Hierarchy (view full)

Constructors

Properties

connected: boolean = false
name: string = ""
provider: Client
rpc_url: string = ""
signer: any = null
wallet: Wallet

Methods

  • Connects to the RPC provider

    Parameters

    • with_reconnect: boolean = true

    Returns Promise<boolean>

    A boolean indicating if the connection was successful

  • Gets the balance of a wallet

    Parameters

    • address: string

      The wallet address

    • multi: boolean = true

    Returns Promise<string>

    The balance of the wallet as a string

  • Creates a skeleton transaction

    Returns Promise<{
        Account: string;
        Amount: string;
        Destination: string;
        Sequence: number;
        TransactionType: "Payment";
    }>

  • Alias

    Creates a signed transaction to transfer default chain currency

    Parameters

    • address: string
    • amount: string | number

      The amount to transfer

    Returns Promise<{}>

    The signed transaction

    prepareTransfer

  • Creates a signed transaction to transfer default chain currency

    Type Parameters

    Parameters

    • this: T
    • receiver: string

      The receiver's address

    • amount: string

      The amount to transfer

    • Optionaloptions: Options

      Options

    Returns Promise<Awaited<ReturnType<T["preparePays"]>>[number]>

    The signed transaction

  • Creatthis.provider = new JsonRpcProvider(this.rpc_url)es a list of signed transactions to transfer default chain currency

    Type Parameters

    Parameters

    Returns Promise<Awaited<ReturnType<T["preparePays"]>>>

    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: Transaction
    • Optionaloptions: {
          privateKey: string;
      }

      Options

      • privateKey: string

    Returns Promise<{}>

    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: Transaction[]

      A list of transactions to sign

    • Optionaloptions: {
          privateKey: string;
      }

      Options

      • privateKey: string

    Returns Promise<{}[]>

  • 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