@taquito/wallet-connect 24.3.0-beta.2 → 24.3.0-beta.5

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.
Files changed (444) hide show
  1. package/README.md +15 -1
  2. package/dist/lib/{taquito-wallet-connect/src/taquito-wallet-connect.js → taquito-wallet-connect.js} +1 -4
  3. package/dist/lib/{taquito-http-utils/src/version.js → version.js} +2 -2
  4. package/package.json +5 -7
  5. package/dist/lib/taquito/src/batch/constants.js +0 -16
  6. package/dist/lib/taquito/src/batch/rpc-batch-provider.js +0 -327
  7. package/dist/lib/taquito/src/constants.js +0 -135
  8. package/dist/lib/taquito/src/context.js +0 -178
  9. package/dist/lib/taquito/src/contract/big-map.js +0 -57
  10. package/dist/lib/taquito/src/contract/compose.js +0 -6
  11. package/dist/lib/taquito/src/contract/constants.js +0 -4
  12. package/dist/lib/taquito/src/contract/contract-methods/contract-method-factory.js +0 -18
  13. package/dist/lib/taquito/src/contract/contract-methods/contract-method-interface.js +0 -2
  14. package/dist/lib/taquito/src/contract/contract-methods/contract-method-object-param.js +0 -72
  15. package/dist/lib/taquito/src/contract/contract-methods/contract-on-chain-view.js +0 -111
  16. package/dist/lib/taquito/src/contract/contract.js +0 -158
  17. package/dist/lib/taquito/src/contract/errors.js +0 -140
  18. package/dist/lib/taquito/src/contract/index.js +0 -30
  19. package/dist/lib/taquito/src/contract/interface.js +0 -2
  20. package/dist/lib/taquito/src/contract/manager-lambda.js +0 -71
  21. package/dist/lib/taquito/src/contract/prepare.js +0 -231
  22. package/dist/lib/taquito/src/contract/rpc-contract-provider.js +0 -675
  23. package/dist/lib/taquito/src/contract/sapling-state-abstraction.js +0 -24
  24. package/dist/lib/taquito/src/contract/semantic.js +0 -43
  25. package/dist/lib/taquito/src/contract/view_lambda.js +0 -27
  26. package/dist/lib/taquito/src/errors.js +0 -42
  27. package/dist/lib/taquito/src/estimate/errors.js +0 -16
  28. package/dist/lib/taquito/src/estimate/estimate-provider-interface.js +0 -2
  29. package/dist/lib/taquito/src/estimate/estimate.js +0 -176
  30. package/dist/lib/taquito/src/estimate/index.js +0 -20
  31. package/dist/lib/taquito/src/estimate/rpc-estimate-provider.js +0 -640
  32. package/dist/lib/taquito/src/extension/extension.js +0 -2
  33. package/dist/lib/taquito/src/forger/composite-forger.js +0 -32
  34. package/dist/lib/taquito/src/forger/errors.js +0 -30
  35. package/dist/lib/taquito/src/forger/rpc-forger.js +0 -12
  36. package/dist/lib/taquito/src/forger/taquito-local-forger.js +0 -21
  37. package/dist/lib/taquito/src/global-constants/default-global-constants-provider.js +0 -35
  38. package/dist/lib/taquito/src/global-constants/errors.js +0 -30
  39. package/dist/lib/taquito/src/global-constants/interface-global-constants-provider.js +0 -2
  40. package/dist/lib/taquito/src/global-constants/noop-global-constants-provider.js +0 -10
  41. package/dist/lib/taquito/src/import-key.js +0 -40
  42. package/dist/lib/taquito/src/injector/helper.js +0 -18
  43. package/dist/lib/taquito/src/injector/interface.js +0 -2
  44. package/dist/lib/taquito/src/injector/rpc-injector.js +0 -27
  45. package/dist/lib/taquito/src/operations/ballot-operation.js +0 -32
  46. package/dist/lib/taquito/src/operations/batch-operation.js +0 -69
  47. package/dist/lib/taquito/src/operations/delegate-operation.js +0 -54
  48. package/dist/lib/taquito/src/operations/drain-delegate-operation.js +0 -31
  49. package/dist/lib/taquito/src/operations/errors.js +0 -133
  50. package/dist/lib/taquito/src/operations/failing-noop-operation.js +0 -2
  51. package/dist/lib/taquito/src/operations/increase-paid-storage-operation.js +0 -49
  52. package/dist/lib/taquito/src/operations/index.js +0 -54
  53. package/dist/lib/taquito/src/operations/operations.js +0 -193
  54. package/dist/lib/taquito/src/operations/origination-operation.js +0 -78
  55. package/dist/lib/taquito/src/operations/proposals-operation.js +0 -29
  56. package/dist/lib/taquito/src/operations/register-global-constant-operation.js +0 -52
  57. package/dist/lib/taquito/src/operations/reveal-operation.js +0 -74
  58. package/dist/lib/taquito/src/operations/smart-rollup-add-messages-operation.js +0 -44
  59. package/dist/lib/taquito/src/operations/smart-rollup-execute-outbox-message-operation.js +0 -53
  60. package/dist/lib/taquito/src/operations/smart-rollup-originate-operation.js +0 -50
  61. package/dist/lib/taquito/src/operations/transaction-operation.js +0 -73
  62. package/dist/lib/taquito/src/operations/transfer-ticket-operation.js +0 -47
  63. package/dist/lib/taquito/src/operations/types.js +0 -88
  64. package/dist/lib/taquito/src/operations/update-companion-key-operation.js +0 -55
  65. package/dist/lib/taquito/src/operations/update-consensus-key-operation.js +0 -55
  66. package/dist/lib/taquito/src/packer/interface.js +0 -2
  67. package/dist/lib/taquito/src/packer/michel-codec-packer.js +0 -11
  68. package/dist/lib/taquito/src/packer/rpc-packer.js +0 -12
  69. package/dist/lib/taquito/src/parser/interface.js +0 -2
  70. package/dist/lib/taquito/src/parser/michel-codec-parser.js +0 -110
  71. package/dist/lib/taquito/src/parser/noop-parser.js +0 -9
  72. package/dist/lib/taquito/src/prepare/index.js +0 -18
  73. package/dist/lib/taquito/src/prepare/interface.js +0 -2
  74. package/dist/lib/taquito/src/prepare/prepare-provider.js +0 -1049
  75. package/dist/lib/taquito/src/provider.js +0 -363
  76. package/dist/lib/taquito/src/read-provider/interface.js +0 -2
  77. package/dist/lib/taquito/src/read-provider/rpc-read-adapter.js +0 -183
  78. package/dist/lib/taquito/src/signer/errors.js +0 -17
  79. package/dist/lib/taquito/src/signer/noop.js +0 -23
  80. package/dist/lib/taquito/src/subscribe/create-observable-from-subscription.js +0 -20
  81. package/dist/lib/taquito/src/subscribe/errors.js +0 -30
  82. package/dist/lib/taquito/src/subscribe/filters.js +0 -96
  83. package/dist/lib/taquito/src/subscribe/interface.js +0 -2
  84. package/dist/lib/taquito/src/subscribe/observable-subscription.js +0 -79
  85. package/dist/lib/taquito/src/subscribe/polling-subcribe-provider.js +0 -118
  86. package/dist/lib/taquito/src/taquito.js +0 -404
  87. package/dist/lib/taquito/src/tz/interface.js +0 -2
  88. package/dist/lib/taquito/src/tz/rpc-tz-provider.js +0 -46
  89. package/dist/lib/taquito/src/version.js +0 -8
  90. package/dist/lib/taquito/src/wallet/batch-operation.js +0 -71
  91. package/dist/lib/taquito/src/wallet/delegation-operation.js +0 -42
  92. package/dist/lib/taquito/src/wallet/errors.js +0 -40
  93. package/dist/lib/taquito/src/wallet/increase-paid-storage-operation.js +0 -42
  94. package/dist/lib/taquito/src/wallet/index.js +0 -25
  95. package/dist/lib/taquito/src/wallet/interface.js +0 -2
  96. package/dist/lib/taquito/src/wallet/legacy.js +0 -51
  97. package/dist/lib/taquito/src/wallet/operation-factory.js +0 -88
  98. package/dist/lib/taquito/src/wallet/operation.js +0 -221
  99. package/dist/lib/taquito/src/wallet/origination-operation.js +0 -53
  100. package/dist/lib/taquito/src/wallet/receipt.js +0 -46
  101. package/dist/lib/taquito/src/wallet/register-global-constant-operation.js +0 -45
  102. package/dist/lib/taquito/src/wallet/transaction-operation.js +0 -38
  103. package/dist/lib/taquito/src/wallet/transfer-ticket-operation.js +0 -38
  104. package/dist/lib/taquito/src/wallet/wallet.js +0 -445
  105. package/dist/lib/taquito-core/src/errors.js +0 -351
  106. package/dist/lib/taquito-core/src/signer-interfaces.js +0 -2
  107. package/dist/lib/taquito-core/src/taquito-core.js +0 -22
  108. package/dist/lib/taquito-http-utils/src/errors.js +0 -103
  109. package/dist/lib/taquito-http-utils/src/status_code.js +0 -322
  110. package/dist/lib/taquito-http-utils/src/taquito-http-utils.js +0 -308
  111. package/dist/lib/taquito-http-utils/src/transport-errors.js +0 -141
  112. package/dist/lib/taquito-local-forging/src/codec.js +0 -543
  113. package/dist/lib/taquito-local-forging/src/constants.js +0 -291
  114. package/dist/lib/taquito-local-forging/src/decoder.js +0 -64
  115. package/dist/lib/taquito-local-forging/src/encoder.js +0 -63
  116. package/dist/lib/taquito-local-forging/src/errors.js +0 -179
  117. package/dist/lib/taquito-local-forging/src/interface.js +0 -2
  118. package/dist/lib/taquito-local-forging/src/michelson/codec.js +0 -283
  119. package/dist/lib/taquito-local-forging/src/protocols.js +0 -60
  120. package/dist/lib/taquito-local-forging/src/schema/operation.js +0 -259
  121. package/dist/lib/taquito-local-forging/src/taquito-local-forging.js +0 -117
  122. package/dist/lib/taquito-local-forging/src/uint8array-consumer.js +0 -35
  123. package/dist/lib/taquito-local-forging/src/utils.js +0 -18
  124. package/dist/lib/taquito-local-forging/src/validator.js +0 -57
  125. package/dist/lib/taquito-local-forging/src/version.js +0 -8
  126. package/dist/lib/taquito-michel-codec/src/base58.js +0 -255
  127. package/dist/lib/taquito-michel-codec/src/binary.js +0 -1271
  128. package/dist/lib/taquito-michel-codec/src/errors.js +0 -90
  129. package/dist/lib/taquito-michel-codec/src/formatters.js +0 -58
  130. package/dist/lib/taquito-michel-codec/src/global-constants.js +0 -12
  131. package/dist/lib/taquito-michel-codec/src/macros.js +0 -551
  132. package/dist/lib/taquito-michel-codec/src/micheline-emitter.js +0 -128
  133. package/dist/lib/taquito-michel-codec/src/micheline-parser.js +0 -402
  134. package/dist/lib/taquito-michel-codec/src/micheline.js +0 -5
  135. package/dist/lib/taquito-michel-codec/src/michelson-contract.js +0 -93
  136. package/dist/lib/taquito-michel-codec/src/michelson-typecheck.js +0 -1756
  137. package/dist/lib/taquito-michel-codec/src/michelson-types.js +0 -83
  138. package/dist/lib/taquito-michel-codec/src/michelson-validator.js +0 -833
  139. package/dist/lib/taquito-michel-codec/src/scan.js +0 -128
  140. package/dist/lib/taquito-michel-codec/src/taquito-michel-codec.js +0 -38
  141. package/dist/lib/taquito-michel-codec/src/utils.js +0 -323
  142. package/dist/lib/taquito-michel-codec/src/version.js +0 -8
  143. package/dist/lib/taquito-michelson-encoder/src/constants.js +0 -11
  144. package/dist/lib/taquito-michelson-encoder/src/errors.js +0 -38
  145. package/dist/lib/taquito-michelson-encoder/src/michelson-map.js +0 -201
  146. package/dist/lib/taquito-michelson-encoder/src/schema/errors.js +0 -127
  147. package/dist/lib/taquito-michelson-encoder/src/schema/event-schema.js +0 -52
  148. package/dist/lib/taquito-michelson-encoder/src/schema/parameter.js +0 -113
  149. package/dist/lib/taquito-michelson-encoder/src/schema/storage.js +0 -260
  150. package/dist/lib/taquito-michelson-encoder/src/schema/types.js +0 -2
  151. package/dist/lib/taquito-michelson-encoder/src/schema/view-schema.js +0 -90
  152. package/dist/lib/taquito-michelson-encoder/src/taquito-michelson-encoder.js +0 -36
  153. package/dist/lib/taquito-michelson-encoder/src/tokens/bigmap.js +0 -130
  154. package/dist/lib/taquito-michelson-encoder/src/tokens/bls12-381-fr.js +0 -86
  155. package/dist/lib/taquito-michelson-encoder/src/tokens/bls12-381-g1.js +0 -76
  156. package/dist/lib/taquito-michelson-encoder/src/tokens/bls12-381-g2.js +0 -76
  157. package/dist/lib/taquito-michelson-encoder/src/tokens/chain-id.js +0 -78
  158. package/dist/lib/taquito-michelson-encoder/src/tokens/chest-key.js +0 -74
  159. package/dist/lib/taquito-michelson-encoder/src/tokens/chest.js +0 -74
  160. package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/address.js +0 -116
  161. package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/bool.js +0 -59
  162. package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/bytes.js +0 -90
  163. package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/int.js +0 -90
  164. package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/key_hash.js +0 -90
  165. package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/mutez.js +0 -90
  166. package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/nat.js +0 -93
  167. package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/string.js +0 -48
  168. package/dist/lib/taquito-michelson-encoder/src/tokens/comparable/timestamp.js +0 -66
  169. package/dist/lib/taquito-michelson-encoder/src/tokens/constant.js +0 -80
  170. package/dist/lib/taquito-michelson-encoder/src/tokens/contract.js +0 -86
  171. package/dist/lib/taquito-michelson-encoder/src/tokens/createToken.js +0 -35
  172. package/dist/lib/taquito-michelson-encoder/src/tokens/key.js +0 -97
  173. package/dist/lib/taquito-michelson-encoder/src/tokens/lambda.js +0 -55
  174. package/dist/lib/taquito-michelson-encoder/src/tokens/list.js +0 -85
  175. package/dist/lib/taquito-michelson-encoder/src/tokens/map.js +0 -112
  176. package/dist/lib/taquito-michelson-encoder/src/tokens/never.js +0 -61
  177. package/dist/lib/taquito-michelson-encoder/src/tokens/operation.js +0 -39
  178. package/dist/lib/taquito-michelson-encoder/src/tokens/option.js +0 -88
  179. package/dist/lib/taquito-michelson-encoder/src/tokens/or.js +0 -282
  180. package/dist/lib/taquito-michelson-encoder/src/tokens/pair.js +0 -233
  181. package/dist/lib/taquito-michelson-encoder/src/tokens/sapling-state.js +0 -84
  182. package/dist/lib/taquito-michelson-encoder/src/tokens/sapling-transaction-deprecated.js +0 -74
  183. package/dist/lib/taquito-michelson-encoder/src/tokens/sapling-transaction.js +0 -74
  184. package/dist/lib/taquito-michelson-encoder/src/tokens/set.js +0 -82
  185. package/dist/lib/taquito-michelson-encoder/src/tokens/signature.js +0 -82
  186. package/dist/lib/taquito-michelson-encoder/src/tokens/ticket-deprecated.js +0 -92
  187. package/dist/lib/taquito-michelson-encoder/src/tokens/ticket.js +0 -92
  188. package/dist/lib/taquito-michelson-encoder/src/tokens/token.js +0 -100
  189. package/dist/lib/taquito-michelson-encoder/src/tokens/tokens.js +0 -75
  190. package/dist/lib/taquito-michelson-encoder/src/tokens/unit.js +0 -52
  191. package/dist/lib/taquito-michelson-encoder/src/version.js +0 -8
  192. package/dist/lib/taquito-rpc/src/opkind.js +0 -49
  193. package/dist/lib/taquito-rpc/src/rpc-client-interface.js +0 -60
  194. package/dist/lib/taquito-rpc/src/rpc-client-modules/rpc-cache.js +0 -1118
  195. package/dist/lib/taquito-rpc/src/taquito-rpc.js +0 -990
  196. package/dist/lib/taquito-rpc/src/types.js +0 -114
  197. package/dist/lib/taquito-rpc/src/utils/utils.js +0 -65
  198. package/dist/lib/taquito-rpc/src/version.js +0 -8
  199. package/dist/lib/taquito-signer/src/bls-key.js +0 -104
  200. package/dist/lib/taquito-signer/src/derivation-tools/ecdsa.js +0 -156
  201. package/dist/lib/taquito-signer/src/derivation-tools/ed25519.js +0 -82
  202. package/dist/lib/taquito-signer/src/derivation-tools/index.js +0 -79
  203. package/dist/lib/taquito-signer/src/derivation-tools/types.js +0 -4
  204. package/dist/lib/taquito-signer/src/derivation-tools/utils.js +0 -16
  205. package/dist/lib/taquito-signer/src/ec-key.js +0 -196
  206. package/dist/lib/taquito-signer/src/ed-key.js +0 -130
  207. package/dist/lib/taquito-signer/src/errors.js +0 -77
  208. package/dist/lib/taquito-signer/src/helpers.js +0 -44
  209. package/dist/lib/taquito-signer/src/in-memory-signer.js +0 -240
  210. package/dist/lib/taquito-signer/src/key-interface.js +0 -6
  211. package/dist/lib/taquito-signer/src/taquito-signer.js +0 -28
  212. package/dist/lib/taquito-signer/src/version.js +0 -8
  213. package/dist/lib/taquito-utils/src/constants.js +0 -203
  214. package/dist/lib/taquito-utils/src/encoding.js +0 -606
  215. package/dist/lib/taquito-utils/src/errors.js +0 -45
  216. package/dist/lib/taquito-utils/src/format.js +0 -29
  217. package/dist/lib/taquito-utils/src/taquito-utils.js +0 -42
  218. package/dist/lib/taquito-utils/src/validators.js +0 -236
  219. package/dist/lib/taquito-utils/src/verify-signature.js +0 -136
  220. package/dist/lib/taquito-utils/src/version.js +0 -8
  221. package/dist/lib/taquito-wallet-connect/src/version.js +0 -8
  222. package/dist/types/taquito/src/batch/constants.d.ts +0 -3
  223. package/dist/types/taquito/src/batch/rpc-batch-provider.d.ts +0 -139
  224. package/dist/types/taquito/src/constants.d.ts +0 -81
  225. package/dist/types/taquito/src/context.d.ts +0 -100
  226. package/dist/types/taquito/src/contract/big-map.d.ts +0 -35
  227. package/dist/types/taquito/src/contract/compose.d.ts +0 -5
  228. package/dist/types/taquito/src/contract/constants.d.ts +0 -1
  229. package/dist/types/taquito/src/contract/contract-methods/contract-method-factory.d.ts +0 -14
  230. package/dist/types/taquito/src/contract/contract-methods/contract-method-interface.d.ts +0 -28
  231. package/dist/types/taquito/src/contract/contract-methods/contract-method-object-param.d.ts +0 -39
  232. package/dist/types/taquito/src/contract/contract-methods/contract-on-chain-view.d.ts +0 -43
  233. package/dist/types/taquito/src/contract/contract.d.ts +0 -75
  234. package/dist/types/taquito/src/contract/errors.d.ts +0 -83
  235. package/dist/types/taquito/src/contract/index.d.ts +0 -11
  236. package/dist/types/taquito/src/contract/interface.d.ts +0 -254
  237. package/dist/types/taquito/src/contract/manager-lambda.d.ts +0 -73
  238. package/dist/types/taquito/src/contract/prepare.d.ts +0 -18
  239. package/dist/types/taquito/src/contract/rpc-contract-provider.d.ts +0 -270
  240. package/dist/types/taquito/src/contract/sapling-state-abstraction.d.ts +0 -17
  241. package/dist/types/taquito/src/contract/semantic.d.ts +0 -7
  242. package/dist/types/taquito/src/contract/view_lambda.d.ts +0 -34
  243. package/dist/types/taquito/src/errors.d.ts +0 -26
  244. package/dist/types/taquito/src/estimate/errors.d.ts +0 -8
  245. package/dist/types/taquito/src/estimate/estimate-provider-interface.d.ts +0 -153
  246. package/dist/types/taquito/src/estimate/estimate.d.ts +0 -111
  247. package/dist/types/taquito/src/estimate/index.d.ts +0 -4
  248. package/dist/types/taquito/src/estimate/rpc-estimate-provider.d.ts +0 -174
  249. package/dist/types/taquito/src/extension/extension.d.ts +0 -4
  250. package/dist/types/taquito/src/forger/composite-forger.d.ts +0 -6
  251. package/dist/types/taquito/src/forger/errors.d.ts +0 -16
  252. package/dist/types/taquito/src/forger/rpc-forger.d.ts +0 -7
  253. package/dist/types/taquito/src/forger/taquito-local-forger.d.ts +0 -8
  254. package/dist/types/taquito/src/global-constants/default-global-constants-provider.d.ts +0 -18
  255. package/dist/types/taquito/src/global-constants/errors.d.ts +0 -16
  256. package/dist/types/taquito/src/global-constants/interface-global-constants-provider.d.ts +0 -11
  257. package/dist/types/taquito/src/global-constants/noop-global-constants-provider.d.ts +0 -5
  258. package/dist/types/taquito/src/import-key.d.ts +0 -13
  259. package/dist/types/taquito/src/injector/helper.d.ts +0 -2
  260. package/dist/types/taquito/src/injector/interface.d.ts +0 -5
  261. package/dist/types/taquito/src/injector/rpc-injector.d.ts +0 -7
  262. package/dist/types/taquito/src/operations/ballot-operation.d.ts +0 -18
  263. package/dist/types/taquito/src/operations/batch-operation.d.ts +0 -19
  264. package/dist/types/taquito/src/operations/delegate-operation.d.ts +0 -24
  265. package/dist/types/taquito/src/operations/drain-delegate-operation.d.ts +0 -17
  266. package/dist/types/taquito/src/operations/errors.d.ts +0 -50
  267. package/dist/types/taquito/src/operations/failing-noop-operation.d.ts +0 -17
  268. package/dist/types/taquito/src/operations/increase-paid-storage-operation.d.ts +0 -23
  269. package/dist/types/taquito/src/operations/index.d.ts +0 -18
  270. package/dist/types/taquito/src/operations/operations.d.ts +0 -35
  271. package/dist/types/taquito/src/operations/origination-operation.d.ts +0 -35
  272. package/dist/types/taquito/src/operations/proposals-operation.d.ts +0 -17
  273. package/dist/types/taquito/src/operations/register-global-constant-operation.d.ts +0 -25
  274. package/dist/types/taquito/src/operations/reveal-operation.d.ts +0 -25
  275. package/dist/types/taquito/src/operations/smart-rollup-add-messages-operation.d.ts +0 -20
  276. package/dist/types/taquito/src/operations/smart-rollup-execute-outbox-message-operation.d.ts +0 -24
  277. package/dist/types/taquito/src/operations/smart-rollup-originate-operation.d.ts +0 -23
  278. package/dist/types/taquito/src/operations/transaction-operation.d.ts +0 -28
  279. package/dist/types/taquito/src/operations/transfer-ticket-operation.d.ts +0 -22
  280. package/dist/types/taquito/src/operations/types.d.ts +0 -823
  281. package/dist/types/taquito/src/operations/update-companion-key-operation.d.ts +0 -23
  282. package/dist/types/taquito/src/operations/update-consensus-key-operation.d.ts +0 -23
  283. package/dist/types/taquito/src/packer/interface.d.ts +0 -4
  284. package/dist/types/taquito/src/packer/michel-codec-packer.d.ts +0 -5
  285. package/dist/types/taquito/src/packer/rpc-packer.d.ts +0 -8
  286. package/dist/types/taquito/src/parser/interface.d.ts +0 -4
  287. package/dist/types/taquito/src/parser/michel-codec-parser.d.ts +0 -16
  288. package/dist/types/taquito/src/parser/noop-parser.d.ts +0 -5
  289. package/dist/types/taquito/src/prepare/index.d.ts +0 -2
  290. package/dist/types/taquito/src/prepare/interface.d.ts +0 -152
  291. package/dist/types/taquito/src/prepare/prepare-provider.d.ts +0 -187
  292. package/dist/types/taquito/src/provider.d.ts +0 -50
  293. package/dist/types/taquito/src/read-provider/interface.d.ts +0 -132
  294. package/dist/types/taquito/src/read-provider/rpc-read-adapter.d.ts +0 -130
  295. package/dist/types/taquito/src/signer/errors.d.ts +0 -8
  296. package/dist/types/taquito/src/signer/noop.d.ts +0 -11
  297. package/dist/types/taquito/src/subscribe/create-observable-from-subscription.d.ts +0 -4
  298. package/dist/types/taquito/src/subscribe/errors.d.ts +0 -18
  299. package/dist/types/taquito/src/subscribe/filters.d.ts +0 -6
  300. package/dist/types/taquito/src/subscribe/interface.d.ts +0 -48
  301. package/dist/types/taquito/src/subscribe/observable-subscription.d.ts +0 -21
  302. package/dist/types/taquito/src/subscribe/polling-subcribe-provider.d.ts +0 -23
  303. package/dist/types/taquito/src/taquito.d.ts +0 -248
  304. package/dist/types/taquito/src/tz/interface.d.ts +0 -20
  305. package/dist/types/taquito/src/tz/rpc-tz-provider.d.ts +0 -13
  306. package/dist/types/taquito/src/version.d.ts +0 -4
  307. package/dist/types/taquito/src/wallet/batch-operation.d.ts +0 -13
  308. package/dist/types/taquito/src/wallet/delegation-operation.d.ts +0 -12
  309. package/dist/types/taquito/src/wallet/errors.d.ts +0 -24
  310. package/dist/types/taquito/src/wallet/increase-paid-storage-operation.d.ts +0 -12
  311. package/dist/types/taquito/src/wallet/index.d.ts +0 -9
  312. package/dist/types/taquito/src/wallet/interface.d.ts +0 -66
  313. package/dist/types/taquito/src/wallet/legacy.d.ts +0 -21
  314. package/dist/types/taquito/src/wallet/operation-factory.d.ts +0 -32
  315. package/dist/types/taquito/src/wallet/operation.d.ts +0 -55
  316. package/dist/types/taquito/src/wallet/origination-operation.d.ts +0 -14
  317. package/dist/types/taquito/src/wallet/receipt.d.ts +0 -16
  318. package/dist/types/taquito/src/wallet/register-global-constant-operation.d.ts +0 -13
  319. package/dist/types/taquito/src/wallet/transaction-operation.d.ts +0 -12
  320. package/dist/types/taquito/src/wallet/transfer-ticket-operation.d.ts +0 -12
  321. package/dist/types/taquito/src/wallet/wallet.d.ts +0 -196
  322. package/dist/types/taquito-core/src/errors.d.ts +0 -213
  323. package/dist/types/taquito-core/src/signer-interfaces.d.ts +0 -38
  324. package/dist/types/taquito-core/src/taquito-core.d.ts +0 -6
  325. package/dist/types/taquito-http-utils/src/errors.d.ts +0 -63
  326. package/dist/types/taquito-http-utils/src/status_code.d.ts +0 -318
  327. package/dist/types/taquito-http-utils/src/taquito-http-utils.d.ts +0 -58
  328. package/dist/types/taquito-http-utils/src/transport-errors.d.ts +0 -28
  329. package/dist/types/taquito-local-forging/src/codec.d.ts +0 -79
  330. package/dist/types/taquito-local-forging/src/constants.d.ts +0 -75
  331. package/dist/types/taquito-local-forging/src/decoder.d.ts +0 -5
  332. package/dist/types/taquito-local-forging/src/encoder.d.ts +0 -4
  333. package/dist/types/taquito-local-forging/src/errors.d.ts +0 -109
  334. package/dist/types/taquito-local-forging/src/interface.d.ts +0 -9
  335. package/dist/types/taquito-local-forging/src/michelson/codec.d.ts +0 -49
  336. package/dist/types/taquito-local-forging/src/protocols.d.ts +0 -27
  337. package/dist/types/taquito-local-forging/src/schema/operation.d.ts +0 -198
  338. package/dist/types/taquito-local-forging/src/taquito-local-forging.d.ts +0 -27
  339. package/dist/types/taquito-local-forging/src/uint8array-consumer.d.ts +0 -10
  340. package/dist/types/taquito-local-forging/src/utils.d.ts +0 -3
  341. package/dist/types/taquito-local-forging/src/validator.d.ts +0 -13
  342. package/dist/types/taquito-local-forging/src/version.d.ts +0 -4
  343. package/dist/types/taquito-michel-codec/src/base58.d.ts +0 -13
  344. package/dist/types/taquito-michel-codec/src/binary.d.ts +0 -127
  345. package/dist/types/taquito-michel-codec/src/errors.d.ts +0 -57
  346. package/dist/types/taquito-michel-codec/src/formatters.d.ts +0 -6
  347. package/dist/types/taquito-michel-codec/src/global-constants.d.ts +0 -3
  348. package/dist/types/taquito-michel-codec/src/macros.d.ts +0 -13
  349. package/dist/types/taquito-michel-codec/src/micheline-emitter.d.ts +0 -17
  350. package/dist/types/taquito-michel-codec/src/micheline-parser.d.ts +0 -130
  351. package/dist/types/taquito-michel-codec/src/micheline.d.ts +0 -44
  352. package/dist/types/taquito-michel-codec/src/michelson-contract.d.ts +0 -24
  353. package/dist/types/taquito-michel-codec/src/michelson-typecheck.d.ts +0 -38
  354. package/dist/types/taquito-michel-codec/src/michelson-types.d.ts +0 -147
  355. package/dist/types/taquito-michel-codec/src/michelson-validator.d.ts +0 -66
  356. package/dist/types/taquito-michel-codec/src/scan.d.ts +0 -26
  357. package/dist/types/taquito-michel-codec/src/taquito-michel-codec.d.ts +0 -16
  358. package/dist/types/taquito-michel-codec/src/utils.d.ts +0 -76
  359. package/dist/types/taquito-michel-codec/src/version.d.ts +0 -4
  360. package/dist/types/taquito-michelson-encoder/src/constants.d.ts +0 -8
  361. package/dist/types/taquito-michelson-encoder/src/errors.d.ts +0 -17
  362. package/dist/types/taquito-michelson-encoder/src/michelson-map.d.ts +0 -82
  363. package/dist/types/taquito-michelson-encoder/src/schema/errors.d.ts +0 -83
  364. package/dist/types/taquito-michelson-encoder/src/schema/event-schema.d.ts +0 -12
  365. package/dist/types/taquito-michelson-encoder/src/schema/parameter.d.ts +0 -54
  366. package/dist/types/taquito-michelson-encoder/src/schema/storage.d.ts +0 -97
  367. package/dist/types/taquito-michelson-encoder/src/schema/types.d.ts +0 -105
  368. package/dist/types/taquito-michelson-encoder/src/schema/view-schema.d.ts +0 -53
  369. package/dist/types/taquito-michelson-encoder/src/taquito-michelson-encoder.d.ts +0 -16
  370. package/dist/types/taquito-michelson-encoder/src/tokens/bigmap.d.ts +0 -51
  371. package/dist/types/taquito-michelson-encoder/src/tokens/bls12-381-fr.d.ts +0 -51
  372. package/dist/types/taquito-michelson-encoder/src/tokens/bls12-381-g1.d.ts +0 -47
  373. package/dist/types/taquito-michelson-encoder/src/tokens/bls12-381-g2.d.ts +0 -47
  374. package/dist/types/taquito-michelson-encoder/src/tokens/chain-id.d.ts +0 -51
  375. package/dist/types/taquito-michelson-encoder/src/tokens/chest-key.d.ts +0 -47
  376. package/dist/types/taquito-michelson-encoder/src/tokens/chest.d.ts +0 -47
  377. package/dist/types/taquito-michelson-encoder/src/tokens/comparable/address.d.ts +0 -61
  378. package/dist/types/taquito-michelson-encoder/src/tokens/comparable/bool.d.ts +0 -32
  379. package/dist/types/taquito-michelson-encoder/src/tokens/comparable/bytes.d.ts +0 -52
  380. package/dist/types/taquito-michelson-encoder/src/tokens/comparable/int.d.ts +0 -56
  381. package/dist/types/taquito-michelson-encoder/src/tokens/comparable/key_hash.d.ts +0 -55
  382. package/dist/types/taquito-michelson-encoder/src/tokens/comparable/mutez.d.ts +0 -53
  383. package/dist/types/taquito-michelson-encoder/src/tokens/comparable/nat.d.ts +0 -55
  384. package/dist/types/taquito-michelson-encoder/src/tokens/comparable/string.d.ts +0 -31
  385. package/dist/types/taquito-michelson-encoder/src/tokens/comparable/timestamp.d.ts +0 -34
  386. package/dist/types/taquito-michelson-encoder/src/tokens/constant.d.ts +0 -51
  387. package/dist/types/taquito-michelson-encoder/src/tokens/contract.d.ts +0 -48
  388. package/dist/types/taquito-michelson-encoder/src/tokens/createToken.d.ts +0 -18
  389. package/dist/types/taquito-michelson-encoder/src/tokens/key.d.ts +0 -55
  390. package/dist/types/taquito-michelson-encoder/src/tokens/lambda.d.ts +0 -24
  391. package/dist/types/taquito-michelson-encoder/src/tokens/list.d.ts +0 -46
  392. package/dist/types/taquito-michelson-encoder/src/tokens/map.d.ts +0 -47
  393. package/dist/types/taquito-michelson-encoder/src/tokens/never.d.ts +0 -41
  394. package/dist/types/taquito-michelson-encoder/src/tokens/operation.d.ts +0 -24
  395. package/dist/types/taquito-michelson-encoder/src/tokens/option.d.ts +0 -37
  396. package/dist/types/taquito-michelson-encoder/src/tokens/or.d.ts +0 -53
  397. package/dist/types/taquito-michelson-encoder/src/tokens/pair.d.ts +0 -50
  398. package/dist/types/taquito-michelson-encoder/src/tokens/sapling-state.d.ts +0 -44
  399. package/dist/types/taquito-michelson-encoder/src/tokens/sapling-transaction-deprecated.d.ts +0 -40
  400. package/dist/types/taquito-michelson-encoder/src/tokens/sapling-transaction.d.ts +0 -40
  401. package/dist/types/taquito-michelson-encoder/src/tokens/set.d.ts +0 -43
  402. package/dist/types/taquito-michelson-encoder/src/tokens/signature.d.ts +0 -53
  403. package/dist/types/taquito-michelson-encoder/src/tokens/ticket-deprecated.d.ts +0 -38
  404. package/dist/types/taquito-michelson-encoder/src/tokens/ticket.d.ts +0 -38
  405. package/dist/types/taquito-michelson-encoder/src/tokens/token.d.ts +0 -68
  406. package/dist/types/taquito-michelson-encoder/src/tokens/tokens.d.ts +0 -36
  407. package/dist/types/taquito-michelson-encoder/src/tokens/unit.d.ts +0 -34
  408. package/dist/types/taquito-michelson-encoder/src/version.d.ts +0 -4
  409. package/dist/types/taquito-rpc/src/opkind.d.ts +0 -45
  410. package/dist/types/taquito-rpc/src/rpc-client-interface.d.ts +0 -126
  411. package/dist/types/taquito-rpc/src/rpc-client-modules/rpc-cache.d.ts +0 -473
  412. package/dist/types/taquito-rpc/src/taquito-rpc.d.ts +0 -483
  413. package/dist/types/taquito-rpc/src/types.d.ts +0 -2362
  414. package/dist/types/taquito-rpc/src/utils/utils.d.ts +0 -14
  415. package/dist/types/taquito-rpc/src/version.d.ts +0 -4
  416. package/dist/types/taquito-signer/src/bls-key.d.ts +0 -21
  417. package/dist/types/taquito-signer/src/derivation-tools/ecdsa.d.ts +0 -49
  418. package/dist/types/taquito-signer/src/derivation-tools/ed25519.d.ts +0 -33
  419. package/dist/types/taquito-signer/src/derivation-tools/index.d.ts +0 -12
  420. package/dist/types/taquito-signer/src/derivation-tools/types.d.ts +0 -10
  421. package/dist/types/taquito-signer/src/derivation-tools/utils.d.ts +0 -1
  422. package/dist/types/taquito-signer/src/ec-key.d.ts +0 -42
  423. package/dist/types/taquito-signer/src/ed-key.d.ts +0 -39
  424. package/dist/types/taquito-signer/src/errors.d.ts +0 -51
  425. package/dist/types/taquito-signer/src/helpers.d.ts +0 -10
  426. package/dist/types/taquito-signer/src/in-memory-signer.d.ts +0 -56
  427. package/dist/types/taquito-signer/src/key-interface.d.ts +0 -37
  428. package/dist/types/taquito-signer/src/taquito-signer.d.ts +0 -10
  429. package/dist/types/taquito-signer/src/version.d.ts +0 -4
  430. package/dist/types/taquito-utils/src/constants.d.ts +0 -78
  431. package/dist/types/taquito-utils/src/encoding.d.ts +0 -184
  432. package/dist/types/taquito-utils/src/errors.d.ts +0 -20
  433. package/dist/types/taquito-utils/src/format.d.ts +0 -4
  434. package/dist/types/taquito-utils/src/taquito-utils.d.ts +0 -11
  435. package/dist/types/taquito-utils/src/validators.d.ts +0 -167
  436. package/dist/types/taquito-utils/src/verify-signature.d.ts +0 -22
  437. package/dist/types/taquito-utils/src/version.d.ts +0 -4
  438. package/dist/types/taquito-wallet-connect/src/version.d.ts +0 -4
  439. /package/dist/lib/{taquito-wallet-connect/src/errors.js → errors.js} +0 -0
  440. /package/dist/lib/{taquito-wallet-connect/src/types.js → types.js} +0 -0
  441. /package/dist/types/{taquito-wallet-connect/src/errors.d.ts → errors.d.ts} +0 -0
  442. /package/dist/types/{taquito-wallet-connect/src/taquito-wallet-connect.d.ts → taquito-wallet-connect.d.ts} +0 -0
  443. /package/dist/types/{taquito-wallet-connect/src/types.d.ts → types.d.ts} +0 -0
  444. /package/dist/types/{taquito-http-utils/src/version.d.ts → version.d.ts} +0 -0
@@ -1,640 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RPCEstimateProvider = void 0;
4
- const errors_1 = require("../operations/errors");
5
- const types_1 = require("../operations/types");
6
- const estimate_1 = require("./estimate");
7
- const utils_1 = require("@taquito/utils");
8
- const errors_2 = require("./errors");
9
- const provider_1 = require("../provider");
10
- const prepare_provider_1 = require("../prepare/prepare-provider");
11
- const core_1 = require("@taquito/core");
12
- // stub signature that won't be verified by tezos rpc simulate_operation
13
- const STUB_SIGNATURE = 'edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg';
14
- /**
15
- * Estimates gas, storage, and fees by simulating operations against the node RPC.
16
- *
17
- * On Tezos L1, Taquito historically matched estimation with built-in fee defaults because the
18
- * fee-per-byte and fee-per-gas terms were usually close to those values. Tezos X / Tezlink keeps
19
- * the same fee formula shape, but those terms are surfaced through `mempool/filter` and may be
20
- * significantly higher or dynamic, so this provider reads them from RPC before computing fees.
21
- */
22
- class RPCEstimateProvider extends provider_1.Provider {
23
- constructor() {
24
- super(...arguments);
25
- this.REVEAL_LENGTH = 324; // injecting size tz1=320, tz2=322, tz3=322
26
- this.REVEAL_LENGTH_TZ4 = 622; // injecting size tz4=620
27
- this.MILLIGAS_BUFFER = 100 * 1000; // 100 buffer depends on operation kind
28
- this.STORAGE_BUFFER = 20; // according to octez-client
29
- this.prepare = new prepare_provider_1.PrepareProvider(this.context);
30
- }
31
- async getKeys() {
32
- const isSignerConfigured = this.context.isAnySignerConfigured();
33
- return {
34
- publicKeyHash: isSignerConfigured
35
- ? await this.signer.publicKeyHash()
36
- : await this.context.wallet.pkh(),
37
- publicKey: isSignerConfigured
38
- ? await this.signer.publicKey()
39
- : await this.context.wallet.pk(),
40
- };
41
- }
42
- getEstimationPropertiesFromOperationContent(content, size, costPerByte, originationSize) {
43
- const operationResults = (0, errors_1.flattenOperationResult)({ contents: [content] });
44
- let consumedMilligas = 0;
45
- let accumulatedStorage = 0;
46
- operationResults.forEach((result) => {
47
- consumedMilligas += Number(result.consumed_milligas) || 0;
48
- // transfer to unrevealed implicit
49
- accumulatedStorage += 'allocated_destination_contract' in result ? originationSize : 0;
50
- // originate
51
- accumulatedStorage +=
52
- 'originated_contracts' in result && Array.isArray(result.originated_contracts)
53
- ? result.originated_contracts.length * originationSize
54
- : 0;
55
- // register_global_constants
56
- accumulatedStorage +=
57
- 'storage_size' in result && 'global_address' in result
58
- ? Number(result.storage_size) || 0
59
- : 0;
60
- // transfer_ticket, originate, contract_call
61
- accumulatedStorage +=
62
- 'paid_storage_size_diff' in result ? Number(result.paid_storage_size_diff) || 0 : 0;
63
- //smart_rollup_originate
64
- accumulatedStorage += 'genesis_commitment_hash' in result ? Number(result.size) || 0 : 0;
65
- });
66
- if ((0, types_1.isOpWithFee)(content)) {
67
- return {
68
- milligasLimit: (0, types_1.isOpWithGasBuffer)(content)
69
- ? consumedMilligas + Number(this.MILLIGAS_BUFFER)
70
- : consumedMilligas,
71
- storageLimit: accumulatedStorage > 0 ? accumulatedStorage + this.STORAGE_BUFFER : 0,
72
- opSize: size,
73
- minimalFeePerStorageByteMutez: costPerByte.toNumber(),
74
- };
75
- }
76
- else {
77
- return {
78
- milligasLimit: 0,
79
- storageLimit: 0,
80
- opSize: size,
81
- minimalFeePerStorageByteMutez: costPerByte.toNumber(),
82
- baseFeeMutez: 0,
83
- };
84
- }
85
- }
86
- async calculateEstimates(op, constants) {
87
- let feeParams = estimate_1.DEFAULT_FEE_PARAMS;
88
- try {
89
- // Tezos X / Tezlink nodes expose the current fee acceptance thresholds through
90
- // `mempool/filter`. On L1 these values are usually close to Taquito's historical
91
- // defaults, but on Tezos X the byte fee is higher and the gas-price component is
92
- // dynamic, so hardcoded L1 constants can underprice operations.
93
- feeParams = (0, estimate_1.feeParamsFromMempoolFilter)(await this.rpc.getMempoolFilter({ include_default: true }));
94
- }
95
- catch {
96
- // Fall back to L1 defaults when the endpoint is missing or unavailable.
97
- }
98
- const { opbytes, opOb: { branch, contents }, } = await this.forge(op);
99
- const operation = {
100
- operation: { branch, contents, signature: STUB_SIGNATURE },
101
- chain_id: await this.context.readProvider.getChainId(),
102
- };
103
- const { opResponse } = await this.simulate(operation, op);
104
- const { cost_per_byte, origination_size } = constants;
105
- const errors = [...(0, errors_1.flattenErrors)(opResponse, 'backtracked'), ...(0, errors_1.flattenErrors)(opResponse)];
106
- // Fail early in case of errors
107
- if (errors.length) {
108
- throw new errors_1.TezosOperationError(errors, 'Error occurred during estimation', opResponse.contents);
109
- }
110
- let numberOfOps = 1;
111
- if (Array.isArray(op.opOb.contents) && op.opOb.contents.length > 1) {
112
- numberOfOps =
113
- opResponse.contents[0].kind === 'reveal'
114
- ? op.opOb.contents.length - 1
115
- : op.opOb.contents.length;
116
- }
117
- return opResponse.contents.map((x) => {
118
- const content = x;
119
- content.source = content.source || '';
120
- let revealSize, eachOpSize;
121
- if (content.source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)) {
122
- revealSize = this.REVEAL_LENGTH_TZ4 / 2;
123
- eachOpSize = (opbytes.length / 2 + utils_1.payloadLength[utils_1.PrefixV2.BLS12_381Signature]) / numberOfOps;
124
- }
125
- else {
126
- revealSize = this.REVEAL_LENGTH / 2;
127
- eachOpSize = (opbytes.length / 2 + utils_1.payloadLength[utils_1.PrefixV2.Ed25519Signature]) / numberOfOps;
128
- }
129
- return {
130
- ...this.getEstimationPropertiesFromOperationContent(x,
131
- // diff between estimated and injecting OP_SIZE is 124-126, we added buffer to use 130
132
- x.kind === 'reveal' ? revealSize : eachOpSize, cost_per_byte, origination_size ?? 257 // protocol constants
133
- ),
134
- feeParams,
135
- };
136
- });
137
- }
138
- /**
139
- *
140
- * Estimate gasLimit, storageLimit and fees for an origination operation
141
- *
142
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
143
- *
144
- * @param params Originate operation parameter
145
- */
146
- async originate(params) {
147
- const preparedOperation = await this.prepare.originate(params);
148
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
149
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
150
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
151
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
152
- ? this.REVEAL_LENGTH_TZ4 / 2
153
- : this.REVEAL_LENGTH / 2;
154
- estimateProperties.shift();
155
- estimateProperties[0].opSize -= revealSize;
156
- }
157
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
158
- }
159
- /**
160
- *
161
- * Estimate gasLimit, storageLimit and fees for an transfer operation
162
- *
163
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
164
- *
165
- * @param TransferOperation Originate operation parameter
166
- */
167
- async transfer({ fee, storageLimit, gasLimit, ...rest }) {
168
- const toValidation = (0, utils_1.validateAddress)(rest.to);
169
- if (toValidation !== utils_1.ValidationResult.VALID) {
170
- throw new core_1.InvalidAddressError(rest.to, toValidation);
171
- }
172
- const sourceValidation = (0, utils_1.validateAddress)(rest.source ?? '');
173
- if (rest.source && sourceValidation !== utils_1.ValidationResult.VALID) {
174
- throw new core_1.InvalidAddressError(rest.source, sourceValidation);
175
- }
176
- if (rest.amount < 0) {
177
- throw new core_1.InvalidAmountError(rest.amount.toString());
178
- }
179
- const preparedOperation = await this.prepare.transaction({
180
- fee,
181
- storageLimit,
182
- gasLimit,
183
- ...rest,
184
- });
185
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
186
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
187
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
188
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
189
- ? this.REVEAL_LENGTH_TZ4 / 2
190
- : this.REVEAL_LENGTH / 2;
191
- estimateProperties.shift();
192
- estimateProperties[0].opSize -= revealSize;
193
- }
194
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
195
- }
196
- /**
197
- *
198
- * Estimate gasLimit, storageLimit and fees for an stake pseudo-operation
199
- *
200
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
201
- *
202
- * @param Stake pseudo-operation parameter
203
- */
204
- async stake({ fee, storageLimit, gasLimit, ...rest }) {
205
- const sourceValidation = (0, utils_1.validateAddress)(rest.source ?? '');
206
- if (rest.source && sourceValidation !== utils_1.ValidationResult.VALID) {
207
- throw new core_1.InvalidAddressError(rest.source, sourceValidation);
208
- }
209
- if (!rest.to) {
210
- rest.to = rest.source;
211
- }
212
- if (rest.to && rest.to !== rest.source) {
213
- throw new core_1.InvalidStakingAddressError(rest.to);
214
- }
215
- if (rest.amount < 0) {
216
- throw new core_1.InvalidAmountError(rest.amount.toString());
217
- }
218
- const preparedOperation = await this.prepare.stake({
219
- fee,
220
- storageLimit,
221
- gasLimit,
222
- ...rest,
223
- });
224
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
225
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
226
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
227
- estimateProperties.shift();
228
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
229
- ? this.REVEAL_LENGTH_TZ4 / 2
230
- : this.REVEAL_LENGTH / 2;
231
- estimateProperties[0].opSize -= revealSize;
232
- }
233
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
234
- }
235
- /**
236
- *
237
- * Estimate gasLimit, storageLimit and fees for an Unstake pseudo-operation
238
- *
239
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
240
- *
241
- * @param Unstake pseudo-operation parameter
242
- */
243
- async unstake({ fee, storageLimit, gasLimit, ...rest }) {
244
- const sourceValidation = (0, utils_1.validateAddress)(rest.source ?? '');
245
- if (rest.source && sourceValidation !== utils_1.ValidationResult.VALID) {
246
- throw new core_1.InvalidAddressError(rest.source, sourceValidation);
247
- }
248
- if (!rest.to) {
249
- rest.to = rest.source;
250
- }
251
- if (rest.to && rest.to !== rest.source) {
252
- throw new core_1.InvalidStakingAddressError(rest.to);
253
- }
254
- if (rest.amount < 0) {
255
- throw new core_1.InvalidAmountError(rest.amount.toString());
256
- }
257
- const preparedOperation = await this.prepare.unstake({
258
- fee,
259
- storageLimit,
260
- gasLimit,
261
- ...rest,
262
- });
263
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
264
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
265
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
266
- estimateProperties.shift();
267
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
268
- ? this.REVEAL_LENGTH_TZ4 / 2
269
- : this.REVEAL_LENGTH / 2;
270
- estimateProperties[0].opSize -= revealSize;
271
- }
272
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
273
- }
274
- /**
275
- *
276
- * Estimate gasLimit, storageLimit and fees for an finalize_unstake pseudo-operation
277
- *
278
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
279
- *
280
- * @param finalize_unstake pseudo-operation parameter
281
- */
282
- async finalizeUnstake({ fee, storageLimit, gasLimit, ...rest }) {
283
- const sourceValidation = (0, utils_1.validateAddress)(rest.source ?? '');
284
- if (rest.source && sourceValidation !== utils_1.ValidationResult.VALID) {
285
- throw new core_1.InvalidAddressError(rest.source, sourceValidation);
286
- }
287
- if (!rest.to) {
288
- rest.to = rest.source;
289
- }
290
- if (!rest.amount) {
291
- rest.amount = 0;
292
- }
293
- if (rest.amount !== undefined && rest.amount !== 0) {
294
- throw new Error('Amount must be 0 for finalize_unstake operation');
295
- }
296
- const preparedOperation = await this.prepare.finalizeUnstake({
297
- fee,
298
- storageLimit,
299
- gasLimit,
300
- ...rest,
301
- });
302
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
303
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
304
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
305
- estimateProperties.shift();
306
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
307
- ? this.REVEAL_LENGTH_TZ4 / 2
308
- : this.REVEAL_LENGTH / 2;
309
- estimateProperties[0].opSize -= revealSize;
310
- }
311
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
312
- }
313
- /**
314
- *
315
- * Estimate gasLimit, storageLimit and fees for a transferTicket operation
316
- *
317
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
318
- *
319
- * @param TransferTicketParams operation parameter
320
- */
321
- async transferTicket({ fee, storageLimit, gasLimit, ...rest }) {
322
- const destinationValidation = (0, utils_1.validateAddress)(rest.destination);
323
- if (destinationValidation !== utils_1.ValidationResult.VALID) {
324
- throw new core_1.InvalidAddressError(rest.destination, destinationValidation);
325
- }
326
- const sourceValidation = (0, utils_1.validateAddress)(rest.source ?? '');
327
- if (rest.source && sourceValidation !== utils_1.ValidationResult.VALID) {
328
- throw new core_1.InvalidAddressError(rest.source, sourceValidation);
329
- }
330
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
331
- const preparedOperation = await this.prepare.transferTicket({
332
- fee,
333
- storageLimit,
334
- gasLimit,
335
- ...rest,
336
- });
337
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
338
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
339
- estimateProperties.shift();
340
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
341
- ? this.REVEAL_LENGTH_TZ4 / 2
342
- : this.REVEAL_LENGTH / 2;
343
- estimateProperties[0].opSize -= revealSize;
344
- }
345
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
346
- }
347
- /**
348
- *
349
- * Estimate gasLimit, storageLimit and fees for a delegate operation
350
- *
351
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
352
- */
353
- async setDelegate({ fee, gasLimit, storageLimit, ...rest }) {
354
- const sourceValidation = (0, utils_1.validateAddress)(rest.source ?? '');
355
- if (rest.source && sourceValidation !== utils_1.ValidationResult.VALID) {
356
- throw new core_1.InvalidAddressError(rest.source, sourceValidation);
357
- }
358
- const delegateValidation = (0, utils_1.validateAddress)(rest.delegate ?? '');
359
- if (rest.delegate && delegateValidation !== utils_1.ValidationResult.VALID) {
360
- throw new core_1.InvalidAddressError(rest.delegate, delegateValidation);
361
- }
362
- const preparedOperation = await this.prepare.delegation({
363
- fee,
364
- storageLimit,
365
- gasLimit,
366
- ...rest,
367
- });
368
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
369
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
370
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
371
- estimateProperties.shift();
372
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
373
- ? this.REVEAL_LENGTH_TZ4 / 2
374
- : this.REVEAL_LENGTH / 2;
375
- estimateProperties[0].opSize -= revealSize;
376
- }
377
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
378
- }
379
- /**
380
- *
381
- * Estimate gasLimit, storageLimit and fees for a each operation in the batch
382
- *
383
- * @returns An array of Estimate objects. If a reveal operation is needed, the first element of the array is the Estimate for the reveal operation.
384
- */
385
- async batch(params) {
386
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
387
- const preparedOperations = await this.prepare.batch(params);
388
- const estimateProperties = await this.calculateEstimates(preparedOperations, protocolConstants);
389
- return estimate_1.Estimate.createArrayEstimateInstancesFromProperties(estimateProperties);
390
- }
391
- /**
392
- *
393
- * Estimate gasLimit, storageLimit and fees for a delegate operation
394
- *
395
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
396
- */
397
- async registerDelegate({ fee, storageLimit, gasLimit, ...rest }, source) {
398
- const pkh = (await this.getKeys()).publicKeyHash;
399
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
400
- const checkSource = source || pkh;
401
- const preparedOperation = await this.prepare.registerDelegate({ fee, storageLimit, gasLimit, ...rest }, checkSource);
402
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
403
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
404
- estimateProperties.shift();
405
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
406
- ? this.REVEAL_LENGTH_TZ4 / 2
407
- : this.REVEAL_LENGTH / 2;
408
- estimateProperties[0].opSize -= revealSize;
409
- }
410
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
411
- }
412
- /**
413
- *
414
- * Estimate gasLimit, storageLimit and fees to reveal the current account
415
- * @returns An estimation of gasLimit, storageLimit and fees for the operation or undefined if the account is already revealed
416
- *
417
- * @param params Reveal operation parameter
418
- */
419
- async reveal(params) {
420
- const { publicKeyHash, publicKey } = await this.getKeys();
421
- if (!publicKey) {
422
- throw new errors_2.RevealEstimateError();
423
- }
424
- if (await this.isAccountRevealRequired(publicKeyHash)) {
425
- const [, pkhPrefix] = (0, utils_1.b58DecodeAndCheckPrefix)(publicKeyHash, utils_1.publicKeyHashPrefixes);
426
- if (pkhPrefix === utils_1.PrefixV2.BLS12_381PublicKeyHash) {
427
- if (params && params.proof) {
428
- (0, utils_1.b58DecodeAndCheckPrefix)(params.proof, [utils_1.PrefixV2.BLS12_381Signature]); // validate proof to be a bls signature
429
- }
430
- else {
431
- const { prefixSig } = await this.signer.provePossession();
432
- params = { ...params, proof: prefixSig };
433
- }
434
- }
435
- else {
436
- if (params && params.proof) {
437
- throw new core_1.ProhibitedActionError('Proof field is only allowed to reveal a bls account ');
438
- }
439
- }
440
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
441
- const preparedOperation = params
442
- ? await this.prepare.reveal(params)
443
- : await this.prepare.reveal({});
444
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
445
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
446
- }
447
- }
448
- /**
449
- *
450
- * Estimate gasLimit, storageLimit and fees for an registerGlobalConstant operation
451
- *
452
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
453
- *
454
- * @param params registerGlobalConstant operation parameter
455
- */
456
- async registerGlobalConstant({ fee, storageLimit, gasLimit, ...rest }) {
457
- const preparedOperation = await this.prepare.registerGlobalConstant({
458
- fee,
459
- storageLimit,
460
- gasLimit,
461
- ...rest,
462
- });
463
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
464
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
465
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
466
- estimateProperties.shift();
467
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
468
- ? this.REVEAL_LENGTH_TZ4 / 2
469
- : this.REVEAL_LENGTH / 2;
470
- estimateProperties[0].opSize -= revealSize;
471
- }
472
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
473
- }
474
- /**
475
- *
476
- * Estimate gasLimit, storageLimit, and fees for an increasePaidStorage operation
477
- *
478
- * @returns An estimation of gasLimit, storageLimit, and fees for the operation
479
- *
480
- * @param params increasePaidStorage operation parameters
481
- */
482
- async increasePaidStorage({ fee, storageLimit, gasLimit, ...rest }) {
483
- if (rest.amount <= 0) {
484
- throw new core_1.InvalidAmountError(rest.amount.toString());
485
- }
486
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
487
- const preparedOperation = await this.prepare.increasePaidStorage({
488
- fee,
489
- storageLimit,
490
- gasLimit,
491
- ...rest,
492
- });
493
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
494
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
495
- estimateProperties.shift();
496
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
497
- ? this.REVEAL_LENGTH_TZ4 / 2
498
- : this.REVEAL_LENGTH / 2;
499
- estimateProperties[0].opSize -= revealSize;
500
- }
501
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
502
- }
503
- /**
504
- *
505
- * Estimate gasLimit, storageLimit and fees for an Update Consensus Key operation
506
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
507
- * @param params UpdateConsensusKey operation parameter
508
- */
509
- async updateConsensusKey(params) {
510
- const [, pkPrefix] = (0, utils_1.b58DecodeAndCheckPrefix)(params.pk, utils_1.publicKeyPrefixes);
511
- if (pkPrefix === utils_1.PrefixV2.BLS12_381PublicKey) {
512
- if (!params.proof) {
513
- throw new core_1.InvalidProofError('Proof is required to set a bls account as consensus key ');
514
- }
515
- }
516
- else {
517
- if (params.proof) {
518
- throw new core_1.ProhibitedActionError('Proof field is only allowed for a bls account as consensus key');
519
- }
520
- }
521
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
522
- const preparedOperation = await this.prepare.updateConsensusKey(params);
523
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
524
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
525
- estimateProperties.shift();
526
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
527
- ? this.REVEAL_LENGTH_TZ4 / 2
528
- : this.REVEAL_LENGTH / 2;
529
- estimateProperties[0].opSize -= revealSize;
530
- }
531
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
532
- }
533
- /**
534
- *
535
- * Estimate gasLimit, storageLimit and fees for an Update Companion Key operation
536
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
537
- * @param params UpdateCompanionKey operation parameter
538
- */
539
- async updateCompanionKey(params) {
540
- const [, pkPrefix] = (0, utils_1.b58DecodeAndCheckPrefix)(params.pk, utils_1.publicKeyPrefixes);
541
- if (pkPrefix !== utils_1.PrefixV2.BLS12_381PublicKey) {
542
- throw new core_1.ProhibitedActionError('companion key must be a bls account');
543
- }
544
- if (!params.proof) {
545
- throw new core_1.InvalidProofError('Proof is required to set a bls account as companion key ');
546
- }
547
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
548
- const preparedOperation = await this.prepare.updateCompanionKey(params);
549
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
550
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
551
- estimateProperties.shift();
552
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
553
- ? this.REVEAL_LENGTH_TZ4 / 2
554
- : this.REVEAL_LENGTH / 2;
555
- estimateProperties[0].opSize -= revealSize;
556
- }
557
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
558
- }
559
- /**
560
- *
561
- * Estimate gasLimit, storageLimit and fees for a smart_rollup_add_messages operation
562
- *
563
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
564
- *
565
- * @param params SmartRollupAddMessages operation parameter
566
- */
567
- async smartRollupAddMessages(params) {
568
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
569
- const preparedOperation = await this.prepare.smartRollupAddMessages(params);
570
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
571
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
572
- estimateProperties.shift();
573
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
574
- ? this.REVEAL_LENGTH_TZ4 / 2
575
- : this.REVEAL_LENGTH / 2;
576
- estimateProperties[0].opSize -= revealSize;
577
- }
578
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
579
- }
580
- /**
581
- *
582
- * Estimate gasLimit, storageLimit and fees for an Smart Rollup Originate operation
583
- *
584
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
585
- *
586
- * @param params SmartRollupOriginate operation parameter
587
- */
588
- async smartRollupOriginate(params) {
589
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
590
- const preparedOperation = await this.prepare.smartRollupOriginate(params);
591
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
592
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
593
- estimateProperties.shift();
594
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
595
- ? this.REVEAL_LENGTH_TZ4 / 2
596
- : this.REVEAL_LENGTH / 2;
597
- estimateProperties[0].opSize -= revealSize;
598
- }
599
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
600
- }
601
- /**
602
- *
603
- * Estimate gasLimit, storageLimit and fees for a smart_rollup_execute_outbox_message operation
604
- *
605
- * @returns An estimation of gasLimit, storageLimit and fees for the operation
606
- *
607
- * @param params SmartRollupExecuteOutboxMessage operation parameter
608
- */
609
- async smartRollupExecuteOutboxMessage(params) {
610
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
611
- const preparedOperation = await this.prepare.smartRollupExecuteOutboxMessage(params);
612
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
613
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
614
- estimateProperties.shift();
615
- }
616
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
617
- }
618
- /**
619
- *
620
- * Estimate gasLimit, storageLimit and fees for contract call
621
- *
622
- * @returns An estimation of gasLimit, storageLimit and fees for the contract call
623
- *
624
- * @param contractMethod ContractMethodObject for the contract call
625
- */
626
- async contractCall(contractMethod) {
627
- const protocolConstants = await this.context.readProvider.getProtocolConstants('head');
628
- const preparedOperation = await this.prepare.contractCall(contractMethod);
629
- const estimateProperties = await this.calculateEstimates(preparedOperation, protocolConstants);
630
- if (preparedOperation.opOb.contents[0].kind === 'reveal') {
631
- estimateProperties.shift();
632
- const revealSize = preparedOperation.opOb.contents[0].source.startsWith(utils_1.PrefixV2.BLS12_381PublicKeyHash)
633
- ? this.REVEAL_LENGTH_TZ4 / 2
634
- : this.REVEAL_LENGTH / 2;
635
- estimateProperties[0].opSize -= revealSize;
636
- }
637
- return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties);
638
- }
639
- }
640
- exports.RPCEstimateProvider = RPCEstimateProvider;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CompositeForger = void 0;
4
- const errors_1 = require("./errors");
5
- class CompositeForger {
6
- constructor(forgers) {
7
- this.forgers = forgers;
8
- if (forgers.length === 0) {
9
- throw new errors_1.UnspecifiedForgerError();
10
- }
11
- }
12
- async forge({ branch, contents }) {
13
- const results = await Promise.all(this.forgers.map((forger) => {
14
- return forger.forge({ branch, contents });
15
- }));
16
- if (results.length === 0) {
17
- throw new errors_1.UnspecifiedForgerError();
18
- }
19
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
20
- let lastResult = results.pop(); // Assumed to be more than one since we
21
- while (results.length) {
22
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
23
- const currentResult = results.pop();
24
- if (currentResult !== lastResult) {
25
- throw new errors_1.ForgingMismatchError([lastResult, currentResult]);
26
- }
27
- lastResult = currentResult;
28
- }
29
- return lastResult;
30
- }
31
- }
32
- exports.CompositeForger = CompositeForger;