@solana/web3.js
    Preparing search index...

    Class PublicKey

    A public key

    Hierarchy (View Summary)

    Index
    default: PublicKey = ...

    Default public key value. The base58-encoded string representation is all ones (as seen below) The underlying BN number is 32 bytes that are all zeros

    • Return the base-58 representation of the public key

      Returns string

    • Return the Buffer representation of the public key in big endian

      Returns Buffer

    • Return the byte array representation of the public key in big endian

      Returns Uint8Array

    • Return the base-58 representation of the public key

      Returns string

    • Async version of createProgramAddressSync For backwards compatibility

      Parameters

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

      Returns Promise<PublicKey>

      Use createProgramAddressSync instead

    • Derive a program address from seeds and a program ID.

      Parameters

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

      Returns PublicKey

    • 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>

    • Async version of findProgramAddressSync For backwards compatibility

      Parameters

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

      Returns Promise<[PublicKey, number]>

      Use findProgramAddressSync instead

    • 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: (Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>)[]
      • programId: PublicKey

      Returns [PublicKey, number]