@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,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Bls12381g2Token = exports.Bls12381g2ValidationError = void 0;
|
|
4
|
+
const token_1 = require("./token");
|
|
5
|
+
/**
|
|
6
|
+
* @category Error
|
|
7
|
+
* Error that indicates a failure happening when parsing encoding/executing a BLS12-381 curve G2
|
|
8
|
+
*/
|
|
9
|
+
class Bls12381g2ValidationError 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 = 'Bls12381g2ValidationError';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.Bls12381g2ValidationError = Bls12381g2ValidationError;
|
|
18
|
+
class Bls12381g2Token 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 Bls12381g2ValidationError}
|
|
27
|
+
*/
|
|
28
|
+
validate(val) {
|
|
29
|
+
if (/^[0-9a-fA-F]*$/.test(val) && val.length % 2 === 0) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
throw new Bls12381g2ValidationError(val, this, `Invalid bytes: ${JSON.stringify(val)}`);
|
|
33
|
+
}
|
|
34
|
+
convertUint8ArrayToHexString(val) {
|
|
35
|
+
return val.constructor === Uint8Array ? Buffer.from(val).toString('hex') : val;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @throws {@link Bls12381g2ValidationError}
|
|
39
|
+
*/
|
|
40
|
+
Encode(args) {
|
|
41
|
+
let val = args.pop();
|
|
42
|
+
val = this.convertUint8ArrayToHexString(val);
|
|
43
|
+
this.validate(val);
|
|
44
|
+
return { bytes: val };
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @throws {@link Bls12381g2ValidationError}
|
|
48
|
+
*/
|
|
49
|
+
EncodeObject(val, semantic) {
|
|
50
|
+
val = this.convertUint8ArrayToHexString(val);
|
|
51
|
+
this.validate(val);
|
|
52
|
+
if (semantic && semantic[Bls12381g2Token.prim]) {
|
|
53
|
+
return semantic[Bls12381g2Token.prim](val);
|
|
54
|
+
}
|
|
55
|
+
return { bytes: val };
|
|
56
|
+
}
|
|
57
|
+
Execute(val) {
|
|
58
|
+
return val.bytes;
|
|
59
|
+
}
|
|
60
|
+
generateSchema() {
|
|
61
|
+
return {
|
|
62
|
+
__michelsonType: Bls12381g2Token.prim,
|
|
63
|
+
schema: Bls12381g2Token.prim,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
findAndReturnTokens(tokenToFind, tokens) {
|
|
67
|
+
if (Bls12381g2Token.prim === tokenToFind) {
|
|
68
|
+
tokens.push(this);
|
|
69
|
+
}
|
|
70
|
+
return tokens;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.Bls12381g2Token = Bls12381g2Token;
|
|
74
|
+
// A point on the BLS12-381 curve G2
|
|
75
|
+
// See https://tezos.gitlab.io/michelson-reference/#type-bls12_381_g2
|
|
76
|
+
Bls12381g2Token.prim = 'bls12_381_g2';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChainIDToken = exports.ChainIDValidationError = void 0;
|
|
4
|
+
const token_1 = require("./token");
|
|
5
|
+
const utils_1 = require("@taquito/utils");
|
|
6
|
+
/**
|
|
7
|
+
* @category Error
|
|
8
|
+
* Error that indicates a failure happening when parsing encoding/executing a ChainID
|
|
9
|
+
*/
|
|
10
|
+
class ChainIDValidationError extends token_1.TokenValidationError {
|
|
11
|
+
constructor(value, token, message) {
|
|
12
|
+
super(value, token, message);
|
|
13
|
+
this.value = value;
|
|
14
|
+
this.token = token;
|
|
15
|
+
this.name = 'ChainIDValidationError';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ChainIDValidationError = ChainIDValidationError;
|
|
19
|
+
class ChainIDToken extends token_1.ComparableToken {
|
|
20
|
+
constructor(val, idx, fac) {
|
|
21
|
+
super(val, idx, fac);
|
|
22
|
+
this.val = val;
|
|
23
|
+
this.idx = idx;
|
|
24
|
+
this.fac = fac;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @throws {@link ChainIDValidationError}
|
|
28
|
+
*/
|
|
29
|
+
validate(value) {
|
|
30
|
+
if ((0, utils_1.validateChain)(value) !== utils_1.ValidationResult.VALID) {
|
|
31
|
+
throw new ChainIDValidationError(value, this, `Value ${JSON.stringify(value)} is not a valid ChainID`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
Execute(val) {
|
|
35
|
+
return val[Object.keys(val)[0]];
|
|
36
|
+
}
|
|
37
|
+
generateSchema() {
|
|
38
|
+
return {
|
|
39
|
+
__michelsonType: ChainIDToken.prim,
|
|
40
|
+
schema: ChainIDToken.prim,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @throws {@link ChainIDValidationError}
|
|
45
|
+
*/
|
|
46
|
+
Encode(args) {
|
|
47
|
+
const val = args.pop();
|
|
48
|
+
this.validate(val);
|
|
49
|
+
return { string: val };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @throws {@link ChainIDValidationError}
|
|
53
|
+
*/
|
|
54
|
+
EncodeObject(val, semantic) {
|
|
55
|
+
this.validate(val);
|
|
56
|
+
if (semantic && semantic[ChainIDToken.prim]) {
|
|
57
|
+
return semantic[ChainIDToken.prim](val);
|
|
58
|
+
}
|
|
59
|
+
return { string: val };
|
|
60
|
+
}
|
|
61
|
+
ToKey({ string }) {
|
|
62
|
+
return string;
|
|
63
|
+
}
|
|
64
|
+
ToBigMapKey(val) {
|
|
65
|
+
return {
|
|
66
|
+
key: { string: val },
|
|
67
|
+
type: { prim: ChainIDToken.prim },
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
findAndReturnTokens(tokenToFind, tokens) {
|
|
71
|
+
if (ChainIDToken.prim === tokenToFind) {
|
|
72
|
+
tokens.push(this);
|
|
73
|
+
}
|
|
74
|
+
return tokens;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.ChainIDToken = ChainIDToken;
|
|
78
|
+
ChainIDToken.prim = 'chain_id';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChestKeyToken = exports.ChestKeyValidationError = void 0;
|
|
4
|
+
const token_1 = require("./token");
|
|
5
|
+
/**
|
|
6
|
+
* @category Error
|
|
7
|
+
* Error that indicates a failure happening when parsing encoding/executing a Chest Key
|
|
8
|
+
*/
|
|
9
|
+
class ChestKeyValidationError 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 = 'ChestKeyValidationError';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ChestKeyValidationError = ChestKeyValidationError;
|
|
18
|
+
class ChestKeyToken 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 ChestKeyValidationError}
|
|
27
|
+
*/
|
|
28
|
+
validate(val) {
|
|
29
|
+
if (/^[0-9a-fA-F]*$/.test(val) && val.length % 2 === 0) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
throw new ChestKeyValidationError(val, this, `Invalid bytes: ${JSON.stringify(val)}`);
|
|
33
|
+
}
|
|
34
|
+
convertUint8ArrayToHexString(val) {
|
|
35
|
+
return val.constructor === Uint8Array ? Buffer.from(val).toString('hex') : val;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @throws {@link ChestKeyValidationError}
|
|
39
|
+
*/
|
|
40
|
+
Encode(args) {
|
|
41
|
+
let val = args.pop();
|
|
42
|
+
val = this.convertUint8ArrayToHexString(val);
|
|
43
|
+
this.validate(val);
|
|
44
|
+
return { bytes: val };
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @throws {@link ChestKeyValidationError}
|
|
48
|
+
*/
|
|
49
|
+
EncodeObject(val, semantic) {
|
|
50
|
+
val = this.convertUint8ArrayToHexString(val);
|
|
51
|
+
this.validate(val);
|
|
52
|
+
if (semantic && semantic[ChestKeyToken.prim]) {
|
|
53
|
+
return semantic[ChestKeyToken.prim](val);
|
|
54
|
+
}
|
|
55
|
+
return { bytes: val };
|
|
56
|
+
}
|
|
57
|
+
Execute(val) {
|
|
58
|
+
return val.bytes;
|
|
59
|
+
}
|
|
60
|
+
generateSchema() {
|
|
61
|
+
return {
|
|
62
|
+
__michelsonType: ChestKeyToken.prim,
|
|
63
|
+
schema: ChestKeyToken.prim,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
findAndReturnTokens(tokenToFind, tokens) {
|
|
67
|
+
if (ChestKeyToken.prim === tokenToFind) {
|
|
68
|
+
tokens.push(this);
|
|
69
|
+
}
|
|
70
|
+
return tokens;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.ChestKeyToken = ChestKeyToken;
|
|
74
|
+
ChestKeyToken.prim = 'chest_key';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChestToken = exports.ChestValidationError = void 0;
|
|
4
|
+
const token_1 = require("./token");
|
|
5
|
+
/**
|
|
6
|
+
* @category Error
|
|
7
|
+
* Error that indicates a failure happening when parsing encoding/executing a Chest
|
|
8
|
+
*/
|
|
9
|
+
class ChestValidationError 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 = 'ChestValidationError';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ChestValidationError = ChestValidationError;
|
|
18
|
+
class ChestToken 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 ChestKeyValidationError}
|
|
27
|
+
*/
|
|
28
|
+
validate(val) {
|
|
29
|
+
if (/^[0-9a-fA-F]*$/.test(val) && val.length % 2 == 0) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
throw new ChestValidationError(val, this, `Invalid bytes: ${JSON.stringify(val)}`);
|
|
33
|
+
}
|
|
34
|
+
convertUint8ArrayToHexString(val) {
|
|
35
|
+
return val.constructor === Uint8Array ? Buffer.from(val).toString('hex') : val;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @throws {@link ChestKeyValidationError}
|
|
39
|
+
*/
|
|
40
|
+
Encode(args) {
|
|
41
|
+
let val = args.pop();
|
|
42
|
+
val = this.convertUint8ArrayToHexString(val);
|
|
43
|
+
this.validate(val);
|
|
44
|
+
return { bytes: val };
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @throws {@link ChestKeyValidationError}
|
|
48
|
+
*/
|
|
49
|
+
EncodeObject(val, semantic) {
|
|
50
|
+
val = this.convertUint8ArrayToHexString(val);
|
|
51
|
+
this.validate(val);
|
|
52
|
+
if (semantic && semantic[ChestToken.prim]) {
|
|
53
|
+
return semantic[ChestToken.prim](val);
|
|
54
|
+
}
|
|
55
|
+
return { bytes: val };
|
|
56
|
+
}
|
|
57
|
+
Execute(val) {
|
|
58
|
+
return val.bytes;
|
|
59
|
+
}
|
|
60
|
+
generateSchema() {
|
|
61
|
+
return {
|
|
62
|
+
__michelsonType: ChestToken.prim,
|
|
63
|
+
schema: ChestToken.prim,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
findAndReturnTokens(tokenToFind, tokens) {
|
|
67
|
+
if (ChestToken.prim === tokenToFind) {
|
|
68
|
+
tokens.push(this);
|
|
69
|
+
}
|
|
70
|
+
return tokens;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.ChestToken = ChestToken;
|
|
74
|
+
ChestToken.prim = 'chest';
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressToken = exports.AddressValidationError = void 0;
|
|
4
|
+
const token_1 = require("../token");
|
|
5
|
+
const utils_1 = require("@taquito/utils");
|
|
6
|
+
/**
|
|
7
|
+
* @category Error
|
|
8
|
+
* Error that indicates a failure happening when parsing encoding/executing an Address
|
|
9
|
+
*/
|
|
10
|
+
class AddressValidationError extends token_1.TokenValidationError {
|
|
11
|
+
constructor(value, token, message) {
|
|
12
|
+
super(value, token, message);
|
|
13
|
+
this.value = value;
|
|
14
|
+
this.token = token;
|
|
15
|
+
this.name = 'AddressValidationError';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.AddressValidationError = AddressValidationError;
|
|
19
|
+
class AddressToken extends token_1.ComparableToken {
|
|
20
|
+
constructor(val, idx, fac) {
|
|
21
|
+
super(val, idx, fac);
|
|
22
|
+
this.val = val;
|
|
23
|
+
this.idx = idx;
|
|
24
|
+
this.fac = fac;
|
|
25
|
+
}
|
|
26
|
+
ToBigMapKey(val) {
|
|
27
|
+
const decoded = (0, utils_1.b58DecodeAddress)(val);
|
|
28
|
+
return {
|
|
29
|
+
key: { bytes: decoded },
|
|
30
|
+
type: { prim: 'bytes' },
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @throws {@link AddressValidationError}
|
|
35
|
+
*/
|
|
36
|
+
validate(value) {
|
|
37
|
+
if (typeof value !== 'string') {
|
|
38
|
+
throw new AddressValidationError(value, this, 'Type error');
|
|
39
|
+
}
|
|
40
|
+
if ((0, utils_1.validateAddress)(value) !== utils_1.ValidationResult.VALID) {
|
|
41
|
+
throw new AddressValidationError(value, this, `Address is not valid: ${JSON.stringify(value)}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @throws {@link AddressValidationError}
|
|
46
|
+
*/
|
|
47
|
+
Encode(args) {
|
|
48
|
+
const val = args.pop();
|
|
49
|
+
this.validate(val);
|
|
50
|
+
return { string: val };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @throws {@link AddressValidationError}
|
|
54
|
+
*/
|
|
55
|
+
EncodeObject(val, semantic) {
|
|
56
|
+
this.validate(val);
|
|
57
|
+
if (semantic && semantic[AddressToken.prim]) {
|
|
58
|
+
return semantic[AddressToken.prim](val);
|
|
59
|
+
}
|
|
60
|
+
return { string: val };
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @throws {@link AddressValidationError}
|
|
64
|
+
*/
|
|
65
|
+
Execute(val) {
|
|
66
|
+
if (val.string) {
|
|
67
|
+
return val.string;
|
|
68
|
+
}
|
|
69
|
+
if (!val.bytes) {
|
|
70
|
+
throw new AddressValidationError(val, this, `cannot be missing both string and bytes: ${JSON.stringify(val)}`);
|
|
71
|
+
}
|
|
72
|
+
return (0, utils_1.encodeAddress)(val.bytes);
|
|
73
|
+
}
|
|
74
|
+
generateSchema() {
|
|
75
|
+
return {
|
|
76
|
+
__michelsonType: AddressToken.prim,
|
|
77
|
+
schema: AddressToken.prim,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @throws {@link AddressValidationError}
|
|
82
|
+
*/
|
|
83
|
+
ToKey({ bytes, string }) {
|
|
84
|
+
if (string) {
|
|
85
|
+
return string;
|
|
86
|
+
}
|
|
87
|
+
if (!bytes) {
|
|
88
|
+
throw new AddressValidationError({ bytes, string }, this, `cannot be missing both string and bytes ${JSON.stringify({ string, bytes })}`);
|
|
89
|
+
}
|
|
90
|
+
return (0, utils_1.encodeAddress)(bytes);
|
|
91
|
+
}
|
|
92
|
+
compare(address1, address2) {
|
|
93
|
+
const [addr1, endpoint1] = (0, utils_1.splitAddress)(address1);
|
|
94
|
+
const [addr2, endpoint2] = (0, utils_1.splitAddress)(address2);
|
|
95
|
+
const ep1 = endpoint1 || '';
|
|
96
|
+
const ep2 = endpoint2 || '';
|
|
97
|
+
// binary type tag actually reflects the expected prefix order
|
|
98
|
+
const bytes1 = (0, utils_1.b58DecodeAddress)(addr1, 'array');
|
|
99
|
+
const bytes2 = (0, utils_1.b58DecodeAddress)(addr2, 'array');
|
|
100
|
+
const res = (0, utils_1.compareArrays)(bytes1, bytes2);
|
|
101
|
+
if (res === 0) {
|
|
102
|
+
return ep1 < ep2 ? -1 : ep1 > ep2 ? 1 : 0;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
return res;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
findAndReturnTokens(tokenToFind, tokens) {
|
|
109
|
+
if (AddressToken.prim === tokenToFind) {
|
|
110
|
+
tokens.push(this);
|
|
111
|
+
}
|
|
112
|
+
return tokens;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.AddressToken = AddressToken;
|
|
116
|
+
AddressToken.prim = 'address';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BoolToken = void 0;
|
|
4
|
+
const token_1 = require("../token");
|
|
5
|
+
class BoolToken extends token_1.ComparableToken {
|
|
6
|
+
constructor(val, idx, fac) {
|
|
7
|
+
super(val, idx, fac);
|
|
8
|
+
this.val = val;
|
|
9
|
+
this.idx = idx;
|
|
10
|
+
this.fac = fac;
|
|
11
|
+
}
|
|
12
|
+
Execute(val) {
|
|
13
|
+
return String(val.prim).toLowerCase() === 'true' ? true : false;
|
|
14
|
+
}
|
|
15
|
+
Encode(args) {
|
|
16
|
+
const val = args.pop();
|
|
17
|
+
return { prim: val ? 'True' : 'False' };
|
|
18
|
+
}
|
|
19
|
+
EncodeObject(val, semantic) {
|
|
20
|
+
if (semantic && semantic[BoolToken.prim]) {
|
|
21
|
+
return semantic[BoolToken.prim](val);
|
|
22
|
+
}
|
|
23
|
+
return { prim: val ? 'True' : 'False' };
|
|
24
|
+
}
|
|
25
|
+
generateSchema() {
|
|
26
|
+
return {
|
|
27
|
+
__michelsonType: BoolToken.prim,
|
|
28
|
+
schema: BoolToken.prim,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
ToBigMapKey(val) {
|
|
32
|
+
return {
|
|
33
|
+
key: this.EncodeObject(val),
|
|
34
|
+
type: { prim: BoolToken.prim },
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
ToKey(val) {
|
|
38
|
+
return this.EncodeObject(val);
|
|
39
|
+
}
|
|
40
|
+
compare(val1, val2) {
|
|
41
|
+
if ((val1 && val2) || (!val1 && !val2)) {
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
else if (val1) {
|
|
45
|
+
return 1;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return -1;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
findAndReturnTokens(tokenToFind, tokens) {
|
|
52
|
+
if (BoolToken.prim === tokenToFind) {
|
|
53
|
+
tokens.push(this);
|
|
54
|
+
}
|
|
55
|
+
return tokens;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.BoolToken = BoolToken;
|
|
59
|
+
BoolToken.prim = 'bool';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BytesToken = exports.BytesValidationError = void 0;
|
|
4
|
+
const token_1 = require("../token");
|
|
5
|
+
const utils_1 = require("@taquito/utils");
|
|
6
|
+
/**
|
|
7
|
+
* @category Error
|
|
8
|
+
* Error that indicates a failure happening when parsing encoding/executing Bytes
|
|
9
|
+
*/
|
|
10
|
+
class BytesValidationError extends token_1.TokenValidationError {
|
|
11
|
+
constructor(value, token, message) {
|
|
12
|
+
super(value, token, message);
|
|
13
|
+
this.value = value;
|
|
14
|
+
this.token = token;
|
|
15
|
+
this.name = 'BytesValidationError';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.BytesValidationError = BytesValidationError;
|
|
19
|
+
class BytesToken extends token_1.ComparableToken {
|
|
20
|
+
constructor(val, idx, fac) {
|
|
21
|
+
super(val, idx, fac);
|
|
22
|
+
this.val = val;
|
|
23
|
+
this.idx = idx;
|
|
24
|
+
this.fac = fac;
|
|
25
|
+
}
|
|
26
|
+
ToBigMapKey(val) {
|
|
27
|
+
return {
|
|
28
|
+
key: { bytes: val },
|
|
29
|
+
type: { prim: BytesToken.prim },
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @throws {@link BytesValidationError}
|
|
34
|
+
*/
|
|
35
|
+
validate(val) {
|
|
36
|
+
if (typeof val === 'string' && /^[0-9a-fA-F]*$/.test(val) && val.length % 2 === 0) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
throw new BytesValidationError(val, this, `Invalid bytes: ${val}`);
|
|
40
|
+
}
|
|
41
|
+
convertUint8ArrayToHexString(val) {
|
|
42
|
+
return val.constructor === Uint8Array ? Buffer.from(val).toString('hex') : val;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @throws {@link BytesValidationError}
|
|
46
|
+
*/
|
|
47
|
+
Encode(args) {
|
|
48
|
+
let val = args.pop();
|
|
49
|
+
val = (0, utils_1.stripHexPrefix)(this.convertUint8ArrayToHexString(val));
|
|
50
|
+
this.validate(val);
|
|
51
|
+
return { bytes: String(val).toString() };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @throws {@link BytesValidationError}
|
|
55
|
+
*/
|
|
56
|
+
EncodeObject(val, semantic) {
|
|
57
|
+
val = this.convertUint8ArrayToHexString(val);
|
|
58
|
+
if (typeof val === 'string') {
|
|
59
|
+
val = (0, utils_1.stripHexPrefix)(val);
|
|
60
|
+
}
|
|
61
|
+
this.validate(val);
|
|
62
|
+
if (semantic && semantic[BytesToken.prim]) {
|
|
63
|
+
return semantic[BytesToken.prim](val);
|
|
64
|
+
}
|
|
65
|
+
return { bytes: String(val).toString() };
|
|
66
|
+
}
|
|
67
|
+
Execute(val) {
|
|
68
|
+
return val.bytes;
|
|
69
|
+
}
|
|
70
|
+
generateSchema() {
|
|
71
|
+
return {
|
|
72
|
+
__michelsonType: BytesToken.prim,
|
|
73
|
+
schema: BytesToken.prim,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
ToKey({ bytes, string }) {
|
|
77
|
+
if (string) {
|
|
78
|
+
return string;
|
|
79
|
+
}
|
|
80
|
+
return bytes;
|
|
81
|
+
}
|
|
82
|
+
findAndReturnTokens(tokenToFind, tokens) {
|
|
83
|
+
if (BytesToken.prim === tokenToFind) {
|
|
84
|
+
tokens.push(this);
|
|
85
|
+
}
|
|
86
|
+
return tokens;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.BytesToken = BytesToken;
|
|
90
|
+
BytesToken.prim = 'bytes';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IntToken = exports.IntValidationError = void 0;
|
|
7
|
+
const token_1 = require("../token");
|
|
8
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
9
|
+
/**
|
|
10
|
+
* @category Error
|
|
11
|
+
* Error that indicates a failure happening when parsing encoding/executing Int
|
|
12
|
+
*/
|
|
13
|
+
class IntValidationError extends token_1.TokenValidationError {
|
|
14
|
+
constructor(value, token, message) {
|
|
15
|
+
super(value, token, message);
|
|
16
|
+
this.value = value;
|
|
17
|
+
this.token = token;
|
|
18
|
+
this.name = 'IntValidationError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.IntValidationError = IntValidationError;
|
|
22
|
+
class IntToken extends token_1.ComparableToken {
|
|
23
|
+
constructor(val, idx, fac) {
|
|
24
|
+
super(val, idx, fac);
|
|
25
|
+
this.val = val;
|
|
26
|
+
this.idx = idx;
|
|
27
|
+
this.fac = fac;
|
|
28
|
+
}
|
|
29
|
+
Execute(val) {
|
|
30
|
+
return new bignumber_js_1.default(val[Object.keys(val)[0]]);
|
|
31
|
+
}
|
|
32
|
+
generateSchema() {
|
|
33
|
+
return {
|
|
34
|
+
__michelsonType: IntToken.prim,
|
|
35
|
+
schema: IntToken.prim,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @throws {@link IntValidationError}
|
|
40
|
+
*/
|
|
41
|
+
validate(val) {
|
|
42
|
+
const bigNumber = new bignumber_js_1.default(val);
|
|
43
|
+
if (bigNumber.isNaN()) {
|
|
44
|
+
throw new IntValidationError(val, this, `Value is not a number: ${JSON.stringify(val)}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @throws {@link IntValidationError}
|
|
49
|
+
*/
|
|
50
|
+
Encode(args) {
|
|
51
|
+
const val = args.pop();
|
|
52
|
+
this.validate(val);
|
|
53
|
+
return { int: new bignumber_js_1.default(val).toFixed() };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @throws {@link IntValidationError}
|
|
57
|
+
*/
|
|
58
|
+
EncodeObject(val, semantic) {
|
|
59
|
+
this.validate(val);
|
|
60
|
+
if (semantic && semantic[IntToken.prim]) {
|
|
61
|
+
return semantic[IntToken.prim](val);
|
|
62
|
+
}
|
|
63
|
+
return { int: new bignumber_js_1.default(val).toFixed() };
|
|
64
|
+
}
|
|
65
|
+
ToBigMapKey(val) {
|
|
66
|
+
return {
|
|
67
|
+
key: { int: String(val) },
|
|
68
|
+
type: { prim: IntToken.prim },
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
ToKey({ int }) {
|
|
72
|
+
return int;
|
|
73
|
+
}
|
|
74
|
+
compare(int1, int2) {
|
|
75
|
+
const o1 = Number(int1);
|
|
76
|
+
const o2 = Number(int2);
|
|
77
|
+
if (o1 === o2) {
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
return o1 < o2 ? -1 : 1;
|
|
81
|
+
}
|
|
82
|
+
findAndReturnTokens(tokenToFind, tokens) {
|
|
83
|
+
if (IntToken.prim === tokenToFind) {
|
|
84
|
+
tokens.push(this);
|
|
85
|
+
}
|
|
86
|
+
return tokens;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.IntToken = IntToken;
|
|
90
|
+
IntToken.prim = 'int';
|