### Start Local Development Server Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/site/README.md Starts a local development server for live previewing changes. The server opens automatically in a browser. ```bash yarn start ``` -------------------------------- ### Install Discounts Package with Move Registry CLI Source: https://github.com/mystenlabs/suins-contracts/blob/main/packages/discounts/README.md Install the discounts package for the testnet or mainnet using the Move Registry CLI. ```bash mvr add @suins/discounts --network testnet # or for mainnet mvr add @suins/discounts --network mainnet ``` -------------------------------- ### Install MVR CLI from Source Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/tooling/mvr-cli.mdx Installs the MVR CLI by cloning the repository and using Cargo to build and install from the local source. This method is useful for development or when the latest unreleased changes are needed. ```sh git clone https://github.com/mystenlabs/mvr.git ``` ```sh cd mvr/mvr-cli && ``` ```sh cargo install --path . ``` -------------------------------- ### Install Denylist Package with Move Registry CLI Source: https://github.com/mystenlabs/suins-contracts/blob/main/packages/denylist/README.md Install the denylist package using the Move Registry CLI for either the testnet or mainnet. ```bash mvr add @suins/deny-list --network testnet ``` ```bash mvr add @suins/deny-list --network mainnet ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/site/README.md Installs the necessary dependencies for the project using Yarn. ```bash yarn ``` -------------------------------- ### Install Payments Package with Move Registry CLI Source: https://github.com/mystenlabs/suins-contracts/blob/main/packages/payments/README.md Installs the payments package using the Move Registry CLI for either the testnet or mainnet. ```bash mvr add @suins/payments --network testnet ``` ```bash mvr add @suins/payments --network mainnet ``` -------------------------------- ### Install Coupons Package with Move Registry CLI Source: https://github.com/mystenlabs/suins-contracts/blob/main/packages/coupons/README.md Install the coupons package using the Move Registry CLI for either the testnet or mainnet. ```bash mvr add @suins/coupons --network testnet # or for mainnet mvr add @suins/coupons --network mainnet ``` -------------------------------- ### Setup SuiNS Locally Source: https://github.com/mystenlabs/suins-contracts/blob/main/scripts/README.md Use this script to set up a local instance of SuiNS. It publishes packages, collects variables into 'published.json', and performs on-chain setup. Choose the network (mainnet, testnet, devnet, localnet) by setting the NETWORK environment variable. ```bash # choose from mainnet, testnet, devnet, localnet export NETWORK=localnet pnpm ts-node init/init.ts ``` -------------------------------- ### Install Subnames Package with Move Registry CLI Source: https://github.com/mystenlabs/suins-contracts/blob/main/packages/subdomains/README.md Installs the subnames package using the Move Registry CLI for either the testnet or mainnet. ```bash mvr add @suins/subnames --network testnet ``` ```bash mvr add @suins/subnames --network mainnet ``` -------------------------------- ### Install Temporary Subnames Proxy with Move Registry CLI Source: https://github.com/mystenlabs/suins-contracts/blob/main/packages/temp_subdomain_proxy/README.md Install the temporary subnames proxy package using the Move Registry CLI for either the testnet or mainnet. ```bash mvr add @suins/temp-subnames-proxy --network testnet ``` ```bash mvr add @suins/temp-subnames-proxy --network mainnet ``` -------------------------------- ### Install MVR CLI using Cargo Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/tooling/mvr-cli.mdx Installs the MVR CLI tool using Cargo, ensuring the latest stable release is used. This is a direct installation method from the official repository. ```sh cargo install --locked --git https://github.com/mystenlabs/mvr --branch release mvr ``` -------------------------------- ### Install SuiNS SDK with @mysten/sui Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/developer/sdk.mdx Install the latest version of the SuiNS SDK using npm. This is for use with the latest TypeScript SDK. ```bash $ npm i @mysten/suins ``` -------------------------------- ### Reverse Resolution API Output Example Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/managing-package-info.mdx Example JSON output from the reverse resolution API, showing the mapping of package IDs to their human-readable MVR names. ```json { "resolution": { "0x00c2f85e07181b90c140b15c5ce27d863f93c4d9159d2a4e7bdaeb40e286d6f5": { "name": "@suins/core" }, "0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809": { "name": "@deepbook/core" } } } ``` -------------------------------- ### Install SuiNS Core Package with Move Registry CLI Source: https://github.com/mystenlabs/suins-contracts/blob/main/packages/suins/README.md Use the Move Registry CLI to add the SuiNS core package to your project for either the testnet or mainnet. ```bash mvr add @suins/core --network testnet # or for mainnet mvr add @suins/core --network mainnet ``` -------------------------------- ### Edit Subname Setup Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/site/static/markdown/developer/sdk/transactions.md Allows the parent holder to edit the setup (allow child creation and allow time extension) for a subname. ```APIDOC ## Edit subname setup ### Description Allows the parent holder to edit the setup (allow child creation and allow time extension) for a subname. ### Method Signature `editSetup(name: string, parentNft: string, allowChildCreation: boolean, allowTimeExtension: boolean)` ### Parameters - **name** (string) - The name of the subname to edit. - **parentNft** (string) - The NFT ID of the parent name. - **allowChildCreation** (boolean) - Whether to allow child creation for this subname. - **allowTimeExtension** (boolean) - Whether to allow time extension for this subname. ``` -------------------------------- ### TypeScript SDK: Equip Accessory (After MVR) Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/tooling/typescript-sdk.mdx Example of building a transaction to equip an accessory using the TypeScript SDK after the Move Value Release (MVR). This demonstrates the use of package names for consistent referencing across networks. ```typescript const transaction = new Transaction(); // Now we can use `@suifrens/core` across all package upgrades for type reference. // And we also have the guarantee to call the latest version of the accessories package. transaction.moveCall({ target: `@suifrens/accessories::accessories::equip`, arguments: [..], typeArguments: [ `@suifrens/core::suifren::SuiFren<@suifrens/core::bullshark::Bullshark>` ] }) ``` -------------------------------- ### TypeScript SDK: Equip Accessory (Before MVR) Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/tooling/typescript-sdk.mdx Example of building a transaction to equip an accessory using the TypeScript SDK before the Move Value Release (MVR). This shows how package IDs were used directly, with variations for testnet and mainnet. ```typescript const transaction = new Transaction(); // testnet // Notice how the suifren type has a V1 outer package id, and a V2 inner type package id, // even if they are part of the same package upgrades. transaction.moveCall({ target: `0xe177697e191327901637f8d2c5ffbbde8b1aaac27ec1024c4b62d1ebd1cd7430::accessories::equip`, arguments: [..], typeArguments: [ `0x80d7de9c4a56194087e0ba0bf59492aa8e6a5ee881606226930827085ddf2332::suifren::SuiFren<0x297d8afb6ede450529d347cf9254caeea2b685c8baef67b084122291ebaefb38::bullshark::Bullshark>` ] }); // mainnet transaction.moveCall({ target: `0x54800ebb4606fd0c03b4554976264373b3374eeb3fd63e7ff69f31cac786ba8c::accessories::equip`, arguments: [..], typeArguments: [ `0xee496a0cc04d06a345982ba6697c90c619020de9e274408c7819f787ff66e1a1::suifren::SuiFren<0x8894fa02fc6f36cbc485ae9145d05f247a78e220814fb8419ab261bd81f08f32::bullshark::Bullshark>` ] }); ``` -------------------------------- ### Install SuiNS SDK with @mysten/sui.js Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/developer/sdk.mdx Install a specific older version of the SuiNS SDK using npm. This is for use with older versions of the TypeScript SDK (prior to 1.x). ```bash $ npm i @mysten/suins@0.0.3 ``` -------------------------------- ### Register, Set Target Address, and Set Default SuiNS Name Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/developer/sdk/transactions.mdx A combined example demonstrating registering a SuiNS name, setting its target address, and configuring it as the default name for an address, all within a single Transaction Block (PTB). This requires specifying coin configuration and price information. ```javascript // Years must be between 1-5. const composedExample = 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.NS; // 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, coinConfig, coinId: '0xMyCoinObject', // Only required for NS/USDC priceInfoObjectId, // Only required for SUI/NS }); // You can now use this NFT, for instance to set its target address. suinsTransaction.setTargetAddress({ nft, address, isSubname: false, }); // And you could also set this name as the default name for `0xMyAddress`. // This is only possible if the address signs and executes the transaction. suinsTransaction.setDefault(name); // Transfer the name's NFT to the address. transaction.transferObjects([nft], transaction.pure.address('0xMyAddress')); // ... sign and execute the transaction } ``` -------------------------------- ### SuiNS Name Resolution in Move Source: https://github.com/mystenlabs/suins-contracts/blob/main/packages/suins/README.md Example of how to import and use the SuiNS package in Move code to perform a domain name lookup and retrieve the target address. ```move module my::awesome_project; use suins::suins::SuiNS; use suins::domain; use suins::name_record::NameRecord; use suins::registry::{Registry, lookup}; use std::string::String; public fun target_address(suins: &mut SuiNS, domain_name: String) { let registry = suins.registry(); let domain = domain::new(domain_name); let name_record = registry.lookup(domain).borrow(); let target_address = name_record.target_address(); ... ``` -------------------------------- ### Bulk Reverse Resolution Query Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/managing-package-info.mdx Query the Move Registry API to get the human-readable names associated with multiple package IDs. This enables identifying and verifying packages on chain. ```bash curl --location 'https://mainnet.mvr.mystenlabs.com/v1/reverse-resolution/bulk' \ --header 'Content-Type: application/json' \ --data '{ "package_ids": [ "0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809", "0x00c2f85e07181b90c140b15c5ce27d863f93c4d9159d2a4e7bdaeb40e286d6f5" ] }' ``` -------------------------------- ### Initialize SuinsClient with Network Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/developer/sdk.mdx Initialize a SuinsClient by providing an active network like 'testnet'. Ensure you reuse an existing SuiClient instance from your project. ```javascript 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', }); ``` -------------------------------- ### Create and Configure PackageInfo with Sui CLI Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/managing-package-info.mdx Use this Sui CLI command to create a new PackageInfo object, set its display and metadata for reverse resolution, and transfer it. Does not use the MVR plugin. ```bash sui client ptb \ --move-call @mvr/metadata::package_info::new @ --assign packageinfo \ --move-call @mvr/metadata::display::default "sample" --assign display \ --move-call @mvr/metadata::package_info::set_display packageinfo display \ --move-call @mvr/metadata::package_info::set_metadata packageinfo "default" "" \ --move-call sui::tx_context::sender --assign sender \ --move-call @mvr/metadata::package_info::transfer packageinfo sender ``` -------------------------------- ### Register a New Application (Sui CLI) Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/site/static/markdown/move-registry/mvr-names.md Use this Sui CLI command to register a new application. This command is consistent across networks and does not use the MVR plugin. ```bash sui client ptb --move-call @mvr/core::move_registry::register \ @0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727 @ \ "" @0x6 --assign appcap --transfer-objects "[appcap]" @ ``` -------------------------------- ### Edit Subname Setup Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/developer/sdk/subnames.mdx Allows the parent holder to edit the setup for a subname, specifically controlling whether it allows child creation and time extension. This function requires the subname and its parent NFT ID. ```javascript 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 } ``` -------------------------------- ### Initialize SuinsClient with Constants Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/developer/sdk.mdx Initialize a SuinsClient using specific package IDs and object IDs for a network, such as Mainnet. It's recommended to keep dependencies updated for transaction compatibility. ```javascript 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: '0x6e0ddefc0ad98889c04bab9639e512c21766c5e6366f89e696956d9be6952871', utilsPackageId: '0xdac22652eb400beb1f5e2126459cae8eedc116b73b8ad60b71e3e8d7fdb317e2', registrationPackageId: '0x9d451fa0139fef8f7c1f0bd5d7e45b7fa9dbb84c2e63c2819c7abd0a7f7d749d', renewalPackageId: '0xd5e5f74126e7934e35991643b0111c3361827fc0564c83fa810668837c6f0b0f', registryTableId: '0xe64cd9db9f829c6cc405d9790bd71567ae07259855f4fba6f02c84f52298c106', } }); ``` -------------------------------- ### Create and Configure PackageInfo with TypeScript SDK Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/managing-package-info.mdx Use this TypeScript snippet to create a new PackageInfo object, set its display and metadata for reverse resolution, and transfer it. Assumes the MVR plugin for the Sui TypeScript SDK. ```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), transaction.pure.address('')], }); // .. you can do any other actions, like setting the source code info, in the same PTB. ``` -------------------------------- ### Create a new package with a project prefix Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/maintainer-practices.mdx When creating a new package within a multi-package repository, prefix the package name with your project name to avoid naming conflicts and improve clarity. This is particularly useful for packages like 'utils' or 'math'. ```bash sui move new mvr_utils ``` -------------------------------- ### Attach Non-Mainnet Package (Sui CLI) Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/mvr-names.mdx This Sui CLI command demonstrates how to attach a non-Mainnet package by constructing a transaction to create app info and set the network in the Move Registry. Replace placeholders with your specific network details. ```bash sui client ptb \ --move-call 0x1::option::some "<0x2::object::ID>" @ \ --assign packageInfo \ --move-call 0x1::option::some "
" @ \ --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 @ \ "" appInfo ``` -------------------------------- ### Register a new application with MVR Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/mvr-names.mdx Use this to create a new application by providing a SuiNS name and a package name. Requires the Move registry object, SuiNS object, the desired name, and the clock object. ```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. ``` -------------------------------- ### Build Static Website Content Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/site/README.md Generates the static content for the website, typically placed in a 'build' directory for hosting. ```bash yarn build ``` -------------------------------- ### Deploy Website Using SSH Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/site/README.md Deploys the website using SSH, often used for pushing to a remote repository like GitHub Pages. ```bash USE_SSH=true yarn deploy ``` -------------------------------- ### Query Active Pricing List Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/developer/sdk/querying.mdx Fetch the active price list for domain names by calling `getPriceList`. Prices are denominated in USDC MIST, where 1 USDC equals 1,000,000 MIST. ```javascript 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 // } ``` -------------------------------- ### Register a new application with MVR using Sui CLI Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/mvr-names.mdx This command registers a new application using the Sui CLI. It requires the Move registry object, SuiNS object ID, the desired name, and an address to transfer the application capability to. ```bash sui client ptb --move-call @mvr/core::move_registry::register \ @0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727 @ \ "" @0x6 --assign appcap --transfer-objects "[appcap]" @ ``` -------------------------------- ### Set application metadata using Sui CLI Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/mvr-names.mdx Set application metadata via the Sui CLI. This command requires the Move registry object, the application capability (AppCap), the metadata key, and the metadata value. Ensure the metadata value is properly quoted. ```bash sui client ptb --move-call @mvr/core::move_registry::set_metadata \ @0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727 \ @ "description" """" ``` -------------------------------- ### Assign a Mainnet package to an application using Sui CLI Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/mvr-names.mdx Assign a Mainnet package to an application via the Sui CLI. This is a permanent operation. It requires the Move registry object, the application capability (AppCap), and the PackageInfo object on mainnet. ```bash sui client ptb --move-call @mvr/core::move_registry::assign_package \ @0x0e5d473a055b6b7d014af557a13ad9075157fdc19b6d51562a18511afd397727 \ @ @ ``` -------------------------------- ### Set application metadata using TypeScript Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/mvr-names.mdx Set metadata for an application using its AppCap. Supports keys like 'description', 'icon_url', 'documentation_url', 'homepage_url', or 'contact'. Requires the Move registry object, the AppCap, the metadata key, and the metadata value. ```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 ], }); ``` -------------------------------- ### Walrus-Specific Components Directory Structure Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/site/src/shared/README.mdx Details the directory structure for components unique to the Walrus documentation. ```plaintext docs/site/src/ ├── components/ │ ├── HomepageFeatures/ │ ├── OperatorsList/ │ ├── PortalsList/ │ ├── PushFeedback/ │ └── Search/ ├── css/ │ ├── cards.module.css │ ├── custom.css │ ├── fontawesome.ts │ ├── fonts.css │ └── sidebar.module.css ├── pages/ ├── plugins/ │ ├── askcookbook/ │ ├── client/ │ ├── index.ts │ └── tailwind-config.js └── scripts/ ├── copy-yaml-files.js └── generate-import-context.js ``` -------------------------------- ### Add MVR dependency to PATH (Fish) Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/tooling/mvr-cli.mdx Configures the Fish shell to include the directory containing the MVR CLI binary in the system's PATH. This allows the `mvr` command to be recognized globally. ```fish set -Ux fish_user_paths /path/to/your/folder $fish_user_paths ``` -------------------------------- ### Build Move Project with MVR Dependencies Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/tooling/mvr-cli.mdx Builds a Move project that includes MVR dependencies. The `sui move build` command automatically integrates with the MVR CLI to resolve and incorporate these dependencies during the build process. ```bash sui move build ``` -------------------------------- ### Register a name Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/site/static/markdown/developer/sdk/transactions.md Registers a new Suins name. This function allows users to register a domain name for a specified number of years, requiring coin configuration and price information. ```APIDOC ## Register a name ### Description Registers a new Suins name (domain) for a specified number of years. This operation requires details about the coin used for payment and the current price information. ### Method Signature ```js const register = async (name: string, years: number) => { ... } ``` ### Parameters #### register options - **domain** (string) - Required - The domain name to register (e.g., 'myname.sui'). - **years** (number) - Required - The number of years to register the domain for (1-5). - **coinConfig** (object) - Required - Configuration for the coin to be used for payment (e.g., `suinsClient.config.coins.USDC`). - **coin** (object) - Required - The coin object to be used for the transaction. - **priceInfoObjectId** (string) - Required - The object ID of the price information, necessary for SUI/NS coin types. ### Example Usage ```js const register = async (name: string, years: number) => { const transaction = new Transaction(); const suinsTransaction = new SuinsTransaction(suinsClient, transaction); const coinConfig = suinsClient.config.coins.USDC; const priceInfoObjectId = (await suinsClient.getPriceInfoObject(tx, coinConfig.feed))[0]; const nft = suinsTx.register({ domain: 'myname.sui', years: 3, coinConfig, coin, priceInfoObjectId, }); transaction.transferObjects([nft], transaction.pure.address('0xMyAddress')); // ... sign and execute the transaction } ``` ``` -------------------------------- ### Shared Components Directory Structure Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/site/src/shared/README.mdx Lists the directory structure for shared components, plugins, and scripts used across Sui Stack documentation sites. ```plaintext ├── components/ │ ├── Cards/ │ ├── ExampleImport/ │ ├── Glossary/ │ ├── ImportContent/ │ ├── RelatedLink/ │ ├── SidebarIframe/ │ ├── Snippet/ │ ├── ThemeToggle/ │ └── UnsafeLink/ ├── css/ │ └── details.css ├── js/ │ ├── convert-release-notes.js │ ├── tabs-md.client.js │ └── utils.js ├── plugins/ │ ├── descriptions/ │ ├── inject-code/ │ ├── plausible/ │ ├── tabs-md-client/ │ │ └── index.mjs │ └── remark-glossary.js ``` -------------------------------- ### MVR Dependency Entry in Move.toml Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/tooling/mvr-cli.mdx Illustrates how the MVR CLI modifies the `Move.toml` file to include a new dependency and its associated network configuration. This is automatically managed by the `mvr add` command. ```toml [dependencies] ...app = { r.mvr = "@mvr/app" } [r.mvr] network = "mainnet" ``` -------------------------------- ### Register a SuiNS Name Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/developer/sdk/transactions.mdx Use this snippet to register a new SuiNS domain name. Specify the domain, duration in years, and the coin configuration for payment. Ensure you have the priceInfoObjectId for SUI/NS coins. ```javascript 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 } ``` -------------------------------- ### Add Git Source Code Information using Sui CLI Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/content/move-registry/managing-package-info.mdx This Sui CLI command allows you to add Git repository, subdirectory, and commit hash information to your PackageInfo. It chains the creation of GitInfo with setting the package versioning. ```bash sui client ptb --move-call @mvr/metadata::git::new \ """" \ """" \ """" --assign git \ --move-call @mvr/metadata::package_info::set_git_versioning @ \ git ``` -------------------------------- ### Query active pricing Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/site/static/markdown/developer/sdk/querying.md Call the `getPriceList` method on the `SuinsClient` instance to query the active names price list. This returns a map of domain length ranges to their corresponding prices in USDC MIST. ```APIDOC ## Query active pricing ### Description Call the `getPriceList` method on the `SuinsClient` instance to query the active names price list. This returns a map of domain length ranges to their corresponding prices in USDC MIST. ### Method `getPriceList()` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript const priceList = await suinsClient.getPriceList(); console.log(priceList); ``` ### Response #### Success Response Returns an object where keys are arrays representing domain length ranges `[domain_length_from, domain_length_to]` and values are the prices in USDC MIST. #### Response Example ```json { "[ 3, 3 ]": 500000000, "[ 4, 4 ]": 100000000, "[ 5, 63 ]": 20000000 } ``` ``` -------------------------------- ### Deploy Website Without SSH Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/site/README.md Deploys the website without using SSH, requiring you to specify your GitHub username. ```bash GIT_USER= yarn deploy ``` -------------------------------- ### Add MVR PATH to fish config Source: https://github.com/mystenlabs/suins-contracts/blob/main/documentation/site/static/markdown/move-registry/tooling/mvr-cli.md Adds the MVR binary directory to your system's PATH for the Fish shell. Replace '/path/to/your/folder' with the actual directory containing the mvr binary. ```sh $ nano ~/.config/fish/config.fish ``` ```sh set -Ux fish_user_paths /path/to/your/folder $fish_user_paths ``` -------------------------------- ### Sync On-Chain Configuration Source: https://github.com/mystenlabs/suins-contracts/blob/main/packages/bbb/cli/README.md Updates the on-chain configuration based on the config.ts file. This command requires the BBBAdminCap holder to execute. ```shell bun src/cli.ts sync-config ```