@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,551 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MacroError = void 0;
|
|
4
|
-
exports.expandMacros = expandMacros;
|
|
5
|
-
const core_1 = require("@taquito/core");
|
|
6
|
-
const michelson_types_1 = require("./michelson-types");
|
|
7
|
-
/**
|
|
8
|
-
* @category Error
|
|
9
|
-
* Error that indicates macros failed to be expanded
|
|
10
|
-
*/
|
|
11
|
-
class MacroError extends core_1.TaquitoError {
|
|
12
|
-
constructor(prim, message) {
|
|
13
|
-
super();
|
|
14
|
-
this.prim = prim;
|
|
15
|
-
this.message = message;
|
|
16
|
-
this.name = 'MacroError';
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.MacroError = MacroError;
|
|
20
|
-
function assertArgs(ex, n) {
|
|
21
|
-
if ((n === 0 && ex.args === undefined) || ex.args?.length === n) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
throw new MacroError(ex, `macro ${ex.prim} expects ${n} arguments, was given ${ex.args?.length}`);
|
|
25
|
-
}
|
|
26
|
-
function assertNoAnnots(ex) {
|
|
27
|
-
if (ex.annots === undefined) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
throw new MacroError(ex, `unexpected annotation on macro ${ex.prim}: ${ex.annots}`);
|
|
31
|
-
}
|
|
32
|
-
function assertIntArg(ex, arg) {
|
|
33
|
-
if ('int' in arg) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
throw new MacroError(ex, `macro ${ex.prim} expects int argument`);
|
|
37
|
-
}
|
|
38
|
-
function parsePairUnpairExpr(p, expr, annotations, agg) {
|
|
39
|
-
let i = 0;
|
|
40
|
-
let ai = 0;
|
|
41
|
-
const ann = [null, null];
|
|
42
|
-
// Left expression
|
|
43
|
-
let lexpr;
|
|
44
|
-
if (i === expr.length) {
|
|
45
|
-
throw new MacroError(p, `unexpected end: ${p.prim}`);
|
|
46
|
-
}
|
|
47
|
-
let c = expr[i++];
|
|
48
|
-
switch (c) {
|
|
49
|
-
case 'P': {
|
|
50
|
-
const { r, n, an } = parsePairUnpairExpr(p, expr.slice(i), annotations.slice(ai), agg);
|
|
51
|
-
lexpr = r;
|
|
52
|
-
i += n;
|
|
53
|
-
ai += an;
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
case 'A':
|
|
57
|
-
if (ai !== annotations.length) {
|
|
58
|
-
ann[0] = annotations[ai++];
|
|
59
|
-
}
|
|
60
|
-
break;
|
|
61
|
-
default:
|
|
62
|
-
throw new MacroError(p, `${p.prim}: unexpected character: ${c}`);
|
|
63
|
-
}
|
|
64
|
-
// Right expression
|
|
65
|
-
let rexpr;
|
|
66
|
-
if (i === expr.length) {
|
|
67
|
-
throw new MacroError(p, `unexpected end: ${p.prim}`);
|
|
68
|
-
}
|
|
69
|
-
c = expr[i++];
|
|
70
|
-
switch (c) {
|
|
71
|
-
case 'P': {
|
|
72
|
-
const { r, n, an } = parsePairUnpairExpr(p, expr.slice(i), annotations.slice(ai), agg);
|
|
73
|
-
rexpr = r.map(([v, a]) => [v + 1, a]);
|
|
74
|
-
i += n;
|
|
75
|
-
ai += an;
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
case 'I':
|
|
79
|
-
if (ai !== annotations.length) {
|
|
80
|
-
ann[1] = annotations[ai++];
|
|
81
|
-
}
|
|
82
|
-
break;
|
|
83
|
-
default:
|
|
84
|
-
throw new MacroError(p, `${p.prim}: unexpected character: ${c}`);
|
|
85
|
-
}
|
|
86
|
-
return { r: agg(lexpr, rexpr, [0, ann]), n: i, an: ai };
|
|
87
|
-
}
|
|
88
|
-
function parseSetMapCadr(p, expr, vann, term) {
|
|
89
|
-
const c = expr[0];
|
|
90
|
-
switch (c) {
|
|
91
|
-
case 'A':
|
|
92
|
-
return expr.length > 1
|
|
93
|
-
? [
|
|
94
|
-
{ prim: 'DUP' },
|
|
95
|
-
{
|
|
96
|
-
prim: 'DIP',
|
|
97
|
-
args: [
|
|
98
|
-
[{ prim: 'CAR', annots: ['@%%'] }, parseSetMapCadr(p, expr.slice(1), [], term)],
|
|
99
|
-
],
|
|
100
|
-
},
|
|
101
|
-
{ prim: 'CDR', annots: ['@%%'] },
|
|
102
|
-
{ prim: 'SWAP' },
|
|
103
|
-
{ prim: 'PAIR', annots: ['%@', '%@', ...vann] },
|
|
104
|
-
]
|
|
105
|
-
: term.a;
|
|
106
|
-
case 'D':
|
|
107
|
-
return expr.length > 1
|
|
108
|
-
? [
|
|
109
|
-
{ prim: 'DUP' },
|
|
110
|
-
{
|
|
111
|
-
prim: 'DIP',
|
|
112
|
-
args: [
|
|
113
|
-
[{ prim: 'CDR', annots: ['@%%'] }, parseSetMapCadr(p, expr.slice(1), [], term)],
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
|
-
{ prim: 'CAR', annots: ['@%%'] },
|
|
117
|
-
{ prim: 'PAIR', annots: ['%@', '%@', ...vann] },
|
|
118
|
-
]
|
|
119
|
-
: term.d;
|
|
120
|
-
default:
|
|
121
|
-
throw new MacroError(p, `${p.prim}: unexpected character: ${c}`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
function trimLast(a, v) {
|
|
125
|
-
let l = a.length;
|
|
126
|
-
while (l > 0 && a[l - 1] === v) {
|
|
127
|
-
l--;
|
|
128
|
-
}
|
|
129
|
-
return a.slice(0, l);
|
|
130
|
-
}
|
|
131
|
-
function filterAnnotations(a) {
|
|
132
|
-
const fields = [];
|
|
133
|
-
const rest = [];
|
|
134
|
-
if (a !== undefined) {
|
|
135
|
-
for (const v of a) {
|
|
136
|
-
(v.length !== 0 && v[0] === '%' ? fields : rest).push(v);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return { fields, rest };
|
|
140
|
-
}
|
|
141
|
-
function mkPrim({ prim, annots, args }) {
|
|
142
|
-
return {
|
|
143
|
-
prim,
|
|
144
|
-
...(annots && { annots }),
|
|
145
|
-
...(args && { args }),
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
const pairRe = /^P[PAI]{3,}R$/;
|
|
149
|
-
const unpairRe = /^UNP[PAI]{2,}R$/;
|
|
150
|
-
const cadrRe = /^C[AD]{2,}R$/;
|
|
151
|
-
const setCadrRe = /^SET_C[AD]+R$/;
|
|
152
|
-
const mapCadrRe = /^MAP_C[AD]+R$/;
|
|
153
|
-
const diipRe = /^DI{2,}P$/;
|
|
154
|
-
const duupRe = /^DU+P$/;
|
|
155
|
-
function expandMacros(ex, opt) {
|
|
156
|
-
const proto = opt?.protocol || michelson_types_1.DefaultProtocol;
|
|
157
|
-
function mayRename(annots) {
|
|
158
|
-
return annots !== undefined ? [{ prim: 'RENAME', annots }] : [];
|
|
159
|
-
}
|
|
160
|
-
switch (ex.prim) {
|
|
161
|
-
// Compare
|
|
162
|
-
case 'CMPEQ':
|
|
163
|
-
case 'CMPNEQ':
|
|
164
|
-
case 'CMPLT':
|
|
165
|
-
case 'CMPGT':
|
|
166
|
-
case 'CMPLE':
|
|
167
|
-
case 'CMPGE':
|
|
168
|
-
if (assertArgs(ex, 0)) {
|
|
169
|
-
return [{ prim: 'COMPARE' }, mkPrim({ prim: ex.prim.slice(3), annots: ex.annots })];
|
|
170
|
-
}
|
|
171
|
-
break;
|
|
172
|
-
case 'IFEQ':
|
|
173
|
-
case 'IFNEQ':
|
|
174
|
-
case 'IFLT':
|
|
175
|
-
case 'IFGT':
|
|
176
|
-
case 'IFLE':
|
|
177
|
-
case 'IFGE':
|
|
178
|
-
if (assertArgs(ex, 2)) {
|
|
179
|
-
return [
|
|
180
|
-
{ prim: ex.prim.slice(2) },
|
|
181
|
-
mkPrim({ prim: 'IF', annots: ex.annots, args: ex.args }),
|
|
182
|
-
];
|
|
183
|
-
}
|
|
184
|
-
break;
|
|
185
|
-
case 'IFCMPEQ':
|
|
186
|
-
case 'IFCMPNEQ':
|
|
187
|
-
case 'IFCMPLT':
|
|
188
|
-
case 'IFCMPGT':
|
|
189
|
-
case 'IFCMPLE':
|
|
190
|
-
case 'IFCMPGE':
|
|
191
|
-
if (assertArgs(ex, 2)) {
|
|
192
|
-
return [
|
|
193
|
-
{ prim: 'COMPARE' },
|
|
194
|
-
{ prim: ex.prim.slice(5) },
|
|
195
|
-
mkPrim({ prim: 'IF', annots: ex.annots, args: ex.args }),
|
|
196
|
-
];
|
|
197
|
-
}
|
|
198
|
-
break;
|
|
199
|
-
// Fail
|
|
200
|
-
case 'FAIL':
|
|
201
|
-
if (assertArgs(ex, 0) && assertNoAnnots(ex)) {
|
|
202
|
-
return [{ prim: 'UNIT' }, { prim: 'FAILWITH' }];
|
|
203
|
-
}
|
|
204
|
-
break;
|
|
205
|
-
// Assertion macros
|
|
206
|
-
case 'ASSERT':
|
|
207
|
-
if (assertArgs(ex, 0) && assertNoAnnots(ex)) {
|
|
208
|
-
return [
|
|
209
|
-
{
|
|
210
|
-
prim: 'IF',
|
|
211
|
-
args: [[], [[{ prim: 'UNIT' }, { prim: 'FAILWITH' }]]],
|
|
212
|
-
},
|
|
213
|
-
];
|
|
214
|
-
}
|
|
215
|
-
break;
|
|
216
|
-
case 'ASSERT_EQ':
|
|
217
|
-
case 'ASSERT_NEQ':
|
|
218
|
-
case 'ASSERT_LT':
|
|
219
|
-
case 'ASSERT_GT':
|
|
220
|
-
case 'ASSERT_LE':
|
|
221
|
-
case 'ASSERT_GE':
|
|
222
|
-
if (assertArgs(ex, 0) && assertNoAnnots(ex)) {
|
|
223
|
-
return [
|
|
224
|
-
{ prim: ex.prim.slice(7) },
|
|
225
|
-
{
|
|
226
|
-
prim: 'IF',
|
|
227
|
-
args: [[], [[{ prim: 'UNIT' }, { prim: 'FAILWITH' }]]],
|
|
228
|
-
},
|
|
229
|
-
];
|
|
230
|
-
}
|
|
231
|
-
break;
|
|
232
|
-
case 'ASSERT_CMPEQ':
|
|
233
|
-
case 'ASSERT_CMPNEQ':
|
|
234
|
-
case 'ASSERT_CMPLT':
|
|
235
|
-
case 'ASSERT_CMPGT':
|
|
236
|
-
case 'ASSERT_CMPLE':
|
|
237
|
-
case 'ASSERT_CMPGE':
|
|
238
|
-
if (assertArgs(ex, 0) && assertNoAnnots(ex)) {
|
|
239
|
-
return [
|
|
240
|
-
[{ prim: 'COMPARE' }, { prim: ex.prim.slice(10) }],
|
|
241
|
-
{
|
|
242
|
-
prim: 'IF',
|
|
243
|
-
args: [[], [[{ prim: 'UNIT' }, { prim: 'FAILWITH' }]]],
|
|
244
|
-
},
|
|
245
|
-
];
|
|
246
|
-
}
|
|
247
|
-
break;
|
|
248
|
-
case 'ASSERT_NONE':
|
|
249
|
-
if (assertArgs(ex, 0) && assertNoAnnots(ex)) {
|
|
250
|
-
return [
|
|
251
|
-
{
|
|
252
|
-
prim: 'IF_NONE',
|
|
253
|
-
args: [[], [[{ prim: 'UNIT' }, { prim: 'FAILWITH' }]]],
|
|
254
|
-
},
|
|
255
|
-
];
|
|
256
|
-
}
|
|
257
|
-
break;
|
|
258
|
-
case 'ASSERT_SOME':
|
|
259
|
-
if (assertArgs(ex, 0)) {
|
|
260
|
-
return [
|
|
261
|
-
{
|
|
262
|
-
prim: 'IF_NONE',
|
|
263
|
-
args: [[[{ prim: 'UNIT' }, { prim: 'FAILWITH' }]], mayRename(ex.annots)],
|
|
264
|
-
},
|
|
265
|
-
];
|
|
266
|
-
}
|
|
267
|
-
break;
|
|
268
|
-
case 'ASSERT_LEFT':
|
|
269
|
-
if (assertArgs(ex, 0)) {
|
|
270
|
-
return [
|
|
271
|
-
{
|
|
272
|
-
prim: 'IF_LEFT',
|
|
273
|
-
args: [mayRename(ex.annots), [[{ prim: 'UNIT' }, { prim: 'FAILWITH' }]]],
|
|
274
|
-
},
|
|
275
|
-
];
|
|
276
|
-
}
|
|
277
|
-
break;
|
|
278
|
-
case 'ASSERT_RIGHT':
|
|
279
|
-
if (assertArgs(ex, 0)) {
|
|
280
|
-
return [
|
|
281
|
-
{
|
|
282
|
-
prim: 'IF_LEFT',
|
|
283
|
-
args: [[[{ prim: 'UNIT' }, { prim: 'FAILWITH' }]], mayRename(ex.annots)],
|
|
284
|
-
},
|
|
285
|
-
];
|
|
286
|
-
}
|
|
287
|
-
break;
|
|
288
|
-
// Syntactic conveniences
|
|
289
|
-
case 'IF_SOME':
|
|
290
|
-
if (assertArgs(ex, 2)) {
|
|
291
|
-
return [mkPrim({ prim: 'IF_NONE', annots: ex.annots, args: [ex.args[1], ex.args[0]] })];
|
|
292
|
-
}
|
|
293
|
-
break;
|
|
294
|
-
case 'IF_RIGHT':
|
|
295
|
-
if (assertArgs(ex, 2)) {
|
|
296
|
-
return [mkPrim({ prim: 'IF_LEFT', annots: ex.annots, args: [ex.args[1], ex.args[0]] })];
|
|
297
|
-
}
|
|
298
|
-
break;
|
|
299
|
-
// CAR/CDR n
|
|
300
|
-
case 'CAR':
|
|
301
|
-
case 'CDR':
|
|
302
|
-
if (ex.args !== undefined) {
|
|
303
|
-
if (assertArgs(ex, 1) && assertIntArg(ex, ex.args[0])) {
|
|
304
|
-
const n = parseInt(ex.args[0].int, 10);
|
|
305
|
-
return mkPrim({
|
|
306
|
-
prim: 'GET',
|
|
307
|
-
args: [{ int: ex.prim === 'CAR' ? String(n * 2 + 1) : String(n * 2) }],
|
|
308
|
-
annots: ex.annots,
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
return ex;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
// More syntactic conveniences
|
|
317
|
-
// PAPPAIIR macro
|
|
318
|
-
if (pairRe.test(ex.prim)) {
|
|
319
|
-
if (assertArgs(ex, 0)) {
|
|
320
|
-
const { fields, rest } = filterAnnotations(ex.annots);
|
|
321
|
-
const { r } = parsePairUnpairExpr(ex, ex.prim.slice(1), fields, (l, r, top) => [
|
|
322
|
-
...(l || []),
|
|
323
|
-
...(r || []),
|
|
324
|
-
top,
|
|
325
|
-
]);
|
|
326
|
-
return r.map(([v, a], i) => {
|
|
327
|
-
const ann = [
|
|
328
|
-
...trimLast(a, null).map((v) => (v === null ? '%' : v)),
|
|
329
|
-
...(v === 0 && i === r.length - 1 ? rest : []),
|
|
330
|
-
];
|
|
331
|
-
const leaf = mkPrim({ prim: 'PAIR', annots: ann.length !== 0 ? ann : undefined });
|
|
332
|
-
return v === 0
|
|
333
|
-
? leaf
|
|
334
|
-
: {
|
|
335
|
-
prim: 'DIP',
|
|
336
|
-
args: v === 1 ? [[leaf]] : [{ int: String(v) }, [leaf]],
|
|
337
|
-
};
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
// UNPAPPAIIR macro
|
|
342
|
-
if (unpairRe.test(ex.prim)) {
|
|
343
|
-
if ((0, michelson_types_1.ProtoInferiorTo)(proto, michelson_types_1.Protocol.PtEdo2Zk) && assertArgs(ex, 0)) {
|
|
344
|
-
const { r } = parsePairUnpairExpr(ex, ex.prim.slice(3), ex.annots || [], (l, r, top) => [
|
|
345
|
-
top,
|
|
346
|
-
...(r || []),
|
|
347
|
-
...(l || []),
|
|
348
|
-
]);
|
|
349
|
-
return r.map(([v, a]) => {
|
|
350
|
-
const leaf = [
|
|
351
|
-
{ prim: 'DUP' },
|
|
352
|
-
mkPrim({ prim: 'CAR', annots: a[0] !== null ? [a[0]] : undefined }),
|
|
353
|
-
{
|
|
354
|
-
prim: 'DIP',
|
|
355
|
-
args: [[mkPrim({ prim: 'CDR', annots: a[1] !== null ? [a[1]] : undefined })]],
|
|
356
|
-
},
|
|
357
|
-
];
|
|
358
|
-
return v === 0
|
|
359
|
-
? leaf
|
|
360
|
-
: {
|
|
361
|
-
prim: 'DIP',
|
|
362
|
-
args: v === 1 ? [[leaf]] : [{ int: String(v) }, [leaf]],
|
|
363
|
-
};
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
else {
|
|
367
|
-
if (ex.prim === 'UNPAIR') {
|
|
368
|
-
return ex;
|
|
369
|
-
}
|
|
370
|
-
if (assertArgs(ex, 0)) {
|
|
371
|
-
// 008_edo: annotations are deprecated
|
|
372
|
-
const { r } = parsePairUnpairExpr(ex, ex.prim.slice(3), [], (l, r, top) => [
|
|
373
|
-
top,
|
|
374
|
-
...(r || []),
|
|
375
|
-
...(l || []),
|
|
376
|
-
]);
|
|
377
|
-
return r.map(([v]) => {
|
|
378
|
-
const leaf = mkPrim({
|
|
379
|
-
prim: 'UNPAIR',
|
|
380
|
-
});
|
|
381
|
-
return v === 0
|
|
382
|
-
? leaf
|
|
383
|
-
: {
|
|
384
|
-
prim: 'DIP',
|
|
385
|
-
args: v === 1 ? [[leaf]] : [{ int: String(v) }, [leaf]],
|
|
386
|
-
};
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
// C[AD]+R macro
|
|
392
|
-
if (cadrRe.test(ex.prim)) {
|
|
393
|
-
if (assertArgs(ex, 0)) {
|
|
394
|
-
const ch = [...ex.prim.slice(1, ex.prim.length - 1)];
|
|
395
|
-
return ch.map((c, i) => {
|
|
396
|
-
const ann = i === ch.length - 1 ? ex.annots : undefined;
|
|
397
|
-
switch (c) {
|
|
398
|
-
case 'A':
|
|
399
|
-
return mkPrim({ prim: 'CAR', annots: ann });
|
|
400
|
-
case 'D':
|
|
401
|
-
return mkPrim({ prim: 'CDR', annots: ann });
|
|
402
|
-
default:
|
|
403
|
-
throw new MacroError(ex, `unexpected character: ${c}`);
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
// SET_C[AD]+R macro
|
|
409
|
-
if (setCadrRe.test(ex.prim)) {
|
|
410
|
-
if (assertArgs(ex, 0)) {
|
|
411
|
-
const { fields, rest } = filterAnnotations(ex.annots);
|
|
412
|
-
if (fields.length > 1) {
|
|
413
|
-
throw new MacroError(ex, `unexpected annotation on macro ${ex.prim}: ${fields}`);
|
|
414
|
-
}
|
|
415
|
-
const term = fields.length !== 0
|
|
416
|
-
? {
|
|
417
|
-
a: [
|
|
418
|
-
{ prim: 'DUP' },
|
|
419
|
-
{ prim: 'CAR', annots: fields },
|
|
420
|
-
{ prim: 'DROP' },
|
|
421
|
-
{ prim: 'CDR', annots: ['@%%'] },
|
|
422
|
-
{ prim: 'SWAP' },
|
|
423
|
-
{ prim: 'PAIR', annots: [fields[0], '%@'] },
|
|
424
|
-
],
|
|
425
|
-
d: [
|
|
426
|
-
{ prim: 'DUP' },
|
|
427
|
-
{ prim: 'CDR', annots: fields },
|
|
428
|
-
{ prim: 'DROP' },
|
|
429
|
-
{ prim: 'CAR', annots: ['@%%'] },
|
|
430
|
-
{ prim: 'PAIR', annots: ['%@', fields[0]] },
|
|
431
|
-
],
|
|
432
|
-
}
|
|
433
|
-
: {
|
|
434
|
-
a: [
|
|
435
|
-
{ prim: 'CDR', annots: ['@%%'] },
|
|
436
|
-
{ prim: 'SWAP' },
|
|
437
|
-
{ prim: 'PAIR', annots: ['%', '%@'] },
|
|
438
|
-
],
|
|
439
|
-
d: [
|
|
440
|
-
{ prim: 'CAR', annots: ['@%%'] },
|
|
441
|
-
{ prim: 'PAIR', annots: ['%@', '%'] },
|
|
442
|
-
],
|
|
443
|
-
};
|
|
444
|
-
return parseSetMapCadr(ex, ex.prim.slice(5, ex.prim.length - 1), rest, term);
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
// MAP_C[AD]+R macro
|
|
448
|
-
if (mapCadrRe.test(ex.prim)) {
|
|
449
|
-
if (assertArgs(ex, 1)) {
|
|
450
|
-
const { fields } = filterAnnotations(ex.annots);
|
|
451
|
-
if (fields.length > 1) {
|
|
452
|
-
throw new MacroError(ex, `unexpected annotation on macro ${ex.prim}: ${fields}`);
|
|
453
|
-
}
|
|
454
|
-
const term = {
|
|
455
|
-
a: [
|
|
456
|
-
{ prim: 'DUP' },
|
|
457
|
-
{ prim: 'CDR', annots: ['@%%'] },
|
|
458
|
-
{
|
|
459
|
-
prim: 'DIP',
|
|
460
|
-
args: [
|
|
461
|
-
[
|
|
462
|
-
mkPrim({
|
|
463
|
-
prim: 'CAR',
|
|
464
|
-
annots: fields.length !== 0 ? ['@' + fields[0].slice(1)] : undefined,
|
|
465
|
-
}),
|
|
466
|
-
ex.args[0],
|
|
467
|
-
],
|
|
468
|
-
],
|
|
469
|
-
},
|
|
470
|
-
{ prim: 'SWAP' },
|
|
471
|
-
{ prim: 'PAIR', annots: [fields.length !== 0 ? fields[0] : '%', '%@'] },
|
|
472
|
-
],
|
|
473
|
-
d: [
|
|
474
|
-
{ prim: 'DUP' },
|
|
475
|
-
mkPrim({
|
|
476
|
-
prim: 'CDR',
|
|
477
|
-
annots: fields.length !== 0 ? ['@' + fields[0].slice(1)] : undefined,
|
|
478
|
-
}),
|
|
479
|
-
ex.args[0],
|
|
480
|
-
{ prim: 'SWAP' },
|
|
481
|
-
{ prim: 'CAR', annots: ['@%%'] },
|
|
482
|
-
{ prim: 'PAIR', annots: ['%@', fields.length !== 0 ? fields[0] : '%'] },
|
|
483
|
-
],
|
|
484
|
-
};
|
|
485
|
-
return parseSetMapCadr(ex, ex.prim.slice(5, ex.prim.length - 1), [], term);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
// Expand deprecated DI...IP to [DIP n]
|
|
489
|
-
if (diipRe.test(ex.prim)) {
|
|
490
|
-
if (assertArgs(ex, 1)) {
|
|
491
|
-
let n = 0;
|
|
492
|
-
while (ex.prim[1 + n] === 'I') {
|
|
493
|
-
n++;
|
|
494
|
-
}
|
|
495
|
-
return mkPrim({ prim: 'DIP', args: [{ int: String(n) }, ex.args[0]] });
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
// Expand DU...UP and DUP n
|
|
499
|
-
if (duupRe.test(ex.prim)) {
|
|
500
|
-
let n = 0;
|
|
501
|
-
while (ex.prim[1 + n] === 'U') {
|
|
502
|
-
n++;
|
|
503
|
-
}
|
|
504
|
-
if ((0, michelson_types_1.ProtoInferiorTo)(proto, michelson_types_1.Protocol.PtEdo2Zk)) {
|
|
505
|
-
if (n === 1) {
|
|
506
|
-
if (ex.args === undefined) {
|
|
507
|
-
return ex; // skip
|
|
508
|
-
}
|
|
509
|
-
if (assertArgs(ex, 1) && assertIntArg(ex, ex.args[0])) {
|
|
510
|
-
n = parseInt(ex.args[0].int, 10);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
else {
|
|
514
|
-
assertArgs(ex, 0);
|
|
515
|
-
}
|
|
516
|
-
if (n === 1) {
|
|
517
|
-
return [mkPrim({ prim: 'DUP', annots: ex.annots })];
|
|
518
|
-
}
|
|
519
|
-
else if (n === 2) {
|
|
520
|
-
return [
|
|
521
|
-
{
|
|
522
|
-
prim: 'DIP',
|
|
523
|
-
args: [[mkPrim({ prim: 'DUP', annots: ex.annots })]],
|
|
524
|
-
},
|
|
525
|
-
{ prim: 'SWAP' },
|
|
526
|
-
];
|
|
527
|
-
}
|
|
528
|
-
else {
|
|
529
|
-
return [
|
|
530
|
-
{
|
|
531
|
-
prim: 'DIP',
|
|
532
|
-
args: [{ int: String(n - 1) }, [mkPrim({ prim: 'DUP', annots: ex.annots })]],
|
|
533
|
-
},
|
|
534
|
-
{
|
|
535
|
-
prim: 'DIG',
|
|
536
|
-
args: [{ int: String(n) }],
|
|
537
|
-
},
|
|
538
|
-
];
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
else {
|
|
542
|
-
if (n === 1) {
|
|
543
|
-
return ex;
|
|
544
|
-
}
|
|
545
|
-
if (assertArgs(ex, 0)) {
|
|
546
|
-
return mkPrim({ prim: 'DUP', args: [{ int: String(n) }], annots: ex.annots });
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
return ex;
|
|
551
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.emitMicheline = emitMicheline;
|
|
4
|
-
const micheline_1 = require("./micheline");
|
|
5
|
-
class Formatter {
|
|
6
|
-
constructor(opt, lev = 0) {
|
|
7
|
-
this.opt = opt;
|
|
8
|
-
this.lev = lev;
|
|
9
|
-
}
|
|
10
|
-
indent(n = 0) {
|
|
11
|
-
let ret = '';
|
|
12
|
-
if (this.opt?.indent !== undefined) {
|
|
13
|
-
for (let i = this.lev + n; i > 0; i--) {
|
|
14
|
-
ret += this.opt.indent;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return ret;
|
|
18
|
-
}
|
|
19
|
-
get lf() {
|
|
20
|
-
return this.opt?.newline || '';
|
|
21
|
-
}
|
|
22
|
-
get lfsp() {
|
|
23
|
-
return this.opt?.newline || ' ';
|
|
24
|
-
}
|
|
25
|
-
down(n) {
|
|
26
|
-
return new Formatter(this.opt, this.lev + n);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function hasArgs(node) {
|
|
30
|
-
return ('prim' in node &&
|
|
31
|
-
((node.annots !== undefined && node.annots.length !== 0) ||
|
|
32
|
-
(node.args !== undefined && node.args.length !== 0)));
|
|
33
|
-
}
|
|
34
|
-
function isMultiline(node) {
|
|
35
|
-
if (node.args !== undefined) {
|
|
36
|
-
for (const a of node.args) {
|
|
37
|
-
if (Array.isArray(a) || hasArgs(a)) {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
function emitExpr(node, f, foldMacros) {
|
|
45
|
-
const macro = node[micheline_1.sourceReference]?.macro;
|
|
46
|
-
if (foldMacros && macro) {
|
|
47
|
-
return emitExpr(macro, f, foldMacros);
|
|
48
|
-
}
|
|
49
|
-
if (Array.isArray(node)) {
|
|
50
|
-
return emitSeq(node, f, foldMacros);
|
|
51
|
-
}
|
|
52
|
-
else if ('string' in node) {
|
|
53
|
-
return JSON.stringify(node.string);
|
|
54
|
-
}
|
|
55
|
-
else if ('int' in node) {
|
|
56
|
-
return node.int;
|
|
57
|
-
}
|
|
58
|
-
else if ('bytes' in node) {
|
|
59
|
-
return '0x' + node.bytes;
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
if ((node.annots === undefined || node.annots.length === 0) &&
|
|
63
|
-
(node.args === undefined || node.args.length === 0)) {
|
|
64
|
-
return node.prim;
|
|
65
|
-
}
|
|
66
|
-
let ret = '(' + node.prim;
|
|
67
|
-
if (node.annots !== undefined) {
|
|
68
|
-
for (const a of node.annots) {
|
|
69
|
-
ret += ' ' + a;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (node.args !== undefined) {
|
|
73
|
-
const multiline = isMultiline(node);
|
|
74
|
-
for (const a of node.args) {
|
|
75
|
-
if (multiline) {
|
|
76
|
-
ret += f.lfsp + f.indent(1) + emitExpr(a, f.down(1), foldMacros);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
ret += ' ' + emitExpr(a, f, foldMacros);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return ret + ')';
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function emitSeq(node, f, foldMacros) {
|
|
87
|
-
let ret = '{' + f.lf;
|
|
88
|
-
let i = node.length;
|
|
89
|
-
for (const el of node) {
|
|
90
|
-
ret += f.indent(1);
|
|
91
|
-
if ('prim' in el) {
|
|
92
|
-
ret += el.prim;
|
|
93
|
-
if (el.annots !== undefined) {
|
|
94
|
-
for (const a of el.annots) {
|
|
95
|
-
ret += ' ' + a;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (el.args !== undefined) {
|
|
99
|
-
const multiline = isMultiline(el);
|
|
100
|
-
for (const a of el.args) {
|
|
101
|
-
if (multiline) {
|
|
102
|
-
ret += f.lfsp + f.indent(2) + emitExpr(a, f.down(2), foldMacros);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
ret += ' ' + emitExpr(a, f, foldMacros);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
ret += emitExpr(el, f.down(1), foldMacros);
|
|
112
|
-
}
|
|
113
|
-
ret += i > 1 ? ';' + f.lfsp : f.lf;
|
|
114
|
-
i--;
|
|
115
|
-
}
|
|
116
|
-
return ret + f.indent() + '}';
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Formats Micheline expression
|
|
120
|
-
* @param expr An AST node
|
|
121
|
-
* @param opt Options
|
|
122
|
-
*/
|
|
123
|
-
function emitMicheline(expr, opt, foldMacros = false) {
|
|
124
|
-
if (typeof expr !== 'object') {
|
|
125
|
-
throw new TypeError(`object type was expected, got ${typeof expr} instead`);
|
|
126
|
-
}
|
|
127
|
-
return emitExpr(expr, new Formatter(opt), foldMacros);
|
|
128
|
-
}
|