@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,282 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrToken = exports.OrValidationError = void 0;
|
|
4
|
+
const token_1 = require("./token");
|
|
5
|
+
/**
|
|
6
|
+
* @category Error
|
|
7
|
+
* Error that indicates a failure happening when parsing encoding/executing an OrToken
|
|
8
|
+
*/
|
|
9
|
+
class OrValidationError extends token_1.TokenValidationError {
|
|
10
|
+
constructor(value, token, message) {
|
|
11
|
+
super(value, token, message);
|
|
12
|
+
this.value = value;
|
|
13
|
+
this.token = token;
|
|
14
|
+
this.name = 'OrValidationError';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.OrValidationError = OrValidationError;
|
|
18
|
+
class OrToken extends token_1.ComparableToken {
|
|
19
|
+
constructor(val, idx, fac, parentTokenType) {
|
|
20
|
+
super(val, idx, fac, parentTokenType);
|
|
21
|
+
this.val = val;
|
|
22
|
+
this.idx = idx;
|
|
23
|
+
this.fac = fac;
|
|
24
|
+
this.parentTokenType = parentTokenType;
|
|
25
|
+
}
|
|
26
|
+
Encode(args) {
|
|
27
|
+
const label = args[args.length - 1];
|
|
28
|
+
const leftToken = this.createToken(this.val.args[0], this.getIdxForChildren(), 'Or');
|
|
29
|
+
let keyCount = 1;
|
|
30
|
+
if (leftToken instanceof OrToken) {
|
|
31
|
+
keyCount = Object.keys(leftToken.generateSchema().schema).length;
|
|
32
|
+
}
|
|
33
|
+
const rightToken = this.createToken(this.val.args[1], this.getIdxForChildren() + keyCount, 'Or');
|
|
34
|
+
if (String(leftToken.annot()) === String(label) && !(leftToken instanceof OrToken)) {
|
|
35
|
+
args.pop();
|
|
36
|
+
return { prim: 'Left', args: [leftToken.Encode(args)] };
|
|
37
|
+
}
|
|
38
|
+
else if (String(rightToken.annot()) === String(label) && !(rightToken instanceof OrToken)) {
|
|
39
|
+
args.pop();
|
|
40
|
+
return { prim: 'Right', args: [rightToken.Encode(args)] };
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
if (leftToken instanceof OrToken) {
|
|
44
|
+
const val = leftToken.Encode(args);
|
|
45
|
+
if (val) {
|
|
46
|
+
return { prim: 'Left', args: [val] };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (rightToken instanceof OrToken) {
|
|
50
|
+
const val = rightToken.Encode(args);
|
|
51
|
+
if (val) {
|
|
52
|
+
return { prim: 'Right', args: [val] };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
ExtractSignature() {
|
|
59
|
+
const leftToken = this.createToken(this.val.args[0], this.getIdxForChildren(), 'Or');
|
|
60
|
+
let keyCount = 1;
|
|
61
|
+
if (leftToken instanceof OrToken) {
|
|
62
|
+
keyCount = Object.keys(leftToken.generateSchema().schema).length;
|
|
63
|
+
}
|
|
64
|
+
const rightToken = this.createToken(this.val.args[1], this.getIdxForChildren() + keyCount, 'Or');
|
|
65
|
+
const newSig = [];
|
|
66
|
+
if (leftToken instanceof OrToken) {
|
|
67
|
+
newSig.push(...leftToken.ExtractSignature());
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
for (const sig of leftToken.ExtractSignature()) {
|
|
71
|
+
newSig.push([leftToken.annot(), ...sig]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (rightToken instanceof OrToken) {
|
|
75
|
+
newSig.push(...rightToken.ExtractSignature());
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
for (const sig of rightToken.ExtractSignature()) {
|
|
79
|
+
newSig.push([rightToken.annot(), ...sig]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return newSig;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* @throws {@link OrValidationError}
|
|
86
|
+
*/
|
|
87
|
+
EncodeObject(args, semantic) {
|
|
88
|
+
this.validateJavascriptObject(args);
|
|
89
|
+
const label = Object.keys(args)[0];
|
|
90
|
+
const leftToken = this.createToken(this.val.args[0], this.getIdxForChildren(), 'Or');
|
|
91
|
+
let keyCount = 1;
|
|
92
|
+
if (leftToken instanceof OrToken) {
|
|
93
|
+
keyCount = Object.keys(leftToken.generateSchema().schema).length;
|
|
94
|
+
}
|
|
95
|
+
const rightToken = this.createToken(this.val.args[1], this.getIdxForChildren() + keyCount, 'Or');
|
|
96
|
+
if (String(leftToken.annot()) === String(label) && !(leftToken instanceof OrToken)) {
|
|
97
|
+
return { prim: 'Left', args: [leftToken.EncodeObject(args[label], semantic)] };
|
|
98
|
+
}
|
|
99
|
+
else if (String(rightToken.annot()) === String(label) && !(rightToken instanceof OrToken)) {
|
|
100
|
+
return { prim: 'Right', args: [rightToken.EncodeObject(args[label], semantic)] };
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
if (leftToken instanceof OrToken) {
|
|
104
|
+
const val = leftToken.EncodeObject(args, semantic);
|
|
105
|
+
if (val) {
|
|
106
|
+
return { prim: 'Left', args: [val] };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (rightToken instanceof OrToken) {
|
|
110
|
+
const val = rightToken.EncodeObject(args, semantic);
|
|
111
|
+
if (val) {
|
|
112
|
+
return { prim: 'Right', args: [val] };
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* @throws {@link OrValidationError}
|
|
120
|
+
*/
|
|
121
|
+
validateJavascriptObject(args) {
|
|
122
|
+
if (typeof args !== 'object' ||
|
|
123
|
+
Array.isArray(args) ||
|
|
124
|
+
args === null ||
|
|
125
|
+
Object.keys(args).length !== 1) {
|
|
126
|
+
throw new OrValidationError(args, this, `EncodeObject expects an object with a single key but got: ${JSON.stringify(args)}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* @throws {@link OrValidationError}
|
|
131
|
+
*/
|
|
132
|
+
Execute(val, semantics) {
|
|
133
|
+
const leftToken = this.createToken(this.val.args[0], this.getIdxForChildren(), 'Or');
|
|
134
|
+
let keyCount = 1;
|
|
135
|
+
if (leftToken instanceof OrToken) {
|
|
136
|
+
keyCount = Object.keys(leftToken.generateSchema().schema).length;
|
|
137
|
+
}
|
|
138
|
+
const rightToken = this.createToken(this.val.args[1], this.getIdxForChildren() + keyCount, 'Or');
|
|
139
|
+
if (val.prim === 'Right') {
|
|
140
|
+
if (rightToken instanceof OrToken) {
|
|
141
|
+
return rightToken.Execute(val.args[0], semantics);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
return {
|
|
145
|
+
[rightToken.annot()]: rightToken.Execute(val.args[0], semantics),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else if (val.prim === 'Left') {
|
|
150
|
+
if (leftToken instanceof OrToken) {
|
|
151
|
+
return leftToken.Execute(val.args[0], semantics);
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
[leftToken.annot()]: leftToken.Execute(val.args[0], semantics),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
throw new OrValidationError(val, this, `Was expecting Left or Right prim but got: ${JSON.stringify(val.prim)}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
traversal(getLeftValue, getRightValue, concat) {
|
|
162
|
+
const leftToken = this.createToken(this.val.args[0], this.getIdxForChildren(), 'Or');
|
|
163
|
+
let keyCount = 1;
|
|
164
|
+
let leftValue;
|
|
165
|
+
if (leftToken instanceof OrToken) {
|
|
166
|
+
leftValue = getLeftValue(leftToken);
|
|
167
|
+
keyCount = Object.keys(leftToken.generateSchema().schema).length;
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
leftValue = { [leftToken.annot()]: getLeftValue(leftToken) };
|
|
171
|
+
}
|
|
172
|
+
const rightToken = this.createToken(this.val.args[1], this.getIdxForChildren() + keyCount, 'Or');
|
|
173
|
+
let rightValue;
|
|
174
|
+
if (rightToken instanceof OrToken) {
|
|
175
|
+
rightValue = getRightValue(rightToken);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
rightValue = { [rightToken.annot()]: getRightValue(rightToken) };
|
|
179
|
+
}
|
|
180
|
+
const res = concat(leftValue, rightValue);
|
|
181
|
+
return res;
|
|
182
|
+
}
|
|
183
|
+
generateSchema() {
|
|
184
|
+
return {
|
|
185
|
+
__michelsonType: OrToken.prim,
|
|
186
|
+
schema: this.traversal((leftToken) => {
|
|
187
|
+
if (leftToken instanceof OrToken) {
|
|
188
|
+
return leftToken.generateSchema().schema;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
return leftToken.generateSchema();
|
|
192
|
+
}
|
|
193
|
+
}, (rightToken) => {
|
|
194
|
+
if (rightToken instanceof OrToken) {
|
|
195
|
+
return rightToken.generateSchema().schema;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
return rightToken.generateSchema();
|
|
199
|
+
}
|
|
200
|
+
}, (leftValue, rightValue) => ({
|
|
201
|
+
...leftValue,
|
|
202
|
+
...rightValue,
|
|
203
|
+
})),
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
findToken(label) {
|
|
207
|
+
const leftToken = this.createToken(this.val.args[0], this.getIdxForChildren(), 'Or');
|
|
208
|
+
let keyCount = 1;
|
|
209
|
+
if (leftToken instanceof OrToken) {
|
|
210
|
+
const schema = leftToken.generateSchema();
|
|
211
|
+
keyCount = Object.keys(schema.schema).length;
|
|
212
|
+
}
|
|
213
|
+
const rightToken = this.createToken(this.val.args[1], this.getIdxForChildren() + keyCount, 'Or');
|
|
214
|
+
if (String(leftToken.annot()) === String(label) &&
|
|
215
|
+
!(leftToken instanceof OrToken) &&
|
|
216
|
+
leftToken instanceof token_1.ComparableToken) {
|
|
217
|
+
return leftToken;
|
|
218
|
+
}
|
|
219
|
+
else if (String(rightToken.annot()) === String(label) &&
|
|
220
|
+
!(rightToken instanceof OrToken) &&
|
|
221
|
+
rightToken instanceof token_1.ComparableToken) {
|
|
222
|
+
return rightToken;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
if (leftToken instanceof OrToken) {
|
|
226
|
+
const tok = leftToken.findToken(label);
|
|
227
|
+
if (tok) {
|
|
228
|
+
return tok;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (rightToken instanceof OrToken) {
|
|
232
|
+
const tok = rightToken.findToken(label);
|
|
233
|
+
if (tok) {
|
|
234
|
+
return tok;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
compare(val1, val2) {
|
|
241
|
+
const labelVal1 = Object.keys(val1)[0];
|
|
242
|
+
const labelVal2 = Object.keys(val2)[0];
|
|
243
|
+
if (labelVal1 === labelVal2) {
|
|
244
|
+
const token = this.findToken(labelVal1);
|
|
245
|
+
if (token instanceof token_1.ComparableToken) {
|
|
246
|
+
return token.compare(val1[labelVal1], val2[labelVal1]);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
const encoded1 = JSON.stringify(this.EncodeObject(val1));
|
|
251
|
+
const encoded2 = JSON.stringify(this.EncodeObject(val2));
|
|
252
|
+
return encoded1 < encoded2 ? -1 : 1;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
ToKey(val) {
|
|
256
|
+
return this.Execute(val);
|
|
257
|
+
}
|
|
258
|
+
ToBigMapKey(val) {
|
|
259
|
+
return {
|
|
260
|
+
key: this.EncodeObject(val),
|
|
261
|
+
type: this.typeWithoutAnnotations(),
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
findAndReturnTokens(tokenToFind, tokens) {
|
|
265
|
+
if (OrToken.prim === tokenToFind) {
|
|
266
|
+
tokens.push(this);
|
|
267
|
+
}
|
|
268
|
+
this.traversal((leftToken) => leftToken.findAndReturnTokens(tokenToFind, tokens), (rightToken) => rightToken.findAndReturnTokens(tokenToFind, tokens), (leftValue, rightValue) => ({
|
|
269
|
+
...leftValue,
|
|
270
|
+
...rightValue,
|
|
271
|
+
}));
|
|
272
|
+
return tokens;
|
|
273
|
+
}
|
|
274
|
+
getIdxForChildren() {
|
|
275
|
+
if (token_1.Token.fieldNumberingStrategy === 'Legacy') {
|
|
276
|
+
return this.idx;
|
|
277
|
+
}
|
|
278
|
+
return this.parentTokenType === 'Or' ? this.idx : 0;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
exports.OrToken = OrToken;
|
|
282
|
+
OrToken.prim = 'or';
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PairToken = exports.TokenComparisonError = exports.TokenArgumentValidationError = void 0;
|
|
4
|
+
const token_1 = require("./token");
|
|
5
|
+
const or_1 = require("./or");
|
|
6
|
+
const core_1 = require("@taquito/core");
|
|
7
|
+
/**
|
|
8
|
+
* @category Error
|
|
9
|
+
* Error that indicates in invalid token argument being passed
|
|
10
|
+
*/
|
|
11
|
+
class TokenArgumentValidationError extends core_1.TaquitoError {
|
|
12
|
+
constructor(message) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.message = message;
|
|
15
|
+
this.name = 'TokenArgumentValidationError';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.TokenArgumentValidationError = TokenArgumentValidationError;
|
|
19
|
+
/**
|
|
20
|
+
* @category Error
|
|
21
|
+
* Error that indicates a failure occurring when doing a comparison of tokens
|
|
22
|
+
*/
|
|
23
|
+
class TokenComparisonError extends core_1.TaquitoError {
|
|
24
|
+
constructor(val1, val2) {
|
|
25
|
+
super();
|
|
26
|
+
this.val1 = val1;
|
|
27
|
+
this.val2 = val2;
|
|
28
|
+
this.name = 'TokenComparisonError';
|
|
29
|
+
this.message = `Tokens ${JSON.stringify(val1)} and ${JSON.stringify(val2)} are not comparable`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.TokenComparisonError = TokenComparisonError;
|
|
33
|
+
// collapse comb pair
|
|
34
|
+
/**
|
|
35
|
+
* @throws {@link TokenArgumentValidationError}
|
|
36
|
+
*/
|
|
37
|
+
function collapse(val, prim = PairToken.prim) {
|
|
38
|
+
if (Array.isArray(val)) {
|
|
39
|
+
return collapse({
|
|
40
|
+
prim: prim,
|
|
41
|
+
args: val,
|
|
42
|
+
}, prim);
|
|
43
|
+
}
|
|
44
|
+
if (val.args === undefined) {
|
|
45
|
+
throw new TokenArgumentValidationError(`The value ${JSON.stringify(val)} is an invalid PairToken with no arguments, a pair must have two or more arguments.`);
|
|
46
|
+
}
|
|
47
|
+
if (val.args.length > 2) {
|
|
48
|
+
return [
|
|
49
|
+
val.args[0],
|
|
50
|
+
{
|
|
51
|
+
prim: prim,
|
|
52
|
+
args: val.args.slice(1),
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
return [val.args[0], val.args[1]];
|
|
57
|
+
}
|
|
58
|
+
class PairToken extends token_1.ComparableToken {
|
|
59
|
+
constructor(val, idx, fac, parentTokenType) {
|
|
60
|
+
super(Array.isArray(val)
|
|
61
|
+
? {
|
|
62
|
+
prim: PairToken.prim,
|
|
63
|
+
args: val,
|
|
64
|
+
}
|
|
65
|
+
: val.prim
|
|
66
|
+
? val
|
|
67
|
+
: {
|
|
68
|
+
prim: PairToken.prim,
|
|
69
|
+
args: val,
|
|
70
|
+
}, idx, fac, parentTokenType);
|
|
71
|
+
}
|
|
72
|
+
args() {
|
|
73
|
+
// collapse comb pair
|
|
74
|
+
return collapse(this.val);
|
|
75
|
+
}
|
|
76
|
+
tokens() {
|
|
77
|
+
let cnt = 0;
|
|
78
|
+
return this.args().map((a) => {
|
|
79
|
+
const tok = this.createToken(a, this.getIdxForChildren() + cnt, 'Pair');
|
|
80
|
+
if (tok instanceof PairToken) {
|
|
81
|
+
cnt += Object.keys(tok.generateSchema()).length;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
cnt++;
|
|
85
|
+
}
|
|
86
|
+
return tok;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
Encode(args) {
|
|
90
|
+
return {
|
|
91
|
+
prim: 'Pair',
|
|
92
|
+
args: this.tokens().map((t) => t.Encode(args)),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
ExtractSignature() {
|
|
96
|
+
const args = this.args();
|
|
97
|
+
const leftToken = this.createToken(args[0], this.getIdxForChildren(), 'Pair');
|
|
98
|
+
let keyCount = 1;
|
|
99
|
+
if (leftToken instanceof or_1.OrToken) {
|
|
100
|
+
keyCount = Object.keys(leftToken.generateSchema()).length;
|
|
101
|
+
}
|
|
102
|
+
const rightToken = this.createToken(args[1], this.getIdxForChildren() + keyCount, 'Pair');
|
|
103
|
+
const newSig = [];
|
|
104
|
+
for (const leftSig of leftToken.ExtractSignature()) {
|
|
105
|
+
for (const rightSig of rightToken.ExtractSignature()) {
|
|
106
|
+
newSig.push([...leftSig, ...rightSig]);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return newSig;
|
|
110
|
+
}
|
|
111
|
+
ToBigMapKey(val) {
|
|
112
|
+
return {
|
|
113
|
+
key: this.EncodeObject(val),
|
|
114
|
+
type: this.typeWithoutAnnotations(),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
ToKey(val) {
|
|
118
|
+
return this.Execute(val);
|
|
119
|
+
}
|
|
120
|
+
EncodeObject(args, semantic) {
|
|
121
|
+
const [leftToken, rightToken] = this.tokens();
|
|
122
|
+
let leftValue;
|
|
123
|
+
if (leftToken instanceof PairToken && !leftToken.hasAnnotations()) {
|
|
124
|
+
leftValue = args;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
leftValue = args[leftToken.annot()];
|
|
128
|
+
}
|
|
129
|
+
let rightValue;
|
|
130
|
+
if (rightToken instanceof PairToken && !rightToken.hasAnnotations()) {
|
|
131
|
+
rightValue = args;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
rightValue = args[rightToken.annot()];
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
prim: 'Pair',
|
|
138
|
+
args: [
|
|
139
|
+
leftToken.EncodeObject(leftValue, semantic),
|
|
140
|
+
rightToken.EncodeObject(rightValue, semantic),
|
|
141
|
+
],
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
traversal(getLeftValue, getRightValue) {
|
|
145
|
+
const args = this.args();
|
|
146
|
+
const leftToken = this.createToken(args[0], this.getIdxForChildren(), 'Pair');
|
|
147
|
+
let keyCount = 1;
|
|
148
|
+
let leftValue;
|
|
149
|
+
if (leftToken instanceof PairToken && !leftToken.hasAnnotations()) {
|
|
150
|
+
leftValue = getLeftValue(leftToken);
|
|
151
|
+
if (leftToken instanceof PairToken) {
|
|
152
|
+
keyCount = Object.keys(leftToken.generateSchema()).length;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
leftValue = { [leftToken.annot()]: getLeftValue(leftToken) };
|
|
157
|
+
}
|
|
158
|
+
const rightToken = this.createToken(args[1], this.getIdxForChildren() + keyCount, 'Pair');
|
|
159
|
+
let rightValue;
|
|
160
|
+
if (rightToken instanceof PairToken && !rightToken.hasAnnotations()) {
|
|
161
|
+
rightValue = getRightValue(rightToken);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
rightValue = { [rightToken.annot()]: getRightValue(rightToken) };
|
|
165
|
+
}
|
|
166
|
+
const res = {
|
|
167
|
+
...leftValue,
|
|
168
|
+
...rightValue,
|
|
169
|
+
};
|
|
170
|
+
return res;
|
|
171
|
+
}
|
|
172
|
+
Execute(val, semantics) {
|
|
173
|
+
const args = collapse(val, 'Pair');
|
|
174
|
+
return this.traversal((leftToken) => leftToken.Execute(args[0], semantics), (rightToken) => rightToken.Execute(args[1], semantics));
|
|
175
|
+
}
|
|
176
|
+
generateSchema() {
|
|
177
|
+
return {
|
|
178
|
+
__michelsonType: PairToken.prim,
|
|
179
|
+
schema: this.traversal((leftToken) => {
|
|
180
|
+
if (leftToken instanceof PairToken && !leftToken.hasAnnotations()) {
|
|
181
|
+
return leftToken.generateSchema().schema;
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
return leftToken.generateSchema();
|
|
185
|
+
}
|
|
186
|
+
}, (rightToken) => {
|
|
187
|
+
if (rightToken instanceof PairToken && !rightToken.hasAnnotations()) {
|
|
188
|
+
return rightToken.generateSchema().schema;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
return rightToken.generateSchema();
|
|
192
|
+
}
|
|
193
|
+
}),
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* @throws {@link TokenComparisonError}
|
|
198
|
+
*/
|
|
199
|
+
compare(val1, val2) {
|
|
200
|
+
const [leftToken, rightToken] = this.tokens();
|
|
201
|
+
const getValue = (token, args) => {
|
|
202
|
+
if (token instanceof PairToken && !token.hasAnnotations()) {
|
|
203
|
+
return args;
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
return args[token.annot()];
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
if (leftToken instanceof token_1.ComparableToken && rightToken instanceof token_1.ComparableToken) {
|
|
210
|
+
const result = leftToken.compare(getValue(leftToken, val1), getValue(leftToken, val2));
|
|
211
|
+
if (result === 0) {
|
|
212
|
+
return rightToken.compare(getValue(rightToken, val1), getValue(rightToken, val2));
|
|
213
|
+
}
|
|
214
|
+
return result;
|
|
215
|
+
}
|
|
216
|
+
throw new TokenComparisonError(val1, val2);
|
|
217
|
+
}
|
|
218
|
+
findAndReturnTokens(tokenToFind, tokens) {
|
|
219
|
+
if (PairToken.prim === tokenToFind) {
|
|
220
|
+
tokens.push(this);
|
|
221
|
+
}
|
|
222
|
+
this.tokens().map((t) => t.findAndReturnTokens(tokenToFind, tokens));
|
|
223
|
+
return tokens;
|
|
224
|
+
}
|
|
225
|
+
getIdxForChildren() {
|
|
226
|
+
if (token_1.Token.fieldNumberingStrategy === 'Legacy') {
|
|
227
|
+
return this.idx;
|
|
228
|
+
}
|
|
229
|
+
return this.parentTokenType === 'Pair' ? this.idx : 0;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
exports.PairToken = PairToken;
|
|
233
|
+
PairToken.prim = 'pair';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SaplingStateToken = exports.SaplingStateValidationError = void 0;
|
|
4
|
+
const token_1 = require("./token");
|
|
5
|
+
/**
|
|
6
|
+
* @category Error
|
|
7
|
+
* Error that indicates a failure happening when parsing encoding/executing a Sapling State
|
|
8
|
+
*/
|
|
9
|
+
class SaplingStateValidationError extends token_1.TokenValidationError {
|
|
10
|
+
constructor(value, token, message) {
|
|
11
|
+
super(value, token, message);
|
|
12
|
+
this.value = value;
|
|
13
|
+
this.token = token;
|
|
14
|
+
this.name = 'SaplingStateValidationError';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.SaplingStateValidationError = SaplingStateValidationError;
|
|
18
|
+
class SaplingStateToken extends token_1.Token {
|
|
19
|
+
constructor(val, idx, fac) {
|
|
20
|
+
super(val, idx, fac);
|
|
21
|
+
this.val = val;
|
|
22
|
+
this.idx = idx;
|
|
23
|
+
this.fac = fac;
|
|
24
|
+
}
|
|
25
|
+
isValid(val) {
|
|
26
|
+
return typeof val === 'object' && Object.keys(val).length === 0;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @throws {@link SaplingStateValidationError}
|
|
30
|
+
*/
|
|
31
|
+
Execute(val, semantic) {
|
|
32
|
+
if (semantic && semantic[SaplingStateToken.prim]) {
|
|
33
|
+
return semantic[SaplingStateToken.prim](val, this.val);
|
|
34
|
+
}
|
|
35
|
+
if ('int' in val) {
|
|
36
|
+
return val.int;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
throw new SaplingStateValidationError(val, this, `Sapling state is expecting an object with an int property. Got ${JSON.stringify(val)}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @throws {@link SaplingStateValidationError}
|
|
44
|
+
*/
|
|
45
|
+
Encode(args) {
|
|
46
|
+
const val = args.pop();
|
|
47
|
+
if (this.isValid(val)) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
throw new SaplingStateValidationError(val, this, `Invalid sapling_state. Received: ${JSON.stringify(val)} while expecting: {}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @throws {@link SaplingStateValidationError}
|
|
56
|
+
*/
|
|
57
|
+
EncodeObject(val, semantic) {
|
|
58
|
+
if (semantic && semantic[SaplingStateToken.prim]) {
|
|
59
|
+
return semantic[SaplingStateToken.prim](val);
|
|
60
|
+
}
|
|
61
|
+
if (this.isValid(val)) {
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
throw new SaplingStateValidationError(val, this, `Invalid sapling_state. Received: ${JSON.stringify(val)} while expecting: {}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
generateSchema() {
|
|
69
|
+
return {
|
|
70
|
+
__michelsonType: SaplingStateToken.prim,
|
|
71
|
+
schema: {
|
|
72
|
+
memoSize: this.val.args[0]['int'],
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
findAndReturnTokens(tokenToFind, tokens) {
|
|
77
|
+
if (SaplingStateToken.prim === tokenToFind) {
|
|
78
|
+
tokens.push(this);
|
|
79
|
+
}
|
|
80
|
+
return tokens;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.SaplingStateToken = SaplingStateToken;
|
|
84
|
+
SaplingStateToken.prim = 'sapling_state';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SaplingTransactionDeprecatedToken = exports.SaplingTransactionDeprecatedValidationError = void 0;
|
|
4
|
+
const token_1 = require("./token");
|
|
5
|
+
/**
|
|
6
|
+
* @category Error
|
|
7
|
+
* Error that indicates a failure happening when parsing encoding/executing a Sapling Transaction Deprecated
|
|
8
|
+
*/
|
|
9
|
+
class SaplingTransactionDeprecatedValidationError extends token_1.TokenValidationError {
|
|
10
|
+
constructor(value, token, message) {
|
|
11
|
+
super(value, token, message);
|
|
12
|
+
this.value = value;
|
|
13
|
+
this.token = token;
|
|
14
|
+
this.name = 'SaplingTransactionDeprecatedValidationError';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.SaplingTransactionDeprecatedValidationError = SaplingTransactionDeprecatedValidationError;
|
|
18
|
+
class SaplingTransactionDeprecatedToken extends token_1.Token {
|
|
19
|
+
constructor(val, idx, fac) {
|
|
20
|
+
super(val, idx, fac);
|
|
21
|
+
this.val = val;
|
|
22
|
+
this.idx = idx;
|
|
23
|
+
this.fac = fac;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @throws {@link SaplingTransactionDeprecatedValidationError}
|
|
27
|
+
*/
|
|
28
|
+
Execute(_val) {
|
|
29
|
+
throw new SaplingTransactionDeprecatedValidationError(_val, this, `There is no literal value for the sapling_transaction_deprecated type. Got: ${JSON.stringify(_val)}.`);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @throws {@link SaplingTransactionDeprecatedValidationError}
|
|
33
|
+
*/
|
|
34
|
+
validateBytes(val) {
|
|
35
|
+
const bytes = /^(0x|0X)?([0-9a-fA-F]*$)/.exec(val);
|
|
36
|
+
if (bytes && bytes[2].length % 2 === 0) {
|
|
37
|
+
return bytes[2];
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
throw new SaplingTransactionDeprecatedValidationError(val, this, `Invalid bytes: ${JSON.stringify(val)}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
convertUint8ArrayToHexString(val) {
|
|
44
|
+
return val.constructor === Uint8Array ? Buffer.from(val).toString('hex') : val;
|
|
45
|
+
}
|
|
46
|
+
Encode(args) {
|
|
47
|
+
let val = args.pop();
|
|
48
|
+
val = this.validateBytes(this.convertUint8ArrayToHexString(val));
|
|
49
|
+
return { bytes: String(val).toString() };
|
|
50
|
+
}
|
|
51
|
+
EncodeObject(val, semantic) {
|
|
52
|
+
val = this.validateBytes(this.convertUint8ArrayToHexString(val));
|
|
53
|
+
if (semantic && semantic[SaplingTransactionDeprecatedToken.prim]) {
|
|
54
|
+
return semantic[SaplingTransactionDeprecatedToken.prim](val);
|
|
55
|
+
}
|
|
56
|
+
return { bytes: String(val).toString() };
|
|
57
|
+
}
|
|
58
|
+
generateSchema() {
|
|
59
|
+
return {
|
|
60
|
+
__michelsonType: SaplingTransactionDeprecatedToken.prim,
|
|
61
|
+
schema: {
|
|
62
|
+
memoSize: this.val.args[0]['int'],
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
findAndReturnTokens(tokenToFind, tokens) {
|
|
67
|
+
if (SaplingTransactionDeprecatedToken.prim === tokenToFind) {
|
|
68
|
+
tokens.push(this);
|
|
69
|
+
}
|
|
70
|
+
return tokens;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.SaplingTransactionDeprecatedToken = SaplingTransactionDeprecatedToken;
|
|
74
|
+
SaplingTransactionDeprecatedToken.prim = 'sapling_transaction_deprecated';
|