@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,990 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.RpcClient = exports.VERSION = exports.OpKind = exports.RpcClientCache = exports.defaultRPCOptions = exports.defaultChain = exports.castToBigNumber = void 0;
|
|
21
|
-
/**
|
|
22
|
-
* @packageDocumentation
|
|
23
|
-
* @module @taquito/rpc
|
|
24
|
-
*/
|
|
25
|
-
const http_utils_1 = require("@taquito/http-utils");
|
|
26
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
27
|
-
const rpc_client_interface_1 = require("./rpc-client-interface");
|
|
28
|
-
const utils_1 = require("./utils/utils");
|
|
29
|
-
const utils_2 = require("@taquito/utils");
|
|
30
|
-
const core_1 = require("@taquito/core");
|
|
31
|
-
var utils_3 = require("./utils/utils");
|
|
32
|
-
Object.defineProperty(exports, "castToBigNumber", { enumerable: true, get: function () { return utils_3.castToBigNumber; } });
|
|
33
|
-
var rpc_client_interface_2 = require("./rpc-client-interface");
|
|
34
|
-
Object.defineProperty(exports, "defaultChain", { enumerable: true, get: function () { return rpc_client_interface_2.defaultChain; } });
|
|
35
|
-
Object.defineProperty(exports, "defaultRPCOptions", { enumerable: true, get: function () { return rpc_client_interface_2.defaultRPCOptions; } });
|
|
36
|
-
var rpc_cache_1 = require("./rpc-client-modules/rpc-cache");
|
|
37
|
-
Object.defineProperty(exports, "RpcClientCache", { enumerable: true, get: function () { return rpc_cache_1.RpcClientCache; } });
|
|
38
|
-
__exportStar(require("./types"), exports);
|
|
39
|
-
var opkind_1 = require("./opkind");
|
|
40
|
-
Object.defineProperty(exports, "OpKind", { enumerable: true, get: function () { return opkind_1.OpKind; } });
|
|
41
|
-
var version_1 = require("./version");
|
|
42
|
-
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
|
|
43
|
-
/***
|
|
44
|
-
* RpcClient allows interaction with Tezos network through an rpc node
|
|
45
|
-
*/
|
|
46
|
-
class RpcClient {
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @param url rpc root url
|
|
50
|
-
* @param chain chain (default main)
|
|
51
|
-
* @param httpBackend Http backend that issue http request.
|
|
52
|
-
* You can override it by providing your own if you which to hook in the request/response
|
|
53
|
-
*
|
|
54
|
-
* @example new RpcClient('https://mainnet.tezos.ecadinfra.com/', 'main') this will use https://mainnet.tezos.ecadinfra.com//chains/main
|
|
55
|
-
*/
|
|
56
|
-
constructor(url, chain = rpc_client_interface_1.defaultChain, httpBackend = new http_utils_1.HttpBackend()) {
|
|
57
|
-
this.url = url;
|
|
58
|
-
this.chain = chain;
|
|
59
|
-
this.httpBackend = httpBackend;
|
|
60
|
-
}
|
|
61
|
-
createURL(path) {
|
|
62
|
-
// Trim trailing slashes because it is assumed to be included in path
|
|
63
|
-
// the regex solution is prone to ReDoS. Please see: https://stackoverflow.com/questions/6680825/return-string-without-trailing-slash#comment124306698_6680877
|
|
64
|
-
// We also got a CodeQL error for the regex based solution
|
|
65
|
-
let rootUrl = this.url;
|
|
66
|
-
while (rootUrl.endsWith('/')) {
|
|
67
|
-
rootUrl = rootUrl.slice(0, -1);
|
|
68
|
-
}
|
|
69
|
-
return `${rootUrl}${path}`;
|
|
70
|
-
}
|
|
71
|
-
validateAddress(address) {
|
|
72
|
-
const addressValidation = (0, utils_2.validateAddress)(address);
|
|
73
|
-
if (addressValidation !== utils_2.ValidationResult.VALID) {
|
|
74
|
-
throw new core_1.InvalidAddressError(address, addressValidation);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
validateContract(address) {
|
|
78
|
-
const addressValidation = (0, utils_2.validateContractAddress)(address);
|
|
79
|
-
if (addressValidation !== utils_2.ValidationResult.VALID) {
|
|
80
|
-
throw new core_1.InvalidContractAddressError(address, addressValidation);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
85
|
-
* Get the block's hash, its unique identifier.
|
|
86
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-hash
|
|
87
|
-
*/
|
|
88
|
-
async getBlockHash({ block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
89
|
-
const hash = await this.httpBackend.createRequest({
|
|
90
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/hash`),
|
|
91
|
-
method: 'GET',
|
|
92
|
-
});
|
|
93
|
-
return hash;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
97
|
-
* List the ancestors of the given block which, if referred to as the branch in an operation header, are recent enough for that operation to be included in the current block.
|
|
98
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-live-blocks
|
|
99
|
-
*/
|
|
100
|
-
async getLiveBlocks({ block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
101
|
-
const blocks = await this.httpBackend.createRequest({
|
|
102
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/live_blocks`),
|
|
103
|
-
method: 'GET',
|
|
104
|
-
});
|
|
105
|
-
return blocks;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* @param address address from which we want to retrieve the spendable balance
|
|
109
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
110
|
-
* The spendable balance of a contract (in mutez), also known as liquid balance. Corresponds to tez owned by the contract that are neither staked, nor in unstaked requests, nor in frozen bonds. Identical to the 'spendable' RPC.
|
|
111
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-balance
|
|
112
|
-
*/
|
|
113
|
-
async getBalance(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
114
|
-
this.validateAddress(address);
|
|
115
|
-
const balance = await this.httpBackend.createRequest({
|
|
116
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/balance`),
|
|
117
|
-
method: 'GET',
|
|
118
|
-
});
|
|
119
|
-
return new bignumber_js_1.default(balance);
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* @param address address from which we want to retrieve the spendable balance
|
|
123
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
124
|
-
* The spendable balance of a contract (in mutez), also known as liquid balance. Corresponds to tez owned by the contract that are neither staked, nor in unstaked requests, nor in frozen bonds. Identical to the 'balance' RPC.
|
|
125
|
-
*/
|
|
126
|
-
async getSpendable(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
127
|
-
this.validateAddress(address);
|
|
128
|
-
const balance = await this.httpBackend.createRequest({
|
|
129
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/spendable`),
|
|
130
|
-
method: 'GET',
|
|
131
|
-
});
|
|
132
|
-
return new bignumber_js_1.default(balance);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* @param address address from which we want to retrieve balance and frozen bonds
|
|
136
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
137
|
-
* The sum (in mutez) of the spendable balance and frozen bonds of a contract. Corresponds to the contract's full balance from which staked funds and unstake requests have been excluded. Identical to the 'spendable_and_frozen_bonds' RPC.
|
|
138
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-full-balance
|
|
139
|
-
*/
|
|
140
|
-
async getBalanceAndFrozenBonds(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
141
|
-
this.validateAddress(address);
|
|
142
|
-
const balance = await this.httpBackend.createRequest({
|
|
143
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/balance_and_frozen_bonds`),
|
|
144
|
-
method: 'GET',
|
|
145
|
-
});
|
|
146
|
-
return new bignumber_js_1.default(balance);
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* @param address address from which we want to retrieve spendable and frozen bonds
|
|
150
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
151
|
-
* The sum (in mutez) of the spendable balance and frozen bonds of a contract. Corresponds to the contract's full balance from which staked funds and unstake requests have been excluded. Identical to the 'balance_and_frozen_bonds' RPC.
|
|
152
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-full-balance
|
|
153
|
-
*/
|
|
154
|
-
async getSpendableAndFrozenBonds(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
155
|
-
this.validateAddress(address);
|
|
156
|
-
const balance = await this.httpBackend.createRequest({
|
|
157
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/spendable_and_frozen_bonds`),
|
|
158
|
-
method: 'GET',
|
|
159
|
-
});
|
|
160
|
-
return new bignumber_js_1.default(balance);
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* @param address address from which we want to retrieve the full balance
|
|
164
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
165
|
-
* Access the full balance of a contract, including frozen bonds and stake.
|
|
166
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-full-balance
|
|
167
|
-
*/
|
|
168
|
-
async getFullBalance(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
169
|
-
this.validateAddress(address);
|
|
170
|
-
const balance = await this.httpBackend.createRequest({
|
|
171
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/full_balance`),
|
|
172
|
-
method: 'GET',
|
|
173
|
-
});
|
|
174
|
-
return new bignumber_js_1.default(balance);
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* @param address address from which we want to retrieve the staked balance
|
|
178
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
179
|
-
* Access the staked balance of a contract. Returns None if the contract is originated, or neither delegated nor a delegate.
|
|
180
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-staked-balance
|
|
181
|
-
*/
|
|
182
|
-
async getStakedBalance(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
183
|
-
this.validateAddress(address);
|
|
184
|
-
const balance = await this.httpBackend.createRequest({
|
|
185
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/staked_balance`),
|
|
186
|
-
method: 'GET',
|
|
187
|
-
});
|
|
188
|
-
return new bignumber_js_1.default(balance);
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* @param address address from which we want to retrieve the unstaked finalizable balance
|
|
192
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
193
|
-
* Access the balance of a contract that was requested for an unstake operation, and is no longer frozen, which means it will appear in the spendable balance of the contract after any stake/unstake/finalize_unstake operation. Returns None if the contract is originated.
|
|
194
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-unstaked-finalizable-balance
|
|
195
|
-
*/
|
|
196
|
-
async getUnstakedFinalizableBalance(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
197
|
-
this.validateAddress(address);
|
|
198
|
-
const balance = await this.httpBackend.createRequest({
|
|
199
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/unstaked_finalizable_balance`),
|
|
200
|
-
method: 'GET',
|
|
201
|
-
});
|
|
202
|
-
return new bignumber_js_1.default(balance);
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* @param address address from which we want to retrieve the unstaked frozen balance
|
|
206
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
207
|
-
* Access the balance of a contract that was requested for an unstake operation, but is still frozen for the duration of the slashing period. Returns None if the contract is originated.
|
|
208
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-unstaked-frozen-balance
|
|
209
|
-
*/
|
|
210
|
-
async getUnstakedFrozenBalance(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
211
|
-
this.validateAddress(address);
|
|
212
|
-
const balance = await this.httpBackend.createRequest({
|
|
213
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/unstaked_frozen_balance`),
|
|
214
|
-
method: 'GET',
|
|
215
|
-
});
|
|
216
|
-
return new bignumber_js_1.default(balance);
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* @param address address from which we want to retrieve the unstaked requests
|
|
220
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
221
|
-
* Access the unstake requests of the contract. The requests that appear in the finalizable field can be finalized, which means that the contract can transfer these (no longer frozen) funds to their spendable balance with a [finalize_unstake] operation call. Returns null if there is no unstake request pending.
|
|
222
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-unstake-requests
|
|
223
|
-
*/
|
|
224
|
-
async getUnstakeRequests(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
225
|
-
this.validateAddress(address);
|
|
226
|
-
const response = await this.httpBackend.createRequest({
|
|
227
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/unstake_requests`),
|
|
228
|
-
method: 'GET',
|
|
229
|
-
});
|
|
230
|
-
return response === null
|
|
231
|
-
? null
|
|
232
|
-
: {
|
|
233
|
-
finalizable: response.finalizable.map(({ amount, ...rest }) => {
|
|
234
|
-
const castedToBigNumber = (0, utils_1.castToBigNumber)({ amount }, ['amount']);
|
|
235
|
-
return {
|
|
236
|
-
...rest,
|
|
237
|
-
amount: castedToBigNumber.amount,
|
|
238
|
-
};
|
|
239
|
-
}),
|
|
240
|
-
unfinalizable: {
|
|
241
|
-
delegate: response.unfinalizable.delegate,
|
|
242
|
-
requests: response.unfinalizable.requests.map(({ amount, cycle }) => {
|
|
243
|
-
const castedToBigNumber = (0, utils_1.castToBigNumber)({ amount }, ['amount']);
|
|
244
|
-
return {
|
|
245
|
-
cycle,
|
|
246
|
-
amount: castedToBigNumber.amount,
|
|
247
|
-
};
|
|
248
|
-
}),
|
|
249
|
-
},
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* @param address contract address from which we want to retrieve the storage
|
|
254
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
255
|
-
* Access the data of the contract.
|
|
256
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-storage
|
|
257
|
-
*/
|
|
258
|
-
async getStorage(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
259
|
-
this.validateContract(address);
|
|
260
|
-
return this.httpBackend.createRequest({
|
|
261
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/storage`),
|
|
262
|
-
method: 'GET',
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* @param address contract address from which we want to retrieve the script
|
|
267
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
268
|
-
* Access the code and data of the contract.
|
|
269
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-script
|
|
270
|
-
*/
|
|
271
|
-
async getScript(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
272
|
-
this.validateContract(address);
|
|
273
|
-
return this.httpBackend.createRequest({
|
|
274
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/script`),
|
|
275
|
-
method: 'GET',
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* @param address contract address from which we want to retrieve the script
|
|
280
|
-
* @param unparsingMode default is { unparsing_mode: "Readable" }
|
|
281
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
282
|
-
* Access the script of the contract and normalize it using the requested unparsing mode.
|
|
283
|
-
*/
|
|
284
|
-
async getNormalizedScript(address, unparsingMode = { unparsing_mode: 'Readable' }, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
285
|
-
this.validateContract(address);
|
|
286
|
-
return this.httpBackend.createRequest({
|
|
287
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/script/normalized`),
|
|
288
|
-
method: 'POST',
|
|
289
|
-
}, unparsingMode);
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* @param address contract address from which we want to retrieve
|
|
293
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
294
|
-
* Access the complete status of a contract.
|
|
295
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id
|
|
296
|
-
*/
|
|
297
|
-
async getContract(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
298
|
-
this.validateAddress(address);
|
|
299
|
-
const contractResponse = await this.httpBackend.createRequest({
|
|
300
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}`),
|
|
301
|
-
method: 'GET',
|
|
302
|
-
});
|
|
303
|
-
return {
|
|
304
|
-
...contractResponse,
|
|
305
|
-
balance: new bignumber_js_1.default(contractResponse.balance),
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* @param address contract address from which we want to retrieve the manager
|
|
310
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
311
|
-
* Access the manager of an implicit contract
|
|
312
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-manager-key
|
|
313
|
-
*/
|
|
314
|
-
async getManagerKey(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
315
|
-
this.validateAddress(address);
|
|
316
|
-
return this.httpBackend.createRequest({
|
|
317
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/manager_key`),
|
|
318
|
-
method: 'GET',
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* @param address contract address from which we want to retrieve the delegate (baker)
|
|
323
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
324
|
-
* Access the delegate of a contract, if any
|
|
325
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-delegate
|
|
326
|
-
*/
|
|
327
|
-
async getDelegate(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
328
|
-
this.validateAddress(address);
|
|
329
|
-
let delegate;
|
|
330
|
-
try {
|
|
331
|
-
delegate = await this.httpBackend.createRequest({
|
|
332
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${address}/delegate`),
|
|
333
|
-
method: 'GET',
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
catch (ex) {
|
|
337
|
-
if (ex instanceof http_utils_1.HttpResponseError && ex.status === http_utils_1.STATUS_CODE.NOT_FOUND) {
|
|
338
|
-
delegate = null;
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
throw ex;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
return delegate;
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* @param id Big Map ID
|
|
348
|
-
* @param expr Expression hash to query (A b58check encoded Blake2b hash of the expression (The expression can be packed using the pack_data method))
|
|
349
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
350
|
-
* Access the value associated with a key in a big map.
|
|
351
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-big-maps-big-map-id-script-expr
|
|
352
|
-
*/
|
|
353
|
-
async getBigMapExpr(id, expr, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
354
|
-
return this.httpBackend.createRequest({
|
|
355
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/big_maps/${id}/${expr}`),
|
|
356
|
-
method: 'GET',
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* @param args contains optional query arguments (active, inactive, with_minimal_stake, without_minimal_stake)
|
|
361
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
362
|
-
* Lists all registered delegates by default with query arguments to filter unneeded values.
|
|
363
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-delegates-pkh
|
|
364
|
-
*/
|
|
365
|
-
async getAllDelegates(args = {}, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
366
|
-
return await this.httpBackend.createRequest({
|
|
367
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/delegates`),
|
|
368
|
-
method: 'GET',
|
|
369
|
-
query: args,
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* @param address delegate address which we want to retrieve
|
|
374
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
375
|
-
* Everything about a delegate
|
|
376
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-delegates-pkh
|
|
377
|
-
*/
|
|
378
|
-
async getDelegates(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
379
|
-
this.validateAddress(address);
|
|
380
|
-
const response = await this.httpBackend.createRequest({
|
|
381
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/delegates/${address}`),
|
|
382
|
-
method: 'GET',
|
|
383
|
-
});
|
|
384
|
-
const castedResponse = (0, utils_1.castToBigNumber)(response, [
|
|
385
|
-
'balance',
|
|
386
|
-
'full_balance',
|
|
387
|
-
'current_frozen_deposits',
|
|
388
|
-
'frozen_deposits',
|
|
389
|
-
'frozen_balance',
|
|
390
|
-
'frozen_deposits_limit',
|
|
391
|
-
'staking_balance',
|
|
392
|
-
'delegated_balance',
|
|
393
|
-
'voting_power',
|
|
394
|
-
'total_delegated_stake',
|
|
395
|
-
'staking_denominator',
|
|
396
|
-
]);
|
|
397
|
-
if (response.frozen_balance_by_cycle) {
|
|
398
|
-
return {
|
|
399
|
-
...response,
|
|
400
|
-
...castedResponse,
|
|
401
|
-
frozen_balance_by_cycle: response.frozen_balance_by_cycle.map(({ deposit, deposits, fees, rewards, ...rest }) => {
|
|
402
|
-
const castedToBigNumber = (0, utils_1.castToBigNumber)({ deposit, deposits, fees, rewards }, [
|
|
403
|
-
'deposit',
|
|
404
|
-
'deposits',
|
|
405
|
-
'fees',
|
|
406
|
-
'rewards',
|
|
407
|
-
]);
|
|
408
|
-
return {
|
|
409
|
-
...rest,
|
|
410
|
-
deposit: castedToBigNumber.deposit,
|
|
411
|
-
deposits: castedToBigNumber.deposits,
|
|
412
|
-
fees: castedToBigNumber.fees,
|
|
413
|
-
rewards: castedToBigNumber.rewards,
|
|
414
|
-
};
|
|
415
|
-
}),
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
else {
|
|
419
|
-
return {
|
|
420
|
-
...response,
|
|
421
|
-
...castedResponse,
|
|
422
|
-
};
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* @param address delegate address which we want to retrieve
|
|
427
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
428
|
-
* Returns the delegate info (e.g. voting power) found in the listings of the current voting period
|
|
429
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-delegates-pkh-voting-info
|
|
430
|
-
*/
|
|
431
|
-
async getVotingInfo(address, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
432
|
-
this.validateAddress(address);
|
|
433
|
-
return await this.httpBackend.createRequest({
|
|
434
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/delegates/${address}/voting_info`),
|
|
435
|
-
method: 'GET',
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
440
|
-
* All constants
|
|
441
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-constants
|
|
442
|
-
*/
|
|
443
|
-
async getConstants({ block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
444
|
-
const response = await this.httpBackend.createRequest({
|
|
445
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/constants`),
|
|
446
|
-
method: 'GET',
|
|
447
|
-
});
|
|
448
|
-
const castedResponse = (0, utils_1.castToBigNumber)(response, [
|
|
449
|
-
'time_between_blocks',
|
|
450
|
-
'hard_gas_limit_per_operation',
|
|
451
|
-
'hard_gas_limit_per_block',
|
|
452
|
-
'proof_of_work_threshold',
|
|
453
|
-
'tokens_per_roll',
|
|
454
|
-
'seed_nonce_revelation_tip',
|
|
455
|
-
'block_security_deposit',
|
|
456
|
-
'endorsement_security_deposit',
|
|
457
|
-
'block_reward',
|
|
458
|
-
'endorsement_reward',
|
|
459
|
-
'cost_per_byte',
|
|
460
|
-
'hard_storage_limit_per_operation',
|
|
461
|
-
'test_chain_duration',
|
|
462
|
-
'baking_reward_per_endorsement',
|
|
463
|
-
'delay_per_missing_endorsement',
|
|
464
|
-
'minimal_block_delay',
|
|
465
|
-
'liquidity_baking_subsidy',
|
|
466
|
-
'cache_layout',
|
|
467
|
-
'baking_reward_fixed_portion',
|
|
468
|
-
'baking_reward_bonus_per_slot',
|
|
469
|
-
'endorsing_reward_per_slot',
|
|
470
|
-
'double_baking_punishment',
|
|
471
|
-
'delay_increment_per_round',
|
|
472
|
-
'tx_rollup_commitment_bond',
|
|
473
|
-
'vdf_difficulty',
|
|
474
|
-
'sc_rollup_stake_amount',
|
|
475
|
-
'minimal_stake',
|
|
476
|
-
]);
|
|
477
|
-
return {
|
|
478
|
-
...response,
|
|
479
|
-
...castedResponse,
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
|
-
/**
|
|
483
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head) and version.
|
|
484
|
-
* All the information about a block
|
|
485
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id
|
|
486
|
-
* @example getBlock() will default to `/main/chains/block/head?version=1`
|
|
487
|
-
* @example getBlock({ block: 'head~2' }) will return an offset of 2 from head blocks
|
|
488
|
-
* @example getBlock({ block: 'BL8fTiWcSxWCjiMVnDkbh6EuhqVPZzgWheJ2dqwrxYRm9AephXh~2' }) will return an offset of 2 blocks from given block hash..
|
|
489
|
-
*/
|
|
490
|
-
async getBlock({ block, version } = rpc_client_interface_1.defaultRPCOptions) {
|
|
491
|
-
const requestOptions = {
|
|
492
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}`),
|
|
493
|
-
method: 'GET',
|
|
494
|
-
};
|
|
495
|
-
if (version !== undefined) {
|
|
496
|
-
requestOptions.query = { version };
|
|
497
|
-
}
|
|
498
|
-
return await this.httpBackend.createRequest(requestOptions);
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
502
|
-
* The whole block header
|
|
503
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-header
|
|
504
|
-
*/
|
|
505
|
-
async getBlockHeader({ block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
506
|
-
const response = await this.httpBackend.createRequest({
|
|
507
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/header`),
|
|
508
|
-
method: 'GET',
|
|
509
|
-
});
|
|
510
|
-
return response;
|
|
511
|
-
}
|
|
512
|
-
/**
|
|
513
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head) and version
|
|
514
|
-
* All the metadata associated to the block
|
|
515
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-metadata
|
|
516
|
-
*/
|
|
517
|
-
async getBlockMetadata({ block, version, } = rpc_client_interface_1.defaultRPCOptions) {
|
|
518
|
-
const requestOptions = {
|
|
519
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/metadata`),
|
|
520
|
-
method: 'GET',
|
|
521
|
-
};
|
|
522
|
-
if (version !== undefined) {
|
|
523
|
-
requestOptions.query = { version };
|
|
524
|
-
}
|
|
525
|
-
return await this.httpBackend.createRequest(requestOptions);
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* @param args contains optional query arguments (level, cycle, delegate, consensus_key, and max_round)
|
|
529
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
530
|
-
* Retrieves the list of delegates allowed to bake a block.
|
|
531
|
-
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/alpha-openapi.json
|
|
532
|
-
*/
|
|
533
|
-
async getBakingRights(args = {}, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
534
|
-
const response = await this.httpBackend.createRequest({
|
|
535
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/baking_rights`),
|
|
536
|
-
method: 'GET',
|
|
537
|
-
query: args,
|
|
538
|
-
});
|
|
539
|
-
return response;
|
|
540
|
-
}
|
|
541
|
-
/**
|
|
542
|
-
* @param args contains optional query arguments (level, cycle, delegate, and consensus_key)
|
|
543
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
544
|
-
* Retrieves the delegates allowed to attest a block
|
|
545
|
-
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/alpha-openapi.json
|
|
546
|
-
*/
|
|
547
|
-
async getAttestationRights(args = {}, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
548
|
-
const response = await this.httpBackend.createRequest({
|
|
549
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/attestation_rights`),
|
|
550
|
-
method: 'GET',
|
|
551
|
-
query: args,
|
|
552
|
-
});
|
|
553
|
-
return response;
|
|
554
|
-
}
|
|
555
|
-
/**
|
|
556
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
557
|
-
* Ballots casted so far during a voting period
|
|
558
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-ballot-list
|
|
559
|
-
*/
|
|
560
|
-
async getBallotList({ block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
561
|
-
const response = await this.httpBackend.createRequest({
|
|
562
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/ballot_list`),
|
|
563
|
-
method: 'GET',
|
|
564
|
-
});
|
|
565
|
-
return response;
|
|
566
|
-
}
|
|
567
|
-
/**
|
|
568
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
569
|
-
* Sum of ballots casted so far during a voting period
|
|
570
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-ballots
|
|
571
|
-
*/
|
|
572
|
-
async getBallots({ block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
573
|
-
const response = await this.httpBackend.createRequest({
|
|
574
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/ballots`),
|
|
575
|
-
method: 'GET',
|
|
576
|
-
});
|
|
577
|
-
const casted = (0, utils_1.castToBigNumber)(response, ['yay', 'nay', 'pass']);
|
|
578
|
-
return casted;
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
582
|
-
* Current proposal under evaluation.
|
|
583
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-current-proposal
|
|
584
|
-
*/
|
|
585
|
-
async getCurrentProposal({ block, } = rpc_client_interface_1.defaultRPCOptions) {
|
|
586
|
-
const response = await this.httpBackend.createRequest({
|
|
587
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/current_proposal`),
|
|
588
|
-
method: 'GET',
|
|
589
|
-
});
|
|
590
|
-
return response;
|
|
591
|
-
}
|
|
592
|
-
/**
|
|
593
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
594
|
-
* Current expected quorum.
|
|
595
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-current-quorum
|
|
596
|
-
*/
|
|
597
|
-
async getCurrentQuorum({ block, } = rpc_client_interface_1.defaultRPCOptions) {
|
|
598
|
-
const response = await this.httpBackend.createRequest({
|
|
599
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/current_quorum`),
|
|
600
|
-
method: 'GET',
|
|
601
|
-
});
|
|
602
|
-
return response;
|
|
603
|
-
}
|
|
604
|
-
/**
|
|
605
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
606
|
-
* List of delegates with their voting power
|
|
607
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-listings
|
|
608
|
-
*/
|
|
609
|
-
async getVotesListings({ block, } = rpc_client_interface_1.defaultRPCOptions) {
|
|
610
|
-
const response = await this.httpBackend.createRequest({
|
|
611
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/listings`),
|
|
612
|
-
method: 'GET',
|
|
613
|
-
});
|
|
614
|
-
response.map((item) => {
|
|
615
|
-
if (item.voting_power) {
|
|
616
|
-
item.voting_power = new bignumber_js_1.default(item.voting_power);
|
|
617
|
-
}
|
|
618
|
-
return item;
|
|
619
|
-
});
|
|
620
|
-
return response;
|
|
621
|
-
}
|
|
622
|
-
/**
|
|
623
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
624
|
-
* List of proposals with number of supporters
|
|
625
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-proposals
|
|
626
|
-
*/
|
|
627
|
-
async getProposals({ block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
628
|
-
const response = await this.httpBackend.createRequest({
|
|
629
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/proposals`),
|
|
630
|
-
method: 'GET',
|
|
631
|
-
});
|
|
632
|
-
response.map((item) => {
|
|
633
|
-
return (item[1] = new bignumber_js_1.default(item[1]));
|
|
634
|
-
});
|
|
635
|
-
return response;
|
|
636
|
-
}
|
|
637
|
-
/**
|
|
638
|
-
* @param data operation contents to forge
|
|
639
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
640
|
-
* Forge an operation returning the unsigned bytes
|
|
641
|
-
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/alpha-openapi.json
|
|
642
|
-
*/
|
|
643
|
-
async forgeOperations(data, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
644
|
-
return this.httpBackend.createRequest({
|
|
645
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/forge/operations`),
|
|
646
|
-
method: 'POST',
|
|
647
|
-
}, data);
|
|
648
|
-
}
|
|
649
|
-
/**
|
|
650
|
-
* @param signedOpBytes signed bytes to inject
|
|
651
|
-
* Inject an operation in node and broadcast it and return the ID of the operation
|
|
652
|
-
* @see https://tezos.gitlab.io/shell/rpc.html#post-injection-operation
|
|
653
|
-
*/
|
|
654
|
-
async injectOperation(signedOpBytes) {
|
|
655
|
-
return this.httpBackend.createRequest({
|
|
656
|
-
url: this.createURL(`/injection/operation`),
|
|
657
|
-
method: 'POST',
|
|
658
|
-
}, signedOpBytes);
|
|
659
|
-
}
|
|
660
|
-
/**
|
|
661
|
-
* @param ops Operations to apply
|
|
662
|
-
* @param options contains generic configuration for rpc calls to specified block and version
|
|
663
|
-
* Simulate the application of the operations with the context of the given block and return the result of each operation application
|
|
664
|
-
* @see https://tezos.gitlab.io/active/rpc.html#post-block-id-helpers-preapply-operations
|
|
665
|
-
*/
|
|
666
|
-
async preapplyOperations(ops, { block, version } = rpc_client_interface_1.defaultRPCOptions) {
|
|
667
|
-
const requestOptions = {
|
|
668
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/preapply/operations`),
|
|
669
|
-
method: 'POST',
|
|
670
|
-
};
|
|
671
|
-
if (version !== undefined) {
|
|
672
|
-
requestOptions.query = { version };
|
|
673
|
-
}
|
|
674
|
-
return await this.httpBackend.createRequest(requestOptions, ops);
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
|
-
* @param contract address of the contract we want to get the entrypoints of
|
|
678
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
679
|
-
* Return the list of entrypoints of the contract
|
|
680
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-entrypoints
|
|
681
|
-
* @remarks version 005_PsBABY5H
|
|
682
|
-
*/
|
|
683
|
-
async getEntrypoints(contract, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
684
|
-
this.validateContract(contract);
|
|
685
|
-
const contractResponse = await this.httpBackend.createRequest({
|
|
686
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${contract}/entrypoints`),
|
|
687
|
-
method: 'GET',
|
|
688
|
-
});
|
|
689
|
-
return contractResponse;
|
|
690
|
-
}
|
|
691
|
-
/**
|
|
692
|
-
* @param op Operation to simulate
|
|
693
|
-
* @param options contains generic configuration for rpc calls to specified block and version
|
|
694
|
-
* Simulate running an operation at some future moment (based on the number of blocks given in the `latency` argument), and return the operation application result.
|
|
695
|
-
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/alpha-openapi.json
|
|
696
|
-
*/
|
|
697
|
-
async simulateOperation(op, { block, version } = rpc_client_interface_1.defaultRPCOptions) {
|
|
698
|
-
const requestOptions = {
|
|
699
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/scripts/simulate_operation`),
|
|
700
|
-
method: 'POST',
|
|
701
|
-
};
|
|
702
|
-
if (version !== undefined) {
|
|
703
|
-
requestOptions.query = { version };
|
|
704
|
-
}
|
|
705
|
-
return await this.httpBackend.createRequest(requestOptions, op);
|
|
706
|
-
}
|
|
707
|
-
/**
|
|
708
|
-
* @param code Code to run
|
|
709
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
710
|
-
* Run a Michelson script in the current context
|
|
711
|
-
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/alpha-openapi.json
|
|
712
|
-
*/
|
|
713
|
-
async runCode(code, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
714
|
-
const response = await this.httpBackend.createRequest({
|
|
715
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/scripts/run_code`),
|
|
716
|
-
method: 'POST',
|
|
717
|
-
}, code);
|
|
718
|
-
return response;
|
|
719
|
-
}
|
|
720
|
-
/**
|
|
721
|
-
* @param viewScriptParams Parameters of the script view to run
|
|
722
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
723
|
-
* Simulate a call to a michelson view
|
|
724
|
-
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/alpha-openapi.json
|
|
725
|
-
*/
|
|
726
|
-
async runScriptView({ unparsing_mode = 'Readable', ...rest }, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
727
|
-
return this.httpBackend.createRequest({
|
|
728
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/scripts/run_script_view`),
|
|
729
|
-
method: 'POST',
|
|
730
|
-
}, {
|
|
731
|
-
unparsing_mode,
|
|
732
|
-
...rest,
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
/**
|
|
736
|
-
* @param viewParams Parameters of the view to run
|
|
737
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
738
|
-
* Simulate a call to a view following the TZIP-4 standard.
|
|
739
|
-
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/alpha-openapi.json
|
|
740
|
-
*/
|
|
741
|
-
async runView({ unparsing_mode = 'Readable', ...rest }, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
742
|
-
return this.httpBackend.createRequest({
|
|
743
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/scripts/run_view`),
|
|
744
|
-
method: 'POST',
|
|
745
|
-
}, {
|
|
746
|
-
unparsing_mode,
|
|
747
|
-
...rest,
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
async getChainId() {
|
|
751
|
-
return this.httpBackend.createRequest({
|
|
752
|
-
url: this.createURL(`/chains/${this.chain}/chain_id`),
|
|
753
|
-
method: 'GET',
|
|
754
|
-
});
|
|
755
|
-
}
|
|
756
|
-
/**
|
|
757
|
-
* @param data Data to pack
|
|
758
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
759
|
-
* Computes the serialized version of a data expression using the same algorithm as script instruction PACK
|
|
760
|
-
* Note: You should always verify the packed bytes before signing or requesting that they be signed when using the RPC to pack.
|
|
761
|
-
* This precaution helps protect you and your applications users from RPC nodes that have been compromised.
|
|
762
|
-
* A node that is operated by a bad actor, or compromised by a bad actor could return a fully formed operation that does not correspond to the input provided to the RPC endpoint.
|
|
763
|
-
* A safer solution to pack and sign data would be to use the `packDataBytes` function available in the `@taquito/michel-codec` package.
|
|
764
|
-
* @example packData({ data: { string: "test" }, type: { prim: "string" } })
|
|
765
|
-
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/alpha-openapi.json
|
|
766
|
-
*/
|
|
767
|
-
async packData(data, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
768
|
-
const { gas, ...rest } = await this.httpBackend.createRequest({
|
|
769
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/scripts/pack_data`),
|
|
770
|
-
method: 'POST',
|
|
771
|
-
}, data);
|
|
772
|
-
let formattedGas = gas;
|
|
773
|
-
const tryBigNumber = new bignumber_js_1.default(gas || '');
|
|
774
|
-
if (!tryBigNumber.isNaN()) {
|
|
775
|
-
formattedGas = tryBigNumber;
|
|
776
|
-
}
|
|
777
|
-
return { gas: formattedGas, ...rest };
|
|
778
|
-
}
|
|
779
|
-
/**
|
|
780
|
-
*
|
|
781
|
-
* Return rpc root url
|
|
782
|
-
*/
|
|
783
|
-
getRpcUrl() {
|
|
784
|
-
return this.url;
|
|
785
|
-
}
|
|
786
|
-
/**
|
|
787
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
788
|
-
* Returns the voting period (index, kind, starting position) and related information (position, remaining) of the interrogated block
|
|
789
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-current-period
|
|
790
|
-
*/
|
|
791
|
-
async getCurrentPeriod({ block, } = rpc_client_interface_1.defaultRPCOptions) {
|
|
792
|
-
const response = await this.httpBackend.createRequest({
|
|
793
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/current_period`),
|
|
794
|
-
method: 'GET',
|
|
795
|
-
});
|
|
796
|
-
return response;
|
|
797
|
-
}
|
|
798
|
-
/**
|
|
799
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
800
|
-
* Returns the voting period (index, kind, starting position) and related information (position, remaining) of the next block.Useful to craft operations that will be valid in the next block
|
|
801
|
-
* @example getSuccessorPeriod() will default to successor voting period for /main/chains/block/head.
|
|
802
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-successor-period
|
|
803
|
-
*/
|
|
804
|
-
async getSuccessorPeriod({ block, } = rpc_client_interface_1.defaultRPCOptions) {
|
|
805
|
-
const response = await this.httpBackend.createRequest({
|
|
806
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/successor_period`),
|
|
807
|
-
method: 'GET',
|
|
808
|
-
});
|
|
809
|
-
return response;
|
|
810
|
-
}
|
|
811
|
-
/**
|
|
812
|
-
* @param id Sapling state ID
|
|
813
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
814
|
-
* Returns the root and a diff of a state starting from an optional offset which is zero by default
|
|
815
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-sapling-sapling-state-id-get-diff
|
|
816
|
-
*/
|
|
817
|
-
async getSaplingDiffById(id, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
818
|
-
return this.httpBackend.createRequest({
|
|
819
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/sapling/${id}/get_diff`),
|
|
820
|
-
method: 'GET',
|
|
821
|
-
});
|
|
822
|
-
}
|
|
823
|
-
/**
|
|
824
|
-
* @param contract address of the contract we want to get the sapling diff
|
|
825
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
826
|
-
* Returns the root and a diff of a state starting from an optional offset which is zero by default
|
|
827
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-single-sapling-get-diff
|
|
828
|
-
*/
|
|
829
|
-
async getSaplingDiffByContract(contract, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
830
|
-
return this.httpBackend.createRequest({
|
|
831
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${contract}/single_sapling_get_diff`),
|
|
832
|
-
method: 'GET',
|
|
833
|
-
});
|
|
834
|
-
}
|
|
835
|
-
/**
|
|
836
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
837
|
-
* get current and next protocol
|
|
838
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-protocols
|
|
839
|
-
*/
|
|
840
|
-
async getProtocols({ block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
841
|
-
return this.httpBackend.createRequest({
|
|
842
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/protocols`),
|
|
843
|
-
method: 'GET',
|
|
844
|
-
});
|
|
845
|
-
}
|
|
846
|
-
/**
|
|
847
|
-
* @param protocol the protocol hash to look up (default to empty string)
|
|
848
|
-
* get current and next protocol
|
|
849
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-protocols
|
|
850
|
-
*/
|
|
851
|
-
async getProtocolActivations(protocol = '') {
|
|
852
|
-
if (protocol) {
|
|
853
|
-
const protocolValidation = (0, utils_2.validateProtocol)(protocol);
|
|
854
|
-
if (protocolValidation !== utils_2.ValidationResult.VALID) {
|
|
855
|
-
throw new utils_2.InvalidProtocolHashError(protocol, protocolValidation);
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
return this.httpBackend.createRequest({
|
|
859
|
-
url: this.createURL(`/chains/${this.chain}/protocols/${protocol}`),
|
|
860
|
-
method: 'GET',
|
|
861
|
-
});
|
|
862
|
-
}
|
|
863
|
-
/**
|
|
864
|
-
* @param contract address of the contract we want to retrieve storage information of
|
|
865
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
866
|
-
* Access the used storage space of the contract
|
|
867
|
-
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/alpha-openapi.json
|
|
868
|
-
*/
|
|
869
|
-
async getStorageUsedSpace(contract, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
870
|
-
return this.httpBackend.createRequest({
|
|
871
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${contract}/storage/used_space`),
|
|
872
|
-
method: 'GET',
|
|
873
|
-
});
|
|
874
|
-
}
|
|
875
|
-
/**
|
|
876
|
-
* @param contract address of the contract we want to retrieve storage information of
|
|
877
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
878
|
-
* Access the paid storage space of the contract
|
|
879
|
-
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/alpha-openapi.json
|
|
880
|
-
*/
|
|
881
|
-
async getStoragePaidSpace(contract, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
882
|
-
return this.httpBackend.createRequest({
|
|
883
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${contract}/storage/paid_space`),
|
|
884
|
-
method: 'GET',
|
|
885
|
-
});
|
|
886
|
-
}
|
|
887
|
-
/**
|
|
888
|
-
* @param contract implicit or originated address we want to retrieve ticket balance of
|
|
889
|
-
* @param ticket object to specify a ticket by ticketer, content type and content
|
|
890
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
891
|
-
* Access the contract's balance of ticket with specified ticketer, content type, and content.
|
|
892
|
-
* @example ticket { ticketer: 'address', content_type: { prim: "string" }, content: { string: 'ticket1' } }
|
|
893
|
-
* @see https://tezos.gitlab.io/protocols/016_mumbai.html#rpc-changes
|
|
894
|
-
*/
|
|
895
|
-
async getTicketBalance(contract, ticket, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
896
|
-
return this.httpBackend.createRequest({
|
|
897
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${contract}/ticket_balance`),
|
|
898
|
-
method: 'POST',
|
|
899
|
-
}, ticket);
|
|
900
|
-
}
|
|
901
|
-
/**
|
|
902
|
-
* @param contract originated address we want to retrieve ticket balances of
|
|
903
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
904
|
-
* Access the complete list of tickets owned by the given contract by scanning the contract's storage.
|
|
905
|
-
* @see https://tezos.gitlab.io/protocols/016_mumbai.html#rpc-changes
|
|
906
|
-
*/
|
|
907
|
-
async getAllTicketBalances(contract, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
908
|
-
return this.httpBackend.createRequest({
|
|
909
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/contracts/${contract}/all_ticket_balances`),
|
|
910
|
-
method: 'GET',
|
|
911
|
-
});
|
|
912
|
-
}
|
|
913
|
-
/**
|
|
914
|
-
* Returns the cycle at which the launch of the Adaptive Issuance feature is set to happen. A result of null means that the feature is not yet set to launch.
|
|
915
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
916
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-adaptive-issuance-launch-cycle
|
|
917
|
-
*/
|
|
918
|
-
async getAdaptiveIssuanceLaunchCycle({ block, } = rpc_client_interface_1.defaultRPCOptions) {
|
|
919
|
-
return this.httpBackend.createRequest({
|
|
920
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/adaptive_issuance_launch_cycle`),
|
|
921
|
-
method: 'GET',
|
|
922
|
-
});
|
|
923
|
-
}
|
|
924
|
-
/**
|
|
925
|
-
* List the prevalidated operations in mempool (accessibility of mempool depends on each rpc endpoint)
|
|
926
|
-
* @param args has 5 optional properties
|
|
927
|
-
* @default args { version: '2', validated: true, refused: true, outdated, true, branchRefused: true, branchDelayed: true, validationPass: undefined, source: undefined, operationHash: undefined }
|
|
928
|
-
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/tallinn-mempool-openapi-rc.json
|
|
929
|
-
*/
|
|
930
|
-
async getPendingOperations(args = {}) {
|
|
931
|
-
return this.httpBackend.createRequest({
|
|
932
|
-
url: this.createURL(`/chains/${this.chain}/mempool/pending_operations`),
|
|
933
|
-
method: 'GET',
|
|
934
|
-
query: args,
|
|
935
|
-
});
|
|
936
|
-
}
|
|
937
|
-
/**
|
|
938
|
-
* Returns the current mempool fee filter configuration.
|
|
939
|
-
*
|
|
940
|
-
* On Tezos L1 these values commonly resemble the historical fee defaults used by clients.
|
|
941
|
-
* On Tezos X / Tezlink, the same fields are used for estimation but may differ materially,
|
|
942
|
-
* especially the byte fee and the gas-price component.
|
|
943
|
-
*
|
|
944
|
-
* @param args optional query arguments for the mempool/filter endpoint
|
|
945
|
-
*/
|
|
946
|
-
async getMempoolFilter(args = {}) {
|
|
947
|
-
return this.httpBackend.createRequest({
|
|
948
|
-
url: this.createURL(`/chains/${this.chain}/mempool/filter`),
|
|
949
|
-
method: 'GET',
|
|
950
|
-
query: args,
|
|
951
|
-
});
|
|
952
|
-
}
|
|
953
|
-
/**
|
|
954
|
-
* @param delegate delegate address which we want to retrieve active staking parameters
|
|
955
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
956
|
-
* Returns the currently active staking parameters for the given delegate
|
|
957
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-delegates-pkh-active-staking-parameters
|
|
958
|
-
*/
|
|
959
|
-
async getActiveStakingParameters(delegate, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
960
|
-
return await this.httpBackend.createRequest({
|
|
961
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/delegates/${delegate}/active_staking_parameters`),
|
|
962
|
-
method: 'GET',
|
|
963
|
-
});
|
|
964
|
-
}
|
|
965
|
-
/**
|
|
966
|
-
* @param delegate delegate address which we want to retrieve pending staking parameters
|
|
967
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
968
|
-
* Returns the pending values for the given delegate's staking parameters
|
|
969
|
-
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-delegates-pkh-pending-staking-parameters
|
|
970
|
-
*/
|
|
971
|
-
async getPendingStakingParameters(delegate, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
972
|
-
return await this.httpBackend.createRequest({
|
|
973
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/delegates/${delegate}/pending_staking_parameters`),
|
|
974
|
-
method: 'GET',
|
|
975
|
-
});
|
|
976
|
-
}
|
|
977
|
-
/**
|
|
978
|
-
* @param destination address to retrieve the index for
|
|
979
|
-
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
980
|
-
* Returns the index assigned to the address if it was indexed by the opcode INDEX_ADDRESS, otherwise returns null
|
|
981
|
-
* @see https://octez.tezos.com/docs/alpha/rpc.html#get-block-id-context-destination-destination-id-index
|
|
982
|
-
*/
|
|
983
|
-
async getDestinationIndex(destination, { block } = rpc_client_interface_1.defaultRPCOptions) {
|
|
984
|
-
return await this.httpBackend.createRequest({
|
|
985
|
-
url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/destination/${destination}/index`),
|
|
986
|
-
method: 'GET',
|
|
987
|
-
});
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
exports.RpcClient = RpcClient;
|