@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,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Cross-runtime transport error classifier.
|
|
4
|
-
*
|
|
5
|
-
* Inspects structural properties first (err.code, err.cause.code, err.name),
|
|
6
|
-
* falls back to message substring matching only when structure isn't enough.
|
|
7
|
-
* Handles node-fetch FetchError, native fetch/undici TypeError + cause chain,
|
|
8
|
-
* browser TypeError, Deno, and Bun error shapes.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.classifyTransportError = classifyTransportError;
|
|
12
|
-
const MAY_HAVE_REACHED = {
|
|
13
|
-
abort: false,
|
|
14
|
-
dns: false,
|
|
15
|
-
connect: false,
|
|
16
|
-
socket: true,
|
|
17
|
-
tls: false,
|
|
18
|
-
timeout: true,
|
|
19
|
-
network: true,
|
|
20
|
-
};
|
|
21
|
-
function extractCode(err) {
|
|
22
|
-
if (typeof err !== 'object' || err === null)
|
|
23
|
-
return undefined;
|
|
24
|
-
const code = err['code'];
|
|
25
|
-
return typeof code === 'string' ? code : undefined;
|
|
26
|
-
}
|
|
27
|
-
function extractCause(err) {
|
|
28
|
-
if (typeof err !== 'object' || err === null)
|
|
29
|
-
return undefined;
|
|
30
|
-
return err['cause'];
|
|
31
|
-
}
|
|
32
|
-
function extractCauseCode(err) {
|
|
33
|
-
return extractCode(extractCause(err));
|
|
34
|
-
}
|
|
35
|
-
function extractCauseMessage(err) {
|
|
36
|
-
const cause = extractCause(err);
|
|
37
|
-
if (typeof cause === 'object' && cause !== null) {
|
|
38
|
-
const msg = cause['message'];
|
|
39
|
-
if (typeof msg === 'string')
|
|
40
|
-
return msg.toLowerCase();
|
|
41
|
-
}
|
|
42
|
-
return '';
|
|
43
|
-
}
|
|
44
|
-
function classify(kind, err) {
|
|
45
|
-
return { kind, mayHaveReachedServer: MAY_HAVE_REACHED[kind], original: err };
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Classify a thrown value as a transport-level error.
|
|
49
|
-
*
|
|
50
|
-
* Inspects structural properties first (err.code, err.cause.code, err.name),
|
|
51
|
-
* then falls back to message substring matching. Handles node-fetch FetchError,
|
|
52
|
-
* native fetch/undici TypeError + cause chain, browser TypeError, Deno, and Bun.
|
|
53
|
-
*
|
|
54
|
-
* @returns the classification, or `undefined` if the error is not transport-related.
|
|
55
|
-
*/
|
|
56
|
-
function classifyTransportError(err) {
|
|
57
|
-
if (!(err instanceof Error))
|
|
58
|
-
return undefined;
|
|
59
|
-
const code = extractCode(err);
|
|
60
|
-
const causeCode = extractCauseCode(err);
|
|
61
|
-
const msg = err.message.toLowerCase();
|
|
62
|
-
const causeMsg = extractCauseMessage(err);
|
|
63
|
-
// 1. AbortError (our timeout or caller cancel)
|
|
64
|
-
if (err.name === 'AbortError') {
|
|
65
|
-
return classify('abort', err);
|
|
66
|
-
}
|
|
67
|
-
// 2. DNS resolution failure
|
|
68
|
-
if (code === 'ENOTFOUND' ||
|
|
69
|
-
code === 'EAI_AGAIN' ||
|
|
70
|
-
causeCode === 'ENOTFOUND' ||
|
|
71
|
-
causeCode === 'EAI_AGAIN' ||
|
|
72
|
-
msg.includes('enotfound') ||
|
|
73
|
-
msg.includes('eai_again')) {
|
|
74
|
-
return classify('dns', err);
|
|
75
|
-
}
|
|
76
|
-
// 3. Connection refused / connect timeout
|
|
77
|
-
if (code === 'ECONNREFUSED' ||
|
|
78
|
-
causeCode === 'ECONNREFUSED' ||
|
|
79
|
-
causeCode === 'UND_ERR_CONNECT_TIMEOUT' ||
|
|
80
|
-
msg.includes('econnrefused')) {
|
|
81
|
-
return classify('connect', err);
|
|
82
|
-
}
|
|
83
|
-
// 4. TLS errors (check before socket/timeout since TLS errors can also set ECONNRESET)
|
|
84
|
-
// Also inspect cause.message for native fetch which wraps TLS errors in TypeError("fetch failed")
|
|
85
|
-
if (msg.includes('certificate') ||
|
|
86
|
-
msg.includes('self signed') ||
|
|
87
|
-
msg.includes('ssl') ||
|
|
88
|
-
msg.includes('handshake') ||
|
|
89
|
-
causeMsg.includes('certificate') ||
|
|
90
|
-
causeMsg.includes('self signed') ||
|
|
91
|
-
causeMsg.includes('ssl') ||
|
|
92
|
-
causeMsg.includes('handshake')) {
|
|
93
|
-
return classify('tls', err);
|
|
94
|
-
}
|
|
95
|
-
// 5. TCP/connect timeout and undici header/body timeouts
|
|
96
|
-
if (code === 'ETIMEDOUT' ||
|
|
97
|
-
causeCode === 'ETIMEDOUT' ||
|
|
98
|
-
causeCode === 'UND_ERR_HEADERS_TIMEOUT' ||
|
|
99
|
-
causeCode === 'UND_ERR_BODY_TIMEOUT' ||
|
|
100
|
-
msg.includes('etimedout') ||
|
|
101
|
-
msg.includes('timed out')) {
|
|
102
|
-
return classify('timeout', err);
|
|
103
|
-
}
|
|
104
|
-
// 6. Socket-level errors (connection was established or partially established)
|
|
105
|
-
if (code === 'ECONNRESET' ||
|
|
106
|
-
causeCode === 'ECONNRESET' ||
|
|
107
|
-
causeCode === 'UND_ERR_SOCKET' ||
|
|
108
|
-
msg.includes('econnreset') ||
|
|
109
|
-
msg.includes('socket hang up') ||
|
|
110
|
-
msg.includes('other side closed') ||
|
|
111
|
-
msg.includes('closed unexpectedly') ||
|
|
112
|
-
msg.includes('connection reset')) {
|
|
113
|
-
return classify('socket', err);
|
|
114
|
-
}
|
|
115
|
-
// 7. Generic fetch failure (browser TypeError, undici wrapper)
|
|
116
|
-
// "terminated" is undici's wrapper for body-read failures (e.g. response.json() after socket drop)
|
|
117
|
-
if (err instanceof TypeError &&
|
|
118
|
-
(msg.includes('fetch failed') ||
|
|
119
|
-
msg.includes('failed to fetch') ||
|
|
120
|
-
msg.includes('network error') ||
|
|
121
|
-
msg.includes('error sending request') ||
|
|
122
|
-
msg === 'terminated')) {
|
|
123
|
-
return classify('network', err);
|
|
124
|
-
}
|
|
125
|
-
// 8. Remaining node-fetch FetchError.
|
|
126
|
-
// Transport types: 'system' (OS-level), 'request-timeout', 'body-timeout'.
|
|
127
|
-
// Non-transport types: 'invalid-json', 'no-redirect', 'max-size'.
|
|
128
|
-
if (err.name === 'FetchError') {
|
|
129
|
-
const fetchType = err['type'];
|
|
130
|
-
if (fetchType === 'request-timeout' || fetchType === 'body-timeout') {
|
|
131
|
-
return classify('timeout', err);
|
|
132
|
-
}
|
|
133
|
-
if (fetchType === 'system') {
|
|
134
|
-
return classify('network', err);
|
|
135
|
-
}
|
|
136
|
-
// Not a transport error (e.g. JSON parse failure on a 200 response)
|
|
137
|
-
return undefined;
|
|
138
|
-
}
|
|
139
|
-
// Not a transport error
|
|
140
|
-
return undefined;
|
|
141
|
-
}
|
|
@@ -1,543 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.burnLimitDecoder = exports.burnLimitEncoder = exports.entrypointNameDecoder = exports.entrypointNameEncoder = exports.blockPayloadHashDecoder = exports.blockPayloadHashEncoder = exports.valueParameterDecoder = exports.valueParameterEncoder = exports.parametersEncoder = exports.entrypointEncoder = exports.parametersDecoder = exports.entrypointDecoder = exports.zarithDecoder = exports.zarithEncoder = exports.smartRollupCommitmentHashDecoder = exports.smartContractAddressDecoder = exports.smartRollupAddressDecoder = exports.addressDecoder = exports.smartRollupCommitmentHashEncoder = exports.publicKeyDecoder = exports.smartContractAddressEncoder = exports.smartRollupAddressEncoder = exports.addressEncoder = exports.publicKeyEncoder = exports.publicKeyHashesEncoder = exports.publicKeyHashEncoder = exports.delegateDecoder = exports.boolDecoder = exports.int16Decoder = exports.int16Encoder = exports.int32Decoder = exports.int32Encoder = exports.delegateEncoder = exports.pvmKindDecoder = exports.pvmKindEncoder = exports.ballotDecoder = exports.ballotEncoder = exports.proposalsEncoder = exports.proposalsDecoder = exports.proposalDecoder = exports.proposalEncoder = exports.boolEncoder = exports.tz1Encoder = exports.branchEncoder = exports.publicKeyHashesDecoder = exports.publicKeyHashDecoder = exports.branchDecoder = exports.tz1Decoder = exports.prefixDecoder = exports.prefixEncoder = void 0;
|
|
7
|
-
exports.slotHeaderDecoder = exports.slotHeaderEncoder = exports.dalCommitmentDecoder = exports.dalCommitmentEncoder = exports.smartRollupMessageDecoder = exports.smartRollupMessageEncoder = exports.paddedBytesDecoder = exports.paddedBytesEncoder = exports.signatureProofDecoder = exports.signatureProofEncoder = exports.depositsLimitDecoder = exports.depositsLimitEncoder = void 0;
|
|
8
|
-
const utils_1 = require("@taquito/utils");
|
|
9
|
-
const errors_1 = require("./errors");
|
|
10
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
11
|
-
const constants_1 = require("./constants");
|
|
12
|
-
const codec_1 = require("./michelson/codec");
|
|
13
|
-
const uint8array_consumer_1 = require("./uint8array-consumer");
|
|
14
|
-
const utils_2 = require("./utils");
|
|
15
|
-
const core_1 = require("@taquito/core");
|
|
16
|
-
// https://tezos.gitlab.io/shell/p2p_api.html specifies data types and structure for forging
|
|
17
|
-
const prefixEncoder = (prefix) => (str) => {
|
|
18
|
-
const [pl] = (0, utils_1.b58DecodeAndCheckPrefix)(str, [prefix]);
|
|
19
|
-
return (0, utils_1.buf2hex)(pl);
|
|
20
|
-
};
|
|
21
|
-
exports.prefixEncoder = prefixEncoder;
|
|
22
|
-
const prefixDecoder = (pre) => (str) => {
|
|
23
|
-
const val = str.consume(utils_1.payloadLength[pre]);
|
|
24
|
-
return (0, utils_1.b58Encode)(val, pre);
|
|
25
|
-
};
|
|
26
|
-
exports.prefixDecoder = prefixDecoder;
|
|
27
|
-
exports.tz1Decoder = (0, exports.prefixDecoder)(utils_1.PrefixV2.Ed25519PublicKeyHash);
|
|
28
|
-
exports.branchDecoder = (0, exports.prefixDecoder)(utils_1.PrefixV2.BlockHash);
|
|
29
|
-
const publicKeyHashDecoder = (val) => {
|
|
30
|
-
const prefix = val.consume(1);
|
|
31
|
-
if (prefix[0] === 0x00) {
|
|
32
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.Ed25519PublicKeyHash)(val);
|
|
33
|
-
}
|
|
34
|
-
else if (prefix[0] === 0x01) {
|
|
35
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.Secp256k1PublicKeyHash)(val);
|
|
36
|
-
}
|
|
37
|
-
else if (prefix[0] === 0x02) {
|
|
38
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.P256PublicKeyHash)(val);
|
|
39
|
-
}
|
|
40
|
-
else if (prefix[0] === 0x03) {
|
|
41
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.BLS12_381PublicKeyHash)(val);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
exports.publicKeyHashDecoder = publicKeyHashDecoder;
|
|
45
|
-
const publicKeyHashesDecoder = (val) => {
|
|
46
|
-
if (!(0, exports.boolDecoder)(val)) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const publicKeyHashes = [];
|
|
50
|
-
val.consume(4);
|
|
51
|
-
while (val.length() > 0) {
|
|
52
|
-
publicKeyHashes.push((0, exports.publicKeyHashDecoder)(val));
|
|
53
|
-
}
|
|
54
|
-
return publicKeyHashes;
|
|
55
|
-
};
|
|
56
|
-
exports.publicKeyHashesDecoder = publicKeyHashesDecoder;
|
|
57
|
-
exports.branchEncoder = (0, exports.prefixEncoder)(utils_1.PrefixV2.BlockHash);
|
|
58
|
-
exports.tz1Encoder = (0, exports.prefixEncoder)(utils_1.PrefixV2.Ed25519PublicKeyHash);
|
|
59
|
-
const boolEncoder = (bool) => (bool ? 'ff' : '00');
|
|
60
|
-
exports.boolEncoder = boolEncoder;
|
|
61
|
-
const proposalEncoder = (proposal) => {
|
|
62
|
-
return (0, exports.prefixEncoder)(utils_1.PrefixV2.ProtocolHash)(proposal);
|
|
63
|
-
};
|
|
64
|
-
exports.proposalEncoder = proposalEncoder;
|
|
65
|
-
const proposalDecoder = (proposal) => {
|
|
66
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.ProtocolHash)(proposal);
|
|
67
|
-
};
|
|
68
|
-
exports.proposalDecoder = proposalDecoder;
|
|
69
|
-
const proposalsDecoder = (proposal) => {
|
|
70
|
-
const proposals = [];
|
|
71
|
-
proposal.consume(4);
|
|
72
|
-
while (proposal.length() > 0) {
|
|
73
|
-
proposals.push((0, exports.proposalDecoder)(proposal));
|
|
74
|
-
}
|
|
75
|
-
return proposals;
|
|
76
|
-
};
|
|
77
|
-
exports.proposalsDecoder = proposalsDecoder;
|
|
78
|
-
const proposalsEncoder = (proposals) => {
|
|
79
|
-
return (0, utils_2.pad)(32 * proposals.length) + proposals.map((x) => (0, exports.proposalEncoder)(x)).join('');
|
|
80
|
-
};
|
|
81
|
-
exports.proposalsEncoder = proposalsEncoder;
|
|
82
|
-
const ballotEncoder = (ballot) => {
|
|
83
|
-
switch (ballot) {
|
|
84
|
-
case 'yay':
|
|
85
|
-
return '00';
|
|
86
|
-
case 'nay':
|
|
87
|
-
return '01';
|
|
88
|
-
case 'pass':
|
|
89
|
-
return '02';
|
|
90
|
-
default:
|
|
91
|
-
throw new errors_1.InvalidBallotValueError(ballot);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
exports.ballotEncoder = ballotEncoder;
|
|
95
|
-
const ballotDecoder = (ballot) => {
|
|
96
|
-
const value = ballot.consume(1);
|
|
97
|
-
switch (value[0]) {
|
|
98
|
-
case 0x00:
|
|
99
|
-
return 'yay';
|
|
100
|
-
case 0x01:
|
|
101
|
-
return 'nay';
|
|
102
|
-
case 0x02:
|
|
103
|
-
return 'pass';
|
|
104
|
-
default:
|
|
105
|
-
throw new errors_1.DecodeBallotValueError(value[0].toString());
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
exports.ballotDecoder = ballotDecoder;
|
|
109
|
-
const pvmKindEncoder = (pvm) => {
|
|
110
|
-
switch (pvm) {
|
|
111
|
-
case 'arith':
|
|
112
|
-
return '00';
|
|
113
|
-
case 'wasm_2_0_0':
|
|
114
|
-
return '01';
|
|
115
|
-
case 'riscv':
|
|
116
|
-
return '02';
|
|
117
|
-
default:
|
|
118
|
-
throw new errors_1.UnsupportedPvmKindError(pvm);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
exports.pvmKindEncoder = pvmKindEncoder;
|
|
122
|
-
const pvmKindDecoder = (pvm) => {
|
|
123
|
-
const value = pvm.consume(1);
|
|
124
|
-
switch (value[0]) {
|
|
125
|
-
case 0x00:
|
|
126
|
-
return 'arith';
|
|
127
|
-
case 0x01:
|
|
128
|
-
return 'wasm_2_0_0';
|
|
129
|
-
case 0x02:
|
|
130
|
-
return 'riscv';
|
|
131
|
-
default:
|
|
132
|
-
throw new errors_1.DecodePvmKindError(value[0].toString());
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
exports.pvmKindDecoder = pvmKindDecoder;
|
|
136
|
-
const delegateEncoder = (val) => {
|
|
137
|
-
if (val) {
|
|
138
|
-
return (0, exports.boolEncoder)(true) + (0, exports.publicKeyHashEncoder)(val);
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
return (0, exports.boolEncoder)(false);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
exports.delegateEncoder = delegateEncoder;
|
|
145
|
-
const int32Encoder = (val) => {
|
|
146
|
-
const num = parseInt(String(val), 10);
|
|
147
|
-
const byte = [];
|
|
148
|
-
for (let i = 0; i < 4; i++) {
|
|
149
|
-
const shiftBy = (4 - (i + 1)) * 8;
|
|
150
|
-
byte.push((num & (0xff << shiftBy)) >> shiftBy);
|
|
151
|
-
}
|
|
152
|
-
return Buffer.from(byte).toString('hex');
|
|
153
|
-
};
|
|
154
|
-
exports.int32Encoder = int32Encoder;
|
|
155
|
-
const int32Decoder = (val) => {
|
|
156
|
-
const num = val.consume(4);
|
|
157
|
-
let finalNum = 0;
|
|
158
|
-
for (let i = 0; i < num.length; i++) {
|
|
159
|
-
finalNum = finalNum | (num[i] << ((num.length - (i + 1)) * 8));
|
|
160
|
-
}
|
|
161
|
-
return finalNum;
|
|
162
|
-
};
|
|
163
|
-
exports.int32Decoder = int32Decoder;
|
|
164
|
-
const int16Encoder = (val) => {
|
|
165
|
-
const num = parseInt(String(val), 10);
|
|
166
|
-
const byte = [];
|
|
167
|
-
for (let i = 0; i < 2; i++) {
|
|
168
|
-
const shiftBy = (2 - (i + 1)) * 8;
|
|
169
|
-
byte.push((num & (0xff << shiftBy)) >> shiftBy);
|
|
170
|
-
}
|
|
171
|
-
return Buffer.from(byte).toString('hex');
|
|
172
|
-
};
|
|
173
|
-
exports.int16Encoder = int16Encoder;
|
|
174
|
-
const int16Decoder = (val) => {
|
|
175
|
-
const num = val.consume(2);
|
|
176
|
-
let finalNum = 0;
|
|
177
|
-
for (let i = 0; i < num.length; i++) {
|
|
178
|
-
finalNum = finalNum | (num[i] << ((num.length - (i + 1)) * 8));
|
|
179
|
-
}
|
|
180
|
-
return finalNum;
|
|
181
|
-
};
|
|
182
|
-
exports.int16Decoder = int16Decoder;
|
|
183
|
-
const boolDecoder = (val) => {
|
|
184
|
-
const bool = val.consume(1);
|
|
185
|
-
return bool[0] === 0xff;
|
|
186
|
-
};
|
|
187
|
-
exports.boolDecoder = boolDecoder;
|
|
188
|
-
const delegateDecoder = (val) => {
|
|
189
|
-
const hasDelegate = (0, exports.boolDecoder)(val);
|
|
190
|
-
if (hasDelegate) {
|
|
191
|
-
return (0, exports.publicKeyHashDecoder)(val);
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
exports.delegateDecoder = delegateDecoder;
|
|
195
|
-
const publicKeyHashEncoder = (val) => {
|
|
196
|
-
try {
|
|
197
|
-
return (0, utils_1.b58DecodePublicKeyHash)(val);
|
|
198
|
-
}
|
|
199
|
-
catch (err) {
|
|
200
|
-
throw new core_1.InvalidKeyHashError(val, err instanceof core_1.ParameterValidationError ? err.result : undefined);
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
exports.publicKeyHashEncoder = publicKeyHashEncoder;
|
|
204
|
-
const publicKeyHashesEncoder = (val) => {
|
|
205
|
-
if (!val) {
|
|
206
|
-
return (0, exports.boolEncoder)(false);
|
|
207
|
-
}
|
|
208
|
-
if (val.length === 0) {
|
|
209
|
-
return (0, exports.boolEncoder)(true) + (0, utils_2.pad)(0);
|
|
210
|
-
}
|
|
211
|
-
const publicKeyHashes = val.reduce((prev, curr) => {
|
|
212
|
-
return prev + (0, exports.publicKeyHashEncoder)(curr);
|
|
213
|
-
}, '');
|
|
214
|
-
return (0, exports.boolEncoder)(true) + (0, utils_2.pad)(publicKeyHashes.length / 2) + publicKeyHashes;
|
|
215
|
-
};
|
|
216
|
-
exports.publicKeyHashesEncoder = publicKeyHashesEncoder;
|
|
217
|
-
const publicKeyEncoder = (val) => {
|
|
218
|
-
try {
|
|
219
|
-
return (0, utils_1.b58DecodePublicKey)(val);
|
|
220
|
-
}
|
|
221
|
-
catch (err) {
|
|
222
|
-
throw new utils_1.InvalidPublicKeyError(val, err instanceof core_1.ParameterValidationError ? err.result : undefined);
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
exports.publicKeyEncoder = publicKeyEncoder;
|
|
226
|
-
const addressEncoder = (val) => {
|
|
227
|
-
return (0, utils_1.b58DecodeAddress)(val);
|
|
228
|
-
};
|
|
229
|
-
exports.addressEncoder = addressEncoder;
|
|
230
|
-
const smartRollupAddressEncoder = (val) => {
|
|
231
|
-
try {
|
|
232
|
-
return (0, exports.prefixEncoder)(utils_1.PrefixV2.SmartRollupHash)(val);
|
|
233
|
-
}
|
|
234
|
-
catch (err) {
|
|
235
|
-
if (err instanceof core_1.ParameterValidationError) {
|
|
236
|
-
throw new errors_1.InvalidSmartRollupAddressError(val);
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
throw err;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
exports.smartRollupAddressEncoder = smartRollupAddressEncoder;
|
|
244
|
-
const smartContractAddressEncoder = (val) => (0, utils_1.b58DecodeAddress)(val);
|
|
245
|
-
exports.smartContractAddressEncoder = smartContractAddressEncoder;
|
|
246
|
-
const publicKeyDecoder = (val) => {
|
|
247
|
-
const preamble = val.consume(1);
|
|
248
|
-
switch (preamble[0]) {
|
|
249
|
-
case 0x00:
|
|
250
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.Ed25519PublicKey)(val);
|
|
251
|
-
case 0x01:
|
|
252
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.Secp256k1PublicKey)(val);
|
|
253
|
-
case 0x02:
|
|
254
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.P256PublicKey)(val);
|
|
255
|
-
case 0x03:
|
|
256
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.BLS12_381PublicKey)(val);
|
|
257
|
-
default:
|
|
258
|
-
throw new utils_1.InvalidPublicKeyError(undefined, utils_1.ValidationResult.NO_PREFIX_MATCHED);
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
exports.publicKeyDecoder = publicKeyDecoder;
|
|
262
|
-
const smartRollupCommitmentHashEncoder = (val) => {
|
|
263
|
-
try {
|
|
264
|
-
return (0, exports.prefixEncoder)(utils_1.PrefixV2.SmartRollupCommitmentHash)(val);
|
|
265
|
-
}
|
|
266
|
-
catch (err) {
|
|
267
|
-
if (err instanceof core_1.ParameterValidationError) {
|
|
268
|
-
throw new errors_1.InvalidSmartRollupCommitmentHashError(val);
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
throw err;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
exports.smartRollupCommitmentHashEncoder = smartRollupCommitmentHashEncoder;
|
|
276
|
-
const addressDecoder = (val) => {
|
|
277
|
-
const preamble = val.consume(1);
|
|
278
|
-
switch (preamble[0]) {
|
|
279
|
-
case 0x00:
|
|
280
|
-
return (0, exports.publicKeyHashDecoder)(val);
|
|
281
|
-
case 0x01: {
|
|
282
|
-
const address = (0, exports.prefixDecoder)(utils_1.PrefixV2.ContractHash)(val);
|
|
283
|
-
val.consume(1);
|
|
284
|
-
return address;
|
|
285
|
-
}
|
|
286
|
-
default:
|
|
287
|
-
throw new core_1.InvalidAddressError(val.toString(), ': Unable to decode.');
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
exports.addressDecoder = addressDecoder;
|
|
291
|
-
const smartRollupAddressDecoder = (val) => {
|
|
292
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.SmartRollupHash)(val);
|
|
293
|
-
};
|
|
294
|
-
exports.smartRollupAddressDecoder = smartRollupAddressDecoder;
|
|
295
|
-
const smartContractAddressDecoder = (val) => {
|
|
296
|
-
const preamble = val.consume(1);
|
|
297
|
-
if (preamble[0] === 0x01) {
|
|
298
|
-
const scAddress = (0, exports.prefixDecoder)(utils_1.PrefixV2.ContractHash)(val);
|
|
299
|
-
val.consume(1);
|
|
300
|
-
return scAddress;
|
|
301
|
-
}
|
|
302
|
-
throw new core_1.InvalidContractAddressError(val.toString(), utils_1.ValidationResult.NO_PREFIX_MATCHED);
|
|
303
|
-
};
|
|
304
|
-
exports.smartContractAddressDecoder = smartContractAddressDecoder;
|
|
305
|
-
const smartRollupCommitmentHashDecoder = (val) => {
|
|
306
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.SmartRollupCommitmentHash)(val);
|
|
307
|
-
};
|
|
308
|
-
exports.smartRollupCommitmentHashDecoder = smartRollupCommitmentHashDecoder;
|
|
309
|
-
const zarithEncoder = (n) => {
|
|
310
|
-
const fn = [];
|
|
311
|
-
let nn = new bignumber_js_1.default(n, 10);
|
|
312
|
-
if (nn.isNaN()) {
|
|
313
|
-
throw new TypeError(`Invalid zarith number ${n}`);
|
|
314
|
-
}
|
|
315
|
-
// eslint-disable-next-line no-constant-condition
|
|
316
|
-
while (true) {
|
|
317
|
-
if (nn.lt(128)) {
|
|
318
|
-
if (nn.lt(16))
|
|
319
|
-
fn.push('0');
|
|
320
|
-
fn.push(nn.toString(16));
|
|
321
|
-
break;
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
let b = nn.mod(128);
|
|
325
|
-
nn = nn.minus(b);
|
|
326
|
-
nn = nn.dividedBy(128);
|
|
327
|
-
b = b.plus(128);
|
|
328
|
-
fn.push(b.toString(16));
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
return fn.join('');
|
|
332
|
-
};
|
|
333
|
-
exports.zarithEncoder = zarithEncoder;
|
|
334
|
-
const zarithDecoder = (n) => {
|
|
335
|
-
let mostSignificantByte = 0;
|
|
336
|
-
while (mostSignificantByte < n.length() && (n.get(mostSignificantByte) & 128) !== 0) {
|
|
337
|
-
mostSignificantByte += 1;
|
|
338
|
-
}
|
|
339
|
-
let num = new bignumber_js_1.default(0);
|
|
340
|
-
for (let i = mostSignificantByte; i >= 0; i -= 1) {
|
|
341
|
-
const tmp = n.get(i) & 0x7f;
|
|
342
|
-
num = num.multipliedBy(128);
|
|
343
|
-
num = num.plus(tmp);
|
|
344
|
-
}
|
|
345
|
-
n.consume(mostSignificantByte + 1);
|
|
346
|
-
return new bignumber_js_1.default(num).toString();
|
|
347
|
-
};
|
|
348
|
-
exports.zarithDecoder = zarithDecoder;
|
|
349
|
-
const entrypointDecoder = (value) => {
|
|
350
|
-
const preamble = (0, utils_2.pad)(value.consume(1)[0], 2);
|
|
351
|
-
if (preamble in constants_1.entrypointMapping) {
|
|
352
|
-
return constants_1.entrypointMapping[preamble];
|
|
353
|
-
}
|
|
354
|
-
else {
|
|
355
|
-
const entry = (0, codec_1.extractRequiredLen)(value, 1);
|
|
356
|
-
const entrypoint = Buffer.from(entry).toString('utf8');
|
|
357
|
-
if (entrypoint.length > constants_1.ENTRYPOINT_MAX_LENGTH) {
|
|
358
|
-
throw new errors_1.OversizedEntryPointError(entrypoint);
|
|
359
|
-
}
|
|
360
|
-
return entrypoint;
|
|
361
|
-
}
|
|
362
|
-
};
|
|
363
|
-
exports.entrypointDecoder = entrypointDecoder;
|
|
364
|
-
const parametersDecoder = (val) => {
|
|
365
|
-
const preamble = val.consume(1);
|
|
366
|
-
if (preamble[0] === 0x00) {
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
const encodedEntrypoint = (0, exports.entrypointDecoder)(val);
|
|
371
|
-
const params = (0, codec_1.extractRequiredLen)(val);
|
|
372
|
-
const parameters = (0, codec_1.valueDecoder)(new uint8array_consumer_1.Uint8ArrayConsumer(params));
|
|
373
|
-
return {
|
|
374
|
-
entrypoint: encodedEntrypoint,
|
|
375
|
-
value: parameters,
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
};
|
|
379
|
-
exports.parametersDecoder = parametersDecoder;
|
|
380
|
-
const entrypointEncoder = (entrypoint) => {
|
|
381
|
-
if (entrypoint in constants_1.entrypointMappingReverse) {
|
|
382
|
-
return `${constants_1.entrypointMappingReverse[entrypoint]}`;
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
if (entrypoint.length > constants_1.ENTRYPOINT_MAX_LENGTH) {
|
|
386
|
-
throw new errors_1.OversizedEntryPointError(entrypoint);
|
|
387
|
-
}
|
|
388
|
-
const value = { string: entrypoint };
|
|
389
|
-
return `ff${(0, codec_1.valueEncoder)(value).slice(8)}`;
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
exports.entrypointEncoder = entrypointEncoder;
|
|
393
|
-
const parametersEncoder = (val) => {
|
|
394
|
-
if (!val || (val.entrypoint === 'default' && 'prim' in val.value && val.value.prim === 'Unit')) {
|
|
395
|
-
return '00';
|
|
396
|
-
}
|
|
397
|
-
const encodedEntrypoint = (0, exports.entrypointEncoder)(val.entrypoint);
|
|
398
|
-
const parameters = (0, codec_1.valueEncoder)(val.value);
|
|
399
|
-
const length = (0, utils_2.pad)(parameters.length / 2);
|
|
400
|
-
return `ff${encodedEntrypoint}${length}${parameters}`;
|
|
401
|
-
};
|
|
402
|
-
exports.parametersEncoder = parametersEncoder;
|
|
403
|
-
const valueParameterEncoder = (value) => {
|
|
404
|
-
const valueEncoded = (0, codec_1.valueEncoder)(value);
|
|
405
|
-
return `${(0, utils_2.pad)(valueEncoded.length / 2)}${valueEncoded}`;
|
|
406
|
-
};
|
|
407
|
-
exports.valueParameterEncoder = valueParameterEncoder;
|
|
408
|
-
const valueParameterDecoder = (val) => {
|
|
409
|
-
const value = (0, codec_1.extractRequiredLen)(val);
|
|
410
|
-
return (0, codec_1.valueDecoder)(new uint8array_consumer_1.Uint8ArrayConsumer(value));
|
|
411
|
-
};
|
|
412
|
-
exports.valueParameterDecoder = valueParameterDecoder;
|
|
413
|
-
exports.blockPayloadHashEncoder = (0, exports.prefixEncoder)(utils_1.PrefixV2.ValueHash);
|
|
414
|
-
exports.blockPayloadHashDecoder = (0, exports.prefixDecoder)(utils_1.PrefixV2.ValueHash);
|
|
415
|
-
const entrypointNameEncoder = (entrypoint) => {
|
|
416
|
-
const value = { string: entrypoint };
|
|
417
|
-
return `${(0, codec_1.valueEncoder)(value).slice(2)}`;
|
|
418
|
-
};
|
|
419
|
-
exports.entrypointNameEncoder = entrypointNameEncoder;
|
|
420
|
-
const entrypointNameDecoder = (val) => {
|
|
421
|
-
const entry = (0, codec_1.extractRequiredLen)(val);
|
|
422
|
-
return Buffer.from(entry).toString('utf8');
|
|
423
|
-
};
|
|
424
|
-
exports.entrypointNameDecoder = entrypointNameDecoder;
|
|
425
|
-
const burnLimitEncoder = (val) => {
|
|
426
|
-
return !val ? '00' : `ff${(0, exports.zarithEncoder)(val)}`;
|
|
427
|
-
};
|
|
428
|
-
exports.burnLimitEncoder = burnLimitEncoder;
|
|
429
|
-
const burnLimitDecoder = (value) => {
|
|
430
|
-
const prefix = value.consume(1);
|
|
431
|
-
if (Buffer.from(prefix).toString('hex') !== '00') {
|
|
432
|
-
return (0, exports.zarithDecoder)(value);
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
exports.burnLimitDecoder = burnLimitDecoder;
|
|
436
|
-
const depositsLimitEncoder = (val) => {
|
|
437
|
-
return !val ? '00' : `ff${(0, exports.zarithEncoder)(val)}`;
|
|
438
|
-
};
|
|
439
|
-
exports.depositsLimitEncoder = depositsLimitEncoder;
|
|
440
|
-
const depositsLimitDecoder = (value) => {
|
|
441
|
-
const prefix = value.consume(1);
|
|
442
|
-
if (Buffer.from(prefix).toString('hex') !== '00') {
|
|
443
|
-
return (0, exports.zarithDecoder)(value);
|
|
444
|
-
}
|
|
445
|
-
};
|
|
446
|
-
exports.depositsLimitDecoder = depositsLimitDecoder;
|
|
447
|
-
const signatureV1Encoder = (val) => {
|
|
448
|
-
try {
|
|
449
|
-
const [data, pre] = (0, utils_1.b58DecodeAndCheckPrefix)(val, utils_1.signaturePrefixes);
|
|
450
|
-
if (pre === utils_1.PrefixV2.BLS12_381Signature) {
|
|
451
|
-
return (0, exports.paddedBytesEncoder)((0, utils_1.buf2hex)(data));
|
|
452
|
-
}
|
|
453
|
-
else {
|
|
454
|
-
throw new core_1.ProhibitedActionError('we only support encoding of BLSIG signatures from protocol Seoul');
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
catch (err) {
|
|
458
|
-
if (err instanceof core_1.ParameterValidationError) {
|
|
459
|
-
throw new core_1.InvalidSignatureError(val, err.result);
|
|
460
|
-
}
|
|
461
|
-
else {
|
|
462
|
-
throw err;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
};
|
|
466
|
-
const signatureV1Decoder = (val) => {
|
|
467
|
-
val.consume(4);
|
|
468
|
-
if (val.length().toString() === '96') {
|
|
469
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.BLS12_381Signature)(val);
|
|
470
|
-
}
|
|
471
|
-
else {
|
|
472
|
-
throw new core_1.ProhibitedActionError('we only support decoding of BLSIG signatures');
|
|
473
|
-
}
|
|
474
|
-
};
|
|
475
|
-
const signatureProofEncoder = (val) => {
|
|
476
|
-
if (val) {
|
|
477
|
-
return (0, exports.boolEncoder)(true) + signatureV1Encoder(val);
|
|
478
|
-
}
|
|
479
|
-
else {
|
|
480
|
-
return (0, exports.boolEncoder)(false);
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
exports.signatureProofEncoder = signatureProofEncoder;
|
|
484
|
-
const signatureProofDecoder = (value) => {
|
|
485
|
-
const hasProof = (0, exports.boolDecoder)(value);
|
|
486
|
-
if (hasProof) {
|
|
487
|
-
return signatureV1Decoder(value);
|
|
488
|
-
}
|
|
489
|
-
};
|
|
490
|
-
exports.signatureProofDecoder = signatureProofDecoder;
|
|
491
|
-
const paddedBytesEncoder = (val, paddingLength = 8) => {
|
|
492
|
-
return `${(0, utils_2.pad)(val.length / 2, paddingLength)}${val}`;
|
|
493
|
-
};
|
|
494
|
-
exports.paddedBytesEncoder = paddedBytesEncoder;
|
|
495
|
-
const paddedBytesDecoder = (val) => {
|
|
496
|
-
const value = (0, codec_1.extractRequiredLen)(val);
|
|
497
|
-
return Buffer.from(value).toString('hex');
|
|
498
|
-
};
|
|
499
|
-
exports.paddedBytesDecoder = paddedBytesDecoder;
|
|
500
|
-
const smartRollupMessageEncoder = (val) => {
|
|
501
|
-
const message = val.reduce((prev, curr) => {
|
|
502
|
-
return prev + `${(0, utils_2.pad)(curr.length / 2)}${curr}`;
|
|
503
|
-
}, '');
|
|
504
|
-
return `${(0, utils_2.pad)(message.length / 2)}${message}`;
|
|
505
|
-
};
|
|
506
|
-
exports.smartRollupMessageEncoder = smartRollupMessageEncoder;
|
|
507
|
-
const smartRollupMessageDecoder = (val) => {
|
|
508
|
-
const valueArray = (0, codec_1.extractRequiredLen)(val);
|
|
509
|
-
const ret = (0, codec_1.stripLengthPrefixFromBytes)(new uint8array_consumer_1.Uint8ArrayConsumer(valueArray));
|
|
510
|
-
return ret.map((value) => Buffer.from(value).toString('hex'));
|
|
511
|
-
};
|
|
512
|
-
exports.smartRollupMessageDecoder = smartRollupMessageDecoder;
|
|
513
|
-
const dalCommitmentEncoder = (val) => {
|
|
514
|
-
try {
|
|
515
|
-
return (0, exports.prefixEncoder)(utils_1.PrefixV2.SlotHeader)(val);
|
|
516
|
-
}
|
|
517
|
-
catch (err) {
|
|
518
|
-
if (err instanceof core_1.ParameterValidationError) {
|
|
519
|
-
throw new errors_1.InvalidDalCommitmentError(val);
|
|
520
|
-
}
|
|
521
|
-
else {
|
|
522
|
-
throw err;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
};
|
|
526
|
-
exports.dalCommitmentEncoder = dalCommitmentEncoder;
|
|
527
|
-
const dalCommitmentDecoder = (val) => {
|
|
528
|
-
return (0, exports.prefixDecoder)(utils_1.PrefixV2.SlotHeader)(val);
|
|
529
|
-
};
|
|
530
|
-
exports.dalCommitmentDecoder = dalCommitmentDecoder;
|
|
531
|
-
const slotHeaderEncoder = (val) => {
|
|
532
|
-
return (0, utils_2.pad)(val.slot_index, 2) + (0, exports.dalCommitmentEncoder)(val.commitment) + val.commitment_proof;
|
|
533
|
-
};
|
|
534
|
-
exports.slotHeaderEncoder = slotHeaderEncoder;
|
|
535
|
-
const slotHeaderDecoder = (val) => {
|
|
536
|
-
const preamble = val.consume(1);
|
|
537
|
-
return {
|
|
538
|
-
slot_index: Number(preamble[0].toString(10)),
|
|
539
|
-
commitment: (0, exports.dalCommitmentDecoder)(val),
|
|
540
|
-
commitment_proof: (0, utils_2.toHexString)(val.consume(96)), // rpcForger expect commitment_proof bytes to be len 96
|
|
541
|
-
};
|
|
542
|
-
};
|
|
543
|
-
exports.slotHeaderDecoder = slotHeaderDecoder;
|