Class MNS

Example

const mns = await MNS.mainnet(provider);
const address = await mns.resolve("example");

Hierarchy (view full)

Constructors

Properties

address: string

Methods

  • Get the MAS balance of the smart contract

    Parameters

    • final: boolean = false

      Whether to get the final balance or the pending balance

    Returns Promise<bigint>

    The MAS balance of the smart contract

  • Executes a smart contract call operation

    Parameters

    • func: string

      The smart contract function to be called.

    • args: Uint8Array | Args = ...
    • options: CallSCOptions = {}

      Includes optional and required parameters like fee, maxGas, coins, and periodToLive.

    Returns Promise<Operation>

    A promise that resolves to an Operation object representing the transaction.

  • Returns the list of domains pointing to multiple addresses

    Parameters

    • addresses: string[]

      List of addresses to resolve domains for

    Returns Promise<string[][]>

    Promise<string[][]> - List of domains for each address

    Throws

    Error if provider implements only PublicProvider interface

  • Parameters

    • target: string
    • final: boolean = false

    Returns Promise<string[]>

  • Parameters

    • address: string
    • final: boolean = false

    Returns Promise<string[]>

  • Parameters

    • domains: string[]
    • final: boolean = false

    Returns Promise<string[]>

  • Executes a smart contract read operation

    Parameters

    • func: string

      The smart contract function to be called.

    • args: Uint8Array | Args = ...

      Parameter for the function call in Uint8Array format.

    • options: ReadSCOptions = {}

      Includes optional parameters like fee, maxGas, coins, and periodToLive.

    Returns Promise<ReadSCData>

    A promise that resolves to the result of the read operation.

  • Deploy a SmartContract byteCode

    Parameters

    • provider: Provider

      Web3 provider.

    • byteCode: Uint8Array

      Compiled SmartContract bytecode.

    • constructorArgs: Uint8Array | Args = ...

      Parameter for call of constructor function.

    • options: DeploySCOptions = {}

      Includes optional parameters like fee, maxGas, coins, and periodToLive.

    Returns Promise<SmartContract>

    A promise that resolves to the result of the read operation.