Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AccountRpc

Hierarchy

  • AccountRpc

Index

Methods

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: H256 | string, passphrase?: undefined | string): Promise<string>
  • Imports a secret key and add the corresponding account.

    Parameters

    • secret: H256 | string

      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

remove

  • remove(address: PlatformAddress | string, passphrase?: undefined | string): Promise<null>
  • Removes the account.

    Parameters

    • address: PlatformAddress | string

      A platform address

    • Optional passphrase: undefined | string

      The account's passphrase

    Returns Promise<null>

sign

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

    Parameters

    • messageDigest: H256 | string

      A message to sign

    • address: PlatformAddress | string

      A platform address

    • Optional passphrase: undefined | string

      The account's passphrase

    Returns Promise<string>

unlock

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

    Parameters

    • address: PlatformAddress | string

      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