import type { SuiGrpcClient } from '@mysten/sui/grpc'; import type { OffchainLookup } from '../types/index.js'; import { type OffchainLookupHandler } from './base.js'; /** * Handler for TableItem lookups (gRPC). * * gRPC has no `getDynamicFieldObject({name:{type,value}})` that BCS-encodes the * key by name. We instead: * 1. Navigate `table_path` over the parent object's JSON content to find the * table's object id (json is fine for *navigation* — field names only). * 2. Encode the structured key to BCS in the key struct's DECLARED field order, * fetched generically from chain via movePackageService.getDatatype (so any * resolver's key encodes correctly, not just CoinTypeKey). * 3. Derive the dynamic-field object id (deriveDynamicFieldID) and getObject it. * 4. Decode the value bytes (json for navigation done; value via bcs/json). */ export declare class TableItemHandler implements OffchainLookupHandler> { resolve(lookup: Extract, client: SuiGrpcClient): Promise; /** * Encode the structured key to BCS in the key struct's declared field order. * * The resolver emits fields by NAME with per-field bytes that are NOT uniformly * BCS-encoded (e.g. a `vector` addr is raw, a `u16` chain is already its 2 * LE bytes). We fetch the struct layout from chain to learn (a) field order and * (b) each field's Move type, then re-encode each value to canonical struct-BCS. */ private encodeStructuredKey; private encodeRawKey; private valueToBytes; /** * Walk a dot-path (e.g. "token_registry.coin_types") over the parent object's * JSON content to find the nested table's object id. JSON is used only for * navigation (field names), never for the resolved value. */ private navigateTablePath; } //# sourceMappingURL=table-item.d.ts.map