Options
All
  • Public
  • Public/Protected
  • All
Menu

A public key

Hierarchy

Index

Constructors

constructor

Properties

Static default

default: PublicKey = ...

Default public key value. (All zeros)

Methods

encode

  • encode(): Buffer

equals

toBase58

  • toBase58(): string
  • Return the base-58 representation of the public key

    Returns string

toBuffer

  • toBuffer(): Buffer

toBytes

  • toBytes(): Uint8Array
  • Return the byte array representation of the public key

    Returns Uint8Array

toString

  • toString(): string

Static createProgramAddress

  • createProgramAddress(seeds: (Buffer | Uint8Array)[], programId: PublicKey): Promise<PublicKey>

Static createWithSeed

  • Derive a public key from another key, a seed, and a program ID. The program ID will also serve as the owner of the public key, giving it permission to write data to the account.

    Parameters

    Returns Promise<PublicKey>

Static decode

  • decode(data: Buffer): any

Static decodeUnchecked

  • decodeUnchecked(data: Buffer): any

Static findProgramAddress

  • findProgramAddress(seeds: (Buffer | Uint8Array)[], programId: PublicKey): Promise<[PublicKey, number]>
  • Find a valid program address

    Valid program addresses must fall off the ed25519 curve. This function iterates a nonce until it finds one that when combined with the seeds results in a valid program address.

    Parameters

    • seeds: (Buffer | Uint8Array)[]
    • programId: PublicKey

    Returns Promise<[PublicKey, number]>

Static isOnCurve

  • isOnCurve(pubkey: Uint8Array): boolean
  • Check that a pubkey is on the ed25519 curve.

    Parameters

    • pubkey: Uint8Array

    Returns boolean

Generated using TypeDoc