Class Wallet

Wallets are created from seeds, so they can have multiple addresses by changing the index. Use Wallets to "write" (send, receive, change rep) to the network

Constructors

  • Parameters

    • rpc: RPCInterface
    • Optional seed: string

      Seed for the wallet from which private keys are derived. 64 character hex string (32 bytes)

    • index: number = 0
    • try_work: boolean = false

    Returns Wallet

Properties

add_do_work: boolean = false
index: number

Seed index. Seeds can have multiple private keys and addresses

seed: string
try_work: boolean

Accessors

  • get address(): `ban_${string}` | `nano_${string}`
  • Returns `ban_${string}` | `nano_${string}`

  • get private_key(): string
  • Returns string

  • get public_key(): string
  • Returns string

Methods

  • Parameters

    • Optional include_confirmed: boolean
    • Optional representative: boolean
    • Optional weight: boolean
    • Optional pending: boolean

    Returns Promise<AccountInfoRPC>

  • Parameters

    • to: `ban_${string}` | `nano_${string}`
    • amount: `${number}`
    • Optional work: string

      optionally provide work

    • Optional previous: string

      optionally provide a previous if you do not want to use the current frontier

    • Optional representative: `ban_${string}` | `nano_${string}`

      optionally provide a representative if you do not want to use the current representative

    Returns Promise<string>