@ledgerhq/coin-vechain 2.2.0-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 (396) hide show
  1. package/.eslintrc.js +20 -0
  2. package/.turbo/turbo-build.log +4 -0
  3. package/.unimportedrc.json +74 -0
  4. package/CHANGELOG.md +1186 -0
  5. package/LICENSE.txt +21 -0
  6. package/jest.config.js +8 -0
  7. package/lib/account.d.ts +7 -0
  8. package/lib/account.d.ts.map +1 -0
  9. package/lib/account.js +19 -0
  10. package/lib/account.js.map +1 -0
  11. package/lib/bridge/broadcast.d.ts +8 -0
  12. package/lib/bridge/broadcast.d.ts.map +1 -0
  13. package/lib/bridge/broadcast.js +27 -0
  14. package/lib/bridge/broadcast.js.map +1 -0
  15. package/lib/bridge/buildOptimisticOperatioin.d.ts +4 -0
  16. package/lib/bridge/buildOptimisticOperatioin.d.ts.map +1 -0
  17. package/lib/bridge/buildOptimisticOperatioin.js +56 -0
  18. package/lib/bridge/buildOptimisticOperatioin.js.map +1 -0
  19. package/lib/bridge/createTransaction.d.ts +9 -0
  20. package/lib/bridge/createTransaction.d.ts.map +1 -0
  21. package/lib/bridge/createTransaction.js +36 -0
  22. package/lib/bridge/createTransaction.js.map +1 -0
  23. package/lib/bridge/estimateMaxSpendable.d.ts +4 -0
  24. package/lib/bridge/estimateMaxSpendable.d.ts.map +1 -0
  25. package/lib/bridge/estimateMaxSpendable.js +29 -0
  26. package/lib/bridge/estimateMaxSpendable.js.map +1 -0
  27. package/lib/bridge/getTransactionStatus.d.ts +5 -0
  28. package/lib/bridge/getTransactionStatus.d.ts.map +1 -0
  29. package/lib/bridge/getTransactionStatus.js +76 -0
  30. package/lib/bridge/getTransactionStatus.js.map +1 -0
  31. package/lib/bridge/index.d.ts +10 -0
  32. package/lib/bridge/index.d.ts.map +1 -0
  33. package/lib/bridge/index.js +64 -0
  34. package/lib/bridge/index.js.map +1 -0
  35. package/lib/bridge/prepareTransaction.d.ts +10 -0
  36. package/lib/bridge/prepareTransaction.d.ts.map +1 -0
  37. package/lib/bridge/prepareTransaction.js +38 -0
  38. package/lib/bridge/prepareTransaction.js.map +1 -0
  39. package/lib/bridge/signOperation.d.ts +8 -0
  40. package/lib/bridge/signOperation.d.ts.map +1 -0
  41. package/lib/bridge/signOperation.js +43 -0
  42. package/lib/bridge/signOperation.js.map +1 -0
  43. package/lib/bridge/synchronisation.d.ts +4 -0
  44. package/lib/bridge/synchronisation.d.ts.map +1 -0
  45. package/lib/bridge/synchronisation.js +84 -0
  46. package/lib/bridge/synchronisation.js.map +1 -0
  47. package/lib/bridge/transaction.d.ts +17 -0
  48. package/lib/bridge/transaction.d.ts.map +1 -0
  49. package/lib/bridge/transaction.js +56 -0
  50. package/lib/bridge/transaction.js.map +1 -0
  51. package/lib/common-logic/address-utils.d.ts +2 -0
  52. package/lib/common-logic/address-utils.d.ts.map +1 -0
  53. package/lib/common-logic/address-utils.js +19 -0
  54. package/lib/common-logic/address-utils.js.map +1 -0
  55. package/lib/common-logic/hex-utils.d.ts +8 -0
  56. package/lib/common-logic/hex-utils.d.ts.map +1 -0
  57. package/lib/common-logic/hex-utils.js +52 -0
  58. package/lib/common-logic/hex-utils.js.map +1 -0
  59. package/lib/common-logic/index.d.ts +7 -0
  60. package/lib/common-logic/index.d.ts.map +1 -0
  61. package/lib/common-logic/index.js +23 -0
  62. package/lib/common-logic/index.js.map +1 -0
  63. package/lib/common-logic/logic.d.ts +5 -0
  64. package/lib/common-logic/logic.d.ts.map +1 -0
  65. package/lib/common-logic/logic.js +46 -0
  66. package/lib/common-logic/logic.js.map +1 -0
  67. package/lib/common-logic/mapping-utils.d.ts +5 -0
  68. package/lib/common-logic/mapping-utils.d.ts.map +1 -0
  69. package/lib/common-logic/mapping-utils.js +61 -0
  70. package/lib/common-logic/mapping-utils.js.map +1 -0
  71. package/lib/common-logic/pad-address.d.ts +2 -0
  72. package/lib/common-logic/pad-address.d.ts.map +1 -0
  73. package/lib/common-logic/pad-address.js +13 -0
  74. package/lib/common-logic/pad-address.js.map +1 -0
  75. package/lib/common-logic/transaction-utils.d.ts +30 -0
  76. package/lib/common-logic/transaction-utils.d.ts.map +1 -0
  77. package/lib/common-logic/transaction-utils.js +164 -0
  78. package/lib/common-logic/transaction-utils.js.map +1 -0
  79. package/lib/config.d.ts +5 -0
  80. package/lib/config.d.ts.map +1 -0
  81. package/lib/config.js +17 -0
  82. package/lib/config.js.map +1 -0
  83. package/lib/contracts/abis/VIP180.d.ts +17 -0
  84. package/lib/contracts/abis/VIP180.d.ts.map +1 -0
  85. package/lib/contracts/abis/VIP180.js +265 -0
  86. package/lib/contracts/abis/VIP180.js.map +1 -0
  87. package/lib/contracts/abis/params.d.ts +8 -0
  88. package/lib/contracts/abis/params.d.ts.map +1 -0
  89. package/lib/contracts/abis/params.js +69 -0
  90. package/lib/contracts/abis/params.js.map +1 -0
  91. package/lib/contracts/constants.d.ts +6 -0
  92. package/lib/contracts/constants.d.ts.map +1 -0
  93. package/lib/contracts/constants.js +10 -0
  94. package/lib/contracts/constants.js.map +1 -0
  95. package/lib/datasets/index.d.ts +3 -0
  96. package/lib/datasets/index.d.ts.map +1 -0
  97. package/lib/datasets/index.js +23 -0
  98. package/lib/datasets/index.js.map +1 -0
  99. package/lib/datasets/vechain.d.ts +5 -0
  100. package/lib/datasets/vechain.d.ts.map +1 -0
  101. package/lib/datasets/vechain.js +91 -0
  102. package/lib/datasets/vechain.js.map +1 -0
  103. package/lib/datasets/vechain.scanAccounts.1.d.ts +6 -0
  104. package/lib/datasets/vechain.scanAccounts.1.d.ts.map +1 -0
  105. package/lib/datasets/vechain.scanAccounts.1.js +16 -0
  106. package/lib/datasets/vechain.scanAccounts.1.js.map +1 -0
  107. package/lib/errors.d.ts +10 -0
  108. package/lib/errors.d.ts.map +1 -0
  109. package/lib/errors.js +8 -0
  110. package/lib/errors.js.map +1 -0
  111. package/lib/index.d.ts +2 -0
  112. package/lib/index.d.ts.map +1 -0
  113. package/lib/index.js +6 -0
  114. package/lib/index.js.map +1 -0
  115. package/lib/mock.d.ts +9 -0
  116. package/lib/mock.d.ts.map +1 -0
  117. package/lib/mock.js +13 -0
  118. package/lib/mock.js.map +1 -0
  119. package/lib/network/index.d.ts +3 -0
  120. package/lib/network/index.d.ts.map +1 -0
  121. package/lib/network/index.js +22 -0
  122. package/lib/network/index.js.map +1 -0
  123. package/lib/network/sdk.d.ts +47 -0
  124. package/lib/network/sdk.d.ts.map +1 -0
  125. package/lib/network/sdk.js +164 -0
  126. package/lib/network/sdk.js.map +1 -0
  127. package/lib/signer/getAddress.d.ts +6 -0
  128. package/lib/signer/getAddress.d.ts.map +1 -0
  129. package/lib/signer/getAddress.js +32 -0
  130. package/lib/signer/getAddress.js.map +1 -0
  131. package/lib/signer/index.d.ts +4 -0
  132. package/lib/signer/index.d.ts.map +1 -0
  133. package/lib/signer/index.js +23 -0
  134. package/lib/signer/index.js.map +1 -0
  135. package/lib/signer/signMessage.d.ts +4 -0
  136. package/lib/signer/signMessage.d.ts.map +1 -0
  137. package/lib/signer/signMessage.js +31 -0
  138. package/lib/signer/signMessage.js.map +1 -0
  139. package/lib/test/bot-deviceActions.d.ts +7 -0
  140. package/lib/test/bot-deviceActions.d.ts.map +1 -0
  141. package/lib/test/bot-deviceActions.js +23 -0
  142. package/lib/test/bot-deviceActions.js.map +1 -0
  143. package/lib/test/bot-specs.d.ts +8 -0
  144. package/lib/test/bot-specs.d.ts.map +1 -0
  145. package/lib/test/bot-specs.js +161 -0
  146. package/lib/test/bot-specs.js.map +1 -0
  147. package/lib/test/bridgeDatasetTest.d.ts +4 -0
  148. package/lib/test/bridgeDatasetTest.d.ts.map +1 -0
  149. package/lib/test/bridgeDatasetTest.js +252 -0
  150. package/lib/test/bridgeDatasetTest.js.map +1 -0
  151. package/lib/test/cli.d.ts +17 -0
  152. package/lib/test/cli.d.ts.map +1 -0
  153. package/lib/test/cli.js +51 -0
  154. package/lib/test/cli.js.map +1 -0
  155. package/lib/test/index.d.ts +6 -0
  156. package/lib/test/index.d.ts.map +1 -0
  157. package/lib/test/index.js +26 -0
  158. package/lib/test/index.js.map +1 -0
  159. package/lib/types/bridge.d.ts +25 -0
  160. package/lib/types/bridge.d.ts.map +1 -0
  161. package/lib/types/bridge.js +3 -0
  162. package/lib/types/bridge.js.map +1 -0
  163. package/lib/types/constants.d.ts +6 -0
  164. package/lib/types/constants.d.ts.map +1 -0
  165. package/lib/types/constants.js +9 -0
  166. package/lib/types/constants.js.map +1 -0
  167. package/lib/types/index.d.ts +5 -0
  168. package/lib/types/index.d.ts.map +1 -0
  169. package/lib/types/index.js +21 -0
  170. package/lib/types/index.js.map +1 -0
  171. package/lib/types/network.d.ts +71 -0
  172. package/lib/types/network.d.ts.map +1 -0
  173. package/lib/types/network.js +3 -0
  174. package/lib/types/network.js.map +1 -0
  175. package/lib/types/signer.d.ts +12 -0
  176. package/lib/types/signer.d.ts.map +1 -0
  177. package/lib/types/signer.js +3 -0
  178. package/lib/types/signer.js.map +1 -0
  179. package/lib-es/account.d.ts +7 -0
  180. package/lib-es/account.d.ts.map +1 -0
  181. package/lib-es/account.js +17 -0
  182. package/lib-es/account.js.map +1 -0
  183. package/lib-es/bridge/broadcast.d.ts +8 -0
  184. package/lib-es/bridge/broadcast.d.ts.map +1 -0
  185. package/lib-es/bridge/broadcast.js +23 -0
  186. package/lib-es/bridge/broadcast.js.map +1 -0
  187. package/lib-es/bridge/buildOptimisticOperatioin.d.ts +4 -0
  188. package/lib-es/bridge/buildOptimisticOperatioin.d.ts.map +1 -0
  189. package/lib-es/bridge/buildOptimisticOperatioin.js +49 -0
  190. package/lib-es/bridge/buildOptimisticOperatioin.js.map +1 -0
  191. package/lib-es/bridge/createTransaction.d.ts +9 -0
  192. package/lib-es/bridge/createTransaction.d.ts.map +1 -0
  193. package/lib-es/bridge/createTransaction.js +29 -0
  194. package/lib-es/bridge/createTransaction.js.map +1 -0
  195. package/lib-es/bridge/estimateMaxSpendable.d.ts +4 -0
  196. package/lib-es/bridge/estimateMaxSpendable.d.ts.map +1 -0
  197. package/lib-es/bridge/estimateMaxSpendable.js +22 -0
  198. package/lib-es/bridge/estimateMaxSpendable.js.map +1 -0
  199. package/lib-es/bridge/getTransactionStatus.d.ts +5 -0
  200. package/lib-es/bridge/getTransactionStatus.d.ts.map +1 -0
  201. package/lib-es/bridge/getTransactionStatus.js +69 -0
  202. package/lib-es/bridge/getTransactionStatus.js.map +1 -0
  203. package/lib-es/bridge/index.d.ts +10 -0
  204. package/lib-es/bridge/index.d.ts.map +1 -0
  205. package/lib-es/bridge/index.js +55 -0
  206. package/lib-es/bridge/index.js.map +1 -0
  207. package/lib-es/bridge/prepareTransaction.d.ts +10 -0
  208. package/lib-es/bridge/prepareTransaction.d.ts.map +1 -0
  209. package/lib-es/bridge/prepareTransaction.js +34 -0
  210. package/lib-es/bridge/prepareTransaction.js.map +1 -0
  211. package/lib-es/bridge/signOperation.d.ts +8 -0
  212. package/lib-es/bridge/signOperation.d.ts.map +1 -0
  213. package/lib-es/bridge/signOperation.js +39 -0
  214. package/lib-es/bridge/signOperation.js.map +1 -0
  215. package/lib-es/bridge/synchronisation.d.ts +4 -0
  216. package/lib-es/bridge/synchronisation.d.ts.map +1 -0
  217. package/lib-es/bridge/synchronisation.js +77 -0
  218. package/lib-es/bridge/synchronisation.js.map +1 -0
  219. package/lib-es/bridge/transaction.d.ts +17 -0
  220. package/lib-es/bridge/transaction.d.ts.map +1 -0
  221. package/lib-es/bridge/transaction.js +48 -0
  222. package/lib-es/bridge/transaction.js.map +1 -0
  223. package/lib-es/common-logic/address-utils.d.ts +2 -0
  224. package/lib-es/common-logic/address-utils.d.ts.map +1 -0
  225. package/lib-es/common-logic/address-utils.js +12 -0
  226. package/lib-es/common-logic/address-utils.js.map +1 -0
  227. package/lib-es/common-logic/hex-utils.d.ts +8 -0
  228. package/lib-es/common-logic/hex-utils.d.ts.map +1 -0
  229. package/lib-es/common-logic/hex-utils.js +50 -0
  230. package/lib-es/common-logic/hex-utils.js.map +1 -0
  231. package/lib-es/common-logic/index.d.ts +7 -0
  232. package/lib-es/common-logic/index.d.ts.map +1 -0
  233. package/lib-es/common-logic/index.js +7 -0
  234. package/lib-es/common-logic/index.js.map +1 -0
  235. package/lib-es/common-logic/logic.d.ts +5 -0
  236. package/lib-es/common-logic/logic.d.ts.map +1 -0
  237. package/lib-es/common-logic/logic.js +38 -0
  238. package/lib-es/common-logic/logic.js.map +1 -0
  239. package/lib-es/common-logic/mapping-utils.d.ts +5 -0
  240. package/lib-es/common-logic/mapping-utils.d.ts.map +1 -0
  241. package/lib-es/common-logic/mapping-utils.js +53 -0
  242. package/lib-es/common-logic/mapping-utils.js.map +1 -0
  243. package/lib-es/common-logic/pad-address.d.ts +2 -0
  244. package/lib-es/common-logic/pad-address.d.ts.map +1 -0
  245. package/lib-es/common-logic/pad-address.js +9 -0
  246. package/lib-es/common-logic/pad-address.js.map +1 -0
  247. package/lib-es/common-logic/transaction-utils.d.ts +30 -0
  248. package/lib-es/common-logic/transaction-utils.d.ts.map +1 -0
  249. package/lib-es/common-logic/transaction-utils.js +153 -0
  250. package/lib-es/common-logic/transaction-utils.js.map +1 -0
  251. package/lib-es/config.d.ts +5 -0
  252. package/lib-es/config.d.ts.map +1 -0
  253. package/lib-es/config.js +12 -0
  254. package/lib-es/config.js.map +1 -0
  255. package/lib-es/contracts/abis/VIP180.d.ts +17 -0
  256. package/lib-es/contracts/abis/VIP180.d.ts.map +1 -0
  257. package/lib-es/contracts/abis/VIP180.js +263 -0
  258. package/lib-es/contracts/abis/VIP180.js.map +1 -0
  259. package/lib-es/contracts/abis/params.d.ts +8 -0
  260. package/lib-es/contracts/abis/params.d.ts.map +1 -0
  261. package/lib-es/contracts/abis/params.js +67 -0
  262. package/lib-es/contracts/abis/params.js.map +1 -0
  263. package/lib-es/contracts/constants.d.ts +6 -0
  264. package/lib-es/contracts/constants.d.ts.map +1 -0
  265. package/lib-es/contracts/constants.js +7 -0
  266. package/lib-es/contracts/constants.js.map +1 -0
  267. package/lib-es/datasets/index.d.ts +3 -0
  268. package/lib-es/datasets/index.d.ts.map +1 -0
  269. package/lib-es/datasets/index.js +3 -0
  270. package/lib-es/datasets/index.js.map +1 -0
  271. package/lib-es/datasets/vechain.d.ts +5 -0
  272. package/lib-es/datasets/vechain.d.ts.map +1 -0
  273. package/lib-es/datasets/vechain.js +88 -0
  274. package/lib-es/datasets/vechain.js.map +1 -0
  275. package/lib-es/datasets/vechain.scanAccounts.1.d.ts +6 -0
  276. package/lib-es/datasets/vechain.scanAccounts.1.d.ts.map +1 -0
  277. package/lib-es/datasets/vechain.scanAccounts.1.js +14 -0
  278. package/lib-es/datasets/vechain.scanAccounts.1.js.map +1 -0
  279. package/lib-es/errors.d.ts +10 -0
  280. package/lib-es/errors.d.ts.map +1 -0
  281. package/lib-es/errors.js +5 -0
  282. package/lib-es/errors.js.map +1 -0
  283. package/lib-es/index.d.ts +2 -0
  284. package/lib-es/index.d.ts.map +1 -0
  285. package/lib-es/index.js +2 -0
  286. package/lib-es/index.js.map +1 -0
  287. package/lib-es/mock.d.ts +9 -0
  288. package/lib-es/mock.d.ts.map +1 -0
  289. package/lib-es/mock.js +11 -0
  290. package/lib-es/mock.js.map +1 -0
  291. package/lib-es/network/index.d.ts +3 -0
  292. package/lib-es/network/index.d.ts.map +1 -0
  293. package/lib-es/network/index.js +3 -0
  294. package/lib-es/network/index.js.map +1 -0
  295. package/lib-es/network/sdk.d.ts +47 -0
  296. package/lib-es/network/sdk.d.ts.map +1 -0
  297. package/lib-es/network/sdk.js +150 -0
  298. package/lib-es/network/sdk.js.map +1 -0
  299. package/lib-es/signer/getAddress.d.ts +6 -0
  300. package/lib-es/signer/getAddress.d.ts.map +1 -0
  301. package/lib-es/signer/getAddress.js +27 -0
  302. package/lib-es/signer/getAddress.js.map +1 -0
  303. package/lib-es/signer/index.d.ts +4 -0
  304. package/lib-es/signer/index.d.ts.map +1 -0
  305. package/lib-es/signer/index.js +4 -0
  306. package/lib-es/signer/index.js.map +1 -0
  307. package/lib-es/signer/signMessage.d.ts +4 -0
  308. package/lib-es/signer/signMessage.d.ts.map +1 -0
  309. package/lib-es/signer/signMessage.js +27 -0
  310. package/lib-es/signer/signMessage.js.map +1 -0
  311. package/lib-es/test/bot-deviceActions.d.ts +7 -0
  312. package/lib-es/test/bot-deviceActions.d.ts.map +1 -0
  313. package/lib-es/test/bot-deviceActions.js +21 -0
  314. package/lib-es/test/bot-deviceActions.js.map +1 -0
  315. package/lib-es/test/bot-specs.d.ts +8 -0
  316. package/lib-es/test/bot-specs.d.ts.map +1 -0
  317. package/lib-es/test/bot-specs.js +156 -0
  318. package/lib-es/test/bot-specs.js.map +1 -0
  319. package/lib-es/test/bridgeDatasetTest.d.ts +4 -0
  320. package/lib-es/test/bridgeDatasetTest.d.ts.map +1 -0
  321. package/lib-es/test/bridgeDatasetTest.js +246 -0
  322. package/lib-es/test/bridgeDatasetTest.js.map +1 -0
  323. package/lib-es/test/cli.d.ts +17 -0
  324. package/lib-es/test/cli.d.ts.map +1 -0
  325. package/lib-es/test/cli.js +45 -0
  326. package/lib-es/test/cli.js.map +1 -0
  327. package/lib-es/test/index.d.ts +6 -0
  328. package/lib-es/test/index.d.ts.map +1 -0
  329. package/lib-es/test/index.js +6 -0
  330. package/lib-es/test/index.js.map +1 -0
  331. package/lib-es/types/bridge.d.ts +25 -0
  332. package/lib-es/types/bridge.d.ts.map +1 -0
  333. package/lib-es/types/bridge.js +2 -0
  334. package/lib-es/types/bridge.js.map +1 -0
  335. package/lib-es/types/constants.d.ts +6 -0
  336. package/lib-es/types/constants.d.ts.map +1 -0
  337. package/lib-es/types/constants.js +6 -0
  338. package/lib-es/types/constants.js.map +1 -0
  339. package/lib-es/types/index.d.ts +5 -0
  340. package/lib-es/types/index.d.ts.map +1 -0
  341. package/lib-es/types/index.js +5 -0
  342. package/lib-es/types/index.js.map +1 -0
  343. package/lib-es/types/network.d.ts +71 -0
  344. package/lib-es/types/network.d.ts.map +1 -0
  345. package/lib-es/types/network.js +2 -0
  346. package/lib-es/types/network.js.map +1 -0
  347. package/lib-es/types/signer.d.ts +12 -0
  348. package/lib-es/types/signer.d.ts.map +1 -0
  349. package/lib-es/types/signer.js +2 -0
  350. package/lib-es/types/signer.js.map +1 -0
  351. package/package.json +120 -0
  352. package/src/__snapshots__/bridge.integration.test.ts.snap +146 -0
  353. package/src/account.ts +22 -0
  354. package/src/bridge/broadcast.ts +23 -0
  355. package/src/bridge/buildOptimisticOperatioin.ts +46 -0
  356. package/src/bridge/createTransaction.ts +31 -0
  357. package/src/bridge/estimateMaxSpendable.ts +18 -0
  358. package/src/bridge/getTransactionStatus.ts +76 -0
  359. package/src/bridge/index.ts +63 -0
  360. package/src/bridge/prepareTransaction.ts +41 -0
  361. package/src/bridge/signOperation.ts +53 -0
  362. package/src/bridge/synchronisation.ts +86 -0
  363. package/src/bridge/transaction.ts +79 -0
  364. package/src/common-logic/address-utils.ts +11 -0
  365. package/src/common-logic/hex-utils.ts +53 -0
  366. package/src/common-logic/index.ts +6 -0
  367. package/src/common-logic/logic.ts +44 -0
  368. package/src/common-logic/mapping-utils.ts +67 -0
  369. package/src/common-logic/pad-address.ts +8 -0
  370. package/src/common-logic/transaction-utils.ts +190 -0
  371. package/src/config.ts +18 -0
  372. package/src/contracts/abis/VIP180.ts +265 -0
  373. package/src/contracts/abis/params.ts +70 -0
  374. package/src/contracts/constants.ts +11 -0
  375. package/src/datasets/index.ts +2 -0
  376. package/src/datasets/vechain.scanAccounts.1.ts +13 -0
  377. package/src/datasets/vechain.ts +92 -0
  378. package/src/errors.ts +7 -0
  379. package/src/index.ts +1 -0
  380. package/src/mock.ts +14 -0
  381. package/src/network/index.ts +2 -0
  382. package/src/network/sdk.ts +177 -0
  383. package/src/signer/getAddress.ts +25 -0
  384. package/src/signer/index.ts +4 -0
  385. package/src/signer/signMessage.ts +22 -0
  386. package/src/test/bot-deviceActions.ts +24 -0
  387. package/src/test/bot-specs.ts +210 -0
  388. package/src/test/bridgeDatasetTest.ts +262 -0
  389. package/src/test/cli.ts +86 -0
  390. package/src/test/index.ts +6 -0
  391. package/src/types/bridge.ts +35 -0
  392. package/src/types/constants.ts +5 -0
  393. package/src/types/index.ts +4 -0
  394. package/src/types/network.ts +81 -0
  395. package/src/types/signer.ts +10 -0
  396. package/tsconfig.json +13 -0
@@ -0,0 +1,22 @@
1
+ import { Transaction as ThorTransaction } from "thor-devkit";
2
+ import { SignerContext } from "@ledgerhq/coin-framework/signer";
3
+ import { VechainSigner } from "../types";
4
+
5
+ export const signMessage =
6
+ (signerContext: SignerContext<VechainSigner>) =>
7
+ async (deviceId: string, path: string, message: string, rawMessage: string) => {
8
+ let messageObj;
9
+ let unsigned: ThorTransaction;
10
+ try {
11
+ if (message) messageObj = JSON.parse(message);
12
+ else messageObj = JSON.parse(rawMessage);
13
+ unsigned = new ThorTransaction(messageObj);
14
+ } catch (e) {
15
+ throw new Error("Message is not a valid JSON object");
16
+ }
17
+ const result = await signerContext(deviceId, signer =>
18
+ signer.signTransaction(path, unsigned.encode().toString("hex")),
19
+ );
20
+
21
+ return result.toString("hex");
22
+ };
@@ -0,0 +1,24 @@
1
+ import { SpeculosButton, deviceActionFlow } from "@ledgerhq/coin-framework/bot/specs";
2
+ import type { Transaction } from "../types";
3
+ import { DeviceAction } from "@ledgerhq/coin-framework/bot/types";
4
+
5
+ const acceptTransaction: DeviceAction<Transaction, any> = deviceActionFlow({
6
+ steps: [
7
+ {
8
+ title: "Review",
9
+ button: SpeculosButton.RIGHT,
10
+ },
11
+ {
12
+ title: "Amount",
13
+ button: SpeculosButton.RIGHT,
14
+ },
15
+ { title: "Address", button: SpeculosButton.RIGHT },
16
+ { title: "Max Fees", button: SpeculosButton.RIGHT },
17
+ {
18
+ title: "Accept",
19
+ button: SpeculosButton.BOTH,
20
+ },
21
+ ],
22
+ });
23
+
24
+ export default { acceptTransaction };
@@ -0,0 +1,210 @@
1
+ import BigNumber from "bignumber.js";
2
+ import invariant from "invariant";
3
+ import type {
4
+ AppSpec,
5
+ TransactionArg,
6
+ TransactionRes,
7
+ TransactionTestInput,
8
+ SpeculosTransport,
9
+ } from "@ledgerhq/coin-framework/bot/types";
10
+ import type { Transaction } from "../types";
11
+ import { pickSiblings, botTest, SpeculosButton } from "@ledgerhq/coin-framework/bot/specs";
12
+ import { DeviceModelId } from "@ledgerhq/devices";
13
+ import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
14
+ import speculosDeviceActions from "./bot-deviceActions";
15
+
16
+ const MIN_VET_TRANSACTION_AMOUNT = 1000000000000000000;
17
+ const MAX_VTHO_FEE_FOR_VTHO_TRANSACTION = 1040000000000000000;
18
+ const MAX_VTHO_FEE_FOR_VET_TRANSACTION = 420000000000000000;
19
+
20
+ const vechainTest = {
21
+ currency: getCryptoCurrencyById("vechain"),
22
+ appQuery: {
23
+ model: DeviceModelId.nanoSP,
24
+ appName: "VeChain",
25
+ appVersion: "1.1.1",
26
+ },
27
+ allowEmptyAccounts: true,
28
+ testTimeout: 60 * 1000, // 1 minute
29
+ genericDeviceAction: speculosDeviceActions.acceptTransaction,
30
+ onSpeculosDeviceCreated: async ({ transport }: { transport: SpeculosTransport }) => {
31
+ // enable contract data
32
+ await transport.button(SpeculosButton.RIGHT);
33
+ await transport.button(SpeculosButton.BOTH);
34
+ await transport.button(SpeculosButton.BOTH);
35
+ await transport.button(SpeculosButton.RIGHT);
36
+ await transport.button(SpeculosButton.BOTH);
37
+ // enable multi-clause
38
+ await transport.button(SpeculosButton.RIGHT);
39
+ await transport.button(SpeculosButton.BOTH);
40
+ await transport.button(SpeculosButton.RIGHT);
41
+ await transport.button(SpeculosButton.BOTH);
42
+ await transport.button(SpeculosButton.RIGHT);
43
+ await transport.button(SpeculosButton.BOTH);
44
+ },
45
+ };
46
+
47
+ const vet: AppSpec<Transaction> = {
48
+ name: "VeChain VET",
49
+ ...vechainTest,
50
+ mutations: [
51
+ {
52
+ name: "move ~50% VET",
53
+ maxRun: 1,
54
+ transaction: ({
55
+ account,
56
+ siblings,
57
+ bridge,
58
+ maxSpendable,
59
+ }: TransactionArg<Transaction>): TransactionRes<Transaction> => {
60
+ if (!account.subAccounts?.[0]) throw new Error("no VTHO account");
61
+ invariant(account.balance.gt(MIN_VET_TRANSACTION_AMOUNT), "Vechain: VET balance is empty");
62
+ invariant(
63
+ account.subAccounts[0].balance.gt(MAX_VTHO_FEE_FOR_VET_TRANSACTION),
64
+ "Vechain: VTHO balance is not enough",
65
+ );
66
+ const sibling = pickSiblings(siblings, 2);
67
+ const recipient = sibling.freshAddress;
68
+ const transaction = bridge.createTransaction(account);
69
+ const amount = maxSpendable.div(2).integerValue();
70
+ const updates = [{ amount }, { recipient }];
71
+ return {
72
+ transaction,
73
+ updates,
74
+ };
75
+ },
76
+ test: ({
77
+ account,
78
+ accountBeforeTransaction,
79
+ operation,
80
+ }: TransactionTestInput<Transaction>): void | undefined => {
81
+ botTest("account balance decreased with operation value", () =>
82
+ expect(account.balance.toString()).toBe(
83
+ accountBeforeTransaction.balance.minus(operation.value).toString(),
84
+ ),
85
+ );
86
+ },
87
+ },
88
+ {
89
+ name: "move all VET",
90
+ maxRun: 1,
91
+ transaction: ({
92
+ account,
93
+ siblings,
94
+ bridge,
95
+ }: TransactionArg<Transaction>): TransactionRes<Transaction> => {
96
+ if (!account.subAccounts?.[0]) throw new Error("no VTHO account");
97
+ invariant(account.balance.gt(MIN_VET_TRANSACTION_AMOUNT), "Vechain: VET balance is empty");
98
+ invariant(
99
+ account.subAccounts?.[0].balance.gt(MAX_VTHO_FEE_FOR_VET_TRANSACTION),
100
+ "Vechain: VTHO balance is not enough",
101
+ );
102
+ const sibling = pickSiblings(siblings, 4);
103
+ const recipient = sibling.freshAddress;
104
+ const transaction = bridge.createTransaction(account);
105
+ const updates = [{ useAllAmount: true }, { recipient }];
106
+ return {
107
+ transaction,
108
+ updates,
109
+ };
110
+ },
111
+ test: ({ account }: TransactionTestInput<Transaction>): void | undefined => {
112
+ botTest("account balance decreased with operation value", () =>
113
+ expect(account.balance.toString()).toBe(new BigNumber(0).toString()),
114
+ );
115
+ },
116
+ },
117
+ ],
118
+ };
119
+
120
+ const vtho: AppSpec<Transaction> = {
121
+ name: "VeChain VTHO",
122
+ ...vechainTest,
123
+ skipOperationHistory: true,
124
+ mutations: [
125
+ {
126
+ name: "move ~50% VTHO",
127
+ maxRun: 1,
128
+ transaction: ({
129
+ account,
130
+ siblings,
131
+ bridge,
132
+ }: TransactionArg<Transaction>): TransactionRes<Transaction> => {
133
+ if (!account.subAccounts?.[0]) throw new Error("no VTHO account");
134
+ invariant(
135
+ account.subAccounts?.[0].balance.gt(MAX_VTHO_FEE_FOR_VTHO_TRANSACTION * 2),
136
+ "Vechain: VTHO balance is not enough",
137
+ );
138
+ const sibling = pickSiblings(siblings, 2);
139
+ const recipient = sibling.freshAddress;
140
+ if (
141
+ !account.subAccounts ||
142
+ !account.subAccounts[0] ||
143
+ !(account.subAccounts[0].type == "TokenAccount")
144
+ )
145
+ throw new Error("no VTHO account");
146
+ const tokenAccount = account.subAccounts[0];
147
+ const transaction = bridge.createTransaction(tokenAccount);
148
+ const amount = tokenAccount.balance.div(2).integerValue();
149
+ const updates = [{ amount }, { recipient }, { subAccountId: tokenAccount.id }];
150
+
151
+ return {
152
+ transaction,
153
+ updates,
154
+ };
155
+ },
156
+ test: ({
157
+ account,
158
+ accountBeforeTransaction,
159
+ }: TransactionTestInput<Transaction>): void | undefined => {
160
+ botTest("account balance decreased with operation value", () =>
161
+ expect(account?.subAccounts?.[0].balance.toString()).toBe(
162
+ new BigNumber(accountBeforeTransaction?.subAccounts?.[0].balance || 0)
163
+ .div(2)
164
+ .toString(),
165
+ ),
166
+ );
167
+ },
168
+ },
169
+ {
170
+ name: "move all VTHO",
171
+ maxRun: 1,
172
+ transaction: ({
173
+ account,
174
+ siblings,
175
+ bridge,
176
+ }: TransactionArg<Transaction>): TransactionRes<Transaction> => {
177
+ if (!account.subAccounts?.[0]) throw new Error("no VTHO account");
178
+ invariant(
179
+ account.subAccounts?.[0].balance.gt(MAX_VTHO_FEE_FOR_VTHO_TRANSACTION),
180
+ "Vechain: VTHO balance is not enough",
181
+ );
182
+ const sibling = pickSiblings(siblings, 4);
183
+ const recipient = sibling.freshAddress;
184
+ if (
185
+ !account.subAccounts ||
186
+ !account.subAccounts[0] ||
187
+ !(account.subAccounts[0].type == "TokenAccount")
188
+ )
189
+ throw new Error("no VTHO account");
190
+ const transaction = bridge.createTransaction(account);
191
+ const updates = [
192
+ { useAllAmount: true },
193
+ { recipient },
194
+ { subAccountId: account.subAccounts[0].id },
195
+ ];
196
+ return {
197
+ transaction,
198
+ updates,
199
+ };
200
+ },
201
+ test: ({ account }: TransactionTestInput<Transaction>): void | undefined => {
202
+ botTest("account balance decreased with operation value", () =>
203
+ expect(account?.subAccounts?.[0].balance.toString()).toBe(new BigNumber(0).toString()),
204
+ );
205
+ },
206
+ },
207
+ ],
208
+ };
209
+
210
+ export default { vtho, vet };
@@ -0,0 +1,262 @@
1
+ import BigNumber from "bignumber.js";
2
+ import type { AccountRaw, CurrenciesData, DatasetTest } from "@ledgerhq/types-live";
3
+ import type { Transaction } from "../types";
4
+ import { fromTransactionRaw } from "../bridge/transaction";
5
+ import { DEFAULT_GAS_COEFFICIENT, MAINNET_CHAIN_TAG } from "../types";
6
+ import { vechain1, vechain3 } from "../datasets";
7
+ import { generateNonce } from "../common-logic";
8
+
9
+ import vechainScanAccounts1 from "../datasets/vechain.scanAccounts.1";
10
+ import { AmountRequired, NotEnoughBalance } from "@ledgerhq/errors";
11
+ import VIP180 from "../contracts/abis/VIP180";
12
+ import { CryptoCurrencyId } from "@ledgerhq/types-cryptoassets";
13
+ import { NotEnoughVTHO } from "../errors";
14
+ import {
15
+ listSupportedCurrencies,
16
+ setSupportedCurrencies,
17
+ } from "@ledgerhq/coin-framework/currencies/index";
18
+ import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
19
+
20
+ const listSupported = listSupportedCurrencies();
21
+ listSupported.push(getCryptoCurrencyById("vechain"));
22
+ setSupportedCurrencies(listSupported.map(c => c.id) as CryptoCurrencyId[]);
23
+
24
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
25
+ const vechain: CurrenciesData<Transaction> = {
26
+ FIXME_ignoreAccountFields: ["balance", "spendableBalance", "estimateMaxSpendable"], // the balance depends on VTHO and it's earned without operations
27
+ scanAccounts: vechainScanAccounts1,
28
+
29
+ accounts: [
30
+ {
31
+ raw: vechain1 as AccountRaw,
32
+ transactions: [
33
+ {
34
+ name: "Send VET",
35
+ transaction: fromTransactionRaw({
36
+ family: "vechain",
37
+ estimatedFees: "210000000000000000",
38
+ recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957",
39
+ amount: "1000000000000000000",
40
+ body: {
41
+ chainTag: MAINNET_CHAIN_TAG,
42
+ blockRef: "0x00634a0c856ec1db",
43
+ expiration: 18,
44
+ clauses: [
45
+ {
46
+ to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957",
47
+ value: "1000000000000000000",
48
+ data: "0x",
49
+ },
50
+ ],
51
+ gasPriceCoef: DEFAULT_GAS_COEFFICIENT,
52
+ gas: "0",
53
+ dependsOn: null,
54
+ nonce: generateNonce(),
55
+ },
56
+ }),
57
+ expectedStatus: {
58
+ amount: new BigNumber("1000000000000000000"),
59
+ estimatedFees: new BigNumber("210000000000000000"),
60
+ totalSpent: new BigNumber("1000000000000000000"),
61
+ errors: {},
62
+ warnings: {},
63
+ },
64
+ },
65
+ {
66
+ name: "Send VTHO",
67
+ transaction: fromTransactionRaw({
68
+ family: "vechain",
69
+ subAccountId:
70
+ "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho",
71
+ estimatedFees: "515180000000000000",
72
+ recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957",
73
+ amount: "1000000000000000000",
74
+ body: {
75
+ chainTag: MAINNET_CHAIN_TAG,
76
+ blockRef: "0x00634a0c856ec1db",
77
+ expiration: 18,
78
+ clauses: [
79
+ {
80
+ to: "0x0000000000000000000000000000456e65726779",
81
+ value: 0,
82
+ data: VIP180.transfer.encode(
83
+ "0xcf130b42ae31c4931298b4b1c0f1d974b8732957",
84
+ "9000000000000000000",
85
+ ),
86
+ },
87
+ ],
88
+ gasPriceCoef: DEFAULT_GAS_COEFFICIENT,
89
+ gas: "0",
90
+ dependsOn: null,
91
+ nonce: generateNonce(),
92
+ },
93
+ }),
94
+ expectedStatus: {
95
+ amount: new BigNumber("1000000000000000000"),
96
+ estimatedFees: new BigNumber("515180000000000000"),
97
+ totalSpent: new BigNumber("1515180000000000000"),
98
+ errors: {},
99
+ warnings: {},
100
+ },
101
+ },
102
+ {
103
+ name: "Amount required",
104
+ transaction: fromTransactionRaw({
105
+ family: "vechain",
106
+ estimatedFees: "0",
107
+ recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957",
108
+ amount: "",
109
+ body: {
110
+ chainTag: MAINNET_CHAIN_TAG,
111
+ blockRef: "0x00634a0c856ec1db",
112
+ expiration: 18,
113
+ clauses: [{ to: "", value: 0, data: "0x" }],
114
+ gasPriceCoef: DEFAULT_GAS_COEFFICIENT,
115
+ gas: "0",
116
+ dependsOn: null,
117
+ nonce: generateNonce(),
118
+ },
119
+ }),
120
+ expectedStatus: {
121
+ errors: {
122
+ amount: new AmountRequired(),
123
+ },
124
+ warnings: {},
125
+ },
126
+ },
127
+ {
128
+ name: "VET balance not enough",
129
+ transaction: fromTransactionRaw({
130
+ family: "vechain",
131
+ estimatedFees: "210000000000000000",
132
+ recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957",
133
+ amount: "20000000000000000000",
134
+ body: {
135
+ chainTag: MAINNET_CHAIN_TAG,
136
+ blockRef: "0x00634a0c856ec1db",
137
+ expiration: 18,
138
+ clauses: [
139
+ {
140
+ to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957",
141
+ value: "20000000000000000000",
142
+ data: "0x",
143
+ },
144
+ ],
145
+ gasPriceCoef: DEFAULT_GAS_COEFFICIENT,
146
+ gas: "0",
147
+ dependsOn: null,
148
+ nonce: generateNonce(),
149
+ },
150
+ }),
151
+ expectedStatus: {
152
+ amount: new BigNumber("20000000000000000000"),
153
+ errors: {
154
+ amount: new NotEnoughBalance(),
155
+ },
156
+ warnings: {},
157
+ totalSpent: new BigNumber("20000000000000000000"),
158
+ estimatedFees: new BigNumber("210000000000000000"),
159
+ },
160
+ },
161
+ {
162
+ name: "VTHO balance not enough",
163
+ transaction: fromTransactionRaw({
164
+ family: "vechain",
165
+ subAccountId:
166
+ "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho",
167
+ estimatedFees: "515820000000000000",
168
+ recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957",
169
+ amount: "20000000000000000000",
170
+ body: {
171
+ chainTag: MAINNET_CHAIN_TAG,
172
+ blockRef: "0x00634a0c856ec1db",
173
+ expiration: 18,
174
+ clauses: [
175
+ {
176
+ to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957",
177
+ value: "20000000000000000000",
178
+ data: "0x",
179
+ },
180
+ ],
181
+ gasPriceCoef: DEFAULT_GAS_COEFFICIENT,
182
+ gas: "0",
183
+ dependsOn: null,
184
+ nonce: generateNonce(),
185
+ },
186
+ }),
187
+ expectedStatus: {
188
+ amount: new BigNumber("20000000000000000000"),
189
+ errors: {
190
+ amount: new NotEnoughBalance(),
191
+ },
192
+ warnings: {},
193
+ totalSpent: new BigNumber("20515820000000000000"),
194
+ estimatedFees: new BigNumber("515820000000000000"),
195
+ },
196
+ },
197
+ ],
198
+ FIXME_tests: [
199
+ "balance is sum of ops", // the balance depends on VTHO and it's earned without operations
200
+ "empty transaction is equals to itself", //nonce is not deterministic
201
+ "ref stability on self transaction", //blockref is not deterministic
202
+ "can be run in parallel and all yield same results", //blockref is not deterministic
203
+ ],
204
+ },
205
+ {
206
+ raw: vechain3 as AccountRaw,
207
+ transactions: [
208
+ {
209
+ name: "Not enough VTHO to pay fees",
210
+ transaction: fromTransactionRaw({
211
+ family: "vechain",
212
+ estimatedFees: "210000000000000000",
213
+ recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957",
214
+ amount: "1000000000000000000",
215
+ body: {
216
+ chainTag: MAINNET_CHAIN_TAG,
217
+ blockRef: "0x00634a0c856ec1db",
218
+ expiration: 18,
219
+ clauses: [
220
+ {
221
+ to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957",
222
+ value: "1000000000000000000",
223
+ data: "0x",
224
+ },
225
+ ],
226
+ gasPriceCoef: DEFAULT_GAS_COEFFICIENT,
227
+ gas: "0",
228
+ dependsOn: null,
229
+ nonce: generateNonce(),
230
+ },
231
+ }),
232
+ expectedStatus: {
233
+ amount: new BigNumber("1000000000000000000"),
234
+ estimatedFees: new BigNumber("210000000000000000"),
235
+ totalSpent: new BigNumber("1000000000000000000"),
236
+ errors: {
237
+ amount: new NotEnoughVTHO(),
238
+ },
239
+ warnings: {},
240
+ },
241
+ },
242
+ ],
243
+ FIXME_tests: [
244
+ "balance is sum of ops", // the balance depends on VTHO and it's earned without operations
245
+ "empty transaction is equals to itself", //nonce is not deterministic
246
+ "ref stability on self transaction", //blockref is not deterministic
247
+ "can be run in parallel and all yield same results", //blockref is not deterministic
248
+ ],
249
+ },
250
+ ],
251
+ };
252
+
253
+ // describe("VeChain Bridge", () => {
254
+ // test.todo("sample test");
255
+ // });
256
+
257
+ export const dataset: DatasetTest<Transaction> = {
258
+ implementations: ["js", "mock"],
259
+ currencies: {
260
+ vechain,
261
+ },
262
+ };
@@ -0,0 +1,86 @@
1
+ import flatMap from "lodash/flatMap";
2
+ import { Transaction, Transaction as VechainTransaction } from "../types";
3
+ import type { Account, AccountLike } from "@ledgerhq/types-live";
4
+ import { VTHO_ADDRESS } from "../contracts/constants";
5
+ import VIP180 from "../contracts/abis/VIP180";
6
+ import { MustBeVechain } from "../errors";
7
+
8
+ type CliTools = {
9
+ options: Array<{
10
+ name: string;
11
+ type: any;
12
+ desc: string;
13
+ }>;
14
+ inferTransactions: (
15
+ transactions: Array<{
16
+ account: AccountLike;
17
+ transaction: Transaction;
18
+ mainAccount: Account;
19
+ }>,
20
+ opts: Record<string, any>,
21
+ ) => Transaction[];
22
+ };
23
+
24
+ type Clauses = {
25
+ to: string;
26
+ data: string;
27
+ value: string | number;
28
+ };
29
+
30
+ const options = [
31
+ {
32
+ name: "vechainCurrency",
33
+ type: String,
34
+ desc: 'select between sending VET or VTHO using "VET" or "VTHO" strings',
35
+ },
36
+ ];
37
+
38
+ function inferTransactions(
39
+ transactions: Array<{
40
+ account: AccountLike;
41
+ transaction: Transaction;
42
+ mainAccount: Account;
43
+ }>,
44
+ opts: Record<string, any>,
45
+ ): Transaction[] {
46
+ return flatMap(transactions, ({ transaction, account }) => {
47
+ let subAccountId =
48
+ account.type == "Account" && account.subAccounts ? account.subAccounts[0].id : "";
49
+
50
+ if (account.type === "TokenAccount") {
51
+ subAccountId = account.id;
52
+ }
53
+
54
+ const clauses: Array<Clauses> = [];
55
+
56
+ if (opts.vechainCurrency == "VET") {
57
+ clauses.push({
58
+ to: transaction.recipient,
59
+ value: "0x" + transaction.amount.toString(16),
60
+ data: "0x",
61
+ });
62
+ } else if (opts.vechainCurrency == "VTHO") {
63
+ clauses.push({
64
+ value: 0,
65
+ to: VTHO_ADDRESS,
66
+ data: VIP180.transfer.encode(transaction.recipient, transaction.amount.toFixed()),
67
+ });
68
+ } else {
69
+ throw new MustBeVechain();
70
+ }
71
+
72
+ return {
73
+ ...transaction,
74
+ family: "vechain",
75
+ subAccountId: opts.vechainCurrency == "VTHO" ? subAccountId : "",
76
+ body: { ...(transaction as VechainTransaction).body, clauses },
77
+ } as VechainTransaction;
78
+ });
79
+ }
80
+
81
+ export default function makeCliTools(): CliTools {
82
+ return {
83
+ options,
84
+ inferTransactions,
85
+ };
86
+ }
@@ -0,0 +1,6 @@
1
+ import makeCliTools from "./cli";
2
+
3
+ export * from "./bridgeDatasetTest";
4
+ export { makeCliTools };
5
+ export * from "./bot-deviceActions";
6
+ export * from "./bot-specs";
@@ -0,0 +1,35 @@
1
+ import type {
2
+ TokenAccount,
3
+ TransactionCommon,
4
+ TransactionCommonRaw,
5
+ TransactionStatusCommon,
6
+ TransactionStatusCommonRaw,
7
+ } from "@ledgerhq/types-live";
8
+ import BigNumber from "bignumber.js";
9
+ import { Transaction as ThorTransaction } from "thor-devkit";
10
+
11
+ export type Transaction = TransactionCommon & {
12
+ family: "vechain";
13
+ estimatedFees: string;
14
+ body: ThorTransaction.Body;
15
+ };
16
+
17
+ export type TransactionRaw = TransactionCommonRaw & {
18
+ family: "vechain";
19
+ estimatedFees: string;
20
+ body: ThorTransaction.Body;
21
+ };
22
+
23
+ export type TransactionStatus = TransactionStatusCommon;
24
+
25
+ export type TransactionStatusRaw = TransactionStatusCommonRaw;
26
+
27
+ export type TransactionInfo = {
28
+ isTokenAccount: boolean;
29
+ amount: BigNumber;
30
+ balance: BigNumber;
31
+ spendableBalance: BigNumber;
32
+ tokenAccount: TokenAccount | undefined;
33
+ estimatedFees: string;
34
+ estimatedGas: number;
35
+ };
@@ -0,0 +1,5 @@
1
+ export const MAINNET_CHAIN_TAG = 74;
2
+ export const TESTNET_CHAIN_TAG = 39;
3
+ export const DEFAULT_GAS_COEFFICIENT = 0;
4
+ export const HEX_PREFIX = "0x";
5
+ export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
@@ -0,0 +1,4 @@
1
+ export * from "./bridge";
2
+ export * from "./signer";
3
+ export * from "./constants";
4
+ export * from "./network";