/** * Similar to `sui::table`, an `ObjectTable` is a map-like collection. But unlike * `sui::table`, the values bound to these dynamic fields _must_ be objects themselves. This allows * for the objects to still exist within in storage, which may be important for external tools. * The difference is otherwise not observable from within Move. */ import type { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client'; import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToPhantomTypeArgument, ToTypeStr } from '../../../_framework/reified'; import { FieldsWithTypes } from '../../../_framework/util'; import { UID } from '../object/structs'; export declare function isObjectTable(type: string): boolean; export interface ObjectTableFields { /** the ID of this table */ id: ToField; /** the number of key-value pairs in the table */ size: ToField<'u64'>; } export type ObjectTableReified = Reified, ObjectTableFields>; export type ObjectTableJSONField = { id: string; size: string; }; export type ObjectTableJSON = { $typeName: typeof ObjectTable.$typeName; $typeArgs: [PhantomToTypeStr, PhantomToTypeStr]; } & ObjectTableJSONField; export declare class ObjectTable implements StructClass { __StructClass: true; static readonly $typeName: `0x2::object_table::ObjectTable`; static readonly $numTypeParams = 2; static readonly $isPhantom: readonly [true, true]; readonly $typeName: typeof ObjectTable.$typeName; readonly $fullTypeName: `0x2::object_table::ObjectTable<${PhantomToTypeStr}, ${PhantomToTypeStr}>`; readonly $typeArgs: [PhantomToTypeStr, PhantomToTypeStr]; readonly $isPhantom: typeof ObjectTable.$isPhantom; /** the ID of this table */ readonly id: ToField; /** the number of key-value pairs in the table */ readonly size: ToField<'u64'>; private constructor(); static reified, V extends PhantomReified>(K: K, V: V): ObjectTableReified, ToPhantomTypeArgument>; static get r(): typeof ObjectTable.reified; static phantom, V extends PhantomReified>(K: K, V: V): PhantomReified, ToPhantomTypeArgument>>>; static get p(): typeof ObjectTable.phantom; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields, V extends PhantomReified>(typeArgs: [K, V], fields: Record): ObjectTable, ToPhantomTypeArgument>; static fromFieldsWithTypes, V extends PhantomReified>(typeArgs: [K, V], item: FieldsWithTypes): ObjectTable, ToPhantomTypeArgument>; static fromBcs, V extends PhantomReified>(typeArgs: [K, V], data: Uint8Array): ObjectTable, ToPhantomTypeArgument>; toJSONField(): ObjectTableJSONField; toJSON(): ObjectTableJSON; static fromJSONField, V extends PhantomReified>(typeArgs: [K, V], field: any): ObjectTable, ToPhantomTypeArgument>; static fromJSON, V extends PhantomReified>(typeArgs: [K, V], json: Record): ObjectTable, ToPhantomTypeArgument>; static fromCoreObject, V extends PhantomReified>(typeArgs: [K, V], obj: SuiClientTypes.Object<{ content: true; }>): ObjectTable, ToPhantomTypeArgument>; static fetch, V extends PhantomReified>(client: ClientWithCoreApi, typeArgs: [K, V], id: string): Promise, ToPhantomTypeArgument>>; }