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

Hierarchy (view full)

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
    • Optional work_function: WorkFunction

    Returns Wallet

Properties

add_do_work: boolean = true
index: number

Seed index. Seeds can have multiple private keys and addresses

seed: string
work_function?: WorkFunction

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

    • new_representative: `ban_${string}` | `nano_${string}`
    • Optional work: boolean

    Returns Promise<string>

  • Parameters

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

      banano address to change representative to

    • Optional gen_work: boolean

      whether or not to call work function to generate work

    Returns Promise<string>

  • Parameters

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

    Returns Promise<AccountInfoRPC>

  • Parameters

    • Optional block_hash: string

      send block to receive

    • Optional gen_work: boolean

      whether or not to call work function to generate work

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

      optionally provide a representative if you do not want to use the current representative receive bananos from a specific send block

    Returns Promise<string>

  • Parameters

    • Optional count: number = 20

      Max amount of blocks to receive receive all (up to count and exceeding threshold if applicable) receivable blocks

    • Optional threshold: `${number}`

      Min amount of Banano to receive in whole

    • Optional gen_work: boolean

      whether or not to call work function to generate work Receive all receivable transactions (up to count, and over threshold

    Returns Promise<string[]>

  • Parameters

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

      address to send to

    • Optional amount: `${number}`

      amount in whole bananos to send

    • Optional gen_work: boolean

      whether or not to call work function to generate work

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

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

    • Optional cached_account_info: AccountInfoRPC

      can save one rpc call in some cases. Mostly for internal use. Make sure that in the RPC call, "representative" is "true" Send Bananos

    Returns Promise<string>

  • Parameters

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

    Returns Promise<string>

  • Parameters

    • message: string

    Returns string