@ledgerhq/live-common 21.21.0-rc.2 → 21.21.2

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 (473) hide show
  1. package/lib/__tests__/cross.js +2 -2
  2. package/lib/__tests__/cross.js.map +1 -1
  3. package/lib/__tests__/csvExport.js +1 -1
  4. package/lib/__tests__/csvExport.js.map +1 -1
  5. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.reorg.integration.test.js +4 -4
  6. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.reorg.integration.test.js.map +1 -1
  7. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.syncing.integration.test.js +2 -2
  8. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.syncing.integration.test.js.map +1 -1
  9. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.NP2WPKH.integration.test.js +7 -7
  10. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.NP2WPKH.integration.test.js.map +1 -1
  11. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.P2WPKH.integration.test.js +5 -5
  12. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.P2WPKH.integration.test.js.map +1 -1
  13. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.integration.test.js +5 -5
  14. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.integration.test.js.map +1 -1
  15. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.litecoin.test.js +4 -4
  16. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.litecoin.test.js.map +1 -1
  17. package/lib/__tests__/mocks/account.js +8 -8
  18. package/lib/__tests__/mocks/account.js.map +1 -1
  19. package/lib/__tests__/portfolio.v2.js +1 -1
  20. package/lib/__tests__/portfolio.v2.js.map +1 -1
  21. package/lib/__tests__/svg.js +3 -3
  22. package/lib/__tests__/svg.js.map +1 -1
  23. package/lib/__tests__/test-helpers/bridge.js +3 -3
  24. package/lib/__tests__/test-helpers/bridge.js.map +1 -1
  25. package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.android.js +1 -1
  26. package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.android.js.map +1 -1
  27. package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.ios.js +1 -1
  28. package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.ios.js.map +1 -1
  29. package/lib/__tests__/test-helpers/mockDevice.js +1 -1
  30. package/lib/__tests__/test-helpers/mockDevice.js.map +1 -1
  31. package/lib/__tests__/test-helpers/setup.js +2 -2
  32. package/lib/__tests__/test-helpers/setup.js.map +1 -1
  33. package/lib/account/accountId.js +2 -2
  34. package/lib/account/accountId.js.map +1 -1
  35. package/lib/account/accountName.js +1 -1
  36. package/lib/account/accountName.js.map +1 -1
  37. package/lib/account/formatters.js +17 -17
  38. package/lib/account/formatters.js.map +1 -1
  39. package/lib/account/helpers.js +1 -1
  40. package/lib/account/helpers.js.map +1 -1
  41. package/lib/api/Ethereum.js +12 -12
  42. package/lib/api/Ethereum.js.map +1 -1
  43. package/lib/api/Fees.js +3 -3
  44. package/lib/api/Fees.js.map +1 -1
  45. package/lib/api/Ledger.js +2 -2
  46. package/lib/api/Ledger.js.map +1 -1
  47. package/lib/api/Manager.js +19 -19
  48. package/lib/api/Manager.js.map +1 -1
  49. package/lib/api/Ripple.js +2 -2
  50. package/lib/api/Ripple.js.map +1 -1
  51. package/lib/api/Tron.js +21 -21
  52. package/lib/api/Tron.js.map +1 -1
  53. package/lib/api/explorerConfig/generate-doc.test.js +1 -1
  54. package/lib/api/explorerConfig/generate-doc.test.js.map +1 -1
  55. package/lib/api/socket.js +1 -1
  56. package/lib/api/socket.js.map +1 -1
  57. package/lib/apps/filtering.js +1 -1
  58. package/lib/apps/filtering.js.map +1 -1
  59. package/lib/apps/formatting.js +1 -1
  60. package/lib/apps/formatting.js.map +1 -1
  61. package/lib/apps/hw.js +1 -1
  62. package/lib/apps/hw.js.map +1 -1
  63. package/lib/apps/support.js +1 -1
  64. package/lib/bot/engine.d.ts.map +1 -1
  65. package/lib/bot/engine.js +19 -18
  66. package/lib/bot/engine.js.map +1 -1
  67. package/lib/bot/formatters.d.ts +1 -0
  68. package/lib/bot/formatters.d.ts.map +1 -1
  69. package/lib/bot/formatters.js +32 -21
  70. package/lib/bot/formatters.js.map +1 -1
  71. package/lib/bot/index.js +36 -36
  72. package/lib/bot/index.js.map +1 -1
  73. package/lib/bot/specs.js +1 -1
  74. package/lib/bot/specs.js.map +1 -1
  75. package/lib/bridge/jsHelpers.js +7 -7
  76. package/lib/bridge/jsHelpers.js.map +1 -1
  77. package/lib/bridge/mockHelpers.js +1 -1
  78. package/lib/bridge/mockHelpers.js.map +1 -1
  79. package/lib/bridge/react/BridgeSync.js +1 -1
  80. package/lib/bridge/react/BridgeSync.js.map +1 -1
  81. package/lib/bridge/shared.js +1 -1
  82. package/lib/bridge/shared.js.map +1 -1
  83. package/lib/convert.js +1 -1
  84. package/lib/convert.js.map +1 -1
  85. package/lib/countervalues/api/api.js +3 -3
  86. package/lib/countervalues/api/api.js.map +1 -1
  87. package/lib/countervalues/api/api.legacy.js +3 -3
  88. package/lib/countervalues/api/api.legacy.js.map +1 -1
  89. package/lib/countervalues/helpers.js +1 -1
  90. package/lib/countervalues/helpers.js.map +1 -1
  91. package/lib/countervalues/logic.js +5 -5
  92. package/lib/countervalues/logic.js.map +1 -1
  93. package/lib/countervalues/react.js +1 -1
  94. package/lib/countervalues/react.js.map +1 -1
  95. package/lib/derivation.js +5 -5
  96. package/lib/derivation.js.map +1 -1
  97. package/lib/env.d.ts.map +1 -1
  98. package/lib/env.js +2 -3
  99. package/lib/env.js.map +1 -1
  100. package/lib/exchange/index.js +1 -1
  101. package/lib/exchange/index.js.map +1 -1
  102. package/lib/exchange/sell/index.js +1 -1
  103. package/lib/exchange/sell/index.js.map +1 -1
  104. package/lib/exchange/swap/getExchangeRates.js +1 -1
  105. package/lib/exchange/swap/getExchangeRates.js.map +1 -1
  106. package/lib/exchange/swap/getKYCStatus.js +1 -1
  107. package/lib/exchange/swap/getKYCStatus.js.map +1 -1
  108. package/lib/exchange/swap/getProviders.js +1 -1
  109. package/lib/exchange/swap/getProviders.js.map +1 -1
  110. package/lib/exchange/swap/getStatus.js +1 -1
  111. package/lib/exchange/swap/getStatus.js.map +1 -1
  112. package/lib/exchange/swap/hooks/usePickDefaultAccount.test.js +1 -1
  113. package/lib/exchange/swap/hooks/usePickDefaultAccount.test.js.map +1 -1
  114. package/lib/exchange/swap/index.js +1 -1
  115. package/lib/exchange/swap/index.js.map +1 -1
  116. package/lib/exchange/swap/initSwap.js +2 -2
  117. package/lib/exchange/swap/initSwap.js.map +1 -1
  118. package/lib/exchange/swap/logic.js +3 -3
  119. package/lib/exchange/swap/logic.js.map +1 -1
  120. package/lib/exchange/swap/startExchange.js +1 -1
  121. package/lib/exchange/swap/startExchange.js.map +1 -1
  122. package/lib/exchange/swap/submitKYC.js +1 -1
  123. package/lib/exchange/swap/submitKYC.js.map +1 -1
  124. package/lib/exchange/swap/utils/index.test.js +1 -1
  125. package/lib/exchange/swap/utils/index.test.js.map +1 -1
  126. package/lib/families/algorand/account.js +2 -2
  127. package/lib/families/algorand/account.js.map +1 -1
  128. package/lib/families/algorand/bridge/libcore.js +1 -1
  129. package/lib/families/algorand/bridge/libcore.js.map +1 -1
  130. package/lib/families/algorand/deviceTransactionConfig.js +2 -2
  131. package/lib/families/algorand/deviceTransactionConfig.js.map +1 -1
  132. package/lib/families/algorand/libcore-signOperation.js +2 -2
  133. package/lib/families/algorand/libcore-signOperation.js.map +1 -1
  134. package/lib/families/algorand/mock.js +1 -1
  135. package/lib/families/algorand/mock.js.map +1 -1
  136. package/lib/families/algorand/speculos-deviceActions.js +1 -1
  137. package/lib/families/algorand/speculos-deviceActions.js.map +1 -1
  138. package/lib/families/algorand/tokens.js +1 -1
  139. package/lib/families/algorand/tokens.js.map +1 -1
  140. package/lib/families/algorand/transaction.js +3 -3
  141. package/lib/families/algorand/transaction.js.map +1 -1
  142. package/lib/families/bitcoin/account.js +5 -5
  143. package/lib/families/bitcoin/account.js.map +1 -1
  144. package/lib/families/bitcoin/bridge/libcore.js +6 -6
  145. package/lib/families/bitcoin/bridge/libcore.js.map +1 -1
  146. package/lib/families/bitcoin/cache.js +5 -5
  147. package/lib/families/bitcoin/cache.js.map +1 -1
  148. package/lib/families/bitcoin/descriptor.js +5 -5
  149. package/lib/families/bitcoin/descriptor.js.map +1 -1
  150. package/lib/families/bitcoin/hw-getAddress.js +5 -5
  151. package/lib/families/bitcoin/hw-getAddress.js.map +1 -1
  152. package/lib/families/bitcoin/hw-signMessage.js +1 -1
  153. package/lib/families/bitcoin/hw-signMessage.js.map +1 -1
  154. package/lib/families/bitcoin/js-getTransactionStatus.js +3 -3
  155. package/lib/families/bitcoin/js-getTransactionStatus.js.map +1 -1
  156. package/lib/families/bitcoin/js-signOperation.js +1 -1
  157. package/lib/families/bitcoin/js-signOperation.js.map +1 -1
  158. package/lib/families/bitcoin/js-synchronisation.js +6 -6
  159. package/lib/families/bitcoin/js-synchronisation.js.map +1 -1
  160. package/lib/families/bitcoin/libcore-buildTransaction.js +1 -1
  161. package/lib/families/bitcoin/libcore-buildTransaction.js.map +1 -1
  162. package/lib/families/bitcoin/libcore-signOperation.js +2 -2
  163. package/lib/families/bitcoin/libcore-signOperation.js.map +1 -1
  164. package/lib/families/bitcoin/satstack.js +3 -3
  165. package/lib/families/bitcoin/satstack.js.map +1 -1
  166. package/lib/families/bitcoin/specs.js +1 -1
  167. package/lib/families/bitcoin/specs.js.map +1 -1
  168. package/lib/families/bitcoin/transaction.js +7 -7
  169. package/lib/families/bitcoin/transaction.js.map +1 -1
  170. package/lib/families/bitcoin/wallet-btc/crypto/base.js +15 -15
  171. package/lib/families/bitcoin/wallet-btc/crypto/base.js.map +1 -1
  172. package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.js +6 -6
  173. package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.js.map +1 -1
  174. package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.js +4 -4
  175. package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.js.map +1 -1
  176. package/lib/families/bitcoin/wallet-btc/crypto/decred.js +3 -3
  177. package/lib/families/bitcoin/wallet-btc/crypto/decred.js.map +1 -1
  178. package/lib/families/bitcoin/wallet-btc/crypto/factory.js +1 -1
  179. package/lib/families/bitcoin/wallet-btc/crypto/factory.js.map +1 -1
  180. package/lib/families/bitcoin/wallet-btc/crypto/litecoin.js +3 -3
  181. package/lib/families/bitcoin/wallet-btc/crypto/litecoin.js.map +1 -1
  182. package/lib/families/bitcoin/wallet-btc/crypto/zec.js +3 -3
  183. package/lib/families/bitcoin/wallet-btc/crypto/zec.js.map +1 -1
  184. package/lib/families/bitcoin/wallet-btc/crypto/zen.js +3 -3
  185. package/lib/families/bitcoin/wallet-btc/crypto/zen.js.map +1 -1
  186. package/lib/families/bitcoin/wallet-btc/explorer/index.js +3 -3
  187. package/lib/families/bitcoin/wallet-btc/explorer/index.js.map +1 -1
  188. package/lib/families/bitcoin/wallet-btc/storage/index.js +4 -4
  189. package/lib/families/bitcoin/wallet-btc/storage/index.js.map +1 -1
  190. package/lib/families/bitcoin/wallet-btc/utils.js +1 -1
  191. package/lib/families/bitcoin/wallet-btc/utils.js.map +1 -1
  192. package/lib/families/bitcoin/wallet-btc/wallet.js +4 -4
  193. package/lib/families/bitcoin/wallet-btc/wallet.js.map +1 -1
  194. package/lib/families/bitcoin/wallet-btc/xpub.js +4 -4
  195. package/lib/families/bitcoin/wallet-btc/xpub.js.map +1 -1
  196. package/lib/families/cosmos/account.js +7 -7
  197. package/lib/families/cosmos/account.js.map +1 -1
  198. package/lib/families/cosmos/cli-transaction.js +1 -1
  199. package/lib/families/cosmos/cli-transaction.js.map +1 -1
  200. package/lib/families/cosmos/libcore-buildTransaction.js +3 -3
  201. package/lib/families/cosmos/libcore-buildTransaction.js.map +1 -1
  202. package/lib/families/cosmos/libcore-signOperation.js +1 -1
  203. package/lib/families/cosmos/libcore-signOperation.js.map +1 -1
  204. package/lib/families/cosmos/logic.js +2 -2
  205. package/lib/families/cosmos/logic.js.map +1 -1
  206. package/lib/families/cosmos/message.js +1 -1
  207. package/lib/families/cosmos/message.js.map +1 -1
  208. package/lib/families/cosmos/mock.js +1 -1
  209. package/lib/families/cosmos/mock.js.map +1 -1
  210. package/lib/families/cosmos/transaction.js +3 -3
  211. package/lib/families/cosmos/transaction.js.map +1 -1
  212. package/lib/families/cosmos/validators.js +7 -7
  213. package/lib/families/cosmos/validators.js.map +1 -1
  214. package/lib/families/crypto_org/api/sdk.js +2 -2
  215. package/lib/families/crypto_org/api/sdk.js.map +1 -1
  216. package/lib/families/crypto_org/js-broadcast.js +1 -1
  217. package/lib/families/crypto_org/js-broadcast.js.map +1 -1
  218. package/lib/families/crypto_org/js-buildTransaction.js +2 -2
  219. package/lib/families/crypto_org/js-buildTransaction.js.map +1 -1
  220. package/lib/families/crypto_org/transaction.js +2 -2
  221. package/lib/families/crypto_org/transaction.js.map +1 -1
  222. package/lib/families/elrond/api/apiCalls.js +7 -7
  223. package/lib/families/elrond/api/apiCalls.js.map +1 -1
  224. package/lib/families/elrond/hw-app-elrond/index.js +2 -2
  225. package/lib/families/elrond/hw-app-elrond/index.js.map +1 -1
  226. package/lib/families/elrond/preload.js +1 -1
  227. package/lib/families/elrond/preload.js.map +1 -1
  228. package/lib/families/elrond/test-dataset.js +4 -4
  229. package/lib/families/elrond/test-dataset.js.map +1 -1
  230. package/lib/families/elrond/transaction.js +2 -2
  231. package/lib/families/elrond/transaction.js.map +1 -1
  232. package/lib/families/ethereum/hw-signMessage.js +1 -1
  233. package/lib/families/ethereum/hw-signMessage.js.map +1 -1
  234. package/lib/families/ethereum/modules/compound.js +4 -4
  235. package/lib/families/ethereum/modules/compound.js.map +1 -1
  236. package/lib/families/ethereum/modules/send.js +2 -2
  237. package/lib/families/ethereum/modules/send.js.map +1 -1
  238. package/lib/families/ethereum/signOperation.js +2 -2
  239. package/lib/families/ethereum/signOperation.js.map +1 -1
  240. package/lib/families/ethereum/synchronisation.js +13 -13
  241. package/lib/families/ethereum/synchronisation.js.map +1 -1
  242. package/lib/families/ethereum/transaction.js +10 -10
  243. package/lib/families/ethereum/transaction.js.map +1 -1
  244. package/lib/families/filecoin/bridge/account.d.ts.map +1 -1
  245. package/lib/families/filecoin/bridge/account.js +4 -6
  246. package/lib/families/filecoin/bridge/account.js.map +1 -1
  247. package/lib/families/filecoin/bridge/utils/addresses.js +4 -4
  248. package/lib/families/filecoin/bridge/utils/addresses.js.map +1 -1
  249. package/lib/families/filecoin/bridge/utils/api.js +3 -3
  250. package/lib/families/filecoin/bridge/utils/api.js.map +1 -1
  251. package/lib/families/filecoin/bridge/utils/types.d.ts +1 -0
  252. package/lib/families/filecoin/bridge/utils/types.d.ts.map +1 -1
  253. package/lib/families/filecoin/bridge/utils/utils.d.ts +1 -0
  254. package/lib/families/filecoin/bridge/utils/utils.d.ts.map +1 -1
  255. package/lib/families/filecoin/bridge/utils/utils.js +30 -11
  256. package/lib/families/filecoin/bridge/utils/utils.js.map +1 -1
  257. package/lib/families/filecoin/hw-signMessage.js +1 -1
  258. package/lib/families/filecoin/hw-signMessage.js.map +1 -1
  259. package/lib/families/filecoin/test-dataset.d.ts.map +1 -1
  260. package/lib/families/filecoin/test-dataset.js +1 -22
  261. package/lib/families/filecoin/test-dataset.js.map +1 -1
  262. package/lib/families/filecoin/transaction.js +2 -2
  263. package/lib/families/filecoin/transaction.js.map +1 -1
  264. package/lib/families/filecoin/utils.js +2 -2
  265. package/lib/families/filecoin/utils.js.map +1 -1
  266. package/lib/families/neo/bridge/js.js +4 -4
  267. package/lib/families/neo/bridge/js.js.map +1 -1
  268. package/lib/families/neo/transaction.js +2 -2
  269. package/lib/families/neo/transaction.js.map +1 -1
  270. package/lib/families/polkadot/account.js +7 -7
  271. package/lib/families/polkadot/account.js.map +1 -1
  272. package/lib/families/polkadot/api/bisontrails.js +6 -6
  273. package/lib/families/polkadot/api/bisontrails.js.map +1 -1
  274. package/lib/families/polkadot/api/common.js +1 -1
  275. package/lib/families/polkadot/api/common.js.map +1 -1
  276. package/lib/families/polkadot/api/sidecar.js +8 -8
  277. package/lib/families/polkadot/api/sidecar.js.map +1 -1
  278. package/lib/families/polkadot/api/sidecar.types.d.ts +2 -1
  279. package/lib/families/polkadot/api/sidecar.types.d.ts.map +1 -1
  280. package/lib/families/polkadot/api/subscan.js +9 -9
  281. package/lib/families/polkadot/api/subscan.js.map +1 -1
  282. package/lib/families/polkadot/api/websocket.js +1 -1
  283. package/lib/families/polkadot/api/websocket.js.map +1 -1
  284. package/lib/families/polkadot/cache.js +10 -10
  285. package/lib/families/polkadot/cache.js.map +1 -1
  286. package/lib/families/polkadot/cli-transaction.js +7 -7
  287. package/lib/families/polkadot/cli-transaction.js.map +1 -1
  288. package/lib/families/polkadot/js-buildTransaction.js +1 -1
  289. package/lib/families/polkadot/js-buildTransaction.js.map +1 -1
  290. package/lib/families/polkadot/platformAdapter.js +1 -1
  291. package/lib/families/polkadot/platformAdapter.js.map +1 -1
  292. package/lib/families/polkadot/react.js +1 -1
  293. package/lib/families/polkadot/react.js.map +1 -1
  294. package/lib/families/polkadot/test-dataset.js +3 -3
  295. package/lib/families/polkadot/test-dataset.js.map +1 -1
  296. package/lib/families/polkadot/transaction.js +2 -2
  297. package/lib/families/polkadot/transaction.js.map +1 -1
  298. package/lib/families/ripple/bridge/js.js +8 -8
  299. package/lib/families/ripple/bridge/js.js.map +1 -1
  300. package/lib/families/ripple/transaction.js +3 -3
  301. package/lib/families/ripple/transaction.js.map +1 -1
  302. package/lib/families/solana/api/cached.js +1 -1
  303. package/lib/families/solana/api/cached.js.map +1 -1
  304. package/lib/families/solana/bridge/bridge.js +1 -1
  305. package/lib/families/solana/bridge/bridge.js.map +1 -1
  306. package/lib/families/solana/bridge/mock.js +2 -2
  307. package/lib/families/solana/bridge/mock.js.map +1 -1
  308. package/lib/families/solana/cli-transaction.js +3 -3
  309. package/lib/families/solana/cli-transaction.js.map +1 -1
  310. package/lib/families/solana/errors.d.ts +0 -3
  311. package/lib/families/solana/errors.d.ts.map +1 -1
  312. package/lib/families/solana/errors.js +1 -2
  313. package/lib/families/solana/errors.js.map +1 -1
  314. package/lib/families/solana/js-getTransactionStatus.d.ts +1 -1
  315. package/lib/families/solana/js-getTransactionStatus.d.ts.map +1 -1
  316. package/lib/families/solana/js-getTransactionStatus.js +51 -12
  317. package/lib/families/solana/js-getTransactionStatus.js.map +1 -1
  318. package/lib/families/solana/js-prepareTransaction.d.ts.map +1 -1
  319. package/lib/families/solana/js-prepareTransaction.js +8 -4
  320. package/lib/families/solana/js-prepareTransaction.js.map +1 -1
  321. package/lib/families/solana/js-signOperation.d.ts.map +1 -1
  322. package/lib/families/solana/js-signOperation.js +19 -9
  323. package/lib/families/solana/js-signOperation.js.map +1 -1
  324. package/lib/families/solana/js-synchronization.js +9 -6
  325. package/lib/families/solana/js-synchronization.js.map +1 -1
  326. package/lib/families/solana/logic.js +2 -2
  327. package/lib/families/solana/logic.js.map +1 -1
  328. package/lib/families/solana/speculos-deviceActions.js +1 -1
  329. package/lib/families/solana/speculos-deviceActions.js.map +1 -1
  330. package/lib/families/solana/test-dataset.js +7 -7
  331. package/lib/families/solana/test-dataset.js.map +1 -1
  332. package/lib/families/solana/transaction.js +7 -7
  333. package/lib/families/solana/transaction.js.map +1 -1
  334. package/lib/families/solana/utils.js +1 -1
  335. package/lib/families/solana/utils.js.map +1 -1
  336. package/lib/families/stellar/js-signOperation.js +1 -1
  337. package/lib/families/stellar/js-signOperation.js.map +1 -1
  338. package/lib/families/stellar/transaction.js +3 -3
  339. package/lib/families/stellar/transaction.js.map +1 -1
  340. package/lib/families/tezos/api/tzkt.js +3 -3
  341. package/lib/families/tezos/api/tzkt.js.map +1 -1
  342. package/lib/families/tezos/bakers.js +1 -1
  343. package/lib/families/tezos/bakers.js.map +1 -1
  344. package/lib/families/tezos/bridge/libcore.js +1 -1
  345. package/lib/families/tezos/bridge/libcore.js.map +1 -1
  346. package/lib/families/tezos/cli-transaction.js +1 -1
  347. package/lib/families/tezos/cli-transaction.js.map +1 -1
  348. package/lib/families/tezos/libcore-buildSubAccounts.js +1 -1
  349. package/lib/families/tezos/libcore-buildSubAccounts.js.map +1 -1
  350. package/lib/families/tezos/libcore-signOperation.js +3 -3
  351. package/lib/families/tezos/libcore-signOperation.js.map +1 -1
  352. package/lib/families/tezos/signOperation.js +1 -1
  353. package/lib/families/tezos/signOperation.js.map +1 -1
  354. package/lib/families/tezos/synchronisation.test.js +2 -2
  355. package/lib/families/tezos/synchronisation.test.js.map +1 -1
  356. package/lib/families/tezos/test-dataset.js +1 -1
  357. package/lib/families/tezos/test-dataset.js.map +1 -1
  358. package/lib/families/tezos/transaction.js +2 -2
  359. package/lib/families/tezos/transaction.js.map +1 -1
  360. package/lib/families/tron/bridge/js.js +7 -7
  361. package/lib/families/tron/bridge/js.js.map +1 -1
  362. package/lib/families/tron/cli-transaction.js +6 -6
  363. package/lib/families/tron/cli-transaction.js.map +1 -1
  364. package/lib/families/tron/react.js +1 -1
  365. package/lib/families/tron/react.js.map +1 -1
  366. package/lib/families/tron/specs.js +3 -3
  367. package/lib/families/tron/specs.js.map +1 -1
  368. package/lib/families/tron/speculos-deviceActions.js +1 -1
  369. package/lib/families/tron/speculos-deviceActions.js.map +1 -1
  370. package/lib/families/tron/transaction.js +3 -3
  371. package/lib/families/tron/transaction.js.map +1 -1
  372. package/lib/families/tron/utils.js +1 -1
  373. package/lib/families/tron/utils.js.map +1 -1
  374. package/lib/hw/actions/app.d.ts.map +1 -1
  375. package/lib/hw/actions/app.js +4 -5
  376. package/lib/hw/actions/app.js.map +1 -1
  377. package/lib/hw/checkAccountApp.js +1 -1
  378. package/lib/hw/checkAccountApp.js.map +1 -1
  379. package/lib/hw/checkCurrencyApp.js +1 -1
  380. package/lib/hw/checkCurrencyApp.js.map +1 -1
  381. package/lib/hw/connectApp.d.ts +1 -0
  382. package/lib/hw/connectApp.d.ts.map +1 -1
  383. package/lib/hw/connectApp.js +2 -1
  384. package/lib/hw/connectApp.js.map +1 -1
  385. package/lib/hw/flash.js +2 -2
  386. package/lib/hw/flash.js.map +1 -1
  387. package/lib/hw/getAddress/index.js +3 -3
  388. package/lib/hw/getAddress/index.js.map +1 -1
  389. package/lib/hw/index.js +3 -3
  390. package/lib/hw/index.js.map +1 -1
  391. package/lib/hw/signMessage/index.js +3 -3
  392. package/lib/hw/signMessage/index.js.map +1 -1
  393. package/lib/hw/signTransaction/index.js +1 -1
  394. package/lib/hw/signTransaction/index.js.map +1 -1
  395. package/lib/libcore/buildAccount/buildOperation.js +3 -3
  396. package/lib/libcore/buildAccount/buildOperation.js.map +1 -1
  397. package/lib/libcore/buildAccount/index.js +7 -7
  398. package/lib/libcore/buildAccount/index.js.map +1 -1
  399. package/lib/libcore/platforms/nodejs.js +5 -5
  400. package/lib/libcore/platforms/nodejs.js.map +1 -1
  401. package/lib/libcore/platforms/react-native.js +6 -6
  402. package/lib/libcore/platforms/react-native.js.map +1 -1
  403. package/lib/libcore/scanAccounts.js +4 -4
  404. package/lib/libcore/scanAccounts.js.map +1 -1
  405. package/lib/libcore/signOperation.js +1 -1
  406. package/lib/libcore/signOperation.js.map +1 -1
  407. package/lib/libcore/syncAccount.js +4 -4
  408. package/lib/libcore/syncAccount.js.map +1 -1
  409. package/lib/load/speculos.js +19 -19
  410. package/lib/load/speculos.js.map +1 -1
  411. package/lib/logs/simple.js +2 -2
  412. package/lib/logs/simple.js.map +1 -1
  413. package/lib/manager/index.js +2 -2
  414. package/lib/manager/index.js.map +1 -1
  415. package/lib/migrations/accounts.js +1 -1
  416. package/lib/migrations/accounts.js.map +1 -1
  417. package/lib/mock/account.js +4 -4
  418. package/lib/mock/account.js.map +1 -1
  419. package/lib/mock/helpers.js +2 -2
  420. package/lib/mock/helpers.js.map +1 -1
  421. package/lib/network.js +5 -5
  422. package/lib/network.js.map +1 -1
  423. package/lib/nft/helpers.js +1 -1
  424. package/lib/nft/helpers.js.map +1 -1
  425. package/lib/nft/nftId.js +1 -1
  426. package/lib/nft/nftId.js.map +1 -1
  427. package/lib/notifications/AnnouncementProvider/api/api.js +1 -1
  428. package/lib/notifications/AnnouncementProvider/api/api.js.map +1 -1
  429. package/lib/notifications/AnnouncementProvider/helpers.js +2 -2
  430. package/lib/notifications/AnnouncementProvider/helpers.js.map +1 -1
  431. package/lib/notifications/ServiceStatusProvider/api/api.js +1 -1
  432. package/lib/notifications/ServiceStatusProvider/api/api.js.map +1 -1
  433. package/lib/operation.js +1 -1
  434. package/lib/operation.js.map +1 -1
  435. package/lib/platform/PlatformAppProvider/api/api.js +1 -1
  436. package/lib/platform/PlatformAppProvider/api/api.js.map +1 -1
  437. package/lib/platform/PlatformAppProvider/providers.js +1 -1
  438. package/lib/platform/PlatformAppProvider/providers.js.map +1 -1
  439. package/lib/platform/converters.test.js +1 -1
  440. package/lib/platform/converters.test.js.map +1 -1
  441. package/lib/portfolio/index.js +3 -3
  442. package/lib/portfolio/index.js.map +1 -1
  443. package/lib/react.js +2 -2
  444. package/lib/react.js.map +1 -1
  445. package/lib/reactNative.js +2 -2
  446. package/lib/reactNative.js.map +1 -1
  447. package/lib/sanityChecks.js +1 -1
  448. package/lib/sanityChecks.js.map +1 -1
  449. package/lib/transaction/status.js +4 -4
  450. package/lib/transaction/status.js.map +1 -1
  451. package/package.json +26 -26
  452. package/src/__tests__/.DS_Store +0 -0
  453. package/src/__tests__/__snapshots__/all.libcore.ts.snap +9 -13
  454. package/src/apps/support.ts +1 -1
  455. package/src/bot/engine.ts +3 -1
  456. package/src/bot/formatters.ts +11 -1
  457. package/src/bot/index.ts +5 -5
  458. package/src/env.ts +1 -2
  459. package/src/families/crypto_org/js-buildTransaction.ts +2 -2
  460. package/src/families/filecoin/bridge/account.ts +0 -3
  461. package/src/families/filecoin/bridge/utils/types.ts +1 -0
  462. package/src/families/filecoin/bridge/utils/utils.ts +39 -7
  463. package/src/families/filecoin/test-dataset.ts +0 -22
  464. package/src/families/polkadot/api/sidecar.types.ts +3 -1
  465. package/src/families/solana/errors.ts +0 -4
  466. package/src/families/solana/js-getTransactionStatus.ts +65 -12
  467. package/src/families/solana/js-prepareTransaction.ts +7 -4
  468. package/src/families/solana/js-signOperation.ts +21 -9
  469. package/src/families/solana/js-synchronization.ts +11 -6
  470. package/src/families/solana/test-dataset.ts +6 -6
  471. package/src/families/tezos/synchronisation.test.ts +2 -2
  472. package/src/hw/actions/app.ts +5 -6
  473. package/src/hw/connectApp.ts +2 -0
@@ -18,6 +18,16 @@ const formatDt = (from, to) => (from && to ? formatTime(to - from) : "?");
18
18
  export function formatAppCandidate(appCandidate: AppCandidate) {
19
19
  return `${appCandidate.appName} ${appCandidate.appVersion} on ${appCandidate.model} ${appCandidate.firmware}`;
20
20
  }
21
+
22
+ export function formatError(e: any) {
23
+ if (!e || typeof e !== "object" || e instanceof Error) return String(e);
24
+ try {
25
+ return "raw object: " + JSON.stringify(e).slice(0, 400);
26
+ } catch (_e) {
27
+ return String(e);
28
+ }
29
+ }
30
+
21
31
  export function formatReportForConsole<T extends Transaction>({
22
32
  syncAllAccountsTime,
23
33
  appCandidate,
@@ -137,7 +147,7 @@ export function formatReportForConsole<T extends Transaction>({
137
147
  }
138
148
 
139
149
  if (error) {
140
- str += `⚠️ ${String(error)}\n`;
150
+ str += `⚠️ ${formatError(error)}\n`;
141
151
  }
142
152
 
143
153
  return str;
package/src/bot/index.ts CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  } from "../currencies";
19
19
  import { isAccountEmpty } from "../account";
20
20
  import { runWithAppSpec } from "./engine";
21
- import { formatReportForConsole } from "./formatters";
21
+ import { formatReportForConsole, formatError } from "./formatters";
22
22
  import {
23
23
  initialState,
24
24
  calculate,
@@ -230,7 +230,7 @@ export async function bot({ currency, family, mutation }: Arg = {}) {
230
230
  let subtitle = "";
231
231
 
232
232
  if (countervaluesError) {
233
- subtitle += `> ${String(countervaluesError)}`;
233
+ subtitle += `> ${formatError(countervaluesError)}`;
234
234
  }
235
235
 
236
236
  let slackBody = "";
@@ -254,8 +254,8 @@ export async function bot({ currency, family, mutation }: Arg = {}) {
254
254
  body += `<summary>${specFatals.length} critical spec errors</summary>\n\n`;
255
255
  specFatals.forEach(({ spec, fatalError }) => {
256
256
  body += `**Spec ${spec.name} failed!**\n`;
257
- body += "```\n" + String(fatalError) + "\n```\n\n";
258
- slackBody += `❌ *Spec ${spec.name}*: \`${String(fatalError)}\`\n`;
257
+ body += "```\n" + formatError(fatalError) + "\n```\n\n";
258
+ slackBody += `❌ *Spec ${spec.name}*: \`${formatError(fatalError)}\`\n`;
259
259
  });
260
260
  body += "</details>\n\n";
261
261
  }
@@ -268,7 +268,7 @@ export async function bot({ currency, family, mutation }: Arg = {}) {
268
268
  "```\n" +
269
269
  formatReportForConsole(c) +
270
270
  "\n" +
271
- String(c.error) +
271
+ formatError(c.error) +
272
272
  "\n```\n\n";
273
273
  });
274
274
  body += "</details>\n\n";
package/src/env.ts CHANGED
@@ -387,8 +387,7 @@ const envDefinitions = {
387
387
  desc: "set the currencies where NFT is active",
388
388
  },
389
389
  NFT_ETH_METADATA_SERVICE: {
390
- // FIXME LL-8001
391
- def: "https://nft.staging.aws.ledger.fr/v1/ethereum/1/contracts/tokens/infos",
390
+ def: "https://nft.api.live.ledger.com/v1/ethereum/1/contracts/tokens/infos",
392
391
  parser: stringParser,
393
392
  desc: "service uri used to get the metadata of an nft",
394
393
  },
@@ -10,8 +10,8 @@ const getTransactionAmount = (a: Account, t: Transaction) => {
10
10
  switch (t.mode) {
11
11
  case "send":
12
12
  if (t.useAllAmount) {
13
- const amountMinusFee = t.amount.minus(t.fees || 0);
14
- return new croSdk.Coin(amountMinusFee.toString(), Units.BASE);
13
+ const balanceMinusFee = a.balance.minus(t.fees || 0);
14
+ return new croSdk.Coin(balanceMinusFee.toString(), Units.BASE);
15
15
  } else {
16
16
  return new croSdk.Coin(t.amount.toString(), Units.BASE);
17
17
  }
@@ -2,7 +2,6 @@ import {
2
2
  AmountRequired,
3
3
  FeeNotLoaded,
4
4
  InvalidAddress,
5
- InvalidAddressBecauseDestinationIsAlsoSource,
6
5
  NotEnoughBalance,
7
6
  RecipientRequired,
8
7
  } from "@ledgerhq/errors";
@@ -71,8 +70,6 @@ const getTransactionStatus = async (
71
70
  const { recipient, amount, gasPremium, gasFeeCap, gasLimit } = t;
72
71
 
73
72
  if (!recipient) errors.recipient = new RecipientRequired();
74
- else if (address === recipient)
75
- errors.recipient = new InvalidAddressBecauseDestinationIsAlsoSource();
76
73
  else if (!validateAddress(recipient).isValid)
77
74
  errors.recipient = new InvalidAddress();
78
75
  else if (!validateAddress(address).isValid)
@@ -23,6 +23,7 @@ export interface TransactionResponse {
23
23
  hash: string;
24
24
  timestamp: number;
25
25
  height: number;
26
+ fee?: string;
26
27
  }
27
28
 
28
29
  export interface BalanceResponse {
@@ -14,27 +14,59 @@ import { encodeAccountId } from "../../../../account";
14
14
  import flatMap from "lodash/flatMap";
15
15
  import { Transaction } from "../../types";
16
16
 
17
+ type TxsById = {
18
+ [id: string]: {
19
+ Send: TransactionResponse;
20
+ Fee?: TransactionResponse;
21
+ };
22
+ };
23
+
17
24
  export const getUnit = () => getCryptoCurrencyById("filecoin").units[0];
18
25
 
26
+ export const processTxs = (
27
+ txs: TransactionResponse[]
28
+ ): TransactionResponse[] => {
29
+ const txsById = txs.reduce((result: TxsById, currentTx) => {
30
+ const { hash, type } = currentTx;
31
+ const txById = result[hash] || {};
32
+
33
+ if (type == "Send" || type == "Fee") txById[type] = currentTx;
34
+
35
+ result[hash] = txById;
36
+ return result;
37
+ }, {});
38
+
39
+ const processedTxs: TransactionResponse[] = [];
40
+ for (const txId in txsById) {
41
+ const { Fee: feeTx, Send: sendTx } = txsById[txId];
42
+
43
+ if (feeTx) sendTx.fee = feeTx.amount.toString();
44
+
45
+ processedTxs.push(sendTx);
46
+ }
47
+
48
+ return processedTxs;
49
+ };
50
+
19
51
  export const mapTxToOps =
20
52
  (id, { address }: GetAccountShapeArg0) =>
21
53
  (tx: TransactionResponse): Operation[] => {
22
- const { to, from, hash, timestamp, amount } = tx;
54
+ const { to, from, hash, timestamp, amount, fee } = tx;
23
55
  const ops: Operation[] = [];
24
56
  const date = new Date(timestamp * 1000);
25
57
  const value = parseCurrencyUnit(getUnit(), amount.toString());
26
58
 
27
59
  const isSending = address === from;
28
60
  const isReceiving = address === to;
29
- const fee = new BigNumber(0);
61
+ const feeToUse = new BigNumber(fee || 0);
30
62
 
31
63
  if (isSending) {
32
64
  ops.push({
33
65
  id: `${id}-${hash}-OUT`,
34
66
  hash,
35
67
  type: "OUT",
36
- value: value.plus(fee),
37
- fee,
68
+ value: value.plus(feeToUse),
69
+ fee: feeToUse,
38
70
  blockHeight: tx.height,
39
71
  blockHash: null,
40
72
  accountId: id,
@@ -51,7 +83,7 @@ export const mapTxToOps =
51
83
  hash,
52
84
  type: "IN",
53
85
  value,
54
- fee,
86
+ fee: feeToUse,
55
87
  blockHeight: tx.height,
56
88
  blockHash: null,
57
89
  accountId: id,
@@ -120,13 +152,13 @@ export const getAccountShape: GetAccountShape = async (info) => {
120
152
 
121
153
  const blockHeight = await fetchBlockHeight();
122
154
  const balance = await fetchBalances(address);
123
- const txs = await fetchTxs(address);
155
+ const rawTxs = await fetchTxs(address);
124
156
 
125
157
  const result = {
126
158
  id: accountId,
127
159
  balance: new BigNumber(balance.total_balance),
128
160
  spendableBalance: new BigNumber(balance.spendable_balance),
129
- operations: flatMap(txs, mapTxToOps(accountId, info)),
161
+ operations: flatMap(processTxs(rawTxs), mapTxToOps(accountId, info)),
130
162
  blockHeight: blockHeight.current_block_identifier.index,
131
163
  };
132
164
 
@@ -2,7 +2,6 @@ import { BigNumber } from "bignumber.js";
2
2
  import {
3
3
  AmountRequired,
4
4
  InvalidAddress,
5
- InvalidAddressBecauseDestinationIsAlsoSource,
6
5
  NotEnoughBalance,
7
6
  } from "@ledgerhq/errors";
8
7
 
@@ -56,27 +55,6 @@ const filecoin = {
56
55
  balance: "1000",
57
56
  },
58
57
  transactions: [
59
- {
60
- name: "recipient and sender must not be the same",
61
- transaction: fromTransactionRaw({
62
- family: "filecoin",
63
- method: 1,
64
- version: 1,
65
- nonce: 100,
66
- gasFeeCap: "1000",
67
- gasLimit: 100,
68
- gasPremium: "200",
69
- recipient: SEED_IDENTIFIER,
70
- amount: "100000000",
71
- }),
72
- expectedStatus: {
73
- amount: new BigNumber("100000000"),
74
- errors: {
75
- recipient: new InvalidAddressBecauseDestinationIsAlsoSource(),
76
- },
77
- warnings: {},
78
- },
79
- },
80
58
  {
81
59
  name: "Not a valid address",
82
60
  transaction: fromTransactionRaw({
@@ -1,3 +1,5 @@
1
+ import type { HexString } from "@polkadot/util/types";
2
+
1
3
  interface IAt {
2
4
  hash: string;
3
5
  height: string;
@@ -137,7 +139,7 @@ export interface SidecarTransactionMaterial {
137
139
  specName: string;
138
140
  specVersion: string;
139
141
  txVersion: string;
140
- metadata?: string;
142
+ metadata?: HexString;
141
143
  }
142
144
  export interface SidecarTransactionBroadcast {
143
145
  hash: string;
@@ -4,10 +4,6 @@ export const SolanaAccountNotFunded = createCustomErrorClass(
4
4
  "SolanaAccountNotFunded"
5
5
  );
6
6
 
7
- export const SolanaNotEnoughBalanceToPayFees = createCustomErrorClass(
8
- "SolanaNotEnoughBalanceToPayFees"
9
- );
10
-
11
7
  export const SolanaRecipientAssociatedTokenAccountWillBeFunded =
12
8
  createCustomErrorClass("SolanaAssociatedTokenAccountWillBeFunded");
13
9
 
@@ -1,10 +1,10 @@
1
1
  import { BigNumber } from "bignumber.js";
2
2
  import type { Account, TransactionStatus } from "../../types";
3
- import type { Command, Transaction } from "./types";
3
+ import type { Command, Transaction, TransactionModel } from "./types";
4
4
  import { assertUnreachable } from "./utils";
5
5
 
6
6
  const getTransactionStatus = async (
7
- _: Account,
7
+ account: Account,
8
8
  tx: Transaction
9
9
  ): Promise<TransactionStatus> => {
10
10
  const txFees = new BigNumber(tx.feeCalculator?.lamportsPerSignature ?? 0);
@@ -12,28 +12,37 @@ const getTransactionStatus = async (
12
12
  const { commandDescriptor } = tx.model;
13
13
 
14
14
  if (commandDescriptor === undefined) {
15
+ const amount = getAmountForModel(account, tx, txFees);
16
+ const totalSpent = getTotalSpentForModel(tx.model, amount, txFees);
15
17
  return {
16
- amount: new BigNumber(tx.amount),
18
+ amount,
17
19
  errors: {},
18
20
  warnings: {},
19
21
  estimatedFees: txFees,
20
- totalSpent: new BigNumber(tx.amount),
22
+ totalSpent,
21
23
  };
22
24
  }
23
25
  switch (commandDescriptor.status) {
24
- case "invalid":
26
+ case "invalid": {
27
+ const amount = getAmountForModel(account, tx, txFees);
28
+ const totalSpent = getTotalSpentForModel(tx.model, amount, txFees);
25
29
  return {
26
- amount: new BigNumber(tx.amount),
30
+ amount,
27
31
  errors: commandDescriptor.errors,
28
32
  warnings: commandDescriptor.warnings ?? {},
29
33
  estimatedFees: txFees,
30
- totalSpent: new BigNumber(0),
34
+ totalSpent,
31
35
  };
36
+ }
32
37
  case "valid": {
33
38
  const { command } = commandDescriptor;
34
39
  const estimatedFees = txFees.plus(commandDescriptor.fees ?? 0);
35
- const amount = getAmount(tx, command);
36
- const totalSpent = getTotalSpent(command, amount, estimatedFees);
40
+ const amount = getAmountForCommand(command);
41
+ const totalSpent = getTotalSpentForCommand(
42
+ command,
43
+ amount,
44
+ estimatedFees
45
+ );
37
46
 
38
47
  return {
39
48
  amount,
@@ -48,17 +57,61 @@ const getTransactionStatus = async (
48
57
  }
49
58
  };
50
59
 
51
- function getAmount(tx: Transaction, command: Command) {
60
+ function getAmountForModel(
61
+ account: Account,
62
+ tx: Transaction,
63
+ estimatedFees: BigNumber
64
+ ) {
65
+ const { model } = tx;
66
+ switch (model.kind) {
67
+ case "transfer": {
68
+ if (tx.amount.lte(0)) {
69
+ return tx.amount;
70
+ }
71
+ const amount = tx.useAllAmount
72
+ ? account.balance.minus(estimatedFees)
73
+ : BigNumber.max(tx.amount, 0);
74
+ return amount.gte(0) ? amount : account.balance;
75
+ }
76
+ case "token.transfer":
77
+ return tx.useAllAmount ? account.balance : tx.amount;
78
+ case "token.createATA":
79
+ return new BigNumber(0);
80
+ default:
81
+ return assertUnreachable(model);
82
+ }
83
+ }
84
+
85
+ function getTotalSpentForModel(
86
+ model: TransactionModel,
87
+ amount: BigNumber,
88
+ estimatedFees: BigNumber
89
+ ) {
90
+ switch (model.kind) {
91
+ case "transfer":
92
+ return amount.plus(estimatedFees);
93
+ case "token.transfer":
94
+ return amount;
95
+ case "token.createATA":
96
+ return estimatedFees;
97
+ default:
98
+ return assertUnreachable(model);
99
+ }
100
+ }
101
+
102
+ function getAmountForCommand(command: Command) {
52
103
  switch (command.kind) {
53
104
  case "transfer":
54
105
  case "token.transfer":
55
106
  return new BigNumber(command.amount);
107
+ case "token.createATA":
108
+ return new BigNumber(0);
56
109
  default:
57
- return tx.amount;
110
+ return assertUnreachable(command);
58
111
  }
59
112
  }
60
113
 
61
- function getTotalSpent(
114
+ function getTotalSpentForCommand(
62
115
  command: Command,
63
116
  amount: BigNumber,
64
117
  estimatedFees: BigNumber
@@ -17,7 +17,6 @@ import {
17
17
  SolanaMemoIsTooLong,
18
18
  SolanaTokenAccountHoldsAnotherToken,
19
19
  SolanaRecipientAssociatedTokenAccountWillBeFunded,
20
- SolanaNotEnoughBalanceToPayFees,
21
20
  SolanaTokenRecipientIsSenderATA,
22
21
  SolanaTokenAccounNotInitialized,
23
22
  } from "./errors";
@@ -64,11 +63,13 @@ async function deriveCommandDescriptor(
64
63
  }
65
64
 
66
65
  if (model.uiState.memo) {
67
- const encoder = new TextEncoder();
68
- if (encoder.encode(model.uiState.memo).byteLength > MAX_MEMO_LENGTH) {
66
+ const memoBytes = Buffer.from(model.uiState.memo, "utf-8");
67
+ if (memoBytes.byteLength > MAX_MEMO_LENGTH) {
69
68
  errors.memo = errors.memo = new SolanaMemoIsTooLong(undefined, {
70
69
  maxLength: MAX_MEMO_LENGTH,
71
70
  });
71
+ // LLM expects <transaction> as error key to disable continue button
72
+ errors.transaction = errors.memo;
72
73
  }
73
74
  }
74
75
 
@@ -102,6 +103,8 @@ const prepareTransaction = async (
102
103
 
103
104
  if (tx.feeCalculator === undefined) {
104
105
  patch.feeCalculator = feeCalculator;
106
+ // LLM requires this field to be truthy to show fees
107
+ (patch as any).networkInfo = true;
105
108
  }
106
109
 
107
110
  const txToDeriveFrom = {
@@ -137,7 +140,7 @@ const prepareTransaction = async (
137
140
  const totalFees =
138
141
  feeCalculator.lamportsPerSignature + (commandDescriptor.fees ?? 0);
139
142
  if (mainAccount.balance.lt(totalFees)) {
140
- errors.amount = new SolanaNotEnoughBalanceToPayFees();
143
+ errors.amount = new NotEnoughBalance();
141
144
  }
142
145
  }
143
146
  }
@@ -7,6 +7,7 @@ import type {
7
7
  } from "../../types";
8
8
  import { open, close } from "../../hw";
9
9
  import type {
10
+ Command,
10
11
  TokenCreateATACommand,
11
12
  TokenTransferCommand,
12
13
  Transaction,
@@ -147,9 +148,7 @@ function optimisticOpForTransfer(
147
148
  senders: [account.freshAddress],
148
149
  recipients: [transaction.recipient],
149
150
  value: new BigNumber(command.amount).plus(commons.fee),
150
- extra: {
151
- memo: command.memo,
152
- },
151
+ extra: getOpExtras(command),
153
152
  };
154
153
  }
155
154
 
@@ -170,9 +169,7 @@ function optimisticOpForTokenTransfer(
170
169
  senders: [account.freshAddress],
171
170
  recipients: [transaction.recipient],
172
171
  value: new BigNumber(command.amount),
173
- extra: {
174
- memo: command.memo,
175
- },
172
+ extra: getOpExtras(command),
176
173
  subOperations: [
177
174
  {
178
175
  ...optimisticOpcommons(transaction, commandDescriptor),
@@ -182,9 +179,7 @@ function optimisticOpForTokenTransfer(
182
179
  senders: [account.freshAddress],
183
180
  recipients: [transaction.recipient],
184
181
  value: new BigNumber(command.amount),
185
- extra: {
186
- memo: command.memo,
187
- },
182
+ extra: getOpExtras(command),
188
183
  },
189
184
  ],
190
185
  };
@@ -228,3 +223,20 @@ function optimisticOpcommons(
228
223
  extra: {},
229
224
  };
230
225
  }
226
+
227
+ function getOpExtras(command: Command): Record<string, any> {
228
+ const extra: Record<string, any> = {};
229
+ switch (command.kind) {
230
+ case "transfer":
231
+ case "token.transfer":
232
+ if (command.memo !== undefined) {
233
+ extra.memo = command.memo;
234
+ }
235
+ break;
236
+ case "token.createATA":
237
+ break;
238
+ default:
239
+ return assertUnreachable(command);
240
+ }
241
+ return extra;
242
+ }
@@ -299,9 +299,7 @@ function txToMainAccOperation(
299
299
  hasFailed: !!tx.info.err,
300
300
  blockHeight: tx.info.slot,
301
301
  blockHash: message.recentBlockhash,
302
- extra: {
303
- memo: tx.info.memo ? dropMemoLengthPrefixIfAny(tx.info.memo) : undefined,
304
- },
302
+ extra: getOpExtra(tx),
305
303
  type: opType,
306
304
  senders,
307
305
  recipients,
@@ -311,6 +309,15 @@ function txToMainAccOperation(
311
309
  };
312
310
  }
313
311
 
312
+ function getOpExtra(tx: TransactionDescriptor): Record<string, any> {
313
+ const extra: Record<string, any> = {};
314
+ if (tx.info.memo !== null) {
315
+ extra.memo = dropMemoLengthPrefixIfAny(tx.info.memo);
316
+ }
317
+
318
+ return extra;
319
+ }
320
+
314
321
  function txToTokenAccOperation(
315
322
  tx: TransactionDescriptor,
316
323
  assocTokenAcc: OnChainTokenAccount,
@@ -364,9 +371,7 @@ function txToTokenAccOperation(
364
371
  senders,
365
372
  value: delta.abs(),
366
373
  hasFailed: !!tx.info.err,
367
- extra: {
368
- memo: tx.info.memo ? dropMemoLengthPrefixIfAny(tx.info.memo) : undefined,
369
- },
374
+ extra: getOpExtra(tx),
370
375
  blockHash: tx.parsed.transaction.message.recentBlockhash,
371
376
  };
372
377
  }
@@ -110,7 +110,7 @@ const dataset: DatasetTest<Transaction> = {
110
110
  warnings: {},
111
111
  estimatedFees: fees(1),
112
112
  amount: zero,
113
- totalSpent: zero,
113
+ totalSpent: fees(1),
114
114
  },
115
115
  },
116
116
  {
@@ -175,7 +175,7 @@ const dataset: DatasetTest<Transaction> = {
175
175
  warnings: {},
176
176
  estimatedFees: fees(1),
177
177
  amount: testOnChainData.fundedSenderBalance,
178
- totalSpent: zero,
178
+ totalSpent: testOnChainData.fundedSenderBalance.plus(fees(1)),
179
179
  },
180
180
  },
181
181
  {
@@ -204,7 +204,7 @@ const dataset: DatasetTest<Transaction> = {
204
204
  warnings: {},
205
205
  estimatedFees: testOnChainData.fundedSenderBalance.plus(1),
206
206
  amount: zero,
207
- totalSpent: zero,
207
+ totalSpent: testOnChainData.fundedSenderBalance.plus(1),
208
208
  },
209
209
  },
210
210
  {
@@ -226,7 +226,7 @@ const dataset: DatasetTest<Transaction> = {
226
226
  warnings: {},
227
227
  estimatedFees: fees(1),
228
228
  amount: zero,
229
- totalSpent: zero,
229
+ totalSpent: fees(1),
230
230
  },
231
231
  },
232
232
  {
@@ -248,7 +248,7 @@ const dataset: DatasetTest<Transaction> = {
248
248
  warnings: {},
249
249
  estimatedFees: fees(1),
250
250
  amount: new BigNumber(-1),
251
- totalSpent: zero,
251
+ totalSpent: new BigNumber(-1).plus(fees(1)),
252
252
  },
253
253
  },
254
254
  {
@@ -497,7 +497,7 @@ function recipientRequired(): TransactionTestSpec[] {
497
497
  warnings: {},
498
498
  estimatedFees: fees(1),
499
499
  amount: zero,
500
- totalSpent: zero,
500
+ totalSpent: model.kind === "transfer" ? fees(1) : zero,
501
501
  },
502
502
  };
503
503
  });
@@ -9,8 +9,8 @@ import { makeSync } from "../../bridge/jsHelpers";
9
9
  import { getAccountShape } from "./synchronisation";
10
10
 
11
11
  const accounts = [
12
- "tz1cf8diKsP1WoeucTQm1BcVfdyrmaBnL4nC",
13
- "tz1ZshTmtorFVkcZ7CpceCAxCn7HBJqTfmpk",
12
+ // "tz1cf8diKsP1WoeucTQm1BcVfdyrmaBnL4nC", // FIXME
13
+ // "tz1ZshTmtorFVkcZ7CpceCAxCn7HBJqTfmpk", // FIXME
14
14
  "tz1ZL36Xw6LJ9RK6tb7QW85o7SVYfFKSMw8c",
15
15
  "tz1VacAyLcnHU3pEY3VNNK45F1CvVyTYXA3z",
16
16
  "tz1hpWkvAVVgftPy4CW8rD3u6tdVd8g1RU58",
@@ -2,6 +2,7 @@ import invariant from "invariant";
2
2
  import {
3
3
  concat,
4
4
  of,
5
+ timer,
5
6
  interval,
6
7
  Observable,
7
8
  throwError,
@@ -11,7 +12,6 @@ import {
11
12
  import {
12
13
  scan,
13
14
  debounce,
14
- debounceTime,
15
15
  catchError,
16
16
  timeout,
17
17
  switchMap,
@@ -161,7 +161,7 @@ const reducer = (state: State, e: Event): State => {
161
161
  return { ...state, unresponsive: true };
162
162
 
163
163
  case "disconnected":
164
- return getInitialState();
164
+ return { ...getInitialState(), isLoading: !!e.expected };
165
165
 
166
166
  case "deviceChange":
167
167
  return { ...getInitialState(e.device), device: e.device };
@@ -384,13 +384,14 @@ function inferCommandParams(appRequest: AppRequest) {
384
384
  };
385
385
  }
386
386
 
387
+ const DISCONNECT_DEBOUNCE = 5000;
387
388
  const implementations = {
388
389
  // in this paradigm, we know that deviceSubject is reflecting the device events
389
390
  // so we just trust deviceSubject to reflect the device context (switch between apps, dashboard,...)
390
391
  event: ({ deviceSubject, connectApp, params }) =>
391
392
  deviceSubject.pipe(
392
- // debounce a bit the connect/disconnect event that we don't need
393
- debounceTime(1000), // each time there is a device change, we pipe to the command
393
+ // debounce a bit the disconnect events that we don't need
394
+ debounce((device) => timer(!device ? DISCONNECT_DEBOUNCE : 0)),
394
395
  switchMap((device) =>
395
396
  concat(
396
397
  of({
@@ -406,7 +407,6 @@ const implementations = {
406
407
  Observable.create((o) => {
407
408
  const POLLING = 2000;
408
409
  const INIT_DEBOUNCE = 5000;
409
- const DISCONNECT_DEBOUNCE = 5000;
410
410
  const DEVICE_POLLING_TIMEOUT = 20000;
411
411
  // this pattern allows to actually support events based (like if deviceSubject emits new device changes) but inside polling paradigm
412
412
  let pollingOnDevice;
@@ -486,7 +486,6 @@ const implementations = {
486
486
  device,
487
487
  });
488
488
  }
489
-
490
489
  o.next(event);
491
490
  }
492
491
  },
@@ -53,6 +53,7 @@ export type ConnectAppEvent =
53
53
  }
54
54
  | {
55
55
  type: "disconnected";
56
+ expected?: boolean;
56
57
  }
57
58
  | {
58
59
  type: "device-permission-requested";
@@ -144,6 +145,7 @@ const attemptToQuitApp = (
144
145
  concatMap(() =>
145
146
  of<ConnectAppEvent>({
146
147
  type: "disconnected",
148
+ expected: true,
147
149
  })
148
150
  ),
149
151
  catchError((e) => throwError(e))