/** Sui object identifiers */ import type { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client'; import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from '../../../_framework/reified'; import { FieldsWithTypes } from '../../../_framework/util'; export declare function isID(type: string): boolean; export interface IDFields { bytes: ToField<'address'>; } export type IDReified = Reified; export type IDJSONField = { bytes: string; }; export type IDJSON = { $typeName: typeof ID.$typeName; $typeArgs: []; } & IDJSONField; /** * An object ID. This is used to reference Sui Objects. * This is *not* guaranteed to be globally unique--anyone can create an `ID` from a `UID` or * from an object, and ID's can be freely copied and dropped. * Here, the values are not globally unique because there can be multiple values of type `ID` * with the same underlying bytes. For example, `object::id(&obj)` can be called as many times * as you want for a given `obj`, and each `ID` value will be identical. */ export declare class ID implements StructClass { __StructClass: true; static readonly $typeName: `0x2::object::ID`; static readonly $numTypeParams = 0; static readonly $isPhantom: readonly []; readonly $typeName: typeof ID.$typeName; readonly $fullTypeName: `0x2::object::ID`; readonly $typeArgs: []; readonly $isPhantom: typeof ID.$isPhantom; readonly bytes: ToField<'address'>; private constructor(); static reified(): IDReified; static get r(): IDReified; static phantom(): PhantomReified>; static get p(): PhantomReified>; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields(fields: Record): ID; static fromFieldsWithTypes(item: FieldsWithTypes): ID; static fromBcs(data: Uint8Array): ID; toJSONField(): IDJSONField; toJSON(): IDJSON; static fromJSONField(field: any): ID; static fromJSON(json: Record): ID; static fromCoreObject(obj: SuiClientTypes.Object<{ content: true; }>): ID; static fetch(client: ClientWithCoreApi, id: string): Promise; } export declare function isUID(type: string): boolean; export interface UIDFields { id: ToField; } export type UIDReified = Reified; export type UIDJSONField = { id: string; }; export type UIDJSON = { $typeName: typeof UID.$typeName; $typeArgs: []; } & UIDJSONField; /** * Globally unique IDs that define an object's ID in storage. Any Sui Object, that is a struct * with the `key` ability, must have `id: UID` as its first field. * These are globally unique in the sense that no two values of type `UID` are ever equal, in * other words for any two values `id1: UID` and `id2: UID`, `id1` != `id2`. * This is a privileged type that can only be derived from a `TxContext`. * `UID` doesn't have the `drop` ability, so deleting a `UID` requires a call to `delete`. */ export declare class UID implements StructClass { __StructClass: true; static readonly $typeName: `0x2::object::UID`; static readonly $numTypeParams = 0; static readonly $isPhantom: readonly []; readonly $typeName: typeof UID.$typeName; readonly $fullTypeName: `0x2::object::UID`; readonly $typeArgs: []; readonly $isPhantom: typeof UID.$isPhantom; readonly id: ToField; private constructor(); static reified(): UIDReified; static get r(): UIDReified; static phantom(): PhantomReified>; static get p(): PhantomReified>; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields(fields: Record): UID; static fromFieldsWithTypes(item: FieldsWithTypes): UID; static fromBcs(data: Uint8Array): UID; toJSONField(): UIDJSONField; toJSON(): UIDJSON; static fromJSONField(field: any): UID; static fromJSON(json: Record): UID; static fromCoreObject(obj: SuiClientTypes.Object<{ content: true; }>): UID; static fetch(client: ClientWithCoreApi, id: string): Promise; }