Managing MVR Names
MVR names let you register Move packages under human-readable names in the Move Registry (MVR). Each name maps to a SuiNS name and a package name. You manage names by creating applications, attaching packages, and setting metadata. On Mainnet, package attachment is permanent. On other networks, you attach a pointer you can update later.
The TypeScript examples assume that you use the MVR plugin for the Sui TypeScript SDK. The Sui CLI examples do not use the MVR plugin.
How do I create a new MVR application?
To create a new application, you must provide a SuiNS name and a package name, as long as it is not already registered.
The register call returns an AppCap object. You can use the AppCap immediately to attach packages, or transfer it to a safe address and register packages later.
- TypeScript
- Sui CLI
const transaction = new Transaction();
const appCap = transaction.moveCall({
target: `@mvr/core::move_registry::register`,
arguments: [
// the registry obj: Can also be resolved as `registry-obj@mvr` from Mainnet SuiNS.
transaction.object('0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727'),
transaction.object(suinsObjectId),
transaction.pure.string(name),
transaction.object.clock(),
],
});
// You can then use the appCap to attach packages directly, or transfer (for example to a safe address)
// and register packages later.
Example of a PTB after MVR, consistent across networks:
sui client ptb --move-call @mvr/core::move_registry::register \
@0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727 @<suinsObjectId> \
\"<name>\" @0x6 --assign appcap --transfer-objects "[appcap]" @<address-to-transfer-appcap>
How do I set metadata on an MVR application?
Metadata is strongly recommended for any application. Provide the appCap along with a key-value pair. Key can be description, icon_url, documentation_url, homepage_url, or contact.
You can call set_metadata multiple times with different keys to configure all fields. Each call updates a single key-value pair.
- TypeScript
- Sui CLI
const transaction = new Transaction();
transaction.moveCall({
target: `@mvr/core::move_registry::set_metadata`,
arguments: [
// the registry obj: Can also be resolved as `registry-obj@mvr` from Mainnet SuiNS.
transaction.object('0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727'), // Move registry
appCap,
transaction.pure.string("description"), // key
transaction.pure.string("<Description for the application>"), // value
],
});
sui client ptb --move-call @mvr/core::move_registry::set_metadata \
@0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727 \
@<appCap> \"description\" "\"<Description for the application>\""
How do I attach a Mainnet package to an application?
When attaching a Mainnet package to an application, you must provide the PackageInfo object. This call is permanent, so after you attach a PackageInfo object to an application, you cannot detach it in the future. Consequently, an app is always linked to a specific package.
- TypeScript
- Sui CLI
// You can then use the appCap to attach packages directly, or transfer (for example to a safe address)
// and register packages later.
const transaction = new Transaction();
transaction.moveCall({
target: `@mvr/core::move_registry::assign_package`,
arguments: [
// the registry obj: Can also be resolved as `registry-obj@mvr` from Mainnet SuiNS.
transaction.object(`0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727`),
transaction.object('<The AppCap object>'),
transaction.object('<The PackageInfo object on Mainnet>'),
],
});
sui client ptb --move-call @mvr/core::move_registry::assign_package \
@0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727 \
@<The AppCap object> @<The PackageInfo object on Mainnet>
How do I attach a non-Mainnet package to an application?
For non-Mainnet networks, you only attach a pointer to the package, instead of strict binding (which would not be possible). You identify the target network by its chain ID, for example 4c78adac for Testnet. You identify the target network by its chain ID, for example 4c78adac for Testnet.
You can always update an external network by first calling @mvr/core::move_registry::unset_network, and then calling @mvr/core::move_registry::set_network again.
The set_network call requires a chain ID string. Use 4c78adac for Testnet. The app_info::new call accepts three optional fields: the PackageInfo object ID on the external network, the package address on the external network, and a third optional field you can set to null.
- TypeScript
- Sui CLI
const transaction = new Transaction();
const appInfo = transaction.moveCall({
target: `@mvr/core::app_info::new`,
arguments: [
transaction.pure.option("address", '<The objectId of the `PackageInfo` object on the external network>'),
transaction.pure.option("address", '<The address of the package on the external network>'),
transaction.pure.option("address", null),
],
});
transaction.moveCall({
target: `@mvr/core::move_registry::set_network`,
arguments: [
// the registry obj: Can also be resolved as `registry-obj@mvr` from Mainnet SuiNS.
transaction.object('0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727'),
transaction.object('<The AppCap object>'),
transaction.pure.string("<chain id of the network: use `4c78adac` for Testnet>"),
appInfo,
],
});
sui client ptb \
--move-call 0x1::option::some "<0x2::object::ID>" @<The objectId of the PackageInfo object on the external network> \
--assign packageInfo \
--move-call 0x1::option::some "<address>" @<The address of the package on the external network> \
--assign packageId \
--move-call 0x1::option::none "<0x2::object::ID>" \
--assign null \
--move-call @mvr/core::app_info::new packageInfo packageId null \
--assign appInfo \
--move-call @mvr/core::move_registry::set_network \
@0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727 @<The AppCap object> \
\"<chain id of the network: use 4c78adac for Testnet>\" appInfo
Key concepts
AppCap: The capability object returned when you register an application. You must present the AppCap to attach packages or set metadata. Store it in a safe address or a shared object your team controls.
PackageInfo: An object created alongside a published package on Mainnet. Attaching it to an application creates a permanent, verifiable link between the MVR name and that package.
Network pointer: For non-Mainnet networks, MVR stores a pointer (chain ID plus package address) instead of a strict binding. You can update this pointer at any time using unset_network followed by set_network.
Registry object: The shared Move Registry object at 0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727. All calls pass this object as the first argument. You can also resolve it as registry-obj@mvr from Mainnet SuiNS.