extractTableLookup method

ExtractTableLookup? extractTableLookup(
  1. AddressLookupTableAccount lookupTable
)

Implementation

ExtractTableLookup? extractTableLookup(
    AddressLookupTableAccount lookupTable) {
  final writableIndexesAndKeys = _drainKeysFoundInLookupTable(
    lookupTable.addresses,
    (keyMeta) =>
        !keyMeta.isSigner && !keyMeta.isInvoked && keyMeta.isWritable,
  );
  final readonlyIndexesAndKeys = _drainKeysFoundInLookupTable(
    lookupTable.addresses,
    (keyMeta) =>
        !keyMeta.isSigner && !keyMeta.isInvoked && !keyMeta.isWritable,
  );
  if (writableIndexesAndKeys.item1.isEmpty &&
      readonlyIndexesAndKeys.item1.isEmpty) {
    return null;
  }
  return ExtractTableLookup(
      lookup: AddressTableLookup(
          accountKey: lookupTable.key,
          writableIndexes: writableIndexesAndKeys.item1,
          readonlyIndexes: readonlyIndexesAndKeys.item1),
      readable: readonlyIndexesAndKeys.item2,
      writable: writableIndexesAndKeys.item2);
}