@ledgerhq/coin-ton 0.3.12-next.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 (341) hide show
  1. package/.eslintrc.js +20 -0
  2. package/.turbo/turbo-build.log +4 -0
  3. package/.unimportedrc.json +19 -0
  4. package/CHANGELOG.md +15 -0
  5. package/LICENSE.txt +21 -0
  6. package/jest.config.js +12 -0
  7. package/lib/__tests__/fixtures/api.fixtures.d.ts +4 -0
  8. package/lib/__tests__/fixtures/api.fixtures.d.ts.map +1 -0
  9. package/lib/__tests__/fixtures/api.fixtures.js +33 -0
  10. package/lib/__tests__/fixtures/api.fixtures.js.map +1 -0
  11. package/lib/__tests__/fixtures/common.fixtures.d.ts +29 -0
  12. package/lib/__tests__/fixtures/common.fixtures.d.ts.map +1 -0
  13. package/lib/__tests__/fixtures/common.fixtures.js +124 -0
  14. package/lib/__tests__/fixtures/common.fixtures.js.map +1 -0
  15. package/lib/__tests__/integration/bridge.integration.test.d.ts +14 -0
  16. package/lib/__tests__/integration/bridge.integration.test.d.ts.map +1 -0
  17. package/lib/__tests__/integration/bridge.integration.test.js +136 -0
  18. package/lib/__tests__/integration/bridge.integration.test.js.map +1 -0
  19. package/lib/__tests__/unit/api.unit.test.d.ts +2 -0
  20. package/lib/__tests__/unit/api.unit.test.d.ts.map +1 -0
  21. package/lib/__tests__/unit/api.unit.test.js +77 -0
  22. package/lib/__tests__/unit/api.unit.test.js.map +1 -0
  23. package/lib/__tests__/unit/broadcast.unit.test.d.ts +2 -0
  24. package/lib/__tests__/unit/broadcast.unit.test.d.ts.map +1 -0
  25. package/lib/__tests__/unit/broadcast.unit.test.js +40 -0
  26. package/lib/__tests__/unit/broadcast.unit.test.js.map +1 -0
  27. package/lib/__tests__/unit/createTransaction.unit.test.d.ts +2 -0
  28. package/lib/__tests__/unit/createTransaction.unit.test.d.ts.map +1 -0
  29. package/lib/__tests__/unit/createTransaction.unit.test.js +34 -0
  30. package/lib/__tests__/unit/createTransaction.unit.test.js.map +1 -0
  31. package/lib/__tests__/unit/deviceTransactionConfig.unit.test.d.ts +2 -0
  32. package/lib/__tests__/unit/deviceTransactionConfig.unit.test.d.ts.map +1 -0
  33. package/lib/__tests__/unit/deviceTransactionConfig.unit.test.js +74 -0
  34. package/lib/__tests__/unit/deviceTransactionConfig.unit.test.js.map +1 -0
  35. package/lib/__tests__/unit/estimateMaxSpendable.unit.test.d.ts +2 -0
  36. package/lib/__tests__/unit/estimateMaxSpendable.unit.test.d.ts.map +1 -0
  37. package/lib/__tests__/unit/estimateMaxSpendable.unit.test.js +31 -0
  38. package/lib/__tests__/unit/estimateMaxSpendable.unit.test.js.map +1 -0
  39. package/lib/__tests__/unit/getTransactionStatus.unit.test.d.ts +2 -0
  40. package/lib/__tests__/unit/getTransactionStatus.unit.test.d.ts.map +1 -0
  41. package/lib/__tests__/unit/getTransactionStatus.unit.test.js +96 -0
  42. package/lib/__tests__/unit/getTransactionStatus.unit.test.js.map +1 -0
  43. package/lib/__tests__/unit/hw-getAddress.unit.test.d.ts +2 -0
  44. package/lib/__tests__/unit/hw-getAddress.unit.test.d.ts.map +1 -0
  45. package/lib/__tests__/unit/hw-getAddress.unit.test.js +67 -0
  46. package/lib/__tests__/unit/hw-getAddress.unit.test.js.map +1 -0
  47. package/lib/__tests__/unit/prepareTransaction.unit.test.d.ts +2 -0
  48. package/lib/__tests__/unit/prepareTransaction.unit.test.d.ts.map +1 -0
  49. package/lib/__tests__/unit/prepareTransaction.unit.test.js +42 -0
  50. package/lib/__tests__/unit/prepareTransaction.unit.test.js.map +1 -0
  51. package/lib/__tests__/unit/signOperation.unit.test.d.ts +2 -0
  52. package/lib/__tests__/unit/signOperation.unit.test.d.ts.map +1 -0
  53. package/lib/__tests__/unit/signOperation.unit.test.js +83 -0
  54. package/lib/__tests__/unit/signOperation.unit.test.js.map +1 -0
  55. package/lib/__tests__/unit/txn.unit.test.d.ts +2 -0
  56. package/lib/__tests__/unit/txn.unit.test.d.ts.map +1 -0
  57. package/lib/__tests__/unit/txn.unit.test.js +116 -0
  58. package/lib/__tests__/unit/txn.unit.test.js.map +1 -0
  59. package/lib/__tests__/unit/utils.unit.test.d.ts +2 -0
  60. package/lib/__tests__/unit/utils.unit.test.d.ts.map +1 -0
  61. package/lib/__tests__/unit/utils.unit.test.js +97 -0
  62. package/lib/__tests__/unit/utils.unit.test.js.map +1 -0
  63. package/lib/bridge/bridgeHelpers/api.d.ts +10 -0
  64. package/lib/bridge/bridgeHelpers/api.d.ts.map +1 -0
  65. package/lib/bridge/bridgeHelpers/api.js +104 -0
  66. package/lib/bridge/bridgeHelpers/api.js.map +1 -0
  67. package/lib/bridge/bridgeHelpers/api.types.d.ts +164 -0
  68. package/lib/bridge/bridgeHelpers/api.types.d.ts.map +1 -0
  69. package/lib/bridge/bridgeHelpers/api.types.js +3 -0
  70. package/lib/bridge/bridgeHelpers/api.types.js.map +1 -0
  71. package/lib/bridge/bridgeHelpers/txn.d.ts +5 -0
  72. package/lib/bridge/bridgeHelpers/txn.d.ts.map +1 -0
  73. package/lib/bridge/bridgeHelpers/txn.js +166 -0
  74. package/lib/bridge/bridgeHelpers/txn.js.map +1 -0
  75. package/lib/bridge/js.d.ts +12 -0
  76. package/lib/bridge/js.d.ts.map +1 -0
  77. package/lib/bridge/js.js +65 -0
  78. package/lib/bridge/js.js.map +1 -0
  79. package/lib/broadcast.d.ts +5 -0
  80. package/lib/broadcast.d.ts.map +1 -0
  81. package/lib/broadcast.js +19 -0
  82. package/lib/broadcast.js.map +1 -0
  83. package/lib/cli-transaction.d.ts +12 -0
  84. package/lib/cli-transaction.d.ts.map +1 -0
  85. package/lib/cli-transaction.js +21 -0
  86. package/lib/cli-transaction.js.map +1 -0
  87. package/lib/config.d.ts +9 -0
  88. package/lib/config.d.ts.map +1 -0
  89. package/lib/config.js +16 -0
  90. package/lib/config.js.map +1 -0
  91. package/lib/createTransaction.d.ts +5 -0
  92. package/lib/createTransaction.d.ts.map +1 -0
  93. package/lib/createTransaction.js +16 -0
  94. package/lib/createTransaction.js.map +1 -0
  95. package/lib/deviceTransactionConfig.d.ts +11 -0
  96. package/lib/deviceTransactionConfig.d.ts.map +1 -0
  97. package/lib/deviceTransactionConfig.js +37 -0
  98. package/lib/deviceTransactionConfig.js.map +1 -0
  99. package/lib/errors.d.ts +4 -0
  100. package/lib/errors.d.ts.map +1 -0
  101. package/lib/errors.js +9 -0
  102. package/lib/errors.js.map +1 -0
  103. package/lib/estimateMaxSpendable.d.ts +5 -0
  104. package/lib/estimateMaxSpendable.d.ts.map +1 -0
  105. package/lib/estimateMaxSpendable.js +32 -0
  106. package/lib/estimateMaxSpendable.js.map +1 -0
  107. package/lib/getTransactionStatus.d.ts +5 -0
  108. package/lib/getTransactionStatus.d.ts.map +1 -0
  109. package/lib/getTransactionStatus.js +97 -0
  110. package/lib/getTransactionStatus.js.map +1 -0
  111. package/lib/hw-getAddress.d.ts +6 -0
  112. package/lib/hw-getAddress.d.ts.map +1 -0
  113. package/lib/hw-getAddress.js +31 -0
  114. package/lib/hw-getAddress.js.map +1 -0
  115. package/lib/hw-signMessage.d.ts +12 -0
  116. package/lib/hw-signMessage.d.ts.map +1 -0
  117. package/lib/hw-signMessage.js +33 -0
  118. package/lib/hw-signMessage.js.map +1 -0
  119. package/lib/prepareTransaction.d.ts +5 -0
  120. package/lib/prepareTransaction.d.ts.map +1 -0
  121. package/lib/prepareTransaction.js +29 -0
  122. package/lib/prepareTransaction.js.map +1 -0
  123. package/lib/signOperation.d.ts +11 -0
  124. package/lib/signOperation.d.ts.map +1 -0
  125. package/lib/signOperation.js +96 -0
  126. package/lib/signOperation.js.map +1 -0
  127. package/lib/signer.d.ts +27 -0
  128. package/lib/signer.d.ts.map +1 -0
  129. package/lib/signer.js +3 -0
  130. package/lib/signer.js.map +1 -0
  131. package/lib/specs.d.ts +8 -0
  132. package/lib/specs.d.ts.map +1 -0
  133. package/lib/specs.js +106 -0
  134. package/lib/specs.js.map +1 -0
  135. package/lib/speculos-deviceActions.d.ts +4 -0
  136. package/lib/speculos-deviceActions.d.ts.map +1 -0
  137. package/lib/speculos-deviceActions.js +34 -0
  138. package/lib/speculos-deviceActions.js.map +1 -0
  139. package/lib/synchronisation.d.ts +5 -0
  140. package/lib/synchronisation.d.ts.map +1 -0
  141. package/lib/synchronisation.js +95 -0
  142. package/lib/synchronisation.js.map +1 -0
  143. package/lib/transaction.d.ts +14 -0
  144. package/lib/transaction.d.ts.map +1 -0
  145. package/lib/transaction.js +41 -0
  146. package/lib/transaction.js.map +1 -0
  147. package/lib/types.d.ts +65 -0
  148. package/lib/types.d.ts.map +1 -0
  149. package/lib/types.js +3 -0
  150. package/lib/types.js.map +1 -0
  151. package/lib/utils.d.ts +11 -0
  152. package/lib/utils.d.ts.map +1 -0
  153. package/lib/utils.js +125 -0
  154. package/lib/utils.js.map +1 -0
  155. package/lib-es/__tests__/fixtures/api.fixtures.d.ts +4 -0
  156. package/lib-es/__tests__/fixtures/api.fixtures.d.ts.map +1 -0
  157. package/lib-es/__tests__/fixtures/api.fixtures.js +30 -0
  158. package/lib-es/__tests__/fixtures/api.fixtures.js.map +1 -0
  159. package/lib-es/__tests__/fixtures/common.fixtures.d.ts +29 -0
  160. package/lib-es/__tests__/fixtures/common.fixtures.d.ts.map +1 -0
  161. package/lib-es/__tests__/fixtures/common.fixtures.js +118 -0
  162. package/lib-es/__tests__/fixtures/common.fixtures.js.map +1 -0
  163. package/lib-es/__tests__/integration/bridge.integration.test.d.ts +14 -0
  164. package/lib-es/__tests__/integration/bridge.integration.test.d.ts.map +1 -0
  165. package/lib-es/__tests__/integration/bridge.integration.test.js +130 -0
  166. package/lib-es/__tests__/integration/bridge.integration.test.js.map +1 -0
  167. package/lib-es/__tests__/unit/api.unit.test.d.ts +2 -0
  168. package/lib-es/__tests__/unit/api.unit.test.d.ts.map +1 -0
  169. package/lib-es/__tests__/unit/api.unit.test.js +52 -0
  170. package/lib-es/__tests__/unit/api.unit.test.js.map +1 -0
  171. package/lib-es/__tests__/unit/broadcast.unit.test.d.ts +2 -0
  172. package/lib-es/__tests__/unit/broadcast.unit.test.d.ts.map +1 -0
  173. package/lib-es/__tests__/unit/broadcast.unit.test.js +35 -0
  174. package/lib-es/__tests__/unit/broadcast.unit.test.js.map +1 -0
  175. package/lib-es/__tests__/unit/createTransaction.unit.test.d.ts +2 -0
  176. package/lib-es/__tests__/unit/createTransaction.unit.test.d.ts.map +1 -0
  177. package/lib-es/__tests__/unit/createTransaction.unit.test.js +29 -0
  178. package/lib-es/__tests__/unit/createTransaction.unit.test.js.map +1 -0
  179. package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.d.ts +2 -0
  180. package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.d.ts.map +1 -0
  181. package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.js +69 -0
  182. package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.js.map +1 -0
  183. package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.d.ts +2 -0
  184. package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.d.ts.map +1 -0
  185. package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.js +26 -0
  186. package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.js.map +1 -0
  187. package/lib-es/__tests__/unit/getTransactionStatus.unit.test.d.ts +2 -0
  188. package/lib-es/__tests__/unit/getTransactionStatus.unit.test.d.ts.map +1 -0
  189. package/lib-es/__tests__/unit/getTransactionStatus.unit.test.js +91 -0
  190. package/lib-es/__tests__/unit/getTransactionStatus.unit.test.js.map +1 -0
  191. package/lib-es/__tests__/unit/hw-getAddress.unit.test.d.ts +2 -0
  192. package/lib-es/__tests__/unit/hw-getAddress.unit.test.d.ts.map +1 -0
  193. package/lib-es/__tests__/unit/hw-getAddress.unit.test.js +62 -0
  194. package/lib-es/__tests__/unit/hw-getAddress.unit.test.js.map +1 -0
  195. package/lib-es/__tests__/unit/prepareTransaction.unit.test.d.ts +2 -0
  196. package/lib-es/__tests__/unit/prepareTransaction.unit.test.d.ts.map +1 -0
  197. package/lib-es/__tests__/unit/prepareTransaction.unit.test.js +37 -0
  198. package/lib-es/__tests__/unit/prepareTransaction.unit.test.js.map +1 -0
  199. package/lib-es/__tests__/unit/signOperation.unit.test.d.ts +2 -0
  200. package/lib-es/__tests__/unit/signOperation.unit.test.d.ts.map +1 -0
  201. package/lib-es/__tests__/unit/signOperation.unit.test.js +78 -0
  202. package/lib-es/__tests__/unit/signOperation.unit.test.js.map +1 -0
  203. package/lib-es/__tests__/unit/txn.unit.test.d.ts +2 -0
  204. package/lib-es/__tests__/unit/txn.unit.test.d.ts.map +1 -0
  205. package/lib-es/__tests__/unit/txn.unit.test.js +111 -0
  206. package/lib-es/__tests__/unit/txn.unit.test.js.map +1 -0
  207. package/lib-es/__tests__/unit/utils.unit.test.d.ts +2 -0
  208. package/lib-es/__tests__/unit/utils.unit.test.d.ts.map +1 -0
  209. package/lib-es/__tests__/unit/utils.unit.test.js +95 -0
  210. package/lib-es/__tests__/unit/utils.unit.test.js.map +1 -0
  211. package/lib-es/bridge/bridgeHelpers/api.d.ts +10 -0
  212. package/lib-es/bridge/bridgeHelpers/api.d.ts.map +1 -0
  213. package/lib-es/bridge/bridgeHelpers/api.js +93 -0
  214. package/lib-es/bridge/bridgeHelpers/api.js.map +1 -0
  215. package/lib-es/bridge/bridgeHelpers/api.types.d.ts +164 -0
  216. package/lib-es/bridge/bridgeHelpers/api.types.d.ts.map +1 -0
  217. package/lib-es/bridge/bridgeHelpers/api.types.js +2 -0
  218. package/lib-es/bridge/bridgeHelpers/api.types.js.map +1 -0
  219. package/lib-es/bridge/bridgeHelpers/txn.d.ts +5 -0
  220. package/lib-es/bridge/bridgeHelpers/txn.d.ts.map +1 -0
  221. package/lib-es/bridge/bridgeHelpers/txn.js +158 -0
  222. package/lib-es/bridge/bridgeHelpers/txn.js.map +1 -0
  223. package/lib-es/bridge/js.d.ts +12 -0
  224. package/lib-es/bridge/js.d.ts.map +1 -0
  225. package/lib-es/bridge/js.js +56 -0
  226. package/lib-es/bridge/js.js.map +1 -0
  227. package/lib-es/broadcast.d.ts +5 -0
  228. package/lib-es/broadcast.d.ts.map +1 -0
  229. package/lib-es/broadcast.js +17 -0
  230. package/lib-es/broadcast.js.map +1 -0
  231. package/lib-es/cli-transaction.d.ts +12 -0
  232. package/lib-es/cli-transaction.d.ts.map +1 -0
  233. package/lib-es/cli-transaction.js +15 -0
  234. package/lib-es/cli-transaction.js.map +1 -0
  235. package/lib-es/config.d.ts +9 -0
  236. package/lib-es/config.d.ts.map +1 -0
  237. package/lib-es/config.js +11 -0
  238. package/lib-es/config.js.map +1 -0
  239. package/lib-es/createTransaction.d.ts +5 -0
  240. package/lib-es/createTransaction.d.ts.map +1 -0
  241. package/lib-es/createTransaction.js +14 -0
  242. package/lib-es/createTransaction.js.map +1 -0
  243. package/lib-es/deviceTransactionConfig.d.ts +11 -0
  244. package/lib-es/deviceTransactionConfig.d.ts.map +1 -0
  245. package/lib-es/deviceTransactionConfig.js +35 -0
  246. package/lib-es/deviceTransactionConfig.js.map +1 -0
  247. package/lib-es/errors.d.ts +4 -0
  248. package/lib-es/errors.d.ts.map +1 -0
  249. package/lib-es/errors.js +6 -0
  250. package/lib-es/errors.js.map +1 -0
  251. package/lib-es/estimateMaxSpendable.d.ts +5 -0
  252. package/lib-es/estimateMaxSpendable.d.ts.map +1 -0
  253. package/lib-es/estimateMaxSpendable.js +30 -0
  254. package/lib-es/estimateMaxSpendable.js.map +1 -0
  255. package/lib-es/getTransactionStatus.d.ts +5 -0
  256. package/lib-es/getTransactionStatus.d.ts.map +1 -0
  257. package/lib-es/getTransactionStatus.js +93 -0
  258. package/lib-es/getTransactionStatus.js.map +1 -0
  259. package/lib-es/hw-getAddress.d.ts +6 -0
  260. package/lib-es/hw-getAddress.d.ts.map +1 -0
  261. package/lib-es/hw-getAddress.js +29 -0
  262. package/lib-es/hw-getAddress.js.map +1 -0
  263. package/lib-es/hw-signMessage.d.ts +12 -0
  264. package/lib-es/hw-signMessage.d.ts.map +1 -0
  265. package/lib-es/hw-signMessage.js +29 -0
  266. package/lib-es/hw-signMessage.js.map +1 -0
  267. package/lib-es/prepareTransaction.d.ts +5 -0
  268. package/lib-es/prepareTransaction.d.ts.map +1 -0
  269. package/lib-es/prepareTransaction.js +27 -0
  270. package/lib-es/prepareTransaction.js.map +1 -0
  271. package/lib-es/signOperation.d.ts +11 -0
  272. package/lib-es/signOperation.d.ts.map +1 -0
  273. package/lib-es/signOperation.js +91 -0
  274. package/lib-es/signOperation.js.map +1 -0
  275. package/lib-es/signer.d.ts +27 -0
  276. package/lib-es/signer.d.ts.map +1 -0
  277. package/lib-es/signer.js +2 -0
  278. package/lib-es/signer.js.map +1 -0
  279. package/lib-es/specs.d.ts +8 -0
  280. package/lib-es/specs.d.ts.map +1 -0
  281. package/lib-es/specs.js +99 -0
  282. package/lib-es/specs.js.map +1 -0
  283. package/lib-es/speculos-deviceActions.d.ts +4 -0
  284. package/lib-es/speculos-deviceActions.d.ts.map +1 -0
  285. package/lib-es/speculos-deviceActions.js +31 -0
  286. package/lib-es/speculos-deviceActions.js.map +1 -0
  287. package/lib-es/synchronisation.d.ts +5 -0
  288. package/lib-es/synchronisation.d.ts.map +1 -0
  289. package/lib-es/synchronisation.js +88 -0
  290. package/lib-es/synchronisation.js.map +1 -0
  291. package/lib-es/transaction.d.ts +14 -0
  292. package/lib-es/transaction.d.ts.map +1 -0
  293. package/lib-es/transaction.js +33 -0
  294. package/lib-es/transaction.js.map +1 -0
  295. package/lib-es/types.d.ts +65 -0
  296. package/lib-es/types.d.ts.map +1 -0
  297. package/lib-es/types.js +2 -0
  298. package/lib-es/types.js.map +1 -0
  299. package/lib-es/utils.d.ts +11 -0
  300. package/lib-es/utils.d.ts.map +1 -0
  301. package/lib-es/utils.js +112 -0
  302. package/lib-es/utils.js.map +1 -0
  303. package/package.json +86 -0
  304. package/src/__tests__/fixtures/api.fixtures.ts +39 -0
  305. package/src/__tests__/fixtures/common.fixtures.ts +139 -0
  306. package/src/__tests__/integration/bridge.integration.test.ts +135 -0
  307. package/src/__tests__/unit/api.unit.test.ts +60 -0
  308. package/src/__tests__/unit/broadcast.unit.test.ts +36 -0
  309. package/src/__tests__/unit/createTransaction.unit.test.ts +20 -0
  310. package/src/__tests__/unit/deviceTransactionConfig.unit.test.ts +69 -0
  311. package/src/__tests__/unit/estimateMaxSpendable.unit.test.ts +19 -0
  312. package/src/__tests__/unit/getTransactionStatus.unit.test.ts +119 -0
  313. package/src/__tests__/unit/hw-getAddress.unit.test.ts +58 -0
  314. package/src/__tests__/unit/prepareTransaction.unit.test.ts +52 -0
  315. package/src/__tests__/unit/signOperation.unit.test.ts +90 -0
  316. package/src/__tests__/unit/txn.unit.test.ts +121 -0
  317. package/src/__tests__/unit/utils.unit.test.ts +126 -0
  318. package/src/bridge/bridgeHelpers/api.ts +104 -0
  319. package/src/bridge/bridgeHelpers/api.types.ts +178 -0
  320. package/src/bridge/bridgeHelpers/txn.ts +166 -0
  321. package/src/bridge/js.ts +65 -0
  322. package/src/broadcast.ts +13 -0
  323. package/src/cli-transaction.ts +30 -0
  324. package/src/config.ts +21 -0
  325. package/src/createTransaction.ts +17 -0
  326. package/src/deviceTransactionConfig.ts +48 -0
  327. package/src/errors.ts +6 -0
  328. package/src/estimateMaxSpendable.ts +40 -0
  329. package/src/getTransactionStatus.ts +130 -0
  330. package/src/hw-getAddress.ts +28 -0
  331. package/src/hw-signMessage.ts +31 -0
  332. package/src/prepareTransaction.ts +27 -0
  333. package/src/signOperation.ts +115 -0
  334. package/src/signer.ts +32 -0
  335. package/src/specs.ts +122 -0
  336. package/src/speculos-deviceActions.ts +38 -0
  337. package/src/synchronisation.ts +91 -0
  338. package/src/transaction.ts +61 -0
  339. package/src/types.ts +82 -0
  340. package/src/utils.ts +120 -0
  341. package/tsconfig.json +12 -0
@@ -0,0 +1,139 @@
1
+ import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
2
+ import { Account } from "@ledgerhq/types-live";
3
+ import BigNumber from "bignumber.js";
4
+ import {
5
+ TonAccountInfo,
6
+ TonResponseEstimateFee,
7
+ TonResponseWalletInfo,
8
+ TonTransactionsList,
9
+ } from "../../bridge/bridgeHelpers/api.types";
10
+ import type { Transaction } from "../../types";
11
+
12
+ export const mockAddress = "UQDzd8aeBOU-jqYw_ZSuZjceI5p-F4b7HMprAsUJAtRPbMol";
13
+ export const mockAccountId =
14
+ "js:2:ton:b19891a06654f21c64147550b3321bef63acd25b5dd61b688b022c42fac4831d:ton";
15
+
16
+ export const account = {
17
+ id: mockAccountId,
18
+ freshAddress: mockAddress,
19
+ freshAddressPath: "44'/607'/0'/0'/0'/0'",
20
+ xpub: "",
21
+ type: "Account",
22
+ currency: getCryptoCurrencyById("ton"),
23
+ spendableBalance: new BigNumber("1000000000"),
24
+ balance: new BigNumber("1000000000"),
25
+ seedIdentifier: "seedIdentifier",
26
+ } as Account;
27
+
28
+ export const transaction = {
29
+ mode: "send",
30
+ recipient: "UQCOvQLYvTcbi5tL9MaDNzuVl3-J3vATimNm9yO5XPafLfV4",
31
+ amount: new BigNumber("1000000"),
32
+ useAllAmount: false,
33
+ comment: { isEncrypted: false, text: "" },
34
+ payload: "",
35
+ family: "ton",
36
+ } as unknown as Transaction;
37
+
38
+ export const fees = {
39
+ in_fwd_fee: 10000,
40
+ storage_fee: 10000,
41
+ gas_fee: 10000,
42
+ fwd_fee: 10000,
43
+ };
44
+
45
+ export const totalFees = BigNumber(
46
+ fees.fwd_fee + fees.gas_fee + fees.in_fwd_fee + fees.storage_fee,
47
+ );
48
+
49
+ export const lastBlockNumber = {
50
+ last: {
51
+ seqno: 38574413,
52
+ },
53
+ first: {
54
+ seqno: 3,
55
+ },
56
+ };
57
+
58
+ export const tonAccount: TonAccountInfo = {
59
+ balance: "1000000000",
60
+ last_transaction_lt: "47055058000008",
61
+ last_transaction_hash: "psVQqt6rf/Lo6xyLzxx0to0jUIx8I2/4znOVf2KhAI0=",
62
+ status: "active",
63
+ seqno: 3,
64
+ };
65
+
66
+ export const tonWallet: TonResponseWalletInfo = {
67
+ balance: "7726736262",
68
+ wallet_type: "wallet v4 r2",
69
+ seqno: 22,
70
+ wallet_id: 698983191,
71
+ last_transaction_lt: "47055058000008",
72
+ last_transaction_hash: "psVQqt6rf/Lo6xyLzxx0to0jUIx8I2/4znOVf2KhAI0=",
73
+ status: "active",
74
+ };
75
+
76
+ export const tonEstimateFee: TonResponseEstimateFee = {
77
+ source_fees: fees,
78
+ destination_fees: [],
79
+ };
80
+
81
+ export const tonTransactionResponse: TonTransactionsList = {
82
+ transactions: [
83
+ {
84
+ account: mockAddress,
85
+ hash: "hash",
86
+ lt: "lt",
87
+ now: 1718241443,
88
+ orig_status: "active",
89
+ end_status: "active",
90
+ total_fees: "0",
91
+ prev_trans_hash: "",
92
+ prev_trans_lt: "",
93
+ description: {
94
+ aborted: true,
95
+ destroyed: false,
96
+ compute_ph: {
97
+ success: false,
98
+ exit_code: -14,
99
+ },
100
+ credit_first: true,
101
+ },
102
+ block_ref: null,
103
+ in_msg: {
104
+ source: "0:959EAA8BD0E3A2662D814278D51A6F997946207D48478008BEBE7F45F3EF781F",
105
+ destination: mockAddress,
106
+ value: "13509565",
107
+ hash: "inMsgHash",
108
+ fwd_fee: "266669",
109
+ ihr_fee: "0",
110
+ created_lt: "47055058000007",
111
+ created_at: "1718241443",
112
+ opcode: "0xd53276db",
113
+ ihr_disabled: true,
114
+ bounce: false,
115
+ bounced: false,
116
+ import_fee: null,
117
+ message_content: {
118
+ hash: "Qa0w2xg42wA9taurO/aCVOqGTzjOeP3EpzD2Sl7tTss=",
119
+ body: "te6cckEBAQEADgAAGNUydtsAAAAAAAAAAfRC8y4=",
120
+ decoded: null,
121
+ },
122
+ init_state: null,
123
+ },
124
+ out_msgs: [],
125
+ account_state_before: null,
126
+ account_state_after: null,
127
+ mc_block_seqno: 3,
128
+ },
129
+ ],
130
+ address_book: {},
131
+ };
132
+
133
+ export const accountInfo: TonAccountInfo = {
134
+ balance: "7726736262",
135
+ last_transaction_lt: "47055058000008",
136
+ last_transaction_hash: "lastTransactionHash",
137
+ status: "active",
138
+ seqno: 22,
139
+ };
@@ -0,0 +1,135 @@
1
+ import { InvalidAddress, NotEnoughBalance } from "@ledgerhq/errors";
2
+ import { CurrenciesData, DatasetTest } from "@ledgerhq/types-live";
3
+ import BigNumber from "bignumber.js";
4
+ import { TonCommentInvalid } from "../../errors";
5
+ import { fromTransactionRaw } from "../../transaction";
6
+ import { Transaction } from "../../types";
7
+
8
+ const PUBKEY = "86196cb40cd25e9e696bc808e3f2c074ce0b39f2a2a9d482a68eafef86e4a060";
9
+ const ADDRESS = "UQCOvQLYvTcbi5tL9MaDNzuVl3-J3vATimNm9yO5XPafLfV4";
10
+ const ADDRESS_2 = "UQAui6M4jOYOezUGfmeONA22Ars9yjd34YIGdAR1Pcpp4sgR";
11
+ const PATH = "44'/607'/0'/0'/0'/0'";
12
+
13
+ const ton: CurrenciesData<Transaction> = {
14
+ scanAccounts: [
15
+ {
16
+ name: "ton seed 1",
17
+ apdus: `
18
+ => e005000019068000002c8000025f80000000800000008000000080000000
19
+ <= 86196cb40cd25e9e696bc808e3f2c074ce0b39f2a2a9d482a68eafef86e4a0609000
20
+ => e005000019068000002c8000025f80000000800000008000000180000000
21
+ <= b5177c2b32f9d72fa8c673cc3d61acec6a9f68eb5e4945445fdbb48a45eb48879000
22
+ `,
23
+ test: (expect, accounts) => {
24
+ for (const account of accounts) {
25
+ expect(account.derivationMode).toEqual("ton");
26
+ }
27
+ },
28
+ },
29
+ ],
30
+ accounts: [
31
+ {
32
+ FIXME_tests: ["balance is sum of ops"],
33
+ raw: {
34
+ id: `js:2:ton:${PUBKEY}:ton`,
35
+ currencyId: "ton",
36
+ seedIdentifier: PUBKEY,
37
+ name: "TON 1",
38
+ derivationMode: "ton",
39
+ index: 0,
40
+ freshAddress: ADDRESS,
41
+ freshAddressPath: PATH,
42
+ xpub: PUBKEY,
43
+ blockHeight: 0,
44
+ operations: [],
45
+ pendingOperations: [],
46
+ lastSyncDate: "",
47
+ balance: "5000000000",
48
+ subAccounts: [],
49
+ },
50
+ transactions: [
51
+ {
52
+ name: "Not a valid address",
53
+ transaction: fromTransactionRaw({
54
+ family: "ton",
55
+ recipient: "novalidaddress",
56
+ fees: "10000000",
57
+ amount: "1000",
58
+ comment: { isEncrypted: false, text: "" },
59
+ }),
60
+ expectedStatus: {
61
+ errors: {
62
+ recipient: new InvalidAddress(),
63
+ },
64
+ warnings: {},
65
+ },
66
+ },
67
+ {
68
+ name: "Not enough balance",
69
+ transaction: fromTransactionRaw({
70
+ family: "ton",
71
+ recipient: ADDRESS_2,
72
+ fees: "10000000",
73
+ amount: (300 * 1e9).toString(),
74
+ comment: { isEncrypted: false, text: "" },
75
+ }),
76
+ expectedStatus: {
77
+ errors: {
78
+ amount: new NotEnoughBalance(),
79
+ },
80
+ warnings: {},
81
+ },
82
+ },
83
+ {
84
+ name: "Invalid transferID/Memo",
85
+ transaction: fromTransactionRaw({
86
+ family: "ton",
87
+ recipient: ADDRESS_2,
88
+ fees: "10000000",
89
+ amount: (1 * 1e9).toString(),
90
+ comment: { isEncrypted: false, text: "😀" },
91
+ }),
92
+ expectedStatus: {
93
+ errors: {
94
+ comment: new TonCommentInvalid(),
95
+ },
96
+ warnings: {},
97
+ },
98
+ },
99
+ {
100
+ name: "New account and sufficient amount",
101
+ transaction: fromTransactionRaw({
102
+ family: "ton",
103
+ recipient: ADDRESS_2,
104
+ fees: "10000000",
105
+ amount: "10000000",
106
+ comment: { isEncrypted: false, text: "Valid" },
107
+ }),
108
+ expectedStatus: {
109
+ amount: new BigNumber("10000000"),
110
+ errors: {},
111
+ warnings: {},
112
+ },
113
+ },
114
+ ],
115
+ },
116
+ ],
117
+ };
118
+
119
+ export const dataset: DatasetTest<Transaction> = {
120
+ implementations: ["js"],
121
+ currencies: {
122
+ ton,
123
+ },
124
+ };
125
+
126
+ /**
127
+ * NOTE: if tests are added to this file,
128
+ * like done in libs/coin-polkadot/src/bridge.integration.test.ts for example,
129
+ * this file fill need to be imported in ledger-live-common
130
+ * libs/ledger-live-common/src/families/ton/bridge.integration.test.ts
131
+ * like done for polkadot.
132
+ * cf.
133
+ * - libs/coin-polkadot/src/bridge.integration.test.ts
134
+ * - libs/ledger-live-common/src/families/polkadot/bridge.integration.test.ts
135
+ */
@@ -0,0 +1,60 @@
1
+ import {
2
+ estimateFee,
3
+ fetchAccountInfo,
4
+ fetchLastBlockNumber,
5
+ fetchTransactions,
6
+ } from "../../bridge/bridgeHelpers/api";
7
+ import { setCoinConfig } from "../../config";
8
+ import mockServer, { API_TON_ENDPOINT } from "../fixtures/api.fixtures";
9
+ import {
10
+ lastBlockNumber,
11
+ mockAddress,
12
+ tonAccount,
13
+ tonEstimateFee,
14
+ tonTransactionResponse,
15
+ tonWallet,
16
+ } from "../fixtures/common.fixtures";
17
+
18
+ describe("getAccount", () => {
19
+ beforeAll(() => {
20
+ setCoinConfig(() => ({
21
+ status: {
22
+ type: "active",
23
+ },
24
+ infra: {
25
+ API_TON_ENDPOINT: API_TON_ENDPOINT,
26
+ },
27
+ }));
28
+ mockServer.listen();
29
+ });
30
+
31
+ afterAll(() => {
32
+ mockServer.close();
33
+ });
34
+
35
+ it("should return last block number", async () => {
36
+ const result = await fetchLastBlockNumber();
37
+ expect(result).toEqual(lastBlockNumber.last.seqno);
38
+ });
39
+
40
+ it("should return the transactions of an address", async () => {
41
+ const result = await fetchTransactions(mockAddress);
42
+ expect(result).toEqual(tonTransactionResponse);
43
+ });
44
+
45
+ it("should return the ton account info of an address", async () => {
46
+ const result = await fetchAccountInfo(mockAddress);
47
+ expect(result).toEqual({
48
+ balance: tonAccount.balance,
49
+ last_transaction_lt: tonAccount.last_transaction_lt,
50
+ last_transaction_hash: tonAccount.last_transaction_hash,
51
+ status: tonAccount.status,
52
+ seqno: tonWallet.seqno,
53
+ });
54
+ });
55
+
56
+ it("should return the estimated fees", async () => {
57
+ const result = await estimateFee(mockAddress, "");
58
+ expect(result).toEqual(tonEstimateFee.source_fees);
59
+ });
60
+ });
@@ -0,0 +1,36 @@
1
+ import { encodeOperationId } from "@ledgerhq/coin-framework/lib/operation";
2
+ import { broadcastTx } from "../../bridge/bridgeHelpers/api";
3
+ import broadcast from "../../broadcast";
4
+ import { buildOptimisticOperation } from "../../signOperation";
5
+ import { account, transaction } from "../fixtures/common.fixtures";
6
+
7
+ jest.mock("../../bridge/bridgeHelpers/api");
8
+ const mockedHash = "validHash";
9
+
10
+ describe("broadcast", () => {
11
+ beforeAll(() => {
12
+ const broadcastTxMock = jest.mocked(broadcastTx);
13
+ broadcastTxMock.mockReturnValue(Promise.resolve(mockedHash));
14
+ });
15
+
16
+ it("should broadcast the coin transaction and add the hash in the optimistic transaction", async () => {
17
+ const optimisticCoinOperation = buildOptimisticOperation(account, transaction);
18
+
19
+ const finalOperation = await broadcast({
20
+ account,
21
+ signedOperation: {
22
+ operation: optimisticCoinOperation,
23
+ signature: "0xS1gn4tUR3",
24
+ },
25
+ });
26
+
27
+ expect(broadcastTx).toHaveBeenCalled();
28
+ expect(finalOperation).toEqual({
29
+ ...optimisticCoinOperation,
30
+ id: encodeOperationId(account.id, mockedHash, "OUT"),
31
+ hash: mockedHash,
32
+ subOperations: [],
33
+ nftOperations: [],
34
+ });
35
+ });
36
+ });
@@ -0,0 +1,20 @@
1
+ import BigNumber from "bignumber.js";
2
+ import createTransaction from "../../createTransaction";
3
+ import { account } from "../fixtures/common.fixtures";
4
+
5
+ describe("createTransaction", () => {
6
+ it("should create a valid transaction", async () => {
7
+ const res = createTransaction(account);
8
+ expect(res).toEqual({
9
+ family: "ton",
10
+ amount: new BigNumber(0),
11
+ fees: new BigNumber(0),
12
+ recipient: "",
13
+ useAllAmount: false,
14
+ comment: {
15
+ isEncrypted: false,
16
+ text: "",
17
+ },
18
+ });
19
+ });
20
+ });
@@ -0,0 +1,69 @@
1
+ import BigNumber from "bignumber.js";
2
+ import getDeviceTransactionConfig from "../../deviceTransactionConfig";
3
+ import { account, transaction as baseTransaction } from "../fixtures/common.fixtures";
4
+
5
+ const status = {
6
+ errors: {},
7
+ warnings: {},
8
+ estimatedFees: new BigNumber(0),
9
+ amount: new BigNumber(0),
10
+ totalSpent: new BigNumber(0),
11
+ };
12
+
13
+ describe("deviceTransactionConfig", () => {
14
+ describe("TON transaction", () => {
15
+ it("should return the fields for a transaction when there is a valid comment", async () => {
16
+ const transaction = {
17
+ ...baseTransaction,
18
+ comment: { isEncrypted: false, text: "validComment" },
19
+ };
20
+ const res = await getDeviceTransactionConfig({
21
+ account: account,
22
+ parentAccount: undefined,
23
+ transaction,
24
+ status,
25
+ });
26
+ expect(res).toEqual([
27
+ {
28
+ type: "address",
29
+ label: "To",
30
+ address: transaction.recipient,
31
+ },
32
+ {
33
+ type: "amount",
34
+ label: "Amount",
35
+ },
36
+ { type: "fees", label: "Fee" },
37
+ { type: "text", label: "Comment", value: "validComment" },
38
+ ]);
39
+ });
40
+
41
+ it("should return the fields for a transaction when useAllAmount is true and there is a valid comment", async () => {
42
+ const transaction = {
43
+ ...baseTransaction,
44
+ useAllAmount: true,
45
+ comment: { isEncrypted: false, text: "validComment" },
46
+ };
47
+ const res = await getDeviceTransactionConfig({
48
+ account: account,
49
+ parentAccount: undefined,
50
+ transaction,
51
+ status,
52
+ });
53
+ expect(res).toEqual([
54
+ {
55
+ type: "address",
56
+ label: "To",
57
+ address: transaction.recipient,
58
+ },
59
+ {
60
+ type: "text",
61
+ label: "Amount",
62
+ value: "ALL YOUR TONs",
63
+ },
64
+ { type: "fees", label: "Fee" },
65
+ { type: "text", label: "Comment", value: "validComment" },
66
+ ]);
67
+ });
68
+ });
69
+ });
@@ -0,0 +1,19 @@
1
+ import { estimateFee, fetchAccountInfo } from "../../bridge/bridgeHelpers/api";
2
+ import estimateMaxSpendable from "../../estimateMaxSpendable";
3
+ import { account, accountInfo, fees, totalFees, transaction } from "../fixtures/common.fixtures";
4
+
5
+ jest.mock("../../bridge/bridgeHelpers/api");
6
+
7
+ describe("estimateMaxSpendable", () => {
8
+ beforeAll(() => {
9
+ const fetchAccountInfoMock = jest.mocked(fetchAccountInfo);
10
+ fetchAccountInfoMock.mockReturnValue(Promise.resolve(accountInfo));
11
+ const fetchEstimateFeeMock = jest.mocked(estimateFee);
12
+ fetchEstimateFeeMock.mockReturnValue(Promise.resolve(fees));
13
+ });
14
+
15
+ it("should return the max spendable for a TON transaction", async () => {
16
+ const res = await estimateMaxSpendable({ account, transaction });
17
+ expect(res).toEqual(account.balance.minus(totalFees));
18
+ });
19
+ });
@@ -0,0 +1,119 @@
1
+ import {
2
+ AmountRequired,
3
+ InvalidAddress,
4
+ InvalidAddressBecauseDestinationIsAlsoSource,
5
+ NotEnoughBalance,
6
+ RecipientRequired,
7
+ } from "@ledgerhq/errors";
8
+ import BigNumber from "bignumber.js";
9
+ import { TonCommentInvalid } from "../../errors";
10
+ import getTransactionStatus from "../../getTransactionStatus";
11
+ import { account, transaction as baseTransaction } from "../fixtures/common.fixtures";
12
+
13
+ describe("getTransactionStatus", () => {
14
+ describe("Recipient", () => {
15
+ it("should detect the missing recipient and have an error", async () => {
16
+ const transaction = { ...baseTransaction, recipient: "" };
17
+ const res = await getTransactionStatus(account, transaction);
18
+ expect(res.errors).toEqual(
19
+ expect.objectContaining({
20
+ recipient: new RecipientRequired(),
21
+ }),
22
+ );
23
+ });
24
+
25
+ it("should detect the incorrect recipient and have an error", async () => {
26
+ const transaction = { ...baseTransaction, recipient: "isInvalid" };
27
+ const res = await getTransactionStatus(account, transaction);
28
+ expect(res.errors).toEqual(
29
+ expect.objectContaining({
30
+ recipient: new InvalidAddress("", {
31
+ currencyName: account.currency.name,
32
+ }),
33
+ }),
34
+ );
35
+ });
36
+
37
+ it("should detect the recipient and the sender are the same and have an error", async () => {
38
+ const transaction = {
39
+ ...baseTransaction,
40
+ recipient: "UQDzd8aeBOU-jqYw_ZSuZjceI5p-F4b7HMprAsUJAtRPbMol",
41
+ };
42
+ const res = await getTransactionStatus(account, transaction);
43
+ expect(res.errors).toEqual(
44
+ expect.objectContaining({
45
+ recipient: new InvalidAddressBecauseDestinationIsAlsoSource("", {
46
+ currencyName: account.currency.name,
47
+ }),
48
+ }),
49
+ );
50
+ });
51
+ });
52
+
53
+ describe("Sender", () => {
54
+ it("should detect the sender is not correct and have an error", async () => {
55
+ const tempAccount = { ...account, freshAddress: "isInvalid" };
56
+ const res = await getTransactionStatus(tempAccount, baseTransaction);
57
+ expect(res.errors).toEqual(
58
+ expect.objectContaining({
59
+ sender: new InvalidAddress(),
60
+ }),
61
+ );
62
+ });
63
+ });
64
+
65
+ describe("Amount", () => {
66
+ it("should detect the amount is missing and have an error", async () => {
67
+ const transaction = { ...baseTransaction, amount: new BigNumber(0) };
68
+ const res = await getTransactionStatus(account, transaction);
69
+ expect(res.errors).toEqual(
70
+ expect.objectContaining({
71
+ amount: new AmountRequired(),
72
+ }),
73
+ );
74
+ });
75
+
76
+ it("should detect the amount is greater than the spendable amount and have an error", async () => {
77
+ const transaction = {
78
+ ...baseTransaction,
79
+ amount: BigNumber(1000000002),
80
+ fees: new BigNumber("20"),
81
+ };
82
+ const res = await getTransactionStatus(account, transaction);
83
+ expect(res.errors).toEqual(
84
+ expect.objectContaining({
85
+ amount: new NotEnoughBalance(),
86
+ }),
87
+ );
88
+ });
89
+
90
+ describe("Comment", () => {
91
+ it("should detect the comment is not valid and have an error", async () => {
92
+ const transaction = {
93
+ ...baseTransaction,
94
+ comment: { isEncrypted: false, text: "comment\nInvalid" },
95
+ };
96
+ const res = await getTransactionStatus(account, transaction);
97
+ expect(res.errors).toEqual(
98
+ expect.objectContaining({
99
+ transaction: new TonCommentInvalid(),
100
+ }),
101
+ );
102
+ });
103
+ });
104
+
105
+ describe("Successful transaction", () => {
106
+ it("should not have errors", async () => {
107
+ const successfulResult = {
108
+ amount: baseTransaction.amount,
109
+ errors: {},
110
+ warnings: {},
111
+ estimatedFees: baseTransaction.fees,
112
+ totalSpent: baseTransaction.amount.plus(baseTransaction.fees),
113
+ };
114
+ const res = await getTransactionStatus(account, baseTransaction);
115
+ expect(res).toEqual(successfulResult);
116
+ });
117
+ });
118
+ });
119
+ });
@@ -0,0 +1,58 @@
1
+ import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets";
2
+ import resolver from "../../hw-getAddress";
3
+ import { TonSigner } from "../../signer";
4
+ import { getLedgerTonPath } from "../../utils";
5
+
6
+ const address = "0xc3f95102d5c8f2c83e49ce3acfb905edfb7f37de";
7
+ const publicKey = "mockedPublicKey";
8
+ const spyGetAddress = jest.fn().mockImplementation(async () =>
9
+ Promise.resolve({
10
+ publicKey,
11
+ address: address.toLowerCase(),
12
+ }),
13
+ );
14
+ const spyValidateAddress = jest.fn().mockImplementation(async () =>
15
+ Promise.resolve({
16
+ publicKey,
17
+ address: address.toLowerCase(),
18
+ }),
19
+ );
20
+
21
+ const mockSignerFactory = <T>(_: string, fn: (signer: TonSigner) => Promise<T>): Promise<T> =>
22
+ fn({
23
+ getAddress: spyGetAddress,
24
+ validateAddress: spyValidateAddress,
25
+ signTransaction: jest.fn(),
26
+ });
27
+
28
+ describe("hw-getAddress", () => {
29
+ it("should return an encoded address and a public key when verifiy is false", async () => {
30
+ const getAddress = resolver(mockSignerFactory);
31
+ const response = await getAddress("deviceId", {
32
+ path: "44'/607'/0'/0'/0'/0'",
33
+ verify: false,
34
+ currency: getCryptoCurrencyById("ton"),
35
+ derivationMode: "ton",
36
+ });
37
+ expect(response.address).toBe(address);
38
+ expect(response.publicKey).toBe(publicKey);
39
+ expect(spyGetAddress).toHaveBeenCalledWith(getLedgerTonPath("44'/607'/0'/0'/0'/0'"), {
40
+ bounceable: false,
41
+ });
42
+ });
43
+
44
+ it("should return an encoded address and a public key when verifiy is true", async () => {
45
+ const getAddress = resolver(mockSignerFactory);
46
+ const response = await getAddress("deviceId", {
47
+ path: "44'/607'/0'/0'/0'/0'",
48
+ verify: true,
49
+ currency: getCryptoCurrencyById("ton"),
50
+ derivationMode: "ton",
51
+ });
52
+ expect(response.address).toBe(address);
53
+ expect(response.publicKey).toBe(publicKey);
54
+ expect(spyValidateAddress).toHaveBeenCalledWith(getLedgerTonPath("44'/607'/0'/0'/0'/0'"), {
55
+ bounceable: false,
56
+ });
57
+ });
58
+ });