Class USDCs

Example

const token = new MRC20(provider, <tokenAddr>);
const balance = await token.balanceOf(<accountAddr>);
console.log(`Your balance: ${balance}`);

const transferOperation = await token.transfer(<recipientAddr>, BigInt(10000));
console.log(`Transfer operation id: ${transferOperation.id}`);

Hierarchy (view full)

Constructors

Properties

address: string
provider: Provider

Methods

  • 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.

  • 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.

  • Executes a smart contract read operation

    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.