Constructors

Methods

  • Initializes a wallet from a file.

    Node.js only - This function requires file system access and will throw in browser environments.

    Parameters

    • filePath: string

      The path to the file containing the wallet's secret key.

    Returns readonly [Wallet, Keypair]

    A promise that resolves to a tuple containing the wallet and the keypair.

    When called in a browser environment

  • Initializes a keypair from a file.

    Node.js only - This function requires file system access and will throw in browser environments.

    Parameters

    • filePath: string

      The path to the file containing the keypair's secret key.

    Returns Keypair

    A promise that resolves to the keypair.

    When called in a browser environment

  • Loads an Anchor program from a connection.

    Parameters

    • connection: Connection

      The connection to load the program from.

    • Optionalwallet: Wallet
    • OptionalprogramId: PublicKey

    Returns Promise<Program<Idl>>

    A promise that resolves to the loaded Anchor program.

  • Loads an Anchor program from a provider.

    Parameters

    • provider: Provider

      The provider to load the program from.

    • OptionalprogramId: PublicKey

      An optional program ID to load the program from.

    Returns Promise<Program<Idl>>

    A promise that resolves to the loaded Anchor program.

  • Loads the same environment set for the Solana CLI.

    Node.js only - This function requires file system access and will throw in browser environments.

    Returns Promise<SolanaConfig>

    A promise that resolves to the Solana configuration.

    When called in a browser environment

  • Parse out anchor events from the logs present in the program IDL.

    Parameters

    • program: Program

      The Anchor program instance.

    • logs: string[]

      The array of logs to parse.

    Returns (null | {})[]

    An array of parsed events.