Profile review: 2026-10-10. Latest website retrieval: 2026-10-10T04:40:25.140Z. Retrieval result: issuer-homepage-shell; substantive-docs-retrieved. A successful retrieval does not validate a project’s claims.
https://raw.githubusercontent.com/MystenLabs/suins-contracts/main/scripts/config/constants.ts
// Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 import { normalizeSuiAddress } from '@mysten/sui/utils'; export type Network = 'mainnet' | 'testnet'; export type Config = Record ; export type DiscordConfig = { packageId: string; discordCap: string; discordObjectId: string; discordTableId: string; }; export type PackageInfo = { packageId: string; packageIdV1: string; packageIdPricing: string; upgradeCap?: string; publisherId: string; adminAddress: string; previousAdminAddress?: string; adminCap: string; suins: string; displayObject?: string; discountsPackage: { packageId: string; discountHouseId: string; }; subNamesPackageId: string; tempSubdomainsProxyPackageId: string; discord: DiscordConfig | undefined; coupons: { packageId: string; upgradeCap?: string; }; treasuryAddress?: string; payments: { packageId: string; upgradeCap: string; }; bbb: { packageId: string; upgradeCap: string; }; pyth: { pythStateId: string; wormholeStateId: string; }; coins: { [key: string]: { type: string; metadataId: string; feed: string; }; }; registryTableId: string; }; export const mainPackage: Config = { mainnet: { packageId: '0x71af035413ed499710980ed8adb010bbf2cc5cacf4ab37c7710a4bb87eb58ba5', packageIdV1: '0xd22b24490e0bae52676651b4f56660a5ff8022a2576e0089f79b3c88d44e08f0', packageIdPricing: '0x71af035413ed499710980ed8adb010bbf2cc5cacf4ab37c7710a4bb87eb58ba5', upgradeCap: '0x9cda28244a0d0de294d2b271e772a9c33eb47d316c59913d7369b545b4af098c', publisherId: '0x7339f23f06df3601167d67a31752781d307136fd18304c48c928778e752caae1', adminAddress: normalizeSuiAddress( '0x9b388a6da9dd4f73e0b13abc6100f1141782ef105f6f5e9d986fb6e00f0b2591', ), previousAdminAddress: '0xa81a2328b7bbf70ab196d6aca400b5b0721dec7615bf272d95e0b0df04517e72', adminCap: '0x3f8d702d90c572b60ac692fb5074f7a7ac350b80d9c59eab4f6b7692786cae0a', suins: '0x6e0ddefc0ad98889c04bab9639e512c21766c5e6366f89e696956d9be6952871', displayObject: '0x866fbd8e51b6637c25f0e811ece9a85eb417f3987ecdfefb80f15d1192d72b4c', discountsPackage: { packageId: '0x03f625d805339b1b0235ba8c503fa6ea62c88c02ddf14cd9d246d9e1febc0c76', discountHouseId: '0x4ce82dee11e6f4858509dcdba1a62985f12e5afb054df680a04f16790bfe1d04', }, subNamesPacka
Open source ↗https://docs.suins.io/dao.md
> For the complete documentation index, see [llms.txt](https://docs.suins.io/llms.txt) The Sui Name Service DAO (SuiNS DAO) aims to provide a fair, transparent, and effective governance structure. The following process governs the rules and procedures by which members of the DAO may propose, vote and implement improvement proposals. These proposals usually go through cycles of refinement and consensus, with the purpose of facilitating increasing community engagement in connection with each iteration. Thus, this process is designed to ensure that all decisions reflect the collective will of the community, maintain the integrity of the protocol, and foster sustainable development. > **Info** > > Read the [SuiNS DAO Constitution](https://vote.suins.io/proposal/0xd4c794821436f03f1dc8321f4939c17d67c54aa6661a7b8dee12b3d179601001) on vote.suins.io. ## Article I – Proposal submission 1. **Eligibility:** SuiNS Foundation and Members will both eventually have the ability to introduce and submit proposals for consideration and pass proposals with sufficient DAO support as outlined below. 1. **Proposal Requirements:** Proposals should include a clear and concise description of the issue, potential or definitive solutions, and the desired outcome. Supporting documents and evidence should be attached where relevant. Proposals should clearly state which category the proposal fits within as well as the implementation timeline and any other pertinent details. 1. **Proposal Categories:** Proposals should be classified into one of four main categories: - **Technical Proposals**, including changes to the protocol or technical aspects of the SuiNS system. These types of proposals will have to include definitive code changes/updates. - **Parameter Proposals**, including those that would change parameters in the contract but not the essence of the code. For example pricing, expirations, temporary discounts, etc. - **Financial Proposals**, including allocation of revenue, community-designated NS tokens, and budget approvals. - **Governance Proposals**, including changes to the governance structure, rules, or constitution amendments. ## Article II – Voting process 1. **Quorum Requiremen
Open source ↗https://docs.suins.io/developer/sdk.md
> For the complete documentation index, see [llms.txt](https://docs.suins.io/llms.txt) Use the SuiNS SDK to interact with the Sui Name Service. Query SuiNS data in a usable way and build transactions that interact with service names. ## Installation To use with the latest version of the TypeScript SDK, install using: ```bash npm2yarn $ npm i @mysten/suins ``` To use with the older version (prior to 1.x) of the TypeScript SDK (0.54.1), install using: ```bash npm2yarn $ npm i @mysten/suins@0.0.3 ``` ## `SuinsClient` `SuinsClient` is the base for all SuiNS functionality. > **Info** > > You should keep only one instance of `SuinsClient` throughout your dApp, API, or script. For example, in React, you should use a context to provide the client. ## Initialize a `SuinsClient` > **Caution** > > Always keep the dependency updated so you get the latest constants. If you do not, some of your transactions might fail to build. You can initialize a `SuinsClient` by either providing the active network (`mainnet` or `testnet`), or by passing in the constants (usable for any network). ```js import { SuinsClient } from '@mysten/suins'; import { getFullnodeUrl, SuiClient } from '@mysten/sui/client'; // You need a Sui client. You can re-use the Sui client of your project // (it's not recommended to create a new one). const client = new SuiClient({ url: getFullnodeUrl('testnet') }); // Now you can use it to create a SuiNS client. const suinsClient = new SuinsClient({ client, network: 'testnet', }); ``` ```js import { SuinsClient } from '@mysten/suins'; import { getFullnodeUrl, SuiClient } from '@mysten/sui/client'; // You need a Sui client. You can re-use the Sui client of your project // (it's not recommended to create a new one). const client = new SuiClient({ url: getFullnodeUrl('testnet') }); // Now you can use it to create a SuiNS client. const suinsClient = new SuinsClient({ client, // This example is the Mainnet configuration. packageIds: { suinsPackageId: { latest: '0xb7004c7914308557f7afbaf0dca8dd258e18e306cb7a45b28019f3d0a693f162', v1: '0xd22b24490e0bae52676651b4f56660a5ff8022a2576e0089f79b3c88d44e08f0', }, suinsObjectId: '0x6e0ddefc0ad98889c04bab9639e512c21766c5e6366f89e6
Open source ↗https://docs.suins.io/move-registry/maintainer-practices.md
> For the complete documentation index, see [llms.txt](https://docs.suins.io/llms.txt) For package authors and maintainers, the following best practices are recommended for working with the Move Registry. Following these tips ensures that other builders can use your package as intended. ## Automated Address Management {#automated-address-management} - Whenever you publish or upgrade a package, use the Sui Automated Address Management feature. - After properly configuring your Automated Address Management, commit and [tag](#tagging) your changes to your git repository. For more information, see [Automated Address Management](https://docs.sui.io/concepts/sui-move-concepts/packages/automated-address-management) in the Sui documentation. ## Sui dependency Switch your `Sui` dependency to the correct network you are publishing or upgrading against (for example, `framework/testnet` for Testnet, `framework/mainnet` for Mainnet). > Starting from Sui v1.45, you should remove the Sui framework and all other system dependencies from your Move.toml file, as they are now automatically added and managed when used. ## Tagging {#tagging} Proper use of tags or commit SHAs helps code maintenance. - Tag your releases with ` / ` (for example, `mainnet/v1`). Make sure the commit you push after configuring [Automated Address Management](#automated-address-management) is also tagged, or is part of your `main` branch. - After applying a release tag, use the commit SHA or the tag to update the source code origin in the `PackageInfo` object. ## Name your package In a multi-package repository, it is common to use generic names for packages, such as `utils` or `math`. However, this can cause confusion when others try to use your packages or when your packages depend on similarly named ones. To avoid this, prefix your package names with the project name. For example, instead of running: ``` sui move new utils ``` You should instead run: ``` sui move new mvr_utils ``` This makes it clear which packages belong to your project, improving organization and usability for others.
Open source ↗https://docs.suins.io/developer/sdk/transactions.md
> For the complete documentation index, see [llms.txt](https://docs.suins.io/llms.txt) `SuinsTransaction` is the client you use similar to `Transaction`, and helps in building a transaction. You need to instantiate it once in every programmable transaction block (PTB) that you are building. ## Available functions This is a list of all the available PTB commands supported through the SDK. ### Register a name ```js const register = async (name: string, years: number) => { // Create a transaction block as usual in your PTBs. const transaction = new Transaction(); // Pass in the transaction block & the app's global SuinsClient. const suinsTransaction = new SuinsTransaction(suinsClient, transaction); // Specify the coin type used for the transaction, can be SUI/NS/USDC const coinConfig = suinsClient.config.coins.USDC; // priceInfoObjectId is required for SUI/NS const priceInfoObjectId = (await suinsClient.getPriceInfoObject(tx, coinConfig.feed))[0]; // Build the transaction to register the name, specifying a year from 1 to 5. const nft = suinsTx.register({ domain: 'myname.sui', years: 3, coinConfig, coin, priceInfoObjectId, // Only required for SUI/NS }); // Transfer the name's NFT transaction.transferObjects([nft], transaction.pure.address('0xMyAddress')); // ... sign and execute the transaction } ``` ### Renew a name ```js const renew = async (nftId: string, name: string, years: number) => { // Create a transaction block as usual in your PTBs. const transaction = new Transaction(); // Pass in the transaction block & the app's global SuinsClient. const suinsTransaction = new SuinsTransaction(suinsClient, transaction); // Specify the coin type used for the transaction, can be SUI/NS/USDC const coinConfig = suinsClient.config.coins.USDC; // priceInfoObjectId is required for SUI/NS const priceInfoObjectId = (await suinsClient.getPriceInfoObject(tx, coinConfig.feed))[0]; // Build the transaction to renew the name, specifying a year from 1 to 5. suinsTx.renew({ nft: '0xMyNftObject', years: 3, coinConfig, coin, priceInfoObjectId, // Only required for SUI/NS }); // ... sign and execute the transaction } ``` ### Set a name's target address This works the same for names and
Open source ↗https://docs.suins.io/developer/sdk/querying.md
> For the complete documentation index, see [llms.txt](https://docs.suins.io/llms.txt) Use the `SuinsClient` that you previously created to query onchain data. ## Query a name record You can query a name record's latest state by calling the `getNameRecord` method on the `SuinsClient` instance. ```js const nameRecord = await suinsClient.getNameRecord('demo.sui'); console.log(nameRecord); // Example output // { // name: 'demo.sui', // nftId: '0xMyNftId', // targetAddress: '0xTargetAddress', // expirationTimestampMs: '1746018571863', // data: { // avatar: '0xAvatarObjectId', // contentHash: 'content', // walrusSiteId: '0xWalrusSiteId', // }, // avatar: '0xAvatarObjectId', // contentHash: 'content', // walrusSiteId: '0xWalrusSiteId', // } ``` ## Query active pricing Call the `getPriceList` method on the `SuinsClient` instance to query the active names price list. ```js const priceList = await suinsClient.getPriceList(); console.log(priceList); // ([domain_length_from, domain_length_to]: price. Prices are in USDC MIST; 1 USDC = 1_000_000 MIST) // Example output: // { // [ 3, 3 ] => 500000000, // [ 4, 4 ] => 100000000, // [ 5, 63 ] => 20000000 // } ``` ## Query active renewal pricing Call the `getRenewalPricelist` method on the `SuinsClient` instance to query the active renewal price list. ```js const renewalPriceList = await suinsClient.getRenewalPricelist(); console.log(renewalPriceList); // ([domain_length_from, domain_length_to]: price. Prices are in USDC MIST; 1 USDC = 1_000_000 MIST) // Example output: // { // [ 3, 3 ] => 500000000, // [ 4, 4 ] => 100000000, // [ 5, 63 ] => 20000000 // } ```
Open source ↗https://docs.suins.io/move-registry.md
> For the complete documentation index, see [llms.txt](https://docs.suins.io/llms.txt) Move Registry (MVR, pronounced mover) provides a uniform naming service for interacting and building with packages from the Sui ecosystem. This means that you can reference packages by their names, and MVR resolves the package address for you, despite the network. You can access the front end of the Move Registry online at https://www.moveregistry.com/apps. Use MVR to: - Reference both packages and types by name in programmable transaction blocks (PTBs). - Depend on other packages when developing with Move. Additionally, MVR can help you manage package versioning. With MVR, you call a specific version of a package without having to resolve the addresses yourself. You also do not need to worry about the package being updated, because if you use a name without a specified version, MVR automatically defaults to the latest version available. > **Info** > > MVR default service currently supports Mainnet and Testnet networks. ## Design - `PackageInfo` registration: Exists independently on each network. - MVR registration: A single source of truth located on Mainnet. The following diagram shows the MVR design at a high level.  ## `PackageInfo` objects The first step when publishing a package is to register its metadata object. This metadata object serves as a key source of information for: 1. Locating the source code across different versions of the package. 2. (Future) Providing text-based metadata (title, description, tags) for the package, which the MVR search engine can use. This metadata object can be reused when authorizing any package upgrades to supply source information for the new version. Sui indexers can index the metadata as it cannot be stored within another object.  See [Managing Package Metadata](./move-registry/managing-package-info.mdx) for examples of working with `PackageInfo` objects. ## MVR name A MVR name consists of a SuiNS name and a package name, in the format ` / `. For example, if your SuiNS name is `myname.sui`, and your package name is `mypackage`, the MVR
Open source ↗https://docs.suins.io/developer/sdk/subnames.md
> For the complete documentation index, see [llms.txt](https://docs.suins.io/llms.txt) This page covers all subname-related PTB commands available through the SDK. For name registration, renewal, and other operations, see [Building Transactions](/developer/sdk/transactions). ### Create a subname ```js const createSubname = async (subName: string, parentNftId: string, expirationMs: number) => { // Create a transaction block as usual in your PTBs. const transaction = new Transaction(); // Pass in the transaction block & the app's global SuinsClient. const suinsTransaction = new SuinsTransaction(suinsClient, transaction); // We build the transaction to create a subname. const subNameNft = suinsTransaction.createSubName({ // The NFT of the parent parentNft: parentNftId, // The subname to be created. name: subName, // The expiration timestamp needs to be less than or equal to the parent's expiration. expirationTimestampMs: expirationMs, // Whether the subname can create more nested subnames. // E.g. more.inner.sui could create even.more.inner.sui allowChildCreation: true, // Whether the subname can manually extend the expiration time to // the expiration time of the parent name. Can be tweaked after creation too. allowTimeExtension: true, }); // Transfer the NFT transaction.transferObjects([subNameNft], transaction.pure.address('0xMyAddress')); // ... sign and execute the transaction } ``` ### Edit subname setup Allows the parent holder to edit the setup (allow child creation and allow time extension) for a subname. ```js const editSetup = async (name: stringify, parentNftId: string, allowChildCreation: boolean, allowTimeExtension: boolean) => { // Create a transaction block as usual in your PTBs. const transaction = new Transaction(); // Pass in the transaction block & the app's global SuinsClient. const suinsTransaction = new SuinsTransaction(suinsClient, transaction); // We build the transaction to edit the setup of a subname. suinsTransaction.editSetup({ name, parentNft: parentNftId, allowChildCreation, allowTimeExtension, }); // ... sign and execute the transaction } ``` ### Extend a subname's expiration This functionality is available only if the parent allows
Open source ↗https://docs.suins.io/move-registry/mvr-names.md
> For the complete documentation index, see [llms.txt](https://docs.suins.io/llms.txt) > **Caution** > > The TypeScript examples assume that you use the [MVR plugin](/move-registry/tooling/typescript-sdk) for the Sui TypeScript SDK. The Sui CLI examples do not use the MVR plugin. ## Create a new application To create a new application, you must provide a SuiNS name and a package name, as long as it is not already registered. ```typescript 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(), ], }); // we can then use the appCap to attach packages directly, or transfer (e.g. to a safe address) // and register packages later. ``` Example of a PTB after MVR, consistent across networks: ```bash sui client ptb --move-call @mvr/core::move_registry::register \ @0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727 @ \ \" \" @0x6 --assign appcap --transfer-objects "[appcap]" @ ``` ## Set application metadata 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`. ```typescript 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(" "), // value ], }); ``` ```bash sui client ptb --move-call @mvr/core::move_registry::set_metadata \ @0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727 \ @ \"description\" "\" \"" ``` ## Attach a Mainnet package to an application When attaching a Mainnet package to an application, you must provide the
Open source ↗https://docs.suins.io/move-registry/managing-package-info.md
> For the complete documentation index, see [llms.txt](https://docs.suins.io/llms.txt) > **Caution** > > The TypeScript examples assume that you use the [MVR plugin](/move-registry/tooling/typescript-sdk) for the Sui TypeScript SDK. The Sui CLI examples do not use the MVR plugin. ## Create a new `PackageInfo` object You should create a `PackageInfo` object for your package when you first deploy it, once for each network. You can then treat the object as the source of truth for metadata of your package. The following example works for both Mainnet and Testnet. ```typescript const transaction = new Transaction(); // ... (other code, could also include a `transaction.publish()` // call to publish & register in one step.) /// We pass in our UpgradeCap const packageInfo = transaction.moveCall({ target: `@mvr/metadata::package_info::new`, arguments: [transaction.object(' ')], }); // We also need to create the visual representation of our "info" object. // You can also call `@mvr/metadata::display::new` instead, // that allows customizing the colors of your metadata object! const display = transaction.moveCall({ target: `@mvr/metadata::display::default`, arguments: [ transaction.pure.string(' ') // Example: core ], }); // Set that display object to our info object. transaction.moveCall({ target: `@mvr/metadata::package_info::set_display`, arguments: [transaction.object(packageInfo), display], }); // Set the default for the packageInfo, which enables reverse resolution for that network // See details in reverse resolution section transaction.moveCall({ target: "@mvr/metadata::package_info::set_metadata", arguments: [ transaction.object(packageInfo), transaction.pure.string("default"), transaction.pure.string(" "), // Example: @suins/core or suins.sui/core ], }); // Optionally unset the metadata for the packageInfo // transaction.moveCall({ // target: "@mvr/metadata::package_info::unset_metadata", // arguments: [ // transaction.object(packageInfo), // transaction.pure.string("default"), // ], // }); // transfer the `PackageInfo` object to a safe address. transaction.moveCall({ target: `@mvr/metadata::package_info::transfer`, arguments: [transaction.object(packageInfo), t
Open source ↗https://docs.suins.io/move-registry/tooling/typescript-sdk.md
> For the complete documentation index, see [llms.txt](https://docs.suins.io/llms.txt) The Move Registry (MVR, pronounced mover) Sui TypeScript SDK plugin offers builders a seamless experience when constructing programmable transaction blocks (PTBs) using MVR names. The plugin resolves MVR names to their respective addresses before constructing the PTB, caching the results during each runtime. This also applies to type names, especially across package upgrades. ## Recommended usage The MVR plugin uses a runtime API to resolve named packages and types. While this is beneficial to the user experience, it naturally comes with considerations around performance, availability, and security. For this reason, consider using the `@mysten/mvr-static` plugin, which statically resolves all the package addresses and types during the build. The plugin caches your MVR references and exports them to a resolution file. This approach offers a couple of benefits: - Enhanced user experience of leveraging MVR in your PTBs for names and types, for both Mainnet and Testnet. - Performance (no extra calls to the MVR endpoint) and security of statically resolving MVR references at build time. Check the NPM page for the [`@mysten/mvr-static` plugin](https://www.npmjs.com/package/@mysten/mvr-static?activeTab=readme) to learn more. ## How to use > **Info** > > The plugin is functional starting from `@mysten/sui` v1.25.0. The MVR plugin is exported directly from the `@mysten/sui` package. To enable the plugin, register it either globally or per PTB in your dApp. ### Endpoints Mysten Labs provides public good endpoints compatible with the MVR plugin. ``` Mainnet: https://mainnet.mvr.mystenlabs.com Testnet: https://testnet.mvr.mystenlabs.com ``` ### Register the plugin Depending on the architecture of your dApp, you can register the plugin either globally or per PTB. ```typescript /** Register the MVR plugin globally */ import { namedPackagesPlugin, Transaction } from "@mysten/sui/transactions"; const plugin = namedPackagesPlugin({ url: ' ' }); /** Register the MVR plugin globally (once) for our PTB construction */ Transaction.registerGlobalSerializationPlugin('namedPackagesPlugin', plugin); `
Open source ↗https://docs.suins.io/move-registry/tooling/mvr-cli.md
> For the complete documentation index, see [llms.txt](https://docs.suins.io/llms.txt) Use the MVR CLI to manage your package dependencies and to interact with the Move Registry (MVR). The MVR CLI is a command line tool that enables: - Adding dependencies to your Move project. - Building your Move project with MVR dependencies. ## Installation There are several ways to install the MVR CLI tool. ### Cargo Use the following command to install using Cargo: ```sh cargo install --locked --git https://github.com/mystenlabs/mvr --branch release mvr ``` ### From binaries Download the correct binary file for your OS and architecture from the [MVR GitHub release page](https://github.com/MystenLabs/mvr/releases/latest). After downloading the file, rename the binary to `mvr` and add its location to your system `PATH` variable. 1. Open your `.zshrc` file. This file is typically located at `~/.zshrc` in macOS. If it does not exist, create it. ```sh $ nano ~/.zshrc ``` 1. Update or add the following `export PATH` command. Be sure to change `/path/to/your/folder` to match your folder path. Separate all paths using a colon, if necessary. ```sh export PATH="/path/to/your/folder:$PATH" ``` 1. Save the file and use the `source` command to apply changes. ```sh $ source ~/.zshrc ``` 1. Open your `.bashrc` file (or `.bash_profile` on macOS). This file is typically located at `~/.bashrc` in macOS. If it does not exist, create it. ```sh $ nano ~/.bashrc ``` 1. Update or add the following `export PATH` command. Be sure to change `/path/to/your/folder` to match your folder path. Separate all paths using a colon, if necessary. ```sh export PATH="/path/to/your/folder:$PATH" ``` 1. Save the file and use the `source` command to apply changes. ```sh $ source ~/.bashrc ``` 1. Open your fish configuration file. ```sh $ nano ~/.config/fish/config.fish ``` 1. Add the following command to the configuration. Be sure to change `/path/to/your/folder` to match your folder path. ```sh set -Ux fish_user_paths /path/to/your/folder $fish_user_paths ``` 1. Save the file. 1. In Search, search for and then select: **System (Control Panel)**. 1. Click the **Advanced system settings** link. 1. Click **Environme
Open source ↗https://docs.suins.io/move-registry/tooling/typescript-sdk
Transaction Plugin for Sui TypeScript SDK | Sui Documentation Skip to main content Move Registry (MVR) Transaction Plugin for Sui TypeScript SDK On this page Transaction Plugin for Sui TypeScript SDK The Move Registry (MVR, pronounced mover) Sui TypeScript SDK plugin offers builders a seamless experience when constructing programmable transaction blocks ( PTBs ) using MVR names. The plugin resolves MVR names to their respective addresses before constructing the PTB , caching the results during each runtime. This also applies to type names, especially across package upgrades. Recommended usage The MVR plugin uses a runtime API to resolve named packages and types. While this is beneficial to the user experience, it naturally comes with considerations around performance, availability, and security. For this reason, consider using the @mysten/mvr-static plugin, which statically resolves all the package addresses and types during the build. The plugin caches your MVR references and exports them to a resolution file. This approach offers a couple of benefits: Enhanced user experience of leveraging MVR in your PTBs for names and types, for both Mainnet and Testnet . Performance (no extra calls to the MVR endpoint) and security of statically resolving MVR references at build time. Check the NPM page for the @mysten/mvr-static plugin to learn more. How to use info The plugin is functional starting from @mysten/sui v1.25.0. The MVR plugin is exported directly from the @mysten/sui package . To enable the plugin, register it either globally or per PTB in your app. Endpoints Mysten Labs provides public good endpoints compatible with the MVR plugin. Mainnet: https://mainnet.mvr.mystenlabs.com Testnet: https://testnet.mvr.mystenlabs.com Register the plugin Depending on the architecture of your app, you can register the plugin either globally or per PTB . /** Register the MVR plugin globally */ import { namedPackagesPlugin , Transaction } from "@mysten/sui/transactions" ; const plugin = namedPackagesPlugin ( { url : '<endpoint based on network>' } ) ; /** Register the MVR plugin globally (once) for our PTB construction */ Transaction . register
Open source ↗https://docs.suins.io/developer/sdk/subnames
Subname Transactions | Sui Documentation Skip to main content SuiNS SDK Subname Transactions On this page Subname Transactions caution The examples on this page use SuinsClient . @mysten/suins 2.0 still exports it, but the suins() client extension is the preferred pattern. The SuinsTransaction commands themselves are unchanged, but the client you pass them is constructed differently. See Migrating @mysten/suins . The following subname-related PTB commands are available through the SDK. For name registration, renewal, and other operations, see Building Transactions . Create a subname const createSubname = async ( subName : string , parentNftId : string , expirationMs : number ) => { // Create a transaction block as usual in your PTBs. const transaction = new Transaction ( ) ; // Pass in the transaction block & the app's global SuinsClient. const suinsTransaction = new SuinsTransaction ( suinsClient , transaction ) ; // We build the transaction to create a subname. const subNameNft = suinsTransaction . createSubName ( { // The NFT of the parent parentNft : parentNftId , // The subname to be created. name : subName , // The expiration timestamp needs to be less than or equal to the parent's expiration. expirationTimestampMs : expirationMs , // Whether the subname can create more nested subnames. // E.g. more.inner.sui could create even.more.inner.sui allowChildCreation : true , // Whether the subname can manually extend the expiration time to // the expiration time of the parent name. Can be tweaked after creation too. allowTimeExtension : true , } ) ; // Transfer the NFT transaction . transferObjects ( [ subNameNft ] , transaction . pure . address ( '0xMyAddress' ) ) ; // ... sign and execute the transaction } Edit subname setup Allows the parent holder to edit the setup (allow child creation and allow time extension) for a subname. const editSetup = async ( name : string , parentNftId : string , allowChildCreation : boolean , allowTimeExtension : boolean ) => { // Create a transaction block as usual in your PTBs. const transaction = new Transaction ( ) ; // Pass in the transaction block & the app's global SuinsClient. co
Open source ↗https://docs.suins.io/developer/sdk/transactions
Building Transactions | Sui Documentation Skip to main content SuiNS SDK Building Transactions On this page Building Transactions caution The examples on this page use SuinsClient . @mysten/suins 2.0 still exports it, but the suins() client extension is the preferred pattern. The SuinsTransaction commands themselves are unchanged, but the client you pass them is constructed differently. See Migrating @mysten/suins . SuinsTransaction is the client you use similar to Transaction , and helps in building a transaction . You need to instantiate it once in every programmable transaction block ( PTB ) that you are building. Pyth price feeds SuiNS names are priced in USDC. Paying in SUI or NS needs a live exchange rate, which the contracts read from the Pyth oracle, so those transactions must include a price info object . Pyth serves its price updates from Hermes, which requires an access token. Create a free Pyth account and copy the key from View your API key . Keep it out of browser code, so the fetch always happens on a server. You can get a price info object into your transaction in two ways. Fetch and build on a server Initialize the SuinsClient with the token and call getPriceInfoObject . It fetches the update and adds the update calls to the transaction you pass it, so this approach builds the whole PTB server-side. const suinsClient = new SuinsClient ( { client , network : 'testnet' , pythAccessToken : process . env . PYTH_ACCESS_TOKEN , } ) ; const priceInfoObjectId = ( await suinsClient . getPriceInfoObject ( transaction , coinConfig . feed ) ) [ 0 ] ; Fetch on a server, build on the client To keep building the PTB in the browser, split the work across @pythnetwork/pyth-sui-js . Fetch the update bytes on your backend: const connection = new SuiPriceServiceConnection ( 'https://pyth.dourolabs.app/hermes' , { accessToken : process . env . PYTH_ACCESS_TOKEN , } ) ; const updates = await connection . getPriceFeedsUpdateData ( [ coinConfig . feed ] ) ; Then add the update to the transaction on the client: const pythClient = new SuiPythClient ( suinsClient . client , suinsClient . config . pyth . pythStateId , suinsClient . config . pyth .
Open source ↗https://raw.githubusercontent.com/MystenLabs/suins-contracts/main/packages/token/sources/ns.move
/// This allows us to create a new token and mint the total tokens to the publisher. /// This also wraps the `TreasuryCap` /// /// After publishing this, we will burn the `UpgradeCap`. /// This will validate that the supply of minted NS cannot change. module suins_token::ns; use sui::{coin::{Self, Coin, TreasuryCap}, dynamic_object_field as dof, url}; const TOTAL_SUPPLY_TO_MINT: u64 = 500_000_000 * 1_000_000; const DECIMALS: u8 = 6; const SYMBOL: vector = b"NS"; const NAME: vector = b"SuiNS Token"; const DESCRIPTION: vector = b"The native token for the SuiNS Protocol."; const ICON_URL: vector = b"https://token-image.suins.io/icon.svg"; /// The OTW for our token. public struct NS has drop {} public struct ProtectedTreasury has key { id: UID, } /// The dynamic object field key for the `TreasuryCap`. /// That allows us to easily look-up the `TreasuryCap` from the `ProtectedTreasury` off-chain. public struct TreasuryCapKey has copy, drop, store {} #[allow(unused_function, lint(share_owned))] fun init(otw: NS, ctx: &mut TxContext) { let (protected_treasury, coin) = create_coin(otw, TOTAL_SUPPLY_TO_MINT, ctx); transfer::share_object(protected_treasury); transfer::public_transfer(coin, ctx.sender()); } /// Get the total supply of the NS token. public fun total_supply(treasury: &ProtectedTreasury): u64 { treasury.borrow_cap().total_supply() } /// Borrows the `TreasuryCap` from the `ProtectedTreasury`. fun borrow_cap(treasury: &ProtectedTreasury): &TreasuryCap { dof::borrow(&treasury.id, TreasuryCapKey {}) } #[allow(lint(share_owned))] /// Internal function to serve both the `init` case and /// the `init_for_testing` case. fun create_coin(otw: NS, amount: u64, ctx: &mut TxContext): (ProtectedTreasury, Coin ) { let (mut cap, metadata) = coin::create_currency( otw, DECIMALS, SYMBOL, NAME, DESCRIPTION, option::some(url::new_unsafe_from_bytes(ICON_URL)), ctx, ); let minted_coin = cap.mint(amount, ctx); transfer::public_freeze_object(metadata); // Wrap the `TreasuryCap` and share it. let mut protected_treasury = ProtectedTreasury { id: object::new(ctx), }; dof::add(&mut protected_treasury.id, TreasuryCapKey {}, cap); (protected_treasury, minted_coin) } #[test_only] public fun
Open source ↗https://raw.githubusercontent.com/MystenLabs/suins-contracts/main/packages/token/Move.lock
# @generated by Move, please check-in and do not edit manually. [move] version = 3 manifest_digest = "DBD324CF7FBAAAEE6DD03938D130725824FCC7F277BC861C11A25E6BC545B2D3" deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ { id = "Sui", name = "Sui" }, ] [[move.package]] id = "MoveStdlib" source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/mainnet", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "Sui" source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/mainnet", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, ] [move.toolchain-version] compiler-version = "1.58.2" edition = "2024.beta" flavor = "sui" [env] [env.mainnet] chain-id = "35834a8a" original-published-id = "0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178" latest-published-id = "0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178" published-version = "1" [env.testnet] chain-id = "4c78adac" original-published-id = "0x6ede641ff84612e771bdd17660e5c968203c6206c863541bea13ea02cc1316b9" latest-published-id = "0x6ede641ff84612e771bdd17660e5c968203c6206c863541bea13ea02cc1316b9" published-version = "1"
Open source ↗SuiNS · workflow, token role and risks
SuiNS: A Sui user obtains a .sui name, links addresses and manages subnames. Developers use SDK transactions/resolution. Move Registry separately maps human-readable package names and versions for application distribution. User workflow: A Sui user obtains a .sui name, links addresses and manages subnames. Developers use SDK transactions/resolution. Move Registry separately maps human-readable package names and versions for application distribution. Token role: NS is issuer-named in mainnet configuration. It participates in financial/governance proposals without an unconditional payout. Name NFT rights, package resolution and governance differ. Legal veto and emergency authority constrain what token voting can execute. Risks needing checking: Establish current emergency-window end and council/foundation approval paths. Reconcile governance stake with actual treasury/upgrade capabilities. Measure paid renewals separately from registry use and inspect name expiry. Collect an independently reconciled recent usage/fee period, excluding internal transfers, incentives and customer principal. This is an analytical interpretation of the linked materials, not an executed transaction or completed contract/holder investigation.
Open source ↗ArcReply · review scope
Utility assessment: Not assessed. This is a protocol overview from public sources. No token utility score, contract audit or holder investigation has been completed.
Open source ↗