Class PrivateKeyAccount

Does everything a Wallet can do, except a private key is put in instead of a seed, and so limited to one address. Means changing .index will not do anything obviously.

Hierarchy (view full)

Constructors

Properties

_private_key: string
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>