Interface for web sdk exclusive methods

interface IDefaultChainWeb {
    connected: boolean;
    name: string;
    provider: any;
    rpc_url: string;
    signer: any;
    wallet: any;
    connect(): Promise<boolean>;
    connectWallet(privateKey: string, options?: {}): Promise<any>;
    disconnect(): Promise<boolean>;
    getAddress(): string;
    getBalance(address: string, options?: {}): Promise<string>;
    getEmptyTransaction(): any;
    preparePay<T>(this: T, receiver: string, amount: string, options?: any): Promise<Awaited<ReturnType<T["preparePays"]>>[number]>;
    preparePays(payments: IPayOptions[], options: {}): Promise<any[]>;
    prepareTransfer<T, Options>(this: T, receiver: string, amount: string, options?: Options): Promise<Awaited<ReturnType<T["preparePays"]>>[number]>;
    prepareTransfers<T, Options>(this: T, payments: IPayOptions[], options?: Options): Promise<Awaited<ReturnType<T["preparePays"]>>>;
    setRpc(rpc_url: string): void;
    signMessage(message: string, options?: {
        privateKey?: string;
    }): Promise<string | Uint8Array<ArrayBufferLike>>;
    signTransaction<T, Tx>(this: T, tx: Tx, options?: any): Promise<Awaited<ReturnType<T["preparePays"]>>[number]>;
    signTransactions(transactions: any[], options?: {
        privateKey?: string;
    }): Promise<any[]>;
    verifyMessage(message: string, signature: string | Uint8Array<ArrayBufferLike>, publicKey: string | Uint8Array<ArrayBufferLike>): Promise<boolean>;
}

Hierarchy (view full)

Implemented by

Properties

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

Methods

  • Alias

    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: any

      Options

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

    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 | Uint8Array<ArrayBufferLike>>

    The signed message

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

    Parameters

    • transactions: any[]

      A list of transactions to sign

    • Optionaloptions: {
          privateKey?: string;
      }

      Options

      • OptionalprivateKey?: string

    Returns Promise<any[]>

  • Verifies a message using the connected wallet

    Parameters

    • message: string

      The message to verify

    • signature: string | Uint8Array<ArrayBufferLike>

      The signature to verify

    • publicKey: string | Uint8Array<ArrayBufferLike>

    Returns Promise<boolean>

    A boolean indicating if the message was verified