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
package/dist/repository.js
DELETED
|
@@ -1,783 +0,0 @@
|
|
|
1
|
-
import { Protocol, ValueType, RepositoryValueType, } from './protocol.js';
|
|
2
|
-
import { Permission } from './permission.js';
|
|
3
|
-
import { Bcs, array_unique, IsValidDesription, IsValidAddress, IsValidArray, ValueTypeConvert, IsValidStringLength, uint2address, MAX_U16 } from './utils.js';
|
|
4
|
-
import { ERROR, Errors } from './exception.js';
|
|
5
|
-
import { MAX_U8, MAX_U128, MAX_U256, MAX_U64 } from './utils.js';
|
|
6
|
-
import { IsValidGuardIdentifier } from './guard.js';
|
|
7
|
-
export var Repository_Policy_Mode;
|
|
8
|
-
(function (Repository_Policy_Mode) {
|
|
9
|
-
Repository_Policy_Mode[Repository_Policy_Mode["POLICY_MODE_FREE"] = 0] = "POLICY_MODE_FREE";
|
|
10
|
-
Repository_Policy_Mode[Repository_Policy_Mode["POLICY_MODE_STRICT"] = 1] = "POLICY_MODE_STRICT";
|
|
11
|
-
})(Repository_Policy_Mode || (Repository_Policy_Mode = {}));
|
|
12
|
-
export var Repository_Type;
|
|
13
|
-
(function (Repository_Type) {
|
|
14
|
-
Repository_Type[Repository_Type["NORMAL"] = 0] = "NORMAL";
|
|
15
|
-
Repository_Type[Repository_Type["WOWOK_GRANTEE"] = 1] = "WOWOK_GRANTEE";
|
|
16
|
-
Repository_Type[Repository_Type["WOWOK_ORACLE"] = 2] = "WOWOK_ORACLE";
|
|
17
|
-
})(Repository_Type || (Repository_Type = {}));
|
|
18
|
-
export class Repository {
|
|
19
|
-
get_object() { return this.object; }
|
|
20
|
-
constructor(txb, permission) {
|
|
21
|
-
this.txb = txb;
|
|
22
|
-
this.permission = permission;
|
|
23
|
-
this.object = '';
|
|
24
|
-
}
|
|
25
|
-
static From(txb, permission, object) {
|
|
26
|
-
let r = new Repository(txb, permission);
|
|
27
|
-
r.object = Protocol.TXB_OBJECT(txb, object);
|
|
28
|
-
return r;
|
|
29
|
-
}
|
|
30
|
-
static New(txb, permission, description, policy_mode = Repository_Policy_Mode.POLICY_MODE_FREE, passport) {
|
|
31
|
-
if (!Protocol.IsValidObjects([permission])) {
|
|
32
|
-
ERROR(Errors.IsValidObjects, 'permission');
|
|
33
|
-
}
|
|
34
|
-
if (!IsValidDesription(description)) {
|
|
35
|
-
ERROR(Errors.IsValidDesription);
|
|
36
|
-
}
|
|
37
|
-
let r = new Repository(txb, permission);
|
|
38
|
-
if (passport) {
|
|
39
|
-
r.object = txb.moveCall({
|
|
40
|
-
target: Protocol.Instance().repositoryFn('new_with_passport'),
|
|
41
|
-
arguments: [passport, txb.pure.string(description), txb.pure.u8(policy_mode), Protocol.TXB_OBJECT(txb, permission)],
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
r.object = txb.moveCall({
|
|
46
|
-
target: Protocol.Instance().repositoryFn('new'),
|
|
47
|
-
arguments: [txb.pure.string(description), txb.pure.u8(policy_mode), Protocol.TXB_OBJECT(txb, permission)],
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return r;
|
|
51
|
-
}
|
|
52
|
-
launch() {
|
|
53
|
-
return this.txb.moveCall({
|
|
54
|
-
target: Protocol.Instance().repositoryFn('create'),
|
|
55
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object)],
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
static typed_data(bcsData, value_type) {
|
|
59
|
-
if (!Repository.IsValidValue(bcsData)) {
|
|
60
|
-
ERROR(Errors.IsValidValue, `repository.typed_data.bcsData ${bcsData}`);
|
|
61
|
-
}
|
|
62
|
-
if (value_type != null) {
|
|
63
|
-
if (!Repository.IsValidValueType(value_type)) {
|
|
64
|
-
ERROR(Errors.IsValidValueType, `repository.typed_data.value_type ${value_type}`);
|
|
65
|
-
}
|
|
66
|
-
let tempArray = new Uint8Array(bcsData.length + 1);
|
|
67
|
-
tempArray[0] = value_type;
|
|
68
|
-
tempArray.set(bcsData, 1);
|
|
69
|
-
return tempArray;
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
if (!Repository.IsValidValueType(bcsData[0])) {
|
|
73
|
-
ERROR(Errors.IsValidValueType, `repository.typed_data.bcsData ${bcsData}`);
|
|
74
|
-
}
|
|
75
|
-
return bcsData;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
add_data(data, passport) {
|
|
79
|
-
if (!Repository.IsValidName(data.key)) {
|
|
80
|
-
ERROR(Errors.IsValidName, `repository.add_data ${data.key}`);
|
|
81
|
-
}
|
|
82
|
-
let repRecord;
|
|
83
|
-
let repWitness;
|
|
84
|
-
data.data.forEach((value) => {
|
|
85
|
-
if (typeof value.address_or_witness == 'string') {
|
|
86
|
-
if (!IsValidAddress(value.address_or_witness))
|
|
87
|
-
ERROR(Errors.IsValidAddress, `add_data.data.data.address ${value}`);
|
|
88
|
-
const d = Repository.typed_data(value.bcsBytes, data.value_type);
|
|
89
|
-
if (!repRecord) {
|
|
90
|
-
repRecord = this.txb.moveCall({
|
|
91
|
-
target: Protocol.Instance().baseRepositoryFn('RepRecord_new'),
|
|
92
|
-
arguments: [this.txb.pure.string(data.key),
|
|
93
|
-
this.txb.pure.address(value.address_or_witness),
|
|
94
|
-
this.txb.pure.vector('u8', [...d]),
|
|
95
|
-
],
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
this.txb.moveCall({
|
|
100
|
-
target: Protocol.Instance().baseRepositoryFn('RepRecord_add'),
|
|
101
|
-
arguments: [repRecord,
|
|
102
|
-
this.txb.pure.address(value.address_or_witness),
|
|
103
|
-
this.txb.pure.vector('u8', [...d]),
|
|
104
|
-
],
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
else if (typeof value.address_or_witness === 'number') {
|
|
109
|
-
if (!IsValidGuardIdentifier(value.address_or_witness))
|
|
110
|
-
ERROR(Errors.IsValidIndentifier, `add_data.data.data.address ${value}`);
|
|
111
|
-
const d = Repository.typed_data(value.bcsBytes, data.value_type);
|
|
112
|
-
if (!repWitness) {
|
|
113
|
-
repWitness = this.txb.moveCall({
|
|
114
|
-
target: Protocol.Instance().baseRepositoryFn('RepWitness_new'),
|
|
115
|
-
arguments: [this.txb.pure.string(data.key),
|
|
116
|
-
this.txb.pure.u8(value.address_or_witness),
|
|
117
|
-
this.txb.pure.vector('u8', [...d]),
|
|
118
|
-
],
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
this.txb.moveCall({
|
|
123
|
-
target: Protocol.Instance().baseRepositoryFn('RepWitness_add'),
|
|
124
|
-
arguments: [repWitness,
|
|
125
|
-
this.txb.pure.u8(value.address_or_witness),
|
|
126
|
-
this.txb.pure.vector('u8', [...d]),
|
|
127
|
-
],
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
ERROR(Errors.InvalidParam, `add_data.data.data.address ${value}`);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
if (!repRecord && !repWitness)
|
|
136
|
-
return;
|
|
137
|
-
if (passport) {
|
|
138
|
-
if (repRecord) {
|
|
139
|
-
this.txb.moveCall({
|
|
140
|
-
target: Protocol.Instance().repositoryFn('add_with_passport'),
|
|
141
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
142
|
-
repRecord, Protocol.TXB_OBJECT(this.txb, this.permission),
|
|
143
|
-
],
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
if (repWitness) {
|
|
147
|
-
this.txb.moveCall({
|
|
148
|
-
target: Protocol.Instance().repositoryFn('addWitness_with_passport'),
|
|
149
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
150
|
-
repWitness, Protocol.TXB_OBJECT(this.txb, this.permission),
|
|
151
|
-
],
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
// no Passport, repWitness ignored
|
|
157
|
-
if (repRecord) {
|
|
158
|
-
this.txb.moveCall({
|
|
159
|
-
target: Protocol.Instance().repositoryFn('add'),
|
|
160
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
|
|
161
|
-
repRecord, Protocol.TXB_OBJECT(this.txb, this.permission),
|
|
162
|
-
],
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
add_data2(data, passport) {
|
|
168
|
-
const mapRecord = new Map();
|
|
169
|
-
const mapWitness = new Map();
|
|
170
|
-
if (typeof data.address_or_witness === 'string') {
|
|
171
|
-
if (!IsValidAddress(data.address_or_witness)) {
|
|
172
|
-
ERROR(Errors.IsValidAddress, `add_data2.data.address ${data.address_or_witness}`);
|
|
173
|
-
}
|
|
174
|
-
data.data.forEach((value) => {
|
|
175
|
-
if (!Repository.IsValidName(value.key))
|
|
176
|
-
ERROR(Errors.IsValidName, `add_data2.data.data.key ${value.key}`);
|
|
177
|
-
const d = Repository.typed_data(value.bcsBytes, data.value_type);
|
|
178
|
-
if (mapRecord.has(value.key)) {
|
|
179
|
-
const obj = mapRecord.get(value.key);
|
|
180
|
-
this.txb.moveCall({
|
|
181
|
-
target: Protocol.Instance().baseRepositoryFn('RepRecord_add'),
|
|
182
|
-
arguments: [obj,
|
|
183
|
-
this.txb.pure.address(data.address_or_witness),
|
|
184
|
-
this.txb.pure.vector('u8', [...d]),],
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
mapRecord.set(value.key, this.txb.moveCall({
|
|
189
|
-
target: Protocol.Instance().baseRepositoryFn('RepRecord_new'),
|
|
190
|
-
arguments: [this.txb.pure.string(value.key),
|
|
191
|
-
this.txb.pure.address(data.address_or_witness),
|
|
192
|
-
this.txb.pure.vector('u8', [...d]),],
|
|
193
|
-
}));
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
else if (typeof data.address_or_witness === 'number') {
|
|
198
|
-
if (!IsValidGuardIdentifier(data.address_or_witness)) {
|
|
199
|
-
ERROR(Errors.IsValidIndentifier, `add_data2.data.address ${data.address_or_witness}`);
|
|
200
|
-
}
|
|
201
|
-
data.data.forEach((value) => {
|
|
202
|
-
if (!Repository.IsValidName(value.key))
|
|
203
|
-
ERROR(Errors.IsValidName, `add_data2.data.data.key ${value.key}`);
|
|
204
|
-
const d = Repository.typed_data(value.bcsBytes, data.value_type);
|
|
205
|
-
if (mapWitness.has(value.key)) {
|
|
206
|
-
const obj = mapWitness.get(value.key);
|
|
207
|
-
this.txb.moveCall({
|
|
208
|
-
target: Protocol.Instance().baseRepositoryFn('RepWitness_add'),
|
|
209
|
-
arguments: [obj,
|
|
210
|
-
this.txb.pure.u8(data.address_or_witness),
|
|
211
|
-
this.txb.pure.vector('u8', [...d]),],
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
mapWitness.set(value.key, this.txb.moveCall({
|
|
216
|
-
target: Protocol.Instance().baseRepositoryFn('RepWitness_new'),
|
|
217
|
-
arguments: [this.txb.pure.string(value.key),
|
|
218
|
-
this.txb.pure.u8(data.address_or_witness),
|
|
219
|
-
this.txb.pure.vector('u8', [...d]),],
|
|
220
|
-
}));
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
ERROR(Errors.InvalidParam, `add_data2.data.address ${data.address_or_witness}`);
|
|
226
|
-
}
|
|
227
|
-
if (passport) {
|
|
228
|
-
mapRecord.forEach((v) => {
|
|
229
|
-
this.txb.moveCall({
|
|
230
|
-
target: Protocol.Instance().repositoryFn('add_with_passport'),
|
|
231
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
232
|
-
v, Protocol.TXB_OBJECT(this.txb, this.permission),
|
|
233
|
-
],
|
|
234
|
-
});
|
|
235
|
-
});
|
|
236
|
-
mapWitness.forEach((v) => {
|
|
237
|
-
this.txb.moveCall({
|
|
238
|
-
target: Protocol.Instance().repositoryFn('addWitness_with_passport'),
|
|
239
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
240
|
-
v, Protocol.TXB_OBJECT(this.txb, this.permission),
|
|
241
|
-
],
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
// witness will be ignored.
|
|
247
|
-
mapRecord.forEach((v) => {
|
|
248
|
-
this.txb.moveCall({
|
|
249
|
-
target: Protocol.Instance().repositoryFn('add'),
|
|
250
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
|
|
251
|
-
v, Protocol.TXB_OBJECT(this.txb, this.permission),
|
|
252
|
-
],
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
remove(addresses, key, passport) {
|
|
258
|
-
if (addresses.length === 0)
|
|
259
|
-
return;
|
|
260
|
-
if (!Repository.IsValidName(key)) {
|
|
261
|
-
ERROR(Errors.IsValidName, `repository.remove.key ${key}`);
|
|
262
|
-
}
|
|
263
|
-
addresses.forEach(v => {
|
|
264
|
-
if (!IsValidAddress(v)) {
|
|
265
|
-
ERROR(Errors.IsValidAddress, `repository.remove.address ${v}`);
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
const ids = array_unique(addresses).map(v => this.txb.pure.address(v));
|
|
269
|
-
if (passport) {
|
|
270
|
-
this.txb.moveCall({
|
|
271
|
-
target: Protocol.Instance().repositoryFn('remove_with_passport'),
|
|
272
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
273
|
-
this.txb.makeMoveVec({ elements: ids, type: 'address' }),
|
|
274
|
-
this.txb.pure.string(key),
|
|
275
|
-
Protocol.TXB_OBJECT(this.txb, this.permission),
|
|
276
|
-
],
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
this.txb.moveCall({
|
|
281
|
-
target: Protocol.Instance().repositoryFn('remove'),
|
|
282
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
|
|
283
|
-
this.txb.makeMoveVec({ elements: ids, type: 'address' }),
|
|
284
|
-
this.txb.pure.string(key),
|
|
285
|
-
Protocol.TXB_OBJECT(this.txb, this.permission),
|
|
286
|
-
],
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
add_reference(references, passport) {
|
|
291
|
-
if (references.length === 0)
|
|
292
|
-
return;
|
|
293
|
-
if (!IsValidArray(references, IsValidAddress)) {
|
|
294
|
-
ERROR(Errors.IsValidArray, 'add_reference');
|
|
295
|
-
}
|
|
296
|
-
if (passport) {
|
|
297
|
-
this.txb.moveCall({
|
|
298
|
-
target: Protocol.Instance().repositoryFn('reference_add_with_passport'),
|
|
299
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
300
|
-
this.txb.pure.vector('address', array_unique(references)),
|
|
301
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
this.txb.moveCall({
|
|
306
|
-
target: Protocol.Instance().repositoryFn('reference_add'),
|
|
307
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
|
|
308
|
-
this.txb.pure.vector('address', array_unique(references)),
|
|
309
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
remove_reference(references, removeall, passport) {
|
|
314
|
-
if (references.length === 0 && !removeall)
|
|
315
|
-
return;
|
|
316
|
-
if (!IsValidArray(references, IsValidAddress)) {
|
|
317
|
-
ERROR(Errors.IsValidArray, 'remove_reference');
|
|
318
|
-
}
|
|
319
|
-
if (removeall) {
|
|
320
|
-
if (passport) {
|
|
321
|
-
this.txb.moveCall({
|
|
322
|
-
target: Protocol.Instance().repositoryFn('reference_removeall_with_passport'),
|
|
323
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
324
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
this.txb.moveCall({
|
|
329
|
-
target: Protocol.Instance().repositoryFn('reference_removeall'),
|
|
330
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
|
|
331
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
else {
|
|
336
|
-
if (passport) {
|
|
337
|
-
this.txb.moveCall({
|
|
338
|
-
target: Protocol.Instance().repositoryFn('reference_remove_with_passport'),
|
|
339
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
340
|
-
this.txb.pure.vector('address', array_unique(references)),
|
|
341
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
|
-
this.txb.moveCall({
|
|
346
|
-
target: Protocol.Instance().repositoryFn('reference_remove'),
|
|
347
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
|
|
348
|
-
this.txb.pure.vector('address', array_unique(references)),
|
|
349
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
// add or modify the old
|
|
355
|
-
add_policies(policies, passport) {
|
|
356
|
-
if (policies.length === 0)
|
|
357
|
-
return;
|
|
358
|
-
policies.forEach((p) => {
|
|
359
|
-
if (!Repository.IsValidPolicyDescription(p.description))
|
|
360
|
-
ERROR(Errors.IsValidDesription, `add_policies.policies.description ${p.description}`);
|
|
361
|
-
if (!Repository.IsValidName(p.key))
|
|
362
|
-
ERROR(Errors.IsValidName, `add_policies.policies.key ${p.key}`);
|
|
363
|
-
});
|
|
364
|
-
policies.forEach((policy) => {
|
|
365
|
-
/* if (policy.permissionIndex == null && policy.guard == null) {
|
|
366
|
-
ERROR(Errors.InvalidParam, `add_policies:At least one of 'permissionIndex' and 'guard' must be specified. ${policy}`)
|
|
367
|
-
} */ // optional all.
|
|
368
|
-
if (policy?.guard) {
|
|
369
|
-
if (policy?.guard?.guard && !IsValidAddress(policy.guard.guard)) {
|
|
370
|
-
ERROR(Errors.IsValidAddress, `add_policies.policies.guard.guard ${policy.guard.guard}`);
|
|
371
|
-
}
|
|
372
|
-
if (!IsValidArray(policy.guard.witness_ids, IsValidGuardIdentifier)) {
|
|
373
|
-
ERROR(Errors.IsValidArray, `add_policies.policies.guard.witness_ids must be 1-255: ${policy.guard.witness_ids}`);
|
|
374
|
-
}
|
|
375
|
-
if (policy.guard.witness_ids.length > Repository.MAX_POLICY_GUARD_WITNESS_COUNT) {
|
|
376
|
-
ERROR(Errors.InvalidParam, `add_policies.policies.guard.witness_ids ${policy.guard.witness_ids}`);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
const permission_index = this.txb.pure.option('u16', policy?.permissionIndex ? policy?.permissionIndex : undefined);
|
|
380
|
-
if (passport) {
|
|
381
|
-
if (policy?.guard?.guard) {
|
|
382
|
-
this.txb.moveCall({
|
|
383
|
-
target: Protocol.Instance().repositoryFn('policy_add2_with_passport'),
|
|
384
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
385
|
-
this.txb.pure.string(policy.key),
|
|
386
|
-
this.txb.pure.string(policy.description),
|
|
387
|
-
permission_index, Protocol.TXB_OBJECT(this.txb, policy.guard.guard),
|
|
388
|
-
this.txb.pure.vector('u8', policy.guard.witness_ids),
|
|
389
|
-
this.txb.pure.u8(policy.dataType),
|
|
390
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
else {
|
|
394
|
-
this.txb.moveCall({
|
|
395
|
-
target: Protocol.Instance().repositoryFn('policy_add_with_passport'),
|
|
396
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
397
|
-
this.txb.pure.string(policy.key),
|
|
398
|
-
this.txb.pure.string(policy.description),
|
|
399
|
-
permission_index, this.txb.pure.u8(policy.dataType),
|
|
400
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
else {
|
|
405
|
-
if (policy?.guard?.guard) {
|
|
406
|
-
this.txb.moveCall({
|
|
407
|
-
target: Protocol.Instance().repositoryFn('policy_add2'),
|
|
408
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
|
|
409
|
-
this.txb.pure.string(policy.key),
|
|
410
|
-
this.txb.pure.string(policy.description),
|
|
411
|
-
permission_index, Protocol.TXB_OBJECT(this.txb, policy.guard.guard),
|
|
412
|
-
this.txb.pure.vector('u8', policy.guard.witness_ids),
|
|
413
|
-
this.txb.pure.u8(policy.dataType),
|
|
414
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
else {
|
|
418
|
-
this.txb.moveCall({
|
|
419
|
-
target: Protocol.Instance().repositoryFn('policy_add'),
|
|
420
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
|
|
421
|
-
this.txb.pure.string(policy.key),
|
|
422
|
-
this.txb.pure.string(policy.description),
|
|
423
|
-
permission_index, this.txb.pure.u8(policy.dataType),
|
|
424
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
remove_policies(policy_keys, removeall, passport) {
|
|
431
|
-
if (policy_keys.length === 0)
|
|
432
|
-
return;
|
|
433
|
-
if (!IsValidArray(policy_keys, Repository.IsValidName)) {
|
|
434
|
-
ERROR(Errors.InvalidParam, 'policy_keys');
|
|
435
|
-
}
|
|
436
|
-
if (passport) {
|
|
437
|
-
if (removeall) {
|
|
438
|
-
this.txb.moveCall({
|
|
439
|
-
target: Protocol.Instance().repositoryFn('policy_removeall_with_passport'),
|
|
440
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
441
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
else {
|
|
445
|
-
this.txb.moveCall({
|
|
446
|
-
target: Protocol.Instance().repositoryFn('policy_remove_with_passport'),
|
|
447
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
448
|
-
this.txb.pure.vector('string', array_unique(policy_keys)),
|
|
449
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
else {
|
|
454
|
-
if (removeall) {
|
|
455
|
-
this.txb.moveCall({
|
|
456
|
-
target: Protocol.Instance().repositoryFn('policy_removeall'),
|
|
457
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
|
|
458
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
else {
|
|
462
|
-
this.txb.moveCall({
|
|
463
|
-
target: Protocol.Instance().repositoryFn('policy_remove'),
|
|
464
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
|
|
465
|
-
this.txb.pure.vector('string', array_unique(policy_keys)),
|
|
466
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
rename_policy(policy_key, new_policy_key, passport) {
|
|
472
|
-
if (!Repository.IsValidName(policy_key)) {
|
|
473
|
-
ERROR(Errors.IsValidName, `rename_policy.policy_key ${policy_key}`);
|
|
474
|
-
}
|
|
475
|
-
if (!Repository.IsValidName(new_policy_key)) {
|
|
476
|
-
ERROR(Errors.IsValidName, `rename_policy.new_policy_key ${new_policy_key}`);
|
|
477
|
-
}
|
|
478
|
-
if (passport) {
|
|
479
|
-
this.txb.moveCall({
|
|
480
|
-
target: Protocol.Instance().repositoryFn('policy_rename_with_passport'),
|
|
481
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
|
|
482
|
-
this.txb.pure.string(policy_key), this.txb.pure.string(new_policy_key),
|
|
483
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
484
|
-
});
|
|
485
|
-
}
|
|
486
|
-
else {
|
|
487
|
-
this.txb.moveCall({
|
|
488
|
-
target: Protocol.Instance().repositoryFn('policy_rename'),
|
|
489
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
|
|
490
|
-
this.txb.pure.string(policy_key), this.txb.pure.string(new_policy_key),
|
|
491
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
// PermissionIndex.description_set
|
|
496
|
-
set_description(description, passport) {
|
|
497
|
-
if (!IsValidDesription(description)) {
|
|
498
|
-
ERROR(Errors.IsValidDesription);
|
|
499
|
-
}
|
|
500
|
-
if (passport) {
|
|
501
|
-
this.txb.moveCall({
|
|
502
|
-
target: Protocol.Instance().repositoryFn('description_set_with_passport'),
|
|
503
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.string(description), Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
else {
|
|
507
|
-
this.txb.moveCall({
|
|
508
|
-
target: Protocol.Instance().repositoryFn('description_set'),
|
|
509
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.string(description), Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
510
|
-
});
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
set_policy_mode(policy_mode, passport) {
|
|
514
|
-
if (passport) {
|
|
515
|
-
this.txb.moveCall({
|
|
516
|
-
target: Protocol.Instance().repositoryFn('mode_set_with_passport'),
|
|
517
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.u8(policy_mode), Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
else {
|
|
521
|
-
this.txb.moveCall({
|
|
522
|
-
target: Protocol.Instance().repositoryFn('mode_set'),
|
|
523
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.u8(policy_mode), Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
524
|
-
});
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
set_guard(guard, passport) {
|
|
528
|
-
if (guard && !Protocol.IsValidObjects([guard])) {
|
|
529
|
-
ERROR(Errors.IsValidObjects, `set_guard.guard ${guard}`);
|
|
530
|
-
}
|
|
531
|
-
if (passport) {
|
|
532
|
-
if (guard) {
|
|
533
|
-
this.txb.moveCall({
|
|
534
|
-
target: Protocol.Instance().repositoryFn('guard_set_with_passport'),
|
|
535
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, guard), Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
|
-
else {
|
|
539
|
-
this.txb.moveCall({
|
|
540
|
-
target: Protocol.Instance().repositoryFn('guard_none_with_passport'),
|
|
541
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
else {
|
|
546
|
-
if (guard) {
|
|
547
|
-
this.txb.moveCall({
|
|
548
|
-
target: Protocol.Instance().repositoryFn('guard_set'),
|
|
549
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, guard), Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
else {
|
|
553
|
-
this.txb.moveCall({
|
|
554
|
-
target: Protocol.Instance().repositoryFn('guard_none'),
|
|
555
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
set_policy_description(policy, description, passport) {
|
|
561
|
-
if (!Repository.IsValidName(policy)) {
|
|
562
|
-
ERROR(Errors.IsValidName, `set_policy_description.policy ${policy}`);
|
|
563
|
-
}
|
|
564
|
-
if (!Repository.IsValidPolicyDescription(description)) {
|
|
565
|
-
ERROR(Errors.IsValidDesription, `set_policy_description.policy_description ${description}`);
|
|
566
|
-
}
|
|
567
|
-
if (passport) {
|
|
568
|
-
this.txb.moveCall({
|
|
569
|
-
target: Protocol.Instance().repositoryFn('policy_description_set_with_passport'),
|
|
570
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.string(policy), this.txb.pure.string(description),
|
|
571
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
else {
|
|
575
|
-
this.txb.moveCall({
|
|
576
|
-
target: Protocol.Instance().repositoryFn('policy_description_set'),
|
|
577
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.string(policy), this.txb.pure.string(description),
|
|
578
|
-
Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
set_policy_permission(policy, permission_index, passport) {
|
|
583
|
-
if (!Repository.IsValidName(policy)) {
|
|
584
|
-
ERROR(Errors.IsValidName, 'policy');
|
|
585
|
-
}
|
|
586
|
-
let index = this.txb.pure.option('u16', undefined);
|
|
587
|
-
if (permission_index !== undefined) {
|
|
588
|
-
if (!Permission.IsValidPermissionIndex(permission_index)) {
|
|
589
|
-
ERROR(Errors.IsValidPermissionIndex);
|
|
590
|
-
}
|
|
591
|
-
index = this.txb.pure.option('u16', permission_index);
|
|
592
|
-
}
|
|
593
|
-
if (passport) {
|
|
594
|
-
this.txb.moveCall({
|
|
595
|
-
target: Protocol.Instance().repositoryFn('policy_permission_set_with_passport'),
|
|
596
|
-
arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), index, Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
else {
|
|
600
|
-
this.txb.moveCall({
|
|
601
|
-
target: Protocol.Instance().repositoryFn('policy_permission_set'),
|
|
602
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object), index, Protocol.TXB_OBJECT(this.txb, this.permission)]
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
change_permission(new_permission) {
|
|
607
|
-
if (!Protocol.IsValidObjects([new_permission])) {
|
|
608
|
-
ERROR(Errors.IsValidObjects);
|
|
609
|
-
}
|
|
610
|
-
this.txb.moveCall({
|
|
611
|
-
target: Protocol.Instance().repositoryFn('permission_set'),
|
|
612
|
-
arguments: [Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, this.permission), Protocol.TXB_OBJECT(this.txb, new_permission)],
|
|
613
|
-
typeArguments: []
|
|
614
|
-
});
|
|
615
|
-
this.permission = new_permission;
|
|
616
|
-
}
|
|
617
|
-
static IsValidPolicyDescription(description) {
|
|
618
|
-
return IsValidStringLength(description, Repository.MAX_POLICY_DESRIPTION_LENGTH);
|
|
619
|
-
}
|
|
620
|
-
static rpc_de_data(fields) {
|
|
621
|
-
const rep = fields?.map((v) => {
|
|
622
|
-
const value = new Uint8Array(v?.data?.content?.fields?.value);
|
|
623
|
-
const type = value?.length > 0 ? value[0] : null;
|
|
624
|
-
var d = value.length > 0 ? value.slice(1) : Uint8Array.from([]);
|
|
625
|
-
if (type === ValueType.TYPE_STRING) {
|
|
626
|
-
d = Bcs.getInstance().de(ValueType.TYPE_VEC_U8, d);
|
|
627
|
-
d = new TextDecoder().decode(Uint8Array.from(d));
|
|
628
|
-
}
|
|
629
|
-
else if (type === ValueType.TYPE_VEC_STRING) {
|
|
630
|
-
d = Bcs.getInstance().de(ValueType.TYPE_VEC_VEC_U8, d);
|
|
631
|
-
d = d.map((i) => {
|
|
632
|
-
return new TextDecoder().decode(Uint8Array.from(i));
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
else {
|
|
636
|
-
d = Bcs.getInstance().de(value[0], d);
|
|
637
|
-
if (type === ValueType.TYPE_ADDRESS) {
|
|
638
|
-
//d = '0x' + d;
|
|
639
|
-
}
|
|
640
|
-
else if (type === ValueType.TYPE_VEC_ADDRESS) {
|
|
641
|
-
//d = d.map((v:string) => { return ('0x' + v) } );
|
|
642
|
-
}
|
|
643
|
-
else if (type === ValueType.TYPE_BOOL) {
|
|
644
|
-
d = d ? 'True' : 'False';
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
;
|
|
648
|
-
return { object: v?.data?.content?.fields?.id?.id, id: v?.data?.content?.fields?.name?.fields?.id,
|
|
649
|
-
name: v?.data?.content?.fields?.name?.fields?.key,
|
|
650
|
-
data: d, dataType: ValueTypeConvert(type) };
|
|
651
|
-
});
|
|
652
|
-
return rep;
|
|
653
|
-
}
|
|
654
|
-
static DataType2ValueType(data) {
|
|
655
|
-
try {
|
|
656
|
-
const value = BigInt(data);
|
|
657
|
-
if (value < 0n)
|
|
658
|
-
return;
|
|
659
|
-
if (value <= MAX_U8) {
|
|
660
|
-
return ValueType.TYPE_U8;
|
|
661
|
-
}
|
|
662
|
-
else if (value <= MAX_U16) {
|
|
663
|
-
return ValueType.TYPE_U16;
|
|
664
|
-
}
|
|
665
|
-
else if (value <= MAX_U64) {
|
|
666
|
-
return ValueType.TYPE_U64;
|
|
667
|
-
}
|
|
668
|
-
else if (value <= MAX_U128) {
|
|
669
|
-
return ValueType.TYPE_U128;
|
|
670
|
-
}
|
|
671
|
-
else if (value <= MAX_U256) {
|
|
672
|
-
return ValueType.TYPE_U256;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
catch (e) {
|
|
676
|
-
//console.log(e)
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
Repository.MAX_POLICY_COUNT = 120;
|
|
681
|
-
Repository.MAX_KEY_LENGTH = 128;
|
|
682
|
-
Repository.MAX_VALUE_LENGTH = 204800;
|
|
683
|
-
Repository.MAX_REFERENCE_COUNT = 100;
|
|
684
|
-
Repository.MAX_POLICY_DESRIPTION_LENGTH = 256;
|
|
685
|
-
Repository.MAX_POLICY_GUARD_WITNESS_COUNT = 100;
|
|
686
|
-
Repository.MAX_ADD_DATA_COUNT_ONCE = 100;
|
|
687
|
-
Repository.IsValidName = (key) => {
|
|
688
|
-
return IsValidStringLength(key, Repository.MAX_KEY_LENGTH) && key.length != 0;
|
|
689
|
-
};
|
|
690
|
-
Repository.IsValidValue = (value) => {
|
|
691
|
-
return value.length < Repository.MAX_VALUE_LENGTH;
|
|
692
|
-
};
|
|
693
|
-
Repository.IsValidValueType = (value_type) => {
|
|
694
|
-
return (value_type === ValueType.TYPE_U8 || value_type === ValueType.TYPE_U16 || value_type === ValueType.TYPE_U64 ||
|
|
695
|
-
value_type === ValueType.TYPE_U128 || value_type === ValueType.TYPE_U256 || value_type === ValueType.TYPE_BOOL ||
|
|
696
|
-
value_type === ValueType.TYPE_ADDRESS || value_type === ValueType.TYPE_STRING || value_type === ValueType.TYPE_VEC_U8 ||
|
|
697
|
-
value_type === ValueType.TYPE_VEC_U16 || value_type === ValueType.TYPE_VEC_U64 || value_type === ValueType.TYPE_VEC_U128 ||
|
|
698
|
-
value_type === ValueType.TYPE_VEC_U256 || value_type === ValueType.TYPE_VEC_ADDRESS || value_type === ValueType.TYPE_VEC_STRING);
|
|
699
|
-
};
|
|
700
|
-
Repository.ResolveRepositoryData = (dataType, data) => {
|
|
701
|
-
if (dataType === RepositoryValueType.String) {
|
|
702
|
-
if (data instanceof Array) {
|
|
703
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType.String but array ${data}`);
|
|
704
|
-
}
|
|
705
|
-
return { type: ValueType.TYPE_STRING, data: Bcs.getInstance().ser(ValueType.TYPE_STRING, data.toString()) };
|
|
706
|
-
}
|
|
707
|
-
else if (dataType === RepositoryValueType.PositiveNumber) {
|
|
708
|
-
if (data instanceof Array) {
|
|
709
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType.PositiveNumber but array ${data}`);
|
|
710
|
-
}
|
|
711
|
-
const t = Repository.DataType2ValueType(data);
|
|
712
|
-
if (!t)
|
|
713
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType.PositiveNumber ${data}`);
|
|
714
|
-
return { type: t, data: Bcs.getInstance().ser(t, data) };
|
|
715
|
-
}
|
|
716
|
-
else if (dataType === RepositoryValueType.Address) {
|
|
717
|
-
if (typeof (data) === 'boolean') {
|
|
718
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType.Address but boolean ${data}`);
|
|
719
|
-
}
|
|
720
|
-
if (data instanceof Array) {
|
|
721
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType.Address but array ${data}`);
|
|
722
|
-
}
|
|
723
|
-
let addr;
|
|
724
|
-
if (typeof data === 'string') {
|
|
725
|
-
addr = data;
|
|
726
|
-
}
|
|
727
|
-
else {
|
|
728
|
-
addr = uint2address(data);
|
|
729
|
-
}
|
|
730
|
-
if (!IsValidAddress(addr))
|
|
731
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType.Address ${data}`);
|
|
732
|
-
return { type: ValueType.TYPE_ADDRESS, data: Bcs.getInstance().ser(ValueType.TYPE_ADDRESS, addr) };
|
|
733
|
-
}
|
|
734
|
-
else if (dataType === RepositoryValueType.Address_Vec) {
|
|
735
|
-
if (!(data instanceof Array)) {
|
|
736
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType.Address_Vec but not array ${data}`);
|
|
737
|
-
}
|
|
738
|
-
const addrs = [];
|
|
739
|
-
for (let i = 0; i < data.length; ++i) {
|
|
740
|
-
if (!IsValidAddress(data[i]))
|
|
741
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType.Address_Vec ${data}`);
|
|
742
|
-
addrs.push(data[i]);
|
|
743
|
-
}
|
|
744
|
-
return { type: ValueType.TYPE_VEC_ADDRESS, data: Bcs.getInstance().ser(ValueType.TYPE_VEC_ADDRESS, addrs) };
|
|
745
|
-
}
|
|
746
|
-
else if (dataType === RepositoryValueType.PositiveNumber_Vec) {
|
|
747
|
-
if (!(data instanceof Array))
|
|
748
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType.PositiveNumber_Vec but not array ${data}`);
|
|
749
|
-
let type = ValueType.TYPE_U8;
|
|
750
|
-
for (let i = 0; i < data.length; ++i) {
|
|
751
|
-
const t = Repository.DataType2ValueType(data[i]);
|
|
752
|
-
if (!t)
|
|
753
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType.PositiveNumber_Vec ${data}`);
|
|
754
|
-
if (t > type)
|
|
755
|
-
type = t;
|
|
756
|
-
}
|
|
757
|
-
if (type === ValueType.TYPE_U8) {
|
|
758
|
-
type = ValueType.TYPE_VEC_U8;
|
|
759
|
-
}
|
|
760
|
-
else if (type === ValueType.TYPE_U64) {
|
|
761
|
-
type = ValueType.TYPE_VEC_U64;
|
|
762
|
-
}
|
|
763
|
-
else if (type === ValueType.TYPE_U128) {
|
|
764
|
-
type = ValueType.TYPE_VEC_U128;
|
|
765
|
-
}
|
|
766
|
-
else {
|
|
767
|
-
type = ValueType.TYPE_VEC_U256;
|
|
768
|
-
}
|
|
769
|
-
return { type: type, data: Bcs.getInstance().ser(type, data) };
|
|
770
|
-
}
|
|
771
|
-
else if (dataType === RepositoryValueType.String_Vec) {
|
|
772
|
-
if (!(data instanceof Array))
|
|
773
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType.String_Vec but not array ${data}`);
|
|
774
|
-
return { type: ValueType.TYPE_VEC_STRING, data: Bcs.getInstance().ser(ValueType.TYPE_VEC_STRING, data) };
|
|
775
|
-
}
|
|
776
|
-
else if (dataType === RepositoryValueType.Bool) {
|
|
777
|
-
if (typeof (data) !== 'boolean')
|
|
778
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType.Bool ${data}`);
|
|
779
|
-
return { type: ValueType.TYPE_BOOL, data: Bcs.getInstance().ser(ValueType.TYPE_BOOL, data) };
|
|
780
|
-
}
|
|
781
|
-
ERROR(Errors.Fail, `ResolveRepositoryData resolve RepositoryValueType ${dataType}`);
|
|
782
|
-
};
|
|
783
|
-
//# sourceMappingURL=repository.js.map
|