Provides: wallets, connection, latest SolMerkleTree, LookupTable, confirmConfig, poseidon

Hierarchy

  • Provider

Constructors

  • Initialize with Wallet or SolanaKeypair. Feepayer is the provided wallet Optionally provide confirmConfig, Default = 'confirmed'.

    Parameters

    • __namedParameters: {
          assetLookupTable?: PublicKey[];
          confirmConfig?: ConfirmOptions;
          connection?: Connection;
          minimumLamports?: BN;
          relayer?: Relayer;
          url?: string;
          verifierProgramLookupTable?: PublicKey[];
          wallet: Keypair | Wallet;
      }
      • Optional assetLookupTable?: PublicKey[]
      • Optional confirmConfig?: ConfirmOptions
      • Optional connection?: Connection
      • Optional minimumLamports?: BN
      • Optional relayer?: Relayer
      • Optional url?: string
      • Optional verifierProgramLookupTable?: PublicKey[]
      • wallet: Keypair | Wallet

    Returns Provider

Properties

confirmConfig: ConfirmOptions
connection?: Connection
lookUpTable?: PublicKey
lookUpTables: {
    assetLookupTable: string[];
    verifierProgramLookupTable: string[];
}

Type declaration

  • assetLookupTable: string[]
  • verifierProgramLookupTable: string[]
minimumLamports: BN
poseidon: any
provider?: AnchorProvider
relayer: Relayer
solMerkleTree?: SolMerkleTree
url?: string
wallet: Wallet

Methods

  • Parameters

    • address: PublicKey

    Returns void

  • Parameters

    Returns Promise<void>

  • Fetches the latest Merkle tree by calling the fetchMerkleTree method with the TRANSACTION_MERKLE_TREE_KEY as the key.

    Parameters

    • Optional indexedTransactions: IndexedTransaction[]

      An optional array of IndexedTransaction objects. If provided, the fetch operation will use these transactions.

    Returns Promise<void>

    A Promise that resolves when the operation is completed.

  • Initializes a Provider instance. This method should only be used if you use the WalletAdapter, such as in the browser. If you use a local keypair, use getNodeProvider() instead.

    Throws

    Throws an error if the wallet parameter is not provided.

    Remarks

    This method is used to initialize a new instance of the Provider class.

    • It loads the Poseidon hash function.
    • Fetches the lookup table.
    • Fetches the Merkle tree with the TRANSACTION_MERKLE_TREE_KEY.
    • Finally returns the initialized Provider instance.

    Parameters

    • __namedParameters: {
          assetLookupTable?: PublicKey[];
          confirmConfig?: ConfirmOptions;
          connection?: Connection;
          relayer?: Relayer;
          url?: string;
          verifierProgramLookupTable?: PublicKey[];
          wallet: Keypair | Wallet;
      }
      • Optional assetLookupTable?: PublicKey[]
      • Optional confirmConfig?: ConfirmOptions
      • Optional connection?: Connection
      • Optional relayer?: Relayer
      • Optional url?: string
      • Optional verifierProgramLookupTable?: PublicKey[]
      • wallet: Keypair | Wallet

    Returns Promise<Provider>

    A promise that resolves to a Provider instance.

  • Static method to load a mock Provider.

    • This method is used for testing purposes to generate a mock Provider.
    • It initializes a Provider with a mock wallet and URL.
    • It also loads Poseidon hash function and initializes a Solana lookup table and a Solana Merkle Tree.

    Returns Promise<Provider>

    A promise that resolves to a mock Provider.

Generated using TypeDoc