Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AccountRpc

Hierarchy

  • AccountRpc

Index

Methods

changePassword

  • changePassword(address: PlatformAddressValue, oldPassphrase: string, newPassphrase: string): Promise<null>
  • Changes the passpharse of the account

    Parameters

    • address: PlatformAddressValue

      A platform address

    • oldPassphrase: string

      The account's current passphrase

    • newPassphrase: string

      The new passphrase for the account

    Returns Promise<null>

create

  • create(passphrase?: undefined | string): Promise<string>
  • Creates a new account.

    Parameters

    • Optional passphrase: undefined | string

      A passphrase to be used by the account owner

    Returns Promise<string>

    An account

getList

  • getList(): Promise<string[]>
  • Gets a list of accounts.

    Returns Promise<string[]>

    A list of accounts

importRaw

  • importRaw(secret: H256Value, passphrase?: undefined | string): Promise<string>
  • Imports a secret key and add the corresponding account.

    Parameters

    • secret: H256Value

      H256 or hexstring for 256-bit private key

    • Optional passphrase: undefined | string

      A passphrase to be used by the account owner

    Returns Promise<string>

    The account

sendTransaction

  • sendTransaction(params: object): Promise<object>
  • Sends a transaction with the account's signature.

    Parameters

    • params: object
      • account: PlatformAddressValue

        The platform account to sign the tx

      • Optional fee?: U64Value
      • Optional passphrase?: undefined | string

        The account's passphrase

      • tx: Transaction

        A tx to send

    Returns Promise<object>

sign

  • sign(messageDigest: H256Value, address: PlatformAddressValue, passphrase?: undefined | string): Promise<string>
  • Calculates the account's signature for a given message.

    Parameters

    • messageDigest: H256Value

      A message to sign

    • address: PlatformAddressValue

      A platform address

    • Optional passphrase: undefined | string

      The account's passphrase

    Returns Promise<string>

unlock

  • unlock(address: PlatformAddressValue, passphrase?: undefined | string, duration?: undefined | number): Promise<null>
  • Unlocks the account.

    Parameters

    • address: PlatformAddressValue

      A platform address

    • Optional passphrase: undefined | string

      The account's passphrase

    • Optional duration: undefined | number

      Time to keep the account unlocked. The default value is 300(seconds). Passing 0 unlocks the account indefinitely.

    Returns Promise<null>

Generated using TypeDoc