Interface IWalletClient

Interface for WalletClient objects

See

  • setBaseAccount - set base account for wallet
  • getBaseAccount - get base account for wallet
  • getWalletAccounts - get all accounts in wallet
  • cleanWallet - delete all accounts from wallet
  • getWalletAccountByAddress - get account by address
  • addSecretKeysToWallet - add accounts to wallet by secret keys
  • addAccountsToWallet - add accounts to wallet
  • removeAddressesFromWallet - remove accounts from wallet
  • walletInfo - get all accounts info
  • signMessage - sign message by account
  • getAccountBalance - get account balance
  • sendTransaction - send transaction
  • buyRolls - buy rolls
  • sellRolls - sell rolls
interface IWalletClient {
    clientConfig: IClientConfig;
    addAccountsToWallet(accounts): Promise<IAccount[]>;
    addSecretKeysToWallet(secretKeys): Promise<IAccount[]>;
    buyRolls(txData, executor?): Promise<string[]>;
    cleanWallet(): void;
    compactBytesForOperation(data, opTypeId, expirePeriod): Buffer;
    getAccountBalance(address): Promise<IBalance>;
    getBaseAccount(): IBaseAccount;
    getPrivateProviders(): IProvider[];
    getPublicProviders(): IProvider[];
    getWalletAccountByAddress(address): IAccount;
    getWalletAccounts(): IAccount[];
    removeAddressesFromWallet(addresses): void;
    sellRolls(txData, executor): Promise<string[]>;
    sendJsonRPCRequest<T>(resource, params): Promise<T>;
    sendTransaction(txData, executor?): Promise<string[]>;
    setBaseAccount(baseAccount): void;
    setProviders(providers): void;
    signMessage(data, chainId, accountSignerAddress): Promise<ISignature>;
    verifySignature(data, signature, signerPublicKey): Promise<boolean>;
    walletInfo(): Promise<IFullAddressInfo[]>;
}

Hierarchy

  • BaseClient
    • IWalletClient

Implemented by

Properties

clientConfig: IClientConfig

Methods

  • Compacts bytes payload per operation.

    Parameters

    • data: DataType

      The operation data.

    • opTypeId: OperationTypeId

      The operation type id.

    • expirePeriod: number

      The expire period.

    Returns Buffer

    The compacted bytes payload.

  • Sends a post JSON rpc request to the node.

    Type Parameters

    • T

    Parameters

    • resource: JSON_RPC_REQUEST_METHOD

      The rpc method to call.

    • params: object

      The parameters to pass to the rpc method.

    Returns Promise<T>

    A promise that resolves as the result of the rpc method.

    Throws

    An error if the rpc method returns an error.

  • Set new providers as IProvider.

    Parameters

    • providers: IProvider[]

      The new providers to set as an array of IProvider.

    Returns void

    Throws

    Will throw an error if no public providers are included in the given array of providers.

    Throws

    Will throw an error if no private providers are included in the given array of providers.

  • Sign a message using a specific account.

    Parameters

    • data: string | Buffer

      The message to sign.

    • chainId: bigint
    • accountSignerAddress: string

      The address of the account used to sign the message.

    Returns Promise<ISignature>

    A promise that resolves to the signed data as an ISignature object.

  • Verify a signature.

    Parameters

    • data: string | Buffer

      The message to verify.

    • signature: ISignature

      The signature to verify.

    • signerPublicKey: string

      The public key of the signer.

    Returns Promise<boolean>

    A promise that resolves to a boolean (true if the signature is valid, false otherwise).

Generated using TypeDoc