An interface for signing messages and transactions.

interface Signer {
    getAddress(address?): string;
    sendSignedTransaction(signature, txBody, isDryrun?): Promise<any>;
    sendTransaction(transactionObject, isDryrun?): any;
    sendTransactionBatch(transactionObjects): Promise<any>;
    signMessage(message, address?): string | Promise<string>;
}

Implemented by

Methods

  • Gets an account's checksum address. If the address is not given, the default account of the signer is used.

    Parameters

    • Optional address: string

      The address of the account.

    Returns string

    The checksum address.

  • Sends a signed transaction to the network.

    Parameters

    • signature: string

      The signature.

    • txBody: TransactionBody

      The transaction body.

    • Optional isDryrun: boolean

      The dryrun option.

    Returns Promise<any>

    The return value of the blockchain API.

  • Signs and sends a transaction to the network.

    Parameters

    • transactionObject: TransactionInput

      The transaction input object.

    • Optional isDryrun: boolean

      The dryrun option.

    Returns any

    The return value of the blockchain API.

  • Signs and sends multiple transactions in a batch to the network.

    Parameters

    • transactionObjects: TransactionInput[]

      The list of the transaction input objects.

    Returns Promise<any>

    The return value of the blockchain API.

  • Signs a message using an account. If an address is not given, the default account of the signer is used.

    Parameters

    • message: string

      The message to sign.

    • Optional address: string

      The address of the account.

    Returns string | Promise<string>

    The signature.