@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
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ _Documentation can be found [here](https://taquito.io/docs/walletconnect)_
|
|
|
10
10
|
|
|
11
11
|
`@taquito/wallet-connect` is an npm package that provides developers a way to connect a dapp built with Taquito to a wallet giving the freedom to the users of the dapp to choose the wallet via the WalletConnect/Reown protocol. The `WalletConnect` class implements the `WalletProvider` interface, providing an alternative to `BeaconWallet`.
|
|
12
12
|
Note: Currently, a QR code is displayed to establish a connection with a wallet. As more Tezos wallets integrate with WalletConnect, we plan showing a list of available wallets alongside the QR code.
|
|
13
|
+
Note: The current QR pairing flow still relies on the legacy WalletConnect modal package. We plan to replace that modal integration in a future release.
|
|
13
14
|
|
|
14
15
|
## Install
|
|
15
16
|
|
|
@@ -39,7 +40,7 @@ const wallet = await WalletConnect.init({
|
|
|
39
40
|
|
|
40
41
|
await wallet.requestPermissions({
|
|
41
42
|
permissionScope: {
|
|
42
|
-
networks: [NetworkType.
|
|
43
|
+
networks: [NetworkType.SHADOWNET],
|
|
43
44
|
events: [],
|
|
44
45
|
methods: [
|
|
45
46
|
PermissionScopeMethods.TEZOS_SEND,
|
|
@@ -53,6 +54,8 @@ const Tezos = new TezosToolkit('https://YOUR_PREFERRED_RPC_URL');
|
|
|
53
54
|
Tezos.setWalletProvider(wallet);
|
|
54
55
|
```
|
|
55
56
|
|
|
57
|
+
Existing sessions can be restored with `configureWithExistingSessionKey()`. Restored sessions are validated before activation, so invalid or stale non-Tezos session data may be rejected during restore.
|
|
58
|
+
|
|
56
59
|
## Additional Info
|
|
57
60
|
|
|
58
61
|
See the top-level [https://github.com/ecadlabs/taquito](https://github.com/ecadlabs/taquito) file for details on reporting issues, contributing and versioning.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BATCH_KINDS = void 0;
|
|
4
|
+
const rpc_1 = require("@taquito/rpc");
|
|
5
|
+
exports.BATCH_KINDS = [
|
|
6
|
+
rpc_1.OpKind.ACTIVATION,
|
|
7
|
+
rpc_1.OpKind.ORIGINATION,
|
|
8
|
+
rpc_1.OpKind.TRANSACTION,
|
|
9
|
+
rpc_1.OpKind.DELEGATION,
|
|
10
|
+
rpc_1.OpKind.REGISTER_GLOBAL_CONSTANT,
|
|
11
|
+
rpc_1.OpKind.INCREASE_PAID_STORAGE,
|
|
12
|
+
rpc_1.OpKind.TRANSFER_TICKET,
|
|
13
|
+
rpc_1.OpKind.SMART_ROLLUP_ADD_MESSAGES,
|
|
14
|
+
rpc_1.OpKind.SMART_ROLLUP_ORIGINATE,
|
|
15
|
+
rpc_1.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE,
|
|
16
|
+
];
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RPCBatchProvider = exports.OperationBatch = exports.BATCH_KINDS = void 0;
|
|
4
|
+
const prepare_1 = require("../contract/prepare");
|
|
5
|
+
const batch_operation_1 = require("../operations/batch-operation");
|
|
6
|
+
const rpc_1 = require("@taquito/rpc");
|
|
7
|
+
const utils_1 = require("@taquito/utils");
|
|
8
|
+
const core_1 = require("@taquito/core");
|
|
9
|
+
const provider_1 = require("../provider");
|
|
10
|
+
const prepare_2 = require("../prepare");
|
|
11
|
+
var constants_1 = require("./constants");
|
|
12
|
+
Object.defineProperty(exports, "BATCH_KINDS", { enumerable: true, get: function () { return constants_1.BATCH_KINDS; } });
|
|
13
|
+
class OperationBatch extends provider_1.Provider {
|
|
14
|
+
constructor(context, estimator) {
|
|
15
|
+
super(context);
|
|
16
|
+
this.estimator = estimator;
|
|
17
|
+
this.operations = [];
|
|
18
|
+
this.prepare = new prepare_2.PrepareProvider(this.context);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* Add a transaction operation to the batch
|
|
23
|
+
*
|
|
24
|
+
* @param params Transfer operation parameter
|
|
25
|
+
*/
|
|
26
|
+
withTransfer(params) {
|
|
27
|
+
const toValidation = (0, utils_1.validateAddress)(params.to);
|
|
28
|
+
if (params.amount < 0) {
|
|
29
|
+
throw new core_1.InvalidAmountError(params.amount.toString());
|
|
30
|
+
}
|
|
31
|
+
if (toValidation !== utils_1.ValidationResult.VALID) {
|
|
32
|
+
throw new core_1.InvalidAddressError(params.to, toValidation);
|
|
33
|
+
}
|
|
34
|
+
this.operations.push({ kind: rpc_1.OpKind.TRANSACTION, ...params });
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* Transfer tickets from a Tezos address (tz1,tz2 or tz3) to a smart contract address( KT1)
|
|
40
|
+
*
|
|
41
|
+
* @param params Transfer operation parameter
|
|
42
|
+
*/
|
|
43
|
+
withTransferTicket(params) {
|
|
44
|
+
const destinationValidation = (0, utils_1.validateAddress)(params.destination);
|
|
45
|
+
if (destinationValidation !== utils_1.ValidationResult.VALID) {
|
|
46
|
+
throw new core_1.InvalidAddressError(params.destination, destinationValidation);
|
|
47
|
+
}
|
|
48
|
+
this.operations.push({ kind: rpc_1.OpKind.TRANSFER_TICKET, ...params });
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* Add a contract call to the batch
|
|
54
|
+
*
|
|
55
|
+
* @param params Call a contract method
|
|
56
|
+
* @param options Generic operation parameters
|
|
57
|
+
*/
|
|
58
|
+
withContractCall(params, options = {}) {
|
|
59
|
+
return this.withTransfer(params.toTransferParams(options));
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* Add a delegation operation to the batch
|
|
64
|
+
*
|
|
65
|
+
* @param params Delegation operation parameter
|
|
66
|
+
*/
|
|
67
|
+
withDelegation(params) {
|
|
68
|
+
const sourceValidation = (0, utils_1.validateAddress)(params.source ?? '');
|
|
69
|
+
if (params.source && sourceValidation !== utils_1.ValidationResult.VALID) {
|
|
70
|
+
throw new core_1.InvalidAddressError(params.source, sourceValidation);
|
|
71
|
+
}
|
|
72
|
+
const delegateValidation = (0, utils_1.validateAddress)(params.delegate ?? '');
|
|
73
|
+
if (params.delegate && delegateValidation !== utils_1.ValidationResult.VALID) {
|
|
74
|
+
throw new core_1.InvalidAddressError(params.delegate, delegateValidation);
|
|
75
|
+
}
|
|
76
|
+
this.operations.push({ kind: rpc_1.OpKind.DELEGATION, ...params });
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* Add an activation operation to the batch
|
|
82
|
+
*
|
|
83
|
+
* @param params Activation operation parameter
|
|
84
|
+
* @throws InvalidKeyHashError
|
|
85
|
+
*/
|
|
86
|
+
withActivation({ pkh, secret }) {
|
|
87
|
+
const pkhValidation = (0, utils_1.validateKeyHash)(pkh);
|
|
88
|
+
if (pkhValidation !== utils_1.ValidationResult.VALID) {
|
|
89
|
+
throw new core_1.InvalidKeyHashError(pkh, pkhValidation);
|
|
90
|
+
}
|
|
91
|
+
this.operations.push({ kind: rpc_1.OpKind.ACTIVATION, pkh, secret });
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* Add an origination operation to the batch
|
|
97
|
+
*
|
|
98
|
+
* @param params Origination operation parameter
|
|
99
|
+
*/
|
|
100
|
+
withOrigination(params) {
|
|
101
|
+
this.operations.push({ kind: rpc_1.OpKind.ORIGINATION, ...params });
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
*
|
|
106
|
+
* Add a register a global constant operation to the batch
|
|
107
|
+
*
|
|
108
|
+
* @param params RegisterGlobalConstant operation parameter
|
|
109
|
+
*/
|
|
110
|
+
withRegisterGlobalConstant(params) {
|
|
111
|
+
this.operations.push({ kind: rpc_1.OpKind.REGISTER_GLOBAL_CONSTANT, ...params });
|
|
112
|
+
return this;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
*
|
|
116
|
+
* Add an increase paid storage operation to the batch
|
|
117
|
+
*
|
|
118
|
+
* @param params IncreasePaidStorage operation parameter
|
|
119
|
+
*/
|
|
120
|
+
withIncreasePaidStorage(params) {
|
|
121
|
+
this.operations.push({ kind: rpc_1.OpKind.INCREASE_PAID_STORAGE, ...params });
|
|
122
|
+
return this;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
*
|
|
126
|
+
* Add a update consensus key operation to the batch
|
|
127
|
+
*
|
|
128
|
+
* @param params UpdateConsensusKey operation parameter
|
|
129
|
+
*/
|
|
130
|
+
withUpdateConsensusKey(params) {
|
|
131
|
+
const [, pkPrefix] = (0, utils_1.b58DecodeAndCheckPrefix)(params.pk, utils_1.publicKeyPrefixes);
|
|
132
|
+
if (pkPrefix === utils_1.PrefixV2.BLS12_381PublicKey) {
|
|
133
|
+
if (!params.proof) {
|
|
134
|
+
throw new core_1.InvalidProofError('Proof is required to set a bls account as consensus key ');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
if (params.proof) {
|
|
139
|
+
throw new core_1.ProhibitedActionError('Proof field is only allowed for a bls account as consensus key');
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
this.operations.push({ kind: rpc_1.OpKind.UPDATE_CONSENSUS_KEY, ...params });
|
|
143
|
+
return this;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
*
|
|
147
|
+
* Add a update companion key operation to the batch
|
|
148
|
+
*
|
|
149
|
+
* @param params UpdateCompanionKey operation parameter
|
|
150
|
+
*/
|
|
151
|
+
withUpdateCompanionKey(params) {
|
|
152
|
+
const [, pkPrefix] = (0, utils_1.b58DecodeAndCheckPrefix)(params.pk, utils_1.publicKeyPrefixes);
|
|
153
|
+
if (pkPrefix !== utils_1.PrefixV2.BLS12_381PublicKey) {
|
|
154
|
+
throw new core_1.ProhibitedActionError('companion key must be a bls account');
|
|
155
|
+
}
|
|
156
|
+
if (!params.proof) {
|
|
157
|
+
throw new core_1.InvalidProofError('Proof is required to set a bls account as companion key ');
|
|
158
|
+
}
|
|
159
|
+
this.operations.push({ kind: rpc_1.OpKind.UPDATE_COMPANION_KEY, ...params });
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
* Add a smart rollup add messages operation to the batch
|
|
165
|
+
*
|
|
166
|
+
* @param params Rollup origination operation parameter
|
|
167
|
+
*/
|
|
168
|
+
withSmartRollupAddMessages(params) {
|
|
169
|
+
this.operations.push({ kind: rpc_1.OpKind.SMART_ROLLUP_ADD_MESSAGES, ...params });
|
|
170
|
+
return this;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
*
|
|
174
|
+
* Add a smart rollup originate operation to the batch
|
|
175
|
+
*
|
|
176
|
+
* @param params Smart Rollup Originate operation parameter
|
|
177
|
+
*/
|
|
178
|
+
withSmartRollupOriginate(params) {
|
|
179
|
+
this.operations.push({ kind: rpc_1.OpKind.SMART_ROLLUP_ORIGINATE, ...params });
|
|
180
|
+
return this;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
*
|
|
184
|
+
* Add a smart rollup execute outbox message to the batch
|
|
185
|
+
*
|
|
186
|
+
* @param params Smart Rollup Execute Outbox Message operation parameter
|
|
187
|
+
*/
|
|
188
|
+
withSmartRollupExecuteOutboxMessage(params) {
|
|
189
|
+
this.operations.push({ kind: rpc_1.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE, ...params });
|
|
190
|
+
return this;
|
|
191
|
+
}
|
|
192
|
+
async getRPCOp(param) {
|
|
193
|
+
switch (param.kind) {
|
|
194
|
+
case rpc_1.OpKind.TRANSACTION:
|
|
195
|
+
return (0, prepare_1.createTransferOperation)({
|
|
196
|
+
...param,
|
|
197
|
+
});
|
|
198
|
+
case rpc_1.OpKind.ORIGINATION:
|
|
199
|
+
return (0, prepare_1.createOriginationOperation)(await this.context.parser.prepareCodeOrigination({
|
|
200
|
+
...param,
|
|
201
|
+
}));
|
|
202
|
+
case rpc_1.OpKind.DELEGATION:
|
|
203
|
+
return (0, prepare_1.createSetDelegateOperation)({
|
|
204
|
+
...param,
|
|
205
|
+
});
|
|
206
|
+
case rpc_1.OpKind.REGISTER_GLOBAL_CONSTANT:
|
|
207
|
+
return (0, prepare_1.createRegisterGlobalConstantOperation)({
|
|
208
|
+
...param,
|
|
209
|
+
});
|
|
210
|
+
case rpc_1.OpKind.INCREASE_PAID_STORAGE:
|
|
211
|
+
return (0, prepare_1.createIncreasePaidStorageOperation)({
|
|
212
|
+
...param,
|
|
213
|
+
});
|
|
214
|
+
case rpc_1.OpKind.UPDATE_CONSENSUS_KEY:
|
|
215
|
+
return (0, prepare_1.createUpdateConsensusKeyOperation)({
|
|
216
|
+
...param,
|
|
217
|
+
});
|
|
218
|
+
case rpc_1.OpKind.UPDATE_COMPANION_KEY:
|
|
219
|
+
return (0, prepare_1.createUpdateCompanionKeyOperation)({
|
|
220
|
+
...param,
|
|
221
|
+
});
|
|
222
|
+
case rpc_1.OpKind.TRANSFER_TICKET:
|
|
223
|
+
return (0, prepare_1.createTransferTicketOperation)({
|
|
224
|
+
...param,
|
|
225
|
+
});
|
|
226
|
+
case rpc_1.OpKind.SMART_ROLLUP_ADD_MESSAGES:
|
|
227
|
+
return (0, prepare_1.createSmartRollupAddMessagesOperation)({
|
|
228
|
+
...param,
|
|
229
|
+
});
|
|
230
|
+
case rpc_1.OpKind.SMART_ROLLUP_ORIGINATE:
|
|
231
|
+
return (0, prepare_1.createSmartRollupOriginateOperation)({
|
|
232
|
+
...param,
|
|
233
|
+
});
|
|
234
|
+
case rpc_1.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:
|
|
235
|
+
return (0, prepare_1.createSmartRollupExecuteOutboxMessageOperation)({
|
|
236
|
+
...param,
|
|
237
|
+
});
|
|
238
|
+
default:
|
|
239
|
+
throw new core_1.InvalidOperationKindError(JSON.stringify(param.kind));
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
*
|
|
244
|
+
* Add a group operation to the batch. Operation will be applied in the order they are in the params array
|
|
245
|
+
*
|
|
246
|
+
* @param params Operations parameter
|
|
247
|
+
* @throws InvalidOperationKindError
|
|
248
|
+
*/
|
|
249
|
+
with(params) {
|
|
250
|
+
for (const param of params) {
|
|
251
|
+
switch (param.kind) {
|
|
252
|
+
case rpc_1.OpKind.TRANSACTION:
|
|
253
|
+
this.withTransfer(param);
|
|
254
|
+
break;
|
|
255
|
+
case rpc_1.OpKind.ORIGINATION:
|
|
256
|
+
this.withOrigination(param);
|
|
257
|
+
break;
|
|
258
|
+
case rpc_1.OpKind.DELEGATION:
|
|
259
|
+
this.withDelegation(param);
|
|
260
|
+
break;
|
|
261
|
+
case rpc_1.OpKind.ACTIVATION:
|
|
262
|
+
this.withActivation(param);
|
|
263
|
+
break;
|
|
264
|
+
case rpc_1.OpKind.REGISTER_GLOBAL_CONSTANT:
|
|
265
|
+
this.withRegisterGlobalConstant(param);
|
|
266
|
+
break;
|
|
267
|
+
case rpc_1.OpKind.INCREASE_PAID_STORAGE:
|
|
268
|
+
this.withIncreasePaidStorage(param);
|
|
269
|
+
break;
|
|
270
|
+
case rpc_1.OpKind.TRANSFER_TICKET:
|
|
271
|
+
this.withTransferTicket(param);
|
|
272
|
+
break;
|
|
273
|
+
case rpc_1.OpKind.SMART_ROLLUP_ADD_MESSAGES:
|
|
274
|
+
this.withSmartRollupAddMessages(param);
|
|
275
|
+
break;
|
|
276
|
+
case rpc_1.OpKind.SMART_ROLLUP_ORIGINATE:
|
|
277
|
+
this.withSmartRollupOriginate(param);
|
|
278
|
+
break;
|
|
279
|
+
case rpc_1.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:
|
|
280
|
+
this.withSmartRollupExecuteOutboxMessage(param);
|
|
281
|
+
break;
|
|
282
|
+
default:
|
|
283
|
+
throw new core_1.InvalidOperationKindError(JSON.stringify(param.kind));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return this;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
*
|
|
290
|
+
* Forge and Inject the operation batch
|
|
291
|
+
*
|
|
292
|
+
* @param params Optionally specify the source of the operation
|
|
293
|
+
*/
|
|
294
|
+
async send(params) {
|
|
295
|
+
const publicKeyHash = await this.signer.publicKeyHash();
|
|
296
|
+
const source = (params && params.source) || publicKeyHash;
|
|
297
|
+
const estimates = await this.estimator.batch(this.operations);
|
|
298
|
+
if (estimates.length !== this.operations.length) {
|
|
299
|
+
estimates.shift();
|
|
300
|
+
}
|
|
301
|
+
const preparedOp = await this.prepare.batch(this.operations, estimates);
|
|
302
|
+
const opBytes = await this.forge(preparedOp);
|
|
303
|
+
const { hash, context, forgedBytes, opResponse } = await this.signAndInject(opBytes);
|
|
304
|
+
return new batch_operation_1.BatchOperation(hash, preparedOp.opOb.contents, source, forgedBytes, opResponse, context);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
exports.OperationBatch = OperationBatch;
|
|
308
|
+
class RPCBatchProvider {
|
|
309
|
+
constructor(context, estimator) {
|
|
310
|
+
this.context = context;
|
|
311
|
+
this.estimator = estimator;
|
|
312
|
+
}
|
|
313
|
+
/***
|
|
314
|
+
*
|
|
315
|
+
* Batch a group of operation together. Operations will be applied in the order in which they are added to the batch
|
|
316
|
+
*
|
|
317
|
+
* @param params List of operation to batch together
|
|
318
|
+
*/
|
|
319
|
+
batch(params) {
|
|
320
|
+
const batch = new OperationBatch(this.context, this.estimator);
|
|
321
|
+
if (Array.isArray(params)) {
|
|
322
|
+
batch.with(params);
|
|
323
|
+
}
|
|
324
|
+
return batch;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
exports.RPCBatchProvider = RPCBatchProvider;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRevealFeeInternal = exports.getRevealFee = exports.getRevealGasLimit = exports.ChainIds = exports.protocols = exports.Protocols = exports.COST_PER_BYTE = exports.ORIGINATION_SIZE = exports.REVEAL_STORAGE_LIMIT = void 0;
|
|
4
|
+
// value is based on octez-client reveal operation gasLimit of each address type in Tallinn Protocol
|
|
5
|
+
const REVEAL_GAS_LIMIT = {
|
|
6
|
+
TZ1: 171,
|
|
7
|
+
TZ2: 157,
|
|
8
|
+
TZ3: 447,
|
|
9
|
+
TZ4: 3252,
|
|
10
|
+
};
|
|
11
|
+
// value is based on octez-client reveal operation fee of each address type in Tallinn Protocol
|
|
12
|
+
const REVEAL_FEE = {
|
|
13
|
+
TZ1: 278,
|
|
14
|
+
TZ2: 277,
|
|
15
|
+
TZ3: 306,
|
|
16
|
+
TZ4: 736,
|
|
17
|
+
};
|
|
18
|
+
// value is based on octez-client reveal operation storageLimit of all address type in Tallinn Protocol
|
|
19
|
+
exports.REVEAL_STORAGE_LIMIT = 0;
|
|
20
|
+
// protocol constants in Tallinn Protocol
|
|
21
|
+
// NOTE: When updating constants here, also check:
|
|
22
|
+
// website/src/config/tezos-constants.mjs (documentation constants, versioned by doc version)
|
|
23
|
+
exports.ORIGINATION_SIZE = 257;
|
|
24
|
+
// protocol constants in Tallinn Protocol
|
|
25
|
+
exports.COST_PER_BYTE = 250;
|
|
26
|
+
var Protocols;
|
|
27
|
+
(function (Protocols) {
|
|
28
|
+
Protocols["Pt24m4xi"] = "Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd";
|
|
29
|
+
Protocols["PsBABY5H"] = "PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU";
|
|
30
|
+
Protocols["PsBabyM1"] = "PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS";
|
|
31
|
+
Protocols["PsCARTHA"] = "PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb";
|
|
32
|
+
Protocols["PsDELPH1"] = "PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo";
|
|
33
|
+
Protocols["PtEdo2Zk"] = "PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA";
|
|
34
|
+
Protocols["PsFLorena"] = "PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i";
|
|
35
|
+
Protocols["PtGRANADs"] = "PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV";
|
|
36
|
+
Protocols["PtHangz2"] = "PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx";
|
|
37
|
+
Protocols["PsiThaCa"] = "PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP";
|
|
38
|
+
Protocols["Psithaca2"] = "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A";
|
|
39
|
+
Protocols["PtJakart2"] = "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY";
|
|
40
|
+
Protocols["PtKathman"] = "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg";
|
|
41
|
+
Protocols["PtLimaPtL"] = "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW";
|
|
42
|
+
Protocols["PtMumbaii"] = "PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc";
|
|
43
|
+
Protocols["PtMumbai2"] = "PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1";
|
|
44
|
+
Protocols["PtNairobi"] = "PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf";
|
|
45
|
+
Protocols["ProxfordY"] = "ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH";
|
|
46
|
+
Protocols["PtParisBx"] = "PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ";
|
|
47
|
+
Protocols["PsParisCZ"] = "PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi";
|
|
48
|
+
Protocols["PsQuebecn"] = "PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg";
|
|
49
|
+
Protocols["PsRiotuma"] = "PsRiotumaAMotcRoDWW1bysEhQy2n1M5fy8JgRp8jjRfHGmfeA7";
|
|
50
|
+
Protocols["PtSeouLou"] = "PtSeouLouXkxhg39oWzjxDWaCydNfR3RxCUrNe4Q9Ro8BTehcbh";
|
|
51
|
+
Protocols["PtTALLiNt"] = "PtTALLiNtPec7mE7yY4m3k26J8Qukef3E3ehzhfXgFZKGtDdAXu";
|
|
52
|
+
Protocols["ProtoALpha"] = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK";
|
|
53
|
+
})(Protocols || (exports.Protocols = Protocols = {}));
|
|
54
|
+
exports.protocols = {
|
|
55
|
+
'004': [Protocols.Pt24m4xi],
|
|
56
|
+
'005': [Protocols.PsBABY5H, Protocols.PsBabyM1],
|
|
57
|
+
'006': [Protocols.PsCARTHA],
|
|
58
|
+
'007': [Protocols.PsDELPH1],
|
|
59
|
+
'008': [Protocols.PtEdo2Zk], // edonet v2
|
|
60
|
+
'009': [Protocols.PsFLorena],
|
|
61
|
+
'010': [Protocols.PtGRANADs],
|
|
62
|
+
'011': [Protocols.PtHangz2], // hangzhou v2,
|
|
63
|
+
'012': [Protocols.PsiThaCa, Protocols.Psithaca2],
|
|
64
|
+
'013': [Protocols.PtJakart2],
|
|
65
|
+
'014': [Protocols.PtKathman],
|
|
66
|
+
'015': [Protocols.PtLimaPtL],
|
|
67
|
+
'016': [Protocols.PtMumbai2], // mumbai v2
|
|
68
|
+
'017': [Protocols.PtNairobi],
|
|
69
|
+
'019': [Protocols.ProxfordY],
|
|
70
|
+
'020': [Protocols.PtParisBx, Protocols.PsParisCZ],
|
|
71
|
+
'021': [Protocols.PsQuebecn],
|
|
72
|
+
'022': [Protocols.PsRiotuma],
|
|
73
|
+
'023': [Protocols.PtSeouLou],
|
|
74
|
+
'024': [Protocols.PtTALLiNt],
|
|
75
|
+
'025': [Protocols.ProtoALpha],
|
|
76
|
+
};
|
|
77
|
+
var ChainIds;
|
|
78
|
+
(function (ChainIds) {
|
|
79
|
+
ChainIds["MAINNET"] = "NetXdQprcVkpaWU";
|
|
80
|
+
ChainIds["GHOSTNET"] = "NetXnHfVqm9iesp";
|
|
81
|
+
ChainIds["SHADOWNET"] = "NetXsqzbfFenSTS";
|
|
82
|
+
ChainIds["CARTHAGENET"] = "NetXjD3HPJJjmcd";
|
|
83
|
+
ChainIds["DELPHINET"] = "NetXm8tYqnMWky1";
|
|
84
|
+
ChainIds["EDONET"] = "NetXSgo1ZT2DRUG";
|
|
85
|
+
ChainIds["FLORENCENET"] = "NetXxkAx4woPLyu";
|
|
86
|
+
ChainIds["GRANADANET"] = "NetXz969SFaFn8k";
|
|
87
|
+
ChainIds["HANGZHOUNET"] = "NetXZSsxBpMQeAT";
|
|
88
|
+
ChainIds["ITHACANET"] = "NetXbhmtAbMukLc";
|
|
89
|
+
ChainIds["JAKARTANET2"] = "NetXLH1uAxK7CCh";
|
|
90
|
+
ChainIds["KATHMANDUNET"] = "NetXazhm4yetmff";
|
|
91
|
+
ChainIds["LIMANET"] = "NetXizpkH94bocH";
|
|
92
|
+
ChainIds["MUMBAINET"] = "NetXQw6nWSnrJ5t";
|
|
93
|
+
ChainIds["MUMBAINET2"] = "NetXgbcrNtXD2yA";
|
|
94
|
+
ChainIds["NAIROBINET"] = "NetXyuzvDo2Ugzb";
|
|
95
|
+
ChainIds["OXFORDNET2"] = "NetXxWsskGahzQB";
|
|
96
|
+
ChainIds["PARISBNET"] = "NetXo8SqH1c38SS";
|
|
97
|
+
ChainIds["PARISCNET"] = "NetXXWAHLEvre9b";
|
|
98
|
+
ChainIds["QUEBECNET"] = "NetXuTeGinLEqxp";
|
|
99
|
+
ChainIds["RIONET"] = "NetXPdgaoabtBth";
|
|
100
|
+
ChainIds["SEOULNET"] = "NetXd56aBs1aeW3";
|
|
101
|
+
ChainIds["TALLINNNET"] = "NetXe8DbhW9A1eS";
|
|
102
|
+
})(ChainIds || (exports.ChainIds = ChainIds = {}));
|
|
103
|
+
const getRevealGasLimit = (address) => Math.round((getRevealGasLimitInternal(address) * 37) / 10);
|
|
104
|
+
exports.getRevealGasLimit = getRevealGasLimit;
|
|
105
|
+
const getRevealGasLimitInternal = (address) => {
|
|
106
|
+
switch (address.substring(0, 3)) {
|
|
107
|
+
case 'tz1':
|
|
108
|
+
return REVEAL_GAS_LIMIT.TZ1;
|
|
109
|
+
case 'tz2':
|
|
110
|
+
return REVEAL_GAS_LIMIT.TZ2;
|
|
111
|
+
case 'tz3':
|
|
112
|
+
return REVEAL_GAS_LIMIT.TZ3;
|
|
113
|
+
case 'tz4':
|
|
114
|
+
return REVEAL_GAS_LIMIT.TZ4;
|
|
115
|
+
default:
|
|
116
|
+
throw new Error(`Cannot estimate reveal gas limit for ${address}`);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const getRevealFee = (address) => Math.round(((0, exports.getRevealFeeInternal)(address) * 12) / 10);
|
|
120
|
+
exports.getRevealFee = getRevealFee;
|
|
121
|
+
const getRevealFeeInternal = (address) => {
|
|
122
|
+
switch (address.substring(0, 3)) {
|
|
123
|
+
case 'tz1':
|
|
124
|
+
return REVEAL_FEE.TZ1;
|
|
125
|
+
case 'tz2':
|
|
126
|
+
return REVEAL_FEE.TZ2;
|
|
127
|
+
case 'tz3':
|
|
128
|
+
return REVEAL_FEE.TZ3;
|
|
129
|
+
case 'tz4':
|
|
130
|
+
return REVEAL_FEE.TZ4 * 1.7;
|
|
131
|
+
default:
|
|
132
|
+
throw new Error(`Cannot estimate reveal fee for ${address}`);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
exports.getRevealFeeInternal = getRevealFeeInternal;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Context = exports.defaultConfigConfirmation = void 0;
|
|
4
|
+
const rpc_1 = require("@taquito/rpc");
|
|
5
|
+
const rpc_injector_1 = require("./injector/rpc-injector");
|
|
6
|
+
const noop_1 = require("./signer/noop");
|
|
7
|
+
const operation_factory_1 = require("./wallet/operation-factory");
|
|
8
|
+
const rpc_tz_provider_1 = require("./tz/rpc-tz-provider");
|
|
9
|
+
const rpc_estimate_provider_1 = require("./estimate/rpc-estimate-provider");
|
|
10
|
+
const rpc_contract_provider_1 = require("./contract/rpc-contract-provider");
|
|
11
|
+
const rpc_batch_provider_1 = require("./batch/rpc-batch-provider");
|
|
12
|
+
const wallet_1 = require("./wallet");
|
|
13
|
+
const michel_codec_parser_1 = require("./parser/michel-codec-parser");
|
|
14
|
+
const rpc_packer_1 = require("./packer/rpc-packer");
|
|
15
|
+
const rxjs_1 = require("rxjs");
|
|
16
|
+
const noop_global_constants_provider_1 = require("./global-constants/noop-global-constants-provider");
|
|
17
|
+
const rpc_read_adapter_1 = require("./read-provider/rpc-read-adapter");
|
|
18
|
+
const polling_subcribe_provider_1 = require("./subscribe/polling-subcribe-provider");
|
|
19
|
+
const taquito_local_forger_1 = require("./forger/taquito-local-forger");
|
|
20
|
+
const prepare_provider_1 = require("./prepare/prepare-provider");
|
|
21
|
+
exports.defaultConfigConfirmation = {
|
|
22
|
+
defaultConfirmationCount: 1,
|
|
23
|
+
confirmationPollingTimeoutSecond: 180,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Encapsulate common service used throughout different part of the library
|
|
27
|
+
*/
|
|
28
|
+
class Context {
|
|
29
|
+
constructor(_rpc, _signer = new noop_1.NoopSigner(), _proto, _config = new rxjs_1.BehaviorSubject({
|
|
30
|
+
...exports.defaultConfigConfirmation,
|
|
31
|
+
}), forger, injector, packer, wallet, parser, globalConstantsProvider, readProvider, stream) {
|
|
32
|
+
this._rpc = _rpc;
|
|
33
|
+
this._signer = _signer;
|
|
34
|
+
this._proto = _proto;
|
|
35
|
+
this._config = _config;
|
|
36
|
+
this.providerDecorator = [];
|
|
37
|
+
this.tz = new rpc_tz_provider_1.RpcTzProvider(this);
|
|
38
|
+
this.estimate = new rpc_estimate_provider_1.RPCEstimateProvider(this);
|
|
39
|
+
this.contract = new rpc_contract_provider_1.RpcContractProvider(this, this.estimate);
|
|
40
|
+
this.prepare = new prepare_provider_1.PrepareProvider(this);
|
|
41
|
+
this.batch = new rpc_batch_provider_1.RPCBatchProvider(this, this.estimate);
|
|
42
|
+
this.wallet = new wallet_1.Wallet(this);
|
|
43
|
+
/**
|
|
44
|
+
* Applies the decorators on a cloned instance of the context and returned this cloned instance.
|
|
45
|
+
* The decorators are functions that inject logic into the context.
|
|
46
|
+
* They are provided by the extensions set on the TezosToolkit by calling the registerProviderDecorator method.
|
|
47
|
+
*/
|
|
48
|
+
this.withExtensions = () => {
|
|
49
|
+
let clonedContext = this.clone();
|
|
50
|
+
this.providerDecorator.forEach((decorator) => {
|
|
51
|
+
clonedContext = decorator(clonedContext);
|
|
52
|
+
});
|
|
53
|
+
return clonedContext;
|
|
54
|
+
};
|
|
55
|
+
if (typeof this._rpc === 'string') {
|
|
56
|
+
this._rpcClient = new rpc_1.RpcClient(this._rpc);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this._rpcClient = this._rpc;
|
|
60
|
+
}
|
|
61
|
+
this._forger = forger ? forger : new taquito_local_forger_1.TaquitoLocalForger(this);
|
|
62
|
+
this._injector = injector ? injector : new rpc_injector_1.RpcInjector(this);
|
|
63
|
+
this.operationFactory = new operation_factory_1.OperationFactory(this);
|
|
64
|
+
this._walletProvider = wallet ? wallet : new wallet_1.LegacyWalletProvider(this);
|
|
65
|
+
this._parser = parser ? parser : new michel_codec_parser_1.MichelCodecParser(this);
|
|
66
|
+
this._packer = packer ? packer : new rpc_packer_1.RpcPacker(this);
|
|
67
|
+
this._globalConstantsProvider = globalConstantsProvider
|
|
68
|
+
? globalConstantsProvider
|
|
69
|
+
: new noop_global_constants_provider_1.NoopGlobalConstantsProvider();
|
|
70
|
+
this._readProvider = readProvider ? readProvider : new rpc_read_adapter_1.RpcReadAdapter(this._rpcClient);
|
|
71
|
+
this._stream = stream ? stream : new polling_subcribe_provider_1.PollingSubscribeProvider(this);
|
|
72
|
+
}
|
|
73
|
+
get config() {
|
|
74
|
+
return this._config.getValue();
|
|
75
|
+
}
|
|
76
|
+
set config(value) {
|
|
77
|
+
this._config.next({
|
|
78
|
+
...value,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
setPartialConfig(value) {
|
|
82
|
+
this._config.next({
|
|
83
|
+
...this._config.getValue(),
|
|
84
|
+
...value,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
get rpc() {
|
|
88
|
+
return this._rpcClient;
|
|
89
|
+
}
|
|
90
|
+
set rpc(value) {
|
|
91
|
+
this._rpcClient = value;
|
|
92
|
+
}
|
|
93
|
+
get injector() {
|
|
94
|
+
return this._injector;
|
|
95
|
+
}
|
|
96
|
+
set injector(value) {
|
|
97
|
+
this._injector = value;
|
|
98
|
+
}
|
|
99
|
+
get forger() {
|
|
100
|
+
return this._forger;
|
|
101
|
+
}
|
|
102
|
+
set forger(value) {
|
|
103
|
+
this._forger = value;
|
|
104
|
+
}
|
|
105
|
+
get signer() {
|
|
106
|
+
return this._signer;
|
|
107
|
+
}
|
|
108
|
+
set signer(value) {
|
|
109
|
+
this._signer = value;
|
|
110
|
+
}
|
|
111
|
+
get walletProvider() {
|
|
112
|
+
return this._walletProvider;
|
|
113
|
+
}
|
|
114
|
+
set walletProvider(value) {
|
|
115
|
+
this._walletProvider = value;
|
|
116
|
+
}
|
|
117
|
+
set proto(value) {
|
|
118
|
+
this._proto = value;
|
|
119
|
+
}
|
|
120
|
+
get proto() {
|
|
121
|
+
return this._proto;
|
|
122
|
+
}
|
|
123
|
+
get parser() {
|
|
124
|
+
return this._parser;
|
|
125
|
+
}
|
|
126
|
+
set parser(value) {
|
|
127
|
+
this._parser = value;
|
|
128
|
+
}
|
|
129
|
+
get packer() {
|
|
130
|
+
return this._packer;
|
|
131
|
+
}
|
|
132
|
+
set packer(value) {
|
|
133
|
+
this._packer = value;
|
|
134
|
+
}
|
|
135
|
+
get globalConstantsProvider() {
|
|
136
|
+
return this._globalConstantsProvider;
|
|
137
|
+
}
|
|
138
|
+
set globalConstantsProvider(value) {
|
|
139
|
+
this._globalConstantsProvider = value;
|
|
140
|
+
}
|
|
141
|
+
get readProvider() {
|
|
142
|
+
return this._readProvider;
|
|
143
|
+
}
|
|
144
|
+
set readProvider(value) {
|
|
145
|
+
this._readProvider = value;
|
|
146
|
+
}
|
|
147
|
+
get stream() {
|
|
148
|
+
return this._stream;
|
|
149
|
+
}
|
|
150
|
+
set stream(value) {
|
|
151
|
+
this._stream = value;
|
|
152
|
+
}
|
|
153
|
+
async isAnyProtocolActive(protocol = []) {
|
|
154
|
+
if (this._proto) {
|
|
155
|
+
return protocol.includes(this._proto);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
const next_protocol = await this.readProvider.getNextProtocol('head');
|
|
159
|
+
return protocol.includes(next_protocol);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
isAnySignerConfigured() {
|
|
163
|
+
return !(this.signer instanceof noop_1.NoopSigner);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Create a copy of the current context. Useful when you have long running operation and you do not want a context change to affect the operation
|
|
167
|
+
*/
|
|
168
|
+
clone() {
|
|
169
|
+
return new Context(this.rpc, this.signer, this.proto, this._config, this.forger, this._injector, this.packer, this._walletProvider, this._parser, this._globalConstantsProvider, this._readProvider, this._stream);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Allows extensions set on the TezosToolkit to inject logic into the context
|
|
173
|
+
*/
|
|
174
|
+
registerProviderDecorator(fx) {
|
|
175
|
+
this.providerDecorator.push(fx);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
exports.Context = Context;
|