@airgap/tezos 0.13.10 → 0.13.11-beta.1

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 (824) hide show
  1. package/package.json +11 -9
  2. package/airgap-coinlib-tezos.min.js +0 -145616
  3. package/index.d.ts +0 -1
  4. package/index.js +0 -18
  5. package/index.js.map +0 -1
  6. package/v0/actions/GetKtAccountsAction.d.ts +0 -8
  7. package/v0/actions/GetKtAccountsAction.js +0 -87
  8. package/v0/actions/GetKtAccountsAction.js.map +0 -1
  9. package/v0/constants.d.ts +0 -18
  10. package/v0/constants.js +0 -28
  11. package/v0/constants.js.map +0 -1
  12. package/v0/index.d.ts +0 -46
  13. package/v0/index.js +0 -146
  14. package/v0/index.js.map +0 -1
  15. package/v0/protocol/TezosAddress.d.ts +0 -11
  16. package/v0/protocol/TezosAddress.js +0 -107
  17. package/v0/protocol/TezosAddress.js.map +0 -1
  18. package/v0/protocol/TezosCryptoClient.d.ts +0 -15
  19. package/v0/protocol/TezosCryptoClient.js +0 -160
  20. package/v0/protocol/TezosCryptoClient.js.map +0 -1
  21. package/v0/protocol/TezosProtocol.d.ts +0 -349
  22. package/v0/protocol/TezosProtocol.js +0 -1861
  23. package/v0/protocol/TezosProtocol.js.map +0 -1
  24. package/v0/protocol/TezosProtocolOptions.d.ts +0 -29
  25. package/v0/protocol/TezosProtocolOptions.js +0 -116
  26. package/v0/protocol/TezosProtocolOptions.js.map +0 -1
  27. package/v0/protocol/TezosUtils.d.ts +0 -40
  28. package/v0/protocol/TezosUtils.js +0 -301
  29. package/v0/protocol/TezosUtils.js.map +0 -1
  30. package/v0/protocol/contract/TezosContract.d.ts +0 -52
  31. package/v0/protocol/contract/TezosContract.js +0 -508
  32. package/v0/protocol/contract/TezosContract.js.map +0 -1
  33. package/v0/protocol/contract/TezosContractCall.d.ts +0 -11
  34. package/v0/protocol/contract/TezosContractCall.js +0 -23
  35. package/v0/protocol/contract/TezosContractCall.js.map +0 -1
  36. package/v0/protocol/contract/TezosContractEntrypoint.d.ts +0 -8
  37. package/v0/protocol/contract/TezosContractEntrypoint.js +0 -27
  38. package/v0/protocol/contract/TezosContractEntrypoint.js.map +0 -1
  39. package/v0/protocol/contract/TezosContractStorage.d.ts +0 -7
  40. package/v0/protocol/contract/TezosContractStorage.js +0 -16
  41. package/v0/protocol/contract/TezosContractStorage.js.map +0 -1
  42. package/v0/protocol/contract/remote-data/TezosContractRemoteDataFactory.d.ts +0 -11
  43. package/v0/protocol/contract/remote-data/TezosContractRemoteDataFactory.js +0 -36
  44. package/v0/protocol/contract/remote-data/TezosContractRemoteDataFactory.js.map +0 -1
  45. package/v0/protocol/contract/remote-data/TezosStorageRemoteData.d.ts +0 -12
  46. package/v0/protocol/contract/remote-data/TezosStorageRemoteData.js +0 -152
  47. package/v0/protocol/contract/remote-data/TezosStorageRemoteData.js.map +0 -1
  48. package/v0/protocol/domains/TezosDomains.d.ts +0 -20
  49. package/v0/protocol/domains/TezosDomains.js +0 -310
  50. package/v0/protocol/domains/TezosDomains.js.map +0 -1
  51. package/v0/protocol/fa/TezosBTC.d.ts +0 -12
  52. package/v0/protocol/fa/TezosBTC.js +0 -109
  53. package/v0/protocol/fa/TezosBTC.js.map +0 -1
  54. package/v0/protocol/fa/TezosBTCtez.d.ts +0 -10
  55. package/v0/protocol/fa/TezosBTCtez.js +0 -56
  56. package/v0/protocol/fa/TezosBTCtez.js.map +0 -1
  57. package/v0/protocol/fa/TezosCTez.d.ts +0 -10
  58. package/v0/protocol/fa/TezosCTez.js +0 -53
  59. package/v0/protocol/fa/TezosCTez.js.map +0 -1
  60. package/v0/protocol/fa/TezosDOGA.d.ts +0 -10
  61. package/v0/protocol/fa/TezosDOGA.js +0 -53
  62. package/v0/protocol/fa/TezosDOGA.js.map +0 -1
  63. package/v0/protocol/fa/TezosETHtz.d.ts +0 -9
  64. package/v0/protocol/fa/TezosETHtz.js +0 -74
  65. package/v0/protocol/fa/TezosETHtz.js.map +0 -1
  66. package/v0/protocol/fa/TezosFA1Protocol.d.ts +0 -27
  67. package/v0/protocol/fa/TezosFA1Protocol.js +0 -312
  68. package/v0/protocol/fa/TezosFA1Protocol.js.map +0 -1
  69. package/v0/protocol/fa/TezosFA1p2Protocol.d.ts +0 -8
  70. package/v0/protocol/fa/TezosFA1p2Protocol.js +0 -119
  71. package/v0/protocol/fa/TezosFA1p2Protocol.js.map +0 -1
  72. package/v0/protocol/fa/TezosFA2Protocol.d.ts +0 -58
  73. package/v0/protocol/fa/TezosFA2Protocol.js +0 -452
  74. package/v0/protocol/fa/TezosFA2Protocol.js.map +0 -1
  75. package/v0/protocol/fa/TezosFAProtocol.d.ts +0 -65
  76. package/v0/protocol/fa/TezosFAProtocol.js +0 -455
  77. package/v0/protocol/fa/TezosFAProtocol.js.map +0 -1
  78. package/v0/protocol/fa/TezosFAProtocolOptions.d.ts +0 -54
  79. package/v0/protocol/fa/TezosFAProtocolOptions.js +0 -230
  80. package/v0/protocol/fa/TezosFAProtocolOptions.js.map +0 -1
  81. package/v0/protocol/fa/TezosKolibriUSD.d.ts +0 -10
  82. package/v0/protocol/fa/TezosKolibriUSD.js +0 -76
  83. package/v0/protocol/fa/TezosKolibriUSD.js.map +0 -1
  84. package/v0/protocol/fa/TezosPlanty.d.ts +0 -10
  85. package/v0/protocol/fa/TezosPlanty.js +0 -53
  86. package/v0/protocol/fa/TezosPlanty.js.map +0 -1
  87. package/v0/protocol/fa/TezosQUIPU.d.ts +0 -10
  88. package/v0/protocol/fa/TezosQUIPU.js +0 -56
  89. package/v0/protocol/fa/TezosQUIPU.js.map +0 -1
  90. package/v0/protocol/fa/TezosSIRS.d.ts +0 -10
  91. package/v0/protocol/fa/TezosSIRS.js +0 -53
  92. package/v0/protocol/fa/TezosSIRS.js.map +0 -1
  93. package/v0/protocol/fa/TezosStaker.d.ts +0 -10
  94. package/v0/protocol/fa/TezosStaker.js +0 -76
  95. package/v0/protocol/fa/TezosStaker.js.map +0 -1
  96. package/v0/protocol/fa/TezosUBTC.d.ts +0 -10
  97. package/v0/protocol/fa/TezosUBTC.js +0 -56
  98. package/v0/protocol/fa/TezosUBTC.js.map +0 -1
  99. package/v0/protocol/fa/TezosUDEFI.d.ts +0 -10
  100. package/v0/protocol/fa/TezosUDEFI.js +0 -56
  101. package/v0/protocol/fa/TezosUDEFI.js.map +0 -1
  102. package/v0/protocol/fa/TezosUSD.d.ts +0 -10
  103. package/v0/protocol/fa/TezosUSD.js +0 -76
  104. package/v0/protocol/fa/TezosUSD.js.map +0 -1
  105. package/v0/protocol/fa/TezosUSDT.d.ts +0 -10
  106. package/v0/protocol/fa/TezosUSDT.js +0 -56
  107. package/v0/protocol/fa/TezosUSDT.js.map +0 -1
  108. package/v0/protocol/fa/TezosUUSD.d.ts +0 -6
  109. package/v0/protocol/fa/TezosUUSD.js +0 -33
  110. package/v0/protocol/fa/TezosUUSD.js.map +0 -1
  111. package/v0/protocol/fa/TezosWRAP.d.ts +0 -10
  112. package/v0/protocol/fa/TezosWRAP.js +0 -56
  113. package/v0/protocol/fa/TezosWRAP.js.map +0 -1
  114. package/v0/protocol/fa/TezosWrapped.d.ts +0 -10
  115. package/v0/protocol/fa/TezosWrapped.js +0 -76
  116. package/v0/protocol/fa/TezosWrapped.js.map +0 -1
  117. package/v0/protocol/fa/TezosYOU.d.ts +0 -6
  118. package/v0/protocol/fa/TezosYOU.js +0 -33
  119. package/v0/protocol/fa/TezosYOU.js.map +0 -1
  120. package/v0/protocol/fa/metadata/BigMapTokenMetadataIndexer.d.ts +0 -13
  121. package/v0/protocol/fa/metadata/BigMapTokenMetadataIndexer.js +0 -180
  122. package/v0/protocol/fa/metadata/BigMapTokenMetadataIndexer.js.map +0 -1
  123. package/v0/protocol/fa/metadata/ObjktTokenMetadataIndexer.d.ts +0 -8
  124. package/v0/protocol/fa/metadata/ObjktTokenMetadataIndexer.js +0 -97
  125. package/v0/protocol/fa/metadata/ObjktTokenMetadataIndexer.js.map +0 -1
  126. package/v0/protocol/fa/metadata/TokenMetadataIndexer.d.ts +0 -4
  127. package/v0/protocol/fa/metadata/TokenMetadataIndexer.js +0 -3
  128. package/v0/protocol/fa/metadata/TokenMetadataIndexer.js.map +0 -1
  129. package/v0/protocol/indexerClient/TezosIndexerClient.d.ts +0 -29
  130. package/v0/protocol/indexerClient/TezosIndexerClient.js +0 -269
  131. package/v0/protocol/indexerClient/TezosIndexerClient.js.map +0 -1
  132. package/v0/protocol/indexerClient/TezosProtocolIndexerClient.d.ts +0 -30
  133. package/v0/protocol/indexerClient/TezosProtocolIndexerClient.js +0 -3
  134. package/v0/protocol/indexerClient/TezosProtocolIndexerClient.js.map +0 -1
  135. package/v0/protocol/kt/TezosKtAddress.d.ts +0 -5
  136. package/v0/protocol/kt/TezosKtAddress.js +0 -74
  137. package/v0/protocol/kt/TezosKtAddress.js.map +0 -1
  138. package/v0/protocol/kt/TezosKtProtocol.d.ts +0 -30
  139. package/v0/protocol/kt/TezosKtProtocol.js +0 -320
  140. package/v0/protocol/kt/TezosKtProtocol.js.map +0 -1
  141. package/v0/protocol/sapling/TezosSaplingAddress.d.ts +0 -12
  142. package/v0/protocol/sapling/TezosSaplingAddress.js +0 -141
  143. package/v0/protocol/sapling/TezosSaplingAddress.js.map +0 -1
  144. package/v0/protocol/sapling/TezosSaplingCryptoClient.d.ts +0 -34
  145. package/v0/protocol/sapling/TezosSaplingCryptoClient.js +0 -248
  146. package/v0/protocol/sapling/TezosSaplingCryptoClient.js.map +0 -1
  147. package/v0/protocol/sapling/TezosSaplingProtocol.d.ts +0 -135
  148. package/v0/protocol/sapling/TezosSaplingProtocol.js +0 -1182
  149. package/v0/protocol/sapling/TezosSaplingProtocol.js.map +0 -1
  150. package/v0/protocol/sapling/TezosSaplingProtocolOptions.d.ts +0 -45
  151. package/v0/protocol/sapling/TezosSaplingProtocolOptions.js +0 -73
  152. package/v0/protocol/sapling/TezosSaplingProtocolOptions.js.map +0 -1
  153. package/v0/protocol/sapling/TezosShieldedTezProtocol.d.ts +0 -12
  154. package/v0/protocol/sapling/TezosShieldedTezProtocol.js +0 -144
  155. package/v0/protocol/sapling/TezosShieldedTezProtocol.js.map +0 -1
  156. package/v0/protocol/sapling/injector/TezosSaplingInjectorClient.d.ts +0 -6
  157. package/v0/protocol/sapling/injector/TezosSaplingInjectorClient.js +0 -68
  158. package/v0/protocol/sapling/injector/TezosSaplingInjectorClient.js.map +0 -1
  159. package/v0/protocol/sapling/node/TezosSaplingNodeClient.d.ts +0 -8
  160. package/v0/protocol/sapling/node/TezosSaplingNodeClient.js +0 -78
  161. package/v0/protocol/sapling/node/TezosSaplingNodeClient.js.map +0 -1
  162. package/v0/protocol/sapling/utils/TezosSaplingBookkeeper.d.ts +0 -34
  163. package/v0/protocol/sapling/utils/TezosSaplingBookkeeper.js +0 -591
  164. package/v0/protocol/sapling/utils/TezosSaplingBookkeeper.js.map +0 -1
  165. package/v0/protocol/sapling/utils/TezosSaplingEncoder.d.ts +0 -22
  166. package/v0/protocol/sapling/utils/TezosSaplingEncoder.js +0 -158
  167. package/v0/protocol/sapling/utils/TezosSaplingEncoder.js.map +0 -1
  168. package/v0/protocol/sapling/utils/TezosSaplingForger.d.ts +0 -27
  169. package/v0/protocol/sapling/utils/TezosSaplingForger.js +0 -304
  170. package/v0/protocol/sapling/utils/TezosSaplingForger.js.map +0 -1
  171. package/v0/protocol/sapling/utils/TezosSaplingState.d.ts +0 -17
  172. package/v0/protocol/sapling/utils/TezosSaplingState.js +0 -266
  173. package/v0/protocol/sapling/utils/TezosSaplingState.js.map +0 -1
  174. package/v0/protocol/types/TezosAddressCursor.d.ts +0 -3
  175. package/v0/protocol/types/TezosAddressCursor.js +0 -3
  176. package/v0/protocol/types/TezosAddressCursor.js.map +0 -1
  177. package/v0/protocol/types/TezosAddressResult.d.ts +0 -4
  178. package/v0/protocol/types/TezosAddressResult.js +0 -3
  179. package/v0/protocol/types/TezosAddressResult.js.map +0 -1
  180. package/v0/protocol/types/TezosBlockHeader.d.ts +0 -13
  181. package/v0/protocol/types/TezosBlockHeader.js +0 -3
  182. package/v0/protocol/types/TezosBlockHeader.js.map +0 -1
  183. package/v0/protocol/types/TezosBlockMetadata.d.ts +0 -7
  184. package/v0/protocol/types/TezosBlockMetadata.js +0 -3
  185. package/v0/protocol/types/TezosBlockMetadata.js.map +0 -1
  186. package/v0/protocol/types/TezosContractCode.d.ts +0 -5
  187. package/v0/protocol/types/TezosContractCode.js +0 -3
  188. package/v0/protocol/types/TezosContractCode.js.map +0 -1
  189. package/v0/protocol/types/TezosOperationType.d.ts +0 -13
  190. package/v0/protocol/types/TezosOperationType.js +0 -18
  191. package/v0/protocol/types/TezosOperationType.js.map +0 -1
  192. package/v0/protocol/types/TezosTransactionCursor.d.ts +0 -3
  193. package/v0/protocol/types/TezosTransactionCursor.js +0 -3
  194. package/v0/protocol/types/TezosTransactionCursor.js.map +0 -1
  195. package/v0/protocol/types/TezosTransactionResult.d.ts +0 -6
  196. package/v0/protocol/types/TezosTransactionResult.js +0 -3
  197. package/v0/protocol/types/TezosTransactionResult.js.map +0 -1
  198. package/v0/protocol/types/TezosWrappedOperation.d.ts +0 -5
  199. package/v0/protocol/types/TezosWrappedOperation.js +0 -3
  200. package/v0/protocol/types/TezosWrappedOperation.js.map +0 -1
  201. package/v0/protocol/types/contract/BigMap.d.ts +0 -7
  202. package/v0/protocol/types/contract/BigMap.js +0 -3
  203. package/v0/protocol/types/contract/BigMap.js.map +0 -1
  204. package/v0/protocol/types/contract/BigMapEntry.d.ts +0 -8
  205. package/v0/protocol/types/contract/BigMapEntry.js +0 -3
  206. package/v0/protocol/types/contract/BigMapEntry.js.map +0 -1
  207. package/v0/protocol/types/contract/BigMapEntryFilter.d.ts +0 -5
  208. package/v0/protocol/types/contract/BigMapEntryFilter.js +0 -3
  209. package/v0/protocol/types/contract/BigMapEntryFilter.js.map +0 -1
  210. package/v0/protocol/types/contract/BigMapRequest.d.ts +0 -10
  211. package/v0/protocol/types/contract/BigMapRequest.js +0 -3
  212. package/v0/protocol/types/contract/BigMapRequest.js.map +0 -1
  213. package/v0/protocol/types/contract/TezosContractMetadata.d.ts +0 -61
  214. package/v0/protocol/types/contract/TezosContractMetadata.js +0 -3
  215. package/v0/protocol/types/contract/TezosContractMetadata.js.map +0 -1
  216. package/v0/protocol/types/domains/TezosDomainsRecord.d.ts +0 -8
  217. package/v0/protocol/types/domains/TezosDomainsRecord.js +0 -3
  218. package/v0/protocol/types/domains/TezosDomainsRecord.js.map +0 -1
  219. package/v0/protocol/types/domains/TezosDomainsReverseRecord.d.ts +0 -5
  220. package/v0/protocol/types/domains/TezosDomainsReverseRecord.js +0 -3
  221. package/v0/protocol/types/domains/TezosDomainsReverseRecord.js.map +0 -1
  222. package/v0/protocol/types/fa/TezosFA2BalanceOfRequest.d.ts +0 -4
  223. package/v0/protocol/types/fa/TezosFA2BalanceOfRequest.js +0 -3
  224. package/v0/protocol/types/fa/TezosFA2BalanceOfRequest.js.map +0 -1
  225. package/v0/protocol/types/fa/TezosFA2BalanceOfResponse.d.ts +0 -5
  226. package/v0/protocol/types/fa/TezosFA2BalanceOfResponse.js +0 -3
  227. package/v0/protocol/types/fa/TezosFA2BalanceOfResponse.js.map +0 -1
  228. package/v0/protocol/types/fa/TezosFA2TransferRequest.d.ts +0 -8
  229. package/v0/protocol/types/fa/TezosFA2TransferRequest.js +0 -3
  230. package/v0/protocol/types/fa/TezosFA2TransferRequest.js.map +0 -1
  231. package/v0/protocol/types/fa/TezosFA2UpdateOperatorRequest.d.ts +0 -6
  232. package/v0/protocol/types/fa/TezosFA2UpdateOperatorRequest.js +0 -3
  233. package/v0/protocol/types/fa/TezosFA2UpdateOperatorRequest.js.map +0 -1
  234. package/v0/protocol/types/fa/TezosFATokenMetadata.d.ts +0 -6
  235. package/v0/protocol/types/fa/TezosFATokenMetadata.js +0 -3
  236. package/v0/protocol/types/fa/TezosFATokenMetadata.js.map +0 -1
  237. package/v0/protocol/types/kt/TezosKtAddressCursor.d.ts +0 -4
  238. package/v0/protocol/types/kt/TezosKtAddressCursor.js +0 -3
  239. package/v0/protocol/types/kt/TezosKtAddressCursor.js.map +0 -1
  240. package/v0/protocol/types/kt/TezosKtAddressResult.d.ts +0 -5
  241. package/v0/protocol/types/kt/TezosKtAddressResult.js +0 -3
  242. package/v0/protocol/types/kt/TezosKtAddressResult.js.map +0 -1
  243. package/v0/protocol/types/micheline/MichelineNode.d.ts +0 -15
  244. package/v0/protocol/types/micheline/MichelineNode.js +0 -5
  245. package/v0/protocol/types/micheline/MichelineNode.js.map +0 -1
  246. package/v0/protocol/types/micheline/MichelineNodeUtils.d.ts +0 -6
  247. package/v0/protocol/types/micheline/MichelineNodeUtils.js +0 -40
  248. package/v0/protocol/types/micheline/MichelineNodeUtils.js.map +0 -1
  249. package/v0/protocol/types/michelson/MichelsonType.d.ts +0 -11
  250. package/v0/protocol/types/michelson/MichelsonType.js +0 -22
  251. package/v0/protocol/types/michelson/MichelsonType.js.map +0 -1
  252. package/v0/protocol/types/michelson/MichelsonTypeMeta.d.ts +0 -33
  253. package/v0/protocol/types/michelson/MichelsonTypeMeta.js +0 -136
  254. package/v0/protocol/types/michelson/MichelsonTypeMeta.js.map +0 -1
  255. package/v0/protocol/types/michelson/MichelsonTypeUtils.d.ts +0 -19
  256. package/v0/protocol/types/michelson/MichelsonTypeUtils.js +0 -251
  257. package/v0/protocol/types/michelson/MichelsonTypeUtils.js.map +0 -1
  258. package/v0/protocol/types/michelson/generics/MichelsonList.d.ts +0 -11
  259. package/v0/protocol/types/michelson/generics/MichelsonList.js +0 -70
  260. package/v0/protocol/types/michelson/generics/MichelsonList.js.map +0 -1
  261. package/v0/protocol/types/michelson/generics/MichelsonMap.d.ts +0 -14
  262. package/v0/protocol/types/michelson/generics/MichelsonMap.js +0 -120
  263. package/v0/protocol/types/michelson/generics/MichelsonMap.js.map +0 -1
  264. package/v0/protocol/types/michelson/generics/MichelsonOption.d.ts +0 -25
  265. package/v0/protocol/types/michelson/generics/MichelsonOption.js +0 -121
  266. package/v0/protocol/types/michelson/generics/MichelsonOption.js.map +0 -1
  267. package/v0/protocol/types/michelson/generics/MichelsonOr.d.ts +0 -25
  268. package/v0/protocol/types/michelson/generics/MichelsonOr.js +0 -134
  269. package/v0/protocol/types/michelson/generics/MichelsonOr.js.map +0 -1
  270. package/v0/protocol/types/michelson/generics/MichelsonPair.d.ts +0 -17
  271. package/v0/protocol/types/michelson/generics/MichelsonPair.js +0 -139
  272. package/v0/protocol/types/michelson/generics/MichelsonPair.js.map +0 -1
  273. package/v0/protocol/types/michelson/grammar/MichelsonGrammarData.d.ts +0 -2
  274. package/v0/protocol/types/michelson/grammar/MichelsonGrammarData.js +0 -4
  275. package/v0/protocol/types/michelson/grammar/MichelsonGrammarData.js.map +0 -1
  276. package/v0/protocol/types/michelson/grammar/MichelsonGrammarInstruction.d.ts +0 -1
  277. package/v0/protocol/types/michelson/grammar/MichelsonGrammarInstruction.js +0 -4
  278. package/v0/protocol/types/michelson/grammar/MichelsonGrammarInstruction.js.map +0 -1
  279. package/v0/protocol/types/michelson/grammar/MichelsonGrammarType.d.ts +0 -1
  280. package/v0/protocol/types/michelson/grammar/MichelsonGrammarType.js +0 -4
  281. package/v0/protocol/types/michelson/grammar/MichelsonGrammarType.js.map +0 -1
  282. package/v0/protocol/types/michelson/primitives/MichelsonAddress.d.ts +0 -15
  283. package/v0/protocol/types/michelson/primitives/MichelsonAddress.js +0 -74
  284. package/v0/protocol/types/michelson/primitives/MichelsonAddress.js.map +0 -1
  285. package/v0/protocol/types/michelson/primitives/MichelsonBool.d.ts +0 -12
  286. package/v0/protocol/types/michelson/primitives/MichelsonBool.js +0 -59
  287. package/v0/protocol/types/michelson/primitives/MichelsonBool.js.map +0 -1
  288. package/v0/protocol/types/michelson/primitives/MichelsonBytes.d.ts +0 -14
  289. package/v0/protocol/types/michelson/primitives/MichelsonBytes.js +0 -77
  290. package/v0/protocol/types/michelson/primitives/MichelsonBytes.js.map +0 -1
  291. package/v0/protocol/types/michelson/primitives/MichelsonInt.d.ts +0 -14
  292. package/v0/protocol/types/michelson/primitives/MichelsonInt.js +0 -74
  293. package/v0/protocol/types/michelson/primitives/MichelsonInt.js.map +0 -1
  294. package/v0/protocol/types/michelson/primitives/MichelsonString.d.ts +0 -14
  295. package/v0/protocol/types/michelson/primitives/MichelsonString.js +0 -76
  296. package/v0/protocol/types/michelson/primitives/MichelsonString.js.map +0 -1
  297. package/v0/protocol/types/michelson/primitives/MichelsonUnit.d.ts +0 -9
  298. package/v0/protocol/types/michelson/primitives/MichelsonUnit.js +0 -55
  299. package/v0/protocol/types/michelson/primitives/MichelsonUnit.js.map +0 -1
  300. package/v0/protocol/types/operations/ActivateAccount.d.ts +0 -7
  301. package/v0/protocol/types/operations/ActivateAccount.js +0 -3
  302. package/v0/protocol/types/operations/ActivateAccount.js.map +0 -1
  303. package/v0/protocol/types/operations/Ballot.d.ts +0 -9
  304. package/v0/protocol/types/operations/Ballot.js +0 -3
  305. package/v0/protocol/types/operations/Ballot.js.map +0 -1
  306. package/v0/protocol/types/operations/Delegation.d.ts +0 -11
  307. package/v0/protocol/types/operations/Delegation.js +0 -3
  308. package/v0/protocol/types/operations/Delegation.js.map +0 -1
  309. package/v0/protocol/types/operations/DoubleBakingEvidence.d.ts +0 -8
  310. package/v0/protocol/types/operations/DoubleBakingEvidence.js +0 -3
  311. package/v0/protocol/types/operations/DoubleBakingEvidence.js.map +0 -1
  312. package/v0/protocol/types/operations/DoubleEndorsementEvidence.d.ts +0 -16
  313. package/v0/protocol/types/operations/DoubleEndorsementEvidence.js +0 -3
  314. package/v0/protocol/types/operations/DoubleEndorsementEvidence.js.map +0 -1
  315. package/v0/protocol/types/operations/Endorsement.d.ts +0 -6
  316. package/v0/protocol/types/operations/Endorsement.js +0 -3
  317. package/v0/protocol/types/operations/Endorsement.js.map +0 -1
  318. package/v0/protocol/types/operations/Origination.d.ts +0 -13
  319. package/v0/protocol/types/operations/Origination.js +0 -3
  320. package/v0/protocol/types/operations/Origination.js.map +0 -1
  321. package/v0/protocol/types/operations/Proposal.d.ts +0 -7
  322. package/v0/protocol/types/operations/Proposal.js +0 -3
  323. package/v0/protocol/types/operations/Proposal.js.map +0 -1
  324. package/v0/protocol/types/operations/Reveal.d.ts +0 -11
  325. package/v0/protocol/types/operations/Reveal.js +0 -3
  326. package/v0/protocol/types/operations/Reveal.js.map +0 -1
  327. package/v0/protocol/types/operations/SeedNonceRevelation.d.ts +0 -7
  328. package/v0/protocol/types/operations/SeedNonceRevelation.js +0 -3
  329. package/v0/protocol/types/operations/SeedNonceRevelation.js.map +0 -1
  330. package/v0/protocol/types/operations/TezosOperation.d.ts +0 -4
  331. package/v0/protocol/types/operations/TezosOperation.js +0 -3
  332. package/v0/protocol/types/operations/TezosOperation.js.map +0 -1
  333. package/v0/protocol/types/operations/Transaction.d.ts +0 -23
  334. package/v0/protocol/types/operations/Transaction.js +0 -3
  335. package/v0/protocol/types/operations/Transaction.js.map +0 -1
  336. package/v0/protocol/types/sapling/TezosSaplingAddressCursor.d.ts +0 -4
  337. package/v0/protocol/types/sapling/TezosSaplingAddressCursor.js +0 -3
  338. package/v0/protocol/types/sapling/TezosSaplingAddressCursor.js.map +0 -1
  339. package/v0/protocol/types/sapling/TezosSaplingAddressResult.d.ts +0 -4
  340. package/v0/protocol/types/sapling/TezosSaplingAddressResult.js +0 -3
  341. package/v0/protocol/types/sapling/TezosSaplingAddressResult.js.map +0 -1
  342. package/v0/protocol/types/sapling/TezosSaplingCiphertext.d.ts +0 -8
  343. package/v0/protocol/types/sapling/TezosSaplingCiphertext.js +0 -3
  344. package/v0/protocol/types/sapling/TezosSaplingCiphertext.js.map +0 -1
  345. package/v0/protocol/types/sapling/TezosSaplingInput.d.ts +0 -6
  346. package/v0/protocol/types/sapling/TezosSaplingInput.js +0 -3
  347. package/v0/protocol/types/sapling/TezosSaplingInput.js.map +0 -1
  348. package/v0/protocol/types/sapling/TezosSaplingOutput.d.ts +0 -6
  349. package/v0/protocol/types/sapling/TezosSaplingOutput.js +0 -3
  350. package/v0/protocol/types/sapling/TezosSaplingOutput.js.map +0 -1
  351. package/v0/protocol/types/sapling/TezosSaplingStateDiff.d.ts +0 -6
  352. package/v0/protocol/types/sapling/TezosSaplingStateDiff.js +0 -3
  353. package/v0/protocol/types/sapling/TezosSaplingStateDiff.js.map +0 -1
  354. package/v0/protocol/types/sapling/TezosSaplingStateTree.d.ts +0 -7
  355. package/v0/protocol/types/sapling/TezosSaplingStateTree.js +0 -3
  356. package/v0/protocol/types/sapling/TezosSaplingStateTree.js.map +0 -1
  357. package/v0/protocol/types/sapling/TezosSaplingTransaction.d.ts +0 -23
  358. package/v0/protocol/types/sapling/TezosSaplingTransaction.js +0 -3
  359. package/v0/protocol/types/sapling/TezosSaplingTransaction.js.map +0 -1
  360. package/v0/protocol/types/sapling/TezosSaplingTransactionCursor.d.ts +0 -3
  361. package/v0/protocol/types/sapling/TezosSaplingTransactionCursor.js +0 -3
  362. package/v0/protocol/types/sapling/TezosSaplingTransactionCursor.js.map +0 -1
  363. package/v0/protocol/types/sapling/TezosSaplingTransactionResult.d.ts +0 -6
  364. package/v0/protocol/types/sapling/TezosSaplingTransactionResult.js +0 -3
  365. package/v0/protocol/types/sapling/TezosSaplingTransactionResult.js.map +0 -1
  366. package/v0/protocol/types/utils.d.ts +0 -8
  367. package/v0/protocol/types/utils.js +0 -41
  368. package/v0/protocol/types/utils.js.map +0 -1
  369. package/v0/serializer/schemas/v2/transaction-sign-request-tezos-sapling.json +0 -127
  370. package/v0/serializer/schemas/v2/transaction-sign-request-tezos.json +0 -29
  371. package/v0/serializer/schemas/v2/transaction-sign-response-tezos-sapling.json +0 -19
  372. package/v0/serializer/schemas/v2/transaction-sign-response-tezos.json +0 -19
  373. package/v0/serializer/schemas/v3/transaction-sign-request-tezos-sapling.json +0 -133
  374. package/v0/serializer/schemas/v3/transaction-sign-request-tezos.json +0 -29
  375. package/v0/serializer/schemas/v3/transaction-sign-response-tezos-sapling.json +0 -19
  376. package/v0/serializer/schemas/v3/transaction-sign-response-tezos.json +0 -19
  377. package/v0/serializer/validators/transaction-validator.d.ts +0 -15
  378. package/v0/serializer/validators/transaction-validator.js +0 -107
  379. package/v0/serializer/validators/transaction-validator.js.map +0 -1
  380. package/v0/serializer/validators/transaction-xtz-btc-validator.d.ts +0 -18
  381. package/v0/serializer/validators/transaction-xtz-btc-validator.js +0 -170
  382. package/v0/serializer/validators/transaction-xtz-btc-validator.js.map +0 -1
  383. package/v0/serializer/validators/validators.d.ts +0 -1
  384. package/v0/serializer/validators/validators.js +0 -115
  385. package/v0/serializer/validators/validators.js.map +0 -1
  386. package/v0/types/signed-transaction-tezos-sapling.d.ts +0 -3
  387. package/v0/types/signed-transaction-tezos-sapling.js +0 -3
  388. package/v0/types/signed-transaction-tezos-sapling.js.map +0 -1
  389. package/v0/types/signed-transaction-tezos.d.ts +0 -5
  390. package/v0/types/signed-transaction-tezos.js +0 -3
  391. package/v0/types/signed-transaction-tezos.js.map +0 -1
  392. package/v0/types/transaction-tezos.d.ts +0 -14
  393. package/v0/types/transaction-tezos.js +0 -3
  394. package/v0/types/transaction-tezos.js.map +0 -1
  395. package/v0/types/unsigned-transaction-tezos-sapling.d.ts +0 -38
  396. package/v0/types/unsigned-transaction-tezos-sapling.js +0 -3
  397. package/v0/types/unsigned-transaction-tezos-sapling.js.map +0 -1
  398. package/v0/types/unsigned-transaction-tezos.d.ts +0 -8
  399. package/v0/types/unsigned-transaction-tezos.js +0 -3
  400. package/v0/types/unsigned-transaction-tezos.js.map +0 -1
  401. package/v1/block-explorer/TzKTBlockExplorer.d.ts +0 -9
  402. package/v1/block-explorer/TzKTBlockExplorer.js +0 -72
  403. package/v1/block-explorer/TzKTBlockExplorer.js.map +0 -1
  404. package/v1/block-explorer/factory.d.ts +0 -3
  405. package/v1/block-explorer/factory.js +0 -17
  406. package/v1/block-explorer/factory.js.map +0 -1
  407. package/v1/contract/TezosContract.d.ts +0 -52
  408. package/v1/contract/TezosContract.js +0 -508
  409. package/v1/contract/TezosContract.js.map +0 -1
  410. package/v1/contract/TezosContractCall.d.ts +0 -11
  411. package/v1/contract/TezosContractCall.js +0 -23
  412. package/v1/contract/TezosContractCall.js.map +0 -1
  413. package/v1/contract/TezosContractEntrypoint.d.ts +0 -9
  414. package/v1/contract/TezosContractEntrypoint.js +0 -27
  415. package/v1/contract/TezosContractEntrypoint.js.map +0 -1
  416. package/v1/contract/TezosContractStorage.d.ts +0 -7
  417. package/v1/contract/TezosContractStorage.js +0 -16
  418. package/v1/contract/TezosContractStorage.js.map +0 -1
  419. package/v1/contract/remote-data/TezosContractRemoteDataFactory.d.ts +0 -11
  420. package/v1/contract/remote-data/TezosContractRemoteDataFactory.js +0 -36
  421. package/v1/contract/remote-data/TezosContractRemoteDataFactory.js.map +0 -1
  422. package/v1/contract/remote-data/TezosStorageRemoteData.d.ts +0 -12
  423. package/v1/contract/remote-data/TezosStorageRemoteData.js +0 -152
  424. package/v1/contract/remote-data/TezosStorageRemoteData.js.map +0 -1
  425. package/v1/crypto/TezosCryptoClient.d.ts +0 -13
  426. package/v1/crypto/TezosCryptoClient.js +0 -153
  427. package/v1/crypto/TezosCryptoClient.js.map +0 -1
  428. package/v1/crypto/TezosSaplingCryptoClient.d.ts +0 -25
  429. package/v1/crypto/TezosSaplingCryptoClient.js +0 -222
  430. package/v1/crypto/TezosSaplingCryptoClient.js.map +0 -1
  431. package/v1/data/TezosAddress.d.ts +0 -9
  432. package/v1/data/TezosAddress.js +0 -27
  433. package/v1/data/TezosAddress.js.map +0 -1
  434. package/v1/data/TezosSaplingAddress.d.ts +0 -14
  435. package/v1/data/TezosSaplingAddress.js +0 -105
  436. package/v1/data/TezosSaplingAddress.js.map +0 -1
  437. package/v1/index.d.ts +0 -52
  438. package/v1/index.js +0 -82
  439. package/v1/index.js.map +0 -1
  440. package/v1/indexer/TezosIndexerClient.d.ts +0 -31
  441. package/v1/indexer/TezosIndexerClient.js +0 -3
  442. package/v1/indexer/TezosIndexerClient.js.map +0 -1
  443. package/v1/indexer/TzKTIndexerClient.d.ts +0 -31
  444. package/v1/indexer/TzKTIndexerClient.js +0 -283
  445. package/v1/indexer/TzKTIndexerClient.js.map +0 -1
  446. package/v1/indexer/factory.d.ts +0 -3
  447. package/v1/indexer/factory.js +0 -17
  448. package/v1/indexer/factory.js.map +0 -1
  449. package/v1/indexer/token-metadata/BigMapTokenMetadataIndexerClient.d.ts +0 -12
  450. package/v1/indexer/token-metadata/BigMapTokenMetadataIndexerClient.js +0 -178
  451. package/v1/indexer/token-metadata/BigMapTokenMetadataIndexerClient.js.map +0 -1
  452. package/v1/indexer/token-metadata/ObjktTokenMetadataIndexerClient.d.ts +0 -8
  453. package/v1/indexer/token-metadata/ObjktTokenMetadataIndexerClient.js +0 -95
  454. package/v1/indexer/token-metadata/ObjktTokenMetadataIndexerClient.js.map +0 -1
  455. package/v1/indexer/token-metadata/TokenMetadataIndexerClient.d.ts +0 -4
  456. package/v1/indexer/token-metadata/TokenMetadataIndexerClient.js +0 -3
  457. package/v1/indexer/token-metadata/TokenMetadataIndexerClient.js.map +0 -1
  458. package/v1/injector/TezosSaplingInjectorClient.d.ts +0 -6
  459. package/v1/injector/TezosSaplingInjectorClient.js +0 -68
  460. package/v1/injector/TezosSaplingInjectorClient.js.map +0 -1
  461. package/v1/module/TezosModule.d.ts +0 -11
  462. package/v1/module/TezosModule.js +0 -202
  463. package/v1/module/TezosModule.js.map +0 -1
  464. package/v1/node/TezosSaplingNodeClient.d.ts +0 -8
  465. package/v1/node/TezosSaplingNodeClient.js +0 -78
  466. package/v1/node/TezosSaplingNodeClient.js.map +0 -1
  467. package/v1/protocol/TezosProtocol.d.ts +0 -72
  468. package/v1/protocol/TezosProtocol.js +0 -968
  469. package/v1/protocol/TezosProtocol.js.map +0 -1
  470. package/v1/protocol/fa/TezosFA1Protocol.d.ts +0 -30
  471. package/v1/protocol/fa/TezosFA1Protocol.js +0 -211
  472. package/v1/protocol/fa/TezosFA1Protocol.js.map +0 -1
  473. package/v1/protocol/fa/TezosFA1p2Protocol.d.ts +0 -19
  474. package/v1/protocol/fa/TezosFA1p2Protocol.js +0 -122
  475. package/v1/protocol/fa/TezosFA1p2Protocol.js.map +0 -1
  476. package/v1/protocol/fa/TezosFA2Protocol.d.ts +0 -40
  477. package/v1/protocol/fa/TezosFA2Protocol.js +0 -305
  478. package/v1/protocol/fa/TezosFA2Protocol.js.map +0 -1
  479. package/v1/protocol/fa/TezosFAProtocol.d.ts +0 -76
  480. package/v1/protocol/fa/TezosFAProtocol.js +0 -574
  481. package/v1/protocol/fa/TezosFAProtocol.js.map +0 -1
  482. package/v1/protocol/fa/tokens/BTCTezProtocol.d.ts +0 -14
  483. package/v1/protocol/fa/tokens/BTCTezProtocol.js +0 -74
  484. package/v1/protocol/fa/tokens/BTCTezProtocol.js.map +0 -1
  485. package/v1/protocol/fa/tokens/CTezProtocol.d.ts +0 -14
  486. package/v1/protocol/fa/tokens/CTezProtocol.js +0 -74
  487. package/v1/protocol/fa/tokens/CTezProtocol.js.map +0 -1
  488. package/v1/protocol/fa/tokens/DogamiProtocol.d.ts +0 -14
  489. package/v1/protocol/fa/tokens/DogamiProtocol.js +0 -74
  490. package/v1/protocol/fa/tokens/DogamiProtocol.js.map +0 -1
  491. package/v1/protocol/fa/tokens/ETHTezProtocol.d.ts +0 -18
  492. package/v1/protocol/fa/tokens/ETHTezProtocol.js +0 -117
  493. package/v1/protocol/fa/tokens/ETHTezProtocol.js.map +0 -1
  494. package/v1/protocol/fa/tokens/KolibriUSDProtocol.d.ts +0 -18
  495. package/v1/protocol/fa/tokens/KolibriUSDProtocol.js +0 -117
  496. package/v1/protocol/fa/tokens/KolibriUSDProtocol.js.map +0 -1
  497. package/v1/protocol/fa/tokens/PlentyProtocol.d.ts +0 -18
  498. package/v1/protocol/fa/tokens/PlentyProtocol.js +0 -117
  499. package/v1/protocol/fa/tokens/PlentyProtocol.js.map +0 -1
  500. package/v1/protocol/fa/tokens/QuipuswapProtocol.d.ts +0 -14
  501. package/v1/protocol/fa/tokens/QuipuswapProtocol.js +0 -74
  502. package/v1/protocol/fa/tokens/QuipuswapProtocol.js.map +0 -1
  503. package/v1/protocol/fa/tokens/SiriusProtocol.d.ts +0 -14
  504. package/v1/protocol/fa/tokens/SiriusProtocol.js +0 -74
  505. package/v1/protocol/fa/tokens/SiriusProtocol.js.map +0 -1
  506. package/v1/protocol/fa/tokens/StakerProtocol.d.ts +0 -18
  507. package/v1/protocol/fa/tokens/StakerProtocol.js +0 -117
  508. package/v1/protocol/fa/tokens/StakerProtocol.js.map +0 -1
  509. package/v1/protocol/fa/tokens/TetherUSDProtocol.d.ts +0 -14
  510. package/v1/protocol/fa/tokens/TetherUSDProtocol.js +0 -74
  511. package/v1/protocol/fa/tokens/TetherUSDProtocol.js.map +0 -1
  512. package/v1/protocol/fa/tokens/TzBTCProtocol.d.ts +0 -14
  513. package/v1/protocol/fa/tokens/TzBTCProtocol.js +0 -74
  514. package/v1/protocol/fa/tokens/TzBTCProtocol.js.map +0 -1
  515. package/v1/protocol/fa/tokens/UBTCProtocol.d.ts +0 -14
  516. package/v1/protocol/fa/tokens/UBTCProtocol.js +0 -74
  517. package/v1/protocol/fa/tokens/UBTCProtocol.js.map +0 -1
  518. package/v1/protocol/fa/tokens/UDEFIProtocol.d.ts +0 -14
  519. package/v1/protocol/fa/tokens/UDEFIProtocol.js +0 -74
  520. package/v1/protocol/fa/tokens/UDEFIProtocol.js.map +0 -1
  521. package/v1/protocol/fa/tokens/USDTezProtocol.d.ts +0 -14
  522. package/v1/protocol/fa/tokens/USDTezProtocol.js +0 -74
  523. package/v1/protocol/fa/tokens/USDTezProtocol.js.map +0 -1
  524. package/v1/protocol/fa/tokens/UUSDProtocol.d.ts +0 -14
  525. package/v1/protocol/fa/tokens/UUSDProtocol.js +0 -74
  526. package/v1/protocol/fa/tokens/UUSDProtocol.js.map +0 -1
  527. package/v1/protocol/fa/tokens/WrapProtocol.d.ts +0 -14
  528. package/v1/protocol/fa/tokens/WrapProtocol.js +0 -74
  529. package/v1/protocol/fa/tokens/WrapProtocol.js.map +0 -1
  530. package/v1/protocol/fa/tokens/WrappedTezosProtocol.d.ts +0 -14
  531. package/v1/protocol/fa/tokens/WrappedTezosProtocol.js +0 -74
  532. package/v1/protocol/fa/tokens/WrappedTezosProtocol.js.map +0 -1
  533. package/v1/protocol/fa/tokens/YouProtocol.d.ts +0 -14
  534. package/v1/protocol/fa/tokens/YouProtocol.js +0 -74
  535. package/v1/protocol/fa/tokens/YouProtocol.js.map +0 -1
  536. package/v1/protocol/kt/TezosKtProtocol.d.ts +0 -17
  537. package/v1/protocol/kt/TezosKtProtocol.js +0 -501
  538. package/v1/protocol/kt/TezosKtProtocol.js.map +0 -1
  539. package/v1/protocol/sapling/TezosSaplingProtocol.d.ts +0 -103
  540. package/v1/protocol/sapling/TezosSaplingProtocol.js +0 -1031
  541. package/v1/protocol/sapling/TezosSaplingProtocol.js.map +0 -1
  542. package/v1/protocol/sapling/TezosShieldedTezProtocol.d.ts +0 -17
  543. package/v1/protocol/sapling/TezosShieldedTezProtocol.js +0 -185
  544. package/v1/protocol/sapling/TezosShieldedTezProtocol.js.map +0 -1
  545. package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +0 -13
  546. package/v1/serializer/v3/schemas/converter/transaction-converter.js +0 -59
  547. package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +0 -1
  548. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos-sapling.d.ts +0 -4
  549. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos-sapling.js +0 -3
  550. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos-sapling.js.map +0 -1
  551. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos.d.ts +0 -8
  552. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos.js +0 -3
  553. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos.js.map +0 -1
  554. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-tezos-sapling.d.ts +0 -3
  555. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-tezos-sapling.js +0 -3
  556. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-tezos-sapling.js.map +0 -1
  557. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-tezos.d.ts +0 -3
  558. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-tezos.js +0 -3
  559. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-tezos.js.map +0 -1
  560. package/v1/serializer/v3/schemas/generated/transaction-sign-request-tezos-sapling.json +0 -145
  561. package/v1/serializer/v3/schemas/generated/transaction-sign-request-tezos.json +0 -29
  562. package/v1/serializer/v3/schemas/generated/transaction-sign-response-tezos-sapling.json +0 -19
  563. package/v1/serializer/v3/schemas/generated/transaction-sign-response-tezos.json +0 -19
  564. package/v1/serializer/v3/serializer-companion.d.ts +0 -15
  565. package/v1/serializer/v3/serializer-companion.js +0 -521
  566. package/v1/serializer/v3/serializer-companion.js.map +0 -1
  567. package/v1/serializer/v3/validators/transaction-validator.d.ts +0 -14
  568. package/v1/serializer/v3/validators/transaction-validator.js +0 -179
  569. package/v1/serializer/v3/validators/transaction-validator.js.map +0 -1
  570. package/v1/serializer/v3/validators/validators.d.ts +0 -4
  571. package/v1/serializer/v3/validators/validators.js +0 -108
  572. package/v1/serializer/v3/validators/validators.js.map +0 -1
  573. package/v1/types/address.d.ts +0 -7
  574. package/v1/types/address.js +0 -3
  575. package/v1/types/address.js.map +0 -1
  576. package/v1/types/block/TezosBlockHeader.d.ts +0 -13
  577. package/v1/types/block/TezosBlockHeader.js +0 -3
  578. package/v1/types/block/TezosBlockHeader.js.map +0 -1
  579. package/v1/types/block-explorer.d.ts +0 -6
  580. package/v1/types/block-explorer.js +0 -3
  581. package/v1/types/block-explorer.js.map +0 -1
  582. package/v1/types/contract/TezosContractCode.d.ts +0 -5
  583. package/v1/types/contract/TezosContractCode.js +0 -3
  584. package/v1/types/contract/TezosContractCode.js.map +0 -1
  585. package/v1/types/contract/TezosContractMetadata.d.ts +0 -61
  586. package/v1/types/contract/TezosContractMetadata.js +0 -3
  587. package/v1/types/contract/TezosContractMetadata.js.map +0 -1
  588. package/v1/types/contract/bigmap/BigMap.d.ts +0 -7
  589. package/v1/types/contract/bigmap/BigMap.js +0 -3
  590. package/v1/types/contract/bigmap/BigMap.js.map +0 -1
  591. package/v1/types/contract/bigmap/BigMapEnrtyFilter.d.ts +0 -5
  592. package/v1/types/contract/bigmap/BigMapEnrtyFilter.js +0 -3
  593. package/v1/types/contract/bigmap/BigMapEnrtyFilter.js.map +0 -1
  594. package/v1/types/contract/bigmap/BigMapEntry.d.ts +0 -8
  595. package/v1/types/contract/bigmap/BigMapEntry.js +0 -3
  596. package/v1/types/contract/bigmap/BigMapEntry.js.map +0 -1
  597. package/v1/types/contract/bigmap/BigMapRequest.d.ts +0 -10
  598. package/v1/types/contract/bigmap/BigMapRequest.js +0 -3
  599. package/v1/types/contract/bigmap/BigMapRequest.js.map +0 -1
  600. package/v1/types/fa/TezosFA1ContractEntrypoint.d.ts +0 -1
  601. package/v1/types/fa/TezosFA1ContractEntrypoint.js +0 -3
  602. package/v1/types/fa/TezosFA1ContractEntrypoint.js.map +0 -1
  603. package/v1/types/fa/TezosFA1p2ContractEntrypoint.d.ts +0 -2
  604. package/v1/types/fa/TezosFA1p2ContractEntrypoint.js +0 -3
  605. package/v1/types/fa/TezosFA1p2ContractEntrypoint.js.map +0 -1
  606. package/v1/types/fa/TezosFA2BalanceOfRequest.d.ts +0 -4
  607. package/v1/types/fa/TezosFA2BalanceOfRequest.js +0 -3
  608. package/v1/types/fa/TezosFA2BalanceOfRequest.js.map +0 -1
  609. package/v1/types/fa/TezosFA2BalanceOfResponse.d.ts +0 -5
  610. package/v1/types/fa/TezosFA2BalanceOfResponse.js +0 -3
  611. package/v1/types/fa/TezosFA2BalanceOfResponse.js.map +0 -1
  612. package/v1/types/fa/TezosFA2ContractEntrypoint.d.ts +0 -1
  613. package/v1/types/fa/TezosFA2ContractEntrypoint.js +0 -3
  614. package/v1/types/fa/TezosFA2ContractEntrypoint.js.map +0 -1
  615. package/v1/types/fa/TezosFA2TransferRequest.d.ts +0 -8
  616. package/v1/types/fa/TezosFA2TransferRequest.js +0 -3
  617. package/v1/types/fa/TezosFA2TransferRequest.js.map +0 -1
  618. package/v1/types/fa/TezosFA2UpdateOperatorRequest.d.ts +0 -6
  619. package/v1/types/fa/TezosFA2UpdateOperatorRequest.js +0 -3
  620. package/v1/types/fa/TezosFA2UpdateOperatorRequest.js.map +0 -1
  621. package/v1/types/fa/TezosFATokenMetadata.d.ts +0 -6
  622. package/v1/types/fa/TezosFATokenMetadata.js +0 -3
  623. package/v1/types/fa/TezosFATokenMetadata.js.map +0 -1
  624. package/v1/types/indexer.d.ts +0 -6
  625. package/v1/types/indexer.js +0 -3
  626. package/v1/types/indexer.js.map +0 -1
  627. package/v1/types/micheline/MichelineNode.d.ts +0 -15
  628. package/v1/types/micheline/MichelineNode.js +0 -5
  629. package/v1/types/micheline/MichelineNode.js.map +0 -1
  630. package/v1/types/micheline/MichelineNodeUtils.d.ts +0 -6
  631. package/v1/types/micheline/MichelineNodeUtils.js +0 -40
  632. package/v1/types/micheline/MichelineNodeUtils.js.map +0 -1
  633. package/v1/types/michelson/MichelsonType.d.ts +0 -11
  634. package/v1/types/michelson/MichelsonType.js +0 -22
  635. package/v1/types/michelson/MichelsonType.js.map +0 -1
  636. package/v1/types/michelson/MichelsonTypeMeta.d.ts +0 -33
  637. package/v1/types/michelson/MichelsonTypeMeta.js +0 -136
  638. package/v1/types/michelson/MichelsonTypeMeta.js.map +0 -1
  639. package/v1/types/michelson/MichelsonTypeUtils.d.ts +0 -19
  640. package/v1/types/michelson/MichelsonTypeUtils.js +0 -251
  641. package/v1/types/michelson/MichelsonTypeUtils.js.map +0 -1
  642. package/v1/types/michelson/generics/MichelsonList.d.ts +0 -11
  643. package/v1/types/michelson/generics/MichelsonList.js +0 -70
  644. package/v1/types/michelson/generics/MichelsonList.js.map +0 -1
  645. package/v1/types/michelson/generics/MichelsonMap.d.ts +0 -14
  646. package/v1/types/michelson/generics/MichelsonMap.js +0 -120
  647. package/v1/types/michelson/generics/MichelsonMap.js.map +0 -1
  648. package/v1/types/michelson/generics/MichelsonOption.d.ts +0 -25
  649. package/v1/types/michelson/generics/MichelsonOption.js +0 -121
  650. package/v1/types/michelson/generics/MichelsonOption.js.map +0 -1
  651. package/v1/types/michelson/generics/MichelsonOr.d.ts +0 -25
  652. package/v1/types/michelson/generics/MichelsonOr.js +0 -134
  653. package/v1/types/michelson/generics/MichelsonOr.js.map +0 -1
  654. package/v1/types/michelson/generics/MichelsonPair.d.ts +0 -17
  655. package/v1/types/michelson/generics/MichelsonPair.js +0 -139
  656. package/v1/types/michelson/generics/MichelsonPair.js.map +0 -1
  657. package/v1/types/michelson/grammar/MichelsonGrammarData.d.ts +0 -2
  658. package/v1/types/michelson/grammar/MichelsonGrammarData.js +0 -4
  659. package/v1/types/michelson/grammar/MichelsonGrammarData.js.map +0 -1
  660. package/v1/types/michelson/grammar/MichelsonGrammarInstruction.d.ts +0 -1
  661. package/v1/types/michelson/grammar/MichelsonGrammarInstruction.js +0 -4
  662. package/v1/types/michelson/grammar/MichelsonGrammarInstruction.js.map +0 -1
  663. package/v1/types/michelson/grammar/MichelsonGrammarType.d.ts +0 -1
  664. package/v1/types/michelson/grammar/MichelsonGrammarType.js +0 -4
  665. package/v1/types/michelson/grammar/MichelsonGrammarType.js.map +0 -1
  666. package/v1/types/michelson/primitives/MichelsonAddress.d.ts +0 -15
  667. package/v1/types/michelson/primitives/MichelsonAddress.js +0 -74
  668. package/v1/types/michelson/primitives/MichelsonAddress.js.map +0 -1
  669. package/v1/types/michelson/primitives/MichelsonBool.d.ts +0 -12
  670. package/v1/types/michelson/primitives/MichelsonBool.js +0 -59
  671. package/v1/types/michelson/primitives/MichelsonBool.js.map +0 -1
  672. package/v1/types/michelson/primitives/MichelsonBytes.d.ts +0 -14
  673. package/v1/types/michelson/primitives/MichelsonBytes.js +0 -77
  674. package/v1/types/michelson/primitives/MichelsonBytes.js.map +0 -1
  675. package/v1/types/michelson/primitives/MichelsonInt.d.ts +0 -14
  676. package/v1/types/michelson/primitives/MichelsonInt.js +0 -74
  677. package/v1/types/michelson/primitives/MichelsonInt.js.map +0 -1
  678. package/v1/types/michelson/primitives/MichelsonString.d.ts +0 -14
  679. package/v1/types/michelson/primitives/MichelsonString.js +0 -76
  680. package/v1/types/michelson/primitives/MichelsonString.js.map +0 -1
  681. package/v1/types/michelson/primitives/MichelsonUnit.d.ts +0 -9
  682. package/v1/types/michelson/primitives/MichelsonUnit.js +0 -55
  683. package/v1/types/michelson/primitives/MichelsonUnit.js.map +0 -1
  684. package/v1/types/network.d.ts +0 -4
  685. package/v1/types/network.js +0 -9
  686. package/v1/types/network.js.map +0 -1
  687. package/v1/types/node.d.ts +0 -78
  688. package/v1/types/node.js +0 -3
  689. package/v1/types/node.js.map +0 -1
  690. package/v1/types/operations/TezosOperationType.d.ts +0 -13
  691. package/v1/types/operations/TezosOperationType.js +0 -18
  692. package/v1/types/operations/TezosOperationType.js.map +0 -1
  693. package/v1/types/operations/TezosWrappedOperation.d.ts +0 -5
  694. package/v1/types/operations/TezosWrappedOperation.js +0 -3
  695. package/v1/types/operations/TezosWrappedOperation.js.map +0 -1
  696. package/v1/types/operations/kinds/ActivateAccount.d.ts +0 -7
  697. package/v1/types/operations/kinds/ActivateAccount.js +0 -3
  698. package/v1/types/operations/kinds/ActivateAccount.js.map +0 -1
  699. package/v1/types/operations/kinds/Ballot.d.ts +0 -9
  700. package/v1/types/operations/kinds/Ballot.js +0 -3
  701. package/v1/types/operations/kinds/Ballot.js.map +0 -1
  702. package/v1/types/operations/kinds/Delegation.d.ts +0 -11
  703. package/v1/types/operations/kinds/Delegation.js +0 -3
  704. package/v1/types/operations/kinds/Delegation.js.map +0 -1
  705. package/v1/types/operations/kinds/DoubleBakingEvidence.d.ts +0 -8
  706. package/v1/types/operations/kinds/DoubleBakingEvidence.js +0 -3
  707. package/v1/types/operations/kinds/DoubleBakingEvidence.js.map +0 -1
  708. package/v1/types/operations/kinds/DoubleEndorsementEvidence.d.ts +0 -16
  709. package/v1/types/operations/kinds/DoubleEndorsementEvidence.js +0 -3
  710. package/v1/types/operations/kinds/DoubleEndorsementEvidence.js.map +0 -1
  711. package/v1/types/operations/kinds/Endorsement.d.ts +0 -6
  712. package/v1/types/operations/kinds/Endorsement.js +0 -3
  713. package/v1/types/operations/kinds/Endorsement.js.map +0 -1
  714. package/v1/types/operations/kinds/Origination.d.ts +0 -13
  715. package/v1/types/operations/kinds/Origination.js +0 -3
  716. package/v1/types/operations/kinds/Origination.js.map +0 -1
  717. package/v1/types/operations/kinds/Proposal.d.ts +0 -7
  718. package/v1/types/operations/kinds/Proposal.js +0 -3
  719. package/v1/types/operations/kinds/Proposal.js.map +0 -1
  720. package/v1/types/operations/kinds/Reveal.d.ts +0 -11
  721. package/v1/types/operations/kinds/Reveal.js +0 -3
  722. package/v1/types/operations/kinds/Reveal.js.map +0 -1
  723. package/v1/types/operations/kinds/SeedNonceRevelation.d.ts +0 -7
  724. package/v1/types/operations/kinds/SeedNonceRevelation.js +0 -3
  725. package/v1/types/operations/kinds/SeedNonceRevelation.js.map +0 -1
  726. package/v1/types/operations/kinds/TezosOperation.d.ts +0 -4
  727. package/v1/types/operations/kinds/TezosOperation.js +0 -3
  728. package/v1/types/operations/kinds/TezosOperation.js.map +0 -1
  729. package/v1/types/operations/kinds/Transaction.d.ts +0 -24
  730. package/v1/types/operations/kinds/Transaction.js +0 -3
  731. package/v1/types/operations/kinds/Transaction.js.map +0 -1
  732. package/v1/types/protocol.d.ts +0 -62
  733. package/v1/types/protocol.js +0 -3
  734. package/v1/types/protocol.js.map +0 -1
  735. package/v1/types/sapling/TezosSaplingCiphertext.d.ts +0 -8
  736. package/v1/types/sapling/TezosSaplingCiphertext.js +0 -3
  737. package/v1/types/sapling/TezosSaplingCiphertext.js.map +0 -1
  738. package/v1/types/sapling/TezosSaplingExternalMethodProvider.d.ts +0 -10
  739. package/v1/types/sapling/TezosSaplingExternalMethodProvider.js +0 -3
  740. package/v1/types/sapling/TezosSaplingExternalMethodProvider.js.map +0 -1
  741. package/v1/types/sapling/TezosSaplingInput.d.ts +0 -6
  742. package/v1/types/sapling/TezosSaplingInput.js +0 -3
  743. package/v1/types/sapling/TezosSaplingInput.js.map +0 -1
  744. package/v1/types/sapling/TezosSaplingOutput.d.ts +0 -6
  745. package/v1/types/sapling/TezosSaplingOutput.js +0 -3
  746. package/v1/types/sapling/TezosSaplingOutput.js.map +0 -1
  747. package/v1/types/sapling/TezosSaplingStateDiff.d.ts +0 -6
  748. package/v1/types/sapling/TezosSaplingStateDiff.js +0 -3
  749. package/v1/types/sapling/TezosSaplingStateDiff.js.map +0 -1
  750. package/v1/types/sapling/TezosSaplingStateTree.d.ts +0 -7
  751. package/v1/types/sapling/TezosSaplingStateTree.js +0 -3
  752. package/v1/types/sapling/TezosSaplingStateTree.js.map +0 -1
  753. package/v1/types/sapling/TezosSaplingTransaction.d.ts +0 -23
  754. package/v1/types/sapling/TezosSaplingTransaction.js +0 -3
  755. package/v1/types/sapling/TezosSaplingTransaction.js.map +0 -1
  756. package/v1/types/sapling/TezosSaplingTransactionCursor.d.ts +0 -3
  757. package/v1/types/sapling/TezosSaplingTransactionCursor.js +0 -3
  758. package/v1/types/sapling/TezosSaplingTransactionCursor.js.map +0 -1
  759. package/v1/types/sapling/TezosSaplingTransactionResult.d.ts +0 -6
  760. package/v1/types/sapling/TezosSaplingTransactionResult.js +0 -3
  761. package/v1/types/sapling/TezosSaplingTransactionResult.js.map +0 -1
  762. package/v1/types/transaction.d.ts +0 -30
  763. package/v1/types/transaction.js +0 -3
  764. package/v1/types/transaction.js.map +0 -1
  765. package/v1/utils/address.d.ts +0 -2
  766. package/v1/utils/address.js +0 -13
  767. package/v1/utils/address.js.map +0 -1
  768. package/v1/utils/bip.d.ts +0 -2
  769. package/v1/utils/bip.js +0 -14
  770. package/v1/utils/bip.js.map +0 -1
  771. package/v1/utils/convert.d.ts +0 -4
  772. package/v1/utils/convert.js +0 -33
  773. package/v1/utils/convert.js.map +0 -1
  774. package/v1/utils/encoding.d.ts +0 -52
  775. package/v1/utils/encoding.js +0 -104
  776. package/v1/utils/encoding.js.map +0 -1
  777. package/v1/utils/fa.d.ts +0 -2
  778. package/v1/utils/fa.js +0 -13
  779. package/v1/utils/fa.js.map +0 -1
  780. package/v1/utils/key.d.ts +0 -4
  781. package/v1/utils/key.js +0 -43
  782. package/v1/utils/key.js.map +0 -1
  783. package/v1/utils/micheline.d.ts +0 -8
  784. package/v1/utils/micheline.js +0 -41
  785. package/v1/utils/micheline.js.map +0 -1
  786. package/v1/utils/operations.d.ts +0 -12
  787. package/v1/utils/operations.js +0 -72
  788. package/v1/utils/operations.js.map +0 -1
  789. package/v1/utils/pack.d.ts +0 -10
  790. package/v1/utils/pack.js +0 -252
  791. package/v1/utils/pack.js.map +0 -1
  792. package/v1/utils/protocol/fa/TezosFA1Accountant.d.ts +0 -9
  793. package/v1/utils/protocol/fa/TezosFA1Accountant.js +0 -76
  794. package/v1/utils/protocol/fa/TezosFA1Accountant.js.map +0 -1
  795. package/v1/utils/protocol/fa/TezosFA2Accountant.d.ts +0 -12
  796. package/v1/utils/protocol/fa/TezosFA2Accountant.js +0 -113
  797. package/v1/utils/protocol/fa/TezosFA2Accountant.js.map +0 -1
  798. package/v1/utils/protocol/fa/TezosFAAccountant.d.ts +0 -8
  799. package/v1/utils/protocol/fa/TezosFAAccountant.js +0 -95
  800. package/v1/utils/protocol/fa/TezosFAAccountant.js.map +0 -1
  801. package/v1/utils/protocol/sapling/TezosSaplingAccountant.d.ts +0 -32
  802. package/v1/utils/protocol/sapling/TezosSaplingAccountant.js +0 -589
  803. package/v1/utils/protocol/sapling/TezosSaplingAccountant.js.map +0 -1
  804. package/v1/utils/protocol/sapling/TezosSaplingEncoder.d.ts +0 -22
  805. package/v1/utils/protocol/sapling/TezosSaplingEncoder.js +0 -158
  806. package/v1/utils/protocol/sapling/TezosSaplingEncoder.js.map +0 -1
  807. package/v1/utils/protocol/sapling/TezosSaplingForger.d.ts +0 -27
  808. package/v1/utils/protocol/sapling/TezosSaplingForger.js +0 -304
  809. package/v1/utils/protocol/sapling/TezosSaplingForger.js.map +0 -1
  810. package/v1/utils/protocol/sapling/TezosSaplingState.d.ts +0 -17
  811. package/v1/utils/protocol/sapling/TezosSaplingState.js +0 -266
  812. package/v1/utils/protocol/sapling/TezosSaplingState.js.map +0 -1
  813. package/v1/utils/protocol/tezos/TezosAccountant.d.ts +0 -13
  814. package/v1/utils/protocol/tezos/TezosAccountant.js +0 -177
  815. package/v1/utils/protocol/tezos/TezosAccountant.js.map +0 -1
  816. package/v1/utils/protocol/tezos/TezosForger.d.ts +0 -6
  817. package/v1/utils/protocol/tezos/TezosForger.js +0 -82
  818. package/v1/utils/protocol/tezos/TezosForger.js.map +0 -1
  819. package/v1/utils/signature.d.ts +0 -2
  820. package/v1/utils/signature.js +0 -23
  821. package/v1/utils/signature.js.map +0 -1
  822. package/v1/utils/transaction.d.ts +0 -9
  823. package/v1/utils/transaction.js +0 -26
  824. package/v1/utils/transaction.js.map +0 -1
@@ -1,968 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
- Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.createTezosProtocolOptions = exports.TEZOS_GHOSTNET_PROTOCOL_NETWORK = exports.TEZOS_MAINNET_PROTOCOL_NETWORK = exports.createTezosProtocol = exports.TezosProtocolImpl = exports.TEZOS_ACCOUNT_METADATA = exports.TEZOS_DERIVATION_PATH = exports.TEZOS_UNITS = void 0;
54
- var coinlib_core_1 = require("@airgap/coinlib-core");
55
- var index_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/axios-0.19.0/index"));
56
- var bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
57
- // @ts-ignore
58
- var index_2 = require("@airgap/coinlib-core/dependencies/src/bip39-2.5.0/index");
59
- var src_1 = require("@airgap/coinlib-core/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src");
60
- var errors_1 = require("@airgap/coinlib-core/errors");
61
- var module_kit_1 = require("@airgap/module-kit");
62
- var TezosCryptoClient_1 = require("../crypto/TezosCryptoClient");
63
- var TezosAddress_1 = require("../data/TezosAddress");
64
- var factory_1 = require("../indexer/factory");
65
- var network_1 = require("../types/network");
66
- var TezosOperationType_1 = require("../types/operations/TezosOperationType");
67
- var key_1 = require("../utils/key");
68
- var operations_1 = require("../utils/operations");
69
- var TezosAccountant_1 = require("../utils/protocol/tezos/TezosAccountant");
70
- var TezosForger_1 = require("../utils/protocol/tezos/TezosForger");
71
- var signature_1 = require("../utils/signature");
72
- // Implementation
73
- var MAX_OPERATIONS_PER_GROUP = 200;
74
- var MAX_GAS_PER_BLOCK = 5200000;
75
- var GAS_LIMIT_PLACEHOLDER = '1040000';
76
- var STORAGE_LIMIT_PLACEHOLDER = '60000';
77
- var FEE_PLACEHOLDER = '0';
78
- var MINIMAL_FEE = 100;
79
- var MINIMAL_FEE_PER_GAS_UNIT = 0.1;
80
- var MINIMAL_FEE_PER_BYTE = 1;
81
- exports.TEZOS_UNITS = {
82
- tez: {
83
- symbol: { value: 'XTZ', market: 'xtz' },
84
- decimals: 6
85
- },
86
- mutez: {
87
- symbol: { value: 'mutez' },
88
- decimals: 0
89
- },
90
- nanotez: {
91
- symbol: { value: 'nanotez' },
92
- decimals: -3
93
- }
94
- };
95
- exports.TEZOS_DERIVATION_PATH = "m/44h/1729h/0h/0h";
96
- exports.TEZOS_ACCOUNT_METADATA = {
97
- standardDerivationPath: exports.TEZOS_DERIVATION_PATH,
98
- address: {
99
- isCaseSensitive: true,
100
- placeholder: 'tz1...',
101
- regex: '^((tz1|tz2|tz3|KT1)[1-9A-Za-z]{33}|zet1[1-9A-Za-z]{65})$'
102
- }
103
- };
104
- var TezosProtocolImpl = /** @class */ (function () {
105
- function TezosProtocolImpl(options) {
106
- // Common
107
- this.units = exports.TEZOS_UNITS;
108
- this.feeDefaults = {
109
- low: (0, module_kit_1.newAmount)(0.00142, 'tez').blockchain(this.units),
110
- medium: (0, module_kit_1.newAmount)(0.00152, 'tez').blockchain(this.units),
111
- high: (0, module_kit_1.newAmount)(0.003, 'tez').blockchain(this.units)
112
- };
113
- this.metadata = {
114
- identifier: coinlib_core_1.MainProtocolSymbols.XTZ,
115
- name: 'Tezos',
116
- units: this.units,
117
- mainUnit: 'tez',
118
- fee: {
119
- defaults: this.feeDefaults
120
- },
121
- account: exports.TEZOS_ACCOUNT_METADATA
122
- };
123
- this.options = createTezosProtocolOptions(options.network);
124
- this.forger = new TezosForger_1.TezosForger();
125
- this.accountant = new TezosAccountant_1.TezosAccountant(this.forger, this.options.network);
126
- this.indexerClient = (0, factory_1.createTezosIndexerClient)(this.options.network.indexer);
127
- this.cryptoClient = new TezosCryptoClient_1.TezosCryptoClient();
128
- }
129
- TezosProtocolImpl.prototype.getMetadata = function () {
130
- return __awaiter(this, void 0, void 0, function () {
131
- return __generator(this, function (_a) {
132
- return [2 /*return*/, this.metadata];
133
- });
134
- });
135
- };
136
- TezosProtocolImpl.prototype.getAddressFromPublicKey = function (publicKey) {
137
- return __awaiter(this, void 0, void 0, function () {
138
- return __generator(this, function (_a) {
139
- return [2 /*return*/, TezosAddress_1.TezosAddress.fromPublicKey(publicKey).asString()];
140
- });
141
- });
142
- };
143
- TezosProtocolImpl.prototype.getDetailsFromTransaction = function (transaction, _publicKey) {
144
- return __awaiter(this, void 0, void 0, function () {
145
- return __generator(this, function (_a) {
146
- return [2 /*return*/, this.accountant.getDetailsFromTransaction(transaction)];
147
- });
148
- });
149
- };
150
- TezosProtocolImpl.prototype.verifyMessageWithPublicKey = function (message, signature, publicKey) {
151
- return __awaiter(this, void 0, void 0, function () {
152
- var encodedSignature, hexPublicKey;
153
- return __generator(this, function (_a) {
154
- encodedSignature = (0, signature_1.convertSignature)(signature, 'encoded');
155
- hexPublicKey = (0, key_1.convertPublicKey)(publicKey, 'hex');
156
- return [2 /*return*/, this.cryptoClient.verifyMessage(message, encodedSignature.value, hexPublicKey.value)];
157
- });
158
- });
159
- };
160
- TezosProtocolImpl.prototype.encryptAsymmetricWithPublicKey = function (payload, publicKey) {
161
- return __awaiter(this, void 0, void 0, function () {
162
- var hexPublicKey;
163
- return __generator(this, function (_a) {
164
- hexPublicKey = (0, key_1.convertPublicKey)(publicKey, 'hex');
165
- return [2 /*return*/, this.cryptoClient.encryptAsymmetric(payload, hexPublicKey.value)];
166
- });
167
- });
168
- };
169
- // Offline
170
- TezosProtocolImpl.prototype.getKeyPairFromSecret = function (secret, derivationPath) {
171
- return __awaiter(this, void 0, void 0, function () {
172
- return __generator(this, function (_a) {
173
- switch (secret.type) {
174
- case 'hex':
175
- return [2 /*return*/, this.getKeyPairFromHexSecret(secret.value, derivationPath)];
176
- case 'mnemonic':
177
- return [2 /*return*/, this.getKeyPairFromMnemonic(secret.value, secret.password, derivationPath)];
178
- default:
179
- (0, coinlib_core_1.assertNever)(secret);
180
- throw new errors_1.UnsupportedError(coinlib_core_1.Domain.TEZOS, 'Unsupported secret type.');
181
- }
182
- return [2 /*return*/];
183
- });
184
- });
185
- };
186
- TezosProtocolImpl.prototype.getKeyPairFromHexSecret = function (secret, derivationPath) {
187
- return __awaiter(this, void 0, void 0, function () {
188
- var keyPair;
189
- return __generator(this, function (_a) {
190
- keyPair = (0, src_1.generateWalletUsingDerivationPath)(Buffer.from(secret, 'hex'), derivationPath);
191
- // should we maybe return encoded keys, i.e. edsk... and edpk... strings?
192
- return [2 /*return*/, {
193
- secretKey: (0, module_kit_1.newSecretKey)(Buffer.from(keyPair.secretKey).toString('hex'), 'hex'),
194
- publicKey: (0, module_kit_1.newPublicKey)(Buffer.from(keyPair.publicKey).toString('hex'), 'hex')
195
- }];
196
- });
197
- });
198
- };
199
- TezosProtocolImpl.prototype.getKeyPairFromMnemonic = function (mnemonic, password, derivationPath) {
200
- return __awaiter(this, void 0, void 0, function () {
201
- var secret;
202
- return __generator(this, function (_a) {
203
- secret = (0, index_2.mnemonicToSeed)(mnemonic, password);
204
- return [2 /*return*/, this.getKeyPairFromHexSecret(secret.toString('hex'), derivationPath)];
205
- });
206
- });
207
- };
208
- TezosProtocolImpl.prototype.signTransactionWithSecretKey = function (transaction, secretKey) {
209
- return __awaiter(this, void 0, void 0, function () {
210
- var hexSecretKey, binaryTransaction, opSignature, signedOp;
211
- return __generator(this, function (_a) {
212
- hexSecretKey = (0, key_1.convertSecretKey)(secretKey, 'hex');
213
- binaryTransaction = Buffer.from(transaction.binary, 'hex');
214
- opSignature = this.cryptoClient.operationSignature(Buffer.from(hexSecretKey.value, 'hex'), binaryTransaction);
215
- signedOp = Buffer.concat([binaryTransaction, opSignature]);
216
- return [2 /*return*/, (0, module_kit_1.newSignedTransaction)({ binary: signedOp.toString('hex') })];
217
- });
218
- });
219
- };
220
- TezosProtocolImpl.prototype.signMessageWithKeyPair = function (message, keyPair) {
221
- return __awaiter(this, void 0, void 0, function () {
222
- var hexSecretKey, signature;
223
- return __generator(this, function (_a) {
224
- switch (_a.label) {
225
- case 0:
226
- hexSecretKey = (0, key_1.convertSecretKey)(keyPair.secretKey, 'hex');
227
- return [4 /*yield*/, this.cryptoClient.signMessage(message, { privateKey: hexSecretKey.value })];
228
- case 1:
229
- signature = _a.sent();
230
- return [2 /*return*/, (0, module_kit_1.newSignature)(signature, 'encoded')];
231
- }
232
- });
233
- });
234
- };
235
- TezosProtocolImpl.prototype.decryptAsymmetricWithKeyPair = function (payload, keyPair) {
236
- return __awaiter(this, void 0, void 0, function () {
237
- var hexSecretKey, hexPublicKey;
238
- return __generator(this, function (_a) {
239
- hexSecretKey = (0, key_1.convertSecretKey)(keyPair.secretKey, 'hex');
240
- hexPublicKey = (0, key_1.convertPublicKey)(keyPair.publicKey, 'hex');
241
- return [2 /*return*/, this.cryptoClient.decryptAsymmetric(payload, { publicKey: hexPublicKey.value, privateKey: hexSecretKey.value })];
242
- });
243
- });
244
- };
245
- TezosProtocolImpl.prototype.encryptAESWithSecretKey = function (payload, secretKey) {
246
- return __awaiter(this, void 0, void 0, function () {
247
- var hexSecretKey;
248
- return __generator(this, function (_a) {
249
- hexSecretKey = (0, key_1.convertSecretKey)(secretKey, 'hex');
250
- return [2 /*return*/, this.cryptoClient.encryptAES(payload, hexSecretKey.value)];
251
- });
252
- });
253
- };
254
- TezosProtocolImpl.prototype.decryptAESWithSecretKey = function (payload, secretKey) {
255
- return __awaiter(this, void 0, void 0, function () {
256
- var hexSecretKey;
257
- return __generator(this, function (_a) {
258
- hexSecretKey = (0, key_1.convertSecretKey)(secretKey, 'hex');
259
- return [2 /*return*/, this.cryptoClient.decryptAES(payload, hexSecretKey.value)];
260
- });
261
- });
262
- };
263
- // Online
264
- TezosProtocolImpl.prototype.getNetwork = function () {
265
- return __awaiter(this, void 0, void 0, function () {
266
- return __generator(this, function (_a) {
267
- return [2 /*return*/, this.options.network];
268
- });
269
- });
270
- };
271
- TezosProtocolImpl.prototype.getTransactionsForPublicKey = function (publicKey, limit, cursor) {
272
- return __awaiter(this, void 0, void 0, function () {
273
- var address;
274
- return __generator(this, function (_a) {
275
- switch (_a.label) {
276
- case 0: return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
277
- case 1:
278
- address = _a.sent();
279
- return [2 /*return*/, this.getTransactionsForAddress(address, limit, cursor)];
280
- }
281
- });
282
- });
283
- };
284
- TezosProtocolImpl.prototype.getTransactionsForAddress = function (address, limit, cursor) {
285
- var _a;
286
- return __awaiter(this, void 0, void 0, function () {
287
- var transactions;
288
- var _this = this;
289
- return __generator(this, function (_b) {
290
- switch (_b.label) {
291
- case 0: return [4 /*yield*/, this.indexerClient.getTransactions(address, limit, cursor === null || cursor === void 0 ? void 0 : cursor.offset)];
292
- case 1:
293
- transactions = _b.sent();
294
- return [2 /*return*/, {
295
- transactions: transactions.map(function (transaction) { return (__assign(__assign({}, transaction), { network: _this.options.network })); }),
296
- cursor: {
297
- hasNext: transactions.length >= limit,
298
- offset: ((_a = cursor === null || cursor === void 0 ? void 0 : cursor.offset) !== null && _a !== void 0 ? _a : 0) + transactions.length
299
- }
300
- }];
301
- }
302
- });
303
- });
304
- };
305
- TezosProtocolImpl.prototype.getBalanceOfPublicKey = function (publicKey) {
306
- return __awaiter(this, void 0, void 0, function () {
307
- var address;
308
- return __generator(this, function (_a) {
309
- switch (_a.label) {
310
- case 0: return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
311
- case 1:
312
- address = _a.sent();
313
- return [2 /*return*/, this.getBalanceOfAddress(address)];
314
- }
315
- });
316
- });
317
- };
318
- TezosProtocolImpl.prototype.getBalanceOfAddress = function (address) {
319
- return __awaiter(this, void 0, void 0, function () {
320
- var balance, data, error_1;
321
- return __generator(this, function (_a) {
322
- switch (_a.label) {
323
- case 0:
324
- balance = new bignumber_1.default(0);
325
- _a.label = 1;
326
- case 1:
327
- _a.trys.push([1, 3, , 4]);
328
- return [4 /*yield*/, index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head/context/contracts/").concat(address, "/balance"))];
329
- case 2:
330
- data = (_a.sent()).data;
331
- balance = new bignumber_1.default(data);
332
- return [3 /*break*/, 4];
333
- case 3:
334
- error_1 = _a.sent();
335
- // if node returns 404 (which means 'no account found'), go with 0 balance
336
- if (error_1.response && error_1.response.status !== 404) {
337
- throw new errors_1.NetworkError(coinlib_core_1.Domain.TEZOS, error_1);
338
- }
339
- return [3 /*break*/, 4];
340
- case 4: return [2 /*return*/, { total: (0, module_kit_1.newAmount)(balance, 'blockchain') }];
341
- }
342
- });
343
- });
344
- };
345
- TezosProtocolImpl.prototype.getTransactionMaxAmountWithPublicKey = function (publicKey, to, configuration) {
346
- return __awaiter(this, void 0, void 0, function () {
347
- var total, adjustedTotal;
348
- return __generator(this, function (_a) {
349
- switch (_a.label) {
350
- case 0: return [4 /*yield*/, this.getBalanceOfPublicKey(publicKey)];
351
- case 1:
352
- total = (_a.sent()).total;
353
- adjustedTotal = new bignumber_1.default((0, module_kit_1.newAmount)(total).convert('mutez', this.units).value).minus(1) // Tezos accounts can never be empty. We must leave at least 1 mutez behind.
354
- ;
355
- return [2 /*return*/, this.getTansactionMaxAmountWithBalance(publicKey, adjustedTotal, to, configuration === null || configuration === void 0 ? void 0 : configuration.fee)];
356
- }
357
- });
358
- });
359
- };
360
- TezosProtocolImpl.prototype.getTansactionMaxAmountWithBalance = function (publicKey, balance, to, fee) {
361
- return __awaiter(this, void 0, void 0, function () {
362
- var maxFee, estimatedFee, error_2, rpcErrors, balanceTooLowError, excess, newMaxBalance, amountWithoutFees;
363
- return __generator(this, function (_a) {
364
- switch (_a.label) {
365
- case 0:
366
- if (!(fee !== undefined)) return [3 /*break*/, 1];
367
- maxFee = fee;
368
- return [3 /*break*/, 4];
369
- case 1:
370
- _a.trys.push([1, 3, , 4]);
371
- return [4 /*yield*/, this.getTransactionFeeWithPublicKey(publicKey, to.map(function (recipient) { return ({
372
- to: recipient,
373
- amount: (0, module_kit_1.newAmount)(balance.div(to.length).decimalPlaces(0, bignumber_1.default.ROUND_CEIL), 'blockchain')
374
- }); }))];
375
- case 2:
376
- estimatedFee = _a.sent();
377
- maxFee = (0, module_kit_1.newAmount)(estimatedFee.medium).blockchain(this.units);
378
- if (balance.lte(maxFee.value)) {
379
- maxFee = (0, module_kit_1.newAmount)(0, 'blockchain');
380
- }
381
- return [3 /*break*/, 4];
382
- case 3:
383
- error_2 = _a.sent();
384
- if (error_2.code !== undefined && error_2.code === errors_1.ProtocolErrorType.TRANSACTION_FAILED && Array.isArray(error_2.data)) {
385
- rpcErrors = error_2.data;
386
- balanceTooLowError = rpcErrors.find(function (error) { return error.id.endsWith('.contract.balance_too_low'); });
387
- if (balanceTooLowError !== undefined && balanceTooLowError.amount !== undefined && balanceTooLowError.balance !== undefined) {
388
- excess = new bignumber_1.default(balanceTooLowError.amount).minus(new bignumber_1.default(balanceTooLowError.balance).minus(1));
389
- newMaxBalance = balance.minus(excess);
390
- if (newMaxBalance.gt(0)) {
391
- return [2 /*return*/, this.getTansactionMaxAmountWithBalance(publicKey, newMaxBalance, to, fee)];
392
- }
393
- }
394
- }
395
- throw error_2;
396
- case 4:
397
- maxFee = (0, module_kit_1.newAmount)(maxFee).blockchain(this.units);
398
- amountWithoutFees = balance.minus(maxFee.value);
399
- if (amountWithoutFees.isNegative()) {
400
- amountWithoutFees = new bignumber_1.default(0);
401
- }
402
- return [2 /*return*/, (0, module_kit_1.newAmount)(amountWithoutFees, 'blockchain')];
403
- }
404
- });
405
- });
406
- };
407
- TezosProtocolImpl.prototype.getTransactionFeeWithPublicKey = function (publicKey, details) {
408
- return __awaiter(this, void 0, void 0, function () {
409
- var operations, i, recipient, transaction;
410
- return __generator(this, function (_a) {
411
- if (details.length === 0) {
412
- return [2 /*return*/, this.feeDefaults];
413
- }
414
- operations = [];
415
- for (i = 0; i < details.length; ++i) {
416
- recipient = details[i].to;
417
- transaction = {
418
- kind: TezosOperationType_1.TezosOperationType.TRANSACTION,
419
- amount: (0, module_kit_1.newAmount)(details[i].amount).blockchain(this.units).value,
420
- destination: recipient,
421
- fee: '0'
422
- };
423
- operations.push(transaction);
424
- }
425
- return [2 /*return*/, this.getOperationFeeDefaults(publicKey, operations)];
426
- });
427
- });
428
- };
429
- TezosProtocolImpl.prototype.getOperationFeeDefaults = function (publicKey, operations) {
430
- return __awaiter(this, void 0, void 0, function () {
431
- var estimated, hasReveal, estimatedFee, feeStepFactor, lowFee, mediumFee, highFee;
432
- return __generator(this, function (_a) {
433
- switch (_a.label) {
434
- case 0: return [4 /*yield*/, this.prepareOperations(publicKey, operations)];
435
- case 1:
436
- estimated = _a.sent();
437
- hasReveal = estimated.contents.some(function (op) { return op.kind === TezosOperationType_1.TezosOperationType.REVEAL; });
438
- estimatedFee = estimated.contents
439
- .reduce(function (current, next) {
440
- if (next.fee !== undefined) {
441
- return current.plus(new bignumber_1.default(next.fee));
442
- }
443
- return current;
444
- }, new bignumber_1.default(0))
445
- .minus(hasReveal ? operations_1.REVEAL_FEE : 0)
446
- .div(hasReveal ? estimated.contents.length - 1 : estimated.contents.length);
447
- feeStepFactor = new bignumber_1.default(0.2);
448
- lowFee = estimatedFee;
449
- mediumFee = lowFee.plus(lowFee.times(feeStepFactor).integerValue(bignumber_1.default.ROUND_FLOOR));
450
- highFee = mediumFee.plus(mediumFee.times(feeStepFactor).integerValue(bignumber_1.default.ROUND_FLOOR));
451
- return [2 /*return*/, {
452
- low: (0, module_kit_1.newAmount)(lowFee, 'blockchain'),
453
- medium: (0, module_kit_1.newAmount)(mediumFee, 'blockchain'),
454
- high: (0, module_kit_1.newAmount)(highFee, 'blockchain')
455
- }];
456
- }
457
- });
458
- });
459
- };
460
- TezosProtocolImpl.prototype.prepareTransactionWithPublicKey = function (publicKey, details, configuration) {
461
- return __awaiter(this, void 0, void 0, function () {
462
- var transactions;
463
- return __generator(this, function (_a) {
464
- switch (_a.label) {
465
- case 0:
466
- if (details.length > MAX_OPERATIONS_PER_GROUP) {
467
- throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, "this transaction exceeds the maximum allowed number of transactions per operation (".concat(MAX_OPERATIONS_PER_GROUP, "). Please use the \"prepareTransactionsFromPublicKey\" method instead."));
468
- }
469
- return [4 /*yield*/, this.prepareTransactionsWithPublicKey(publicKey, details, configuration)];
470
- case 1:
471
- transactions = _a.sent();
472
- if (transactions.length === 1) {
473
- return [2 /*return*/, transactions[0]];
474
- }
475
- else {
476
- throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, 'Transaction could not be prepared. More or less than 1 operations have been generated.');
477
- }
478
- return [2 /*return*/];
479
- }
480
- });
481
- });
482
- };
483
- TezosProtocolImpl.prototype.broadcastTransaction = function (transaction) {
484
- return __awaiter(this, void 0, void 0, function () {
485
- var injectionResponse;
486
- return __generator(this, function (_a) {
487
- switch (_a.label) {
488
- case 0: return [4 /*yield*/, index_1.default
489
- .post("".concat(this.options.network.rpcUrl, "/injection/operation?chain=main"), JSON.stringify(transaction.binary), {
490
- headers: { 'content-type': 'application/json' }
491
- })
492
- .catch(function (error) {
493
- throw new errors_1.NetworkError(coinlib_core_1.Domain.TEZOS, error);
494
- })
495
- // returns hash if successful
496
- ];
497
- case 1:
498
- injectionResponse = (_a.sent()).data;
499
- // returns hash if successful
500
- return [2 /*return*/, injectionResponse];
501
- }
502
- });
503
- });
504
- };
505
- // Custom
506
- TezosProtocolImpl.prototype.forgeOperation = function (wrappedOperation) {
507
- return __awaiter(this, void 0, void 0, function () {
508
- return __generator(this, function (_a) {
509
- return [2 /*return*/, this.forger.forgeOperation(wrappedOperation)];
510
- });
511
- });
512
- };
513
- TezosProtocolImpl.prototype.unforgeOperation = function (forged, type) {
514
- if (type === void 0) { type = 'unsigned'; }
515
- return __awaiter(this, void 0, void 0, function () {
516
- return __generator(this, function (_a) {
517
- return [2 /*return*/, this.forger.unforgeOperation(forged, type)];
518
- });
519
- });
520
- };
521
- TezosProtocolImpl.prototype.prepareTransactionsWithPublicKey = function (publicKey, details, configuration) {
522
- var _a;
523
- return __awaiter(this, void 0, void 0, function () {
524
- var operationsPerGroup, fee, estimatedFee, wrappedFee, address, operations, results, currentCounter, counter, branch, accountManager, _b, total, transferable, balance, transactions, allOperations, numberOfGroups, startingCounter, i, start, end, operationsGroup, wrappedOperationWithEstimatedGas, forged;
525
- return __generator(this, function (_c) {
526
- switch (_c.label) {
527
- case 0:
528
- operationsPerGroup = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.operationsPerGroup) !== null && _a !== void 0 ? _a : MAX_OPERATIONS_PER_GROUP;
529
- if (!((configuration === null || configuration === void 0 ? void 0 : configuration.fee) !== undefined)) return [3 /*break*/, 1];
530
- fee = configuration.fee;
531
- return [3 /*break*/, 3];
532
- case 1: return [4 /*yield*/, this.getTransactionFeeWithPublicKey(publicKey, details)];
533
- case 2:
534
- estimatedFee = _c.sent();
535
- fee = estimatedFee.medium;
536
- _c.label = 3;
537
- case 3:
538
- wrappedFee = new bignumber_1.default((0, module_kit_1.newAmount)(fee).blockchain(this.units).value);
539
- return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
540
- case 4:
541
- address = _c.sent();
542
- operations = [];
543
- return [4 /*yield*/, Promise.all([
544
- index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head/context/contracts/").concat(address, "/counter")),
545
- index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head~2/hash")),
546
- index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head/context/contracts/").concat(address, "/manager_key"))
547
- ]).catch(function (error) {
548
- throw new errors_1.NetworkError(coinlib_core_1.Domain.TEZOS, error);
549
- })];
550
- case 5:
551
- results = _c.sent();
552
- currentCounter = new bignumber_1.default(results[0].data);
553
- counter = currentCounter.plus(1);
554
- branch = results[1].data;
555
- accountManager = results[2].data;
556
- // check if we have revealed the address already
557
- if (!accountManager) {
558
- operations.push((0, operations_1.createRevealOperation)(counter, publicKey, address));
559
- counter = counter.plus(1);
560
- }
561
- return [4 /*yield*/, this.getBalanceOfPublicKey(publicKey)];
562
- case 6:
563
- _b = _c.sent(), total = _b.total, transferable = _b.transferable;
564
- balance = new bignumber_1.default((0, module_kit_1.newAmount)(transferable !== null && transferable !== void 0 ? transferable : total).blockchain(this.units).value);
565
- transactions = [];
566
- return [4 /*yield*/, this.createTransactionOperations(operations, details, wrappedFee, address, counter, balance)];
567
- case 7:
568
- allOperations = _c.sent();
569
- allOperations = operations.concat(allOperations); // if we have a reveal in operations, we need to make sure it is present in the allOperations array
570
- numberOfGroups = Math.ceil(allOperations.length / operationsPerGroup);
571
- startingCounter = numberOfGroups > 1 ? currentCounter.plus(1) : undefined;
572
- i = 0;
573
- _c.label = 8;
574
- case 8:
575
- if (!(i < numberOfGroups)) return [3 /*break*/, 12];
576
- start = i * operationsPerGroup;
577
- end = start + operationsPerGroup;
578
- operationsGroup = allOperations.slice(start, end);
579
- return [4 /*yield*/, this.estimateAndReplaceLimitsAndFee({
580
- branch: branch,
581
- contents: operationsGroup
582
- }, false, startingCounter)];
583
- case 9:
584
- wrappedOperationWithEstimatedGas = _c.sent();
585
- return [4 /*yield*/, this.forgeOperation(wrappedOperationWithEstimatedGas)];
586
- case 10:
587
- forged = _c.sent();
588
- transactions.push((0, module_kit_1.newUnsignedTransaction)({ binary: forged }));
589
- _c.label = 11;
590
- case 11:
591
- i++;
592
- return [3 /*break*/, 8];
593
- case 12: return [2 /*return*/, transactions];
594
- }
595
- });
596
- });
597
- };
598
- TezosProtocolImpl.prototype.prepareOperations = function (publicKey, operationRequests, overrideParameters) {
599
- if (overrideParameters === void 0) { overrideParameters = true; }
600
- return __awaiter(this, void 0, void 0, function () {
601
- var counter, branch, operations, address, results, accountManager, hasRevealInOperationRequests, operationPromises, _a, _b, _c, wrappedOperation;
602
- var _this = this;
603
- return __generator(this, function (_d) {
604
- switch (_d.label) {
605
- case 0:
606
- counter = new bignumber_1.default(1);
607
- operations = [];
608
- return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
609
- case 1:
610
- address = _d.sent();
611
- return [4 /*yield*/, Promise.all([
612
- index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head/context/contracts/").concat(address, "/counter")),
613
- index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head~2/hash")),
614
- index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head/context/contracts/").concat(address, "/manager_key"))
615
- ]).catch(function (error) {
616
- throw new errors_1.NetworkError(coinlib_core_1.Domain.TEZOS, error);
617
- })];
618
- case 2:
619
- results = _d.sent();
620
- counter = new bignumber_1.default(results[0].data).plus(1);
621
- branch = results[1].data;
622
- accountManager = results[2].data;
623
- hasRevealInOperationRequests = operationRequests.some(function (request) { return request.kind === TezosOperationType_1.TezosOperationType.REVEAL; });
624
- // check if we have revealed the address already
625
- if (!accountManager && !hasRevealInOperationRequests) {
626
- operations.push((0, operations_1.createRevealOperation)(counter, publicKey, address));
627
- counter = counter.plus(1);
628
- }
629
- operationPromises = operationRequests.map(function (operationRequest, index) { return __awaiter(_this, void 0, void 0, function () {
630
- var recipient, receivingBalance, total, defaultCounter, defaultFee, defaultGasLimit, defaultStorageLimit, revealOperation, delegationOperation, transactionOperation, originationOperation;
631
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
632
- return __generator(this, function (_w) {
633
- switch (_w.label) {
634
- case 0:
635
- // TODO: Handle activation burn
636
- if (!operationRequest.kind) {
637
- throw new errors_1.PropertyUndefinedError(coinlib_core_1.Domain.TEZOS, 'property "kind" was not defined');
638
- }
639
- recipient = operationRequest.destination;
640
- if (!(recipient && recipient.toLowerCase().startsWith('tz'))) return [3 /*break*/, 2];
641
- return [4 /*yield*/, this.getBalanceOfAddress(recipient)];
642
- case 1:
643
- total = (_w.sent()).total;
644
- receivingBalance = new bignumber_1.default((0, module_kit_1.newAmount)(total).blockchain(this.units).value);
645
- _w.label = 2;
646
- case 2:
647
- defaultCounter = counter.plus(index).toFixed() // TODO: Handle counter if we have some operations without counters in the array
648
- ;
649
- defaultFee = FEE_PLACEHOLDER;
650
- defaultGasLimit = '10300';
651
- defaultStorageLimit = receivingBalance && receivingBalance.isZero() && recipient && recipient.toLowerCase().startsWith('tz') ? '300' : '0' // taken from eztz
652
- ;
653
- switch (operationRequest.kind) {
654
- // TODO: Handle if the dApp already provides a reveal operation
655
- case TezosOperationType_1.TezosOperationType.REVEAL:
656
- revealOperation = operationRequest;
657
- if (!revealOperation.public_key) {
658
- throw new errors_1.PropertyUndefinedError(coinlib_core_1.Domain.TEZOS, 'property "public_key" was not defined');
659
- }
660
- revealOperation.source = (_a = revealOperation.source) !== null && _a !== void 0 ? _a : address;
661
- revealOperation.counter = (_b = revealOperation.counter) !== null && _b !== void 0 ? _b : defaultCounter;
662
- revealOperation.fee = (_c = revealOperation.fee) !== null && _c !== void 0 ? _c : defaultFee;
663
- revealOperation.gas_limit = (_d = revealOperation.gas_limit) !== null && _d !== void 0 ? _d : defaultGasLimit;
664
- revealOperation.storage_limit = (_e = revealOperation.storage_limit) !== null && _e !== void 0 ? _e : defaultStorageLimit;
665
- return [2 /*return*/, revealOperation];
666
- case TezosOperationType_1.TezosOperationType.DELEGATION:
667
- delegationOperation = operationRequest;
668
- // The delegate property is optional, so we don't have any mandatory properties to check for
669
- delegationOperation.source = (_f = delegationOperation.source) !== null && _f !== void 0 ? _f : address;
670
- delegationOperation.counter = (_g = delegationOperation.counter) !== null && _g !== void 0 ? _g : defaultCounter;
671
- delegationOperation.fee = (_h = delegationOperation.fee) !== null && _h !== void 0 ? _h : defaultFee;
672
- delegationOperation.gas_limit = (_j = delegationOperation.gas_limit) !== null && _j !== void 0 ? _j : defaultGasLimit;
673
- delegationOperation.storage_limit = (_k = delegationOperation.storage_limit) !== null && _k !== void 0 ? _k : defaultStorageLimit;
674
- return [2 /*return*/, delegationOperation];
675
- case TezosOperationType_1.TezosOperationType.TRANSACTION:
676
- transactionOperation = operationRequest;
677
- if (!transactionOperation.amount) {
678
- throw new errors_1.PropertyUndefinedError(coinlib_core_1.Domain.TEZOS, 'property "amount" was not defined');
679
- }
680
- if (!transactionOperation.destination) {
681
- throw new errors_1.PropertyUndefinedError(coinlib_core_1.Domain.TEZOS, 'property "destination" was not defined');
682
- }
683
- transactionOperation.source = (_l = transactionOperation.source) !== null && _l !== void 0 ? _l : address;
684
- transactionOperation.counter = (_m = transactionOperation.counter) !== null && _m !== void 0 ? _m : defaultCounter;
685
- transactionOperation.fee = (_o = transactionOperation.fee) !== null && _o !== void 0 ? _o : defaultFee;
686
- transactionOperation.gas_limit = (_p = transactionOperation.gas_limit) !== null && _p !== void 0 ? _p : GAS_LIMIT_PLACEHOLDER;
687
- transactionOperation.storage_limit = (_q = transactionOperation.storage_limit) !== null && _q !== void 0 ? _q : STORAGE_LIMIT_PLACEHOLDER;
688
- return [2 /*return*/, transactionOperation];
689
- case TezosOperationType_1.TezosOperationType.ORIGINATION:
690
- originationOperation = operationRequest;
691
- if (!originationOperation.balance) {
692
- throw new errors_1.PropertyUndefinedError(coinlib_core_1.Domain.TEZOS, 'property "balance" was not defined');
693
- }
694
- if (!originationOperation.script) {
695
- throw new errors_1.PropertyUndefinedError(coinlib_core_1.Domain.TEZOS, 'property "script" was not defined');
696
- }
697
- originationOperation.source = (_r = originationOperation.source) !== null && _r !== void 0 ? _r : address;
698
- originationOperation.counter = (_s = originationOperation.counter) !== null && _s !== void 0 ? _s : defaultCounter;
699
- originationOperation.fee = (_t = originationOperation.fee) !== null && _t !== void 0 ? _t : defaultFee;
700
- originationOperation.gas_limit = (_u = originationOperation.gas_limit) !== null && _u !== void 0 ? _u : GAS_LIMIT_PLACEHOLDER;
701
- originationOperation.storage_limit = (_v = originationOperation.storage_limit) !== null && _v !== void 0 ? _v : STORAGE_LIMIT_PLACEHOLDER;
702
- return [2 /*return*/, originationOperation];
703
- case TezosOperationType_1.TezosOperationType.ENDORSEMENT:
704
- case TezosOperationType_1.TezosOperationType.SEED_NONCE_REVELATION:
705
- case TezosOperationType_1.TezosOperationType.DOUBLE_ENDORSEMENT_EVIDENCE:
706
- case TezosOperationType_1.TezosOperationType.DOUBLE_BAKING_EVIDENCE:
707
- case TezosOperationType_1.TezosOperationType.ACTIVATE_ACCOUNT:
708
- case TezosOperationType_1.TezosOperationType.PROPOSALS:
709
- case TezosOperationType_1.TezosOperationType.BALLOT:
710
- // Do not change anything
711
- return [2 /*return*/, operationRequest];
712
- default:
713
- (0, coinlib_core_1.assertNever)(operationRequest.kind);
714
- throw new errors_1.UnsupportedError(coinlib_core_1.Domain.TEZOS, "unsupported operation type \"".concat(JSON.stringify(operationRequest.kind), "\""));
715
- }
716
- return [2 /*return*/];
717
- }
718
- });
719
- }); });
720
- _b = (_a = operations.push).apply;
721
- _c = [operations];
722
- return [4 /*yield*/, Promise.all(operationPromises)];
723
- case 3:
724
- _b.apply(_a, _c.concat([(_d.sent())]));
725
- wrappedOperation = {
726
- branch: branch,
727
- contents: operations
728
- };
729
- return [2 /*return*/, this.estimateAndReplaceLimitsAndFee(wrappedOperation, overrideParameters)];
730
- }
731
- });
732
- });
733
- };
734
- TezosProtocolImpl.prototype.estimateAndReplaceLimitsAndFee = function (wrappedOperation, overrideParameters, startingCounter) {
735
- if (overrideParameters === void 0) { overrideParameters = true; }
736
- return __awaiter(this, void 0, void 0, function () {
737
- var fakeSignature, opKinds, contents, block, body, forgedOperation, gasLimitTotal, response, fee, nonRevealOperations, feePerOperation_1;
738
- return __generator(this, function (_a) {
739
- switch (_a.label) {
740
- case 0:
741
- fakeSignature = 'sigUHx32f9wesZ1n2BWpixXz4AQaZggEtchaQNHYGRCoWNAXx45WGW2ua3apUUUAGMLPwAU41QoaFCzVSL61VaessLg4YbbP';
742
- opKinds = [
743
- TezosOperationType_1.TezosOperationType.TRANSACTION,
744
- TezosOperationType_1.TezosOperationType.REVEAL,
745
- TezosOperationType_1.TezosOperationType.ORIGINATION,
746
- TezosOperationType_1.TezosOperationType.DELEGATION
747
- ];
748
- contents = wrappedOperation.contents.map(function (operation, i) {
749
- if (!opKinds.includes(operation.kind)) {
750
- return operation;
751
- }
752
- var op = operation;
753
- var gasValue = new bignumber_1.default(MAX_GAS_PER_BLOCK).dividedToIntegerBy(wrappedOperation.contents.length);
754
- var gas_limit = new bignumber_1.default(GAS_LIMIT_PLACEHOLDER).gt(gasValue) ? gasValue : GAS_LIMIT_PLACEHOLDER;
755
- var counter = startingCounter ? startingCounter.plus(i).toString() : op.counter;
756
- return __assign(__assign({}, operation), { gas_limit: gas_limit, counter: counter });
757
- });
758
- return [4 /*yield*/, index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head"))];
759
- case 1:
760
- block = (_a.sent()).data;
761
- body = {
762
- chain_id: block.chain_id,
763
- operation: {
764
- branch: wrappedOperation.branch,
765
- contents: contents,
766
- signature: fakeSignature // signature will not be checked, so it is ok to always use this one
767
- }
768
- };
769
- return [4 /*yield*/, this.forgeOperation(wrappedOperation)];
770
- case 2:
771
- forgedOperation = _a.sent();
772
- gasLimitTotal = 0;
773
- return [4 /*yield*/, index_1.default
774
- .post("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head/helpers/scripts/run_operation"), body, {
775
- headers: { 'Content-Type': 'application/json' }
776
- })
777
- .catch(function (runOperationError) {
778
- throw new errors_1.NetworkError(coinlib_core_1.Domain.TEZOS, runOperationError);
779
- })];
780
- case 3:
781
- response = _a.sent();
782
- if (wrappedOperation.contents.length !== response.data.contents.length) {
783
- throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, "Run Operation did not return same number of operations. Locally we have ".concat(wrappedOperation.contents.length, ", but got back ").concat(response.data.contents.length));
784
- }
785
- wrappedOperation.contents.forEach(function (content, i) {
786
- var metadata = response.data.contents[i].metadata;
787
- if (metadata.operation_result) {
788
- var result = metadata.operation_result;
789
- var gasLimit_1 = 0;
790
- var storageLimit_1 = 0;
791
- // If there are internal operations, we first add gas and storage used of internal operations
792
- if (metadata.internal_operation_results) {
793
- metadata.internal_operation_results.forEach(function (internalOperation) {
794
- if (internalOperation === null || internalOperation === void 0 ? void 0 : internalOperation.result) {
795
- if (internalOperation.result.errors) {
796
- throw new errors_1.TransactionError(coinlib_core_1.Domain.TEZOS, 'An internal operation produced an error', internalOperation.result.errors);
797
- }
798
- gasLimit_1 += Math.ceil(Number(internalOperation.result.consumed_milligas) / 1000);
799
- if (internalOperation.result.paid_storage_size_diff) {
800
- storageLimit_1 += Number(internalOperation.result.paid_storage_size_diff);
801
- }
802
- if (internalOperation.result.originated_contracts) {
803
- storageLimit_1 += internalOperation.result.originated_contracts.length * 257;
804
- }
805
- if (internalOperation.result.allocated_destination_contract) {
806
- storageLimit_1 += 257;
807
- }
808
- }
809
- });
810
- }
811
- if (result.errors) {
812
- throw new errors_1.TransactionError(coinlib_core_1.Domain.TEZOS, 'The operation produced an error', result.errors);
813
- }
814
- // Add gas and storage used by operation
815
- gasLimit_1 += Math.ceil(Number(result.consumed_milligas) / 1000);
816
- if (result.paid_storage_size_diff) {
817
- storageLimit_1 += Number(result.paid_storage_size_diff);
818
- }
819
- if (result.originated_contracts) {
820
- storageLimit_1 += result.originated_contracts.length * 257;
821
- }
822
- if (result.allocated_destination_contract) {
823
- storageLimit_1 += 257;
824
- }
825
- // in prepareTransactionsFromPublicKey() we invoke this method with overrideParameters = false
826
- if ((content.gas_limit && overrideParameters) || content.gas_limit === GAS_LIMIT_PLACEHOLDER) {
827
- ;
828
- content.gas_limit = gasLimit_1.toString();
829
- }
830
- if ((content.storage_limit && overrideParameters) || content.storage_limit === STORAGE_LIMIT_PLACEHOLDER) {
831
- ;
832
- content.storage_limit = storageLimit_1.toString();
833
- }
834
- gasLimitTotal += gasLimit_1;
835
- }
836
- });
837
- if (overrideParameters || wrappedOperation.contents.some(function (operation) { return (operation === null || operation === void 0 ? void 0 : operation.fee) === FEE_PLACEHOLDER; })) {
838
- fee = MINIMAL_FEE +
839
- MINIMAL_FEE_PER_BYTE * Math.ceil((forgedOperation.length + 128) / 2) + // 128 is the length of a hex signature
840
- MINIMAL_FEE_PER_GAS_UNIT * gasLimitTotal +
841
- 100 // add 100 for safety
842
- ;
843
- nonRevealOperations = wrappedOperation.contents.filter(function (operation) { return operation.kind !== 'reveal'; });
844
- feePerOperation_1 = Math.ceil(fee / nonRevealOperations.length);
845
- wrappedOperation.contents.forEach(function (content) {
846
- if (content.fee && content.kind !== 'reveal') {
847
- ;
848
- content.fee = feePerOperation_1.toString();
849
- }
850
- });
851
- }
852
- return [2 /*return*/, wrappedOperation];
853
- }
854
- });
855
- });
856
- };
857
- TezosProtocolImpl.prototype.createTransactionOperations = function (previousOperations, details, fee, address, counter, balance) {
858
- return __awaiter(this, void 0, void 0, function () {
859
- var amountUsedByPreviousOperations, operations, firstValue, i, recipient, value, _a, total, transferable, receivingBalance, spendOperation;
860
- return __generator(this, function (_b) {
861
- switch (_b.label) {
862
- case 0:
863
- amountUsedByPreviousOperations = (0, operations_1.getAmountUsedByPreviousOperations)(previousOperations);
864
- operations = [];
865
- if (!amountUsedByPreviousOperations.isZero()) {
866
- firstValue = new bignumber_1.default((0, module_kit_1.newAmount)(details[0].amount).blockchain(this.units).value);
867
- if (balance.isLessThan(firstValue.plus(fee).plus(amountUsedByPreviousOperations))) {
868
- // if not, make room for the init fee
869
- details[0] = __assign(__assign({}, details[0]), { amount: (0, module_kit_1.newAmount)(firstValue.minus(amountUsedByPreviousOperations), 'blockchain') // deduct fee from balance
870
- });
871
- }
872
- }
873
- i = 0;
874
- _b.label = 1;
875
- case 1:
876
- if (!(i < details.length)) return [3 /*break*/, 4];
877
- recipient = details[i].to;
878
- value = new bignumber_1.default((0, module_kit_1.newAmount)(details[i].amount).blockchain(this.units).value);
879
- return [4 /*yield*/, this.getBalanceOfAddress(recipient)];
880
- case 2:
881
- _a = _b.sent(), total = _a.total, transferable = _a.transferable;
882
- receivingBalance = new bignumber_1.default((0, module_kit_1.newAmount)(transferable !== null && transferable !== void 0 ? transferable : total).blockchain(this.units).value);
883
- // if our receiver has 0 balance, the account is not activated yet.
884
- if (receivingBalance.isZero() && recipient.toLowerCase().startsWith('tz')) {
885
- // We have to supply an additional 0.257 XTZ fee for storage_limit costs, which gets automatically deducted from the sender so we just have to make sure enough balance is around
886
- if (balance.isLessThan(fee.plus(operations_1.ACTIVATION_BURN))) {
887
- // If we don't have enough funds to pay the activation + fee, we throw an error
888
- throw new errors_1.BalanceError(coinlib_core_1.Domain.TEZOS, 'Insufficient balance to pay activation burn!');
889
- }
890
- else if (balance.isLessThan(value.plus(fee).plus(operations_1.ACTIVATION_BURN))) {
891
- // Check whether the sender has enough to cover the amount to send + fee + activation
892
- // If not, we deduct it from amount sent to make room for the activation burn
893
- value = value.minus(operations_1.ACTIVATION_BURN); // deduct fee from balance
894
- }
895
- }
896
- if (balance.isEqualTo(value.plus(fee))) {
897
- // Tezos accounts can never be empty. If user tries to send everything, we must leave 1 mutez behind.
898
- value = value.minus(1);
899
- }
900
- else if (balance.isLessThan(value.plus(fee))) {
901
- throw new errors_1.BalanceError(coinlib_core_1.Domain.TEZOS, 'not enough balance');
902
- }
903
- spendOperation = {
904
- kind: TezosOperationType_1.TezosOperationType.TRANSACTION,
905
- fee: fee.toFixed(),
906
- gas_limit: GAS_LIMIT_PLACEHOLDER,
907
- storage_limit: STORAGE_LIMIT_PLACEHOLDER,
908
- amount: value.toFixed(),
909
- counter: counter.plus(i).toFixed(),
910
- destination: recipient,
911
- source: address
912
- };
913
- operations.push(spendOperation);
914
- _b.label = 3;
915
- case 3:
916
- i++;
917
- return [3 /*break*/, 1];
918
- case 4: return [2 /*return*/, operations];
919
- }
920
- });
921
- });
922
- };
923
- return TezosProtocolImpl;
924
- }());
925
- exports.TezosProtocolImpl = TezosProtocolImpl;
926
- // Factory
927
- function createTezosProtocol(options) {
928
- if (options === void 0) { options = {}; }
929
- return new TezosProtocolImpl(options);
930
- }
931
- exports.createTezosProtocol = createTezosProtocol;
932
- exports.TEZOS_MAINNET_PROTOCOL_NETWORK = {
933
- name: 'Mainnet',
934
- type: 'mainnet',
935
- rpcUrl: 'https://tezos-node.prod.gke.papers.tech',
936
- network: network_1.TezosNetwork.MAINNET,
937
- blockExplorer: {
938
- type: 'tzkt',
939
- url: 'https://tzkt.io'
940
- },
941
- indexer: {
942
- type: 'tzkt',
943
- apiUrl: 'https://tezos-mainnet-indexer.prod.gke.papers.tech'
944
- }
945
- };
946
- exports.TEZOS_GHOSTNET_PROTOCOL_NETWORK = {
947
- name: 'Ghostnet',
948
- type: 'testnet',
949
- rpcUrl: 'https://tezos-ghostnet-node.prod.gke.papers.tech',
950
- network: network_1.TezosNetwork.GHOSTNET,
951
- blockExplorer: {
952
- type: 'tzkt',
953
- url: 'https://ghostnet.tzkt.io'
954
- },
955
- indexer: {
956
- type: 'tzkt',
957
- apiUrl: 'https://tezos-ghostnet-indexer.prod.gke.papers.tech'
958
- }
959
- };
960
- var DEFAULT_TEZOS_PROTOCOL_NETWORK = exports.TEZOS_MAINNET_PROTOCOL_NETWORK;
961
- function createTezosProtocolOptions(network) {
962
- if (network === void 0) { network = {}; }
963
- return {
964
- network: __assign(__assign(__assign({}, DEFAULT_TEZOS_PROTOCOL_NETWORK), network), { blockExplorer: __assign(__assign({}, DEFAULT_TEZOS_PROTOCOL_NETWORK.blockExplorer), network.blockExplorer), indexer: __assign(__assign({}, DEFAULT_TEZOS_PROTOCOL_NETWORK.indexer), network.indexer) })
965
- };
966
- }
967
- exports.createTezosProtocolOptions = createTezosProtocolOptions;
968
- //# sourceMappingURL=TezosProtocol.js.map