wowok 2.1.13 → 2.1.15
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/dist/cjs/bcs/bcs.js +160 -164
- package/dist/cjs/bcs/bcs.js.map +1 -1
- package/dist/cjs/bcs/effects.js +109 -112
- package/dist/cjs/bcs/effects.js.map +1 -1
- package/dist/cjs/bcs/index.js +49 -58
- package/dist/cjs/bcs/index.js.map +1 -1
- package/dist/cjs/bcs/pure.js +14 -17
- package/dist/cjs/bcs/pure.js.map +1 -1
- package/dist/cjs/bcs/type-tag-serializer.js +6 -11
- package/dist/cjs/bcs/type-tag-serializer.js.map +1 -1
- package/dist/cjs/bcs/types.js +1 -4
- package/dist/cjs/bcs/types.js.map +1 -1
- package/dist/cjs/client/index.js +4 -15
- package/dist/cjs/client/index.js.map +1 -1
- package/dist/cjs/client/network.js +3 -7
- package/dist/cjs/client/network.js.map +1 -1
- package/dist/cjs/cryptography/index.js +6 -27
- package/dist/cjs/cryptography/index.js.map +1 -1
- package/dist/cjs/cryptography/intent.js +4 -7
- package/dist/cjs/cryptography/intent.js.map +1 -1
- package/dist/cjs/cryptography/keypair.js +26 -33
- package/dist/cjs/cryptography/keypair.js.map +1 -1
- package/dist/cjs/cryptography/mnemonics.js +8 -14
- package/dist/cjs/cryptography/mnemonics.js.map +1 -1
- package/dist/cjs/cryptography/publickey.js +19 -25
- package/dist/cjs/cryptography/publickey.js.map +1 -1
- package/dist/cjs/cryptography/signature-scheme.js +3 -6
- package/dist/cjs/cryptography/signature-scheme.js.map +1 -1
- package/dist/cjs/cryptography/signature.js +14 -18
- package/dist/cjs/cryptography/signature.js.map +1 -1
- package/dist/cjs/experimental/cache.js +1 -5
- package/dist/cjs/experimental/cache.js.map +1 -1
- package/dist/cjs/experimental/client.js +3 -7
- package/dist/cjs/experimental/client.js.map +1 -1
- package/dist/cjs/experimental/core.js +11 -15
- package/dist/cjs/experimental/core.js.map +1 -1
- package/dist/cjs/experimental/errors.js +2 -7
- package/dist/cjs/experimental/errors.js.map +1 -1
- package/dist/cjs/experimental/index.js +5 -12
- package/dist/cjs/experimental/index.js.map +1 -1
- package/dist/cjs/experimental/persistent-storage.js +30 -36
- package/dist/cjs/experimental/persistent-storage.js.map +1 -1
- package/dist/cjs/experimental/persistent-storage.test.js +18 -20
- package/dist/cjs/experimental/persistent-storage.test.js.map +1 -1
- package/dist/cjs/experimental/transports/utils.js +6 -10
- package/dist/cjs/experimental/transports/utils.js.map +1 -1
- package/dist/cjs/experimental/types.js +1 -2
- package/dist/cjs/experimental/types.js.map +1 -1
- package/dist/cjs/faucet/faucet.js +6 -15
- package/dist/cjs/faucet/faucet.js.map +1 -1
- package/dist/cjs/faucet/index.js +1 -10
- package/dist/cjs/faucet/index.js.map +1 -1
- package/dist/cjs/grpc/client.js +20 -24
- package/dist/cjs/grpc/client.js.map +1 -1
- package/dist/cjs/grpc/core.js +65 -70
- package/dist/cjs/grpc/core.js.map +1 -1
- package/dist/cjs/grpc/index.js +2 -7
- package/dist/cjs/grpc/index.js.map +1 -1
- package/dist/cjs/grpc/proto/google/protobuf/any.js +10 -13
- package/dist/cjs/grpc/proto/google/protobuf/any.js.map +1 -1
- package/dist/cjs/grpc/proto/google/protobuf/duration.js +8 -11
- package/dist/cjs/grpc/proto/google/protobuf/duration.js.map +1 -1
- package/dist/cjs/grpc/proto/google/protobuf/empty.js +3 -6
- package/dist/cjs/grpc/proto/google/protobuf/empty.js.map +1 -1
- package/dist/cjs/grpc/proto/google/protobuf/field_mask.js +7 -10
- package/dist/cjs/grpc/proto/google/protobuf/field_mask.js.map +1 -1
- package/dist/cjs/grpc/proto/google/protobuf/struct.js +25 -28
- package/dist/cjs/grpc/proto/google/protobuf/struct.js.map +1 -1
- package/dist/cjs/grpc/proto/google/protobuf/timestamp.js +11 -14
- package/dist/cjs/grpc/proto/google/protobuf/timestamp.js.map +1 -1
- package/dist/cjs/grpc/proto/google/rpc/error_details.js +36 -39
- package/dist/cjs/grpc/proto/google/rpc/error_details.js.map +1 -1
- package/dist/cjs/grpc/proto/google/rpc/status.js +5 -8
- package/dist/cjs/grpc/proto/google/rpc/status.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/argument.js +5 -8
- package/dist/cjs/grpc/proto/sui/rpc/v2/argument.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/balance_change.js +3 -6
- package/dist/cjs/grpc/proto/sui/rpc/v2/balance_change.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/bcs.js +3 -6
- package/dist/cjs/grpc/proto/sui/rpc/v2/bcs.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint.js +13 -16
- package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_contents.js +10 -13
- package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_contents.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_summary.js +20 -23
- package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_summary.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/effects.js +29 -32
- package/dist/cjs/grpc/proto/sui/rpc/v2/effects.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/epoch.js +12 -15
- package/dist/cjs/grpc/proto/sui/rpc/v2/epoch.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/error_reason.js +2 -5
- package/dist/cjs/grpc/proto/sui/rpc/v2/error_reason.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/event.js +11 -14
- package/dist/cjs/grpc/proto/sui/rpc/v2/event.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/executed_transaction.js +17 -20
- package/dist/cjs/grpc/proto/sui/rpc/v2/executed_transaction.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/execution_status.js +45 -48
- package/dist/cjs/grpc/proto/sui/rpc/v2/execution_status.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/gas_cost_summary.js +3 -6
- package/dist/cjs/grpc/proto/sui/rpc/v2/gas_cost_summary.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/input.js +7 -10
- package/dist/cjs/grpc/proto/sui/rpc/v2/input.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/jwk.js +5 -8
- package/dist/cjs/grpc/proto/sui/rpc/v2/jwk.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.client.js +13 -17
- package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.client.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.js +73 -76
- package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/move_package.js +48 -51
- package/dist/cjs/grpc/proto/sui/rpc/v2/move_package.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.client.js +10 -14
- package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.client.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.js +36 -39
- package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.client.js +8 -12
- package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.client.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.js +21 -24
- package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/object.js +15 -18
- package/dist/cjs/grpc/proto/sui/rpc/v2/object.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/object_reference.js +3 -6
- package/dist/cjs/grpc/proto/sui/rpc/v2/object_reference.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/owner.js +5 -8
- package/dist/cjs/grpc/proto/sui/rpc/v2/owner.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/protocol_config.js +3 -6
- package/dist/cjs/grpc/proto/sui/rpc/v2/protocol_config.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature.js +67 -70
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature_scheme.js +2 -5
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature_scheme.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.client.js +7 -11
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.client.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.js +15 -18
- package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.client.js +11 -15
- package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.client.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.js +67 -70
- package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.client.js +7 -11
- package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.client.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.js +13 -16
- package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/system_state.js +38 -41
- package/dist/cjs/grpc/proto/sui/rpc/v2/system_state.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/transaction.js +124 -127
- package/dist/cjs/grpc/proto/sui/rpc/v2/transaction.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.client.js +8 -12
- package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.client.js.map +1 -1
- package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.js +41 -44
- package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.js.map +1 -1
- package/dist/cjs/index.js +22 -87
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/jsonRpc/client.js +29 -34
- package/dist/cjs/jsonRpc/client.js.map +1 -1
- package/dist/cjs/jsonRpc/core.js +29 -33
- package/dist/cjs/jsonRpc/core.js.map +1 -1
- package/dist/cjs/jsonRpc/errors.js +3 -9
- package/dist/cjs/jsonRpc/errors.js.map +1 -1
- package/dist/cjs/jsonRpc/http-transport.js +9 -13
- package/dist/cjs/jsonRpc/http-transport.js.map +1 -1
- package/dist/cjs/jsonRpc/index.js +3 -12
- package/dist/cjs/jsonRpc/index.js.map +1 -1
- package/dist/cjs/jsonRpc/json-rpc-resolver.js +19 -22
- package/dist/cjs/jsonRpc/json-rpc-resolver.js.map +1 -1
- package/dist/cjs/jsonRpc/rpc-websocket-client.js +5 -9
- package/dist/cjs/jsonRpc/rpc-websocket-client.js.map +1 -1
- package/dist/cjs/jsonRpc/types/chain.js +1 -2
- package/dist/cjs/jsonRpc/types/chain.js.map +1 -1
- package/dist/cjs/jsonRpc/types/changes.js +1 -2
- package/dist/cjs/jsonRpc/types/changes.js.map +1 -1
- package/dist/cjs/jsonRpc/types/coins.js +1 -2
- package/dist/cjs/jsonRpc/types/coins.js.map +1 -1
- package/dist/cjs/jsonRpc/types/common.js +1 -2
- package/dist/cjs/jsonRpc/types/common.js.map +1 -1
- package/dist/cjs/jsonRpc/types/generated.js +1 -2
- package/dist/cjs/jsonRpc/types/generated.js.map +1 -1
- package/dist/cjs/jsonRpc/types/index.js +1 -2
- package/dist/cjs/jsonRpc/types/index.js.map +1 -1
- package/dist/cjs/jsonRpc/types/params.js +1 -2
- package/dist/cjs/jsonRpc/types/params.js.map +1 -1
- package/dist/cjs/keypairs/ed25519/ed25519-hd-key.js +7 -11
- package/dist/cjs/keypairs/ed25519/ed25519-hd-key.js.map +1 -1
- package/dist/cjs/keypairs/ed25519/index.js +2 -8
- package/dist/cjs/keypairs/ed25519/index.js.map +1 -1
- package/dist/cjs/keypairs/ed25519/keypair.js +26 -30
- package/dist/cjs/keypairs/ed25519/keypair.js.map +1 -1
- package/dist/cjs/keypairs/ed25519/publickey.js +10 -14
- package/dist/cjs/keypairs/ed25519/publickey.js.map +1 -1
- package/dist/cjs/keypairs/index.js +4 -20
- package/dist/cjs/keypairs/index.js.map +1 -1
- package/dist/cjs/keypairs/passkey/index.js +2 -9
- package/dist/cjs/keypairs/passkey/index.js.map +1 -1
- package/dist/cjs/keypairs/passkey/keypair.js +29 -35
- package/dist/cjs/keypairs/passkey/keypair.js.map +1 -1
- package/dist/cjs/keypairs/passkey/publickey.js +35 -41
- package/dist/cjs/keypairs/passkey/publickey.js.map +1 -1
- package/dist/cjs/keypairs/passkey/types.js +1 -2
- package/dist/cjs/keypairs/passkey/types.js.map +1 -1
- package/dist/cjs/keypairs/secp256k1/index.js +2 -8
- package/dist/cjs/keypairs/secp256k1/index.js.map +1 -1
- package/dist/cjs/keypairs/secp256k1/keypair.js +25 -29
- package/dist/cjs/keypairs/secp256k1/keypair.js.map +1 -1
- package/dist/cjs/keypairs/secp256k1/publickey.js +11 -15
- package/dist/cjs/keypairs/secp256k1/publickey.js.map +1 -1
- package/dist/cjs/keypairs/secp256r1/index.js +2 -8
- package/dist/cjs/keypairs/secp256r1/index.js.map +1 -1
- package/dist/cjs/keypairs/secp256r1/keypair.js +25 -29
- package/dist/cjs/keypairs/secp256r1/keypair.js.map +1 -1
- package/dist/cjs/keypairs/secp256r1/publickey.js +12 -16
- package/dist/cjs/keypairs/secp256r1/publickey.js.map +1 -1
- package/dist/cjs/multisig/index.js +2 -8
- package/dist/cjs/multisig/index.js.map +1 -1
- package/dist/cjs/multisig/publickey.js +40 -45
- package/dist/cjs/multisig/publickey.js.map +1 -1
- package/dist/cjs/multisig/signer.js +5 -9
- package/dist/cjs/multisig/signer.js.map +1 -1
- package/dist/cjs/transactions/Arguments.js +5 -8
- package/dist/cjs/transactions/Arguments.js.map +1 -1
- package/dist/cjs/transactions/Commands.js +21 -24
- package/dist/cjs/transactions/Commands.js.map +1 -1
- package/dist/cjs/transactions/Inputs.js +7 -10
- package/dist/cjs/transactions/Inputs.js.map +1 -1
- package/dist/cjs/transactions/ObjectCache.js +7 -13
- package/dist/cjs/transactions/ObjectCache.js.map +1 -1
- package/dist/cjs/transactions/Transaction.js +54 -59
- package/dist/cjs/transactions/Transaction.js.map +1 -1
- package/dist/cjs/transactions/TransactionData.js +27 -31
- package/dist/cjs/transactions/TransactionData.js.map +1 -1
- package/dist/cjs/transactions/__tests__/Transaction.test.js +71 -73
- package/dist/cjs/transactions/__tests__/Transaction.test.js.map +1 -1
- package/dist/cjs/transactions/__tests__/bcs.test.js +26 -28
- package/dist/cjs/transactions/__tests__/bcs.test.js.map +1 -1
- package/dist/cjs/transactions/data/internal.js +122 -126
- package/dist/cjs/transactions/data/internal.js.map +1 -1
- package/dist/cjs/transactions/data/v1.js +114 -119
- package/dist/cjs/transactions/data/v1.js.map +1 -1
- package/dist/cjs/transactions/data/v2.js +63 -66
- package/dist/cjs/transactions/data/v2.js.map +1 -1
- package/dist/cjs/transactions/executor/caching.js +7 -11
- package/dist/cjs/transactions/executor/caching.js.map +1 -1
- package/dist/cjs/transactions/executor/parallel.js +20 -24
- package/dist/cjs/transactions/executor/parallel.js.map +1 -1
- package/dist/cjs/transactions/executor/queue.js +2 -7
- package/dist/cjs/transactions/executor/queue.js.map +1 -1
- package/dist/cjs/transactions/executor/serial.js +11 -16
- package/dist/cjs/transactions/executor/serial.js.map +1 -1
- package/dist/cjs/transactions/hash.js +3 -6
- package/dist/cjs/transactions/hash.js.map +1 -1
- package/dist/cjs/transactions/index.js +12 -31
- package/dist/cjs/transactions/index.js.map +1 -1
- package/dist/cjs/transactions/intents/CoinWithBalance.js +21 -25
- package/dist/cjs/transactions/intents/CoinWithBalance.js.map +1 -1
- package/dist/cjs/transactions/object.js +4 -7
- package/dist/cjs/transactions/object.js.map +1 -1
- package/dist/cjs/transactions/plugins/NamedPackagesPlugin.js +2 -7
- package/dist/cjs/transactions/plugins/NamedPackagesPlugin.js.map +1 -1
- package/dist/cjs/transactions/pure.js +19 -22
- package/dist/cjs/transactions/pure.js.map +1 -1
- package/dist/cjs/transactions/resolve.js +10 -15
- package/dist/cjs/transactions/resolve.js.map +1 -1
- package/dist/cjs/transactions/serializer.js +34 -40
- package/dist/cjs/transactions/serializer.js.map +1 -1
- package/dist/cjs/transactions/utils.js +15 -23
- package/dist/cjs/transactions/utils.js.map +1 -1
- package/dist/cjs/utils/constants.js +18 -21
- package/dist/cjs/utils/constants.js.map +1 -1
- package/dist/cjs/utils/derived-objects.js +5 -8
- package/dist/cjs/utils/derived-objects.js.map +1 -1
- package/dist/cjs/utils/dynamic-fields.js +9 -12
- package/dist/cjs/utils/dynamic-fields.js.map +1 -1
- package/dist/cjs/utils/format.js +2 -6
- package/dist/cjs/utils/format.js.map +1 -1
- package/dist/cjs/utils/index.js +10 -46
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/move-registry.js +5 -10
- package/dist/cjs/utils/move-registry.js.map +1 -1
- package/dist/cjs/utils/sui-types.js +15 -25
- package/dist/cjs/utils/sui-types.js.map +1 -1
- package/dist/cjs/utils/suins.js +2 -6
- package/dist/cjs/utils/suins.js.map +1 -1
- package/dist/cjs/verify/index.js +1 -9
- package/dist/cjs/verify/index.js.map +1 -1
- package/dist/cjs/verify/verify.js +21 -28
- package/dist/cjs/verify/verify.js.map +1 -1
- package/dist/cjs/version.js +2 -5
- package/dist/cjs/version.js.map +1 -1
- package/dist/cjs/w/call/allocation.js +88 -99
- package/dist/cjs/w/call/allocation.js.map +1 -1
- package/dist/cjs/w/call/arb.js +49 -58
- package/dist/cjs/w/call/arb.js.map +1 -1
- package/dist/cjs/w/call/arbitration.js +380 -406
- package/dist/cjs/w/call/arbitration.js.map +1 -1
- package/dist/cjs/w/call/base.js +63 -73
- package/dist/cjs/w/call/base.js.map +1 -1
- package/dist/cjs/w/call/contact.js +111 -123
- package/dist/cjs/w/call/contact.js.map +1 -1
- package/dist/cjs/w/call/demand.js +221 -238
- package/dist/cjs/w/call/demand.js.map +1 -1
- package/dist/cjs/w/call/entity.js +58 -75
- package/dist/cjs/w/call/entity.js.map +1 -1
- package/dist/cjs/w/call/guard-ins.js +1191 -1196
- package/dist/cjs/w/call/guard-ins.js.map +1 -1
- package/dist/cjs/w/call/guard.js +265 -286
- package/dist/cjs/w/call/guard.js.map +1 -1
- package/dist/cjs/w/call/index.js +22 -66
- package/dist/cjs/w/call/index.js.map +1 -1
- package/dist/cjs/w/call/machine.js +351 -378
- package/dist/cjs/w/call/machine.js.map +1 -1
- package/dist/cjs/w/call/order.js +102 -113
- package/dist/cjs/w/call/order.js.map +1 -1
- package/dist/cjs/w/call/passport.js +53 -65
- package/dist/cjs/w/call/passport.js.map +1 -1
- package/dist/cjs/w/call/payment.js +41 -50
- package/dist/cjs/w/call/payment.js.map +1 -1
- package/dist/cjs/w/call/permission.js +233 -263
- package/dist/cjs/w/call/permission.js.map +1 -1
- package/dist/cjs/w/call/personal.js +38 -42
- package/dist/cjs/w/call/personal.js.map +1 -1
- package/dist/cjs/w/call/progress.js +222 -240
- package/dist/cjs/w/call/progress.js.map +1 -1
- package/dist/cjs/w/call/proof.js +23 -30
- package/dist/cjs/w/call/proof.js.map +1 -1
- package/dist/cjs/w/call/repository.js +283 -302
- package/dist/cjs/w/call/repository.js.map +1 -1
- package/dist/cjs/w/call/resource.js +27 -37
- package/dist/cjs/w/call/resource.js.map +1 -1
- package/dist/cjs/w/call/reward.js +227 -241
- package/dist/cjs/w/call/reward.js.map +1 -1
- package/dist/cjs/w/call/service.js +653 -694
- package/dist/cjs/w/call/service.js.map +1 -1
- package/dist/cjs/w/call/treasury.js +270 -289
- package/dist/cjs/w/call/treasury.js.map +1 -1
- package/dist/cjs/w/call/util.js +201 -208
- package/dist/cjs/w/call/util.js.map +1 -1
- package/dist/cjs/w/common.js +117 -168
- package/dist/cjs/w/common.js.map +1 -1
- package/dist/cjs/w/exception.js +18 -30
- package/dist/cjs/w/exception.js.map +1 -1
- package/dist/cjs/w/index.js +8 -24
- package/dist/cjs/w/index.js.map +1 -1
- package/dist/cjs/w/local/account.js +73 -77
- package/dist/cjs/w/local/account.js.map +1 -1
- package/dist/cjs/w/local/cache.js +5 -9
- package/dist/cjs/w/local/cache.js.map +1 -1
- package/dist/cjs/w/local/config.js +10 -14
- package/dist/cjs/w/local/config.js.map +1 -1
- package/dist/cjs/w/local/index.js +65 -98
- package/dist/cjs/w/local/index.js.map +1 -1
- package/dist/cjs/w/local/local.js +59 -65
- package/dist/cjs/w/local/local.js.map +1 -1
- package/dist/cjs/w/local/storage.js +13 -56
- package/dist/cjs/w/local/storage.js.map +1 -1
- package/dist/cjs/w/local/token.js +20 -24
- package/dist/cjs/w/local/token.js.map +1 -1
- package/dist/cjs/w/local/util.js +3 -39
- package/dist/cjs/w/local/util.js.map +1 -1
- package/dist/cjs/w/local/wip.js +22 -70
- package/dist/cjs/w/local/wip.js.map +1 -1
- package/dist/cjs/w/messenger/crypto.js +34 -57
- package/dist/cjs/w/messenger/crypto.js.map +1 -1
- package/dist/cjs/w/messenger/index.js +4 -31
- package/dist/cjs/w/messenger/index.js.map +1 -1
- package/dist/cjs/w/messenger/messenger-api.js +125 -174
- package/dist/cjs/w/messenger/messenger-api.js.map +1 -1
- package/dist/cjs/w/messenger/messenger-manager.js +49 -53
- package/dist/cjs/w/messenger/messenger-manager.js.map +1 -1
- package/dist/cjs/w/messenger/messenger.js +100 -137
- package/dist/cjs/w/messenger/messenger.js.map +1 -1
- package/dist/cjs/w/messenger/server.js +40 -44
- package/dist/cjs/w/messenger/server.js.map +1 -1
- package/dist/cjs/w/messenger/session.js +52 -56
- package/dist/cjs/w/messenger/session.js.map +1 -1
- package/dist/cjs/w/messenger/storage.js +13 -57
- package/dist/cjs/w/messenger/storage.js.map +1 -1
- package/dist/cjs/w/messenger/types.js +23 -27
- package/dist/cjs/w/messenger/types.js.map +1 -1
- package/dist/cjs/w/messenger/utils.js +1 -4
- package/dist/cjs/w/messenger/utils.js.map +1 -1
- package/dist/cjs/w/query/bult-in.js +22 -27
- package/dist/cjs/w/query/bult-in.js.map +1 -1
- package/dist/cjs/w/query/event.js +13 -18
- package/dist/cjs/w/query/event.js.map +1 -1
- package/dist/cjs/w/query/index.js +5 -21
- package/dist/cjs/w/query/index.js.map +1 -1
- package/dist/cjs/w/query/object.js +229 -266
- package/dist/cjs/w/query/object.js.map +1 -1
- package/dist/cjs/w/query/received.js +17 -21
- package/dist/cjs/w/query/received.js.map +1 -1
- package/dist/cjs/w/query/util.js +13 -17
- package/dist/cjs/w/query/util.js.map +1 -1
- package/dist/cjs/w/util.js +211 -225
- package/dist/cjs/w/util.js.map +1 -1
- package/dist/esm/experimental/persistent-storage.test.js +1 -1
- package/dist/esm/experimental/persistent-storage.test.js.map +1 -1
- package/package.json +7 -4
- package/scripts/download-prebuilds.js +213 -195
- package/scripts/install-better-sqlite3.js +8 -8
|
@@ -1,45 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright (c) Wowok.
|
|
3
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
exports.fee_set = fee_set;
|
|
17
|
-
exports.dispute = dispute;
|
|
18
|
-
exports.vote = vote;
|
|
19
|
-
exports.arbitration = arbitration;
|
|
20
|
-
exports.feedback = feedback;
|
|
21
|
-
exports.confirm = confirm;
|
|
22
|
-
exports.voting_deadline_change = voting_deadline_change;
|
|
23
|
-
exports.reset = reset;
|
|
24
|
-
exports.arb_withdraw = arb_withdraw;
|
|
25
|
-
exports.fees_alloc = fees_alloc;
|
|
26
|
-
exports.fees_transfer = fees_transfer;
|
|
27
|
-
exports.um_set = um_set;
|
|
28
|
-
const common_js_1 = require("../common.js");
|
|
29
|
-
const exception_js_1 = require("../exception.js");
|
|
30
|
-
const local_js_1 = require("../local/local.js");
|
|
31
|
-
const object_js_1 = require("../query/object.js");
|
|
32
|
-
const util_js_1 = require("../util.js");
|
|
33
|
-
const base_js_1 = require("./base.js");
|
|
34
|
-
const permission_js_1 = require("./permission.js");
|
|
35
|
-
const sui_types_js_1 = require("../../utils/sui-types.js");
|
|
36
|
-
const arb_js_1 = require("./arb.js");
|
|
37
|
-
const arb_js_2 = require("./arb.js");
|
|
38
|
-
const permission_js_2 = require("./permission.js");
|
|
39
|
-
const received_js_1 = require("../query/received.js");
|
|
3
|
+
import { toTxObject, isValidDescription, MAX_DESCRIPTION_LENGTH, PackageAddress, isValidU8, isValidU64, GetObjectExisted, GetObject, IsValidArgType, isValidLongName, MAX_LONG_NAME_LENGTH, isValidU32, isValidArray, GetObjectDescription, arbitrationFn, } from "../common.js";
|
|
4
|
+
import { W_ERROR, WErrors } from "../exception.js";
|
|
5
|
+
import { LocalMark } from "../local/local.js";
|
|
6
|
+
import { ObjectType } from "../query/object.js";
|
|
7
|
+
import { owner_receive, parseObjectType, validObjects } from "../util.js";
|
|
8
|
+
import { CallBase, getCoinParam } from "./base.js";
|
|
9
|
+
import { BuiltinPermissionIndex, newPermission } from "./permission.js";
|
|
10
|
+
import { isValidWowAddress } from "../../utils/sui-types.js";
|
|
11
|
+
import { MAX_PROPOSITION_COUNT } from "./arb.js";
|
|
12
|
+
import { create as arbCreate } from "./arb.js";
|
|
13
|
+
import { create as permissionCreate } from "./permission.js";
|
|
14
|
+
import { query_received } from "../query/received.js";
|
|
40
15
|
// ================================================
|
|
41
16
|
// 数据操作类
|
|
42
|
-
class CallArbitration extends
|
|
17
|
+
export class CallArbitration extends CallBase {
|
|
43
18
|
data;
|
|
44
19
|
object_address = undefined;
|
|
45
20
|
permission_address = undefined;
|
|
@@ -52,28 +27,28 @@ class CallArbitration extends base_js_1.CallBase {
|
|
|
52
27
|
async prepare(env) {
|
|
53
28
|
await super.prepare(env);
|
|
54
29
|
if (!this.object_address) {
|
|
55
|
-
this.object_address = await
|
|
30
|
+
this.object_address = await GetObjectExisted(this.data?.object);
|
|
56
31
|
}
|
|
57
32
|
if (this.object_address) {
|
|
58
|
-
await this.update_content(env,
|
|
33
|
+
await this.update_content(env, ObjectType.Arbitration, this.object_address);
|
|
59
34
|
if (!this.content)
|
|
60
|
-
|
|
35
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.object:" + this.object_address);
|
|
61
36
|
this.permission_address = this.content.permission;
|
|
62
|
-
this.parameter_type =
|
|
37
|
+
this.parameter_type = parseObjectType(this.content.type_raw, "arbitration::Arbitration");
|
|
63
38
|
if (!this.permission_address) {
|
|
64
|
-
|
|
39
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.object.permission is empty");
|
|
65
40
|
}
|
|
66
|
-
if (!
|
|
67
|
-
|
|
41
|
+
if (!IsValidArgType(this.parameter_type)) {
|
|
42
|
+
W_ERROR(WErrors.IsValidArgType, "CallArbitration_Data.data.object.type_parameter is empty");
|
|
68
43
|
}
|
|
69
44
|
}
|
|
70
45
|
else {
|
|
71
|
-
const n =
|
|
72
|
-
this.permission_address = await
|
|
73
|
-
this.new_permission_description =
|
|
46
|
+
const n = GetObject(this.data.object);
|
|
47
|
+
this.permission_address = await GetObjectExisted(n?.permission);
|
|
48
|
+
this.new_permission_description = GetObjectDescription(n);
|
|
74
49
|
this.parameter_type = n?.type_parameter;
|
|
75
|
-
if (!
|
|
76
|
-
|
|
50
|
+
if (!IsValidArgType(this.parameter_type)) {
|
|
51
|
+
W_ERROR(WErrors.IsValidArgType, "CallArbitration_Data.data.object.type_parameter invalid");
|
|
77
52
|
}
|
|
78
53
|
}
|
|
79
54
|
}
|
|
@@ -93,11 +68,11 @@ class CallArbitration extends base_js_1.CallBase {
|
|
|
93
68
|
};
|
|
94
69
|
const obj = this.content;
|
|
95
70
|
if (this.permission_address && !this.object_address) {
|
|
96
|
-
add_perm(
|
|
71
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_NEW);
|
|
97
72
|
}
|
|
98
73
|
if (this.data?.dispute != null) {
|
|
99
74
|
if (obj.bPaused) {
|
|
100
|
-
|
|
75
|
+
W_ERROR(WErrors.InvalidParam, "Arbitration is paused and cannot be disputed");
|
|
101
76
|
}
|
|
102
77
|
if (obj.usage_guard) {
|
|
103
78
|
add_guard(obj.usage_guard);
|
|
@@ -106,75 +81,75 @@ class CallArbitration extends base_js_1.CallBase {
|
|
|
106
81
|
if (this.permission_address &&
|
|
107
82
|
this.data?.description != null &&
|
|
108
83
|
this.object_address) {
|
|
109
|
-
add_perm(
|
|
84
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_DESCRIPTION);
|
|
110
85
|
}
|
|
111
86
|
if (this.permission_address && this.data?.location != null) {
|
|
112
|
-
add_perm(
|
|
87
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_LOCATION);
|
|
113
88
|
}
|
|
114
89
|
if (this.permission_address && this.data?.fee != null) {
|
|
115
|
-
add_perm(
|
|
90
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_FEE);
|
|
116
91
|
}
|
|
117
92
|
if (this.permission_address && this.data?.usage_guard !== undefined) {
|
|
118
|
-
add_perm(
|
|
93
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_USAGE_GUARD);
|
|
119
94
|
}
|
|
120
95
|
if (this.permission_address && this.data?.vote != null) {
|
|
121
96
|
this.data.vote.voting_guard =
|
|
122
|
-
await
|
|
97
|
+
await LocalMark.Instance().get_address(this.data.vote.voting_guard);
|
|
123
98
|
if (this.data.vote.voting_guard) {
|
|
124
99
|
add_guard(this.data.vote.voting_guard);
|
|
125
100
|
}
|
|
126
101
|
else {
|
|
127
|
-
|
|
102
|
+
W_ERROR(WErrors.InvalidParam, `CallArbitration_Data.data.vote.voting_guard ${this.data.vote.voting_guard} invalid`);
|
|
128
103
|
}
|
|
129
104
|
}
|
|
130
105
|
if (this.permission_address && this.data?.voting_guard != null) {
|
|
131
|
-
add_perm(
|
|
106
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_VOTING_GUARD);
|
|
132
107
|
}
|
|
133
108
|
if (this.permission_address && this.data?.pause !== undefined) {
|
|
134
|
-
add_perm(
|
|
109
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_PAUSE);
|
|
135
110
|
}
|
|
136
111
|
if (this.permission_address && this.data?.owner_receive != null) {
|
|
137
|
-
add_perm(
|
|
112
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_OWNER_RECEIVE);
|
|
138
113
|
}
|
|
139
114
|
// 处理 arbitration 操作权限
|
|
140
115
|
if (this.permission_address && this.data?.arbitration != null) {
|
|
141
|
-
add_perm(
|
|
116
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_ARBITRATION);
|
|
142
117
|
}
|
|
143
118
|
// 处理 feedback 操作权限
|
|
144
119
|
if (this.permission_address && this.data?.feedback != null) {
|
|
145
|
-
add_perm(
|
|
120
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_FEEDBACK);
|
|
146
121
|
}
|
|
147
122
|
// 处理 confirm 操作权限
|
|
148
123
|
if (this.permission_address && this.data?.confirm != null) {
|
|
149
|
-
add_perm(
|
|
124
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_CONFIRM);
|
|
150
125
|
}
|
|
151
126
|
// 处理 voting_deadline_change 操作权限
|
|
152
127
|
if (this.permission_address &&
|
|
153
128
|
this.data?.voting_deadline_change != null) {
|
|
154
|
-
add_perm(
|
|
129
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_VOTING_DEADLINE_CHANGE);
|
|
155
130
|
}
|
|
156
131
|
// 处理 reset 操作权限
|
|
157
132
|
if (this.permission_address && this.data?.reset != null) {
|
|
158
|
-
add_perm(
|
|
133
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_RESET);
|
|
159
134
|
}
|
|
160
135
|
// 处理 arb_withdraw 操作权限
|
|
161
136
|
if (this.permission_address && this.data?.arb_withdraw != null) {
|
|
162
|
-
add_perm(
|
|
137
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_ARB_WITHDRAW);
|
|
163
138
|
}
|
|
164
139
|
// 处理 fees_alloc 操作权限
|
|
165
140
|
if (this.permission_address && this.data?.fees_transfer != null) {
|
|
166
141
|
if ("allocator" in this.data.fees_transfer.to) {
|
|
167
|
-
add_perm(
|
|
142
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_FEES_ALLOC);
|
|
168
143
|
}
|
|
169
144
|
else if ("treasury" in this.data.fees_transfer.to) {
|
|
170
|
-
add_perm(
|
|
145
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_FEES_TRANSFER);
|
|
171
146
|
}
|
|
172
147
|
else {
|
|
173
|
-
|
|
148
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.fees_withdraw.to is invalid");
|
|
174
149
|
}
|
|
175
150
|
}
|
|
176
151
|
if (this.permission_address && this.data.um !== undefined) {
|
|
177
|
-
add_perm(
|
|
152
|
+
add_perm(BuiltinPermissionIndex.ARBITRATION_UM);
|
|
178
153
|
}
|
|
179
154
|
if (this.permission_address || guards.length > 0) {
|
|
180
155
|
return await this.check_permission_and_call(env, this.permission_address, perms, guards);
|
|
@@ -186,23 +161,23 @@ class CallArbitration extends base_js_1.CallBase {
|
|
|
186
161
|
let object = this.object_address;
|
|
187
162
|
if (!this.object_address) {
|
|
188
163
|
if (!permission) {
|
|
189
|
-
permission =
|
|
164
|
+
permission = newPermission(tx, this.new_permission_description ?? "");
|
|
190
165
|
}
|
|
191
166
|
if (permission && this.parameter_type) {
|
|
192
167
|
object = newArbitration(tx, this.parameter_type, permission, this.data?.description ?? "", passport);
|
|
193
168
|
}
|
|
194
169
|
}
|
|
195
170
|
if (!object || !permission) {
|
|
196
|
-
|
|
171
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.object:" + this.object_address);
|
|
197
172
|
}
|
|
198
173
|
if (this.data.dispute != null) {
|
|
199
|
-
const order = await
|
|
174
|
+
const order = await LocalMark.Instance().get_address(this.data.dispute.order);
|
|
200
175
|
if (!order) {
|
|
201
|
-
|
|
176
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.dispute.order:" +
|
|
202
177
|
this.data.dispute.order);
|
|
203
178
|
}
|
|
204
179
|
const arb = await dispute(env, tx, object, this.parameter_type, order, this.data.dispute.description, this.data.dispute.proposition, this.data.dispute.fee, passport);
|
|
205
|
-
await this.new_with_mark(env, tx,
|
|
180
|
+
await this.new_with_mark(env, tx, ObjectType.Arb, arbCreate(tx, arb, this.parameter_type), GetObject(this.data?.dispute.namedArb));
|
|
206
181
|
}
|
|
207
182
|
// 处理 description 更新
|
|
208
183
|
if (this.data.description != null && this.object_address) {
|
|
@@ -222,76 +197,76 @@ class CallArbitration extends base_js_1.CallBase {
|
|
|
222
197
|
}
|
|
223
198
|
// 处理 confirm 操作
|
|
224
199
|
if (this.data.confirm != null) {
|
|
225
|
-
const arb = await
|
|
200
|
+
const arb = await LocalMark.Instance().get_address(this.data.confirm.arb);
|
|
226
201
|
if (arb) {
|
|
227
202
|
confirm(tx, object, this.parameter_type, permission, arb, this.data.confirm.voting_deadline, passport);
|
|
228
203
|
}
|
|
229
204
|
else {
|
|
230
|
-
|
|
205
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.confirm.arb:" +
|
|
231
206
|
this.data.confirm.arb);
|
|
232
207
|
}
|
|
233
208
|
}
|
|
234
209
|
// 处理 voting_deadline_change 操作
|
|
235
210
|
if (this.data.voting_deadline_change != null) {
|
|
236
|
-
const arb = await
|
|
211
|
+
const arb = await LocalMark.Instance().get_address(this.data.voting_deadline_change.arb);
|
|
237
212
|
if (arb) {
|
|
238
213
|
voting_deadline_change(tx, object, this.parameter_type, permission, arb, this.data.voting_deadline_change.voting_deadline, passport);
|
|
239
214
|
}
|
|
240
215
|
else {
|
|
241
|
-
|
|
216
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.voting_deadline_change.arb:" +
|
|
242
217
|
this.data.voting_deadline_change.arb);
|
|
243
218
|
}
|
|
244
219
|
}
|
|
245
220
|
if (this.data.vote != null) {
|
|
246
|
-
const arb = await
|
|
221
|
+
const arb = await LocalMark.Instance().get_address(this.data.vote.arb);
|
|
247
222
|
if (arb) {
|
|
248
223
|
vote(tx, object, this.parameter_type, permission, arb, this.data.vote.votes, this.data.vote.voting_guard, passport);
|
|
249
224
|
}
|
|
250
225
|
else {
|
|
251
|
-
|
|
226
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.vote.arb:" + this.data.vote.arb);
|
|
252
227
|
}
|
|
253
228
|
}
|
|
254
229
|
// 处理 feedback 操作
|
|
255
230
|
if (this.data.feedback != null) {
|
|
256
|
-
const arb = await
|
|
231
|
+
const arb = await LocalMark.Instance().get_address(this.data.feedback.arb);
|
|
257
232
|
if (arb) {
|
|
258
233
|
feedback(tx, object, this.parameter_type, permission, arb, this.data.feedback.feedback, passport);
|
|
259
234
|
}
|
|
260
235
|
else {
|
|
261
|
-
|
|
236
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.feedback.arb:" +
|
|
262
237
|
this.data.feedback.arb);
|
|
263
238
|
}
|
|
264
239
|
}
|
|
265
240
|
// 处理 arbitration 操作
|
|
266
241
|
if (this.data.arbitration != null) {
|
|
267
|
-
const arb = await
|
|
242
|
+
const arb = await LocalMark.Instance().get_address(this.data.arbitration.arb);
|
|
268
243
|
if (arb) {
|
|
269
244
|
arbitration(tx, object, this.parameter_type, permission, arb, this.data.arbitration.feedback, this.data.arbitration.indemnity, passport);
|
|
270
245
|
}
|
|
271
246
|
else {
|
|
272
|
-
|
|
247
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.arbitration.arb:" +
|
|
273
248
|
this.data.arbitration.arb);
|
|
274
249
|
}
|
|
275
250
|
}
|
|
276
251
|
// 处理 reset 操作
|
|
277
252
|
if (this.data.reset != null) {
|
|
278
|
-
const arb = await
|
|
253
|
+
const arb = await LocalMark.Instance().get_address(this.data.reset.arb);
|
|
279
254
|
if (arb) {
|
|
280
255
|
reset(tx, object, this.parameter_type, permission, arb, this.data.reset.feedback, passport);
|
|
281
256
|
}
|
|
282
257
|
else {
|
|
283
|
-
|
|
258
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.reset.arb:" +
|
|
284
259
|
this.data.reset.arb);
|
|
285
260
|
}
|
|
286
261
|
}
|
|
287
262
|
// 处理 arb_withdraw 操作
|
|
288
263
|
if (this.data.arb_withdraw != null) {
|
|
289
|
-
const arb = await
|
|
264
|
+
const arb = await LocalMark.Instance().get_address(this.data.arb_withdraw.arb);
|
|
290
265
|
if (arb) {
|
|
291
266
|
arb_withdraw(tx, object, this.parameter_type, permission, arb, passport);
|
|
292
267
|
}
|
|
293
268
|
else {
|
|
294
|
-
|
|
269
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.arb_withdraw.arb:" +
|
|
295
270
|
this.data.arb_withdraw.arb);
|
|
296
271
|
}
|
|
297
272
|
}
|
|
@@ -299,36 +274,36 @@ class CallArbitration extends base_js_1.CallBase {
|
|
|
299
274
|
if (this.data.fees_transfer != null) {
|
|
300
275
|
let payment_address = undefined;
|
|
301
276
|
if ("allocation" in this.data.fees_transfer.to) {
|
|
302
|
-
const a = await
|
|
277
|
+
const a = await LocalMark.Instance().get_address(this.data.fees_transfer.to.allocation);
|
|
303
278
|
if (a) {
|
|
304
279
|
payment_address = fees_alloc(tx, object, this.parameter_type, permission, a, this.data.fees_transfer.payment_remark, this.data.fees_transfer.payment_index);
|
|
305
280
|
}
|
|
306
281
|
else {
|
|
307
|
-
|
|
282
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.fees_transfer.to.allocation:" +
|
|
308
283
|
this.data.fees_transfer.to.allocation);
|
|
309
284
|
}
|
|
310
285
|
}
|
|
311
286
|
else if ("treasury" in this.data.fees_transfer.to) {
|
|
312
|
-
const t = await
|
|
287
|
+
const t = await LocalMark.Instance().get_address(this.data.fees_transfer.to.treasury);
|
|
313
288
|
if (t) {
|
|
314
289
|
payment_address = fees_transfer(tx, object, this.parameter_type, permission, t, this.data.fees_transfer.payment_remark, this.data.fees_transfer.payment_index, passport);
|
|
315
290
|
}
|
|
316
291
|
else {
|
|
317
|
-
|
|
292
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.fees_transfer.to.treasury:" +
|
|
318
293
|
this.data.fees_transfer.to.treasury);
|
|
319
294
|
}
|
|
320
295
|
}
|
|
321
296
|
else {
|
|
322
|
-
|
|
297
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.fees_withdraw.to is invalid");
|
|
323
298
|
}
|
|
324
299
|
if (this.data.fees_transfer.newPayment != null && payment_address) {
|
|
325
|
-
await this.new_with_mark(env, tx,
|
|
300
|
+
await this.new_with_mark(env, tx, ObjectType.Payment, payment_address, this.data.fees_transfer.newPayment);
|
|
326
301
|
}
|
|
327
302
|
}
|
|
328
303
|
// 处理 usage_guard 更新
|
|
329
304
|
if (this.data.usage_guard !== undefined) {
|
|
330
305
|
if (this.data.usage_guard) {
|
|
331
|
-
const guard = await
|
|
306
|
+
const guard = await LocalMark.Instance().get_address(this.data.usage_guard);
|
|
332
307
|
if (guard) {
|
|
333
308
|
usage_guard_set(tx, object, this.parameter_type, permission, guard, passport);
|
|
334
309
|
}
|
|
@@ -343,14 +318,14 @@ class CallArbitration extends base_js_1.CallBase {
|
|
|
343
318
|
case "add":
|
|
344
319
|
case "set": {
|
|
345
320
|
if (this.data.voting_guard.guards.length >
|
|
346
|
-
|
|
347
|
-
|
|
321
|
+
MAX_VOTING_GUARD_COUNT) {
|
|
322
|
+
W_ERROR(WErrors.InvalidParam, `Voting guard count exceeds maximum count ${MAX_VOTING_GUARD_COUNT}`);
|
|
348
323
|
}
|
|
349
324
|
if (this.data.voting_guard.op === "set") {
|
|
350
325
|
voting_guard_clear(tx, object, this.parameter_type, permission, passport);
|
|
351
326
|
}
|
|
352
327
|
const guards = await Promise.all(this.data.voting_guard.guards.map(async (vg) => {
|
|
353
|
-
const guard = await
|
|
328
|
+
const guard = await LocalMark.Instance().get_address(vg.guard);
|
|
354
329
|
return {
|
|
355
330
|
originalGuard: vg.guard,
|
|
356
331
|
guard,
|
|
@@ -361,7 +336,7 @@ class CallArbitration extends base_js_1.CallBase {
|
|
|
361
336
|
.filter((vg) => vg.guard === undefined)
|
|
362
337
|
.map((vg) => vg.originalGuard);
|
|
363
338
|
if (invalidGuards.length > 0) {
|
|
364
|
-
|
|
339
|
+
W_ERROR(WErrors.InvalidParam, `Invalid voting guards: ${invalidGuards.join(", ")} could not be resolved to valid addresses`);
|
|
365
340
|
}
|
|
366
341
|
const voting_guards = guards.map((vg) => ({
|
|
367
342
|
guard: vg.guard,
|
|
@@ -371,9 +346,9 @@ class CallArbitration extends base_js_1.CallBase {
|
|
|
371
346
|
break;
|
|
372
347
|
}
|
|
373
348
|
case "remove": {
|
|
374
|
-
const guards = await
|
|
375
|
-
if (guards.length >
|
|
376
|
-
|
|
349
|
+
const guards = await LocalMark.Instance().get_many_address_availables(this.data.voting_guard.guards);
|
|
350
|
+
if (guards.length > MAX_VOTING_GUARD_COUNT) {
|
|
351
|
+
W_ERROR(WErrors.InvalidParam, `Voting guard count exceeds maximum count ${MAX_VOTING_GUARD_COUNT}`);
|
|
377
352
|
}
|
|
378
353
|
voting_guard_remove(tx, object, this.parameter_type, permission, guards, passport);
|
|
379
354
|
break;
|
|
@@ -388,65 +363,64 @@ class CallArbitration extends base_js_1.CallBase {
|
|
|
388
363
|
if (this.data.owner_receive != null && this.object_address) {
|
|
389
364
|
// 直接传递整个ReceivedObjects参数给owner_receive函数
|
|
390
365
|
if (this.data.owner_receive === "recently") {
|
|
391
|
-
this.data.owner_receive = await
|
|
366
|
+
this.data.owner_receive = await query_received({
|
|
392
367
|
object: this.object_address,
|
|
393
368
|
all_type: true,
|
|
394
369
|
no_cache: env.no_cache,
|
|
395
370
|
network: env.network,
|
|
396
371
|
});
|
|
397
372
|
}
|
|
398
|
-
await
|
|
373
|
+
await owner_receive(tx, object, permission, this.data.owner_receive, this.parameter_type, (name) => `${PackageAddress}::arbitration::${name}`, passport);
|
|
399
374
|
}
|
|
400
375
|
// 处理 um
|
|
401
376
|
if (this.data.um !== undefined) {
|
|
402
377
|
let um_address = null;
|
|
403
378
|
if (this.data.um) {
|
|
404
379
|
um_address =
|
|
405
|
-
(await
|
|
380
|
+
(await LocalMark.Instance().get_address(this.data.um)) ||
|
|
406
381
|
null;
|
|
407
382
|
if (!um_address) {
|
|
408
|
-
|
|
383
|
+
W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.um:" + this.data.um);
|
|
409
384
|
}
|
|
410
385
|
}
|
|
411
386
|
um_set(tx, object, this.parameter_type, permission, um_address, passport);
|
|
412
387
|
}
|
|
413
388
|
if (!this.permission_address) {
|
|
414
|
-
const p =
|
|
415
|
-
await this.new_with_mark(env, tx,
|
|
389
|
+
const p = GetObject(this.data?.object);
|
|
390
|
+
await this.new_with_mark(env, tx, ObjectType.Permission, permissionCreate(tx, permission), GetObject(p.permission));
|
|
416
391
|
}
|
|
417
392
|
if (!this.object_address) {
|
|
418
|
-
await this.new_with_mark(env, tx,
|
|
393
|
+
await this.new_with_mark(env, tx, ObjectType.Arbitration, create(tx, object, this.parameter_type), GetObject(this.data?.object));
|
|
419
394
|
}
|
|
420
395
|
}
|
|
421
396
|
}
|
|
422
|
-
exports.CallArbitration = CallArbitration;
|
|
423
397
|
// ================================================
|
|
424
398
|
// move 调用函数
|
|
425
|
-
|
|
426
|
-
function create(tx, arbitration, parameter_type) {
|
|
427
|
-
|
|
428
|
-
if (!
|
|
429
|
-
|
|
399
|
+
export const MAX_VOTING_GUARD_COUNT = 50;
|
|
400
|
+
export function create(tx, arbitration, parameter_type) {
|
|
401
|
+
validObjects([arbitration]);
|
|
402
|
+
if (!IsValidArgType(parameter_type)) {
|
|
403
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
430
404
|
}
|
|
431
405
|
return tx.moveCall({
|
|
432
|
-
target:
|
|
433
|
-
arguments: [
|
|
406
|
+
target: arbitrationFn(`create`),
|
|
407
|
+
arguments: [toTxObject(tx, arbitration)],
|
|
434
408
|
typeArguments: [parameter_type],
|
|
435
409
|
});
|
|
436
410
|
}
|
|
437
|
-
function newArbitration(tx, parameter_type, permission, description, passport) {
|
|
438
|
-
|
|
439
|
-
if (!
|
|
440
|
-
|
|
411
|
+
export function newArbitration(tx, parameter_type, permission, description, passport) {
|
|
412
|
+
validObjects([permission]);
|
|
413
|
+
if (!IsValidArgType(parameter_type)) {
|
|
414
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
441
415
|
}
|
|
442
|
-
if (!
|
|
443
|
-
|
|
416
|
+
if (!isValidDescription(description)) {
|
|
417
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration description ${description} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
|
|
444
418
|
}
|
|
445
419
|
if (passport) {
|
|
446
420
|
return tx.moveCall({
|
|
447
|
-
target:
|
|
421
|
+
target: arbitrationFn(`new_with_passport`),
|
|
448
422
|
arguments: [
|
|
449
|
-
|
|
423
|
+
toTxObject(tx, permission),
|
|
450
424
|
passport,
|
|
451
425
|
tx.pure.string(description),
|
|
452
426
|
tx.object.mutRegistrar(),
|
|
@@ -457,9 +431,9 @@ function newArbitration(tx, parameter_type, permission, description, passport) {
|
|
|
457
431
|
}
|
|
458
432
|
else {
|
|
459
433
|
return tx.moveCall({
|
|
460
|
-
target:
|
|
434
|
+
target: arbitrationFn(`new`),
|
|
461
435
|
arguments: [
|
|
462
|
-
|
|
436
|
+
toTxObject(tx, permission),
|
|
463
437
|
tx.pure.string(description),
|
|
464
438
|
tx.object.mutRegistrar(),
|
|
465
439
|
tx.object.clock(),
|
|
@@ -468,20 +442,20 @@ function newArbitration(tx, parameter_type, permission, description, passport) {
|
|
|
468
442
|
});
|
|
469
443
|
}
|
|
470
444
|
}
|
|
471
|
-
function description_set(tx, arbitration, parameter_type, permission, description, passport) {
|
|
472
|
-
|
|
473
|
-
if (!
|
|
474
|
-
|
|
445
|
+
export function description_set(tx, arbitration, parameter_type, permission, description, passport) {
|
|
446
|
+
validObjects([arbitration, permission]);
|
|
447
|
+
if (!IsValidArgType(parameter_type)) {
|
|
448
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
475
449
|
}
|
|
476
|
-
if (!
|
|
477
|
-
|
|
450
|
+
if (!isValidDescription(description)) {
|
|
451
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration description ${description} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
|
|
478
452
|
}
|
|
479
453
|
if (passport) {
|
|
480
454
|
tx.moveCall({
|
|
481
|
-
target:
|
|
455
|
+
target: arbitrationFn(`description_set_with_passsport`),
|
|
482
456
|
arguments: [
|
|
483
|
-
|
|
484
|
-
|
|
457
|
+
toTxObject(tx, arbitration),
|
|
458
|
+
toTxObject(tx, permission),
|
|
485
459
|
passport,
|
|
486
460
|
tx.pure.string(description),
|
|
487
461
|
],
|
|
@@ -490,30 +464,30 @@ function description_set(tx, arbitration, parameter_type, permission, descriptio
|
|
|
490
464
|
}
|
|
491
465
|
else {
|
|
492
466
|
tx.moveCall({
|
|
493
|
-
target:
|
|
467
|
+
target: arbitrationFn(`description_set`),
|
|
494
468
|
arguments: [
|
|
495
|
-
|
|
496
|
-
|
|
469
|
+
toTxObject(tx, arbitration),
|
|
470
|
+
toTxObject(tx, permission),
|
|
497
471
|
tx.pure.string(description),
|
|
498
472
|
],
|
|
499
473
|
typeArguments: [parameter_type],
|
|
500
474
|
});
|
|
501
475
|
}
|
|
502
476
|
}
|
|
503
|
-
function location_set(tx, arbitration, parameter_type, permission, location, passport) {
|
|
504
|
-
|
|
505
|
-
if (!
|
|
506
|
-
|
|
477
|
+
export function location_set(tx, arbitration, parameter_type, permission, location, passport) {
|
|
478
|
+
validObjects([arbitration, permission]);
|
|
479
|
+
if (!IsValidArgType(parameter_type)) {
|
|
480
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
507
481
|
}
|
|
508
|
-
if (!
|
|
509
|
-
|
|
482
|
+
if (!isValidLongName(location)) {
|
|
483
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration location ${location} is exceeds maximum length ${MAX_LONG_NAME_LENGTH}`);
|
|
510
484
|
}
|
|
511
485
|
if (passport) {
|
|
512
486
|
tx.moveCall({
|
|
513
|
-
target:
|
|
487
|
+
target: arbitrationFn(`location_set_with_passport`),
|
|
514
488
|
arguments: [
|
|
515
|
-
|
|
516
|
-
|
|
489
|
+
toTxObject(tx, arbitration),
|
|
490
|
+
toTxObject(tx, permission),
|
|
517
491
|
passport,
|
|
518
492
|
tx.pure.string(location),
|
|
519
493
|
],
|
|
@@ -522,35 +496,35 @@ function location_set(tx, arbitration, parameter_type, permission, location, pas
|
|
|
522
496
|
}
|
|
523
497
|
else {
|
|
524
498
|
tx.moveCall({
|
|
525
|
-
target:
|
|
499
|
+
target: arbitrationFn(`location_set`),
|
|
526
500
|
arguments: [
|
|
527
|
-
|
|
528
|
-
|
|
501
|
+
toTxObject(tx, arbitration),
|
|
502
|
+
toTxObject(tx, permission),
|
|
529
503
|
tx.pure.string(location),
|
|
530
504
|
],
|
|
531
505
|
typeArguments: [parameter_type],
|
|
532
506
|
});
|
|
533
507
|
}
|
|
534
508
|
}
|
|
535
|
-
function voting_guard_add(tx, arbitration, parameter_type, permission, voting_guards, passport) {
|
|
536
|
-
|
|
537
|
-
if (!
|
|
538
|
-
|
|
509
|
+
export function voting_guard_add(tx, arbitration, parameter_type, permission, voting_guards, passport) {
|
|
510
|
+
validObjects([arbitration, permission]);
|
|
511
|
+
if (!IsValidArgType(parameter_type)) {
|
|
512
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
539
513
|
}
|
|
540
514
|
voting_guards.forEach((vg) => {
|
|
541
|
-
if (!
|
|
542
|
-
|
|
515
|
+
if (!isValidWowAddress(vg.guard)) {
|
|
516
|
+
W_ERROR(WErrors.InvalidParam, `Voting guard ${vg.guard} is not valid`);
|
|
543
517
|
}
|
|
544
518
|
if ("GuardIdentifier" in vg.vote_weight) {
|
|
545
|
-
if (!
|
|
546
|
-
|
|
519
|
+
if (!isValidU8(vg.vote_weight.GuardIdentifier)) {
|
|
520
|
+
W_ERROR(WErrors.InvalidParam, `Voting guard ${vg.vote_weight.GuardIdentifier} must be u8 number`);
|
|
547
521
|
}
|
|
548
522
|
if (passport) {
|
|
549
523
|
tx.moveCall({
|
|
550
|
-
target:
|
|
524
|
+
target: arbitrationFn(`voting_guard_add_by_id_add_with_passport`),
|
|
551
525
|
arguments: [
|
|
552
|
-
|
|
553
|
-
|
|
526
|
+
toTxObject(tx, arbitration),
|
|
527
|
+
toTxObject(tx, permission),
|
|
554
528
|
passport,
|
|
555
529
|
tx.object(vg.guard),
|
|
556
530
|
tx.pure.u8(vg.vote_weight.GuardIdentifier),
|
|
@@ -560,10 +534,10 @@ function voting_guard_add(tx, arbitration, parameter_type, permission, voting_gu
|
|
|
560
534
|
}
|
|
561
535
|
else {
|
|
562
536
|
tx.moveCall({
|
|
563
|
-
target:
|
|
537
|
+
target: arbitrationFn(`voting_guard_add_by_id_add`),
|
|
564
538
|
arguments: [
|
|
565
|
-
|
|
566
|
-
|
|
539
|
+
toTxObject(tx, arbitration),
|
|
540
|
+
toTxObject(tx, permission),
|
|
567
541
|
tx.object(vg.guard),
|
|
568
542
|
tx.pure.u8(vg.vote_weight.GuardIdentifier),
|
|
569
543
|
],
|
|
@@ -572,15 +546,15 @@ function voting_guard_add(tx, arbitration, parameter_type, permission, voting_gu
|
|
|
572
546
|
}
|
|
573
547
|
}
|
|
574
548
|
else if ("FixedValue" in vg.vote_weight) {
|
|
575
|
-
if (!
|
|
576
|
-
|
|
549
|
+
if (!isValidU32(vg.vote_weight.FixedValue)) {
|
|
550
|
+
W_ERROR(WErrors.InvalidParam, `Voting guard ${vg.vote_weight.FixedValue} must be u32 number`);
|
|
577
551
|
}
|
|
578
552
|
if (passport) {
|
|
579
553
|
tx.moveCall({
|
|
580
|
-
target:
|
|
554
|
+
target: arbitrationFn(`voting_guard_fixed_add_with_passport`),
|
|
581
555
|
arguments: [
|
|
582
|
-
|
|
583
|
-
|
|
556
|
+
toTxObject(tx, arbitration),
|
|
557
|
+
toTxObject(tx, permission),
|
|
584
558
|
passport,
|
|
585
559
|
tx.object(vg.guard),
|
|
586
560
|
tx.pure.u32(vg.vote_weight.FixedValue),
|
|
@@ -592,10 +566,10 @@ function voting_guard_add(tx, arbitration, parameter_type, permission, voting_gu
|
|
|
592
566
|
}
|
|
593
567
|
else {
|
|
594
568
|
tx.moveCall({
|
|
595
|
-
target:
|
|
569
|
+
target: arbitrationFn(`voting_guard_fixed_add`),
|
|
596
570
|
arguments: [
|
|
597
|
-
|
|
598
|
-
|
|
571
|
+
toTxObject(tx, arbitration),
|
|
572
|
+
toTxObject(tx, permission),
|
|
599
573
|
tx.object(vg.guard),
|
|
600
574
|
tx.pure.u32(vg.vote_weight.FixedValue),
|
|
601
575
|
tx.object.mutRegistrar(),
|
|
@@ -607,20 +581,20 @@ function voting_guard_add(tx, arbitration, parameter_type, permission, voting_gu
|
|
|
607
581
|
}
|
|
608
582
|
});
|
|
609
583
|
}
|
|
610
|
-
function voting_guard_remove(tx, arbitration, parameter_type, permission, guards, passport) {
|
|
584
|
+
export function voting_guard_remove(tx, arbitration, parameter_type, permission, guards, passport) {
|
|
611
585
|
if (guards.length === 0) {
|
|
612
586
|
return;
|
|
613
587
|
}
|
|
614
|
-
|
|
615
|
-
if (!
|
|
616
|
-
|
|
588
|
+
validObjects([arbitration, permission, ...guards]);
|
|
589
|
+
if (!IsValidArgType(parameter_type)) {
|
|
590
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
617
591
|
}
|
|
618
592
|
if (passport) {
|
|
619
593
|
tx.moveCall({
|
|
620
|
-
target:
|
|
594
|
+
target: arbitrationFn(`voting_guard_remove_with_passport`),
|
|
621
595
|
arguments: [
|
|
622
|
-
|
|
623
|
-
|
|
596
|
+
toTxObject(tx, arbitration),
|
|
597
|
+
toTxObject(tx, permission),
|
|
624
598
|
passport,
|
|
625
599
|
tx.pure.vector("address", guards),
|
|
626
600
|
tx.object.mutRegistrar(),
|
|
@@ -630,10 +604,10 @@ function voting_guard_remove(tx, arbitration, parameter_type, permission, guards
|
|
|
630
604
|
}
|
|
631
605
|
else {
|
|
632
606
|
tx.moveCall({
|
|
633
|
-
target:
|
|
607
|
+
target: arbitrationFn(`voting_guard_remove`),
|
|
634
608
|
arguments: [
|
|
635
|
-
|
|
636
|
-
|
|
609
|
+
toTxObject(tx, arbitration),
|
|
610
|
+
toTxObject(tx, permission),
|
|
637
611
|
tx.pure.vector("address", guards),
|
|
638
612
|
tx.object.mutRegistrar(),
|
|
639
613
|
],
|
|
@@ -641,17 +615,17 @@ function voting_guard_remove(tx, arbitration, parameter_type, permission, guards
|
|
|
641
615
|
});
|
|
642
616
|
}
|
|
643
617
|
}
|
|
644
|
-
function voting_guard_clear(tx, arbitration, parameter_type, permission, passport) {
|
|
645
|
-
|
|
646
|
-
if (!
|
|
647
|
-
|
|
618
|
+
export function voting_guard_clear(tx, arbitration, parameter_type, permission, passport) {
|
|
619
|
+
validObjects([arbitration, permission]);
|
|
620
|
+
if (!IsValidArgType(parameter_type)) {
|
|
621
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
648
622
|
}
|
|
649
623
|
if (passport) {
|
|
650
624
|
tx.moveCall({
|
|
651
|
-
target:
|
|
625
|
+
target: arbitrationFn(`voting_guard_clear_with_passport`),
|
|
652
626
|
arguments: [
|
|
653
|
-
|
|
654
|
-
|
|
627
|
+
toTxObject(tx, arbitration),
|
|
628
|
+
toTxObject(tx, permission),
|
|
655
629
|
passport,
|
|
656
630
|
tx.object.mutRegistrar(),
|
|
657
631
|
],
|
|
@@ -660,27 +634,27 @@ function voting_guard_clear(tx, arbitration, parameter_type, permission, passpor
|
|
|
660
634
|
}
|
|
661
635
|
else {
|
|
662
636
|
tx.moveCall({
|
|
663
|
-
target:
|
|
637
|
+
target: arbitrationFn(`voting_guard_clear`),
|
|
664
638
|
arguments: [
|
|
665
|
-
|
|
666
|
-
|
|
639
|
+
toTxObject(tx, arbitration),
|
|
640
|
+
toTxObject(tx, permission),
|
|
667
641
|
tx.object.mutRegistrar(),
|
|
668
642
|
],
|
|
669
643
|
typeArguments: [parameter_type],
|
|
670
644
|
});
|
|
671
645
|
}
|
|
672
646
|
}
|
|
673
|
-
function usage_guard_set(tx, arbitration, parameter_type, permission, guard, passport) {
|
|
674
|
-
|
|
675
|
-
if (!
|
|
676
|
-
|
|
647
|
+
export function usage_guard_set(tx, arbitration, parameter_type, permission, guard, passport) {
|
|
648
|
+
validObjects([arbitration, permission, guard]);
|
|
649
|
+
if (!IsValidArgType(parameter_type)) {
|
|
650
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
677
651
|
}
|
|
678
652
|
if (passport) {
|
|
679
653
|
tx.moveCall({
|
|
680
|
-
target:
|
|
654
|
+
target: arbitrationFn(`usage_guard_set_with_passport`),
|
|
681
655
|
arguments: [
|
|
682
|
-
|
|
683
|
-
|
|
656
|
+
toTxObject(tx, arbitration),
|
|
657
|
+
toTxObject(tx, permission),
|
|
684
658
|
passport,
|
|
685
659
|
tx.object(guard),
|
|
686
660
|
tx.object.mutRegistrar(),
|
|
@@ -691,10 +665,10 @@ function usage_guard_set(tx, arbitration, parameter_type, permission, guard, pas
|
|
|
691
665
|
}
|
|
692
666
|
else {
|
|
693
667
|
tx.moveCall({
|
|
694
|
-
target:
|
|
668
|
+
target: arbitrationFn(`usage_guard_set`),
|
|
695
669
|
arguments: [
|
|
696
|
-
|
|
697
|
-
|
|
670
|
+
toTxObject(tx, arbitration),
|
|
671
|
+
toTxObject(tx, permission),
|
|
698
672
|
tx.object(guard),
|
|
699
673
|
tx.object.mutRegistrar(),
|
|
700
674
|
tx.object.clock(),
|
|
@@ -703,17 +677,17 @@ function usage_guard_set(tx, arbitration, parameter_type, permission, guard, pas
|
|
|
703
677
|
});
|
|
704
678
|
}
|
|
705
679
|
}
|
|
706
|
-
function usage_guard_none(tx, arbitration, parameter_type, permission, passport) {
|
|
707
|
-
|
|
708
|
-
if (!
|
|
709
|
-
|
|
680
|
+
export function usage_guard_none(tx, arbitration, parameter_type, permission, passport) {
|
|
681
|
+
validObjects([arbitration, permission]);
|
|
682
|
+
if (!IsValidArgType(parameter_type)) {
|
|
683
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
710
684
|
}
|
|
711
685
|
if (passport) {
|
|
712
686
|
tx.moveCall({
|
|
713
|
-
target:
|
|
687
|
+
target: arbitrationFn(`usage_guard_none_with_passport`),
|
|
714
688
|
arguments: [
|
|
715
|
-
|
|
716
|
-
|
|
689
|
+
toTxObject(tx, arbitration),
|
|
690
|
+
toTxObject(tx, permission),
|
|
717
691
|
passport,
|
|
718
692
|
tx.object.mutRegistrar(),
|
|
719
693
|
],
|
|
@@ -722,27 +696,27 @@ function usage_guard_none(tx, arbitration, parameter_type, permission, passport)
|
|
|
722
696
|
}
|
|
723
697
|
else {
|
|
724
698
|
tx.moveCall({
|
|
725
|
-
target:
|
|
699
|
+
target: arbitrationFn(`usage_guard_none`),
|
|
726
700
|
arguments: [
|
|
727
|
-
|
|
728
|
-
|
|
701
|
+
toTxObject(tx, arbitration),
|
|
702
|
+
toTxObject(tx, permission),
|
|
729
703
|
tx.object.mutRegistrar(),
|
|
730
704
|
],
|
|
731
705
|
typeArguments: [parameter_type],
|
|
732
706
|
});
|
|
733
707
|
}
|
|
734
708
|
}
|
|
735
|
-
function pause(tx, arbitration, parameter_type, permission, pause, passport) {
|
|
736
|
-
|
|
737
|
-
if (!
|
|
738
|
-
|
|
709
|
+
export function pause(tx, arbitration, parameter_type, permission, pause, passport) {
|
|
710
|
+
validObjects([arbitration, permission]);
|
|
711
|
+
if (!IsValidArgType(parameter_type)) {
|
|
712
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
739
713
|
}
|
|
740
714
|
if (passport) {
|
|
741
715
|
tx.moveCall({
|
|
742
|
-
target:
|
|
716
|
+
target: arbitrationFn(`pause_with_passport`),
|
|
743
717
|
arguments: [
|
|
744
|
-
|
|
745
|
-
|
|
718
|
+
toTxObject(tx, arbitration),
|
|
719
|
+
toTxObject(tx, permission),
|
|
746
720
|
passport,
|
|
747
721
|
tx.pure.bool(pause),
|
|
748
722
|
],
|
|
@@ -751,30 +725,30 @@ function pause(tx, arbitration, parameter_type, permission, pause, passport) {
|
|
|
751
725
|
}
|
|
752
726
|
else {
|
|
753
727
|
tx.moveCall({
|
|
754
|
-
target:
|
|
728
|
+
target: arbitrationFn(`pause`),
|
|
755
729
|
arguments: [
|
|
756
|
-
|
|
757
|
-
|
|
730
|
+
toTxObject(tx, arbitration),
|
|
731
|
+
toTxObject(tx, permission),
|
|
758
732
|
tx.pure.bool(pause),
|
|
759
733
|
],
|
|
760
734
|
typeArguments: [parameter_type],
|
|
761
735
|
});
|
|
762
736
|
}
|
|
763
737
|
}
|
|
764
|
-
function fee_set(tx, arbitration, parameter_type, permission, fee, passport) {
|
|
765
|
-
|
|
766
|
-
if (!
|
|
767
|
-
|
|
738
|
+
export function fee_set(tx, arbitration, parameter_type, permission, fee, passport) {
|
|
739
|
+
validObjects([arbitration, permission]);
|
|
740
|
+
if (!IsValidArgType(parameter_type)) {
|
|
741
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
768
742
|
}
|
|
769
|
-
if (!
|
|
770
|
-
|
|
743
|
+
if (!isValidU64(fee)) {
|
|
744
|
+
W_ERROR(WErrors.InvalidParam, `Fee ${fee} is not valid u64`);
|
|
771
745
|
}
|
|
772
746
|
if (passport) {
|
|
773
747
|
tx.moveCall({
|
|
774
|
-
target:
|
|
748
|
+
target: arbitrationFn(`fee_set_with_passport`),
|
|
775
749
|
arguments: [
|
|
776
|
-
|
|
777
|
-
|
|
750
|
+
toTxObject(tx, arbitration),
|
|
751
|
+
toTxObject(tx, permission),
|
|
778
752
|
passport,
|
|
779
753
|
tx.pure.u64(fee),
|
|
780
754
|
],
|
|
@@ -783,38 +757,38 @@ function fee_set(tx, arbitration, parameter_type, permission, fee, passport) {
|
|
|
783
757
|
}
|
|
784
758
|
else {
|
|
785
759
|
tx.moveCall({
|
|
786
|
-
target:
|
|
760
|
+
target: arbitrationFn(`fee_set`),
|
|
787
761
|
arguments: [
|
|
788
|
-
|
|
789
|
-
|
|
762
|
+
toTxObject(tx, arbitration),
|
|
763
|
+
toTxObject(tx, permission),
|
|
790
764
|
tx.pure.u64(fee),
|
|
791
765
|
],
|
|
792
766
|
typeArguments: [parameter_type],
|
|
793
767
|
});
|
|
794
768
|
}
|
|
795
769
|
}
|
|
796
|
-
async function dispute(env, tx, arbitration, parameter_type, order, description, proposition, fee, passport) {
|
|
797
|
-
|
|
798
|
-
if (!
|
|
799
|
-
|
|
770
|
+
export async function dispute(env, tx, arbitration, parameter_type, order, description, proposition, fee, passport) {
|
|
771
|
+
validObjects([arbitration, order]);
|
|
772
|
+
if (!IsValidArgType(parameter_type)) {
|
|
773
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
800
774
|
}
|
|
801
|
-
if (!
|
|
802
|
-
|
|
775
|
+
if (!isValidDescription(description)) {
|
|
776
|
+
W_ERROR(WErrors.IsValidDescription, `Description exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
|
|
803
777
|
}
|
|
804
|
-
if (proposition.length >
|
|
805
|
-
|
|
778
|
+
if (proposition.length > MAX_PROPOSITION_COUNT) {
|
|
779
|
+
W_ERROR(WErrors.InvalidParam, `Proposition count exceeds maximum count ${MAX_PROPOSITION_COUNT}`);
|
|
806
780
|
}
|
|
807
|
-
if (!
|
|
808
|
-
|
|
781
|
+
if (!isValidArray(proposition, isValidLongName)) {
|
|
782
|
+
W_ERROR(WErrors.InvalidParam, `Proposition ${proposition} is not valid array of string, each string must less than ${MAX_LONG_NAME_LENGTH}`);
|
|
809
783
|
}
|
|
810
|
-
const c = await
|
|
784
|
+
const c = await getCoinParam(env, tx, fee, parameter_type);
|
|
811
785
|
if (passport) {
|
|
812
786
|
return tx.moveCall({
|
|
813
|
-
target:
|
|
787
|
+
target: arbitrationFn(`dispute_with_passport`),
|
|
814
788
|
arguments: [
|
|
815
|
-
|
|
789
|
+
toTxObject(tx, arbitration),
|
|
816
790
|
passport,
|
|
817
|
-
|
|
791
|
+
toTxObject(tx, order),
|
|
818
792
|
tx.pure.string(description),
|
|
819
793
|
tx.pure.vector("string", proposition),
|
|
820
794
|
c,
|
|
@@ -825,10 +799,10 @@ async function dispute(env, tx, arbitration, parameter_type, order, description,
|
|
|
825
799
|
}
|
|
826
800
|
else {
|
|
827
801
|
return tx.moveCall({
|
|
828
|
-
target:
|
|
802
|
+
target: arbitrationFn(`dispute`),
|
|
829
803
|
arguments: [
|
|
830
|
-
|
|
831
|
-
|
|
804
|
+
toTxObject(tx, arbitration),
|
|
805
|
+
toTxObject(tx, order),
|
|
832
806
|
tx.pure.string(description),
|
|
833
807
|
tx.pure.vector("string", proposition),
|
|
834
808
|
c,
|
|
@@ -838,24 +812,24 @@ async function dispute(env, tx, arbitration, parameter_type, order, description,
|
|
|
838
812
|
});
|
|
839
813
|
}
|
|
840
814
|
}
|
|
841
|
-
function vote(tx, arbitration, parameter_type, permission, arb, votes, voting_guard, passport) {
|
|
842
|
-
|
|
843
|
-
if (!
|
|
844
|
-
|
|
815
|
+
export function vote(tx, arbitration, parameter_type, permission, arb, votes, voting_guard, passport) {
|
|
816
|
+
validObjects([arbitration, permission, arb, voting_guard]);
|
|
817
|
+
if (!IsValidArgType(parameter_type)) {
|
|
818
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
845
819
|
}
|
|
846
|
-
if (!
|
|
847
|
-
|
|
820
|
+
if (!isValidArray(votes, isValidU8)) {
|
|
821
|
+
W_ERROR(WErrors.InvalidParam, `Votes ${votes} is not valid array of u8`);
|
|
848
822
|
}
|
|
849
823
|
if (passport) {
|
|
850
824
|
// voting by voting-guard
|
|
851
825
|
if (voting_guard) {
|
|
852
826
|
tx.moveCall({
|
|
853
|
-
target:
|
|
827
|
+
target: arbitrationFn(`vote_with_voting_guard`),
|
|
854
828
|
arguments: [
|
|
855
|
-
|
|
829
|
+
toTxObject(tx, arbitration),
|
|
856
830
|
passport,
|
|
857
|
-
|
|
858
|
-
|
|
831
|
+
toTxObject(tx, arb),
|
|
832
|
+
toTxObject(tx, voting_guard),
|
|
859
833
|
tx.pure.vector("u8", votes),
|
|
860
834
|
tx.object.clock(),
|
|
861
835
|
],
|
|
@@ -864,12 +838,12 @@ function vote(tx, arbitration, parameter_type, permission, arb, votes, voting_gu
|
|
|
864
838
|
}
|
|
865
839
|
else {
|
|
866
840
|
tx.moveCall({
|
|
867
|
-
target:
|
|
841
|
+
target: arbitrationFn(`vote_with_passport`),
|
|
868
842
|
arguments: [
|
|
869
|
-
|
|
870
|
-
|
|
843
|
+
toTxObject(tx, arbitration),
|
|
844
|
+
toTxObject(tx, permission),
|
|
871
845
|
passport,
|
|
872
|
-
|
|
846
|
+
toTxObject(tx, arb),
|
|
873
847
|
tx.pure.vector("u8", votes),
|
|
874
848
|
tx.object.clock(),
|
|
875
849
|
],
|
|
@@ -879,11 +853,11 @@ function vote(tx, arbitration, parameter_type, permission, arb, votes, voting_gu
|
|
|
879
853
|
}
|
|
880
854
|
else {
|
|
881
855
|
tx.moveCall({
|
|
882
|
-
target:
|
|
856
|
+
target: arbitrationFn(`vote`),
|
|
883
857
|
arguments: [
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
858
|
+
toTxObject(tx, arbitration),
|
|
859
|
+
toTxObject(tx, permission),
|
|
860
|
+
toTxObject(tx, arb),
|
|
887
861
|
tx.pure.vector("u8", votes),
|
|
888
862
|
tx.object.clock(),
|
|
889
863
|
],
|
|
@@ -891,25 +865,25 @@ function vote(tx, arbitration, parameter_type, permission, arb, votes, voting_gu
|
|
|
891
865
|
});
|
|
892
866
|
}
|
|
893
867
|
}
|
|
894
|
-
function arbitration(tx, arbitration, parameter_type, permission, arb, feedback, indemnity, passport) {
|
|
895
|
-
|
|
896
|
-
if (!
|
|
897
|
-
|
|
868
|
+
export function arbitration(tx, arbitration, parameter_type, permission, arb, feedback, indemnity, passport) {
|
|
869
|
+
validObjects([arbitration, permission, arb]);
|
|
870
|
+
if (!IsValidArgType(parameter_type)) {
|
|
871
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
898
872
|
}
|
|
899
|
-
if (!
|
|
900
|
-
|
|
873
|
+
if (!isValidDescription(feedback)) {
|
|
874
|
+
W_ERROR(WErrors.InvalidParam, `Feedback ${feedback} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
|
|
901
875
|
}
|
|
902
|
-
if (!
|
|
903
|
-
|
|
876
|
+
if (!isValidU64(indemnity)) {
|
|
877
|
+
W_ERROR(WErrors.InvalidParam, `Indemnity ${indemnity} must be u64 number`);
|
|
904
878
|
}
|
|
905
879
|
if (passport) {
|
|
906
880
|
tx.moveCall({
|
|
907
|
-
target:
|
|
881
|
+
target: arbitrationFn(`arbitration_with_passport`),
|
|
908
882
|
arguments: [
|
|
909
|
-
|
|
910
|
-
|
|
883
|
+
toTxObject(tx, arbitration),
|
|
884
|
+
toTxObject(tx, permission),
|
|
911
885
|
passport,
|
|
912
|
-
|
|
886
|
+
toTxObject(tx, arb),
|
|
913
887
|
tx.pure.string(feedback),
|
|
914
888
|
tx.pure.u64(indemnity),
|
|
915
889
|
tx.object.clock(),
|
|
@@ -919,11 +893,11 @@ function arbitration(tx, arbitration, parameter_type, permission, arb, feedback,
|
|
|
919
893
|
}
|
|
920
894
|
else {
|
|
921
895
|
tx.moveCall({
|
|
922
|
-
target:
|
|
896
|
+
target: arbitrationFn(`arbitration`),
|
|
923
897
|
arguments: [
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
898
|
+
toTxObject(tx, arbitration),
|
|
899
|
+
toTxObject(tx, permission),
|
|
900
|
+
toTxObject(tx, arb),
|
|
927
901
|
tx.pure.string(feedback),
|
|
928
902
|
tx.pure.u64(indemnity),
|
|
929
903
|
tx.object.clock(),
|
|
@@ -932,22 +906,22 @@ function arbitration(tx, arbitration, parameter_type, permission, arb, feedback,
|
|
|
932
906
|
});
|
|
933
907
|
}
|
|
934
908
|
}
|
|
935
|
-
function feedback(tx, arbitration, parameter_type, permission, arb, feedback, passport) {
|
|
936
|
-
|
|
937
|
-
if (!
|
|
938
|
-
|
|
909
|
+
export function feedback(tx, arbitration, parameter_type, permission, arb, feedback, passport) {
|
|
910
|
+
validObjects([arbitration, permission, arb]);
|
|
911
|
+
if (!IsValidArgType(parameter_type)) {
|
|
912
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
939
913
|
}
|
|
940
|
-
if (!
|
|
941
|
-
|
|
914
|
+
if (!isValidDescription(feedback)) {
|
|
915
|
+
W_ERROR(WErrors.InvalidParam, `Feedback ${feedback} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
|
|
942
916
|
}
|
|
943
917
|
if (passport) {
|
|
944
918
|
tx.moveCall({
|
|
945
|
-
target:
|
|
919
|
+
target: arbitrationFn(`feedback_with_passport`),
|
|
946
920
|
arguments: [
|
|
947
|
-
|
|
948
|
-
|
|
921
|
+
toTxObject(tx, arbitration),
|
|
922
|
+
toTxObject(tx, permission),
|
|
949
923
|
passport,
|
|
950
|
-
|
|
924
|
+
toTxObject(tx, arb),
|
|
951
925
|
tx.pure.string(feedback),
|
|
952
926
|
],
|
|
953
927
|
typeArguments: [parameter_type],
|
|
@@ -955,33 +929,33 @@ function feedback(tx, arbitration, parameter_type, permission, arb, feedback, pa
|
|
|
955
929
|
}
|
|
956
930
|
else {
|
|
957
931
|
tx.moveCall({
|
|
958
|
-
target:
|
|
932
|
+
target: arbitrationFn(`feedback`),
|
|
959
933
|
arguments: [
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
934
|
+
toTxObject(tx, arbitration),
|
|
935
|
+
toTxObject(tx, permission),
|
|
936
|
+
toTxObject(tx, arb),
|
|
963
937
|
tx.pure.string(feedback),
|
|
964
938
|
],
|
|
965
939
|
typeArguments: [parameter_type],
|
|
966
940
|
});
|
|
967
941
|
}
|
|
968
942
|
}
|
|
969
|
-
function confirm(tx, arbitration, parameter_type, permission, arb, voting_deadline, passport) {
|
|
970
|
-
|
|
971
|
-
if (!
|
|
972
|
-
|
|
943
|
+
export function confirm(tx, arbitration, parameter_type, permission, arb, voting_deadline, passport) {
|
|
944
|
+
validObjects([arbitration, permission, arb]);
|
|
945
|
+
if (!IsValidArgType(parameter_type)) {
|
|
946
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
973
947
|
}
|
|
974
|
-
if (voting_deadline !== null && !
|
|
975
|
-
|
|
948
|
+
if (voting_deadline !== null && !isValidU64(voting_deadline)) {
|
|
949
|
+
W_ERROR(WErrors.InvalidParam, `Voting deadline ${voting_deadline} must be u64 number or null`);
|
|
976
950
|
}
|
|
977
951
|
if (passport) {
|
|
978
952
|
tx.moveCall({
|
|
979
|
-
target:
|
|
953
|
+
target: arbitrationFn(`confirm_with_passport`),
|
|
980
954
|
arguments: [
|
|
981
|
-
|
|
982
|
-
|
|
955
|
+
toTxObject(tx, arbitration),
|
|
956
|
+
toTxObject(tx, permission),
|
|
983
957
|
passport,
|
|
984
|
-
|
|
958
|
+
toTxObject(tx, arb),
|
|
985
959
|
tx.pure.option("u64", voting_deadline),
|
|
986
960
|
],
|
|
987
961
|
typeArguments: [parameter_type],
|
|
@@ -989,33 +963,33 @@ function confirm(tx, arbitration, parameter_type, permission, arb, voting_deadli
|
|
|
989
963
|
}
|
|
990
964
|
else {
|
|
991
965
|
tx.moveCall({
|
|
992
|
-
target:
|
|
966
|
+
target: arbitrationFn(`confirm`),
|
|
993
967
|
arguments: [
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
968
|
+
toTxObject(tx, arbitration),
|
|
969
|
+
toTxObject(tx, permission),
|
|
970
|
+
toTxObject(tx, arb),
|
|
997
971
|
tx.pure.option("u64", voting_deadline),
|
|
998
972
|
],
|
|
999
973
|
typeArguments: [parameter_type],
|
|
1000
974
|
});
|
|
1001
975
|
}
|
|
1002
976
|
}
|
|
1003
|
-
function voting_deadline_change(tx, arbitration, parameter_type, permission, arb, voting_deadline, passport) {
|
|
1004
|
-
|
|
1005
|
-
if (!
|
|
1006
|
-
|
|
977
|
+
export function voting_deadline_change(tx, arbitration, parameter_type, permission, arb, voting_deadline, passport) {
|
|
978
|
+
validObjects([arbitration, permission, arb]);
|
|
979
|
+
if (!IsValidArgType(parameter_type)) {
|
|
980
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
1007
981
|
}
|
|
1008
|
-
if (voting_deadline !== null && !
|
|
1009
|
-
|
|
982
|
+
if (voting_deadline !== null && !isValidU64(voting_deadline)) {
|
|
983
|
+
W_ERROR(WErrors.InvalidParam, `Voting deadline ${voting_deadline} must be u64 number or null`);
|
|
1010
984
|
}
|
|
1011
985
|
if (passport) {
|
|
1012
986
|
tx.moveCall({
|
|
1013
|
-
target:
|
|
987
|
+
target: arbitrationFn(`voting_deadline_change_with_passport`),
|
|
1014
988
|
arguments: [
|
|
1015
|
-
|
|
1016
|
-
|
|
989
|
+
toTxObject(tx, arbitration),
|
|
990
|
+
toTxObject(tx, permission),
|
|
1017
991
|
passport,
|
|
1018
|
-
|
|
992
|
+
toTxObject(tx, arb),
|
|
1019
993
|
tx.pure.option("u64", voting_deadline),
|
|
1020
994
|
],
|
|
1021
995
|
typeArguments: [parameter_type],
|
|
@@ -1023,33 +997,33 @@ function voting_deadline_change(tx, arbitration, parameter_type, permission, arb
|
|
|
1023
997
|
}
|
|
1024
998
|
else {
|
|
1025
999
|
tx.moveCall({
|
|
1026
|
-
target:
|
|
1000
|
+
target: arbitrationFn(`voting_deadline_change`),
|
|
1027
1001
|
arguments: [
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1002
|
+
toTxObject(tx, arbitration),
|
|
1003
|
+
toTxObject(tx, permission),
|
|
1004
|
+
toTxObject(tx, arb),
|
|
1031
1005
|
tx.pure.option("u64", voting_deadline),
|
|
1032
1006
|
],
|
|
1033
1007
|
typeArguments: [parameter_type],
|
|
1034
1008
|
});
|
|
1035
1009
|
}
|
|
1036
1010
|
}
|
|
1037
|
-
function reset(tx, arbitration, parameter_type, permission, arb, feedback, passport) {
|
|
1038
|
-
|
|
1039
|
-
if (!
|
|
1040
|
-
|
|
1011
|
+
export function reset(tx, arbitration, parameter_type, permission, arb, feedback, passport) {
|
|
1012
|
+
validObjects([arbitration, permission, arb]);
|
|
1013
|
+
if (!IsValidArgType(parameter_type)) {
|
|
1014
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
1041
1015
|
}
|
|
1042
|
-
if (!
|
|
1043
|
-
|
|
1016
|
+
if (!isValidDescription(feedback)) {
|
|
1017
|
+
W_ERROR(WErrors.InvalidParam, `Feedback ${feedback} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
|
|
1044
1018
|
}
|
|
1045
1019
|
if (passport) {
|
|
1046
1020
|
tx.moveCall({
|
|
1047
|
-
target:
|
|
1021
|
+
target: arbitrationFn(`reset_with_passport`),
|
|
1048
1022
|
arguments: [
|
|
1049
|
-
|
|
1050
|
-
|
|
1023
|
+
toTxObject(tx, arbitration),
|
|
1024
|
+
toTxObject(tx, permission),
|
|
1051
1025
|
passport,
|
|
1052
|
-
|
|
1026
|
+
toTxObject(tx, arb),
|
|
1053
1027
|
tx.pure.string(feedback),
|
|
1054
1028
|
],
|
|
1055
1029
|
typeArguments: [parameter_type],
|
|
@@ -1057,30 +1031,30 @@ function reset(tx, arbitration, parameter_type, permission, arb, feedback, passp
|
|
|
1057
1031
|
}
|
|
1058
1032
|
else {
|
|
1059
1033
|
tx.moveCall({
|
|
1060
|
-
target:
|
|
1034
|
+
target: arbitrationFn(`reset`),
|
|
1061
1035
|
arguments: [
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1036
|
+
toTxObject(tx, arbitration),
|
|
1037
|
+
toTxObject(tx, permission),
|
|
1038
|
+
toTxObject(tx, arb),
|
|
1065
1039
|
tx.pure.string(feedback),
|
|
1066
1040
|
],
|
|
1067
1041
|
typeArguments: [parameter_type],
|
|
1068
1042
|
});
|
|
1069
1043
|
}
|
|
1070
1044
|
}
|
|
1071
|
-
function arb_withdraw(tx, arbitration, parameter_type, permission, arb, passport) {
|
|
1072
|
-
|
|
1073
|
-
if (!
|
|
1074
|
-
|
|
1045
|
+
export function arb_withdraw(tx, arbitration, parameter_type, permission, arb, passport) {
|
|
1046
|
+
validObjects([arbitration, permission, arb]);
|
|
1047
|
+
if (!IsValidArgType(parameter_type)) {
|
|
1048
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
1075
1049
|
}
|
|
1076
1050
|
if (passport) {
|
|
1077
1051
|
tx.moveCall({
|
|
1078
|
-
target:
|
|
1052
|
+
target: arbitrationFn(`arb_withdraw_with_passport`),
|
|
1079
1053
|
arguments: [
|
|
1080
|
-
|
|
1081
|
-
|
|
1054
|
+
toTxObject(tx, arbitration),
|
|
1055
|
+
toTxObject(tx, permission),
|
|
1082
1056
|
passport,
|
|
1083
|
-
|
|
1057
|
+
toTxObject(tx, arb),
|
|
1084
1058
|
tx.object.clock(),
|
|
1085
1059
|
],
|
|
1086
1060
|
typeArguments: [parameter_type],
|
|
@@ -1088,36 +1062,36 @@ function arb_withdraw(tx, arbitration, parameter_type, permission, arb, passport
|
|
|
1088
1062
|
}
|
|
1089
1063
|
else {
|
|
1090
1064
|
tx.moveCall({
|
|
1091
|
-
target:
|
|
1065
|
+
target: arbitrationFn(`arb_withdraw`),
|
|
1092
1066
|
arguments: [
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1067
|
+
toTxObject(tx, arbitration),
|
|
1068
|
+
toTxObject(tx, permission),
|
|
1069
|
+
toTxObject(tx, arb),
|
|
1096
1070
|
tx.object.clock(),
|
|
1097
1071
|
],
|
|
1098
1072
|
typeArguments: [parameter_type],
|
|
1099
1073
|
});
|
|
1100
1074
|
}
|
|
1101
1075
|
}
|
|
1102
|
-
function fees_alloc(tx, arbitration, parameter_type, permission, allocation, payment_remark, payment_index, passport) {
|
|
1103
|
-
|
|
1104
|
-
if (!
|
|
1105
|
-
|
|
1076
|
+
export function fees_alloc(tx, arbitration, parameter_type, permission, allocation, payment_remark, payment_index, passport) {
|
|
1077
|
+
validObjects([arbitration, permission, allocation]);
|
|
1078
|
+
if (!IsValidArgType(parameter_type)) {
|
|
1079
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
1106
1080
|
}
|
|
1107
|
-
if (!
|
|
1108
|
-
|
|
1081
|
+
if (!isValidDescription(payment_remark)) {
|
|
1082
|
+
W_ERROR(WErrors.InvalidParam, `Payment remark ${payment_remark} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
|
|
1109
1083
|
}
|
|
1110
|
-
if (!
|
|
1111
|
-
|
|
1084
|
+
if (!isValidU64(payment_index)) {
|
|
1085
|
+
W_ERROR(WErrors.InvalidParam, `Payment index ${payment_index} must be u64 number`);
|
|
1112
1086
|
}
|
|
1113
1087
|
if (passport) {
|
|
1114
1088
|
return tx.moveCall({
|
|
1115
|
-
target:
|
|
1089
|
+
target: arbitrationFn(`fees_alloc_with_passport`),
|
|
1116
1090
|
arguments: [
|
|
1117
|
-
|
|
1118
|
-
|
|
1091
|
+
toTxObject(tx, arbitration),
|
|
1092
|
+
toTxObject(tx, permission),
|
|
1119
1093
|
passport,
|
|
1120
|
-
|
|
1094
|
+
toTxObject(tx, allocation),
|
|
1121
1095
|
tx.pure.string(payment_remark),
|
|
1122
1096
|
tx.pure.u64(payment_index),
|
|
1123
1097
|
tx.object.mutRegistrar(),
|
|
@@ -1128,11 +1102,11 @@ function fees_alloc(tx, arbitration, parameter_type, permission, allocation, pay
|
|
|
1128
1102
|
}
|
|
1129
1103
|
else {
|
|
1130
1104
|
return tx.moveCall({
|
|
1131
|
-
target:
|
|
1105
|
+
target: arbitrationFn(`fees_alloc`),
|
|
1132
1106
|
arguments: [
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1107
|
+
toTxObject(tx, arbitration),
|
|
1108
|
+
toTxObject(tx, permission),
|
|
1109
|
+
toTxObject(tx, allocation),
|
|
1136
1110
|
tx.pure.string(payment_remark),
|
|
1137
1111
|
tx.pure.u64(payment_index),
|
|
1138
1112
|
tx.object.mutRegistrar(),
|
|
@@ -1142,25 +1116,25 @@ function fees_alloc(tx, arbitration, parameter_type, permission, allocation, pay
|
|
|
1142
1116
|
});
|
|
1143
1117
|
}
|
|
1144
1118
|
}
|
|
1145
|
-
function fees_transfer(tx, arbitration, parameter_type, permission, treasury, payment_remark, payment_index, passport) {
|
|
1146
|
-
|
|
1147
|
-
if (!
|
|
1148
|
-
|
|
1119
|
+
export function fees_transfer(tx, arbitration, parameter_type, permission, treasury, payment_remark, payment_index, passport) {
|
|
1120
|
+
validObjects([arbitration, permission, treasury]);
|
|
1121
|
+
if (!IsValidArgType(parameter_type)) {
|
|
1122
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
1149
1123
|
}
|
|
1150
|
-
if (!
|
|
1151
|
-
|
|
1124
|
+
if (!isValidDescription(payment_remark)) {
|
|
1125
|
+
W_ERROR(WErrors.InvalidParam, `Payment remark ${payment_remark} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
|
|
1152
1126
|
}
|
|
1153
|
-
if (!
|
|
1154
|
-
|
|
1127
|
+
if (!isValidU64(payment_index)) {
|
|
1128
|
+
W_ERROR(WErrors.InvalidParam, `Payment index ${payment_index} must be u64 number`);
|
|
1155
1129
|
}
|
|
1156
1130
|
if (passport) {
|
|
1157
1131
|
return tx.moveCall({
|
|
1158
|
-
target:
|
|
1132
|
+
target: arbitrationFn(`fees_transfer_with_passport`),
|
|
1159
1133
|
arguments: [
|
|
1160
|
-
|
|
1161
|
-
|
|
1134
|
+
toTxObject(tx, arbitration),
|
|
1135
|
+
toTxObject(tx, permission),
|
|
1162
1136
|
passport,
|
|
1163
|
-
|
|
1137
|
+
toTxObject(tx, treasury),
|
|
1164
1138
|
tx.pure.string(payment_remark),
|
|
1165
1139
|
tx.pure.u64(payment_index),
|
|
1166
1140
|
tx.object.mutRegistrar(),
|
|
@@ -1171,11 +1145,11 @@ function fees_transfer(tx, arbitration, parameter_type, permission, treasury, pa
|
|
|
1171
1145
|
}
|
|
1172
1146
|
else {
|
|
1173
1147
|
return tx.moveCall({
|
|
1174
|
-
target:
|
|
1148
|
+
target: arbitrationFn(`fees_transfer`),
|
|
1175
1149
|
arguments: [
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1150
|
+
toTxObject(tx, arbitration),
|
|
1151
|
+
toTxObject(tx, permission),
|
|
1152
|
+
toTxObject(tx, treasury),
|
|
1179
1153
|
tx.pure.string(payment_remark),
|
|
1180
1154
|
tx.pure.u64(payment_index),
|
|
1181
1155
|
tx.object.mutRegistrar(),
|
|
@@ -1185,20 +1159,20 @@ function fees_transfer(tx, arbitration, parameter_type, permission, treasury, pa
|
|
|
1185
1159
|
});
|
|
1186
1160
|
}
|
|
1187
1161
|
}
|
|
1188
|
-
function um_set(tx, arbitration, parameter_type, permission, um, passport) {
|
|
1189
|
-
|
|
1190
|
-
if (!
|
|
1191
|
-
|
|
1162
|
+
export function um_set(tx, arbitration, parameter_type, permission, um, passport) {
|
|
1163
|
+
validObjects([arbitration, permission]);
|
|
1164
|
+
if (!IsValidArgType(parameter_type)) {
|
|
1165
|
+
W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
|
|
1192
1166
|
}
|
|
1193
1167
|
if (um) {
|
|
1194
1168
|
if (passport) {
|
|
1195
1169
|
tx.moveCall({
|
|
1196
|
-
target:
|
|
1170
|
+
target: arbitrationFn(`um_set_with_passport`),
|
|
1197
1171
|
arguments: [
|
|
1198
|
-
|
|
1199
|
-
|
|
1172
|
+
toTxObject(tx, arbitration),
|
|
1173
|
+
toTxObject(tx, permission),
|
|
1200
1174
|
passport,
|
|
1201
|
-
|
|
1175
|
+
toTxObject(tx, um),
|
|
1202
1176
|
tx.object.mutRegistrar(),
|
|
1203
1177
|
tx.object.clock(),
|
|
1204
1178
|
],
|
|
@@ -1207,11 +1181,11 @@ function um_set(tx, arbitration, parameter_type, permission, um, passport) {
|
|
|
1207
1181
|
}
|
|
1208
1182
|
else {
|
|
1209
1183
|
tx.moveCall({
|
|
1210
|
-
target:
|
|
1184
|
+
target: arbitrationFn(`um_set`),
|
|
1211
1185
|
arguments: [
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1186
|
+
toTxObject(tx, arbitration),
|
|
1187
|
+
toTxObject(tx, permission),
|
|
1188
|
+
toTxObject(tx, um),
|
|
1215
1189
|
tx.object.mutRegistrar(),
|
|
1216
1190
|
tx.object.clock(),
|
|
1217
1191
|
],
|
|
@@ -1222,10 +1196,10 @@ function um_set(tx, arbitration, parameter_type, permission, um, passport) {
|
|
|
1222
1196
|
else {
|
|
1223
1197
|
if (passport) {
|
|
1224
1198
|
tx.moveCall({
|
|
1225
|
-
target:
|
|
1199
|
+
target: arbitrationFn(`um_none_with_passport`),
|
|
1226
1200
|
arguments: [
|
|
1227
|
-
|
|
1228
|
-
|
|
1201
|
+
toTxObject(tx, arbitration),
|
|
1202
|
+
toTxObject(tx, permission),
|
|
1229
1203
|
passport,
|
|
1230
1204
|
tx.object.mutRegistrar(),
|
|
1231
1205
|
],
|
|
@@ -1234,10 +1208,10 @@ function um_set(tx, arbitration, parameter_type, permission, um, passport) {
|
|
|
1234
1208
|
}
|
|
1235
1209
|
else {
|
|
1236
1210
|
tx.moveCall({
|
|
1237
|
-
target:
|
|
1211
|
+
target: arbitrationFn(`um_none`),
|
|
1238
1212
|
arguments: [
|
|
1239
|
-
|
|
1240
|
-
|
|
1213
|
+
toTxObject(tx, arbitration),
|
|
1214
|
+
toTxObject(tx, permission),
|
|
1241
1215
|
tx.object.mutRegistrar(),
|
|
1242
1216
|
],
|
|
1243
1217
|
typeArguments: [parameter_type],
|