@mysten/sui 2.16.3 → 2.18.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 +36 -0
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/bcs/index.d.mts +20 -20
- package/dist/graphql/generated/queries.d.mts.map +1 -1
- package/dist/graphql/generated/queries.mjs.map +1 -1
- package/dist/graphql/generated/tada-env.d.mts +82 -1
- package/dist/grpc/client.d.mts +2 -0
- package/dist/grpc/client.d.mts.map +1 -1
- package/dist/grpc/client.mjs +2 -0
- package/dist/grpc/client.mjs.map +1 -1
- package/dist/grpc/proto/google/protobuf/struct.mjs +1 -1
- package/dist/grpc/proto/google/protobuf/struct.mjs.map +1 -1
- package/dist/grpc/proto/google/rpc/status.mjs +1 -1
- package/dist/grpc/proto/google/rpc/status.mjs.map +1 -1
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.d.mts +66 -0
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.d.mts.map +1 -0
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.mjs +48 -0
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.mjs.map +1 -0
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.d.mts +135 -0
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.d.mts.map +1 -0
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.mjs +144 -0
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.mjs.map +1 -0
- package/dist/grpc/proto/sui/rpc/v2/checkpoint.mjs +1 -1
- package/dist/grpc/proto/sui/rpc/v2/checkpoint.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/checkpoint_contents.mjs +3 -3
- package/dist/grpc/proto/sui/rpc/v2/checkpoint_contents.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/checkpoint_summary.mjs +3 -3
- package/dist/grpc/proto/sui/rpc/v2/checkpoint_summary.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/effects.d.mts +71 -3
- package/dist/grpc/proto/sui/rpc/v2/effects.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/effects.mjs +71 -5
- package/dist/grpc/proto/sui/rpc/v2/effects.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/event.mjs +1 -1
- package/dist/grpc/proto/sui/rpc/v2/event.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/executed_transaction.mjs +2 -2
- package/dist/grpc/proto/sui/rpc/v2/executed_transaction.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.mjs +3 -3
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/move_package.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/move_package.mjs +13 -13
- package/dist/grpc/proto/sui/rpc/v2/move_package.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/move_package_service.mjs +1 -1
- package/dist/grpc/proto/sui/rpc/v2/move_package_service.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/object.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/object.mjs +1 -1
- package/dist/grpc/proto/sui/rpc/v2/object.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/signature.mjs +3 -3
- package/dist/grpc/proto/sui/rpc/v2/signature.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.mjs +1 -1
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/state_service.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/state_service.mjs +3 -3
- package/dist/grpc/proto/sui/rpc/v2/state_service.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/system_state.mjs +2 -2
- package/dist/grpc/proto/sui/rpc/v2/system_state.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/transaction.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/transaction.mjs +16 -16
- package/dist/grpc/proto/sui/rpc/v2/transaction.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.mjs +4 -4
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.mjs.map +1 -1
- package/dist/grpc/proto/types.d.mts +3 -2
- package/dist/grpc/proto/types.mjs +11 -1
- package/dist/grpc/proto/types.mjs.map +1 -1
- package/dist/jsonRpc/types/params.d.mts +5 -5
- package/dist/transactions/Transaction.d.mts +25 -11
- package/dist/transactions/Transaction.d.mts.map +1 -1
- package/dist/transactions/Transaction.mjs +8 -3
- package/dist/transactions/Transaction.mjs.map +1 -1
- package/dist/transactions/index.d.mts +2 -2
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/dist/zklogin/jwt-utils.d.mts.map +1 -1
- package/dist/zklogin/jwt-utils.mjs.map +1 -1
- package/dist/zklogin/utils.d.mts.map +1 -1
- package/dist/zklogin/utils.mjs +9 -0
- package/dist/zklogin/utils.mjs.map +1 -1
- package/docs/bcs.md +11 -6
- package/docs/clients/core.md +10 -9
- package/docs/clients/grpc.md +1 -1
- package/docs/index.md +176 -22
- package/docs/llms-index.md +6 -9
- package/docs/migrations/0.38.md +2 -2
- package/docs/migrations/sui-1.0.md +2 -2
- package/docs/migrations/sui-2.0/json-rpc-migration.md +76 -33
- package/docs/plugins.md +29 -5
- package/docs/transactions/basics.md +279 -0
- package/docs/transactions/coins-and-balances.md +293 -0
- package/docs/transactions/offline.md +192 -0
- package/docs/transactions/reference.md +380 -0
- package/docs/transactions/signing-and-execution.md +401 -0
- package/package.json +27 -27
- package/src/graphql/generated/queries.ts +46 -1
- package/src/graphql/generated/schema.graphql +49 -3
- package/src/graphql/generated/tada-env.ts +97 -1
- package/src/grpc/client.ts +3 -0
- package/src/grpc/proto/google/protobuf/struct.ts +1 -1
- package/src/grpc/proto/google/rpc/error_details.ts +4 -4
- package/src/grpc/proto/google/rpc/status.ts +1 -1
- package/src/grpc/proto/sui/forking/v1alpha/forking_service.client.ts +125 -0
- package/src/grpc/proto/sui/forking/v1alpha/forking_service.ts +230 -0
- package/src/grpc/proto/sui/rpc/v2/checkpoint.ts +1 -1
- package/src/grpc/proto/sui/rpc/v2/checkpoint_contents.ts +3 -3
- package/src/grpc/proto/sui/rpc/v2/checkpoint_summary.ts +3 -3
- package/src/grpc/proto/sui/rpc/v2/effects.ts +112 -6
- package/src/grpc/proto/sui/rpc/v2/event.ts +1 -1
- package/src/grpc/proto/sui/rpc/v2/executed_transaction.ts +2 -2
- package/src/grpc/proto/sui/rpc/v2/ledger_service.ts +3 -3
- package/src/grpc/proto/sui/rpc/v2/move_package.ts +19 -13
- package/src/grpc/proto/sui/rpc/v2/move_package_service.ts +1 -1
- package/src/grpc/proto/sui/rpc/v2/object.ts +7 -1
- package/src/grpc/proto/sui/rpc/v2/signature.ts +3 -3
- package/src/grpc/proto/sui/rpc/v2/signature_verification_service.ts +7 -1
- package/src/grpc/proto/sui/rpc/v2/state_service.ts +9 -3
- package/src/grpc/proto/sui/rpc/v2/system_state.ts +2 -2
- package/src/grpc/proto/sui/rpc/v2/transaction.ts +22 -16
- package/src/grpc/proto/sui/rpc/v2/transaction_execution_service.ts +4 -4
- package/src/grpc/proto/types.ts +1 -0
- package/src/jsonRpc/types/params.ts +5 -5
- package/src/transactions/Transaction.ts +36 -5
- package/src/transactions/index.ts +1 -0
- package/src/version.ts +1 -1
- package/src/zklogin/jwt-utils.ts +3 -0
- package/src/zklogin/utils.ts +17 -0
- package/docs/faucet.md +0 -26
- package/docs/hello-sui.md +0 -115
- package/docs/install.md +0 -61
- package/docs/transaction-building/basics.md +0 -299
- package/docs/transaction-building/gas.md +0 -61
- package/docs/transaction-building/intents.md +0 -62
- package/docs/transaction-building/offline.md +0 -73
- package/docs/transaction-building/sponsored-transactions.md +0 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction_execution_service.mjs","names":[],"sources":["../../../../../../src/grpc/proto/sui/rpc/v2/transaction_execution_service.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// @generated by protobuf-ts 2.9.6 with parameter force_server_none,optimize_code_size,ts_nocheck\n// @generated from protobuf file \"sui/rpc/v2/transaction_execution_service.proto\" (package \"sui.rpc.v2\", syntax proto3)\n// tslint:disable\n// @ts-nocheck\n//\n// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n//\nimport { ServiceType } from '@protobuf-ts/runtime-rpc';\nimport { MessageType } from '@protobuf-ts/runtime';\nimport { Value } from '../../../google/protobuf/struct.js';\nimport { Bcs } from './bcs.js';\nimport { Argument } from './argument.js';\nimport { ExecutedTransaction } from './executed_transaction.js';\nimport { FieldMask } from '../../../google/protobuf/field_mask.js';\nimport { UserSignature } from './signature.js';\nimport { Transaction } from './transaction.js';\n/**\n * @generated from protobuf message sui.rpc.v2.ExecuteTransactionRequest\n */\nexport interface ExecuteTransactionRequest {\n\t/**\n\t * The transaction to execute.\n\t *\n\t * @generated from protobuf field: optional sui.rpc.v2.Transaction transaction = 1;\n\t */\n\ttransaction?: Transaction;\n\t/**\n\t * Set of `UserSignature`s authorizing the execution of the provided\n\t * transaction.\n\t *\n\t * @generated from protobuf field: repeated sui.rpc.v2.UserSignature signatures = 2;\n\t */\n\tsignatures: UserSignature[];\n\t/**\n\t * Mask specifying which fields to read.\n\t * If no mask is specified, defaults to `effects.status,checkpoint`.\n\t *\n\t * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 3;\n\t */\n\treadMask?: FieldMask;\n}\n/**\n * Response message for `NodeService.ExecuteTransaction`.\n *\n * @generated from protobuf message sui.rpc.v2.ExecuteTransactionResponse\n */\nexport interface ExecuteTransactionResponse {\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.ExecutedTransaction transaction = 1;\n\t */\n\ttransaction?: ExecutedTransaction;\n}\n/**\n * @generated from protobuf message sui.rpc.v2.SimulateTransactionRequest\n */\nexport interface SimulateTransactionRequest {\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.Transaction transaction = 1;\n\t */\n\ttransaction?: Transaction;\n\t/**\n\t * Mask specifying which fields to read.\n\t *\n\t * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 2;\n\t */\n\treadMask?: FieldMask;\n\t/**\n\t * Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction\n\t *\n\t * @generated from protobuf field: optional sui.rpc.v2.SimulateTransactionRequest.TransactionChecks checks = 3;\n\t */\n\tchecks?: SimulateTransactionRequest_TransactionChecks;\n\t/**\n\t * Perform gas selection based on a budget estimation and include the\n\t * selected gas payment and budget in the response.\n\t *\n\t * This option will be ignored if `checks` is `DISABLED`.\n\t *\n\t * @generated from protobuf field: optional bool do_gas_selection = 4;\n\t */\n\tdoGasSelection?: boolean;\n}\n/**\n * buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n *\n * @generated from protobuf enum sui.rpc.v2.SimulateTransactionRequest.TransactionChecks\n */\nexport enum SimulateTransactionRequest_TransactionChecks {\n\t/**\n\t * @generated from protobuf enum value: ENABLED = 0;\n\t */\n\tENABLED = 0,\n\t/**\n\t * @generated from protobuf enum value: DISABLED = 1;\n\t */\n\tDISABLED = 1,\n}\n/**\n * @generated from protobuf message sui.rpc.v2.SimulateTransactionResponse\n */\nexport interface SimulateTransactionResponse {\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.ExecutedTransaction transaction = 1;\n\t */\n\ttransaction?: ExecutedTransaction;\n\t/**\n\t * @generated from protobuf field: repeated sui.rpc.v2.CommandResult command_outputs = 2;\n\t */\n\tcommandOutputs: CommandResult[];\n\t/**\n\t * A suggested gas price to use, that is above RGP, in order to provide a\n\t * better chance of the transaction being included in the presence of\n\t * congested objects.\n\t *\n\t * @generated from protobuf field: optional uint64 suggested_gas_price = 3;\n\t */\n\tsuggestedGasPrice?: bigint;\n}\n/**\n * An intermediate result/output from the execution of a single command\n *\n * @generated from protobuf message sui.rpc.v2.CommandResult\n */\nexport interface CommandResult {\n\t/**\n\t * @generated from protobuf field: repeated sui.rpc.v2.CommandOutput return_values = 1;\n\t */\n\treturnValues: CommandOutput[];\n\t/**\n\t * @generated from protobuf field: repeated sui.rpc.v2.CommandOutput mutated_by_ref = 2;\n\t */\n\tmutatedByRef: CommandOutput[];\n}\n/**\n * @generated from protobuf message sui.rpc.v2.CommandOutput\n */\nexport interface CommandOutput {\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.Argument argument = 1;\n\t */\n\targument?: Argument;\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.Bcs value = 2;\n\t */\n\tvalue?: Bcs;\n\t/**\n\t * JSON rendering of the output.\n\t *\n\t * @generated from protobuf field: optional google.protobuf.Value json = 3;\n\t */\n\tjson?: Value;\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass ExecuteTransactionRequest$Type extends MessageType<ExecuteTransactionRequest> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.ExecuteTransactionRequest', [\n\t\t\t{ no: 1, name: 'transaction', kind: 'message', T: () => Transaction },\n\t\t\t{\n\t\t\t\tno: 2,\n\t\t\t\tname: 'signatures',\n\t\t\t\tkind: 'message',\n\t\t\t\trepeat: 1 /*RepeatType.PACKED*/,\n\t\t\t\tT: () => UserSignature,\n\t\t\t},\n\t\t\t{ no: 3, name: 'read_mask', kind: 'message', T: () => FieldMask },\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.ExecuteTransactionRequest\n */\nexport const ExecuteTransactionRequest = new ExecuteTransactionRequest$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass ExecuteTransactionResponse$Type extends MessageType<ExecuteTransactionResponse> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.ExecuteTransactionResponse', [\n\t\t\t{ no: 1, name: 'transaction', kind: 'message', T: () => ExecutedTransaction },\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.ExecuteTransactionResponse\n */\nexport const ExecuteTransactionResponse = new ExecuteTransactionResponse$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass SimulateTransactionRequest$Type extends MessageType<SimulateTransactionRequest> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.SimulateTransactionRequest', [\n\t\t\t{ no: 1, name: 'transaction', kind: 'message', T: () => Transaction },\n\t\t\t{ no: 2, name: 'read_mask', kind: 'message', T: () => FieldMask },\n\t\t\t{\n\t\t\t\tno: 3,\n\t\t\t\tname: 'checks',\n\t\t\t\tkind: 'enum',\n\t\t\t\topt: true,\n\t\t\t\tT: () => [\n\t\t\t\t\t'sui.rpc.v2.SimulateTransactionRequest.TransactionChecks',\n\t\t\t\t\tSimulateTransactionRequest_TransactionChecks,\n\t\t\t\t],\n\t\t\t},\n\t\t\t{ no: 4, name: 'do_gas_selection', kind: 'scalar', opt: true, T: 8 /*ScalarType.BOOL*/ },\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.SimulateTransactionRequest\n */\nexport const SimulateTransactionRequest = new SimulateTransactionRequest$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass SimulateTransactionResponse$Type extends MessageType<SimulateTransactionResponse> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.SimulateTransactionResponse', [\n\t\t\t{ no: 1, name: 'transaction', kind: 'message', T: () => ExecutedTransaction },\n\t\t\t{\n\t\t\t\tno: 2,\n\t\t\t\tname: 'command_outputs',\n\t\t\t\tkind: 'message',\n\t\t\t\trepeat: 1 /*RepeatType.PACKED*/,\n\t\t\t\tT: () => CommandResult,\n\t\t\t},\n\t\t\t{\n\t\t\t\tno: 3,\n\t\t\t\tname: 'suggested_gas_price',\n\t\t\t\tkind: 'scalar',\n\t\t\t\topt: true,\n\t\t\t\tT: 4 /*ScalarType.UINT64*/,\n\t\t\t\tL: 0 /*LongType.BIGINT*/,\n\t\t\t},\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.SimulateTransactionResponse\n */\nexport const SimulateTransactionResponse = new SimulateTransactionResponse$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass CommandResult$Type extends MessageType<CommandResult> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.CommandResult', [\n\t\t\t{\n\t\t\t\tno: 1,\n\t\t\t\tname: 'return_values',\n\t\t\t\tkind: 'message',\n\t\t\t\trepeat: 1 /*RepeatType.PACKED*/,\n\t\t\t\tT: () => CommandOutput,\n\t\t\t},\n\t\t\t{\n\t\t\t\tno: 2,\n\t\t\t\tname: 'mutated_by_ref',\n\t\t\t\tkind: 'message',\n\t\t\t\trepeat: 1 /*RepeatType.PACKED*/,\n\t\t\t\tT: () => CommandOutput,\n\t\t\t},\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.CommandResult\n */\nexport const CommandResult = new CommandResult$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass CommandOutput$Type extends MessageType<CommandOutput> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.CommandOutput', [\n\t\t\t{ no: 1, name: 'argument', kind: 'message', T: () => Argument },\n\t\t\t{ no: 2, name: 'value', kind: 'message', T: () => Bcs },\n\t\t\t{ no: 3, name: 'json', kind: 'message', T: () => Value },\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.CommandOutput\n */\nexport const CommandOutput = new CommandOutput$Type();\n/**\n * @generated ServiceType for protobuf service sui.rpc.v2.TransactionExecutionService\n */\nexport const TransactionExecutionService = new ServiceType(\n\t'sui.rpc.v2.TransactionExecutionService',\n\t[\n\t\t{\n\t\t\tname: 'ExecuteTransaction',\n\t\t\toptions: {},\n\t\t\tI: ExecuteTransactionRequest,\n\t\t\tO: ExecuteTransactionResponse,\n\t\t},\n\t\t{\n\t\t\tname: 'SimulateTransaction',\n\t\t\toptions: {},\n\t\t\tI: SimulateTransactionRequest,\n\t\t\tO: SimulateTransactionResponse,\n\t\t},\n\t],\n);\n"],"mappings":";;;;;;;;;;;;;;;;AA2FA,IAAY,wHAAL;;;;AAIN;;;;AAIA;;;AA0DD,IAAM,iCAAN,cAA6C,YAAuC;CACnF,cAAc;AACb,QAAM,wCAAwC;GAC7C;IAAE,IAAI;IAAG,MAAM;IAAe,MAAM;IAAW,SAAS;IAAa;GACrE;IACC,IAAI;IACJ,MAAM;IACN,MAAM;IACN,QAAQ;IACR,SAAS;IACT;GACD;IAAE,IAAI;IAAG,MAAM;IAAa,MAAM;IAAW,SAAS;IAAW;GACjE,CAAC;;;;;;AAMJ,MAAa,4BAA4B,IAAI,gCAAgC;AAE7E,IAAM,kCAAN,cAA8C,YAAwC;CACrF,cAAc;AACb,QAAM,yCAAyC,CAC9C;GAAE,IAAI;GAAG,MAAM;GAAe,MAAM;GAAW,SAAS;GAAqB,CAC7E,CAAC;;;;;;AAMJ,MAAa,6BAA6B,IAAI,iCAAiC;AAE/E,IAAM,kCAAN,cAA8C,YAAwC;CACrF,cAAc;AACb,QAAM,yCAAyC;GAC9C;IAAE,IAAI;IAAG,MAAM;IAAe,MAAM;IAAW,SAAS;IAAa;GACrE;IAAE,IAAI;IAAG,MAAM;IAAa,MAAM;IAAW,SAAS;IAAW;GACjE;IACC,IAAI;IACJ,MAAM;IACN,MAAM;IACN,KA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
{"version":3,"file":"transaction_execution_service.mjs","names":[],"sources":["../../../../../../src/grpc/proto/sui/rpc/v2/transaction_execution_service.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// @generated by protobuf-ts 2.9.6 with parameter force_server_none,optimize_code_size,ts_nocheck\n// @generated from protobuf file \"sui/rpc/v2/transaction_execution_service.proto\" (package \"sui.rpc.v2\", syntax proto3)\n// tslint:disable\n// @ts-nocheck\n//\n// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n//\nimport { ServiceType } from '@protobuf-ts/runtime-rpc';\nimport { MessageType } from '@protobuf-ts/runtime';\nimport { Value } from '../../../google/protobuf/struct.js';\nimport { Bcs } from './bcs.js';\nimport { Argument } from './argument.js';\nimport { ExecutedTransaction } from './executed_transaction.js';\nimport { FieldMask } from '../../../google/protobuf/field_mask.js';\nimport { UserSignature } from './signature.js';\nimport { Transaction } from './transaction.js';\n/**\n * @generated from protobuf message sui.rpc.v2.ExecuteTransactionRequest\n */\nexport interface ExecuteTransactionRequest {\n\t/**\n\t * The transaction to execute.\n\t *\n\t * @generated from protobuf field: optional sui.rpc.v2.Transaction transaction = 1;\n\t */\n\ttransaction?: Transaction;\n\t/**\n\t * Set of `UserSignature`s authorizing the execution of the provided\n\t * transaction.\n\t *\n\t * @generated from protobuf field: repeated sui.rpc.v2.UserSignature signatures = 2;\n\t */\n\tsignatures: UserSignature[];\n\t/**\n\t * Mask specifying which fields to read.\n\t * If no mask is specified, defaults to `effects.status,checkpoint`.\n\t *\n\t * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 3;\n\t */\n\treadMask?: FieldMask;\n}\n/**\n * Response message for `NodeService.ExecuteTransaction`.\n *\n * @generated from protobuf message sui.rpc.v2.ExecuteTransactionResponse\n */\nexport interface ExecuteTransactionResponse {\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.ExecutedTransaction transaction = 1;\n\t */\n\ttransaction?: ExecutedTransaction;\n}\n/**\n * @generated from protobuf message sui.rpc.v2.SimulateTransactionRequest\n */\nexport interface SimulateTransactionRequest {\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.Transaction transaction = 1;\n\t */\n\ttransaction?: Transaction;\n\t/**\n\t * Mask specifying which fields to read.\n\t *\n\t * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 2;\n\t */\n\treadMask?: FieldMask;\n\t/**\n\t * Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction\n\t *\n\t * @generated from protobuf field: optional sui.rpc.v2.SimulateTransactionRequest.TransactionChecks checks = 3;\n\t */\n\tchecks?: SimulateTransactionRequest_TransactionChecks;\n\t/**\n\t * Perform gas selection based on a budget estimation and include the\n\t * selected gas payment and budget in the response.\n\t *\n\t * This option will be ignored if `checks` is `DISABLED`.\n\t *\n\t * @generated from protobuf field: optional bool do_gas_selection = 4;\n\t */\n\tdoGasSelection?: boolean;\n}\n/**\n * buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n *\n * @generated from protobuf enum sui.rpc.v2.SimulateTransactionRequest.TransactionChecks\n */\nexport enum SimulateTransactionRequest_TransactionChecks {\n\t/**\n\t * @generated from protobuf enum value: ENABLED = 0;\n\t */\n\tENABLED = 0,\n\t/**\n\t * @generated from protobuf enum value: DISABLED = 1;\n\t */\n\tDISABLED = 1,\n}\n/**\n * @generated from protobuf message sui.rpc.v2.SimulateTransactionResponse\n */\nexport interface SimulateTransactionResponse {\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.ExecutedTransaction transaction = 1;\n\t */\n\ttransaction?: ExecutedTransaction;\n\t/**\n\t * @generated from protobuf field: repeated sui.rpc.v2.CommandResult command_outputs = 2;\n\t */\n\tcommandOutputs: CommandResult[];\n\t/**\n\t * A suggested gas price to use, that is above RGP, in order to provide a\n\t * better chance of the transaction being included in the presence of\n\t * congested objects.\n\t *\n\t * @generated from protobuf field: optional uint64 suggested_gas_price = 3;\n\t */\n\tsuggestedGasPrice?: bigint;\n}\n/**\n * An intermediate result/output from the execution of a single command\n *\n * @generated from protobuf message sui.rpc.v2.CommandResult\n */\nexport interface CommandResult {\n\t/**\n\t * @generated from protobuf field: repeated sui.rpc.v2.CommandOutput return_values = 1;\n\t */\n\treturnValues: CommandOutput[];\n\t/**\n\t * @generated from protobuf field: repeated sui.rpc.v2.CommandOutput mutated_by_ref = 2;\n\t */\n\tmutatedByRef: CommandOutput[];\n}\n/**\n * @generated from protobuf message sui.rpc.v2.CommandOutput\n */\nexport interface CommandOutput {\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.Argument argument = 1;\n\t */\n\targument?: Argument;\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.Bcs value = 2;\n\t */\n\tvalue?: Bcs;\n\t/**\n\t * JSON rendering of the output.\n\t *\n\t * @generated from protobuf field: optional google.protobuf.Value json = 3;\n\t */\n\tjson?: Value;\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass ExecuteTransactionRequest$Type extends MessageType<ExecuteTransactionRequest> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.ExecuteTransactionRequest', [\n\t\t\t{ no: 1, name: 'transaction', kind: 'message', T: () => Transaction },\n\t\t\t{\n\t\t\t\tno: 2,\n\t\t\t\tname: 'signatures',\n\t\t\t\tkind: 'message',\n\t\t\t\trepeat: 2 /*RepeatType.UNPACKED*/,\n\t\t\t\tT: () => UserSignature,\n\t\t\t},\n\t\t\t{ no: 3, name: 'read_mask', kind: 'message', T: () => FieldMask },\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.ExecuteTransactionRequest\n */\nexport const ExecuteTransactionRequest = new ExecuteTransactionRequest$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass ExecuteTransactionResponse$Type extends MessageType<ExecuteTransactionResponse> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.ExecuteTransactionResponse', [\n\t\t\t{ no: 1, name: 'transaction', kind: 'message', T: () => ExecutedTransaction },\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.ExecuteTransactionResponse\n */\nexport const ExecuteTransactionResponse = new ExecuteTransactionResponse$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass SimulateTransactionRequest$Type extends MessageType<SimulateTransactionRequest> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.SimulateTransactionRequest', [\n\t\t\t{ no: 1, name: 'transaction', kind: 'message', T: () => Transaction },\n\t\t\t{ no: 2, name: 'read_mask', kind: 'message', T: () => FieldMask },\n\t\t\t{\n\t\t\t\tno: 3,\n\t\t\t\tname: 'checks',\n\t\t\t\tkind: 'enum',\n\t\t\t\topt: true,\n\t\t\t\tT: () => [\n\t\t\t\t\t'sui.rpc.v2.SimulateTransactionRequest.TransactionChecks',\n\t\t\t\t\tSimulateTransactionRequest_TransactionChecks,\n\t\t\t\t],\n\t\t\t},\n\t\t\t{ no: 4, name: 'do_gas_selection', kind: 'scalar', opt: true, T: 8 /*ScalarType.BOOL*/ },\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.SimulateTransactionRequest\n */\nexport const SimulateTransactionRequest = new SimulateTransactionRequest$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass SimulateTransactionResponse$Type extends MessageType<SimulateTransactionResponse> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.SimulateTransactionResponse', [\n\t\t\t{ no: 1, name: 'transaction', kind: 'message', T: () => ExecutedTransaction },\n\t\t\t{\n\t\t\t\tno: 2,\n\t\t\t\tname: 'command_outputs',\n\t\t\t\tkind: 'message',\n\t\t\t\trepeat: 2 /*RepeatType.UNPACKED*/,\n\t\t\t\tT: () => CommandResult,\n\t\t\t},\n\t\t\t{\n\t\t\t\tno: 3,\n\t\t\t\tname: 'suggested_gas_price',\n\t\t\t\tkind: 'scalar',\n\t\t\t\topt: true,\n\t\t\t\tT: 4 /*ScalarType.UINT64*/,\n\t\t\t\tL: 0 /*LongType.BIGINT*/,\n\t\t\t},\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.SimulateTransactionResponse\n */\nexport const SimulateTransactionResponse = new SimulateTransactionResponse$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass CommandResult$Type extends MessageType<CommandResult> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.CommandResult', [\n\t\t\t{\n\t\t\t\tno: 1,\n\t\t\t\tname: 'return_values',\n\t\t\t\tkind: 'message',\n\t\t\t\trepeat: 2 /*RepeatType.UNPACKED*/,\n\t\t\t\tT: () => CommandOutput,\n\t\t\t},\n\t\t\t{\n\t\t\t\tno: 2,\n\t\t\t\tname: 'mutated_by_ref',\n\t\t\t\tkind: 'message',\n\t\t\t\trepeat: 2 /*RepeatType.UNPACKED*/,\n\t\t\t\tT: () => CommandOutput,\n\t\t\t},\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.CommandResult\n */\nexport const CommandResult = new CommandResult$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass CommandOutput$Type extends MessageType<CommandOutput> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.CommandOutput', [\n\t\t\t{ no: 1, name: 'argument', kind: 'message', T: () => Argument },\n\t\t\t{ no: 2, name: 'value', kind: 'message', T: () => Bcs },\n\t\t\t{ no: 3, name: 'json', kind: 'message', T: () => Value },\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.CommandOutput\n */\nexport const CommandOutput = new CommandOutput$Type();\n/**\n * @generated ServiceType for protobuf service sui.rpc.v2.TransactionExecutionService\n */\nexport const TransactionExecutionService = new ServiceType(\n\t'sui.rpc.v2.TransactionExecutionService',\n\t[\n\t\t{\n\t\t\tname: 'ExecuteTransaction',\n\t\t\toptions: {},\n\t\t\tI: ExecuteTransactionRequest,\n\t\t\tO: ExecuteTransactionResponse,\n\t\t},\n\t\t{\n\t\t\tname: 'SimulateTransaction',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ACR,SAAS;IACT;GACD;IACC,IAAI;IACJ,MAAM;IACN,MAAM;IACN,KAAK;IACL,GAAG;IACH,GAAG;IACH;GACD,CAAC;;;;;;AAMJ,MAAa,8BAA8B,IAAI,kCAAkC;AAEjF,IAAM,qBAAN,cAAiC,YAA2B;CAC3D,cAAc;AACb,QAAM,4BAA4B,CACjC;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,QAAQ;GACR,SAAS;GACT,EACD;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,QAAQ;GACR,SAAS;GACT,CACD,CAAC;;;;;;AAMJ,MAAa,gBAAgB,IAAI,oBAAoB;AAErD,IAAM,qBAAN,cAAiC,YAA2B;CAC3D,cAAc;AACb,QAAM,4BAA4B;GACjC;IAAE,IAAI;IAAG,MAAM;IAAY,MAAM;IAAW,SAAS;IAAU;GAC/D;IAAE,IAAI;IAAG,MAAM;IAAS,MAAM;IAAW,SAAS;IAAK;GACvD;IAAE,IAAI;IAAG,MAAM;IAAQ,MAAM;IAAW,SAAS;IAAO;GACxD,CAAC;;;;;;AAMJ,MAAa,gBAAgB,IAAI,oBAAoB;;;;AAIrD,MAAa,8BAA8B,IAAI,YAC9C,0CACA,CACC;CACC,MAAM;CACN,SAAS,EAAE;CACX,GAAG;CACH,GAAG;CACH,EACD;CACC,MAAM;CACN,SAAS,EAAE;CACX,GAAG;CACH,GAAG;CACH,CACD,CACD"}
|
|
@@ -8,7 +8,7 @@ import { Event, TransactionEvents } from "./sui/rpc/v2/event.mjs";
|
|
|
8
8
|
import { ObjectReference } from "./sui/rpc/v2/object_reference.mjs";
|
|
9
9
|
import { GasCostSummary } from "./sui/rpc/v2/gas_cost_summary.mjs";
|
|
10
10
|
import { CleverError, CoinDenyListError, CommandArgumentError, CommandArgumentError_CommandArgumentErrorKind, CongestedObjects, ExecutionError, ExecutionError_ExecutionErrorKind, ExecutionStatus, IndexError, MoveAbort, MoveLocation, PackageUpgradeError, PackageUpgradeError_PackageUpgradeErrorKind, SizeError, TypeArgumentError, TypeArgumentError_TypeArgumentErrorKind } from "./sui/rpc/v2/execution_status.mjs";
|
|
11
|
-
import { AccumulatorWrite, AccumulatorWrite_AccumulatorOperation, ChangedObject, ChangedObject_IdOperation, ChangedObject_InputObjectState, ChangedObject_OutputObjectState, TransactionEffects, UnchangedConsensusObject, UnchangedConsensusObject_UnchangedConsensusObjectKind } from "./sui/rpc/v2/effects.mjs";
|
|
11
|
+
import { AccumulatorWrite, AccumulatorWrite_AccumulatorOperation, AccumulatorWrite_AccumulatorValue, ChangedObject, ChangedObject_IdOperation, ChangedObject_InputObjectState, ChangedObject_OutputObjectState, EventDigestEntry, TransactionEffects, UnchangedConsensusObject, UnchangedConsensusObject_UnchangedConsensusObjectKind } from "./sui/rpc/v2/effects.mjs";
|
|
12
12
|
import { Jwk, JwkId } from "./sui/rpc/v2/jwk.mjs";
|
|
13
13
|
import { SignatureScheme } from "./sui/rpc/v2/signature_scheme.mjs";
|
|
14
14
|
import { CircomG1, CircomG2, MultisigAggregatedSignature, MultisigCommittee, MultisigMember, MultisigMemberPublicKey, MultisigMemberSignature, PasskeyAuthenticator, SimpleSignature, UserSignature, ValidatorAggregatedSignature, ValidatorCommittee, ValidatorCommitteeMember, ZkLoginAuthenticator, ZkLoginClaim, ZkLoginInputs, ZkLoginProof, ZkLoginPublicIdentifier } from "./sui/rpc/v2/signature.mjs";
|
|
@@ -28,11 +28,12 @@ import { SignatureVerificationService, VerifySignatureRequest, VerifySignatureRe
|
|
|
28
28
|
import { Balance, CoinMetadata, CoinMetadata_MetadataCapState, CoinTreasury, CoinTreasury_SupplyState, DynamicField, DynamicField_DynamicFieldKind, GetBalanceRequest, GetBalanceResponse, GetCoinInfoRequest, GetCoinInfoResponse, ListBalancesRequest, ListBalancesResponse, ListDynamicFieldsRequest, ListDynamicFieldsResponse, ListOwnedObjectsRequest, ListOwnedObjectsResponse, RegulatedCoinMetadata, RegulatedCoinMetadata_CoinRegulatedState, StateService } from "./sui/rpc/v2/state_service.mjs";
|
|
29
29
|
import { SubscribeCheckpointsRequest, SubscribeCheckpointsResponse, SubscriptionService } from "./sui/rpc/v2/subscription_service.mjs";
|
|
30
30
|
import { LookupNameRequest, LookupNameResponse, NameRecord, NameService, ReverseLookupNameRequest, ReverseLookupNameResponse } from "./sui/rpc/v2/name_service.mjs";
|
|
31
|
+
import { AdvanceCheckpointRequest, AdvanceCheckpointResponse, AdvanceClockRequest, AdvanceClockResponse, ForkingService, GetStatusRequest, GetStatusResponse } from "./sui/forking/v1alpha/forking_service.mjs";
|
|
31
32
|
import { ErrorReason } from "./sui/rpc/v2/error_reason.mjs";
|
|
32
33
|
|
|
33
34
|
//#region src/grpc/proto/types.d.ts
|
|
34
35
|
declare namespace types_d_exports {
|
|
35
|
-
export { Ability, AccumulatorWrite, AccumulatorWrite_AccumulatorOperation, ActiveJwk, AddressAliasesVersion, Argument, Argument_ArgumentKind, AuthenticatorStateExpire, AuthenticatorStateUpdate, Balance, BalanceChange, BatchGetObjectsRequest, BatchGetObjectsResponse, BatchGetTransactionsRequest, BatchGetTransactionsResponse, Bcs, CanceledTransaction, ChangeEpoch, ChangedObject, ChangedObject_IdOperation, ChangedObject_InputObjectState, ChangedObject_OutputObjectState, Checkpoint, CheckpointCommitment, CheckpointCommitment_CheckpointCommitmentKind, CheckpointContents, CheckpointSummary, CheckpointedTransactionInfo, CircomG1, CircomG2, CleverError, CoinDenyListError, CoinMetadata, CoinMetadata_MetadataCapState, CoinTreasury, CoinTreasury_SupplyState, Command, CommandArgumentError, CommandArgumentError_CommandArgumentErrorKind, CommandOutput, CommandResult, CongestedObjects, ConsensusCommitPrologue, ConsensusDeterminedVersionAssignments, DatatypeDescriptor, DatatypeDescriptor_DatatypeKind, Display, DynamicField, DynamicField_DynamicFieldKind, EndOfEpochData, EndOfEpochTransaction, EndOfEpochTransactionKind, EndOfEpochTransactionKind_Kind, Epoch, ErrorReason, Event, ExecuteTransactionRequest, ExecuteTransactionResponse, ExecutedTransaction, ExecutionError, ExecutionError_ExecutionErrorKind, ExecutionStatus, ExecutionTimeObservation, ExecutionTimeObservation_ExecutionTimeObservationKind, ExecutionTimeObservations, FieldDescriptor, FunctionDescriptor, FunctionDescriptor_Visibility, FundsWithdrawal, FundsWithdrawal_Source, GasCostSummary, GasPayment, GenesisTransaction, GetBalanceRequest, GetBalanceResponse, GetCheckpointRequest, GetCheckpointResponse, GetCoinInfoRequest, GetCoinInfoResponse, GetDatatypeRequest, GetDatatypeResponse, GetEpochRequest, GetEpochResponse, GetFunctionRequest, GetFunctionResponse, GetObjectRequest, GetObjectResponse, GetObjectResult, GetPackageRequest, GetPackageResponse, GetServiceInfoRequest, GetServiceInfoResponse, GetTransactionRequest, GetTransactionResponse, GetTransactionResult, IndexError, Input, Input_InputKind, Input_Mutability, Jwk, JwkId, LedgerService, Linkage, ListBalancesRequest, ListBalancesResponse, ListDynamicFieldsRequest, ListDynamicFieldsResponse, ListOwnedObjectsRequest, ListOwnedObjectsResponse, ListPackageVersionsRequest, ListPackageVersionsResponse, LookupNameRequest, LookupNameResponse, MakeMoveVector, MergeCoins, Module, MoveAbort, MoveCall, MoveLocation, MovePackageService, MoveTable, MultisigAggregatedSignature, MultisigCommittee, MultisigMember, MultisigMemberPublicKey, MultisigMemberSignature, NameRecord, NameService, Object$1 as Object, ObjectReference, ObjectSet, OpenSignature, OpenSignatureBody, OpenSignatureBody_Type, OpenSignature_Reference, Owner, Owner_OwnerKind, Package, PackageUpgradeError, PackageUpgradeError_PackageUpgradeErrorKind, PackageVersion, PasskeyAuthenticator, ProgrammableTransaction, ProtocolConfig, Publish, RandomnessStateUpdate, RegulatedCoinMetadata, RegulatedCoinMetadata_CoinRegulatedState, ReverseLookupNameRequest, ReverseLookupNameResponse, SignatureScheme, SignatureVerificationService, SimpleSignature, SimulateTransactionRequest, SimulateTransactionRequest_TransactionChecks, SimulateTransactionResponse, SizeError, SplitCoins, StakeSubsidy, StakingPool, StateService, StorageFund, SubscribeCheckpointsRequest, SubscribeCheckpointsResponse, SubscriptionService, SystemPackage, SystemParameters, SystemState, Transaction, TransactionEffects, TransactionEvents, TransactionExecutionService, TransactionExpiration, TransactionExpiration_TransactionExpirationKind, TransactionKind, TransactionKind_Kind, TransferObjects, TypeArgumentError, TypeArgumentError_TypeArgumentErrorKind, TypeOrigin, TypeParameter, UnchangedConsensusObject, UnchangedConsensusObject_UnchangedConsensusObjectKind, Upgrade, UserSignature, Validator, ValidatorAggregatedSignature, ValidatorCommittee, ValidatorCommitteeMember, ValidatorExecutionTimeObservation, ValidatorReportRecord, ValidatorSet, VariantDescriptor, VerifySignatureRequest, VerifySignatureResponse, VersionAssignment, ZkLoginAuthenticator, ZkLoginClaim, ZkLoginInputs, ZkLoginProof, ZkLoginPublicIdentifier };
|
|
36
|
+
export { Ability, AccumulatorWrite, AccumulatorWrite_AccumulatorOperation, AccumulatorWrite_AccumulatorValue, ActiveJwk, AddressAliasesVersion, AdvanceCheckpointRequest, AdvanceCheckpointResponse, AdvanceClockRequest, AdvanceClockResponse, Argument, Argument_ArgumentKind, AuthenticatorStateExpire, AuthenticatorStateUpdate, Balance, BalanceChange, BatchGetObjectsRequest, BatchGetObjectsResponse, BatchGetTransactionsRequest, BatchGetTransactionsResponse, Bcs, CanceledTransaction, ChangeEpoch, ChangedObject, ChangedObject_IdOperation, ChangedObject_InputObjectState, ChangedObject_OutputObjectState, Checkpoint, CheckpointCommitment, CheckpointCommitment_CheckpointCommitmentKind, CheckpointContents, CheckpointSummary, CheckpointedTransactionInfo, CircomG1, CircomG2, CleverError, CoinDenyListError, CoinMetadata, CoinMetadata_MetadataCapState, CoinTreasury, CoinTreasury_SupplyState, Command, CommandArgumentError, CommandArgumentError_CommandArgumentErrorKind, CommandOutput, CommandResult, CongestedObjects, ConsensusCommitPrologue, ConsensusDeterminedVersionAssignments, DatatypeDescriptor, DatatypeDescriptor_DatatypeKind, Display, DynamicField, DynamicField_DynamicFieldKind, EndOfEpochData, EndOfEpochTransaction, EndOfEpochTransactionKind, EndOfEpochTransactionKind_Kind, Epoch, ErrorReason, Event, EventDigestEntry, ExecuteTransactionRequest, ExecuteTransactionResponse, ExecutedTransaction, ExecutionError, ExecutionError_ExecutionErrorKind, ExecutionStatus, ExecutionTimeObservation, ExecutionTimeObservation_ExecutionTimeObservationKind, ExecutionTimeObservations, FieldDescriptor, ForkingService, FunctionDescriptor, FunctionDescriptor_Visibility, FundsWithdrawal, FundsWithdrawal_Source, GasCostSummary, GasPayment, GenesisTransaction, GetBalanceRequest, GetBalanceResponse, GetCheckpointRequest, GetCheckpointResponse, GetCoinInfoRequest, GetCoinInfoResponse, GetDatatypeRequest, GetDatatypeResponse, GetEpochRequest, GetEpochResponse, GetFunctionRequest, GetFunctionResponse, GetObjectRequest, GetObjectResponse, GetObjectResult, GetPackageRequest, GetPackageResponse, GetServiceInfoRequest, GetServiceInfoResponse, GetStatusRequest, GetStatusResponse, GetTransactionRequest, GetTransactionResponse, GetTransactionResult, IndexError, Input, Input_InputKind, Input_Mutability, Jwk, JwkId, LedgerService, Linkage, ListBalancesRequest, ListBalancesResponse, ListDynamicFieldsRequest, ListDynamicFieldsResponse, ListOwnedObjectsRequest, ListOwnedObjectsResponse, ListPackageVersionsRequest, ListPackageVersionsResponse, LookupNameRequest, LookupNameResponse, MakeMoveVector, MergeCoins, Module, MoveAbort, MoveCall, MoveLocation, MovePackageService, MoveTable, MultisigAggregatedSignature, MultisigCommittee, MultisigMember, MultisigMemberPublicKey, MultisigMemberSignature, NameRecord, NameService, Object$1 as Object, ObjectReference, ObjectSet, OpenSignature, OpenSignatureBody, OpenSignatureBody_Type, OpenSignature_Reference, Owner, Owner_OwnerKind, Package, PackageUpgradeError, PackageUpgradeError_PackageUpgradeErrorKind, PackageVersion, PasskeyAuthenticator, ProgrammableTransaction, ProtocolConfig, Publish, RandomnessStateUpdate, RegulatedCoinMetadata, RegulatedCoinMetadata_CoinRegulatedState, ReverseLookupNameRequest, ReverseLookupNameResponse, SignatureScheme, SignatureVerificationService, SimpleSignature, SimulateTransactionRequest, SimulateTransactionRequest_TransactionChecks, SimulateTransactionResponse, SizeError, SplitCoins, StakeSubsidy, StakingPool, StateService, StorageFund, SubscribeCheckpointsRequest, SubscribeCheckpointsResponse, SubscriptionService, SystemPackage, SystemParameters, SystemState, Transaction, TransactionEffects, TransactionEvents, TransactionExecutionService, TransactionExpiration, TransactionExpiration_TransactionExpirationKind, TransactionKind, TransactionKind_Kind, TransferObjects, TypeArgumentError, TypeArgumentError_TypeArgumentErrorKind, TypeOrigin, TypeParameter, UnchangedConsensusObject, UnchangedConsensusObject_UnchangedConsensusObjectKind, Upgrade, UserSignature, Validator, ValidatorAggregatedSignature, ValidatorCommittee, ValidatorCommitteeMember, ValidatorExecutionTimeObservation, ValidatorReportRecord, ValidatorSet, VariantDescriptor, VerifySignatureRequest, VerifySignatureResponse, VersionAssignment, ZkLoginAuthenticator, ZkLoginClaim, ZkLoginInputs, ZkLoginProof, ZkLoginPublicIdentifier };
|
|
36
37
|
}
|
|
37
38
|
//#endregion
|
|
38
39
|
export { types_d_exports };
|
|
@@ -11,7 +11,7 @@ import { ActiveJwk, AuthenticatorStateExpire, AuthenticatorStateUpdate, Canceled
|
|
|
11
11
|
import { BalanceChange } from "./sui/rpc/v2/balance_change.mjs";
|
|
12
12
|
import { GasCostSummary } from "./sui/rpc/v2/gas_cost_summary.mjs";
|
|
13
13
|
import { CleverError, CoinDenyListError, CommandArgumentError, CommandArgumentError_CommandArgumentErrorKind, CongestedObjects, ExecutionError, ExecutionError_ExecutionErrorKind, ExecutionStatus, IndexError, MoveAbort, MoveLocation, PackageUpgradeError, PackageUpgradeError_PackageUpgradeErrorKind, SizeError, TypeArgumentError, TypeArgumentError_TypeArgumentErrorKind } from "./sui/rpc/v2/execution_status.mjs";
|
|
14
|
-
import { AccumulatorWrite, AccumulatorWrite_AccumulatorOperation, ChangedObject, ChangedObject_IdOperation, ChangedObject_InputObjectState, ChangedObject_OutputObjectState, TransactionEffects, UnchangedConsensusObject, UnchangedConsensusObject_UnchangedConsensusObjectKind } from "./sui/rpc/v2/effects.mjs";
|
|
14
|
+
import { AccumulatorWrite, AccumulatorWrite_AccumulatorOperation, AccumulatorWrite_AccumulatorValue, ChangedObject, ChangedObject_IdOperation, ChangedObject_InputObjectState, ChangedObject_OutputObjectState, EventDigestEntry, TransactionEffects, UnchangedConsensusObject, UnchangedConsensusObject_UnchangedConsensusObjectKind } from "./sui/rpc/v2/effects.mjs";
|
|
15
15
|
import { Event, TransactionEvents } from "./sui/rpc/v2/event.mjs";
|
|
16
16
|
import { SignatureScheme } from "./sui/rpc/v2/signature_scheme.mjs";
|
|
17
17
|
import { CircomG1, CircomG2, MultisigAggregatedSignature, MultisigCommittee, MultisigMember, MultisigMemberPublicKey, MultisigMemberSignature, PasskeyAuthenticator, SimpleSignature, UserSignature, ValidatorAggregatedSignature, ValidatorCommittee, ValidatorCommitteeMember, ZkLoginAuthenticator, ZkLoginClaim, ZkLoginInputs, ZkLoginProof, ZkLoginPublicIdentifier } from "./sui/rpc/v2/signature.mjs";
|
|
@@ -29,6 +29,7 @@ import { SignatureVerificationService, VerifySignatureRequest, VerifySignatureRe
|
|
|
29
29
|
import { Balance, CoinMetadata, CoinMetadata_MetadataCapState, CoinTreasury, CoinTreasury_SupplyState, DynamicField, DynamicField_DynamicFieldKind, GetBalanceRequest, GetBalanceResponse, GetCoinInfoRequest, GetCoinInfoResponse, ListBalancesRequest, ListBalancesResponse, ListDynamicFieldsRequest, ListDynamicFieldsResponse, ListOwnedObjectsRequest, ListOwnedObjectsResponse, RegulatedCoinMetadata, RegulatedCoinMetadata_CoinRegulatedState, StateService } from "./sui/rpc/v2/state_service.mjs";
|
|
30
30
|
import { SubscribeCheckpointsRequest, SubscribeCheckpointsResponse, SubscriptionService } from "./sui/rpc/v2/subscription_service.mjs";
|
|
31
31
|
import { LookupNameRequest, LookupNameResponse, NameRecord, NameService, ReverseLookupNameRequest, ReverseLookupNameResponse } from "./sui/rpc/v2/name_service.mjs";
|
|
32
|
+
import { AdvanceCheckpointRequest, AdvanceCheckpointResponse, AdvanceClockRequest, AdvanceClockResponse, ForkingService, GetStatusRequest, GetStatusResponse } from "./sui/forking/v1alpha/forking_service.mjs";
|
|
32
33
|
import { ErrorReason } from "./sui/rpc/v2/error_reason.mjs";
|
|
33
34
|
|
|
34
35
|
//#region src/grpc/proto/types.ts
|
|
@@ -36,8 +37,13 @@ var types_exports = /* @__PURE__ */ __exportAll({
|
|
|
36
37
|
Ability: () => Ability,
|
|
37
38
|
AccumulatorWrite: () => AccumulatorWrite,
|
|
38
39
|
AccumulatorWrite_AccumulatorOperation: () => AccumulatorWrite_AccumulatorOperation,
|
|
40
|
+
AccumulatorWrite_AccumulatorValue: () => AccumulatorWrite_AccumulatorValue,
|
|
39
41
|
ActiveJwk: () => ActiveJwk,
|
|
40
42
|
AddressAliasesVersion: () => AddressAliasesVersion,
|
|
43
|
+
AdvanceCheckpointRequest: () => AdvanceCheckpointRequest,
|
|
44
|
+
AdvanceCheckpointResponse: () => AdvanceCheckpointResponse,
|
|
45
|
+
AdvanceClockRequest: () => AdvanceClockRequest,
|
|
46
|
+
AdvanceClockResponse: () => AdvanceClockResponse,
|
|
41
47
|
Argument: () => Argument,
|
|
42
48
|
Argument_ArgumentKind: () => Argument_ArgumentKind,
|
|
43
49
|
AuthenticatorStateExpire: () => AuthenticatorStateExpire,
|
|
@@ -89,6 +95,7 @@ var types_exports = /* @__PURE__ */ __exportAll({
|
|
|
89
95
|
Epoch: () => Epoch,
|
|
90
96
|
ErrorReason: () => ErrorReason,
|
|
91
97
|
Event: () => Event,
|
|
98
|
+
EventDigestEntry: () => EventDigestEntry,
|
|
92
99
|
ExecuteTransactionRequest: () => ExecuteTransactionRequest,
|
|
93
100
|
ExecuteTransactionResponse: () => ExecuteTransactionResponse,
|
|
94
101
|
ExecutedTransaction: () => ExecutedTransaction,
|
|
@@ -99,6 +106,7 @@ var types_exports = /* @__PURE__ */ __exportAll({
|
|
|
99
106
|
ExecutionTimeObservation_ExecutionTimeObservationKind: () => ExecutionTimeObservation_ExecutionTimeObservationKind,
|
|
100
107
|
ExecutionTimeObservations: () => ExecutionTimeObservations,
|
|
101
108
|
FieldDescriptor: () => FieldDescriptor,
|
|
109
|
+
ForkingService: () => ForkingService,
|
|
102
110
|
FunctionDescriptor: () => FunctionDescriptor,
|
|
103
111
|
FunctionDescriptor_Visibility: () => FunctionDescriptor_Visibility,
|
|
104
112
|
FundsWithdrawal: () => FundsWithdrawal,
|
|
@@ -125,6 +133,8 @@ var types_exports = /* @__PURE__ */ __exportAll({
|
|
|
125
133
|
GetPackageResponse: () => GetPackageResponse,
|
|
126
134
|
GetServiceInfoRequest: () => GetServiceInfoRequest,
|
|
127
135
|
GetServiceInfoResponse: () => GetServiceInfoResponse,
|
|
136
|
+
GetStatusRequest: () => GetStatusRequest,
|
|
137
|
+
GetStatusResponse: () => GetStatusResponse,
|
|
128
138
|
GetTransactionRequest: () => GetTransactionRequest,
|
|
129
139
|
GetTransactionResponse: () => GetTransactionResponse,
|
|
130
140
|
GetTransactionResult: () => GetTransactionResult,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","names":[],"sources":["../../../src/grpc/proto/types.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * ######################################\n * ### DO NOT EDIT THIS FILE DIRECTLY ###\n * ######################################\n *\n * This file is auto-generated by scripts/generate-grpc-types.ts\n * Run `pnpm codegen:grpc` to regenerate.\n */\n\n// Re-export all gRPC proto types for easy consumption\nexport * from './sui/rpc/v2/argument.js';\nexport * from './sui/rpc/v2/balance_change.js';\nexport * from './sui/rpc/v2/bcs.js';\nexport * from './sui/rpc/v2/checkpoint.js';\nexport * from './sui/rpc/v2/checkpoint_contents.js';\nexport * from './sui/rpc/v2/checkpoint_summary.js';\nexport * from './sui/rpc/v2/effects.js';\nexport * from './sui/rpc/v2/epoch.js';\nexport * from './sui/rpc/v2/error_reason.js';\nexport * from './sui/rpc/v2/event.js';\nexport * from './sui/rpc/v2/executed_transaction.js';\nexport * from './sui/rpc/v2/execution_status.js';\nexport * from './sui/rpc/v2/gas_cost_summary.js';\nexport * from './sui/rpc/v2/input.js';\nexport * from './sui/rpc/v2/jwk.js';\nexport * from './sui/rpc/v2/ledger_service.js';\nexport * from './sui/rpc/v2/move_package.js';\nexport * from './sui/rpc/v2/move_package_service.js';\nexport * from './sui/rpc/v2/name_service.js';\nexport * from './sui/rpc/v2/object.js';\nexport * from './sui/rpc/v2/object_reference.js';\nexport * from './sui/rpc/v2/owner.js';\nexport * from './sui/rpc/v2/protocol_config.js';\nexport * from './sui/rpc/v2/signature.js';\nexport * from './sui/rpc/v2/signature_scheme.js';\nexport * from './sui/rpc/v2/signature_verification_service.js';\nexport * from './sui/rpc/v2/state_service.js';\nexport * from './sui/rpc/v2/subscription_service.js';\nexport * from './sui/rpc/v2/system_state.js';\nexport * from './sui/rpc/v2/transaction.js';\nexport * from './sui/rpc/v2/transaction_execution_service.js';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.mjs","names":[],"sources":["../../../src/grpc/proto/types.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * ######################################\n * ### DO NOT EDIT THIS FILE DIRECTLY ###\n * ######################################\n *\n * This file is auto-generated by scripts/generate-grpc-types.ts\n * Run `pnpm codegen:grpc` to regenerate.\n */\n\n// Re-export all gRPC proto types for easy consumption\nexport * from './sui/rpc/v2/argument.js';\nexport * from './sui/rpc/v2/balance_change.js';\nexport * from './sui/rpc/v2/bcs.js';\nexport * from './sui/rpc/v2/checkpoint.js';\nexport * from './sui/rpc/v2/checkpoint_contents.js';\nexport * from './sui/rpc/v2/checkpoint_summary.js';\nexport * from './sui/rpc/v2/effects.js';\nexport * from './sui/rpc/v2/epoch.js';\nexport * from './sui/rpc/v2/error_reason.js';\nexport * from './sui/rpc/v2/event.js';\nexport * from './sui/rpc/v2/executed_transaction.js';\nexport * from './sui/rpc/v2/execution_status.js';\nexport * from './sui/rpc/v2/gas_cost_summary.js';\nexport * from './sui/rpc/v2/input.js';\nexport * from './sui/rpc/v2/jwk.js';\nexport * from './sui/rpc/v2/ledger_service.js';\nexport * from './sui/rpc/v2/move_package.js';\nexport * from './sui/rpc/v2/move_package_service.js';\nexport * from './sui/rpc/v2/name_service.js';\nexport * from './sui/rpc/v2/object.js';\nexport * from './sui/rpc/v2/object_reference.js';\nexport * from './sui/rpc/v2/owner.js';\nexport * from './sui/rpc/v2/protocol_config.js';\nexport * from './sui/rpc/v2/signature.js';\nexport * from './sui/rpc/v2/signature_scheme.js';\nexport * from './sui/rpc/v2/signature_verification_service.js';\nexport * from './sui/rpc/v2/state_service.js';\nexport * from './sui/rpc/v2/subscription_service.js';\nexport * from './sui/rpc/v2/system_state.js';\nexport * from './sui/rpc/v2/transaction.js';\nexport * from './sui/rpc/v2/transaction_execution_service.js';\nexport * from './sui/forking/v1alpha/forking_service.js';\n"],"mappings":""}
|
|
@@ -126,8 +126,8 @@ interface GetObjectParams {
|
|
|
126
126
|
signal?: AbortSignal;
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
|
-
* Return the protocol config table for the given version number. If
|
|
130
|
-
*
|
|
129
|
+
* Return the protocol config table for the given version number. If none is specified, the node uses
|
|
130
|
+
* the version of the latest epoch it has processed.
|
|
131
131
|
*/
|
|
132
132
|
interface GetProtocolConfigParams {
|
|
133
133
|
/**
|
|
@@ -507,7 +507,7 @@ interface UnsafePayAllSuiParams {
|
|
|
507
507
|
* input_coin to create new coin following the order of amounts and assign it to the corresponding
|
|
508
508
|
* recipient. 2. accumulate all residual SUI from input coins left and deposit all SUI to the first
|
|
509
509
|
* input coin, then use the first input coin as the gas coin object. 3. the balance of the first input
|
|
510
|
-
* coin after tx is sum(input_coins) - sum(amounts) - actual_gas_cost 4. all other input
|
|
510
|
+
* coin after tx is sum(input_coins) - sum(amounts) - actual_gas_cost 4. all other input coins other
|
|
511
511
|
* than the first one are deleted.
|
|
512
512
|
*/
|
|
513
513
|
interface UnsafePaySuiParams {
|
|
@@ -578,7 +578,7 @@ interface UnsafeRequestWithdrawStakeParams {
|
|
|
578
578
|
interface UnsafeSplitCoinParams {
|
|
579
579
|
/** the transaction signer's Sui address */
|
|
580
580
|
signer: string;
|
|
581
|
-
/** the coin object to be
|
|
581
|
+
/** the coin object to be split */
|
|
582
582
|
coinObjectId: string;
|
|
583
583
|
/** the amounts to split out from the coin */
|
|
584
584
|
splitAmounts: string[];
|
|
@@ -595,7 +595,7 @@ interface UnsafeSplitCoinParams {
|
|
|
595
595
|
interface UnsafeSplitCoinEqualParams {
|
|
596
596
|
/** the transaction signer's Sui address */
|
|
597
597
|
signer: string;
|
|
598
|
-
/** the coin object to be
|
|
598
|
+
/** the coin object to be split */
|
|
599
599
|
coinObjectId: string;
|
|
600
600
|
/** the number of coins to split into */
|
|
601
601
|
splitCount: string;
|
|
@@ -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
|
|
11
|
+
import * as _mysten_bcs823 from "@mysten/bcs";
|
|
12
12
|
import { SerializedBcs } from "@mysten/bcs";
|
|
13
13
|
import { InferInput } from "valibot";
|
|
14
14
|
|
|
@@ -40,6 +40,16 @@ type TransactionObjectInput = string | CallArg | TransactionObjectArgument;
|
|
|
40
40
|
type TransactionLike = {
|
|
41
41
|
getData(): unknown;
|
|
42
42
|
};
|
|
43
|
+
interface TransactionCopyOptions {
|
|
44
|
+
/**
|
|
45
|
+
* A map of intent names to resolvers for any custom intents used in the transaction being copied.
|
|
46
|
+
*
|
|
47
|
+
* Built-in intents (such as `CoinWithBalance`) are handled automatically. Providing resolvers for
|
|
48
|
+
* custom intents lets `Transaction.from` copy a transaction synchronously even when it still
|
|
49
|
+
* contains unresolved intents, without first awaiting `prepareForSerialization`.
|
|
50
|
+
*/
|
|
51
|
+
intentResolvers?: Record<string, TransactionPlugin>;
|
|
52
|
+
}
|
|
43
53
|
/**
|
|
44
54
|
* Transaction Builder
|
|
45
55
|
*/
|
|
@@ -56,8 +66,12 @@ declare class Transaction {
|
|
|
56
66
|
* There are two supported serialized formats:
|
|
57
67
|
* - A string returned from `Transaction#serialize`. The serialized format must be compatible, or it will throw an error.
|
|
58
68
|
* - A byte array (or base64-encoded bytes) containing BCS transaction data.
|
|
69
|
+
*
|
|
70
|
+
* When copying an in-memory transaction that uses custom intents, pass resolvers for those intents
|
|
71
|
+
* via `options.intentResolvers` so the copy can be created synchronously without first awaiting
|
|
72
|
+
* `prepareForSerialization`. Built-in intents (such as `CoinWithBalance`) are handled automatically.
|
|
59
73
|
*/
|
|
60
|
-
static from(transaction: string | Uint8Array | TransactionLike): Transaction;
|
|
74
|
+
static from(transaction: string | Uint8Array | TransactionLike, options?: TransactionCopyOptions): Transaction;
|
|
61
75
|
addSerializationPlugin(step: TransactionPlugin): void;
|
|
62
76
|
addBuildPlugin(step: TransactionPlugin): void;
|
|
63
77
|
addIntentResolver(intent: string, resolver: TransactionPlugin): void;
|
|
@@ -77,7 +91,7 @@ declare class Transaction {
|
|
|
77
91
|
getData(): {
|
|
78
92
|
version: 2;
|
|
79
93
|
sender?: string | null | undefined;
|
|
80
|
-
expiration?:
|
|
94
|
+
expiration?: _mysten_bcs823.EnumOutputShapeWithKeys<{
|
|
81
95
|
None: true;
|
|
82
96
|
Epoch: string | number;
|
|
83
97
|
ValidDuring: {
|
|
@@ -88,7 +102,7 @@ declare class Transaction {
|
|
|
88
102
|
chain: string;
|
|
89
103
|
nonce: number;
|
|
90
104
|
};
|
|
91
|
-
}, "
|
|
105
|
+
}, "Epoch" | "None" | "ValidDuring"> | null | undefined;
|
|
92
106
|
gasData: {
|
|
93
107
|
budget: string | number | null;
|
|
94
108
|
price: string | number | null;
|
|
@@ -99,8 +113,8 @@ declare class Transaction {
|
|
|
99
113
|
digest: string;
|
|
100
114
|
}[] | null;
|
|
101
115
|
};
|
|
102
|
-
inputs:
|
|
103
|
-
Object:
|
|
116
|
+
inputs: _mysten_bcs823.EnumOutputShapeWithKeys<{
|
|
117
|
+
Object: _mysten_bcs823.EnumOutputShapeWithKeys<{
|
|
104
118
|
ImmOrOwnedObject: {
|
|
105
119
|
objectId: string;
|
|
106
120
|
version: string | number;
|
|
@@ -116,7 +130,7 @@ declare class Transaction {
|
|
|
116
130
|
version: string | number;
|
|
117
131
|
digest: string;
|
|
118
132
|
};
|
|
119
|
-
}, "
|
|
133
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
120
134
|
Pure: {
|
|
121
135
|
bytes: string;
|
|
122
136
|
};
|
|
@@ -139,13 +153,13 @@ declare class Transaction {
|
|
|
139
153
|
Balance: string;
|
|
140
154
|
$kind: "Balance";
|
|
141
155
|
};
|
|
142
|
-
withdrawFrom:
|
|
156
|
+
withdrawFrom: _mysten_bcs823.EnumOutputShapeWithKeys<{
|
|
143
157
|
Sender: true;
|
|
144
158
|
Sponsor: true;
|
|
145
159
|
}, "Sender" | "Sponsor">;
|
|
146
160
|
};
|
|
147
|
-
}, "
|
|
148
|
-
commands:
|
|
161
|
+
}, "Object" | "Pure" | "FundsWithdrawal" | "UnresolvedPure" | "UnresolvedObject">[];
|
|
162
|
+
commands: _mysten_bcs823.EnumOutputShapeWithKeys<{
|
|
149
163
|
MoveCall: {
|
|
150
164
|
package: string;
|
|
151
165
|
module: string;
|
|
@@ -514,5 +528,5 @@ declare class Transaction {
|
|
|
514
528
|
prepareForSerialization(options: SerializeTransactionOptions): Promise<void>;
|
|
515
529
|
}
|
|
516
530
|
//#endregion
|
|
517
|
-
export { AsyncTransactionThunk, Transaction, TransactionObjectArgument, TransactionObjectInput, TransactionResult, isTransaction };
|
|
531
|
+
export { AsyncTransactionThunk, Transaction, TransactionCopyOptions, TransactionObjectArgument, TransactionObjectInput, TransactionResult, isTransaction };
|
|
518
532
|
//# sourceMappingURL=Transaction.d.mts.map
|
|
@@ -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;;;;
|
|
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,yBA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AA,CAA2B,OAAA;IAAW,gBAAA;EAAA;;;;;;;;;;;;EA2BtC,eAAA,CAAA;;EAiBM,KAAA,CAAM,OAAA,GAAS,uBAAA,GAA+B,OAAA,CAAQ,UAAA,CAAW,WAAA;EA7btE;EAscK,SAAA,CACL,OAAA;IACC,MAAA,GAAS,iBAAA;EAAA,IAER,OAAA;EAsJG,uBAAA,CAAwB,OAAA,EAAS,2BAAA,GAA2B,OAAA;AAAA"}
|
|
@@ -82,8 +82,12 @@ var Transaction = class Transaction {
|
|
|
82
82
|
* There are two supported serialized formats:
|
|
83
83
|
* - A string returned from `Transaction#serialize`. The serialized format must be compatible, or it will throw an error.
|
|
84
84
|
* - A byte array (or base64-encoded bytes) containing BCS transaction data.
|
|
85
|
+
*
|
|
86
|
+
* When copying an in-memory transaction that uses custom intents, pass resolvers for those intents
|
|
87
|
+
* via `options.intentResolvers` so the copy can be created synchronously without first awaiting
|
|
88
|
+
* `prepareForSerialization`. Built-in intents (such as `CoinWithBalance`) are handled automatically.
|
|
85
89
|
*/
|
|
86
|
-
static from(transaction) {
|
|
90
|
+
static from(transaction, options = {}) {
|
|
87
91
|
const newTransaction = new Transaction();
|
|
88
92
|
if (isTransaction(transaction)) newTransaction.#data = TransactionDataBuilder.restore(transaction.getData());
|
|
89
93
|
else if (typeof transaction !== "string" || !transaction.startsWith("{")) newTransaction.#data = TransactionDataBuilder.fromBytes(typeof transaction === "string" ? fromBase64(transaction) : transaction);
|
|
@@ -91,8 +95,9 @@ var Transaction = class Transaction {
|
|
|
91
95
|
newTransaction.#inputSection = newTransaction.#data.inputs.slice();
|
|
92
96
|
newTransaction.#commandSection = newTransaction.#data.commands.slice();
|
|
93
97
|
newTransaction.#availableResults = new Set(newTransaction.#commandSection.map((_, i) => i));
|
|
94
|
-
|
|
95
|
-
if (newTransaction
|
|
98
|
+
const intentResolvers = new Map([[COIN_WITH_BALANCE, resolveCoinBalance], ...Object.entries(options.intentResolvers ?? {})]);
|
|
99
|
+
if (!newTransaction.isPreparedForSerialization({ supportedIntents: [...intentResolvers.keys()] })) throw new Error("Transaction has unresolved intents or async thunks. Provide resolvers for any custom intents via the `intentResolvers` option, or call `prepareForSerialization` before copying.");
|
|
100
|
+
for (const [intent, resolver] of intentResolvers) newTransaction.addIntentResolver(intent, resolver);
|
|
96
101
|
return newTransaction;
|
|
97
102
|
}
|
|
98
103
|
addSerializationPlugin(step) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.mjs","names":["#data","#inputSection","#commandSection","#availableResults","#serializationPlugins","#buildPlugins","#intentResolvers","#addInput","#pendingPromises","#added","#fork","#addCommand","result","#resolveArgument","#normalizeTransactionArgument","#prepareBuild","#runPlugins","#waitForPendingTasks","#sortCommandsAndInputs"],"sources":["../../src/transactions/Transaction.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { SerializedBcs } from '@mysten/bcs';\nimport { fromBase64, isSerializedBcs } from '@mysten/bcs';\nimport type { InferInput } from 'valibot';\nimport { is, parse } from 'valibot';\n\nimport type { SignatureWithBytes, Signer } from '../cryptography/index.js';\nimport { normalizeSuiAddress } from '../utils/sui-types.js';\nimport type { TransactionArgument } from './Commands.js';\nimport { TransactionCommands } from './Commands.js';\nimport type { CallArg, Command, Argument, ObjectRef } from './data/internal.js';\nimport {\n\tArgumentSchema,\n\tNormalizedCallArg,\n\tObjectRefSchema,\n\tTransactionExpiration,\n} from './data/internal.js';\nimport { serializeV1TransactionData } from './data/v1.js';\nimport { SerializedTransactionDataV2Schema } from './data/v2.js';\nimport { Inputs } from './Inputs.js';\nimport { needsTransactionResolution, resolveTransactionPlugin } from './resolve.js';\nimport type {\n\tBuildTransactionOptions,\n\tSerializeTransactionOptions,\n\tTransactionPlugin,\n} from './resolve.js';\nimport { createObjectMethods } from './object.js';\nimport { createPure } from './pure.js';\nimport { TransactionDataBuilder } from './TransactionData.js';\nimport { getIdFromCallArg } from './utils.js';\nimport { namedPackagesPlugin } from './plugins/NamedPackagesPlugin.js';\nimport {\n\tCOIN_WITH_BALANCE,\n\tresolveCoinBalance,\n\tcoinWithBalance,\n\tcreateBalance,\n} from './intents/CoinWithBalance.js';\nimport type { ClientWithCoreApi } from '../client/core.js';\n\nexport type TransactionObjectArgument =\n\t| Exclude<InferInput<typeof ArgumentSchema>, { Input: unknown; type?: 'pure' }>\n\t| ((\n\t\t\ttx: Transaction,\n\t ) => Exclude<InferInput<typeof ArgumentSchema>, { Input: unknown; type?: 'pure' }>)\n\t| AsyncTransactionThunk<TransactionResultArgument>;\n\nexport type TransactionResult = Extract<Argument, { Result: unknown }> &\n\tExtract<Argument, { NestedResult: unknown }>[];\n\nexport type TransactionResultArgument =\n\t| Extract<Argument, { Result: unknown }>\n\t| readonly Extract<Argument, { NestedResult: unknown }>[];\n\nexport type AsyncTransactionThunk<\n\tT extends TransactionResultArgument | void = TransactionResultArgument | void,\n> = (tx: Transaction) => Promise<T | void>;\n\nfunction createTransactionResult(\n\tindex: number | (() => number),\n\tlength = Infinity,\n): TransactionResult {\n\tconst baseResult = {\n\t\t$kind: 'Result' as const,\n\t\tget Result() {\n\t\t\treturn typeof index === 'function' ? index() : index;\n\t\t},\n\t};\n\n\tconst nestedResults: {\n\t\t$kind: 'NestedResult';\n\t\tNestedResult: [number, number];\n\t}[] = [];\n\tconst nestedResultFor = (\n\t\tresultIndex: number,\n\t): {\n\t\t$kind: 'NestedResult';\n\t\tNestedResult: [number, number];\n\t} =>\n\t\t(nestedResults[resultIndex] ??= {\n\t\t\t$kind: 'NestedResult' as const,\n\t\t\tget NestedResult() {\n\t\t\t\treturn [typeof index === 'function' ? index() : index, resultIndex] as [number, number];\n\t\t\t},\n\t\t});\n\n\treturn new Proxy(baseResult, {\n\t\tset() {\n\t\t\tthrow new Error(\n\t\t\t\t'The transaction result is a proxy, and does not support setting properties directly',\n\t\t\t);\n\t\t},\n\t\t// TODO: Instead of making this return a concrete argument, we should ideally\n\t\t// make it reference-based (so that this gets resolved at build-time), which\n\t\t// allows re-ordering transactions.\n\t\tget(target, property) {\n\t\t\t// This allows this transaction argument to be used in the singular form:\n\t\t\tif (property in target) {\n\t\t\t\treturn Reflect.get(target, property);\n\t\t\t}\n\n\t\t\t// Support destructuring:\n\t\t\tif (property === Symbol.iterator) {\n\t\t\t\treturn function* () {\n\t\t\t\t\tlet i = 0;\n\t\t\t\t\twhile (i < length) {\n\t\t\t\t\t\tyield nestedResultFor(i);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (typeof property === 'symbol') return;\n\n\t\t\tconst resultIndex = parseInt(property, 10);\n\t\t\tif (Number.isNaN(resultIndex) || resultIndex < 0) return;\n\t\t\treturn nestedResultFor(resultIndex);\n\t\t},\n\t}) as TransactionResult;\n}\n\nconst TRANSACTION_BRAND = Symbol.for('@mysten/transaction') as never;\n\ninterface SignOptions extends BuildTransactionOptions {\n\tsigner: Signer;\n}\n\nexport function isTransaction(obj: unknown): obj is TransactionLike {\n\treturn !!obj && typeof obj === 'object' && (obj as any)[TRANSACTION_BRAND] === true;\n}\n\nexport type TransactionObjectInput = string | CallArg | TransactionObjectArgument;\n\ntype InputSection = (CallArg | InputSection)[];\ntype CommandSection = (Command | CommandSection)[];\n\ntype TransactionLike = {\n\tgetData(): unknown;\n};\n\n/**\n * Transaction Builder\n */\nexport class Transaction {\n\t#serializationPlugins: TransactionPlugin[];\n\t#buildPlugins: TransactionPlugin[];\n\t#intentResolvers = new Map<string, TransactionPlugin>();\n\t#inputSection: InputSection = [];\n\t#commandSection: CommandSection = [];\n\t#availableResults: Set<number> = new Set();\n\t#pendingPromises = new Set<Promise<unknown>>();\n\t#added = new Map<(...args: any[]) => unknown, unknown>();\n\n\t/**\n\t * Converts from a serialize transaction kind (built with `build({ onlyTransactionKind: true })`) to a `Transaction` class.\n\t * Supports either a byte array, or base64-encoded bytes.\n\t */\n\tstatic fromKind(serialized: string | Uint8Array) {\n\t\tconst tx = new Transaction();\n\n\t\ttx.#data = TransactionDataBuilder.fromKindBytes(\n\t\t\ttypeof serialized === 'string' ? fromBase64(serialized) : serialized,\n\t\t);\n\n\t\ttx.#inputSection = tx.#data.inputs.slice();\n\t\ttx.#commandSection = tx.#data.commands.slice();\n\t\ttx.#availableResults = new Set(tx.#commandSection.map((_, i) => i));\n\n\t\treturn tx;\n\t}\n\n\t/**\n\t * Converts from a serialized transaction format to a `Transaction` class.\n\t * There are two supported serialized formats:\n\t * - A string returned from `Transaction#serialize`. The serialized format must be compatible, or it will throw an error.\n\t * - A byte array (or base64-encoded bytes) containing BCS transaction data.\n\t */\n\tstatic from(transaction: string | Uint8Array | TransactionLike) {\n\t\tconst newTransaction = new Transaction();\n\n\t\tif (isTransaction(transaction)) {\n\t\t\tnewTransaction.#data = TransactionDataBuilder.restore(\n\t\t\t\ttransaction.getData() as InferInput<typeof SerializedTransactionDataV2Schema>,\n\t\t\t);\n\t\t} else if (typeof transaction !== 'string' || !transaction.startsWith('{')) {\n\t\t\tnewTransaction.#data = TransactionDataBuilder.fromBytes(\n\t\t\t\ttypeof transaction === 'string' ? fromBase64(transaction) : transaction,\n\t\t\t);\n\t\t} else {\n\t\t\tnewTransaction.#data = TransactionDataBuilder.restore(JSON.parse(transaction));\n\t\t}\n\n\t\tnewTransaction.#inputSection = newTransaction.#data.inputs.slice();\n\t\tnewTransaction.#commandSection = newTransaction.#data.commands.slice();\n\t\tnewTransaction.#availableResults = new Set(newTransaction.#commandSection.map((_, i) => i));\n\n\t\tif (!newTransaction.isPreparedForSerialization({ supportedIntents: [COIN_WITH_BALANCE] })) {\n\t\t\tthrow new Error(\n\t\t\t\t'Transaction has unresolved intents or async thunks. Call `prepareForSerialization` before copying.',\n\t\t\t);\n\t\t}\n\n\t\tif (newTransaction.#data.commands.some((cmd) => cmd.$Intent?.name === COIN_WITH_BALANCE)) {\n\t\t\tnewTransaction.addIntentResolver(COIN_WITH_BALANCE, resolveCoinBalance);\n\t\t}\n\n\t\treturn newTransaction;\n\t}\n\n\taddSerializationPlugin(step: TransactionPlugin) {\n\t\tthis.#serializationPlugins.push(step);\n\t}\n\n\taddBuildPlugin(step: TransactionPlugin) {\n\t\tthis.#buildPlugins.push(step);\n\t}\n\n\taddIntentResolver(intent: string, resolver: TransactionPlugin) {\n\t\tif (this.#intentResolvers.has(intent) && this.#intentResolvers.get(intent) !== resolver) {\n\t\t\tthrow new Error(`Intent resolver for ${intent} already exists`);\n\t\t}\n\n\t\tthis.#intentResolvers.set(intent, resolver);\n\t}\n\n\tsetSender(sender: string) {\n\t\tthis.#data.sender = sender;\n\t}\n\t/**\n\t * Sets the sender only if it has not already been set.\n\t * This is useful for sponsored transaction flows where the sender may not be the same as the signer address.\n\t */\n\tsetSenderIfNotSet(sender: string) {\n\t\tif (!this.#data.sender) {\n\t\t\tthis.#data.sender = sender;\n\t\t}\n\t}\n\tsetExpiration(expiration?: InferInput<typeof TransactionExpiration> | null) {\n\t\tthis.#data.expiration = expiration ? parse(TransactionExpiration, expiration) : null;\n\t}\n\tsetGasPrice(price: number | bigint | string) {\n\t\tthis.#data.gasData.price = String(price);\n\t}\n\tsetGasBudget(budget: number | bigint | string) {\n\t\tthis.#data.gasData.budget = String(budget);\n\t}\n\n\tsetGasBudgetIfNotSet(budget: number | bigint | string) {\n\t\tif (this.#data.gasData.budget == null) {\n\t\t\tthis.#data.gasData.budget = String(budget);\n\t\t}\n\t}\n\n\tsetGasOwner(owner: string) {\n\t\tthis.#data.gasData.owner = owner;\n\t}\n\tsetGasPayment(payments: ObjectRef[]) {\n\t\tthis.#data.gasData.payment = payments.map((payment) => parse(ObjectRefSchema, payment));\n\t}\n\n\t#data: TransactionDataBuilder;\n\n\t/** Get a snapshot of the transaction data, in JSON form: */\n\tgetData() {\n\t\treturn this.#data.snapshot();\n\t}\n\n\t// Used to brand transaction classes so that they can be identified, even between multiple copies\n\t// of the builder.\n\tget [TRANSACTION_BRAND]() {\n\t\treturn true;\n\t}\n\n\t// Temporary workaround for the wallet interface accidentally serializing transactions via postMessage\n\tget pure(): ReturnType<typeof createPure<Argument>> {\n\t\tObject.defineProperty(this, 'pure', {\n\t\t\tenumerable: false,\n\t\t\tvalue: createPure<Argument>((value): Argument => {\n\t\t\t\tif (isSerializedBcs(value)) {\n\t\t\t\t\treturn this.#addInput('pure', {\n\t\t\t\t\t\t$kind: 'Pure',\n\t\t\t\t\t\tPure: {\n\t\t\t\t\t\t\tbytes: value.toBase64(),\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// TODO: we can also do some deduplication here\n\t\t\t\treturn this.#addInput(\n\t\t\t\t\t'pure',\n\t\t\t\t\tis(NormalizedCallArg, value)\n\t\t\t\t\t\t? parse(NormalizedCallArg, value)\n\t\t\t\t\t\t: value instanceof Uint8Array\n\t\t\t\t\t\t\t? Inputs.Pure(value)\n\t\t\t\t\t\t\t: { $kind: 'UnresolvedPure', UnresolvedPure: { value } },\n\t\t\t\t);\n\t\t\t}),\n\t\t});\n\n\t\treturn this.pure;\n\t}\n\n\tconstructor() {\n\t\tthis.#data = new TransactionDataBuilder();\n\t\tthis.#buildPlugins = [];\n\t\tthis.#serializationPlugins = [];\n\t}\n\n\t/** Returns an argument for the gas coin, to be used in a transaction. */\n\tget gas() {\n\t\treturn { $kind: 'GasCoin' as const, GasCoin: true as const };\n\t}\n\n\t/**\n\t * Creates a coin of the specified type and balance.\n\t * Sourced from address balance when available, falling back to owned coins.\n\t */\n\tcoin({\n\t\ttype,\n\t\tbalance,\n\t\tuseGasCoin,\n\t}: {\n\t\tbalance: bigint | number;\n\t\ttype?: string;\n\t\tuseGasCoin?: boolean;\n\t}): TransactionResult {\n\t\treturn this.add(coinWithBalance({ type, balance, useGasCoin }));\n\t}\n\n\t/**\n\t * Creates a Balance object of the specified type and balance.\n\t * Sourced from address balance when available, falling back to owned coins.\n\t */\n\tbalance({\n\t\ttype,\n\t\tbalance,\n\t\tuseGasCoin,\n\t}: {\n\t\tbalance: bigint | number;\n\t\ttype?: string;\n\t\tuseGasCoin?: boolean;\n\t}): TransactionResult {\n\t\treturn this.add(createBalance({ type, balance, useGasCoin }));\n\t}\n\n\t/**\n\t * Add a new object input to the transaction.\n\t */\n\tobject: ReturnType<\n\t\ttypeof createObjectMethods<{ $kind: 'Input'; Input: number; type?: 'object' }>\n\t> = createObjectMethods(\n\t\t(value: TransactionObjectInput): { $kind: 'Input'; Input: number; type?: 'object' } => {\n\t\t\tif (typeof value === 'function') {\n\t\t\t\treturn this.object(this.add(value as (tx: Transaction) => TransactionObjectArgument));\n\t\t\t}\n\n\t\t\tif (typeof value === 'object' && is(ArgumentSchema, value)) {\n\t\t\t\treturn value as { $kind: 'Input'; Input: number; type?: 'object' };\n\t\t\t}\n\n\t\t\tconst id = getIdFromCallArg(value);\n\n\t\t\tconst inserted = this.#data.inputs.find((i) => id === getIdFromCallArg(i));\n\n\t\t\t// Upgrade shared object inputs to mutable if needed:\n\t\t\tif (\n\t\t\t\tinserted?.Object?.SharedObject &&\n\t\t\t\ttypeof value === 'object' &&\n\t\t\t\tvalue.Object?.SharedObject\n\t\t\t) {\n\t\t\t\tinserted.Object.SharedObject.mutable =\n\t\t\t\t\tinserted.Object.SharedObject.mutable || value.Object.SharedObject.mutable;\n\t\t\t}\n\n\t\t\treturn inserted\n\t\t\t\t? { $kind: 'Input', Input: this.#data.inputs.indexOf(inserted), type: 'object' }\n\t\t\t\t: this.#addInput(\n\t\t\t\t\t\t'object',\n\t\t\t\t\t\ttypeof value === 'string'\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t$kind: 'UnresolvedObject',\n\t\t\t\t\t\t\t\t\tUnresolvedObject: { objectId: normalizeSuiAddress(value) },\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: value,\n\t\t\t\t\t);\n\t\t},\n\t);\n\n\t/**\n\t * Add a new object input to the transaction using the fully-resolved object reference.\n\t * If you only have an object ID, use `builder.object(id)` instead.\n\t */\n\tobjectRef(...args: Parameters<(typeof Inputs)['ObjectRef']>) {\n\t\treturn this.object(Inputs.ObjectRef(...args));\n\t}\n\n\t/**\n\t * Add a new receiving input to the transaction using the fully-resolved object reference.\n\t * If you only have an object ID, use `builder.object(id)` instead.\n\t */\n\treceivingRef(...args: Parameters<(typeof Inputs)['ReceivingRef']>) {\n\t\treturn this.object(Inputs.ReceivingRef(...args));\n\t}\n\n\t/**\n\t * Add a new shared object input to the transaction using the fully-resolved shared object reference.\n\t * If you only have an object ID, use `builder.object(id)` instead.\n\t */\n\tsharedObjectRef(...args: Parameters<(typeof Inputs)['SharedObjectRef']>) {\n\t\treturn this.object(Inputs.SharedObjectRef(...args));\n\t}\n\n\t#fork() {\n\t\tconst fork = new Transaction();\n\n\t\tfork.#data = this.#data;\n\t\tfork.#serializationPlugins = this.#serializationPlugins;\n\t\tfork.#buildPlugins = this.#buildPlugins;\n\t\tfork.#intentResolvers = this.#intentResolvers;\n\t\tfork.#pendingPromises = this.#pendingPromises;\n\t\tfork.#availableResults = new Set(this.#availableResults);\n\t\tfork.#added = this.#added;\n\t\tthis.#inputSection.push(fork.#inputSection);\n\t\tthis.#commandSection.push(fork.#commandSection);\n\n\t\treturn fork;\n\t}\n\n\t/** Add a transaction to the transaction */\n\n\tadd<T extends Command>(command: T): TransactionResult;\n\tadd<T extends void | TransactionResultArgument | TransactionArgument | Command>(\n\t\tthunk: (tx: Transaction) => T,\n\t): T;\n\tadd<T extends TransactionResultArgument | void>(\n\t\tasyncTransactionThunk: AsyncTransactionThunk<T>,\n\t): T;\n\tadd(command: Command | AsyncTransactionThunk | ((tx: Transaction) => unknown)): unknown {\n\t\tif (typeof command === 'function') {\n\t\t\tif (this.#added.has(command)) {\n\t\t\t\treturn this.#added.get(command);\n\t\t\t}\n\n\t\t\tconst fork = this.#fork();\n\t\t\tconst result = command(fork);\n\n\t\t\tif (!(result && typeof result === 'object' && 'then' in result)) {\n\t\t\t\tthis.#availableResults = fork.#availableResults;\n\t\t\t\tthis.#added.set(command, result);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tconst placeholder = this.#addCommand({\n\t\t\t\t$kind: '$Intent',\n\t\t\t\t$Intent: {\n\t\t\t\t\tname: 'AsyncTransactionThunk',\n\t\t\t\t\tinputs: {},\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tresultIndex: this.#data.commands.length,\n\t\t\t\t\t\tresult: null as TransactionResult | null,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tthis.#pendingPromises.add(\n\t\t\t\tPromise.resolve(result as Promise<TransactionResult>).then((result) => {\n\t\t\t\t\tplaceholder.$Intent.data.result = result;\n\t\t\t\t}),\n\t\t\t);\n\t\t\tconst txResult = createTransactionResult(() => placeholder.$Intent.data.resultIndex);\n\t\t\tthis.#added.set(command, txResult);\n\t\t\treturn txResult;\n\t\t} else {\n\t\t\tthis.#addCommand(command);\n\t\t}\n\n\t\treturn createTransactionResult(this.#data.commands.length - 1);\n\t}\n\n\t#addCommand<T extends Command>(command: T) {\n\t\tconst resultIndex = this.#data.commands.length;\n\t\tthis.#commandSection.push(command);\n\t\tthis.#availableResults.add(resultIndex);\n\t\tthis.#data.commands.push(command);\n\n\t\tthis.#data.mapCommandArguments(resultIndex, (arg) => {\n\t\t\tif (arg.$kind === 'Result' && !this.#availableResults.has(arg.Result)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Result { Result: ${arg.Result} } is not available to use in the current transaction`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (arg.$kind === 'NestedResult' && !this.#availableResults.has(arg.NestedResult[0])) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Result { NestedResult: [${arg.NestedResult[0]}, ${arg.NestedResult[1]}] } is not available to use in the current transaction`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (arg.$kind === 'Input' && arg.Input >= this.#data.inputs.length) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Input { Input: ${arg.Input} } references an input that does not exist in the current transaction`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn arg;\n\t\t});\n\n\t\treturn command;\n\t}\n\n\t#addInput<T extends 'pure' | 'object'>(type: T, input: CallArg) {\n\t\tthis.#inputSection.push(input);\n\t\treturn this.#data.addInput(type, input);\n\t}\n\n\t#normalizeTransactionArgument(arg: TransactionArgument | SerializedBcs<any>) {\n\t\tif (isSerializedBcs(arg)) {\n\t\t\treturn this.pure(arg);\n\t\t}\n\n\t\treturn this.#resolveArgument(arg as TransactionArgument);\n\t}\n\n\t#resolveArgument(arg: TransactionArgument): Argument {\n\t\tif (typeof arg === 'function') {\n\t\t\tconst resolved = this.add(arg as never);\n\n\t\t\tif (typeof resolved === 'function') {\n\t\t\t\treturn this.#resolveArgument(resolved);\n\t\t\t}\n\n\t\t\treturn parse(ArgumentSchema, resolved);\n\t\t}\n\n\t\treturn parse(ArgumentSchema, arg);\n\t}\n\n\t// Method shorthands:\n\n\tsplitCoins<\n\t\tconst Amounts extends (TransactionArgument | SerializedBcs<any> | number | string | bigint)[],\n\t>(coin: TransactionObjectArgument | string, amounts: Amounts) {\n\t\tconst command = TransactionCommands.SplitCoins(\n\t\t\ttypeof coin === 'string' ? this.object(coin) : this.#resolveArgument(coin),\n\t\t\tamounts.map((amount) =>\n\t\t\t\ttypeof amount === 'number' || typeof amount === 'bigint' || typeof amount === 'string'\n\t\t\t\t\t? this.pure.u64(amount)\n\t\t\t\t\t: this.#normalizeTransactionArgument(amount),\n\t\t\t),\n\t\t);\n\t\tthis.#addCommand(command);\n\t\treturn createTransactionResult(this.#data.commands.length - 1, amounts.length) as Extract<\n\t\t\tArgument,\n\t\t\t{ Result: unknown }\n\t\t> & {\n\t\t\t[K in keyof Amounts]: Extract<Argument, { NestedResult: unknown }>;\n\t\t};\n\t}\n\tmergeCoins(\n\t\tdestination: TransactionObjectArgument | string,\n\t\tsources: (TransactionObjectArgument | string)[],\n\t) {\n\t\treturn this.add(\n\t\t\tTransactionCommands.MergeCoins(\n\t\t\t\tthis.object(destination),\n\t\t\t\tsources.map((src) => this.object(src)),\n\t\t\t),\n\t\t);\n\t}\n\tpublish({ modules, dependencies }: { modules: number[][] | string[]; dependencies: string[] }) {\n\t\treturn this.add(\n\t\t\tTransactionCommands.Publish({\n\t\t\t\tmodules,\n\t\t\t\tdependencies,\n\t\t\t}),\n\t\t);\n\t}\n\tupgrade({\n\t\tmodules,\n\t\tdependencies,\n\t\tpackage: packageId,\n\t\tticket,\n\t}: {\n\t\tmodules: number[][] | string[];\n\t\tdependencies: string[];\n\t\tpackage: string;\n\t\tticket: TransactionObjectArgument | string;\n\t}) {\n\t\treturn this.add(\n\t\t\tTransactionCommands.Upgrade({\n\t\t\t\tmodules,\n\t\t\t\tdependencies,\n\t\t\t\tpackage: packageId,\n\t\t\t\tticket: this.object(ticket),\n\t\t\t}),\n\t\t);\n\t}\n\tmoveCall({\n\t\targuments: args,\n\t\t...input\n\t}:\n\t\t| {\n\t\t\t\tpackage: string;\n\t\t\t\tmodule: string;\n\t\t\t\tfunction: string;\n\t\t\t\targuments?: (TransactionArgument | SerializedBcs<any>)[];\n\t\t\t\ttypeArguments?: string[];\n\t\t }\n\t\t| {\n\t\t\t\ttarget: string;\n\t\t\t\targuments?: (TransactionArgument | SerializedBcs<any>)[];\n\t\t\t\ttypeArguments?: string[];\n\t\t }) {\n\t\treturn this.add(\n\t\t\tTransactionCommands.MoveCall({\n\t\t\t\t...input,\n\t\t\t\targuments: args?.map((arg) => this.#normalizeTransactionArgument(arg)),\n\t\t\t} as Parameters<typeof TransactionCommands.MoveCall>[0]),\n\t\t);\n\t}\n\ttransferObjects(\n\t\tobjects: (TransactionObjectArgument | string)[],\n\t\taddress: TransactionArgument | SerializedBcs<any> | string,\n\t) {\n\t\treturn this.add(\n\t\t\tTransactionCommands.TransferObjects(\n\t\t\t\tobjects.map((obj) => this.object(obj)),\n\t\t\t\ttypeof address === 'string'\n\t\t\t\t\t? this.pure.address(address)\n\t\t\t\t\t: this.#normalizeTransactionArgument(address),\n\t\t\t),\n\t\t);\n\t}\n\tmakeMoveVec({\n\t\ttype,\n\t\telements,\n\t}: {\n\t\telements: (TransactionObjectArgument | string)[];\n\t\ttype?: string;\n\t}) {\n\t\treturn this.add(\n\t\t\tTransactionCommands.MakeMoveVec({\n\t\t\t\ttype,\n\t\t\t\telements: elements.map((obj) => this.object(obj)),\n\t\t\t}),\n\t\t);\n\t}\n\n\t/**\n\t * Create a FundsWithdrawal input for withdrawing Balance<T> from an address balance accumulator.\n\t * This is used for gas payments from address balances.\n\t *\n\t * @param options.amount - The Amount to withdraw (u64).\n\t * @param options.type - The balance type (e.g., \"0x2::sui::SUI\"). Defaults to SUI.\n\t */\n\twithdrawal({ amount, type }: { amount: number | bigint | string; type?: string | null }): {\n\t\t$kind: 'Input';\n\t\tInput: number;\n\t\ttype?: 'object';\n\t} {\n\t\tconst input: CallArg = {\n\t\t\t$kind: 'FundsWithdrawal',\n\t\t\tFundsWithdrawal: {\n\t\t\t\t// TODO: support entire balance withdrawals once supported\n\t\t\t\treservation: { $kind: 'MaxAmountU64', MaxAmountU64: String(amount) },\n\t\t\t\ttypeArg: { $kind: 'Balance', Balance: type ?? '0x2::sui::SUI' },\n\t\t\t\twithdrawFrom:\n\t\t\t\t\t// fromSponsor === true\n\t\t\t\t\t// \t? { $kind: 'Sponsor', Sponsor: true } :\n\t\t\t\t\t// TODO: currently only supporting withdrawals from sender\n\t\t\t\t\t{ $kind: 'Sender', Sender: true },\n\t\t\t},\n\t\t};\n\n\t\treturn this.#addInput('object', input);\n\t}\n\n\t/**\n\t * @deprecated Use toJSON instead.\n\t * For synchronous serialization, you can use `getData()`\n\t * */\n\tserialize() {\n\t\treturn JSON.stringify(serializeV1TransactionData(this.#data.snapshot()));\n\t}\n\n\tasync toJSON(options: SerializeTransactionOptions = {}): Promise<string> {\n\t\tawait this.prepareForSerialization(options);\n\t\tconst fullyResolved = this.isFullyResolved();\n\t\treturn JSON.stringify(\n\t\t\tparse(\n\t\t\t\tSerializedTransactionDataV2Schema,\n\t\t\t\tfullyResolved\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...this.#data.snapshot(),\n\t\t\t\t\t\t\tdigest: this.#data.getDigest(),\n\t\t\t\t\t\t}\n\t\t\t\t\t: this.#data.snapshot(),\n\t\t\t),\n\t\t\t(_key, value) => (typeof value === 'bigint' ? value.toString() : value),\n\t\t\t2,\n\t\t);\n\t}\n\n\t/** Build the transaction to BCS bytes, and sign it with the provided keypair. */\n\tasync sign(options: SignOptions): Promise<SignatureWithBytes> {\n\t\tconst { signer, ...buildOptions } = options;\n\t\tconst bytes = await this.build(buildOptions);\n\t\treturn signer.signTransaction(bytes);\n\t}\n\n\t/**\n\t * Checks if the transaction is prepared for serialization to JSON.\n\t * This means:\n\t * - All async thunks have been fully resolved\n\t * - All transaction intents have been resolved (unless in supportedIntents)\n\t *\n\t * Unlike `isFullyResolved()`, this does not require the sender, gas payment,\n\t * budget, or object versions to be set.\n\t */\n\tisPreparedForSerialization(options: { supportedIntents?: string[] } = {}) {\n\t\tif (this.#pendingPromises.size > 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (\n\t\t\tthis.#data.commands.some(\n\t\t\t\t(cmd) => cmd.$Intent && !options.supportedIntents?.includes(cmd.$Intent.name),\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Ensures that:\n\t * - All objects have been fully resolved to a specific version\n\t * - All pure inputs have been serialized to bytes\n\t * - All async thunks have been fully resolved\n\t * - All transaction intents have been resolved\n\t * \t- The gas payment, budget, and price have been set\n\t * - The transaction sender has been set\n\t *\n\t * When true, the transaction will always be built to the same bytes and digest (unless the transaction is mutated)\n\t */\n\tisFullyResolved() {\n\t\tif (!this.isPreparedForSerialization()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!this.#data.sender) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (needsTransactionResolution(this.#data, {})) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/** Build the transaction to BCS bytes. */\n\tasync build(options: BuildTransactionOptions = {}): Promise<Uint8Array<ArrayBuffer>> {\n\t\tawait this.prepareForSerialization(options);\n\t\tawait this.#prepareBuild(options);\n\t\treturn this.#data.build({\n\t\t\tonlyTransactionKind: options.onlyTransactionKind,\n\t\t});\n\t}\n\n\t/** Derive transaction digest */\n\tasync getDigest(\n\t\toptions: {\n\t\t\tclient?: ClientWithCoreApi;\n\t\t} = {},\n\t): Promise<string> {\n\t\tawait this.prepareForSerialization(options);\n\t\tawait this.#prepareBuild(options);\n\t\treturn this.#data.getDigest();\n\t}\n\n\t/**\n\t * Prepare the transaction by validating the transaction data and resolving all inputs\n\t * so that it can be built into bytes.\n\t */\n\tasync #prepareBuild(options: BuildTransactionOptions) {\n\t\tif (!options.onlyTransactionKind && !this.#data.sender) {\n\t\t\tthrow new Error('Missing transaction sender');\n\t\t}\n\n\t\tawait this.#runPlugins([...this.#buildPlugins, resolveTransactionPlugin], options);\n\t}\n\n\tasync #runPlugins(plugins: TransactionPlugin[], options: SerializeTransactionOptions) {\n\t\ttry {\n\t\t\tconst createNext = (i: number) => {\n\t\t\t\tif (i >= plugins.length) {\n\t\t\t\t\treturn () => {};\n\t\t\t\t}\n\t\t\t\tconst plugin = plugins[i];\n\n\t\t\t\treturn async () => {\n\t\t\t\t\tconst next = createNext(i + 1);\n\t\t\t\t\tlet calledNext = false;\n\t\t\t\t\tlet nextResolved = false;\n\n\t\t\t\t\tawait plugin(this.#data, options, async () => {\n\t\t\t\t\t\tif (calledNext) {\n\t\t\t\t\t\t\tthrow new Error(`next() was call multiple times in TransactionPlugin ${i}`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcalledNext = true;\n\n\t\t\t\t\t\tawait next();\n\n\t\t\t\t\t\tnextResolved = true;\n\t\t\t\t\t});\n\n\t\t\t\t\tif (!calledNext) {\n\t\t\t\t\t\tthrow new Error(`next() was not called in TransactionPlugin ${i}`);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!nextResolved) {\n\t\t\t\t\t\tthrow new Error(`next() was not awaited in TransactionPlugin ${i}`);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t\tawait createNext(0)();\n\t\t} finally {\n\t\t\tthis.#inputSection = this.#data.inputs.slice();\n\t\t\tthis.#commandSection = this.#data.commands.slice();\n\t\t\tthis.#availableResults = new Set(this.#commandSection.map((_, i) => i));\n\t\t}\n\t}\n\n\tasync #waitForPendingTasks() {\n\t\twhile (this.#pendingPromises.size > 0) {\n\t\t\tconst newPromise = Promise.all(this.#pendingPromises);\n\t\t\tthis.#pendingPromises.clear();\n\t\t\tthis.#pendingPromises.add(newPromise);\n\t\t\tawait newPromise;\n\t\t\tthis.#pendingPromises.delete(newPromise);\n\t\t}\n\t}\n\n\t#sortCommandsAndInputs() {\n\t\tconst unorderedCommands = this.#data.commands;\n\t\tconst unorderedInputs = this.#data.inputs;\n\n\t\tconst orderedCommands = (this.#commandSection as Command[]).flat(Infinity);\n\t\tconst orderedInputs = (this.#inputSection as CallArg[]).flat(Infinity);\n\n\t\tif (orderedCommands.length !== unorderedCommands.length) {\n\t\t\tthrow new Error('Unexpected number of commands found in transaction data');\n\t\t}\n\n\t\tif (orderedInputs.length !== unorderedInputs.length) {\n\t\t\tthrow new Error('Unexpected number of inputs found in transaction data');\n\t\t}\n\n\t\tconst filteredCommands = orderedCommands.filter(\n\t\t\t(cmd) => cmd.$Intent?.name !== 'AsyncTransactionThunk',\n\t\t);\n\n\t\tthis.#data.commands = filteredCommands;\n\t\tthis.#data.inputs = orderedInputs;\n\t\tthis.#commandSection = filteredCommands;\n\t\tthis.#inputSection = orderedInputs;\n\t\tthis.#availableResults = new Set(filteredCommands.map((_, i) => i));\n\n\t\tfunction getOriginalIndex(index: number): number {\n\t\t\tconst command = unorderedCommands[index];\n\t\t\tif (command.$Intent?.name === 'AsyncTransactionThunk') {\n\t\t\t\tconst result = command.$Intent.data.result as TransactionResult | null;\n\n\t\t\t\tif (result == null) {\n\t\t\t\t\tthrow new Error('AsyncTransactionThunk has not been resolved');\n\t\t\t\t}\n\n\t\t\t\treturn getOriginalIndex(result.Result);\n\t\t\t}\n\n\t\t\tconst updated = filteredCommands.indexOf(command);\n\n\t\t\tif (updated === -1) {\n\t\t\t\tthrow new Error('Unable to find original index for command');\n\t\t\t}\n\n\t\t\treturn updated;\n\t\t}\n\n\t\tthis.#data.mapArguments((arg) => {\n\t\t\tif (arg.$kind === 'Input') {\n\t\t\t\tconst updated = orderedInputs.indexOf(unorderedInputs[arg.Input]);\n\n\t\t\t\tif (updated === -1) {\n\t\t\t\t\tthrow new Error('Input has not been resolved');\n\t\t\t\t}\n\n\t\t\t\treturn { ...arg, Input: updated };\n\t\t\t} else if (arg.$kind === 'Result') {\n\t\t\t\tconst updated = getOriginalIndex(arg.Result);\n\n\t\t\t\treturn { ...arg, Result: updated };\n\t\t\t} else if (arg.$kind === 'NestedResult') {\n\t\t\t\tconst updated = getOriginalIndex(arg.NestedResult[0]);\n\n\t\t\t\treturn { ...arg, NestedResult: [updated, arg.NestedResult[1]] };\n\t\t\t}\n\n\t\t\treturn arg;\n\t\t});\n\n\t\tfor (const [i, cmd] of unorderedCommands.entries()) {\n\t\t\tif (cmd.$Intent?.name === 'AsyncTransactionThunk') {\n\t\t\t\ttry {\n\t\t\t\t\tcmd.$Intent.data.resultIndex = getOriginalIndex(i);\n\t\t\t\t} catch {\n\t\t\t\t\t// If async thunk did not return a result, this will error, but is safe to ignore\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tasync prepareForSerialization(options: SerializeTransactionOptions) {\n\t\tawait this.#waitForPendingTasks();\n\t\tthis.#sortCommandsAndInputs();\n\t\tconst intents = new Set<string>();\n\t\tfor (const command of this.#data.commands) {\n\t\t\tif (command.$Intent) {\n\t\t\t\tintents.add(command.$Intent.name);\n\t\t\t}\n\t\t}\n\n\t\tconst steps = [...this.#serializationPlugins];\n\n\t\tfor (const intent of intents) {\n\t\t\tif (options.supportedIntents?.includes(intent)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!this.#intentResolvers.has(intent)) {\n\t\t\t\tthrow new Error(`Missing intent resolver for ${intent}`);\n\t\t\t}\n\n\t\t\tsteps.push(this.#intentResolvers.get(intent)!);\n\t\t}\n\n\t\tsteps.push(namedPackagesPlugin());\n\n\t\tawait this.#runPlugins(steps, options);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA2DA,SAAS,wBACR,OACA,SAAS,UACW;CACpB,MAAM,aAAa;EAClB,OAAO;EACP,IAAI,SAAS;AACZ,UAAO,OAAO,UAAU,aAAa,OAAO,GAAG;;EAEhD;CAED,MAAM,gBAGA,EAAE;CACR,MAAM,mBACL,gBAKC,cAAc,iBAAiB;EAC/B,OAAO;EACP,IAAI,eAAe;AAClB,UAAO,CAAC,OAAO,UAAU,aAAa,OAAO,GAAG,OAAO,YAAY;;EAEpE;AAEF,QAAO,IAAI,MAAM,YAAY;EAC5B,MAAM;AACL,SAAM,IAAI,MACT,sFACA;;EAKF,IAAI,QAAQ,UAAU;AAErB,OAAI,YAAY,OACf,QAAO,QAAQ,IAAI,QAAQ,SAAS;AAIrC,OAAI,aAAa,OAAO,SACvB,QAAO,aAAa;IACnB,IAAI,IAAI;AACR,WAAO,IAAI,QAAQ;AAClB,WAAM,gBAAgB,EAAE;AACxB;;;AAKH,OAAI,OAAO,aAAa,SAAU;GAElC,MAAM,cAAc,SAAS,UAAU,GAAG;AAC1C,OAAI,OAAO,MAAM,YAAY,IAAI,cAAc,EAAG;AAClD,UAAO,gBAAgB,YAAY;;EAEpC,CAAC;;AAGH,MAAM,oBAAoB,OAAO,IAAI,sBAAsB;AAM3D,SAAgB,cAAc,KAAsC;AACnE,QAAO,CAAC,CAAC,OAAO,OAAO,QAAQ,YAAa,IAAY,uBAAuB;;;;;AAehF,IAAa,cAAb,MAAa,YAAY;CACxB;CACA;CACA,mC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AAM,8BAA8B;AAG/C,WAAO;KAAE,GAAG;KAAK,OAAO;KAAS;cACvB,IAAI,UAAU,UAAU;IAClC,MAAM,UAAU,iBAAiB,IAAI,OAAO;AAE5C,WAAO;KAAE,GAAG;KAAK,QAAQ;KAAS;cACxB,IAAI,UAAU,gBAAgB;IACxC,MAAM,UAAU,iBAAiB,IAAI,aAAa,GAAG;AAErD,WAAO;KAAE,GAAG;KAAK,cAAc,CAAC,SAAS,IAAI,aAAa,GAAG;KAAE;;AAGhE,UAAO;IACN;AAEF,OAAK,MAAM,CAAC,GAAG,QAAQ,kBAAkB,SAAS,CACjD,KAAI,IAAI,SAAS,SAAS,wBACzB,KAAI;AACH,OAAI,QAAQ,KAAK,cAAc,iBAAiB,EAAE;UAC3C;;CAOX,MAAM,wBAAwB,SAAsC;AACnE,QAAM,MAAKiB,qBAAsB;AACjC,QAAKC,uBAAwB;EAC7B,MAAM,0BAAU,IAAI,KAAa;AACjC,OAAK,MAAM,WAAW,MAAKlB,KAAM,SAChC,KAAI,QAAQ,QACX,SAAQ,IAAI,QAAQ,QAAQ,KAAK;EAInC,MAAM,QAAQ,CAAC,GAAG,MAAKI,qBAAsB;AAE7C,OAAK,MAAM,UAAU,SAAS;AAC7B,OAAI,QAAQ,kBAAkB,SAAS,OAAO,CAC7C;AAGD,OAAI,CAAC,MAAKE,gBAAiB,IAAI,OAAO,CACrC,OAAM,IAAI,MAAM,+BAA+B,SAAS;AAGzD,SAAM,KAAK,MAAKA,gBAAiB,IAAI,OAAO,CAAE;;AAG/C,QAAM,KAAK,qBAAqB,CAAC;AAEjC,QAAM,MAAKU,WAAY,OAAO,QAAQ"}
|
|
1
|
+
{"version":3,"file":"Transaction.mjs","names":["#data","#inputSection","#commandSection","#availableResults","#serializationPlugins","#buildPlugins","#intentResolvers","#addInput","#pendingPromises","#added","#fork","#addCommand","result","#resolveArgument","#normalizeTransactionArgument","#prepareBuild","#runPlugins","#waitForPendingTasks","#sortCommandsAndInputs"],"sources":["../../src/transactions/Transaction.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { SerializedBcs } from '@mysten/bcs';\nimport { fromBase64, isSerializedBcs } from '@mysten/bcs';\nimport type { InferInput } from 'valibot';\nimport { is, parse } from 'valibot';\n\nimport type { SignatureWithBytes, Signer } from '../cryptography/index.js';\nimport { normalizeSuiAddress } from '../utils/sui-types.js';\nimport type { TransactionArgument } from './Commands.js';\nimport { TransactionCommands } from './Commands.js';\nimport type { CallArg, Command, Argument, ObjectRef } from './data/internal.js';\nimport {\n\tArgumentSchema,\n\tNormalizedCallArg,\n\tObjectRefSchema,\n\tTransactionExpiration,\n} from './data/internal.js';\nimport { serializeV1TransactionData } from './data/v1.js';\nimport { SerializedTransactionDataV2Schema } from './data/v2.js';\nimport { Inputs } from './Inputs.js';\nimport { needsTransactionResolution, resolveTransactionPlugin } from './resolve.js';\nimport type {\n\tBuildTransactionOptions,\n\tSerializeTransactionOptions,\n\tTransactionPlugin,\n} from './resolve.js';\nimport { createObjectMethods } from './object.js';\nimport { createPure } from './pure.js';\nimport { TransactionDataBuilder } from './TransactionData.js';\nimport { getIdFromCallArg } from './utils.js';\nimport { namedPackagesPlugin } from './plugins/NamedPackagesPlugin.js';\nimport {\n\tCOIN_WITH_BALANCE,\n\tresolveCoinBalance,\n\tcoinWithBalance,\n\tcreateBalance,\n} from './intents/CoinWithBalance.js';\nimport type { ClientWithCoreApi } from '../client/core.js';\n\nexport type TransactionObjectArgument =\n\t| Exclude<InferInput<typeof ArgumentSchema>, { Input: unknown; type?: 'pure' }>\n\t| ((\n\t\t\ttx: Transaction,\n\t ) => Exclude<InferInput<typeof ArgumentSchema>, { Input: unknown; type?: 'pure' }>)\n\t| AsyncTransactionThunk<TransactionResultArgument>;\n\nexport type TransactionResult = Extract<Argument, { Result: unknown }> &\n\tExtract<Argument, { NestedResult: unknown }>[];\n\nexport type TransactionResultArgument =\n\t| Extract<Argument, { Result: unknown }>\n\t| readonly Extract<Argument, { NestedResult: unknown }>[];\n\nexport type AsyncTransactionThunk<\n\tT extends TransactionResultArgument | void = TransactionResultArgument | void,\n> = (tx: Transaction) => Promise<T | void>;\n\nfunction createTransactionResult(\n\tindex: number | (() => number),\n\tlength = Infinity,\n): TransactionResult {\n\tconst baseResult = {\n\t\t$kind: 'Result' as const,\n\t\tget Result() {\n\t\t\treturn typeof index === 'function' ? index() : index;\n\t\t},\n\t};\n\n\tconst nestedResults: {\n\t\t$kind: 'NestedResult';\n\t\tNestedResult: [number, number];\n\t}[] = [];\n\tconst nestedResultFor = (\n\t\tresultIndex: number,\n\t): {\n\t\t$kind: 'NestedResult';\n\t\tNestedResult: [number, number];\n\t} =>\n\t\t(nestedResults[resultIndex] ??= {\n\t\t\t$kind: 'NestedResult' as const,\n\t\t\tget NestedResult() {\n\t\t\t\treturn [typeof index === 'function' ? index() : index, resultIndex] as [number, number];\n\t\t\t},\n\t\t});\n\n\treturn new Proxy(baseResult, {\n\t\tset() {\n\t\t\tthrow new Error(\n\t\t\t\t'The transaction result is a proxy, and does not support setting properties directly',\n\t\t\t);\n\t\t},\n\t\t// TODO: Instead of making this return a concrete argument, we should ideally\n\t\t// make it reference-based (so that this gets resolved at build-time), which\n\t\t// allows re-ordering transactions.\n\t\tget(target, property) {\n\t\t\t// This allows this transaction argument to be used in the singular form:\n\t\t\tif (property in target) {\n\t\t\t\treturn Reflect.get(target, property);\n\t\t\t}\n\n\t\t\t// Support destructuring:\n\t\t\tif (property === Symbol.iterator) {\n\t\t\t\treturn function* () {\n\t\t\t\t\tlet i = 0;\n\t\t\t\t\twhile (i < length) {\n\t\t\t\t\t\tyield nestedResultFor(i);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (typeof property === 'symbol') return;\n\n\t\t\tconst resultIndex = parseInt(property, 10);\n\t\t\tif (Number.isNaN(resultIndex) || resultIndex < 0) return;\n\t\t\treturn nestedResultFor(resultIndex);\n\t\t},\n\t}) as TransactionResult;\n}\n\nconst TRANSACTION_BRAND = Symbol.for('@mysten/transaction') as never;\n\ninterface SignOptions extends BuildTransactionOptions {\n\tsigner: Signer;\n}\n\nexport function isTransaction(obj: unknown): obj is TransactionLike {\n\treturn !!obj && typeof obj === 'object' && (obj as any)[TRANSACTION_BRAND] === true;\n}\n\nexport type TransactionObjectInput = string | CallArg | TransactionObjectArgument;\n\ntype InputSection = (CallArg | InputSection)[];\ntype CommandSection = (Command | CommandSection)[];\n\ntype TransactionLike = {\n\tgetData(): unknown;\n};\n\nexport interface TransactionCopyOptions {\n\t/**\n\t * A map of intent names to resolvers for any custom intents used in the transaction being copied.\n\t *\n\t * Built-in intents (such as `CoinWithBalance`) are handled automatically. Providing resolvers for\n\t * custom intents lets `Transaction.from` copy a transaction synchronously even when it still\n\t * contains unresolved intents, without first awaiting `prepareForSerialization`.\n\t */\n\tintentResolvers?: Record<string, TransactionPlugin>;\n}\n\n/**\n * Transaction Builder\n */\nexport class Transaction {\n\t#serializationPlugins: TransactionPlugin[];\n\t#buildPlugins: TransactionPlugin[];\n\t#intentResolvers = new Map<string, TransactionPlugin>();\n\t#inputSection: InputSection = [];\n\t#commandSection: CommandSection = [];\n\t#availableResults: Set<number> = new Set();\n\t#pendingPromises = new Set<Promise<unknown>>();\n\t#added = new Map<(...args: any[]) => unknown, unknown>();\n\n\t/**\n\t * Converts from a serialize transaction kind (built with `build({ onlyTransactionKind: true })`) to a `Transaction` class.\n\t * Supports either a byte array, or base64-encoded bytes.\n\t */\n\tstatic fromKind(serialized: string | Uint8Array) {\n\t\tconst tx = new Transaction();\n\n\t\ttx.#data = TransactionDataBuilder.fromKindBytes(\n\t\t\ttypeof serialized === 'string' ? fromBase64(serialized) : serialized,\n\t\t);\n\n\t\ttx.#inputSection = tx.#data.inputs.slice();\n\t\ttx.#commandSection = tx.#data.commands.slice();\n\t\ttx.#availableResults = new Set(tx.#commandSection.map((_, i) => i));\n\n\t\treturn tx;\n\t}\n\n\t/**\n\t * Converts from a serialized transaction format to a `Transaction` class.\n\t * There are two supported serialized formats:\n\t * - A string returned from `Transaction#serialize`. The serialized format must be compatible, or it will throw an error.\n\t * - A byte array (or base64-encoded bytes) containing BCS transaction data.\n\t *\n\t * When copying an in-memory transaction that uses custom intents, pass resolvers for those intents\n\t * via `options.intentResolvers` so the copy can be created synchronously without first awaiting\n\t * `prepareForSerialization`. Built-in intents (such as `CoinWithBalance`) are handled automatically.\n\t */\n\tstatic from(\n\t\ttransaction: string | Uint8Array | TransactionLike,\n\t\toptions: TransactionCopyOptions = {},\n\t) {\n\t\tconst newTransaction = new Transaction();\n\n\t\tif (isTransaction(transaction)) {\n\t\t\tnewTransaction.#data = TransactionDataBuilder.restore(\n\t\t\t\ttransaction.getData() as InferInput<typeof SerializedTransactionDataV2Schema>,\n\t\t\t);\n\t\t} else if (typeof transaction !== 'string' || !transaction.startsWith('{')) {\n\t\t\tnewTransaction.#data = TransactionDataBuilder.fromBytes(\n\t\t\t\ttypeof transaction === 'string' ? fromBase64(transaction) : transaction,\n\t\t\t);\n\t\t} else {\n\t\t\tnewTransaction.#data = TransactionDataBuilder.restore(JSON.parse(transaction));\n\t\t}\n\n\t\tnewTransaction.#inputSection = newTransaction.#data.inputs.slice();\n\t\tnewTransaction.#commandSection = newTransaction.#data.commands.slice();\n\t\tnewTransaction.#availableResults = new Set(newTransaction.#commandSection.map((_, i) => i));\n\n\t\t// Built-in intents are resolvable by default. Caller-supplied resolvers cover custom intents,\n\t\t// and take precedence so a built-in resolver can be overridden if needed.\n\t\tconst intentResolvers = new Map<string, TransactionPlugin>([\n\t\t\t[COIN_WITH_BALANCE, resolveCoinBalance],\n\t\t\t...Object.entries(options.intentResolvers ?? {}),\n\t\t]);\n\n\t\tif (\n\t\t\t!newTransaction.isPreparedForSerialization({\n\t\t\t\tsupportedIntents: [...intentResolvers.keys()],\n\t\t\t})\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t'Transaction has unresolved intents or async thunks. Provide resolvers for any custom intents via the `intentResolvers` option, or call `prepareForSerialization` before copying.',\n\t\t\t);\n\t\t}\n\n\t\t// Register every resolver so the copy can resolve its intents on build. Resolvers for intents\n\t\t// that aren't present are harmless — a resolver only runs when its intent appears in the data.\n\t\tfor (const [intent, resolver] of intentResolvers) {\n\t\t\tnewTransaction.addIntentResolver(intent, resolver);\n\t\t}\n\n\t\treturn newTransaction;\n\t}\n\n\taddSerializationPlugin(step: TransactionPlugin) {\n\t\tthis.#serializationPlugins.push(step);\n\t}\n\n\taddBuildPlugin(step: TransactionPlugin) {\n\t\tthis.#buildPlugins.push(step);\n\t}\n\n\taddIntentResolver(intent: string, resolver: TransactionPlugin) {\n\t\tif (this.#intentResolvers.has(intent) && this.#intentResolvers.get(intent) !== resolver) {\n\t\t\tthrow new Error(`Intent resolver for ${intent} already exists`);\n\t\t}\n\n\t\tthis.#intentResolvers.set(intent, resolver);\n\t}\n\n\tsetSender(sender: string) {\n\t\tthis.#data.sender = sender;\n\t}\n\t/**\n\t * Sets the sender only if it has not already been set.\n\t * This is useful for sponsored transaction flows where the sender may not be the same as the signer address.\n\t */\n\tsetSenderIfNotSet(sender: string) {\n\t\tif (!this.#data.sender) {\n\t\t\tthis.#data.sender = sender;\n\t\t}\n\t}\n\tsetExpiration(expiration?: InferInput<typeof TransactionExpiration> | null) {\n\t\tthis.#data.expiration = expiration ? parse(TransactionExpiration, expiration) : null;\n\t}\n\tsetGasPrice(price: number | bigint | string) {\n\t\tthis.#data.gasData.price = String(price);\n\t}\n\tsetGasBudget(budget: number | bigint | string) {\n\t\tthis.#data.gasData.budget = String(budget);\n\t}\n\n\tsetGasBudgetIfNotSet(budget: number | bigint | string) {\n\t\tif (this.#data.gasData.budget == null) {\n\t\t\tthis.#data.gasData.budget = String(budget);\n\t\t}\n\t}\n\n\tsetGasOwner(owner: string) {\n\t\tthis.#data.gasData.owner = owner;\n\t}\n\tsetGasPayment(payments: ObjectRef[]) {\n\t\tthis.#data.gasData.payment = payments.map((payment) => parse(ObjectRefSchema, payment));\n\t}\n\n\t#data: TransactionDataBuilder;\n\n\t/** Get a snapshot of the transaction data, in JSON form: */\n\tgetData() {\n\t\treturn this.#data.snapshot();\n\t}\n\n\t// Used to brand transaction classes so that they can be identified, even between multiple copies\n\t// of the builder.\n\tget [TRANSACTION_BRAND]() {\n\t\treturn true;\n\t}\n\n\t// Temporary workaround for the wallet interface accidentally serializing transactions via postMessage\n\tget pure(): ReturnType<typeof createPure<Argument>> {\n\t\tObject.defineProperty(this, 'pure', {\n\t\t\tenumerable: false,\n\t\t\tvalue: createPure<Argument>((value): Argument => {\n\t\t\t\tif (isSerializedBcs(value)) {\n\t\t\t\t\treturn this.#addInput('pure', {\n\t\t\t\t\t\t$kind: 'Pure',\n\t\t\t\t\t\tPure: {\n\t\t\t\t\t\t\tbytes: value.toBase64(),\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// TODO: we can also do some deduplication here\n\t\t\t\treturn this.#addInput(\n\t\t\t\t\t'pure',\n\t\t\t\t\tis(NormalizedCallArg, value)\n\t\t\t\t\t\t? parse(NormalizedCallArg, value)\n\t\t\t\t\t\t: value instanceof Uint8Array\n\t\t\t\t\t\t\t? Inputs.Pure(value)\n\t\t\t\t\t\t\t: { $kind: 'UnresolvedPure', UnresolvedPure: { value } },\n\t\t\t\t);\n\t\t\t}),\n\t\t});\n\n\t\treturn this.pure;\n\t}\n\n\tconstructor() {\n\t\tthis.#data = new TransactionDataBuilder();\n\t\tthis.#buildPlugins = [];\n\t\tthis.#serializationPlugins = [];\n\t}\n\n\t/** Returns an argument for the gas coin, to be used in a transaction. */\n\tget gas() {\n\t\treturn { $kind: 'GasCoin' as const, GasCoin: true as const };\n\t}\n\n\t/**\n\t * Creates a coin of the specified type and balance.\n\t * Sourced from address balance when available, falling back to owned coins.\n\t */\n\tcoin({\n\t\ttype,\n\t\tbalance,\n\t\tuseGasCoin,\n\t}: {\n\t\tbalance: bigint | number;\n\t\ttype?: string;\n\t\tuseGasCoin?: boolean;\n\t}): TransactionResult {\n\t\treturn this.add(coinWithBalance({ type, balance, useGasCoin }));\n\t}\n\n\t/**\n\t * Creates a Balance object of the specified type and balance.\n\t * Sourced from address balance when available, falling back to owned coins.\n\t */\n\tbalance({\n\t\ttype,\n\t\tbalance,\n\t\tuseGasCoin,\n\t}: {\n\t\tbalance: bigint | number;\n\t\ttype?: string;\n\t\tuseGasCoin?: boolean;\n\t}): TransactionResult {\n\t\treturn this.add(createBalance({ type, balance, useGasCoin }));\n\t}\n\n\t/**\n\t * Add a new object input to the transaction.\n\t */\n\tobject: ReturnType<\n\t\ttypeof createObjectMethods<{ $kind: 'Input'; Input: number; type?: 'object' }>\n\t> = createObjectMethods(\n\t\t(value: TransactionObjectInput): { $kind: 'Input'; Input: number; type?: 'object' } => {\n\t\t\tif (typeof value === 'function') {\n\t\t\t\treturn this.object(this.add(value as (tx: Transaction) => TransactionObjectArgument));\n\t\t\t}\n\n\t\t\tif (typeof value === 'object' && is(ArgumentSchema, value)) {\n\t\t\t\treturn value as { $kind: 'Input'; Input: number; type?: 'object' };\n\t\t\t}\n\n\t\t\tconst id = getIdFromCallArg(value);\n\n\t\t\tconst inserted = this.#data.inputs.find((i) => id === getIdFromCallArg(i));\n\n\t\t\t// Upgrade shared object inputs to mutable if needed:\n\t\t\tif (\n\t\t\t\tinserted?.Object?.SharedObject &&\n\t\t\t\ttypeof value === 'object' &&\n\t\t\t\tvalue.Object?.SharedObject\n\t\t\t) {\n\t\t\t\tinserted.Object.SharedObject.mutable =\n\t\t\t\t\tinserted.Object.SharedObject.mutable || value.Object.SharedObject.mutable;\n\t\t\t}\n\n\t\t\treturn inserted\n\t\t\t\t? { $kind: 'Input', Input: this.#data.inputs.indexOf(inserted), type: 'object' }\n\t\t\t\t: this.#addInput(\n\t\t\t\t\t\t'object',\n\t\t\t\t\t\ttypeof value === 'string'\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t$kind: 'UnresolvedObject',\n\t\t\t\t\t\t\t\t\tUnresolvedObject: { objectId: normalizeSuiAddress(value) },\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: value,\n\t\t\t\t\t);\n\t\t},\n\t);\n\n\t/**\n\t * Add a new object input to the transaction using the fully-resolved object reference.\n\t * If you only have an object ID, use `builder.object(id)` instead.\n\t */\n\tobjectRef(...args: Parameters<(typeof Inputs)['ObjectRef']>) {\n\t\treturn this.object(Inputs.ObjectRef(...args));\n\t}\n\n\t/**\n\t * Add a new receiving input to the transaction using the fully-resolved object reference.\n\t * If you only have an object ID, use `builder.object(id)` instead.\n\t */\n\treceivingRef(...args: Parameters<(typeof Inputs)['ReceivingRef']>) {\n\t\treturn this.object(Inputs.ReceivingRef(...args));\n\t}\n\n\t/**\n\t * Add a new shared object input to the transaction using the fully-resolved shared object reference.\n\t * If you only have an object ID, use `builder.object(id)` instead.\n\t */\n\tsharedObjectRef(...args: Parameters<(typeof Inputs)['SharedObjectRef']>) {\n\t\treturn this.object(Inputs.SharedObjectRef(...args));\n\t}\n\n\t#fork() {\n\t\tconst fork = new Transaction();\n\n\t\tfork.#data = this.#data;\n\t\tfork.#serializationPlugins = this.#serializationPlugins;\n\t\tfork.#buildPlugins = this.#buildPlugins;\n\t\tfork.#intentResolvers = this.#intentResolvers;\n\t\tfork.#pendingPromises = this.#pendingPromises;\n\t\tfork.#availableResults = new Set(this.#availableResults);\n\t\tfork.#added = this.#added;\n\t\tthis.#inputSection.push(fork.#inputSection);\n\t\tthis.#commandSection.push(fork.#commandSection);\n\n\t\treturn fork;\n\t}\n\n\t/** Add a transaction to the transaction */\n\n\tadd<T extends Command>(command: T): TransactionResult;\n\tadd<T extends void | TransactionResultArgument | TransactionArgument | Command>(\n\t\tthunk: (tx: Transaction) => T,\n\t): T;\n\tadd<T extends TransactionResultArgument | void>(\n\t\tasyncTransactionThunk: AsyncTransactionThunk<T>,\n\t): T;\n\tadd(command: Command | AsyncTransactionThunk | ((tx: Transaction) => unknown)): unknown {\n\t\tif (typeof command === 'function') {\n\t\t\tif (this.#added.has(command)) {\n\t\t\t\treturn this.#added.get(command);\n\t\t\t}\n\n\t\t\tconst fork = this.#fork();\n\t\t\tconst result = command(fork);\n\n\t\t\tif (!(result && typeof result === 'object' && 'then' in result)) {\n\t\t\t\tthis.#availableResults = fork.#availableResults;\n\t\t\t\tthis.#added.set(command, result);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tconst placeholder = this.#addCommand({\n\t\t\t\t$kind: '$Intent',\n\t\t\t\t$Intent: {\n\t\t\t\t\tname: 'AsyncTransactionThunk',\n\t\t\t\t\tinputs: {},\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tresultIndex: this.#data.commands.length,\n\t\t\t\t\t\tresult: null as TransactionResult | null,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tthis.#pendingPromises.add(\n\t\t\t\tPromise.resolve(result as Promise<TransactionResult>).then((result) => {\n\t\t\t\t\tplaceholder.$Intent.data.result = result;\n\t\t\t\t}),\n\t\t\t);\n\t\t\tconst txResult = createTransactionResult(() => placeholder.$Intent.data.resultIndex);\n\t\t\tthis.#added.set(command, txResult);\n\t\t\treturn txResult;\n\t\t} else {\n\t\t\tthis.#addCommand(command);\n\t\t}\n\n\t\treturn createTransactionResult(this.#data.commands.length - 1);\n\t}\n\n\t#addCommand<T extends Command>(command: T) {\n\t\tconst resultIndex = this.#data.commands.length;\n\t\tthis.#commandSection.push(command);\n\t\tthis.#availableResults.add(resultIndex);\n\t\tthis.#data.commands.push(command);\n\n\t\tthis.#data.mapCommandArguments(resultIndex, (arg) => {\n\t\t\tif (arg.$kind === 'Result' && !this.#availableResults.has(arg.Result)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Result { Result: ${arg.Result} } is not available to use in the current transaction`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (arg.$kind === 'NestedResult' && !this.#availableResults.has(arg.NestedResult[0])) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Result { NestedResult: [${arg.NestedResult[0]}, ${arg.NestedResult[1]}] } is not available to use in the current transaction`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (arg.$kind === 'Input' && arg.Input >= this.#data.inputs.length) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Input { Input: ${arg.Input} } references an input that does not exist in the current transaction`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn arg;\n\t\t});\n\n\t\treturn command;\n\t}\n\n\t#addInput<T extends 'pure' | 'object'>(type: T, input: CallArg) {\n\t\tthis.#inputSection.push(input);\n\t\treturn this.#data.addInput(type, input);\n\t}\n\n\t#normalizeTransactionArgument(arg: TransactionArgument | SerializedBcs<any>) {\n\t\tif (isSerializedBcs(arg)) {\n\t\t\treturn this.pure(arg);\n\t\t}\n\n\t\treturn this.#resolveArgument(arg as TransactionArgument);\n\t}\n\n\t#resolveArgument(arg: TransactionArgument): Argument {\n\t\tif (typeof arg === 'function') {\n\t\t\tconst resolved = this.add(arg as never);\n\n\t\t\tif (typeof resolved === 'function') {\n\t\t\t\treturn this.#resolveArgument(resolved);\n\t\t\t}\n\n\t\t\treturn parse(ArgumentSchema, resolved);\n\t\t}\n\n\t\treturn parse(ArgumentSchema, arg);\n\t}\n\n\t// Method shorthands:\n\n\tsplitCoins<\n\t\tconst Amounts extends (TransactionArgument | SerializedBcs<any> | number | string | bigint)[],\n\t>(coin: TransactionObjectArgument | string, amounts: Amounts) {\n\t\tconst command = TransactionCommands.SplitCoins(\n\t\t\ttypeof coin === 'string' ? this.object(coin) : this.#resolveArgument(coin),\n\t\t\tamounts.map((amount) =>\n\t\t\t\ttypeof amount === 'number' || typeof amount === 'bigint' || typeof amount === 'string'\n\t\t\t\t\t? this.pure.u64(amount)\n\t\t\t\t\t: this.#normalizeTransactionArgument(amount),\n\t\t\t),\n\t\t);\n\t\tthis.#addCommand(command);\n\t\treturn createTransactionResult(this.#data.commands.length - 1, amounts.length) as Extract<\n\t\t\tArgument,\n\t\t\t{ Result: unknown }\n\t\t> & {\n\t\t\t[K in keyof Amounts]: Extract<Argument, { NestedResult: unknown }>;\n\t\t};\n\t}\n\tmergeCoins(\n\t\tdestination: TransactionObjectArgument | string,\n\t\tsources: (TransactionObjectArgument | string)[],\n\t) {\n\t\treturn this.add(\n\t\t\tTransactionCommands.MergeCoins(\n\t\t\t\tthis.object(destination),\n\t\t\t\tsources.map((src) => this.object(src)),\n\t\t\t),\n\t\t);\n\t}\n\tpublish({ modules, dependencies }: { modules: number[][] | string[]; dependencies: string[] }) {\n\t\treturn this.add(\n\t\t\tTransactionCommands.Publish({\n\t\t\t\tmodules,\n\t\t\t\tdependencies,\n\t\t\t}),\n\t\t);\n\t}\n\tupgrade({\n\t\tmodules,\n\t\tdependencies,\n\t\tpackage: packageId,\n\t\tticket,\n\t}: {\n\t\tmodules: number[][] | string[];\n\t\tdependencies: string[];\n\t\tpackage: string;\n\t\tticket: TransactionObjectArgument | string;\n\t}) {\n\t\treturn this.add(\n\t\t\tTransactionCommands.Upgrade({\n\t\t\t\tmodules,\n\t\t\t\tdependencies,\n\t\t\t\tpackage: packageId,\n\t\t\t\tticket: this.object(ticket),\n\t\t\t}),\n\t\t);\n\t}\n\tmoveCall({\n\t\targuments: args,\n\t\t...input\n\t}:\n\t\t| {\n\t\t\t\tpackage: string;\n\t\t\t\tmodule: string;\n\t\t\t\tfunction: string;\n\t\t\t\targuments?: (TransactionArgument | SerializedBcs<any>)[];\n\t\t\t\ttypeArguments?: string[];\n\t\t }\n\t\t| {\n\t\t\t\ttarget: string;\n\t\t\t\targuments?: (TransactionArgument | SerializedBcs<any>)[];\n\t\t\t\ttypeArguments?: string[];\n\t\t }) {\n\t\treturn this.add(\n\t\t\tTransactionCommands.MoveCall({\n\t\t\t\t...input,\n\t\t\t\targuments: args?.map((arg) => this.#normalizeTransactionArgument(arg)),\n\t\t\t} as Parameters<typeof TransactionCommands.MoveCall>[0]),\n\t\t);\n\t}\n\ttransferObjects(\n\t\tobjects: (TransactionObjectArgument | string)[],\n\t\taddress: TransactionArgument | SerializedBcs<any> | string,\n\t) {\n\t\treturn this.add(\n\t\t\tTransactionCommands.TransferObjects(\n\t\t\t\tobjects.map((obj) => this.object(obj)),\n\t\t\t\ttypeof address === 'string'\n\t\t\t\t\t? this.pure.address(address)\n\t\t\t\t\t: this.#normalizeTransactionArgument(address),\n\t\t\t),\n\t\t);\n\t}\n\tmakeMoveVec({\n\t\ttype,\n\t\telements,\n\t}: {\n\t\telements: (TransactionObjectArgument | string)[];\n\t\ttype?: string;\n\t}) {\n\t\treturn this.add(\n\t\t\tTransactionCommands.MakeMoveVec({\n\t\t\t\ttype,\n\t\t\t\telements: elements.map((obj) => this.object(obj)),\n\t\t\t}),\n\t\t);\n\t}\n\n\t/**\n\t * Create a FundsWithdrawal input for withdrawing Balance<T> from an address balance accumulator.\n\t * This is used for gas payments from address balances.\n\t *\n\t * @param options.amount - The Amount to withdraw (u64).\n\t * @param options.type - The balance type (e.g., \"0x2::sui::SUI\"). Defaults to SUI.\n\t */\n\twithdrawal({ amount, type }: { amount: number | bigint | string; type?: string | null }): {\n\t\t$kind: 'Input';\n\t\tInput: number;\n\t\ttype?: 'object';\n\t} {\n\t\tconst input: CallArg = {\n\t\t\t$kind: 'FundsWithdrawal',\n\t\t\tFundsWithdrawal: {\n\t\t\t\t// TODO: support entire balance withdrawals once supported\n\t\t\t\treservation: { $kind: 'MaxAmountU64', MaxAmountU64: String(amount) },\n\t\t\t\ttypeArg: { $kind: 'Balance', Balance: type ?? '0x2::sui::SUI' },\n\t\t\t\twithdrawFrom:\n\t\t\t\t\t// fromSponsor === true\n\t\t\t\t\t// \t? { $kind: 'Sponsor', Sponsor: true } :\n\t\t\t\t\t// TODO: currently only supporting withdrawals from sender\n\t\t\t\t\t{ $kind: 'Sender', Sender: true },\n\t\t\t},\n\t\t};\n\n\t\treturn this.#addInput('object', input);\n\t}\n\n\t/**\n\t * @deprecated Use toJSON instead.\n\t * For synchronous serialization, you can use `getData()`\n\t * */\n\tserialize() {\n\t\treturn JSON.stringify(serializeV1TransactionData(this.#data.snapshot()));\n\t}\n\n\tasync toJSON(options: SerializeTransactionOptions = {}): Promise<string> {\n\t\tawait this.prepareForSerialization(options);\n\t\tconst fullyResolved = this.isFullyResolved();\n\t\treturn JSON.stringify(\n\t\t\tparse(\n\t\t\t\tSerializedTransactionDataV2Schema,\n\t\t\t\tfullyResolved\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...this.#data.snapshot(),\n\t\t\t\t\t\t\tdigest: this.#data.getDigest(),\n\t\t\t\t\t\t}\n\t\t\t\t\t: this.#data.snapshot(),\n\t\t\t),\n\t\t\t(_key, value) => (typeof value === 'bigint' ? value.toString() : value),\n\t\t\t2,\n\t\t);\n\t}\n\n\t/** Build the transaction to BCS bytes, and sign it with the provided keypair. */\n\tasync sign(options: SignOptions): Promise<SignatureWithBytes> {\n\t\tconst { signer, ...buildOptions } = options;\n\t\tconst bytes = await this.build(buildOptions);\n\t\treturn signer.signTransaction(bytes);\n\t}\n\n\t/**\n\t * Checks if the transaction is prepared for serialization to JSON.\n\t * This means:\n\t * - All async thunks have been fully resolved\n\t * - All transaction intents have been resolved (unless in supportedIntents)\n\t *\n\t * Unlike `isFullyResolved()`, this does not require the sender, gas payment,\n\t * budget, or object versions to be set.\n\t */\n\tisPreparedForSerialization(options: { supportedIntents?: string[] } = {}) {\n\t\tif (this.#pendingPromises.size > 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (\n\t\t\tthis.#data.commands.some(\n\t\t\t\t(cmd) => cmd.$Intent && !options.supportedIntents?.includes(cmd.$Intent.name),\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Ensures that:\n\t * - All objects have been fully resolved to a specific version\n\t * - All pure inputs have been serialized to bytes\n\t * - All async thunks have been fully resolved\n\t * - All transaction intents have been resolved\n\t * \t- The gas payment, budget, and price have been set\n\t * - The transaction sender has been set\n\t *\n\t * When true, the transaction will always be built to the same bytes and digest (unless the transaction is mutated)\n\t */\n\tisFullyResolved() {\n\t\tif (!this.isPreparedForSerialization()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!this.#data.sender) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (needsTransactionResolution(this.#data, {})) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/** Build the transaction to BCS bytes. */\n\tasync build(options: BuildTransactionOptions = {}): Promise<Uint8Array<ArrayBuffer>> {\n\t\tawait this.prepareForSerialization(options);\n\t\tawait this.#prepareBuild(options);\n\t\treturn this.#data.build({\n\t\t\tonlyTransactionKind: options.onlyTransactionKind,\n\t\t});\n\t}\n\n\t/** Derive transaction digest */\n\tasync getDigest(\n\t\toptions: {\n\t\t\tclient?: ClientWithCoreApi;\n\t\t} = {},\n\t): Promise<string> {\n\t\tawait this.prepareForSerialization(options);\n\t\tawait this.#prepareBuild(options);\n\t\treturn this.#data.getDigest();\n\t}\n\n\t/**\n\t * Prepare the transaction by validating the transaction data and resolving all inputs\n\t * so that it can be built into bytes.\n\t */\n\tasync #prepareBuild(options: BuildTransactionOptions) {\n\t\tif (!options.onlyTransactionKind && !this.#data.sender) {\n\t\t\tthrow new Error('Missing transaction sender');\n\t\t}\n\n\t\tawait this.#runPlugins([...this.#buildPlugins, resolveTransactionPlugin], options);\n\t}\n\n\tasync #runPlugins(plugins: TransactionPlugin[], options: SerializeTransactionOptions) {\n\t\ttry {\n\t\t\tconst createNext = (i: number) => {\n\t\t\t\tif (i >= plugins.length) {\n\t\t\t\t\treturn () => {};\n\t\t\t\t}\n\t\t\t\tconst plugin = plugins[i];\n\n\t\t\t\treturn async () => {\n\t\t\t\t\tconst next = createNext(i + 1);\n\t\t\t\t\tlet calledNext = false;\n\t\t\t\t\tlet nextResolved = false;\n\n\t\t\t\t\tawait plugin(this.#data, options, async () => {\n\t\t\t\t\t\tif (calledNext) {\n\t\t\t\t\t\t\tthrow new Error(`next() was call multiple times in TransactionPlugin ${i}`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcalledNext = true;\n\n\t\t\t\t\t\tawait next();\n\n\t\t\t\t\t\tnextResolved = true;\n\t\t\t\t\t});\n\n\t\t\t\t\tif (!calledNext) {\n\t\t\t\t\t\tthrow new Error(`next() was not called in TransactionPlugin ${i}`);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!nextResolved) {\n\t\t\t\t\t\tthrow new Error(`next() was not awaited in TransactionPlugin ${i}`);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t\tawait createNext(0)();\n\t\t} finally {\n\t\t\tthis.#inputSection = this.#data.inputs.slice();\n\t\t\tthis.#commandSection = this.#data.commands.slice();\n\t\t\tthis.#availableResults = new Set(this.#commandSection.map((_, i) => i));\n\t\t}\n\t}\n\n\tasync #waitForPendingTasks() {\n\t\twhile (this.#pendingPromises.size > 0) {\n\t\t\tconst newPromise = Promise.all(this.#pendingPromises);\n\t\t\tthis.#pendingPromises.clear();\n\t\t\tthis.#pendingPromises.add(newPromise);\n\t\t\tawait newPromise;\n\t\t\tthis.#pendingPromises.delete(newPromise);\n\t\t}\n\t}\n\n\t#sortCommandsAndInputs() {\n\t\tconst unorderedCommands = this.#data.commands;\n\t\tconst unorderedInputs = this.#data.inputs;\n\n\t\tconst orderedCommands = (this.#commandSection as Command[]).flat(Infinity);\n\t\tconst orderedInputs = (this.#inputSection as CallArg[]).flat(Infinity);\n\n\t\tif (orderedCommands.length !== unorderedCommands.length) {\n\t\t\tthrow new Error('Unexpected number of commands found in transaction data');\n\t\t}\n\n\t\tif (orderedInputs.length !== unorderedInputs.length) {\n\t\t\tthrow new Error('Unexpected number of inputs found in transaction data');\n\t\t}\n\n\t\tconst filteredCommands = orderedCommands.filter(\n\t\t\t(cmd) => cmd.$Intent?.name !== 'AsyncTransactionThunk',\n\t\t);\n\n\t\tthis.#data.commands = filteredCommands;\n\t\tthis.#data.inputs = orderedInputs;\n\t\tthis.#commandSection = filteredCommands;\n\t\tthis.#inputSection = orderedInputs;\n\t\tthis.#availableResults = new Set(filteredCommands.map((_, i) => i));\n\n\t\tfunction getOriginalIndex(index: number): number {\n\t\t\tconst command = unorderedCommands[index];\n\t\t\tif (command.$Intent?.name === 'AsyncTransactionThunk') {\n\t\t\t\tconst result = command.$Intent.data.result as TransactionResult | null;\n\n\t\t\t\tif (result == null) {\n\t\t\t\t\tthrow new Error('AsyncTransactionThunk has not been resolved');\n\t\t\t\t}\n\n\t\t\t\treturn getOriginalIndex(result.Result);\n\t\t\t}\n\n\t\t\tconst updated = filteredCommands.indexOf(command);\n\n\t\t\tif (updated === -1) {\n\t\t\t\tthrow new Error('Unable to find original index for command');\n\t\t\t}\n\n\t\t\treturn updated;\n\t\t}\n\n\t\tthis.#data.mapArguments((arg) => {\n\t\t\tif (arg.$kind === 'Input') {\n\t\t\t\tconst updated = orderedInputs.indexOf(unorderedInputs[arg.Input]);\n\n\t\t\t\tif (updated === -1) {\n\t\t\t\t\tthrow new Error('Input has not been resolved');\n\t\t\t\t}\n\n\t\t\t\treturn { ...arg, Input: updated };\n\t\t\t} else if (arg.$kind === 'Result') {\n\t\t\t\tconst updated = getOriginalIndex(arg.Result);\n\n\t\t\t\treturn { ...arg, Result: updated };\n\t\t\t} else if (arg.$kind === 'NestedResult') {\n\t\t\t\tconst updated = getOriginalIndex(arg.NestedResult[0]);\n\n\t\t\t\treturn { ...arg, NestedResult: [updated, arg.NestedResult[1]] };\n\t\t\t}\n\n\t\t\treturn arg;\n\t\t});\n\n\t\tfor (const [i, cmd] of unorderedCommands.entries()) {\n\t\t\tif (cmd.$Intent?.name === 'AsyncTransactionThunk') {\n\t\t\t\ttry {\n\t\t\t\t\tcmd.$Intent.data.resultIndex = getOriginalIndex(i);\n\t\t\t\t} catch {\n\t\t\t\t\t// If async thunk did not return a result, this will error, but is safe to ignore\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tasync prepareForSerialization(options: SerializeTransactionOptions) {\n\t\tawait this.#waitForPendingTasks();\n\t\tthis.#sortCommandsAndInputs();\n\t\tconst intents = new Set<string>();\n\t\tfor (const command of this.#data.commands) {\n\t\t\tif (command.$Intent) {\n\t\t\t\tintents.add(command.$Intent.name);\n\t\t\t}\n\t\t}\n\n\t\tconst steps = [...this.#serializationPlugins];\n\n\t\tfor (const intent of intents) {\n\t\t\tif (options.supportedIntents?.includes(intent)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!this.#intentResolvers.has(intent)) {\n\t\t\t\tthrow new Error(`Missing intent resolver for ${intent}`);\n\t\t\t}\n\n\t\t\tsteps.push(this.#intentResolvers.get(intent)!);\n\t\t}\n\n\t\tsteps.push(namedPackagesPlugin());\n\n\t\tawait this.#runPlugins(steps, options);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA2DA,SAAS,wBACR,OACA,SAAS,UACW;CACpB,MAAM,aAAa;EAClB,OAAO;EACP,IAAI,SAAS;AACZ,UAAO,OAAO,UAAU,aAAa,OAAO,GAAG;;EAEhD;CAED,MAAM,gBAGA,EAAE;CACR,MAAM,mBACL,gBAKC,cAAc,iBAAiB;EAC/B,OAAO;EACP,IAAI,eAAe;AAClB,UAAO,CAAC,OAAO,UAAU,aAAa,OAAO,GAAG,OAAO,YAAY;;EAEpE;AAEF,QAAO,IAAI,MAAM,YAAY;EAC5B,MAAM;AACL,SAAM,IAAI,MACT,sFACA;;EAKF,IAAI,QAAQ,UAAU;AAErB,OAAI,YAAY,OACf,QAAO,QAAQ,IAAI,QAAQ,SAAS;AAIrC,OAAI,aAAa,OAAO,SACvB,QAAO,aAAa;IACnB,IAAI,IAAI;AACR,WAAO,IAAI,QAAQ;AAClB,WAAM,gBAAgB,EAAE;AACxB;;;AAKH,OAAI,OAAO,aAAa,SAAU;GAElC,MAAM,cAAc,SAAS,UAAU,GAAG;AAC1C,OAAI,OAAO,MAAM,YAAY,IAAI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OAAM,IAAI,MAAM,+BAA+B,SAAS;AAGzD,SAAM,KAAK,MAAKA,gBAAiB,IAAI,OAAO,CAAE;;AAG/C,QAAM,KAAK,qBAAqB,CAAC;AAEjC,QAAM,MAAKU,WAAY,OAAO,QAAQ"}
|
|
@@ -5,7 +5,7 @@ import { SerializedTransactionDataV1 } from "./data/v1.mjs";
|
|
|
5
5
|
import { SerializedTransactionDataV2 } from "./data/v2.mjs";
|
|
6
6
|
import { TransactionDataBuilder } from "./TransactionData.mjs";
|
|
7
7
|
import { BuildTransactionOptions, SerializeTransactionOptions, TransactionPlugin } from "./resolve.mjs";
|
|
8
|
-
import { Transaction, TransactionObjectArgument, TransactionObjectInput, TransactionResult, isTransaction } from "./Transaction.mjs";
|
|
8
|
+
import { Transaction, TransactionCopyOptions, TransactionObjectArgument, TransactionObjectInput, TransactionResult, isTransaction } from "./Transaction.mjs";
|
|
9
9
|
import { getPureBcsSchema, normalizedTypeToMoveTypeSignature } from "./serializer.mjs";
|
|
10
10
|
import { AsyncCache, ObjectCache } from "./ObjectCache.mjs";
|
|
11
11
|
import { SerialTransactionExecutor } from "./executor/serial.mjs";
|
|
@@ -13,4 +13,4 @@ import { ParallelTransactionExecutor, ParallelTransactionExecutorOptions } from
|
|
|
13
13
|
import { coinWithBalance } from "./intents/CoinWithBalance.mjs";
|
|
14
14
|
import { Arguments } from "./Arguments.mjs";
|
|
15
15
|
import { isArgument } from "./utils.mjs";
|
|
16
|
-
export { type Argument, Arguments, AsyncCache, type BuildTransactionOptions, type CallArg, type Command, type GasData, Inputs, ObjectCache, type ObjectRef, ParallelTransactionExecutor, type ParallelTransactionExecutorOptions, SerialTransactionExecutor, type SerializeTransactionOptions, type SerializedTransactionDataV1, type SerializedTransactionDataV2, Transaction, type TransactionArgument, TransactionCommands, type TransactionData, TransactionDataBuilder, type TransactionInput, type TransactionObjectArgument, type TransactionObjectInput, type TransactionPlugin, type TransactionResult, UpgradePolicy, coinWithBalance, getPureBcsSchema, isArgument, isTransaction, normalizedTypeToMoveTypeSignature };
|
|
16
|
+
export { type Argument, Arguments, AsyncCache, type BuildTransactionOptions, type CallArg, type Command, type GasData, Inputs, ObjectCache, type ObjectRef, ParallelTransactionExecutor, type ParallelTransactionExecutorOptions, SerialTransactionExecutor, type SerializeTransactionOptions, type SerializedTransactionDataV1, type SerializedTransactionDataV2, Transaction, type TransactionArgument, TransactionCommands, type TransactionCopyOptions, type TransactionData, TransactionDataBuilder, type TransactionInput, type TransactionObjectArgument, type TransactionObjectInput, type TransactionPlugin, type TransactionResult, UpgradePolicy, coinWithBalance, getPureBcsSchema, isArgument, isTransaction, normalizedTypeToMoveTypeSignature };
|