@taquito/wallet-connect 24.3.0-beta.0 → 24.3.0-beta.2
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 -1
- package/dist/lib/taquito/src/batch/constants.js +16 -0
- package/dist/lib/taquito/src/batch/rpc-batch-provider.js +327 -0
- package/dist/lib/taquito/src/constants.js +135 -0
- package/dist/lib/taquito/src/context.js +178 -0
- package/dist/lib/taquito/src/contract/big-map.js +57 -0
- package/dist/lib/taquito/src/contract/compose.js +6 -0
- package/dist/lib/taquito/src/contract/constants.js +4 -0
- package/dist/lib/taquito/src/contract/contract-methods/contract-method-factory.js +18 -0
- package/dist/lib/taquito/src/contract/contract-methods/contract-method-interface.js +2 -0
- package/dist/lib/taquito/src/contract/contract-methods/contract-method-object-param.js +72 -0
- package/dist/lib/taquito/src/contract/contract-methods/contract-on-chain-view.js +111 -0
- package/dist/lib/taquito/src/contract/contract.js +158 -0
- package/dist/lib/taquito/src/contract/errors.js +140 -0
- package/dist/lib/taquito/src/contract/index.js +30 -0
- package/dist/lib/taquito/src/contract/interface.js +2 -0
- package/dist/lib/taquito/src/contract/manager-lambda.js +71 -0
- package/dist/lib/taquito/src/contract/prepare.js +231 -0
- package/dist/lib/taquito/src/contract/rpc-contract-provider.js +675 -0
- package/dist/lib/taquito/src/contract/sapling-state-abstraction.js +24 -0
- package/dist/lib/taquito/src/contract/semantic.js +43 -0
- package/dist/lib/taquito/src/contract/view_lambda.js +27 -0
- package/dist/lib/taquito/src/errors.js +42 -0
- package/dist/lib/taquito/src/estimate/errors.js +16 -0
- package/dist/lib/taquito/src/estimate/estimate-provider-interface.js +2 -0
- package/dist/lib/taquito/src/estimate/estimate.js +176 -0
- package/dist/lib/taquito/src/estimate/index.js +20 -0
- package/dist/lib/taquito/src/estimate/rpc-estimate-provider.js +640 -0
- package/dist/lib/taquito/src/extension/extension.js +2 -0
- package/dist/lib/taquito/src/forger/composite-forger.js +32 -0
- package/dist/lib/taquito/src/forger/errors.js +30 -0
- package/dist/lib/taquito/src/forger/rpc-forger.js +12 -0
- package/dist/lib/taquito/src/forger/taquito-local-forger.js +21 -0
- package/dist/lib/taquito/src/global-constants/default-global-constants-provider.js +35 -0
- package/dist/lib/taquito/src/global-constants/errors.js +30 -0
- package/dist/lib/taquito/src/global-constants/interface-global-constants-provider.js +2 -0
- package/dist/lib/taquito/src/global-constants/noop-global-constants-provider.js +10 -0
- package/dist/lib/taquito/src/import-key.js +40 -0
- package/dist/lib/taquito/src/injector/helper.js +18 -0
- package/dist/lib/taquito/src/injector/interface.js +2 -0
- package/dist/lib/taquito/src/injector/rpc-injector.js +27 -0
- package/dist/lib/taquito/src/operations/ballot-operation.js +32 -0
- package/dist/lib/taquito/src/operations/batch-operation.js +69 -0
- package/dist/lib/taquito/src/operations/delegate-operation.js +54 -0
- package/dist/lib/taquito/src/operations/drain-delegate-operation.js +31 -0
- package/dist/lib/taquito/src/operations/errors.js +133 -0
- package/dist/lib/taquito/src/operations/failing-noop-operation.js +2 -0
- package/dist/lib/taquito/src/operations/increase-paid-storage-operation.js +49 -0
- package/dist/lib/taquito/src/operations/index.js +54 -0
- package/dist/lib/taquito/src/operations/operations.js +193 -0
- package/dist/lib/taquito/src/operations/origination-operation.js +78 -0
- package/dist/lib/taquito/src/operations/proposals-operation.js +29 -0
- package/dist/lib/taquito/src/operations/register-global-constant-operation.js +52 -0
- package/dist/lib/taquito/src/operations/reveal-operation.js +74 -0
- package/dist/lib/taquito/src/operations/smart-rollup-add-messages-operation.js +44 -0
- package/dist/lib/taquito/src/operations/smart-rollup-execute-outbox-message-operation.js +53 -0
- package/dist/lib/taquito/src/operations/smart-rollup-originate-operation.js +50 -0
- package/dist/lib/taquito/src/operations/transaction-operation.js +73 -0
- package/dist/lib/taquito/src/operations/transfer-ticket-operation.js +47 -0
- package/dist/lib/taquito/src/operations/types.js +88 -0
- package/dist/lib/taquito/src/operations/update-companion-key-operation.js +55 -0
- package/dist/lib/taquito/src/operations/update-consensus-key-operation.js +55 -0
- package/dist/lib/taquito/src/packer/interface.js +2 -0
- package/dist/lib/taquito/src/packer/michel-codec-packer.js +11 -0
- package/dist/lib/taquito/src/packer/rpc-packer.js +12 -0
- package/dist/lib/taquito/src/parser/interface.js +2 -0
- package/dist/lib/taquito/src/parser/michel-codec-parser.js +110 -0
- package/dist/lib/taquito/src/parser/noop-parser.js +9 -0
- package/dist/lib/taquito/src/prepare/index.js +18 -0
- package/dist/lib/taquito/src/prepare/interface.js +2 -0
- package/dist/lib/taquito/src/prepare/prepare-provider.js +1049 -0
- package/dist/lib/taquito/src/provider.js +363 -0
- package/dist/lib/taquito/src/read-provider/interface.js +2 -0
- package/dist/lib/taquito/src/read-provider/rpc-read-adapter.js +183 -0
- package/dist/lib/taquito/src/signer/errors.js +17 -0
- package/dist/lib/taquito/src/signer/noop.js +23 -0
- package/dist/lib/taquito/src/subscribe/create-observable-from-subscription.js +20 -0
- package/dist/lib/taquito/src/subscribe/errors.js +30 -0
- package/dist/lib/taquito/src/subscribe/filters.js +96 -0
- package/dist/lib/taquito/src/subscribe/interface.js +2 -0
- package/dist/lib/taquito/src/subscribe/observable-subscription.js +79 -0
- package/dist/lib/taquito/src/subscribe/polling-subcribe-provider.js +118 -0
- package/dist/lib/taquito/src/taquito.js +404 -0
- package/dist/lib/taquito/src/tz/interface.js +2 -0
- package/dist/lib/taquito/src/tz/rpc-tz-provider.js +46 -0
- package/dist/lib/taquito/src/version.js +8 -0
- package/dist/lib/taquito/src/wallet/batch-operation.js +71 -0
- package/dist/lib/taquito/src/wallet/delegation-operation.js +42 -0
- package/dist/lib/taquito/src/wallet/errors.js +40 -0
- package/dist/lib/taquito/src/wallet/increase-paid-storage-operation.js +42 -0
- package/dist/lib/taquito/src/wallet/index.js +25 -0
- package/dist/lib/taquito/src/wallet/interface.js +2 -0
- package/dist/lib/taquito/src/wallet/legacy.js +51 -0
- package/dist/lib/taquito/src/wallet/operation-factory.js +88 -0
- package/dist/lib/taquito/src/wallet/operation.js +221 -0
- package/dist/lib/taquito/src/wallet/origination-operation.js +53 -0
- package/dist/lib/taquito/src/wallet/receipt.js +46 -0
- package/dist/lib/taquito/src/wallet/register-global-constant-operation.js +45 -0
- package/dist/lib/taquito/src/wallet/transaction-operation.js +38 -0
- package/dist/lib/taquito/src/wallet/transfer-ticket-operation.js +38 -0
- package/dist/lib/taquito/src/wallet/wallet.js +445 -0
- package/dist/lib/taquito-core/src/errors.js +351 -0
- package/dist/lib/taquito-core/src/signer-interfaces.js +2 -0
- package/dist/lib/taquito-core/src/taquito-core.js +22 -0
- package/dist/lib/taquito-http-utils/src/errors.js +103 -0
- package/dist/lib/taquito-http-utils/src/status_code.js +322 -0
- package/dist/lib/taquito-http-utils/src/taquito-http-utils.js +308 -0
- package/dist/lib/taquito-http-utils/src/transport-errors.js +141 -0
- package/dist/lib/{version.js → taquito-http-utils/src/version.js} +2 -2
- package/dist/lib/taquito-local-forging/src/codec.js +543 -0
- package/dist/lib/taquito-local-forging/src/constants.js +291 -0
- package/dist/lib/taquito-local-forging/src/decoder.js +64 -0
- package/dist/lib/taquito-local-forging/src/encoder.js +63 -0
- package/dist/lib/taquito-local-forging/src/errors.js +179 -0
- package/dist/lib/taquito-local-forging/src/interface.js +2 -0
- package/dist/lib/taquito-local-forging/src/michelson/codec.js +283 -0
- package/dist/lib/taquito-local-forging/src/protocols.js +60 -0
- package/dist/lib/taquito-local-forging/src/schema/operation.js +259 -0
- package/dist/lib/taquito-local-forging/src/taquito-local-forging.js +117 -0
- package/dist/lib/taquito-local-forging/src/uint8array-consumer.js +35 -0
- package/dist/lib/taquito-local-forging/src/utils.js +18 -0
- package/dist/lib/taquito-local-forging/src/validator.js +57 -0
- package/dist/lib/taquito-local-forging/src/version.js +8 -0
- package/dist/lib/taquito-michel-codec/src/base58.js +255 -0
- package/dist/lib/taquito-michel-codec/src/binary.js +1271 -0
- package/dist/lib/taquito-michel-codec/src/errors.js +90 -0
- package/dist/lib/taquito-michel-codec/src/formatters.js +58 -0
- package/dist/lib/taquito-michel-codec/src/global-constants.js +12 -0
- package/dist/lib/taquito-michel-codec/src/macros.js +551 -0
- package/dist/lib/taquito-michel-codec/src/micheline-emitter.js +128 -0
- package/dist/lib/taquito-michel-codec/src/micheline-parser.js +402 -0
- package/dist/lib/taquito-michel-codec/src/micheline.js +5 -0
- package/dist/lib/taquito-michel-codec/src/michelson-contract.js +93 -0
- package/dist/lib/taquito-michel-codec/src/michelson-typecheck.js +1756 -0
- package/dist/lib/taquito-michel-codec/src/michelson-types.js +83 -0
- package/dist/lib/taquito-michel-codec/src/michelson-validator.js +833 -0
- package/dist/lib/taquito-michel-codec/src/scan.js +128 -0
- package/dist/lib/taquito-michel-codec/src/taquito-michel-codec.js +38 -0
- package/dist/lib/taquito-michel-codec/src/utils.js +323 -0
- package/dist/lib/taquito-michel-codec/src/version.js +8 -0
- package/dist/lib/taquito-michelson-encoder/src/constants.js +11 -0
- package/dist/lib/taquito-michelson-encoder/src/errors.js +38 -0
- package/dist/lib/taquito-michelson-encoder/src/michelson-map.js +201 -0
- package/dist/lib/taquito-michelson-encoder/src/schema/errors.js +127 -0
- package/dist/lib/taquito-michelson-encoder/src/schema/event-schema.js +52 -0
- package/dist/lib/taquito-michelson-encoder/src/schema/parameter.js +113 -0
- package/dist/lib/taquito-michelson-encoder/src/schema/storage.js +260 -0
- package/dist/lib/taquito-michelson-encoder/src/schema/types.js +2 -0
- package/dist/lib/taquito-michelson-encoder/src/schema/view-schema.js +90 -0
- package/dist/lib/taquito-michelson-encoder/src/taquito-michelson-encoder.js +36 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/bigmap.js +130 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/bls12-381-fr.js +86 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/bls12-381-g1.js +76 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/bls12-381-g2.js +76 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/chain-id.js +78 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/chest-key.js +74 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/chest.js +74 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/address.js +116 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/bool.js +59 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/bytes.js +90 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/int.js +90 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/key_hash.js +90 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/mutez.js +90 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/nat.js +93 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/string.js +48 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/timestamp.js +66 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/constant.js +80 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/contract.js +86 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/createToken.js +35 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/key.js +97 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/lambda.js +55 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/list.js +85 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/map.js +112 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/never.js +61 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/operation.js +39 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/option.js +88 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/or.js +282 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/pair.js +233 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/sapling-state.js +84 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/sapling-transaction-deprecated.js +74 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/sapling-transaction.js +74 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/set.js +82 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/signature.js +82 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/ticket-deprecated.js +92 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/ticket.js +92 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/token.js +100 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/tokens.js +75 -0
- package/dist/lib/taquito-michelson-encoder/src/tokens/unit.js +52 -0
- package/dist/lib/taquito-michelson-encoder/src/version.js +8 -0
- package/dist/lib/taquito-rpc/src/opkind.js +49 -0
- package/dist/lib/taquito-rpc/src/rpc-client-interface.js +60 -0
- package/dist/lib/taquito-rpc/src/rpc-client-modules/rpc-cache.js +1118 -0
- package/dist/lib/taquito-rpc/src/taquito-rpc.js +990 -0
- package/dist/lib/taquito-rpc/src/types.js +114 -0
- package/dist/lib/taquito-rpc/src/utils/utils.js +65 -0
- package/dist/lib/taquito-rpc/src/version.js +8 -0
- package/dist/lib/taquito-signer/src/bls-key.js +104 -0
- package/dist/lib/taquito-signer/src/derivation-tools/ecdsa.js +156 -0
- package/dist/lib/taquito-signer/src/derivation-tools/ed25519.js +82 -0
- package/dist/lib/taquito-signer/src/derivation-tools/index.js +79 -0
- package/dist/lib/taquito-signer/src/derivation-tools/types.js +4 -0
- package/dist/lib/taquito-signer/src/derivation-tools/utils.js +16 -0
- package/dist/lib/taquito-signer/src/ec-key.js +196 -0
- package/dist/lib/taquito-signer/src/ed-key.js +130 -0
- package/dist/lib/taquito-signer/src/errors.js +77 -0
- package/dist/lib/taquito-signer/src/helpers.js +44 -0
- package/dist/lib/taquito-signer/src/in-memory-signer.js +240 -0
- package/dist/lib/taquito-signer/src/key-interface.js +6 -0
- package/dist/lib/taquito-signer/src/taquito-signer.js +28 -0
- package/dist/lib/taquito-signer/src/version.js +8 -0
- package/dist/lib/taquito-utils/src/constants.js +203 -0
- package/dist/lib/taquito-utils/src/encoding.js +606 -0
- package/dist/lib/taquito-utils/src/errors.js +45 -0
- package/dist/lib/taquito-utils/src/format.js +29 -0
- package/dist/lib/taquito-utils/src/taquito-utils.js +42 -0
- package/dist/lib/taquito-utils/src/validators.js +236 -0
- package/dist/lib/taquito-utils/src/verify-signature.js +136 -0
- package/dist/lib/taquito-utils/src/version.js +8 -0
- package/dist/lib/{taquito-wallet-connect.js → taquito-wallet-connect/src/taquito-wallet-connect.js} +50 -33
- package/dist/lib/taquito-wallet-connect/src/version.js +8 -0
- package/dist/taquito-wallet-connect.es6.js +46 -32
- package/dist/taquito-wallet-connect.es6.js.map +1 -1
- package/dist/taquito-wallet-connect.umd.js +46 -32
- package/dist/taquito-wallet-connect.umd.js.map +1 -1
- package/dist/types/taquito/src/batch/constants.d.ts +3 -0
- package/dist/types/taquito/src/batch/rpc-batch-provider.d.ts +139 -0
- package/dist/types/taquito/src/constants.d.ts +81 -0
- package/dist/types/taquito/src/context.d.ts +100 -0
- package/dist/types/taquito/src/contract/big-map.d.ts +35 -0
- package/dist/types/taquito/src/contract/compose.d.ts +5 -0
- package/dist/types/taquito/src/contract/constants.d.ts +1 -0
- package/dist/types/taquito/src/contract/contract-methods/contract-method-factory.d.ts +14 -0
- package/dist/types/taquito/src/contract/contract-methods/contract-method-interface.d.ts +28 -0
- package/dist/types/taquito/src/contract/contract-methods/contract-method-object-param.d.ts +39 -0
- package/dist/types/taquito/src/contract/contract-methods/contract-on-chain-view.d.ts +43 -0
- package/dist/types/taquito/src/contract/contract.d.ts +75 -0
- package/dist/types/taquito/src/contract/errors.d.ts +83 -0
- package/dist/types/taquito/src/contract/index.d.ts +11 -0
- package/dist/types/taquito/src/contract/interface.d.ts +254 -0
- package/dist/types/taquito/src/contract/manager-lambda.d.ts +73 -0
- package/dist/types/taquito/src/contract/prepare.d.ts +18 -0
- package/dist/types/taquito/src/contract/rpc-contract-provider.d.ts +270 -0
- package/dist/types/taquito/src/contract/sapling-state-abstraction.d.ts +17 -0
- package/dist/types/taquito/src/contract/semantic.d.ts +7 -0
- package/dist/types/taquito/src/contract/view_lambda.d.ts +34 -0
- package/dist/types/taquito/src/errors.d.ts +26 -0
- package/dist/types/taquito/src/estimate/errors.d.ts +8 -0
- package/dist/types/taquito/src/estimate/estimate-provider-interface.d.ts +153 -0
- package/dist/types/taquito/src/estimate/estimate.d.ts +111 -0
- package/dist/types/taquito/src/estimate/index.d.ts +4 -0
- package/dist/types/taquito/src/estimate/rpc-estimate-provider.d.ts +174 -0
- package/dist/types/taquito/src/extension/extension.d.ts +4 -0
- package/dist/types/taquito/src/forger/composite-forger.d.ts +6 -0
- package/dist/types/taquito/src/forger/errors.d.ts +16 -0
- package/dist/types/taquito/src/forger/rpc-forger.d.ts +7 -0
- package/dist/types/taquito/src/forger/taquito-local-forger.d.ts +8 -0
- package/dist/types/taquito/src/global-constants/default-global-constants-provider.d.ts +18 -0
- package/dist/types/taquito/src/global-constants/errors.d.ts +16 -0
- package/dist/types/taquito/src/global-constants/interface-global-constants-provider.d.ts +11 -0
- package/dist/types/taquito/src/global-constants/noop-global-constants-provider.d.ts +5 -0
- package/dist/types/taquito/src/import-key.d.ts +13 -0
- package/dist/types/taquito/src/injector/helper.d.ts +2 -0
- package/dist/types/taquito/src/injector/interface.d.ts +5 -0
- package/dist/types/taquito/src/injector/rpc-injector.d.ts +7 -0
- package/dist/types/taquito/src/operations/ballot-operation.d.ts +18 -0
- package/dist/types/taquito/src/operations/batch-operation.d.ts +19 -0
- package/dist/types/taquito/src/operations/delegate-operation.d.ts +24 -0
- package/dist/types/taquito/src/operations/drain-delegate-operation.d.ts +17 -0
- package/dist/types/taquito/src/operations/errors.d.ts +50 -0
- package/dist/types/taquito/src/operations/failing-noop-operation.d.ts +17 -0
- package/dist/types/taquito/src/operations/increase-paid-storage-operation.d.ts +23 -0
- package/dist/types/taquito/src/operations/index.d.ts +18 -0
- package/dist/types/taquito/src/operations/operations.d.ts +35 -0
- package/dist/types/taquito/src/operations/origination-operation.d.ts +35 -0
- package/dist/types/taquito/src/operations/proposals-operation.d.ts +17 -0
- package/dist/types/taquito/src/operations/register-global-constant-operation.d.ts +25 -0
- package/dist/types/taquito/src/operations/reveal-operation.d.ts +25 -0
- package/dist/types/taquito/src/operations/smart-rollup-add-messages-operation.d.ts +20 -0
- package/dist/types/taquito/src/operations/smart-rollup-execute-outbox-message-operation.d.ts +24 -0
- package/dist/types/taquito/src/operations/smart-rollup-originate-operation.d.ts +23 -0
- package/dist/types/taquito/src/operations/transaction-operation.d.ts +28 -0
- package/dist/types/taquito/src/operations/transfer-ticket-operation.d.ts +22 -0
- package/dist/types/taquito/src/operations/types.d.ts +823 -0
- package/dist/types/taquito/src/operations/update-companion-key-operation.d.ts +23 -0
- package/dist/types/taquito/src/operations/update-consensus-key-operation.d.ts +23 -0
- package/dist/types/taquito/src/packer/interface.d.ts +4 -0
- package/dist/types/taquito/src/packer/michel-codec-packer.d.ts +5 -0
- package/dist/types/taquito/src/packer/rpc-packer.d.ts +8 -0
- package/dist/types/taquito/src/parser/interface.d.ts +4 -0
- package/dist/types/taquito/src/parser/michel-codec-parser.d.ts +16 -0
- package/dist/types/taquito/src/parser/noop-parser.d.ts +5 -0
- package/dist/types/taquito/src/prepare/index.d.ts +2 -0
- package/dist/types/taquito/src/prepare/interface.d.ts +152 -0
- package/dist/types/taquito/src/prepare/prepare-provider.d.ts +187 -0
- package/dist/types/taquito/src/provider.d.ts +50 -0
- package/dist/types/taquito/src/read-provider/interface.d.ts +132 -0
- package/dist/types/taquito/src/read-provider/rpc-read-adapter.d.ts +130 -0
- package/dist/types/taquito/src/signer/errors.d.ts +8 -0
- package/dist/types/taquito/src/signer/noop.d.ts +11 -0
- package/dist/types/taquito/src/subscribe/create-observable-from-subscription.d.ts +4 -0
- package/dist/types/taquito/src/subscribe/errors.d.ts +18 -0
- package/dist/types/taquito/src/subscribe/filters.d.ts +6 -0
- package/dist/types/taquito/src/subscribe/interface.d.ts +48 -0
- package/dist/types/taquito/src/subscribe/observable-subscription.d.ts +21 -0
- package/dist/types/taquito/src/subscribe/polling-subcribe-provider.d.ts +23 -0
- package/dist/types/taquito/src/taquito.d.ts +248 -0
- package/dist/types/taquito/src/tz/interface.d.ts +20 -0
- package/dist/types/taquito/src/tz/rpc-tz-provider.d.ts +13 -0
- package/dist/types/taquito/src/version.d.ts +4 -0
- package/dist/types/taquito/src/wallet/batch-operation.d.ts +13 -0
- package/dist/types/taquito/src/wallet/delegation-operation.d.ts +12 -0
- package/dist/types/taquito/src/wallet/errors.d.ts +24 -0
- package/dist/types/taquito/src/wallet/increase-paid-storage-operation.d.ts +12 -0
- package/dist/types/taquito/src/wallet/index.d.ts +9 -0
- package/dist/types/taquito/src/wallet/interface.d.ts +66 -0
- package/dist/types/taquito/src/wallet/legacy.d.ts +21 -0
- package/dist/types/taquito/src/wallet/operation-factory.d.ts +32 -0
- package/dist/types/taquito/src/wallet/operation.d.ts +55 -0
- package/dist/types/taquito/src/wallet/origination-operation.d.ts +14 -0
- package/dist/types/taquito/src/wallet/receipt.d.ts +16 -0
- package/dist/types/taquito/src/wallet/register-global-constant-operation.d.ts +13 -0
- package/dist/types/taquito/src/wallet/transaction-operation.d.ts +12 -0
- package/dist/types/taquito/src/wallet/transfer-ticket-operation.d.ts +12 -0
- package/dist/types/taquito/src/wallet/wallet.d.ts +196 -0
- package/dist/types/taquito-core/src/errors.d.ts +213 -0
- package/dist/types/taquito-core/src/signer-interfaces.d.ts +38 -0
- package/dist/types/taquito-core/src/taquito-core.d.ts +6 -0
- package/dist/types/taquito-http-utils/src/errors.d.ts +63 -0
- package/dist/types/taquito-http-utils/src/status_code.d.ts +318 -0
- package/dist/types/taquito-http-utils/src/taquito-http-utils.d.ts +58 -0
- package/dist/types/taquito-http-utils/src/transport-errors.d.ts +28 -0
- package/dist/types/taquito-local-forging/src/codec.d.ts +79 -0
- package/dist/types/taquito-local-forging/src/constants.d.ts +75 -0
- package/dist/types/taquito-local-forging/src/decoder.d.ts +5 -0
- package/dist/types/taquito-local-forging/src/encoder.d.ts +4 -0
- package/dist/types/taquito-local-forging/src/errors.d.ts +109 -0
- package/dist/types/taquito-local-forging/src/interface.d.ts +9 -0
- package/dist/types/taquito-local-forging/src/michelson/codec.d.ts +49 -0
- package/dist/types/taquito-local-forging/src/protocols.d.ts +27 -0
- package/dist/types/taquito-local-forging/src/schema/operation.d.ts +198 -0
- package/dist/types/taquito-local-forging/src/taquito-local-forging.d.ts +27 -0
- package/dist/types/taquito-local-forging/src/uint8array-consumer.d.ts +10 -0
- package/dist/types/taquito-local-forging/src/utils.d.ts +3 -0
- package/dist/types/taquito-local-forging/src/validator.d.ts +13 -0
- package/dist/types/taquito-local-forging/src/version.d.ts +4 -0
- package/dist/types/taquito-michel-codec/src/base58.d.ts +13 -0
- package/dist/types/taquito-michel-codec/src/binary.d.ts +127 -0
- package/dist/types/taquito-michel-codec/src/errors.d.ts +57 -0
- package/dist/types/taquito-michel-codec/src/formatters.d.ts +6 -0
- package/dist/types/taquito-michel-codec/src/global-constants.d.ts +3 -0
- package/dist/types/taquito-michel-codec/src/macros.d.ts +13 -0
- package/dist/types/taquito-michel-codec/src/micheline-emitter.d.ts +17 -0
- package/dist/types/taquito-michel-codec/src/micheline-parser.d.ts +130 -0
- package/dist/types/taquito-michel-codec/src/micheline.d.ts +44 -0
- package/dist/types/taquito-michel-codec/src/michelson-contract.d.ts +24 -0
- package/dist/types/taquito-michel-codec/src/michelson-typecheck.d.ts +38 -0
- package/dist/types/taquito-michel-codec/src/michelson-types.d.ts +147 -0
- package/dist/types/taquito-michel-codec/src/michelson-validator.d.ts +66 -0
- package/dist/types/taquito-michel-codec/src/scan.d.ts +26 -0
- package/dist/types/taquito-michel-codec/src/taquito-michel-codec.d.ts +16 -0
- package/dist/types/taquito-michel-codec/src/utils.d.ts +76 -0
- package/dist/types/taquito-michel-codec/src/version.d.ts +4 -0
- package/dist/types/taquito-michelson-encoder/src/constants.d.ts +8 -0
- package/dist/types/taquito-michelson-encoder/src/errors.d.ts +17 -0
- package/dist/types/taquito-michelson-encoder/src/michelson-map.d.ts +82 -0
- package/dist/types/taquito-michelson-encoder/src/schema/errors.d.ts +83 -0
- package/dist/types/taquito-michelson-encoder/src/schema/event-schema.d.ts +12 -0
- package/dist/types/taquito-michelson-encoder/src/schema/parameter.d.ts +54 -0
- package/dist/types/taquito-michelson-encoder/src/schema/storage.d.ts +97 -0
- package/dist/types/taquito-michelson-encoder/src/schema/types.d.ts +105 -0
- package/dist/types/taquito-michelson-encoder/src/schema/view-schema.d.ts +53 -0
- package/dist/types/taquito-michelson-encoder/src/taquito-michelson-encoder.d.ts +16 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/bigmap.d.ts +51 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/bls12-381-fr.d.ts +51 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/bls12-381-g1.d.ts +47 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/bls12-381-g2.d.ts +47 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/chain-id.d.ts +51 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/chest-key.d.ts +47 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/chest.d.ts +47 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/address.d.ts +61 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/bool.d.ts +32 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/bytes.d.ts +52 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/int.d.ts +56 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/key_hash.d.ts +55 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/mutez.d.ts +53 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/nat.d.ts +55 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/string.d.ts +31 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/timestamp.d.ts +34 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/constant.d.ts +51 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/contract.d.ts +48 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/createToken.d.ts +18 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/key.d.ts +55 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/lambda.d.ts +24 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/list.d.ts +46 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/map.d.ts +47 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/never.d.ts +41 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/operation.d.ts +24 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/option.d.ts +37 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/or.d.ts +53 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/pair.d.ts +50 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/sapling-state.d.ts +44 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/sapling-transaction-deprecated.d.ts +40 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/sapling-transaction.d.ts +40 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/set.d.ts +43 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/signature.d.ts +53 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/ticket-deprecated.d.ts +38 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/ticket.d.ts +38 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/token.d.ts +68 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/tokens.d.ts +36 -0
- package/dist/types/taquito-michelson-encoder/src/tokens/unit.d.ts +34 -0
- package/dist/types/taquito-michelson-encoder/src/version.d.ts +4 -0
- package/dist/types/taquito-rpc/src/opkind.d.ts +45 -0
- package/dist/types/taquito-rpc/src/rpc-client-interface.d.ts +126 -0
- package/dist/types/taquito-rpc/src/rpc-client-modules/rpc-cache.d.ts +473 -0
- package/dist/types/taquito-rpc/src/taquito-rpc.d.ts +483 -0
- package/dist/types/taquito-rpc/src/types.d.ts +2362 -0
- package/dist/types/taquito-rpc/src/utils/utils.d.ts +14 -0
- package/dist/types/taquito-rpc/src/version.d.ts +4 -0
- package/dist/types/taquito-signer/src/bls-key.d.ts +21 -0
- package/dist/types/taquito-signer/src/derivation-tools/ecdsa.d.ts +49 -0
- package/dist/types/taquito-signer/src/derivation-tools/ed25519.d.ts +33 -0
- package/dist/types/taquito-signer/src/derivation-tools/index.d.ts +12 -0
- package/dist/types/taquito-signer/src/derivation-tools/types.d.ts +10 -0
- package/dist/types/taquito-signer/src/derivation-tools/utils.d.ts +1 -0
- package/dist/types/taquito-signer/src/ec-key.d.ts +42 -0
- package/dist/types/taquito-signer/src/ed-key.d.ts +39 -0
- package/dist/types/taquito-signer/src/errors.d.ts +51 -0
- package/dist/types/taquito-signer/src/helpers.d.ts +10 -0
- package/dist/types/taquito-signer/src/in-memory-signer.d.ts +56 -0
- package/dist/types/taquito-signer/src/key-interface.d.ts +37 -0
- package/dist/types/taquito-signer/src/taquito-signer.d.ts +10 -0
- package/dist/types/taquito-signer/src/version.d.ts +4 -0
- package/dist/types/taquito-utils/src/constants.d.ts +78 -0
- package/dist/types/taquito-utils/src/encoding.d.ts +184 -0
- package/dist/types/taquito-utils/src/errors.d.ts +20 -0
- package/dist/types/taquito-utils/src/format.d.ts +4 -0
- package/dist/types/taquito-utils/src/taquito-utils.d.ts +11 -0
- package/dist/types/taquito-utils/src/validators.d.ts +167 -0
- package/dist/types/taquito-utils/src/verify-signature.d.ts +22 -0
- package/dist/types/taquito-utils/src/version.d.ts +4 -0
- package/dist/types/{taquito-wallet-connect.d.ts → taquito-wallet-connect/src/taquito-wallet-connect.d.ts} +4 -2
- package/dist/types/taquito-wallet-connect/src/version.d.ts +4 -0
- package/package.json +9 -35
- /package/dist/lib/{errors.js → taquito-wallet-connect/src/errors.js} +0 -0
- /package/dist/lib/{types.js → taquito-wallet-connect/src/types.js} +0 -0
- /package/dist/types/{version.d.ts → taquito-http-utils/src/version.d.ts} +0 -0
- /package/dist/types/{errors.d.ts → taquito-wallet-connect/src/errors.d.ts} +0 -0
- /package/dist/types/{types.d.ts → taquito-wallet-connect/src/types.d.ts} +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
* @module @taquito/utils
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.format = exports.POP_DST = exports.BLS12_381_DST = exports.verifySignature = exports.payloadLength = exports.PrefixV2 = exports.VERSION = void 0;
|
|
22
|
+
// Re-export everything from encoding
|
|
23
|
+
__exportStar(require("./encoding"), exports);
|
|
24
|
+
// Re-export everything from validators
|
|
25
|
+
__exportStar(require("./validators"), exports);
|
|
26
|
+
// Re-export version
|
|
27
|
+
var version_1 = require("./version");
|
|
28
|
+
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
|
|
29
|
+
// Re-export constants
|
|
30
|
+
var constants_1 = require("./constants");
|
|
31
|
+
Object.defineProperty(exports, "PrefixV2", { enumerable: true, get: function () { return constants_1.PrefixV2; } });
|
|
32
|
+
Object.defineProperty(exports, "payloadLength", { enumerable: true, get: function () { return constants_1.payloadLength; } });
|
|
33
|
+
// Re-export from verify-signature
|
|
34
|
+
var verify_signature_1 = require("./verify-signature");
|
|
35
|
+
Object.defineProperty(exports, "verifySignature", { enumerable: true, get: function () { return verify_signature_1.verifySignature; } });
|
|
36
|
+
Object.defineProperty(exports, "BLS12_381_DST", { enumerable: true, get: function () { return verify_signature_1.BLS12_381_DST; } });
|
|
37
|
+
Object.defineProperty(exports, "POP_DST", { enumerable: true, get: function () { return verify_signature_1.POP_DST; } });
|
|
38
|
+
// Re-export errors
|
|
39
|
+
__exportStar(require("./errors"), exports);
|
|
40
|
+
// Re-export format
|
|
41
|
+
var format_1 = require("./format");
|
|
42
|
+
Object.defineProperty(exports, "format", { enumerable: true, get: function () { return format_1.format; } });
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidationResult = void 0;
|
|
4
|
+
exports.isValidPrefixedValue = isValidPrefixedValue;
|
|
5
|
+
exports.validateAddress = validateAddress;
|
|
6
|
+
exports.validateChain = validateChain;
|
|
7
|
+
exports.validateContractAddress = validateContractAddress;
|
|
8
|
+
exports.validateKeyHash = validateKeyHash;
|
|
9
|
+
exports.validateSignature = validateSignature;
|
|
10
|
+
exports.validatePublicKey = validatePublicKey;
|
|
11
|
+
exports.validateOperation = validateOperation;
|
|
12
|
+
exports.validateProtocol = validateProtocol;
|
|
13
|
+
exports.validateBlock = validateBlock;
|
|
14
|
+
exports.validateSpendingKey = validateSpendingKey;
|
|
15
|
+
exports.validateSmartRollupAddress = validateSmartRollupAddress;
|
|
16
|
+
const constants_1 = require("./constants");
|
|
17
|
+
const encoding_1 = require("./encoding");
|
|
18
|
+
const core_1 = require("@taquito/core");
|
|
19
|
+
var core_2 = require("@taquito/core");
|
|
20
|
+
Object.defineProperty(exports, "ValidationResult", { enumerable: true, get: function () { return core_2.ValidationResult; } });
|
|
21
|
+
/**
|
|
22
|
+
* Used to check if a value has one of the allowed prefixes.
|
|
23
|
+
* @returns true if the value has one of the allowed prefixes, false otherwise
|
|
24
|
+
* @example
|
|
25
|
+
* ```
|
|
26
|
+
* import { isValidPrefixedValue } from '@taquito/utils';
|
|
27
|
+
* const value = 'tz1L9r8mWmRPndRhuvMCWESLGSVeFzQ9NAWx'
|
|
28
|
+
* const isValid = isValidPrefixedValue(value, [PrefixV2.Ed25519PublicKeyHash])
|
|
29
|
+
* console.log(isValid) // true
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
function isValidPrefixedValue(value, prefixes) {
|
|
33
|
+
return validatePrefixedValue(value, prefixes) === core_1.ValidationResult.VALID;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* This function is called by the validation functions ([[validateAddress]], [[validateChain]], [[validateContractAddress]], [[validateKeyHash]], [[validateSignature]], [[validatePublicKey]]).
|
|
37
|
+
* Verify if the value can be decoded or return `1` (INVALID_CHECKSUM) / `5` (INVALID_ENCODING), then check if the prefix is valid or allowed or return `0` (NO_PREFIX_MATCHED) / `4` (PREFIX_NOT_ALLOWED)
|
|
38
|
+
* If all checks pass, return `3` (VALID).
|
|
39
|
+
* @param value Value to validate
|
|
40
|
+
* @param prefixes prefix the value should have
|
|
41
|
+
* @returns 0 = NO_PREFIX_MATCHED, 1 = INVALID_CHECKSUM, 2 = INVALID_LENGTH, 3 = VALID, 4 = PREFIX_NOT_ALLOWED, 5 = INVALID_ENCODING, 6 = OTHER,
|
|
42
|
+
* @example
|
|
43
|
+
* ```
|
|
44
|
+
* import { validatePrefixedValue } from '@taquito/utils';
|
|
45
|
+
* const value = 'tz1L9r8mWmRPndRhuvMCWESLGSVeFzQ9NAWx'
|
|
46
|
+
* const validation = validatePrefixedValue(value, [PrefixV2.Ed25519PublicKeyHash])
|
|
47
|
+
* console.log(validation) // 3
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
function validatePrefixedValue(value, prefixes) {
|
|
51
|
+
try {
|
|
52
|
+
(0, encoding_1.b58DecodeAndCheckPrefix)(value, prefixes);
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
if (err instanceof core_1.ParameterValidationError && err.result !== undefined) {
|
|
56
|
+
return err.result;
|
|
57
|
+
}
|
|
58
|
+
return core_1.ValidationResult.OTHER;
|
|
59
|
+
}
|
|
60
|
+
return core_1.ValidationResult.VALID;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Used to check if an address or a contract address is valid.
|
|
64
|
+
*
|
|
65
|
+
* @returns
|
|
66
|
+
* 0 = NO_PREFIX_MATCHED, 1 = INVALID_CHECKSUM, 2 = INVALID_LENGTH, 3 = VALID, 4 = PREFIX_NOT_ALLOWED, 5 = INVALID_ENCODING, 6 = OTHER,
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```
|
|
70
|
+
* import { validateAddress } from '@taquito/utils';
|
|
71
|
+
* const pkh = 'tz1L9r8mWmRPndRhuvMCWESLGSVeFzQ9NAWx'
|
|
72
|
+
* const validation = validateAddress(pkh)
|
|
73
|
+
* console.log(validation)
|
|
74
|
+
* // This example return 3 which correspond to VALID
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
function validateAddress(value) {
|
|
78
|
+
const [addr] = (0, encoding_1.splitAddress)(value ?? '');
|
|
79
|
+
return validatePrefixedValue(addr, encoding_1.addressPrefixes);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Used to check if a chain id is valid.
|
|
83
|
+
*
|
|
84
|
+
* @returns
|
|
85
|
+
* 0 = NO_PREFIX_MATCHED, 1 = INVALID_CHECKSUM, 2 = INVALID_LENGTH, 3 = VALID, 4 = PREFIX_NOT_ALLOWED, 5 = INVALID_ENCODING, 6 = OTHER,
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```
|
|
89
|
+
* import { validateChain } from '@taquito/utils';
|
|
90
|
+
* const chainId = 'NetXdQprcVkpaWU'
|
|
91
|
+
* const validation = validateChain(chainId)
|
|
92
|
+
* console.log(validation)
|
|
93
|
+
* // This example return 3 which correspond to VALID
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
function validateChain(value) {
|
|
97
|
+
return validatePrefixedValue(value, [constants_1.PrefixV2.ChainID]);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Used to check if a contract address is valid.
|
|
101
|
+
*
|
|
102
|
+
* @returns
|
|
103
|
+
* 0 = NO_PREFIX_MATCHED, 1 = INVALID_CHECKSUM, 2 = INVALID_LENGTH, 3 = VALID, 4 = PREFIX_NOT_ALLOWED, 5 = INVALID_ENCODING, 6 = OTHER,
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```
|
|
107
|
+
* import { validateContractAddress } from '@taquito/utils';
|
|
108
|
+
* const contractAddress = 'KT1JVErLYTgtY8uGGZ4mso2npTSxqVLDRVbC'
|
|
109
|
+
* const validation = validateContractAddress(contractAddress)
|
|
110
|
+
* console.log(validation)
|
|
111
|
+
* // This example return 3 which correspond to VALID
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
function validateContractAddress(value) {
|
|
115
|
+
return validatePrefixedValue(value, [constants_1.PrefixV2.ContractHash]);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Used to check if a key hash is valid.
|
|
119
|
+
*
|
|
120
|
+
* @returns
|
|
121
|
+
* 0 = NO_PREFIX_MATCHED, 1 = INVALID_CHECKSUM, 2 = INVALID_LENGTH, 3 = VALID, 4 = PREFIX_NOT_ALLOWED, 5 = INVALID_ENCODING, 6 = OTHER,
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```
|
|
125
|
+
* import { validateKeyHash } from '@taquito/utils';
|
|
126
|
+
* const keyHashWithoutPrefix = '1L9r8mWmRPndRhuvMCWESLGSVeFzQ9NAWx'
|
|
127
|
+
* const validation = validateKeyHash(keyHashWithoutPrefix)
|
|
128
|
+
* console.log(validation)
|
|
129
|
+
* // This example return 0 which correspond to NO_PREFIX_MATCHED
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
function validateKeyHash(value) {
|
|
133
|
+
return validatePrefixedValue(value, encoding_1.publicKeyHashPrefixes);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Used to check if a signature is valid.
|
|
137
|
+
*
|
|
138
|
+
* @returns
|
|
139
|
+
* 0 = NO_PREFIX_MATCHED, 1 = INVALID_CHECKSUM, 2 = INVALID_LENGTH, 3 = VALID, 4 = PREFIX_NOT_ALLOWED, 5 = INVALID_ENCODING, 6 = OTHER,
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```
|
|
143
|
+
* import { validateSignature } from '@taquito/utils';
|
|
144
|
+
* const signature = 'edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg'
|
|
145
|
+
* const validation = validateSignature(signature)
|
|
146
|
+
* console.log(validation)
|
|
147
|
+
* // This example return 3 which correspond to VALID
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
function validateSignature(value) {
|
|
151
|
+
return validatePrefixedValue(value, encoding_1.signaturePrefixes);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Used to check if a public key is valid.
|
|
155
|
+
*
|
|
156
|
+
* @returns
|
|
157
|
+
* 0 = NO_PREFIX_MATCHED, 1 = INVALID_CHECKSUM, 2 = INVALID_LENGTH, 3 = VALID, 4 = PREFIX_NOT_ALLOWED, 5 = INVALID_ENCODING, 6 = OTHER,
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```
|
|
161
|
+
* import { validatePublicKey } from '@taquito/utils';
|
|
162
|
+
* const publicKey = 'edpkvS5QFv7KRGfa3b87gg9DBpxSm3NpSwnjhUjNBQrRUUR66F7C9g'
|
|
163
|
+
* const validation = validatePublicKey(publicKey)
|
|
164
|
+
* console.log(validation)
|
|
165
|
+
* // This example return 3 which correspond to VALID
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
function validatePublicKey(value) {
|
|
169
|
+
return validatePrefixedValue(value, encoding_1.publicKeyPrefixes);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Used to check if an operation hash is valid.
|
|
173
|
+
*
|
|
174
|
+
* @returns
|
|
175
|
+
* 0 = NO_PREFIX_MATCHED, 1 = INVALID_CHECKSUM, 2 = INVALID_LENGTH, 3 = VALID, 4 = PREFIX_NOT_ALLOWED, 5 = INVALID_ENCODING, 6 = OTHER,
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```
|
|
179
|
+
* import { validateOperation } from '@taquito/utils';
|
|
180
|
+
* const operationHash = 'oo6JPEAy8VuMRGaFuMmLNFFGdJgiaKfnmT1CpHJfKP3Ye5ZahiP'
|
|
181
|
+
* const validation = validateOperation(operationHash)
|
|
182
|
+
* console.log(validation)
|
|
183
|
+
* // This example return 3 which correspond to VALID
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
function validateOperation(value) {
|
|
187
|
+
return validatePrefixedValue(value, [constants_1.PrefixV2.OperationHash]);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Used to check if a protocol hash is valid.
|
|
191
|
+
*
|
|
192
|
+
* @returns
|
|
193
|
+
* 0 = NO_PREFIX_MATCHED, 1 = INVALID_CHECKSUM, 2 = INVALID_LENGTH, 3 = VALID, 4 = PREFIX_NOT_ALLOWED, 5 = INVALID_ENCODING, 6 = OTHER,
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```
|
|
197
|
+
* import { validateProtocol } from '@taquito/utils';
|
|
198
|
+
* const protocolHash = 'PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx'
|
|
199
|
+
* const validation = validateProtocol(protocolHash)
|
|
200
|
+
* console.log(validation)
|
|
201
|
+
* // This example return 3 which correspond to VALID
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
function validateProtocol(value) {
|
|
205
|
+
return validatePrefixedValue(value, [constants_1.PrefixV2.ProtocolHash]);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Used to check if a block hash is valid.
|
|
209
|
+
*
|
|
210
|
+
* @returns
|
|
211
|
+
* 0 = NO_PREFIX_MATCHED, 1 = INVALID_CHECKSUM, 2 = INVALID_LENGTH, 3 = VALID, 4 = PREFIX_NOT_ALLOWED, 5 = INVALID_ENCODING, 6 = OTHER,
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```
|
|
215
|
+
* import { validateBlock } from '@taquito/utils';
|
|
216
|
+
* const blockHash = 'PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx'
|
|
217
|
+
* const validation = validateBlock(blockHash)
|
|
218
|
+
* console.log(validation)
|
|
219
|
+
* // This example return 3 which correspond to VALID
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
function validateBlock(value) {
|
|
223
|
+
return validatePrefixedValue(value, [constants_1.PrefixV2.BlockHash]);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Used to check if a spending key is valid.
|
|
227
|
+
* @returns
|
|
228
|
+
* 0 = NO_PREFIX_MATCHED, 1 = INVALID_CHECKSUM, 2 = INVALID_LENGTH, 3 = VALID, 4 = PREFIX_NOT_ALLOWED, 5 = INVALID_ENCODING, 6 = OTHER,
|
|
229
|
+
*
|
|
230
|
+
*/
|
|
231
|
+
function validateSpendingKey(value) {
|
|
232
|
+
return validatePrefixedValue(value, [constants_1.PrefixV2.SaplingSpendingKey]);
|
|
233
|
+
}
|
|
234
|
+
function validateSmartRollupAddress(value) {
|
|
235
|
+
return validatePrefixedValue(value, [constants_1.PrefixV2.SmartRollupHash]);
|
|
236
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.POP_DST = exports.BLS12_381_DST = void 0;
|
|
4
|
+
exports.verifySignature = verifySignature;
|
|
5
|
+
const ed25519_1 = require("@noble/curves/ed25519");
|
|
6
|
+
const blake2_js_1 = require("@noble/hashes/blake2.js");
|
|
7
|
+
const encoding_1 = require("./encoding");
|
|
8
|
+
const constants_1 = require("./constants");
|
|
9
|
+
const secp256k1_1 = require("@noble/curves/secp256k1");
|
|
10
|
+
const nist_1 = require("@noble/curves/nist");
|
|
11
|
+
const core_1 = require("@taquito/core");
|
|
12
|
+
const bls12_381_1 = require("@noble/curves/bls12-381");
|
|
13
|
+
exports.BLS12_381_DST = 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_';
|
|
14
|
+
exports.POP_DST = 'BLS_POP_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_';
|
|
15
|
+
/**
|
|
16
|
+
* Verify signature of a payload
|
|
17
|
+
* @param message The forged message including the magic byte (11 for block, 12 for preattestation, 13 for attestation, 3 for generic, 5 for the PACK format of michelson) in string or Uint8Array
|
|
18
|
+
* @param publicKey The public key to verify the signature against
|
|
19
|
+
* @param signature The signature to verify
|
|
20
|
+
* @param watermark Optional if not included in the message
|
|
21
|
+
* @param pop Optional if verifying proof of possession signature
|
|
22
|
+
* @returns A boolean indicating if the signature matches
|
|
23
|
+
* @throws InvalidPublicKeyError | InvalidSignatureError | InvalidMessageError
|
|
24
|
+
* @example
|
|
25
|
+
* ```
|
|
26
|
+
* const message = '03d0c10e3ed11d7c6e3357f6ef335bab9e8f2bd54d0ce20c482e241191a6e4b8ce6c01be917311d9ac46959750e405d57e268e2ed9e174a80794fbd504e12a4a000141eb3781afed2f69679ff2bbe1c5375950b0e40d00ff000000005e05050505050507070100000024747a32526773486e74516b72794670707352466261313652546656503539684b72654a4d07070100000024747a315a6672455263414c42776d4171776f6e525859565142445439426a4e6a42484a750001';
|
|
27
|
+
* const pk = 'sppk7c7hkPj47yjYFEHX85q46sFJGw6RBrqoVSHwAJAT4e14KJwzoey';
|
|
28
|
+
* const sig = 'spsig1cdLkp1RLgUHAp13aRFkZ6MQDPp7xCnjAExGL3MBSdMDmT6JgQSX8cufyDgJRM3sinFtiCzLbsyP6d365EHoNevxhT47nx'
|
|
29
|
+
*
|
|
30
|
+
* const response = verifySignature(message, pk, sig);
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
function verifySignature(message, publicKey, signature, watermark, pop) {
|
|
35
|
+
const [pk, pre] = (() => {
|
|
36
|
+
try {
|
|
37
|
+
return (0, encoding_1.b58DecodeAndCheckPrefix)(publicKey, encoding_1.publicKeyPrefixes);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
if (err instanceof core_1.ParameterValidationError) {
|
|
41
|
+
throw new core_1.InvalidPublicKeyError(publicKey, err.result);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
throw err;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
})();
|
|
48
|
+
const sig = (() => {
|
|
49
|
+
try {
|
|
50
|
+
const [sig] = (0, encoding_1.b58DecodeAndCheckPrefix)(signature, encoding_1.signaturePrefixes);
|
|
51
|
+
return sig;
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
if (err instanceof core_1.ParameterValidationError) {
|
|
55
|
+
throw new core_1.InvalidSignatureError(signature, err.result);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
throw err;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
})();
|
|
62
|
+
let msg;
|
|
63
|
+
if (typeof message === 'string') {
|
|
64
|
+
msg = (0, encoding_1.hex2buf)(message);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
msg = message;
|
|
68
|
+
}
|
|
69
|
+
if (msg.length === 0) {
|
|
70
|
+
throw new core_1.InvalidMessageError((0, encoding_1.buf2hex)(msg), `can't be empty`);
|
|
71
|
+
}
|
|
72
|
+
if (typeof watermark !== 'undefined') {
|
|
73
|
+
msg = (0, encoding_1.mergebuf)(watermark, msg);
|
|
74
|
+
}
|
|
75
|
+
if (pop) {
|
|
76
|
+
return verifyBLSPopSignature(sig, msg, pk);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
switch (pre) {
|
|
80
|
+
case constants_1.PrefixV2.P256PublicKey:
|
|
81
|
+
return verifyP2Signature(sig, msg, pk);
|
|
82
|
+
case constants_1.PrefixV2.Secp256k1PublicKey:
|
|
83
|
+
return verifySpSignature(sig, msg, pk);
|
|
84
|
+
case constants_1.PrefixV2.Ed25519PublicKey:
|
|
85
|
+
return verifyEdSignature(sig, msg, pk);
|
|
86
|
+
default:
|
|
87
|
+
return verifyBLSSignature(sig, msg, pk);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function verifyEdSignature(sig, msg, publicKey) {
|
|
92
|
+
const hash = (0, blake2_js_1.blake2b)(msg, { dkLen: 32 });
|
|
93
|
+
try {
|
|
94
|
+
return ed25519_1.ed25519.verify(sig, hash, publicKey);
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function verifySpSignature(sig, msg, publicKey) {
|
|
101
|
+
const hash = (0, blake2_js_1.blake2b)(msg, { dkLen: 32 });
|
|
102
|
+
try {
|
|
103
|
+
return secp256k1_1.secp256k1.verify(sig, hash, publicKey);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function verifyP2Signature(sig, msg, publicKey) {
|
|
110
|
+
const hash = (0, blake2_js_1.blake2b)(msg, { dkLen: 32 });
|
|
111
|
+
try {
|
|
112
|
+
return nist_1.p256.verify(sig, hash, publicKey);
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const bls = bls12_381_1.bls12_381.longSignatures; // AKA MinPK
|
|
119
|
+
function verifyBLSSignature(sig, msg, publicKey) {
|
|
120
|
+
try {
|
|
121
|
+
const point = bls.hash(msg, exports.BLS12_381_DST);
|
|
122
|
+
return bls.verify(sig, point, publicKey);
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function verifyBLSPopSignature(sig, msg, publicKey) {
|
|
129
|
+
try {
|
|
130
|
+
const point = bls.hash(msg, exports.POP_DST);
|
|
131
|
+
return bls.verify(sig, point, publicKey);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VERSION = void 0;
|
|
4
|
+
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT!
|
|
5
|
+
exports.VERSION = {
|
|
6
|
+
"commitHash": "fb73f1546d3dff2fbba7741ca6006680212bef16",
|
|
7
|
+
"version": "24.3.0-beta.2"
|
|
8
|
+
};
|
package/dist/lib/{taquito-wallet-connect.js → taquito-wallet-connect/src/taquito-wallet-connect.js}
RENAMED
|
@@ -17,9 +17,12 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
17
17
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
18
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
19
|
};
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
20
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
24
|
exports.WalletConnect = void 0;
|
|
22
|
-
const sign_client_1 = require("@walletconnect/sign-client");
|
|
25
|
+
const sign_client_1 = __importDefault(require("@walletconnect/sign-client"));
|
|
23
26
|
const modal_1 = require("@walletconnect/modal");
|
|
24
27
|
const taquito_1 = require("@taquito/taquito");
|
|
25
28
|
const utils_1 = require("@walletconnect/utils");
|
|
@@ -40,18 +43,20 @@ class WalletConnect {
|
|
|
40
43
|
this.walletConnectModal = WalletConnectModal;
|
|
41
44
|
this.signClient.on('session_delete', ({ topic }) => {
|
|
42
45
|
if (this.session?.topic === topic) {
|
|
43
|
-
this.
|
|
46
|
+
this.clearState();
|
|
44
47
|
}
|
|
45
48
|
});
|
|
46
49
|
this.signClient.on('session_expire', ({ topic }) => {
|
|
47
50
|
if (this.session?.topic === topic) {
|
|
48
|
-
this.
|
|
51
|
+
this.clearState();
|
|
49
52
|
}
|
|
50
53
|
});
|
|
51
54
|
this.signClient.on('session_update', ({ params, topic }) => {
|
|
52
55
|
if (this.session?.topic === topic) {
|
|
53
|
-
this.
|
|
54
|
-
|
|
56
|
+
this.activateSession({
|
|
57
|
+
...this.session,
|
|
58
|
+
namespaces: params.namespaces,
|
|
59
|
+
}, undefined, false);
|
|
55
60
|
}
|
|
56
61
|
});
|
|
57
62
|
this.signClient.on('session_event', () => {
|
|
@@ -95,10 +100,11 @@ class WalletConnect {
|
|
|
95
100
|
*/
|
|
96
101
|
async requestPermissions(connectParams) {
|
|
97
102
|
// TODO when Tezos wallets will officially support wallet connect, we need to provide a default value for registryUrl
|
|
103
|
+
let approvedSession;
|
|
98
104
|
try {
|
|
99
105
|
const chains = connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`);
|
|
100
106
|
const { uri, approval } = await this.signClient.connect({
|
|
101
|
-
|
|
107
|
+
optionalNamespaces: {
|
|
102
108
|
[TEZOS_PLACEHOLDER]: {
|
|
103
109
|
chains,
|
|
104
110
|
methods: connectParams.permissionScope.methods,
|
|
@@ -113,7 +119,7 @@ class WalletConnect {
|
|
|
113
119
|
chains,
|
|
114
120
|
});
|
|
115
121
|
}
|
|
116
|
-
|
|
122
|
+
approvedSession = await approval();
|
|
117
123
|
}
|
|
118
124
|
catch (error) {
|
|
119
125
|
throw new errors_1.ConnectionFailed(error);
|
|
@@ -121,8 +127,7 @@ class WalletConnect {
|
|
|
121
127
|
finally {
|
|
122
128
|
this.walletConnectModal.closeModal();
|
|
123
129
|
}
|
|
124
|
-
this.
|
|
125
|
-
this.setDefaultAccountAndNetwork();
|
|
130
|
+
this.activateSession(approvedSession, connectParams.permissionScope);
|
|
126
131
|
}
|
|
127
132
|
/**
|
|
128
133
|
* Access all existing active pairings
|
|
@@ -147,8 +152,7 @@ class WalletConnect {
|
|
|
147
152
|
if (!sessions.includes(key)) {
|
|
148
153
|
throw new errors_1.InvalidSessionKey(key);
|
|
149
154
|
}
|
|
150
|
-
this.
|
|
151
|
-
this.setDefaultAccountAndNetwork();
|
|
155
|
+
this.activateSession(this.signClient.session.get(key));
|
|
152
156
|
}
|
|
153
157
|
async disconnect() {
|
|
154
158
|
if (this.session) {
|
|
@@ -304,14 +308,28 @@ class WalletConnect {
|
|
|
304
308
|
}
|
|
305
309
|
return this.activeNetwork;
|
|
306
310
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
if (
|
|
310
|
-
this.
|
|
311
|
+
activateSession(session, permissionScope, resetActiveState = true) {
|
|
312
|
+
this.session = session;
|
|
313
|
+
if (permissionScope) {
|
|
314
|
+
this.validateReceivedNamespace(permissionScope, session.namespaces);
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
this.validateRestoredNamespace(session.namespaces);
|
|
311
318
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
this.activeNetwork =
|
|
319
|
+
if (resetActiveState) {
|
|
320
|
+
this.activeAccount = undefined;
|
|
321
|
+
this.activeNetwork = undefined;
|
|
322
|
+
}
|
|
323
|
+
this.reconcileActiveAccountAndNetwork();
|
|
324
|
+
}
|
|
325
|
+
reconcileActiveAccountAndNetwork() {
|
|
326
|
+
const accounts = this.getAccounts();
|
|
327
|
+
if (!this.activeAccount || !accounts.includes(this.activeAccount)) {
|
|
328
|
+
this.activeAccount = accounts.length === 1 ? accounts[0] : undefined;
|
|
329
|
+
}
|
|
330
|
+
const networks = this.getNetworks();
|
|
331
|
+
if (!this.activeNetwork || !networks.includes(this.activeNetwork)) {
|
|
332
|
+
this.activeNetwork = networks.length === 1 ? networks[0] : undefined;
|
|
315
333
|
}
|
|
316
334
|
}
|
|
317
335
|
clearState() {
|
|
@@ -358,6 +376,14 @@ class WalletConnect {
|
|
|
358
376
|
throw new errors_1.InvalidReceivedSessionNamespace('All methods must be approved', (0, utils_1.getSdkError)('USER_REJECTED_METHODS').code, 'incomplete', missingMethods);
|
|
359
377
|
}
|
|
360
378
|
}
|
|
379
|
+
validateRestoredNamespace(receivedNamespaces) {
|
|
380
|
+
const tezosNamespace = receivedNamespaces[TEZOS_PLACEHOLDER];
|
|
381
|
+
if (!tezosNamespace) {
|
|
382
|
+
this.clearState();
|
|
383
|
+
throw new errors_1.InvalidSession('Tezos not found in namespaces');
|
|
384
|
+
}
|
|
385
|
+
this.validateAccounts(this.getChainsFromAccounts(tezosNamespace.accounts), tezosNamespace.accounts);
|
|
386
|
+
}
|
|
361
387
|
validateEvents(requiredEvents, receivedEvents) {
|
|
362
388
|
const missingEvents = [];
|
|
363
389
|
requiredEvents.forEach((method) => {
|
|
@@ -375,7 +401,6 @@ class WalletConnect {
|
|
|
375
401
|
this.clearState();
|
|
376
402
|
throw new errors_1.InvalidReceivedSessionNamespace('Accounts must not be empty', (0, utils_1.getSdkError)('USER_REJECTED_CHAINS').code, 'incomplete');
|
|
377
403
|
}
|
|
378
|
-
const receivedChains = [];
|
|
379
404
|
const invalidChains = [];
|
|
380
405
|
const missingChains = [];
|
|
381
406
|
const invalidChainsNamespace = [];
|
|
@@ -387,10 +412,6 @@ class WalletConnect {
|
|
|
387
412
|
if (accountId[0] !== TEZOS_PLACEHOLDER) {
|
|
388
413
|
invalidChainsNamespace.push(chain);
|
|
389
414
|
}
|
|
390
|
-
const network = accountId[1];
|
|
391
|
-
if (!receivedChains.includes(network)) {
|
|
392
|
-
receivedChains.push(network);
|
|
393
|
-
}
|
|
394
415
|
});
|
|
395
416
|
if (invalidChains.length > 0) {
|
|
396
417
|
this.clearState();
|
|
@@ -400,6 +421,7 @@ class WalletConnect {
|
|
|
400
421
|
this.clearState();
|
|
401
422
|
throw new errors_1.InvalidReceivedSessionNamespace('Accounts must be defined in matching namespace', (0, utils_1.getSdkError)('UNSUPPORTED_ACCOUNTS').code, 'invalid', invalidChainsNamespace);
|
|
402
423
|
}
|
|
424
|
+
const receivedChains = this.getChainsFromAccounts(receivedAccounts);
|
|
403
425
|
requiredNetwork.forEach((network) => {
|
|
404
426
|
if (!receivedChains.includes(network)) {
|
|
405
427
|
missingChains.push(network);
|
|
@@ -418,24 +440,19 @@ class WalletConnect {
|
|
|
418
440
|
throw new errors_1.InvalidSession('Tezos not found in namespaces');
|
|
419
441
|
}
|
|
420
442
|
}
|
|
421
|
-
getTezosRequiredNamespace() {
|
|
422
|
-
if (TEZOS_PLACEHOLDER in this.getSession().requiredNamespaces) {
|
|
423
|
-
return this.getSession().requiredNamespaces[TEZOS_PLACEHOLDER];
|
|
424
|
-
}
|
|
425
|
-
else {
|
|
426
|
-
throw new errors_1.InvalidSession('Tezos not found in requiredNamespaces');
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
443
|
validateNetworkAndAccount(network, account) {
|
|
430
444
|
if (!this.getTezosNamespace().accounts.includes(`${TEZOS_PLACEHOLDER}:${network}:${account}`)) {
|
|
431
445
|
throw new errors_1.InvalidNetworkOrAccount(network, account);
|
|
432
446
|
}
|
|
433
447
|
}
|
|
434
448
|
getPermittedMethods() {
|
|
435
|
-
return this.
|
|
449
|
+
return this.getTezosNamespace().methods;
|
|
436
450
|
}
|
|
437
451
|
getPermittedNetwork() {
|
|
438
|
-
return this.
|
|
452
|
+
return this.getChainsFromAccounts(this.getTezosNamespace().accounts);
|
|
453
|
+
}
|
|
454
|
+
getChainsFromAccounts(accounts) {
|
|
455
|
+
return [...new Set(accounts.map((account) => account.split(':')[1]))];
|
|
439
456
|
}
|
|
440
457
|
formatParameters(params) {
|
|
441
458
|
const formatedParams = params;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VERSION = void 0;
|
|
4
|
+
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT!
|
|
5
|
+
exports.VERSION = {
|
|
6
|
+
"commitHash": "fb73f1546d3dff2fbba7741ca6006680212bef16",
|
|
7
|
+
"version": "24.3.0-beta.2"
|
|
8
|
+
};
|