@taquito/wallet-connect 24.3.0-beta.2 → 24.3.0-beta.3
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/dist/lib/{taquito-wallet-connect/src/taquito-wallet-connect.js → taquito-wallet-connect.js} +1 -4
- package/dist/lib/{taquito-http-utils/src/version.js → version.js} +2 -2
- package/package.json +5 -7
- package/dist/lib/taquito/src/batch/constants.js +0 -16
- package/dist/lib/taquito/src/batch/rpc-batch-provider.js +0 -327
- package/dist/lib/taquito/src/constants.js +0 -135
- package/dist/lib/taquito/src/context.js +0 -178
- package/dist/lib/taquito/src/contract/big-map.js +0 -57
- package/dist/lib/taquito/src/contract/compose.js +0 -6
- package/dist/lib/taquito/src/contract/constants.js +0 -4
- package/dist/lib/taquito/src/contract/contract-methods/contract-method-factory.js +0 -18
- package/dist/lib/taquito/src/contract/contract-methods/contract-method-interface.js +0 -2
- package/dist/lib/taquito/src/contract/contract-methods/contract-method-object-param.js +0 -72
- package/dist/lib/taquito/src/contract/contract-methods/contract-on-chain-view.js +0 -111
- package/dist/lib/taquito/src/contract/contract.js +0 -158
- package/dist/lib/taquito/src/contract/errors.js +0 -140
- package/dist/lib/taquito/src/contract/index.js +0 -30
- package/dist/lib/taquito/src/contract/interface.js +0 -2
- package/dist/lib/taquito/src/contract/manager-lambda.js +0 -71
- package/dist/lib/taquito/src/contract/prepare.js +0 -231
- package/dist/lib/taquito/src/contract/rpc-contract-provider.js +0 -675
- package/dist/lib/taquito/src/contract/sapling-state-abstraction.js +0 -24
- package/dist/lib/taquito/src/contract/semantic.js +0 -43
- package/dist/lib/taquito/src/contract/view_lambda.js +0 -27
- package/dist/lib/taquito/src/errors.js +0 -42
- package/dist/lib/taquito/src/estimate/errors.js +0 -16
- package/dist/lib/taquito/src/estimate/estimate-provider-interface.js +0 -2
- package/dist/lib/taquito/src/estimate/estimate.js +0 -176
- package/dist/lib/taquito/src/estimate/index.js +0 -20
- package/dist/lib/taquito/src/estimate/rpc-estimate-provider.js +0 -640
- package/dist/lib/taquito/src/extension/extension.js +0 -2
- package/dist/lib/taquito/src/forger/composite-forger.js +0 -32
- package/dist/lib/taquito/src/forger/errors.js +0 -30
- package/dist/lib/taquito/src/forger/rpc-forger.js +0 -12
- package/dist/lib/taquito/src/forger/taquito-local-forger.js +0 -21
- package/dist/lib/taquito/src/global-constants/default-global-constants-provider.js +0 -35
- package/dist/lib/taquito/src/global-constants/errors.js +0 -30
- package/dist/lib/taquito/src/global-constants/interface-global-constants-provider.js +0 -2
- package/dist/lib/taquito/src/global-constants/noop-global-constants-provider.js +0 -10
- package/dist/lib/taquito/src/import-key.js +0 -40
- package/dist/lib/taquito/src/injector/helper.js +0 -18
- package/dist/lib/taquito/src/injector/interface.js +0 -2
- package/dist/lib/taquito/src/injector/rpc-injector.js +0 -27
- package/dist/lib/taquito/src/operations/ballot-operation.js +0 -32
- package/dist/lib/taquito/src/operations/batch-operation.js +0 -69
- package/dist/lib/taquito/src/operations/delegate-operation.js +0 -54
- package/dist/lib/taquito/src/operations/drain-delegate-operation.js +0 -31
- package/dist/lib/taquito/src/operations/errors.js +0 -133
- package/dist/lib/taquito/src/operations/failing-noop-operation.js +0 -2
- package/dist/lib/taquito/src/operations/increase-paid-storage-operation.js +0 -49
- package/dist/lib/taquito/src/operations/index.js +0 -54
- package/dist/lib/taquito/src/operations/operations.js +0 -193
- package/dist/lib/taquito/src/operations/origination-operation.js +0 -78
- package/dist/lib/taquito/src/operations/proposals-operation.js +0 -29
- package/dist/lib/taquito/src/operations/register-global-constant-operation.js +0 -52
- package/dist/lib/taquito/src/operations/reveal-operation.js +0 -74
- package/dist/lib/taquito/src/operations/smart-rollup-add-messages-operation.js +0 -44
- package/dist/lib/taquito/src/operations/smart-rollup-execute-outbox-message-operation.js +0 -53
- package/dist/lib/taquito/src/operations/smart-rollup-originate-operation.js +0 -50
- package/dist/lib/taquito/src/operations/transaction-operation.js +0 -73
- package/dist/lib/taquito/src/operations/transfer-ticket-operation.js +0 -47
- package/dist/lib/taquito/src/operations/types.js +0 -88
- package/dist/lib/taquito/src/operations/update-companion-key-operation.js +0 -55
- package/dist/lib/taquito/src/operations/update-consensus-key-operation.js +0 -55
- package/dist/lib/taquito/src/packer/interface.js +0 -2
- package/dist/lib/taquito/src/packer/michel-codec-packer.js +0 -11
- package/dist/lib/taquito/src/packer/rpc-packer.js +0 -12
- package/dist/lib/taquito/src/parser/interface.js +0 -2
- package/dist/lib/taquito/src/parser/michel-codec-parser.js +0 -110
- package/dist/lib/taquito/src/parser/noop-parser.js +0 -9
- package/dist/lib/taquito/src/prepare/index.js +0 -18
- package/dist/lib/taquito/src/prepare/interface.js +0 -2
- package/dist/lib/taquito/src/prepare/prepare-provider.js +0 -1049
- package/dist/lib/taquito/src/provider.js +0 -363
- package/dist/lib/taquito/src/read-provider/interface.js +0 -2
- package/dist/lib/taquito/src/read-provider/rpc-read-adapter.js +0 -183
- package/dist/lib/taquito/src/signer/errors.js +0 -17
- package/dist/lib/taquito/src/signer/noop.js +0 -23
- package/dist/lib/taquito/src/subscribe/create-observable-from-subscription.js +0 -20
- package/dist/lib/taquito/src/subscribe/errors.js +0 -30
- package/dist/lib/taquito/src/subscribe/filters.js +0 -96
- package/dist/lib/taquito/src/subscribe/interface.js +0 -2
- package/dist/lib/taquito/src/subscribe/observable-subscription.js +0 -79
- package/dist/lib/taquito/src/subscribe/polling-subcribe-provider.js +0 -118
- package/dist/lib/taquito/src/taquito.js +0 -404
- package/dist/lib/taquito/src/tz/interface.js +0 -2
- package/dist/lib/taquito/src/tz/rpc-tz-provider.js +0 -46
- package/dist/lib/taquito/src/version.js +0 -8
- package/dist/lib/taquito/src/wallet/batch-operation.js +0 -71
- package/dist/lib/taquito/src/wallet/delegation-operation.js +0 -42
- package/dist/lib/taquito/src/wallet/errors.js +0 -40
- package/dist/lib/taquito/src/wallet/increase-paid-storage-operation.js +0 -42
- package/dist/lib/taquito/src/wallet/index.js +0 -25
- package/dist/lib/taquito/src/wallet/interface.js +0 -2
- package/dist/lib/taquito/src/wallet/legacy.js +0 -51
- package/dist/lib/taquito/src/wallet/operation-factory.js +0 -88
- package/dist/lib/taquito/src/wallet/operation.js +0 -221
- package/dist/lib/taquito/src/wallet/origination-operation.js +0 -53
- package/dist/lib/taquito/src/wallet/receipt.js +0 -46
- package/dist/lib/taquito/src/wallet/register-global-constant-operation.js +0 -45
- package/dist/lib/taquito/src/wallet/transaction-operation.js +0 -38
- package/dist/lib/taquito/src/wallet/transfer-ticket-operation.js +0 -38
- package/dist/lib/taquito/src/wallet/wallet.js +0 -445
- package/dist/lib/taquito-core/src/errors.js +0 -351
- package/dist/lib/taquito-core/src/signer-interfaces.js +0 -2
- package/dist/lib/taquito-core/src/taquito-core.js +0 -22
- package/dist/lib/taquito-http-utils/src/errors.js +0 -103
- package/dist/lib/taquito-http-utils/src/status_code.js +0 -322
- package/dist/lib/taquito-http-utils/src/taquito-http-utils.js +0 -308
- package/dist/lib/taquito-http-utils/src/transport-errors.js +0 -141
- package/dist/lib/taquito-local-forging/src/codec.js +0 -543
- package/dist/lib/taquito-local-forging/src/constants.js +0 -291
- package/dist/lib/taquito-local-forging/src/decoder.js +0 -64
- package/dist/lib/taquito-local-forging/src/encoder.js +0 -63
- package/dist/lib/taquito-local-forging/src/errors.js +0 -179
- package/dist/lib/taquito-local-forging/src/interface.js +0 -2
- package/dist/lib/taquito-local-forging/src/michelson/codec.js +0 -283
- package/dist/lib/taquito-local-forging/src/protocols.js +0 -60
- package/dist/lib/taquito-local-forging/src/schema/operation.js +0 -259
- package/dist/lib/taquito-local-forging/src/taquito-local-forging.js +0 -117
- package/dist/lib/taquito-local-forging/src/uint8array-consumer.js +0 -35
- package/dist/lib/taquito-local-forging/src/utils.js +0 -18
- package/dist/lib/taquito-local-forging/src/validator.js +0 -57
- package/dist/lib/taquito-local-forging/src/version.js +0 -8
- package/dist/lib/taquito-michel-codec/src/base58.js +0 -255
- package/dist/lib/taquito-michel-codec/src/binary.js +0 -1271
- package/dist/lib/taquito-michel-codec/src/errors.js +0 -90
- package/dist/lib/taquito-michel-codec/src/formatters.js +0 -58
- package/dist/lib/taquito-michel-codec/src/global-constants.js +0 -12
- package/dist/lib/taquito-michel-codec/src/macros.js +0 -551
- package/dist/lib/taquito-michel-codec/src/micheline-emitter.js +0 -128
- package/dist/lib/taquito-michel-codec/src/micheline-parser.js +0 -402
- package/dist/lib/taquito-michel-codec/src/micheline.js +0 -5
- package/dist/lib/taquito-michel-codec/src/michelson-contract.js +0 -93
- package/dist/lib/taquito-michel-codec/src/michelson-typecheck.js +0 -1756
- package/dist/lib/taquito-michel-codec/src/michelson-types.js +0 -83
- package/dist/lib/taquito-michel-codec/src/michelson-validator.js +0 -833
- package/dist/lib/taquito-michel-codec/src/scan.js +0 -128
- package/dist/lib/taquito-michel-codec/src/taquito-michel-codec.js +0 -38
- package/dist/lib/taquito-michel-codec/src/utils.js +0 -323
- package/dist/lib/taquito-michel-codec/src/version.js +0 -8
- package/dist/lib/taquito-michelson-encoder/src/constants.js +0 -11
- package/dist/lib/taquito-michelson-encoder/src/errors.js +0 -38
- package/dist/lib/taquito-michelson-encoder/src/michelson-map.js +0 -201
- package/dist/lib/taquito-michelson-encoder/src/schema/errors.js +0 -127
- package/dist/lib/taquito-michelson-encoder/src/schema/event-schema.js +0 -52
- package/dist/lib/taquito-michelson-encoder/src/schema/parameter.js +0 -113
- package/dist/lib/taquito-michelson-encoder/src/schema/storage.js +0 -260
- package/dist/lib/taquito-michelson-encoder/src/schema/types.js +0 -2
- package/dist/lib/taquito-michelson-encoder/src/schema/view-schema.js +0 -90
- package/dist/lib/taquito-michelson-encoder/src/taquito-michelson-encoder.js +0 -36
- package/dist/lib/taquito-michelson-encoder/src/tokens/bigmap.js +0 -130
- package/dist/lib/taquito-michelson-encoder/src/tokens/bls12-381-fr.js +0 -86
- package/dist/lib/taquito-michelson-encoder/src/tokens/bls12-381-g1.js +0 -76
- package/dist/lib/taquito-michelson-encoder/src/tokens/bls12-381-g2.js +0 -76
- package/dist/lib/taquito-michelson-encoder/src/tokens/chain-id.js +0 -78
- package/dist/lib/taquito-michelson-encoder/src/tokens/chest-key.js +0 -74
- package/dist/lib/taquito-michelson-encoder/src/tokens/chest.js +0 -74
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/address.js +0 -116
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/bool.js +0 -59
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/bytes.js +0 -90
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/int.js +0 -90
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/key_hash.js +0 -90
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/mutez.js +0 -90
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/nat.js +0 -93
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/string.js +0 -48
- package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/timestamp.js +0 -66
- package/dist/lib/taquito-michelson-encoder/src/tokens/constant.js +0 -80
- package/dist/lib/taquito-michelson-encoder/src/tokens/contract.js +0 -86
- package/dist/lib/taquito-michelson-encoder/src/tokens/createToken.js +0 -35
- package/dist/lib/taquito-michelson-encoder/src/tokens/key.js +0 -97
- package/dist/lib/taquito-michelson-encoder/src/tokens/lambda.js +0 -55
- package/dist/lib/taquito-michelson-encoder/src/tokens/list.js +0 -85
- package/dist/lib/taquito-michelson-encoder/src/tokens/map.js +0 -112
- package/dist/lib/taquito-michelson-encoder/src/tokens/never.js +0 -61
- package/dist/lib/taquito-michelson-encoder/src/tokens/operation.js +0 -39
- package/dist/lib/taquito-michelson-encoder/src/tokens/option.js +0 -88
- package/dist/lib/taquito-michelson-encoder/src/tokens/or.js +0 -282
- package/dist/lib/taquito-michelson-encoder/src/tokens/pair.js +0 -233
- package/dist/lib/taquito-michelson-encoder/src/tokens/sapling-state.js +0 -84
- package/dist/lib/taquito-michelson-encoder/src/tokens/sapling-transaction-deprecated.js +0 -74
- package/dist/lib/taquito-michelson-encoder/src/tokens/sapling-transaction.js +0 -74
- package/dist/lib/taquito-michelson-encoder/src/tokens/set.js +0 -82
- package/dist/lib/taquito-michelson-encoder/src/tokens/signature.js +0 -82
- package/dist/lib/taquito-michelson-encoder/src/tokens/ticket-deprecated.js +0 -92
- package/dist/lib/taquito-michelson-encoder/src/tokens/ticket.js +0 -92
- package/dist/lib/taquito-michelson-encoder/src/tokens/token.js +0 -100
- package/dist/lib/taquito-michelson-encoder/src/tokens/tokens.js +0 -75
- package/dist/lib/taquito-michelson-encoder/src/tokens/unit.js +0 -52
- package/dist/lib/taquito-michelson-encoder/src/version.js +0 -8
- package/dist/lib/taquito-rpc/src/opkind.js +0 -49
- package/dist/lib/taquito-rpc/src/rpc-client-interface.js +0 -60
- package/dist/lib/taquito-rpc/src/rpc-client-modules/rpc-cache.js +0 -1118
- package/dist/lib/taquito-rpc/src/taquito-rpc.js +0 -990
- package/dist/lib/taquito-rpc/src/types.js +0 -114
- package/dist/lib/taquito-rpc/src/utils/utils.js +0 -65
- package/dist/lib/taquito-rpc/src/version.js +0 -8
- package/dist/lib/taquito-signer/src/bls-key.js +0 -104
- package/dist/lib/taquito-signer/src/derivation-tools/ecdsa.js +0 -156
- package/dist/lib/taquito-signer/src/derivation-tools/ed25519.js +0 -82
- package/dist/lib/taquito-signer/src/derivation-tools/index.js +0 -79
- package/dist/lib/taquito-signer/src/derivation-tools/types.js +0 -4
- package/dist/lib/taquito-signer/src/derivation-tools/utils.js +0 -16
- package/dist/lib/taquito-signer/src/ec-key.js +0 -196
- package/dist/lib/taquito-signer/src/ed-key.js +0 -130
- package/dist/lib/taquito-signer/src/errors.js +0 -77
- package/dist/lib/taquito-signer/src/helpers.js +0 -44
- package/dist/lib/taquito-signer/src/in-memory-signer.js +0 -240
- package/dist/lib/taquito-signer/src/key-interface.js +0 -6
- package/dist/lib/taquito-signer/src/taquito-signer.js +0 -28
- package/dist/lib/taquito-signer/src/version.js +0 -8
- package/dist/lib/taquito-utils/src/constants.js +0 -203
- package/dist/lib/taquito-utils/src/encoding.js +0 -606
- package/dist/lib/taquito-utils/src/errors.js +0 -45
- package/dist/lib/taquito-utils/src/format.js +0 -29
- package/dist/lib/taquito-utils/src/taquito-utils.js +0 -42
- package/dist/lib/taquito-utils/src/validators.js +0 -236
- package/dist/lib/taquito-utils/src/verify-signature.js +0 -136
- package/dist/lib/taquito-utils/src/version.js +0 -8
- package/dist/lib/taquito-wallet-connect/src/version.js +0 -8
- package/dist/types/taquito/src/batch/constants.d.ts +0 -3
- package/dist/types/taquito/src/batch/rpc-batch-provider.d.ts +0 -139
- package/dist/types/taquito/src/constants.d.ts +0 -81
- package/dist/types/taquito/src/context.d.ts +0 -100
- package/dist/types/taquito/src/contract/big-map.d.ts +0 -35
- package/dist/types/taquito/src/contract/compose.d.ts +0 -5
- package/dist/types/taquito/src/contract/constants.d.ts +0 -1
- package/dist/types/taquito/src/contract/contract-methods/contract-method-factory.d.ts +0 -14
- package/dist/types/taquito/src/contract/contract-methods/contract-method-interface.d.ts +0 -28
- package/dist/types/taquito/src/contract/contract-methods/contract-method-object-param.d.ts +0 -39
- package/dist/types/taquito/src/contract/contract-methods/contract-on-chain-view.d.ts +0 -43
- package/dist/types/taquito/src/contract/contract.d.ts +0 -75
- package/dist/types/taquito/src/contract/errors.d.ts +0 -83
- package/dist/types/taquito/src/contract/index.d.ts +0 -11
- package/dist/types/taquito/src/contract/interface.d.ts +0 -254
- package/dist/types/taquito/src/contract/manager-lambda.d.ts +0 -73
- package/dist/types/taquito/src/contract/prepare.d.ts +0 -18
- package/dist/types/taquito/src/contract/rpc-contract-provider.d.ts +0 -270
- package/dist/types/taquito/src/contract/sapling-state-abstraction.d.ts +0 -17
- package/dist/types/taquito/src/contract/semantic.d.ts +0 -7
- package/dist/types/taquito/src/contract/view_lambda.d.ts +0 -34
- package/dist/types/taquito/src/errors.d.ts +0 -26
- package/dist/types/taquito/src/estimate/errors.d.ts +0 -8
- package/dist/types/taquito/src/estimate/estimate-provider-interface.d.ts +0 -153
- package/dist/types/taquito/src/estimate/estimate.d.ts +0 -111
- package/dist/types/taquito/src/estimate/index.d.ts +0 -4
- package/dist/types/taquito/src/estimate/rpc-estimate-provider.d.ts +0 -174
- package/dist/types/taquito/src/extension/extension.d.ts +0 -4
- package/dist/types/taquito/src/forger/composite-forger.d.ts +0 -6
- package/dist/types/taquito/src/forger/errors.d.ts +0 -16
- package/dist/types/taquito/src/forger/rpc-forger.d.ts +0 -7
- package/dist/types/taquito/src/forger/taquito-local-forger.d.ts +0 -8
- package/dist/types/taquito/src/global-constants/default-global-constants-provider.d.ts +0 -18
- package/dist/types/taquito/src/global-constants/errors.d.ts +0 -16
- package/dist/types/taquito/src/global-constants/interface-global-constants-provider.d.ts +0 -11
- package/dist/types/taquito/src/global-constants/noop-global-constants-provider.d.ts +0 -5
- package/dist/types/taquito/src/import-key.d.ts +0 -13
- package/dist/types/taquito/src/injector/helper.d.ts +0 -2
- package/dist/types/taquito/src/injector/interface.d.ts +0 -5
- package/dist/types/taquito/src/injector/rpc-injector.d.ts +0 -7
- package/dist/types/taquito/src/operations/ballot-operation.d.ts +0 -18
- package/dist/types/taquito/src/operations/batch-operation.d.ts +0 -19
- package/dist/types/taquito/src/operations/delegate-operation.d.ts +0 -24
- package/dist/types/taquito/src/operations/drain-delegate-operation.d.ts +0 -17
- package/dist/types/taquito/src/operations/errors.d.ts +0 -50
- package/dist/types/taquito/src/operations/failing-noop-operation.d.ts +0 -17
- package/dist/types/taquito/src/operations/increase-paid-storage-operation.d.ts +0 -23
- package/dist/types/taquito/src/operations/index.d.ts +0 -18
- package/dist/types/taquito/src/operations/operations.d.ts +0 -35
- package/dist/types/taquito/src/operations/origination-operation.d.ts +0 -35
- package/dist/types/taquito/src/operations/proposals-operation.d.ts +0 -17
- package/dist/types/taquito/src/operations/register-global-constant-operation.d.ts +0 -25
- package/dist/types/taquito/src/operations/reveal-operation.d.ts +0 -25
- package/dist/types/taquito/src/operations/smart-rollup-add-messages-operation.d.ts +0 -20
- package/dist/types/taquito/src/operations/smart-rollup-execute-outbox-message-operation.d.ts +0 -24
- package/dist/types/taquito/src/operations/smart-rollup-originate-operation.d.ts +0 -23
- package/dist/types/taquito/src/operations/transaction-operation.d.ts +0 -28
- package/dist/types/taquito/src/operations/transfer-ticket-operation.d.ts +0 -22
- package/dist/types/taquito/src/operations/types.d.ts +0 -823
- package/dist/types/taquito/src/operations/update-companion-key-operation.d.ts +0 -23
- package/dist/types/taquito/src/operations/update-consensus-key-operation.d.ts +0 -23
- package/dist/types/taquito/src/packer/interface.d.ts +0 -4
- package/dist/types/taquito/src/packer/michel-codec-packer.d.ts +0 -5
- package/dist/types/taquito/src/packer/rpc-packer.d.ts +0 -8
- package/dist/types/taquito/src/parser/interface.d.ts +0 -4
- package/dist/types/taquito/src/parser/michel-codec-parser.d.ts +0 -16
- package/dist/types/taquito/src/parser/noop-parser.d.ts +0 -5
- package/dist/types/taquito/src/prepare/index.d.ts +0 -2
- package/dist/types/taquito/src/prepare/interface.d.ts +0 -152
- package/dist/types/taquito/src/prepare/prepare-provider.d.ts +0 -187
- package/dist/types/taquito/src/provider.d.ts +0 -50
- package/dist/types/taquito/src/read-provider/interface.d.ts +0 -132
- package/dist/types/taquito/src/read-provider/rpc-read-adapter.d.ts +0 -130
- package/dist/types/taquito/src/signer/errors.d.ts +0 -8
- package/dist/types/taquito/src/signer/noop.d.ts +0 -11
- package/dist/types/taquito/src/subscribe/create-observable-from-subscription.d.ts +0 -4
- package/dist/types/taquito/src/subscribe/errors.d.ts +0 -18
- package/dist/types/taquito/src/subscribe/filters.d.ts +0 -6
- package/dist/types/taquito/src/subscribe/interface.d.ts +0 -48
- package/dist/types/taquito/src/subscribe/observable-subscription.d.ts +0 -21
- package/dist/types/taquito/src/subscribe/polling-subcribe-provider.d.ts +0 -23
- package/dist/types/taquito/src/taquito.d.ts +0 -248
- package/dist/types/taquito/src/tz/interface.d.ts +0 -20
- package/dist/types/taquito/src/tz/rpc-tz-provider.d.ts +0 -13
- package/dist/types/taquito/src/version.d.ts +0 -4
- package/dist/types/taquito/src/wallet/batch-operation.d.ts +0 -13
- package/dist/types/taquito/src/wallet/delegation-operation.d.ts +0 -12
- package/dist/types/taquito/src/wallet/errors.d.ts +0 -24
- package/dist/types/taquito/src/wallet/increase-paid-storage-operation.d.ts +0 -12
- package/dist/types/taquito/src/wallet/index.d.ts +0 -9
- package/dist/types/taquito/src/wallet/interface.d.ts +0 -66
- package/dist/types/taquito/src/wallet/legacy.d.ts +0 -21
- package/dist/types/taquito/src/wallet/operation-factory.d.ts +0 -32
- package/dist/types/taquito/src/wallet/operation.d.ts +0 -55
- package/dist/types/taquito/src/wallet/origination-operation.d.ts +0 -14
- package/dist/types/taquito/src/wallet/receipt.d.ts +0 -16
- package/dist/types/taquito/src/wallet/register-global-constant-operation.d.ts +0 -13
- package/dist/types/taquito/src/wallet/transaction-operation.d.ts +0 -12
- package/dist/types/taquito/src/wallet/transfer-ticket-operation.d.ts +0 -12
- package/dist/types/taquito/src/wallet/wallet.d.ts +0 -196
- package/dist/types/taquito-core/src/errors.d.ts +0 -213
- package/dist/types/taquito-core/src/signer-interfaces.d.ts +0 -38
- package/dist/types/taquito-core/src/taquito-core.d.ts +0 -6
- package/dist/types/taquito-http-utils/src/errors.d.ts +0 -63
- package/dist/types/taquito-http-utils/src/status_code.d.ts +0 -318
- package/dist/types/taquito-http-utils/src/taquito-http-utils.d.ts +0 -58
- package/dist/types/taquito-http-utils/src/transport-errors.d.ts +0 -28
- package/dist/types/taquito-local-forging/src/codec.d.ts +0 -79
- package/dist/types/taquito-local-forging/src/constants.d.ts +0 -75
- package/dist/types/taquito-local-forging/src/decoder.d.ts +0 -5
- package/dist/types/taquito-local-forging/src/encoder.d.ts +0 -4
- package/dist/types/taquito-local-forging/src/errors.d.ts +0 -109
- package/dist/types/taquito-local-forging/src/interface.d.ts +0 -9
- package/dist/types/taquito-local-forging/src/michelson/codec.d.ts +0 -49
- package/dist/types/taquito-local-forging/src/protocols.d.ts +0 -27
- package/dist/types/taquito-local-forging/src/schema/operation.d.ts +0 -198
- package/dist/types/taquito-local-forging/src/taquito-local-forging.d.ts +0 -27
- package/dist/types/taquito-local-forging/src/uint8array-consumer.d.ts +0 -10
- package/dist/types/taquito-local-forging/src/utils.d.ts +0 -3
- package/dist/types/taquito-local-forging/src/validator.d.ts +0 -13
- package/dist/types/taquito-local-forging/src/version.d.ts +0 -4
- package/dist/types/taquito-michel-codec/src/base58.d.ts +0 -13
- package/dist/types/taquito-michel-codec/src/binary.d.ts +0 -127
- package/dist/types/taquito-michel-codec/src/errors.d.ts +0 -57
- package/dist/types/taquito-michel-codec/src/formatters.d.ts +0 -6
- package/dist/types/taquito-michel-codec/src/global-constants.d.ts +0 -3
- package/dist/types/taquito-michel-codec/src/macros.d.ts +0 -13
- package/dist/types/taquito-michel-codec/src/micheline-emitter.d.ts +0 -17
- package/dist/types/taquito-michel-codec/src/micheline-parser.d.ts +0 -130
- package/dist/types/taquito-michel-codec/src/micheline.d.ts +0 -44
- package/dist/types/taquito-michel-codec/src/michelson-contract.d.ts +0 -24
- package/dist/types/taquito-michel-codec/src/michelson-typecheck.d.ts +0 -38
- package/dist/types/taquito-michel-codec/src/michelson-types.d.ts +0 -147
- package/dist/types/taquito-michel-codec/src/michelson-validator.d.ts +0 -66
- package/dist/types/taquito-michel-codec/src/scan.d.ts +0 -26
- package/dist/types/taquito-michel-codec/src/taquito-michel-codec.d.ts +0 -16
- package/dist/types/taquito-michel-codec/src/utils.d.ts +0 -76
- package/dist/types/taquito-michel-codec/src/version.d.ts +0 -4
- package/dist/types/taquito-michelson-encoder/src/constants.d.ts +0 -8
- package/dist/types/taquito-michelson-encoder/src/errors.d.ts +0 -17
- package/dist/types/taquito-michelson-encoder/src/michelson-map.d.ts +0 -82
- package/dist/types/taquito-michelson-encoder/src/schema/errors.d.ts +0 -83
- package/dist/types/taquito-michelson-encoder/src/schema/event-schema.d.ts +0 -12
- package/dist/types/taquito-michelson-encoder/src/schema/parameter.d.ts +0 -54
- package/dist/types/taquito-michelson-encoder/src/schema/storage.d.ts +0 -97
- package/dist/types/taquito-michelson-encoder/src/schema/types.d.ts +0 -105
- package/dist/types/taquito-michelson-encoder/src/schema/view-schema.d.ts +0 -53
- package/dist/types/taquito-michelson-encoder/src/taquito-michelson-encoder.d.ts +0 -16
- package/dist/types/taquito-michelson-encoder/src/tokens/bigmap.d.ts +0 -51
- package/dist/types/taquito-michelson-encoder/src/tokens/bls12-381-fr.d.ts +0 -51
- package/dist/types/taquito-michelson-encoder/src/tokens/bls12-381-g1.d.ts +0 -47
- package/dist/types/taquito-michelson-encoder/src/tokens/bls12-381-g2.d.ts +0 -47
- package/dist/types/taquito-michelson-encoder/src/tokens/chain-id.d.ts +0 -51
- package/dist/types/taquito-michelson-encoder/src/tokens/chest-key.d.ts +0 -47
- package/dist/types/taquito-michelson-encoder/src/tokens/chest.d.ts +0 -47
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/address.d.ts +0 -61
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/bool.d.ts +0 -32
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/bytes.d.ts +0 -52
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/int.d.ts +0 -56
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/key_hash.d.ts +0 -55
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/mutez.d.ts +0 -53
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/nat.d.ts +0 -55
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/string.d.ts +0 -31
- package/dist/types/taquito-michelson-encoder/src/tokens/comparable/timestamp.d.ts +0 -34
- package/dist/types/taquito-michelson-encoder/src/tokens/constant.d.ts +0 -51
- package/dist/types/taquito-michelson-encoder/src/tokens/contract.d.ts +0 -48
- package/dist/types/taquito-michelson-encoder/src/tokens/createToken.d.ts +0 -18
- package/dist/types/taquito-michelson-encoder/src/tokens/key.d.ts +0 -55
- package/dist/types/taquito-michelson-encoder/src/tokens/lambda.d.ts +0 -24
- package/dist/types/taquito-michelson-encoder/src/tokens/list.d.ts +0 -46
- package/dist/types/taquito-michelson-encoder/src/tokens/map.d.ts +0 -47
- package/dist/types/taquito-michelson-encoder/src/tokens/never.d.ts +0 -41
- package/dist/types/taquito-michelson-encoder/src/tokens/operation.d.ts +0 -24
- package/dist/types/taquito-michelson-encoder/src/tokens/option.d.ts +0 -37
- package/dist/types/taquito-michelson-encoder/src/tokens/or.d.ts +0 -53
- package/dist/types/taquito-michelson-encoder/src/tokens/pair.d.ts +0 -50
- package/dist/types/taquito-michelson-encoder/src/tokens/sapling-state.d.ts +0 -44
- package/dist/types/taquito-michelson-encoder/src/tokens/sapling-transaction-deprecated.d.ts +0 -40
- package/dist/types/taquito-michelson-encoder/src/tokens/sapling-transaction.d.ts +0 -40
- package/dist/types/taquito-michelson-encoder/src/tokens/set.d.ts +0 -43
- package/dist/types/taquito-michelson-encoder/src/tokens/signature.d.ts +0 -53
- package/dist/types/taquito-michelson-encoder/src/tokens/ticket-deprecated.d.ts +0 -38
- package/dist/types/taquito-michelson-encoder/src/tokens/ticket.d.ts +0 -38
- package/dist/types/taquito-michelson-encoder/src/tokens/token.d.ts +0 -68
- package/dist/types/taquito-michelson-encoder/src/tokens/tokens.d.ts +0 -36
- package/dist/types/taquito-michelson-encoder/src/tokens/unit.d.ts +0 -34
- package/dist/types/taquito-michelson-encoder/src/version.d.ts +0 -4
- package/dist/types/taquito-rpc/src/opkind.d.ts +0 -45
- package/dist/types/taquito-rpc/src/rpc-client-interface.d.ts +0 -126
- package/dist/types/taquito-rpc/src/rpc-client-modules/rpc-cache.d.ts +0 -473
- package/dist/types/taquito-rpc/src/taquito-rpc.d.ts +0 -483
- package/dist/types/taquito-rpc/src/types.d.ts +0 -2362
- package/dist/types/taquito-rpc/src/utils/utils.d.ts +0 -14
- package/dist/types/taquito-rpc/src/version.d.ts +0 -4
- package/dist/types/taquito-signer/src/bls-key.d.ts +0 -21
- package/dist/types/taquito-signer/src/derivation-tools/ecdsa.d.ts +0 -49
- package/dist/types/taquito-signer/src/derivation-tools/ed25519.d.ts +0 -33
- package/dist/types/taquito-signer/src/derivation-tools/index.d.ts +0 -12
- package/dist/types/taquito-signer/src/derivation-tools/types.d.ts +0 -10
- package/dist/types/taquito-signer/src/derivation-tools/utils.d.ts +0 -1
- package/dist/types/taquito-signer/src/ec-key.d.ts +0 -42
- package/dist/types/taquito-signer/src/ed-key.d.ts +0 -39
- package/dist/types/taquito-signer/src/errors.d.ts +0 -51
- package/dist/types/taquito-signer/src/helpers.d.ts +0 -10
- package/dist/types/taquito-signer/src/in-memory-signer.d.ts +0 -56
- package/dist/types/taquito-signer/src/key-interface.d.ts +0 -37
- package/dist/types/taquito-signer/src/taquito-signer.d.ts +0 -10
- package/dist/types/taquito-signer/src/version.d.ts +0 -4
- package/dist/types/taquito-utils/src/constants.d.ts +0 -78
- package/dist/types/taquito-utils/src/encoding.d.ts +0 -184
- package/dist/types/taquito-utils/src/errors.d.ts +0 -20
- package/dist/types/taquito-utils/src/format.d.ts +0 -4
- package/dist/types/taquito-utils/src/taquito-utils.d.ts +0 -11
- package/dist/types/taquito-utils/src/validators.d.ts +0 -167
- package/dist/types/taquito-utils/src/verify-signature.d.ts +0 -22
- package/dist/types/taquito-utils/src/version.d.ts +0 -4
- package/dist/types/taquito-wallet-connect/src/version.d.ts +0 -4
- /package/dist/lib/{taquito-wallet-connect/src/errors.js → errors.js} +0 -0
- /package/dist/lib/{taquito-wallet-connect/src/types.js → types.js} +0 -0
- /package/dist/types/{taquito-wallet-connect/src/errors.d.ts → errors.d.ts} +0 -0
- /package/dist/types/{taquito-wallet-connect/src/taquito-wallet-connect.d.ts → taquito-wallet-connect.d.ts} +0 -0
- /package/dist/types/{taquito-wallet-connect/src/types.d.ts → types.d.ts} +0 -0
- /package/dist/types/{taquito-http-utils/src/version.d.ts → version.d.ts} +0 -0
|
@@ -1,402 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Parser = exports.JSONParseError = exports.MichelineParseError = void 0;
|
|
4
|
-
const scan_1 = require("./scan");
|
|
5
|
-
const micheline_1 = require("./micheline");
|
|
6
|
-
const macros_1 = require("./macros");
|
|
7
|
-
const global_constants_1 = require("./global-constants");
|
|
8
|
-
const core_1 = require("@taquito/core");
|
|
9
|
-
/**
|
|
10
|
-
* @category Error
|
|
11
|
-
* Error that indicates a failure when parsing Micheline expressions
|
|
12
|
-
*/
|
|
13
|
-
class MichelineParseError extends core_1.TaquitoError {
|
|
14
|
-
/**
|
|
15
|
-
* @param token A token caused the error
|
|
16
|
-
* @param message An error message
|
|
17
|
-
*/
|
|
18
|
-
constructor(token, message) {
|
|
19
|
-
super();
|
|
20
|
-
this.token = token;
|
|
21
|
-
this.message = message;
|
|
22
|
-
this.name = 'MichelineParseError';
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.MichelineParseError = MichelineParseError;
|
|
26
|
-
/**
|
|
27
|
-
* @category Error
|
|
28
|
-
* Error indicates a failure when parsing Micheline JSON
|
|
29
|
-
*/
|
|
30
|
-
class JSONParseError extends core_1.TaquitoError {
|
|
31
|
-
/**
|
|
32
|
-
* @param node A node caused the error
|
|
33
|
-
* @param message An error message
|
|
34
|
-
*/
|
|
35
|
-
constructor(node, message) {
|
|
36
|
-
super();
|
|
37
|
-
this.node = node;
|
|
38
|
-
this.message = message;
|
|
39
|
-
this.name = 'JSONParseError';
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.JSONParseError = JSONParseError;
|
|
43
|
-
const errEOF = new MichelineParseError(null, 'Unexpected EOF');
|
|
44
|
-
function isAnnotation(tok) {
|
|
45
|
-
return tok.t === scan_1.Literal.Ident && (tok.v[0] === '@' || tok.v[0] === '%' || tok.v[0] === ':');
|
|
46
|
-
}
|
|
47
|
-
const intRe = new RegExp('^-?[0-9]+$');
|
|
48
|
-
const bytesRe = new RegExp('^([0-9a-fA-F]{2})*$');
|
|
49
|
-
/**
|
|
50
|
-
* Converts and validates Michelson expressions between JSON-based Michelson and Micheline
|
|
51
|
-
*
|
|
52
|
-
* Pretty Print a Michelson Smart Contract:
|
|
53
|
-
* ```
|
|
54
|
-
* const contract = await Tezos.contract.at("KT1Vsw3kh9638gqWoHTjvHCoHLPKvCbMVbCg");
|
|
55
|
-
* const p = new Parser();
|
|
56
|
-
*
|
|
57
|
-
* const michelsonCode = p.parseJSON(contract.script.code);
|
|
58
|
-
* const storage = p.parseJSON(contract.script.storage);
|
|
59
|
-
*
|
|
60
|
-
* console.log("Pretty print Michelson smart contract:");
|
|
61
|
-
* console.log(emitMicheline(michelsonCode, {indent:" ", newline: "\n",}));
|
|
62
|
-
*
|
|
63
|
-
* console.log("Pretty print Storage:");
|
|
64
|
-
* console.log(emitMicheline(storage, {indent:" ", newline: "\n",}));
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
* Encode a Michelson expression for initial storage of a smart contract
|
|
68
|
-
* ```
|
|
69
|
-
* const src = `(Pair (Pair { Elt 1
|
|
70
|
-
* (Pair (Pair "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx")
|
|
71
|
-
* 0x0501000000026869) }
|
|
72
|
-
* 10000000)
|
|
73
|
-
* (Pair 2 333))`;
|
|
74
|
-
*
|
|
75
|
-
* const p = new Parser();
|
|
76
|
-
*
|
|
77
|
-
* const exp = p.parseMichelineExpression(src);
|
|
78
|
-
* console.log(JSON.stringify(exp));
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
class Parser {
|
|
82
|
-
constructor(opt) {
|
|
83
|
-
this.opt = opt;
|
|
84
|
-
}
|
|
85
|
-
expand(ex) {
|
|
86
|
-
if (this.opt?.expandGlobalConstant !== undefined && ex.prim === 'constant') {
|
|
87
|
-
const ret = (0, global_constants_1.expandGlobalConstants)(ex, this.opt.expandGlobalConstant);
|
|
88
|
-
if (ret !== ex) {
|
|
89
|
-
ret[micheline_1.sourceReference] = {
|
|
90
|
-
...(ex[micheline_1.sourceReference] || { first: 0, last: 0 }),
|
|
91
|
-
globalConstant: ex,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
return ret;
|
|
95
|
-
}
|
|
96
|
-
if (this.opt?.expandMacros !== undefined ? this.opt?.expandMacros : true) {
|
|
97
|
-
const ret = (0, macros_1.expandMacros)(ex, this.opt);
|
|
98
|
-
if (ret !== ex) {
|
|
99
|
-
ret[micheline_1.sourceReference] = { ...(ex[micheline_1.sourceReference] || { first: 0, last: 0 }), macro: ex };
|
|
100
|
-
}
|
|
101
|
-
return ret;
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
return ex;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
parseListExpr(scanner, start) {
|
|
108
|
-
const ref = {
|
|
109
|
-
first: start.first,
|
|
110
|
-
last: start.last,
|
|
111
|
-
};
|
|
112
|
-
const expectBracket = start.t === '(';
|
|
113
|
-
let tok;
|
|
114
|
-
if (expectBracket) {
|
|
115
|
-
tok = scanner.next();
|
|
116
|
-
if (tok.done) {
|
|
117
|
-
throw errEOF;
|
|
118
|
-
}
|
|
119
|
-
ref.last = tok.value.last;
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
tok = { value: start };
|
|
123
|
-
}
|
|
124
|
-
if (tok.value.t !== scan_1.Literal.Ident) {
|
|
125
|
-
throw new MichelineParseError(tok.value, `not an identifier: ${tok.value.v}`);
|
|
126
|
-
}
|
|
127
|
-
const ret = {
|
|
128
|
-
prim: tok.value.v,
|
|
129
|
-
[micheline_1.sourceReference]: ref,
|
|
130
|
-
};
|
|
131
|
-
for (;;) {
|
|
132
|
-
const tok = scanner.next();
|
|
133
|
-
if (tok.done) {
|
|
134
|
-
if (expectBracket) {
|
|
135
|
-
throw errEOF;
|
|
136
|
-
}
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
else if (tok.value.t === ')') {
|
|
140
|
-
if (!expectBracket) {
|
|
141
|
-
throw new MichelineParseError(tok.value, 'unexpected closing bracket');
|
|
142
|
-
}
|
|
143
|
-
ref.last = tok.value.last;
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
else if (isAnnotation(tok.value)) {
|
|
147
|
-
ret.annots = ret.annots || [];
|
|
148
|
-
ret.annots.push(tok.value.v);
|
|
149
|
-
ref.last = tok.value.last;
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
ret.args = ret.args || [];
|
|
153
|
-
const arg = this.parseExpr(scanner, tok.value);
|
|
154
|
-
ref.last = arg[micheline_1.sourceReference]?.last || ref.last;
|
|
155
|
-
ret.args.push(arg);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return this.expand(ret);
|
|
159
|
-
}
|
|
160
|
-
parseArgs(scanner, start) {
|
|
161
|
-
// Identifier with arguments
|
|
162
|
-
const ref = {
|
|
163
|
-
first: start.first,
|
|
164
|
-
last: start.last,
|
|
165
|
-
};
|
|
166
|
-
const p = {
|
|
167
|
-
prim: start.v,
|
|
168
|
-
[micheline_1.sourceReference]: ref,
|
|
169
|
-
};
|
|
170
|
-
for (;;) {
|
|
171
|
-
const t = scanner.next();
|
|
172
|
-
if (t.done || t.value.t === '}' || t.value.t === ';') {
|
|
173
|
-
return [p, t];
|
|
174
|
-
}
|
|
175
|
-
if (isAnnotation(t.value)) {
|
|
176
|
-
ref.last = t.value.last;
|
|
177
|
-
p.annots = p.annots || [];
|
|
178
|
-
p.annots.push(t.value.v);
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
const arg = this.parseExpr(scanner, t.value);
|
|
182
|
-
ref.last = arg[micheline_1.sourceReference]?.last || ref.last;
|
|
183
|
-
p.args = p.args || [];
|
|
184
|
-
p.args.push(arg);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
parseSequenceExpr(scanner, start) {
|
|
189
|
-
const ref = {
|
|
190
|
-
first: start.first,
|
|
191
|
-
last: start.last,
|
|
192
|
-
};
|
|
193
|
-
const seq = [];
|
|
194
|
-
seq[micheline_1.sourceReference] = ref;
|
|
195
|
-
const expectBracket = start.t === '{';
|
|
196
|
-
let tok = start.t === '{' ? null : { value: start };
|
|
197
|
-
for (;;) {
|
|
198
|
-
if (tok === null) {
|
|
199
|
-
tok = scanner.next();
|
|
200
|
-
if (!tok.done) {
|
|
201
|
-
ref.last = tok.value.last;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
if (tok.done) {
|
|
205
|
-
if (expectBracket) {
|
|
206
|
-
throw errEOF;
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
return seq;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
if (tok.value.t === '}') {
|
|
213
|
-
if (!expectBracket) {
|
|
214
|
-
throw new MichelineParseError(tok.value, 'unexpected closing bracket');
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
return seq;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
else if (tok.value.t === scan_1.Literal.Ident) {
|
|
221
|
-
// Identifier with arguments
|
|
222
|
-
const [itm, n] = this.parseArgs(scanner, tok.value);
|
|
223
|
-
ref.last = itm[micheline_1.sourceReference]?.last || ref.last;
|
|
224
|
-
seq.push(this.expand(itm));
|
|
225
|
-
tok = n;
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
// Other
|
|
229
|
-
const ex = this.parseExpr(scanner, tok.value);
|
|
230
|
-
ref.last = ex[micheline_1.sourceReference]?.last || ref.last;
|
|
231
|
-
seq.push(ex);
|
|
232
|
-
tok = null;
|
|
233
|
-
}
|
|
234
|
-
if (tok === null) {
|
|
235
|
-
tok = scanner.next();
|
|
236
|
-
if (!tok.done) {
|
|
237
|
-
ref.last = tok.value.last;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
if (!tok.done && tok.value.t === ';') {
|
|
241
|
-
tok = null;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
parseExpr(scanner, tok) {
|
|
246
|
-
switch (tok.t) {
|
|
247
|
-
case scan_1.Literal.Ident:
|
|
248
|
-
return this.expand({
|
|
249
|
-
prim: tok.v,
|
|
250
|
-
[micheline_1.sourceReference]: { first: tok.first, last: tok.last },
|
|
251
|
-
});
|
|
252
|
-
case scan_1.Literal.Number:
|
|
253
|
-
return { int: tok.v, [micheline_1.sourceReference]: { first: tok.first, last: tok.last } };
|
|
254
|
-
case scan_1.Literal.String:
|
|
255
|
-
return {
|
|
256
|
-
string: JSON.parse(tok.v),
|
|
257
|
-
[micheline_1.sourceReference]: { first: tok.first, last: tok.last },
|
|
258
|
-
};
|
|
259
|
-
case scan_1.Literal.Bytes:
|
|
260
|
-
return { bytes: tok.v.slice(2), [micheline_1.sourceReference]: { first: tok.first, last: tok.last } };
|
|
261
|
-
case '{':
|
|
262
|
-
return this.parseSequenceExpr(scanner, tok);
|
|
263
|
-
default:
|
|
264
|
-
return this.parseListExpr(scanner, tok);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Parses a Micheline sequence expression, such as smart contract source. Enclosing curly brackets may be omitted.
|
|
269
|
-
* @param src A Micheline sequence `{parameter ...; storage int; code { DUP ; ...};}` or `parameter ...; storage int; code { DUP ; ...};`
|
|
270
|
-
*/
|
|
271
|
-
parseSequence(src) {
|
|
272
|
-
if (typeof src !== 'string') {
|
|
273
|
-
throw new TypeError(`string type was expected, got ${typeof src} instead`);
|
|
274
|
-
}
|
|
275
|
-
const scanner = (0, scan_1.scan)(src);
|
|
276
|
-
const tok = scanner.next();
|
|
277
|
-
if (tok.done) {
|
|
278
|
-
return null;
|
|
279
|
-
}
|
|
280
|
-
return this.parseSequenceExpr(scanner, tok.value);
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Parse a Micheline sequence expression. Enclosing curly brackets may be omitted.
|
|
284
|
-
* @param src A Michelson list expression such as `(Pair {Elt "0" 0} 0)` or `Pair {Elt "0" 0} 0`
|
|
285
|
-
* @returns An AST node or null for empty document.
|
|
286
|
-
*/
|
|
287
|
-
parseList(src) {
|
|
288
|
-
if (typeof src !== 'string') {
|
|
289
|
-
throw new TypeError(`string type was expected, got ${typeof src} instead`);
|
|
290
|
-
}
|
|
291
|
-
const scanner = (0, scan_1.scan)(src);
|
|
292
|
-
const tok = scanner.next();
|
|
293
|
-
if (tok.done) {
|
|
294
|
-
return null;
|
|
295
|
-
}
|
|
296
|
-
return this.parseListExpr(scanner, tok.value);
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Parse any Michelson expression
|
|
300
|
-
* @param src A Michelson expression such as `(Pair {Elt "0" 0} 0)` or `{parameter ...; storage int; code { DUP ; ...};}`
|
|
301
|
-
* @returns An AST node or null for empty document.
|
|
302
|
-
*/
|
|
303
|
-
parseMichelineExpression(src) {
|
|
304
|
-
if (typeof src !== 'string') {
|
|
305
|
-
throw new TypeError(`string type was expected, got ${typeof src} instead`);
|
|
306
|
-
}
|
|
307
|
-
const scanner = (0, scan_1.scan)(src);
|
|
308
|
-
const tok = scanner.next();
|
|
309
|
-
if (tok.done) {
|
|
310
|
-
return null;
|
|
311
|
-
}
|
|
312
|
-
return this.parseExpr(scanner, tok.value);
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* Parse a Micheline sequence expression, such as smart contract source. Enclosing curly brackets may be omitted.
|
|
316
|
-
* An alias for `parseSequence`
|
|
317
|
-
* @param src A Micheline sequence `{parameter ...; storage int; code { DUP ; ...};}` or `parameter ...; storage int; code { DUP ; ...};`
|
|
318
|
-
*/
|
|
319
|
-
parseScript(src) {
|
|
320
|
-
return this.parseSequence(src);
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Parse a Micheline sequence expression. Enclosing curly brackets may be omitted.
|
|
324
|
-
* An alias for `parseList`
|
|
325
|
-
* @param src A Michelson list expression such as `(Pair {Elt "0" 0} 0)` or `Pair {Elt "0" 0} 0`
|
|
326
|
-
* @returns An AST node or null for empty document.
|
|
327
|
-
*/
|
|
328
|
-
parseData(src) {
|
|
329
|
-
return this.parseList(src);
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Takes a JSON-encoded Michelson, validates it, strips away unneeded properties and optionally expands macros (See {@link ParserOptions}).
|
|
333
|
-
* @param src An object containing JSON-encoded Michelson, usually returned by `JSON.parse()`
|
|
334
|
-
*/
|
|
335
|
-
parseJSON(src) {
|
|
336
|
-
if (typeof src !== 'object') {
|
|
337
|
-
throw new TypeError(`object type was expected, got ${typeof src} instead`);
|
|
338
|
-
}
|
|
339
|
-
if (Array.isArray(src)) {
|
|
340
|
-
const ret = [];
|
|
341
|
-
for (const n of src) {
|
|
342
|
-
if (n === null || typeof n !== 'object') {
|
|
343
|
-
throw new JSONParseError(n, `unexpected sequence element: ${n}`);
|
|
344
|
-
}
|
|
345
|
-
ret.push(this.parseJSON(n));
|
|
346
|
-
}
|
|
347
|
-
return ret;
|
|
348
|
-
}
|
|
349
|
-
else if ('prim' in src) {
|
|
350
|
-
const p = src;
|
|
351
|
-
if (typeof p.prim === 'string' &&
|
|
352
|
-
(p.annots === undefined || Array.isArray(p.annots)) &&
|
|
353
|
-
(p.args === undefined || Array.isArray(p.args))) {
|
|
354
|
-
const ret = {
|
|
355
|
-
prim: p.prim,
|
|
356
|
-
};
|
|
357
|
-
if (p.annots !== undefined) {
|
|
358
|
-
for (const a of p.annots) {
|
|
359
|
-
if (typeof a !== 'string') {
|
|
360
|
-
throw new JSONParseError(a, `string expected: ${a}`);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
ret.annots = p.annots;
|
|
364
|
-
}
|
|
365
|
-
if (p.args !== undefined) {
|
|
366
|
-
ret.args = [];
|
|
367
|
-
for (const a of p.args) {
|
|
368
|
-
if (a === null || typeof a !== 'object') {
|
|
369
|
-
throw new JSONParseError(a, `unexpected argument: ${a}`);
|
|
370
|
-
}
|
|
371
|
-
ret.args.push(this.parseJSON(a));
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
return this.expand(ret);
|
|
375
|
-
}
|
|
376
|
-
throw new JSONParseError(src, `malformed prim expression: ${src}`);
|
|
377
|
-
}
|
|
378
|
-
else if ('string' in src) {
|
|
379
|
-
if (typeof src.string === 'string') {
|
|
380
|
-
return { string: src.string };
|
|
381
|
-
}
|
|
382
|
-
throw new JSONParseError(src, `malformed string literal: ${src}`);
|
|
383
|
-
}
|
|
384
|
-
else if ('int' in src) {
|
|
385
|
-
if (typeof src.int === 'string' && intRe.test(src.int)) {
|
|
386
|
-
return { int: src.int };
|
|
387
|
-
}
|
|
388
|
-
throw new JSONParseError(src, `malformed int literal: ${src}`);
|
|
389
|
-
}
|
|
390
|
-
else if ('bytes' in src) {
|
|
391
|
-
if (typeof src.bytes === 'string' &&
|
|
392
|
-
bytesRe.test(src.bytes)) {
|
|
393
|
-
return { bytes: src.bytes };
|
|
394
|
-
}
|
|
395
|
-
throw new JSONParseError(src, `malformed bytes literal: ${src}`);
|
|
396
|
-
}
|
|
397
|
-
else {
|
|
398
|
-
throw new JSONParseError(src, `unexpected object: ${src}`);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
exports.Parser = Parser;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Michelson abstract syntax tree types https://tezos.gitlab.io/whitedoc/michelson.html#concrete-syntax
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.sourceReference = void 0;
|
|
5
|
-
exports.sourceReference = Symbol('source_reference');
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dummyContract = exports.Contract = void 0;
|
|
4
|
-
const michelson_typecheck_1 = require("./michelson-typecheck");
|
|
5
|
-
const micheline_parser_1 = require("./micheline-parser");
|
|
6
|
-
const michelson_validator_1 = require("./michelson-validator");
|
|
7
|
-
const errors_1 = require("./errors");
|
|
8
|
-
class Contract {
|
|
9
|
-
constructor(contract, opt) {
|
|
10
|
-
this.contract = contract;
|
|
11
|
-
this.ctx = { contract, ...opt };
|
|
12
|
-
this.output = (0, michelson_typecheck_1.assertContractValid)(contract, this.ctx);
|
|
13
|
-
}
|
|
14
|
-
static parse(src, opt) {
|
|
15
|
-
const p = new micheline_parser_1.Parser(opt);
|
|
16
|
-
const expr = typeof src === 'string' ? p.parseScript(src) : p.parseJSON(src);
|
|
17
|
-
if (expr === null) {
|
|
18
|
-
throw new errors_1.InvalidMichelsonError('empty Michelson');
|
|
19
|
-
}
|
|
20
|
-
if ((0, michelson_validator_1.assertMichelsonContract)(expr)) {
|
|
21
|
-
return new Contract(expr, opt);
|
|
22
|
-
}
|
|
23
|
-
throw undefined;
|
|
24
|
-
}
|
|
25
|
-
static parseTypeExpression(src, opt) {
|
|
26
|
-
const p = new micheline_parser_1.Parser(opt);
|
|
27
|
-
const expr = typeof src === 'string' ? p.parseScript(src) : p.parseJSON(src);
|
|
28
|
-
if (expr === null) {
|
|
29
|
-
throw new errors_1.InvalidTypeExpressionError('empty type expression');
|
|
30
|
-
}
|
|
31
|
-
// remove assertTypeAnnotationsValid from if block because: () => void || throw error
|
|
32
|
-
if ((0, michelson_validator_1.assertMichelsonType)(expr)) {
|
|
33
|
-
(0, michelson_typecheck_1.assertTypeAnnotationsValid)(expr);
|
|
34
|
-
return expr;
|
|
35
|
-
}
|
|
36
|
-
throw undefined;
|
|
37
|
-
}
|
|
38
|
-
static parseDataExpression(src, opt) {
|
|
39
|
-
const p = new micheline_parser_1.Parser(opt);
|
|
40
|
-
const expr = typeof src === 'string' ? p.parseScript(src) : p.parseJSON(src);
|
|
41
|
-
if (expr === null) {
|
|
42
|
-
throw new errors_1.InvalidDataExpressionError('empty data expression');
|
|
43
|
-
}
|
|
44
|
-
if ((0, michelson_validator_1.assertMichelsonData)(expr)) {
|
|
45
|
-
return expr;
|
|
46
|
-
}
|
|
47
|
-
throw undefined;
|
|
48
|
-
}
|
|
49
|
-
section(section) {
|
|
50
|
-
return (0, michelson_typecheck_1.contractSection)(this.contract, section);
|
|
51
|
-
}
|
|
52
|
-
entryPoints() {
|
|
53
|
-
return (0, michelson_typecheck_1.contractEntryPoints)(this.contract);
|
|
54
|
-
}
|
|
55
|
-
entryPoint(ep) {
|
|
56
|
-
return (0, michelson_typecheck_1.contractEntryPoint)(this.contract, ep);
|
|
57
|
-
}
|
|
58
|
-
assertDataValid(d, t) {
|
|
59
|
-
(0, michelson_typecheck_1.assertDataValid)(d, t, this.ctx);
|
|
60
|
-
}
|
|
61
|
-
isDataValid(d, t) {
|
|
62
|
-
return (0, michelson_typecheck_1.isDataValid)(d, t, this.ctx);
|
|
63
|
-
}
|
|
64
|
-
assertParameterValid(ep, d) {
|
|
65
|
-
const t = this.entryPoint(ep || undefined);
|
|
66
|
-
if (t === null) {
|
|
67
|
-
throw new errors_1.InvalidEntrypointError(ep?.toString());
|
|
68
|
-
}
|
|
69
|
-
this.assertDataValid(d, t);
|
|
70
|
-
}
|
|
71
|
-
isParameterValid(ep, d) {
|
|
72
|
-
try {
|
|
73
|
-
this.assertParameterValid(ep, d);
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
functionType(inst, stack) {
|
|
81
|
-
return (0, michelson_typecheck_1.functionType)(inst, stack, this.ctx);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
exports.Contract = Contract;
|
|
85
|
-
// TODO: dummyContract not used anywhere in the codebase can be deleted?
|
|
86
|
-
exports.dummyContract = new Contract([
|
|
87
|
-
{ prim: 'parameter', args: [{ prim: 'unit' }] },
|
|
88
|
-
{ prim: 'storage', args: [{ prim: 'unit' }] },
|
|
89
|
-
{
|
|
90
|
-
prim: 'code',
|
|
91
|
-
args: [[{ prim: 'CAR' }, { prim: 'NIL', args: [{ prim: 'operation' }] }, { prim: 'PAIR' }]],
|
|
92
|
-
},
|
|
93
|
-
]);
|