getAddressLookupTable method

Future<AddressLookupTableAccount?> getAddressLookupTable(
  1. Pubkey pubkey, {
  2. GetAddressLookupTableConfig? config,
})

Returns the address lookup table of the provided pubkey.

Implementation

Future<AddressLookupTableAccount?> getAddressLookupTable(
  final Pubkey pubkey, {
  final GetAddressLookupTableConfig? config,
}) async {
  final AccountInfo? accountInfo = await getAccountInfo(
    pubkey,
    config: GetAccountInfoConfig(
      commitment: config?.commitment,
      encoding: AccountEncoding.base64,
      minContextSlot: config?.minContextSlot,
    ),
  );
  final state = AddressLookupTableState.tryFromBorshBase64(
    accountInfo?.binaryData,
  );
  return state != null
      ? AddressLookupTableAccount(key: pubkey, state: state)
      : null;
}