import { BcsStruct, BcsTuple, BcsType } from "@mysten/sui/bcs"; import { TransactionArgument, TransactionObjectArgument } from "@mysten/sui/transactions"; import { ClientWithCoreApi, SuiClientTypes } from "@mysten/sui/client"; //#region src/contracts/utils/index.d.ts type RawTransactionArgument = T | TransactionArgument; type GetOptions = {}> = SuiClientTypes.GetObjectOptions & { client: ClientWithCoreApi; }; type GetManyOptions = {}> = SuiClientTypes.GetObjectsOptions & { client: ClientWithCoreApi; }; /** * A non-callback transaction argument in a generated config object, used for keys whose matched * parameter can't be supplied as an object id string. */ type ConfigObjectValue = Exclude unknown>; /** * A plain value in a generated config object: an object id or a non-callback transaction * argument. Keys that can resolve multiple bindings are typed as resolver functions instead. */ type ConfigValue = string | ConfigObjectValue; /** A type argument: a type tag string, or a BCS type whose name is a Move type. */ type TypeArgument = string | BcsType; interface TypeTagOptions { package?: string; typeArguments?: readonly TypeArgument[]; } /** * `typeArguments` is required when the type's name contains unfilled * `phantom X` parameters (at any depth). Everything else — argument arity, * position contents, and tag validity — is validated at runtime. */ type TypeTagParams = Name extends `${string}phantom ${string}` ? [options: TypeTagOptions & { typeArguments: readonly TypeArgument[]; }] : [options?: TypeTagOptions]; type ResolveTypeTagOptions = { client: ClientWithCoreApi; } & (Name extends `${string}phantom ${string}` ? TypeTagOptions & { typeArguments: readonly TypeArgument[]; } : TypeTagOptions); declare class MoveStruct>, const Name extends string = string> extends BcsStruct { /** * Build the type tag for this struct. * * `typeArguments` is the full positional list, in Move declaration order, and * is required when the struct has unfilled phantom parameters. The result may * contain MVR names: those are valid in transaction `typeArguments`, but for * queries or comparisons against on-chain data use `resolveTypeTag` instead. */ typeTag(...args: TypeTagParams): string; /** * Build the type tag for this struct, then resolve any MVR names through the * client (using its configured overrides and the MVR API) and return the * normalized, address-only form suitable for queries and comparisons against * on-chain data. */ resolveTypeTag(options: ResolveTypeTagOptions): Promise; get = {}>({ objectId, ...options }: GetOptions): Promise & { json: BcsStruct['$inferType']; }>; getMany = {}>({ client, ...options }: GetManyOptions): Promise & { json: BcsStruct['$inferType']; }>>; } declare class MoveTuple[], const Name extends string> extends BcsTuple { /** Build the type tag for this struct. See `MoveStruct.typeTag` for semantics. */ typeTag(...args: TypeTagParams): string; /** Build and resolve the type tag for this struct. See `MoveStruct.resolveTypeTag`. */ resolveTypeTag(options: ResolveTypeTagOptions): Promise; } //#endregion export { ConfigValue, MoveStruct, MoveTuple, RawTransactionArgument }; //# sourceMappingURL=index.d.mts.map