@mysten/sui 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/bcs/index.d.mts +20 -20
- package/dist/client/types.d.mts +13 -6
- package/dist/client/types.d.mts.map +1 -1
- package/dist/cryptography/signature.d.mts +14 -14
- package/dist/graphql/core.d.mts.map +1 -1
- package/dist/graphql/core.mjs +7 -3
- package/dist/graphql/core.mjs.map +1 -1
- package/dist/graphql/generated/queries.mjs +1 -0
- package/dist/graphql/generated/queries.mjs.map +1 -1
- package/dist/grpc/core.d.mts.map +1 -1
- package/dist/grpc/core.mjs +7 -3
- package/dist/grpc/core.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
- package/dist/jsonRpc/core.d.mts +1 -9
- package/dist/jsonRpc/core.d.mts.map +1 -1
- package/dist/jsonRpc/core.mjs +10 -4
- package/dist/jsonRpc/core.mjs.map +1 -1
- package/dist/transactions/Transaction.d.mts +3 -3
- package/dist/transactions/Transaction.d.mts.map +1 -1
- package/dist/utils/sui-types.d.mts.map +1 -1
- package/dist/utils/sui-types.mjs +8 -0
- package/dist/utils/sui-types.mjs.map +1 -1
- package/dist/version.mjs +2 -2
- package/dist/version.mjs.map +1 -1
- package/dist/zklogin/bcs.d.mts +14 -14
- package/dist/zklogin/bcs.d.mts.map +1 -1
- package/package.json +1 -1
- package/src/client/types.ts +8 -6
- package/src/graphql/core.ts +14 -4
- package/src/graphql/generated/queries.ts +2 -1
- package/src/graphql/queries/getDynamicFields.graphql +1 -0
- package/src/grpc/core.ts +20 -16
- package/src/jsonRpc/core.ts +11 -4
- package/src/utils/sui-types.ts +15 -0
- package/src/version.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.mjs","names":["#jsonRpcClient","result","bcs"],"sources":["../../src/jsonRpc/core.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { fromBase64, type InferBcsInput } from '@mysten/bcs';\n\nimport { bcs, TypeTagSerializer } from '../bcs/index.js';\nimport type {\n\tExecutionStatus as JsonRpcExecutionStatus,\n\tObjectOwner,\n\tSuiMoveAbilitySet,\n\tSuiMoveAbort,\n\tSuiMoveNormalizedType,\n\tSuiMoveVisibility,\n\tSuiObjectChange,\n\tSuiObjectData,\n\tSuiObjectDataFilter,\n\tSuiTransactionBlockResponse,\n\tTransactionEffects,\n} from './types/index.js';\nimport { Transaction } from '../transactions/Transaction.js';\nimport { coreClientResolveTransactionPlugin } from '../client/core-resolver.js';\nimport { TransactionDataBuilder } from '../transactions/TransactionData.js';\nimport { chunk } from '@mysten/utils';\nimport { normalizeSuiAddress, normalizeStructTag } from '../utils/sui-types.js';\nimport { SUI_FRAMEWORK_ADDRESS, SUI_SYSTEM_ADDRESS } from '../utils/constants.js';\nimport { CoreClient } from '../client/core.js';\nimport type { SuiClientTypes } from '../client/types.js';\nimport { ObjectError } from '../client/errors.js';\nimport {\n\tformatMoveAbortMessage,\n\tparseTransactionBcs,\n\tparseTransactionEffectsBcs,\n} from '../client/index.js';\nimport type { SuiJsonRpcClient } from './client.js';\n\nconst MAX_GAS = 50_000_000_000;\n\nfunction parseJsonRpcExecutionStatus(\n\tstatus: JsonRpcExecutionStatus,\n\tabortError?: SuiMoveAbort | null,\n): SuiClientTypes.ExecutionStatus {\n\tif (status.status === 'success') {\n\t\treturn { success: true, error: null };\n\t}\n\n\tconst rawMessage = status.error ?? 'Unknown';\n\n\tif (abortError) {\n\t\tconst commandMatch = rawMessage.match(/in command (\\d+)/);\n\t\tconst command = commandMatch ? parseInt(commandMatch[1], 10) : undefined;\n\n\t\tconst instructionMatch = rawMessage.match(/instruction:\\s*(\\d+)/);\n\t\tconst instruction = instructionMatch ? parseInt(instructionMatch[1], 10) : undefined;\n\n\t\tconst moduleParts = abortError.module_id?.split('::') ?? [];\n\t\tconst pkg = moduleParts[0] ? normalizeSuiAddress(moduleParts[0]) : undefined;\n\t\tconst module = moduleParts[1];\n\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\t$kind: 'MoveAbort',\n\t\t\t\tmessage: formatMoveAbortMessage({\n\t\t\t\t\tcommand,\n\t\t\t\t\tlocation:\n\t\t\t\t\t\tpkg && module\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tpackage: pkg,\n\t\t\t\t\t\t\t\t\tmodule,\n\t\t\t\t\t\t\t\t\tfunctionName: abortError.function ?? undefined,\n\t\t\t\t\t\t\t\t\tinstruction,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\tabortCode: String(abortError.error_code ?? 0),\n\t\t\t\t\tcleverError: abortError.line != null ? { lineNumber: abortError.line } : undefined,\n\t\t\t\t}),\n\t\t\t\tcommand,\n\t\t\t\tMoveAbort: {\n\t\t\t\t\tabortCode: String(abortError.error_code ?? 0),\n\t\t\t\t\tlocation: abortError.module_id\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tpackage: normalizeSuiAddress(abortError.module_id.split('::')[0] ?? ''),\n\t\t\t\t\t\t\t\tmodule: abortError.module_id.split('::')[1] ?? '',\n\t\t\t\t\t\t\t\tfunctionName: abortError.function ?? undefined,\n\t\t\t\t\t\t\t\tinstruction,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\treturn {\n\t\tsuccess: false,\n\t\terror: {\n\t\t\t$kind: 'Unknown',\n\t\t\tmessage: rawMessage,\n\t\t\tUnknown: null,\n\t\t},\n\t};\n}\n\nexport class JSONRpcCoreClient extends CoreClient {\n\t#jsonRpcClient: SuiJsonRpcClient;\n\n\tconstructor({\n\t\tjsonRpcClient,\n\t\tmvr,\n\t}: {\n\t\tjsonRpcClient: SuiJsonRpcClient;\n\t\tmvr?: SuiClientTypes.MvrOptions;\n\t}) {\n\t\tsuper({ network: jsonRpcClient.network, base: jsonRpcClient, mvr });\n\t\tthis.#jsonRpcClient = jsonRpcClient;\n\t}\n\n\tasync getObjects<Include extends SuiClientTypes.ObjectInclude = object>(\n\t\toptions: SuiClientTypes.GetObjectsOptions<Include>,\n\t) {\n\t\tconst batches = chunk(options.objectIds, 50);\n\t\tconst results: SuiClientTypes.GetObjectsResponse<Include>['objects'] = [];\n\t\tfor (const batch of batches) {\n\t\t\tconst objects = await this.#jsonRpcClient.multiGetObjects({\n\t\t\t\tids: batch,\n\t\t\t\toptions: {\n\t\t\t\t\tshowOwner: true,\n\t\t\t\t\tshowType: true,\n\t\t\t\t\tshowBcs: options.include?.content || options.include?.objectBcs ? true : false,\n\t\t\t\t\tshowPreviousTransaction:\n\t\t\t\t\t\toptions.include?.previousTransaction || options.include?.objectBcs ? true : false,\n\t\t\t\t\tshowStorageRebate: options.include?.objectBcs ?? false,\n\t\t\t\t\tshowContent: options.include?.json ?? false,\n\t\t\t\t},\n\t\t\t\tsignal: options.signal,\n\t\t\t});\n\n\t\t\tfor (const [idx, object] of objects.entries()) {\n\t\t\t\tif (object.error) {\n\t\t\t\t\tresults.push(ObjectError.fromResponse(object.error, batch[idx]));\n\t\t\t\t} else {\n\t\t\t\t\tresults.push(parseObject(object.data!, options.include));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tobjects: results,\n\t\t};\n\t}\n\tasync listOwnedObjects<Include extends SuiClientTypes.ObjectInclude = object>(\n\t\toptions: SuiClientTypes.ListOwnedObjectsOptions<Include>,\n\t) {\n\t\tlet filter: SuiObjectDataFilter | null = null;\n\t\tif (options.type) {\n\t\t\tconst parts = options.type.split('::');\n\t\t\tif (parts.length === 1) {\n\t\t\t\tfilter = { Package: options.type };\n\t\t\t} else if (parts.length === 2) {\n\t\t\t\tfilter = { MoveModule: { package: parts[0], module: parts[1] } };\n\t\t\t} else {\n\t\t\t\tfilter = { StructType: options.type };\n\t\t\t}\n\t\t}\n\n\t\tconst objects = await this.#jsonRpcClient.getOwnedObjects({\n\t\t\towner: options.owner,\n\t\t\tlimit: options.limit,\n\t\t\tcursor: options.cursor,\n\t\t\toptions: {\n\t\t\t\tshowOwner: true,\n\t\t\t\tshowType: true,\n\t\t\t\tshowBcs: options.include?.content || options.include?.objectBcs ? true : false,\n\t\t\t\tshowPreviousTransaction:\n\t\t\t\t\toptions.include?.previousTransaction || options.include?.objectBcs ? true : false,\n\t\t\t\tshowStorageRebate: options.include?.objectBcs ?? false,\n\t\t\t\tshowContent: options.include?.json ?? false,\n\t\t\t},\n\t\t\tfilter,\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\treturn {\n\t\t\tobjects: objects.data.map((result) => {\n\t\t\t\tif (result.error) {\n\t\t\t\t\tthrow ObjectError.fromResponse(result.error);\n\t\t\t\t}\n\n\t\t\t\treturn parseObject(result.data!, options.include);\n\t\t\t}),\n\t\t\thasNextPage: objects.hasNextPage,\n\t\t\tcursor: objects.nextCursor ?? null,\n\t\t};\n\t}\n\n\tasync listCoins(options: SuiClientTypes.ListCoinsOptions) {\n\t\tconst coins = await this.#jsonRpcClient.getCoins({\n\t\t\towner: options.owner,\n\t\t\tcoinType: options.coinType,\n\t\t\tlimit: options.limit,\n\t\t\tcursor: options.cursor,\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\treturn {\n\t\t\tobjects: coins.data.map(\n\t\t\t\t(coin): SuiClientTypes.Coin => ({\n\t\t\t\t\tobjectId: coin.coinObjectId,\n\t\t\t\t\tversion: coin.version,\n\t\t\t\t\tdigest: coin.digest,\n\t\t\t\t\tbalance: coin.balance,\n\t\t\t\t\ttype: normalizeStructTag(`0x2::coin::Coin<${coin.coinType}>`),\n\t\t\t\t\towner: {\n\t\t\t\t\t\t$kind: 'AddressOwner' as const,\n\t\t\t\t\t\tAddressOwner: options.owner,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t),\n\t\t\thasNextPage: coins.hasNextPage,\n\t\t\tcursor: coins.nextCursor ?? null,\n\t\t};\n\t}\n\n\tasync getBalance(options: SuiClientTypes.GetBalanceOptions) {\n\t\tconst balance = await this.#jsonRpcClient.getBalance({\n\t\t\towner: options.owner,\n\t\t\tcoinType: options.coinType,\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\tconst addressBalance = balance.fundsInAddressBalance ?? '0';\n\t\tconst coinBalance = String(BigInt(balance.totalBalance) - BigInt(addressBalance));\n\n\t\treturn {\n\t\t\tbalance: {\n\t\t\t\tcoinType: normalizeStructTag(balance.coinType),\n\t\t\t\tbalance: balance.totalBalance,\n\t\t\t\tcoinBalance,\n\t\t\t\taddressBalance,\n\t\t\t},\n\t\t};\n\t}\n\tasync getCoinMetadata(\n\t\toptions: SuiClientTypes.GetCoinMetadataOptions,\n\t): Promise<SuiClientTypes.GetCoinMetadataResponse> {\n\t\tconst coinType = (await this.mvr.resolveType({ type: options.coinType })).type;\n\n\t\tconst result = await this.#jsonRpcClient.getCoinMetadata({\n\t\t\tcoinType,\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\tif (!result) {\n\t\t\treturn { coinMetadata: null };\n\t\t}\n\n\t\treturn {\n\t\t\tcoinMetadata: {\n\t\t\t\tid: result.id ?? null,\n\t\t\t\tdecimals: result.decimals,\n\t\t\t\tname: result.name,\n\t\t\t\tsymbol: result.symbol,\n\t\t\t\tdescription: result.description,\n\t\t\t\ticonUrl: result.iconUrl ?? null,\n\t\t\t},\n\t\t};\n\t}\n\n\tasync listBalances(options: SuiClientTypes.ListBalancesOptions) {\n\t\tconst balances = await this.#jsonRpcClient.getAllBalances({\n\t\t\towner: options.owner,\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\treturn {\n\t\t\tbalances: balances.map((balance) => {\n\t\t\t\tconst addressBalance = balance.fundsInAddressBalance ?? '0';\n\t\t\t\tconst coinBalance = String(BigInt(balance.totalBalance) - BigInt(addressBalance));\n\t\t\t\treturn {\n\t\t\t\t\tcoinType: normalizeStructTag(balance.coinType),\n\t\t\t\t\tbalance: balance.totalBalance,\n\t\t\t\t\tcoinBalance,\n\t\t\t\t\taddressBalance,\n\t\t\t\t};\n\t\t\t}),\n\t\t\thasNextPage: false,\n\t\t\tcursor: null,\n\t\t};\n\t}\n\tasync getTransaction<Include extends SuiClientTypes.TransactionInclude = object>(\n\t\toptions: SuiClientTypes.GetTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\tconst transaction = await this.#jsonRpcClient.getTransactionBlock({\n\t\t\tdigest: options.digest,\n\t\t\toptions: {\n\t\t\t\t// showRawInput is always needed to extract signatures from SenderSignedData\n\t\t\t\tshowRawInput: true,\n\t\t\t\t// showEffects is always needed to get status\n\t\t\t\tshowEffects: true,\n\t\t\t\tshowObjectChanges: options.include?.objectTypes ?? false,\n\t\t\t\tshowRawEffects: options.include?.effects ?? false,\n\t\t\t\tshowEvents: options.include?.events ?? false,\n\t\t\t\tshowBalanceChanges: options.include?.balanceChanges ?? false,\n\t\t\t},\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\treturn parseTransaction(transaction, options.include);\n\t}\n\tasync executeTransaction<Include extends SuiClientTypes.TransactionInclude = object>(\n\t\toptions: SuiClientTypes.ExecuteTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\tconst transaction = await this.#jsonRpcClient.executeTransactionBlock({\n\t\t\ttransactionBlock: options.transaction,\n\t\t\tsignature: options.signatures,\n\t\t\toptions: {\n\t\t\t\t// showRawInput is always needed to extract signatures from SenderSignedData\n\t\t\t\tshowRawInput: true,\n\t\t\t\t// showEffects is always needed to get status\n\t\t\t\tshowEffects: true,\n\t\t\t\tshowRawEffects: options.include?.effects ?? false,\n\t\t\t\tshowEvents: options.include?.events ?? false,\n\t\t\t\tshowObjectChanges: options.include?.objectTypes ?? false,\n\t\t\t\tshowBalanceChanges: options.include?.balanceChanges ?? false,\n\t\t\t},\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\treturn parseTransaction(transaction, options.include);\n\t}\n\tasync simulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude = object>(\n\t\toptions: SuiClientTypes.SimulateTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.SimulateTransactionResult<Include>> {\n\t\tif (!(options.transaction instanceof Uint8Array)) {\n\t\t\tawait options.transaction.prepareForSerialization({ client: this });\n\t\t}\n\n\t\tconst tx = Transaction.from(options.transaction);\n\n\t\tconst data =\n\t\t\toptions.transaction instanceof Uint8Array\n\t\t\t\t? null\n\t\t\t\t: TransactionDataBuilder.restore(options.transaction.getData());\n\n\t\tconst transactionBytes = data\n\t\t\t? data.build({\n\t\t\t\t\toverrides: {\n\t\t\t\t\t\tgasData: {\n\t\t\t\t\t\t\tbudget: data.gasData.budget ?? String(MAX_GAS),\n\t\t\t\t\t\t\tprice: data.gasData.price ?? String(await this.#jsonRpcClient.getReferenceGasPrice()),\n\t\t\t\t\t\t\tpayment: data.gasData.payment ?? [],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t: (options.transaction as Uint8Array);\n\n\t\tconst result = await this.#jsonRpcClient.dryRunTransactionBlock({\n\t\t\ttransactionBlock: transactionBytes,\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\tconst { effects, objectTypes } = parseTransactionEffectsJson({\n\t\t\teffects: result.effects,\n\t\t\tobjectChanges: result.objectChanges,\n\t\t});\n\n\t\tconst transactionData: SuiClientTypes.Transaction<Include> = {\n\t\t\tdigest: TransactionDataBuilder.getDigestFromBytes(transactionBytes),\n\t\t\tepoch: null,\n\t\t\tstatus: effects.status,\n\t\t\teffects: (options.include?.effects\n\t\t\t\t? effects\n\t\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['effects'],\n\t\t\tobjectTypes: (options.include?.objectTypes\n\t\t\t\t? objectTypes\n\t\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['objectTypes'],\n\t\t\tsignatures: [],\n\t\t\ttransaction: (options.include?.transaction\n\t\t\t\t? parseTransactionBcs(\n\t\t\t\t\t\toptions.transaction instanceof Uint8Array\n\t\t\t\t\t\t\t? options.transaction\n\t\t\t\t\t\t\t: await options.transaction\n\t\t\t\t\t\t\t\t\t.build({\n\t\t\t\t\t\t\t\t\t\tclient: this,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.catch(() => null as never),\n\t\t\t\t\t)\n\t\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['transaction'],\n\t\t\tbcs: (options.include?.bcs\n\t\t\t\t? transactionBytes\n\t\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['bcs'],\n\t\t\tbalanceChanges: (options.include?.balanceChanges\n\t\t\t\t? result.balanceChanges.map((change) => ({\n\t\t\t\t\t\tcoinType: normalizeStructTag(change.coinType),\n\t\t\t\t\t\taddress: parseOwnerAddress(change.owner)!,\n\t\t\t\t\t\tamount: change.amount,\n\t\t\t\t\t}))\n\t\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['balanceChanges'],\n\t\t\tevents: (options.include?.events\n\t\t\t\t? (result.events?.map((event) => ({\n\t\t\t\t\t\tpackageId: event.packageId,\n\t\t\t\t\t\tmodule: event.transactionModule,\n\t\t\t\t\t\tsender: event.sender,\n\t\t\t\t\t\teventType: event.type,\n\t\t\t\t\t\tbcs: 'bcs' in event ? fromBase64(event.bcs) : new Uint8Array(),\n\t\t\t\t\t})) ?? [])\n\t\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['events'],\n\t\t};\n\n\t\tlet commandResults: SuiClientTypes.CommandResult[] | undefined;\n\t\tif (options.include?.commandResults) {\n\t\t\ttry {\n\t\t\t\tconst sender = tx.getData().sender ?? normalizeSuiAddress('0x0');\n\t\t\t\tconst devInspectResult = await this.#jsonRpcClient.devInspectTransactionBlock({\n\t\t\t\t\tsender,\n\t\t\t\t\ttransactionBlock: tx,\n\t\t\t\t\tsignal: options.signal,\n\t\t\t\t});\n\n\t\t\t\tif (devInspectResult.results) {\n\t\t\t\t\tcommandResults = devInspectResult.results.map((result) => ({\n\t\t\t\t\t\treturnValues: (result.returnValues ?? []).map(([bytes]) => ({\n\t\t\t\t\t\t\tbcs: new Uint8Array(bytes),\n\t\t\t\t\t\t})),\n\t\t\t\t\t\tmutatedReferences: (result.mutableReferenceOutputs ?? []).map(([, bytes]) => ({\n\t\t\t\t\t\t\tbcs: new Uint8Array(bytes),\n\t\t\t\t\t\t})),\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t}\n\n\t\treturn effects.status.success\n\t\t\t? {\n\t\t\t\t\t$kind: 'Transaction',\n\t\t\t\t\tTransaction: transactionData,\n\t\t\t\t\tcommandResults:\n\t\t\t\t\t\tcommandResults as SuiClientTypes.SimulateTransactionResult<Include>['commandResults'],\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\t$kind: 'FailedTransaction',\n\t\t\t\t\tFailedTransaction: transactionData,\n\t\t\t\t\tcommandResults:\n\t\t\t\t\t\tcommandResults as SuiClientTypes.SimulateTransactionResult<Include>['commandResults'],\n\t\t\t\t};\n\t}\n\tasync getReferenceGasPrice(options?: SuiClientTypes.GetReferenceGasPriceOptions) {\n\t\tconst referenceGasPrice = await this.#jsonRpcClient.getReferenceGasPrice({\n\t\t\tsignal: options?.signal,\n\t\t});\n\n\t\treturn {\n\t\t\treferenceGasPrice: String(referenceGasPrice),\n\t\t};\n\t}\n\n\tasync getCurrentSystemState(\n\t\toptions?: SuiClientTypes.GetCurrentSystemStateOptions,\n\t): Promise<SuiClientTypes.GetCurrentSystemStateResponse> {\n\t\tconst systemState = await this.#jsonRpcClient.getLatestSuiSystemState({\n\t\t\tsignal: options?.signal,\n\t\t});\n\n\t\treturn {\n\t\t\tsystemState: {\n\t\t\t\tsystemStateVersion: systemState.systemStateVersion,\n\t\t\t\tepoch: systemState.epoch,\n\t\t\t\tprotocolVersion: systemState.protocolVersion,\n\t\t\t\treferenceGasPrice: systemState.referenceGasPrice?.toString() ?? (null as never),\n\t\t\t\tepochStartTimestampMs: systemState.epochStartTimestampMs,\n\t\t\t\tsafeMode: systemState.safeMode,\n\t\t\t\tsafeModeStorageRewards: systemState.safeModeStorageRewards,\n\t\t\t\tsafeModeComputationRewards: systemState.safeModeComputationRewards,\n\t\t\t\tsafeModeStorageRebates: systemState.safeModeStorageRebates,\n\t\t\t\tsafeModeNonRefundableStorageFee: systemState.safeModeNonRefundableStorageFee,\n\t\t\t\tparameters: {\n\t\t\t\t\tepochDurationMs: systemState.epochDurationMs,\n\t\t\t\t\tstakeSubsidyStartEpoch: systemState.stakeSubsidyStartEpoch,\n\t\t\t\t\tmaxValidatorCount: systemState.maxValidatorCount,\n\t\t\t\t\tminValidatorJoiningStake: systemState.minValidatorJoiningStake,\n\t\t\t\t\tvalidatorLowStakeThreshold: systemState.validatorLowStakeThreshold,\n\t\t\t\t\tvalidatorLowStakeGracePeriod: systemState.validatorLowStakeGracePeriod,\n\t\t\t\t},\n\t\t\t\tstorageFund: {\n\t\t\t\t\ttotalObjectStorageRebates: systemState.storageFundTotalObjectStorageRebates,\n\t\t\t\t\tnonRefundableBalance: systemState.storageFundNonRefundableBalance,\n\t\t\t\t},\n\t\t\t\tstakeSubsidy: {\n\t\t\t\t\tbalance: systemState.stakeSubsidyBalance,\n\t\t\t\t\tdistributionCounter: systemState.stakeSubsidyDistributionCounter,\n\t\t\t\t\tcurrentDistributionAmount: systemState.stakeSubsidyCurrentDistributionAmount,\n\t\t\t\t\tstakeSubsidyPeriodLength: systemState.stakeSubsidyPeriodLength,\n\t\t\t\t\tstakeSubsidyDecreaseRate: systemState.stakeSubsidyDecreaseRate,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\tasync listDynamicFields(options: SuiClientTypes.ListDynamicFieldsOptions) {\n\t\tconst dynamicFields = await this.#jsonRpcClient.getDynamicFields({\n\t\t\tparentId: options.parentId,\n\t\t\tlimit: options.limit,\n\t\t\tcursor: options.cursor,\n\t\t});\n\n\t\treturn {\n\t\t\tdynamicFields: dynamicFields.data.map((dynamicField) => {\n\t\t\t\tconst isDynamicObject = dynamicField.type === 'DynamicObject';\n\t\t\t\tconst fullType = isDynamicObject\n\t\t\t\t\t? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${dynamicField.name.type}>, 0x2::object::ID>`\n\t\t\t\t\t: `0x2::dynamic_field::Field<${dynamicField.name.type}, ${dynamicField.objectType}>`;\n\n\t\t\t\treturn {\n\t\t\t\t\tfieldId: dynamicField.objectId,\n\t\t\t\t\ttype: normalizeStructTag(fullType),\n\t\t\t\t\tname: {\n\t\t\t\t\t\ttype: dynamicField.name.type,\n\t\t\t\t\t\tbcs: fromBase64(dynamicField.bcsName),\n\t\t\t\t\t},\n\t\t\t\t\tvalueType: dynamicField.objectType,\n\t\t\t\t};\n\t\t\t}),\n\t\t\thasNextPage: dynamicFields.hasNextPage,\n\t\t\tcursor: dynamicFields.nextCursor,\n\t\t};\n\t}\n\n\tasync verifyZkLoginSignature(options: SuiClientTypes.VerifyZkLoginSignatureOptions) {\n\t\tconst result = await this.#jsonRpcClient.verifyZkLoginSignature({\n\t\t\tbytes: options.bytes,\n\t\t\tsignature: options.signature,\n\t\t\tintentScope: options.intentScope,\n\t\t\tauthor: options.address,\n\t\t});\n\n\t\treturn {\n\t\t\tsuccess: result.success,\n\t\t\terrors: result.errors,\n\t\t};\n\t}\n\n\tasync defaultNameServiceName(\n\t\toptions: SuiClientTypes.DefaultNameServiceNameOptions,\n\t): Promise<SuiClientTypes.DefaultNameServiceNameResponse> {\n\t\tconst name = (await this.#jsonRpcClient.resolveNameServiceNames(options)).data[0];\n\t\treturn {\n\t\t\tdata: {\n\t\t\t\tname,\n\t\t\t},\n\t\t};\n\t}\n\n\tresolveTransactionPlugin() {\n\t\treturn coreClientResolveTransactionPlugin;\n\t}\n\n\tasync getMoveFunction(\n\t\toptions: SuiClientTypes.GetMoveFunctionOptions,\n\t): Promise<SuiClientTypes.GetMoveFunctionResponse> {\n\t\tconst resolvedPackageId = (await this.mvr.resolvePackage({ package: options.packageId }))\n\t\t\t.package;\n\t\tconst result = await this.#jsonRpcClient.getNormalizedMoveFunction({\n\t\t\tpackage: resolvedPackageId,\n\t\t\tmodule: options.moduleName,\n\t\t\tfunction: options.name,\n\t\t});\n\n\t\treturn {\n\t\t\tfunction: {\n\t\t\t\tpackageId: normalizeSuiAddress(resolvedPackageId),\n\t\t\t\tmoduleName: options.moduleName,\n\t\t\t\tname: options.name,\n\t\t\t\tvisibility: parseVisibility(result.visibility),\n\t\t\t\tisEntry: result.isEntry,\n\t\t\t\ttypeParameters: result.typeParameters.map((abilities) => ({\n\t\t\t\t\tisPhantom: false,\n\t\t\t\t\tconstraints: parseAbilities(abilities),\n\t\t\t\t})),\n\t\t\t\tparameters: result.parameters.map((param) => parseNormalizedSuiMoveType(param)),\n\t\t\t\treturns: result.return.map((ret) => parseNormalizedSuiMoveType(ret)),\n\t\t\t},\n\t\t};\n\t}\n\n\tasync getChainIdentifier(\n\t\t_options?: SuiClientTypes.GetChainIdentifierOptions,\n\t): Promise<SuiClientTypes.GetChainIdentifierResponse> {\n\t\treturn this.cache.read(['chainIdentifier'], async () => {\n\t\t\tconst checkpoint = await this.#jsonRpcClient.getCheckpoint({ id: '0' });\n\t\t\treturn {\n\t\t\t\tchainIdentifier: checkpoint.digest,\n\t\t\t};\n\t\t});\n\t}\n}\n\nfunction serializeObjectToBcs(object: SuiObjectData): Uint8Array | undefined {\n\tif (object.bcs?.dataType !== 'moveObject') {\n\t\treturn undefined;\n\t}\n\n\ttry {\n\t\t// Normalize the type string to ensure consistent address formatting (0x2 vs 0x00...02)\n\t\tconst typeStr = normalizeStructTag(object.bcs.type);\n\t\tlet moveObjectType: InferBcsInput<typeof bcs.MoveObjectType>;\n\n\t\t// Normalize constants for comparison\n\t\tconst normalizedSuiFramework = normalizeSuiAddress(SUI_FRAMEWORK_ADDRESS);\n\t\tconst gasCoinType = normalizeStructTag(\n\t\t\t`${SUI_FRAMEWORK_ADDRESS}::coin::Coin<${SUI_FRAMEWORK_ADDRESS}::sui::SUI>`,\n\t\t);\n\t\tconst stakedSuiType = normalizeStructTag(`${SUI_SYSTEM_ADDRESS}::staking_pool::StakedSui`);\n\t\tconst coinPrefix = `${normalizedSuiFramework}::coin::Coin<`;\n\n\t\tif (typeStr === gasCoinType) {\n\t\t\tmoveObjectType = { GasCoin: null };\n\t\t} else if (typeStr === stakedSuiType) {\n\t\t\tmoveObjectType = { StakedSui: null };\n\t\t} else if (typeStr.startsWith(coinPrefix)) {\n\t\t\tconst innerTypeMatch = typeStr.match(\n\t\t\t\tnew RegExp(\n\t\t\t\t\t`${normalizedSuiFramework.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}::coin::Coin<(.+)>$`,\n\t\t\t\t),\n\t\t\t);\n\t\t\tif (innerTypeMatch) {\n\t\t\t\tconst innerTypeTag = TypeTagSerializer.parseFromStr(innerTypeMatch[1], true);\n\t\t\t\tmoveObjectType = { Coin: innerTypeTag };\n\t\t\t} else {\n\t\t\t\tthrow new Error('Failed to parse Coin type');\n\t\t\t}\n\t\t} else {\n\t\t\tconst typeTag = TypeTagSerializer.parseFromStr(typeStr, true);\n\t\t\tif (typeof typeTag !== 'object' || !('struct' in typeTag)) {\n\t\t\t\tthrow new Error('Expected struct type tag');\n\t\t\t}\n\t\t\tmoveObjectType = { Other: typeTag.struct };\n\t\t}\n\n\t\tconst contents = fromBase64(object.bcs.bcsBytes);\n\t\tconst owner = convertOwnerToBcs(object.owner!);\n\n\t\treturn bcs.Object.serialize({\n\t\t\tdata: {\n\t\t\t\tMove: {\n\t\t\t\t\ttype: moveObjectType,\n\t\t\t\t\thasPublicTransfer: object.bcs.hasPublicTransfer,\n\t\t\t\t\tversion: object.bcs.version,\n\t\t\t\t\tcontents,\n\t\t\t\t},\n\t\t\t},\n\t\t\towner,\n\t\t\tpreviousTransaction: object.previousTransaction!,\n\t\t\tstorageRebate: object.storageRebate!,\n\t\t}).toBytes();\n\t} catch {\n\t\t// If serialization fails, return undefined\n\t\treturn undefined;\n\t}\n}\n\nfunction parseObject<Include extends SuiClientTypes.ObjectInclude = object>(\n\tobject: SuiObjectData,\n\tinclude?: Include,\n): SuiClientTypes.Object<Include> {\n\tconst bcsContent =\n\t\tobject.bcs?.dataType === 'moveObject' ? fromBase64(object.bcs.bcsBytes) : undefined;\n\n\tconst objectBcs = include?.objectBcs ? serializeObjectToBcs(object) : undefined;\n\n\t// Package objects have type \"package\" which is not a struct tag, so don't normalize it\n\tconst type =\n\t\tobject.type && object.type.includes('::')\n\t\t\t? normalizeStructTag(object.type)\n\t\t\t: (object.type ?? '');\n\n\tconst jsonContent =\n\t\tinclude?.json && object.content?.dataType === 'moveObject'\n\t\t\t? (object.content.fields as Record<string, unknown>)\n\t\t\t: include?.json\n\t\t\t\t? null\n\t\t\t\t: undefined;\n\n\treturn {\n\t\tobjectId: object.objectId,\n\t\tversion: object.version,\n\t\tdigest: object.digest,\n\t\ttype,\n\t\tcontent: (include?.content\n\t\t\t? bcsContent\n\t\t\t: undefined) as SuiClientTypes.Object<Include>['content'],\n\t\towner: parseOwner(object.owner!),\n\t\tpreviousTransaction: (include?.previousTransaction\n\t\t\t? (object.previousTransaction ?? undefined)\n\t\t\t: undefined) as SuiClientTypes.Object<Include>['previousTransaction'],\n\t\tobjectBcs: objectBcs as SuiClientTypes.Object<Include>['objectBcs'],\n\t\tjson: jsonContent as SuiClientTypes.Object<Include>['json'],\n\t};\n}\n\nfunction parseOwner(owner: ObjectOwner): SuiClientTypes.ObjectOwner {\n\tif (owner === 'Immutable') {\n\t\treturn {\n\t\t\t$kind: 'Immutable',\n\t\t\tImmutable: true,\n\t\t};\n\t}\n\n\tif ('ConsensusAddressOwner' in owner) {\n\t\treturn {\n\t\t\t$kind: 'ConsensusAddressOwner',\n\t\t\tConsensusAddressOwner: {\n\t\t\t\towner: owner.ConsensusAddressOwner.owner,\n\t\t\t\tstartVersion: owner.ConsensusAddressOwner.start_version,\n\t\t\t},\n\t\t};\n\t}\n\n\tif ('AddressOwner' in owner) {\n\t\treturn {\n\t\t\t$kind: 'AddressOwner',\n\t\t\tAddressOwner: owner.AddressOwner,\n\t\t};\n\t}\n\n\tif ('ObjectOwner' in owner) {\n\t\treturn {\n\t\t\t$kind: 'ObjectOwner',\n\t\t\tObjectOwner: owner.ObjectOwner,\n\t\t};\n\t}\n\n\tif ('Shared' in owner) {\n\t\treturn {\n\t\t\t$kind: 'Shared',\n\t\t\tShared: {\n\t\t\t\tinitialSharedVersion: owner.Shared.initial_shared_version,\n\t\t\t},\n\t\t};\n\t}\n\n\tthrow new Error(`Unknown owner type: ${JSON.stringify(owner)}`);\n}\n\nfunction convertOwnerToBcs(owner: ObjectOwner) {\n\tif (owner === 'Immutable') {\n\t\treturn { Immutable: null };\n\t}\n\n\tif ('AddressOwner' in owner) {\n\t\treturn { AddressOwner: owner.AddressOwner };\n\t}\n\n\tif ('ObjectOwner' in owner) {\n\t\treturn { ObjectOwner: owner.ObjectOwner };\n\t}\n\n\tif ('Shared' in owner) {\n\t\treturn {\n\t\t\tShared: { initialSharedVersion: owner.Shared.initial_shared_version },\n\t\t};\n\t}\n\n\tif (typeof owner === 'object' && owner !== null && 'ConsensusAddressOwner' in owner) {\n\t\treturn {\n\t\t\tConsensusAddressOwner: {\n\t\t\t\tstartVersion: owner.ConsensusAddressOwner.start_version,\n\t\t\t\towner: owner.ConsensusAddressOwner.owner,\n\t\t\t},\n\t\t};\n\t}\n\n\tthrow new Error(`Unknown owner type: ${JSON.stringify(owner)}`);\n}\n\nfunction parseOwnerAddress(owner: ObjectOwner): string | null {\n\tif (owner === 'Immutable') {\n\t\treturn null;\n\t}\n\n\tif ('ConsensusAddressOwner' in owner) {\n\t\treturn owner.ConsensusAddressOwner.owner;\n\t}\n\n\tif ('AddressOwner' in owner) {\n\t\treturn owner.AddressOwner;\n\t}\n\n\tif ('ObjectOwner' in owner) {\n\t\treturn owner.ObjectOwner;\n\t}\n\n\tif ('Shared' in owner) {\n\t\treturn null;\n\t}\n\n\tthrow new Error(`Unknown owner type: ${JSON.stringify(owner)}`);\n}\n\nfunction parseTransaction<Include extends SuiClientTypes.TransactionInclude = object>(\n\ttransaction: SuiTransactionBlockResponse,\n\tinclude?: Include,\n): SuiClientTypes.TransactionResult<Include> {\n\tconst objectTypes: Record<string, string> = {};\n\n\tif (include?.objectTypes) {\n\t\ttransaction.objectChanges?.forEach((change) => {\n\t\t\tif (change.type !== 'published') {\n\t\t\t\tobjectTypes[change.objectId] = normalizeStructTag(change.objectType);\n\t\t\t}\n\t\t});\n\t}\n\n\tlet transactionData: SuiClientTypes.TransactionData | undefined;\n\tlet signatures: string[] = [];\n\tlet bcsBytes: Uint8Array | undefined;\n\n\tif (transaction.rawTransaction) {\n\t\tconst parsedTx = bcs.SenderSignedData.parse(fromBase64(transaction.rawTransaction))[0];\n\t\tsignatures = parsedTx.txSignatures;\n\n\t\tif (include?.transaction || include?.bcs) {\n\t\t\tconst bytes = bcs.TransactionData.serialize(parsedTx.intentMessage.value).toBytes();\n\n\t\t\tif (include?.bcs) {\n\t\t\t\tbcsBytes = bytes;\n\t\t\t}\n\n\t\t\tif (include?.transaction) {\n\t\t\t\tconst data = TransactionDataBuilder.restore({\n\t\t\t\t\tversion: 2,\n\t\t\t\t\tsender: parsedTx.intentMessage.value.V1.sender,\n\t\t\t\t\texpiration: parsedTx.intentMessage.value.V1.expiration,\n\t\t\t\t\tgasData: parsedTx.intentMessage.value.V1.gasData,\n\t\t\t\t\tinputs: parsedTx.intentMessage.value.V1.kind.ProgrammableTransaction!.inputs,\n\t\t\t\t\tcommands: parsedTx.intentMessage.value.V1.kind.ProgrammableTransaction!.commands,\n\t\t\t\t});\n\t\t\t\ttransactionData = { ...data };\n\t\t\t}\n\t\t}\n\t}\n\n\t// Get status from JSON-RPC response\n\tconst status: SuiClientTypes.ExecutionStatus = transaction.effects?.status\n\t\t? parseJsonRpcExecutionStatus(transaction.effects.status, transaction.effects.abortError)\n\t\t: {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\t$kind: 'Unknown',\n\t\t\t\t\tmessage: 'Unknown',\n\t\t\t\t\tUnknown: null,\n\t\t\t\t},\n\t\t\t};\n\n\tconst effectsBytes = transaction.rawEffects ? new Uint8Array(transaction.rawEffects) : null;\n\n\tconst result: SuiClientTypes.Transaction<Include> = {\n\t\tdigest: transaction.digest,\n\t\tepoch: transaction.effects?.executedEpoch ?? null,\n\t\tstatus,\n\t\teffects: (include?.effects && effectsBytes\n\t\t\t? parseTransactionEffectsBcs(effectsBytes)\n\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['effects'],\n\t\tobjectTypes: (include?.objectTypes\n\t\t\t? objectTypes\n\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['objectTypes'],\n\t\ttransaction: transactionData as SuiClientTypes.Transaction<Include>['transaction'],\n\t\tbcs: bcsBytes as SuiClientTypes.Transaction<Include>['bcs'],\n\t\tsignatures,\n\t\tbalanceChanges: (include?.balanceChanges\n\t\t\t? (transaction.balanceChanges?.map((change) => ({\n\t\t\t\t\tcoinType: normalizeStructTag(change.coinType),\n\t\t\t\t\taddress: parseOwnerAddress(change.owner)!,\n\t\t\t\t\tamount: change.amount,\n\t\t\t\t})) ?? [])\n\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['balanceChanges'],\n\t\tevents: (include?.events\n\t\t\t? (transaction.events?.map((event) => ({\n\t\t\t\t\tpackageId: event.packageId,\n\t\t\t\t\tmodule: event.transactionModule,\n\t\t\t\t\tsender: event.sender,\n\t\t\t\t\teventType: event.type,\n\t\t\t\t\tbcs: 'bcs' in event ? fromBase64(event.bcs) : new Uint8Array(),\n\t\t\t\t})) ?? [])\n\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['events'],\n\t};\n\n\treturn status.success\n\t\t? {\n\t\t\t\t$kind: 'Transaction',\n\t\t\t\tTransaction: result,\n\t\t\t}\n\t\t: {\n\t\t\t\t$kind: 'FailedTransaction',\n\t\t\t\tFailedTransaction: result,\n\t\t\t};\n}\n\nfunction parseTransactionEffectsJson({\n\tbytes,\n\teffects,\n\tobjectChanges,\n}: {\n\tbytes?: Uint8Array;\n\teffects: TransactionEffects;\n\tobjectChanges: SuiObjectChange[] | null;\n}): {\n\teffects: SuiClientTypes.TransactionEffects;\n\tobjectTypes: Record<string, string>;\n} {\n\tconst changedObjects: SuiClientTypes.ChangedObject[] = [];\n\tconst unchangedConsensusObjects: SuiClientTypes.UnchangedConsensusObject[] = [];\n\tconst objectTypes: Record<string, string> = {};\n\n\tobjectChanges?.forEach((change) => {\n\t\tswitch (change.type) {\n\t\t\tcase 'published':\n\t\t\t\tchangedObjects.push({\n\t\t\t\t\tobjectId: change.packageId,\n\t\t\t\t\tinputState: 'DoesNotExist',\n\t\t\t\t\tinputVersion: null,\n\t\t\t\t\tinputDigest: null,\n\t\t\t\t\tinputOwner: null,\n\t\t\t\t\toutputState: 'PackageWrite',\n\t\t\t\t\toutputVersion: change.version,\n\t\t\t\t\toutputDigest: change.digest,\n\t\t\t\t\toutputOwner: null,\n\t\t\t\t\tidOperation: 'Created',\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'transferred':\n\t\t\t\tchangedObjects.push({\n\t\t\t\t\tobjectId: change.objectId,\n\t\t\t\t\tinputState: 'Exists',\n\t\t\t\t\tinputVersion: change.version,\n\t\t\t\t\tinputDigest: change.digest,\n\t\t\t\t\tinputOwner: {\n\t\t\t\t\t\t$kind: 'AddressOwner' as const,\n\t\t\t\t\t\tAddressOwner: change.sender,\n\t\t\t\t\t},\n\t\t\t\t\toutputState: 'ObjectWrite',\n\t\t\t\t\toutputVersion: change.version,\n\t\t\t\t\toutputDigest: change.digest,\n\t\t\t\t\toutputOwner: parseOwner(change.recipient),\n\t\t\t\t\tidOperation: 'None',\n\t\t\t\t});\n\t\t\t\tobjectTypes[change.objectId] = normalizeStructTag(change.objectType);\n\t\t\t\tbreak;\n\t\t\tcase 'mutated':\n\t\t\t\tchangedObjects.push({\n\t\t\t\t\tobjectId: change.objectId,\n\t\t\t\t\tinputState: 'Exists',\n\t\t\t\t\tinputVersion: change.previousVersion,\n\t\t\t\t\tinputDigest: null,\n\t\t\t\t\tinputOwner: parseOwner(change.owner),\n\t\t\t\t\toutputState: 'ObjectWrite',\n\t\t\t\t\toutputVersion: change.version,\n\t\t\t\t\toutputDigest: change.digest,\n\t\t\t\t\toutputOwner: parseOwner(change.owner),\n\t\t\t\t\tidOperation: 'None',\n\t\t\t\t});\n\t\t\t\tobjectTypes[change.objectId] = normalizeStructTag(change.objectType);\n\t\t\t\tbreak;\n\t\t\tcase 'deleted':\n\t\t\t\tchangedObjects.push({\n\t\t\t\t\tobjectId: change.objectId,\n\t\t\t\t\tinputState: 'Exists',\n\t\t\t\t\tinputVersion: change.version,\n\t\t\t\t\tinputDigest: effects.deleted?.find((d) => d.objectId === change.objectId)?.digest ?? null,\n\t\t\t\t\tinputOwner: null,\n\t\t\t\t\toutputState: 'DoesNotExist',\n\t\t\t\t\toutputVersion: null,\n\t\t\t\t\toutputDigest: null,\n\t\t\t\t\toutputOwner: null,\n\t\t\t\t\tidOperation: 'Deleted',\n\t\t\t\t});\n\t\t\t\tobjectTypes[change.objectId] = normalizeStructTag(change.objectType);\n\t\t\t\tbreak;\n\t\t\tcase 'wrapped':\n\t\t\t\tchangedObjects.push({\n\t\t\t\t\tobjectId: change.objectId,\n\t\t\t\t\tinputState: 'Exists',\n\t\t\t\t\tinputVersion: change.version,\n\t\t\t\t\tinputDigest: null,\n\t\t\t\t\tinputOwner: {\n\t\t\t\t\t\t$kind: 'AddressOwner' as const,\n\t\t\t\t\t\tAddressOwner: change.sender,\n\t\t\t\t\t},\n\t\t\t\t\toutputState: 'ObjectWrite',\n\t\t\t\t\toutputVersion: change.version,\n\t\t\t\t\toutputDigest:\n\t\t\t\t\t\teffects.wrapped?.find((w) => w.objectId === change.objectId)?.digest ?? null,\n\t\t\t\t\toutputOwner: {\n\t\t\t\t\t\t$kind: 'ObjectOwner' as const,\n\t\t\t\t\t\tObjectOwner: change.sender,\n\t\t\t\t\t},\n\t\t\t\t\tidOperation: 'None',\n\t\t\t\t});\n\t\t\t\tobjectTypes[change.objectId] = normalizeStructTag(change.objectType);\n\t\t\t\tbreak;\n\t\t\tcase 'created':\n\t\t\t\tchangedObjects.push({\n\t\t\t\t\tobjectId: change.objectId,\n\t\t\t\t\tinputState: 'DoesNotExist',\n\t\t\t\t\tinputVersion: null,\n\t\t\t\t\tinputDigest: null,\n\t\t\t\t\tinputOwner: null,\n\t\t\t\t\toutputState: 'ObjectWrite',\n\t\t\t\t\toutputVersion: change.version,\n\t\t\t\t\toutputDigest: change.digest,\n\t\t\t\t\toutputOwner: parseOwner(change.owner),\n\t\t\t\t\tidOperation: 'Created',\n\t\t\t\t});\n\t\t\t\tobjectTypes[change.objectId] = normalizeStructTag(change.objectType);\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n\treturn {\n\t\tobjectTypes,\n\t\teffects: {\n\t\t\tbcs: bytes ?? null,\n\t\t\tversion: 2,\n\t\t\tstatus: parseJsonRpcExecutionStatus(effects.status, effects.abortError),\n\t\t\tgasUsed: effects.gasUsed,\n\t\t\ttransactionDigest: effects.transactionDigest,\n\t\t\tgasObject: {\n\t\t\t\tobjectId: effects.gasObject?.reference.objectId,\n\t\t\t\tinputState: 'Exists',\n\t\t\t\tinputVersion: null,\n\t\t\t\tinputDigest: null,\n\t\t\t\tinputOwner: null,\n\t\t\t\toutputState: 'ObjectWrite',\n\t\t\t\toutputVersion: effects.gasObject.reference.version,\n\t\t\t\toutputDigest: effects.gasObject.reference.digest,\n\t\t\t\toutputOwner: parseOwner(effects.gasObject.owner),\n\t\t\t\tidOperation: 'None',\n\t\t\t},\n\t\t\teventsDigest: effects.eventsDigest ?? null,\n\t\t\tdependencies: effects.dependencies ?? [],\n\t\t\tlamportVersion: effects.gasObject.reference.version,\n\t\t\tchangedObjects,\n\t\t\tunchangedConsensusObjects,\n\t\t\tauxiliaryDataDigest: null,\n\t\t},\n\t};\n}\n\nfunction parseNormalizedSuiMoveType(type: SuiMoveNormalizedType): SuiClientTypes.OpenSignature {\n\tif (typeof type !== 'string') {\n\t\tif ('Reference' in type) {\n\t\t\treturn {\n\t\t\t\treference: 'immutable',\n\t\t\t\tbody: parseNormalizedSuiMoveTypeBody(type.Reference),\n\t\t\t};\n\t\t}\n\n\t\tif ('MutableReference' in type) {\n\t\t\treturn {\n\t\t\t\treference: 'mutable',\n\t\t\t\tbody: parseNormalizedSuiMoveTypeBody(type.MutableReference),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn {\n\t\treference: null,\n\t\tbody: parseNormalizedSuiMoveTypeBody(type),\n\t};\n}\n\nfunction parseNormalizedSuiMoveTypeBody(\n\ttype: SuiMoveNormalizedType,\n): SuiClientTypes.OpenSignatureBody {\n\tswitch (type) {\n\t\tcase 'Address':\n\t\t\treturn { $kind: 'address' };\n\t\tcase 'Bool':\n\t\t\treturn { $kind: 'bool' };\n\t\tcase 'U8':\n\t\t\treturn { $kind: 'u8' };\n\t\tcase 'U16':\n\t\t\treturn { $kind: 'u16' };\n\t\tcase 'U32':\n\t\t\treturn { $kind: 'u32' };\n\t\tcase 'U64':\n\t\t\treturn { $kind: 'u64' };\n\t\tcase 'U128':\n\t\t\treturn { $kind: 'u128' };\n\t\tcase 'U256':\n\t\t\treturn { $kind: 'u256' };\n\t}\n\n\tif (typeof type === 'string') {\n\t\tthrow new Error(`Unknown type: ${type}`);\n\t}\n\n\tif ('Vector' in type) {\n\t\treturn {\n\t\t\t$kind: 'vector',\n\t\t\tvector: parseNormalizedSuiMoveTypeBody(type.Vector),\n\t\t};\n\t}\n\n\tif ('Struct' in type) {\n\t\treturn {\n\t\t\t$kind: 'datatype',\n\t\t\tdatatype: {\n\t\t\t\ttypeName: `${normalizeSuiAddress(type.Struct.address)}::${type.Struct.module}::${type.Struct.name}`,\n\t\t\t\ttypeParameters: type.Struct.typeArguments.map((t) => parseNormalizedSuiMoveTypeBody(t)),\n\t\t\t},\n\t\t};\n\t}\n\n\tif ('TypeParameter' in type) {\n\t\treturn {\n\t\t\t$kind: 'typeParameter',\n\t\t\tindex: type.TypeParameter,\n\t\t};\n\t}\n\n\tthrow new Error(`Unknown type: ${JSON.stringify(type)}`);\n}\n\nfunction parseAbilities(abilitySet: SuiMoveAbilitySet): SuiClientTypes.Ability[] {\n\treturn abilitySet.abilities.map((ability) => {\n\t\tswitch (ability) {\n\t\t\tcase 'Copy':\n\t\t\t\treturn 'copy';\n\t\t\tcase 'Drop':\n\t\t\t\treturn 'drop';\n\t\t\tcase 'Store':\n\t\t\t\treturn 'store';\n\t\t\tcase 'Key':\n\t\t\t\treturn 'key';\n\t\t\tdefault:\n\t\t\t\treturn 'unknown';\n\t\t}\n\t});\n}\n\nfunction parseVisibility(visibility: SuiMoveVisibility): SuiClientTypes.Visibility {\n\tswitch (visibility) {\n\t\tcase 'Public':\n\t\t\treturn 'public';\n\t\tcase 'Private':\n\t\t\treturn 'private';\n\t\tcase 'Friend':\n\t\t\treturn 'friend';\n\t\tdefault:\n\t\t\treturn 'unknown';\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAmCA,MAAM,UAAU;AAEhB,SAAS,4BACR,QACA,YACiC;AACjC,KAAI,OAAO,WAAW,UACrB,QAAO;EAAE,SAAS;EAAM,OAAO;EAAM;CAGtC,MAAM,aAAa,OAAO,SAAS;AAEnC,KAAI,YAAY;EACf,MAAM,eAAe,WAAW,MAAM,mBAAmB;EACzD,MAAM,UAAU,eAAe,SAAS,aAAa,IAAI,GAAG,GAAG;EAE/D,MAAM,mBAAmB,WAAW,MAAM,uBAAuB;EACjE,MAAM,cAAc,mBAAmB,SAAS,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O;GACR,KAAK,QACJ,QAAO;GACR,KAAK,MACJ,QAAO;GACR,QACC,QAAO;;GAER;;AAGH,SAAS,gBAAgB,YAA0D;AAClF,SAAQ,YAAR;EACC,KAAK,SACJ,QAAO;EACR,KAAK,UACJ,QAAO;EACR,KAAK,SACJ,QAAO;EACR,QACC,QAAO"}
|
|
1
|
+
{"version":3,"file":"core.mjs","names":["#jsonRpcClient","result","bcs"],"sources":["../../src/jsonRpc/core.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { fromBase64, type InferBcsInput } from '@mysten/bcs';\n\nimport { bcs, TypeTagSerializer } from '../bcs/index.js';\nimport type {\n\tExecutionStatus as JsonRpcExecutionStatus,\n\tObjectOwner,\n\tSuiMoveAbilitySet,\n\tSuiMoveAbort,\n\tSuiMoveNormalizedType,\n\tSuiMoveVisibility,\n\tSuiObjectChange,\n\tSuiObjectData,\n\tSuiObjectDataFilter,\n\tSuiTransactionBlockResponse,\n\tTransactionEffects,\n} from './types/index.js';\nimport { Transaction } from '../transactions/Transaction.js';\nimport { coreClientResolveTransactionPlugin } from '../client/core-resolver.js';\nimport { TransactionDataBuilder } from '../transactions/TransactionData.js';\nimport { chunk } from '@mysten/utils';\nimport { normalizeSuiAddress, normalizeStructTag } from '../utils/sui-types.js';\nimport { deriveDynamicFieldID } from '../utils/dynamic-fields.js';\nimport { SUI_FRAMEWORK_ADDRESS, SUI_SYSTEM_ADDRESS } from '../utils/constants.js';\nimport { CoreClient } from '../client/core.js';\nimport type { SuiClientTypes } from '../client/types.js';\nimport { ObjectError } from '../client/errors.js';\nimport {\n\tformatMoveAbortMessage,\n\tparseTransactionBcs,\n\tparseTransactionEffectsBcs,\n} from '../client/index.js';\nimport type { SuiJsonRpcClient } from './client.js';\n\nconst MAX_GAS = 50_000_000_000;\n\nfunction parseJsonRpcExecutionStatus(\n\tstatus: JsonRpcExecutionStatus,\n\tabortError?: SuiMoveAbort | null,\n): SuiClientTypes.ExecutionStatus {\n\tif (status.status === 'success') {\n\t\treturn { success: true, error: null };\n\t}\n\n\tconst rawMessage = status.error ?? 'Unknown';\n\n\tif (abortError) {\n\t\tconst commandMatch = rawMessage.match(/in command (\\d+)/);\n\t\tconst command = commandMatch ? parseInt(commandMatch[1], 10) : undefined;\n\n\t\tconst instructionMatch = rawMessage.match(/instruction:\\s*(\\d+)/);\n\t\tconst instruction = instructionMatch ? parseInt(instructionMatch[1], 10) : undefined;\n\n\t\tconst moduleParts = abortError.module_id?.split('::') ?? [];\n\t\tconst pkg = moduleParts[0] ? normalizeSuiAddress(moduleParts[0]) : undefined;\n\t\tconst module = moduleParts[1];\n\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\t$kind: 'MoveAbort',\n\t\t\t\tmessage: formatMoveAbortMessage({\n\t\t\t\t\tcommand,\n\t\t\t\t\tlocation:\n\t\t\t\t\t\tpkg && module\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tpackage: pkg,\n\t\t\t\t\t\t\t\t\tmodule,\n\t\t\t\t\t\t\t\t\tfunctionName: abortError.function ?? undefined,\n\t\t\t\t\t\t\t\t\tinstruction,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\tabortCode: String(abortError.error_code ?? 0),\n\t\t\t\t\tcleverError: abortError.line != null ? { lineNumber: abortError.line } : undefined,\n\t\t\t\t}),\n\t\t\t\tcommand,\n\t\t\t\tMoveAbort: {\n\t\t\t\t\tabortCode: String(abortError.error_code ?? 0),\n\t\t\t\t\tlocation: abortError.module_id\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tpackage: normalizeSuiAddress(abortError.module_id.split('::')[0] ?? ''),\n\t\t\t\t\t\t\t\tmodule: abortError.module_id.split('::')[1] ?? '',\n\t\t\t\t\t\t\t\tfunctionName: abortError.function ?? undefined,\n\t\t\t\t\t\t\t\tinstruction,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\treturn {\n\t\tsuccess: false,\n\t\terror: {\n\t\t\t$kind: 'Unknown',\n\t\t\tmessage: rawMessage,\n\t\t\tUnknown: null,\n\t\t},\n\t};\n}\n\nexport class JSONRpcCoreClient extends CoreClient {\n\t#jsonRpcClient: SuiJsonRpcClient;\n\n\tconstructor({\n\t\tjsonRpcClient,\n\t\tmvr,\n\t}: {\n\t\tjsonRpcClient: SuiJsonRpcClient;\n\t\tmvr?: SuiClientTypes.MvrOptions;\n\t}) {\n\t\tsuper({ network: jsonRpcClient.network, base: jsonRpcClient, mvr });\n\t\tthis.#jsonRpcClient = jsonRpcClient;\n\t}\n\n\tasync getObjects<Include extends SuiClientTypes.ObjectInclude = object>(\n\t\toptions: SuiClientTypes.GetObjectsOptions<Include>,\n\t) {\n\t\tconst batches = chunk(options.objectIds, 50);\n\t\tconst results: SuiClientTypes.GetObjectsResponse<Include>['objects'] = [];\n\t\tfor (const batch of batches) {\n\t\t\tconst objects = await this.#jsonRpcClient.multiGetObjects({\n\t\t\t\tids: batch,\n\t\t\t\toptions: {\n\t\t\t\t\tshowOwner: true,\n\t\t\t\t\tshowType: true,\n\t\t\t\t\tshowBcs: options.include?.content || options.include?.objectBcs ? true : false,\n\t\t\t\t\tshowPreviousTransaction:\n\t\t\t\t\t\toptions.include?.previousTransaction || options.include?.objectBcs ? true : false,\n\t\t\t\t\tshowStorageRebate: options.include?.objectBcs ?? false,\n\t\t\t\t\tshowContent: options.include?.json ?? false,\n\t\t\t\t},\n\t\t\t\tsignal: options.signal,\n\t\t\t});\n\n\t\t\tfor (const [idx, object] of objects.entries()) {\n\t\t\t\tif (object.error) {\n\t\t\t\t\tresults.push(ObjectError.fromResponse(object.error, batch[idx]));\n\t\t\t\t} else {\n\t\t\t\t\tresults.push(parseObject(object.data!, options.include));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tobjects: results,\n\t\t};\n\t}\n\tasync listOwnedObjects<Include extends SuiClientTypes.ObjectInclude = object>(\n\t\toptions: SuiClientTypes.ListOwnedObjectsOptions<Include>,\n\t) {\n\t\tlet filter: SuiObjectDataFilter | null = null;\n\t\tif (options.type) {\n\t\t\tconst parts = options.type.split('::');\n\t\t\tif (parts.length === 1) {\n\t\t\t\tfilter = { Package: options.type };\n\t\t\t} else if (parts.length === 2) {\n\t\t\t\tfilter = { MoveModule: { package: parts[0], module: parts[1] } };\n\t\t\t} else {\n\t\t\t\tfilter = { StructType: options.type };\n\t\t\t}\n\t\t}\n\n\t\tconst objects = await this.#jsonRpcClient.getOwnedObjects({\n\t\t\towner: options.owner,\n\t\t\tlimit: options.limit,\n\t\t\tcursor: options.cursor,\n\t\t\toptions: {\n\t\t\t\tshowOwner: true,\n\t\t\t\tshowType: true,\n\t\t\t\tshowBcs: options.include?.content || options.include?.objectBcs ? true : false,\n\t\t\t\tshowPreviousTransaction:\n\t\t\t\t\toptions.include?.previousTransaction || options.include?.objectBcs ? true : false,\n\t\t\t\tshowStorageRebate: options.include?.objectBcs ?? false,\n\t\t\t\tshowContent: options.include?.json ?? false,\n\t\t\t},\n\t\t\tfilter,\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\treturn {\n\t\t\tobjects: objects.data.map((result) => {\n\t\t\t\tif (result.error) {\n\t\t\t\t\tthrow ObjectError.fromResponse(result.error);\n\t\t\t\t}\n\n\t\t\t\treturn parseObject(result.data!, options.include);\n\t\t\t}),\n\t\t\thasNextPage: objects.hasNextPage,\n\t\t\tcursor: objects.nextCursor ?? null,\n\t\t};\n\t}\n\n\tasync listCoins(options: SuiClientTypes.ListCoinsOptions) {\n\t\tconst coins = await this.#jsonRpcClient.getCoins({\n\t\t\towner: options.owner,\n\t\t\tcoinType: options.coinType,\n\t\t\tlimit: options.limit,\n\t\t\tcursor: options.cursor,\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\treturn {\n\t\t\tobjects: coins.data.map(\n\t\t\t\t(coin): SuiClientTypes.Coin => ({\n\t\t\t\t\tobjectId: coin.coinObjectId,\n\t\t\t\t\tversion: coin.version,\n\t\t\t\t\tdigest: coin.digest,\n\t\t\t\t\tbalance: coin.balance,\n\t\t\t\t\ttype: normalizeStructTag(`0x2::coin::Coin<${coin.coinType}>`),\n\t\t\t\t\towner: {\n\t\t\t\t\t\t$kind: 'AddressOwner' as const,\n\t\t\t\t\t\tAddressOwner: options.owner,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t),\n\t\t\thasNextPage: coins.hasNextPage,\n\t\t\tcursor: coins.nextCursor ?? null,\n\t\t};\n\t}\n\n\tasync getBalance(options: SuiClientTypes.GetBalanceOptions) {\n\t\tconst balance = await this.#jsonRpcClient.getBalance({\n\t\t\towner: options.owner,\n\t\t\tcoinType: options.coinType,\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\tconst addressBalance = balance.fundsInAddressBalance ?? '0';\n\t\tconst coinBalance = String(BigInt(balance.totalBalance) - BigInt(addressBalance));\n\n\t\treturn {\n\t\t\tbalance: {\n\t\t\t\tcoinType: normalizeStructTag(balance.coinType),\n\t\t\t\tbalance: balance.totalBalance,\n\t\t\t\tcoinBalance,\n\t\t\t\taddressBalance,\n\t\t\t},\n\t\t};\n\t}\n\tasync getCoinMetadata(\n\t\toptions: SuiClientTypes.GetCoinMetadataOptions,\n\t): Promise<SuiClientTypes.GetCoinMetadataResponse> {\n\t\tconst coinType = (await this.mvr.resolveType({ type: options.coinType })).type;\n\n\t\tconst result = await this.#jsonRpcClient.getCoinMetadata({\n\t\t\tcoinType,\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\tif (!result) {\n\t\t\treturn { coinMetadata: null };\n\t\t}\n\n\t\treturn {\n\t\t\tcoinMetadata: {\n\t\t\t\tid: result.id ?? null,\n\t\t\t\tdecimals: result.decimals,\n\t\t\t\tname: result.name,\n\t\t\t\tsymbol: result.symbol,\n\t\t\t\tdescription: result.description,\n\t\t\t\ticonUrl: result.iconUrl ?? null,\n\t\t\t},\n\t\t};\n\t}\n\n\tasync listBalances(options: SuiClientTypes.ListBalancesOptions) {\n\t\tconst balances = await this.#jsonRpcClient.getAllBalances({\n\t\t\towner: options.owner,\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\treturn {\n\t\t\tbalances: balances.map((balance) => {\n\t\t\t\tconst addressBalance = balance.fundsInAddressBalance ?? '0';\n\t\t\t\tconst coinBalance = String(BigInt(balance.totalBalance) - BigInt(addressBalance));\n\t\t\t\treturn {\n\t\t\t\t\tcoinType: normalizeStructTag(balance.coinType),\n\t\t\t\t\tbalance: balance.totalBalance,\n\t\t\t\t\tcoinBalance,\n\t\t\t\t\taddressBalance,\n\t\t\t\t};\n\t\t\t}),\n\t\t\thasNextPage: false,\n\t\t\tcursor: null,\n\t\t};\n\t}\n\tasync getTransaction<Include extends SuiClientTypes.TransactionInclude = object>(\n\t\toptions: SuiClientTypes.GetTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\tconst transaction = await this.#jsonRpcClient.getTransactionBlock({\n\t\t\tdigest: options.digest,\n\t\t\toptions: {\n\t\t\t\t// showRawInput is always needed to extract signatures from SenderSignedData\n\t\t\t\tshowRawInput: true,\n\t\t\t\t// showEffects is always needed to get status\n\t\t\t\tshowEffects: true,\n\t\t\t\tshowObjectChanges: options.include?.objectTypes ?? false,\n\t\t\t\tshowRawEffects: options.include?.effects ?? false,\n\t\t\t\tshowEvents: options.include?.events ?? false,\n\t\t\t\tshowBalanceChanges: options.include?.balanceChanges ?? false,\n\t\t\t},\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\treturn parseTransaction(transaction, options.include);\n\t}\n\tasync executeTransaction<Include extends SuiClientTypes.TransactionInclude = object>(\n\t\toptions: SuiClientTypes.ExecuteTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\tconst transaction = await this.#jsonRpcClient.executeTransactionBlock({\n\t\t\ttransactionBlock: options.transaction,\n\t\t\tsignature: options.signatures,\n\t\t\toptions: {\n\t\t\t\t// showRawInput is always needed to extract signatures from SenderSignedData\n\t\t\t\tshowRawInput: true,\n\t\t\t\t// showEffects is always needed to get status\n\t\t\t\tshowEffects: true,\n\t\t\t\tshowRawEffects: options.include?.effects ?? false,\n\t\t\t\tshowEvents: options.include?.events ?? false,\n\t\t\t\tshowObjectChanges: options.include?.objectTypes ?? false,\n\t\t\t\tshowBalanceChanges: options.include?.balanceChanges ?? false,\n\t\t\t},\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\treturn parseTransaction(transaction, options.include);\n\t}\n\tasync simulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude = object>(\n\t\toptions: SuiClientTypes.SimulateTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.SimulateTransactionResult<Include>> {\n\t\tif (!(options.transaction instanceof Uint8Array)) {\n\t\t\tawait options.transaction.prepareForSerialization({ client: this });\n\t\t}\n\n\t\tconst tx = Transaction.from(options.transaction);\n\n\t\tconst data =\n\t\t\toptions.transaction instanceof Uint8Array\n\t\t\t\t? null\n\t\t\t\t: TransactionDataBuilder.restore(options.transaction.getData());\n\n\t\tconst transactionBytes = data\n\t\t\t? data.build({\n\t\t\t\t\toverrides: {\n\t\t\t\t\t\tgasData: {\n\t\t\t\t\t\t\tbudget: data.gasData.budget ?? String(MAX_GAS),\n\t\t\t\t\t\t\tprice: data.gasData.price ?? String(await this.#jsonRpcClient.getReferenceGasPrice()),\n\t\t\t\t\t\t\tpayment: data.gasData.payment ?? [],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t: (options.transaction as Uint8Array);\n\n\t\tconst result = await this.#jsonRpcClient.dryRunTransactionBlock({\n\t\t\ttransactionBlock: transactionBytes,\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\tconst { effects, objectTypes } = parseTransactionEffectsJson({\n\t\t\teffects: result.effects,\n\t\t\tobjectChanges: result.objectChanges,\n\t\t});\n\n\t\tconst transactionData: SuiClientTypes.Transaction<Include> = {\n\t\t\tdigest: TransactionDataBuilder.getDigestFromBytes(transactionBytes),\n\t\t\tepoch: null,\n\t\t\tstatus: effects.status,\n\t\t\teffects: (options.include?.effects\n\t\t\t\t? effects\n\t\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['effects'],\n\t\t\tobjectTypes: (options.include?.objectTypes\n\t\t\t\t? objectTypes\n\t\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['objectTypes'],\n\t\t\tsignatures: [],\n\t\t\ttransaction: (options.include?.transaction\n\t\t\t\t? parseTransactionBcs(\n\t\t\t\t\t\toptions.transaction instanceof Uint8Array\n\t\t\t\t\t\t\t? options.transaction\n\t\t\t\t\t\t\t: await options.transaction\n\t\t\t\t\t\t\t\t\t.build({\n\t\t\t\t\t\t\t\t\t\tclient: this,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.catch(() => null as never),\n\t\t\t\t\t)\n\t\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['transaction'],\n\t\t\tbcs: (options.include?.bcs\n\t\t\t\t? transactionBytes\n\t\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['bcs'],\n\t\t\tbalanceChanges: (options.include?.balanceChanges\n\t\t\t\t? result.balanceChanges.map((change) => ({\n\t\t\t\t\t\tcoinType: normalizeStructTag(change.coinType),\n\t\t\t\t\t\taddress: parseOwnerAddress(change.owner)!,\n\t\t\t\t\t\tamount: change.amount,\n\t\t\t\t\t}))\n\t\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['balanceChanges'],\n\t\t\tevents: (options.include?.events\n\t\t\t\t? (result.events?.map((event) => ({\n\t\t\t\t\t\tpackageId: event.packageId,\n\t\t\t\t\t\tmodule: event.transactionModule,\n\t\t\t\t\t\tsender: event.sender,\n\t\t\t\t\t\teventType: event.type,\n\t\t\t\t\t\tbcs: 'bcs' in event ? fromBase64(event.bcs) : new Uint8Array(),\n\t\t\t\t\t})) ?? [])\n\t\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['events'],\n\t\t};\n\n\t\tlet commandResults: SuiClientTypes.CommandResult[] | undefined;\n\t\tif (options.include?.commandResults) {\n\t\t\ttry {\n\t\t\t\tconst sender = tx.getData().sender ?? normalizeSuiAddress('0x0');\n\t\t\t\tconst devInspectResult = await this.#jsonRpcClient.devInspectTransactionBlock({\n\t\t\t\t\tsender,\n\t\t\t\t\ttransactionBlock: tx,\n\t\t\t\t\tsignal: options.signal,\n\t\t\t\t});\n\n\t\t\t\tif (devInspectResult.results) {\n\t\t\t\t\tcommandResults = devInspectResult.results.map((result) => ({\n\t\t\t\t\t\treturnValues: (result.returnValues ?? []).map(([bytes]) => ({\n\t\t\t\t\t\t\tbcs: new Uint8Array(bytes),\n\t\t\t\t\t\t})),\n\t\t\t\t\t\tmutatedReferences: (result.mutableReferenceOutputs ?? []).map(([, bytes]) => ({\n\t\t\t\t\t\t\tbcs: new Uint8Array(bytes),\n\t\t\t\t\t\t})),\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t}\n\n\t\treturn effects.status.success\n\t\t\t? {\n\t\t\t\t\t$kind: 'Transaction',\n\t\t\t\t\tTransaction: transactionData,\n\t\t\t\t\tcommandResults:\n\t\t\t\t\t\tcommandResults as SuiClientTypes.SimulateTransactionResult<Include>['commandResults'],\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\t$kind: 'FailedTransaction',\n\t\t\t\t\tFailedTransaction: transactionData,\n\t\t\t\t\tcommandResults:\n\t\t\t\t\t\tcommandResults as SuiClientTypes.SimulateTransactionResult<Include>['commandResults'],\n\t\t\t\t};\n\t}\n\tasync getReferenceGasPrice(options?: SuiClientTypes.GetReferenceGasPriceOptions) {\n\t\tconst referenceGasPrice = await this.#jsonRpcClient.getReferenceGasPrice({\n\t\t\tsignal: options?.signal,\n\t\t});\n\n\t\treturn {\n\t\t\treferenceGasPrice: String(referenceGasPrice),\n\t\t};\n\t}\n\n\tasync getCurrentSystemState(\n\t\toptions?: SuiClientTypes.GetCurrentSystemStateOptions,\n\t): Promise<SuiClientTypes.GetCurrentSystemStateResponse> {\n\t\tconst systemState = await this.#jsonRpcClient.getLatestSuiSystemState({\n\t\t\tsignal: options?.signal,\n\t\t});\n\n\t\treturn {\n\t\t\tsystemState: {\n\t\t\t\tsystemStateVersion: systemState.systemStateVersion,\n\t\t\t\tepoch: systemState.epoch,\n\t\t\t\tprotocolVersion: systemState.protocolVersion,\n\t\t\t\treferenceGasPrice: systemState.referenceGasPrice?.toString() ?? (null as never),\n\t\t\t\tepochStartTimestampMs: systemState.epochStartTimestampMs,\n\t\t\t\tsafeMode: systemState.safeMode,\n\t\t\t\tsafeModeStorageRewards: systemState.safeModeStorageRewards,\n\t\t\t\tsafeModeComputationRewards: systemState.safeModeComputationRewards,\n\t\t\t\tsafeModeStorageRebates: systemState.safeModeStorageRebates,\n\t\t\t\tsafeModeNonRefundableStorageFee: systemState.safeModeNonRefundableStorageFee,\n\t\t\t\tparameters: {\n\t\t\t\t\tepochDurationMs: systemState.epochDurationMs,\n\t\t\t\t\tstakeSubsidyStartEpoch: systemState.stakeSubsidyStartEpoch,\n\t\t\t\t\tmaxValidatorCount: systemState.maxValidatorCount,\n\t\t\t\t\tminValidatorJoiningStake: systemState.minValidatorJoiningStake,\n\t\t\t\t\tvalidatorLowStakeThreshold: systemState.validatorLowStakeThreshold,\n\t\t\t\t\tvalidatorLowStakeGracePeriod: systemState.validatorLowStakeGracePeriod,\n\t\t\t\t},\n\t\t\t\tstorageFund: {\n\t\t\t\t\ttotalObjectStorageRebates: systemState.storageFundTotalObjectStorageRebates,\n\t\t\t\t\tnonRefundableBalance: systemState.storageFundNonRefundableBalance,\n\t\t\t\t},\n\t\t\t\tstakeSubsidy: {\n\t\t\t\t\tbalance: systemState.stakeSubsidyBalance,\n\t\t\t\t\tdistributionCounter: systemState.stakeSubsidyDistributionCounter,\n\t\t\t\t\tcurrentDistributionAmount: systemState.stakeSubsidyCurrentDistributionAmount,\n\t\t\t\t\tstakeSubsidyPeriodLength: systemState.stakeSubsidyPeriodLength,\n\t\t\t\t\tstakeSubsidyDecreaseRate: systemState.stakeSubsidyDecreaseRate,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\tasync listDynamicFields(options: SuiClientTypes.ListDynamicFieldsOptions) {\n\t\tconst dynamicFields = await this.#jsonRpcClient.getDynamicFields({\n\t\t\tparentId: options.parentId,\n\t\t\tlimit: options.limit,\n\t\t\tcursor: options.cursor,\n\t\t});\n\n\t\treturn {\n\t\t\tdynamicFields: dynamicFields.data.map((dynamicField): SuiClientTypes.DynamicFieldEntry => {\n\t\t\t\tconst isDynamicObject = dynamicField.type === 'DynamicObject';\n\t\t\t\tconst fullType = isDynamicObject\n\t\t\t\t\t? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${dynamicField.name.type}>, 0x2::object::ID>`\n\t\t\t\t\t: `0x2::dynamic_field::Field<${dynamicField.name.type}, ${dynamicField.objectType}>`;\n\n\t\t\t\tconst bcsBytes = fromBase64(dynamicField.bcsName);\n\t\t\t\tconst derivedNameType = isDynamicObject\n\t\t\t\t\t? `0x2::dynamic_object_field::Wrapper<${dynamicField.name.type}>`\n\t\t\t\t\t: dynamicField.name.type;\n\t\t\t\treturn {\n\t\t\t\t\t$kind: isDynamicObject ? 'DynamicObject' : 'DynamicField',\n\t\t\t\t\tfieldId: deriveDynamicFieldID(options.parentId, derivedNameType, bcsBytes),\n\t\t\t\t\ttype: normalizeStructTag(fullType),\n\t\t\t\t\tname: {\n\t\t\t\t\t\ttype: dynamicField.name.type,\n\t\t\t\t\t\tbcs: bcsBytes,\n\t\t\t\t\t},\n\t\t\t\t\tvalueType: dynamicField.objectType,\n\t\t\t\t\tchildId: isDynamicObject ? dynamicField.objectId : undefined,\n\t\t\t\t} as SuiClientTypes.DynamicFieldEntry;\n\t\t\t}),\n\t\t\thasNextPage: dynamicFields.hasNextPage,\n\t\t\tcursor: dynamicFields.nextCursor,\n\t\t};\n\t}\n\n\tasync verifyZkLoginSignature(options: SuiClientTypes.VerifyZkLoginSignatureOptions) {\n\t\tconst result = await this.#jsonRpcClient.verifyZkLoginSignature({\n\t\t\tbytes: options.bytes,\n\t\t\tsignature: options.signature,\n\t\t\tintentScope: options.intentScope,\n\t\t\tauthor: options.address,\n\t\t});\n\n\t\treturn {\n\t\t\tsuccess: result.success,\n\t\t\terrors: result.errors,\n\t\t};\n\t}\n\n\tasync defaultNameServiceName(\n\t\toptions: SuiClientTypes.DefaultNameServiceNameOptions,\n\t): Promise<SuiClientTypes.DefaultNameServiceNameResponse> {\n\t\tconst name = (await this.#jsonRpcClient.resolveNameServiceNames(options)).data[0];\n\t\treturn {\n\t\t\tdata: {\n\t\t\t\tname,\n\t\t\t},\n\t\t};\n\t}\n\n\tresolveTransactionPlugin() {\n\t\treturn coreClientResolveTransactionPlugin;\n\t}\n\n\tasync getMoveFunction(\n\t\toptions: SuiClientTypes.GetMoveFunctionOptions,\n\t): Promise<SuiClientTypes.GetMoveFunctionResponse> {\n\t\tconst resolvedPackageId = (await this.mvr.resolvePackage({ package: options.packageId }))\n\t\t\t.package;\n\t\tconst result = await this.#jsonRpcClient.getNormalizedMoveFunction({\n\t\t\tpackage: resolvedPackageId,\n\t\t\tmodule: options.moduleName,\n\t\t\tfunction: options.name,\n\t\t});\n\n\t\treturn {\n\t\t\tfunction: {\n\t\t\t\tpackageId: normalizeSuiAddress(resolvedPackageId),\n\t\t\t\tmoduleName: options.moduleName,\n\t\t\t\tname: options.name,\n\t\t\t\tvisibility: parseVisibility(result.visibility),\n\t\t\t\tisEntry: result.isEntry,\n\t\t\t\ttypeParameters: result.typeParameters.map((abilities) => ({\n\t\t\t\t\tisPhantom: false,\n\t\t\t\t\tconstraints: parseAbilities(abilities),\n\t\t\t\t})),\n\t\t\t\tparameters: result.parameters.map((param) => parseNormalizedSuiMoveType(param)),\n\t\t\t\treturns: result.return.map((ret) => parseNormalizedSuiMoveType(ret)),\n\t\t\t},\n\t\t};\n\t}\n\n\tasync getChainIdentifier(\n\t\t_options?: SuiClientTypes.GetChainIdentifierOptions,\n\t): Promise<SuiClientTypes.GetChainIdentifierResponse> {\n\t\treturn this.cache.read(['chainIdentifier'], async () => {\n\t\t\tconst checkpoint = await this.#jsonRpcClient.getCheckpoint({ id: '0' });\n\t\t\treturn {\n\t\t\t\tchainIdentifier: checkpoint.digest,\n\t\t\t};\n\t\t});\n\t}\n}\n\nfunction serializeObjectToBcs(object: SuiObjectData): Uint8Array | undefined {\n\tif (object.bcs?.dataType !== 'moveObject') {\n\t\treturn undefined;\n\t}\n\n\ttry {\n\t\t// Normalize the type string to ensure consistent address formatting (0x2 vs 0x00...02)\n\t\tconst typeStr = normalizeStructTag(object.bcs.type);\n\t\tlet moveObjectType: InferBcsInput<typeof bcs.MoveObjectType>;\n\n\t\t// Normalize constants for comparison\n\t\tconst normalizedSuiFramework = normalizeSuiAddress(SUI_FRAMEWORK_ADDRESS);\n\t\tconst gasCoinType = normalizeStructTag(\n\t\t\t`${SUI_FRAMEWORK_ADDRESS}::coin::Coin<${SUI_FRAMEWORK_ADDRESS}::sui::SUI>`,\n\t\t);\n\t\tconst stakedSuiType = normalizeStructTag(`${SUI_SYSTEM_ADDRESS}::staking_pool::StakedSui`);\n\t\tconst coinPrefix = `${normalizedSuiFramework}::coin::Coin<`;\n\n\t\tif (typeStr === gasCoinType) {\n\t\t\tmoveObjectType = { GasCoin: null };\n\t\t} else if (typeStr === stakedSuiType) {\n\t\t\tmoveObjectType = { StakedSui: null };\n\t\t} else if (typeStr.startsWith(coinPrefix)) {\n\t\t\tconst innerTypeMatch = typeStr.match(\n\t\t\t\tnew RegExp(\n\t\t\t\t\t`${normalizedSuiFramework.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}::coin::Coin<(.+)>$`,\n\t\t\t\t),\n\t\t\t);\n\t\t\tif (innerTypeMatch) {\n\t\t\t\tconst innerTypeTag = TypeTagSerializer.parseFromStr(innerTypeMatch[1], true);\n\t\t\t\tmoveObjectType = { Coin: innerTypeTag };\n\t\t\t} else {\n\t\t\t\tthrow new Error('Failed to parse Coin type');\n\t\t\t}\n\t\t} else {\n\t\t\tconst typeTag = TypeTagSerializer.parseFromStr(typeStr, true);\n\t\t\tif (typeof typeTag !== 'object' || !('struct' in typeTag)) {\n\t\t\t\tthrow new Error('Expected struct type tag');\n\t\t\t}\n\t\t\tmoveObjectType = { Other: typeTag.struct };\n\t\t}\n\n\t\tconst contents = fromBase64(object.bcs.bcsBytes);\n\t\tconst owner = convertOwnerToBcs(object.owner!);\n\n\t\treturn bcs.Object.serialize({\n\t\t\tdata: {\n\t\t\t\tMove: {\n\t\t\t\t\ttype: moveObjectType,\n\t\t\t\t\thasPublicTransfer: object.bcs.hasPublicTransfer,\n\t\t\t\t\tversion: object.bcs.version,\n\t\t\t\t\tcontents,\n\t\t\t\t},\n\t\t\t},\n\t\t\towner,\n\t\t\tpreviousTransaction: object.previousTransaction!,\n\t\t\tstorageRebate: object.storageRebate!,\n\t\t}).toBytes();\n\t} catch {\n\t\t// If serialization fails, return undefined\n\t\treturn undefined;\n\t}\n}\n\nfunction parseObject<Include extends SuiClientTypes.ObjectInclude = object>(\n\tobject: SuiObjectData,\n\tinclude?: Include,\n): SuiClientTypes.Object<Include> {\n\tconst bcsContent =\n\t\tobject.bcs?.dataType === 'moveObject' ? fromBase64(object.bcs.bcsBytes) : undefined;\n\n\tconst objectBcs = include?.objectBcs ? serializeObjectToBcs(object) : undefined;\n\n\t// Package objects have type \"package\" which is not a struct tag, so don't normalize it\n\tconst type =\n\t\tobject.type && object.type.includes('::')\n\t\t\t? normalizeStructTag(object.type)\n\t\t\t: (object.type ?? '');\n\n\tconst jsonContent =\n\t\tinclude?.json && object.content?.dataType === 'moveObject'\n\t\t\t? (object.content.fields as Record<string, unknown>)\n\t\t\t: include?.json\n\t\t\t\t? null\n\t\t\t\t: undefined;\n\n\treturn {\n\t\tobjectId: object.objectId,\n\t\tversion: object.version,\n\t\tdigest: object.digest,\n\t\ttype,\n\t\tcontent: (include?.content\n\t\t\t? bcsContent\n\t\t\t: undefined) as SuiClientTypes.Object<Include>['content'],\n\t\towner: parseOwner(object.owner!),\n\t\tpreviousTransaction: (include?.previousTransaction\n\t\t\t? (object.previousTransaction ?? undefined)\n\t\t\t: undefined) as SuiClientTypes.Object<Include>['previousTransaction'],\n\t\tobjectBcs: objectBcs as SuiClientTypes.Object<Include>['objectBcs'],\n\t\tjson: jsonContent as SuiClientTypes.Object<Include>['json'],\n\t};\n}\n\nfunction parseOwner(owner: ObjectOwner): SuiClientTypes.ObjectOwner {\n\tif (owner === 'Immutable') {\n\t\treturn {\n\t\t\t$kind: 'Immutable',\n\t\t\tImmutable: true,\n\t\t};\n\t}\n\n\tif ('ConsensusAddressOwner' in owner) {\n\t\treturn {\n\t\t\t$kind: 'ConsensusAddressOwner',\n\t\t\tConsensusAddressOwner: {\n\t\t\t\towner: owner.ConsensusAddressOwner.owner,\n\t\t\t\tstartVersion: owner.ConsensusAddressOwner.start_version,\n\t\t\t},\n\t\t};\n\t}\n\n\tif ('AddressOwner' in owner) {\n\t\treturn {\n\t\t\t$kind: 'AddressOwner',\n\t\t\tAddressOwner: owner.AddressOwner,\n\t\t};\n\t}\n\n\tif ('ObjectOwner' in owner) {\n\t\treturn {\n\t\t\t$kind: 'ObjectOwner',\n\t\t\tObjectOwner: owner.ObjectOwner,\n\t\t};\n\t}\n\n\tif ('Shared' in owner) {\n\t\treturn {\n\t\t\t$kind: 'Shared',\n\t\t\tShared: {\n\t\t\t\tinitialSharedVersion: owner.Shared.initial_shared_version,\n\t\t\t},\n\t\t};\n\t}\n\n\tthrow new Error(`Unknown owner type: ${JSON.stringify(owner)}`);\n}\n\nfunction convertOwnerToBcs(owner: ObjectOwner) {\n\tif (owner === 'Immutable') {\n\t\treturn { Immutable: null };\n\t}\n\n\tif ('AddressOwner' in owner) {\n\t\treturn { AddressOwner: owner.AddressOwner };\n\t}\n\n\tif ('ObjectOwner' in owner) {\n\t\treturn { ObjectOwner: owner.ObjectOwner };\n\t}\n\n\tif ('Shared' in owner) {\n\t\treturn {\n\t\t\tShared: { initialSharedVersion: owner.Shared.initial_shared_version },\n\t\t};\n\t}\n\n\tif (typeof owner === 'object' && owner !== null && 'ConsensusAddressOwner' in owner) {\n\t\treturn {\n\t\t\tConsensusAddressOwner: {\n\t\t\t\tstartVersion: owner.ConsensusAddressOwner.start_version,\n\t\t\t\towner: owner.ConsensusAddressOwner.owner,\n\t\t\t},\n\t\t};\n\t}\n\n\tthrow new Error(`Unknown owner type: ${JSON.stringify(owner)}`);\n}\n\nfunction parseOwnerAddress(owner: ObjectOwner): string | null {\n\tif (owner === 'Immutable') {\n\t\treturn null;\n\t}\n\n\tif ('ConsensusAddressOwner' in owner) {\n\t\treturn owner.ConsensusAddressOwner.owner;\n\t}\n\n\tif ('AddressOwner' in owner) {\n\t\treturn owner.AddressOwner;\n\t}\n\n\tif ('ObjectOwner' in owner) {\n\t\treturn owner.ObjectOwner;\n\t}\n\n\tif ('Shared' in owner) {\n\t\treturn null;\n\t}\n\n\tthrow new Error(`Unknown owner type: ${JSON.stringify(owner)}`);\n}\n\nfunction parseTransaction<Include extends SuiClientTypes.TransactionInclude = object>(\n\ttransaction: SuiTransactionBlockResponse,\n\tinclude?: Include,\n): SuiClientTypes.TransactionResult<Include> {\n\tconst objectTypes: Record<string, string> = {};\n\n\tif (include?.objectTypes) {\n\t\ttransaction.objectChanges?.forEach((change) => {\n\t\t\tif (change.type !== 'published') {\n\t\t\t\tobjectTypes[change.objectId] = normalizeStructTag(change.objectType);\n\t\t\t}\n\t\t});\n\t}\n\n\tlet transactionData: SuiClientTypes.TransactionData | undefined;\n\tlet signatures: string[] = [];\n\tlet bcsBytes: Uint8Array | undefined;\n\n\tif (transaction.rawTransaction) {\n\t\tconst parsedTx = bcs.SenderSignedData.parse(fromBase64(transaction.rawTransaction))[0];\n\t\tsignatures = parsedTx.txSignatures;\n\n\t\tif (include?.transaction || include?.bcs) {\n\t\t\tconst bytes = bcs.TransactionData.serialize(parsedTx.intentMessage.value).toBytes();\n\n\t\t\tif (include?.bcs) {\n\t\t\t\tbcsBytes = bytes;\n\t\t\t}\n\n\t\t\tif (include?.transaction) {\n\t\t\t\tconst data = TransactionDataBuilder.restore({\n\t\t\t\t\tversion: 2,\n\t\t\t\t\tsender: parsedTx.intentMessage.value.V1.sender,\n\t\t\t\t\texpiration: parsedTx.intentMessage.value.V1.expiration,\n\t\t\t\t\tgasData: parsedTx.intentMessage.value.V1.gasData,\n\t\t\t\t\tinputs: parsedTx.intentMessage.value.V1.kind.ProgrammableTransaction!.inputs,\n\t\t\t\t\tcommands: parsedTx.intentMessage.value.V1.kind.ProgrammableTransaction!.commands,\n\t\t\t\t});\n\t\t\t\ttransactionData = { ...data };\n\t\t\t}\n\t\t}\n\t}\n\n\t// Get status from JSON-RPC response\n\tconst status: SuiClientTypes.ExecutionStatus = transaction.effects?.status\n\t\t? parseJsonRpcExecutionStatus(transaction.effects.status, transaction.effects.abortError)\n\t\t: {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\t$kind: 'Unknown',\n\t\t\t\t\tmessage: 'Unknown',\n\t\t\t\t\tUnknown: null,\n\t\t\t\t},\n\t\t\t};\n\n\tconst effectsBytes = transaction.rawEffects ? new Uint8Array(transaction.rawEffects) : null;\n\n\tconst result: SuiClientTypes.Transaction<Include> = {\n\t\tdigest: transaction.digest,\n\t\tepoch: transaction.effects?.executedEpoch ?? null,\n\t\tstatus,\n\t\teffects: (include?.effects && effectsBytes\n\t\t\t? parseTransactionEffectsBcs(effectsBytes)\n\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['effects'],\n\t\tobjectTypes: (include?.objectTypes\n\t\t\t? objectTypes\n\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['objectTypes'],\n\t\ttransaction: transactionData as SuiClientTypes.Transaction<Include>['transaction'],\n\t\tbcs: bcsBytes as SuiClientTypes.Transaction<Include>['bcs'],\n\t\tsignatures,\n\t\tbalanceChanges: (include?.balanceChanges\n\t\t\t? (transaction.balanceChanges?.map((change) => ({\n\t\t\t\t\tcoinType: normalizeStructTag(change.coinType),\n\t\t\t\t\taddress: parseOwnerAddress(change.owner)!,\n\t\t\t\t\tamount: change.amount,\n\t\t\t\t})) ?? [])\n\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['balanceChanges'],\n\t\tevents: (include?.events\n\t\t\t? (transaction.events?.map((event) => ({\n\t\t\t\t\tpackageId: event.packageId,\n\t\t\t\t\tmodule: event.transactionModule,\n\t\t\t\t\tsender: event.sender,\n\t\t\t\t\teventType: event.type,\n\t\t\t\t\tbcs: 'bcs' in event ? fromBase64(event.bcs) : new Uint8Array(),\n\t\t\t\t})) ?? [])\n\t\t\t: undefined) as SuiClientTypes.Transaction<Include>['events'],\n\t};\n\n\treturn status.success\n\t\t? {\n\t\t\t\t$kind: 'Transaction',\n\t\t\t\tTransaction: result,\n\t\t\t}\n\t\t: {\n\t\t\t\t$kind: 'FailedTransaction',\n\t\t\t\tFailedTransaction: result,\n\t\t\t};\n}\n\nfunction parseTransactionEffectsJson({\n\tbytes,\n\teffects,\n\tobjectChanges,\n}: {\n\tbytes?: Uint8Array;\n\teffects: TransactionEffects;\n\tobjectChanges: SuiObjectChange[] | null;\n}): {\n\teffects: SuiClientTypes.TransactionEffects;\n\tobjectTypes: Record<string, string>;\n} {\n\tconst changedObjects: SuiClientTypes.ChangedObject[] = [];\n\tconst unchangedConsensusObjects: SuiClientTypes.UnchangedConsensusObject[] = [];\n\tconst objectTypes: Record<string, string> = {};\n\n\tobjectChanges?.forEach((change) => {\n\t\tswitch (change.type) {\n\t\t\tcase 'published':\n\t\t\t\tchangedObjects.push({\n\t\t\t\t\tobjectId: change.packageId,\n\t\t\t\t\tinputState: 'DoesNotExist',\n\t\t\t\t\tinputVersion: null,\n\t\t\t\t\tinputDigest: null,\n\t\t\t\t\tinputOwner: null,\n\t\t\t\t\toutputState: 'PackageWrite',\n\t\t\t\t\toutputVersion: change.version,\n\t\t\t\t\toutputDigest: change.digest,\n\t\t\t\t\toutputOwner: null,\n\t\t\t\t\tidOperation: 'Created',\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'transferred':\n\t\t\t\tchangedObjects.push({\n\t\t\t\t\tobjectId: change.objectId,\n\t\t\t\t\tinputState: 'Exists',\n\t\t\t\t\tinputVersion: change.version,\n\t\t\t\t\tinputDigest: change.digest,\n\t\t\t\t\tinputOwner: {\n\t\t\t\t\t\t$kind: 'AddressOwner' as const,\n\t\t\t\t\t\tAddressOwner: change.sender,\n\t\t\t\t\t},\n\t\t\t\t\toutputState: 'ObjectWrite',\n\t\t\t\t\toutputVersion: change.version,\n\t\t\t\t\toutputDigest: change.digest,\n\t\t\t\t\toutputOwner: parseOwner(change.recipient),\n\t\t\t\t\tidOperation: 'None',\n\t\t\t\t});\n\t\t\t\tobjectTypes[change.objectId] = normalizeStructTag(change.objectType);\n\t\t\t\tbreak;\n\t\t\tcase 'mutated':\n\t\t\t\tchangedObjects.push({\n\t\t\t\t\tobjectId: change.objectId,\n\t\t\t\t\tinputState: 'Exists',\n\t\t\t\t\tinputVersion: change.previousVersion,\n\t\t\t\t\tinputDigest: null,\n\t\t\t\t\tinputOwner: parseOwner(change.owner),\n\t\t\t\t\toutputState: 'ObjectWrite',\n\t\t\t\t\toutputVersion: change.version,\n\t\t\t\t\toutputDigest: change.digest,\n\t\t\t\t\toutputOwner: parseOwner(change.owner),\n\t\t\t\t\tidOperation: 'None',\n\t\t\t\t});\n\t\t\t\tobjectTypes[change.objectId] = normalizeStructTag(change.objectType);\n\t\t\t\tbreak;\n\t\t\tcase 'deleted':\n\t\t\t\tchangedObjects.push({\n\t\t\t\t\tobjectId: change.objectId,\n\t\t\t\t\tinputState: 'Exists',\n\t\t\t\t\tinputVersion: change.version,\n\t\t\t\t\tinputDigest: effects.deleted?.find((d) => d.objectId === change.objectId)?.digest ?? null,\n\t\t\t\t\tinputOwner: null,\n\t\t\t\t\toutputState: 'DoesNotExist',\n\t\t\t\t\toutputVersion: null,\n\t\t\t\t\toutputDigest: null,\n\t\t\t\t\toutputOwner: null,\n\t\t\t\t\tidOperation: 'Deleted',\n\t\t\t\t});\n\t\t\t\tobjectTypes[change.objectId] = normalizeStructTag(change.objectType);\n\t\t\t\tbreak;\n\t\t\tcase 'wrapped':\n\t\t\t\tchangedObjects.push({\n\t\t\t\t\tobjectId: change.objectId,\n\t\t\t\t\tinputState: 'Exists',\n\t\t\t\t\tinputVersion: change.version,\n\t\t\t\t\tinputDigest: null,\n\t\t\t\t\tinputOwner: {\n\t\t\t\t\t\t$kind: 'AddressOwner' as const,\n\t\t\t\t\t\tAddressOwner: change.sender,\n\t\t\t\t\t},\n\t\t\t\t\toutputState: 'ObjectWrite',\n\t\t\t\t\toutputVersion: change.version,\n\t\t\t\t\toutputDigest:\n\t\t\t\t\t\teffects.wrapped?.find((w) => w.objectId === change.objectId)?.digest ?? null,\n\t\t\t\t\toutputOwner: {\n\t\t\t\t\t\t$kind: 'ObjectOwner' as const,\n\t\t\t\t\t\tObjectOwner: change.sender,\n\t\t\t\t\t},\n\t\t\t\t\tidOperation: 'None',\n\t\t\t\t});\n\t\t\t\tobjectTypes[change.objectId] = normalizeStructTag(change.objectType);\n\t\t\t\tbreak;\n\t\t\tcase 'created':\n\t\t\t\tchangedObjects.push({\n\t\t\t\t\tobjectId: change.objectId,\n\t\t\t\t\tinputState: 'DoesNotExist',\n\t\t\t\t\tinputVersion: null,\n\t\t\t\t\tinputDigest: null,\n\t\t\t\t\tinputOwner: null,\n\t\t\t\t\toutputState: 'ObjectWrite',\n\t\t\t\t\toutputVersion: change.version,\n\t\t\t\t\toutputDigest: change.digest,\n\t\t\t\t\toutputOwner: parseOwner(change.owner),\n\t\t\t\t\tidOperation: 'Created',\n\t\t\t\t});\n\t\t\t\tobjectTypes[change.objectId] = normalizeStructTag(change.objectType);\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n\treturn {\n\t\tobjectTypes,\n\t\teffects: {\n\t\t\tbcs: bytes ?? null,\n\t\t\tversion: 2,\n\t\t\tstatus: parseJsonRpcExecutionStatus(effects.status, effects.abortError),\n\t\t\tgasUsed: effects.gasUsed,\n\t\t\ttransactionDigest: effects.transactionDigest,\n\t\t\tgasObject: {\n\t\t\t\tobjectId: effects.gasObject?.reference.objectId,\n\t\t\t\tinputState: 'Exists',\n\t\t\t\tinputVersion: null,\n\t\t\t\tinputDigest: null,\n\t\t\t\tinputOwner: null,\n\t\t\t\toutputState: 'ObjectWrite',\n\t\t\t\toutputVersion: effects.gasObject.reference.version,\n\t\t\t\toutputDigest: effects.gasObject.reference.digest,\n\t\t\t\toutputOwner: parseOwner(effects.gasObject.owner),\n\t\t\t\tidOperation: 'None',\n\t\t\t},\n\t\t\teventsDigest: effects.eventsDigest ?? null,\n\t\t\tdependencies: effects.dependencies ?? [],\n\t\t\tlamportVersion: effects.gasObject.reference.version,\n\t\t\tchangedObjects,\n\t\t\tunchangedConsensusObjects,\n\t\t\tauxiliaryDataDigest: null,\n\t\t},\n\t};\n}\n\nfunction parseNormalizedSuiMoveType(type: SuiMoveNormalizedType): SuiClientTypes.OpenSignature {\n\tif (typeof type !== 'string') {\n\t\tif ('Reference' in type) {\n\t\t\treturn {\n\t\t\t\treference: 'immutable',\n\t\t\t\tbody: parseNormalizedSuiMoveTypeBody(type.Reference),\n\t\t\t};\n\t\t}\n\n\t\tif ('MutableReference' in type) {\n\t\t\treturn {\n\t\t\t\treference: 'mutable',\n\t\t\t\tbody: parseNormalizedSuiMoveTypeBody(type.MutableReference),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn {\n\t\treference: null,\n\t\tbody: parseNormalizedSuiMoveTypeBody(type),\n\t};\n}\n\nfunction parseNormalizedSuiMoveTypeBody(\n\ttype: SuiMoveNormalizedType,\n): SuiClientTypes.OpenSignatureBody {\n\tswitch (type) {\n\t\tcase 'Address':\n\t\t\treturn { $kind: 'address' };\n\t\tcase 'Bool':\n\t\t\treturn { $kind: 'bool' };\n\t\tcase 'U8':\n\t\t\treturn { $kind: 'u8' };\n\t\tcase 'U16':\n\t\t\treturn { $kind: 'u16' };\n\t\tcase 'U32':\n\t\t\treturn { $kind: 'u32' };\n\t\tcase 'U64':\n\t\t\treturn { $kind: 'u64' };\n\t\tcase 'U128':\n\t\t\treturn { $kind: 'u128' };\n\t\tcase 'U256':\n\t\t\treturn { $kind: 'u256' };\n\t}\n\n\tif (typeof type === 'string') {\n\t\tthrow new Error(`Unknown type: ${type}`);\n\t}\n\n\tif ('Vector' in type) {\n\t\treturn {\n\t\t\t$kind: 'vector',\n\t\t\tvector: parseNormalizedSuiMoveTypeBody(type.Vector),\n\t\t};\n\t}\n\n\tif ('Struct' in type) {\n\t\treturn {\n\t\t\t$kind: 'datatype',\n\t\t\tdatatype: {\n\t\t\t\ttypeName: `${normalizeSuiAddress(type.Struct.address)}::${type.Struct.module}::${type.Struct.name}`,\n\t\t\t\ttypeParameters: type.Struct.typeArguments.map((t) => parseNormalizedSuiMoveTypeBody(t)),\n\t\t\t},\n\t\t};\n\t}\n\n\tif ('TypeParameter' in type) {\n\t\treturn {\n\t\t\t$kind: 'typeParameter',\n\t\t\tindex: type.TypeParameter,\n\t\t};\n\t}\n\n\tthrow new Error(`Unknown type: ${JSON.stringify(type)}`);\n}\n\nfunction parseAbilities(abilitySet: SuiMoveAbilitySet): SuiClientTypes.Ability[] {\n\treturn abilitySet.abilities.map((ability) => {\n\t\tswitch (ability) {\n\t\t\tcase 'Copy':\n\t\t\t\treturn 'copy';\n\t\t\tcase 'Drop':\n\t\t\t\treturn 'drop';\n\t\t\tcase 'Store':\n\t\t\t\treturn 'store';\n\t\t\tcase 'Key':\n\t\t\t\treturn 'key';\n\t\t\tdefault:\n\t\t\t\treturn 'unknown';\n\t\t}\n\t});\n}\n\nfunction parseVisibility(visibility: SuiMoveVisibility): SuiClientTypes.Visibility {\n\tswitch (visibility) {\n\t\tcase 'Public':\n\t\t\treturn 'public';\n\t\tcase 'Private':\n\t\t\treturn 'private';\n\t\tcase 'Friend':\n\t\t\treturn 'friend';\n\t\tdefault:\n\t\t\treturn 'unknown';\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoCA,MAAM,UAAU;AAEhB,SAAS,4BACR,QACA,YACiC;AACjC,KAAI,OAAO,WAAW,UACrB,QAAO;EAAE,SAAS;EAAM,OAAO;EAAM;CAGtC,MAAM,aAAa,OAAO,SAAS;AAEnC,KAAI,YAAY;EACf,MAAM,eAAe,WAAW,MAAM,mBAAmB;EACzD,MAAM,UAAU,eAAe,SAAS,aAAa,IAAI,GAAG,GAAG;EAE/D,MAAM,mBAAmB,WAAW,MAAM,uBAAuB;EACjE,MAAM,cAAc,mBAAmB,SAAS,iBAAiB,IAAI,GAAG,GAAG;EAE3E,MAAM,cAAc,WAAW,WAAW,MAAM,KAAK,IAAI,EAAE;EAC3D,MAAM,MAAM,YAAY,KAAK,oBAAoB,YAAY,GAAG,GAAG;EACnE,MAAM,SAAS,YAAY;AAE3B,SAAO;GACN,SAAS;GACT,OAAO;IACN,OAAO;IACP,SAAS,uBAAuB;KAC/B;KACA,UACC,OAAO,SACJ;MACA,SAAS;MACT;MACA,cAAc,WAAW,YAAY;MACrC;MACA,GACA;KACJ,WAAW,OAAO,WAAW,cAAc,EAAE;KAC7C,aAAa,WAAW,QAAQ,OAAO,EAAE,YAAY,WAAW,MAAM,GAAG;KACzE,CAAC;IACF;IACA,WAAW;KACV,WAAW,OAAO,WAAW,cAAc,EAAE;KAC7C,UAAU,WAAW,YAClB;MACA,SAAS,oBAAoB,WAAW,UAAU,MAAM,KAAK,CAAC,MAAM,GAAG;MACvE,QAAQ,WAAW,UAAU,MAAM,KAAK,CAAC,MAAM;MAC/C,cAAc,WAAW,YAAY;MACrC;MACA,GACA;KACH;IACD;GACD;;AAGF,QAAO;EACN,SAAS;EACT,OAAO;GACN,OAAO;GACP,SAAS;GACT,SAAS;GACT;EACD;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AK,OACJ,QAAO,EAAE,OAAO,QAAQ;EACzB,KAAK,OACJ,QAAO,EAAE,OAAO,QAAQ;;AAG1B,KAAI,OAAO,SAAS,SACnB,OAAM,IAAI,MAAM,iBAAiB,OAAO;AAGzC,KAAI,YAAY,KACf,QAAO;EACN,OAAO;EACP,QAAQ,+BAA+B,KAAK,OAAO;EACnD;AAGF,KAAI,YAAY,KACf,QAAO;EACN,OAAO;EACP,UAAU;GACT,UAAU,GAAG,oBAAoB,KAAK,OAAO,QAAQ,CAAC,IAAI,KAAK,OAAO,OAAO,IAAI,KAAK,OAAO;GAC7F,gBAAgB,KAAK,OAAO,cAAc,KAAK,MAAM,+BAA+B,EAAE,CAAC;GACvF;EACD;AAGF,KAAI,mBAAmB,KACtB,QAAO;EACN,OAAO;EACP,OAAO,KAAK;EACZ;AAGF,OAAM,IAAI,MAAM,iBAAiB,KAAK,UAAU,KAAK,GAAG;;AAGzD,SAAS,eAAe,YAAyD;AAChF,QAAO,WAAW,UAAU,KAAK,YAAY;AAC5C,UAAQ,SAAR;GACC,KAAK,OACJ,QAAO;GACR,KAAK,OACJ,QAAO;GACR,KAAK,QACJ,QAAO;GACR,KAAK,MACJ,QAAO;GACR,QACC,QAAO;;GAER;;AAGH,SAAS,gBAAgB,YAA0D;AAClF,SAAQ,YAAR;EACC,KAAK,SACJ,QAAO;EACR,KAAK,UACJ,QAAO;EACR,KAAK,SACJ,QAAO;EACR,QACC,QAAO"}
|
|
@@ -88,7 +88,7 @@ declare class Transaction {
|
|
|
88
88
|
chain: string;
|
|
89
89
|
nonce: number;
|
|
90
90
|
};
|
|
91
|
-
}, "
|
|
91
|
+
}, "Epoch" | "None" | "ValidDuring"> | null | undefined;
|
|
92
92
|
gasData: {
|
|
93
93
|
budget: string | number | null;
|
|
94
94
|
price: string | number | null;
|
|
@@ -116,7 +116,7 @@ declare class Transaction {
|
|
|
116
116
|
version: string | number;
|
|
117
117
|
digest: string;
|
|
118
118
|
};
|
|
119
|
-
}, "
|
|
119
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
120
120
|
Pure: {
|
|
121
121
|
bytes: string;
|
|
122
122
|
};
|
|
@@ -144,7 +144,7 @@ declare class Transaction {
|
|
|
144
144
|
Sponsor: true;
|
|
145
145
|
}, "Sender" | "Sponsor">;
|
|
146
146
|
};
|
|
147
|
-
}, "
|
|
147
|
+
}, "Object" | "Pure" | "FundsWithdrawal" | "UnresolvedPure" | "UnresolvedObject">[];
|
|
148
148
|
commands: _mysten_bcs1124.EnumOutputShapeWithKeys<{
|
|
149
149
|
MoveCall: {
|
|
150
150
|
package: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.d.mts","names":[],"sources":["../../src/transactions/Transaction.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;KAoCY,yBAAA,GACT,QAAQ,kBAAkB;;;WAEtB,gBACC,QAAQ,kBAAkB;EAJtB,KAAA,EAAA,OAAA;EACiB,IAAA,CAAA,EAAA,MAAA;CAAlB,CAAA,CAAA,GAIR,qBAJQ,CAIc,yBAJd,CAAA;AAAR,KAMS,iBAAA,GAAoB,OAN7B,CAMqC,QANrC,EAAA;EAEI,MAAA,EAAA,OAAA;CAC2B,CAAA,GAIjC,OAJiC,CAIzB,QAJyB,EAAA;EAAlB,YAAA,EAAA,OAAA;CAAR,CAAA,EAAA;AACiB,KAKb,yBAAA,GACT,OANsB,CAMd,QANc,EAAA;EAAtB,MAAA,EAAA,OAAA;CAAqB,CAAA,GAAA,SAOZ,OAPY,CAOJ,QAPI,EAAA;EAEZ,YAAA,EAAA,OAAiB;CAAW,CAAA,EAAA;AAAR,KAOpB,qBAPoB,CAAA,UAQrB,yBARqB,GAAA,IAAA,GAQc,yBARd,GAAA,IAAA,CAAA,GAAA,CAAA,EAAA,EASvB,WATuB,EAAA,GASP,OATO,CASC,CATD,GAAA,IAAA,CAAA;cA0E1B,iBAzEG,EAAA,KAAA;UA2EC,WAAA,SAAoB,uBA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B,8BAA2B;;;;;eAe/C;;MAEX;;;;;;;;;;;;;;;;;;;;;;;;mBA8CqB,8BAAmC;;gBAmBrC,cAAc,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2DrB,0BAA+B,QAAQ,WAAW;;;aAW5D;MAER;mCAsJoC,8BAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sui-types.d.mts","names":[],"sources":["../../src/utils/sui-types.ts"],"sourcesContent":[],"mappings":";;AAUgB,iBAAA,wBAAA,CAAwB,KAAA,EAAA,MAAA,CAAA,EAAA,KAAA,IAAA,MAAA;AAe3B,cAAA,kBAAA,GAAkB,EAAA;AACf,iBAAA,iBAAA,CAAiB,KAAA,EAAA,MAAA,CAAA,EAAA,KAAA,IAAA,MAAA;AAIjB,iBAAA,kBAAA,CAAkB,KAAA,EAAA,MAAA,CAAA,EAAA,OAAA;AA6DtB,iBATI,gBAAA,CAagB,IAAA,EAAA,MAAA,CAAA,EAAA,OAAA;
|
|
1
|
+
{"version":3,"file":"sui-types.d.mts","names":[],"sources":["../../src/utils/sui-types.ts"],"sourcesContent":[],"mappings":";;AAUgB,iBAAA,wBAAA,CAAwB,KAAA,EAAA,MAAA,CAAA,EAAA,KAAA,IAAA,MAAA;AAe3B,cAAA,kBAAA,GAAkB,EAAA;AACf,iBAAA,iBAAA,CAAiB,KAAA,EAAA,MAAA,CAAA,EAAA,KAAA,IAAA,MAAA;AAIjB,iBAAA,kBAAA,CAAkB,KAAA,EAAA,MAAA,CAAA,EAAA,OAAA;AA6DtB,iBATI,gBAAA,CAagB,IAAA,EAAA,MAAA,CAAA,EAAA,OAAA;AAwBhB,KA5BJ,SAAA,GA4BkB;EA0Bd,OAAA,EAAA,MAAA;EA2BA,MAAA,EAAA,MAAA;EAQA,IAAA,EAAA,MAAA;wBArFO;;iBAwBP,cAAA,gBAA8B;iBA0B9B,kBAAA,gBAAkC;;;;;;;;;;;;iBA2BlC,mBAAA;iBAQA,oBAAA"}
|
package/dist/utils/sui-types.mjs
CHANGED
|
@@ -57,6 +57,14 @@ function isValidStructTag(type) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
function parseTypeTag(type) {
|
|
60
|
+
if (type.startsWith("vector<")) {
|
|
61
|
+
if (!type.endsWith(">")) throw new Error(`Invalid type tag: ${type}`);
|
|
62
|
+
const inner = type.slice(7, -1);
|
|
63
|
+
if (!inner) throw new Error(`Invalid type tag: ${type}`);
|
|
64
|
+
const parsed = parseTypeTag(inner);
|
|
65
|
+
if (typeof parsed === "string") return `vector<${parsed}>`;
|
|
66
|
+
return `vector<${normalizeStructTag(parsed)}>`;
|
|
67
|
+
}
|
|
60
68
|
if (!type.includes("::")) return type;
|
|
61
69
|
return parseStructTag(type);
|
|
62
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sui-types.mjs","names":[],"sources":["../../src/utils/sui-types.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { fromBase58, splitGenericParameters } from '@mysten/bcs';\n\nimport { isValidNamedPackage } from './move-registry.js';\n\nconst TX_DIGEST_LENGTH = 32;\n\n/** Returns whether the tx digest is valid based on the serialization format */\nexport function isValidTransactionDigest(value: string): value is string {\n\ttry {\n\t\tconst buffer = fromBase58(value);\n\t\treturn buffer.length === TX_DIGEST_LENGTH;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n// TODO - can we automatically sync this with rust length definition?\n// Source of truth is\n// https://github.com/MystenLabs/sui/blob/acb2b97ae21f47600e05b0d28127d88d0725561d/crates/sui-types/src/base_types.rs#L67\n// which uses the Move account address length\n// https://github.com/move-language/move/blob/67ec40dc50c66c34fd73512fcc412f3b68d67235/language/move-core/types/src/account_address.rs#L23 .\n\nexport const SUI_ADDRESS_LENGTH = 32;\nexport function isValidSuiAddress(value: string): value is string {\n\treturn isHex(value) && getHexByteLength(value) === SUI_ADDRESS_LENGTH;\n}\n\nexport function isValidSuiObjectId(value: string): boolean {\n\treturn isValidSuiAddress(value);\n}\n\nconst MOVE_IDENTIFIER_REGEX = /^[a-zA-Z][a-zA-Z0-9_]*$/;\n\nexport function isValidMoveIdentifier(name: string): boolean {\n\treturn MOVE_IDENTIFIER_REGEX.test(name);\n}\n\nconst PRIMITIVE_TYPE_TAGS = [\n\t'bool',\n\t'u8',\n\t'u16',\n\t'u32',\n\t'u64',\n\t'u128',\n\t'u256',\n\t'address',\n\t'signer',\n];\n\nconst VECTOR_TYPE_REGEX = /^vector<(.+)>$/;\n\nfunction isValidTypeTag(type: string): boolean {\n\tif (PRIMITIVE_TYPE_TAGS.includes(type)) return true;\n\n\tconst vectorMatch = type.match(VECTOR_TYPE_REGEX);\n\tif (vectorMatch) return isValidTypeTag(vectorMatch[1]);\n\n\tif (type.includes('::')) return isValidStructTag(type);\n\n\treturn false;\n}\n\nfunction isValidParsedStructTag(tag: StructTag): boolean {\n\tif (!isValidSuiAddress(tag.address) && !isValidNamedPackage(tag.address)) {\n\t\treturn false;\n\t}\n\n\tif (!isValidMoveIdentifier(tag.module) || !isValidMoveIdentifier(tag.name)) {\n\t\treturn false;\n\t}\n\n\treturn tag.typeParams.every((param) => {\n\t\tif (typeof param === 'string') {\n\t\t\treturn isValidTypeTag(param);\n\t\t}\n\t\treturn isValidParsedStructTag(param);\n\t});\n}\n\nexport function isValidStructTag(type: string): boolean {\n\ttry {\n\t\tconst tag = parseStructTag(type);\n\t\treturn isValidParsedStructTag(tag);\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport type StructTag = {\n\taddress: string;\n\tmodule: string;\n\tname: string;\n\ttypeParams: (string | StructTag)[];\n};\n\nfunction parseTypeTag(type: string): string | StructTag {\n\tif (!type.includes('::')) return type;\n\n\treturn parseStructTag(type);\n}\n\nexport function parseStructTag(type: string): StructTag {\n\tconst parts = type.split('::');\n\n\tif (parts.length < 3) {\n\t\tthrow new Error(`Invalid struct tag: ${type}`);\n\t}\n\n\tconst [address, module] = parts;\n\tconst isMvrPackage = isValidNamedPackage(address);\n\n\tconst rest = type.slice(address.length + module.length + 4);\n\tconst name = rest.includes('<') ? rest.slice(0, rest.indexOf('<')) : rest;\n\tconst typeParams = rest.includes('<')\n\t\t? splitGenericParameters(rest.slice(rest.indexOf('<') + 1, rest.lastIndexOf('>'))).map(\n\t\t\t\t(typeParam) => parseTypeTag(typeParam.trim()),\n\t\t\t)\n\t\t: [];\n\n\treturn {\n\t\taddress: isMvrPackage ? address : normalizeSuiAddress(address),\n\t\tmodule,\n\t\tname,\n\t\ttypeParams,\n\t};\n}\n\nexport function normalizeStructTag(type: string | StructTag): string {\n\tconst { address, module, name, typeParams } =\n\t\ttypeof type === 'string' ? parseStructTag(type) : type;\n\n\tconst formattedTypeParams =\n\t\ttypeParams?.length > 0\n\t\t\t? `<${typeParams\n\t\t\t\t\t.map((typeParam) =>\n\t\t\t\t\t\ttypeof typeParam === 'string' ? typeParam : normalizeStructTag(typeParam),\n\t\t\t\t\t)\n\t\t\t\t\t.join(',')}>`\n\t\t\t: '';\n\n\treturn `${address}::${module}::${name}${formattedTypeParams}`;\n}\n\n/**\n * Perform the following operations:\n * 1. Make the address lower case\n * 2. Prepend `0x` if the string does not start with `0x`.\n * 3. Add more zeros if the length of the address(excluding `0x`) is less than `SUI_ADDRESS_LENGTH`\n *\n * WARNING: if the address value itself starts with `0x`, e.g., `0x0x`, the default behavior\n * is to treat the first `0x` not as part of the address. The default behavior can be overridden by\n * setting `forceAdd0x` to true\n *\n */\nexport function normalizeSuiAddress(value: string, forceAdd0x: boolean = false): string {\n\tlet address = value.toLowerCase();\n\tif (!forceAdd0x && address.startsWith('0x')) {\n\t\taddress = address.slice(2);\n\t}\n\treturn `0x${address.padStart(SUI_ADDRESS_LENGTH * 2, '0')}`;\n}\n\nexport function normalizeSuiObjectId(value: string, forceAdd0x: boolean = false): string {\n\treturn normalizeSuiAddress(value, forceAdd0x);\n}\n\nfunction isHex(value: string): boolean {\n\treturn /^(0x|0X)?[a-fA-F0-9]+$/.test(value) && value.length % 2 === 0;\n}\n\nfunction getHexByteLength(value: string): number {\n\treturn /^(0x|0X)/.test(value) ? (value.length - 2) / 2 : value.length / 2;\n}\n"],"mappings":";;;;AAOA,MAAM,mBAAmB;;AAGzB,SAAgB,yBAAyB,OAAgC;AACxE,KAAI;AAEH,SADe,WAAW,MAAM,CAClB,WAAW;SAClB;AACP,SAAO;;;AAUT,MAAa,qBAAqB;AAClC,SAAgB,kBAAkB,OAAgC;AACjE,QAAO,MAAM,MAAM,IAAI,iBAAiB,MAAM,KAAK;;AAGpD,SAAgB,mBAAmB,OAAwB;AAC1D,QAAO,kBAAkB,MAAM;;AAGhC,MAAM,wBAAwB;AAE9B,SAAgB,sBAAsB,MAAuB;AAC5D,QAAO,sBAAsB,KAAK,KAAK;;AAGxC,MAAM,sBAAsB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAED,MAAM,oBAAoB;AAE1B,SAAS,eAAe,MAAuB;AAC9C,KAAI,oBAAoB,SAAS,KAAK,CAAE,QAAO;CAE/C,MAAM,cAAc,KAAK,MAAM,kBAAkB;AACjD,KAAI,YAAa,QAAO,eAAe,YAAY,GAAG;AAEtD,KAAI,KAAK,SAAS,KAAK,CAAE,QAAO,iBAAiB,KAAK;AAEtD,QAAO;;AAGR,SAAS,uBAAuB,KAAyB;AACxD,KAAI,CAAC,kBAAkB,IAAI,QAAQ,IAAI,CAAC,oBAAoB,IAAI,QAAQ,CACvE,QAAO;AAGR,KAAI,CAAC,sBAAsB,IAAI,OAAO,IAAI,CAAC,sBAAsB,IAAI,KAAK,CACzE,QAAO;AAGR,QAAO,IAAI,WAAW,OAAO,UAAU;AACtC,MAAI,OAAO,UAAU,SACpB,QAAO,eAAe,MAAM;AAE7B,SAAO,uBAAuB,MAAM;GACnC;;AAGH,SAAgB,iBAAiB,MAAuB;AACvD,KAAI;AAEH,SAAO,uBADK,eAAe,KAAK,CACE;SAC3B;AACP,SAAO;;;A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AAe;AACxF,QAAO,oBAAoB,OAAO,WAAW;;AAG9C,SAAS,MAAM,OAAwB;AACtC,QAAO,yBAAyB,KAAK,MAAM,IAAI,MAAM,SAAS,MAAM;;AAGrE,SAAS,iBAAiB,OAAuB;AAChD,QAAO,WAAW,KAAK,MAAM,IAAI,MAAM,SAAS,KAAK,IAAI,MAAM,SAAS"}
|
|
1
|
+
{"version":3,"file":"sui-types.mjs","names":[],"sources":["../../src/utils/sui-types.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { fromBase58, splitGenericParameters } from '@mysten/bcs';\n\nimport { isValidNamedPackage } from './move-registry.js';\n\nconst TX_DIGEST_LENGTH = 32;\n\n/** Returns whether the tx digest is valid based on the serialization format */\nexport function isValidTransactionDigest(value: string): value is string {\n\ttry {\n\t\tconst buffer = fromBase58(value);\n\t\treturn buffer.length === TX_DIGEST_LENGTH;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n// TODO - can we automatically sync this with rust length definition?\n// Source of truth is\n// https://github.com/MystenLabs/sui/blob/acb2b97ae21f47600e05b0d28127d88d0725561d/crates/sui-types/src/base_types.rs#L67\n// which uses the Move account address length\n// https://github.com/move-language/move/blob/67ec40dc50c66c34fd73512fcc412f3b68d67235/language/move-core/types/src/account_address.rs#L23 .\n\nexport const SUI_ADDRESS_LENGTH = 32;\nexport function isValidSuiAddress(value: string): value is string {\n\treturn isHex(value) && getHexByteLength(value) === SUI_ADDRESS_LENGTH;\n}\n\nexport function isValidSuiObjectId(value: string): boolean {\n\treturn isValidSuiAddress(value);\n}\n\nconst MOVE_IDENTIFIER_REGEX = /^[a-zA-Z][a-zA-Z0-9_]*$/;\n\nexport function isValidMoveIdentifier(name: string): boolean {\n\treturn MOVE_IDENTIFIER_REGEX.test(name);\n}\n\nconst PRIMITIVE_TYPE_TAGS = [\n\t'bool',\n\t'u8',\n\t'u16',\n\t'u32',\n\t'u64',\n\t'u128',\n\t'u256',\n\t'address',\n\t'signer',\n];\n\nconst VECTOR_TYPE_REGEX = /^vector<(.+)>$/;\n\nfunction isValidTypeTag(type: string): boolean {\n\tif (PRIMITIVE_TYPE_TAGS.includes(type)) return true;\n\n\tconst vectorMatch = type.match(VECTOR_TYPE_REGEX);\n\tif (vectorMatch) return isValidTypeTag(vectorMatch[1]);\n\n\tif (type.includes('::')) return isValidStructTag(type);\n\n\treturn false;\n}\n\nfunction isValidParsedStructTag(tag: StructTag): boolean {\n\tif (!isValidSuiAddress(tag.address) && !isValidNamedPackage(tag.address)) {\n\t\treturn false;\n\t}\n\n\tif (!isValidMoveIdentifier(tag.module) || !isValidMoveIdentifier(tag.name)) {\n\t\treturn false;\n\t}\n\n\treturn tag.typeParams.every((param) => {\n\t\tif (typeof param === 'string') {\n\t\t\treturn isValidTypeTag(param);\n\t\t}\n\t\treturn isValidParsedStructTag(param);\n\t});\n}\n\nexport function isValidStructTag(type: string): boolean {\n\ttry {\n\t\tconst tag = parseStructTag(type);\n\t\treturn isValidParsedStructTag(tag);\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport type StructTag = {\n\taddress: string;\n\tmodule: string;\n\tname: string;\n\ttypeParams: (string | StructTag)[];\n};\n\nfunction parseTypeTag(type: string): string | StructTag {\n\tif (type.startsWith('vector<')) {\n\t\tif (!type.endsWith('>')) {\n\t\t\tthrow new Error(`Invalid type tag: ${type}`);\n\t\t}\n\t\tconst inner = type.slice(7, -1);\n\t\tif (!inner) {\n\t\t\tthrow new Error(`Invalid type tag: ${type}`);\n\t\t}\n\t\tconst parsed = parseTypeTag(inner);\n\t\tif (typeof parsed === 'string') {\n\t\t\treturn `vector<${parsed}>`;\n\t\t}\n\t\treturn `vector<${normalizeStructTag(parsed)}>`;\n\t}\n\n\tif (!type.includes('::')) return type;\n\n\treturn parseStructTag(type);\n}\n\nexport function parseStructTag(type: string): StructTag {\n\tconst parts = type.split('::');\n\n\tif (parts.length < 3) {\n\t\tthrow new Error(`Invalid struct tag: ${type}`);\n\t}\n\n\tconst [address, module] = parts;\n\tconst isMvrPackage = isValidNamedPackage(address);\n\n\tconst rest = type.slice(address.length + module.length + 4);\n\tconst name = rest.includes('<') ? rest.slice(0, rest.indexOf('<')) : rest;\n\tconst typeParams = rest.includes('<')\n\t\t? splitGenericParameters(rest.slice(rest.indexOf('<') + 1, rest.lastIndexOf('>'))).map(\n\t\t\t\t(typeParam) => parseTypeTag(typeParam.trim()),\n\t\t\t)\n\t\t: [];\n\n\treturn {\n\t\taddress: isMvrPackage ? address : normalizeSuiAddress(address),\n\t\tmodule,\n\t\tname,\n\t\ttypeParams,\n\t};\n}\n\nexport function normalizeStructTag(type: string | StructTag): string {\n\tconst { address, module, name, typeParams } =\n\t\ttypeof type === 'string' ? parseStructTag(type) : type;\n\n\tconst formattedTypeParams =\n\t\ttypeParams?.length > 0\n\t\t\t? `<${typeParams\n\t\t\t\t\t.map((typeParam) =>\n\t\t\t\t\t\ttypeof typeParam === 'string' ? typeParam : normalizeStructTag(typeParam),\n\t\t\t\t\t)\n\t\t\t\t\t.join(',')}>`\n\t\t\t: '';\n\n\treturn `${address}::${module}::${name}${formattedTypeParams}`;\n}\n\n/**\n * Perform the following operations:\n * 1. Make the address lower case\n * 2. Prepend `0x` if the string does not start with `0x`.\n * 3. Add more zeros if the length of the address(excluding `0x`) is less than `SUI_ADDRESS_LENGTH`\n *\n * WARNING: if the address value itself starts with `0x`, e.g., `0x0x`, the default behavior\n * is to treat the first `0x` not as part of the address. The default behavior can be overridden by\n * setting `forceAdd0x` to true\n *\n */\nexport function normalizeSuiAddress(value: string, forceAdd0x: boolean = false): string {\n\tlet address = value.toLowerCase();\n\tif (!forceAdd0x && address.startsWith('0x')) {\n\t\taddress = address.slice(2);\n\t}\n\treturn `0x${address.padStart(SUI_ADDRESS_LENGTH * 2, '0')}`;\n}\n\nexport function normalizeSuiObjectId(value: string, forceAdd0x: boolean = false): string {\n\treturn normalizeSuiAddress(value, forceAdd0x);\n}\n\nfunction isHex(value: string): boolean {\n\treturn /^(0x|0X)?[a-fA-F0-9]+$/.test(value) && value.length % 2 === 0;\n}\n\nfunction getHexByteLength(value: string): number {\n\treturn /^(0x|0X)/.test(value) ? (value.length - 2) / 2 : value.length / 2;\n}\n"],"mappings":";;;;AAOA,MAAM,mBAAmB;;AAGzB,SAAgB,yBAAyB,OAAgC;AACxE,KAAI;AAEH,SADe,WAAW,MAAM,CAClB,WAAW;SAClB;AACP,SAAO;;;AAUT,MAAa,qBAAqB;AAClC,SAAgB,kBAAkB,OAAgC;AACjE,QAAO,MAAM,MAAM,IAAI,iBAAiB,MAAM,KAAK;;AAGpD,SAAgB,mBAAmB,OAAwB;AAC1D,QAAO,kBAAkB,MAAM;;AAGhC,MAAM,wBAAwB;AAE9B,SAAgB,sBAAsB,MAAuB;AAC5D,QAAO,sBAAsB,KAAK,KAAK;;AAGxC,MAAM,sBAAsB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAED,MAAM,oBAAoB;AAE1B,SAAS,eAAe,MAAuB;AAC9C,KAAI,oBAAoB,SAAS,KAAK,CAAE,QAAO;CAE/C,MAAM,cAAc,KAAK,MAAM,kBAAkB;AACjD,KAAI,YAAa,QAAO,eAAe,YAAY,GAAG;AAEtD,KAAI,KAAK,SAAS,KAAK,CAAE,QAAO,iBAAiB,KAAK;AAEtD,QAAO;;AAGR,SAAS,uBAAuB,KAAyB;AACxD,KAAI,CAAC,kBAAkB,IAAI,QAAQ,IAAI,CAAC,oBAAoB,IAAI,QAAQ,CACvE,QAAO;AAGR,KAAI,CAAC,sBAAsB,IAAI,OAAO,IAAI,CAAC,sBAAsB,IAAI,KAAK,CACzE,QAAO;AAGR,QAAO,IAAI,WAAW,OAAO,UAAU;AACtC,MAAI,OAAO,UAAU,SACpB,QAAO,eAAe,MAAM;AAE7B,SAAO,uBAAuB,MAAM;GACnC;;AAGH,SAAgB,iBAAiB,MAAuB;AACvD,KAAI;AAEH,SAAO,uBADK,eAAe,KAAK,C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,SAAS,IAClB,IAAI,WACH,KAAK,cACL,OAAO,cAAc,WAAW,YAAY,mBAAmB,UAAU,CACzE,CACA,KAAK,IAAI,CAAC,KACX;;;;;;;;;;;;;AAgBL,SAAgB,oBAAoB,OAAe,aAAsB,OAAe;CACvF,IAAI,UAAU,MAAM,aAAa;AACjC,KAAI,CAAC,cAAc,QAAQ,WAAW,KAAK,CAC1C,WAAU,QAAQ,MAAM,EAAE;AAE3B,QAAO,KAAK,QAAQ,SAAS,qBAAqB,GAAG,IAAI;;AAG1D,SAAgB,qBAAqB,OAAe,aAAsB,OAAe;AACxF,QAAO,oBAAoB,OAAO,WAAW;;AAG9C,SAAS,MAAM,OAAwB;AACtC,QAAO,yBAAyB,KAAK,MAAM,IAAI,MAAM,SAAS,MAAM;;AAGrE,SAAS,iBAAiB,OAAuB;AAChD,QAAO,WAAW,KAAK,MAAM,IAAI,MAAM,SAAS,KAAK,IAAI,MAAM,SAAS"}
|
package/dist/version.mjs
CHANGED
package/dist/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// This file is generated by genversion.mjs. Do not edit it directly.\n\nexport const PACKAGE_VERSION = '2.
|
|
1
|
+
{"version":3,"file":"version.mjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// This file is generated by genversion.mjs. Do not edit it directly.\n\nexport const PACKAGE_VERSION = '2.5.0';\nexport const TARGETED_RPC_VERSION = '1.67.0';\n"],"mappings":";AAKA,MAAa,kBAAkB;AAC/B,MAAa,uBAAuB"}
|
package/dist/zklogin/bcs.d.mts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _mysten_bcs810 from "@mysten/bcs";
|
|
2
2
|
import { InferBcsInput } from "@mysten/bcs";
|
|
3
3
|
|
|
4
4
|
//#region src/zklogin/bcs.d.ts
|
|
5
|
-
declare const zkLoginSignature:
|
|
6
|
-
inputs:
|
|
7
|
-
proofPoints:
|
|
8
|
-
a:
|
|
5
|
+
declare const zkLoginSignature: _mysten_bcs810.BcsStruct<{
|
|
6
|
+
inputs: _mysten_bcs810.BcsStruct<{
|
|
7
|
+
proofPoints: _mysten_bcs810.BcsStruct<{
|
|
8
|
+
a: _mysten_bcs810.BcsType<string[], Iterable<string> & {
|
|
9
9
|
length: number;
|
|
10
10
|
}, string>;
|
|
11
|
-
b:
|
|
11
|
+
b: _mysten_bcs810.BcsType<string[][], Iterable<Iterable<string> & {
|
|
12
12
|
length: number;
|
|
13
13
|
}> & {
|
|
14
14
|
length: number;
|
|
15
15
|
}, string>;
|
|
16
|
-
c:
|
|
16
|
+
c: _mysten_bcs810.BcsType<string[], Iterable<string> & {
|
|
17
17
|
length: number;
|
|
18
18
|
}, string>;
|
|
19
19
|
}, string>;
|
|
20
|
-
issBase64Details:
|
|
21
|
-
value:
|
|
22
|
-
indexMod4:
|
|
20
|
+
issBase64Details: _mysten_bcs810.BcsStruct<{
|
|
21
|
+
value: _mysten_bcs810.BcsType<string, string, "string">;
|
|
22
|
+
indexMod4: _mysten_bcs810.BcsType<number, number, "u8">;
|
|
23
23
|
}, string>;
|
|
24
|
-
headerBase64:
|
|
25
|
-
addressSeed:
|
|
24
|
+
headerBase64: _mysten_bcs810.BcsType<string, string, "string">;
|
|
25
|
+
addressSeed: _mysten_bcs810.BcsType<string, string, "string">;
|
|
26
26
|
}, string>;
|
|
27
|
-
maxEpoch:
|
|
28
|
-
userSignature:
|
|
27
|
+
maxEpoch: _mysten_bcs810.BcsType<string, string | number | bigint, "u64">;
|
|
28
|
+
userSignature: _mysten_bcs810.BcsType<Uint8Array<ArrayBufferLike>, Iterable<number>, "vector<u8>">;
|
|
29
29
|
}, string>;
|
|
30
30
|
type ZkLoginSignature = InferBcsInput<typeof zkLoginSignature>;
|
|
31
31
|
type ZkLoginSignatureInputs = ZkLoginSignature['inputs'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bcs.d.mts","names":[],"sources":["../../src/zklogin/bcs.ts"],"sourcesContent":[],"mappings":";;;;cAMa,
|
|
1
|
+
{"version":3,"file":"bcs.d.mts","names":[],"sources":["../../src/zklogin/bcs.ts"],"sourcesContent":[],"mappings":";;;;cAMa,iCAAgB;;;MAAhB,CAAA,wBAgBX,CAAA,MAAA,EAAA,UAAA,CAAA,MAAA,CAAA,GAAA;;;;;;;;;;;;;;;;;;;;eAhB2B,wBAAA,WAAA,gBAAA,CAAA,UAAA,CAAA,MAAA,CAAA,EAAA,YAAA,CAAA;CAAA,EAAA,MAAA,CAAA;AAkBjB,KAAA,gBAAA,GAAmB,aAAqB,CAAA,OAAA,gBAAR,CAAA;AAChC,KAAA,sBAAA,GAAyB,gBAAA,CAAA,QAAgB,CAAA"}
|
package/package.json
CHANGED
package/src/client/types.ts
CHANGED
|
@@ -155,15 +155,17 @@ export namespace SuiClientTypes {
|
|
|
155
155
|
balance: string;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
export type DynamicFieldEntry = {
|
|
159
|
+
fieldId: string;
|
|
160
|
+
type: string;
|
|
161
|
+
name: DynamicFieldName;
|
|
162
|
+
valueType: string;
|
|
163
|
+
} & ({ $kind: 'DynamicField'; childId?: never } | { $kind: 'DynamicObject'; childId: string });
|
|
164
|
+
|
|
158
165
|
export interface ListDynamicFieldsResponse {
|
|
159
166
|
hasNextPage: boolean;
|
|
160
167
|
cursor: string | null;
|
|
161
|
-
dynamicFields:
|
|
162
|
-
fieldId: string;
|
|
163
|
-
type: string;
|
|
164
|
-
name: DynamicFieldName;
|
|
165
|
-
valueType: string;
|
|
166
|
-
}[];
|
|
168
|
+
dynamicFields: DynamicFieldEntry[];
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
export interface GetDynamicFieldResponse {
|
package/src/graphql/core.ts
CHANGED
|
@@ -571,19 +571,25 @@ export class GraphQLCoreClient extends CoreClient {
|
|
|
571
571
|
);
|
|
572
572
|
|
|
573
573
|
return {
|
|
574
|
-
dynamicFields: result.nodes.map((dynamicField) => {
|
|
574
|
+
dynamicFields: result.nodes.map((dynamicField): SuiClientTypes.DynamicFieldEntry => {
|
|
575
575
|
const valueType =
|
|
576
576
|
dynamicField.value?.__typename === 'MoveObject'
|
|
577
577
|
? dynamicField.value.contents?.type?.repr!
|
|
578
578
|
: dynamicField.value?.type?.repr!;
|
|
579
|
+
const isDynamicObject = dynamicField.value?.__typename === 'MoveObject';
|
|
580
|
+
const derivedNameType = isDynamicObject
|
|
581
|
+
? `0x2::dynamic_object_field::Wrapper<${dynamicField.name?.type?.repr}>`
|
|
582
|
+
: dynamicField.name?.type?.repr!;
|
|
583
|
+
|
|
579
584
|
return {
|
|
585
|
+
$kind: isDynamicObject ? 'DynamicObject' : 'DynamicField',
|
|
580
586
|
fieldId: deriveDynamicFieldID(
|
|
581
587
|
options.parentId,
|
|
582
|
-
|
|
588
|
+
derivedNameType,
|
|
583
589
|
fromBase64(dynamicField.name?.bcs!),
|
|
584
590
|
),
|
|
585
591
|
type: normalizeStructTag(
|
|
586
|
-
|
|
592
|
+
isDynamicObject
|
|
587
593
|
? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${dynamicField.name?.type?.repr}>,0x2::object::ID>`
|
|
588
594
|
: `0x2::dynamic_field::Field<${dynamicField.name?.type?.repr},${valueType}>`,
|
|
589
595
|
),
|
|
@@ -592,7 +598,11 @@ export class GraphQLCoreClient extends CoreClient {
|
|
|
592
598
|
bcs: fromBase64(dynamicField.name?.bcs!),
|
|
593
599
|
},
|
|
594
600
|
valueType,
|
|
595
|
-
|
|
601
|
+
childId:
|
|
602
|
+
isDynamicObject && dynamicField.value?.__typename === 'MoveObject'
|
|
603
|
+
? dynamicField.value.address
|
|
604
|
+
: undefined,
|
|
605
|
+
} as SuiClientTypes.DynamicFieldEntry;
|
|
596
606
|
}),
|
|
597
607
|
cursor: result.pageInfo.endCursor ?? null,
|
|
598
608
|
hasNextPage: result.pageInfo.hasNextPage,
|
|
@@ -4648,7 +4648,7 @@ export type GetDynamicFieldsQueryVariables = Exact<{
|
|
|
4648
4648
|
|
|
4649
4649
|
|
|
4650
4650
|
export type GetDynamicFieldsQuery = { __typename?: 'Query', address?: { __typename?: 'Address', dynamicFields?: { __typename?: 'DynamicFieldConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, nodes: Array<{ __typename?: 'DynamicField', name?: { __typename?: 'MoveValue', bcs?: string | null, type?: { __typename?: 'MoveType', repr: string } | null } | null, value?:
|
|
4651
|
-
| { __typename: 'MoveObject', contents?: { __typename?: 'MoveValue', type?: { __typename?: 'MoveType', repr: string } | null } | null }
|
|
4651
|
+
| { __typename: 'MoveObject', address: string, contents?: { __typename?: 'MoveValue', type?: { __typename?: 'MoveType', repr: string } | null } | null }
|
|
4652
4652
|
| { __typename: 'MoveValue', type?: { __typename?: 'MoveType', repr: string } | null }
|
|
4653
4653
|
| null }> } | null } | null };
|
|
4654
4654
|
|
|
@@ -5147,6 +5147,7 @@ export const GetDynamicFieldsDocument = new TypedDocumentString(`
|
|
|
5147
5147
|
}
|
|
5148
5148
|
}
|
|
5149
5149
|
... on MoveObject {
|
|
5150
|
+
address
|
|
5150
5151
|
contents {
|
|
5151
5152
|
type {
|
|
5152
5153
|
repr
|
package/src/grpc/core.ts
CHANGED
|
@@ -566,26 +566,30 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
566
566
|
pageToken: options.cursor ? fromBase64(options.cursor) : undefined,
|
|
567
567
|
pageSize: options.limit,
|
|
568
568
|
readMask: {
|
|
569
|
-
paths: ['field_id', 'name', 'value_type', 'kind'],
|
|
569
|
+
paths: ['field_id', 'name', 'value_type', 'kind', 'child_id'],
|
|
570
570
|
},
|
|
571
571
|
});
|
|
572
572
|
|
|
573
573
|
return {
|
|
574
|
-
dynamicFields: response.response.dynamicFields.map(
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
574
|
+
dynamicFields: response.response.dynamicFields.map(
|
|
575
|
+
(field): SuiClientTypes.DynamicFieldEntry => {
|
|
576
|
+
const isDynamicObject = field.kind === DynamicField_DynamicFieldKind.OBJECT;
|
|
577
|
+
const fieldType = isDynamicObject
|
|
578
|
+
? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${field.name?.name!}>,0x2::object::ID>`
|
|
579
|
+
: `0x2::dynamic_field::Field<${field.name?.name!},${field.valueType!}>`;
|
|
580
|
+
return {
|
|
581
|
+
$kind: isDynamicObject ? 'DynamicObject' : 'DynamicField',
|
|
582
|
+
fieldId: field.fieldId!,
|
|
583
|
+
name: {
|
|
584
|
+
type: field.name?.name!,
|
|
585
|
+
bcs: field.name?.value!,
|
|
586
|
+
},
|
|
587
|
+
valueType: field.valueType!,
|
|
588
|
+
type: normalizeStructTag(fieldType),
|
|
589
|
+
childId: field.childId,
|
|
590
|
+
} as SuiClientTypes.DynamicFieldEntry;
|
|
591
|
+
},
|
|
592
|
+
),
|
|
589
593
|
cursor: response.response.nextPageToken ? toBase64(response.response.nextPageToken) : null,
|
|
590
594
|
hasNextPage: response.response.nextPageToken !== undefined,
|
|
591
595
|
};
|