@ledgerhq/coin-aptos 3.4.0 → 3.4.1-nightly.0

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 (298) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.json +6 -6
  3. package/lib/__tests__/api/craftTransaction.unit.test.d.ts +0 -2
  4. package/lib/__tests__/api/craftTransaction.unit.test.d.ts.map +0 -1
  5. package/lib/__tests__/api/craftTransaction.unit.test.js +0 -177
  6. package/lib/__tests__/api/craftTransaction.unit.test.js.map +0 -1
  7. package/lib/__tests__/api/getBalance.unit.test.d.ts +0 -2
  8. package/lib/__tests__/api/getBalance.unit.test.d.ts.map +0 -1
  9. package/lib/__tests__/api/getBalance.unit.test.js +0 -80
  10. package/lib/__tests__/api/getBalance.unit.test.js.map +0 -1
  11. package/lib/__tests__/api/index.integ.test.d.ts +0 -2
  12. package/lib/__tests__/api/index.integ.test.d.ts.map +0 -1
  13. package/lib/__tests__/api/index.integ.test.js +0 -340
  14. package/lib/__tests__/api/index.integ.test.js.map +0 -1
  15. package/lib/__tests__/api/index.test.d.ts +0 -2
  16. package/lib/__tests__/api/index.test.d.ts.map +0 -1
  17. package/lib/__tests__/api/index.test.js +0 -66
  18. package/lib/__tests__/api/index.test.js.map +0 -1
  19. package/lib/__tests__/bridge/broadcast.test.d.ts +0 -2
  20. package/lib/__tests__/bridge/broadcast.test.d.ts.map +0 -1
  21. package/lib/__tests__/bridge/broadcast.test.js +0 -92
  22. package/lib/__tests__/bridge/broadcast.test.js.map +0 -1
  23. package/lib/__tests__/bridge/deviceTransactionConfig.test.d.ts +0 -2
  24. package/lib/__tests__/bridge/deviceTransactionConfig.test.d.ts.map +0 -1
  25. package/lib/__tests__/bridge/deviceTransactionConfig.test.js +0 -128
  26. package/lib/__tests__/bridge/deviceTransactionConfig.test.js.map +0 -1
  27. package/lib/__tests__/bridge/estimateMaxSpendable.test.d.ts +0 -2
  28. package/lib/__tests__/bridge/estimateMaxSpendable.test.d.ts.map +0 -1
  29. package/lib/__tests__/bridge/estimateMaxSpendable.test.js +0 -75
  30. package/lib/__tests__/bridge/estimateMaxSpendable.test.js.map +0 -1
  31. package/lib/__tests__/bridge/getFeesForTransaction.test.d.ts +0 -2
  32. package/lib/__tests__/bridge/getFeesForTransaction.test.d.ts.map +0 -1
  33. package/lib/__tests__/bridge/getFeesForTransaction.test.js +0 -280
  34. package/lib/__tests__/bridge/getFeesForTransaction.test.js.map +0 -1
  35. package/lib/__tests__/bridge/getTransactionStatus.test.d.ts +0 -2
  36. package/lib/__tests__/bridge/getTransactionStatus.test.d.ts.map +0 -1
  37. package/lib/__tests__/bridge/getTransactionStatus.test.js +0 -453
  38. package/lib/__tests__/bridge/getTransactionStatus.test.js.map +0 -1
  39. package/lib/__tests__/bridge/index.test.d.ts +0 -2
  40. package/lib/__tests__/bridge/index.test.d.ts.map +0 -1
  41. package/lib/__tests__/bridge/index.test.js +0 -110
  42. package/lib/__tests__/bridge/index.test.js.map +0 -1
  43. package/lib/__tests__/bridge/logic.test.d.ts +0 -2
  44. package/lib/__tests__/bridge/logic.test.d.ts.map +0 -1
  45. package/lib/__tests__/bridge/logic.test.js +0 -997
  46. package/lib/__tests__/bridge/logic.test.js.map +0 -1
  47. package/lib/__tests__/bridge/prepareTransaction.test.d.ts +0 -2
  48. package/lib/__tests__/bridge/prepareTransaction.test.d.ts.map +0 -1
  49. package/lib/__tests__/bridge/prepareTransaction.test.js +0 -109
  50. package/lib/__tests__/bridge/prepareTransaction.test.js.map +0 -1
  51. package/lib/__tests__/bridge/serialization.d.ts +0 -2
  52. package/lib/__tests__/bridge/serialization.d.ts.map +0 -1
  53. package/lib/__tests__/bridge/serialization.js +0 -91
  54. package/lib/__tests__/bridge/serialization.js.map +0 -1
  55. package/lib/__tests__/bridge/signOperation.test.d.ts +0 -2
  56. package/lib/__tests__/bridge/signOperation.test.d.ts.map +0 -1
  57. package/lib/__tests__/bridge/signOperation.test.js +0 -299
  58. package/lib/__tests__/bridge/signOperation.test.js.map +0 -1
  59. package/lib/__tests__/bridge/synchronisation.test.d.ts +0 -2
  60. package/lib/__tests__/bridge/synchronisation.test.d.ts.map +0 -1
  61. package/lib/__tests__/bridge/synchronisation.test.js +0 -2226
  62. package/lib/__tests__/bridge/synchronisation.test.js.map +0 -1
  63. package/lib/__tests__/bridge/transaction.test.d.ts +0 -2
  64. package/lib/__tests__/bridge/transaction.test.d.ts.map +0 -1
  65. package/lib/__tests__/bridge/transaction.test.js +0 -221
  66. package/lib/__tests__/bridge/transaction.test.js.map +0 -1
  67. package/lib/__tests__/errors.test.d.ts +0 -2
  68. package/lib/__tests__/errors.test.d.ts.map +0 -1
  69. package/lib/__tests__/errors.test.js +0 -18
  70. package/lib/__tests__/errors.test.js.map +0 -1
  71. package/lib/__tests__/index.test.d.ts +0 -2
  72. package/lib/__tests__/index.test.d.ts.map +0 -1
  73. package/lib/__tests__/index.test.js +0 -27
  74. package/lib/__tests__/index.test.js.map +0 -1
  75. package/lib/__tests__/logic/buildTransaction.test.d.ts +0 -2
  76. package/lib/__tests__/logic/buildTransaction.test.d.ts.map +0 -1
  77. package/lib/__tests__/logic/buildTransaction.test.js +0 -114
  78. package/lib/__tests__/logic/buildTransaction.test.js.map +0 -1
  79. package/lib/__tests__/logic/calculateAmount.unit.test.d.ts +0 -2
  80. package/lib/__tests__/logic/calculateAmount.unit.test.d.ts.map +0 -1
  81. package/lib/__tests__/logic/calculateAmount.unit.test.js +0 -45
  82. package/lib/__tests__/logic/calculateAmount.unit.test.js.map +0 -1
  83. package/lib/__tests__/logic/combine.unit.test.d.ts +0 -2
  84. package/lib/__tests__/logic/combine.unit.test.d.ts.map +0 -1
  85. package/lib/__tests__/logic/combine.unit.test.js +0 -47
  86. package/lib/__tests__/logic/combine.unit.test.js.map +0 -1
  87. package/lib/__tests__/logic/compareAddress.unit.test.d.ts +0 -2
  88. package/lib/__tests__/logic/compareAddress.unit.test.d.ts.map +0 -1
  89. package/lib/__tests__/logic/compareAddress.unit.test.js +0 -26
  90. package/lib/__tests__/logic/compareAddress.unit.test.js.map +0 -1
  91. package/lib/__tests__/logic/createTransaction.test.d.ts +0 -2
  92. package/lib/__tests__/logic/createTransaction.test.d.ts.map +0 -1
  93. package/lib/__tests__/logic/createTransaction.test.js +0 -29
  94. package/lib/__tests__/logic/createTransaction.test.js.map +0 -1
  95. package/lib/__tests__/logic/getBalances.test.d.ts +0 -2
  96. package/lib/__tests__/logic/getBalances.test.d.ts.map +0 -1
  97. package/lib/__tests__/logic/getBalances.test.js +0 -62
  98. package/lib/__tests__/logic/getBalances.test.js.map +0 -1
  99. package/lib/__tests__/logic/getCoinAndAmounts.unit.test.d.ts +0 -2
  100. package/lib/__tests__/logic/getCoinAndAmounts.unit.test.d.ts.map +0 -1
  101. package/lib/__tests__/logic/getCoinAndAmounts.unit.test.js +0 -186
  102. package/lib/__tests__/logic/getCoinAndAmounts.unit.test.js.map +0 -1
  103. package/lib/__tests__/logic/getFunctionAddress.unit.test.d.ts +0 -2
  104. package/lib/__tests__/logic/getFunctionAddress.unit.test.d.ts.map +0 -1
  105. package/lib/__tests__/logic/getFunctionAddress.unit.test.js +0 -29
  106. package/lib/__tests__/logic/getFunctionAddress.unit.test.js.map +0 -1
  107. package/lib/__tests__/logic/getResourceAddress.unit.test.d.ts +0 -2
  108. package/lib/__tests__/logic/getResourceAddress.unit.test.d.ts.map +0 -1
  109. package/lib/__tests__/logic/getResourceAddress.unit.test.js +0 -218
  110. package/lib/__tests__/logic/getResourceAddress.unit.test.js.map +0 -1
  111. package/lib/__tests__/logic/isTestnet.unit.test.d.ts +0 -2
  112. package/lib/__tests__/logic/isTestnet.unit.test.d.ts.map +0 -1
  113. package/lib/__tests__/logic/isTestnet.unit.test.js +0 -12
  114. package/lib/__tests__/logic/isTestnet.unit.test.js.map +0 -1
  115. package/lib/__tests__/logic/normalizeAddress.unit.test.d.ts +0 -2
  116. package/lib/__tests__/logic/normalizeAddress.unit.test.d.ts.map +0 -1
  117. package/lib/__tests__/logic/normalizeAddress.unit.test.js +0 -12
  118. package/lib/__tests__/logic/normalizeAddress.unit.test.js.map +0 -1
  119. package/lib/__tests__/logic/processRecipients.unit.test.d.ts +0 -2
  120. package/lib/__tests__/logic/processRecipients.unit.test.d.ts.map +0 -1
  121. package/lib/__tests__/logic/processRecipients.unit.test.js +0 -79
  122. package/lib/__tests__/logic/processRecipients.unit.test.js.map +0 -1
  123. package/lib/__tests__/logic/staking.test.d.ts +0 -2
  124. package/lib/__tests__/logic/staking.test.d.ts.map +0 -1
  125. package/lib/__tests__/logic/staking.test.js +0 -202
  126. package/lib/__tests__/logic/staking.test.js.map +0 -1
  127. package/lib/__tests__/network/client.test.d.ts +0 -2
  128. package/lib/__tests__/network/client.test.d.ts.map +0 -1
  129. package/lib/__tests__/network/client.test.js +0 -1179
  130. package/lib/__tests__/network/client.test.js.map +0 -1
  131. package/lib/__tests__/network/index.test.d.ts +0 -2
  132. package/lib/__tests__/network/index.test.d.ts.map +0 -1
  133. package/lib/__tests__/network/index.test.js +0 -51
  134. package/lib/__tests__/network/index.test.js.map +0 -1
  135. package/lib/__tests__/network/validators.test.d.ts +0 -2
  136. package/lib/__tests__/network/validators.test.d.ts.map +0 -1
  137. package/lib/__tests__/network/validators.test.js +0 -102
  138. package/lib/__tests__/network/validators.test.js.map +0 -1
  139. package/lib/__tests__/signer/index.test.d.ts +0 -2
  140. package/lib/__tests__/signer/index.test.d.ts.map +0 -1
  141. package/lib/__tests__/signer/index.test.js +0 -26
  142. package/lib/__tests__/signer/index.test.js.map +0 -1
  143. package/lib/__tests__/utils/IconGenerator.test.d.ts +0 -2
  144. package/lib/__tests__/utils/IconGenerator.test.d.ts.map +0 -1
  145. package/lib/__tests__/utils/IconGenerator.test.js +0 -14
  146. package/lib/__tests__/utils/IconGenerator.test.js.map +0 -1
  147. package/lib/__tests__/utils/index.test.d.ts +0 -2
  148. package/lib/__tests__/utils/index.test.d.ts.map +0 -1
  149. package/lib/__tests__/utils/index.test.js +0 -11
  150. package/lib/__tests__/utils/index.test.js.map +0 -1
  151. package/lib-es/__tests__/api/craftTransaction.unit.test.d.ts +0 -2
  152. package/lib-es/__tests__/api/craftTransaction.unit.test.d.ts.map +0 -1
  153. package/lib-es/__tests__/api/craftTransaction.unit.test.js +0 -175
  154. package/lib-es/__tests__/api/craftTransaction.unit.test.js.map +0 -1
  155. package/lib-es/__tests__/api/getBalance.unit.test.d.ts +0 -2
  156. package/lib-es/__tests__/api/getBalance.unit.test.d.ts.map +0 -1
  157. package/lib-es/__tests__/api/getBalance.unit.test.js +0 -78
  158. package/lib-es/__tests__/api/getBalance.unit.test.js.map +0 -1
  159. package/lib-es/__tests__/api/index.integ.test.d.ts +0 -2
  160. package/lib-es/__tests__/api/index.integ.test.d.ts.map +0 -1
  161. package/lib-es/__tests__/api/index.integ.test.js +0 -338
  162. package/lib-es/__tests__/api/index.integ.test.js.map +0 -1
  163. package/lib-es/__tests__/api/index.test.d.ts +0 -2
  164. package/lib-es/__tests__/api/index.test.d.ts.map +0 -1
  165. package/lib-es/__tests__/api/index.test.js +0 -61
  166. package/lib-es/__tests__/api/index.test.js.map +0 -1
  167. package/lib-es/__tests__/bridge/broadcast.test.d.ts +0 -2
  168. package/lib-es/__tests__/bridge/broadcast.test.d.ts.map +0 -1
  169. package/lib-es/__tests__/bridge/broadcast.test.js +0 -87
  170. package/lib-es/__tests__/bridge/broadcast.test.js.map +0 -1
  171. package/lib-es/__tests__/bridge/deviceTransactionConfig.test.d.ts +0 -2
  172. package/lib-es/__tests__/bridge/deviceTransactionConfig.test.d.ts.map +0 -1
  173. package/lib-es/__tests__/bridge/deviceTransactionConfig.test.js +0 -123
  174. package/lib-es/__tests__/bridge/deviceTransactionConfig.test.js.map +0 -1
  175. package/lib-es/__tests__/bridge/estimateMaxSpendable.test.d.ts +0 -2
  176. package/lib-es/__tests__/bridge/estimateMaxSpendable.test.d.ts.map +0 -1
  177. package/lib-es/__tests__/bridge/estimateMaxSpendable.test.js +0 -70
  178. package/lib-es/__tests__/bridge/estimateMaxSpendable.test.js.map +0 -1
  179. package/lib-es/__tests__/bridge/getFeesForTransaction.test.d.ts +0 -2
  180. package/lib-es/__tests__/bridge/getFeesForTransaction.test.d.ts.map +0 -1
  181. package/lib-es/__tests__/bridge/getFeesForTransaction.test.js +0 -252
  182. package/lib-es/__tests__/bridge/getFeesForTransaction.test.js.map +0 -1
  183. package/lib-es/__tests__/bridge/getTransactionStatus.test.d.ts +0 -2
  184. package/lib-es/__tests__/bridge/getTransactionStatus.test.d.ts.map +0 -1
  185. package/lib-es/__tests__/bridge/getTransactionStatus.test.js +0 -448
  186. package/lib-es/__tests__/bridge/getTransactionStatus.test.js.map +0 -1
  187. package/lib-es/__tests__/bridge/index.test.d.ts +0 -2
  188. package/lib-es/__tests__/bridge/index.test.d.ts.map +0 -1
  189. package/lib-es/__tests__/bridge/index.test.js +0 -105
  190. package/lib-es/__tests__/bridge/index.test.js.map +0 -1
  191. package/lib-es/__tests__/bridge/logic.test.d.ts +0 -2
  192. package/lib-es/__tests__/bridge/logic.test.d.ts.map +0 -1
  193. package/lib-es/__tests__/bridge/logic.test.js +0 -992
  194. package/lib-es/__tests__/bridge/logic.test.js.map +0 -1
  195. package/lib-es/__tests__/bridge/prepareTransaction.test.d.ts +0 -2
  196. package/lib-es/__tests__/bridge/prepareTransaction.test.d.ts.map +0 -1
  197. package/lib-es/__tests__/bridge/prepareTransaction.test.js +0 -104
  198. package/lib-es/__tests__/bridge/prepareTransaction.test.js.map +0 -1
  199. package/lib-es/__tests__/bridge/serialization.d.ts +0 -2
  200. package/lib-es/__tests__/bridge/serialization.d.ts.map +0 -1
  201. package/lib-es/__tests__/bridge/serialization.js +0 -86
  202. package/lib-es/__tests__/bridge/serialization.js.map +0 -1
  203. package/lib-es/__tests__/bridge/signOperation.test.d.ts +0 -2
  204. package/lib-es/__tests__/bridge/signOperation.test.d.ts.map +0 -1
  205. package/lib-es/__tests__/bridge/signOperation.test.js +0 -271
  206. package/lib-es/__tests__/bridge/signOperation.test.js.map +0 -1
  207. package/lib-es/__tests__/bridge/synchronisation.test.d.ts +0 -2
  208. package/lib-es/__tests__/bridge/synchronisation.test.d.ts.map +0 -1
  209. package/lib-es/__tests__/bridge/synchronisation.test.js +0 -2221
  210. package/lib-es/__tests__/bridge/synchronisation.test.js.map +0 -1
  211. package/lib-es/__tests__/bridge/transaction.test.d.ts +0 -2
  212. package/lib-es/__tests__/bridge/transaction.test.d.ts.map +0 -1
  213. package/lib-es/__tests__/bridge/transaction.test.js +0 -216
  214. package/lib-es/__tests__/bridge/transaction.test.js.map +0 -1
  215. package/lib-es/__tests__/errors.test.d.ts +0 -2
  216. package/lib-es/__tests__/errors.test.d.ts.map +0 -1
  217. package/lib-es/__tests__/errors.test.js +0 -16
  218. package/lib-es/__tests__/errors.test.js.map +0 -1
  219. package/lib-es/__tests__/index.test.d.ts +0 -2
  220. package/lib-es/__tests__/index.test.d.ts.map +0 -1
  221. package/lib-es/__tests__/index.test.js +0 -25
  222. package/lib-es/__tests__/index.test.js.map +0 -1
  223. package/lib-es/__tests__/logic/buildTransaction.test.d.ts +0 -2
  224. package/lib-es/__tests__/logic/buildTransaction.test.d.ts.map +0 -1
  225. package/lib-es/__tests__/logic/buildTransaction.test.js +0 -109
  226. package/lib-es/__tests__/logic/buildTransaction.test.js.map +0 -1
  227. package/lib-es/__tests__/logic/calculateAmount.unit.test.d.ts +0 -2
  228. package/lib-es/__tests__/logic/calculateAmount.unit.test.d.ts.map +0 -1
  229. package/lib-es/__tests__/logic/calculateAmount.unit.test.js +0 -40
  230. package/lib-es/__tests__/logic/calculateAmount.unit.test.js.map +0 -1
  231. package/lib-es/__tests__/logic/combine.unit.test.d.ts +0 -2
  232. package/lib-es/__tests__/logic/combine.unit.test.d.ts.map +0 -1
  233. package/lib-es/__tests__/logic/combine.unit.test.js +0 -45
  234. package/lib-es/__tests__/logic/combine.unit.test.js.map +0 -1
  235. package/lib-es/__tests__/logic/compareAddress.unit.test.d.ts +0 -2
  236. package/lib-es/__tests__/logic/compareAddress.unit.test.d.ts.map +0 -1
  237. package/lib-es/__tests__/logic/compareAddress.unit.test.js +0 -24
  238. package/lib-es/__tests__/logic/compareAddress.unit.test.js.map +0 -1
  239. package/lib-es/__tests__/logic/createTransaction.test.d.ts +0 -2
  240. package/lib-es/__tests__/logic/createTransaction.test.d.ts.map +0 -1
  241. package/lib-es/__tests__/logic/createTransaction.test.js +0 -24
  242. package/lib-es/__tests__/logic/createTransaction.test.js.map +0 -1
  243. package/lib-es/__tests__/logic/getBalances.test.d.ts +0 -2
  244. package/lib-es/__tests__/logic/getBalances.test.d.ts.map +0 -1
  245. package/lib-es/__tests__/logic/getBalances.test.js +0 -60
  246. package/lib-es/__tests__/logic/getBalances.test.js.map +0 -1
  247. package/lib-es/__tests__/logic/getCoinAndAmounts.unit.test.d.ts +0 -2
  248. package/lib-es/__tests__/logic/getCoinAndAmounts.unit.test.d.ts.map +0 -1
  249. package/lib-es/__tests__/logic/getCoinAndAmounts.unit.test.js +0 -181
  250. package/lib-es/__tests__/logic/getCoinAndAmounts.unit.test.js.map +0 -1
  251. package/lib-es/__tests__/logic/getFunctionAddress.unit.test.d.ts +0 -2
  252. package/lib-es/__tests__/logic/getFunctionAddress.unit.test.d.ts.map +0 -1
  253. package/lib-es/__tests__/logic/getFunctionAddress.unit.test.js +0 -27
  254. package/lib-es/__tests__/logic/getFunctionAddress.unit.test.js.map +0 -1
  255. package/lib-es/__tests__/logic/getResourceAddress.unit.test.d.ts +0 -2
  256. package/lib-es/__tests__/logic/getResourceAddress.unit.test.d.ts.map +0 -1
  257. package/lib-es/__tests__/logic/getResourceAddress.unit.test.js +0 -216
  258. package/lib-es/__tests__/logic/getResourceAddress.unit.test.js.map +0 -1
  259. package/lib-es/__tests__/logic/isTestnet.unit.test.d.ts +0 -2
  260. package/lib-es/__tests__/logic/isTestnet.unit.test.d.ts.map +0 -1
  261. package/lib-es/__tests__/logic/isTestnet.unit.test.js +0 -10
  262. package/lib-es/__tests__/logic/isTestnet.unit.test.js.map +0 -1
  263. package/lib-es/__tests__/logic/normalizeAddress.unit.test.d.ts +0 -2
  264. package/lib-es/__tests__/logic/normalizeAddress.unit.test.d.ts.map +0 -1
  265. package/lib-es/__tests__/logic/normalizeAddress.unit.test.js +0 -10
  266. package/lib-es/__tests__/logic/normalizeAddress.unit.test.js.map +0 -1
  267. package/lib-es/__tests__/logic/processRecipients.unit.test.d.ts +0 -2
  268. package/lib-es/__tests__/logic/processRecipients.unit.test.d.ts.map +0 -1
  269. package/lib-es/__tests__/logic/processRecipients.unit.test.js +0 -74
  270. package/lib-es/__tests__/logic/processRecipients.unit.test.js.map +0 -1
  271. package/lib-es/__tests__/logic/staking.test.d.ts +0 -2
  272. package/lib-es/__tests__/logic/staking.test.d.ts.map +0 -1
  273. package/lib-es/__tests__/logic/staking.test.js +0 -197
  274. package/lib-es/__tests__/logic/staking.test.js.map +0 -1
  275. package/lib-es/__tests__/network/client.test.d.ts +0 -2
  276. package/lib-es/__tests__/network/client.test.d.ts.map +0 -1
  277. package/lib-es/__tests__/network/client.test.js +0 -1174
  278. package/lib-es/__tests__/network/client.test.js.map +0 -1
  279. package/lib-es/__tests__/network/index.test.d.ts +0 -2
  280. package/lib-es/__tests__/network/index.test.d.ts.map +0 -1
  281. package/lib-es/__tests__/network/index.test.js +0 -49
  282. package/lib-es/__tests__/network/index.test.js.map +0 -1
  283. package/lib-es/__tests__/network/validators.test.d.ts +0 -2
  284. package/lib-es/__tests__/network/validators.test.d.ts.map +0 -1
  285. package/lib-es/__tests__/network/validators.test.js +0 -97
  286. package/lib-es/__tests__/network/validators.test.js.map +0 -1
  287. package/lib-es/__tests__/signer/index.test.d.ts +0 -2
  288. package/lib-es/__tests__/signer/index.test.d.ts.map +0 -1
  289. package/lib-es/__tests__/signer/index.test.js +0 -21
  290. package/lib-es/__tests__/signer/index.test.js.map +0 -1
  291. package/lib-es/__tests__/utils/IconGenerator.test.d.ts +0 -2
  292. package/lib-es/__tests__/utils/IconGenerator.test.d.ts.map +0 -1
  293. package/lib-es/__tests__/utils/IconGenerator.test.js +0 -12
  294. package/lib-es/__tests__/utils/IconGenerator.test.js.map +0 -1
  295. package/lib-es/__tests__/utils/index.test.d.ts +0 -2
  296. package/lib-es/__tests__/utils/index.test.d.ts.map +0 -1
  297. package/lib-es/__tests__/utils/index.test.js +0 -9
  298. package/lib-es/__tests__/utils/index.test.js.map +0 -1
@@ -1,997 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const bignumber_js_1 = __importDefault(require("bignumber.js"));
7
- const constants_1 = require("../../constants");
8
- const logic_1 = require("../../bridge/logic");
9
- const bridge_fixture_1 = require("../../bridge/bridge.fixture");
10
- const cryptoassets_1 = require("@ledgerhq/cryptoassets");
11
- const index_1 = require("@ledgerhq/coin-framework/account/index");
12
- const normalizeTransactionOptions_1 = require("../../logic/normalizeTransactionOptions");
13
- jest.mock("@ledgerhq/cryptoassets");
14
- jest.mock("@ledgerhq/coin-framework/account/index");
15
- describe("Aptos logic ", () => {
16
- describe("getMaxSendBalance", () => {
17
- it("should return the correct max send balance when amount is greater than total gas", () => {
18
- const amount = new bignumber_js_1.default(1000000);
19
- const account = (0, bridge_fixture_1.createFixtureAccount)({ balance: amount, spendableBalance: amount });
20
- const transaction = (0, bridge_fixture_1.createFixtureTransaction)();
21
- const gas = new bignumber_js_1.default(200);
22
- const gasPrice = new bignumber_js_1.default(100);
23
- const result = (0, logic_1.getMaxSendBalance)(account, transaction, gas, gasPrice);
24
- expect(result.isEqualTo(amount.minus(gas.multipliedBy(gasPrice)))).toBe(true);
25
- });
26
- it("should return zero when amount is less than total gas", () => {
27
- const account = (0, bridge_fixture_1.createFixtureAccount)();
28
- const transaction = (0, bridge_fixture_1.createFixtureTransaction)();
29
- const gas = new bignumber_js_1.default(200);
30
- const gasPrice = new bignumber_js_1.default(100);
31
- const result = (0, logic_1.getMaxSendBalance)(account, transaction, gas, gasPrice);
32
- expect(result.isEqualTo(new bignumber_js_1.default(0))).toBe(true);
33
- });
34
- it("should return zero when amount is equal to total gas", () => {
35
- const account = (0, bridge_fixture_1.createFixtureAccount)();
36
- const transaction = (0, bridge_fixture_1.createFixtureTransaction)();
37
- const gas = new bignumber_js_1.default(200);
38
- const gasPrice = new bignumber_js_1.default(100);
39
- const result = (0, logic_1.getMaxSendBalance)(account, transaction, gas, gasPrice);
40
- expect(result.isEqualTo(new bignumber_js_1.default(0))).toBe(true);
41
- });
42
- it("should handle zero amount", () => {
43
- const account = (0, bridge_fixture_1.createFixtureAccount)();
44
- const transaction = (0, bridge_fixture_1.createFixtureTransaction)();
45
- const gas = new bignumber_js_1.default(200);
46
- const gasPrice = new bignumber_js_1.default(100);
47
- const result = (0, logic_1.getMaxSendBalance)(account, transaction, gas, gasPrice);
48
- expect(result.isEqualTo(new bignumber_js_1.default(0))).toBe(true);
49
- });
50
- it("should handle zero gas and gas price", () => {
51
- const amount = new bignumber_js_1.default(1000000);
52
- const account = (0, bridge_fixture_1.createFixtureAccount)({ balance: amount, spendableBalance: amount });
53
- const transaction = (0, bridge_fixture_1.createFixtureTransaction)();
54
- const gas = new bignumber_js_1.default(0);
55
- const gasPrice = new bignumber_js_1.default(0);
56
- const result = (0, logic_1.getMaxSendBalance)(account, transaction, gas, gasPrice);
57
- expect(result.isEqualTo(amount)).toBe(true);
58
- });
59
- });
60
- describe("normalizeTransactionOptions", () => {
61
- it("should normalize transaction options", () => {
62
- const options = {
63
- maxGasAmount: "1000",
64
- gasUnitPrice: "10",
65
- };
66
- const result = (0, normalizeTransactionOptions_1.normalizeTransactionOptions)(options);
67
- expect(result).toEqual(options);
68
- });
69
- it("should return undefined for empty values", () => {
70
- const options = {
71
- maxGasAmount: "",
72
- gasUnitPrice: "",
73
- };
74
- const result = (0, normalizeTransactionOptions_1.normalizeTransactionOptions)(options);
75
- expect(result).toEqual({
76
- maxGasAmount: undefined,
77
- gasUnitPrice: undefined,
78
- });
79
- });
80
- });
81
- describe("getBlankOperation", () => {
82
- it("should return a blank operation", () => {
83
- const tx = {
84
- hash: "0x123",
85
- block: { hash: "0xabc", height: 1 },
86
- timestamp: "1000000",
87
- sequence_number: "1",
88
- version: "1",
89
- };
90
- const id = "test_id";
91
- const result = (0, logic_1.getBlankOperation)(tx, id);
92
- expect(result).toEqual({
93
- id: "",
94
- hash: "0x123",
95
- type: "",
96
- value: new bignumber_js_1.default(0),
97
- fee: new bignumber_js_1.default(0),
98
- blockHash: "0xabc",
99
- blockHeight: 1,
100
- senders: [],
101
- recipients: [],
102
- accountId: id,
103
- date: new Date(1000),
104
- extra: { version: "1" },
105
- transactionSequenceNumber: 1,
106
- hasFailed: false,
107
- });
108
- });
109
- it("should return a blank operation even when some transaction fields are missing", () => {
110
- const tx = {
111
- hash: "0x123",
112
- timestamp: "1000000",
113
- sequence_number: "1",
114
- };
115
- const id = "test_id";
116
- const result = (0, logic_1.getBlankOperation)(tx, id);
117
- expect(result).toEqual({
118
- id: "",
119
- hash: "0x123",
120
- type: "",
121
- value: new bignumber_js_1.default(0),
122
- fee: new bignumber_js_1.default(0),
123
- blockHash: undefined,
124
- blockHeight: undefined,
125
- senders: [],
126
- recipients: [],
127
- accountId: id,
128
- date: new Date(1000),
129
- extra: { version: undefined },
130
- transactionSequenceNumber: 1,
131
- hasFailed: false,
132
- });
133
- });
134
- });
135
- });
136
- describe("Aptos sync logic ", () => {
137
- describe("txsToOps", () => {
138
- it("should convert Aptos transactions to operations correctly", () => {
139
- const address = "0x11";
140
- const id = "test_id";
141
- const txs = [
142
- {
143
- hash: "0x123",
144
- sender: "0x11",
145
- gas_used: "200",
146
- gas_unit_price: "100",
147
- success: true,
148
- payload: {
149
- type: "entry_function_payload",
150
- function: "0x1::coin::transfer",
151
- type_arguments: [],
152
- arguments: ["0x12", 100],
153
- },
154
- events: [
155
- {
156
- type: "0x1::coin::WithdrawEvent",
157
- guid: {
158
- account_address: "0x11",
159
- creation_number: "1",
160
- },
161
- data: {
162
- amount: "100",
163
- },
164
- },
165
- {
166
- type: "0x1::coin::DepositEvent",
167
- guid: {
168
- account_address: "0x12",
169
- creation_number: "2",
170
- },
171
- data: {
172
- amount: "100",
173
- },
174
- },
175
- ],
176
- changes: [
177
- {
178
- type: "write_resource",
179
- data: {
180
- type: constants_1.APTOS_COIN_CHANGE,
181
- data: {
182
- withdraw_events: {
183
- guid: {
184
- id: {
185
- addr: "0x11",
186
- creation_num: "1",
187
- },
188
- },
189
- },
190
- deposit_events: {
191
- guid: {
192
- id: {
193
- addr: "0x12",
194
- creation_num: "2",
195
- },
196
- },
197
- },
198
- },
199
- },
200
- },
201
- ],
202
- block: { hash: "0xabc", height: 1 },
203
- timestamp: "1000000",
204
- sequence_number: "1",
205
- },
206
- ];
207
- const [result] = (0, logic_1.txsToOps)({ address }, id, txs);
208
- expect(result).toHaveLength(1);
209
- expect(result[0]).toEqual({
210
- id: expect.any(String),
211
- hash: "0x123",
212
- type: constants_1.OP_TYPE.OUT,
213
- value: new bignumber_js_1.default(100),
214
- fee: new bignumber_js_1.default(20000),
215
- blockHash: "0xabc",
216
- blockHeight: 1,
217
- senders: ["0x11"],
218
- recipients: ["0x0000000000000000000000000000000000000000000000000000000000000012"],
219
- accountId: id,
220
- date: new Date(1000),
221
- extra: { version: undefined },
222
- transactionSequenceNumber: 1,
223
- hasFailed: false,
224
- });
225
- });
226
- it("should skip transactions without functions in payload", () => {
227
- const address = "0x11";
228
- const id = "test_id";
229
- const txs = [
230
- {
231
- hash: "0x123",
232
- sender: "0x11",
233
- gas_used: "200",
234
- gas_unit_price: "100",
235
- success: true,
236
- payload: {},
237
- events: [],
238
- changes: [],
239
- block: { hash: "0xabc", height: 1 },
240
- timestamp: "1000000",
241
- sequence_number: "1",
242
- },
243
- ];
244
- const [result] = (0, logic_1.txsToOps)({ address }, id, txs);
245
- expect(result).toHaveLength(0);
246
- });
247
- it("should skip transactions that result in no Aptos change", () => {
248
- const address = "0x11";
249
- const id = "test_id";
250
- const txs = [
251
- {
252
- hash: "0x123",
253
- sender: "0x12",
254
- gas_used: "200",
255
- gas_unit_price: "100",
256
- success: true,
257
- payload: {
258
- type: "entry_function_payload",
259
- function: "0x1::coin::transfer",
260
- type_arguments: [],
261
- arguments: ["0x11", 100],
262
- },
263
- events: [],
264
- changes: [],
265
- block: { hash: "0xabc", height: 1 },
266
- timestamp: "1000000",
267
- sequence_number: "1",
268
- },
269
- ];
270
- const [result] = (0, logic_1.txsToOps)({ address }, id, txs);
271
- expect(result).toHaveLength(0);
272
- });
273
- it("should handle failed transactions", () => {
274
- const address = "0xa0d8";
275
- const id = "test_id";
276
- const txs = [
277
- {
278
- hash: "0x0189",
279
- sender: "0xa0d8",
280
- gas_used: "200",
281
- gas_unit_price: "100",
282
- success: false,
283
- payload: {
284
- function: "0x1::coin::transfer",
285
- type_arguments: ["0xd111::staked_coin::StakedAptos"],
286
- arguments: ["0x4e5e", "50000000"],
287
- type: "entry_function_payload",
288
- },
289
- events: [
290
- {
291
- guid: {
292
- creation_number: "0",
293
- account_address: "0x0",
294
- },
295
- sequence_number: "0",
296
- type: "0x1::transaction_fee::FeeStatement",
297
- data: {
298
- execution_gas_units: "5",
299
- io_gas_units: "4",
300
- storage_fee_octas: "0",
301
- storage_fee_refund_octas: "0",
302
- total_charge_gas_units: "8",
303
- },
304
- },
305
- ],
306
- changes: [
307
- {
308
- address: "0xa0d8",
309
- state_key_hash: "0x1709",
310
- data: {
311
- type: "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>",
312
- data: {
313
- coin: {
314
- value: "573163341",
315
- },
316
- deposit_events: {
317
- counter: "45",
318
- guid: {
319
- id: {
320
- addr: "0xa0d8",
321
- creation_num: "2",
322
- },
323
- },
324
- },
325
- frozen: false,
326
- withdraw_events: {
327
- counter: "82",
328
- guid: {
329
- id: {
330
- addr: "0xa0d8",
331
- creation_num: "3",
332
- },
333
- },
334
- },
335
- },
336
- },
337
- type: "write_resource",
338
- },
339
- {
340
- address: "0xa0d8",
341
- state_key_hash: "0x6f1e",
342
- data: {
343
- type: "0x1::account::Account",
344
- data: {
345
- authentication_key: "0xa0d8",
346
- coin_register_events: {
347
- counter: "5",
348
- guid: {
349
- id: {
350
- addr: "0xa0d8",
351
- creation_num: "0",
352
- },
353
- },
354
- },
355
- guid_creation_num: "12",
356
- key_rotation_events: {
357
- counter: "0",
358
- guid: {
359
- id: {
360
- addr: "0xa0d8",
361
- creation_num: "1",
362
- },
363
- },
364
- },
365
- rotation_capability_offer: {
366
- for: {
367
- vec: [],
368
- },
369
- },
370
- sequence_number: "83",
371
- signer_capability_offer: {
372
- for: {
373
- vec: [],
374
- },
375
- },
376
- },
377
- },
378
- type: "write_resource",
379
- },
380
- {
381
- state_key_hash: "0x6e4b",
382
- handle: "0x1b85",
383
- key: "0x0619",
384
- value: "0x72c5e483c25c96010000000000000000",
385
- data: null,
386
- type: "write_table_item",
387
- },
388
- ],
389
- block: {
390
- hash: "0xc496",
391
- height: 1,
392
- },
393
- timestamp: "1000000",
394
- sequence_number: "1",
395
- },
396
- ];
397
- const [result] = (0, logic_1.txsToOps)({ address }, id, txs);
398
- expect(result).toHaveLength(1);
399
- expect(result[0]).toEqual({
400
- id: expect.any(String),
401
- hash: "0x0189",
402
- type: constants_1.OP_TYPE.OUT,
403
- value: new bignumber_js_1.default(20000),
404
- fee: new bignumber_js_1.default(20000),
405
- blockHash: "0xc496",
406
- blockHeight: 1,
407
- senders: ["0xa0d8"],
408
- recipients: ["0x0000000000000000000000000000000000000000000000000000000000004e5e"],
409
- accountId: id,
410
- date: new Date(1000),
411
- extra: { version: undefined },
412
- transactionSequenceNumber: 1,
413
- hasFailed: true,
414
- });
415
- });
416
- it("should convert Aptos token transactions to operations correctly", () => {
417
- cryptoassets_1.findTokenByAddressInCurrency.mockReturnValue({
418
- type: "TokenCurrency",
419
- id: "aptos/coin/dstapt::staked_coin::stakedaptos",
420
- contractAddress: "0xd111::staked_coin::StakedAptos",
421
- parentCurrency: {
422
- type: "CryptoCurrency",
423
- id: "aptos",
424
- coinType: 637,
425
- name: "Aptos",
426
- managerAppName: "Aptos",
427
- ticker: "APT",
428
- scheme: "aptos",
429
- color: "#231F20",
430
- family: "aptos",
431
- units: [
432
- {
433
- name: "APT",
434
- code: "APT",
435
- magnitude: 8,
436
- },
437
- ],
438
- explorerViews: [
439
- {
440
- address: "https://explorer.aptoslabs.com/account/$address?network=mainnet",
441
- tx: "https://explorer.aptoslabs.com/txn/$hash?network=mainnet",
442
- },
443
- ],
444
- },
445
- name: "dstAPT",
446
- tokenType: "coin",
447
- ticker: "dstAPT",
448
- disableCountervalue: false,
449
- delisted: false,
450
- units: [
451
- {
452
- name: "dstAPT",
453
- code: "dstAPT",
454
- magnitude: 8,
455
- },
456
- ],
457
- });
458
- jest.mock("../../bridge/logic", () => ({
459
- ...jest.requireActual("../../bridge/logic"),
460
- getResourceAddress: jest.fn().mockReturnValue("0xd111::staked_coin::StakedAptos"),
461
- }));
462
- index_1.decodeTokenAccountId.mockReturnValue({
463
- accountId: "token_account_id",
464
- });
465
- const address = "0xa0d";
466
- const id = "test_id";
467
- const txs = [
468
- {
469
- hash: "0x123",
470
- sender: address,
471
- gas_used: "200",
472
- gas_unit_price: "100",
473
- success: true,
474
- payload: {
475
- function: "0x1::aptos_account::transfer_coins",
476
- type_arguments: ["0xd111::staked_coin::StakedAptos"],
477
- arguments: ["0x4e5", "1500000"],
478
- type: "entry_function_payload",
479
- },
480
- events: [
481
- {
482
- guid: {
483
- creation_number: "11",
484
- account_address: "0xa0d",
485
- },
486
- sequence_number: "12",
487
- type: "0x1::coin::WithdrawEvent",
488
- data: {
489
- amount: "1500000",
490
- },
491
- },
492
- {
493
- guid: {
494
- creation_number: "4",
495
- account_address: "0x4e5",
496
- },
497
- sequence_number: "8",
498
- type: "0x1::coin::DepositEvent",
499
- data: {
500
- amount: "1500000",
501
- },
502
- },
503
- {
504
- guid: {
505
- creation_number: "0",
506
- account_address: "0x0",
507
- },
508
- sequence_number: "0",
509
- type: "0x1::transaction_fee::FeeStatement",
510
- data: {
511
- execution_gas_units: "6",
512
- io_gas_units: "6",
513
- storage_fee_octas: "0",
514
- storage_fee_refund_octas: "0",
515
- total_charge_gas_units: "12",
516
- },
517
- },
518
- ],
519
- changes: [
520
- {
521
- address: "0x4e5",
522
- state_key_hash: "0x3c0",
523
- data: {
524
- type: "0x1::coin::CoinStore<0xd111::staked_coin::StakedAptos>",
525
- data: {
526
- coin: {
527
- value: "4000000",
528
- },
529
- deposit_events: {
530
- counter: "9",
531
- guid: {
532
- id: {
533
- addr: "0x4e5",
534
- creation_num: "4",
535
- },
536
- },
537
- },
538
- frozen: false,
539
- withdraw_events: {
540
- counter: "6",
541
- guid: {
542
- id: {
543
- addr: "0x4e5",
544
- creation_num: "5",
545
- },
546
- },
547
- },
548
- },
549
- },
550
- type: "write_resource",
551
- },
552
- {
553
- address: "0xa0d",
554
- state_key_hash: "0x1709",
555
- data: {
556
- type: "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>",
557
- data: {
558
- coin: {
559
- value: "68254118",
560
- },
561
- deposit_events: {
562
- counter: "46",
563
- guid: {
564
- id: {
565
- addr: "0xa0d",
566
- creation_num: "2",
567
- },
568
- },
569
- },
570
- frozen: false,
571
- withdraw_events: {
572
- counter: "89",
573
- guid: {
574
- id: {
575
- addr: "0xa0d",
576
- creation_num: "3",
577
- },
578
- },
579
- },
580
- },
581
- },
582
- type: "write_resource",
583
- },
584
- {
585
- address: "0xa0d",
586
- state_key_hash: "0x5520",
587
- data: {
588
- type: "0x1::coin::CoinStore<0xd111::staked_coin::StakedAptos>",
589
- data: {
590
- coin: {
591
- value: "1000000",
592
- },
593
- deposit_events: {
594
- counter: "7",
595
- guid: {
596
- id: {
597
- addr: "0xa0d",
598
- creation_num: "10",
599
- },
600
- },
601
- },
602
- frozen: false,
603
- withdraw_events: {
604
- counter: "13",
605
- guid: {
606
- id: {
607
- addr: "0xa0d",
608
- creation_num: "11",
609
- },
610
- },
611
- },
612
- },
613
- },
614
- type: "write_resource",
615
- },
616
- {
617
- address: "0xa0d",
618
- state_key_hash: "0x6f1e",
619
- data: {
620
- type: "0x1::account::Account",
621
- data: {
622
- authentication_key: "0xa0d",
623
- coin_register_events: {
624
- counter: "5",
625
- guid: {
626
- id: {
627
- addr: "0xa0d",
628
- creation_num: "0",
629
- },
630
- },
631
- },
632
- guid_creation_num: "12",
633
- key_rotation_events: {
634
- counter: "0",
635
- guid: {
636
- id: {
637
- addr: "0xa0d",
638
- creation_num: "1",
639
- },
640
- },
641
- },
642
- rotation_capability_offer: {
643
- for: {
644
- vec: [],
645
- },
646
- },
647
- sequence_number: "122",
648
- signer_capability_offer: {
649
- for: {
650
- vec: [],
651
- },
652
- },
653
- },
654
- },
655
- type: "write_resource",
656
- },
657
- {
658
- state_key_hash: "0x6e4b",
659
- handle: "0x1b85",
660
- key: "0x0619",
661
- value: "0x1ddaf8da3b1497010000000000000000",
662
- data: null,
663
- type: "write_table_item",
664
- },
665
- ],
666
- block: { hash: "0xabc", height: 1 },
667
- timestamp: "1000000",
668
- sequence_number: "1",
669
- },
670
- ];
671
- const [ops, tokenOps] = (0, logic_1.txsToOps)({ address }, id, txs);
672
- expect(ops).toHaveLength(1);
673
- expect(ops[0]).toEqual({
674
- id: expect.any(String),
675
- hash: "0x123",
676
- type: "FEES",
677
- value: new bignumber_js_1.default(20000),
678
- fee: new bignumber_js_1.default(20000),
679
- blockHash: "0xabc",
680
- blockHeight: 1,
681
- senders: ["0xa0d"],
682
- recipients: ["0x00000000000000000000000000000000000000000000000000000000000004e5"],
683
- accountId: "token_account_id",
684
- date: new Date(1000),
685
- extra: { version: undefined },
686
- transactionSequenceNumber: 1,
687
- hasFailed: false,
688
- });
689
- expect(tokenOps).toHaveLength(1);
690
- expect(tokenOps[0]).toEqual({
691
- id: expect.any(String),
692
- hash: "0x123",
693
- type: constants_1.OP_TYPE.OUT,
694
- value: new bignumber_js_1.default(1500000),
695
- fee: new bignumber_js_1.default(20000),
696
- blockHash: "0xabc",
697
- blockHeight: 1,
698
- senders: ["0xa0d"],
699
- recipients: ["0x00000000000000000000000000000000000000000000000000000000000004e5"],
700
- date: new Date(1000),
701
- extra: { version: undefined },
702
- transactionSequenceNumber: 1,
703
- hasFailed: false,
704
- });
705
- });
706
- it("should convert Aptos token transactions to operations correctly", () => {
707
- cryptoassets_1.findTokenByAddressInCurrency.mockReturnValue({
708
- type: "TokenCurrency",
709
- id: "aptos/fungible_asset/cellana_0x2ebb2ccac5e027a87fa0e2e5f656a3a4238d6a48d93ec9b610d570fc0aa0df12",
710
- contractAddress: "0x2ebb",
711
- parentCurrency: {
712
- type: "CryptoCurrency",
713
- id: "aptos",
714
- coinType: 637,
715
- name: "Aptos",
716
- managerAppName: "Aptos",
717
- ticker: "APT",
718
- scheme: "aptos",
719
- color: "#231F20",
720
- family: "aptos",
721
- units: [
722
- {
723
- name: "APT",
724
- code: "APT",
725
- magnitude: 8,
726
- },
727
- ],
728
- explorerViews: [
729
- {
730
- address: "https://explorer.aptoslabs.com/account/$address?network=mainnet",
731
- tx: "https://explorer.aptoslabs.com/txn/$hash?network=mainnet",
732
- },
733
- ],
734
- },
735
- name: "CELLANA",
736
- tokenType: "fungible_asset",
737
- ticker: "CELL",
738
- disableCountervalue: false,
739
- delisted: false,
740
- units: [
741
- {
742
- name: "CELLANA",
743
- code: "CELL",
744
- magnitude: 8,
745
- },
746
- ],
747
- });
748
- jest.mock("../../bridge/logic", () => ({
749
- ...jest.requireActual("../../bridge/logic"),
750
- getResourceAddress: jest.fn().mockReturnValue("0x2ebb"),
751
- }));
752
- index_1.encodeTokenAccountId.mockReturnValue("token_account_id");
753
- const txs = [
754
- {
755
- hash: "0x10c9",
756
- sender: "0xa0d8",
757
- gas_used: "200",
758
- gas_unit_price: "100",
759
- success: true,
760
- payload: {
761
- function: "0x1::primary_fungible_store::transfer",
762
- type_arguments: ["0x1::fungible_asset::Metadata"],
763
- arguments: [
764
- {
765
- inner: "0x2ebb",
766
- },
767
- "0x6b8c",
768
- "193",
769
- ],
770
- type: "entry_function_payload",
771
- },
772
- events: [
773
- {
774
- guid: {
775
- creation_number: "0",
776
- account_address: "0x0",
777
- },
778
- sequence_number: "0",
779
- type: "0x1::fungible_asset::Withdraw",
780
- data: {
781
- amount: "193",
782
- store: "0xd475",
783
- },
784
- },
785
- {
786
- guid: {
787
- creation_number: "0",
788
- account_address: "0x0",
789
- },
790
- sequence_number: "0",
791
- type: "0x1::fungible_asset::Deposit",
792
- data: {
793
- amount: "193",
794
- store: "0xaaa9",
795
- },
796
- },
797
- {
798
- guid: {
799
- creation_number: "0",
800
- account_address: "0x0",
801
- },
802
- sequence_number: "0",
803
- type: "0x1::transaction_fee::FeeStatement",
804
- data: {
805
- execution_gas_units: "4",
806
- io_gas_units: "6",
807
- storage_fee_octas: "0",
808
- storage_fee_refund_octas: "0",
809
- total_charge_gas_units: "10",
810
- },
811
- },
812
- ],
813
- changes: [
814
- {
815
- address: "0xaaa9",
816
- state_key_hash: "0x9a17",
817
- data: {
818
- type: "0x1::fungible_asset::FungibleStore",
819
- data: {
820
- balance: "10044959",
821
- frozen: false,
822
- metadata: {
823
- inner: "0x2ebb",
824
- },
825
- },
826
- },
827
- type: "write_resource",
828
- },
829
- {
830
- address: "0xaaa9",
831
- state_key_hash: "0x9a17",
832
- data: {
833
- type: "0x1::object::ObjectCore",
834
- data: {
835
- allow_ungated_transfer: false,
836
- guid_creation_num: "1125899906842625",
837
- owner: "0x6b8c",
838
- transfer_events: {
839
- counter: "0",
840
- guid: {
841
- id: {
842
- addr: "0xaaa9",
843
- creation_num: "1125899906842624",
844
- },
845
- },
846
- },
847
- },
848
- },
849
- type: "write_resource",
850
- },
851
- {
852
- address: "0xa0d8",
853
- state_key_hash: "0x1709",
854
- data: {
855
- type: "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>",
856
- data: {
857
- coin: {
858
- value: "98423118",
859
- },
860
- deposit_events: {
861
- counter: "46",
862
- guid: {
863
- id: {
864
- addr: "0xa0d8",
865
- creation_num: "2",
866
- },
867
- },
868
- },
869
- frozen: false,
870
- withdraw_events: {
871
- counter: "88",
872
- guid: {
873
- id: {
874
- addr: "0xa0d8",
875
- creation_num: "3",
876
- },
877
- },
878
- },
879
- },
880
- },
881
- type: "write_resource",
882
- },
883
- {
884
- address: "0xa0d8",
885
- state_key_hash: "0x6f1e",
886
- data: {
887
- type: "0x1::account::Account",
888
- data: {
889
- authentication_key: "0xa0d8",
890
- coin_register_events: {
891
- counter: "5",
892
- guid: {
893
- id: {
894
- addr: "0xa0d8",
895
- creation_num: "0",
896
- },
897
- },
898
- },
899
- guid_creation_num: "12",
900
- key_rotation_events: {
901
- counter: "0",
902
- guid: {
903
- id: {
904
- addr: "0xa0d8",
905
- creation_num: "1",
906
- },
907
- },
908
- },
909
- rotation_capability_offer: {
910
- for: {
911
- vec: [],
912
- },
913
- },
914
- sequence_number: "108",
915
- signer_capability_offer: {
916
- for: {
917
- vec: [],
918
- },
919
- },
920
- },
921
- },
922
- type: "write_resource",
923
- },
924
- {
925
- address: "0xd475",
926
- state_key_hash: "0x7567",
927
- data: {
928
- type: "0x1::fungible_asset::FungibleStore",
929
- data: {
930
- balance: "14000",
931
- frozen: false,
932
- metadata: {
933
- inner: "0x2ebb",
934
- },
935
- },
936
- },
937
- type: "write_resource",
938
- },
939
- {
940
- address: "0xd475",
941
- state_key_hash: "0x7567",
942
- data: {
943
- type: "0x1::object::ObjectCore",
944
- data: {
945
- allow_ungated_transfer: false,
946
- guid_creation_num: "1125899906842625",
947
- owner: "0xa0d8",
948
- transfer_events: {
949
- counter: "0",
950
- guid: {
951
- id: {
952
- addr: "0xd475",
953
- creation_num: "1125899906842624",
954
- },
955
- },
956
- },
957
- },
958
- },
959
- type: "write_resource",
960
- },
961
- {
962
- state_key_hash: "0x6e4b",
963
- handle: "0x1b85",
964
- key: "0x0619",
965
- value: "0xad4388dc7daf96010000000000000000",
966
- data: null,
967
- type: "write_table_item",
968
- },
969
- ],
970
- block: { hash: "0xabc", height: 1 },
971
- timestamp: "1000000",
972
- sequence_number: "1",
973
- },
974
- ];
975
- const [ops, tokenOps] = (0, logic_1.txsToOps)({ address: "0x6b8c" }, "test_id", txs);
976
- expect(ops).toHaveLength(0);
977
- expect(tokenOps).toHaveLength(1);
978
- expect(tokenOps[0]).toEqual({
979
- id: expect.any(String),
980
- accountId: "token_account_id",
981
- hash: "0x10c9",
982
- type: constants_1.OP_TYPE.IN,
983
- value: new bignumber_js_1.default(193),
984
- fee: new bignumber_js_1.default(20000),
985
- blockHash: "0xabc",
986
- blockHeight: 1,
987
- senders: ["0xa0d8"],
988
- recipients: ["0x0000000000000000000000000000000000000000000000000000000000006b8c"],
989
- date: new Date(1000),
990
- extra: { version: undefined },
991
- transactionSequenceNumber: 1,
992
- hasFailed: false,
993
- });
994
- });
995
- });
996
- });
997
- //# sourceMappingURL=logic.test.js.map