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,1192 @@
|
|
|
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 __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21
|
+
var treasury_exports = {};
|
|
22
|
+
__export(treasury_exports, {
|
|
23
|
+
CallTreasury: () => CallTreasury,
|
|
24
|
+
MAX_EXTERNAL_DEPOSIT_GUARD_COUNT: () => MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,
|
|
25
|
+
MAX_EXTERNAL_WITHDRAW_GUARD_COUNT: () => MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,
|
|
26
|
+
create: () => create,
|
|
27
|
+
deposit: () => deposit,
|
|
28
|
+
description_set: () => description_set,
|
|
29
|
+
external_deposit: () => external_deposit,
|
|
30
|
+
external_deposit_guard_add: () => external_deposit_guard_add,
|
|
31
|
+
external_deposit_guard_clear: () => external_deposit_guard_clear,
|
|
32
|
+
external_deposit_guard_remove: () => external_deposit_guard_remove,
|
|
33
|
+
external_withdraw: () => external_withdraw,
|
|
34
|
+
external_withdraw_guard_add: () => external_withdraw_guard_add,
|
|
35
|
+
external_withdraw_guard_clear: () => external_withdraw_guard_clear,
|
|
36
|
+
external_withdraw_guard_remove: () => external_withdraw_guard_remove,
|
|
37
|
+
newTreasury: () => newTreasury,
|
|
38
|
+
receive: () => receive,
|
|
39
|
+
um_set: () => um_set,
|
|
40
|
+
withdraw: () => withdraw
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(treasury_exports);
|
|
43
|
+
var import_common = require("../common.js");
|
|
44
|
+
var import_exception = require("../exception.js");
|
|
45
|
+
var import_object = require("../query/object.js");
|
|
46
|
+
var import_util = require("../util.js");
|
|
47
|
+
var import_base = require("./base.js");
|
|
48
|
+
var import_permission = require("./permission.js");
|
|
49
|
+
var import_local = require("../local/index.js");
|
|
50
|
+
var import_local2 = require("../local/local.js");
|
|
51
|
+
var import_permission2 = require("./permission.js");
|
|
52
|
+
var import_payment = require("./payment.js");
|
|
53
|
+
var import_received = require("../query/received.js");
|
|
54
|
+
class CallTreasury extends import_base.CallBase {
|
|
55
|
+
constructor(data) {
|
|
56
|
+
super();
|
|
57
|
+
__publicField(this, "data");
|
|
58
|
+
__publicField(this, "object_address");
|
|
59
|
+
__publicField(this, "permission_address");
|
|
60
|
+
__publicField(this, "new_permission_description");
|
|
61
|
+
__publicField(this, "parameter_type");
|
|
62
|
+
this.data = data;
|
|
63
|
+
}
|
|
64
|
+
async prepare(env) {
|
|
65
|
+
await super.prepare(env);
|
|
66
|
+
if (!this.object_address) {
|
|
67
|
+
this.object_address = await (0, import_common.GetObjectExisted)(this.data?.object);
|
|
68
|
+
}
|
|
69
|
+
if (this.object_address) {
|
|
70
|
+
await this.update_content(
|
|
71
|
+
env,
|
|
72
|
+
import_object.ObjectType.Treasury,
|
|
73
|
+
this.object_address
|
|
74
|
+
);
|
|
75
|
+
if (!this.content)
|
|
76
|
+
(0, import_exception.W_ERROR)(
|
|
77
|
+
import_exception.WErrors.InvalidParam,
|
|
78
|
+
"CallTreasury_Data.data.object:" + this.object_address
|
|
79
|
+
);
|
|
80
|
+
this.permission_address = this.content.permission;
|
|
81
|
+
this.parameter_type = (0, import_util.parseObjectType)(
|
|
82
|
+
this.content.type_raw,
|
|
83
|
+
"treasury::Treasury"
|
|
84
|
+
);
|
|
85
|
+
if (!this.permission_address) {
|
|
86
|
+
(0, import_exception.W_ERROR)(
|
|
87
|
+
import_exception.WErrors.InvalidParam,
|
|
88
|
+
"CallTreasury_Data.data.object.permission is empty"
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
if (!(0, import_common.IsValidArgType)(this.parameter_type)) {
|
|
92
|
+
(0, import_exception.W_ERROR)(
|
|
93
|
+
import_exception.WErrors.IsValidArgType,
|
|
94
|
+
"CallTreasury_Data.data.object.type_parameter is empty"
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
const n = (0, import_common.GetObject)(
|
|
99
|
+
this.data.object
|
|
100
|
+
);
|
|
101
|
+
this.permission_address = await (0, import_common.GetObjectExisted)(n?.permission);
|
|
102
|
+
this.new_permission_description = (0, import_common.GetObjectDescription)(
|
|
103
|
+
n?.permission
|
|
104
|
+
);
|
|
105
|
+
this.parameter_type = n?.type_parameter;
|
|
106
|
+
if (!(0, import_common.IsValidArgType)(this.parameter_type)) {
|
|
107
|
+
(0, import_exception.W_ERROR)(
|
|
108
|
+
import_exception.WErrors.IsValidArgType,
|
|
109
|
+
"CallTreasury_Data.data.object.type_parameter invalid"
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async call(env) {
|
|
115
|
+
await this.prepare(env);
|
|
116
|
+
const guards = [];
|
|
117
|
+
const perms = [];
|
|
118
|
+
const add_guard = (guard) => {
|
|
119
|
+
if (!guards.includes(guard)) {
|
|
120
|
+
guards.push(guard);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const add_perm = (index) => {
|
|
124
|
+
if (this.permission_address && !perms.includes(index)) {
|
|
125
|
+
perms.push(index);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
if (this.permission_address && !this.object_address) {
|
|
129
|
+
add_perm(import_permission.BuiltinPermissionIndex.TREASURY_NEW);
|
|
130
|
+
}
|
|
131
|
+
if (this.permission_address && this.data?.description != null && this.object_address) {
|
|
132
|
+
add_perm(import_permission.BuiltinPermissionIndex.TREASURY_DESCRIPTION);
|
|
133
|
+
}
|
|
134
|
+
if (this.permission_address && this.data?.receive != null) {
|
|
135
|
+
add_perm(import_permission.BuiltinPermissionIndex.TREASURY_RECEIVE);
|
|
136
|
+
}
|
|
137
|
+
if (this.data?.deposit != null) {
|
|
138
|
+
if (this.data.deposit.by_external_deposit_guard) {
|
|
139
|
+
const guard = await import_local2.LocalMark.Instance().get_address(
|
|
140
|
+
this.data.deposit.by_external_deposit_guard
|
|
141
|
+
);
|
|
142
|
+
if (guard) {
|
|
143
|
+
add_guard(guard);
|
|
144
|
+
this.data.deposit.by_external_deposit_guard = guard;
|
|
145
|
+
} else {
|
|
146
|
+
(0, import_exception.W_ERROR)(
|
|
147
|
+
import_exception.WErrors.InvalidParam,
|
|
148
|
+
`external_deposit_guard ${this.data.deposit.by_external_deposit_guard} not found`
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
if (this.permission_address) {
|
|
153
|
+
add_perm(import_permission.BuiltinPermissionIndex.TREASURY_DEPOSIT);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (this.data?.withdraw != null) {
|
|
158
|
+
const withdraw2 = this.data.withdraw;
|
|
159
|
+
if (withdraw2 && withdraw2.amount) {
|
|
160
|
+
if ("fixed" in withdraw2.amount) {
|
|
161
|
+
if (this.permission_address) {
|
|
162
|
+
add_perm(import_permission.BuiltinPermissionIndex.TREASURY_WITHDRAW);
|
|
163
|
+
}
|
|
164
|
+
} else if ("by_external_withdraw_guard" in withdraw2.amount) {
|
|
165
|
+
const guard = await import_local2.LocalMark.Instance().get_address(
|
|
166
|
+
withdraw2.amount.by_external_withdraw_guard
|
|
167
|
+
);
|
|
168
|
+
if (guard) {
|
|
169
|
+
withdraw2.amount.by_external_withdraw_guard = guard;
|
|
170
|
+
add_guard(guard);
|
|
171
|
+
} else {
|
|
172
|
+
(0, import_exception.W_ERROR)(
|
|
173
|
+
import_exception.WErrors.InvalidParam,
|
|
174
|
+
`by_external_withdraw_guard ${withdraw2.amount.by_external_withdraw_guard} not found`
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (this.permission_address && this.data?.external_deposit_guard != null) {
|
|
181
|
+
add_perm(import_permission.BuiltinPermissionIndex.TREASURY_EXTERNAL_DEPOSIT_GUARD);
|
|
182
|
+
}
|
|
183
|
+
if (this.permission_address && this.data?.external_withdraw_guard != null) {
|
|
184
|
+
add_perm(import_permission.BuiltinPermissionIndex.TREASURY_EXTERNAL_WITHDRAW_GUARD);
|
|
185
|
+
}
|
|
186
|
+
if (this.permission_address && this.data?.owner_receive != null) {
|
|
187
|
+
add_perm(import_permission.BuiltinPermissionIndex.TREASURY_OWNER_RECEIVE);
|
|
188
|
+
}
|
|
189
|
+
if (this.permission_address && this.data?.um !== void 0) {
|
|
190
|
+
add_perm(import_permission.BuiltinPermissionIndex.TREASURY_UM);
|
|
191
|
+
}
|
|
192
|
+
if (this.permission_address || guards.length > 0) {
|
|
193
|
+
return await this.check_permission_and_call(
|
|
194
|
+
env,
|
|
195
|
+
this.permission_address,
|
|
196
|
+
perms,
|
|
197
|
+
guards
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
return await this.exec(env);
|
|
201
|
+
}
|
|
202
|
+
async operate(env, tx, passport, submission) {
|
|
203
|
+
let permission = this.permission_address;
|
|
204
|
+
let object = this.object_address;
|
|
205
|
+
const content = this.content;
|
|
206
|
+
if (!this.object_address) {
|
|
207
|
+
if (!permission) {
|
|
208
|
+
permission = (0, import_permission.newPermission)(
|
|
209
|
+
tx,
|
|
210
|
+
this.new_permission_description ?? ""
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
if (permission && this.parameter_type) {
|
|
214
|
+
object = newTreasury(
|
|
215
|
+
tx,
|
|
216
|
+
this.parameter_type,
|
|
217
|
+
permission,
|
|
218
|
+
this.data?.description ?? "",
|
|
219
|
+
passport
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (!object || !permission) {
|
|
224
|
+
(0, import_exception.W_ERROR)(
|
|
225
|
+
import_exception.WErrors.InvalidParam,
|
|
226
|
+
"CallTreasury_Data.data.object:" + this.object_address
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
if (this.data.description != null && !this.object_address) {
|
|
230
|
+
description_set(
|
|
231
|
+
tx,
|
|
232
|
+
object,
|
|
233
|
+
this.parameter_type,
|
|
234
|
+
permission,
|
|
235
|
+
this.data.description,
|
|
236
|
+
passport
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
if (this.data.receive != null && this.object_address) {
|
|
240
|
+
if (this.data.receive === "recently") {
|
|
241
|
+
const received = await (0, import_received.query_received)({
|
|
242
|
+
object: this.object_address,
|
|
243
|
+
network: env.network,
|
|
244
|
+
no_cache: env.no_cache
|
|
245
|
+
});
|
|
246
|
+
if (Array.isArray(received)) {
|
|
247
|
+
(0, import_exception.W_ERROR)(
|
|
248
|
+
import_exception.WErrors.InvalidParam,
|
|
249
|
+
"CallAllocation_Data.data.received_coins: received is ReceivedNormal[]"
|
|
250
|
+
);
|
|
251
|
+
} else {
|
|
252
|
+
this.data.receive = received;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (typeof this.data.receive === "object" && "received" in this.data.receive && this.data.receive.received?.length > 0) {
|
|
256
|
+
if (this.data.receive.token_type !== this.parameter_type) {
|
|
257
|
+
(0, import_exception.W_ERROR)(
|
|
258
|
+
import_exception.WErrors.InvalidParam,
|
|
259
|
+
`token_type ${this.data.receive.token_type} is not equal to parameter_type ${this.parameter_type}`
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
for (const item of this.data.receive.received) {
|
|
263
|
+
const [received_object, payment_object] = await Promise.all(
|
|
264
|
+
[
|
|
265
|
+
import_local2.LocalMark.Instance().get_address(item.id),
|
|
266
|
+
import_local2.LocalMark.Instance().get_address(item.payment)
|
|
267
|
+
]
|
|
268
|
+
);
|
|
269
|
+
if (received_object && payment_object) {
|
|
270
|
+
receive(
|
|
271
|
+
tx,
|
|
272
|
+
object,
|
|
273
|
+
this.parameter_type,
|
|
274
|
+
permission,
|
|
275
|
+
received_object,
|
|
276
|
+
payment_object,
|
|
277
|
+
passport
|
|
278
|
+
);
|
|
279
|
+
} else {
|
|
280
|
+
(0, import_exception.W_ERROR)(
|
|
281
|
+
import_exception.WErrors.IsValidArgType,
|
|
282
|
+
`Receive object ${item.id} or payment object ${item.payment} not found`
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (this.data.deposit != null) {
|
|
289
|
+
if (this.data.deposit.by_external_deposit_guard) {
|
|
290
|
+
if (!passport) {
|
|
291
|
+
(0, import_exception.W_ERROR)(
|
|
292
|
+
import_exception.WErrors.InvalidParam,
|
|
293
|
+
"Passport is required for external deposit"
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
await this.new_with_mark(
|
|
297
|
+
env,
|
|
298
|
+
tx,
|
|
299
|
+
import_object.ObjectType.Payment,
|
|
300
|
+
await external_deposit(
|
|
301
|
+
env,
|
|
302
|
+
tx,
|
|
303
|
+
object,
|
|
304
|
+
this.parameter_type,
|
|
305
|
+
passport,
|
|
306
|
+
this.data.deposit.by_external_deposit_guard,
|
|
307
|
+
this.data.deposit.coin,
|
|
308
|
+
this.data.deposit.payment_info
|
|
309
|
+
),
|
|
310
|
+
this.data.deposit.namedNewPayment
|
|
311
|
+
);
|
|
312
|
+
} else {
|
|
313
|
+
await this.new_with_mark(
|
|
314
|
+
env,
|
|
315
|
+
tx,
|
|
316
|
+
import_object.ObjectType.Payment,
|
|
317
|
+
await deposit(
|
|
318
|
+
env,
|
|
319
|
+
tx,
|
|
320
|
+
object,
|
|
321
|
+
this.parameter_type,
|
|
322
|
+
permission,
|
|
323
|
+
this.data.deposit.coin,
|
|
324
|
+
this.data.deposit.payment_info,
|
|
325
|
+
passport
|
|
326
|
+
),
|
|
327
|
+
this.data.deposit.namedNewPayment
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if (this.data.withdraw != null && this.data.withdraw.amount) {
|
|
332
|
+
if ("fixed" in this.data.withdraw.amount) {
|
|
333
|
+
await this.new_with_mark(
|
|
334
|
+
env,
|
|
335
|
+
tx,
|
|
336
|
+
import_object.ObjectType.Payment,
|
|
337
|
+
await withdraw(
|
|
338
|
+
env,
|
|
339
|
+
tx,
|
|
340
|
+
object,
|
|
341
|
+
this.parameter_type,
|
|
342
|
+
permission,
|
|
343
|
+
this.data.withdraw.amount.fixed,
|
|
344
|
+
this.data.withdraw.recipient,
|
|
345
|
+
this.data.withdraw.payment_info,
|
|
346
|
+
passport
|
|
347
|
+
),
|
|
348
|
+
this.data.withdraw.namedNewPayment
|
|
349
|
+
);
|
|
350
|
+
} else if ("by_external_withdraw_guard" in this.data.withdraw.amount) {
|
|
351
|
+
if (!passport) {
|
|
352
|
+
(0, import_exception.W_ERROR)(
|
|
353
|
+
import_exception.WErrors.InvalidParam,
|
|
354
|
+
"Passport is required for external withdraw"
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
await this.new_with_mark(
|
|
358
|
+
env,
|
|
359
|
+
tx,
|
|
360
|
+
import_object.ObjectType.Payment,
|
|
361
|
+
await external_withdraw(
|
|
362
|
+
env,
|
|
363
|
+
tx,
|
|
364
|
+
object,
|
|
365
|
+
this.parameter_type,
|
|
366
|
+
passport,
|
|
367
|
+
this.data.withdraw.amount.by_external_withdraw_guard,
|
|
368
|
+
this.data.withdraw.recipient,
|
|
369
|
+
this.data.withdraw.payment_info
|
|
370
|
+
),
|
|
371
|
+
this.data.withdraw.namedNewPayment
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (this.data.external_deposit_guard != null) {
|
|
376
|
+
switch (this.data.external_deposit_guard.op) {
|
|
377
|
+
case "add":
|
|
378
|
+
case "set": {
|
|
379
|
+
if (this.data.external_deposit_guard.op === "set") {
|
|
380
|
+
external_deposit_guard_clear(
|
|
381
|
+
tx,
|
|
382
|
+
object,
|
|
383
|
+
this.parameter_type,
|
|
384
|
+
permission,
|
|
385
|
+
passport
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
await external_deposit_guard_add(
|
|
389
|
+
tx,
|
|
390
|
+
object,
|
|
391
|
+
this.parameter_type,
|
|
392
|
+
permission,
|
|
393
|
+
this.data.external_deposit_guard.guards,
|
|
394
|
+
MAX_EXTERNAL_DEPOSIT_GUARD_COUNT - (content?.external_deposit_guard?.length ?? 0),
|
|
395
|
+
passport
|
|
396
|
+
);
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
case "remove": {
|
|
400
|
+
await external_deposit_guard_remove(
|
|
401
|
+
tx,
|
|
402
|
+
object,
|
|
403
|
+
this.parameter_type,
|
|
404
|
+
permission,
|
|
405
|
+
this.data.external_deposit_guard.guards,
|
|
406
|
+
content?.external_deposit_guard?.length ?? 0,
|
|
407
|
+
passport
|
|
408
|
+
);
|
|
409
|
+
break;
|
|
410
|
+
}
|
|
411
|
+
case "clear": {
|
|
412
|
+
external_deposit_guard_clear(
|
|
413
|
+
tx,
|
|
414
|
+
object,
|
|
415
|
+
this.parameter_type,
|
|
416
|
+
permission,
|
|
417
|
+
passport
|
|
418
|
+
);
|
|
419
|
+
break;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
if (this.data.external_withdraw_guard != null) {
|
|
424
|
+
switch (this.data.external_withdraw_guard.op) {
|
|
425
|
+
case "add":
|
|
426
|
+
case "set": {
|
|
427
|
+
if (this.data.external_withdraw_guard.op === "set") {
|
|
428
|
+
external_withdraw_guard_clear(
|
|
429
|
+
tx,
|
|
430
|
+
object,
|
|
431
|
+
this.parameter_type,
|
|
432
|
+
permission,
|
|
433
|
+
passport
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
await external_withdraw_guard_add(
|
|
437
|
+
tx,
|
|
438
|
+
object,
|
|
439
|
+
this.parameter_type,
|
|
440
|
+
permission,
|
|
441
|
+
this.data.external_withdraw_guard.guards,
|
|
442
|
+
MAX_EXTERNAL_WITHDRAW_GUARD_COUNT - (content?.external_withdraw_guard?.length ?? 0),
|
|
443
|
+
passport
|
|
444
|
+
);
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
case "remove": {
|
|
448
|
+
await external_withdraw_guard_remove(
|
|
449
|
+
tx,
|
|
450
|
+
object,
|
|
451
|
+
this.parameter_type,
|
|
452
|
+
permission,
|
|
453
|
+
this.data.external_withdraw_guard.guards,
|
|
454
|
+
content?.external_withdraw_guard?.length ?? 0,
|
|
455
|
+
passport
|
|
456
|
+
);
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
case "clear": {
|
|
460
|
+
external_withdraw_guard_clear(
|
|
461
|
+
tx,
|
|
462
|
+
object,
|
|
463
|
+
this.parameter_type,
|
|
464
|
+
permission,
|
|
465
|
+
passport
|
|
466
|
+
);
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (this.data.owner_receive != null && this.object_address) {
|
|
472
|
+
if (this.data.owner_receive === "recently") {
|
|
473
|
+
this.data.owner_receive = await (0, import_received.query_received)({
|
|
474
|
+
object: this.object_address,
|
|
475
|
+
all_type: true,
|
|
476
|
+
network: env.network,
|
|
477
|
+
no_cache: env.no_cache
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
await (0, import_util.owner_receive)(
|
|
481
|
+
tx,
|
|
482
|
+
object,
|
|
483
|
+
permission,
|
|
484
|
+
this.data.owner_receive,
|
|
485
|
+
this.parameter_type,
|
|
486
|
+
(name) => `${import_common.PackageAddress}::treasury::${name}`,
|
|
487
|
+
passport
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
if (this.data.um !== void 0) {
|
|
491
|
+
let um_address = null;
|
|
492
|
+
if (this.data.um) {
|
|
493
|
+
um_address = await import_local2.LocalMark.Instance().get_address(this.data.um) || null;
|
|
494
|
+
if (!um_address) {
|
|
495
|
+
(0, import_exception.W_ERROR)(
|
|
496
|
+
import_exception.WErrors.InvalidParam,
|
|
497
|
+
"CallTreasury_Data.data.um:" + this.data.um
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
um_set(
|
|
502
|
+
tx,
|
|
503
|
+
object,
|
|
504
|
+
this.parameter_type,
|
|
505
|
+
permission,
|
|
506
|
+
um_address,
|
|
507
|
+
passport
|
|
508
|
+
);
|
|
509
|
+
}
|
|
510
|
+
if (!this.permission_address) {
|
|
511
|
+
const p = (0, import_common.GetObject)(
|
|
512
|
+
this.data?.object
|
|
513
|
+
);
|
|
514
|
+
await this.new_with_mark(
|
|
515
|
+
env,
|
|
516
|
+
tx,
|
|
517
|
+
import_object.ObjectType.Permission,
|
|
518
|
+
(0, import_permission2.create)(tx, permission),
|
|
519
|
+
(0, import_common.GetObject)(p.permission)
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
if (!this.object_address) {
|
|
523
|
+
await this.new_with_mark(
|
|
524
|
+
env,
|
|
525
|
+
tx,
|
|
526
|
+
import_object.ObjectType.Treasury,
|
|
527
|
+
create(tx, object, this.parameter_type),
|
|
528
|
+
(0, import_common.GetObject)(this.data?.object)
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
const MAX_EXTERNAL_DEPOSIT_GUARD_COUNT = 100;
|
|
534
|
+
const MAX_EXTERNAL_WITHDRAW_GUARD_COUNT = 200;
|
|
535
|
+
function newTreasury(tx, treasury_type, permission, description, passport) {
|
|
536
|
+
(0, import_util.validObjects)([permission, passport]);
|
|
537
|
+
if (typeof description === "string" && !(0, import_common.isValidDescription)(description)) {
|
|
538
|
+
(0, import_exception.W_ERROR)(
|
|
539
|
+
import_exception.WErrors.IsValidDescription,
|
|
540
|
+
`Description exceeds maximum length ${import_common.MAX_DESCRIPTION_LENGTH}`
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
544
|
+
(0, import_exception.W_ERROR)(
|
|
545
|
+
import_exception.WErrors.InvalidParam,
|
|
546
|
+
`New treasury type ${treasury_type} is not valid`
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
if (passport) {
|
|
550
|
+
return tx.moveCall({
|
|
551
|
+
target: (0, import_common.treasuryFn)("new_with_passport"),
|
|
552
|
+
arguments: [
|
|
553
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
554
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
555
|
+
(0, import_common.toTxString)(tx, description),
|
|
556
|
+
tx.object.mutRegistrar(),
|
|
557
|
+
tx.object.clock()
|
|
558
|
+
],
|
|
559
|
+
typeArguments: [treasury_type]
|
|
560
|
+
});
|
|
561
|
+
} else {
|
|
562
|
+
return tx.moveCall({
|
|
563
|
+
target: (0, import_common.treasuryFn)("new"),
|
|
564
|
+
arguments: [
|
|
565
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
566
|
+
(0, import_common.toTxString)(tx, description),
|
|
567
|
+
tx.object.mutRegistrar(),
|
|
568
|
+
tx.object.clock()
|
|
569
|
+
],
|
|
570
|
+
typeArguments: [treasury_type]
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
function description_set(tx, treasury, treasury_type, permission, description, passport) {
|
|
575
|
+
(0, import_util.validObjects)([treasury, permission, passport]);
|
|
576
|
+
if (typeof description === "string" && !(0, import_common.isValidDescription)(description)) {
|
|
577
|
+
(0, import_exception.W_ERROR)(
|
|
578
|
+
import_exception.WErrors.IsValidDescription,
|
|
579
|
+
`Description exceeds maximum length ${import_common.MAX_DESCRIPTION_LENGTH}`
|
|
580
|
+
);
|
|
581
|
+
}
|
|
582
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
583
|
+
(0, import_exception.W_ERROR)(
|
|
584
|
+
import_exception.WErrors.InvalidParam,
|
|
585
|
+
`Description set treasury type ${treasury_type} is not valid`
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
if (passport) {
|
|
589
|
+
tx.moveCall({
|
|
590
|
+
target: (0, import_common.treasuryFn)("description_set_with_passport"),
|
|
591
|
+
arguments: [
|
|
592
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
593
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
594
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
595
|
+
(0, import_common.toTxString)(tx, description)
|
|
596
|
+
],
|
|
597
|
+
typeArguments: [treasury_type]
|
|
598
|
+
});
|
|
599
|
+
} else {
|
|
600
|
+
tx.moveCall({
|
|
601
|
+
target: (0, import_common.treasuryFn)("description_set"),
|
|
602
|
+
arguments: [
|
|
603
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
604
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
605
|
+
(0, import_common.toTxString)(tx, description)
|
|
606
|
+
],
|
|
607
|
+
typeArguments: [treasury_type]
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
async function deposit(env, tx, treasury, treasury_type, permission, coin, payment_info, passport) {
|
|
612
|
+
(0, import_util.validObjects)([treasury, permission, passport]);
|
|
613
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
614
|
+
(0, import_exception.W_ERROR)(
|
|
615
|
+
import_exception.WErrors.InvalidParam,
|
|
616
|
+
`Deposit treasury type ${treasury_type} is not valid`
|
|
617
|
+
);
|
|
618
|
+
}
|
|
619
|
+
const c = await (0, import_base.getCoinParam)(env, tx, coin, treasury_type);
|
|
620
|
+
const p = await (0, import_payment.paymentInfo)(env, tx, payment_info);
|
|
621
|
+
if (passport) {
|
|
622
|
+
return tx.moveCall({
|
|
623
|
+
target: (0, import_common.treasuryFn)("deposit_with_passport"),
|
|
624
|
+
arguments: [
|
|
625
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
626
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
627
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
628
|
+
c,
|
|
629
|
+
p,
|
|
630
|
+
tx.object.mutRegistrar(),
|
|
631
|
+
tx.object.clock()
|
|
632
|
+
],
|
|
633
|
+
typeArguments: [treasury_type]
|
|
634
|
+
});
|
|
635
|
+
} else {
|
|
636
|
+
return tx.moveCall({
|
|
637
|
+
target: (0, import_common.treasuryFn)("deposit"),
|
|
638
|
+
arguments: [
|
|
639
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
640
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
641
|
+
c,
|
|
642
|
+
p,
|
|
643
|
+
tx.object.mutRegistrar(),
|
|
644
|
+
tx.object.clock()
|
|
645
|
+
],
|
|
646
|
+
typeArguments: [treasury_type]
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
async function withdraw(env, tx, treasury, treasury_type, permission, amount, recipient, payment_info, passport) {
|
|
651
|
+
(0, import_util.validObjects)([treasury, permission, passport]);
|
|
652
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
653
|
+
(0, import_exception.W_ERROR)(
|
|
654
|
+
import_exception.WErrors.InvalidParam,
|
|
655
|
+
`Withdraw treasury type ${treasury_type} is not valid`
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
if (!(0, import_common.isValidU64)(amount)) {
|
|
659
|
+
(0, import_exception.W_ERROR)(import_exception.WErrors.IsValidU64, `Amount ${amount} is not valid`);
|
|
660
|
+
}
|
|
661
|
+
const r = await (0, import_local.GetAccountOrMark_Address)(recipient);
|
|
662
|
+
if (!r) {
|
|
663
|
+
(0, import_exception.W_ERROR)(import_exception.WErrors.InvalidParam, `Recipient ${recipient} is not valid`);
|
|
664
|
+
}
|
|
665
|
+
const p = await (0, import_payment.paymentInfo)(env, tx, payment_info);
|
|
666
|
+
if (passport) {
|
|
667
|
+
return tx.moveCall({
|
|
668
|
+
target: (0, import_common.treasuryFn)("withdraw_with_passport"),
|
|
669
|
+
arguments: [
|
|
670
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
671
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
672
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
673
|
+
tx.pure.u64(amount),
|
|
674
|
+
tx.pure.address(r),
|
|
675
|
+
p,
|
|
676
|
+
tx.object.mutRegistrar(),
|
|
677
|
+
tx.object.clock()
|
|
678
|
+
],
|
|
679
|
+
typeArguments: [treasury_type]
|
|
680
|
+
});
|
|
681
|
+
} else {
|
|
682
|
+
return tx.moveCall({
|
|
683
|
+
target: (0, import_common.treasuryFn)("withdraw"),
|
|
684
|
+
arguments: [
|
|
685
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
686
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
687
|
+
tx.pure.u64(amount),
|
|
688
|
+
tx.pure.address(r),
|
|
689
|
+
p,
|
|
690
|
+
tx.object.mutRegistrar(),
|
|
691
|
+
tx.object.clock()
|
|
692
|
+
],
|
|
693
|
+
typeArguments: [treasury_type]
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
async function external_deposit_guard_add(tx, treasury, treasury_type, permission, guards, counts = MAX_EXTERNAL_DEPOSIT_GUARD_COUNT, passport) {
|
|
698
|
+
if (guards.length === 0) {
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
if (guards.length > counts) {
|
|
702
|
+
(0, import_exception.W_ERROR)(
|
|
703
|
+
import_exception.WErrors.InvalidParam,
|
|
704
|
+
`External deposit guard add guards count ${guards.length} exceeds maximum ${counts}`
|
|
705
|
+
);
|
|
706
|
+
}
|
|
707
|
+
(0, import_util.validObjects)([treasury, permission, passport]);
|
|
708
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
709
|
+
(0, import_exception.W_ERROR)(
|
|
710
|
+
import_exception.WErrors.InvalidParam,
|
|
711
|
+
`External deposit guard add treasury type ${treasury_type} is not valid`
|
|
712
|
+
);
|
|
713
|
+
}
|
|
714
|
+
const g = await Promise.all(
|
|
715
|
+
guards.map(async (item) => {
|
|
716
|
+
const guard = await import_local2.LocalMark.Instance().get_address(item.guard);
|
|
717
|
+
if (!guard) {
|
|
718
|
+
(0, import_exception.W_ERROR)(
|
|
719
|
+
import_exception.WErrors.InvalidParam,
|
|
720
|
+
`External deposit guard add guard ${item.guard} is not valid`
|
|
721
|
+
);
|
|
722
|
+
}
|
|
723
|
+
if (item.identifier && !(0, import_common.isValidU8)(item.identifier)) {
|
|
724
|
+
(0, import_exception.W_ERROR)(
|
|
725
|
+
import_exception.WErrors.IsValidU8,
|
|
726
|
+
`External deposit guard add identifier ${item.identifier} is not optional u8`
|
|
727
|
+
);
|
|
728
|
+
}
|
|
729
|
+
return {
|
|
730
|
+
guard: item.guard,
|
|
731
|
+
identifier: item.identifier,
|
|
732
|
+
guard_addr: guard
|
|
733
|
+
};
|
|
734
|
+
})
|
|
735
|
+
);
|
|
736
|
+
const invalidGuards = g.filter((item) => !item.guard_addr);
|
|
737
|
+
if (invalidGuards.length > 0) {
|
|
738
|
+
(0, import_exception.W_ERROR)(
|
|
739
|
+
import_exception.WErrors.InvalidParam,
|
|
740
|
+
`External deposit guard add has invalid guards with empty guard_addr: ${JSON.stringify(invalidGuards)}`
|
|
741
|
+
);
|
|
742
|
+
}
|
|
743
|
+
g.filter((item) => item.guard_addr !== void 0).map((item) => ({
|
|
744
|
+
guard: item.guard_addr,
|
|
745
|
+
identifier: item.identifier !== void 0 ? item.identifier : null
|
|
746
|
+
})).forEach((item) => {
|
|
747
|
+
if (passport) {
|
|
748
|
+
tx.moveCall({
|
|
749
|
+
target: (0, import_common.treasuryFn)(
|
|
750
|
+
"external_deposit_guard_add_with_passport"
|
|
751
|
+
),
|
|
752
|
+
arguments: [
|
|
753
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
754
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
755
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
756
|
+
(0, import_common.toTxObject)(tx, item.guard),
|
|
757
|
+
tx.pure.option("u8", item.identifier),
|
|
758
|
+
tx.object.mutRegistrar(),
|
|
759
|
+
tx.object.clock()
|
|
760
|
+
],
|
|
761
|
+
typeArguments: [treasury_type]
|
|
762
|
+
});
|
|
763
|
+
} else {
|
|
764
|
+
tx.moveCall({
|
|
765
|
+
target: (0, import_common.treasuryFn)("external_deposit_guard_add"),
|
|
766
|
+
arguments: [
|
|
767
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
768
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
769
|
+
(0, import_common.toTxObject)(tx, item.guard),
|
|
770
|
+
tx.pure.option("u8", item.identifier),
|
|
771
|
+
tx.object.mutRegistrar(),
|
|
772
|
+
tx.object.clock()
|
|
773
|
+
],
|
|
774
|
+
typeArguments: [treasury_type]
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
async function external_deposit_guard_remove(tx, treasury, treasury_type, permission, guards, counts = MAX_EXTERNAL_DEPOSIT_GUARD_COUNT, passport) {
|
|
780
|
+
guards = await import_local2.LocalMark.Instance().get_many_address_availables(guards);
|
|
781
|
+
if (guards.length === 0) {
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
if (guards.length > counts) {
|
|
785
|
+
(0, import_exception.W_ERROR)(
|
|
786
|
+
import_exception.WErrors.InvalidParam,
|
|
787
|
+
`External deposit guard remove guards count ${guards.length} exceeds maximum ${counts}`
|
|
788
|
+
);
|
|
789
|
+
}
|
|
790
|
+
(0, import_util.validObjects)([treasury, permission, passport, ...guards]);
|
|
791
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
792
|
+
(0, import_exception.W_ERROR)(
|
|
793
|
+
import_exception.WErrors.InvalidParam,
|
|
794
|
+
`External deposit guard remove treasury type ${treasury_type} is not valid`
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
if (passport) {
|
|
798
|
+
tx.moveCall({
|
|
799
|
+
target: (0, import_common.treasuryFn)("external_deposit_guard_remove_with_passport"),
|
|
800
|
+
arguments: [
|
|
801
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
802
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
803
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
804
|
+
tx.pure.vector("address", guards),
|
|
805
|
+
tx.object.mutRegistrar()
|
|
806
|
+
],
|
|
807
|
+
typeArguments: [treasury_type]
|
|
808
|
+
});
|
|
809
|
+
} else {
|
|
810
|
+
tx.moveCall({
|
|
811
|
+
target: (0, import_common.treasuryFn)("external_deposit_guard_remove"),
|
|
812
|
+
arguments: [
|
|
813
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
814
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
815
|
+
tx.pure.vector("address", guards),
|
|
816
|
+
tx.object.mutRegistrar()
|
|
817
|
+
],
|
|
818
|
+
typeArguments: [treasury_type]
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
function external_deposit_guard_clear(tx, treasury, treasury_type, permission, passport) {
|
|
823
|
+
(0, import_util.validObjects)([treasury, permission, passport]);
|
|
824
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
825
|
+
(0, import_exception.W_ERROR)(
|
|
826
|
+
import_exception.WErrors.InvalidParam,
|
|
827
|
+
`External deposit guard clear treasury type ${treasury_type} is not valid`
|
|
828
|
+
);
|
|
829
|
+
}
|
|
830
|
+
if (passport) {
|
|
831
|
+
tx.moveCall({
|
|
832
|
+
target: (0, import_common.treasuryFn)("external_deposit_guard_clear_with_passport"),
|
|
833
|
+
arguments: [
|
|
834
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
835
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
836
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
837
|
+
tx.object.mutRegistrar()
|
|
838
|
+
],
|
|
839
|
+
typeArguments: [treasury_type]
|
|
840
|
+
});
|
|
841
|
+
} else {
|
|
842
|
+
tx.moveCall({
|
|
843
|
+
target: (0, import_common.treasuryFn)("external_deposit_guard_clear"),
|
|
844
|
+
arguments: [
|
|
845
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
846
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
847
|
+
tx.object.mutRegistrar()
|
|
848
|
+
],
|
|
849
|
+
typeArguments: [treasury_type]
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
async function external_withdraw_guard_add(tx, treasury, treasury_type, permission, guards, counts = MAX_EXTERNAL_DEPOSIT_GUARD_COUNT, passport) {
|
|
854
|
+
if (guards.length === 0) {
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
if (guards.length > counts) {
|
|
858
|
+
(0, import_exception.W_ERROR)(
|
|
859
|
+
import_exception.WErrors.InvalidParam,
|
|
860
|
+
`External withdraw guard add guards count ${guards.length} exceeds maximum ${counts}`
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
(0, import_util.validObjects)([treasury, permission, passport]);
|
|
864
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
865
|
+
(0, import_exception.W_ERROR)(
|
|
866
|
+
import_exception.WErrors.InvalidParam,
|
|
867
|
+
`External withdraw guard add treasury type ${treasury_type} is not valid`
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
const g = await Promise.all(
|
|
871
|
+
guards.map(async (item) => {
|
|
872
|
+
const guard = await import_local2.LocalMark.Instance().get_address(item.guard);
|
|
873
|
+
if (!guard) {
|
|
874
|
+
(0, import_exception.W_ERROR)(
|
|
875
|
+
import_exception.WErrors.InvalidParam,
|
|
876
|
+
`External withdraw guard add guard ${item.guard} is not valid`
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
if (!(0, import_common.isValidU8)(item.identifier)) {
|
|
880
|
+
(0, import_exception.W_ERROR)(
|
|
881
|
+
import_exception.WErrors.IsValidU8,
|
|
882
|
+
`External withdraw guard add identifier ${item.identifier} is not optional u8`
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
return {
|
|
886
|
+
guard: item.guard,
|
|
887
|
+
identifier: item.identifier,
|
|
888
|
+
guard_addr: guard
|
|
889
|
+
};
|
|
890
|
+
})
|
|
891
|
+
);
|
|
892
|
+
const invalidGuards = g.filter((item) => !item.guard_addr);
|
|
893
|
+
if (invalidGuards.length > 0) {
|
|
894
|
+
(0, import_exception.W_ERROR)(
|
|
895
|
+
import_exception.WErrors.InvalidParam,
|
|
896
|
+
`External withdraw guard add has invalid guards with empty guard_addr: ${JSON.stringify(invalidGuards)}`
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
g.filter((item) => item.guard_addr !== void 0).map((item) => ({
|
|
900
|
+
guard: item.guard_addr,
|
|
901
|
+
identifier: item.identifier
|
|
902
|
+
})).forEach((item) => {
|
|
903
|
+
if (passport) {
|
|
904
|
+
tx.moveCall({
|
|
905
|
+
target: (0, import_common.treasuryFn)(
|
|
906
|
+
"external_withdraw_guard_add_with_passport"
|
|
907
|
+
),
|
|
908
|
+
arguments: [
|
|
909
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
910
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
911
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
912
|
+
(0, import_common.toTxObject)(tx, item.guard),
|
|
913
|
+
tx.pure.u8(item.identifier),
|
|
914
|
+
tx.object.mutRegistrar(),
|
|
915
|
+
tx.object.clock()
|
|
916
|
+
],
|
|
917
|
+
typeArguments: [treasury_type]
|
|
918
|
+
});
|
|
919
|
+
} else {
|
|
920
|
+
tx.moveCall({
|
|
921
|
+
target: (0, import_common.treasuryFn)("external_withdraw_guard_add"),
|
|
922
|
+
arguments: [
|
|
923
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
924
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
925
|
+
(0, import_common.toTxObject)(tx, item.guard),
|
|
926
|
+
tx.pure.u8(item.identifier),
|
|
927
|
+
tx.object.mutRegistrar(),
|
|
928
|
+
tx.object.clock()
|
|
929
|
+
],
|
|
930
|
+
typeArguments: [treasury_type]
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
async function external_withdraw_guard_remove(tx, treasury, treasury_type, permission, guards, counts = MAX_EXTERNAL_DEPOSIT_GUARD_COUNT, passport) {
|
|
936
|
+
guards = await import_local2.LocalMark.Instance().get_many_address_availables(guards);
|
|
937
|
+
if (guards.length === 0) {
|
|
938
|
+
return;
|
|
939
|
+
}
|
|
940
|
+
if (guards.length > counts) {
|
|
941
|
+
(0, import_exception.W_ERROR)(
|
|
942
|
+
import_exception.WErrors.InvalidParam,
|
|
943
|
+
`External withdraw guard remove guards count ${guards.length} exceeds maximum ${counts}`
|
|
944
|
+
);
|
|
945
|
+
}
|
|
946
|
+
(0, import_util.validObjects)([treasury, permission, passport]);
|
|
947
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
948
|
+
(0, import_exception.W_ERROR)(
|
|
949
|
+
import_exception.WErrors.InvalidParam,
|
|
950
|
+
`External withdraw guard remove treasury type ${treasury_type} is not valid`
|
|
951
|
+
);
|
|
952
|
+
}
|
|
953
|
+
if (passport) {
|
|
954
|
+
tx.moveCall({
|
|
955
|
+
target: (0, import_common.treasuryFn)("external_withdraw_guard_remove_with_passport"),
|
|
956
|
+
arguments: [
|
|
957
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
958
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
959
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
960
|
+
tx.pure.vector("address", guards),
|
|
961
|
+
tx.object.mutRegistrar()
|
|
962
|
+
],
|
|
963
|
+
typeArguments: [treasury_type]
|
|
964
|
+
});
|
|
965
|
+
} else {
|
|
966
|
+
tx.moveCall({
|
|
967
|
+
target: (0, import_common.treasuryFn)("external_withdraw_guard_remove"),
|
|
968
|
+
arguments: [
|
|
969
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
970
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
971
|
+
tx.pure.vector("address", guards),
|
|
972
|
+
tx.object.mutRegistrar()
|
|
973
|
+
],
|
|
974
|
+
typeArguments: [treasury_type]
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
function external_withdraw_guard_clear(tx, treasury, treasury_type, permission, passport) {
|
|
979
|
+
(0, import_util.validObjects)([treasury, permission, passport]);
|
|
980
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
981
|
+
(0, import_exception.W_ERROR)(
|
|
982
|
+
import_exception.WErrors.InvalidParam,
|
|
983
|
+
`External withdraw guard clear treasury type ${treasury_type} is not valid`
|
|
984
|
+
);
|
|
985
|
+
}
|
|
986
|
+
if (passport) {
|
|
987
|
+
tx.moveCall({
|
|
988
|
+
target: (0, import_common.treasuryFn)("external_withdraw_guard_clear_with_passport"),
|
|
989
|
+
arguments: [
|
|
990
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
991
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
992
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
993
|
+
tx.object.mutRegistrar()
|
|
994
|
+
],
|
|
995
|
+
typeArguments: [treasury_type]
|
|
996
|
+
});
|
|
997
|
+
} else {
|
|
998
|
+
tx.moveCall({
|
|
999
|
+
target: (0, import_common.treasuryFn)("external_withdraw_guard_clear"),
|
|
1000
|
+
arguments: [
|
|
1001
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
1002
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
1003
|
+
tx.object.mutRegistrar()
|
|
1004
|
+
],
|
|
1005
|
+
typeArguments: [treasury_type]
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
function create(tx, treasury, treasury_type) {
|
|
1010
|
+
(0, import_util.validObjects)([treasury]);
|
|
1011
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
1012
|
+
(0, import_exception.W_ERROR)(
|
|
1013
|
+
import_exception.WErrors.InvalidParam,
|
|
1014
|
+
`Create treasury type ${treasury_type} is not valid`
|
|
1015
|
+
);
|
|
1016
|
+
}
|
|
1017
|
+
return tx.moveCall({
|
|
1018
|
+
target: (0, import_common.treasuryFn)("create"),
|
|
1019
|
+
arguments: [(0, import_common.toTxObject)(tx, treasury)],
|
|
1020
|
+
typeArguments: [treasury_type]
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
async function external_deposit(env, tx, treasury, treasury_type, passport, external_deposit_guard, coin, payment_info) {
|
|
1024
|
+
(0, import_util.validObjects)([treasury, passport]);
|
|
1025
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
1026
|
+
(0, import_exception.W_ERROR)(
|
|
1027
|
+
import_exception.WErrors.InvalidParam,
|
|
1028
|
+
`External deposit treasury type ${treasury_type} is not valid`
|
|
1029
|
+
);
|
|
1030
|
+
}
|
|
1031
|
+
const [c, p, guard] = await Promise.all([
|
|
1032
|
+
(0, import_base.getCoinParam)(env, tx, coin, treasury_type),
|
|
1033
|
+
(0, import_payment.paymentInfo)(env, tx, payment_info),
|
|
1034
|
+
import_local2.LocalMark.Instance().get_address(external_deposit_guard)
|
|
1035
|
+
]);
|
|
1036
|
+
if (!guard) {
|
|
1037
|
+
(0, import_exception.W_ERROR)(
|
|
1038
|
+
import_exception.WErrors.InvalidParam,
|
|
1039
|
+
`External deposit guard ${external_deposit_guard} is not valid`
|
|
1040
|
+
);
|
|
1041
|
+
}
|
|
1042
|
+
return tx.moveCall({
|
|
1043
|
+
target: (0, import_common.treasuryFn)("external_deposit"),
|
|
1044
|
+
arguments: [
|
|
1045
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
1046
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
1047
|
+
(0, import_common.toTxObject)(tx, guard),
|
|
1048
|
+
c,
|
|
1049
|
+
p,
|
|
1050
|
+
tx.object.mutRegistrar(),
|
|
1051
|
+
tx.object.clock()
|
|
1052
|
+
],
|
|
1053
|
+
typeArguments: [treasury_type]
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
async function external_withdraw(env, tx, treasury, treasury_type, passport, external_withdraw_guard, recipient, payment_info) {
|
|
1057
|
+
(0, import_util.validObjects)([treasury, passport]);
|
|
1058
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
1059
|
+
(0, import_exception.W_ERROR)(
|
|
1060
|
+
import_exception.WErrors.InvalidParam,
|
|
1061
|
+
`External withdraw treasury type ${treasury_type} is not valid`
|
|
1062
|
+
);
|
|
1063
|
+
}
|
|
1064
|
+
const [p, guard, recipient_addr] = await Promise.all([
|
|
1065
|
+
(0, import_payment.paymentInfo)(env, tx, payment_info),
|
|
1066
|
+
import_local2.LocalMark.Instance().get_address(external_withdraw_guard),
|
|
1067
|
+
(0, import_local.GetAccountOrMark_Address)(recipient)
|
|
1068
|
+
]);
|
|
1069
|
+
if (!guard) {
|
|
1070
|
+
(0, import_exception.W_ERROR)(
|
|
1071
|
+
import_exception.WErrors.InvalidParam,
|
|
1072
|
+
`External withdraw guard ${external_withdraw_guard} is not valid`
|
|
1073
|
+
);
|
|
1074
|
+
}
|
|
1075
|
+
if (!recipient_addr) {
|
|
1076
|
+
(0, import_exception.W_ERROR)(
|
|
1077
|
+
import_exception.WErrors.InvalidParam,
|
|
1078
|
+
`External withdraw recipient ${recipient} is not valid`
|
|
1079
|
+
);
|
|
1080
|
+
}
|
|
1081
|
+
return tx.moveCall({
|
|
1082
|
+
target: (0, import_common.treasuryFn)("external_withdraw"),
|
|
1083
|
+
arguments: [
|
|
1084
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
1085
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
1086
|
+
(0, import_common.toTxObject)(tx, guard),
|
|
1087
|
+
tx.pure.address(recipient_addr),
|
|
1088
|
+
p,
|
|
1089
|
+
tx.object.mutRegistrar(),
|
|
1090
|
+
tx.object.clock()
|
|
1091
|
+
],
|
|
1092
|
+
typeArguments: [treasury_type]
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
function receive(tx, treasury, treasury_type, permission, received, payment, passport) {
|
|
1096
|
+
if (!payment) {
|
|
1097
|
+
(0, import_exception.W_ERROR)(import_exception.WErrors.InvalidParam, `Treasury receive payment is required`);
|
|
1098
|
+
}
|
|
1099
|
+
(0, import_util.validObjects)([treasury, permission, received, payment, passport]);
|
|
1100
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
1101
|
+
(0, import_exception.W_ERROR)(
|
|
1102
|
+
import_exception.WErrors.InvalidParam,
|
|
1103
|
+
`Treasury receive treasury type ${treasury_type} is not valid`
|
|
1104
|
+
);
|
|
1105
|
+
}
|
|
1106
|
+
if (passport) {
|
|
1107
|
+
tx.moveCall({
|
|
1108
|
+
target: (0, import_common.treasuryFn)("receive_with_passport"),
|
|
1109
|
+
arguments: [
|
|
1110
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
1111
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
1112
|
+
(0, import_common.toTxObject)(tx, passport),
|
|
1113
|
+
(0, import_common.toTxObject)(tx, received),
|
|
1114
|
+
(0, import_common.toTxObject)(tx, payment),
|
|
1115
|
+
tx.object.clock()
|
|
1116
|
+
],
|
|
1117
|
+
typeArguments: [treasury_type]
|
|
1118
|
+
});
|
|
1119
|
+
} else {
|
|
1120
|
+
tx.moveCall({
|
|
1121
|
+
target: (0, import_common.treasuryFn)("receive"),
|
|
1122
|
+
arguments: [
|
|
1123
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
1124
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
1125
|
+
(0, import_common.toTxObject)(tx, received),
|
|
1126
|
+
(0, import_common.toTxObject)(tx, payment),
|
|
1127
|
+
tx.object.clock()
|
|
1128
|
+
],
|
|
1129
|
+
typeArguments: [treasury_type]
|
|
1130
|
+
});
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
function um_set(tx, treasury, treasury_type, permission, um, passport) {
|
|
1134
|
+
(0, import_util.validObjects)([treasury, permission]);
|
|
1135
|
+
if (!(0, import_common.IsValidArgType)(treasury_type)) {
|
|
1136
|
+
(0, import_exception.W_ERROR)(
|
|
1137
|
+
import_exception.WErrors.InvalidParam,
|
|
1138
|
+
`Treasury type ${treasury_type} is not valid`
|
|
1139
|
+
);
|
|
1140
|
+
}
|
|
1141
|
+
if (um) {
|
|
1142
|
+
if (passport) {
|
|
1143
|
+
tx.moveCall({
|
|
1144
|
+
target: (0, import_common.treasuryFn)(`um_set_with_passport`),
|
|
1145
|
+
arguments: [
|
|
1146
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
1147
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
1148
|
+
passport,
|
|
1149
|
+
(0, import_common.toTxObject)(tx, um),
|
|
1150
|
+
tx.object.mutRegistrar(),
|
|
1151
|
+
tx.object.clock()
|
|
1152
|
+
],
|
|
1153
|
+
typeArguments: [treasury_type]
|
|
1154
|
+
});
|
|
1155
|
+
} else {
|
|
1156
|
+
tx.moveCall({
|
|
1157
|
+
target: (0, import_common.treasuryFn)(`um_set`),
|
|
1158
|
+
arguments: [
|
|
1159
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
1160
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
1161
|
+
(0, import_common.toTxObject)(tx, um),
|
|
1162
|
+
tx.object.mutRegistrar(),
|
|
1163
|
+
tx.object.clock()
|
|
1164
|
+
],
|
|
1165
|
+
typeArguments: [treasury_type]
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
} else {
|
|
1169
|
+
if (passport) {
|
|
1170
|
+
tx.moveCall({
|
|
1171
|
+
target: (0, import_common.treasuryFn)(`um_none_with_passport`),
|
|
1172
|
+
arguments: [
|
|
1173
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
1174
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
1175
|
+
passport,
|
|
1176
|
+
tx.object.mutRegistrar()
|
|
1177
|
+
],
|
|
1178
|
+
typeArguments: [treasury_type]
|
|
1179
|
+
});
|
|
1180
|
+
} else {
|
|
1181
|
+
tx.moveCall({
|
|
1182
|
+
target: (0, import_common.treasuryFn)(`um_none`),
|
|
1183
|
+
arguments: [
|
|
1184
|
+
(0, import_common.toTxObject)(tx, treasury),
|
|
1185
|
+
(0, import_common.toTxObject)(tx, permission),
|
|
1186
|
+
tx.object.mutRegistrar()
|
|
1187
|
+
],
|
|
1188
|
+
typeArguments: [treasury_type]
|
|
1189
|
+
});
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
}
|