@ledgerhq/coin-concordium 0.2.0-nightly.20251209140356

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 (385) hide show
  1. package/.env.integ.test.example +2 -0
  2. package/.eslintrc.js +37 -0
  3. package/.turbo/turbo-build.log +4 -0
  4. package/.unimportedrc.json +29 -0
  5. package/CHANGELOG.md +18 -0
  6. package/LICENSE.txt +21 -0
  7. package/jest.config.js +21 -0
  8. package/jest.integ.config.js +8 -0
  9. package/lib/api/index.d.ts +4 -0
  10. package/lib/api/index.d.ts.map +1 -0
  11. package/lib/api/index.js +56 -0
  12. package/lib/api/index.js.map +1 -0
  13. package/lib/bridge/broadcast.d.ts +4 -0
  14. package/lib/bridge/broadcast.d.ts.map +1 -0
  15. package/lib/bridge/broadcast.js +11 -0
  16. package/lib/bridge/broadcast.js.map +1 -0
  17. package/lib/bridge/createTransaction.d.ts +4 -0
  18. package/lib/bridge/createTransaction.d.ts.map +1 -0
  19. package/lib/bridge/createTransaction.js +19 -0
  20. package/lib/bridge/createTransaction.js.map +1 -0
  21. package/lib/bridge/deviceTransactionConfig.d.ts +11 -0
  22. package/lib/bridge/deviceTransactionConfig.d.ts.map +1 -0
  23. package/lib/bridge/deviceTransactionConfig.js +21 -0
  24. package/lib/bridge/deviceTransactionConfig.js.map +1 -0
  25. package/lib/bridge/estimateMaxSpendable.d.ts +4 -0
  26. package/lib/bridge/estimateMaxSpendable.d.ts.map +1 -0
  27. package/lib/bridge/estimateMaxSpendable.js +26 -0
  28. package/lib/bridge/estimateMaxSpendable.js.map +1 -0
  29. package/lib/bridge/getTransactionStatus.d.ts +4 -0
  30. package/lib/bridge/getTransactionStatus.d.ts.map +1 -0
  31. package/lib/bridge/getTransactionStatus.js +78 -0
  32. package/lib/bridge/getTransactionStatus.js.map +1 -0
  33. package/lib/bridge/index.d.ts +11 -0
  34. package/lib/bridge/index.d.ts.map +1 -0
  35. package/lib/bridge/index.js +54 -0
  36. package/lib/bridge/index.js.map +1 -0
  37. package/lib/bridge/prepareTransaction.d.ts +4 -0
  38. package/lib/bridge/prepareTransaction.d.ts.map +1 -0
  39. package/lib/bridge/prepareTransaction.js +20 -0
  40. package/lib/bridge/prepareTransaction.js.map +1 -0
  41. package/lib/bridge/signOperation.d.ts +5 -0
  42. package/lib/bridge/signOperation.d.ts.map +1 -0
  43. package/lib/bridge/signOperation.js +75 -0
  44. package/lib/bridge/signOperation.js.map +1 -0
  45. package/lib/bridge/sync.d.ts +3 -0
  46. package/lib/bridge/sync.d.ts.map +1 -0
  47. package/lib/bridge/sync.js +86 -0
  48. package/lib/bridge/sync.js.map +1 -0
  49. package/lib/bridge/transaction.d.ts +15 -0
  50. package/lib/bridge/transaction.d.ts.map +1 -0
  51. package/lib/bridge/transaction.js +50 -0
  52. package/lib/bridge/transaction.js.map +1 -0
  53. package/lib/bridge/updateTransaction.d.ts +4 -0
  54. package/lib/bridge/updateTransaction.d.ts.map +1 -0
  55. package/lib/bridge/updateTransaction.js +17 -0
  56. package/lib/bridge/updateTransaction.js.map +1 -0
  57. package/lib/common-logic/account/getBalance.d.ts +3 -0
  58. package/lib/common-logic/account/getBalance.d.ts.map +1 -0
  59. package/lib/common-logic/account/getBalance.js +10 -0
  60. package/lib/common-logic/account/getBalance.js.map +1 -0
  61. package/lib/common-logic/account/getNextSequence.d.ts +2 -0
  62. package/lib/common-logic/account/getNextSequence.d.ts.map +1 -0
  63. package/lib/common-logic/account/getNextSequence.js +9 -0
  64. package/lib/common-logic/account/getNextSequence.js.map +1 -0
  65. package/lib/common-logic/common.d.ts +3 -0
  66. package/lib/common-logic/common.d.ts.map +1 -0
  67. package/lib/common-logic/common.js +11 -0
  68. package/lib/common-logic/common.js.map +1 -0
  69. package/lib/common-logic/history/lastBlock.d.ts +3 -0
  70. package/lib/common-logic/history/lastBlock.d.ts.map +1 -0
  71. package/lib/common-logic/history/lastBlock.js +13 -0
  72. package/lib/common-logic/history/lastBlock.js.map +1 -0
  73. package/lib/common-logic/history/listOperations.d.ts +11 -0
  74. package/lib/common-logic/history/listOperations.d.ts.map +1 -0
  75. package/lib/common-logic/history/listOperations.js +53 -0
  76. package/lib/common-logic/history/listOperations.js.map +1 -0
  77. package/lib/common-logic/index.d.ts +11 -0
  78. package/lib/common-logic/index.d.ts.map +1 -0
  79. package/lib/common-logic/index.js +24 -0
  80. package/lib/common-logic/index.js.map +1 -0
  81. package/lib/common-logic/transaction/broadcast.d.ts +2 -0
  82. package/lib/common-logic/transaction/broadcast.d.ts.map +1 -0
  83. package/lib/common-logic/transaction/broadcast.js +9 -0
  84. package/lib/common-logic/transaction/broadcast.js.map +1 -0
  85. package/lib/common-logic/transaction/combine.d.ts +2 -0
  86. package/lib/common-logic/transaction/combine.d.ts.map +1 -0
  87. package/lib/common-logic/transaction/combine.js +9 -0
  88. package/lib/common-logic/transaction/combine.js.map +1 -0
  89. package/lib/common-logic/transaction/craftTransaction.d.ts +15 -0
  90. package/lib/common-logic/transaction/craftTransaction.d.ts.map +1 -0
  91. package/lib/common-logic/transaction/craftTransaction.js +20 -0
  92. package/lib/common-logic/transaction/craftTransaction.js.map +1 -0
  93. package/lib/common-logic/transaction/estimateFees.d.ts +2 -0
  94. package/lib/common-logic/transaction/estimateFees.d.ts.map +1 -0
  95. package/lib/common-logic/transaction/estimateFees.js +21 -0
  96. package/lib/common-logic/transaction/estimateFees.js.map +1 -0
  97. package/lib/common-logic/utils.d.ts +6 -0
  98. package/lib/common-logic/utils.d.ts.map +1 -0
  99. package/lib/common-logic/utils.js +22 -0
  100. package/lib/common-logic/utils.js.map +1 -0
  101. package/lib/config.d.ts +12 -0
  102. package/lib/config.d.ts.map +1 -0
  103. package/lib/config.js +9 -0
  104. package/lib/config.js.map +1 -0
  105. package/lib/index.d.ts +4 -0
  106. package/lib/index.d.ts.map +1 -0
  107. package/lib/index.js +21 -0
  108. package/lib/index.js.map +1 -0
  109. package/lib/network/indexer.d.ts +6 -0
  110. package/lib/network/indexer.d.ts.map +1 -0
  111. package/lib/network/indexer.js +19 -0
  112. package/lib/network/indexer.js.map +1 -0
  113. package/lib/network/mock-network.d.ts +5 -0
  114. package/lib/network/mock-network.d.ts.map +1 -0
  115. package/lib/network/mock-network.js +29 -0
  116. package/lib/network/mock-network.js.map +1 -0
  117. package/lib/network/node.d.ts +12 -0
  118. package/lib/network/node.d.ts.map +1 -0
  119. package/lib/network/node.js +92 -0
  120. package/lib/network/node.js.map +1 -0
  121. package/lib/network/types.d.ts +47 -0
  122. package/lib/network/types.d.ts.map +1 -0
  123. package/lib/network/types.js +7 -0
  124. package/lib/network/types.js.map +1 -0
  125. package/lib/signer/getAddress.d.ts +6 -0
  126. package/lib/signer/getAddress.d.ts.map +1 -0
  127. package/lib/signer/getAddress.js +14 -0
  128. package/lib/signer/getAddress.js.map +1 -0
  129. package/lib/signer/index.d.ts +6 -0
  130. package/lib/signer/index.d.ts.map +1 -0
  131. package/lib/signer/index.js +11 -0
  132. package/lib/signer/index.js.map +1 -0
  133. package/lib/test/bot-deviceActions.d.ts +4 -0
  134. package/lib/test/bot-deviceActions.d.ts.map +1 -0
  135. package/lib/test/bot-deviceActions.js +44 -0
  136. package/lib/test/bot-deviceActions.js.map +1 -0
  137. package/lib/test/bot-specs.d.ts +2 -0
  138. package/lib/test/bot-specs.d.ts.map +1 -0
  139. package/lib/test/bot-specs.js +79 -0
  140. package/lib/test/bot-specs.js.map +1 -0
  141. package/lib/test/bridgeDatasetTest.d.ts +5 -0
  142. package/lib/test/bridgeDatasetTest.d.ts.map +1 -0
  143. package/lib/test/bridgeDatasetTest.js +148 -0
  144. package/lib/test/bridgeDatasetTest.js.map +1 -0
  145. package/lib/test/cli.d.ts +26 -0
  146. package/lib/test/cli.d.ts.map +1 -0
  147. package/lib/test/cli.js +36 -0
  148. package/lib/test/cli.js.map +1 -0
  149. package/lib/test/index.d.ts +5 -0
  150. package/lib/test/index.d.ts.map +1 -0
  151. package/lib/test/index.js +26 -0
  152. package/lib/test/index.js.map +1 -0
  153. package/lib/types/assets.d.ts +3 -0
  154. package/lib/types/assets.d.ts.map +1 -0
  155. package/lib/types/assets.js +3 -0
  156. package/lib/types/assets.js.map +1 -0
  157. package/lib/types/bridge.d.ts +23 -0
  158. package/lib/types/bridge.d.ts.map +1 -0
  159. package/lib/types/bridge.js +3 -0
  160. package/lib/types/bridge.js.map +1 -0
  161. package/lib/types/errors.d.ts +4 -0
  162. package/lib/types/errors.d.ts.map +1 -0
  163. package/lib/types/errors.js +6 -0
  164. package/lib/types/errors.js.map +1 -0
  165. package/lib/types/index.d.ts +13 -0
  166. package/lib/types/index.d.ts.map +1 -0
  167. package/lib/types/index.js +19 -0
  168. package/lib/types/index.js.map +1 -0
  169. package/lib/types/signer.d.ts +10 -0
  170. package/lib/types/signer.d.ts.map +1 -0
  171. package/lib/types/signer.js +3 -0
  172. package/lib/types/signer.js.map +1 -0
  173. package/lib-es/api/index.d.ts +4 -0
  174. package/lib-es/api/index.d.ts.map +1 -0
  175. package/lib-es/api/index.js +50 -0
  176. package/lib-es/api/index.js.map +1 -0
  177. package/lib-es/bridge/broadcast.d.ts +4 -0
  178. package/lib-es/bridge/broadcast.d.ts.map +1 -0
  179. package/lib-es/bridge/broadcast.js +7 -0
  180. package/lib-es/bridge/broadcast.js.map +1 -0
  181. package/lib-es/bridge/createTransaction.d.ts +4 -0
  182. package/lib-es/bridge/createTransaction.d.ts.map +1 -0
  183. package/lib-es/bridge/createTransaction.js +12 -0
  184. package/lib-es/bridge/createTransaction.js.map +1 -0
  185. package/lib-es/bridge/deviceTransactionConfig.d.ts +11 -0
  186. package/lib-es/bridge/deviceTransactionConfig.d.ts.map +1 -0
  187. package/lib-es/bridge/deviceTransactionConfig.js +19 -0
  188. package/lib-es/bridge/deviceTransactionConfig.js.map +1 -0
  189. package/lib-es/bridge/estimateMaxSpendable.d.ts +4 -0
  190. package/lib-es/bridge/estimateMaxSpendable.d.ts.map +1 -0
  191. package/lib-es/bridge/estimateMaxSpendable.js +19 -0
  192. package/lib-es/bridge/estimateMaxSpendable.js.map +1 -0
  193. package/lib-es/bridge/getTransactionStatus.d.ts +4 -0
  194. package/lib-es/bridge/getTransactionStatus.d.ts.map +1 -0
  195. package/lib-es/bridge/getTransactionStatus.js +71 -0
  196. package/lib-es/bridge/getTransactionStatus.js.map +1 -0
  197. package/lib-es/bridge/index.d.ts +11 -0
  198. package/lib-es/bridge/index.d.ts.map +1 -0
  199. package/lib-es/bridge/index.js +48 -0
  200. package/lib-es/bridge/index.js.map +1 -0
  201. package/lib-es/bridge/prepareTransaction.d.ts +4 -0
  202. package/lib-es/bridge/prepareTransaction.d.ts.map +1 -0
  203. package/lib-es/bridge/prepareTransaction.js +13 -0
  204. package/lib-es/bridge/prepareTransaction.js.map +1 -0
  205. package/lib-es/bridge/signOperation.d.ts +5 -0
  206. package/lib-es/bridge/signOperation.d.ts.map +1 -0
  207. package/lib-es/bridge/signOperation.js +68 -0
  208. package/lib-es/bridge/signOperation.js.map +1 -0
  209. package/lib-es/bridge/sync.d.ts +3 -0
  210. package/lib-es/bridge/sync.d.ts.map +1 -0
  211. package/lib-es/bridge/sync.js +79 -0
  212. package/lib-es/bridge/sync.js.map +1 -0
  213. package/lib-es/bridge/transaction.d.ts +15 -0
  214. package/lib-es/bridge/transaction.d.ts.map +1 -0
  215. package/lib-es/bridge/transaction.js +44 -0
  216. package/lib-es/bridge/transaction.js.map +1 -0
  217. package/lib-es/bridge/updateTransaction.d.ts +4 -0
  218. package/lib-es/bridge/updateTransaction.d.ts.map +1 -0
  219. package/lib-es/bridge/updateTransaction.js +13 -0
  220. package/lib-es/bridge/updateTransaction.js.map +1 -0
  221. package/lib-es/common-logic/account/getBalance.d.ts +3 -0
  222. package/lib-es/common-logic/account/getBalance.d.ts.map +1 -0
  223. package/lib-es/common-logic/account/getBalance.js +7 -0
  224. package/lib-es/common-logic/account/getBalance.js.map +1 -0
  225. package/lib-es/common-logic/account/getNextSequence.d.ts +2 -0
  226. package/lib-es/common-logic/account/getNextSequence.d.ts.map +1 -0
  227. package/lib-es/common-logic/account/getNextSequence.js +6 -0
  228. package/lib-es/common-logic/account/getNextSequence.js.map +1 -0
  229. package/lib-es/common-logic/common.d.ts +3 -0
  230. package/lib-es/common-logic/common.d.ts.map +1 -0
  231. package/lib-es/common-logic/common.js +7 -0
  232. package/lib-es/common-logic/common.js.map +1 -0
  233. package/lib-es/common-logic/history/lastBlock.d.ts +3 -0
  234. package/lib-es/common-logic/history/lastBlock.d.ts.map +1 -0
  235. package/lib-es/common-logic/history/lastBlock.js +10 -0
  236. package/lib-es/common-logic/history/lastBlock.js.map +1 -0
  237. package/lib-es/common-logic/history/listOperations.d.ts +11 -0
  238. package/lib-es/common-logic/history/listOperations.d.ts.map +1 -0
  239. package/lib-es/common-logic/history/listOperations.js +50 -0
  240. package/lib-es/common-logic/history/listOperations.js.map +1 -0
  241. package/lib-es/common-logic/index.d.ts +11 -0
  242. package/lib-es/common-logic/index.d.ts.map +1 -0
  243. package/lib-es/common-logic/index.js +11 -0
  244. package/lib-es/common-logic/index.js.map +1 -0
  245. package/lib-es/common-logic/transaction/broadcast.d.ts +2 -0
  246. package/lib-es/common-logic/transaction/broadcast.d.ts.map +1 -0
  247. package/lib-es/common-logic/transaction/broadcast.js +6 -0
  248. package/lib-es/common-logic/transaction/broadcast.js.map +1 -0
  249. package/lib-es/common-logic/transaction/combine.d.ts +2 -0
  250. package/lib-es/common-logic/transaction/combine.d.ts.map +1 -0
  251. package/lib-es/common-logic/transaction/combine.js +6 -0
  252. package/lib-es/common-logic/transaction/combine.js.map +1 -0
  253. package/lib-es/common-logic/transaction/craftTransaction.d.ts +15 -0
  254. package/lib-es/common-logic/transaction/craftTransaction.d.ts.map +1 -0
  255. package/lib-es/common-logic/transaction/craftTransaction.js +17 -0
  256. package/lib-es/common-logic/transaction/craftTransaction.js.map +1 -0
  257. package/lib-es/common-logic/transaction/estimateFees.d.ts +2 -0
  258. package/lib-es/common-logic/transaction/estimateFees.d.ts.map +1 -0
  259. package/lib-es/common-logic/transaction/estimateFees.js +18 -0
  260. package/lib-es/common-logic/transaction/estimateFees.js.map +1 -0
  261. package/lib-es/common-logic/utils.d.ts +6 -0
  262. package/lib-es/common-logic/utils.d.ts.map +1 -0
  263. package/lib-es/common-logic/utils.js +13 -0
  264. package/lib-es/common-logic/utils.js.map +1 -0
  265. package/lib-es/config.d.ts +12 -0
  266. package/lib-es/config.d.ts.map +1 -0
  267. package/lib-es/config.js +4 -0
  268. package/lib-es/config.js.map +1 -0
  269. package/lib-es/index.d.ts +4 -0
  270. package/lib-es/index.d.ts.map +1 -0
  271. package/lib-es/index.js +3 -0
  272. package/lib-es/index.js.map +1 -0
  273. package/lib-es/network/indexer.d.ts +6 -0
  274. package/lib-es/network/indexer.d.ts.map +1 -0
  275. package/lib-es/network/indexer.js +12 -0
  276. package/lib-es/network/indexer.js.map +1 -0
  277. package/lib-es/network/mock-network.d.ts +5 -0
  278. package/lib-es/network/mock-network.d.ts.map +1 -0
  279. package/lib-es/network/mock-network.js +25 -0
  280. package/lib-es/network/mock-network.js.map +1 -0
  281. package/lib-es/network/node.d.ts +12 -0
  282. package/lib-es/network/node.d.ts.map +1 -0
  283. package/lib-es/network/node.js +80 -0
  284. package/lib-es/network/node.js.map +1 -0
  285. package/lib-es/network/types.d.ts +47 -0
  286. package/lib-es/network/types.d.ts.map +1 -0
  287. package/lib-es/network/types.js +4 -0
  288. package/lib-es/network/types.js.map +1 -0
  289. package/lib-es/signer/getAddress.d.ts +6 -0
  290. package/lib-es/signer/getAddress.d.ts.map +1 -0
  291. package/lib-es/signer/getAddress.js +12 -0
  292. package/lib-es/signer/getAddress.js.map +1 -0
  293. package/lib-es/signer/index.d.ts +6 -0
  294. package/lib-es/signer/index.d.ts.map +1 -0
  295. package/lib-es/signer/index.js +6 -0
  296. package/lib-es/signer/index.js.map +1 -0
  297. package/lib-es/test/bot-deviceActions.d.ts +4 -0
  298. package/lib-es/test/bot-deviceActions.d.ts.map +1 -0
  299. package/lib-es/test/bot-deviceActions.js +41 -0
  300. package/lib-es/test/bot-deviceActions.js.map +1 -0
  301. package/lib-es/test/bot-specs.d.ts +1 -0
  302. package/lib-es/test/bot-specs.d.ts.map +1 -0
  303. package/lib-es/test/bot-specs.js +78 -0
  304. package/lib-es/test/bot-specs.js.map +1 -0
  305. package/lib-es/test/bridgeDatasetTest.d.ts +5 -0
  306. package/lib-es/test/bridgeDatasetTest.d.ts.map +1 -0
  307. package/lib-es/test/bridgeDatasetTest.js +142 -0
  308. package/lib-es/test/bridgeDatasetTest.js.map +1 -0
  309. package/lib-es/test/cli.d.ts +26 -0
  310. package/lib-es/test/cli.d.ts.map +1 -0
  311. package/lib-es/test/cli.js +30 -0
  312. package/lib-es/test/cli.js.map +1 -0
  313. package/lib-es/test/index.d.ts +5 -0
  314. package/lib-es/test/index.d.ts.map +1 -0
  315. package/lib-es/test/index.js +6 -0
  316. package/lib-es/test/index.js.map +1 -0
  317. package/lib-es/types/assets.d.ts +3 -0
  318. package/lib-es/types/assets.d.ts.map +1 -0
  319. package/lib-es/types/assets.js +2 -0
  320. package/lib-es/types/assets.js.map +1 -0
  321. package/lib-es/types/bridge.d.ts +23 -0
  322. package/lib-es/types/bridge.d.ts.map +1 -0
  323. package/lib-es/types/bridge.js +2 -0
  324. package/lib-es/types/bridge.js.map +1 -0
  325. package/lib-es/types/errors.d.ts +4 -0
  326. package/lib-es/types/errors.d.ts.map +1 -0
  327. package/lib-es/types/errors.js +3 -0
  328. package/lib-es/types/errors.js.map +1 -0
  329. package/lib-es/types/index.d.ts +13 -0
  330. package/lib-es/types/index.d.ts.map +1 -0
  331. package/lib-es/types/index.js +3 -0
  332. package/lib-es/types/index.js.map +1 -0
  333. package/lib-es/types/signer.d.ts +10 -0
  334. package/lib-es/types/signer.d.ts.map +1 -0
  335. package/lib-es/types/signer.js +2 -0
  336. package/lib-es/types/signer.js.map +1 -0
  337. package/package.json +137 -0
  338. package/src/api/index.test.ts +22 -0
  339. package/src/api/index.ts +88 -0
  340. package/src/bridge/broadcast.test.ts +36 -0
  341. package/src/bridge/broadcast.ts +11 -0
  342. package/src/bridge/createTransaction.test.ts +12 -0
  343. package/src/bridge/createTransaction.ts +14 -0
  344. package/src/bridge/deviceTransactionConfig.test.ts +20 -0
  345. package/src/bridge/deviceTransactionConfig.ts +34 -0
  346. package/src/bridge/estimateMaxSpendable.ts +25 -0
  347. package/src/bridge/getTransactionStatus.ts +88 -0
  348. package/src/bridge/index.test.ts +26 -0
  349. package/src/bridge/index.ts +65 -0
  350. package/src/bridge/prepareTransaction.test.ts +29 -0
  351. package/src/bridge/prepareTransaction.ts +25 -0
  352. package/src/bridge/signOperation.ts +94 -0
  353. package/src/bridge/sync.ts +106 -0
  354. package/src/bridge/transaction.ts +61 -0
  355. package/src/bridge/updateTransaction.ts +17 -0
  356. package/src/common-logic/account/getBalance.ts +8 -0
  357. package/src/common-logic/account/getNextSequence.ts +6 -0
  358. package/src/common-logic/common.ts +8 -0
  359. package/src/common-logic/history/lastBlock.ts +11 -0
  360. package/src/common-logic/history/listOperations.ts +65 -0
  361. package/src/common-logic/index.ts +11 -0
  362. package/src/common-logic/transaction/broadcast.ts +6 -0
  363. package/src/common-logic/transaction/combine.ts +6 -0
  364. package/src/common-logic/transaction/craftTransaction.ts +36 -0
  365. package/src/common-logic/transaction/estimateFees.ts +16 -0
  366. package/src/common-logic/utils.ts +18 -0
  367. package/src/config.ts +12 -0
  368. package/src/index.ts +4 -0
  369. package/src/network/indexer.ts +17 -0
  370. package/src/network/mock-network.ts +25 -0
  371. package/src/network/node.ts +94 -0
  372. package/src/network/types.ts +51 -0
  373. package/src/signer/getAddress.ts +20 -0
  374. package/src/signer/index.ts +7 -0
  375. package/src/test/bot-deviceActions.ts +48 -0
  376. package/src/test/bot-specs.ts +76 -0
  377. package/src/test/bridgeDatasetTest.ts +147 -0
  378. package/src/test/cli.ts +44 -0
  379. package/src/test/index.ts +6 -0
  380. package/src/types/assets.ts +3 -0
  381. package/src/types/bridge.ts +33 -0
  382. package/src/types/errors.ts +3 -0
  383. package/src/types/index.ts +13 -0
  384. package/src/types/signer.ts +11 -0
  385. package/tsconfig.json +12 -0
@@ -0,0 +1,106 @@
1
+ import BigNumber from "bignumber.js";
2
+ import { Operation } from "@ledgerhq/types-live";
3
+ import { encodeAccountId } from "@ledgerhq/coin-framework/account/index";
4
+ import { GetAccountShape, mergeOps } from "@ledgerhq/coin-framework/bridge/jsHelpers";
5
+ import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
6
+ import { getTransactions } from "../network/indexer";
7
+ import { getAccountInfo, getBlockHeight } from "../network/node";
8
+
9
+ import { ConcordiumOperation } from "../network/types";
10
+ import coinConfig from "../config";
11
+
12
+ const operationAdapter =
13
+ (accountId: string, address: string) =>
14
+ ({
15
+ meta: { delivered_amount },
16
+ tx: { Fee, hash, inLedger, date, Account, Destination, Sequence },
17
+ }: ConcordiumOperation) => {
18
+ const type = Account === address ? "OUT" : "IN";
19
+ let value =
20
+ delivered_amount && typeof delivered_amount === "string"
21
+ ? new BigNumber(delivered_amount)
22
+ : new BigNumber(0);
23
+ const feeValue = new BigNumber(Fee);
24
+
25
+ if (type === "OUT") {
26
+ if (!Number.isNaN(feeValue)) {
27
+ value = value.plus(feeValue);
28
+ }
29
+ }
30
+
31
+ const op: Operation = {
32
+ id: encodeOperationId(accountId, hash, type),
33
+ hash: hash,
34
+ accountId,
35
+ type,
36
+ value,
37
+ fee: feeValue,
38
+ blockHash: null,
39
+ blockHeight: inLedger,
40
+ senders: [Account],
41
+ recipients: [Destination],
42
+ date: new Date(),
43
+ transactionSequenceNumber: new BigNumber(Sequence),
44
+ extra: {},
45
+ };
46
+
47
+ return op;
48
+ };
49
+
50
+ const filterOperations = (
51
+ transactions: ConcordiumOperation[],
52
+ accountId: string,
53
+ address: string,
54
+ ) => {
55
+ return transactions
56
+ .filter(
57
+ ({ tx, meta }: ConcordiumOperation) =>
58
+ tx.TransactionType === "Payment" && typeof meta.delivered_amount === "string",
59
+ )
60
+ .map(operationAdapter(accountId, address))
61
+ .filter((op): op is Operation => Boolean(op));
62
+ };
63
+
64
+ export const getAccountShape: GetAccountShape = async info => {
65
+ const { address, initialAccount, currency, derivationMode } = info;
66
+
67
+ const accountId = encodeAccountId({
68
+ type: "js",
69
+ version: "2",
70
+ currencyId: currency.id,
71
+ xpubOrAddress: address,
72
+ derivationMode,
73
+ });
74
+
75
+ // blockheight retrieval
76
+ const blockHeight = await getBlockHeight();
77
+
78
+ // Account info retrieval + spendable balance calculation
79
+ const accountInfo = await getAccountInfo(address);
80
+ const balance = new BigNumber(accountInfo.account_data.Balance);
81
+ const reserveMin = coinConfig.getCoinConfig().minReserve;
82
+ const spendableBalance = new BigNumber(accountInfo.account_data.Balance).minus(reserveMin);
83
+
84
+ // Tx history fetching
85
+ const oldOperations = initialAccount?.operations || [];
86
+ const startAt = oldOperations.length ? (oldOperations[0].blockHeight || 0) + 1 : 0;
87
+ const newTransactions = await getTransactions(address, {
88
+ from: startAt,
89
+ size: 100,
90
+ });
91
+ const newOperations = filterOperations(newTransactions, accountId, address);
92
+ const operations = mergeOps(oldOperations, newOperations as Operation[]);
93
+
94
+ // We return the new account shape
95
+ const shape = {
96
+ id: accountId,
97
+ xpub: address,
98
+ blockHeight,
99
+ balance,
100
+ spendableBalance,
101
+ operations,
102
+ operationsCount: operations.length,
103
+ };
104
+
105
+ return shape;
106
+ };
@@ -0,0 +1,61 @@
1
+ import { BigNumber } from "bignumber.js";
2
+ import { formatTransactionStatus } from "@ledgerhq/coin-framework/formatters";
3
+ import {
4
+ fromTransactionCommonRaw,
5
+ fromTransactionStatusRawCommon as fromTransactionStatusRaw,
6
+ toTransactionCommonRaw,
7
+ toTransactionStatusRawCommon as toTransactionStatusRaw,
8
+ } from "@ledgerhq/coin-framework/serialization/transaction";
9
+ import type { Account } from "@ledgerhq/types-live";
10
+ import { getAccountCurrency } from "@ledgerhq/coin-framework/account/index";
11
+ import { formatCurrencyUnit } from "@ledgerhq/coin-framework/currencies/index";
12
+ import type { Transaction, TransactionRaw } from "../types";
13
+
14
+ export const formatTransaction = (
15
+ { amount, recipient, fee, useAllAmount }: Transaction,
16
+ account: Account,
17
+ ): string => `
18
+ SEND ${
19
+ useAllAmount
20
+ ? "MAX"
21
+ : formatCurrencyUnit(getAccountCurrency(account).units[0], amount, {
22
+ showCode: true,
23
+ disableRounding: true,
24
+ })
25
+ }
26
+ TO ${recipient}
27
+ with fee=${
28
+ !fee
29
+ ? "?"
30
+ : formatCurrencyUnit(getAccountCurrency(account).units[0], fee, {
31
+ showCode: true,
32
+ disableRounding: true,
33
+ })
34
+ }`;
35
+
36
+ export const fromTransactionRaw = (tr: TransactionRaw): Transaction => {
37
+ const common = fromTransactionCommonRaw(tr);
38
+ return {
39
+ ...common,
40
+ family: tr.family,
41
+ fee: tr.fee ? new BigNumber(tr.fee) : null,
42
+ };
43
+ };
44
+
45
+ export const toTransactionRaw = (t: Transaction): TransactionRaw => {
46
+ const common = toTransactionCommonRaw(t);
47
+ return {
48
+ ...common,
49
+ family: t.family,
50
+ fee: t.fee ? t.fee.toString() : null,
51
+ };
52
+ };
53
+
54
+ export default {
55
+ formatTransaction,
56
+ fromTransactionRaw,
57
+ toTransactionRaw,
58
+ fromTransactionStatusRaw,
59
+ toTransactionStatusRaw,
60
+ formatTransactionStatus,
61
+ };
@@ -0,0 +1,17 @@
1
+ import { updateTransaction as defaultUpdateTransaction } from "@ledgerhq/coin-framework/bridge/jsHelpers";
2
+ import { AccountBridge } from "@ledgerhq/types-live";
3
+ import type { Transaction } from "../types";
4
+
5
+ // NOTE: this method is optional, use defaultUpdateTransaction
6
+ // acts as a middleware to update the transaction patch object
7
+
8
+ // NOTE: here is an example transaction updater function
9
+ // in this case, it resets fee to null depending on the patch content
10
+ export const updateTransaction: AccountBridge<Transaction>["updateTransaction"] = (tx, patch) => {
11
+ // eslint-disable-next-line no-constant-condition
12
+ if (patch.recipient === "concordium1" || true) {
13
+ patch = { ...patch, fee: null };
14
+ }
15
+
16
+ return defaultUpdateTransaction(tx, patch);
17
+ };
@@ -0,0 +1,8 @@
1
+ import { Balance } from "@ledgerhq/coin-framework/api/types";
2
+ import { getAccountInfo } from "../../network/node";
3
+
4
+ // Could be getAccountInfo so it is used in both bridge and api
5
+ export async function getBalance(address: string): Promise<Balance[]> {
6
+ const accountInfo = await getAccountInfo(address);
7
+ return [{ asset: { type: "native" }, value: BigInt(accountInfo.account_data.Balance) }];
8
+ }
@@ -0,0 +1,6 @@
1
+ import { getNextSequence } from "../../network/node";
2
+
3
+ // Could be getAccountInfo so it is used in both bridge and api
4
+ export async function getNextValidSequence(address: string): Promise<number> {
5
+ return await getNextSequence(address);
6
+ }
@@ -0,0 +1,8 @@
1
+ import { BigNumber } from "bignumber.js";
2
+ import { parseCurrencyUnit } from "@ledgerhq/coin-framework/currencies";
3
+ import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
4
+
5
+ // NOTE: replace ripple by your currency id, it should be found in
6
+ // libs/ledgerjs/packages/cryptoassets/src/currencies.ts
7
+ const concordiumUnit = getCryptoCurrencyById("ripple").units[0];
8
+ export const parseAPIValue = (value: string): BigNumber => parseCurrencyUnit(concordiumUnit, value);
@@ -0,0 +1,11 @@
1
+ import type { BlockInfo } from "@ledgerhq/coin-framework/api/index";
2
+ import { getLastBlock } from "../../network/node";
3
+
4
+ export async function lastBlock(): Promise<BlockInfo> {
5
+ const result = await getLastBlock();
6
+ return {
7
+ height: result.blockHeight,
8
+ hash: result.blockHash,
9
+ time: new Date(result.timestamp),
10
+ };
11
+ }
@@ -0,0 +1,65 @@
1
+ import type { Operation, Pagination } from "@ledgerhq/coin-framework/api/index";
2
+ import { getTransactions } from "../../network/indexer";
3
+ import { ConcordiumOperation } from "../../network/types";
4
+
5
+ /**
6
+ * Returns list of operations associated to an account.
7
+ * @param address Account address
8
+ * @param pagination Pagination options
9
+ * @returns Operations found and the next "id" or "index" to use for pagination (i.e. `start` property).\
10
+ * If `0` is returns, no pagination needed.
11
+ * This "id" or "index" value, thus it has functional meaning, is different for each blockchain.
12
+ */
13
+ export async function listOperations(
14
+ address: string,
15
+ page: Pagination,
16
+ ): Promise<[Operation[], string]> {
17
+ const transactions = await getTransactions(address, { from: page.minHeight });
18
+ return [transactions.map(convertToCoreOperation(address)), ""];
19
+ }
20
+
21
+ const convertToCoreOperation =
22
+ (address: string) =>
23
+ (operation: ConcordiumOperation): Operation => {
24
+ const {
25
+ meta: { delivered_amount },
26
+ tx: { Fee, hash, inLedger, date, Account, Destination },
27
+ } = operation;
28
+
29
+ const type = Account === address ? "OUT" : "IN";
30
+ let value =
31
+ delivered_amount && typeof delivered_amount === "string"
32
+ ? BigInt(delivered_amount)
33
+ : BigInt(0);
34
+
35
+ const feeValue = BigInt(Fee);
36
+ if (type === "OUT") {
37
+ if (!Number.isNaN(feeValue)) {
38
+ value = value + feeValue;
39
+ }
40
+ }
41
+
42
+ return {
43
+ /**
44
+ * Note: The operation ID must be concatenated with another
45
+ * value if the transaction hash is not enough to identify it
46
+ */
47
+ id: hash,
48
+ asset: { type: "native" },
49
+ tx: {
50
+ hash,
51
+ fees: feeValue,
52
+ date: new Date(date),
53
+ failed: false,
54
+ block: {
55
+ height: inLedger,
56
+ hash,
57
+ time: new Date(date),
58
+ },
59
+ },
60
+ type,
61
+ value,
62
+ senders: [Account],
63
+ recipients: [Destination],
64
+ };
65
+ };
@@ -0,0 +1,11 @@
1
+ export { broadcast } from "./transaction/broadcast";
2
+ export { combine } from "./transaction/combine";
3
+ export { craftTransaction } from "./transaction/craftTransaction";
4
+ export { estimateFees } from "./transaction/estimateFees";
5
+ export { getBalance } from "./account/getBalance";
6
+ export { lastBlock } from "./history/lastBlock";
7
+ export { listOperations } from "./history/listOperations";
8
+ export { isRecipientValid } from "./utils";
9
+ export { getNextValidSequence } from "./account/getNextSequence";
10
+
11
+ export { parseAPIValue } from "./common";
@@ -0,0 +1,6 @@
1
+ import { submit } from "../../network/node";
2
+
3
+ export async function broadcast(signedTx: string): Promise<string> {
4
+ const submittedPayment = await submit(signedTx);
5
+ return submittedPayment.tx_hash;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { encode } from "../utils";
2
+
3
+ // Combines signature with raw transaction
4
+ export function combine(transaction: string, signature: string, publicKey?: string): string {
5
+ return encode(transaction, signature, publicKey || "");
6
+ }
@@ -0,0 +1,36 @@
1
+ import BigNumber from "bignumber.js";
2
+ import { ConcordiumNativeTransaction } from "../../types";
3
+
4
+ const encodeNativeTx = (nativeTx: ConcordiumNativeTransaction) => JSON.stringify(nativeTx);
5
+
6
+ export async function craftTransaction(
7
+ account: {
8
+ address: string;
9
+ nextSequenceNumber?: number;
10
+ publicKey?: string;
11
+ },
12
+ transaction: {
13
+ recipient?: string;
14
+ amount: BigNumber;
15
+ fee?: BigNumber;
16
+ },
17
+ ): Promise<{
18
+ nativeTransaction: ConcordiumNativeTransaction;
19
+ serializedTransaction: string;
20
+ }> {
21
+ const nativeTransaction: ConcordiumNativeTransaction = {
22
+ TransactionType: "Payment",
23
+ Account: account.address,
24
+ Amount: transaction.amount.toString(),
25
+ Destination: transaction.recipient || "",
26
+ Fee: transaction.fee?.toString() || "0",
27
+ Sequence: account.nextSequenceNumber || 0,
28
+ };
29
+
30
+ const serializedTransaction = encodeNativeTx(nativeTransaction);
31
+
32
+ return {
33
+ nativeTransaction,
34
+ serializedTransaction,
35
+ };
36
+ }
@@ -0,0 +1,16 @@
1
+ import { simulate } from "../../network/node";
2
+ import { SimulationError } from "../../types/errors";
3
+
4
+ export async function estimateFees(serializedTransaction: string): Promise<bigint> {
5
+ try {
6
+ // We call the node to do a dry run and estimate fees
7
+ return BigInt(await simulate(serializedTransaction));
8
+ } catch (e) {
9
+ // default value is required in case of simulation error, else user will encounter an error in the flow
10
+ if (e instanceof SimulationError) {
11
+ return BigInt(1000);
12
+ } else {
13
+ throw new Error("Unexpected error while estimating fees.");
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,18 @@
1
+ import BigNumber from "bignumber.js";
2
+
3
+ export const UINT32_MAX = new BigNumber(2).pow(32).minus(1);
4
+
5
+ export const validateTag = (tag: BigNumber) => {
6
+ return (
7
+ !tag.isNaN() && tag.isFinite() && tag.isInteger() && tag.isPositive() && tag.lte(UINT32_MAX)
8
+ );
9
+ };
10
+
11
+ export function isRecipientValid(recipient: string): boolean {
12
+ return recipient.length > 0;
13
+ }
14
+
15
+ export const encode = (transaction: string, signature: string, publicKey?: string) => {
16
+ // sample encoding
17
+ return `${transaction}${publicKey}${signature}encodedTx`;
18
+ };
package/src/config.ts ADDED
@@ -0,0 +1,12 @@
1
+ import buildCoinConfig, { type CurrencyConfig } from "@ledgerhq/coin-framework/config";
2
+
3
+ export type ConcordiumConfig = {
4
+ nodeUrl: string;
5
+ minReserve: number;
6
+ };
7
+
8
+ export type ConcordiumCoinConfig = CurrencyConfig & ConcordiumConfig;
9
+
10
+ const coinConfig = buildCoinConfig<ConcordiumCoinConfig>();
11
+
12
+ export default coinConfig;
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./types";
2
+
3
+ export { createBridges } from "./bridge/index";
4
+ export type { ConcordiumCoinConfig } from "./config";
@@ -0,0 +1,17 @@
1
+ import network from "@ledgerhq/live-network/network";
2
+ import { getEnv } from "@ledgerhq/live-env";
3
+ import { AccountTxResponse } from "./types";
4
+
5
+ export const getTransactions = async (
6
+ address: string,
7
+ params: { from: number; size?: number },
8
+ ): Promise<AccountTxResponse["transactions"]> => {
9
+ const { data } = await network<AccountTxResponse>({
10
+ // NOTE: add INDEXER_BOILERPLATE to libs/env/src/env.ts
11
+ // @ts-expect-error: add INDEXER_BOILERPLATE to libs/env/src/env.ts
12
+ url: `${getEnv("INDEXER_BOILERPLATE")}/account/${address}/transactions`,
13
+ method: "GET",
14
+ });
15
+
16
+ return data.transactions;
17
+ };
@@ -0,0 +1,25 @@
1
+ /*
2
+
3
+ In a real use case you should use live-network library like this :
4
+
5
+ import network from "@ledgerhq/live-network/network";
6
+
7
+
8
+ instead of this mocked method
9
+
10
+ */
11
+
12
+ export const network = (params: { url: string; method: "GET" | "POST" }) => {
13
+ switch (true) {
14
+ case params.url.includes("simulate"):
15
+ break;
16
+ case params.url.includes("submit"):
17
+ break;
18
+ case params.url.includes("account_info"):
19
+ break;
20
+ case params.url.includes("transactions"):
21
+ break;
22
+ default:
23
+ throw new Error("Mock network 404");
24
+ }
25
+ };
@@ -0,0 +1,94 @@
1
+ import network from "@ledgerhq/live-network/network";
2
+ import { getEnv } from "@ledgerhq/live-env";
3
+ import { SimulationError } from "../types/errors";
4
+ import coinConfig from "../config";
5
+ import { AccountInfoResponse, SubmitReponse } from "./types";
6
+
7
+ const getNodeUrl = () => coinConfig.getCoinConfig().nodeUrl;
8
+
9
+ // NOTE: add NODE_BOILERPLATE to libs/env/src/env.ts
10
+
11
+ // txPayload needs to be unsigned
12
+ export const simulate = async (serializedTx: string): Promise<number> => {
13
+ // @ts-expect-error: add NODE_BOILERPLATE to libs/env/src/env.ts
14
+ const url = `${getEnv("NODE_BOILERPLATE")}/simulate`;
15
+ const { data } = await network({
16
+ url,
17
+ method: "POST",
18
+ data: {
19
+ txPayload: serializedTx,
20
+ },
21
+ });
22
+ if (data.error) {
23
+ throw new SimulationError();
24
+ }
25
+ return data.fees;
26
+ };
27
+
28
+ // can be called nonce or sequence
29
+ export const getNextSequence = async (address: string): Promise<number> => {
30
+ // @ts-expect-error: add NODE_BOILERPLATE to libs/env/src/env.ts
31
+ const url = `${getEnv("NODE_BOILERPLATE")}/${address}/sequence`;
32
+ try {
33
+ const { data } = await network({
34
+ url,
35
+ method: "GET",
36
+ });
37
+ return data.sequence;
38
+ } catch (e) {
39
+ return 0;
40
+ }
41
+ };
42
+
43
+ export const getBlockHeight = async (): Promise<number> => {
44
+ // @ts-expect-error: add NODE_BOILERPLATE to libs/env/src/env.ts
45
+ const url = `${getEnv("NODE_BOILERPLATE")}/blockheight`;
46
+ const { data } = await network({
47
+ url,
48
+ method: "GET",
49
+ });
50
+ return data.blockHeight;
51
+ };
52
+
53
+ export const getLastBlock = async (): Promise<{
54
+ blockHeight: number;
55
+ blockHash: string;
56
+ timestamp: number;
57
+ }> => {
58
+ // @ts-expect-error: add NODE_BOILERPLATE to libs/env/src/env.ts
59
+ const url = `${getEnv("NODE_BOILERPLATE")}/block/current`;
60
+ const { data } = await network({
61
+ url,
62
+ method: "GET",
63
+ });
64
+ return data;
65
+ };
66
+
67
+ export const submit = async (signedTx: string): Promise<SubmitReponse> => {
68
+ // @ts-expect-error: add NODE_BOILERPLATE to libs/env/src/env.ts
69
+ const url = `${getEnv("NODE_BOILERPLATE")}/submit`;
70
+ const { data } = await network<SubmitReponse>({
71
+ url,
72
+ method: "GET",
73
+ });
74
+ return data;
75
+ };
76
+
77
+ export const getAccountInfo = async (address: string): Promise<AccountInfoResponse> => {
78
+ const {
79
+ data: { result },
80
+ } = await network<{ result: AccountInfoResponse }>({
81
+ method: "POST",
82
+ url: getNodeUrl(),
83
+ data: {
84
+ method: "account_info",
85
+ params: [
86
+ {
87
+ account: address,
88
+ },
89
+ ],
90
+ },
91
+ });
92
+
93
+ return result;
94
+ };
@@ -0,0 +1,51 @@
1
+ export type ConcordiumOperation = {
2
+ meta: {
3
+ delivered_amount: string;
4
+ };
5
+ tx: {
6
+ Account: string;
7
+ Amount: string;
8
+ Destination: string;
9
+ Fee: string;
10
+ Memo: string;
11
+ Sequence: number;
12
+ SigningPubKey: string;
13
+ TransactionType: string;
14
+ TxnSignature: string;
15
+ date: number;
16
+ hash: string;
17
+ inLedger: number;
18
+ };
19
+ validated: boolean;
20
+ };
21
+
22
+ export type ResponseStatus =
23
+ | { status: string; error?: never }
24
+ | {
25
+ status?: never;
26
+ error: string;
27
+ };
28
+ export function isResponseStatus(obj: object): obj is ResponseStatus {
29
+ return "status" in obj || "error" in obj;
30
+ }
31
+
32
+ export type NewAccount = "NewAccount";
33
+ export type AccountInfoResponse = {
34
+ account_data: {
35
+ Account: string;
36
+ Balance: string;
37
+ };
38
+ ledger_hash: string;
39
+ ledger_index: number;
40
+ validated: boolean;
41
+ } & ResponseStatus;
42
+
43
+ export type SubmitReponse = {
44
+ accepted: boolean;
45
+ tx_hash: string;
46
+ };
47
+
48
+ export type AccountTxResponse = {
49
+ account: string;
50
+ transactions: ConcordiumOperation[];
51
+ } & ResponseStatus;
@@ -0,0 +1,20 @@
1
+ import { GetAddressOptions } from "@ledgerhq/coin-framework/derivation";
2
+ import { GetAddressFn } from "@ledgerhq/coin-framework/bridge/getAddressWrapper";
3
+ import { SignerContext } from "@ledgerhq/coin-framework/signer";
4
+ import { ConcordiumAddress, ConcordiumSigner } from "../types";
5
+
6
+ const getAddress = (signerContext: SignerContext<ConcordiumSigner>): GetAddressFn => {
7
+ return async (deviceId: string, { path, verify }: GetAddressOptions) => {
8
+ const { address, publicKey } = (await signerContext(deviceId, signer =>
9
+ signer.getAddress(path),
10
+ )) as ConcordiumAddress;
11
+
12
+ return {
13
+ path,
14
+ address,
15
+ publicKey,
16
+ };
17
+ };
18
+ };
19
+
20
+ export default getAddress;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This directory is the home for all types and logic based on Ledgers signer.
3
+ */
4
+
5
+ import getAddress from "./getAddress";
6
+
7
+ export default getAddress;
@@ -0,0 +1,48 @@
1
+ import type { DeviceAction } from "@ledgerhq/coin-framework/bot/types";
2
+ import {
3
+ deviceActionFlow,
4
+ formatDeviceAmount,
5
+ SpeculosButton,
6
+ } from "@ledgerhq/coin-framework/bot/specs";
7
+ import type { Transaction } from "../types";
8
+
9
+ export const acceptTransaction: DeviceAction<Transaction, any> = deviceActionFlow({
10
+ steps: [
11
+ {
12
+ title: "Transaction Type",
13
+ button: SpeculosButton.RIGHT,
14
+ expectedValue: () => "Payment",
15
+ },
16
+ {
17
+ title: "Amount",
18
+ button: SpeculosButton.RIGHT,
19
+ expectedValue: ({ account, status }) => formatDeviceAmount(account.currency, status.amount),
20
+ },
21
+ {
22
+ title: "Fee",
23
+ button: SpeculosButton.RIGHT,
24
+ expectedValue: ({ account, status }) =>
25
+ formatDeviceAmount(account.currency, status.estimatedFees),
26
+ },
27
+ {
28
+ title: "Destination",
29
+ button: SpeculosButton.RIGHT,
30
+ trimValue: true,
31
+ expectedValue: ({ transaction }) => transaction.recipient,
32
+ },
33
+ {
34
+ title: "Account",
35
+ button: SpeculosButton.RIGHT,
36
+ trimValue: true,
37
+ expectedValue: ({ account }) => account.freshAddress,
38
+ },
39
+ {
40
+ title: "Accept",
41
+ button: SpeculosButton.BOTH,
42
+ },
43
+ {
44
+ title: "Sign transaction",
45
+ button: SpeculosButton.BOTH,
46
+ },
47
+ ],
48
+ });