@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,449 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ var __assign = (this && this.__assign) || function () {
16
+ __assign = Object.assign || function(t) {
17
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
18
+ s = arguments[i];
19
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
+ t[p] = s[p];
21
+ }
22
+ return t;
23
+ };
24
+ return __assign.apply(this, arguments);
25
+ };
26
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
+ return new (P || (P = Promise))(function (resolve, reject) {
29
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
33
+ });
34
+ };
35
+ var __generator = (this && this.__generator) || function (thisArg, body) {
36
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
37
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
+ function verb(n) { return function (v) { return step([n, v]); }; }
39
+ function step(op) {
40
+ if (f) throw new TypeError("Generator is already executing.");
41
+ while (_) try {
42
+ 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;
43
+ if (y = 0, t) op = [op[0] & 2, t.value];
44
+ switch (op[0]) {
45
+ case 0: case 1: t = op; break;
46
+ case 4: _.label++; return { value: op[1], done: false };
47
+ case 5: _.label++; y = op[1]; op = [0]; continue;
48
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
49
+ default:
50
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
51
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
52
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
53
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
54
+ if (t[2]) _.ops.pop();
55
+ _.trys.pop(); continue;
56
+ }
57
+ op = body.call(thisArg, _);
58
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
59
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
60
+ }
61
+ };
62
+ var __importDefault = (this && this.__importDefault) || function (mod) {
63
+ return (mod && mod.__esModule) ? mod : { "default": mod };
64
+ };
65
+ Object.defineProperty(exports, "__esModule", { value: true });
66
+ exports.TezosFA2Protocol = void 0;
67
+ var bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
68
+ var errors_1 = require("@airgap/coinlib-core/errors");
69
+ var coinlib_error_1 = require("@airgap/coinlib-core/errors/coinlib-error");
70
+ var hex_1 = require("@airgap/coinlib-core/utils/hex");
71
+ var TezosProtocol_1 = require("../TezosProtocol");
72
+ var TezosUtils_1 = require("../TezosUtils");
73
+ var MichelsonList_1 = require("../types/michelson/generics/MichelsonList");
74
+ var MichelsonPair_1 = require("../types/michelson/generics/MichelsonPair");
75
+ var MichelsonAddress_1 = require("../types/michelson/primitives/MichelsonAddress");
76
+ var MichelsonInt_1 = require("../types/michelson/primitives/MichelsonInt");
77
+ var MichelsonString_1 = require("../types/michelson/primitives/MichelsonString");
78
+ var TezosOperationType_1 = require("../types/TezosOperationType");
79
+ var utils_1 = require("../types/utils");
80
+ var TezosFAProtocol_1 = require("./TezosFAProtocol");
81
+ var TezosFA2ContractEntrypoint;
82
+ (function (TezosFA2ContractEntrypoint) {
83
+ TezosFA2ContractEntrypoint["BALANCE"] = "balance_of";
84
+ TezosFA2ContractEntrypoint["TRANSFER"] = "transfer";
85
+ TezosFA2ContractEntrypoint["UPDATE_OPERATORS"] = "update_operators";
86
+ })(TezosFA2ContractEntrypoint || (TezosFA2ContractEntrypoint = {}));
87
+ var TezosFA2Protocol = /** @class */ (function (_super) {
88
+ __extends(TezosFA2Protocol, _super);
89
+ function TezosFA2Protocol(options) {
90
+ var _a, _b, _c;
91
+ var _this = _super.call(this, options) || this;
92
+ _this.options = options;
93
+ _this.tokenID = options.config.defaultTokenID;
94
+ _this.defaultCallbackContract = (_a = {},
95
+ _a[TezosProtocol_1.TezosNetwork.MAINNET] = (_b = {},
96
+ _b[TezosFA2ContractEntrypoint.BALANCE] = 'KT1LyHDYnML5eCuTEVCTynUpivwG6ns6khiG',
97
+ _b),
98
+ _a[TezosProtocol_1.TezosNetwork.GHOSTNET] = (_c = {},
99
+ _c[TezosFA2ContractEntrypoint.BALANCE] = 'KT1D1vHAyMVqfVJoufp6eYTJcJWEFigR3yjr',
100
+ _c),
101
+ _a);
102
+ return _this;
103
+ }
104
+ TezosFA2Protocol.prototype.getOptions = function () {
105
+ return __awaiter(this, void 0, void 0, function () {
106
+ return __generator(this, function (_a) {
107
+ return [2 /*return*/, this.options];
108
+ });
109
+ });
110
+ };
111
+ TezosFA2Protocol.prototype.getBalanceOfPublicKey = function (publicKey, data) {
112
+ return __awaiter(this, void 0, void 0, function () {
113
+ var address;
114
+ return __generator(this, function (_a) {
115
+ switch (_a.label) {
116
+ case 0: return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
117
+ case 1:
118
+ address = _a.sent();
119
+ return [2 /*return*/, this.getBalanceOfAddresses([address.address], data)];
120
+ }
121
+ });
122
+ });
123
+ };
124
+ TezosFA2Protocol.prototype.getAvailableBalanceOfAddresses = function (addresses, data) {
125
+ return __awaiter(this, void 0, void 0, function () {
126
+ return __generator(this, function (_a) {
127
+ return [2 /*return*/, this.getBalanceOfAddresses(addresses, data)];
128
+ });
129
+ });
130
+ };
131
+ TezosFA2Protocol.prototype.getBalanceOfAddresses = function (addresses, data) {
132
+ return __awaiter(this, void 0, void 0, function () {
133
+ var results;
134
+ var _this = this;
135
+ return __generator(this, function (_a) {
136
+ switch (_a.label) {
137
+ case 0: return [4 /*yield*/, this.balanceOf(addresses.map(function (address) {
138
+ var _a, _b;
139
+ return {
140
+ address: address,
141
+ tokenID: (_b = (_a = data === null || data === void 0 ? void 0 : data.assetID) !== null && _a !== void 0 ? _a : _this.tokenID) !== null && _b !== void 0 ? _b : 0
142
+ };
143
+ }, this.defaultSourceAddress))];
144
+ case 1:
145
+ results = _a.sent();
146
+ return [2 /*return*/, results.reduce(function (sum, next) { return sum.plus(next.amount); }, new bignumber_1.default(0)).toFixed()];
147
+ }
148
+ });
149
+ });
150
+ };
151
+ TezosFA2Protocol.prototype.estimateFeeDefaultsFromPublicKey = function (publicKey, recipients, values, data) {
152
+ return __awaiter(this, void 0, void 0, function () {
153
+ var transferCall, operation;
154
+ return __generator(this, function (_a) {
155
+ switch (_a.label) {
156
+ case 0:
157
+ // return this.feeDefaults
158
+ if (recipients.length !== values.length) {
159
+ throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.TEZOS, 'length of recipients and values does not match!');
160
+ }
161
+ return [4 /*yield*/, this.createTransferCall(publicKey, recipients, values, this.feeDefaults.medium, data)];
162
+ case 1:
163
+ transferCall = _a.sent();
164
+ operation = {
165
+ kind: TezosOperationType_1.TezosOperationType.TRANSACTION,
166
+ amount: '0',
167
+ destination: this.contractAddress,
168
+ parameters: transferCall.toJSON(),
169
+ fee: '0'
170
+ };
171
+ return [2 /*return*/, this.estimateFeeDefaultsForOperations(publicKey, [operation])];
172
+ }
173
+ });
174
+ });
175
+ };
176
+ TezosFA2Protocol.prototype.prepareTransactionFromPublicKey = function (publicKey, recipients, values, fee, data) {
177
+ return __awaiter(this, void 0, void 0, function () {
178
+ var transferCall;
179
+ return __generator(this, function (_a) {
180
+ switch (_a.label) {
181
+ case 0: return [4 /*yield*/, this.createTransferCall(publicKey, recipients, values, fee, data)];
182
+ case 1:
183
+ transferCall = _a.sent();
184
+ return [2 /*return*/, this.prepareContractCall([transferCall], fee, publicKey)];
185
+ }
186
+ });
187
+ });
188
+ };
189
+ TezosFA2Protocol.prototype.transactionDetailsFromParameters = function (parameters) {
190
+ var _this = this;
191
+ var defaultDetails = {
192
+ extra: {
193
+ type: parameters.entrypoint
194
+ }
195
+ };
196
+ if (parameters.entrypoint !== TezosFA2ContractEntrypoint.TRANSFER) {
197
+ console.warn('Only calls to the transfer entrypoint can be converted to IAirGapTransaction');
198
+ return [defaultDetails];
199
+ }
200
+ try {
201
+ var callArgumentsList = MichelsonList_1.MichelsonList.from(parameters.value, function (pairJSON) {
202
+ return MichelsonPair_1.MichelsonPair.from(pairJSON, undefined, function (fromJSON) { return MichelsonAddress_1.MichelsonAddress.from(fromJSON, 'from_'); }, function (txsJSON) {
203
+ return MichelsonList_1.MichelsonList.from(txsJSON, function (pairJSON) {
204
+ return MichelsonPair_1.MichelsonPair.from(pairJSON, undefined, function (toJSON) { return MichelsonAddress_1.MichelsonAddress.from(toJSON, 'to_'); }, function (pairJSON) {
205
+ return MichelsonPair_1.MichelsonPair.from(pairJSON, undefined, function (tokenJSON) { return MichelsonInt_1.MichelsonInt.from(tokenJSON, 'token_id'); }, function (amountJSON) { return MichelsonInt_1.MichelsonInt.from(amountJSON, 'amount'); });
206
+ });
207
+ }, 'txs');
208
+ });
209
+ }).asRawValue();
210
+ return Array.isArray(callArgumentsList)
211
+ ? callArgumentsList
212
+ .map(function (callArguments) {
213
+ if (!_this.isTransferRequest(callArguments)) {
214
+ return [];
215
+ }
216
+ var from = hex_1.isHex(callArguments.from_) ? TezosUtils_1.TezosUtils.parseAddress(callArguments.from_) : callArguments.from_;
217
+ var transferDetails = callArguments.txs.map(function (tx) {
218
+ var to = hex_1.isHex(tx.to_) ? TezosUtils_1.TezosUtils.parseAddress(tx.to_) : tx.to_;
219
+ return [to, tx.token_id, tx.amount];
220
+ });
221
+ return transferDetails
222
+ .map(function (_a) {
223
+ var to = _a[0], tokenID = _a[1], amount = _a[2];
224
+ if (_this.tokenID !== undefined && !tokenID.eq(_this.tokenID)) {
225
+ return undefined;
226
+ }
227
+ return __assign(__assign({}, defaultDetails), { amount: amount.toFixed(), from: [from], to: [to], extra: {
228
+ type: parameters.entrypoint,
229
+ assetID: tokenID.toNumber()
230
+ } });
231
+ })
232
+ .filter(function (partialDetails) { return partialDetails !== undefined; });
233
+ })
234
+ .reduce(function (flatten, next) { return flatten.concat(next); }, [])
235
+ : [defaultDetails];
236
+ }
237
+ catch (_a) {
238
+ return [defaultDetails];
239
+ }
240
+ };
241
+ TezosFA2Protocol.prototype.balanceOf = function (balanceRequests, source, callbackContract) {
242
+ if (callbackContract === void 0) { callbackContract = this.callbackContract(TezosFA2ContractEntrypoint.BALANCE); }
243
+ return __awaiter(this, void 0, void 0, function () {
244
+ var balanceOfCall, results;
245
+ return __generator(this, function (_a) {
246
+ switch (_a.label) {
247
+ case 0: return [4 /*yield*/, this.contract.createContractCall(TezosFA2ContractEntrypoint.BALANCE, {
248
+ requests: balanceRequests.map(function (request) {
249
+ return {
250
+ owner: request.address,
251
+ token_id: typeof request.tokenID === 'string' ? parseInt(request.tokenID, 10) : request.tokenID
252
+ };
253
+ }),
254
+ callback: callbackContract
255
+ })];
256
+ case 1:
257
+ balanceOfCall = _a.sent();
258
+ return [4 /*yield*/, this.runContractCall(balanceOfCall, this.requireSource(source))];
259
+ case 2:
260
+ results = _a.sent();
261
+ if (utils_1.isMichelineSequence(results)) {
262
+ return [2 /*return*/, results
263
+ .map(function (node) {
264
+ try {
265
+ var pair = MichelsonPair_1.MichelsonPair.from(node, undefined, function (value) { return MichelsonPair_1.MichelsonPair.from(value, undefined, MichelsonAddress_1.MichelsonAddress.from, MichelsonInt_1.MichelsonInt.from); }, MichelsonInt_1.MichelsonInt.from);
266
+ var accountWithTokenID = MichelsonPair_1.MichelsonPair.from(pair.items[0].get());
267
+ var account = MichelsonAddress_1.MichelsonAddress.from(accountWithTokenID.items[0].get());
268
+ var tokenID = MichelsonInt_1.MichelsonInt.from(accountWithTokenID.items[1].get());
269
+ var amount = MichelsonInt_1.MichelsonInt.from(pair.items[1].get());
270
+ return {
271
+ address: account.address instanceof MichelsonString_1.MichelsonString ? account.address.value : TezosUtils_1.TezosUtils.parseAddress(account.address.value),
272
+ tokenID: tokenID.value.toNumber(),
273
+ amount: amount.value.toFixed()
274
+ };
275
+ }
276
+ catch (error) {
277
+ console.warn(error);
278
+ return undefined;
279
+ }
280
+ })
281
+ .filter(function (balanceOfResults) { return balanceOfResults !== undefined; })];
282
+ }
283
+ else {
284
+ return [2 /*return*/, []];
285
+ }
286
+ return [2 /*return*/];
287
+ }
288
+ });
289
+ });
290
+ };
291
+ TezosFA2Protocol.prototype.transfer = function (transferRequests, fee, publicKey) {
292
+ return __awaiter(this, void 0, void 0, function () {
293
+ var transferCall;
294
+ return __generator(this, function (_a) {
295
+ switch (_a.label) {
296
+ case 0: return [4 /*yield*/, this.contract.createContractCall(TezosFA2ContractEntrypoint.TRANSFER, transferRequests.map(function (request) {
297
+ return {
298
+ from_: request.from,
299
+ txs: request.txs.map(function (tx) {
300
+ return {
301
+ to_: tx.to,
302
+ token_id: tx.tokenID,
303
+ amount: tx.amount
304
+ };
305
+ })
306
+ };
307
+ }))];
308
+ case 1:
309
+ transferCall = _a.sent();
310
+ return [2 /*return*/, this.prepareContractCall([transferCall], fee, publicKey)];
311
+ }
312
+ });
313
+ });
314
+ };
315
+ TezosFA2Protocol.prototype.updateOperators = function (updateRequests, fee, publicKey) {
316
+ return __awaiter(this, void 0, void 0, function () {
317
+ var updateCall;
318
+ return __generator(this, function (_a) {
319
+ switch (_a.label) {
320
+ case 0: return [4 /*yield*/, this.contract.createContractCall(TezosFA2ContractEntrypoint.UPDATE_OPERATORS, updateRequests.map(function (request) {
321
+ var _a;
322
+ var args = (_a = {},
323
+ _a[request.operation + "_operator"] = {
324
+ owner: request.owner,
325
+ operator: request.operator,
326
+ token_id: request.tokenId
327
+ },
328
+ _a);
329
+ return [request.operation === 'add' ? 'Left' : 'Right', args];
330
+ }))];
331
+ case 1:
332
+ updateCall = _a.sent();
333
+ return [2 /*return*/, this.prepareContractCall([updateCall], fee, publicKey)];
334
+ }
335
+ });
336
+ });
337
+ };
338
+ TezosFA2Protocol.prototype.getTokenMetadata = function (tokenID) {
339
+ var _a;
340
+ return __awaiter(this, void 0, void 0, function () {
341
+ return __generator(this, function (_b) {
342
+ return [2 /*return*/, this.getTokenMetadataForTokenID((_a = tokenID !== null && tokenID !== void 0 ? tokenID : this.tokenID) !== null && _a !== void 0 ? _a : 0)];
343
+ });
344
+ });
345
+ };
346
+ TezosFA2Protocol.prototype.fetchTokenHolders = function (tokenID) {
347
+ var _a;
348
+ return __awaiter(this, void 0, void 0, function () {
349
+ return __generator(this, function (_b) {
350
+ return [2 /*return*/, this.contract.network.extras.indexerClient.getTokenBalances({
351
+ contractAddress: this.contract.address,
352
+ id: (_a = tokenID !== null && tokenID !== void 0 ? tokenID : this.tokenID) !== null && _a !== void 0 ? _a : 0
353
+ })];
354
+ });
355
+ });
356
+ };
357
+ TezosFA2Protocol.prototype.getTotalSupply = function (tokenID) {
358
+ var _a;
359
+ return __awaiter(this, void 0, void 0, function () {
360
+ var bigMaps, bigMapIndex, bigMap, result;
361
+ return __generator(this, function (_b) {
362
+ switch (_b.label) {
363
+ case 0: return [4 /*yield*/, this.contract.getBigMaps()];
364
+ case 1:
365
+ bigMaps = _b.sent();
366
+ bigMapIndex = this.options.config.totalSupplyBigMapID;
367
+ bigMap = undefined;
368
+ if (bigMapIndex !== undefined) {
369
+ bigMap = bigMaps.find(function (bigMap) { return bigMap.id === bigMapIndex; });
370
+ }
371
+ else {
372
+ bigMap = bigMaps.find(function (bigMap) {
373
+ return (bigMap.path === 'total_supply' || bigMap.path.endsWith('.total_supply')) &&
374
+ utils_1.isMichelinePrimitiveApplication('nat', bigMap.keyType) &&
375
+ utils_1.isMichelinePrimitiveApplication('nat', bigMap.valueType);
376
+ });
377
+ }
378
+ return [4 /*yield*/, this.contract.getBigMapValue({
379
+ bigMap: bigMap,
380
+ key: "" + ((_a = tokenID !== null && tokenID !== void 0 ? tokenID : this.tokenID) !== null && _a !== void 0 ? _a : 0)
381
+ })];
382
+ case 2:
383
+ result = _b.sent();
384
+ if (result !== undefined && utils_1.isMichelinePrimitive('int', result.value)) {
385
+ return [2 /*return*/, result.value.int];
386
+ }
387
+ return [2 /*return*/, '0'];
388
+ }
389
+ });
390
+ });
391
+ };
392
+ TezosFA2Protocol.prototype.createTransferCall = function (publicKey, recipients, values, fee, data) {
393
+ var _a, _b, _c;
394
+ return __awaiter(this, void 0, void 0, function () {
395
+ var addressIndex, tokenID, addresses, fromAddress, recipientsWithValues, transferCall;
396
+ return __generator(this, function (_d) {
397
+ switch (_d.label) {
398
+ case 0:
399
+ if (recipients.length !== values.length) {
400
+ throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.TEZOSFA, 'length of recipients and values does not match!');
401
+ }
402
+ addressIndex = (_a = data === null || data === void 0 ? void 0 : data.addressIndex) !== null && _a !== void 0 ? _a : 0;
403
+ tokenID = (_c = (_b = data === null || data === void 0 ? void 0 : data.assetID) !== null && _b !== void 0 ? _b : this.tokenID) !== null && _c !== void 0 ? _c : 0;
404
+ return [4 /*yield*/, this.getAddressesFromPublicKey(publicKey)];
405
+ case 1:
406
+ addresses = (_d.sent()).map(function (address) { return address.address; });
407
+ if (!addresses[addressIndex]) {
408
+ throw new errors_1.NotFoundError(coinlib_error_1.Domain.TEZOSFA, "no kt-address with index " + addressIndex + " exists");
409
+ }
410
+ fromAddress = addresses[addressIndex];
411
+ recipientsWithValues = recipients.map(function (recipient, index) { return [recipient, values[index]]; });
412
+ return [4 /*yield*/, this.contract.createContractCall(TezosFA2ContractEntrypoint.TRANSFER, [
413
+ {
414
+ from_: fromAddress,
415
+ txs: recipientsWithValues.map(function (_a) {
416
+ var recipient = _a[0], value = _a[1];
417
+ return {
418
+ to_: recipient,
419
+ token_id: tokenID,
420
+ amount: value
421
+ };
422
+ })
423
+ }
424
+ ])];
425
+ case 2:
426
+ transferCall = _d.sent();
427
+ return [2 /*return*/, transferCall];
428
+ }
429
+ });
430
+ });
431
+ };
432
+ TezosFA2Protocol.prototype.callbackContract = function (entrypoint) {
433
+ var networkCallbacks = this.defaultCallbackContract[this.options.network.extras.network];
434
+ var callback = networkCallbacks ? networkCallbacks[entrypoint] : undefined;
435
+ return callback !== null && callback !== void 0 ? callback : '';
436
+ };
437
+ TezosFA2Protocol.prototype.isTransferRequest = function (obj) {
438
+ var anyObj = obj;
439
+ return (anyObj instanceof Object &&
440
+ typeof anyObj.from_ === 'string' &&
441
+ Array.isArray(anyObj.txs) &&
442
+ anyObj.txs.every(function (tx) {
443
+ return tx instanceof Object && typeof tx.to_ === 'string' && bignumber_1.default.isBigNumber(tx.token_id) && bignumber_1.default.isBigNumber(tx.amount);
444
+ }));
445
+ };
446
+ return TezosFA2Protocol;
447
+ }(TezosFAProtocol_1.TezosFAProtocol));
448
+ exports.TezosFA2Protocol = TezosFA2Protocol;
449
+ //# sourceMappingURL=TezosFA2Protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TezosFA2Protocol.js","sourceRoot":"","sources":["../../../src/protocol/fa/TezosFA2Protocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iHAA0F;AAC1F,sDAAoF;AACpF,2EAAkE;AAElE,sDAAsD;AAItD,kDAA+C;AAC/C,4CAA0C;AAQ1C,2EAAyE;AACzE,2EAAyE;AACzE,mFAAiF;AACjF,2EAAyE;AACzE,iFAA+E;AAG/E,kEAAgE;AAChE,wCAA2G;AAE3G,qDAAmD;AAGnD,IAAK,0BAIJ;AAJD,WAAK,0BAA0B;IAC7B,oDAAsB,CAAA;IACtB,mDAAqB,CAAA;IACrB,mEAAqC,CAAA;AACvC,CAAC,EAJI,0BAA0B,KAA1B,0BAA0B,QAI9B;AAED;IAAsC,oCAAe;IAKnD,0BAA4B,OAAgC;;QAA5D,YACE,kBAAM,OAAO,CAAC,SAYf;QAb2B,aAAO,GAAP,OAAO,CAAyB;QAG1D,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC,M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,CAAC;YAA5H,CAA4H,CAC/H,CACF,CAAA;IACH,CAAC;IACH,uBAAC;AAAD,CAAC,AApWD,CAAsC,iCAAe,GAoWpD;AApWY,4CAAgB"}
@@ -0,0 +1,65 @@
1
+ import { FeeDefaults, ICoinSubProtocol, SubProtocolType } from '@airgap/coinlib-core';
2
+ import { IAirGapTransaction } from '@airgap/coinlib-core/interfaces/IAirGapTransaction';
3
+ import { ProtocolSymbols } from '@airgap/coinlib-core/utils/ProtocolSymbols';
4
+ import { RemoteDataFactory } from '@airgap/coinlib-core/utils/remote-data/RemoteDataFactory';
5
+ import { RawTezosTransaction } from '../../types/transaction-tezos';
6
+ import { TezosContract } from '../contract/TezosContract';
7
+ import { TezosContractCall } from '../contract/TezosContractCall';
8
+ import { TezosProtocol } from '../TezosProtocol';
9
+ import { TezosProtocolNetworkResolver } from '../TezosProtocolOptions';
10
+ import { TezosContractMetadata } from '../types/contract/TezosContractMetadata';
11
+ import { TezosFATokenMetadata } from '../types/fa/TezosFATokenMetadata';
12
+ import { MichelineDataNode, MichelineNode } from '../types/micheline/MichelineNode';
13
+ import { TezosTransactionOperation, TezosTransactionParameters } from '../types/operations/Transaction';
14
+ import { TezosTransactionCursor } from '../types/TezosTransactionCursor';
15
+ import { TezosTransactionResult } from '../types/TezosTransactionResult';
16
+ import { TezosNetwork } from './../TezosProtocol';
17
+ import { TezosFAProtocolOptions } from './TezosFAProtocolOptions';
18
+ export interface TezosFAProtocolConfiguration {
19
+ symbol: string;
20
+ name: string;
21
+ marketSymbol: string;
22
+ identifier: ProtocolSymbols;
23
+ contractAddress: string;
24
+ feeDefaults: FeeDefaults;
25
+ decimals?: number;
26
+ jsonRPCAPI?: string;
27
+ baseApiUrl?: string;
28
+ network?: TezosNetwork;
29
+ baseApiKey?: string;
30
+ baseApiNetwork?: string;
31
+ }
32
+ export declare abstract class TezosFAProtocol extends TezosProtocol implements ICoinSubProtocol {
33
+ readonly options: TezosFAProtocolOptions;
34
+ readonly isSubProtocol: boolean;
35
+ readonly subProtocolType: SubProtocolType;
36
+ readonly contractAddress: string;
37
+ readonly tokenMetadataBigMapID?: number;
38
+ readonly contract: TezosContract;
39
+ readonly defaultSourceAddress: string;
40
+ readonly remoteDataFactory: RemoteDataFactory;
41
+ constructor(options: TezosFAProtocolOptions);
42
+ getIsSubProtocol(): Promise<boolean>;
43
+ getSubProtocolType(): Promise<SubProtocolType>;
44
+ getContractAddress(): Promise<string | undefined>;
45
+ getOptions(): Promise<TezosFAProtocolOptions>;
46
+ abstract transactionDetailsFromParameters(parameters: TezosTransactionParameters): Partial<IAirGapTransaction>[];
47
+ bigMapValue(key: string, isKeyHash?: boolean, bigMapID?: number): Promise<MichelineNode | null>;
48
+ contractMetadata(networkResolver?: TezosProtocolNetworkResolver): Promise<TezosContractMetadata | undefined>;
49
+ estimateMaxTransactionValueFromPublicKey(publicKey: string, recipients: string[], fee?: string, data?: any): Promise<string>;
50
+ getTransactionsFromPublicKey(publicKey: string, limit: number, cursor?: TezosTransactionCursor): Promise<TezosTransactionResult>;
51
+ getTransactionsFromAddresses(addresses: string[], limit: number, cursor?: TezosTransactionCursor): Promise<TezosTransactionResult>;
52
+ getTransactions(limit: number, cursor?: TezosTransactionCursor): Promise<TezosTransactionResult>;
53
+ normalizeTransactionParameters(parameters: string, fallbackEntrypointName?: string): Promise<TezosTransactionParameters>;
54
+ getAllTokenMetadata(): Promise<Record<number, TezosFATokenMetadata> | undefined>;
55
+ protected getTokenMetadataForTokenID(tokenID: number): Promise<TezosFATokenMetadata | undefined>;
56
+ private createRemoteData;
57
+ protected getTransactionOperationDetails(transactionOperation: TezosTransactionOperation): Promise<Partial<IAirGapTransaction>[]>;
58
+ private parseParameters;
59
+ protected runContractCall(contractCall: TezosContractCall, source: string): Promise<MichelineDataNode>;
60
+ protected prepareContractCall(contractCalls: TezosContractCall[], fee: string, publicKey: string): Promise<RawTezosTransaction>;
61
+ protected requireSource(source?: string, defaultSource?: string, ...excludedPrefixes: string[]): string;
62
+ private prepareMockContractCall;
63
+ private url;
64
+ private isTokenMetadata;
65
+ }