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,715 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var util_exports = {};
|
|
20
|
+
__export(util_exports, {
|
|
21
|
+
bcsBytesToValue: () => bcsBytesToValue,
|
|
22
|
+
extractCoinType: () => extractCoinType,
|
|
23
|
+
isValidValueContainer: () => isValidValueContainer,
|
|
24
|
+
owner_receive: () => owner_receive,
|
|
25
|
+
parseObjectType: () => parseObjectType,
|
|
26
|
+
parseRecipient: () => parseRecipient,
|
|
27
|
+
parseTypeParameter: () => parseTypeParameter,
|
|
28
|
+
permission_set: () => permission_set,
|
|
29
|
+
uint2address: () => uint2address,
|
|
30
|
+
validObjects: () => validObjects,
|
|
31
|
+
valueToBcsBytes: () => valueToBcsBytes
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(util_exports);
|
|
34
|
+
var import_bcs = require("../bcs/index.js");
|
|
35
|
+
var import_common = require("./common.js");
|
|
36
|
+
var import_exception = require("./exception.js");
|
|
37
|
+
var import_local = require("./local/index.js");
|
|
38
|
+
var import_common2 = require("./common.js");
|
|
39
|
+
var import_sui_types = require("../utils/sui-types.js");
|
|
40
|
+
var import_local2 = require("./local/local.js");
|
|
41
|
+
var import_local3 = require("./local/local.js");
|
|
42
|
+
const isValidValueContainer = (container) => {
|
|
43
|
+
try {
|
|
44
|
+
valueToBcsBytes(container.valueType, container.value);
|
|
45
|
+
return true;
|
|
46
|
+
} catch {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const toU64Value = (value) => {
|
|
51
|
+
if (typeof value === "string") {
|
|
52
|
+
if (value.length > 15) {
|
|
53
|
+
return BigInt(value);
|
|
54
|
+
} else {
|
|
55
|
+
const num = parseInt(value, 10);
|
|
56
|
+
return Number.isInteger(num) ? num : BigInt(value);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return value;
|
|
60
|
+
};
|
|
61
|
+
const toU128Value = (value) => {
|
|
62
|
+
if (typeof value === "bigint") {
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
if (typeof value === "string") {
|
|
66
|
+
return BigInt(value);
|
|
67
|
+
}
|
|
68
|
+
return BigInt(value);
|
|
69
|
+
};
|
|
70
|
+
const toU256Value = (value) => {
|
|
71
|
+
if (typeof value === "bigint") {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
if (typeof value === "string") {
|
|
75
|
+
return BigInt(value);
|
|
76
|
+
}
|
|
77
|
+
return BigInt(value);
|
|
78
|
+
};
|
|
79
|
+
const valueToBcsBytes = async (valueType, value) => {
|
|
80
|
+
if (!(0, import_common.isValidValueType)(valueType)) {
|
|
81
|
+
(0, import_exception.W_ERROR)(import_exception.WErrors.InvalidParam, `Invalid ValueType: ${valueType}`);
|
|
82
|
+
return new Uint8Array(0);
|
|
83
|
+
}
|
|
84
|
+
const result = new Uint8Array(1);
|
|
85
|
+
result[0] = valueType;
|
|
86
|
+
try {
|
|
87
|
+
let serializedValue;
|
|
88
|
+
switch (valueType) {
|
|
89
|
+
case import_common.ValueType.Bool:
|
|
90
|
+
serializedValue = import_bcs.bcs.Bool.serialize(
|
|
91
|
+
value
|
|
92
|
+
).toBytes();
|
|
93
|
+
break;
|
|
94
|
+
case import_common.ValueType.Address: {
|
|
95
|
+
let addressValue;
|
|
96
|
+
let errorDetails = "";
|
|
97
|
+
if (typeof value === "string") {
|
|
98
|
+
addressValue = await (0, import_local.GetAccountOrMark_Address)({
|
|
99
|
+
name_or_address: value
|
|
100
|
+
});
|
|
101
|
+
errorDetails = `string: ${value}`;
|
|
102
|
+
} else if (value && typeof value === "object" && "name_or_address" in value) {
|
|
103
|
+
const accountOrMarkAddr = value;
|
|
104
|
+
addressValue = await (0, import_local.GetAccountOrMark_Address)(accountOrMarkAddr);
|
|
105
|
+
errorDetails = `AccountOrMark_Address: ${JSON.stringify(value)}`;
|
|
106
|
+
} else {
|
|
107
|
+
addressValue = void 0;
|
|
108
|
+
errorDetails = `type: ${typeof value}, value: ${JSON.stringify(value)}`;
|
|
109
|
+
}
|
|
110
|
+
if (addressValue === void 0) {
|
|
111
|
+
(0, import_exception.W_ERROR)(
|
|
112
|
+
import_exception.WErrors.InvalidParam,
|
|
113
|
+
`Expected valid Address for ValueType.Address, but failed to resolve ${errorDetails}. Address may not exist in local accounts or marks.`
|
|
114
|
+
);
|
|
115
|
+
return new Uint8Array(0);
|
|
116
|
+
}
|
|
117
|
+
serializedValue = import_bcs.bcs.Address.serialize(addressValue).toBytes();
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
case import_common.ValueType.String:
|
|
121
|
+
serializedValue = import_bcs.bcs.String.serialize(
|
|
122
|
+
value
|
|
123
|
+
).toBytes();
|
|
124
|
+
break;
|
|
125
|
+
case import_common.ValueType.U8:
|
|
126
|
+
if (!(0, import_common.isValidU8)(value)) {
|
|
127
|
+
(0, import_exception.W_ERROR)(
|
|
128
|
+
import_exception.WErrors.InvalidParam,
|
|
129
|
+
`Expected valid U8 for ValueType.U8, got ${JSON.stringify(value)}`
|
|
130
|
+
);
|
|
131
|
+
return new Uint8Array(0);
|
|
132
|
+
}
|
|
133
|
+
serializedValue = import_bcs.bcs.U8.serialize(value).toBytes();
|
|
134
|
+
break;
|
|
135
|
+
case import_common.ValueType.U16:
|
|
136
|
+
if (!(0, import_common.isValidU16)(value)) {
|
|
137
|
+
(0, import_exception.W_ERROR)(
|
|
138
|
+
import_exception.WErrors.InvalidParam,
|
|
139
|
+
`Expected valid U16 for ValueType.U16, got ${JSON.stringify(value)}`
|
|
140
|
+
);
|
|
141
|
+
return new Uint8Array(0);
|
|
142
|
+
}
|
|
143
|
+
serializedValue = import_bcs.bcs.U16.serialize(value).toBytes();
|
|
144
|
+
break;
|
|
145
|
+
case import_common.ValueType.U32:
|
|
146
|
+
if (!(0, import_common.isValidU32)(value)) {
|
|
147
|
+
(0, import_exception.W_ERROR)(
|
|
148
|
+
import_exception.WErrors.InvalidParam,
|
|
149
|
+
`Expected valid U32 for ValueType.U32, got ${JSON.stringify(value)}`
|
|
150
|
+
);
|
|
151
|
+
return new Uint8Array(0);
|
|
152
|
+
}
|
|
153
|
+
serializedValue = import_bcs.bcs.U32.serialize(value).toBytes();
|
|
154
|
+
break;
|
|
155
|
+
case import_common.ValueType.U64:
|
|
156
|
+
if (!(0, import_common.isValidU64)(value)) {
|
|
157
|
+
(0, import_exception.W_ERROR)(
|
|
158
|
+
import_exception.WErrors.InvalidParam,
|
|
159
|
+
`Expected valid U64 for ValueType.U64, got ${JSON.stringify(value)}`
|
|
160
|
+
);
|
|
161
|
+
return new Uint8Array(0);
|
|
162
|
+
}
|
|
163
|
+
serializedValue = import_bcs.bcs.U64.serialize(
|
|
164
|
+
toU64Value(value)
|
|
165
|
+
).toBytes();
|
|
166
|
+
break;
|
|
167
|
+
case import_common.ValueType.U128:
|
|
168
|
+
if (!(0, import_common.isValidU128)(value)) {
|
|
169
|
+
(0, import_exception.W_ERROR)(
|
|
170
|
+
import_exception.WErrors.InvalidParam,
|
|
171
|
+
`Expected valid U128 for ValueType.U128, got ${JSON.stringify(value)}`
|
|
172
|
+
);
|
|
173
|
+
return new Uint8Array(0);
|
|
174
|
+
}
|
|
175
|
+
serializedValue = import_bcs.bcs.U128.serialize(
|
|
176
|
+
toU128Value(value)
|
|
177
|
+
).toBytes();
|
|
178
|
+
break;
|
|
179
|
+
case import_common.ValueType.U256:
|
|
180
|
+
if (!(0, import_common.isValidU256)(value)) {
|
|
181
|
+
(0, import_exception.W_ERROR)(
|
|
182
|
+
import_exception.WErrors.InvalidParam,
|
|
183
|
+
`Expected valid U256 for ValueType.U256, got ${JSON.stringify(value)}`
|
|
184
|
+
);
|
|
185
|
+
return new Uint8Array(0);
|
|
186
|
+
}
|
|
187
|
+
serializedValue = import_bcs.bcs.U256.serialize(
|
|
188
|
+
toU256Value(value)
|
|
189
|
+
).toBytes();
|
|
190
|
+
break;
|
|
191
|
+
case import_common.ValueType.VecBool:
|
|
192
|
+
if (!Array.isArray(value)) {
|
|
193
|
+
(0, import_exception.W_ERROR)(
|
|
194
|
+
import_exception.WErrors.InvalidParam,
|
|
195
|
+
`Expected array for ValueType.VecBool, got ${typeof value}`
|
|
196
|
+
);
|
|
197
|
+
return new Uint8Array(0);
|
|
198
|
+
}
|
|
199
|
+
for (const item of value) {
|
|
200
|
+
if (typeof item !== "boolean") {
|
|
201
|
+
(0, import_exception.W_ERROR)(
|
|
202
|
+
import_exception.WErrors.InvalidParam,
|
|
203
|
+
`Expected boolean in VecBool, got ${typeof item}`
|
|
204
|
+
);
|
|
205
|
+
return new Uint8Array(0);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
serializedValue = import_bcs.bcs.vector(import_bcs.bcs.Bool).serialize(value).toBytes();
|
|
209
|
+
break;
|
|
210
|
+
case import_common.ValueType.VecAddress:
|
|
211
|
+
const r = await (0, import_local.GetManyAccountOrMark_Address)(
|
|
212
|
+
value
|
|
213
|
+
);
|
|
214
|
+
serializedValue = import_bcs.bcs.vector(import_bcs.bcs.Address).serialize(r).toBytes();
|
|
215
|
+
break;
|
|
216
|
+
case import_common.ValueType.VecString:
|
|
217
|
+
if (!Array.isArray(value)) {
|
|
218
|
+
(0, import_exception.W_ERROR)(
|
|
219
|
+
import_exception.WErrors.InvalidParam,
|
|
220
|
+
`Expected array for ValueType.VecString, got ${typeof value}`
|
|
221
|
+
);
|
|
222
|
+
return new Uint8Array(0);
|
|
223
|
+
}
|
|
224
|
+
for (const item of value) {
|
|
225
|
+
if (typeof item !== "string") {
|
|
226
|
+
(0, import_exception.W_ERROR)(
|
|
227
|
+
import_exception.WErrors.InvalidParam,
|
|
228
|
+
`Expected string in VecString, got ${typeof item}`
|
|
229
|
+
);
|
|
230
|
+
return new Uint8Array(0);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
serializedValue = import_bcs.bcs.vector(import_bcs.bcs.String).serialize(value).toBytes();
|
|
234
|
+
break;
|
|
235
|
+
case import_common.ValueType.VecU8:
|
|
236
|
+
if (value instanceof Uint8Array) {
|
|
237
|
+
serializedValue = import_bcs.bcs.vector(import_bcs.bcs.U8).serialize(Array.from(value)).toBytes();
|
|
238
|
+
} else if (Array.isArray(value)) {
|
|
239
|
+
for (const item of value) {
|
|
240
|
+
if (!(0, import_common.isValidU8)(item)) {
|
|
241
|
+
(0, import_exception.W_ERROR)(
|
|
242
|
+
import_exception.WErrors.InvalidParam,
|
|
243
|
+
`Expected valid U8 in VecU8, got ${item}`
|
|
244
|
+
);
|
|
245
|
+
return new Uint8Array(0);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
serializedValue = import_bcs.bcs.vector(import_bcs.bcs.U8).serialize(value).toBytes();
|
|
249
|
+
} else {
|
|
250
|
+
(0, import_exception.W_ERROR)(
|
|
251
|
+
import_exception.WErrors.InvalidParam,
|
|
252
|
+
`Expected Uint8Array or array for ValueType.VecU8, got ${typeof value}`
|
|
253
|
+
);
|
|
254
|
+
return new Uint8Array(0);
|
|
255
|
+
}
|
|
256
|
+
break;
|
|
257
|
+
case import_common.ValueType.VecU16:
|
|
258
|
+
if (!Array.isArray(value)) {
|
|
259
|
+
(0, import_exception.W_ERROR)(
|
|
260
|
+
import_exception.WErrors.InvalidParam,
|
|
261
|
+
`Expected array for ValueType.VecU16, got ${typeof value}`
|
|
262
|
+
);
|
|
263
|
+
return new Uint8Array(0);
|
|
264
|
+
}
|
|
265
|
+
for (const item of value) {
|
|
266
|
+
if (!(0, import_common.isValidU16)(item)) {
|
|
267
|
+
(0, import_exception.W_ERROR)(
|
|
268
|
+
import_exception.WErrors.InvalidParam,
|
|
269
|
+
`Expected valid U16 in VecU16, got ${item}`
|
|
270
|
+
);
|
|
271
|
+
return new Uint8Array(0);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
serializedValue = import_bcs.bcs.vector(import_bcs.bcs.U16).serialize(value).toBytes();
|
|
275
|
+
break;
|
|
276
|
+
case import_common.ValueType.VecU32:
|
|
277
|
+
if (!Array.isArray(value)) {
|
|
278
|
+
(0, import_exception.W_ERROR)(
|
|
279
|
+
import_exception.WErrors.InvalidParam,
|
|
280
|
+
`Expected array for ValueType.VecU32, got ${typeof value}`
|
|
281
|
+
);
|
|
282
|
+
return new Uint8Array(0);
|
|
283
|
+
}
|
|
284
|
+
for (const item of value) {
|
|
285
|
+
if (!(0, import_common.isValidU32)(item)) {
|
|
286
|
+
(0, import_exception.W_ERROR)(
|
|
287
|
+
import_exception.WErrors.InvalidParam,
|
|
288
|
+
`Expected valid U32 in VecU32, got ${item}`
|
|
289
|
+
);
|
|
290
|
+
return new Uint8Array(0);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
serializedValue = import_bcs.bcs.vector(import_bcs.bcs.U32).serialize(value).toBytes();
|
|
294
|
+
break;
|
|
295
|
+
case import_common.ValueType.VecU64:
|
|
296
|
+
if (!Array.isArray(value)) {
|
|
297
|
+
(0, import_exception.W_ERROR)(
|
|
298
|
+
import_exception.WErrors.InvalidParam,
|
|
299
|
+
`Expected array for ValueType.VecU64, got ${typeof value}`
|
|
300
|
+
);
|
|
301
|
+
return new Uint8Array(0);
|
|
302
|
+
}
|
|
303
|
+
for (const item of value) {
|
|
304
|
+
if (!(0, import_common.isValidU64)(item)) {
|
|
305
|
+
(0, import_exception.W_ERROR)(
|
|
306
|
+
import_exception.WErrors.InvalidParam,
|
|
307
|
+
`Expected valid U64 in VecU64, got ${item}`
|
|
308
|
+
);
|
|
309
|
+
return new Uint8Array(0);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
const vecU64Values = value.map(toU64Value);
|
|
313
|
+
serializedValue = import_bcs.bcs.vector(import_bcs.bcs.U64).serialize(vecU64Values).toBytes();
|
|
314
|
+
break;
|
|
315
|
+
case import_common.ValueType.VecU128:
|
|
316
|
+
if (!Array.isArray(value)) {
|
|
317
|
+
(0, import_exception.W_ERROR)(
|
|
318
|
+
import_exception.WErrors.InvalidParam,
|
|
319
|
+
`Expected array for ValueType.VecU128, got ${typeof value}`
|
|
320
|
+
);
|
|
321
|
+
return new Uint8Array(0);
|
|
322
|
+
}
|
|
323
|
+
for (const item of value) {
|
|
324
|
+
if (!(0, import_common.isValidU128)(item)) {
|
|
325
|
+
(0, import_exception.W_ERROR)(
|
|
326
|
+
import_exception.WErrors.InvalidParam,
|
|
327
|
+
`Expected valid U128 in VecU128, got ${item}`
|
|
328
|
+
);
|
|
329
|
+
return new Uint8Array(0);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
const vecU128Values = value.map(toU128Value);
|
|
333
|
+
serializedValue = import_bcs.bcs.vector(import_bcs.bcs.U128).serialize(vecU128Values).toBytes();
|
|
334
|
+
break;
|
|
335
|
+
case import_common.ValueType.VecU256:
|
|
336
|
+
if (!Array.isArray(value)) {
|
|
337
|
+
(0, import_exception.W_ERROR)(
|
|
338
|
+
import_exception.WErrors.InvalidParam,
|
|
339
|
+
`Expected array for ValueType.VecU256, got ${typeof value}`
|
|
340
|
+
);
|
|
341
|
+
return new Uint8Array(0);
|
|
342
|
+
}
|
|
343
|
+
for (const item of value) {
|
|
344
|
+
if (!(0, import_common.isValidU256)(item)) {
|
|
345
|
+
(0, import_exception.W_ERROR)(
|
|
346
|
+
import_exception.WErrors.InvalidParam,
|
|
347
|
+
`Expected valid U256 in VecU256, got ${item}`
|
|
348
|
+
);
|
|
349
|
+
return new Uint8Array(0);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
const vecU256Values = value.map(toU256Value);
|
|
353
|
+
serializedValue = import_bcs.bcs.vector(import_bcs.bcs.U256).serialize(vecU256Values).toBytes();
|
|
354
|
+
break;
|
|
355
|
+
case import_common.ValueType.VecVecU8:
|
|
356
|
+
if (!Array.isArray(value)) {
|
|
357
|
+
(0, import_exception.W_ERROR)(
|
|
358
|
+
import_exception.WErrors.InvalidParam,
|
|
359
|
+
`Expected array for ValueType.VecVecU8, got ${typeof value}`
|
|
360
|
+
);
|
|
361
|
+
return new Uint8Array(0);
|
|
362
|
+
}
|
|
363
|
+
for (const item of value) {
|
|
364
|
+
if (!(item instanceof Uint8Array || Array.isArray(item))) {
|
|
365
|
+
(0, import_exception.W_ERROR)(
|
|
366
|
+
import_exception.WErrors.InvalidParam,
|
|
367
|
+
`Expected Uint8Array or array in VecVecU8, got ${typeof item}`
|
|
368
|
+
);
|
|
369
|
+
return new Uint8Array(0);
|
|
370
|
+
}
|
|
371
|
+
if (Array.isArray(item)) {
|
|
372
|
+
for (const subItem of item) {
|
|
373
|
+
if (!(0, import_common.isValidU8)(subItem)) {
|
|
374
|
+
(0, import_exception.W_ERROR)(
|
|
375
|
+
import_exception.WErrors.InvalidParam,
|
|
376
|
+
`Expected valid U8 in VecVecU8, got ${subItem}`
|
|
377
|
+
);
|
|
378
|
+
return new Uint8Array(0);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
const vecVecU8 = value.map(
|
|
384
|
+
(item) => item instanceof Uint8Array ? Array.from(item) : item
|
|
385
|
+
);
|
|
386
|
+
serializedValue = import_bcs.bcs.vector(import_bcs.bcs.vector(import_bcs.bcs.U8)).serialize(vecVecU8).toBytes();
|
|
387
|
+
break;
|
|
388
|
+
case import_common.ValueType.Value:
|
|
389
|
+
const container = value;
|
|
390
|
+
if (!container || typeof container !== "object" || !("valueType" in container) || !("value" in container)) {
|
|
391
|
+
(0, import_exception.W_ERROR)(
|
|
392
|
+
import_exception.WErrors.InvalidParam,
|
|
393
|
+
`Expected ValueContainer for ValueType.Value, got ${JSON.stringify(value)}`
|
|
394
|
+
);
|
|
395
|
+
return new Uint8Array(0);
|
|
396
|
+
}
|
|
397
|
+
if (!(0, import_common.isValidValueType)(container.valueType)) {
|
|
398
|
+
(0, import_exception.W_ERROR)(
|
|
399
|
+
import_exception.WErrors.InvalidParam,
|
|
400
|
+
`Invalid inner ValueType in ValueContainer: ${container.valueType}`
|
|
401
|
+
);
|
|
402
|
+
return new Uint8Array(0);
|
|
403
|
+
}
|
|
404
|
+
serializedValue = await valueToBcsBytes(
|
|
405
|
+
container.valueType,
|
|
406
|
+
container.value
|
|
407
|
+
);
|
|
408
|
+
break;
|
|
409
|
+
default:
|
|
410
|
+
(0, import_exception.W_ERROR)(
|
|
411
|
+
import_exception.WErrors.InvalidParam,
|
|
412
|
+
`Unsupported ValueType: ${valueType}`
|
|
413
|
+
);
|
|
414
|
+
return new Uint8Array(0);
|
|
415
|
+
}
|
|
416
|
+
const finalResult = new Uint8Array(
|
|
417
|
+
result.length + serializedValue.length
|
|
418
|
+
);
|
|
419
|
+
finalResult.set(result, 0);
|
|
420
|
+
finalResult.set(serializedValue, 1);
|
|
421
|
+
return finalResult;
|
|
422
|
+
} catch (error) {
|
|
423
|
+
(0, import_exception.W_ERROR)(
|
|
424
|
+
import_exception.WErrors.InvalidParam,
|
|
425
|
+
`BCS serialization failed: ${error.message}`
|
|
426
|
+
);
|
|
427
|
+
return new Uint8Array(0);
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
const bcsBytesToValue = (bytes, valueType) => {
|
|
431
|
+
if (bytes.length === 0) {
|
|
432
|
+
(0, import_exception.W_ERROR)(import_exception.WErrors.InvalidParam, "Empty bytes array");
|
|
433
|
+
return void 0;
|
|
434
|
+
}
|
|
435
|
+
const actualValueType = valueType ?? bytes[0];
|
|
436
|
+
if (!(0, import_common.isValidValueType)(actualValueType)) {
|
|
437
|
+
(0, import_exception.W_ERROR)(
|
|
438
|
+
import_exception.WErrors.InvalidParam,
|
|
439
|
+
`Invalid ValueType in bytes: ${actualValueType}`
|
|
440
|
+
);
|
|
441
|
+
return void 0;
|
|
442
|
+
}
|
|
443
|
+
if (bytes.length < 2) {
|
|
444
|
+
return void 0;
|
|
445
|
+
}
|
|
446
|
+
const dataBytes = bytes.slice(1);
|
|
447
|
+
try {
|
|
448
|
+
switch (actualValueType) {
|
|
449
|
+
case import_common.ValueType.Bool:
|
|
450
|
+
return import_bcs.bcs.Bool.parse(dataBytes);
|
|
451
|
+
case import_common.ValueType.Address:
|
|
452
|
+
return import_bcs.bcs.Address.parse(dataBytes);
|
|
453
|
+
case import_common.ValueType.String:
|
|
454
|
+
return import_bcs.bcs.String.parse(dataBytes);
|
|
455
|
+
case import_common.ValueType.U8:
|
|
456
|
+
return import_bcs.bcs.U8.parse(dataBytes);
|
|
457
|
+
case import_common.ValueType.U16:
|
|
458
|
+
return import_bcs.bcs.U16.parse(dataBytes);
|
|
459
|
+
case import_common.ValueType.U32:
|
|
460
|
+
return import_bcs.bcs.U32.parse(dataBytes);
|
|
461
|
+
case import_common.ValueType.U64:
|
|
462
|
+
return import_bcs.bcs.U64.parse(dataBytes);
|
|
463
|
+
case import_common.ValueType.U128:
|
|
464
|
+
return import_bcs.bcs.U128.parse(dataBytes);
|
|
465
|
+
case import_common.ValueType.U256:
|
|
466
|
+
return import_bcs.bcs.U256.parse(dataBytes);
|
|
467
|
+
case import_common.ValueType.VecBool:
|
|
468
|
+
return import_bcs.bcs.vector(import_bcs.bcs.Bool).parse(dataBytes);
|
|
469
|
+
case import_common.ValueType.VecAddress:
|
|
470
|
+
const addresses = import_bcs.bcs.vector(import_bcs.bcs.Address).parse(dataBytes);
|
|
471
|
+
return {
|
|
472
|
+
entities: addresses.map((addr) => ({
|
|
473
|
+
name_or_address: addr
|
|
474
|
+
}))
|
|
475
|
+
};
|
|
476
|
+
case import_common.ValueType.VecString:
|
|
477
|
+
return import_bcs.bcs.vector(import_bcs.bcs.String).parse(dataBytes);
|
|
478
|
+
case import_common.ValueType.VecU8:
|
|
479
|
+
return import_bcs.bcs.vector(import_bcs.bcs.U8).parse(dataBytes);
|
|
480
|
+
case import_common.ValueType.VecU16:
|
|
481
|
+
return import_bcs.bcs.vector(import_bcs.bcs.U16).parse(dataBytes);
|
|
482
|
+
case import_common.ValueType.VecU32:
|
|
483
|
+
return import_bcs.bcs.vector(import_bcs.bcs.U32).parse(dataBytes);
|
|
484
|
+
case import_common.ValueType.VecU64:
|
|
485
|
+
return import_bcs.bcs.vector(import_bcs.bcs.U64).parse(dataBytes);
|
|
486
|
+
case import_common.ValueType.VecU128:
|
|
487
|
+
return import_bcs.bcs.vector(import_bcs.bcs.U128).parse(dataBytes);
|
|
488
|
+
case import_common.ValueType.VecU256:
|
|
489
|
+
return import_bcs.bcs.vector(import_bcs.bcs.U256).parse(dataBytes);
|
|
490
|
+
case import_common.ValueType.VecVecU8:
|
|
491
|
+
return import_bcs.bcs.vector(import_bcs.bcs.vector(import_bcs.bcs.U8)).parse(dataBytes);
|
|
492
|
+
default:
|
|
493
|
+
(0, import_exception.W_ERROR)(
|
|
494
|
+
import_exception.WErrors.InvalidParam,
|
|
495
|
+
`Unsupported ValueType for deserialization: ${actualValueType}`
|
|
496
|
+
);
|
|
497
|
+
return void 0;
|
|
498
|
+
}
|
|
499
|
+
} catch (error) {
|
|
500
|
+
(0, import_exception.W_ERROR)(
|
|
501
|
+
import_exception.WErrors.InvalidParam,
|
|
502
|
+
`BCS deserialization failed: ${error.message}`
|
|
503
|
+
);
|
|
504
|
+
return void 0;
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
const parseObjectType = (chain_type, header = "payment::Payment") => {
|
|
508
|
+
header += "<";
|
|
509
|
+
if (chain_type && (0, import_common.isThisPackage)(chain_type)) {
|
|
510
|
+
const i = chain_type.indexOf(header);
|
|
511
|
+
if (i > 0) {
|
|
512
|
+
const r = chain_type.slice(
|
|
513
|
+
i + header.length,
|
|
514
|
+
chain_type.length - 1
|
|
515
|
+
);
|
|
516
|
+
return r;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
return void 0;
|
|
520
|
+
};
|
|
521
|
+
const parseTypeParameter = (type) => {
|
|
522
|
+
if (!type || !type.startsWith(import_common.PackageAddress)) {
|
|
523
|
+
return void 0;
|
|
524
|
+
}
|
|
525
|
+
const openIndex = type.indexOf("<");
|
|
526
|
+
const closeIndex = type.lastIndexOf(">");
|
|
527
|
+
if (openIndex === -1 || closeIndex === -1 || openIndex >= closeIndex) {
|
|
528
|
+
return void 0;
|
|
529
|
+
}
|
|
530
|
+
return type.slice(openIndex + 1, closeIndex);
|
|
531
|
+
};
|
|
532
|
+
const extractCoinType = (type) => {
|
|
533
|
+
if (!type || !type.startsWith(import_common.PackageAddress)) {
|
|
534
|
+
return void 0;
|
|
535
|
+
}
|
|
536
|
+
const escapedPackageAddress = import_common.PackageAddress.replace(
|
|
537
|
+
/[.*+?^${}()|[\]\\]/g,
|
|
538
|
+
"\\$&"
|
|
539
|
+
);
|
|
540
|
+
const coinPattern = new RegExp(
|
|
541
|
+
`${escapedPackageAddress}::[^:]+::[^<]+<${escapedPackageAddress}::coin::Coin<([^>]+)>>`
|
|
542
|
+
);
|
|
543
|
+
const match = type.match(coinPattern);
|
|
544
|
+
if (match && match[1]) {
|
|
545
|
+
return match[1];
|
|
546
|
+
}
|
|
547
|
+
return void 0;
|
|
548
|
+
};
|
|
549
|
+
async function owner_receive(tx, object, permission, param, caller_type, fnBuilder, passport) {
|
|
550
|
+
validObjects([object, permission, passport]);
|
|
551
|
+
if (caller_type && !(0, import_common.IsValidArgType)(caller_type)) {
|
|
552
|
+
(0, import_exception.W_ERROR)(
|
|
553
|
+
import_exception.WErrors.IsValidArgType,
|
|
554
|
+
`caller_type ${caller_type} is invalid`
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
if (Array.isArray(param)) {
|
|
558
|
+
for (const item of param) {
|
|
559
|
+
if (!item.type || !(0, import_common.IsValidArgType)(item.type)) {
|
|
560
|
+
(0, import_exception.W_ERROR)(import_exception.WErrors.IsValidArgType, `type ${item.type} is invalid`);
|
|
561
|
+
}
|
|
562
|
+
if (passport) {
|
|
563
|
+
const r = await import_local2.LocalMark.Instance().get_address(item.id);
|
|
564
|
+
if (!r) {
|
|
565
|
+
(0, import_exception.W_ERROR)(
|
|
566
|
+
import_exception.WErrors.IsValidArgType,
|
|
567
|
+
`Received ${item.id} is invalid`
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
tx.moveCall({
|
|
571
|
+
target: fnBuilder("owner_receive_object_with_passport"),
|
|
572
|
+
arguments: [
|
|
573
|
+
(0, import_common2.toTxObject)(tx, object),
|
|
574
|
+
(0, import_common2.toTxObject)(tx, permission),
|
|
575
|
+
(0, import_common2.toTxObject)(tx, passport),
|
|
576
|
+
(0, import_common2.toTxObject)(tx, r)
|
|
577
|
+
],
|
|
578
|
+
typeArguments: caller_type ? [caller_type, item.type] : [item.type]
|
|
579
|
+
});
|
|
580
|
+
} else {
|
|
581
|
+
const r = await import_local2.LocalMark.Instance().get_address(item.id);
|
|
582
|
+
if (!r) {
|
|
583
|
+
(0, import_exception.W_ERROR)(
|
|
584
|
+
import_exception.WErrors.IsValidArgType,
|
|
585
|
+
`Received ${item.id} is invalid`
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
tx.moveCall({
|
|
589
|
+
target: fnBuilder("owner_receive_object"),
|
|
590
|
+
arguments: [
|
|
591
|
+
(0, import_common2.toTxObject)(tx, object),
|
|
592
|
+
(0, import_common2.toTxObject)(tx, permission),
|
|
593
|
+
(0, import_common2.toTxObject)(tx, r)
|
|
594
|
+
],
|
|
595
|
+
typeArguments: caller_type ? [caller_type, item.type] : [item.type]
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
} else {
|
|
600
|
+
const match = param.token_type.match(/CoinWrapper<([^>]+)>/);
|
|
601
|
+
if (!match) {
|
|
602
|
+
(0, import_exception.W_ERROR)(
|
|
603
|
+
import_exception.WErrors.IsValidArgType,
|
|
604
|
+
`Invalid CoinWrapper type: ${param.token_type}`
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
const t = match[1];
|
|
608
|
+
if (!(0, import_common.IsValidArgType)(t)) {
|
|
609
|
+
(0, import_exception.W_ERROR)(import_exception.WErrors.IsValidArgType, `Invalid CoinWrapper type: ${t}`);
|
|
610
|
+
}
|
|
611
|
+
for (const item of param.received) {
|
|
612
|
+
const [r, p] = await Promise.all([
|
|
613
|
+
import_local2.LocalMark.Instance().get_address(item.id),
|
|
614
|
+
import_local2.LocalMark.Instance().get_address(item.payment)
|
|
615
|
+
]);
|
|
616
|
+
if (!r || !p) {
|
|
617
|
+
(0, import_exception.W_ERROR)(
|
|
618
|
+
import_exception.WErrors.IsValidArgType,
|
|
619
|
+
`Received ${item.id} or Payment ${item.payment} is invalid`
|
|
620
|
+
);
|
|
621
|
+
}
|
|
622
|
+
if (passport) {
|
|
623
|
+
tx.moveCall({
|
|
624
|
+
target: fnBuilder("owner_receive_with_passport"),
|
|
625
|
+
arguments: [
|
|
626
|
+
(0, import_common2.toTxObject)(tx, object),
|
|
627
|
+
(0, import_common2.toTxObject)(tx, permission),
|
|
628
|
+
(0, import_common2.toTxObject)(tx, passport),
|
|
629
|
+
(0, import_common2.toTxObject)(tx, r),
|
|
630
|
+
(0, import_common2.toTxObject)(tx, p)
|
|
631
|
+
],
|
|
632
|
+
typeArguments: caller_type ? [caller_type, t] : [t]
|
|
633
|
+
});
|
|
634
|
+
} else {
|
|
635
|
+
tx.moveCall({
|
|
636
|
+
target: fnBuilder("owner_receive"),
|
|
637
|
+
arguments: [
|
|
638
|
+
(0, import_common2.toTxObject)(tx, object),
|
|
639
|
+
(0, import_common2.toTxObject)(tx, permission),
|
|
640
|
+
(0, import_common2.toTxObject)(tx, r),
|
|
641
|
+
(0, import_common2.toTxObject)(tx, p)
|
|
642
|
+
],
|
|
643
|
+
typeArguments: caller_type ? [caller_type, t] : [t]
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
function permission_set(tx, object, old_permission, new_permission, caller_type, fnBuilder) {
|
|
650
|
+
validObjects([object, old_permission, new_permission]);
|
|
651
|
+
if (caller_type && !(0, import_common.IsValidArgType)(caller_type)) {
|
|
652
|
+
(0, import_exception.W_ERROR)(
|
|
653
|
+
import_exception.WErrors.IsValidArgType,
|
|
654
|
+
`caller_type ${caller_type} is invalid`
|
|
655
|
+
);
|
|
656
|
+
}
|
|
657
|
+
tx.moveCall({
|
|
658
|
+
target: fnBuilder("permission_set"),
|
|
659
|
+
arguments: [
|
|
660
|
+
(0, import_common2.toTxObject)(tx, object),
|
|
661
|
+
(0, import_common2.toTxObject)(tx, old_permission),
|
|
662
|
+
(0, import_common2.toTxObject)(tx, new_permission),
|
|
663
|
+
tx.object.mutRegistrar(),
|
|
664
|
+
tx.object.clock()
|
|
665
|
+
],
|
|
666
|
+
typeArguments: caller_type ? [caller_type] : []
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
const validObjects = (objects, allowNull = true) => {
|
|
670
|
+
objects.forEach((item, index) => {
|
|
671
|
+
if (typeof item === "string" && item != null) {
|
|
672
|
+
if (!(0, import_local3.isValidAddress)(item)) {
|
|
673
|
+
(0, import_exception.W_ERROR)(import_exception.WErrors.IsValidAddress, `Address is invalid: ${item}`);
|
|
674
|
+
}
|
|
675
|
+
} else {
|
|
676
|
+
if (!allowNull && !item) {
|
|
677
|
+
(0, import_exception.W_ERROR)(
|
|
678
|
+
import_exception.WErrors.IsValidAddress,
|
|
679
|
+
`Address is required at index ${index} in objects ${objects}`
|
|
680
|
+
);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
};
|
|
685
|
+
const uint2address = (value) => {
|
|
686
|
+
return (0, import_sui_types.normalizeWowAddress)(value.toString(16));
|
|
687
|
+
};
|
|
688
|
+
const parseRecipient = (whoData) => {
|
|
689
|
+
if (!whoData || !whoData.variant) {
|
|
690
|
+
(0, import_exception.W_ERROR)(
|
|
691
|
+
import_exception.WErrors.ParseObjectContentFailed,
|
|
692
|
+
`Invalid who data: ${JSON.stringify(whoData)}`
|
|
693
|
+
);
|
|
694
|
+
}
|
|
695
|
+
if (whoData.variant === "GuardIdentifier" && whoData.fields) {
|
|
696
|
+
return {
|
|
697
|
+
GuardIdentifier: Number(whoData.fields.pos0)
|
|
698
|
+
};
|
|
699
|
+
} else if (whoData.variant === "Entity" && whoData.fields) {
|
|
700
|
+
return {
|
|
701
|
+
Entity: {
|
|
702
|
+
name_or_address: whoData.fields.pos0
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
} else if (whoData.variant === "Signer") {
|
|
706
|
+
return {
|
|
707
|
+
Signer: null
|
|
708
|
+
};
|
|
709
|
+
} else {
|
|
710
|
+
(0, import_exception.W_ERROR)(
|
|
711
|
+
import_exception.WErrors.ParseObjectContentFailed,
|
|
712
|
+
`Invalid who variant: ${whoData.variant}`
|
|
713
|
+
);
|
|
714
|
+
}
|
|
715
|
+
};
|