@airgap/tezos 0.13.7-beta.11

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 (370) hide show
  1. package/LICENSE.md +7 -0
  2. package/actions/GetKtAccountsAction.d.ts +8 -0
  3. package/actions/GetKtAccountsAction.js +85 -0
  4. package/actions/GetKtAccountsAction.js.map +1 -0
  5. package/airgap-coinlib-tezos.min.js +103587 -0
  6. package/constants.d.ts +18 -0
  7. package/constants.js +28 -0
  8. package/constants.js.map +1 -0
  9. package/index.d.ts +46 -0
  10. package/index.js +103 -0
  11. package/index.js.map +1 -0
  12. package/package.json +70 -0
  13. package/protocol/TezosAddress.d.ts +11 -0
  14. package/protocol/TezosAddress.js +102 -0
  15. package/protocol/TezosAddress.js.map +1 -0
  16. package/protocol/TezosCryptoClient.d.ts +15 -0
  17. package/protocol/TezosCryptoClient.js +152 -0
  18. package/protocol/TezosCryptoClient.js.map +1 -0
  19. package/protocol/TezosProtocol.d.ts +349 -0
  20. package/protocol/TezosProtocol.js +1853 -0
  21. package/protocol/TezosProtocol.js.map +1 -0
  22. package/protocol/TezosProtocolOptions.d.ts +29 -0
  23. package/protocol/TezosProtocolOptions.js +114 -0
  24. package/protocol/TezosProtocolOptions.js.map +1 -0
  25. package/protocol/TezosUtils.d.ts +40 -0
  26. package/protocol/TezosUtils.js +296 -0
  27. package/protocol/TezosUtils.js.map +1 -0
  28. package/protocol/contract/TezosContract.d.ts +52 -0
  29. package/protocol/contract/TezosContract.js +509 -0
  30. package/protocol/contract/TezosContract.js.map +1 -0
  31. package/protocol/contract/TezosContractCall.d.ts +10 -0
  32. package/protocol/contract/TezosContractCall.js +23 -0
  33. package/protocol/contract/TezosContractCall.js.map +1 -0
  34. package/protocol/contract/TezosContractEntrypoint.d.ts +8 -0
  35. package/protocol/contract/TezosContractEntrypoint.js +27 -0
  36. package/protocol/contract/TezosContractEntrypoint.js.map +1 -0
  37. package/protocol/contract/TezosContractStorage.d.ts +7 -0
  38. package/protocol/contract/TezosContractStorage.js +16 -0
  39. package/protocol/contract/TezosContractStorage.js.map +1 -0
  40. package/protocol/contract/remote-data/TezosContractRemoteDataFactory.d.ts +11 -0
  41. package/protocol/contract/remote-data/TezosContractRemoteDataFactory.js +34 -0
  42. package/protocol/contract/remote-data/TezosContractRemoteDataFactory.js.map +1 -0
  43. package/protocol/contract/remote-data/TezosStorageRemoteData.d.ts +12 -0
  44. package/protocol/contract/remote-data/TezosStorageRemoteData.js +151 -0
  45. package/protocol/contract/remote-data/TezosStorageRemoteData.js.map +1 -0
  46. package/protocol/domains/TezosDomains.d.ts +20 -0
  47. package/protocol/domains/TezosDomains.js +306 -0
  48. package/protocol/domains/TezosDomains.js.map +1 -0
  49. package/protocol/fa/TezosBTC.d.ts +12 -0
  50. package/protocol/fa/TezosBTC.js +107 -0
  51. package/protocol/fa/TezosBTC.js.map +1 -0
  52. package/protocol/fa/TezosBTCtez.d.ts +10 -0
  53. package/protocol/fa/TezosBTCtez.js +54 -0
  54. package/protocol/fa/TezosBTCtez.js.map +1 -0
  55. package/protocol/fa/TezosCTez.d.ts +10 -0
  56. package/protocol/fa/TezosCTez.js +51 -0
  57. package/protocol/fa/TezosCTez.js.map +1 -0
  58. package/protocol/fa/TezosDOGA.d.ts +10 -0
  59. package/protocol/fa/TezosDOGA.js +51 -0
  60. package/protocol/fa/TezosDOGA.js.map +1 -0
  61. package/protocol/fa/TezosETHtz.d.ts +9 -0
  62. package/protocol/fa/TezosETHtz.js +72 -0
  63. package/protocol/fa/TezosETHtz.js.map +1 -0
  64. package/protocol/fa/TezosFA1Protocol.d.ts +27 -0
  65. package/protocol/fa/TezosFA1Protocol.js +310 -0
  66. package/protocol/fa/TezosFA1Protocol.js.map +1 -0
  67. package/protocol/fa/TezosFA1p2Protocol.d.ts +8 -0
  68. package/protocol/fa/TezosFA1p2Protocol.js +117 -0
  69. package/protocol/fa/TezosFA1p2Protocol.js.map +1 -0
  70. package/protocol/fa/TezosFA2Protocol.d.ts +58 -0
  71. package/protocol/fa/TezosFA2Protocol.js +449 -0
  72. package/protocol/fa/TezosFA2Protocol.js.map +1 -0
  73. package/protocol/fa/TezosFAProtocol.d.ts +65 -0
  74. package/protocol/fa/TezosFAProtocol.js +510 -0
  75. package/protocol/fa/TezosFAProtocol.js.map +1 -0
  76. package/protocol/fa/TezosFAProtocolOptions.d.ts +54 -0
  77. package/protocol/fa/TezosFAProtocolOptions.js +228 -0
  78. package/protocol/fa/TezosFAProtocolOptions.js.map +1 -0
  79. package/protocol/fa/TezosKolibriUSD.d.ts +10 -0
  80. package/protocol/fa/TezosKolibriUSD.js +74 -0
  81. package/protocol/fa/TezosKolibriUSD.js.map +1 -0
  82. package/protocol/fa/TezosPlanty.d.ts +10 -0
  83. package/protocol/fa/TezosPlanty.js +51 -0
  84. package/protocol/fa/TezosPlanty.js.map +1 -0
  85. package/protocol/fa/TezosQUIPU.d.ts +10 -0
  86. package/protocol/fa/TezosQUIPU.js +54 -0
  87. package/protocol/fa/TezosQUIPU.js.map +1 -0
  88. package/protocol/fa/TezosSIRS.d.ts +10 -0
  89. package/protocol/fa/TezosSIRS.js +51 -0
  90. package/protocol/fa/TezosSIRS.js.map +1 -0
  91. package/protocol/fa/TezosStaker.d.ts +10 -0
  92. package/protocol/fa/TezosStaker.js +74 -0
  93. package/protocol/fa/TezosStaker.js.map +1 -0
  94. package/protocol/fa/TezosUBTC.d.ts +10 -0
  95. package/protocol/fa/TezosUBTC.js +54 -0
  96. package/protocol/fa/TezosUBTC.js.map +1 -0
  97. package/protocol/fa/TezosUDEFI.d.ts +10 -0
  98. package/protocol/fa/TezosUDEFI.js +54 -0
  99. package/protocol/fa/TezosUDEFI.js.map +1 -0
  100. package/protocol/fa/TezosUSD.d.ts +10 -0
  101. package/protocol/fa/TezosUSD.js +74 -0
  102. package/protocol/fa/TezosUSD.js.map +1 -0
  103. package/protocol/fa/TezosUSDT.d.ts +10 -0
  104. package/protocol/fa/TezosUSDT.js +54 -0
  105. package/protocol/fa/TezosUSDT.js.map +1 -0
  106. package/protocol/fa/TezosUUSD.d.ts +6 -0
  107. package/protocol/fa/TezosUUSD.js +31 -0
  108. package/protocol/fa/TezosUUSD.js.map +1 -0
  109. package/protocol/fa/TezosWRAP.d.ts +10 -0
  110. package/protocol/fa/TezosWRAP.js +54 -0
  111. package/protocol/fa/TezosWRAP.js.map +1 -0
  112. package/protocol/fa/TezosWrapped.d.ts +10 -0
  113. package/protocol/fa/TezosWrapped.js +74 -0
  114. package/protocol/fa/TezosWrapped.js.map +1 -0
  115. package/protocol/fa/TezosYOU.d.ts +6 -0
  116. package/protocol/fa/TezosYOU.js +31 -0
  117. package/protocol/fa/TezosYOU.js.map +1 -0
  118. package/protocol/indexerClient/TezosIndexerClient.d.ts +25 -0
  119. package/protocol/indexerClient/TezosIndexerClient.js +251 -0
  120. package/protocol/indexerClient/TezosIndexerClient.js.map +1 -0
  121. package/protocol/indexerClient/TezosProtocolIndexerClient.d.ts +26 -0
  122. package/protocol/indexerClient/TezosProtocolIndexerClient.js +3 -0
  123. package/protocol/indexerClient/TezosProtocolIndexerClient.js.map +1 -0
  124. package/protocol/kt/TezosKtAddress.d.ts +5 -0
  125. package/protocol/kt/TezosKtAddress.js +72 -0
  126. package/protocol/kt/TezosKtAddress.js.map +1 -0
  127. package/protocol/kt/TezosKtProtocol.d.ts +30 -0
  128. package/protocol/kt/TezosKtProtocol.js +317 -0
  129. package/protocol/kt/TezosKtProtocol.js.map +1 -0
  130. package/protocol/sapling/TezosSaplingAddress.d.ts +12 -0
  131. package/protocol/sapling/TezosSaplingAddress.js +134 -0
  132. package/protocol/sapling/TezosSaplingAddress.js.map +1 -0
  133. package/protocol/sapling/TezosSaplingCryptoClient.d.ts +34 -0
  134. package/protocol/sapling/TezosSaplingCryptoClient.js +241 -0
  135. package/protocol/sapling/TezosSaplingCryptoClient.js.map +1 -0
  136. package/protocol/sapling/TezosSaplingProtocol.d.ts +130 -0
  137. package/protocol/sapling/TezosSaplingProtocol.js +1101 -0
  138. package/protocol/sapling/TezosSaplingProtocol.js.map +1 -0
  139. package/protocol/sapling/TezosSaplingProtocolOptions.d.ts +43 -0
  140. package/protocol/sapling/TezosSaplingProtocolOptions.js +78 -0
  141. package/protocol/sapling/TezosSaplingProtocolOptions.js.map +1 -0
  142. package/protocol/sapling/TezosShieldedTezProtocol.d.ts +9 -0
  143. package/protocol/sapling/TezosShieldedTezProtocol.js +109 -0
  144. package/protocol/sapling/TezosShieldedTezProtocol.js.map +1 -0
  145. package/protocol/sapling/node/TezosSaplingNodeClient.d.ts +8 -0
  146. package/protocol/sapling/node/TezosSaplingNodeClient.js +78 -0
  147. package/protocol/sapling/node/TezosSaplingNodeClient.js.map +1 -0
  148. package/protocol/sapling/utils/TezosSaplingBookkeeper.d.ts +34 -0
  149. package/protocol/sapling/utils/TezosSaplingBookkeeper.js +586 -0
  150. package/protocol/sapling/utils/TezosSaplingBookkeeper.js.map +1 -0
  151. package/protocol/sapling/utils/TezosSaplingEncoder.d.ts +22 -0
  152. package/protocol/sapling/utils/TezosSaplingEncoder.js +158 -0
  153. package/protocol/sapling/utils/TezosSaplingEncoder.js.map +1 -0
  154. package/protocol/sapling/utils/TezosSaplingForger.d.ts +26 -0
  155. package/protocol/sapling/utils/TezosSaplingForger.js +278 -0
  156. package/protocol/sapling/utils/TezosSaplingForger.js.map +1 -0
  157. package/protocol/sapling/utils/TezosSaplingState.d.ts +17 -0
  158. package/protocol/sapling/utils/TezosSaplingState.js +260 -0
  159. package/protocol/sapling/utils/TezosSaplingState.js.map +1 -0
  160. package/protocol/types/TezosAddressCursor.d.ts +3 -0
  161. package/protocol/types/TezosAddressCursor.js +3 -0
  162. package/protocol/types/TezosAddressCursor.js.map +1 -0
  163. package/protocol/types/TezosAddressResult.d.ts +4 -0
  164. package/protocol/types/TezosAddressResult.js +3 -0
  165. package/protocol/types/TezosAddressResult.js.map +1 -0
  166. package/protocol/types/TezosBlockHeader.d.ts +13 -0
  167. package/protocol/types/TezosBlockHeader.js +3 -0
  168. package/protocol/types/TezosBlockHeader.js.map +1 -0
  169. package/protocol/types/TezosBlockMetadata.d.ts +7 -0
  170. package/protocol/types/TezosBlockMetadata.js +3 -0
  171. package/protocol/types/TezosBlockMetadata.js.map +1 -0
  172. package/protocol/types/TezosContractCode.d.ts +5 -0
  173. package/protocol/types/TezosContractCode.js +3 -0
  174. package/protocol/types/TezosContractCode.js.map +1 -0
  175. package/protocol/types/TezosOperationType.d.ts +13 -0
  176. package/protocol/types/TezosOperationType.js +18 -0
  177. package/protocol/types/TezosOperationType.js.map +1 -0
  178. package/protocol/types/TezosTransactionCursor.d.ts +3 -0
  179. package/protocol/types/TezosTransactionCursor.js +3 -0
  180. package/protocol/types/TezosTransactionCursor.js.map +1 -0
  181. package/protocol/types/TezosTransactionResult.d.ts +6 -0
  182. package/protocol/types/TezosTransactionResult.js +3 -0
  183. package/protocol/types/TezosTransactionResult.js.map +1 -0
  184. package/protocol/types/TezosWrappedOperation.d.ts +5 -0
  185. package/protocol/types/TezosWrappedOperation.js +3 -0
  186. package/protocol/types/TezosWrappedOperation.js.map +1 -0
  187. package/protocol/types/contract/BigMap.d.ts +7 -0
  188. package/protocol/types/contract/BigMap.js +3 -0
  189. package/protocol/types/contract/BigMap.js.map +1 -0
  190. package/protocol/types/contract/BigMapEnrtyFilter.d.ts +5 -0
  191. package/protocol/types/contract/BigMapEnrtyFilter.js +3 -0
  192. package/protocol/types/contract/BigMapEnrtyFilter.js.map +1 -0
  193. package/protocol/types/contract/BigMapEntry.d.ts +7 -0
  194. package/protocol/types/contract/BigMapEntry.js +3 -0
  195. package/protocol/types/contract/BigMapEntry.js.map +1 -0
  196. package/protocol/types/contract/BigMapRequest.d.ts +8 -0
  197. package/protocol/types/contract/BigMapRequest.js +3 -0
  198. package/protocol/types/contract/BigMapRequest.js.map +1 -0
  199. package/protocol/types/contract/TezosContractMetadata.d.ts +61 -0
  200. package/protocol/types/contract/TezosContractMetadata.js +3 -0
  201. package/protocol/types/contract/TezosContractMetadata.js.map +1 -0
  202. package/protocol/types/domains/TezosDomainsRecord.d.ts +8 -0
  203. package/protocol/types/domains/TezosDomainsRecord.js +3 -0
  204. package/protocol/types/domains/TezosDomainsRecord.js.map +1 -0
  205. package/protocol/types/domains/TezosDomainsReverseRecord.d.ts +5 -0
  206. package/protocol/types/domains/TezosDomainsReverseRecord.js +3 -0
  207. package/protocol/types/domains/TezosDomainsReverseRecord.js.map +1 -0
  208. package/protocol/types/fa/TezosFA2BalanceOfRequest.d.ts +4 -0
  209. package/protocol/types/fa/TezosFA2BalanceOfRequest.js +3 -0
  210. package/protocol/types/fa/TezosFA2BalanceOfRequest.js.map +1 -0
  211. package/protocol/types/fa/TezosFA2BalanceOfResponse.d.ts +5 -0
  212. package/protocol/types/fa/TezosFA2BalanceOfResponse.js +3 -0
  213. package/protocol/types/fa/TezosFA2BalanceOfResponse.js.map +1 -0
  214. package/protocol/types/fa/TezosFA2TransferRequest.d.ts +8 -0
  215. package/protocol/types/fa/TezosFA2TransferRequest.js +3 -0
  216. package/protocol/types/fa/TezosFA2TransferRequest.js.map +1 -0
  217. package/protocol/types/fa/TezosFA2UpdateOperatorRequest.d.ts +6 -0
  218. package/protocol/types/fa/TezosFA2UpdateOperatorRequest.js +3 -0
  219. package/protocol/types/fa/TezosFA2UpdateOperatorRequest.js.map +1 -0
  220. package/protocol/types/fa/TezosFATokenMetadata.d.ts +6 -0
  221. package/protocol/types/fa/TezosFATokenMetadata.js +3 -0
  222. package/protocol/types/fa/TezosFATokenMetadata.js.map +1 -0
  223. package/protocol/types/kt/TezosKtAddressCursor.d.ts +4 -0
  224. package/protocol/types/kt/TezosKtAddressCursor.js +3 -0
  225. package/protocol/types/kt/TezosKtAddressCursor.js.map +1 -0
  226. package/protocol/types/kt/TezosKtAddressResult.d.ts +5 -0
  227. package/protocol/types/kt/TezosKtAddressResult.js +3 -0
  228. package/protocol/types/kt/TezosKtAddressResult.js.map +1 -0
  229. package/protocol/types/micheline/MichelineNode.d.ts +15 -0
  230. package/protocol/types/micheline/MichelineNode.js +5 -0
  231. package/protocol/types/micheline/MichelineNode.js.map +1 -0
  232. package/protocol/types/micheline/MichelineNodeUtils.d.ts +6 -0
  233. package/protocol/types/micheline/MichelineNodeUtils.js +40 -0
  234. package/protocol/types/micheline/MichelineNodeUtils.js.map +1 -0
  235. package/protocol/types/michelson/MichelsonType.d.ts +11 -0
  236. package/protocol/types/michelson/MichelsonType.js +22 -0
  237. package/protocol/types/michelson/MichelsonType.js.map +1 -0
  238. package/protocol/types/michelson/MichelsonTypeMeta.d.ts +33 -0
  239. package/protocol/types/michelson/MichelsonTypeMeta.js +132 -0
  240. package/protocol/types/michelson/MichelsonTypeMeta.js.map +1 -0
  241. package/protocol/types/michelson/MichelsonTypeUtils.d.ts +19 -0
  242. package/protocol/types/michelson/MichelsonTypeUtils.js +249 -0
  243. package/protocol/types/michelson/MichelsonTypeUtils.js.map +1 -0
  244. package/protocol/types/michelson/generics/MichelsonList.d.ts +11 -0
  245. package/protocol/types/michelson/generics/MichelsonList.js +68 -0
  246. package/protocol/types/michelson/generics/MichelsonList.js.map +1 -0
  247. package/protocol/types/michelson/generics/MichelsonMap.d.ts +14 -0
  248. package/protocol/types/michelson/generics/MichelsonMap.js +118 -0
  249. package/protocol/types/michelson/generics/MichelsonMap.js.map +1 -0
  250. package/protocol/types/michelson/generics/MichelsonOption.d.ts +25 -0
  251. package/protocol/types/michelson/generics/MichelsonOption.js +119 -0
  252. package/protocol/types/michelson/generics/MichelsonOption.js.map +1 -0
  253. package/protocol/types/michelson/generics/MichelsonOr.d.ts +25 -0
  254. package/protocol/types/michelson/generics/MichelsonOr.js +132 -0
  255. package/protocol/types/michelson/generics/MichelsonOr.js.map +1 -0
  256. package/protocol/types/michelson/generics/MichelsonPair.d.ts +17 -0
  257. package/protocol/types/michelson/generics/MichelsonPair.js +135 -0
  258. package/protocol/types/michelson/generics/MichelsonPair.js.map +1 -0
  259. package/protocol/types/michelson/grammar/MichelsonGrammarData.d.ts +2 -0
  260. package/protocol/types/michelson/grammar/MichelsonGrammarData.js +4 -0
  261. package/protocol/types/michelson/grammar/MichelsonGrammarData.js.map +1 -0
  262. package/protocol/types/michelson/grammar/MichelsonGrammarInstruction.d.ts +1 -0
  263. package/protocol/types/michelson/grammar/MichelsonGrammarInstruction.js +4 -0
  264. package/protocol/types/michelson/grammar/MichelsonGrammarInstruction.js.map +1 -0
  265. package/protocol/types/michelson/grammar/MichelsonGrammarType.d.ts +1 -0
  266. package/protocol/types/michelson/grammar/MichelsonGrammarType.js +4 -0
  267. package/protocol/types/michelson/grammar/MichelsonGrammarType.js.map +1 -0
  268. package/protocol/types/michelson/primitives/MichelsonAddress.d.ts +15 -0
  269. package/protocol/types/michelson/primitives/MichelsonAddress.js +72 -0
  270. package/protocol/types/michelson/primitives/MichelsonAddress.js.map +1 -0
  271. package/protocol/types/michelson/primitives/MichelsonBool.d.ts +12 -0
  272. package/protocol/types/michelson/primitives/MichelsonBool.js +57 -0
  273. package/protocol/types/michelson/primitives/MichelsonBool.js.map +1 -0
  274. package/protocol/types/michelson/primitives/MichelsonBytes.d.ts +14 -0
  275. package/protocol/types/michelson/primitives/MichelsonBytes.js +75 -0
  276. package/protocol/types/michelson/primitives/MichelsonBytes.js.map +1 -0
  277. package/protocol/types/michelson/primitives/MichelsonInt.d.ts +14 -0
  278. package/protocol/types/michelson/primitives/MichelsonInt.js +72 -0
  279. package/protocol/types/michelson/primitives/MichelsonInt.js.map +1 -0
  280. package/protocol/types/michelson/primitives/MichelsonString.d.ts +14 -0
  281. package/protocol/types/michelson/primitives/MichelsonString.js +74 -0
  282. package/protocol/types/michelson/primitives/MichelsonString.js.map +1 -0
  283. package/protocol/types/michelson/primitives/MichelsonUnit.d.ts +9 -0
  284. package/protocol/types/michelson/primitives/MichelsonUnit.js +53 -0
  285. package/protocol/types/michelson/primitives/MichelsonUnit.js.map +1 -0
  286. package/protocol/types/operations/ActivateAccount.d.ts +7 -0
  287. package/protocol/types/operations/ActivateAccount.js +3 -0
  288. package/protocol/types/operations/ActivateAccount.js.map +1 -0
  289. package/protocol/types/operations/Ballot.d.ts +9 -0
  290. package/protocol/types/operations/Ballot.js +3 -0
  291. package/protocol/types/operations/Ballot.js.map +1 -0
  292. package/protocol/types/operations/Delegation.d.ts +11 -0
  293. package/protocol/types/operations/Delegation.js +3 -0
  294. package/protocol/types/operations/Delegation.js.map +1 -0
  295. package/protocol/types/operations/DoubleBakingEvidence.d.ts +8 -0
  296. package/protocol/types/operations/DoubleBakingEvidence.js +3 -0
  297. package/protocol/types/operations/DoubleBakingEvidence.js.map +1 -0
  298. package/protocol/types/operations/DoubleEndorsementEvidence.d.ts +16 -0
  299. package/protocol/types/operations/DoubleEndorsementEvidence.js +3 -0
  300. package/protocol/types/operations/DoubleEndorsementEvidence.js.map +1 -0
  301. package/protocol/types/operations/Endorsement.d.ts +6 -0
  302. package/protocol/types/operations/Endorsement.js +3 -0
  303. package/protocol/types/operations/Endorsement.js.map +1 -0
  304. package/protocol/types/operations/Origination.d.ts +13 -0
  305. package/protocol/types/operations/Origination.js +3 -0
  306. package/protocol/types/operations/Origination.js.map +1 -0
  307. package/protocol/types/operations/Proposal.d.ts +7 -0
  308. package/protocol/types/operations/Proposal.js +3 -0
  309. package/protocol/types/operations/Proposal.js.map +1 -0
  310. package/protocol/types/operations/Reveal.d.ts +11 -0
  311. package/protocol/types/operations/Reveal.js +3 -0
  312. package/protocol/types/operations/Reveal.js.map +1 -0
  313. package/protocol/types/operations/SeedNonceRevelation.d.ts +7 -0
  314. package/protocol/types/operations/SeedNonceRevelation.js +3 -0
  315. package/protocol/types/operations/SeedNonceRevelation.js.map +1 -0
  316. package/protocol/types/operations/TezosOperation.d.ts +4 -0
  317. package/protocol/types/operations/TezosOperation.js +3 -0
  318. package/protocol/types/operations/TezosOperation.js.map +1 -0
  319. package/protocol/types/operations/Transaction.d.ts +23 -0
  320. package/protocol/types/operations/Transaction.js +3 -0
  321. package/protocol/types/operations/Transaction.js.map +1 -0
  322. package/protocol/types/sapling/TezosSaplingAddressCursor.d.ts +4 -0
  323. package/protocol/types/sapling/TezosSaplingAddressCursor.js +3 -0
  324. package/protocol/types/sapling/TezosSaplingAddressCursor.js.map +1 -0
  325. package/protocol/types/sapling/TezosSaplingAddressResult.d.ts +4 -0
  326. package/protocol/types/sapling/TezosSaplingAddressResult.js +3 -0
  327. package/protocol/types/sapling/TezosSaplingAddressResult.js.map +1 -0
  328. package/protocol/types/sapling/TezosSaplingCiphertext.d.ts +8 -0
  329. package/protocol/types/sapling/TezosSaplingCiphertext.js +3 -0
  330. package/protocol/types/sapling/TezosSaplingCiphertext.js.map +1 -0
  331. package/protocol/types/sapling/TezosSaplingInput.d.ts +6 -0
  332. package/protocol/types/sapling/TezosSaplingInput.js +3 -0
  333. package/protocol/types/sapling/TezosSaplingInput.js.map +1 -0
  334. package/protocol/types/sapling/TezosSaplingOutput.d.ts +6 -0
  335. package/protocol/types/sapling/TezosSaplingOutput.js +3 -0
  336. package/protocol/types/sapling/TezosSaplingOutput.js.map +1 -0
  337. package/protocol/types/sapling/TezosSaplingStateDiff.d.ts +6 -0
  338. package/protocol/types/sapling/TezosSaplingStateDiff.js +3 -0
  339. package/protocol/types/sapling/TezosSaplingStateDiff.js.map +1 -0
  340. package/protocol/types/sapling/TezosSaplingStateTree.d.ts +7 -0
  341. package/protocol/types/sapling/TezosSaplingStateTree.js +3 -0
  342. package/protocol/types/sapling/TezosSaplingStateTree.js.map +1 -0
  343. package/protocol/types/sapling/TezosSaplingTransaction.d.ts +23 -0
  344. package/protocol/types/sapling/TezosSaplingTransaction.js +3 -0
  345. package/protocol/types/sapling/TezosSaplingTransaction.js.map +1 -0
  346. package/protocol/types/sapling/TezosSaplingTransactionCursor.d.ts +3 -0
  347. package/protocol/types/sapling/TezosSaplingTransactionCursor.js +3 -0
  348. package/protocol/types/sapling/TezosSaplingTransactionCursor.js.map +1 -0
  349. package/protocol/types/sapling/TezosSaplingTransactionResult.d.ts +6 -0
  350. package/protocol/types/sapling/TezosSaplingTransactionResult.js +3 -0
  351. package/protocol/types/sapling/TezosSaplingTransactionResult.js.map +1 -0
  352. package/protocol/types/utils.d.ts +8 -0
  353. package/protocol/types/utils.js +41 -0
  354. package/protocol/types/utils.js.map +1 -0
  355. package/readme.md +121 -0
  356. package/types/signed-transaction-tezos-sapling.d.ts +3 -0
  357. package/types/signed-transaction-tezos-sapling.js +3 -0
  358. package/types/signed-transaction-tezos-sapling.js.map +1 -0
  359. package/types/signed-transaction-tezos.d.ts +5 -0
  360. package/types/signed-transaction-tezos.js +3 -0
  361. package/types/signed-transaction-tezos.js.map +1 -0
  362. package/types/transaction-tezos.d.ts +14 -0
  363. package/types/transaction-tezos.js +3 -0
  364. package/types/transaction-tezos.js.map +1 -0
  365. package/types/unsigned-transaction-tezos-sapling.d.ts +38 -0
  366. package/types/unsigned-transaction-tezos-sapling.js +3 -0
  367. package/types/unsigned-transaction-tezos-sapling.js.map +1 -0
  368. package/types/unsigned-transaction-tezos.d.ts +8 -0
  369. package/types/unsigned-transaction-tezos.js +3 -0
  370. package/types/unsigned-transaction-tezos.js.map +1 -0
@@ -0,0 +1,5 @@
1
+ export interface TezosFA2BalanceOfResponse {
2
+ address: string;
3
+ tokenID: number;
4
+ amount: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TezosFA2BalanceOfResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TezosFA2BalanceOfResponse.js","sourceRoot":"","sources":["../../../../src/protocol/types/fa/TezosFA2BalanceOfResponse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export interface TezosFA2TransferRequest {
2
+ from: string;
3
+ txs: {
4
+ to: string;
5
+ tokenID: number;
6
+ amount: string;
7
+ }[];
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TezosFA2TransferRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TezosFA2TransferRequest.js","sourceRoot":"","sources":["../../../../src/protocol/types/fa/TezosFA2TransferRequest.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export interface TezosFA2UpdateOperatorRequest {
2
+ operation: 'add' | 'remove';
3
+ owner: string;
4
+ operator: string;
5
+ tokenId: number;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TezosFA2UpdateOperatorRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TezosFA2UpdateOperatorRequest.js","sourceRoot":"","sources":["../../../../src/protocol/types/fa/TezosFA2UpdateOperatorRequest.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export interface TezosFATokenMetadata {
2
+ symbol: string;
3
+ name: string;
4
+ decimals: number;
5
+ [key: string]: string | number | boolean;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TezosFATokenMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TezosFATokenMetadata.js","sourceRoot":"","sources":["../../../../src/protocol/types/fa/TezosFATokenMetadata.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { TezosAddressCursor } from '../TezosAddressCursor';
2
+ export interface TezosKtAddressCursor extends TezosAddressCursor {
3
+ index?: number;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TezosKtAddressCursor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TezosKtAddressCursor.js","sourceRoot":"","sources":["../../../../src/protocol/types/kt/TezosKtAddressCursor.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { TezosAddressResult } from '../TezosAddressResult';
2
+ import { TezosKtAddressCursor } from './TezosKtAddressCursor';
3
+ export interface TezosKtAddressResult extends TezosAddressResult {
4
+ cursor: TezosKtAddressCursor;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TezosKtAddressResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TezosKtAddressResult.js","sourceRoot":"","sources":["../../../../src/protocol/types/kt/TezosKtAddressResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { MichelsonGrammarData } from '../michelson/grammar/MichelsonGrammarData';
2
+ import { MichelsonGrammarInstruction } from '../michelson/grammar/MichelsonGrammarInstruction';
3
+ import { MichelsonGrammarType } from '../michelson/grammar/MichelsonGrammarType';
4
+ export declare type MichelineGenericNode<T extends MichelsonGrammarType | MichelsonGrammarData> = MichelinePrimitive<'int'> | MichelinePrimitive<'string'> | MichelinePrimitive<'bytes'> | MichelinePrimitiveApplication<T> | MichelineGenericNode<T>[];
5
+ export declare type MichelineNode = MichelineGenericNode<MichelsonGrammarType | MichelsonGrammarData>;
6
+ export declare type MichelineTypeNode = MichelineGenericNode<MichelsonGrammarType>;
7
+ export declare type MichelineDataNode = MichelineGenericNode<MichelsonGrammarData>;
8
+ export declare type MichelineCodeNode = MichelineGenericNode<MichelsonGrammarInstruction>;
9
+ export declare type MichelinePrimitiveType = 'int' | 'string' | 'bytes';
10
+ export declare type MichelinePrimitive<T extends MichelinePrimitiveType> = Record<T, string>;
11
+ export interface MichelinePrimitiveApplication<T extends MichelsonGrammarType | MichelsonGrammarData> {
12
+ prim: T;
13
+ args?: MichelineGenericNode<T>[];
14
+ annots?: string[];
15
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // https://tezos.gitlab.io/whitedoc/micheline.html#bnf-grammar
3
+ // https://tezos.gitlab.io/whitedoc/micheline.html#conversion-to-json
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=MichelineNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MichelineNode.js","sourceRoot":"","sources":["../../../../src/protocol/types/micheline/MichelineNode.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,qEAAqE"}
@@ -0,0 +1,6 @@
1
+ import { MichelsonGrammarData } from '../michelson/grammar/MichelsonGrammarData';
2
+ import { MichelsonGrammarType } from '../michelson/grammar/MichelsonGrammarType';
3
+ import { MichelineGenericNode } from './MichelineNode';
4
+ export declare class MichelineNodeUtils {
5
+ static normalize<T extends MichelsonGrammarData | MichelsonGrammarType>(node: MichelineGenericNode<T>): MichelineGenericNode<T>;
6
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MichelineNodeUtils = void 0;
4
+ var utils_1 = require("../utils");
5
+ var MichelineNodeUtils = /** @class */ (function () {
6
+ function MichelineNodeUtils() {
7
+ }
8
+ MichelineNodeUtils.normalize = function (node) {
9
+ var _a;
10
+ if (utils_1.isMichelineSequence(node, false)) {
11
+ return node.map(function (value) { return MichelineNodeUtils.normalize(value); });
12
+ }
13
+ else if (utils_1.isAnyMichelinePrimitiveApplication(node)) {
14
+ var args = void 0;
15
+ if ((node.prim === 'pair' || node.prim === 'Pair') && node.args && node.args.length > 2) {
16
+ args = [
17
+ MichelineNodeUtils.normalize(node.args[0]),
18
+ MichelineNodeUtils.normalize({
19
+ prim: node.prim,
20
+ args: node.args.slice(1)
21
+ })
22
+ ];
23
+ }
24
+ else {
25
+ args = (_a = node.args) === null || _a === void 0 ? void 0 : _a.map(function (arg) { return MichelineNodeUtils.normalize(arg); });
26
+ }
27
+ return {
28
+ prim: node.prim,
29
+ args: args,
30
+ annots: node.annots
31
+ };
32
+ }
33
+ else {
34
+ return node;
35
+ }
36
+ };
37
+ return MichelineNodeUtils;
38
+ }());
39
+ exports.MichelineNodeUtils = MichelineNodeUtils;
40
+ //# sourceMappingURL=MichelineNodeUtils.js.map
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D,CAAC,AA3BD,IA2BC;AA3BY,gDAAkB"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="node" />
2
+ import { MichelineDataNode } from '../micheline/MichelineNode';
3
+ export declare abstract class MichelsonType {
4
+ name?: string | undefined;
5
+ constructor(name?: string | undefined);
6
+ abstract asRawValue(): any;
7
+ abstract toMichelineJSON(): MichelineDataNode;
8
+ eval(): void;
9
+ encode(): Buffer;
10
+ setName(name: string): void;
11
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MichelsonType = void 0;
4
+ var errors_1 = require("@airgap/coinlib-core/errors");
5
+ var coinlib_error_1 = require("@airgap/coinlib-core/errors/coinlib-error");
6
+ var MichelsonType = /** @class */ (function () {
7
+ function MichelsonType(name) {
8
+ this.name = name;
9
+ }
10
+ MichelsonType.prototype.eval = function () {
11
+ // default implementation, no action required
12
+ };
13
+ MichelsonType.prototype.encode = function () {
14
+ throw new errors_1.UnsupportedError(coinlib_error_1.Domain.TEZOS, 'Encoding for this Michelson type is not supported');
15
+ };
16
+ MichelsonType.prototype.setName = function (name) {
17
+ this.name = name;
18
+ };
19
+ return MichelsonType;
20
+ }());
21
+ exports.MichelsonType = MichelsonType;
22
+ //# sourceMappingURL=MichelsonType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MichelsonType.js","sourceRoot":"","sources":["../../../../src/protocol/types/michelson/MichelsonType.ts"],"names":[],"mappings":";;;AAAA,sDAA8D;AAC9D,2EAAkE;AAIlE;IACE,uBAAmB,IAAa;QAAb,SAAI,GAAJ,IAAI,CAAS;IAAG,CAAC;IAK7B,4BAAI,GAAX;QACE,6CAA6C;IAC/C,CAAC;IAEM,8BAAM,GAAb;QACE,MAAM,IAAI,yBAAgB,CAAC,sBAAM,CAAC,KAAK,EAAE,mDAAmD,CAAC,CAAA;IAC/F,CAAC;IAEM,+BAAO,GAAd,UAAe,IAAY;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IACH,oBAAC;AAAD,CAAC,AAjBD,IAiBC;AAjBqB,sCAAa"}
@@ -0,0 +1,33 @@
1
+ import { Lazy } from '@airgap/coinlib-core/data/Lazy';
2
+ import { MichelinePrimitiveApplication, MichelineTypeNode } from '../../types/micheline/MichelineNode';
3
+ import { MichelsonGrammarType } from '../../types/michelson/grammar/MichelsonGrammarType';
4
+ import { MichelsonType } from './MichelsonType';
5
+ export declare enum MichelsonAnnotationPrefix {
6
+ TYPE = ":",
7
+ VARIABLE = "@",
8
+ FIELD = "%"
9
+ }
10
+ export interface MichelsonTypeMetaCreateValueConfiguration {
11
+ lazyEval?: boolean;
12
+ readAnnots?: boolean;
13
+ beforeNext?(meta: MichelsonTypeMeta, raw: unknown): void;
14
+ onNext?(meta: MichelsonTypeMeta, raw: unknown, value: MichelsonType): void;
15
+ }
16
+ export declare class MichelsonTypeMeta {
17
+ readonly type: MichelsonGrammarType;
18
+ readonly parent?: MichelsonGenericTypeMeta | undefined;
19
+ readonly annots: string[];
20
+ constructor(type: MichelsonGrammarType, parent?: MichelsonGenericTypeMeta | undefined, annots?: string[]);
21
+ static fromMichelineNode(node: MichelineTypeNode): MichelsonTypeMeta | undefined;
22
+ static fromMichelinePrimitiveApplication(primitiveApplication: MichelinePrimitiveApplication<any>, parent?: MichelsonGenericTypeMeta): MichelsonTypeMeta;
23
+ static from(type: MichelsonGrammarType, annots: string[], args: MichelinePrimitiveApplication<any>[], parent?: MichelsonGenericTypeMeta): MichelsonTypeMeta;
24
+ createValue(value: unknown, configuration?: MichelsonTypeMetaCreateValueConfiguration): MichelsonType;
25
+ getAnnotation(...prefixes: MichelsonAnnotationPrefix[]): string | undefined;
26
+ protected getMichelsonValue(raw: unknown, _configuration?: MichelsonTypeMetaCreateValueConfiguration): MichelsonType;
27
+ protected getRawValue(value: unknown): unknown;
28
+ }
29
+ export declare class MichelsonGenericTypeMeta extends MichelsonTypeMeta {
30
+ readonly generics: Lazy<MichelsonTypeMeta>[];
31
+ constructor(type: MichelsonGrammarType, genericTypes: MichelinePrimitiveApplication<any>[], parent?: MichelsonGenericTypeMeta, annots?: string[]);
32
+ protected getMichelsonValue(raw: unknown, configuration?: MichelsonTypeMetaCreateValueConfiguration): MichelsonType;
33
+ }
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ // tslint:disable: max-classes-per-file
3
+ var __extends = (this && this.__extends) || (function () {
4
+ var extendStatics = function (d, b) {
5
+ extendStatics = Object.setPrototypeOf ||
6
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
7
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
8
+ return extendStatics(d, b);
9
+ };
10
+ return function (d, b) {
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var __spreadArrays = (this && this.__spreadArrays) || function () {
17
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
18
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
19
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
20
+ r[k] = a[j];
21
+ return r;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.MichelsonGenericTypeMeta = exports.MichelsonTypeMeta = exports.MichelsonAnnotationPrefix = void 0;
25
+ var Lazy_1 = require("@airgap/coinlib-core/data/Lazy");
26
+ var utils_1 = require("../utils");
27
+ var MichelsonType_1 = require("./MichelsonType");
28
+ var MichelsonTypeUtils_1 = require("./MichelsonTypeUtils");
29
+ var MichelsonAnnotationPrefix;
30
+ (function (MichelsonAnnotationPrefix) {
31
+ MichelsonAnnotationPrefix["TYPE"] = ":";
32
+ MichelsonAnnotationPrefix["VARIABLE"] = "@";
33
+ MichelsonAnnotationPrefix["FIELD"] = "%";
34
+ })(MichelsonAnnotationPrefix = exports.MichelsonAnnotationPrefix || (exports.MichelsonAnnotationPrefix = {}));
35
+ var MichelsonTypeMeta = /** @class */ (function () {
36
+ function MichelsonTypeMeta(type, parent, annots) {
37
+ if (annots === void 0) { annots = []; }
38
+ this.type = type;
39
+ this.parent = parent;
40
+ this.annots = annots;
41
+ }
42
+ MichelsonTypeMeta.fromMichelineNode = function (node) {
43
+ if (!utils_1.isAnyMichelinePrimitiveApplication(node)) {
44
+ return undefined;
45
+ }
46
+ return this.fromMichelinePrimitiveApplication(node);
47
+ };
48
+ MichelsonTypeMeta.fromMichelinePrimitiveApplication = function (primitiveApplication, parent) {
49
+ var _a, _b, _c;
50
+ return this.from(primitiveApplication.prim, (_a = primitiveApplication.annots) !== null && _a !== void 0 ? _a : [], (_c = (_b = primitiveApplication.args) === null || _b === void 0 ? void 0 : _b.filter(utils_1.isAnyMichelinePrimitiveApplication)) !== null && _c !== void 0 ? _c : [], parent);
51
+ };
52
+ MichelsonTypeMeta.from = function (type, annots, args, parent) {
53
+ return args.length === 0 ? new MichelsonTypeMeta(type, parent, annots) : new MichelsonGenericTypeMeta(type, args, parent, annots);
54
+ };
55
+ MichelsonTypeMeta.prototype.createValue = function (value, configuration) {
56
+ var _a, _b;
57
+ if (configuration === void 0) { configuration = {}; }
58
+ if (value instanceof MichelsonType_1.MichelsonType) {
59
+ return value;
60
+ }
61
+ var raw = this.getRawValue(value);
62
+ if (configuration.beforeNext) {
63
+ configuration.beforeNext(this, raw);
64
+ }
65
+ var michelsonValue = this.getMichelsonValue(raw, configuration);
66
+ if (!((_a = configuration.lazyEval) !== null && _a !== void 0 ? _a : true)) {
67
+ michelsonValue.eval();
68
+ }
69
+ if ((_b = configuration.readAnnots) !== null && _b !== void 0 ? _b : true) {
70
+ var name_1 = this.getAnnotation(MichelsonAnnotationPrefix.FIELD, MichelsonAnnotationPrefix.TYPE);
71
+ if (name_1) {
72
+ michelsonValue.setName(name_1);
73
+ }
74
+ }
75
+ if (configuration.onNext) {
76
+ configuration.onNext(this, raw, michelsonValue);
77
+ }
78
+ return michelsonValue;
79
+ };
80
+ MichelsonTypeMeta.prototype.getAnnotation = function () {
81
+ var prefixes = [];
82
+ for (var _i = 0; _i < arguments.length; _i++) {
83
+ prefixes[_i] = arguments[_i];
84
+ }
85
+ var _loop_1 = function (annot) {
86
+ var matchedPrefix = prefixes.find(function (prefix) {
87
+ return annot.startsWith(prefix);
88
+ });
89
+ if (matchedPrefix !== undefined) {
90
+ return { value: annot.slice(matchedPrefix.length) };
91
+ }
92
+ };
93
+ for (var _a = 0, _b = this.annots; _a < _b.length; _a++) {
94
+ var annot = _b[_a];
95
+ var state_1 = _loop_1(annot);
96
+ if (typeof state_1 === "object")
97
+ return state_1.value;
98
+ }
99
+ return undefined;
100
+ };
101
+ MichelsonTypeMeta.prototype.getMichelsonValue = function (raw, _configuration) {
102
+ if (_configuration === void 0) { _configuration = {}; }
103
+ return MichelsonTypeUtils_1.MichelsonTypeUtils.create(this.type, raw);
104
+ };
105
+ MichelsonTypeMeta.prototype.getRawValue = function (value) {
106
+ var argName = this.getAnnotation(MichelsonAnnotationPrefix.TYPE, MichelsonAnnotationPrefix.FIELD);
107
+ return value instanceof Object && argName && argName in value ? value[argName] : value;
108
+ };
109
+ return MichelsonTypeMeta;
110
+ }());
111
+ exports.MichelsonTypeMeta = MichelsonTypeMeta;
112
+ var MichelsonGenericTypeMeta = /** @class */ (function (_super) {
113
+ __extends(MichelsonGenericTypeMeta, _super);
114
+ function MichelsonGenericTypeMeta(type, genericTypes, parent, annots) {
115
+ if (annots === void 0) { annots = []; }
116
+ var _this = _super.call(this, type, parent, annots) || this;
117
+ _this.generics = genericTypes.map(function (type) {
118
+ return new Lazy_1.Lazy(function () { return MichelsonTypeMeta.fromMichelinePrimitiveApplication(type, _this); });
119
+ });
120
+ return _this;
121
+ }
122
+ MichelsonGenericTypeMeta.prototype.getMichelsonValue = function (raw, configuration) {
123
+ if (configuration === void 0) { configuration = {}; }
124
+ var genericFactories = this.generics.map(function (genericMeta) {
125
+ return function (genericValue) { return genericMeta.get().createValue(genericValue, configuration); };
126
+ });
127
+ return MichelsonTypeUtils_1.MichelsonTypeUtils.create.apply(MichelsonTypeUtils_1.MichelsonTypeUtils, __spreadArrays([this.type, raw], genericFactories));
128
+ };
129
+ return MichelsonGenericTypeMeta;
130
+ }(MichelsonTypeMeta));
131
+ exports.MichelsonGenericTypeMeta = MichelsonGenericTypeMeta;
132
+ //# sourceMappingURL=MichelsonTypeMeta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MichelsonTypeMeta.js","sourceRoot":"","sources":["../../../../src/protocol/types/michelson/MichelsonTypeMeta.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;AAEvC,uDAAqD;AAIrD,kCAA6D;AAE7D,iDAA+C;AAC/C,2DAAyD;AAEzD,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACnC,uCAAU,CAAA;IACV,2CAAc,CAAA;IACd,wCAAW,CAAA;AACb,CAAC,EAJW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAIpC;AAUD;IACE,2BACkB,IAA0B,EAC1B,MAAiC,EACjC,MAAqB;QAArB,uBAAA,EAAA,WAAqB;QAFrB,SAAI,GAAJ,IAAI,CAAsB;QAC1B,WAAM,GAAN,MAAM,CAA2B;QACjC,WAAM,GAAN,MAAM,CAAe;IACpC,CAAC;IAEU,mCAAiB,GAA/B,UAAgC,IAAuB;QACrD,IAAI,CAAC,0CAAkC,CAAC,IAAI,CAAC,EAAE;YAC7C,OAAO,SAAS,CAAA;SACjB;QAED,OAAO,IAAI,CAAC,iCAAiC,CAAC,IAAI,CAAC,CAAA;IACrD,CAAC;IAEa,mDAAiC,GAA/C,UACE,oBAAwD,EACxD,MAAiC;;QAEjC,OAAO,IAAI,CAAC,IAAI,CACd,oBAAoB,CAAC,IAAI,QACzB,oBAAoB,CAAC,MAAM,mCAAI,EAAE,cACjC,oBAAoB,CAAC,IAAI,0CAAE,MAAM,CAAC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,GAAG,YAAY,CAAC,GAAG,CAAC,UAAC,IAAwC;YACxE,OAAO,IAAI,WAAI,CAAC,cAAM,OAAA,iBAAiB,CAAC,iCAAiC,CAAC,IAAI,EAAE,KAAI,CAAC,EAA/D,CAA+D,CAAC,CAAA;QACxF,CAAC,CAAC,CAAA;;IACJ,CAAC;IAES,oDAAiB,GAA3B,UAA4B,GAAY,EAAE,aAA6D;QAA7D,8BAAA,EAAA,kBAA6D;QACrG,IAAM,gBAAgB,GAAiD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAC,WAAoC;YAC5H,OAAO,UAAC,YAAqB,IAAoB,OAAA,WAAW,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,aAAa,CAAC,EAA1D,CAA0D,CAAA;QAC7G,CAAC,CAAC,CAAA;QAEF,OAAO,uCAAkB,CAAC,MAAM,OAAzB,uCAAkB,kBAAQ,IAAI,CAAC,IAAI,EAAE,GAAG,GAAK,gBAAgB,GAAC;IACvE,CAAC;IACH,+BAAC;AAAD,CAAC,AAvBD,CAA8C,iBAAiB,GAuB9D;AAvBY,4DAAwB"}
@@ -0,0 +1,19 @@
1
+ /// <reference types="node" />
2
+ import { MichelsonGrammarType } from './grammar/MichelsonGrammarType';
3
+ import { MichelsonType } from './MichelsonType';
4
+ export declare class MichelsonTypeUtils {
5
+ static readonly literalPrefixes: {
6
+ int: Buffer;
7
+ string: Buffer;
8
+ bytes: Buffer;
9
+ };
10
+ static readonly primPrefixes: {
11
+ pair: Buffer;
12
+ };
13
+ static readonly sequencePrefixes: {
14
+ list: Buffer;
15
+ };
16
+ static decode(encoded: string | Buffer | Uint8Array): MichelsonType | undefined;
17
+ private static readonly michelsonTypeFactories;
18
+ static create(type: MichelsonGrammarType, ...args: unknown[]): MichelsonType;
19
+ }