@mysten/sui 2.13.3 → 2.13.4

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @mysten/sui.js
2
2
 
3
+ ## 2.13.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 2f76ba2: Revert removal of coin reservation feature flag check in core resolver
8
+
3
9
  ## 2.13.3
4
10
 
5
11
  ### Patch Changes
@@ -1,21 +1,21 @@
1
1
  import { TypeTag as TypeTag$1 } from "./types.mjs";
2
- import * as _mysten_bcs830 from "@mysten/bcs";
2
+ import * as _mysten_bcs810 from "@mysten/bcs";
3
3
  import { BcsType } from "@mysten/bcs";
4
4
 
5
5
  //#region src/bcs/bcs.d.ts
6
6
  declare const TypeTag: BcsType<string, string | TypeTag$1, string>;
7
- declare function IntentMessage<T extends BcsType<any>>(T: T): _mysten_bcs830.BcsStruct<{
8
- intent: _mysten_bcs830.BcsStruct<{
9
- scope: _mysten_bcs830.BcsEnum<{
7
+ declare function IntentMessage<T extends BcsType<any>>(T: T): _mysten_bcs810.BcsStruct<{
8
+ intent: _mysten_bcs810.BcsStruct<{
9
+ scope: _mysten_bcs810.BcsEnum<{
10
10
  TransactionData: null;
11
11
  TransactionEffects: null;
12
12
  CheckpointSummary: null;
13
13
  PersonalMessage: null;
14
14
  }, "IntentScope">;
15
- version: _mysten_bcs830.BcsEnum<{
15
+ version: _mysten_bcs810.BcsEnum<{
16
16
  V0: null;
17
17
  }, "IntentVersion">;
18
- appId: _mysten_bcs830.BcsEnum<{
18
+ appId: _mysten_bcs810.BcsEnum<{
19
19
  Sui: null;
20
20
  }, "AppId">;
21
21
  }, string>;
@@ -40,7 +40,7 @@ async function coreClientResolveTransactionPlugin(transactionData, options, next
40
40
  if (withdrawalOwner && normalizeSuiAddress(withdrawalOwner) === normalizedGasPayer && input.FundsWithdrawal.reservation.$kind === "MaxAmountU64") withdrawals += BigInt(input.FundsWithdrawal.reservation.MaxAmountU64);
41
41
  }
42
42
  const needsSystemState = needsGasPrice || needsPayment && usesGasCoin;
43
- const [, systemStateResult, balanceResult, coinsResult, chainIdResult] = await Promise.all([
43
+ const [, systemStateResult, balanceResult, coinsResult, protocolConfigResult, chainIdResult] = await Promise.all([
44
44
  normalizeInputs(transactionData, client),
45
45
  needsSystemState ? client.core.getCurrentSystemState() : null,
46
46
  needsPayment && gasPayer ? client.core.getBalance({ owner: gasPayer }) : null,
@@ -48,6 +48,7 @@ async function coreClientResolveTransactionPlugin(transactionData, options, next
48
48
  owner: gasPayer,
49
49
  coinType: SUI_TYPE_ARG
50
50
  }) : null,
51
+ needsPayment && usesGasCoin ? client.core.getProtocolConfig() : null,
51
52
  needsPayment && usesGasCoin ? client.core.getChainIdentifier() : null
52
53
  ]);
53
54
  await resolveObjectReferences(transactionData, client);
@@ -63,6 +64,7 @@ async function coreClientResolveTransactionPlugin(transactionData, options, next
63
64
  coins: coinsResult,
64
65
  usesGasCoin,
65
66
  withdrawals,
67
+ protocolConfig: protocolConfigResult?.protocolConfig,
66
68
  gasPayer,
67
69
  chainIdentifier: chainIdResult?.chainIdentifier ?? null,
68
70
  epoch: systemState?.epoch ?? null
@@ -90,7 +92,7 @@ async function setGasBudget(transactionData, client) {
90
92
  }
91
93
  transactionData.gasData.budget = computeGasBudget(simulateResult.Transaction.effects.gasUsed, transactionData.gasData.price ? String(transactionData.gasData.price) : void 0);
92
94
  }
93
- function setGasPayment({ transactionData, balance, coins, usesGasCoin, withdrawals, gasPayer, chainIdentifier, epoch }) {
95
+ function setGasPayment({ transactionData, balance, coins, usesGasCoin, withdrawals, protocolConfig, gasPayer, chainIdentifier, epoch }) {
94
96
  const budget = BigInt(transactionData.gasData.budget);
95
97
  const addressBalance = BigInt(balance.balance.addressBalance);
96
98
  if (budget === 0n || !usesGasCoin && addressBalance >= budget + withdrawals) {
@@ -109,7 +111,7 @@ function setGasPayment({ transactionData, balance, coins, usesGasCoin, withdrawa
109
111
  version: coin.version
110
112
  }));
111
113
  const reservationAmount = addressBalance - withdrawals;
112
- if (usesGasCoin && reservationAmount > 0n && chainIdentifier && epoch) transactionData.gasData.payment = [createCoinReservationRef(reservationAmount, gasPayer, chainIdentifier, epoch), ...paymentCoins];
114
+ if (usesGasCoin && reservationAmount > 0n && protocolConfig?.featureFlags?.["enable_coin_reservation_obj_refs"] && chainIdentifier && epoch) transactionData.gasData.payment = [createCoinReservationRef(reservationAmount, gasPayer, chainIdentifier, epoch), ...paymentCoins];
113
115
  else if (!filteredCoins.length) throw new Error("No valid gas coins found for the transaction.");
114
116
  else transactionData.gasData.payment = paymentCoins;
115
117
  }
@@ -1 +1 @@
1
- {"version":3,"file":"core-resolver.mjs","names":[],"sources":["../../src/client/core-resolver.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n\tnormalizeSuiAddress,\n\tnormalizeSuiObjectId,\n\tnormalizeStructTag,\n\tSUI_TYPE_ARG,\n} from '../utils/index.js';\nimport { createCoinReservationRef } from '../utils/coin-reservation.js';\nimport type { ClientWithCoreApi } from './core.js';\nimport type { CallArg, Command } from '../transactions/data/internal.js';\nimport type { SuiClientTypes } from './types.js';\nimport { SimulationError } from './errors.js';\nimport { Inputs } from '../transactions/Inputs.js';\nimport { getPureBcsSchema, isTxContext } from '../transactions/serializer.js';\nimport type { TransactionDataBuilder } from '../transactions/TransactionData.js';\nimport { chunk } from '@mysten/utils';\nimport type { BuildTransactionOptions } from '../transactions/index.js';\n\n// The maximum objects that can be fetched at once using multiGetObjects.\nconst MAX_OBJECTS_PER_FETCH = 50;\n\n// An amount of gas (in gas units) that is added to transactions as an overhead to ensure transactions do not fail.\nconst GAS_SAFE_OVERHEAD = 1000n;\nconst MAX_GAS = 50_000_000_000;\n\n/** Compute a gas budget from gasUsed effects data. */\nexport function computeGasBudget(\n\tgasUsed: { computationCost: string; storageCost: string; storageRebate: string },\n\tgasPrice: bigint | string = 1n,\n): string {\n\tconst safeOverhead = GAS_SAFE_OVERHEAD * BigInt(gasPrice);\n\tconst baseComputationCostWithOverhead = BigInt(gasUsed.computationCost) + safeOverhead;\n\tconst gasBudget =\n\t\tbaseComputationCostWithOverhead + BigInt(gasUsed.storageCost) - BigInt(gasUsed.storageRebate);\n\treturn String(\n\t\tgasBudget > baseComputationCostWithOverhead ? gasBudget : baseComputationCostWithOverhead,\n\t);\n}\n\nfunction getClient(options: BuildTransactionOptions): ClientWithCoreApi {\n\tif (!options.client) {\n\t\tthrow new Error(\n\t\t\t`No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.`,\n\t\t);\n\t}\n\treturn options.client;\n}\n\nexport async function coreClientResolveTransactionPlugin(\n\ttransactionData: TransactionDataBuilder,\n\toptions: BuildTransactionOptions,\n\tnext: () => Promise<void>,\n) {\n\tconst client = getClient(options);\n\n\tconst needsGasPrice = !options.onlyTransactionKind && !transactionData.gasData.price;\n\tconst needsPayment = !options.onlyTransactionKind && !transactionData.gasData.payment;\n\tconst gasPayer = transactionData.gasData.owner ?? transactionData.sender;\n\n\tlet usesGasCoin = false;\n\tlet withdrawals = 0n;\n\n\ttransactionData.mapArguments((arg) => {\n\t\tif (arg.$kind === 'GasCoin') usesGasCoin = true;\n\t\treturn arg;\n\t});\n\n\tconst normalizedGasPayer = gasPayer ? normalizeSuiAddress(gasPayer) : null;\n\tfor (const input of transactionData.inputs) {\n\t\tif (input.$kind !== 'FundsWithdrawal' || !normalizedGasPayer) continue;\n\t\tif (normalizeStructTag(input.FundsWithdrawal.typeArg.Balance) !== SUI_TYPE_ARG) continue;\n\n\t\tconst withdrawalOwner = input.FundsWithdrawal.withdrawFrom.Sender\n\t\t\t? transactionData.sender\n\t\t\t: gasPayer;\n\t\tif (\n\t\t\twithdrawalOwner &&\n\t\t\tnormalizeSuiAddress(withdrawalOwner) === normalizedGasPayer &&\n\t\t\tinput.FundsWithdrawal.reservation.$kind === 'MaxAmountU64'\n\t\t) {\n\t\t\twithdrawals += BigInt(input.FundsWithdrawal.reservation.MaxAmountU64);\n\t\t}\n\t}\n\n\tconst needsSystemState = needsGasPrice || (needsPayment && usesGasCoin);\n\tconst [, systemStateResult, balanceResult, coinsResult, chainIdResult] = await Promise.all([\n\t\tnormalizeInputs(transactionData, client),\n\t\tneedsSystemState ? client.core.getCurrentSystemState() : null,\n\t\tneedsPayment && gasPayer ? client.core.getBalance({ owner: gasPayer }) : null,\n\t\tneedsPayment && gasPayer\n\t\t\t? client.core.listCoins({ owner: gasPayer, coinType: SUI_TYPE_ARG })\n\t\t\t: null,\n\t\tneedsPayment && usesGasCoin ? client.core.getChainIdentifier() : null,\n\t]);\n\n\tawait resolveObjectReferences(transactionData, client);\n\n\tif (!options.onlyTransactionKind) {\n\t\tconst systemState = systemStateResult?.systemState ?? null;\n\n\t\tif (systemState && !transactionData.gasData.price) {\n\t\t\ttransactionData.gasData.price = systemState.referenceGasPrice;\n\t\t}\n\n\t\tawait setGasBudget(transactionData, client);\n\n\t\tif (needsPayment) {\n\t\t\tif (!balanceResult || !coinsResult) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Could not resolve gas payment: a gas owner or sender must be set to fetch balance and coins.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tsetGasPayment({\n\t\t\t\ttransactionData,\n\t\t\t\tbalance: balanceResult,\n\t\t\t\tcoins: coinsResult,\n\t\t\t\tusesGasCoin,\n\t\t\t\twithdrawals,\n\t\t\t\tgasPayer: gasPayer!,\n\t\t\t\tchainIdentifier: chainIdResult?.chainIdentifier ?? null,\n\t\t\t\tepoch: systemState?.epoch ?? null,\n\t\t\t});\n\t\t}\n\n\t\tif (!transactionData.expiration && transactionData.gasData.payment?.length === 0) {\n\t\t\tawait setExpiration(\n\t\t\t\ttransactionData,\n\t\t\t\tclient,\n\t\t\t\tsystemState,\n\t\t\t\tchainIdResult?.chainIdentifier ?? null,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn await next();\n}\n\nasync function setGasBudget(transactionData: TransactionDataBuilder, client: ClientWithCoreApi) {\n\tif (transactionData.gasData.budget) {\n\t\treturn;\n\t}\n\n\tconst simulateResult = await client.core.simulateTransaction({\n\t\ttransaction: transactionData.build({\n\t\t\toverrides: {\n\t\t\t\tgasData: {\n\t\t\t\t\tbudget: String(MAX_GAS),\n\t\t\t\t\tpayment: [],\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t\tinclude: { effects: true },\n\t});\n\n\tif (simulateResult.$kind === 'FailedTransaction') {\n\t\tconst executionError = simulateResult.FailedTransaction.status.error ?? undefined;\n\t\tconst errorMessage = executionError?.message ?? 'Unknown error';\n\t\tthrow new SimulationError(`Transaction resolution failed: ${errorMessage}`, {\n\t\t\tcause: simulateResult,\n\t\t\texecutionError,\n\t\t});\n\t}\n\n\ttransactionData.gasData.budget = computeGasBudget(\n\t\tsimulateResult.Transaction.effects!.gasUsed,\n\t\ttransactionData.gasData.price ? String(transactionData.gasData.price) : undefined,\n\t);\n}\n\nfunction setGasPayment({\n\ttransactionData,\n\tbalance,\n\tcoins,\n\tusesGasCoin,\n\twithdrawals,\n\tgasPayer,\n\tchainIdentifier,\n\tepoch,\n}: {\n\ttransactionData: TransactionDataBuilder;\n\tbalance: SuiClientTypes.GetBalanceResponse;\n\tcoins: SuiClientTypes.ListCoinsResponse;\n\tusesGasCoin: boolean;\n\twithdrawals: bigint;\n\tgasPayer: string;\n\tchainIdentifier: string | null;\n\tepoch: string | null;\n}) {\n\tconst budget = BigInt(transactionData.gasData.budget!);\n\tconst addressBalance = BigInt(balance.balance.addressBalance);\n\n\tif (budget === 0n || (!usesGasCoin && addressBalance >= budget + withdrawals)) {\n\t\ttransactionData.gasData.payment = [];\n\t\treturn;\n\t}\n\n\tconst filteredCoins = coins.objects.filter((coin) => {\n\t\tconst matchingInput = transactionData.inputs.find((input) => {\n\t\t\tif (input.Object?.ImmOrOwnedObject) {\n\t\t\t\treturn coin.objectId === input.Object.ImmOrOwnedObject.objectId;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t});\n\n\t\treturn !matchingInput;\n\t});\n\n\tconst paymentCoins = filteredCoins.map((coin) => ({\n\t\tobjectId: coin.objectId,\n\t\tdigest: coin.digest,\n\t\tversion: coin.version,\n\t}));\n\n\tconst reservationAmount = addressBalance - withdrawals;\n\n\tif (usesGasCoin && reservationAmount > 0n && chainIdentifier && epoch) {\n\t\ttransactionData.gasData.payment = [\n\t\t\tcreateCoinReservationRef(reservationAmount, gasPayer, chainIdentifier, epoch),\n\t\t\t...paymentCoins,\n\t\t];\n\t} else if (!filteredCoins.length) {\n\t\tthrow new Error('No valid gas coins found for the transaction.');\n\t} else {\n\t\ttransactionData.gasData.payment = paymentCoins;\n\t}\n}\n\ninterface SystemStateData {\n\tepoch: string;\n\treferenceGasPrice: string;\n}\n\nasync function setExpiration(\n\ttransactionData: TransactionDataBuilder,\n\tclient: ClientWithCoreApi,\n\tsystemState: SystemStateData | null,\n\texistingChainIdentifier: string | null = null,\n) {\n\tconst [chainIdentifier, resolvedSystemState] = await Promise.all([\n\t\texistingChainIdentifier ?? client.core.getChainIdentifier().then((r) => r.chainIdentifier),\n\t\tsystemState ?? client.core.getCurrentSystemState().then((r) => r.systemState),\n\t]);\n\tconst currentEpoch = BigInt(resolvedSystemState.epoch);\n\n\ttransactionData.expiration = {\n\t\t$kind: 'ValidDuring',\n\t\tValidDuring: {\n\t\t\tminEpoch: String(currentEpoch),\n\t\t\tmaxEpoch: String(currentEpoch + 1n),\n\t\t\tminTimestamp: null,\n\t\t\tmaxTimestamp: null,\n\t\t\tchain: chainIdentifier,\n\t\t\tnonce: (Math.random() * 0x100000000) >>> 0,\n\t\t},\n\t};\n}\n\nasync function resolveObjectReferences(\n\ttransactionData: TransactionDataBuilder,\n\tclient: ClientWithCoreApi,\n) {\n\t// Keep track of the object references that will need to be resolved at the end of the transaction.\n\t// We keep the input by-reference to avoid needing to re-resolve it:\n\tconst objectsToResolve = transactionData.inputs.filter((input) => {\n\t\treturn (\n\t\t\tinput.UnresolvedObject &&\n\t\t\t!(input.UnresolvedObject.version || input.UnresolvedObject?.initialSharedVersion)\n\t\t);\n\t}) as Extract<CallArg, { UnresolvedObject: unknown }>[];\n\n\tconst dedupedIds = [\n\t\t...new Set(\n\t\t\tobjectsToResolve.map((input) => normalizeSuiObjectId(input.UnresolvedObject.objectId)),\n\t\t),\n\t];\n\n\tconst objectChunks = dedupedIds.length ? chunk(dedupedIds, MAX_OBJECTS_PER_FETCH) : [];\n\tconst resolved = (\n\t\tawait Promise.all(\n\t\t\tobjectChunks.map((chunkIds) =>\n\t\t\t\tclient.core.getObjects({\n\t\t\t\t\tobjectIds: chunkIds,\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t).flatMap((result) => result.objects);\n\n\tconst responsesById = new Map(\n\t\tdedupedIds.map((id, index) => {\n\t\t\treturn [id, resolved[index]];\n\t\t}),\n\t);\n\n\tconst invalidObjects = Array.from(responsesById)\n\t\t.filter(([_, obj]) => obj instanceof Error)\n\t\t.map(([_, obj]) => (obj as Error).message);\n\n\tif (invalidObjects.length) {\n\t\tthrow new Error(`The following input objects are invalid: ${invalidObjects.join(', ')}`);\n\t}\n\n\tconst objects = resolved.map((object) => {\n\t\tif (object instanceof Error) {\n\t\t\tthrow new Error(`Failed to fetch object: ${object.message}`);\n\t\t}\n\t\tconst owner = object.owner;\n\t\tconst initialSharedVersion =\n\t\t\towner && typeof owner === 'object'\n\t\t\t\t? owner.$kind === 'Shared'\n\t\t\t\t\t? owner.Shared.initialSharedVersion\n\t\t\t\t\t: owner.$kind === 'ConsensusAddressOwner'\n\t\t\t\t\t\t? owner.ConsensusAddressOwner.startVersion\n\t\t\t\t\t\t: null\n\t\t\t\t: null;\n\n\t\treturn {\n\t\t\tobjectId: object.objectId,\n\t\t\tdigest: object.digest,\n\t\t\tversion: object.version,\n\t\t\tinitialSharedVersion,\n\t\t};\n\t});\n\n\tconst objectsById = new Map(\n\t\tdedupedIds.map((id, index) => {\n\t\t\treturn [id, objects[index]];\n\t\t}),\n\t);\n\n\tfor (const [index, input] of transactionData.inputs.entries()) {\n\t\tif (!input.UnresolvedObject) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet updated: CallArg | undefined;\n\t\tconst id = normalizeSuiAddress(input.UnresolvedObject.objectId);\n\t\tconst object = objectsById.get(id);\n\n\t\tif (input.UnresolvedObject.initialSharedVersion ?? object?.initialSharedVersion) {\n\t\t\tupdated = Inputs.SharedObjectRef({\n\t\t\t\tobjectId: id,\n\t\t\t\tinitialSharedVersion:\n\t\t\t\t\tinput.UnresolvedObject.initialSharedVersion || object?.initialSharedVersion!,\n\t\t\t\tmutable: input.UnresolvedObject.mutable || isUsedAsMutable(transactionData, index),\n\t\t\t});\n\t\t} else if (isUsedAsReceiving(transactionData, index)) {\n\t\t\tupdated = Inputs.ReceivingRef(\n\t\t\t\t{\n\t\t\t\t\tobjectId: id,\n\t\t\t\t\tdigest: input.UnresolvedObject.digest ?? object?.digest!,\n\t\t\t\t\tversion: input.UnresolvedObject.version ?? object?.version!,\n\t\t\t\t}!,\n\t\t\t);\n\t\t}\n\n\t\ttransactionData.inputs[transactionData.inputs.indexOf(input)] =\n\t\t\tupdated ??\n\t\t\tInputs.ObjectRef({\n\t\t\t\tobjectId: id,\n\t\t\t\tdigest: input.UnresolvedObject.digest ?? object?.digest!,\n\t\t\t\tversion: input.UnresolvedObject.version ?? object?.version!,\n\t\t\t});\n\t}\n}\n\nasync function normalizeInputs(transactionData: TransactionDataBuilder, client: ClientWithCoreApi) {\n\tconst { inputs, commands } = transactionData;\n\tconst moveCallsToResolve: Extract<Command, { MoveCall: unknown }>['MoveCall'][] = [];\n\tconst moveFunctionsToResolve = new Set<string>();\n\n\tcommands.forEach((command) => {\n\t\t// Special case move call:\n\t\tif (command.MoveCall) {\n\t\t\t// Determine if any of the arguments require encoding.\n\t\t\t// - If they don't, then this is good to go.\n\t\t\t// - If they do, then we need to fetch the normalized move module.\n\n\t\t\t// If we already know the argument types, we don't need to resolve them again\n\t\t\tif (command.MoveCall._argumentTypes) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst inputs = command.MoveCall.arguments.map((arg) => {\n\t\t\t\tif (arg.$kind === 'Input') {\n\t\t\t\t\treturn transactionData.inputs[arg.Input];\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t});\n\t\t\tconst needsResolution = inputs.some(\n\t\t\t\t(input) =>\n\t\t\t\t\tinput?.UnresolvedPure ||\n\t\t\t\t\t(input?.UnresolvedObject && typeof input?.UnresolvedObject.mutable !== 'boolean'),\n\t\t\t);\n\n\t\t\tif (needsResolution) {\n\t\t\t\tconst functionName = `${command.MoveCall.package}::${command.MoveCall.module}::${command.MoveCall.function}`;\n\t\t\t\tmoveFunctionsToResolve.add(functionName);\n\t\t\t\tmoveCallsToResolve.push(command.MoveCall);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst moveFunctionParameters = new Map<string, SuiClientTypes.OpenSignature[]>();\n\tif (moveFunctionsToResolve.size > 0) {\n\t\tawait Promise.all(\n\t\t\t[...moveFunctionsToResolve].map(async (functionName) => {\n\t\t\t\tconst [packageId, moduleName, name] = functionName.split('::');\n\t\t\t\tconst { function: def } = await client.core.getMoveFunction({\n\t\t\t\t\tpackageId,\n\t\t\t\t\tmoduleName,\n\t\t\t\t\tname,\n\t\t\t\t});\n\n\t\t\t\tmoveFunctionParameters.set(functionName, def.parameters);\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (moveCallsToResolve.length) {\n\t\tawait Promise.all(\n\t\t\tmoveCallsToResolve.map(async (moveCall) => {\n\t\t\t\tconst parameters = moveFunctionParameters.get(\n\t\t\t\t\t`${moveCall.package}::${moveCall.module}::${moveCall.function}`,\n\t\t\t\t);\n\n\t\t\t\tif (!parameters) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Entry functions can have a mutable reference to an instance of the TxContext\n\t\t\t\t// struct defined in the TxContext module as the last parameter. The caller of\n\t\t\t\t// the function does not need to pass it in as an argument.\n\t\t\t\tconst hasTxContext = parameters.length > 0 && isTxContext(parameters.at(-1)!);\n\t\t\t\tconst params = hasTxContext ? parameters.slice(0, parameters.length - 1) : parameters;\n\n\t\t\t\tmoveCall._argumentTypes = params;\n\t\t\t}),\n\t\t);\n\t}\n\n\tcommands.forEach((command) => {\n\t\tif (!command.MoveCall) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst moveCall = command.MoveCall;\n\t\tconst fnName = `${moveCall.package}::${moveCall.module}::${moveCall.function}`;\n\t\tconst params = moveCall._argumentTypes;\n\n\t\tif (!params) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (params.length !== command.MoveCall.arguments.length) {\n\t\t\tthrow new Error(`Incorrect number of arguments for ${fnName}`);\n\t\t}\n\n\t\tparams.forEach((param, i) => {\n\t\t\tconst arg = moveCall.arguments[i];\n\t\t\tif (arg.$kind !== 'Input') return;\n\t\t\tconst input = inputs[arg.Input];\n\n\t\t\t// Skip if the input is already resolved\n\t\t\tif (!input.UnresolvedPure && !input.UnresolvedObject) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst inputValue = input.UnresolvedPure?.value ?? input.UnresolvedObject?.objectId!;\n\n\t\t\tconst schema = getPureBcsSchema(param.body);\n\t\t\tif (schema) {\n\t\t\t\targ.type = 'pure';\n\t\t\t\tinputs[inputs.indexOf(input)] = Inputs.Pure(schema.serialize(inputValue));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (typeof inputValue !== 'string') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Expect the argument to be an object id string, got ${JSON.stringify(\n\t\t\t\t\t\tinputValue,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t2,\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\targ.type = 'object';\n\t\t\tconst unresolvedObject: typeof input = input.UnresolvedPure\n\t\t\t\t? {\n\t\t\t\t\t\t$kind: 'UnresolvedObject',\n\t\t\t\t\t\tUnresolvedObject: {\n\t\t\t\t\t\t\tobjectId: inputValue,\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t: input;\n\n\t\t\tinputs[arg.Input] = unresolvedObject;\n\t\t});\n\t});\n}\n\nfunction isUsedAsMutable(transactionData: TransactionDataBuilder, index: number) {\n\tlet usedAsMutable = false;\n\n\ttransactionData.getInputUses(index, (arg, tx) => {\n\t\tif (tx.MoveCall && tx.MoveCall._argumentTypes) {\n\t\t\tconst argIndex = tx.MoveCall.arguments.indexOf(arg);\n\t\t\tusedAsMutable =\n\t\t\t\ttx.MoveCall._argumentTypes[argIndex].reference !== 'immutable' || usedAsMutable;\n\t\t}\n\n\t\tif (\n\t\t\ttx.$kind === 'MakeMoveVec' ||\n\t\t\ttx.$kind === 'MergeCoins' ||\n\t\t\ttx.$kind === 'SplitCoins' ||\n\t\t\ttx.$kind === 'TransferObjects'\n\t\t) {\n\t\t\tusedAsMutable = true;\n\t\t}\n\t});\n\n\treturn usedAsMutable;\n}\n\nfunction isUsedAsReceiving(transactionData: TransactionDataBuilder, index: number) {\n\tlet usedAsReceiving = false;\n\n\ttransactionData.getInputUses(index, (arg, tx) => {\n\t\tif (tx.MoveCall && tx.MoveCall._argumentTypes) {\n\t\t\tconst argIndex = tx.MoveCall.arguments.indexOf(arg);\n\t\t\tusedAsReceiving = isReceivingType(tx.MoveCall._argumentTypes[argIndex]) || usedAsReceiving;\n\t\t}\n\t});\n\n\treturn usedAsReceiving;\n}\n\nconst RECEIVING_TYPE =\n\t'0x0000000000000000000000000000000000000000000000000000000000000002::transfer::Receiving';\n\nfunction isReceivingType(type: SuiClientTypes.OpenSignature): boolean {\n\tif (type.body.$kind !== 'datatype') {\n\t\treturn false;\n\t}\n\n\treturn type.body.datatype.typeName === RECEIVING_TYPE;\n}\n"],"mappings":";;;;;;;;;AAqBA,MAAM,wBAAwB;AAG9B,MAAM,oBAAoB;AAC1B,MAAM,UAAU;;AAGhB,SAAgB,iBACf,SACA,WAA4B,IACnB;CACT,MA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) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n\tnormalizeSuiAddress,\n\tnormalizeSuiObjectId,\n\tnormalizeStructTag,\n\tSUI_TYPE_ARG,\n} from '../utils/index.js';\nimport { createCoinReservationRef } from '../utils/coin-reservation.js';\nimport type { ClientWithCoreApi } from './core.js';\nimport type { CallArg, Command } from '../transactions/data/internal.js';\nimport type { SuiClientTypes } from './types.js';\nimport { SimulationError } from './errors.js';\nimport { Inputs } from '../transactions/Inputs.js';\nimport { getPureBcsSchema, isTxContext } from '../transactions/serializer.js';\nimport type { TransactionDataBuilder } from '../transactions/TransactionData.js';\nimport { chunk } from '@mysten/utils';\nimport type { BuildTransactionOptions } from '../transactions/index.js';\n\n// The maximum objects that can be fetched at once using multiGetObjects.\nconst MAX_OBJECTS_PER_FETCH = 50;\n\n// An amount of gas (in gas units) that is added to transactions as an overhead to ensure transactions do not fail.\nconst GAS_SAFE_OVERHEAD = 1000n;\nconst MAX_GAS = 50_000_000_000;\n\n/** Compute a gas budget from gasUsed effects data. */\nexport function computeGasBudget(\n\tgasUsed: { computationCost: string; storageCost: string; storageRebate: string },\n\tgasPrice: bigint | string = 1n,\n): string {\n\tconst safeOverhead = GAS_SAFE_OVERHEAD * BigInt(gasPrice);\n\tconst baseComputationCostWithOverhead = BigInt(gasUsed.computationCost) + safeOverhead;\n\tconst gasBudget =\n\t\tbaseComputationCostWithOverhead + BigInt(gasUsed.storageCost) - BigInt(gasUsed.storageRebate);\n\treturn String(\n\t\tgasBudget > baseComputationCostWithOverhead ? gasBudget : baseComputationCostWithOverhead,\n\t);\n}\n\nfunction getClient(options: BuildTransactionOptions): ClientWithCoreApi {\n\tif (!options.client) {\n\t\tthrow new Error(\n\t\t\t`No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.`,\n\t\t);\n\t}\n\treturn options.client;\n}\n\nexport async function coreClientResolveTransactionPlugin(\n\ttransactionData: TransactionDataBuilder,\n\toptions: BuildTransactionOptions,\n\tnext: () => Promise<void>,\n) {\n\tconst client = getClient(options);\n\n\tconst needsGasPrice = !options.onlyTransactionKind && !transactionData.gasData.price;\n\tconst needsPayment = !options.onlyTransactionKind && !transactionData.gasData.payment;\n\tconst gasPayer = transactionData.gasData.owner ?? transactionData.sender;\n\n\tlet usesGasCoin = false;\n\tlet withdrawals = 0n;\n\n\ttransactionData.mapArguments((arg) => {\n\t\tif (arg.$kind === 'GasCoin') usesGasCoin = true;\n\t\treturn arg;\n\t});\n\n\tconst normalizedGasPayer = gasPayer ? normalizeSuiAddress(gasPayer) : null;\n\tfor (const input of transactionData.inputs) {\n\t\tif (input.$kind !== 'FundsWithdrawal' || !normalizedGasPayer) continue;\n\t\tif (normalizeStructTag(input.FundsWithdrawal.typeArg.Balance) !== SUI_TYPE_ARG) continue;\n\n\t\tconst withdrawalOwner = input.FundsWithdrawal.withdrawFrom.Sender\n\t\t\t? transactionData.sender\n\t\t\t: gasPayer;\n\t\tif (\n\t\t\twithdrawalOwner &&\n\t\t\tnormalizeSuiAddress(withdrawalOwner) === normalizedGasPayer &&\n\t\t\tinput.FundsWithdrawal.reservation.$kind === 'MaxAmountU64'\n\t\t) {\n\t\t\twithdrawals += BigInt(input.FundsWithdrawal.reservation.MaxAmountU64);\n\t\t}\n\t}\n\n\tconst needsSystemState = needsGasPrice || (needsPayment && usesGasCoin);\n\tconst [, systemStateResult, balanceResult, coinsResult, protocolConfigResult, chainIdResult] =\n\t\tawait Promise.all([\n\t\t\tnormalizeInputs(transactionData, client),\n\t\t\tneedsSystemState ? client.core.getCurrentSystemState() : null,\n\t\t\tneedsPayment && gasPayer ? client.core.getBalance({ owner: gasPayer }) : null,\n\t\t\tneedsPayment && gasPayer\n\t\t\t\t? client.core.listCoins({ owner: gasPayer, coinType: SUI_TYPE_ARG })\n\t\t\t\t: null,\n\t\t\tneedsPayment && usesGasCoin ? client.core.getProtocolConfig() : null,\n\t\t\tneedsPayment && usesGasCoin ? client.core.getChainIdentifier() : null,\n\t\t]);\n\n\tawait resolveObjectReferences(transactionData, client);\n\n\tif (!options.onlyTransactionKind) {\n\t\tconst systemState = systemStateResult?.systemState ?? null;\n\n\t\tif (systemState && !transactionData.gasData.price) {\n\t\t\ttransactionData.gasData.price = systemState.referenceGasPrice;\n\t\t}\n\n\t\tawait setGasBudget(transactionData, client);\n\n\t\tif (needsPayment) {\n\t\t\tif (!balanceResult || !coinsResult) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Could not resolve gas payment: a gas owner or sender must be set to fetch balance and coins.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tsetGasPayment({\n\t\t\t\ttransactionData,\n\t\t\t\tbalance: balanceResult,\n\t\t\t\tcoins: coinsResult,\n\t\t\t\tusesGasCoin,\n\t\t\t\twithdrawals,\n\t\t\t\tprotocolConfig: protocolConfigResult?.protocolConfig,\n\t\t\t\tgasPayer: gasPayer!,\n\t\t\t\tchainIdentifier: chainIdResult?.chainIdentifier ?? null,\n\t\t\t\tepoch: systemState?.epoch ?? null,\n\t\t\t});\n\t\t}\n\n\t\tif (!transactionData.expiration && transactionData.gasData.payment?.length === 0) {\n\t\t\tawait setExpiration(\n\t\t\t\ttransactionData,\n\t\t\t\tclient,\n\t\t\t\tsystemState,\n\t\t\t\tchainIdResult?.chainIdentifier ?? null,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn await next();\n}\n\nasync function setGasBudget(transactionData: TransactionDataBuilder, client: ClientWithCoreApi) {\n\tif (transactionData.gasData.budget) {\n\t\treturn;\n\t}\n\n\tconst simulateResult = await client.core.simulateTransaction({\n\t\ttransaction: transactionData.build({\n\t\t\toverrides: {\n\t\t\t\tgasData: {\n\t\t\t\t\tbudget: String(MAX_GAS),\n\t\t\t\t\tpayment: [],\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t\tinclude: { effects: true },\n\t});\n\n\tif (simulateResult.$kind === 'FailedTransaction') {\n\t\tconst executionError = simulateResult.FailedTransaction.status.error ?? undefined;\n\t\tconst errorMessage = executionError?.message ?? 'Unknown error';\n\t\tthrow new SimulationError(`Transaction resolution failed: ${errorMessage}`, {\n\t\t\tcause: simulateResult,\n\t\t\texecutionError,\n\t\t});\n\t}\n\n\ttransactionData.gasData.budget = computeGasBudget(\n\t\tsimulateResult.Transaction.effects!.gasUsed,\n\t\ttransactionData.gasData.price ? String(transactionData.gasData.price) : undefined,\n\t);\n}\n\nfunction setGasPayment({\n\ttransactionData,\n\tbalance,\n\tcoins,\n\tusesGasCoin,\n\twithdrawals,\n\tprotocolConfig,\n\tgasPayer,\n\tchainIdentifier,\n\tepoch,\n}: {\n\ttransactionData: TransactionDataBuilder;\n\tbalance: SuiClientTypes.GetBalanceResponse;\n\tcoins: SuiClientTypes.ListCoinsResponse;\n\tusesGasCoin: boolean;\n\twithdrawals: bigint;\n\tprotocolConfig: SuiClientTypes.ProtocolConfig | undefined;\n\tgasPayer: string;\n\tchainIdentifier: string | null;\n\tepoch: string | null;\n}) {\n\tconst budget = BigInt(transactionData.gasData.budget!);\n\tconst addressBalance = BigInt(balance.balance.addressBalance);\n\n\tif (budget === 0n || (!usesGasCoin && addressBalance >= budget + withdrawals)) {\n\t\ttransactionData.gasData.payment = [];\n\t\treturn;\n\t}\n\n\tconst filteredCoins = coins.objects.filter((coin) => {\n\t\tconst matchingInput = transactionData.inputs.find((input) => {\n\t\t\tif (input.Object?.ImmOrOwnedObject) {\n\t\t\t\treturn coin.objectId === input.Object.ImmOrOwnedObject.objectId;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t});\n\n\t\treturn !matchingInput;\n\t});\n\n\tconst paymentCoins = filteredCoins.map((coin) => ({\n\t\tobjectId: coin.objectId,\n\t\tdigest: coin.digest,\n\t\tversion: coin.version,\n\t}));\n\n\tconst reservationAmount = addressBalance - withdrawals;\n\n\tif (\n\t\tusesGasCoin &&\n\t\treservationAmount > 0n &&\n\t\tprotocolConfig?.featureFlags?.['enable_coin_reservation_obj_refs'] &&\n\t\tchainIdentifier &&\n\t\tepoch\n\t) {\n\t\ttransactionData.gasData.payment = [\n\t\t\tcreateCoinReservationRef(reservationAmount, gasPayer, chainIdentifier, epoch),\n\t\t\t...paymentCoins,\n\t\t];\n\t} else if (!filteredCoins.length) {\n\t\tthrow new Error('No valid gas coins found for the transaction.');\n\t} else {\n\t\ttransactionData.gasData.payment = paymentCoins;\n\t}\n}\n\ninterface SystemStateData {\n\tepoch: string;\n\treferenceGasPrice: string;\n}\n\nasync function setExpiration(\n\ttransactionData: TransactionDataBuilder,\n\tclient: ClientWithCoreApi,\n\tsystemState: SystemStateData | null,\n\texistingChainIdentifier: string | null = null,\n) {\n\tconst [chainIdentifier, resolvedSystemState] = await Promise.all([\n\t\texistingChainIdentifier ?? client.core.getChainIdentifier().then((r) => r.chainIdentifier),\n\t\tsystemState ?? client.core.getCurrentSystemState().then((r) => r.systemState),\n\t]);\n\tconst currentEpoch = BigInt(resolvedSystemState.epoch);\n\n\ttransactionData.expiration = {\n\t\t$kind: 'ValidDuring',\n\t\tValidDuring: {\n\t\t\tminEpoch: String(currentEpoch),\n\t\t\tmaxEpoch: String(currentEpoch + 1n),\n\t\t\tminTimestamp: null,\n\t\t\tmaxTimestamp: null,\n\t\t\tchain: chainIdentifier,\n\t\t\tnonce: (Math.random() * 0x100000000) >>> 0,\n\t\t},\n\t};\n}\n\nasync function resolveObjectReferences(\n\ttransactionData: TransactionDataBuilder,\n\tclient: ClientWithCoreApi,\n) {\n\t// Keep track of the object references that will need to be resolved at the end of the transaction.\n\t// We keep the input by-reference to avoid needing to re-resolve it:\n\tconst objectsToResolve = transactionData.inputs.filter((input) => {\n\t\treturn (\n\t\t\tinput.UnresolvedObject &&\n\t\t\t!(input.UnresolvedObject.version || input.UnresolvedObject?.initialSharedVersion)\n\t\t);\n\t}) as Extract<CallArg, { UnresolvedObject: unknown }>[];\n\n\tconst dedupedIds = [\n\t\t...new Set(\n\t\t\tobjectsToResolve.map((input) => normalizeSuiObjectId(input.UnresolvedObject.objectId)),\n\t\t),\n\t];\n\n\tconst objectChunks = dedupedIds.length ? chunk(dedupedIds, MAX_OBJECTS_PER_FETCH) : [];\n\tconst resolved = (\n\t\tawait Promise.all(\n\t\t\tobjectChunks.map((chunkIds) =>\n\t\t\t\tclient.core.getObjects({\n\t\t\t\t\tobjectIds: chunkIds,\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t).flatMap((result) => result.objects);\n\n\tconst responsesById = new Map(\n\t\tdedupedIds.map((id, index) => {\n\t\t\treturn [id, resolved[index]];\n\t\t}),\n\t);\n\n\tconst invalidObjects = Array.from(responsesById)\n\t\t.filter(([_, obj]) => obj instanceof Error)\n\t\t.map(([_, obj]) => (obj as Error).message);\n\n\tif (invalidObjects.length) {\n\t\tthrow new Error(`The following input objects are invalid: ${invalidObjects.join(', ')}`);\n\t}\n\n\tconst objects = resolved.map((object) => {\n\t\tif (object instanceof Error) {\n\t\t\tthrow new Error(`Failed to fetch object: ${object.message}`);\n\t\t}\n\t\tconst owner = object.owner;\n\t\tconst initialSharedVersion =\n\t\t\towner && typeof owner === 'object'\n\t\t\t\t? owner.$kind === 'Shared'\n\t\t\t\t\t? owner.Shared.initialSharedVersion\n\t\t\t\t\t: owner.$kind === 'ConsensusAddressOwner'\n\t\t\t\t\t\t? owner.ConsensusAddressOwner.startVersion\n\t\t\t\t\t\t: null\n\t\t\t\t: null;\n\n\t\treturn {\n\t\t\tobjectId: object.objectId,\n\t\t\tdigest: object.digest,\n\t\t\tversion: object.version,\n\t\t\tinitialSharedVersion,\n\t\t};\n\t});\n\n\tconst objectsById = new Map(\n\t\tdedupedIds.map((id, index) => {\n\t\t\treturn [id, objects[index]];\n\t\t}),\n\t);\n\n\tfor (const [index, input] of transactionData.inputs.entries()) {\n\t\tif (!input.UnresolvedObject) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet updated: CallArg | undefined;\n\t\tconst id = normalizeSuiAddress(input.UnresolvedObject.objectId);\n\t\tconst object = objectsById.get(id);\n\n\t\tif (input.UnresolvedObject.initialSharedVersion ?? object?.initialSharedVersion) {\n\t\t\tupdated = Inputs.SharedObjectRef({\n\t\t\t\tobjectId: id,\n\t\t\t\tinitialSharedVersion:\n\t\t\t\t\tinput.UnresolvedObject.initialSharedVersion || object?.initialSharedVersion!,\n\t\t\t\tmutable: input.UnresolvedObject.mutable || isUsedAsMutable(transactionData, index),\n\t\t\t});\n\t\t} else if (isUsedAsReceiving(transactionData, index)) {\n\t\t\tupdated = Inputs.ReceivingRef(\n\t\t\t\t{\n\t\t\t\t\tobjectId: id,\n\t\t\t\t\tdigest: input.UnresolvedObject.digest ?? object?.digest!,\n\t\t\t\t\tversion: input.UnresolvedObject.version ?? object?.version!,\n\t\t\t\t}!,\n\t\t\t);\n\t\t}\n\n\t\ttransactionData.inputs[transactionData.inputs.indexOf(input)] =\n\t\t\tupdated ??\n\t\t\tInputs.ObjectRef({\n\t\t\t\tobjectId: id,\n\t\t\t\tdigest: input.UnresolvedObject.digest ?? object?.digest!,\n\t\t\t\tversion: input.UnresolvedObject.version ?? object?.version!,\n\t\t\t});\n\t}\n}\n\nasync function normalizeInputs(transactionData: TransactionDataBuilder, client: ClientWithCoreApi) {\n\tconst { inputs, commands } = transactionData;\n\tconst moveCallsToResolve: Extract<Command, { MoveCall: unknown }>['MoveCall'][] = [];\n\tconst moveFunctionsToResolve = new Set<string>();\n\n\tcommands.forEach((command) => {\n\t\t// Special case move call:\n\t\tif (command.MoveCall) {\n\t\t\t// Determine if any of the arguments require encoding.\n\t\t\t// - If they don't, then this is good to go.\n\t\t\t// - If they do, then we need to fetch the normalized move module.\n\n\t\t\t// If we already know the argument types, we don't need to resolve them again\n\t\t\tif (command.MoveCall._argumentTypes) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst inputs = command.MoveCall.arguments.map((arg) => {\n\t\t\t\tif (arg.$kind === 'Input') {\n\t\t\t\t\treturn transactionData.inputs[arg.Input];\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t});\n\t\t\tconst needsResolution = inputs.some(\n\t\t\t\t(input) =>\n\t\t\t\t\tinput?.UnresolvedPure ||\n\t\t\t\t\t(input?.UnresolvedObject && typeof input?.UnresolvedObject.mutable !== 'boolean'),\n\t\t\t);\n\n\t\t\tif (needsResolution) {\n\t\t\t\tconst functionName = `${command.MoveCall.package}::${command.MoveCall.module}::${command.MoveCall.function}`;\n\t\t\t\tmoveFunctionsToResolve.add(functionName);\n\t\t\t\tmoveCallsToResolve.push(command.MoveCall);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst moveFunctionParameters = new Map<string, SuiClientTypes.OpenSignature[]>();\n\tif (moveFunctionsToResolve.size > 0) {\n\t\tawait Promise.all(\n\t\t\t[...moveFunctionsToResolve].map(async (functionName) => {\n\t\t\t\tconst [packageId, moduleName, name] = functionName.split('::');\n\t\t\t\tconst { function: def } = await client.core.getMoveFunction({\n\t\t\t\t\tpackageId,\n\t\t\t\t\tmoduleName,\n\t\t\t\t\tname,\n\t\t\t\t});\n\n\t\t\t\tmoveFunctionParameters.set(functionName, def.parameters);\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (moveCallsToResolve.length) {\n\t\tawait Promise.all(\n\t\t\tmoveCallsToResolve.map(async (moveCall) => {\n\t\t\t\tconst parameters = moveFunctionParameters.get(\n\t\t\t\t\t`${moveCall.package}::${moveCall.module}::${moveCall.function}`,\n\t\t\t\t);\n\n\t\t\t\tif (!parameters) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Entry functions can have a mutable reference to an instance of the TxContext\n\t\t\t\t// struct defined in the TxContext module as the last parameter. The caller of\n\t\t\t\t// the function does not need to pass it in as an argument.\n\t\t\t\tconst hasTxContext = parameters.length > 0 && isTxContext(parameters.at(-1)!);\n\t\t\t\tconst params = hasTxContext ? parameters.slice(0, parameters.length - 1) : parameters;\n\n\t\t\t\tmoveCall._argumentTypes = params;\n\t\t\t}),\n\t\t);\n\t}\n\n\tcommands.forEach((command) => {\n\t\tif (!command.MoveCall) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst moveCall = command.MoveCall;\n\t\tconst fnName = `${moveCall.package}::${moveCall.module}::${moveCall.function}`;\n\t\tconst params = moveCall._argumentTypes;\n\n\t\tif (!params) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (params.length !== command.MoveCall.arguments.length) {\n\t\t\tthrow new Error(`Incorrect number of arguments for ${fnName}`);\n\t\t}\n\n\t\tparams.forEach((param, i) => {\n\t\t\tconst arg = moveCall.arguments[i];\n\t\t\tif (arg.$kind !== 'Input') return;\n\t\t\tconst input = inputs[arg.Input];\n\n\t\t\t// Skip if the input is already resolved\n\t\t\tif (!input.UnresolvedPure && !input.UnresolvedObject) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst inputValue = input.UnresolvedPure?.value ?? input.UnresolvedObject?.objectId!;\n\n\t\t\tconst schema = getPureBcsSchema(param.body);\n\t\t\tif (schema) {\n\t\t\t\targ.type = 'pure';\n\t\t\t\tinputs[inputs.indexOf(input)] = Inputs.Pure(schema.serialize(inputValue));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (typeof inputValue !== 'string') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Expect the argument to be an object id string, got ${JSON.stringify(\n\t\t\t\t\t\tinputValue,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t2,\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\targ.type = 'object';\n\t\t\tconst unresolvedObject: typeof input = input.UnresolvedPure\n\t\t\t\t? {\n\t\t\t\t\t\t$kind: 'UnresolvedObject',\n\t\t\t\t\t\tUnresolvedObject: {\n\t\t\t\t\t\t\tobjectId: inputValue,\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t: input;\n\n\t\t\tinputs[arg.Input] = unresolvedObject;\n\t\t});\n\t});\n}\n\nfunction isUsedAsMutable(transactionData: TransactionDataBuilder, index: number) {\n\tlet usedAsMutable = false;\n\n\ttransactionData.getInputUses(index, (arg, tx) => {\n\t\tif (tx.MoveCall && tx.MoveCall._argumentTypes) {\n\t\t\tconst argIndex = tx.MoveCall.arguments.indexOf(arg);\n\t\t\tusedAsMutable =\n\t\t\t\ttx.MoveCall._argumentTypes[argIndex].reference !== 'immutable' || usedAsMutable;\n\t\t}\n\n\t\tif (\n\t\t\ttx.$kind === 'MakeMoveVec' ||\n\t\t\ttx.$kind === 'MergeCoins' ||\n\t\t\ttx.$kind === 'SplitCoins' ||\n\t\t\ttx.$kind === 'TransferObjects'\n\t\t) {\n\t\t\tusedAsMutable = true;\n\t\t}\n\t});\n\n\treturn usedAsMutable;\n}\n\nfunction isUsedAsReceiving(transactionData: TransactionDataBuilder, index: number) {\n\tlet usedAsReceiving = false;\n\n\ttransactionData.getInputUses(index, (arg, tx) => {\n\t\tif (tx.MoveCall && tx.MoveCall._argumentTypes) {\n\t\t\tconst argIndex = tx.MoveCall.arguments.indexOf(arg);\n\t\t\tusedAsReceiving = isReceivingType(tx.MoveCall._argumentTypes[argIndex]) || usedAsReceiving;\n\t\t}\n\t});\n\n\treturn usedAsReceiving;\n}\n\nconst RECEIVING_TYPE =\n\t'0x0000000000000000000000000000000000000000000000000000000000000002::transfer::Receiving';\n\nfunction isReceivingType(type: SuiClientTypes.OpenSignature): boolean {\n\tif (type.body.$kind !== 'datatype') {\n\t\treturn false;\n\t}\n\n\treturn type.body.datatype.typeName === RECEIVING_TYPE;\n}\n"],"mappings":";;;;;;;;;AAqBA,MAAM,wBAAwB;AAG9B,MAAM,oBAAoB;AAC1B,MAAM,UAAU;;AAGhB,SAAgB,iBACf,SACA,WAA4B,IACnB;CACT,MAAM,eAAe,oBAAoB,OAAO,SAAS;CACzD,MAAM,kCAAkC,OAAO,QAAQ,gBAAgB,GAAG;CAC1E,MAAM,YACL,kCAAkC,OAAO,QAAQ,YAAY,GAAG,OAAO,QAAQ,cAAc;AAC9F,QAAO,OACN,YAAY,kCAAkC,YAAY,gCAC1D;;AAGF,SAAS,UAAU,SAAqD;AACvE,KAA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,IAAI,OAAO,KAAK,OAAO,UAAU,WAAW,CAAC;AACzE;;AAGD,OAAI,OAAO,eAAe,SACzB,OAAM,IAAI,MACT,sDAAsD,KAAK,UAC1D,YACA,MACA,EACA,GACD;AAGF,OAAI,OAAO;GACX,MAAM,mBAAiC,MAAM,iBAC1C;IACA,OAAO;IACP,kBAAkB,EACjB,UAAU,YACV;IACD,GACA;AAEH,UAAO,IAAI,SAAS;IACnB;GACD;;AAGH,SAAS,gBAAgB,iBAAyC,OAAe;CAChF,IAAI,gBAAgB;AAEpB,iBAAgB,aAAa,QAAQ,KAAK,OAAO;AAChD,MAAI,GAAG,YAAY,GAAG,SAAS,gBAAgB;GAC9C,MAAM,WAAW,GAAG,SAAS,UAAU,QAAQ,IAAI;AACnD,mBACC,GAAG,SAAS,eAAe,UAAU,cAAc,eAAe;;AAGpE,MACC,GAAG,UAAU,iBACb,GAAG,UAAU,gBACb,GAAG,UAAU,gBACb,GAAG,UAAU,kBAEb,iBAAgB;GAEhB;AAEF,QAAO;;AAGR,SAAS,kBAAkB,iBAAyC,OAAe;CAClF,IAAI,kBAAkB;AAEtB,iBAAgB,aAAa,QAAQ,KAAK,OAAO;AAChD,MAAI,GAAG,YAAY,GAAG,SAAS,gBAAgB;GAC9C,MAAM,WAAW,GAAG,SAAS,UAAU,QAAQ,IAAI;AACnD,qBAAkB,gBAAgB,GAAG,SAAS,eAAe,UAAU,IAAI;;GAE3E;AAEF,QAAO;;AAGR,MAAM,iBACL;AAED,SAAS,gBAAgB,MAA6C;AACrE,KAAI,KAAK,KAAK,UAAU,WACvB,QAAO;AAGR,QAAO,KAAK,KAAK,SAAS,aAAa"}
@@ -30,6 +30,12 @@ declare function parseSerializedSignature(serializedSignature: string): {
30
30
  clientDataJson: string;
31
31
  userSignature: Uint8Array<ArrayBuffer>;
32
32
  publicKey: Uint8Array<ArrayBuffer>;
33
+ } | {
34
+ serializedSignature: string;
35
+ signatureScheme: "ED25519" | "Secp256k1" | "Secp256r1";
36
+ signature: Uint8Array<ArrayBuffer>;
37
+ publicKey: Uint8Array<ArrayBuffer>;
38
+ bytes: Uint8Array<ArrayBuffer>;
33
39
  } | {
34
40
  serializedSignature: string;
35
41
  signatureScheme: "ZkLogin";
@@ -54,12 +60,6 @@ declare function parseSerializedSignature(serializedSignature: string): {
54
60
  };
55
61
  signature: Uint8Array<ArrayBufferLike>;
56
62
  publicKey: Uint8Array<ArrayBuffer>;
57
- } | {
58
- serializedSignature: string;
59
- signatureScheme: "ED25519" | "Secp256k1" | "Secp256r1";
60
- signature: Uint8Array<ArrayBuffer>;
61
- publicKey: Uint8Array<ArrayBuffer>;
62
- bytes: Uint8Array<ArrayBuffer>;
63
63
  } | {
64
64
  serializedSignature: string;
65
65
  signatureScheme: "MultiSig";
@@ -1,6 +1,6 @@
1
1
  import { BatchGetObjectsRequest, BatchGetObjectsResponse, BatchGetTransactionsRequest, BatchGetTransactionsResponse, GetCheckpointRequest, GetCheckpointResponse, GetEpochRequest, GetEpochResponse, GetObjectRequest, GetObjectResponse, GetServiceInfoRequest, GetServiceInfoResponse, GetTransactionRequest, GetTransactionResponse } from "./ledger_service.mjs";
2
- import * as _protobuf_ts_runtime1 from "@protobuf-ts/runtime";
3
- import * as _protobuf_ts_runtime_rpc1 from "@protobuf-ts/runtime-rpc";
2
+ import * as _protobuf_ts_runtime3 from "@protobuf-ts/runtime";
3
+ import * as _protobuf_ts_runtime_rpc3 from "@protobuf-ts/runtime-rpc";
4
4
  import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
5
5
 
6
6
  //#region src/grpc/proto/sui/rpc/v2/ledger_service.client.d.ts
@@ -45,9 +45,9 @@ interface ILedgerServiceClient {
45
45
  declare class LedgerServiceClient implements ILedgerServiceClient, ServiceInfo {
46
46
  private readonly _transport;
47
47
  typeName: string;
48
- methods: _protobuf_ts_runtime_rpc1.MethodInfo<any, any>[];
48
+ methods: _protobuf_ts_runtime_rpc3.MethodInfo<any, any>[];
49
49
  options: {
50
- [extensionName: string]: _protobuf_ts_runtime1.JsonValue;
50
+ [extensionName: string]: _protobuf_ts_runtime3.JsonValue;
51
51
  };
52
52
  constructor(_transport: RpcTransport);
53
53
  /**
@@ -1,6 +1,6 @@
1
1
  import { LookupNameRequest, LookupNameResponse, ReverseLookupNameRequest, ReverseLookupNameResponse } from "./name_service.mjs";
2
- import * as _protobuf_ts_runtime5 from "@protobuf-ts/runtime";
3
- import * as _protobuf_ts_runtime_rpc5 from "@protobuf-ts/runtime-rpc";
2
+ import * as _protobuf_ts_runtime0 from "@protobuf-ts/runtime";
3
+ import * as _protobuf_ts_runtime_rpc0 from "@protobuf-ts/runtime-rpc";
4
4
  import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
5
5
 
6
6
  //#region src/grpc/proto/sui/rpc/v2/name_service.client.d.ts
@@ -23,9 +23,9 @@ interface INameServiceClient {
23
23
  declare class NameServiceClient implements INameServiceClient, ServiceInfo {
24
24
  private readonly _transport;
25
25
  typeName: string;
26
- methods: _protobuf_ts_runtime_rpc5.MethodInfo<any, any>[];
26
+ methods: _protobuf_ts_runtime_rpc0.MethodInfo<any, any>[];
27
27
  options: {
28
- [extensionName: string]: _protobuf_ts_runtime5.JsonValue;
28
+ [extensionName: string]: _protobuf_ts_runtime0.JsonValue;
29
29
  };
30
30
  constructor(_transport: RpcTransport);
31
31
  /**
@@ -1,6 +1,6 @@
1
1
  import { VerifySignatureRequest, VerifySignatureResponse } from "./signature_verification_service.mjs";
2
- import * as _protobuf_ts_runtime4 from "@protobuf-ts/runtime";
3
- import * as _protobuf_ts_runtime_rpc4 from "@protobuf-ts/runtime-rpc";
2
+ import * as _protobuf_ts_runtime2 from "@protobuf-ts/runtime";
3
+ import * as _protobuf_ts_runtime_rpc2 from "@protobuf-ts/runtime-rpc";
4
4
  import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
5
5
 
6
6
  //#region src/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.ts
@@ -21,9 +21,9 @@ interface ISignatureVerificationServiceClient {
21
21
  declare class SignatureVerificationServiceClient implements ISignatureVerificationServiceClient, ServiceInfo {
22
22
  private readonly _transport;
23
23
  typeName: string;
24
- methods: _protobuf_ts_runtime_rpc4.MethodInfo<any, any>[];
24
+ methods: _protobuf_ts_runtime_rpc2.MethodInfo<any, any>[];
25
25
  options: {
26
- [extensionName: string]: _protobuf_ts_runtime4.JsonValue;
26
+ [extensionName: string]: _protobuf_ts_runtime2.JsonValue;
27
27
  };
28
28
  constructor(_transport: RpcTransport);
29
29
  /**
@@ -1,6 +1,6 @@
1
1
  import { GetBalanceRequest, GetBalanceResponse, GetCoinInfoRequest, GetCoinInfoResponse, ListBalancesRequest, ListBalancesResponse, ListDynamicFieldsRequest, ListDynamicFieldsResponse, ListOwnedObjectsRequest, ListOwnedObjectsResponse } from "./state_service.mjs";
2
- import * as _protobuf_ts_runtime2 from "@protobuf-ts/runtime";
3
- import * as _protobuf_ts_runtime_rpc2 from "@protobuf-ts/runtime-rpc";
2
+ import * as _protobuf_ts_runtime4 from "@protobuf-ts/runtime";
3
+ import * as _protobuf_ts_runtime_rpc4 from "@protobuf-ts/runtime-rpc";
4
4
  import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
5
5
 
6
6
  //#region src/grpc/proto/sui/rpc/v2/state_service.client.d.ts
@@ -35,9 +35,9 @@ interface IStateServiceClient {
35
35
  declare class StateServiceClient implements IStateServiceClient, ServiceInfo {
36
36
  private readonly _transport;
37
37
  typeName: string;
38
- methods: _protobuf_ts_runtime_rpc2.MethodInfo<any, any>[];
38
+ methods: _protobuf_ts_runtime_rpc4.MethodInfo<any, any>[];
39
39
  options: {
40
- [extensionName: string]: _protobuf_ts_runtime2.JsonValue;
40
+ [extensionName: string]: _protobuf_ts_runtime4.JsonValue;
41
41
  };
42
42
  constructor(_transport: RpcTransport);
43
43
  /**
@@ -1,6 +1,6 @@
1
1
  import { SubscribeCheckpointsRequest, SubscribeCheckpointsResponse } from "./subscription_service.mjs";
2
- import * as _protobuf_ts_runtime3 from "@protobuf-ts/runtime";
3
- import * as _protobuf_ts_runtime_rpc3 from "@protobuf-ts/runtime-rpc";
2
+ import * as _protobuf_ts_runtime5 from "@protobuf-ts/runtime";
3
+ import * as _protobuf_ts_runtime_rpc5 from "@protobuf-ts/runtime-rpc";
4
4
  import { RpcOptions, RpcTransport, ServerStreamingCall, ServiceInfo } from "@protobuf-ts/runtime-rpc";
5
5
 
6
6
  //#region src/grpc/proto/sui/rpc/v2/subscription_service.client.d.ts
@@ -31,9 +31,9 @@ interface ISubscriptionServiceClient {
31
31
  declare class SubscriptionServiceClient implements ISubscriptionServiceClient, ServiceInfo {
32
32
  private readonly _transport;
33
33
  typeName: string;
34
- methods: _protobuf_ts_runtime_rpc3.MethodInfo<any, any>[];
34
+ methods: _protobuf_ts_runtime_rpc5.MethodInfo<any, any>[];
35
35
  options: {
36
- [extensionName: string]: _protobuf_ts_runtime3.JsonValue;
36
+ [extensionName: string]: _protobuf_ts_runtime5.JsonValue;
37
37
  };
38
38
  constructor(_transport: RpcTransport);
39
39
  /**
@@ -1,6 +1,6 @@
1
1
  import { ExecuteTransactionRequest, ExecuteTransactionResponse, SimulateTransactionRequest, SimulateTransactionResponse } from "./transaction_execution_service.mjs";
2
- import * as _protobuf_ts_runtime0 from "@protobuf-ts/runtime";
3
- import * as _protobuf_ts_runtime_rpc0 from "@protobuf-ts/runtime-rpc";
2
+ import * as _protobuf_ts_runtime1 from "@protobuf-ts/runtime";
3
+ import * as _protobuf_ts_runtime_rpc1 from "@protobuf-ts/runtime-rpc";
4
4
  import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
5
5
 
6
6
  //#region src/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.ts
@@ -23,9 +23,9 @@ interface ITransactionExecutionServiceClient {
23
23
  declare class TransactionExecutionServiceClient implements ITransactionExecutionServiceClient, ServiceInfo {
24
24
  private readonly _transport;
25
25
  typeName: string;
26
- methods: _protobuf_ts_runtime_rpc0.MethodInfo<any, any>[];
26
+ methods: _protobuf_ts_runtime_rpc1.MethodInfo<any, any>[];
27
27
  options: {
28
- [extensionName: string]: _protobuf_ts_runtime0.JsonValue;
28
+ [extensionName: string]: _protobuf_ts_runtime1.JsonValue;
29
29
  };
30
30
  constructor(_transport: RpcTransport);
31
31
  /**
@@ -8,7 +8,7 @@ import { createPure } from "./pure.mjs";
8
8
  import { SignatureWithBytes, Signer } from "../cryptography/keypair.mjs";
9
9
  import "../cryptography/index.mjs";
10
10
  import { ClientWithCoreApi } from "../client/core.mjs";
11
- import * as _mysten_bcs812 from "@mysten/bcs";
11
+ import * as _mysten_bcs1124 from "@mysten/bcs";
12
12
  import { SerializedBcs } from "@mysten/bcs";
13
13
  import { InferInput } from "valibot";
14
14
 
@@ -77,7 +77,7 @@ declare class Transaction {
77
77
  getData(): {
78
78
  version: 2;
79
79
  sender?: string | null | undefined;
80
- expiration?: _mysten_bcs812.EnumOutputShapeWithKeys<{
80
+ expiration?: _mysten_bcs1124.EnumOutputShapeWithKeys<{
81
81
  None: true;
82
82
  Epoch: string | number;
83
83
  ValidDuring: {
@@ -99,8 +99,8 @@ declare class Transaction {
99
99
  digest: string;
100
100
  }[] | null;
101
101
  };
102
- inputs: _mysten_bcs812.EnumOutputShapeWithKeys<{
103
- Object: _mysten_bcs812.EnumOutputShapeWithKeys<{
102
+ inputs: _mysten_bcs1124.EnumOutputShapeWithKeys<{
103
+ Object: _mysten_bcs1124.EnumOutputShapeWithKeys<{
104
104
  ImmOrOwnedObject: {
105
105
  objectId: string;
106
106
  version: string | number;
@@ -139,13 +139,13 @@ declare class Transaction {
139
139
  Balance: string;
140
140
  $kind: "Balance";
141
141
  };
142
- withdrawFrom: _mysten_bcs812.EnumOutputShapeWithKeys<{
142
+ withdrawFrom: _mysten_bcs1124.EnumOutputShapeWithKeys<{
143
143
  Sender: true;
144
144
  Sponsor: true;
145
145
  }, "Sender" | "Sponsor">;
146
146
  };
147
147
  }, "Object" | "Pure" | "FundsWithdrawal" | "UnresolvedPure" | "UnresolvedObject">[];
148
- commands: _mysten_bcs812.EnumOutputShapeWithKeys<{
148
+ commands: _mysten_bcs1124.EnumOutputShapeWithKeys<{
149
149
  MoveCall: {
150
150
  package: string;
151
151
  module: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Transaction.d.mts","names":[],"sources":["../../src/transactions/Transaction.ts"],"mappings":";;;;;;;;;;;;;;;KAyCY,yBAAA,GACT,OAAA,CAAQ,UAAA,QAAkB,cAAA;EAAmB,KAAA;EAAgB,IAAA;AAAA,OAE7D,EAAA,EAAI,WAAA,KACC,OAAA,CAAQ,UAAA,QAAkB,cAAA;EAAmB,KAAA;EAAgB,IAAA;AAAA,MAClE,qBAAA,CAAsB,yBAAA;AAAA,KAEb,iBAAA,GAAoB,OAAA,CAAQ,QAAA;EAAY,MAAA;AAAA,KACnD,OAAA,CAAQ,QAAA;EAAY,YAAA;AAAA;AAAA,KAET,yBAAA,GACT,OAAA,CAAQ,QAAA;EAAY,MAAA;AAAA,cACX,OAAA,CAAQ,QAAA;EAAY,YAAA;AAAA;AAAA,KAEpB,qBAAA,WACD,yBAAA,UAAmC,yBAAA,YACzC,EAAA,EAAI,WAAA,KAAgB,OAAA,CAAQ,CAAA;AAAA,cAiE3B,iBAAA;AAAA,UAEI,WAAA,SAAoB,uBAAA;EAC7B,MAAA,EAAQ,MAAA;AAAA;AAAA,iBAGO,aAAA,CAAc,GAAA,YAAe,GAAA,IAAO,eAAA;AAAA,KAIxC,sBAAA,YAAkC,OAAA,GAAU,yBAAA;AAAA,KAKnD,eAAA;EACJ,OAAA;AAAA;;;;cAMY,WAAA;EAAA;GA8HP,iBAAA;EAhO4C;AAElD;;;EAFkD,OAgH1C,QAAA,CAAS,UAAA,WAAqB,UAAA,GAAU,WAAA;EA9GhB;;;;;;EAAA,O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