Interface for web sdk exclusive methods

Hierarchy (view full)

Implements

Constructors

Properties

chainId: number
connected: boolean = false
contracts: Map<string, Contract> = ...
isEIP1559: boolean
name: string = ""
provider: JsonRpcProvider
rpc_url: string = ""
signer: any = null
wallet: Wallet

Methods

  • Connects to the EVM network

    Parameters

    • OptionalchainId: number

      (Optional) The chainId of this network

    • OptionalisEIP1559: boolean

      (Optional) Whether this network uses EIP-1559

    Returns Promise<boolean>

    A boolean indicating whether the connection was successful

    When parameters are not provided, they are automatically inferred from the network.

  • Creates a skeleton transaction

    Returns Promise<{
        chainId: number;
        gasLimit: number;
        maxFeePerGas: bigint;
        maxPriorityFeePerGas: bigint;
        type: number;
    } | {
        chainId: number;
        gasLimit: number;
        gasPrice: bigint;
    }>

  • Get the balance of a token

    Parameters

    • contract_address: string

      The address of the token contract

    • address: string

      The address of the wallet

    Returns Promise<{
        balance: string;
        decimals: number;
        name: string;
        symbol: string;
    }>

    The balance of the token

  • Check if an address is valid

    Parameters

    • address: string

      The address to check

    Returns boolean

    A boolean indicating whether the address is valid

  • Returns Promise<{
        chainId: number;
        gasLimit: number;
        maxFeePerGas: bigint;
        maxPriorityFeePerGas: bigint;
        type: number;
    } | {
        chainId: number;
        gasLimit: number;
        gasPrice: bigint;
    }>

  • Alias

    Creates a signed transaction to transfer default chain currency

    Parameters

    • address: string
    • amount: string

      The amount to transfer

    • Optionaloptions: {
          gasLimit?: number;
      }

      Options

      • OptionalgasLimit?: number

    Returns Promise<string>

    The signed transaction

    prepareTransfer

  • Creates a list of signed transactions to transfer default chain currency

    Parameters

    • payments: IPayOptions[]

      A list of transfers to prepare

    • Optionaloptions: {
          gasLimit?: number;
      }

      Options

      • OptionalgasLimit?: number

    Returns Promise<string[]>

    An ordered list of signed transactions

  • Signs a message using the connected wallet

    Parameters

    • message: string

      The message to sign

    • Optionaloptions: {
          privateKey?: string;
      }

      Options

      • OptionalprivateKey?: string

    Returns Promise<string>

    The signed message

  • Signs a transaction using the connected wallet

    Parameters

    • transaction: TransactionRequest
    • Optionaloptions: {
          privateKey?: string;
      }

      Options

      • OptionalprivateKey?: string

    Returns Promise<string>

    The signed transaction

  • Signs a list of transactions using the connected wallet. The transaction nonce is incremented for each transaction in order of appearance.

    Parameters

    • transactions: TransactionRequest[]

      A list of transactions to sign

    • Optionaloptions: {
          privateKey?: string;
      }

      Options

      • OptionalprivateKey?: string

    Returns Promise<string[]>

  • Verifies a message using the connected wallet

    Parameters

    • message: string

      The message to verify

    • signature: string

      The signature to verify

    • publicKey: string

    Returns Promise<boolean>

    A boolean indicating if the message was verified

  • Creates a new instance of this sdk

    Type Parameters

    Parameters

    • this: (new (rpc_url: string) => T)
        • new (rpc_url): T
        • Parameters

          • rpc_url: string

          Returns T

    • rpc_url: string = ""

      The RPC URL

    Returns Promise<T>

    The sdk instance connected to the RPC provider