wowok 1.8.2 → 2.1.9
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/README.md +4 -33
- package/dist/cjs/bcs/bcs.d.ts +1973 -0
- package/dist/cjs/bcs/bcs.js +327 -0
- package/dist/cjs/bcs/effects.d.ts +579 -0
- package/dist/cjs/bcs/effects.js +231 -0
- package/dist/cjs/bcs/index.d.ts +2589 -0
- package/dist/cjs/bcs/index.js +79 -0
- package/dist/cjs/bcs/pure.d.ts +22 -0
- package/dist/cjs/bcs/pure.js +62 -0
- package/dist/cjs/bcs/type-tag-serializer.d.ts +7 -0
- package/dist/cjs/bcs/type-tag-serializer.js +124 -0
- package/dist/cjs/bcs/types.d.ts +114 -0
- package/dist/cjs/bcs/types.js +26 -0
- package/dist/cjs/client/index.d.ts +5 -0
- package/dist/cjs/client/index.js +34 -0
- package/dist/cjs/client/network.d.ts +5 -0
- package/dist/cjs/client/network.js +43 -0
- package/dist/cjs/cryptography/index.d.ts +7 -0
- package/dist/cjs/cryptography/index.js +46 -0
- package/dist/cjs/cryptography/intent.d.ts +6 -0
- package/dist/cjs/cryptography/intent.js +34 -0
- package/dist/cjs/cryptography/keypair.d.ts +73 -0
- package/dist/cjs/cryptography/keypair.js +125 -0
- package/dist/cjs/cryptography/mnemonics.d.ts +27 -0
- package/dist/cjs/cryptography/mnemonics.js +50 -0
- package/dist/cjs/cryptography/publickey.d.ts +67 -0
- package/dist/cjs/cryptography/publickey.js +142 -0
- package/dist/cjs/cryptography/signature-scheme.d.ts +24 -0
- package/dist/cjs/cryptography/signature-scheme.js +47 -0
- package/dist/cjs/cryptography/signature.d.ts +62 -0
- package/dist/cjs/cryptography/signature.js +71 -0
- package/dist/cjs/experimental/cache.d.ts +12 -0
- package/dist/cjs/experimental/client.d.ts +12 -0
- package/dist/cjs/experimental/core.d.ts +33 -0
- package/dist/cjs/experimental/errors.d.ts +8 -0
- package/dist/cjs/experimental/index.d.ts +7 -0
- package/dist/cjs/experimental/persistent-storage.d.ts +134 -0
- package/dist/cjs/experimental/persistent-storage.test.d.ts +5 -0
- package/dist/cjs/experimental/transports/utils.d.ts +3 -0
- package/dist/cjs/experimental/types.d.ts +367 -0
- package/dist/cjs/faucet/faucet.d.ts +66 -0
- package/dist/cjs/faucet/faucet.js +138 -0
- package/dist/cjs/faucet/index.d.ts +1 -0
- package/dist/cjs/faucet/index.js +29 -0
- package/dist/cjs/graphql/client.js +98 -0
- package/dist/cjs/graphql/core.js +506 -0
- package/dist/cjs/graphql/generated/2024.1/tada-env.js +13141 -0
- package/dist/cjs/graphql/generated/2024.1/tsconfig.tada.js +11 -0
- package/dist/cjs/graphql/generated/2024.4/tada-env.js +13287 -0
- package/dist/cjs/graphql/generated/2024.4/tsconfig.tada.js +11 -0
- package/dist/cjs/graphql/generated/latest/tada-env.js +12925 -0
- package/dist/cjs/graphql/generated/latest/tsconfig.tada.js +11 -0
- package/dist/cjs/graphql/generated/queries.js +807 -0
- package/dist/cjs/graphql/index.js +25 -0
- package/dist/cjs/graphql/schemas/2024.1/index.js +28 -0
- package/dist/cjs/graphql/schemas/2024.4/index.js +28 -0
- package/dist/cjs/graphql/schemas/latest/index.js +28 -0
- package/dist/cjs/graphql/types.js +16 -0
- package/dist/cjs/grpc/client.d.ts +32 -0
- package/dist/cjs/grpc/client.js +64 -0
- package/dist/cjs/grpc/core.d.ts +28 -0
- package/dist/cjs/grpc/core.js +645 -0
- package/dist/cjs/grpc/index.d.ts +4 -0
- package/dist/cjs/grpc/index.js +26 -0
- package/dist/cjs/grpc/proto/google/protobuf/any.d.ts +173 -0
- package/dist/cjs/grpc/proto/google/protobuf/any.js +138 -0
- package/dist/cjs/grpc/proto/google/protobuf/duration.d.ts +104 -0
- package/dist/cjs/grpc/proto/google/protobuf/duration.js +94 -0
- package/dist/cjs/grpc/proto/google/protobuf/empty.d.ts +25 -0
- package/dist/cjs/grpc/proto/google/protobuf/empty.js +30 -0
- package/dist/cjs/grpc/proto/google/protobuf/field_mask.d.ts +231 -0
- package/dist/cjs/grpc/proto/google/protobuf/field_mask.js +77 -0
- package/dist/cjs/grpc/proto/google/protobuf/struct.d.ts +169 -0
- package/dist/cjs/grpc/proto/google/protobuf/struct.js +224 -0
- package/dist/cjs/grpc/proto/google/protobuf/timestamp.d.ts +145 -0
- package/dist/cjs/grpc/proto/google/protobuf/timestamp.js +134 -0
- package/dist/cjs/grpc/proto/google/rpc/error_details.d.ts +525 -0
- package/dist/cjs/grpc/proto/google/rpc/error_details.js +317 -0
- package/dist/cjs/grpc/proto/google/rpc/status.d.ts +46 -0
- package/dist/cjs/grpc/proto/google/rpc/status.js +52 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/argument.d.ts +66 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/argument.js +70 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/balance_change.d.ts +34 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/balance_change.js +52 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/bcs.d.ts +30 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/bcs.js +45 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint.d.ts +68 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint.js +77 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_contents.d.ts +74 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_contents.js +84 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_summary.d.ts +195 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_summary.js +170 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/effects.d.ts +338 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/effects.js +300 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/epoch.d.ts +62 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/epoch.js +87 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/error_reason.d.ts +17 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/error_reason.js +29 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/event.d.ts +88 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/event.js +86 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/executed_transaction.d.ts +80 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/executed_transaction.js +87 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/execution_status.d.ts +843 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/execution_status.js +519 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/gas_cost_summary.d.ts +41 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/gas_cost_summary.js +63 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/input.d.ts +98 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/input.js +85 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/jwk.d.ts +70 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/jwk.js +81 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.client.d.ts +95 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.client.js +122 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.d.ts +420 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.js +368 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/move_package.d.ts +579 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/move_package.js +485 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.client.d.ts +61 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.client.js +81 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.d.ts +229 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.js +241 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.client.d.ts +41 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.client.js +55 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.d.ts +144 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.js +141 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/object.d.ts +127 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/object.js +114 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/object_reference.d.ts +34 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/object_reference.js +53 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/owner.d.ts +61 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/owner.js +63 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/protocol_config.d.ts +30 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/protocol_config.js +61 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature.d.ts +630 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature.js +541 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature_scheme.d.ts +40 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature_scheme.js +33 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.ts +35 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.client.js +50 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.d.ts +79 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.js +90 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.client.d.ts +71 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.client.js +88 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.d.ts +690 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.js +546 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.client.d.ts +55 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.client.js +54 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.d.ts +57 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.js +65 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/system_state.d.ts +684 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/system_state.js +740 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/transaction.d.ts +1321 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/transaction.js +1005 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.ts +41 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.client.js +49 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.d.ts +184 -0
- package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.js +177 -0
- package/dist/cjs/index.d.ts +25 -0
- package/dist/cjs/index.js +93 -0
- package/dist/cjs/jsonRpc/client.d.ts +261 -0
- package/dist/cjs/jsonRpc/client.js +747 -0
- package/dist/cjs/jsonRpc/core.d.ts +87 -0
- package/dist/cjs/jsonRpc/core.js +638 -0
- package/dist/cjs/jsonRpc/errors.d.ts +12 -0
- package/dist/cjs/jsonRpc/errors.js +65 -0
- package/dist/cjs/jsonRpc/http-transport.d.ts +42 -0
- package/dist/cjs/jsonRpc/http-transport.js +121 -0
- package/dist/cjs/jsonRpc/index.d.ts +4 -0
- package/dist/cjs/jsonRpc/index.js +31 -0
- package/dist/cjs/jsonRpc/json-rpc-resolver.d.ts +4 -0
- package/dist/cjs/jsonRpc/json-rpc-resolver.js +321 -0
- package/dist/cjs/jsonRpc/rpc-websocket-client.d.ts +43 -0
- package/dist/cjs/jsonRpc/rpc-websocket-client.js +220 -0
- package/dist/cjs/jsonRpc/types/chain.d.ts +99 -0
- package/dist/cjs/jsonRpc/types/chain.js +16 -0
- package/dist/cjs/jsonRpc/types/changes.d.ts +19 -0
- package/dist/cjs/jsonRpc/types/changes.js +16 -0
- package/dist/cjs/jsonRpc/types/coins.d.ts +6 -0
- package/dist/cjs/jsonRpc/types/coins.js +16 -0
- package/dist/cjs/jsonRpc/types/common.d.ts +2 -0
- package/dist/cjs/jsonRpc/types/common.js +16 -0
- package/dist/cjs/jsonRpc/types/generated.d.ts +1492 -0
- package/dist/cjs/jsonRpc/types/generated.js +16 -0
- package/dist/cjs/jsonRpc/types/index.d.ts +6 -0
- package/dist/cjs/jsonRpc/types/index.js +16 -0
- package/dist/cjs/jsonRpc/types/params.d.ts +656 -0
- package/dist/cjs/jsonRpc/types/params.js +16 -0
- package/dist/cjs/keypairs/ed25519/ed25519-hd-key.d.ts +8 -0
- package/dist/cjs/keypairs/ed25519/ed25519-hd-key.js +82 -0
- package/dist/cjs/keypairs/ed25519/index.d.ts +2 -0
- package/dist/cjs/keypairs/ed25519/index.js +27 -0
- package/dist/cjs/keypairs/ed25519/keypair.d.ts +74 -0
- package/dist/cjs/keypairs/ed25519/keypair.js +169 -0
- package/dist/cjs/keypairs/ed25519/publickey.d.ts +30 -0
- package/dist/cjs/keypairs/ed25519/publickey.js +90 -0
- package/dist/cjs/keypairs/index.d.ts +4 -0
- package/dist/cjs/keypairs/index.js +21 -0
- package/dist/cjs/keypairs/passkey/index.d.ts +3 -0
- package/dist/cjs/keypairs/passkey/index.js +28 -0
- package/dist/cjs/keypairs/passkey/keypair.d.ts +113 -0
- package/dist/cjs/keypairs/passkey/keypair.js +268 -0
- package/dist/cjs/keypairs/passkey/publickey.d.ts +72 -0
- package/dist/cjs/keypairs/passkey/publickey.js +175 -0
- package/dist/cjs/keypairs/passkey/types.d.ts +12 -0
- package/dist/cjs/keypairs/passkey/types.js +16 -0
- package/dist/cjs/keypairs/secp256k1/index.d.ts +2 -0
- package/dist/cjs/keypairs/secp256k1/index.js +27 -0
- package/dist/cjs/keypairs/secp256k1/keypair.d.ts +73 -0
- package/dist/cjs/keypairs/secp256k1/keypair.js +159 -0
- package/dist/cjs/keypairs/secp256k1/publickey.d.ts +30 -0
- package/dist/cjs/keypairs/secp256k1/publickey.js +95 -0
- package/dist/cjs/keypairs/secp256r1/index.d.ts +2 -0
- package/dist/cjs/keypairs/secp256r1/index.js +27 -0
- package/dist/cjs/keypairs/secp256r1/keypair.d.ts +73 -0
- package/dist/cjs/keypairs/secp256r1/keypair.js +155 -0
- package/dist/cjs/keypairs/secp256r1/publickey.d.ts +30 -0
- package/dist/cjs/keypairs/secp256r1/publickey.js +96 -0
- package/dist/cjs/multisig/index.d.ts +2 -0
- package/dist/cjs/multisig/index.js +27 -0
- package/dist/cjs/multisig/publickey.d.ts +79 -0
- package/dist/cjs/multisig/publickey.js +296 -0
- package/dist/cjs/multisig/signer.d.ts +20 -0
- package/dist/cjs/multisig/signer.js +114 -0
- package/dist/cjs/package.json +5 -0
- package/dist/cjs/transactions/Arguments.d.ts +57 -0
- package/dist/cjs/transactions/Arguments.js +36 -0
- package/dist/cjs/transactions/Commands.d.ts +57 -0
- package/dist/cjs/transactions/Commands.js +143 -0
- package/dist/cjs/transactions/Inputs.d.ts +22 -0
- package/dist/cjs/transactions/Inputs.js +87 -0
- package/dist/cjs/transactions/ObjectCache.d.ts +83 -0
- package/dist/cjs/transactions/ObjectCache.js +251 -0
- package/dist/cjs/transactions/Transaction.d.ts +710 -0
- package/dist/cjs/transactions/Transaction.js +742 -0
- package/dist/cjs/transactions/TransactionData.d.ts +73 -0
- package/dist/cjs/transactions/TransactionData.js +472 -0
- package/dist/cjs/transactions/__tests__/Transaction.test.d.ts +1 -0
- package/dist/cjs/transactions/__tests__/bcs.test.d.ts +1 -0
- package/dist/cjs/transactions/data/internal.d.ts +1010 -0
- package/dist/cjs/transactions/data/internal.js +230 -0
- package/dist/cjs/transactions/data/v1.d.ts +312 -0
- package/dist/cjs/transactions/data/v1.js +538 -0
- package/dist/cjs/transactions/data/v2.d.ts +153 -0
- package/dist/cjs/transactions/data/v2.js +124 -0
- package/dist/cjs/transactions/executor/caching.d.ts +31 -0
- package/dist/cjs/transactions/executor/caching.js +118 -0
- package/dist/cjs/transactions/executor/parallel.d.ts +37 -0
- package/dist/cjs/transactions/executor/parallel.js +395 -0
- package/dist/cjs/transactions/executor/queue.d.ts +11 -0
- package/dist/cjs/transactions/executor/queue.js +87 -0
- package/dist/cjs/transactions/executor/serial.d.ts +31 -0
- package/dist/cjs/transactions/executor/serial.js +136 -0
- package/dist/cjs/transactions/hash.d.ts +7 -0
- package/dist/cjs/transactions/hash.js +31 -0
- package/dist/cjs/transactions/index.d.ts +21 -0
- package/dist/cjs/transactions/index.js +50 -0
- package/dist/cjs/transactions/intents/CoinWithBalance.d.ts +9 -0
- package/dist/cjs/transactions/intents/CoinWithBalance.js +206 -0
- package/dist/cjs/transactions/object.d.ts +24 -0
- package/dist/cjs/transactions/object.js +116 -0
- package/dist/cjs/transactions/plugins/NamedPackagesPlugin.d.ts +31 -0
- package/dist/cjs/transactions/plugins/NamedPackagesPlugin.js +37 -0
- package/dist/cjs/transactions/pure.d.ts +20 -0
- package/dist/cjs/transactions/pure.js +64 -0
- package/dist/cjs/transactions/resolve.d.ts +13 -0
- package/dist/cjs/transactions/resolve.js +103 -0
- package/dist/cjs/transactions/serializer.d.ts +7 -0
- package/dist/cjs/transactions/serializer.js +189 -0
- package/dist/cjs/transactions/utils.d.ts +10 -0
- package/dist/cjs/transactions/utils.js +143 -0
- package/dist/cjs/utils/constants.d.ts +17 -0
- package/dist/cjs/utils/constants.js +57 -0
- package/dist/cjs/utils/derived-objects.d.ts +5 -0
- package/dist/cjs/utils/derived-objects.js +33 -0
- package/dist/cjs/utils/dynamic-fields.d.ts +2 -0
- package/dist/cjs/utils/dynamic-fields.js +40 -0
- package/dist/cjs/utils/format.d.ts +2 -0
- package/dist/cjs/utils/format.js +35 -0
- package/dist/cjs/utils/index.d.ts +8 -0
- package/dist/cjs/utils/index.js +65 -0
- package/dist/cjs/utils/move-registry.d.ts +6 -0
- package/dist/cjs/utils/move-registry.js +44 -0
- package/dist/cjs/utils/sui-types.d.ts +26 -0
- package/dist/cjs/utils/sui-types.js +90 -0
- package/dist/cjs/utils/suins.d.ts +2 -0
- package/dist/cjs/utils/suins.js +56 -0
- package/dist/cjs/verify/index.d.ts +1 -0
- package/dist/cjs/verify/index.js +28 -0
- package/dist/cjs/verify/verify.d.ts +16 -0
- package/dist/cjs/verify/verify.js +125 -0
- package/dist/cjs/version.d.ts +2 -0
- package/dist/cjs/version.js +26 -0
- package/dist/cjs/w/call/allocation.d.ts +35 -0
- package/dist/cjs/w/call/allocation.js +439 -0
- package/dist/cjs/w/call/arb.d.ts +17 -0
- package/dist/cjs/w/call/arb.js +149 -0
- package/dist/cjs/w/call/arbitration.d.ts +106 -0
- package/dist/cjs/w/call/arbitration.js +1623 -0
- package/dist/cjs/w/call/base.d.ts +42 -0
- package/dist/cjs/w/call/base.js +363 -0
- package/dist/cjs/w/call/contact.d.ts +45 -0
- package/dist/cjs/w/call/contact.js +479 -0
- package/dist/cjs/w/call/demand.d.ts +79 -0
- package/dist/cjs/w/call/demand.js +872 -0
- package/dist/cjs/w/call/entity.d.ts +33 -0
- package/dist/cjs/w/call/entity.js +230 -0
- package/dist/cjs/w/call/guard-ins.d.ts +31 -0
- package/dist/cjs/w/call/guard-ins.js +4391 -0
- package/dist/cjs/w/call/guard.d.ts +254 -0
- package/dist/cjs/w/call/guard.js +1210 -0
- package/dist/cjs/w/call/index.d.ts +37 -0
- package/dist/cjs/w/call/index.js +71 -0
- package/dist/cjs/w/call/machine.d.ts +124 -0
- package/dist/cjs/w/call/machine.js +1486 -0
- package/dist/cjs/w/call/order.d.ts +73 -0
- package/dist/cjs/w/call/order.js +485 -0
- package/dist/cjs/w/call/passport.d.ts +24 -0
- package/dist/cjs/w/call/passport.js +281 -0
- package/dist/cjs/w/call/payment.d.ts +27 -0
- package/dist/cjs/w/call/payment.js +241 -0
- package/dist/cjs/w/call/permission.d.ts +222 -0
- package/dist/cjs/w/call/permission.js +1368 -0
- package/dist/cjs/w/call/personal.d.ts +51 -0
- package/dist/cjs/w/call/personal.js +184 -0
- package/dist/cjs/w/call/progress.d.ts +94 -0
- package/dist/cjs/w/call/progress.js +833 -0
- package/dist/cjs/w/call/proof.d.ts +27 -0
- package/dist/cjs/w/call/proof.js +124 -0
- package/dist/cjs/w/call/repository.d.ts +97 -0
- package/dist/cjs/w/call/repository.js +1324 -0
- package/dist/cjs/w/call/resource.d.ts +27 -0
- package/dist/cjs/w/call/resource.js +149 -0
- package/dist/cjs/w/call/reward.d.ts +52 -0
- package/dist/cjs/w/call/reward.js +879 -0
- package/dist/cjs/w/call/service.d.ts +184 -0
- package/dist/cjs/w/call/service.js +2468 -0
- package/dist/cjs/w/call/treasury.d.ts +77 -0
- package/dist/cjs/w/call/treasury.js +1192 -0
- package/dist/cjs/w/call/util.d.ts +12 -0
- package/dist/cjs/w/call/util.js +661 -0
- package/dist/cjs/w/common.d.ts +359 -0
- package/dist/cjs/w/common.js +625 -0
- package/dist/cjs/w/exception.d.ts +82 -0
- package/dist/cjs/w/exception.js +604 -0
- package/dist/cjs/w/index.d.ts +8 -0
- package/dist/cjs/w/index.js +25 -0
- package/dist/cjs/w/local/.eslintrc.js +15 -0
- package/dist/cjs/w/local/account.d.ts +134 -0
- package/dist/cjs/w/local/account.js +770 -0
- package/dist/cjs/w/local/cache.d.ts +35 -0
- package/dist/cjs/w/local/cache.js +181 -0
- package/dist/cjs/w/local/config.d.ts +15 -0
- package/dist/cjs/w/local/config.js +83 -0
- package/dist/cjs/w/local/index.d.ts +193 -0
- package/dist/cjs/w/local/index.js +322 -0
- package/dist/cjs/w/local/local.d.ts +93 -0
- package/dist/cjs/w/local/local.js +673 -0
- package/dist/cjs/w/local/storage.d.ts +61 -0
- package/dist/cjs/w/local/storage.js +219 -0
- package/dist/cjs/w/local/token.d.ts +22 -0
- package/dist/cjs/w/local/token.js +182 -0
- package/dist/cjs/w/local/util.d.ts +5 -0
- package/dist/cjs/w/local/util.js +57 -0
- package/dist/cjs/w/local/wip.d.ts +218 -0
- package/dist/cjs/w/local/wip.js +911 -0
- package/dist/cjs/w/messenger/.eslintrc.js +15 -0
- package/dist/cjs/w/messenger/crypto.d.ts +269 -0
- package/dist/cjs/w/messenger/crypto.js +448 -0
- package/dist/cjs/w/messenger/index.d.ts +23 -0
- package/dist/cjs/w/messenger/index.js +37 -0
- package/dist/cjs/w/messenger/messenger-api.d.ts +225 -0
- package/dist/cjs/w/messenger/messenger-api.js +1247 -0
- package/dist/cjs/w/messenger/messenger-manager.d.ts +80 -0
- package/dist/cjs/w/messenger/messenger-manager.js +1143 -0
- package/dist/cjs/w/messenger/messenger.d.ts +231 -0
- package/dist/cjs/w/messenger/messenger.js +1512 -0
- package/dist/cjs/w/messenger/server.d.ts +134 -0
- package/dist/cjs/w/messenger/server.js +535 -0
- package/dist/cjs/w/messenger/session.d.ts +78 -0
- package/dist/cjs/w/messenger/session.js +418 -0
- package/dist/cjs/w/messenger/storage.d.ts +192 -0
- package/dist/cjs/w/messenger/storage.js +964 -0
- package/dist/cjs/w/messenger/types.d.ts +705 -0
- package/dist/cjs/w/messenger/types.js +107 -0
- package/dist/cjs/w/messenger/utils.d.ts +15 -0
- package/dist/cjs/w/messenger/utils.js +37 -0
- package/dist/cjs/w/query/bult-in.d.ts +73 -0
- package/dist/cjs/w/query/bult-in.js +121 -0
- package/dist/cjs/w/query/event.d.ts +82 -0
- package/dist/cjs/w/query/event.js +157 -0
- package/dist/cjs/w/query/index.d.ts +5 -0
- package/dist/cjs/w/query/index.js +22 -0
- package/dist/cjs/w/query/object.d.ts +658 -0
- package/dist/cjs/w/query/object.js +1671 -0
- package/dist/cjs/w/query/received.d.ts +34 -0
- package/dist/cjs/w/query/received.js +93 -0
- package/dist/cjs/w/query/util.d.ts +5 -0
- package/dist/cjs/w/query/util.js +82 -0
- package/dist/cjs/w/util.d.ts +19 -0
- package/dist/cjs/w/util.js +715 -0
- package/dist/cjs/zklogin/address.js +93 -0
- package/dist/cjs/zklogin/bcs.js +41 -0
- package/dist/cjs/zklogin/index.js +45 -0
- package/dist/cjs/zklogin/jwt-decode.js +88 -0
- package/dist/cjs/zklogin/jwt-utils.js +128 -0
- package/dist/cjs/zklogin/nonce.js +60 -0
- package/dist/cjs/zklogin/poseidon.js +64 -0
- package/dist/cjs/zklogin/publickey.js +281 -0
- package/dist/cjs/zklogin/signature.js +57 -0
- package/dist/cjs/zklogin/utils.js +98 -0
- package/dist/esm/bcs/bcs.d.ts +1973 -0
- package/dist/esm/bcs/bcs.js +319 -0
- package/dist/esm/bcs/effects.d.ts +579 -0
- package/dist/esm/bcs/effects.js +211 -0
- package/dist/esm/bcs/index.d.ts +2589 -0
- package/dist/esm/bcs/index.js +98 -0
- package/dist/esm/bcs/pure.d.ts +22 -0
- package/dist/esm/bcs/pure.js +42 -0
- package/dist/esm/bcs/type-tag-serializer.d.ts +7 -0
- package/dist/esm/bcs/type-tag-serializer.js +104 -0
- package/dist/esm/bcs/types.d.ts +114 -0
- package/dist/esm/bcs/types.js +6 -0
- package/dist/esm/client/index.d.ts +5 -0
- package/dist/esm/client/index.js +23 -0
- package/dist/esm/client/network.d.ts +5 -0
- package/dist/esm/client/network.js +23 -0
- package/dist/esm/cryptography/index.d.ts +7 -0
- package/dist/esm/cryptography/index.js +46 -0
- package/dist/esm/cryptography/intent.d.ts +6 -0
- package/dist/esm/cryptography/intent.js +14 -0
- package/dist/esm/cryptography/keypair.d.ts +73 -0
- package/dist/esm/cryptography/keypair.js +108 -0
- package/dist/esm/cryptography/mnemonics.d.ts +27 -0
- package/dist/esm/cryptography/mnemonics.js +30 -0
- package/dist/esm/cryptography/publickey.d.ts +67 -0
- package/dist/esm/cryptography/publickey.js +125 -0
- package/dist/esm/cryptography/signature-scheme.d.ts +24 -0
- package/dist/esm/cryptography/signature-scheme.js +27 -0
- package/dist/esm/cryptography/signature.d.ts +62 -0
- package/dist/esm/cryptography/signature.js +54 -0
- package/dist/esm/experimental/cache.d.ts +12 -0
- package/dist/esm/experimental/client.d.ts +12 -0
- package/dist/esm/experimental/core.d.ts +33 -0
- package/dist/esm/experimental/errors.d.ts +8 -0
- package/dist/esm/experimental/index.d.ts +7 -0
- package/dist/esm/experimental/persistent-storage.d.ts +134 -0
- package/dist/esm/experimental/persistent-storage.test.d.ts +5 -0
- package/dist/esm/experimental/transports/utils.d.ts +3 -0
- package/dist/esm/experimental/types.d.ts +367 -0
- package/dist/esm/faucet/faucet.d.ts +66 -0
- package/dist/esm/faucet/faucet.js +118 -0
- package/dist/esm/faucet/index.d.ts +1 -0
- package/dist/esm/faucet/index.js +16 -0
- package/dist/esm/graphql/client.js +79 -0
- package/dist/esm/graphql/core.js +505 -0
- package/dist/esm/graphql/generated/2024.1/tada-env.js +13121 -0
- package/dist/esm/graphql/generated/2024.1/tsconfig.tada.js +16 -0
- package/dist/esm/graphql/generated/2024.4/tada-env.js +13267 -0
- package/dist/esm/graphql/generated/2024.4/tsconfig.tada.js +16 -0
- package/dist/esm/graphql/generated/latest/tada-env.js +12905 -0
- package/dist/esm/graphql/generated/latest/tsconfig.tada.js +16 -0
- package/dist/esm/graphql/generated/queries.js +788 -0
- package/dist/esm/graphql/index.js +8 -0
- package/dist/esm/graphql/schemas/2024.1/index.js +8 -0
- package/dist/esm/graphql/schemas/2024.4/index.js +8 -0
- package/dist/esm/graphql/schemas/latest/index.js +8 -0
- package/dist/esm/graphql/types.js +0 -0
- package/dist/esm/grpc/client.d.ts +32 -0
- package/dist/esm/grpc/client.js +45 -0
- package/dist/esm/grpc/core.d.ts +28 -0
- package/dist/esm/grpc/core.js +634 -0
- package/dist/esm/grpc/index.d.ts +4 -0
- package/dist/esm/grpc/index.js +6 -0
- package/dist/esm/grpc/proto/google/protobuf/any.d.ts +173 -0
- package/dist/esm/grpc/proto/google/protobuf/any.js +118 -0
- package/dist/esm/grpc/proto/google/protobuf/duration.d.ts +104 -0
- package/dist/esm/grpc/proto/google/protobuf/duration.js +74 -0
- package/dist/esm/grpc/proto/google/protobuf/empty.d.ts +25 -0
- package/dist/esm/grpc/proto/google/protobuf/empty.js +10 -0
- package/dist/esm/grpc/proto/google/protobuf/field_mask.d.ts +231 -0
- package/dist/esm/grpc/proto/google/protobuf/field_mask.js +57 -0
- package/dist/esm/grpc/proto/google/protobuf/struct.d.ts +169 -0
- package/dist/esm/grpc/proto/google/protobuf/struct.js +204 -0
- package/dist/esm/grpc/proto/google/protobuf/timestamp.d.ts +145 -0
- package/dist/esm/grpc/proto/google/protobuf/timestamp.js +114 -0
- package/dist/esm/grpc/proto/google/rpc/error_details.d.ts +525 -0
- package/dist/esm/grpc/proto/google/rpc/error_details.js +297 -0
- package/dist/esm/grpc/proto/google/rpc/status.d.ts +46 -0
- package/dist/esm/grpc/proto/google/rpc/status.js +32 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/argument.d.ts +66 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/argument.js +50 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/balance_change.d.ts +34 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/balance_change.js +32 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/bcs.d.ts +30 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/bcs.js +25 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint.d.ts +68 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint.js +57 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint_contents.d.ts +74 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint_contents.js +64 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint_summary.d.ts +195 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint_summary.js +150 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/effects.d.ts +338 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/effects.js +280 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/epoch.d.ts +62 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/epoch.js +67 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/error_reason.d.ts +17 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/error_reason.js +9 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/event.d.ts +88 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/event.js +66 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/executed_transaction.d.ts +80 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/executed_transaction.js +67 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/execution_status.d.ts +843 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/execution_status.js +499 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/gas_cost_summary.d.ts +41 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/gas_cost_summary.js +43 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/input.d.ts +98 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/input.js +65 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/jwk.d.ts +70 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/jwk.js +61 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/ledger_service.client.d.ts +95 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/ledger_service.client.js +103 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/ledger_service.d.ts +420 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/ledger_service.js +348 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/move_package.d.ts +579 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/move_package.js +465 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/move_package_service.client.d.ts +61 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/move_package_service.client.js +62 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/move_package_service.d.ts +229 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/move_package_service.js +221 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/name_service.client.d.ts +41 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/name_service.client.js +36 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/name_service.d.ts +144 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/name_service.js +121 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/object.d.ts +127 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/object.js +94 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/object_reference.d.ts +34 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/object_reference.js +33 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/owner.d.ts +61 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/owner.js +43 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/protocol_config.d.ts +30 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/protocol_config.js +41 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/signature.d.ts +630 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/signature.js +521 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/signature_scheme.d.ts +40 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/signature_scheme.js +13 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.ts +35 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/signature_verification_service.client.js +31 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/signature_verification_service.d.ts +79 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/signature_verification_service.js +70 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/state_service.client.d.ts +71 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/state_service.client.js +69 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/state_service.d.ts +690 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/state_service.js +526 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/subscription_service.client.d.ts +55 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/subscription_service.client.js +35 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/subscription_service.d.ts +57 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/subscription_service.js +45 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/system_state.d.ts +684 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/system_state.js +720 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/transaction.d.ts +1321 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/transaction.js +985 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.ts +41 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/transaction_execution_service.client.js +30 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/transaction_execution_service.d.ts +184 -0
- package/dist/esm/grpc/proto/sui/rpc/v2/transaction_execution_service.js +157 -0
- package/dist/esm/index.d.ts +25 -0
- package/dist/esm/index.js +119 -0
- package/dist/esm/jsonRpc/client.d.ts +261 -0
- package/dist/esm/jsonRpc/client.js +734 -0
- package/dist/esm/jsonRpc/core.d.ts +87 -0
- package/dist/esm/jsonRpc/core.js +621 -0
- package/dist/esm/jsonRpc/errors.d.ts +12 -0
- package/dist/esm/jsonRpc/errors.js +46 -0
- package/dist/esm/jsonRpc/http-transport.d.ts +42 -0
- package/dist/esm/jsonRpc/http-transport.js +101 -0
- package/dist/esm/jsonRpc/index.d.ts +4 -0
- package/dist/esm/jsonRpc/index.js +20 -0
- package/dist/esm/jsonRpc/json-rpc-resolver.d.ts +4 -0
- package/dist/esm/jsonRpc/json-rpc-resolver.js +309 -0
- package/dist/esm/jsonRpc/rpc-websocket-client.d.ts +43 -0
- package/dist/esm/jsonRpc/rpc-websocket-client.js +201 -0
- package/dist/esm/jsonRpc/types/chain.d.ts +99 -0
- package/dist/esm/jsonRpc/types/chain.js +0 -0
- package/dist/esm/jsonRpc/types/changes.d.ts +19 -0
- package/dist/esm/jsonRpc/types/changes.js +0 -0
- package/dist/esm/jsonRpc/types/coins.d.ts +6 -0
- package/dist/esm/jsonRpc/types/coins.js +0 -0
- package/dist/esm/jsonRpc/types/common.d.ts +2 -0
- package/dist/esm/jsonRpc/types/common.js +0 -0
- package/dist/esm/jsonRpc/types/generated.d.ts +1492 -0
- package/dist/esm/jsonRpc/types/generated.js +0 -0
- package/dist/esm/jsonRpc/types/index.d.ts +6 -0
- package/dist/esm/jsonRpc/types/index.js +0 -0
- package/dist/esm/jsonRpc/types/params.d.ts +656 -0
- package/dist/esm/jsonRpc/types/params.js +0 -0
- package/dist/esm/keypairs/ed25519/ed25519-hd-key.d.ts +8 -0
- package/dist/esm/keypairs/ed25519/ed25519-hd-key.js +62 -0
- package/dist/esm/keypairs/ed25519/index.d.ts +2 -0
- package/dist/esm/keypairs/ed25519/index.js +10 -0
- package/dist/esm/keypairs/ed25519/keypair.d.ts +74 -0
- package/dist/esm/keypairs/ed25519/keypair.js +158 -0
- package/dist/esm/keypairs/ed25519/publickey.d.ts +30 -0
- package/dist/esm/keypairs/ed25519/publickey.js +75 -0
- package/dist/esm/keypairs/index.d.ts +4 -0
- package/dist/esm/keypairs/index.js +4 -0
- package/dist/esm/keypairs/passkey/index.d.ts +3 -0
- package/dist/esm/keypairs/passkey/index.js +12 -0
- package/dist/esm/keypairs/passkey/keypair.d.ts +113 -0
- package/dist/esm/keypairs/passkey/keypair.js +258 -0
- package/dist/esm/keypairs/passkey/publickey.d.ts +72 -0
- package/dist/esm/keypairs/passkey/publickey.js +156 -0
- package/dist/esm/keypairs/passkey/types.d.ts +12 -0
- package/dist/esm/keypairs/passkey/types.js +0 -0
- package/dist/esm/keypairs/secp256k1/index.d.ts +2 -0
- package/dist/esm/keypairs/secp256k1/index.js +10 -0
- package/dist/esm/keypairs/secp256k1/keypair.d.ts +73 -0
- package/dist/esm/keypairs/secp256k1/keypair.js +147 -0
- package/dist/esm/keypairs/secp256k1/publickey.d.ts +30 -0
- package/dist/esm/keypairs/secp256k1/publickey.js +80 -0
- package/dist/esm/keypairs/secp256r1/index.d.ts +2 -0
- package/dist/esm/keypairs/secp256r1/index.js +10 -0
- package/dist/esm/keypairs/secp256r1/keypair.d.ts +73 -0
- package/dist/esm/keypairs/secp256r1/keypair.js +143 -0
- package/dist/esm/keypairs/secp256r1/publickey.d.ts +30 -0
- package/dist/esm/keypairs/secp256r1/publickey.js +77 -0
- package/dist/esm/multisig/index.d.ts +2 -0
- package/dist/esm/multisig/index.js +10 -0
- package/dist/esm/multisig/publickey.d.ts +79 -0
- package/dist/esm/multisig/publickey.js +280 -0
- package/dist/esm/multisig/signer.d.ts +20 -0
- package/dist/esm/multisig/signer.js +94 -0
- package/dist/esm/package.json +5 -0
- package/dist/esm/transactions/Arguments.d.ts +57 -0
- package/dist/esm/transactions/Arguments.js +16 -0
- package/dist/esm/transactions/Commands.d.ts +57 -0
- package/dist/esm/transactions/Commands.js +123 -0
- package/dist/esm/transactions/Inputs.d.ts +22 -0
- package/dist/esm/transactions/Inputs.js +67 -0
- package/dist/esm/transactions/ObjectCache.d.ts +83 -0
- package/dist/esm/transactions/ObjectCache.js +231 -0
- package/dist/esm/transactions/Transaction.d.ts +710 -0
- package/dist/esm/transactions/Transaction.js +731 -0
- package/dist/esm/transactions/TransactionData.d.ts +73 -0
- package/dist/esm/transactions/TransactionData.js +453 -0
- package/dist/esm/transactions/__tests__/Transaction.test.d.ts +1 -0
- package/dist/esm/transactions/__tests__/bcs.test.d.ts +1 -0
- package/dist/esm/transactions/data/internal.d.ts +1010 -0
- package/dist/esm/transactions/data/internal.js +232 -0
- package/dist/esm/transactions/data/v1.d.ts +312 -0
- package/dist/esm/transactions/data/v1.js +542 -0
- package/dist/esm/transactions/data/v2.d.ts +153 -0
- package/dist/esm/transactions/data/v2.js +126 -0
- package/dist/esm/transactions/executor/caching.d.ts +31 -0
- package/dist/esm/transactions/executor/caching.js +99 -0
- package/dist/esm/transactions/executor/parallel.d.ts +37 -0
- package/dist/esm/transactions/executor/parallel.js +375 -0
- package/dist/esm/transactions/executor/queue.d.ts +11 -0
- package/dist/esm/transactions/executor/queue.js +68 -0
- package/dist/esm/transactions/executor/serial.d.ts +31 -0
- package/dist/esm/transactions/executor/serial.js +116 -0
- package/dist/esm/transactions/hash.d.ts +7 -0
- package/dist/esm/transactions/hash.js +11 -0
- package/dist/esm/transactions/index.d.ts +21 -0
- package/dist/esm/transactions/index.js +41 -0
- package/dist/esm/transactions/intents/CoinWithBalance.d.ts +9 -0
- package/dist/esm/transactions/intents/CoinWithBalance.js +186 -0
- package/dist/esm/transactions/object.d.ts +24 -0
- package/dist/esm/transactions/object.js +96 -0
- package/dist/esm/transactions/plugins/NamedPackagesPlugin.d.ts +31 -0
- package/dist/esm/transactions/plugins/NamedPackagesPlugin.js +17 -0
- package/dist/esm/transactions/pure.d.ts +20 -0
- package/dist/esm/transactions/pure.js +44 -0
- package/dist/esm/transactions/resolve.d.ts +13 -0
- package/dist/esm/transactions/resolve.js +83 -0
- package/dist/esm/transactions/serializer.d.ts +7 -0
- package/dist/esm/transactions/serializer.js +169 -0
- package/dist/esm/transactions/utils.d.ts +10 -0
- package/dist/esm/transactions/utils.js +123 -0
- package/dist/esm/utils/constants.d.ts +17 -0
- package/dist/esm/utils/constants.js +37 -0
- package/dist/esm/utils/derived-objects.d.ts +5 -0
- package/dist/esm/utils/derived-objects.js +13 -0
- package/dist/esm/utils/dynamic-fields.d.ts +2 -0
- package/dist/esm/utils/dynamic-fields.js +20 -0
- package/dist/esm/utils/format.d.ts +2 -0
- package/dist/esm/utils/format.js +15 -0
- package/dist/esm/utils/index.d.ts +8 -0
- package/dist/esm/utils/index.js +76 -0
- package/dist/esm/utils/move-registry.d.ts +6 -0
- package/dist/esm/utils/move-registry.js +24 -0
- package/dist/esm/utils/sui-types.d.ts +26 -0
- package/dist/esm/utils/sui-types.js +70 -0
- package/dist/esm/utils/suins.d.ts +2 -0
- package/dist/esm/utils/suins.js +36 -0
- package/dist/esm/verify/index.d.ts +1 -0
- package/dist/esm/verify/index.js +14 -0
- package/dist/esm/verify/verify.d.ts +16 -0
- package/dist/esm/verify/verify.js +108 -0
- package/dist/esm/version.d.ts +2 -0
- package/dist/esm/version.js +6 -0
- package/dist/esm/w/call/allocation.d.ts +35 -0
- package/dist/esm/w/call/allocation.js +433 -0
- package/dist/esm/w/call/arb.d.ts +17 -0
- package/dist/esm/w/call/arb.js +138 -0
- package/dist/esm/w/call/arbitration.d.ts +106 -0
- package/dist/esm/w/call/arbitration.js +1620 -0
- package/dist/esm/w/call/base.d.ts +42 -0
- package/dist/esm/w/call/base.js +350 -0
- package/dist/esm/w/call/contact.d.ts +45 -0
- package/dist/esm/w/call/contact.js +474 -0
- package/dist/esm/w/call/demand.d.ts +79 -0
- package/dist/esm/w/call/demand.js +869 -0
- package/dist/esm/w/call/entity.d.ts +33 -0
- package/dist/esm/w/call/entity.js +220 -0
- package/dist/esm/w/call/guard-ins.d.ts +31 -0
- package/dist/esm/w/call/guard-ins.js +4371 -0
- package/dist/esm/w/call/guard.d.ts +254 -0
- package/dist/esm/w/call/guard.js +1202 -0
- package/dist/esm/w/call/index.d.ts +37 -0
- package/dist/esm/w/call/index.js +57 -0
- package/dist/esm/w/call/machine.d.ts +124 -0
- package/dist/esm/w/call/machine.js +1492 -0
- package/dist/esm/w/call/order.d.ts +73 -0
- package/dist/esm/w/call/order.js +481 -0
- package/dist/esm/w/call/passport.d.ts +24 -0
- package/dist/esm/w/call/passport.js +266 -0
- package/dist/esm/w/call/payment.d.ts +27 -0
- package/dist/esm/w/call/payment.js +233 -0
- package/dist/esm/w/call/permission.d.ts +222 -0
- package/dist/esm/w/call/permission.js +1375 -0
- package/dist/esm/w/call/personal.d.ts +51 -0
- package/dist/esm/w/call/personal.js +177 -0
- package/dist/esm/w/call/progress.d.ts +94 -0
- package/dist/esm/w/call/progress.js +827 -0
- package/dist/esm/w/call/proof.d.ts +27 -0
- package/dist/esm/w/call/proof.js +110 -0
- package/dist/esm/w/call/repository.d.ts +97 -0
- package/dist/esm/w/call/repository.js +1325 -0
- package/dist/esm/w/call/resource.d.ts +27 -0
- package/dist/esm/w/call/resource.js +135 -0
- package/dist/esm/w/call/reward.d.ts +52 -0
- package/dist/esm/w/call/reward.js +874 -0
- package/dist/esm/w/call/service.d.ts +184 -0
- package/dist/esm/w/call/service.js +2472 -0
- package/dist/esm/w/call/treasury.d.ts +77 -0
- package/dist/esm/w/call/treasury.js +1186 -0
- package/dist/esm/w/call/util.d.ts +12 -0
- package/dist/esm/w/call/util.js +646 -0
- package/dist/esm/w/common.d.ts +359 -0
- package/dist/esm/w/common.js +605 -0
- package/dist/esm/w/exception.d.ts +82 -0
- package/dist/esm/w/exception.js +585 -0
- package/dist/esm/w/index.d.ts +8 -0
- package/dist/esm/w/index.js +8 -0
- package/dist/esm/w/local/.eslintrc.js +23 -0
- package/dist/esm/w/local/account.d.ts +134 -0
- package/dist/esm/w/local/account.js +746 -0
- package/dist/esm/w/local/cache.d.ts +35 -0
- package/dist/esm/w/local/cache.js +162 -0
- package/dist/esm/w/local/config.d.ts +15 -0
- package/dist/esm/w/local/config.js +64 -0
- package/dist/esm/w/local/index.d.ts +193 -0
- package/dist/esm/w/local/index.js +301 -0
- package/dist/esm/w/local/local.d.ts +93 -0
- package/dist/esm/w/local/local.js +654 -0
- package/dist/esm/w/local/storage.d.ts +61 -0
- package/dist/esm/w/local/storage.js +190 -0
- package/dist/esm/w/local/token.d.ts +22 -0
- package/dist/esm/w/local/token.js +163 -0
- package/dist/esm/w/local/util.d.ts +5 -0
- package/dist/esm/w/local/util.js +27 -0
- package/dist/esm/w/local/wip.d.ts +218 -0
- package/dist/esm/w/local/wip.js +882 -0
- package/dist/esm/w/messenger/.eslintrc.js +23 -0
- package/dist/esm/w/messenger/crypto.d.ts +269 -0
- package/dist/esm/w/messenger/crypto.js +428 -0
- package/dist/esm/w/messenger/index.d.ts +23 -0
- package/dist/esm/w/messenger/index.js +25 -0
- package/dist/esm/w/messenger/messenger-api.d.ts +225 -0
- package/dist/esm/w/messenger/messenger-api.js +1228 -0
- package/dist/esm/w/messenger/messenger-manager.d.ts +80 -0
- package/dist/esm/w/messenger/messenger-manager.js +1118 -0
- package/dist/esm/w/messenger/messenger.d.ts +231 -0
- package/dist/esm/w/messenger/messenger.js +1492 -0
- package/dist/esm/w/messenger/server.d.ts +134 -0
- package/dist/esm/w/messenger/server.js +520 -0
- package/dist/esm/w/messenger/session.d.ts +78 -0
- package/dist/esm/w/messenger/session.js +415 -0
- package/dist/esm/w/messenger/storage.d.ts +192 -0
- package/dist/esm/w/messenger/storage.js +935 -0
- package/dist/esm/w/messenger/types.d.ts +705 -0
- package/dist/esm/w/messenger/types.js +88 -0
- package/dist/esm/w/messenger/utils.d.ts +15 -0
- package/dist/esm/w/messenger/utils.js +17 -0
- package/dist/esm/w/query/bult-in.d.ts +73 -0
- package/dist/esm/w/query/bult-in.js +112 -0
- package/dist/esm/w/query/event.d.ts +82 -0
- package/dist/esm/w/query/event.js +137 -0
- package/dist/esm/w/query/index.d.ts +5 -0
- package/dist/esm/w/query/index.js +5 -0
- package/dist/esm/w/query/object.d.ts +658 -0
- package/dist/esm/w/query/object.js +1648 -0
- package/dist/esm/w/query/received.d.ts +34 -0
- package/dist/esm/w/query/received.js +73 -0
- package/dist/esm/w/query/util.d.ts +5 -0
- package/dist/esm/w/query/util.js +62 -0
- package/dist/esm/w/util.d.ts +19 -0
- package/dist/esm/w/util.js +710 -0
- package/dist/esm/zklogin/address.js +78 -0
- package/dist/esm/zklogin/bcs.js +21 -0
- package/dist/esm/zklogin/index.js +38 -0
- package/dist/esm/zklogin/jwt-decode.js +68 -0
- package/dist/esm/zklogin/jwt-utils.js +108 -0
- package/dist/esm/zklogin/nonce.js +40 -0
- package/dist/esm/zklogin/poseidon.js +61 -0
- package/dist/esm/zklogin/publickey.js +265 -0
- package/dist/esm/zklogin/signature.js +37 -0
- package/dist/esm/zklogin/utils.js +78 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +295 -61
- package/dist/arbitration.d.ts +0 -65
- package/dist/arbitration.d.ts.map +0 -1
- package/dist/arbitration.js +0 -517
- package/dist/arbitration.js.map +0 -1
- package/dist/demand.d.ts +0 -27
- package/dist/demand.d.ts.map +0 -1
- package/dist/demand.js +0 -266
- package/dist/demand.js.map +0 -1
- package/dist/entity.d.ts +0 -46
- package/dist/entity.d.ts.map +0 -1
- package/dist/entity.js +0 -146
- package/dist/entity.js.map +0 -1
- package/dist/exception.d.ts +0 -37
- package/dist/exception.d.ts.map +0 -1
- package/dist/exception.js +0 -41
- package/dist/exception.js.map +0 -1
- package/dist/guard.d.ts +0 -110
- package/dist/guard.d.ts.map +0 -1
- package/dist/guard.js +0 -936
- package/dist/guard.js.map +0 -1
- package/dist/index.d.ts +0 -40
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -28
- package/dist/index.js.map +0 -1
- package/dist/machine.d.ts +0 -68
- package/dist/machine.d.ts.map +0 -1
- package/dist/machine.js +0 -520
- package/dist/machine.js.map +0 -1
- package/dist/passport.d.ts +0 -129
- package/dist/passport.d.ts.map +0 -1
- package/dist/passport.js +0 -1233
- package/dist/passport.js.map +0 -1
- package/dist/payment.d.ts +0 -28
- package/dist/payment.d.ts.map +0 -1
- package/dist/payment.js +0 -60
- package/dist/payment.js.map +0 -1
- package/dist/permission.d.ts +0 -155
- package/dist/permission.d.ts.map +0 -1
- package/dist/permission.js +0 -462
- package/dist/permission.js.map +0 -1
- package/dist/progress.d.ts +0 -66
- package/dist/progress.d.ts.map +0 -1
- package/dist/progress.js +0 -311
- package/dist/progress.js.map +0 -1
- package/dist/protocol.d.ts +0 -247
- package/dist/protocol.d.ts.map +0 -1
- package/dist/protocol.js +0 -726
- package/dist/protocol.js.map +0 -1
- package/dist/repository.d.ts +0 -94
- package/dist/repository.d.ts.map +0 -1
- package/dist/repository.js +0 -783
- package/dist/repository.js.map +0 -1
- package/dist/resource.d.ts +0 -36
- package/dist/resource.d.ts.map +0 -1
- package/dist/resource.js +0 -129
- package/dist/resource.js.map +0 -1
- package/dist/service.d.ts +0 -144
- package/dist/service.d.ts.map +0 -1
- package/dist/service.js +0 -1303
- package/dist/service.js.map +0 -1
- package/dist/treasury.d.ts +0 -55
- package/dist/treasury.d.ts.map +0 -1
- package/dist/treasury.js +0 -393
- package/dist/treasury.js.map +0 -1
- package/dist/utils.d.ts +0 -94
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -582
- package/dist/utils.js.map +0 -1
- package/dist/wowok.d.ts +0 -15
- package/dist/wowok.d.ts.map +0 -1
- package/dist/wowok.js +0 -66
- package/dist/wowok.js.map +0 -1
|
@@ -0,0 +1,731 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
4
|
+
};
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
8
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
9
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
+
var _serializationPlugins, _buildPlugins, _intentResolvers, _inputSection, _commandSection, _availableResults, _pendingPromises, _added, _data, _Transaction_instances, fork_fn, addCommand_fn, addInput_fn, normalizeTransactionArgument_fn, resolveArgument_fn, prepareBuild_fn, runPlugins_fn, waitForPendingTasks_fn, sortCommandsAndInputs_fn;
|
|
13
|
+
import { fromBase64, isSerializedBcs } from "@mysten/bcs";
|
|
14
|
+
import { is, parse } from "valibot";
|
|
15
|
+
import { normalizeWowAddress } from "../utils/sui-types.js";
|
|
16
|
+
import { Commands } from "./Commands.js";
|
|
17
|
+
import {
|
|
18
|
+
ArgumentSchema,
|
|
19
|
+
NormalizedCallArg,
|
|
20
|
+
ObjectRefSchema,
|
|
21
|
+
TransactionExpiration
|
|
22
|
+
} from "./data/internal.js";
|
|
23
|
+
import { serializeV1TransactionData } from "./data/v1.js";
|
|
24
|
+
import { SerializedTransactionDataV2Schema } from "./data/v2.js";
|
|
25
|
+
import { Inputs } from "./Inputs.js";
|
|
26
|
+
import {
|
|
27
|
+
needsTransactionResolution,
|
|
28
|
+
resolveTransactionPlugin
|
|
29
|
+
} from "./resolve.js";
|
|
30
|
+
import { createObjectMethods } from "./object.js";
|
|
31
|
+
import { createPure } from "./pure.js";
|
|
32
|
+
import { TransactionDataBuilder } from "./TransactionData.js";
|
|
33
|
+
import { getIdFromCallArg } from "./utils.js";
|
|
34
|
+
import { namedPackagesPlugin } from "./plugins/NamedPackagesPlugin.js";
|
|
35
|
+
function createTransactionResult(index, length = Infinity) {
|
|
36
|
+
const baseResult = {
|
|
37
|
+
$kind: "Result",
|
|
38
|
+
get Result() {
|
|
39
|
+
return typeof index === "function" ? index() : index;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const nestedResults = [];
|
|
43
|
+
const nestedResultFor = (resultIndex) => nestedResults[resultIndex] ?? (nestedResults[resultIndex] = {
|
|
44
|
+
$kind: "NestedResult",
|
|
45
|
+
get NestedResult() {
|
|
46
|
+
return [
|
|
47
|
+
typeof index === "function" ? index() : index,
|
|
48
|
+
resultIndex
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return new Proxy(baseResult, {
|
|
53
|
+
set() {
|
|
54
|
+
throw new Error(
|
|
55
|
+
"The transaction result is a proxy, and does not support setting properties directly"
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
// TODO: Instead of making this return a concrete argument, we should ideally
|
|
59
|
+
// make it reference-based (so that this gets resolved at build-time), which
|
|
60
|
+
// allows re-ordering transactions.
|
|
61
|
+
get(target, property) {
|
|
62
|
+
if (property in target) {
|
|
63
|
+
return Reflect.get(target, property);
|
|
64
|
+
}
|
|
65
|
+
if (property === Symbol.iterator) {
|
|
66
|
+
return function* () {
|
|
67
|
+
let i = 0;
|
|
68
|
+
while (i < length) {
|
|
69
|
+
yield nestedResultFor(i);
|
|
70
|
+
i++;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (typeof property === "symbol") return;
|
|
75
|
+
const resultIndex = parseInt(property, 10);
|
|
76
|
+
if (Number.isNaN(resultIndex) || resultIndex < 0) return;
|
|
77
|
+
return nestedResultFor(resultIndex);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const TRANSACTION_BRAND = /* @__PURE__ */ Symbol.for("@mysten/transaction");
|
|
82
|
+
function isTransaction(obj) {
|
|
83
|
+
return !!obj && typeof obj === "object" && obj[TRANSACTION_BRAND] === true;
|
|
84
|
+
}
|
|
85
|
+
const modulePluginRegistry = {
|
|
86
|
+
buildPlugins: /* @__PURE__ */ new Map(),
|
|
87
|
+
serializationPlugins: /* @__PURE__ */ new Map()
|
|
88
|
+
};
|
|
89
|
+
const TRANSACTION_REGISTRY_KEY = /* @__PURE__ */ Symbol.for("@mysten/transaction/registry");
|
|
90
|
+
function getGlobalPluginRegistry() {
|
|
91
|
+
try {
|
|
92
|
+
const target = globalThis;
|
|
93
|
+
if (!target[TRANSACTION_REGISTRY_KEY]) {
|
|
94
|
+
target[TRANSACTION_REGISTRY_KEY] = modulePluginRegistry;
|
|
95
|
+
}
|
|
96
|
+
return target[TRANSACTION_REGISTRY_KEY];
|
|
97
|
+
} catch {
|
|
98
|
+
return modulePluginRegistry;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const _Transaction = class _Transaction {
|
|
102
|
+
constructor() {
|
|
103
|
+
__privateAdd(this, _Transaction_instances);
|
|
104
|
+
__privateAdd(this, _serializationPlugins);
|
|
105
|
+
__privateAdd(this, _buildPlugins);
|
|
106
|
+
__privateAdd(this, _intentResolvers, /* @__PURE__ */ new Map());
|
|
107
|
+
__privateAdd(this, _inputSection, []);
|
|
108
|
+
__privateAdd(this, _commandSection, []);
|
|
109
|
+
__privateAdd(this, _availableResults, /* @__PURE__ */ new Set());
|
|
110
|
+
__privateAdd(this, _pendingPromises, /* @__PURE__ */ new Set());
|
|
111
|
+
__privateAdd(this, _added, /* @__PURE__ */ new Map());
|
|
112
|
+
__privateAdd(this, _data);
|
|
113
|
+
/**
|
|
114
|
+
* Add a new object input to the transaction.
|
|
115
|
+
*/
|
|
116
|
+
__publicField(this, "object", createObjectMethods(
|
|
117
|
+
(value) => {
|
|
118
|
+
if (typeof value === "function") {
|
|
119
|
+
return this.object(
|
|
120
|
+
this.add(
|
|
121
|
+
value
|
|
122
|
+
)
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
if (typeof value === "object" && is(ArgumentSchema, value)) {
|
|
126
|
+
return value;
|
|
127
|
+
}
|
|
128
|
+
const id = getIdFromCallArg(value);
|
|
129
|
+
const inserted = __privateGet(this, _data).inputs.find(
|
|
130
|
+
(i) => id === getIdFromCallArg(i)
|
|
131
|
+
);
|
|
132
|
+
if (inserted?.Object?.SharedObject && typeof value === "object" && value.Object?.SharedObject) {
|
|
133
|
+
inserted.Object.SharedObject.mutable = inserted.Object.SharedObject.mutable || value.Object.SharedObject.mutable;
|
|
134
|
+
}
|
|
135
|
+
return inserted ? {
|
|
136
|
+
$kind: "Input",
|
|
137
|
+
Input: __privateGet(this, _data).inputs.indexOf(inserted),
|
|
138
|
+
type: "object"
|
|
139
|
+
} : __privateMethod(this, _Transaction_instances, addInput_fn).call(this, "object", typeof value === "string" ? {
|
|
140
|
+
$kind: "UnresolvedObject",
|
|
141
|
+
UnresolvedObject: {
|
|
142
|
+
objectId: normalizeWowAddress(value)
|
|
143
|
+
}
|
|
144
|
+
} : value);
|
|
145
|
+
}
|
|
146
|
+
));
|
|
147
|
+
const globalPlugins = getGlobalPluginRegistry();
|
|
148
|
+
__privateSet(this, _data, new TransactionDataBuilder());
|
|
149
|
+
__privateSet(this, _buildPlugins, [...globalPlugins.buildPlugins.values()]);
|
|
150
|
+
__privateSet(this, _serializationPlugins, [
|
|
151
|
+
...globalPlugins.serializationPlugins.values()
|
|
152
|
+
]);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Converts from a serialize transaction kind (built with `build({ onlyTransactionKind: true })`) to a `Transaction` class.
|
|
156
|
+
* Supports either a byte array, or base64-encoded bytes.
|
|
157
|
+
*/
|
|
158
|
+
static fromKind(serialized) {
|
|
159
|
+
const tx = new _Transaction();
|
|
160
|
+
__privateSet(tx, _data, TransactionDataBuilder.fromKindBytes(
|
|
161
|
+
typeof serialized === "string" ? fromBase64(serialized) : serialized
|
|
162
|
+
));
|
|
163
|
+
__privateSet(tx, _inputSection, __privateGet(tx, _data).inputs.slice());
|
|
164
|
+
__privateSet(tx, _commandSection, __privateGet(tx, _data).commands.slice());
|
|
165
|
+
__privateSet(tx, _availableResults, new Set(__privateGet(tx, _commandSection).map((_, i) => i)));
|
|
166
|
+
return tx;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Converts from a serialized transaction format to a `Transaction` class.
|
|
170
|
+
* There are two supported serialized formats:
|
|
171
|
+
* - A string returned from `Transaction#serialize`. The serialized format must be compatible, or it will throw an error.
|
|
172
|
+
* - A byte array (or base64-encoded bytes) containing BCS transaction data.
|
|
173
|
+
*/
|
|
174
|
+
static from(transaction) {
|
|
175
|
+
const newTransaction = new _Transaction();
|
|
176
|
+
if (isTransaction(transaction)) {
|
|
177
|
+
__privateSet(newTransaction, _data, TransactionDataBuilder.restore(
|
|
178
|
+
transaction.getData()
|
|
179
|
+
));
|
|
180
|
+
} else if (typeof transaction !== "string" || !transaction.startsWith("{")) {
|
|
181
|
+
__privateSet(newTransaction, _data, TransactionDataBuilder.fromBytes(
|
|
182
|
+
typeof transaction === "string" ? fromBase64(transaction) : transaction
|
|
183
|
+
));
|
|
184
|
+
} else {
|
|
185
|
+
__privateSet(newTransaction, _data, TransactionDataBuilder.restore(
|
|
186
|
+
JSON.parse(transaction)
|
|
187
|
+
));
|
|
188
|
+
}
|
|
189
|
+
__privateSet(newTransaction, _inputSection, __privateGet(newTransaction, _data).inputs.slice());
|
|
190
|
+
__privateSet(newTransaction, _commandSection, __privateGet(newTransaction, _data).commands.slice());
|
|
191
|
+
__privateSet(newTransaction, _availableResults, new Set(
|
|
192
|
+
__privateGet(newTransaction, _commandSection).map((_, i) => i)
|
|
193
|
+
));
|
|
194
|
+
return newTransaction;
|
|
195
|
+
}
|
|
196
|
+
static registerGlobalSerializationPlugin(stepOrStep, step) {
|
|
197
|
+
getGlobalPluginRegistry().serializationPlugins.set(
|
|
198
|
+
stepOrStep,
|
|
199
|
+
step ?? stepOrStep
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
static unregisterGlobalSerializationPlugin(name) {
|
|
203
|
+
getGlobalPluginRegistry().serializationPlugins.delete(name);
|
|
204
|
+
}
|
|
205
|
+
static registerGlobalBuildPlugin(stepOrStep, step) {
|
|
206
|
+
getGlobalPluginRegistry().buildPlugins.set(
|
|
207
|
+
stepOrStep,
|
|
208
|
+
step ?? stepOrStep
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
static unregisterGlobalBuildPlugin(name) {
|
|
212
|
+
getGlobalPluginRegistry().buildPlugins.delete(name);
|
|
213
|
+
}
|
|
214
|
+
addSerializationPlugin(step) {
|
|
215
|
+
__privateGet(this, _serializationPlugins).push(step);
|
|
216
|
+
}
|
|
217
|
+
addBuildPlugin(step) {
|
|
218
|
+
__privateGet(this, _buildPlugins).push(step);
|
|
219
|
+
}
|
|
220
|
+
addIntentResolver(intent, resolver) {
|
|
221
|
+
if (__privateGet(this, _intentResolvers).has(intent) && __privateGet(this, _intentResolvers).get(intent) !== resolver) {
|
|
222
|
+
throw new Error(`Intent resolver for ${intent} already exists`);
|
|
223
|
+
}
|
|
224
|
+
__privateGet(this, _intentResolvers).set(intent, resolver);
|
|
225
|
+
}
|
|
226
|
+
setSender(sender) {
|
|
227
|
+
__privateGet(this, _data).sender = sender;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Sets the sender only if it has not already been set.
|
|
231
|
+
* This is useful for sponsored transaction flows where the sender may not be the same as the signer address.
|
|
232
|
+
*/
|
|
233
|
+
setSenderIfNotSet(sender) {
|
|
234
|
+
if (!__privateGet(this, _data).sender) {
|
|
235
|
+
__privateGet(this, _data).sender = sender;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
setExpiration(expiration) {
|
|
239
|
+
__privateGet(this, _data).expiration = expiration ? parse(TransactionExpiration, expiration) : null;
|
|
240
|
+
}
|
|
241
|
+
setGasPrice(price) {
|
|
242
|
+
__privateGet(this, _data).gasConfig.price = String(price);
|
|
243
|
+
}
|
|
244
|
+
setGasBudget(budget) {
|
|
245
|
+
__privateGet(this, _data).gasConfig.budget = String(budget);
|
|
246
|
+
}
|
|
247
|
+
setGasBudgetIfNotSet(budget) {
|
|
248
|
+
if (__privateGet(this, _data).gasData.budget == null) {
|
|
249
|
+
__privateGet(this, _data).gasConfig.budget = String(budget);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
setGasOwner(owner) {
|
|
253
|
+
__privateGet(this, _data).gasConfig.owner = owner;
|
|
254
|
+
}
|
|
255
|
+
setGasPayment(payments) {
|
|
256
|
+
__privateGet(this, _data).gasConfig.payment = payments.map(
|
|
257
|
+
(payment) => parse(ObjectRefSchema, payment)
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
/** @deprecated Use `getData()` instead. */
|
|
261
|
+
get blockData() {
|
|
262
|
+
return serializeV1TransactionData(__privateGet(this, _data).snapshot());
|
|
263
|
+
}
|
|
264
|
+
/** Get a snapshot of the transaction data, in JSON form: */
|
|
265
|
+
getData() {
|
|
266
|
+
return __privateGet(this, _data).snapshot();
|
|
267
|
+
}
|
|
268
|
+
// Used to brand transaction classes so that they can be identified, even between multiple copies
|
|
269
|
+
// of the builder.
|
|
270
|
+
get [TRANSACTION_BRAND]() {
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
// Temporary workaround for the wallet interface accidentally serializing transactions via postMessage
|
|
274
|
+
get pure() {
|
|
275
|
+
Object.defineProperty(this, "pure", {
|
|
276
|
+
enumerable: false,
|
|
277
|
+
value: createPure((value) => {
|
|
278
|
+
if (isSerializedBcs(value)) {
|
|
279
|
+
return __privateMethod(this, _Transaction_instances, addInput_fn).call(this, "pure", {
|
|
280
|
+
$kind: "Pure",
|
|
281
|
+
Pure: {
|
|
282
|
+
bytes: value.toBase64()
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
return __privateMethod(this, _Transaction_instances, addInput_fn).call(this, "pure", is(NormalizedCallArg, value) ? parse(NormalizedCallArg, value) : value instanceof Uint8Array ? Inputs.Pure(value) : {
|
|
287
|
+
$kind: "UnresolvedPure",
|
|
288
|
+
UnresolvedPure: { value }
|
|
289
|
+
});
|
|
290
|
+
})
|
|
291
|
+
});
|
|
292
|
+
return this.pure;
|
|
293
|
+
}
|
|
294
|
+
/** Returns an argument for the gas coin, to be used in a transaction. */
|
|
295
|
+
get gas() {
|
|
296
|
+
return { $kind: "GasCoin", GasCoin: true };
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Add a new object input to the transaction using the fully-resolved object reference.
|
|
300
|
+
* If you only have an object ID, use `builder.object(id)` instead.
|
|
301
|
+
*/
|
|
302
|
+
objectRef(...args) {
|
|
303
|
+
return this.object(Inputs.ObjectRef(...args));
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Add a new receiving input to the transaction using the fully-resolved object reference.
|
|
307
|
+
* If you only have an object ID, use `builder.object(id)` instead.
|
|
308
|
+
*/
|
|
309
|
+
receivingRef(...args) {
|
|
310
|
+
return this.object(Inputs.ReceivingRef(...args));
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Add a new shared object input to the transaction using the fully-resolved shared object reference.
|
|
314
|
+
* If you only have an object ID, use `builder.object(id)` instead.
|
|
315
|
+
*/
|
|
316
|
+
sharedObjectRef(...args) {
|
|
317
|
+
return this.object(Inputs.SharedObjectRef(...args));
|
|
318
|
+
}
|
|
319
|
+
add(command) {
|
|
320
|
+
if (typeof command === "function") {
|
|
321
|
+
if (__privateGet(this, _added).has(command)) {
|
|
322
|
+
return __privateGet(this, _added).get(command);
|
|
323
|
+
}
|
|
324
|
+
const fork = __privateMethod(this, _Transaction_instances, fork_fn).call(this);
|
|
325
|
+
const result = command(fork);
|
|
326
|
+
if (!(result && typeof result === "object" && "then" in result)) {
|
|
327
|
+
__privateSet(this, _availableResults, __privateGet(fork, _availableResults));
|
|
328
|
+
__privateGet(this, _added).set(command, result);
|
|
329
|
+
return result;
|
|
330
|
+
}
|
|
331
|
+
const placeholder = __privateMethod(this, _Transaction_instances, addCommand_fn).call(this, {
|
|
332
|
+
$kind: "$Intent",
|
|
333
|
+
$Intent: {
|
|
334
|
+
name: "AsyncTransactionThunk",
|
|
335
|
+
inputs: {},
|
|
336
|
+
data: {
|
|
337
|
+
resultIndex: __privateGet(this, _data).commands.length,
|
|
338
|
+
result: null
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
__privateGet(this, _pendingPromises).add(
|
|
343
|
+
Promise.resolve(result).then(
|
|
344
|
+
(result2) => {
|
|
345
|
+
placeholder.$Intent.data.result = result2;
|
|
346
|
+
}
|
|
347
|
+
)
|
|
348
|
+
);
|
|
349
|
+
const txResult = createTransactionResult(
|
|
350
|
+
() => placeholder.$Intent.data.resultIndex
|
|
351
|
+
);
|
|
352
|
+
__privateGet(this, _added).set(command, txResult);
|
|
353
|
+
return txResult;
|
|
354
|
+
} else {
|
|
355
|
+
__privateMethod(this, _Transaction_instances, addCommand_fn).call(this, command);
|
|
356
|
+
}
|
|
357
|
+
return createTransactionResult(__privateGet(this, _data).commands.length - 1);
|
|
358
|
+
}
|
|
359
|
+
// Method shorthands:
|
|
360
|
+
splitCoins(coin, amounts) {
|
|
361
|
+
const command = Commands.SplitCoins(
|
|
362
|
+
typeof coin === "string" ? this.object(coin) : __privateMethod(this, _Transaction_instances, resolveArgument_fn).call(this, coin),
|
|
363
|
+
amounts.map(
|
|
364
|
+
(amount) => typeof amount === "number" || typeof amount === "bigint" || typeof amount === "string" ? this.pure.u64(amount) : __privateMethod(this, _Transaction_instances, normalizeTransactionArgument_fn).call(this, amount)
|
|
365
|
+
)
|
|
366
|
+
);
|
|
367
|
+
__privateMethod(this, _Transaction_instances, addCommand_fn).call(this, command);
|
|
368
|
+
return createTransactionResult(
|
|
369
|
+
__privateGet(this, _data).commands.length - 1,
|
|
370
|
+
amounts.length
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
mergeCoins(destination, sources) {
|
|
374
|
+
return this.add(
|
|
375
|
+
Commands.MergeCoins(
|
|
376
|
+
this.object(destination),
|
|
377
|
+
sources.map((src) => this.object(src))
|
|
378
|
+
)
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
publish({
|
|
382
|
+
modules,
|
|
383
|
+
dependencies
|
|
384
|
+
}) {
|
|
385
|
+
return this.add(
|
|
386
|
+
Commands.Publish({
|
|
387
|
+
modules,
|
|
388
|
+
dependencies
|
|
389
|
+
})
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
upgrade({
|
|
393
|
+
modules,
|
|
394
|
+
dependencies,
|
|
395
|
+
package: packageId,
|
|
396
|
+
ticket
|
|
397
|
+
}) {
|
|
398
|
+
return this.add(
|
|
399
|
+
Commands.Upgrade({
|
|
400
|
+
modules,
|
|
401
|
+
dependencies,
|
|
402
|
+
package: packageId,
|
|
403
|
+
ticket: this.object(ticket)
|
|
404
|
+
})
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
moveCall({
|
|
408
|
+
arguments: args,
|
|
409
|
+
...input
|
|
410
|
+
}) {
|
|
411
|
+
return this.add(
|
|
412
|
+
Commands.MoveCall({
|
|
413
|
+
...input,
|
|
414
|
+
arguments: args?.map(
|
|
415
|
+
(arg) => __privateMethod(this, _Transaction_instances, normalizeTransactionArgument_fn).call(this, arg)
|
|
416
|
+
)
|
|
417
|
+
})
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
transferObjects(objects, address) {
|
|
421
|
+
return this.add(
|
|
422
|
+
Commands.TransferObjects(
|
|
423
|
+
objects.map((obj) => this.object(obj)),
|
|
424
|
+
typeof address === "string" ? this.pure.address(address) : __privateMethod(this, _Transaction_instances, normalizeTransactionArgument_fn).call(this, address)
|
|
425
|
+
)
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
makeMoveVec({
|
|
429
|
+
type,
|
|
430
|
+
elements
|
|
431
|
+
}) {
|
|
432
|
+
return this.add(
|
|
433
|
+
Commands.MakeMoveVec({
|
|
434
|
+
type,
|
|
435
|
+
elements: elements.map((obj) => this.object(obj))
|
|
436
|
+
})
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* @deprecated Use toJSON instead.
|
|
441
|
+
* For synchronous serialization, you can use `getData()`
|
|
442
|
+
* */
|
|
443
|
+
serialize() {
|
|
444
|
+
return JSON.stringify(
|
|
445
|
+
serializeV1TransactionData(__privateGet(this, _data).snapshot())
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
async toJSON(options = {}) {
|
|
449
|
+
await this.prepareForSerialization(options);
|
|
450
|
+
const fullyResolved = this.isFullyResolved();
|
|
451
|
+
return JSON.stringify(
|
|
452
|
+
parse(
|
|
453
|
+
SerializedTransactionDataV2Schema,
|
|
454
|
+
fullyResolved ? {
|
|
455
|
+
...__privateGet(this, _data).snapshot(),
|
|
456
|
+
digest: __privateGet(this, _data).getDigest()
|
|
457
|
+
} : __privateGet(this, _data).snapshot()
|
|
458
|
+
),
|
|
459
|
+
(_key, value) => typeof value === "bigint" ? value.toString() : value,
|
|
460
|
+
2
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
/** Build the transaction to BCS bytes, and sign it with the provided keypair. */
|
|
464
|
+
async sign(options) {
|
|
465
|
+
const { signer, ...buildOptions } = options;
|
|
466
|
+
const bytes = await this.build(buildOptions);
|
|
467
|
+
return signer.signTransaction(bytes);
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Ensures that:
|
|
471
|
+
* - All objects have been fully resolved to a specific version
|
|
472
|
+
* - All pure inputs have been serialized to bytes
|
|
473
|
+
* - All async thunks have been fully resolved
|
|
474
|
+
* - All transaction intents have been resolved
|
|
475
|
+
* - The gas payment, budget, and price have been set
|
|
476
|
+
* - The transaction sender has been set
|
|
477
|
+
*
|
|
478
|
+
* When true, the transaction will always be built to the same bytes and digest (unless the transaction is mutated)
|
|
479
|
+
*/
|
|
480
|
+
isFullyResolved() {
|
|
481
|
+
if (!__privateGet(this, _data).sender) {
|
|
482
|
+
return false;
|
|
483
|
+
}
|
|
484
|
+
if (__privateGet(this, _pendingPromises).size > 0) {
|
|
485
|
+
return false;
|
|
486
|
+
}
|
|
487
|
+
if (__privateGet(this, _data).commands.some((cmd) => cmd.$Intent)) {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
if (needsTransactionResolution(__privateGet(this, _data), {})) {
|
|
491
|
+
return false;
|
|
492
|
+
}
|
|
493
|
+
return true;
|
|
494
|
+
}
|
|
495
|
+
/** Build the transaction to BCS bytes. */
|
|
496
|
+
async build(options = {}) {
|
|
497
|
+
await this.prepareForSerialization(options);
|
|
498
|
+
await __privateMethod(this, _Transaction_instances, prepareBuild_fn).call(this, options);
|
|
499
|
+
return __privateGet(this, _data).build({
|
|
500
|
+
onlyTransactionKind: options.onlyTransactionKind
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
/** Derive transaction digest */
|
|
504
|
+
async getDigest(options = {}) {
|
|
505
|
+
await this.prepareForSerialization(options);
|
|
506
|
+
await __privateMethod(this, _Transaction_instances, prepareBuild_fn).call(this, options);
|
|
507
|
+
return __privateGet(this, _data).getDigest();
|
|
508
|
+
}
|
|
509
|
+
async prepareForSerialization(options) {
|
|
510
|
+
await __privateMethod(this, _Transaction_instances, waitForPendingTasks_fn).call(this);
|
|
511
|
+
__privateMethod(this, _Transaction_instances, sortCommandsAndInputs_fn).call(this);
|
|
512
|
+
const intents = /* @__PURE__ */ new Set();
|
|
513
|
+
for (const command of __privateGet(this, _data).commands) {
|
|
514
|
+
if (command.$Intent) {
|
|
515
|
+
intents.add(command.$Intent.name);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
const steps = [...__privateGet(this, _serializationPlugins)];
|
|
519
|
+
for (const intent of intents) {
|
|
520
|
+
if (options.supportedIntents?.includes(intent)) {
|
|
521
|
+
continue;
|
|
522
|
+
}
|
|
523
|
+
if (!__privateGet(this, _intentResolvers).has(intent)) {
|
|
524
|
+
throw new Error(`Missing intent resolver for ${intent}`);
|
|
525
|
+
}
|
|
526
|
+
steps.push(__privateGet(this, _intentResolvers).get(intent));
|
|
527
|
+
}
|
|
528
|
+
steps.push(namedPackagesPlugin());
|
|
529
|
+
await __privateMethod(this, _Transaction_instances, runPlugins_fn).call(this, steps, options);
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
_serializationPlugins = new WeakMap();
|
|
533
|
+
_buildPlugins = new WeakMap();
|
|
534
|
+
_intentResolvers = new WeakMap();
|
|
535
|
+
_inputSection = new WeakMap();
|
|
536
|
+
_commandSection = new WeakMap();
|
|
537
|
+
_availableResults = new WeakMap();
|
|
538
|
+
_pendingPromises = new WeakMap();
|
|
539
|
+
_added = new WeakMap();
|
|
540
|
+
_data = new WeakMap();
|
|
541
|
+
_Transaction_instances = new WeakSet();
|
|
542
|
+
fork_fn = function() {
|
|
543
|
+
const fork = new _Transaction();
|
|
544
|
+
__privateSet(fork, _data, __privateGet(this, _data));
|
|
545
|
+
__privateSet(fork, _serializationPlugins, __privateGet(this, _serializationPlugins));
|
|
546
|
+
__privateSet(fork, _buildPlugins, __privateGet(this, _buildPlugins));
|
|
547
|
+
__privateSet(fork, _intentResolvers, __privateGet(this, _intentResolvers));
|
|
548
|
+
__privateSet(fork, _pendingPromises, __privateGet(this, _pendingPromises));
|
|
549
|
+
__privateSet(fork, _availableResults, new Set(__privateGet(this, _availableResults)));
|
|
550
|
+
__privateSet(fork, _added, __privateGet(this, _added));
|
|
551
|
+
__privateGet(this, _inputSection).push(__privateGet(fork, _inputSection));
|
|
552
|
+
__privateGet(this, _commandSection).push(__privateGet(fork, _commandSection));
|
|
553
|
+
return fork;
|
|
554
|
+
};
|
|
555
|
+
addCommand_fn = function(command) {
|
|
556
|
+
const resultIndex = __privateGet(this, _data).commands.length;
|
|
557
|
+
__privateGet(this, _commandSection).push(command);
|
|
558
|
+
__privateGet(this, _availableResults).add(resultIndex);
|
|
559
|
+
__privateGet(this, _data).commands.push(command);
|
|
560
|
+
__privateGet(this, _data).mapCommandArguments(resultIndex, (arg) => {
|
|
561
|
+
if (arg.$kind === "Result" && !__privateGet(this, _availableResults).has(arg.Result)) {
|
|
562
|
+
throw new Error(
|
|
563
|
+
`Result { Result: ${arg.Result} } is not available to use in the current transaction`
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
if (arg.$kind === "NestedResult" && !__privateGet(this, _availableResults).has(arg.NestedResult[0])) {
|
|
567
|
+
throw new Error(
|
|
568
|
+
`Result { NestedResult: [${arg.NestedResult[0]}, ${arg.NestedResult[1]}] } is not available to use in the current transaction`
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
if (arg.$kind === "Input" && arg.Input >= __privateGet(this, _data).inputs.length) {
|
|
572
|
+
throw new Error(
|
|
573
|
+
`Input { Input: ${arg.Input} } references an input that does not exist in the current transaction`
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
return arg;
|
|
577
|
+
});
|
|
578
|
+
return command;
|
|
579
|
+
};
|
|
580
|
+
addInput_fn = function(type, input) {
|
|
581
|
+
__privateGet(this, _inputSection).push(input);
|
|
582
|
+
return __privateGet(this, _data).addInput(type, input);
|
|
583
|
+
};
|
|
584
|
+
normalizeTransactionArgument_fn = function(arg) {
|
|
585
|
+
if (isSerializedBcs(arg)) {
|
|
586
|
+
return this.pure(arg);
|
|
587
|
+
}
|
|
588
|
+
return __privateMethod(this, _Transaction_instances, resolveArgument_fn).call(this, arg);
|
|
589
|
+
};
|
|
590
|
+
resolveArgument_fn = function(arg) {
|
|
591
|
+
if (typeof arg === "function") {
|
|
592
|
+
const resolved = this.add(arg);
|
|
593
|
+
if (typeof resolved === "function") {
|
|
594
|
+
return __privateMethod(this, _Transaction_instances, resolveArgument_fn).call(this, resolved);
|
|
595
|
+
}
|
|
596
|
+
return parse(ArgumentSchema, resolved);
|
|
597
|
+
}
|
|
598
|
+
return parse(ArgumentSchema, arg);
|
|
599
|
+
};
|
|
600
|
+
prepareBuild_fn = async function(options) {
|
|
601
|
+
if (!options.onlyTransactionKind && !__privateGet(this, _data).sender) {
|
|
602
|
+
throw new Error("Missing transaction sender");
|
|
603
|
+
}
|
|
604
|
+
await __privateMethod(this, _Transaction_instances, runPlugins_fn).call(this, [...__privateGet(this, _buildPlugins), resolveTransactionPlugin], options);
|
|
605
|
+
};
|
|
606
|
+
runPlugins_fn = async function(plugins, options) {
|
|
607
|
+
try {
|
|
608
|
+
const createNext = (i) => {
|
|
609
|
+
if (i >= plugins.length) {
|
|
610
|
+
return () => {
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
const plugin = plugins[i];
|
|
614
|
+
return async () => {
|
|
615
|
+
const next = createNext(i + 1);
|
|
616
|
+
let calledNext = false;
|
|
617
|
+
let nextResolved = false;
|
|
618
|
+
await plugin(__privateGet(this, _data), options, async () => {
|
|
619
|
+
if (calledNext) {
|
|
620
|
+
throw new Error(
|
|
621
|
+
`next() was call multiple times in TransactionPlugin ${i}`
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
calledNext = true;
|
|
625
|
+
await next();
|
|
626
|
+
nextResolved = true;
|
|
627
|
+
});
|
|
628
|
+
if (!calledNext) {
|
|
629
|
+
throw new Error(
|
|
630
|
+
`next() was not called in TransactionPlugin ${i}`
|
|
631
|
+
);
|
|
632
|
+
}
|
|
633
|
+
if (!nextResolved) {
|
|
634
|
+
throw new Error(
|
|
635
|
+
`next() was not awaited in TransactionPlugin ${i}`
|
|
636
|
+
);
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
};
|
|
640
|
+
await createNext(0)();
|
|
641
|
+
} finally {
|
|
642
|
+
__privateSet(this, _inputSection, __privateGet(this, _data).inputs.slice());
|
|
643
|
+
__privateSet(this, _commandSection, __privateGet(this, _data).commands.slice());
|
|
644
|
+
__privateSet(this, _availableResults, new Set(
|
|
645
|
+
__privateGet(this, _commandSection).map((_, i) => i)
|
|
646
|
+
));
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
waitForPendingTasks_fn = async function() {
|
|
650
|
+
while (__privateGet(this, _pendingPromises).size > 0) {
|
|
651
|
+
const newPromise = Promise.all(__privateGet(this, _pendingPromises));
|
|
652
|
+
__privateGet(this, _pendingPromises).clear();
|
|
653
|
+
__privateGet(this, _pendingPromises).add(newPromise);
|
|
654
|
+
await newPromise;
|
|
655
|
+
__privateGet(this, _pendingPromises).delete(newPromise);
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
sortCommandsAndInputs_fn = function() {
|
|
659
|
+
const unorderedCommands = __privateGet(this, _data).commands;
|
|
660
|
+
const unorderedInputs = __privateGet(this, _data).inputs;
|
|
661
|
+
const orderedCommands = __privateGet(this, _commandSection).flat(
|
|
662
|
+
Infinity
|
|
663
|
+
);
|
|
664
|
+
const orderedInputs = __privateGet(this, _inputSection).flat(Infinity);
|
|
665
|
+
if (orderedCommands.length !== unorderedCommands.length) {
|
|
666
|
+
throw new Error(
|
|
667
|
+
"Unexpected number of commands found in transaction data"
|
|
668
|
+
);
|
|
669
|
+
}
|
|
670
|
+
if (orderedInputs.length !== unorderedInputs.length) {
|
|
671
|
+
throw new Error(
|
|
672
|
+
"Unexpected number of inputs found in transaction data"
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
const filteredCommands = orderedCommands.filter(
|
|
676
|
+
(cmd) => cmd.$Intent?.name !== "AsyncTransactionThunk"
|
|
677
|
+
);
|
|
678
|
+
__privateGet(this, _data).commands = filteredCommands;
|
|
679
|
+
__privateGet(this, _data).inputs = orderedInputs;
|
|
680
|
+
__privateSet(this, _commandSection, filteredCommands);
|
|
681
|
+
__privateSet(this, _inputSection, orderedInputs);
|
|
682
|
+
__privateSet(this, _availableResults, new Set(filteredCommands.map((_, i) => i)));
|
|
683
|
+
function getOriginalIndex(index) {
|
|
684
|
+
const command = unorderedCommands[index];
|
|
685
|
+
if (command.$Intent?.name === "AsyncTransactionThunk") {
|
|
686
|
+
const result = command.$Intent.data.result;
|
|
687
|
+
if (result == null) {
|
|
688
|
+
throw new Error(
|
|
689
|
+
"AsyncTransactionThunk has not been resolved"
|
|
690
|
+
);
|
|
691
|
+
}
|
|
692
|
+
return getOriginalIndex(result.Result);
|
|
693
|
+
}
|
|
694
|
+
const updated = filteredCommands.indexOf(command);
|
|
695
|
+
if (updated === -1) {
|
|
696
|
+
throw new Error("Unable to find original index for command");
|
|
697
|
+
}
|
|
698
|
+
return updated;
|
|
699
|
+
}
|
|
700
|
+
__privateGet(this, _data).mapArguments((arg) => {
|
|
701
|
+
if (arg.$kind === "Input") {
|
|
702
|
+
const updated = orderedInputs.indexOf(
|
|
703
|
+
unorderedInputs[arg.Input]
|
|
704
|
+
);
|
|
705
|
+
if (updated === -1) {
|
|
706
|
+
throw new Error("Input has not been resolved");
|
|
707
|
+
}
|
|
708
|
+
return { ...arg, Input: updated };
|
|
709
|
+
} else if (arg.$kind === "Result") {
|
|
710
|
+
const updated = getOriginalIndex(arg.Result);
|
|
711
|
+
return { ...arg, Result: updated };
|
|
712
|
+
} else if (arg.$kind === "NestedResult") {
|
|
713
|
+
const updated = getOriginalIndex(arg.NestedResult[0]);
|
|
714
|
+
return { ...arg, NestedResult: [updated, arg.NestedResult[1]] };
|
|
715
|
+
}
|
|
716
|
+
return arg;
|
|
717
|
+
});
|
|
718
|
+
for (const [i, cmd] of unorderedCommands.entries()) {
|
|
719
|
+
if (cmd.$Intent?.name === "AsyncTransactionThunk") {
|
|
720
|
+
try {
|
|
721
|
+
cmd.$Intent.data.resultIndex = getOriginalIndex(i);
|
|
722
|
+
} catch {
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
let Transaction = _Transaction;
|
|
728
|
+
export {
|
|
729
|
+
Transaction,
|
|
730
|
+
isTransaction
|
|
731
|
+
};
|