@ledgerhq/live-common 29.1.0 → 29.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 (481) hide show
  1. package/lib/account/serialization.d.ts +0 -6
  2. package/lib/account/serialization.d.ts.map +1 -1
  3. package/lib/account/serialization.js +11 -50
  4. package/lib/account/serialization.js.map +1 -1
  5. package/lib/apps/hw.js +1 -1
  6. package/lib/apps/hw.js.map +1 -1
  7. package/lib/countervalues/react.d.ts.map +1 -1
  8. package/lib/countervalues/react.js +1 -1
  9. package/lib/countervalues/react.js.map +1 -1
  10. package/lib/data/icons/react/gm.d.ts +8 -0
  11. package/lib/data/icons/react/gm.d.ts.map +1 -0
  12. package/lib/data/icons/react/gm.js +36 -0
  13. package/lib/data/icons/react/gm.js.map +1 -0
  14. package/lib/data/icons/react/index.d.ts +1 -0
  15. package/lib/data/icons/react/index.d.ts.map +1 -1
  16. package/lib/data/icons/react/index.js +9 -7
  17. package/lib/data/icons/react/index.js.map +1 -1
  18. package/lib/data/icons/reactNative/gm.d.ts +8 -0
  19. package/lib/data/icons/reactNative/gm.d.ts.map +1 -0
  20. package/lib/data/icons/reactNative/gm.js +37 -0
  21. package/lib/data/icons/reactNative/gm.js.map +1 -0
  22. package/lib/data/icons/reactNative/index.d.ts +1 -0
  23. package/lib/data/icons/reactNative/index.d.ts.map +1 -1
  24. package/lib/data/icons/reactNative/index.js +9 -7
  25. package/lib/data/icons/reactNative/index.js.map +1 -1
  26. package/lib/families/algorand/bridge/js.d.ts.map +1 -1
  27. package/lib/families/algorand/bridge/js.js +0 -1
  28. package/lib/families/algorand/bridge/js.js.map +1 -1
  29. package/lib/families/algorand/bridge/mock.d.ts.map +1 -1
  30. package/lib/families/algorand/bridge/mock.js +0 -1
  31. package/lib/families/algorand/bridge/mock.js.map +1 -1
  32. package/lib/families/algorand/serialization.d.ts +0 -1
  33. package/lib/families/algorand/serialization.d.ts.map +1 -1
  34. package/lib/families/algorand/serialization.js +1 -16
  35. package/lib/families/algorand/serialization.js.map +1 -1
  36. package/lib/families/bitcoin/bridge/js.d.ts.map +1 -1
  37. package/lib/families/bitcoin/bridge/js.js +4 -1
  38. package/lib/families/bitcoin/bridge/js.js.map +1 -1
  39. package/lib/families/bitcoin/descriptor.test.js +2 -0
  40. package/lib/families/bitcoin/descriptor.test.js.map +1 -1
  41. package/lib/families/bitcoin/satstack.test.js +2 -0
  42. package/lib/families/bitcoin/satstack.test.js.map +1 -1
  43. package/lib/families/bitcoin/serialization.d.ts +3 -0
  44. package/lib/families/bitcoin/serialization.d.ts.map +1 -1
  45. package/lib/families/bitcoin/serialization.js +16 -1
  46. package/lib/families/bitcoin/serialization.js.map +1 -1
  47. package/lib/families/bitcoin/serialization.test.d.ts +2 -0
  48. package/lib/families/bitcoin/serialization.test.d.ts.map +1 -0
  49. package/lib/families/bitcoin/serialization.test.js +110 -0
  50. package/lib/families/bitcoin/serialization.test.js.map +1 -0
  51. package/lib/families/cardano/bridge/js.d.ts.map +1 -1
  52. package/lib/families/cardano/bridge/js.js +0 -1
  53. package/lib/families/cardano/bridge/js.js.map +1 -1
  54. package/lib/families/cardano/serialization.d.ts +0 -1
  55. package/lib/families/cardano/serialization.d.ts.map +1 -1
  56. package/lib/families/cardano/serialization.js +1 -18
  57. package/lib/families/cardano/serialization.js.map +1 -1
  58. package/lib/families/celo/bridge/js.d.ts.map +1 -1
  59. package/lib/families/celo/bridge/js.js +0 -1
  60. package/lib/families/celo/bridge/js.js.map +1 -1
  61. package/lib/families/celo/serialization.d.ts +0 -1
  62. package/lib/families/celo/serialization.d.ts.map +1 -1
  63. package/lib/families/celo/serialization.js +1 -15
  64. package/lib/families/celo/serialization.js.map +1 -1
  65. package/lib/families/cosmos/bridge/js.d.ts.map +1 -1
  66. package/lib/families/cosmos/bridge/js.js +0 -2
  67. package/lib/families/cosmos/bridge/js.js.map +1 -1
  68. package/lib/families/cosmos/js-synchronisation.d.ts +1 -3
  69. package/lib/families/cosmos/js-synchronisation.d.ts.map +1 -1
  70. package/lib/families/cosmos/js-synchronisation.js +1 -16
  71. package/lib/families/cosmos/js-synchronisation.js.map +1 -1
  72. package/lib/families/crypto_org/api/sdk.d.ts.map +1 -1
  73. package/lib/families/crypto_org/api/sdk.js +6 -9
  74. package/lib/families/crypto_org/api/sdk.js.map +1 -1
  75. package/lib/families/crypto_org/js-buildTransaction.d.ts.map +1 -1
  76. package/lib/families/crypto_org/js-buildTransaction.js +3 -2
  77. package/lib/families/crypto_org/js-buildTransaction.js.map +1 -1
  78. package/lib/families/crypto_org/js-signOperation.js +1 -1
  79. package/lib/families/crypto_org/js-signOperation.js.map +1 -1
  80. package/lib/families/crypto_org/logic.d.ts +0 -16
  81. package/lib/families/crypto_org/logic.d.ts.map +1 -1
  82. package/lib/families/crypto_org/logic.js +6 -20
  83. package/lib/families/crypto_org/logic.js.map +1 -1
  84. package/lib/families/elrond/bridge/js.d.ts.map +1 -1
  85. package/lib/families/elrond/bridge/js.js +0 -2
  86. package/lib/families/elrond/bridge/js.js.map +1 -1
  87. package/lib/families/elrond/js-synchronisation.d.ts +1 -3
  88. package/lib/families/elrond/js-synchronisation.d.ts.map +1 -1
  89. package/lib/families/elrond/js-synchronisation.js +1 -16
  90. package/lib/families/elrond/js-synchronisation.js.map +1 -1
  91. package/lib/families/ethereum/__tests__/nft.integration.test.js +0 -7
  92. package/lib/families/ethereum/__tests__/nft.integration.test.js.map +1 -1
  93. package/lib/families/hedera/api/mirror.d.ts.map +1 -1
  94. package/lib/families/hedera/api/mirror.js +40 -16
  95. package/lib/families/hedera/api/mirror.js.map +1 -1
  96. package/lib/families/hedera/api/network.js +6 -1
  97. package/lib/families/hedera/api/network.js.map +1 -1
  98. package/lib/families/hedera/bridge.integration.test.js +1 -2
  99. package/lib/families/hedera/bridge.integration.test.js.map +1 -1
  100. package/lib/families/hedera/js-estimateMaxSpendable.d.ts.map +1 -1
  101. package/lib/families/hedera/js-estimateMaxSpendable.js +55 -11
  102. package/lib/families/hedera/js-estimateMaxSpendable.js.map +1 -1
  103. package/lib/families/hedera/js-getTransactionStatus.d.ts.map +1 -1
  104. package/lib/families/hedera/js-getTransactionStatus.js +5 -2
  105. package/lib/families/hedera/js-getTransactionStatus.js.map +1 -1
  106. package/lib/families/hedera/js-signOperation.js +23 -16
  107. package/lib/families/hedera/js-signOperation.js.map +1 -1
  108. package/lib/families/hedera/tests/js-estimateMaxSpendable.integration.test.d.ts +2 -0
  109. package/lib/families/hedera/tests/js-estimateMaxSpendable.integration.test.d.ts.map +1 -0
  110. package/lib/families/hedera/tests/{js-estimateMaxSpendable.test.js → js-estimateMaxSpendable.integration.test.js} +27 -3
  111. package/lib/families/hedera/tests/js-estimateMaxSpendable.integration.test.js.map +1 -0
  112. package/lib/families/hedera/tests/utils.integration.test.d.ts +2 -0
  113. package/lib/families/hedera/tests/utils.integration.test.d.ts.map +1 -0
  114. package/lib/families/hedera/tests/{utils.test.js → utils.integration.test.js} +28 -4
  115. package/lib/families/hedera/tests/utils.integration.test.js.map +1 -0
  116. package/lib/families/hedera/utils.d.ts +1 -1
  117. package/lib/families/hedera/utils.d.ts.map +1 -1
  118. package/lib/families/hedera/utils.js +40 -14
  119. package/lib/families/hedera/utils.js.map +1 -1
  120. package/lib/families/near/bridge/js.d.ts.map +1 -1
  121. package/lib/families/near/bridge/js.js +1 -2
  122. package/lib/families/near/bridge/js.js.map +1 -1
  123. package/lib/families/near/serialization.d.ts +0 -1
  124. package/lib/families/near/serialization.d.ts.map +1 -1
  125. package/lib/families/near/serialization.js +1 -15
  126. package/lib/families/near/serialization.js.map +1 -1
  127. package/lib/families/solana/api/chain/web3.d.ts +1 -0
  128. package/lib/families/solana/api/chain/web3.d.ts.map +1 -1
  129. package/lib/families/solana/api/chain/web3.js +16 -1
  130. package/lib/families/solana/api/chain/web3.js.map +1 -1
  131. package/lib/families/solana/bridge/bridge.d.ts.map +1 -1
  132. package/lib/families/solana/bridge/bridge.js +0 -1
  133. package/lib/families/solana/bridge/bridge.js.map +1 -1
  134. package/lib/families/solana/bridge.integration.test.js +7 -4
  135. package/lib/families/solana/bridge.integration.test.js.map +1 -1
  136. package/lib/families/solana/js-estimateMaxSpendable.d.ts.map +1 -1
  137. package/lib/families/solana/js-estimateMaxSpendable.js +9 -6
  138. package/lib/families/solana/js-estimateMaxSpendable.js.map +1 -1
  139. package/lib/families/solana/js-prepareTransaction.d.ts.map +1 -1
  140. package/lib/families/solana/js-prepareTransaction.js +15 -8
  141. package/lib/families/solana/js-prepareTransaction.js.map +1 -1
  142. package/lib/families/solana/logic.d.ts +0 -1
  143. package/lib/families/solana/logic.d.ts.map +1 -1
  144. package/lib/families/solana/logic.js +1 -4
  145. package/lib/families/solana/logic.js.map +1 -1
  146. package/lib/families/solana/serialization.d.ts +0 -1
  147. package/lib/families/solana/serialization.d.ts.map +1 -1
  148. package/lib/families/solana/serialization.js +1 -15
  149. package/lib/families/solana/serialization.js.map +1 -1
  150. package/lib/families/tezos/bridge/js.d.ts.map +1 -1
  151. package/lib/families/tezos/bridge/js.js +0 -1
  152. package/lib/families/tezos/bridge/js.js.map +1 -1
  153. package/lib/families/tezos/serialization.d.ts +0 -1
  154. package/lib/families/tezos/serialization.d.ts.map +1 -1
  155. package/lib/families/tezos/serialization.js +1 -18
  156. package/lib/families/tezos/serialization.js.map +1 -1
  157. package/lib/families/tron/bridge/js.d.ts.map +1 -1
  158. package/lib/families/tron/bridge/js.js +0 -1
  159. package/lib/families/tron/bridge/js.js.map +1 -1
  160. package/lib/families/tron/serialization.d.ts +0 -1
  161. package/lib/families/tron/serialization.d.ts.map +1 -1
  162. package/lib/families/tron/serialization.js +1 -15
  163. package/lib/families/tron/serialization.js.map +1 -1
  164. package/lib/hw/deviceAccess.d.ts.map +1 -1
  165. package/lib/hw/deviceAccess.js +4 -2
  166. package/lib/hw/deviceAccess.js.map +1 -1
  167. package/lib/hw/extractOnboardingState.d.ts +5 -3
  168. package/lib/hw/extractOnboardingState.d.ts.map +1 -1
  169. package/lib/hw/extractOnboardingState.js +6 -2
  170. package/lib/hw/extractOnboardingState.js.map +1 -1
  171. package/lib/hw/extractOnboardingState.test.js +46 -16
  172. package/lib/hw/extractOnboardingState.test.js.map +1 -1
  173. package/lib/hw/getDeviceName.d.ts.map +1 -1
  174. package/lib/hw/getDeviceName.js +2 -0
  175. package/lib/hw/getDeviceName.js.map +1 -1
  176. package/lib/hw/getDeviceName.test.js +16 -0
  177. package/lib/hw/getDeviceName.test.js.map +1 -1
  178. package/lib/hw/getOnboardingStatePolling.d.ts.map +1 -1
  179. package/lib/hw/getOnboardingStatePolling.js +38 -58
  180. package/lib/hw/getOnboardingStatePolling.js.map +1 -1
  181. package/lib/hw/getOnboardingStatePolling.test.js +1 -1
  182. package/lib/hw/getOnboardingStatePolling.test.js.map +1 -1
  183. package/lib/hw/hooks/useGenuineCheck.d.ts.map +1 -1
  184. package/lib/hw/hooks/useGenuineCheck.js +1 -0
  185. package/lib/hw/hooks/useGenuineCheck.js.map +1 -1
  186. package/lib/migrations/accounts-dataset.js +1 -1
  187. package/lib/migrations/accounts-dataset.js.map +1 -1
  188. package/lib/platform/providers/RemoteLiveAppProvider/index.d.ts +1 -0
  189. package/lib/platform/providers/RemoteLiveAppProvider/index.d.ts.map +1 -1
  190. package/lib/platform/providers/RemoteLiveAppProvider/index.js +6 -1
  191. package/lib/platform/providers/RemoteLiveAppProvider/index.js.map +1 -1
  192. package/lib/platform/types.d.ts +1 -0
  193. package/lib/platform/types.d.ts.map +1 -1
  194. package/lib-es/account/serialization.d.ts +0 -6
  195. package/lib-es/account/serialization.d.ts.map +1 -1
  196. package/lib-es/account/serialization.js +0 -36
  197. package/lib-es/account/serialization.js.map +1 -1
  198. package/lib-es/apps/hw.js +1 -1
  199. package/lib-es/apps/hw.js.map +1 -1
  200. package/lib-es/countervalues/react.d.ts.map +1 -1
  201. package/lib-es/countervalues/react.js +1 -1
  202. package/lib-es/countervalues/react.js.map +1 -1
  203. package/lib-es/data/icons/react/gm.d.ts +8 -0
  204. package/lib-es/data/icons/react/gm.d.ts.map +1 -0
  205. package/lib-es/data/icons/react/gm.js +11 -0
  206. package/lib-es/data/icons/react/gm.js.map +1 -0
  207. package/lib-es/data/icons/react/index.d.ts +1 -0
  208. package/lib-es/data/icons/react/index.d.ts.map +1 -1
  209. package/lib-es/data/icons/react/index.js +1 -0
  210. package/lib-es/data/icons/react/index.js.map +1 -1
  211. package/lib-es/data/icons/reactNative/gm.d.ts +8 -0
  212. package/lib-es/data/icons/reactNative/gm.d.ts.map +1 -0
  213. package/lib-es/data/icons/reactNative/gm.js +12 -0
  214. package/lib-es/data/icons/reactNative/gm.js.map +1 -0
  215. package/lib-es/data/icons/reactNative/index.d.ts +1 -0
  216. package/lib-es/data/icons/reactNative/index.d.ts.map +1 -1
  217. package/lib-es/data/icons/reactNative/index.js +1 -0
  218. package/lib-es/data/icons/reactNative/index.js.map +1 -1
  219. package/lib-es/families/algorand/bridge/js.d.ts.map +1 -1
  220. package/lib-es/families/algorand/bridge/js.js +1 -2
  221. package/lib-es/families/algorand/bridge/js.js.map +1 -1
  222. package/lib-es/families/algorand/bridge/mock.d.ts.map +1 -1
  223. package/lib-es/families/algorand/bridge/mock.js +1 -2
  224. package/lib-es/families/algorand/bridge/mock.js.map +1 -1
  225. package/lib-es/families/algorand/serialization.d.ts +0 -1
  226. package/lib-es/families/algorand/serialization.d.ts.map +1 -1
  227. package/lib-es/families/algorand/serialization.js +0 -11
  228. package/lib-es/families/algorand/serialization.js.map +1 -1
  229. package/lib-es/families/bitcoin/bridge/js.d.ts.map +1 -1
  230. package/lib-es/families/bitcoin/bridge/js.js +4 -1
  231. package/lib-es/families/bitcoin/bridge/js.js.map +1 -1
  232. package/lib-es/families/bitcoin/descriptor.test.js +2 -0
  233. package/lib-es/families/bitcoin/descriptor.test.js.map +1 -1
  234. package/lib-es/families/bitcoin/satstack.test.js +2 -0
  235. package/lib-es/families/bitcoin/satstack.test.js.map +1 -1
  236. package/lib-es/families/bitcoin/serialization.d.ts +3 -0
  237. package/lib-es/families/bitcoin/serialization.d.ts.map +1 -1
  238. package/lib-es/families/bitcoin/serialization.js +13 -0
  239. package/lib-es/families/bitcoin/serialization.js.map +1 -1
  240. package/lib-es/families/bitcoin/serialization.test.d.ts +2 -0
  241. package/lib-es/families/bitcoin/serialization.test.d.ts.map +1 -0
  242. package/lib-es/families/bitcoin/serialization.test.js +105 -0
  243. package/lib-es/families/bitcoin/serialization.test.js.map +1 -0
  244. package/lib-es/families/cardano/bridge/js.d.ts.map +1 -1
  245. package/lib-es/families/cardano/bridge/js.js +1 -2
  246. package/lib-es/families/cardano/bridge/js.js.map +1 -1
  247. package/lib-es/families/cardano/serialization.d.ts +0 -1
  248. package/lib-es/families/cardano/serialization.d.ts.map +1 -1
  249. package/lib-es/families/cardano/serialization.js +0 -13
  250. package/lib-es/families/cardano/serialization.js.map +1 -1
  251. package/lib-es/families/celo/bridge/js.d.ts.map +1 -1
  252. package/lib-es/families/celo/bridge/js.js +1 -2
  253. package/lib-es/families/celo/bridge/js.js.map +1 -1
  254. package/lib-es/families/celo/serialization.d.ts +0 -1
  255. package/lib-es/families/celo/serialization.d.ts.map +1 -1
  256. package/lib-es/families/celo/serialization.js +0 -13
  257. package/lib-es/families/celo/serialization.js.map +1 -1
  258. package/lib-es/families/cosmos/bridge/js.d.ts.map +1 -1
  259. package/lib-es/families/cosmos/bridge/js.js +0 -2
  260. package/lib-es/families/cosmos/bridge/js.js.map +1 -1
  261. package/lib-es/families/cosmos/js-synchronisation.d.ts +1 -3
  262. package/lib-es/families/cosmos/js-synchronisation.d.ts.map +1 -1
  263. package/lib-es/families/cosmos/js-synchronisation.js +0 -14
  264. package/lib-es/families/cosmos/js-synchronisation.js.map +1 -1
  265. package/lib-es/families/crypto_org/api/sdk.d.ts.map +1 -1
  266. package/lib-es/families/crypto_org/api/sdk.js +6 -9
  267. package/lib-es/families/crypto_org/api/sdk.js.map +1 -1
  268. package/lib-es/families/crypto_org/js-buildTransaction.d.ts.map +1 -1
  269. package/lib-es/families/crypto_org/js-buildTransaction.js +3 -2
  270. package/lib-es/families/crypto_org/js-buildTransaction.js.map +1 -1
  271. package/lib-es/families/crypto_org/js-signOperation.js +1 -1
  272. package/lib-es/families/crypto_org/js-signOperation.js.map +1 -1
  273. package/lib-es/families/crypto_org/logic.d.ts +0 -16
  274. package/lib-es/families/crypto_org/logic.d.ts.map +1 -1
  275. package/lib-es/families/crypto_org/logic.js +5 -19
  276. package/lib-es/families/crypto_org/logic.js.map +1 -1
  277. package/lib-es/families/elrond/bridge/js.d.ts.map +1 -1
  278. package/lib-es/families/elrond/bridge/js.js +0 -2
  279. package/lib-es/families/elrond/bridge/js.js.map +1 -1
  280. package/lib-es/families/elrond/js-synchronisation.d.ts +1 -3
  281. package/lib-es/families/elrond/js-synchronisation.d.ts.map +1 -1
  282. package/lib-es/families/elrond/js-synchronisation.js +0 -14
  283. package/lib-es/families/elrond/js-synchronisation.js.map +1 -1
  284. package/lib-es/families/ethereum/__tests__/nft.integration.test.js +1 -8
  285. package/lib-es/families/ethereum/__tests__/nft.integration.test.js.map +1 -1
  286. package/lib-es/families/hedera/api/mirror.d.ts.map +1 -1
  287. package/lib-es/families/hedera/api/mirror.js +40 -16
  288. package/lib-es/families/hedera/api/mirror.js.map +1 -1
  289. package/lib-es/families/hedera/api/network.js +6 -1
  290. package/lib-es/families/hedera/api/network.js.map +1 -1
  291. package/lib-es/families/hedera/bridge.integration.test.js +1 -2
  292. package/lib-es/families/hedera/bridge.integration.test.js.map +1 -1
  293. package/lib-es/families/hedera/js-estimateMaxSpendable.d.ts.map +1 -1
  294. package/lib-es/families/hedera/js-estimateMaxSpendable.js +56 -12
  295. package/lib-es/families/hedera/js-estimateMaxSpendable.js.map +1 -1
  296. package/lib-es/families/hedera/js-getTransactionStatus.d.ts.map +1 -1
  297. package/lib-es/families/hedera/js-getTransactionStatus.js +5 -2
  298. package/lib-es/families/hedera/js-getTransactionStatus.js.map +1 -1
  299. package/lib-es/families/hedera/js-signOperation.js +24 -17
  300. package/lib-es/families/hedera/js-signOperation.js.map +1 -1
  301. package/lib-es/families/hedera/tests/js-estimateMaxSpendable.integration.test.d.ts +2 -0
  302. package/lib-es/families/hedera/tests/js-estimateMaxSpendable.integration.test.d.ts.map +1 -0
  303. package/lib-es/families/hedera/tests/{js-estimateMaxSpendable.test.js → js-estimateMaxSpendable.integration.test.js} +27 -3
  304. package/lib-es/families/hedera/tests/js-estimateMaxSpendable.integration.test.js.map +1 -0
  305. package/lib-es/families/hedera/tests/utils.integration.test.d.ts +2 -0
  306. package/lib-es/families/hedera/tests/utils.integration.test.d.ts.map +1 -0
  307. package/lib-es/families/hedera/tests/{utils.test.js → utils.integration.test.js} +28 -4
  308. package/lib-es/families/hedera/tests/utils.integration.test.js.map +1 -0
  309. package/lib-es/families/hedera/utils.d.ts +1 -1
  310. package/lib-es/families/hedera/utils.d.ts.map +1 -1
  311. package/lib-es/families/hedera/utils.js +38 -13
  312. package/lib-es/families/hedera/utils.js.map +1 -1
  313. package/lib-es/families/near/bridge/js.d.ts.map +1 -1
  314. package/lib-es/families/near/bridge/js.js +2 -3
  315. package/lib-es/families/near/bridge/js.js.map +1 -1
  316. package/lib-es/families/near/serialization.d.ts +0 -1
  317. package/lib-es/families/near/serialization.d.ts.map +1 -1
  318. package/lib-es/families/near/serialization.js +0 -13
  319. package/lib-es/families/near/serialization.js.map +1 -1
  320. package/lib-es/families/solana/api/chain/web3.d.ts +1 -0
  321. package/lib-es/families/solana/api/chain/web3.d.ts.map +1 -1
  322. package/lib-es/families/solana/api/chain/web3.js +14 -0
  323. package/lib-es/families/solana/api/chain/web3.js.map +1 -1
  324. package/lib-es/families/solana/bridge/bridge.d.ts.map +1 -1
  325. package/lib-es/families/solana/bridge/bridge.js +1 -2
  326. package/lib-es/families/solana/bridge/bridge.js.map +1 -1
  327. package/lib-es/families/solana/bridge.integration.test.js +8 -5
  328. package/lib-es/families/solana/bridge.integration.test.js.map +1 -1
  329. package/lib-es/families/solana/js-estimateMaxSpendable.d.ts.map +1 -1
  330. package/lib-es/families/solana/js-estimateMaxSpendable.js +10 -7
  331. package/lib-es/families/solana/js-estimateMaxSpendable.js.map +1 -1
  332. package/lib-es/families/solana/js-prepareTransaction.d.ts.map +1 -1
  333. package/lib-es/families/solana/js-prepareTransaction.js +17 -10
  334. package/lib-es/families/solana/js-prepareTransaction.js.map +1 -1
  335. package/lib-es/families/solana/logic.d.ts +0 -1
  336. package/lib-es/families/solana/logic.d.ts.map +1 -1
  337. package/lib-es/families/solana/logic.js +1 -4
  338. package/lib-es/families/solana/logic.js.map +1 -1
  339. package/lib-es/families/solana/serialization.d.ts +0 -1
  340. package/lib-es/families/solana/serialization.d.ts.map +1 -1
  341. package/lib-es/families/solana/serialization.js +0 -13
  342. package/lib-es/families/solana/serialization.js.map +1 -1
  343. package/lib-es/families/tezos/bridge/js.d.ts.map +1 -1
  344. package/lib-es/families/tezos/bridge/js.js +1 -2
  345. package/lib-es/families/tezos/bridge/js.js.map +1 -1
  346. package/lib-es/families/tezos/serialization.d.ts +0 -1
  347. package/lib-es/families/tezos/serialization.d.ts.map +1 -1
  348. package/lib-es/families/tezos/serialization.js +0 -13
  349. package/lib-es/families/tezos/serialization.js.map +1 -1
  350. package/lib-es/families/tron/bridge/js.d.ts.map +1 -1
  351. package/lib-es/families/tron/bridge/js.js +1 -2
  352. package/lib-es/families/tron/bridge/js.js.map +1 -1
  353. package/lib-es/families/tron/serialization.d.ts +0 -1
  354. package/lib-es/families/tron/serialization.d.ts.map +1 -1
  355. package/lib-es/families/tron/serialization.js +0 -13
  356. package/lib-es/families/tron/serialization.js.map +1 -1
  357. package/lib-es/hw/deviceAccess.d.ts.map +1 -1
  358. package/lib-es/hw/deviceAccess.js +4 -2
  359. package/lib-es/hw/deviceAccess.js.map +1 -1
  360. package/lib-es/hw/extractOnboardingState.d.ts +5 -3
  361. package/lib-es/hw/extractOnboardingState.d.ts.map +1 -1
  362. package/lib-es/hw/extractOnboardingState.js +6 -2
  363. package/lib-es/hw/extractOnboardingState.js.map +1 -1
  364. package/lib-es/hw/extractOnboardingState.test.js +46 -16
  365. package/lib-es/hw/extractOnboardingState.test.js.map +1 -1
  366. package/lib-es/hw/getDeviceName.d.ts.map +1 -1
  367. package/lib-es/hw/getDeviceName.js +2 -0
  368. package/lib-es/hw/getDeviceName.js.map +1 -1
  369. package/lib-es/hw/getDeviceName.test.js +16 -0
  370. package/lib-es/hw/getDeviceName.test.js.map +1 -1
  371. package/lib-es/hw/getOnboardingStatePolling.d.ts.map +1 -1
  372. package/lib-es/hw/getOnboardingStatePolling.js +39 -59
  373. package/lib-es/hw/getOnboardingStatePolling.js.map +1 -1
  374. package/lib-es/hw/getOnboardingStatePolling.test.js +1 -1
  375. package/lib-es/hw/getOnboardingStatePolling.test.js.map +1 -1
  376. package/lib-es/hw/hooks/useGenuineCheck.d.ts.map +1 -1
  377. package/lib-es/hw/hooks/useGenuineCheck.js +1 -0
  378. package/lib-es/hw/hooks/useGenuineCheck.js.map +1 -1
  379. package/lib-es/migrations/accounts-dataset.js +1 -1
  380. package/lib-es/migrations/accounts-dataset.js.map +1 -1
  381. package/lib-es/platform/providers/RemoteLiveAppProvider/index.d.ts +1 -0
  382. package/lib-es/platform/providers/RemoteLiveAppProvider/index.d.ts.map +1 -1
  383. package/lib-es/platform/providers/RemoteLiveAppProvider/index.js +4 -0
  384. package/lib-es/platform/providers/RemoteLiveAppProvider/index.js.map +1 -1
  385. package/lib-es/platform/types.d.ts +1 -0
  386. package/lib-es/platform/types.d.ts.map +1 -1
  387. package/package.json +21 -21
  388. package/src/account/serialization.ts +0 -55
  389. package/src/apps/hw.ts +1 -1
  390. package/src/bot/portfolio/__snapshots__/formatter.test.ts.snap +1 -1
  391. package/src/countervalues/react.tsx +2 -2
  392. package/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap +34 -2
  393. package/src/data/icons/react/gm.tsx +14 -0
  394. package/src/data/icons/react/index.tsx +1 -0
  395. package/src/data/icons/reactNative/gm.tsx +15 -0
  396. package/src/data/icons/reactNative/index.tsx +1 -0
  397. package/src/data/icons/svg/GM.svg +4 -0
  398. package/src/families/algorand/bridge/js.ts +1 -6
  399. package/src/families/algorand/bridge/mock.ts +1 -6
  400. package/src/families/algorand/serialization.ts +0 -23
  401. package/src/families/bitcoin/bridge/js.ts +3 -0
  402. package/src/families/bitcoin/descriptor.test.ts +3 -0
  403. package/src/families/bitcoin/satstack.test.ts +3 -0
  404. package/src/families/bitcoin/serialization.test.ts +150 -0
  405. package/src/families/bitcoin/serialization.ts +22 -0
  406. package/src/families/cardano/bridge/js.ts +1 -6
  407. package/src/families/cardano/serialization.ts +0 -25
  408. package/src/families/celo/bridge/js.ts +1 -6
  409. package/src/families/celo/serialization.ts +0 -25
  410. package/src/families/cosmos/bridge/js.ts +0 -2
  411. package/src/families/cosmos/js-synchronisation.ts +1 -28
  412. package/src/families/crypto_org/api/sdk.ts +14 -18
  413. package/src/families/crypto_org/js-buildTransaction.ts +3 -2
  414. package/src/families/crypto_org/js-signOperation.ts +1 -1
  415. package/src/families/crypto_org/logic.ts +5 -19
  416. package/src/families/elrond/bridge/js.ts +0 -2
  417. package/src/families/elrond/js-synchronisation.ts +0 -28
  418. package/src/families/ethereum/__tests__/nft.integration.test.ts +1 -12
  419. package/src/families/hedera/api/mirror.ts +16 -15
  420. package/src/families/hedera/api/network.ts +9 -1
  421. package/src/families/hedera/bridge.integration.test.ts +1 -4
  422. package/src/families/hedera/js-estimateMaxSpendable.ts +4 -6
  423. package/src/families/hedera/js-getTransactionStatus.ts +3 -1
  424. package/src/families/hedera/js-signOperation.ts +2 -2
  425. package/src/families/hedera/tests/{js-estimateMaxSpendable.test.ts → js-estimateMaxSpendable.integration.test.ts} +17 -2
  426. package/src/families/hedera/tests/{utils.test.ts → utils.integration.test.ts} +18 -3
  427. package/src/families/hedera/utils.ts +17 -5
  428. package/src/families/near/bridge/js.ts +1 -6
  429. package/src/families/near/serialization.ts +0 -25
  430. package/src/families/solana/api/chain/web3.ts +11 -0
  431. package/src/families/solana/bridge/bridge.ts +1 -6
  432. package/src/families/solana/bridge.integration.test.ts +11 -5
  433. package/src/families/solana/js-estimateMaxSpendable.ts +14 -3
  434. package/src/families/solana/js-prepareTransaction.ts +23 -5
  435. package/src/families/solana/logic.ts +1 -6
  436. package/src/families/solana/serialization.ts +0 -26
  437. package/src/families/tezos/bridge/js.ts +1 -6
  438. package/src/families/tezos/serialization.ts +0 -25
  439. package/src/families/tron/bridge/js.ts +1 -6
  440. package/src/families/tron/serialization.ts +0 -25
  441. package/src/hw/deviceAccess.ts +6 -2
  442. package/src/hw/extractOnboardingState.test.ts +63 -16
  443. package/src/hw/extractOnboardingState.ts +6 -2
  444. package/src/hw/getDeviceName.test.ts +10 -0
  445. package/src/hw/getDeviceName.ts +2 -0
  446. package/src/hw/getOnboardingStatePolling.test.ts +1 -1
  447. package/src/hw/getOnboardingStatePolling.ts +13 -40
  448. package/src/hw/hooks/useGenuineCheck.ts +1 -0
  449. package/src/migrations/accounts-dataset.ts +1 -1
  450. package/src/platform/providers/RemoteLiveAppProvider/index.tsx +4 -0
  451. package/src/platform/types.ts +1 -0
  452. package/lib/__tests__/reconciliation.d.ts +0 -2
  453. package/lib/__tests__/reconciliation.d.ts.map +0 -1
  454. package/lib/__tests__/reconciliation.js +0 -51
  455. package/lib/__tests__/reconciliation.js.map +0 -1
  456. package/lib/families/hedera/tests/js-estimateMaxSpendable.test.d.ts +0 -2
  457. package/lib/families/hedera/tests/js-estimateMaxSpendable.test.d.ts.map +0 -1
  458. package/lib/families/hedera/tests/js-estimateMaxSpendable.test.js.map +0 -1
  459. package/lib/families/hedera/tests/utils.test.d.ts +0 -2
  460. package/lib/families/hedera/tests/utils.test.d.ts.map +0 -1
  461. package/lib/families/hedera/tests/utils.test.js.map +0 -1
  462. package/lib/reconciliation.d.ts +0 -9
  463. package/lib/reconciliation.d.ts.map +0 -1
  464. package/lib/reconciliation.js +0 -450
  465. package/lib/reconciliation.js.map +0 -1
  466. package/lib-es/__tests__/reconciliation.d.ts +0 -2
  467. package/lib-es/__tests__/reconciliation.d.ts.map +0 -1
  468. package/lib-es/__tests__/reconciliation.js +0 -49
  469. package/lib-es/__tests__/reconciliation.js.map +0 -1
  470. package/lib-es/families/hedera/tests/js-estimateMaxSpendable.test.d.ts +0 -2
  471. package/lib-es/families/hedera/tests/js-estimateMaxSpendable.test.d.ts.map +0 -1
  472. package/lib-es/families/hedera/tests/js-estimateMaxSpendable.test.js.map +0 -1
  473. package/lib-es/families/hedera/tests/utils.test.d.ts +0 -2
  474. package/lib-es/families/hedera/tests/utils.test.d.ts.map +0 -1
  475. package/lib-es/families/hedera/tests/utils.test.js.map +0 -1
  476. package/lib-es/reconciliation.d.ts +0 -9
  477. package/lib-es/reconciliation.d.ts.map +0 -1
  478. package/lib-es/reconciliation.js +0 -438
  479. package/lib-es/reconciliation.js.map +0 -1
  480. package/src/__tests__/reconciliation.ts +0 -40
  481. package/src/reconciliation.ts +0 -536
@@ -11,11 +11,7 @@ import signOperation from "../js-signOperation";
11
11
  import broadcast from "../js-broadcast";
12
12
  import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers";
13
13
  import type { AccountBridge, CurrencyBridge } from "@ledgerhq/types-live";
14
- import {
15
- applyReconciliation,
16
- assignToAccountRaw,
17
- assignFromAccountRaw,
18
- } from "../serialization";
14
+ import { assignToAccountRaw, assignFromAccountRaw } from "../serialization";
19
15
 
20
16
  const receive = makeAccountBridgeReceive();
21
17
 
@@ -27,7 +23,6 @@ const accountBridge: AccountBridge<Transaction> = {
27
23
  prepareTransaction,
28
24
  sync,
29
25
  receive,
30
- applyReconciliation,
31
26
  assignToAccountRaw,
32
27
  assignFromAccountRaw,
33
28
  signOperation,
@@ -16,7 +16,6 @@ import type {
16
16
  TokenRaw,
17
17
  } from "./types";
18
18
  import { Account, AccountRaw } from "@ledgerhq/types-live";
19
- import isEqual from "lodash/isEqual";
20
19
 
21
20
  function toTokenRaw({ assetName, policyId, amount }: Token): TokenRaw {
22
21
  return {
@@ -182,30 +181,6 @@ export function fromCardanoResourceRaw(
182
181
  };
183
182
  }
184
183
 
185
- export function applyReconciliation(
186
- account: Account,
187
- updatedRaw: AccountRaw,
188
- next: Account
189
- ): boolean {
190
- let changed = false;
191
- const cardanoAcc = account as CardanoAccount;
192
- const cardanoUpdatedRaw = updatedRaw as CardanoAccountRaw;
193
- if (
194
- cardanoUpdatedRaw.cardanoResources &&
195
- (!cardanoAcc.cardanoResources ||
196
- !isEqual(
197
- toCardanoResourceRaw(cardanoAcc.cardanoResources),
198
- cardanoUpdatedRaw.cardanoResources
199
- ))
200
- ) {
201
- (next as CardanoAccount).cardanoResources = fromCardanoResourceRaw(
202
- cardanoUpdatedRaw.cardanoResources
203
- );
204
- changed = true;
205
- }
206
- return changed;
207
- }
208
-
209
184
  export function assignToAccountRaw(
210
185
  account: Account,
211
186
  accountRaw: AccountRaw
@@ -9,11 +9,7 @@ import broadcast from "../js-broadcast";
9
9
  import estimateMaxSpendable from "../js-estimateMaxSpendable";
10
10
  import prepareTransaction from "../js-prepareTransaction";
11
11
  import createTransaction from "../js-createTransaction";
12
- import {
13
- applyReconciliation,
14
- assignFromAccountRaw,
15
- assignToAccountRaw,
16
- } from "../serialization";
12
+ import { assignFromAccountRaw, assignToAccountRaw } from "../serialization";
17
13
 
18
14
  const updateTransaction = (t, patch) => ({ ...t, ...patch });
19
15
 
@@ -35,7 +31,6 @@ const accountBridge: AccountBridge<Transaction> = {
35
31
  receive,
36
32
  signOperation,
37
33
  broadcast,
38
- applyReconciliation,
39
34
  assignFromAccountRaw,
40
35
  assignToAccountRaw,
41
36
  };
@@ -5,7 +5,6 @@ import type {
5
5
  CeloResourcesRaw,
6
6
  } from "./types";
7
7
  import { BigNumber } from "bignumber.js";
8
- import { isEqual } from "lodash";
9
8
  import { Account, AccountRaw } from "@ledgerhq/types-live";
10
9
 
11
10
  export function toCeloResourcesRaw(r: CeloResources): CeloResourcesRaw {
@@ -80,27 +79,3 @@ export function assignFromAccountRaw(accountRaw: AccountRaw, account: Account) {
80
79
  (account as CeloAccount).celoResources =
81
80
  fromCeloResourcesRaw(celoResourcesRaw);
82
81
  }
83
-
84
- export function applyReconciliation(
85
- account: Account,
86
- updatedRaw: AccountRaw,
87
- next: Account
88
- ): boolean {
89
- const celoAcc = account as CeloAccount;
90
- const celoUpdatedRaw = updatedRaw as CeloAccountRaw;
91
- let changed = false;
92
- if (
93
- celoUpdatedRaw.celoResources &&
94
- (!celoAcc.celoResources ||
95
- !isEqual(
96
- toCeloResourcesRaw(celoAcc.celoResources),
97
- celoUpdatedRaw.celoResources
98
- ))
99
- ) {
100
- (next as CeloAccount).celoResources = fromCeloResourcesRaw(
101
- celoUpdatedRaw.celoResources
102
- );
103
- changed = true;
104
- }
105
- return changed;
106
- }
@@ -17,7 +17,6 @@ import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
17
17
  import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets";
18
18
  import { CosmosValidatorsManager } from "../CosmosValidatorsManager";
19
19
  import { assignFromAccountRaw, assignToAccountRaw } from "../serialization";
20
- import { applyReconciliation } from "../js-synchronisation";
21
20
 
22
21
  const receive = makeAccountBridgeReceive();
23
22
 
@@ -71,7 +70,6 @@ const accountBridge: AccountBridge<Transaction> = {
71
70
  signOperation,
72
71
  assignFromAccountRaw,
73
72
  assignToAccountRaw,
74
- applyReconciliation,
75
73
  broadcast: async ({ account, signedOperation }) => {
76
74
  return new CosmosAPI(account.currency.id).broadcast({
77
75
  signedOperation,
@@ -8,12 +8,9 @@ import {
8
8
  import { encodeAccountId } from "../../account";
9
9
  import { CosmosAPI } from "./api/Cosmos";
10
10
  import { encodeOperationId } from "../../operation";
11
- import { CosmosAccount, CosmosAccountRaw, CosmosDelegationInfo } from "./types";
11
+ import { CosmosDelegationInfo } from "./types";
12
12
  import type { Operation, OperationType } from "@ledgerhq/types-live";
13
13
  import { getMainMessage } from "./helpers";
14
- import { isEqual } from "lodash";
15
- import { Account, AccountRaw } from "@ledgerhq/types-live";
16
- import { fromCosmosResourcesRaw, toCosmosResourcesRaw } from "./serialization";
17
14
 
18
15
  const getBlankOperation = (tx, fees, id) => ({
19
16
  id: "",
@@ -236,27 +233,3 @@ export const getAccountShape: GetAccountShape = async (info) => {
236
233
 
237
234
  export const scanAccounts = makeScanAccounts({ getAccountShape });
238
235
  export const sync = makeSync({ getAccountShape });
239
-
240
- export function applyReconciliation(
241
- account: Account,
242
- updatedRaw: AccountRaw,
243
- next: Account
244
- ): boolean {
245
- let changed = false;
246
- const cosmosAcc = account as CosmosAccount;
247
- const cosmosUpdatedRaw = updatedRaw as CosmosAccountRaw;
248
- if (
249
- cosmosUpdatedRaw.cosmosResources &&
250
- (!cosmosAcc.cosmosResources ||
251
- !isEqual(
252
- toCosmosResourcesRaw(cosmosAcc.cosmosResources),
253
- cosmosUpdatedRaw.cosmosResources
254
- ))
255
- ) {
256
- (next as CosmosAccount).cosmosResources = fromCosmosResourcesRaw(
257
- cosmosUpdatedRaw.cosmosResources
258
- );
259
- changed = true;
260
- }
261
- return changed;
262
- }
@@ -1,4 +1,4 @@
1
- import { utils } from "@crypto-com/chain-jslib";
1
+ import { utils } from "@crypto-org-chain/chain-jslib";
2
2
  import {
3
3
  CryptoOrgAccountTransaction,
4
4
  CryptoOrgMsgSendContent,
@@ -196,23 +196,19 @@ export const getOperations = async (
196
196
  const memoTransaction = memo || "";
197
197
 
198
198
  for (let j = 0; j < msgs.length; j++) {
199
- switch (msgs[j].type) {
200
- case CryptoOrgAccountTransactionTypeEnum.MsgSend: {
201
- const msgSend: CryptoOrgMsgSendContent = msgs[j].content;
202
- rawTransactions.push(
203
- convertSendTransactionToOperation(
204
- accountId,
205
- addr,
206
- msgSend,
207
- accountTransactions[i],
208
- currencyId,
209
- memoTransaction
210
- )
211
- );
212
- break;
213
- }
214
-
215
- default:
199
+ const msgType: string = msgs[j].type;
200
+ if (msgType.includes(CryptoOrgAccountTransactionTypeEnum.MsgSend)) {
201
+ const msgSend: CryptoOrgMsgSendContent = msgs[j].content;
202
+ rawTransactions.push(
203
+ convertSendTransactionToOperation(
204
+ accountId,
205
+ addr,
206
+ msgSend,
207
+ accountTransactions[i],
208
+ currencyId,
209
+ memoTransaction
210
+ )
211
+ );
216
212
  }
217
213
  }
218
214
  }
@@ -1,6 +1,7 @@
1
1
  import type { Transaction } from "./types";
2
2
  import type { Account } from "@ledgerhq/types-live";
3
- import { Units, utils } from "@crypto-com/chain-jslib";
3
+ import { Units, utils } from "@crypto-org-chain/chain-jslib";
4
+ import { SIGN_MODE } from "@crypto-org-chain/chain-jslib/lib/dist/transaction/types";
4
5
  import { getAccountParams } from "./api/sdk";
5
6
  import { getCroSdk } from "./logic";
6
7
 
@@ -56,7 +57,7 @@ export const buildTransaction = async (
56
57
  publicKey: utils.Bytes.fromHexString(publicKey),
57
58
  accountNumber: new utils.Big(accountNumber),
58
59
  accountSequence: new utils.Big(sequence),
59
- signMode: 0,
60
+ signMode: SIGN_MODE.LEGACY_AMINO_JSON,
60
61
  })
61
62
  .toSignable();
62
63
  return signableTx;
@@ -1,6 +1,6 @@
1
1
  import { BigNumber } from "bignumber.js";
2
2
  import { Observable } from "rxjs";
3
- import { utils } from "@crypto-com/chain-jslib";
3
+ import { utils } from "@crypto-org-chain/chain-jslib";
4
4
  import { FeeNotLoaded } from "@ledgerhq/errors";
5
5
  import CryptoOrgApp from "@ledgerhq/hw-app-cosmos";
6
6
  import {
@@ -1,23 +1,7 @@
1
- import { CroNetwork, CroSDK, utils } from "@crypto-com/chain-jslib";
1
+ import { CroNetwork, CroSDK, utils } from "@crypto-org-chain/chain-jslib";
2
2
  export const TESTNET_CURRENCY_ID = "crypto_org_croeseid";
3
3
  export const FIXED_GAS_PRICE = 0.025;
4
4
  export const FIXED_DEFAULT_GAS_LIMIT = 200000;
5
- export const TestnetCroeseid4 = {
6
- defaultNodeUrl: "https://testnet-croeseid-4.crypto.org",
7
- chainId: "testnet-croeseid-4",
8
- addressPrefix: "tcro",
9
- validatorAddressPrefix: "tcrocncl",
10
- validatorPubKeyPrefix: "tcrocnclconspub",
11
- coin: {
12
- baseDenom: "basetcro",
13
- croDenom: "tcro",
14
- },
15
- bip44Path: {
16
- coinType: 1,
17
- account: 0,
18
- },
19
- rpcUrl: "https://testnet-croeseid-4.crypto.org:26657",
20
- };
21
5
  const croSdks = {};
22
6
 
23
7
  /**
@@ -37,7 +21,7 @@ export function getCroSdk(currencyId: string) {
37
21
  if (!croSdks[currencyId]) {
38
22
  croSdks[currencyId] = isTestNet(currencyId)
39
23
  ? CroSDK({
40
- network: TestnetCroeseid4,
24
+ network: CroNetwork.TestnetCroeseid4,
41
25
  })
42
26
  : CroSDK({
43
27
  network: CroNetwork.Mainnet,
@@ -58,7 +42,9 @@ export const isValidAddress = (
58
42
  currencyId: string
59
43
  ): boolean => {
60
44
  if (!address) return false;
61
- const network = isTestNet(currencyId) ? TestnetCroeseid4 : CroNetwork.Mainnet;
45
+ const network = isTestNet(currencyId)
46
+ ? CroNetwork.TestnetCroeseid4
47
+ : CroNetwork.Mainnet;
62
48
  const addressProps = {
63
49
  address: address,
64
50
  network: network,
@@ -13,7 +13,6 @@ import estimateMaxSpendable from "../js-estimateMaxSpendable";
13
13
  import signOperation from "../js-signOperation";
14
14
  import broadcast from "../js-broadcast";
15
15
  import { assignFromAccountRaw, assignToAccountRaw } from "../serialization";
16
- import { applyReconciliation } from "../js-synchronisation";
17
16
 
18
17
  const receive = makeAccountBridgeReceive();
19
18
  const currencyBridge: CurrencyBridge = {
@@ -32,7 +31,6 @@ const accountBridge: AccountBridge<Transaction> = {
32
31
  receive,
33
32
  signOperation,
34
33
  broadcast,
35
- applyReconciliation,
36
34
  assignFromAccountRaw,
37
35
  assignToAccountRaw,
38
36
  };
@@ -1,5 +1,4 @@
1
1
  import { TokenAccount } from "@ledgerhq/types-live";
2
- import { isEqual } from "lodash";
3
2
  import { encodeAccountId, inferSubOperations } from "../../account";
4
3
  import type { GetAccountShape } from "../../bridge/jsHelpers";
5
4
  import { makeScanAccounts, makeSync, mergeOps } from "../../bridge/jsHelpers";
@@ -12,9 +11,6 @@ import {
12
11
  import elrondBuildESDTTokenAccounts from "./js-buildSubAccounts";
13
12
  import { reconciliateSubAccounts } from "./js-reconciliation";
14
13
  import { computeDelegationBalance } from "./logic";
15
- import { fromElrondResourcesRaw, toElrondResourcesRaw } from "./serialization";
16
- import { ElrondAccount, ElrondAccountRaw } from "./types";
17
- import { Account, AccountRaw } from "@ledgerhq/types-live";
18
14
 
19
15
  const getAccountShape: GetAccountShape = async (info, syncConfig) => {
20
16
  const { address, initialAccount, currency, derivationMode } = info;
@@ -86,27 +82,3 @@ const getAccountShape: GetAccountShape = async (info, syncConfig) => {
86
82
 
87
83
  export const scanAccounts = makeScanAccounts({ getAccountShape });
88
84
  export const sync = makeSync({ getAccountShape });
89
-
90
- export function applyReconciliation(
91
- account: Account,
92
- updatedRaw: AccountRaw,
93
- next: Account
94
- ): boolean {
95
- let changed = false;
96
- const elrondAcc = account as ElrondAccount;
97
- const elrondUpdatedRaw = updatedRaw as ElrondAccountRaw;
98
- if (
99
- elrondUpdatedRaw.elrondResources &&
100
- (!elrondAcc.elrondResources ||
101
- !isEqual(
102
- toElrondResourcesRaw(elrondAcc.elrondResources),
103
- elrondUpdatedRaw.elrondResources
104
- ))
105
- ) {
106
- (next as ElrondAccount).elrondResources = fromElrondResourcesRaw(
107
- elrondUpdatedRaw.elrondResources
108
- );
109
- changed = true;
110
- }
111
- return changed;
112
- }
@@ -1,10 +1,9 @@
1
1
  import "../../../__tests__/test-helpers/setup";
2
2
  import { reduce } from "rxjs/operators";
3
- import { fromAccountRaw, toAccountRaw } from "../../../account";
3
+ import { fromAccountRaw } from "../../../account";
4
4
  import type { Account, AccountRaw } from "@ledgerhq/types-live";
5
5
  import { getAccountBridge } from "../../../bridge";
6
6
  import { makeBridgeCacheSystem } from "../../../bridge/cache";
7
- import { patchAccount } from "../../../reconciliation";
8
7
 
9
8
  jest.setTimeout(200000);
10
9
 
@@ -105,16 +104,6 @@ ethTestingAccounts.forEach((a) => {
105
104
  expect(account.nfts?.find((n) => !n.amount.gt(0))).toEqual(undefined);
106
105
  });
107
106
 
108
- test("patchAccount restore new NFTs correctly", () => {
109
- const copy = {
110
- ...account,
111
- operations: [],
112
- nfts: account.nfts?.slice(Math.ceil((account.nfts?.length || 0) / 2)),
113
- };
114
- const newAccount = patchAccount(copy, toAccountRaw(account));
115
- expect(newAccount.nfts).toEqual(account.nfts);
116
- });
117
-
118
107
  test("remove half NFTs will restore them with half operations", async () => {
119
108
  const halfOps = Math.ceil(account.operations.length / 2);
120
109
  const copy = {
@@ -1,6 +1,5 @@
1
1
  import BigNumber from "bignumber.js";
2
2
  import network from "../../../network";
3
- import URL from "url";
4
3
  import { getAccountBalance } from "./network";
5
4
  import { Operation, OperationType } from "@ledgerhq/types-live";
6
5
  import { encodeOperationId } from "../../../operation";
@@ -10,14 +9,12 @@ import { base64ToUrlSafeBase64 } from "../utils";
10
9
 
11
10
  const getMirrorApiUrl = (): string => getEnv("API_HEDERA_MIRROR");
12
11
 
13
- const fetch = (path, query = {}) =>
14
- network({
12
+ const fetch = (path) => {
13
+ return network({
15
14
  method: "GET",
16
- url: URL.format({
17
- pathname: `${getMirrorApiUrl()}/api/v1${path}`,
18
- query,
19
- }),
15
+ url: `${getMirrorApiUrl()}${path}`,
20
16
  });
17
+ };
21
18
 
22
19
  export interface Account {
23
20
  accountId: AccountId;
@@ -29,10 +26,9 @@ export async function getAccountsForPublicKey(
29
26
  ): Promise<Account[]> {
30
27
  let r;
31
28
  try {
32
- r = await fetch("/accounts", {
33
- "account.publicKey": publicKey,
34
- balance: false,
35
- });
29
+ r = await fetch(
30
+ `/api/v1/accounts?account.publicKey=${publicKey}&balance=false`
31
+ );
36
32
  } catch (e: any) {
37
33
  if (e.name === "LedgerAPI4xx") return [];
38
34
  throw e;
@@ -70,12 +66,17 @@ export async function getOperationsForAccount(
70
66
  latestOperationTimestamp: string
71
67
  ): Promise<Operation[]> {
72
68
  const operations: Operation[] = [];
73
- const r = await fetch("/transactions", {
74
- "account.id": address,
75
- timestamp: `gt:${latestOperationTimestamp}`,
76
- });
69
+ let r = await fetch(
70
+ `/api/v1/transactions?account.id=${address}&timestamp=gt:${latestOperationTimestamp}`
71
+ );
77
72
  const rawOperations = r.data.transactions as HederaMirrorTransaction[];
78
73
 
74
+ while (r.data.links.next) {
75
+ r = await fetch(r.data.links.next);
76
+ const newOperations = r.data.transactions as HederaMirrorTransaction[];
77
+ rawOperations.push(...newOperations);
78
+ }
79
+
79
80
  for (const raw of rawOperations) {
80
81
  const { consensus_timestamp } = raw;
81
82
  const timestamp = new Date(
@@ -43,7 +43,7 @@ export async function getAccountBalance(
43
43
  try {
44
44
  accountBalance = await new hedera.AccountBalanceQuery({
45
45
  accountId,
46
- }).execute(getClient());
46
+ }).execute(getBalanceClient());
47
47
  } catch {
48
48
  throw new HederaAddAccountError();
49
49
  }
@@ -55,6 +55,8 @@ export async function getAccountBalance(
55
55
 
56
56
  let _hederaClient: hedera.Client | null = null;
57
57
 
58
+ let _hederaBalanceClient: hedera.Client | null = null;
59
+
58
60
  function getClient(): hedera.Client {
59
61
  _hederaClient ??= hedera.Client.forMainnet().setMaxNodesPerTransaction(1);
60
62
 
@@ -62,3 +64,9 @@ function getClient(): hedera.Client {
62
64
 
63
65
  return _hederaClient;
64
66
  }
67
+
68
+ function getBalanceClient(): hedera.Client {
69
+ _hederaBalanceClient ??= hedera.Client.forMainnet();
70
+
71
+ return _hederaBalanceClient;
72
+ }
@@ -9,7 +9,6 @@ import {
9
9
  } from "@ledgerhq/errors";
10
10
 
11
11
  import { fromTransactionRaw } from "./transaction";
12
- import { estimatedFeeSafetyRate } from "./utils";
13
12
 
14
13
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
15
14
  const hedera: CurrenciesData<Transaction> = {
@@ -94,9 +93,7 @@ const hedera: CurrenciesData<Transaction> = {
94
93
  }),
95
94
  expectedStatus: (account, _, status) => {
96
95
  return {
97
- amount: account.balance.minus(
98
- status.estimatedFees.toNumber() * estimatedFeeSafetyRate
99
- ),
96
+ amount: account.balance.minus(status.estimatedFees),
100
97
  errors: {},
101
98
  warnings: {},
102
99
  };
@@ -1,9 +1,9 @@
1
1
  import BigNumber from "bignumber.js";
2
- import { estimatedFeeSafetyRate, estimatedFees } from "./utils";
2
+ import { getEstimatedFees } from "./utils";
3
3
  import type { Account, AccountLike } from "@ledgerhq/types-live";
4
4
  import type { Transaction } from "./types";
5
5
 
6
- export default function estimateMaxSpendable({
6
+ export default async function estimateMaxSpendable({
7
7
  account,
8
8
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
9
  parentAccount,
@@ -16,11 +16,9 @@ export default function estimateMaxSpendable({
16
16
  }): Promise<BigNumber> {
17
17
  const balance = account.balance;
18
18
 
19
- // as fees are based on a currency conversion, we stay
20
- // on the safe side here and double the estimate for "max spendable"
21
- const estimatedFee = estimatedFees.multipliedBy(estimatedFeeSafetyRate);
19
+ const estimatedFees = await getEstimatedFees();
22
20
 
23
- let maxSpendable = balance.minus(estimatedFee);
21
+ let maxSpendable = balance.minus(estimatedFees);
24
22
 
25
23
  // set max spendable to 0 if negative
26
24
  // for cases where the user's account balance is smaller than the estimated fee
@@ -8,7 +8,7 @@ import {
8
8
  import { AccountId } from "@hashgraph/sdk";
9
9
  import type { Transaction, TransactionStatus } from "./types";
10
10
  import type { Account } from "@ledgerhq/types-live";
11
- import { calculateAmount, estimatedFees } from "./utils";
11
+ import { calculateAmount, getEstimatedFees } from "./utils";
12
12
 
13
13
  export default async function getTransactionStatus(
14
14
  account: Account,
@@ -43,6 +43,8 @@ export default async function getTransactionStatus(
43
43
  errors.amount = new NotEnoughBalance("");
44
44
  }
45
45
 
46
+ const estimatedFees = await getEstimatedFees();
47
+
46
48
  return {
47
49
  amount,
48
50
  errors,
@@ -9,7 +9,7 @@ import {
9
9
  import { withDevice } from "../../hw/deviceAccess";
10
10
  import { Transaction } from "./types";
11
11
  import { buildUnsignedTransaction } from "./api/network";
12
- import { estimatedFees } from "./utils";
12
+ import { getEstimatedFees } from "./utils";
13
13
  import Hedera from "./hw-app-hedera";
14
14
 
15
15
  const signOperation = ({
@@ -84,7 +84,7 @@ async function buildOptimisticOperation({
84
84
  hash: "",
85
85
  type: "OUT",
86
86
  value: transaction.amount,
87
- fee: estimatedFees,
87
+ fee: await getEstimatedFees(),
88
88
  blockHash: null,
89
89
  blockHeight: null,
90
90
  senders: [account.freshAddress.toString()],
@@ -1,7 +1,9 @@
1
1
  import BigNumber from "bignumber.js";
2
2
  import type { Account } from "@ledgerhq/types-live";
3
3
  import estimateMaxSpendable from "../js-estimateMaxSpendable";
4
+ import network from "../../../network";
4
5
 
6
+ // Balance is 1 Hbar
5
7
  const account: Account = {
6
8
  type: "Account",
7
9
  id: "",
@@ -14,7 +16,7 @@ const account: Account = {
14
16
  name: "",
15
17
  starred: false,
16
18
  used: false,
17
- balance: new BigNumber(200000),
19
+ balance: new BigNumber(100000000),
18
20
  spendableBalance: new BigNumber(0),
19
21
  creationDate: new Date(),
20
22
  blockHeight: 0,
@@ -51,7 +53,20 @@ const account: Account = {
51
53
  };
52
54
 
53
55
  describe("js-estimateMaxSpendable", () => {
54
- const estimatedFees = new BigNumber("83300").multipliedBy(2);
56
+ let estimatedFees = new BigNumber("150200").multipliedBy(2); // 0.001502 ℏ (as of 2023-03-14)
57
+
58
+ it("should return hedera price if available", async () => {
59
+ // If get hedera price works, use real estimate, otherwise fallback to hard coded
60
+ try {
61
+ const { data } = await network({
62
+ method: "GET",
63
+ url: "https://countervalues.live.ledger.com/latest/direct?pairs=hbar:usd",
64
+ });
65
+ estimatedFees = new BigNumber(10000).dividedBy(data[0]);
66
+ } catch {
67
+ console.error("Could not fetch Hedera price");
68
+ }
69
+ });
55
70
 
56
71
  test("estimateMaxSpendable", async () => {
57
72
  const result = await estimateMaxSpendable({
@@ -2,7 +2,9 @@ import BigNumber from "bignumber.js";
2
2
  import type { Account } from "@ledgerhq/types-live";
3
3
  import type { Transaction } from "../types";
4
4
  import { calculateAmount } from "../utils";
5
+ import network from "../../../network";
5
6
 
7
+ // Balance is 1 Hbar
6
8
  const account: Account = {
7
9
  type: "Account",
8
10
  id: "",
@@ -15,7 +17,7 @@ const account: Account = {
15
17
  name: "",
16
18
  starred: false,
17
19
  used: false,
18
- balance: new BigNumber(200000),
20
+ balance: new BigNumber(100000000),
19
21
  spendableBalance: new BigNumber(0),
20
22
  creationDate: new Date(),
21
23
  blockHeight: 0,
@@ -59,12 +61,25 @@ const transaction: Transaction = {
59
61
  };
60
62
 
61
63
  describe("utils", () => {
62
- const estimatedFees = new BigNumber("83300");
64
+ let estimatedFees = new BigNumber("150200").multipliedBy(2); // 0.001502 ℏ (as of 2023-03-14)
65
+
66
+ it("should return hedera price if available", async () => {
67
+ // If get hedera price works, use real estimate, otherwise fallback to hard coded
68
+ try {
69
+ const { data } = await network({
70
+ method: "GET",
71
+ url: "https://countervalues.live.ledger.com/latest/direct?pairs=hbar:usd",
72
+ });
73
+ estimatedFees = new BigNumber(10000).dividedBy(data[0]);
74
+ } catch {
75
+ console.error("Could not fetch Hedera price");
76
+ }
77
+ });
63
78
 
64
79
  test("calculateAmount transaction.useAllAmount = true", async () => {
65
80
  transaction.useAllAmount = true;
66
81
 
67
- const amount = account.balance.minus(estimatedFees.multipliedBy(2));
82
+ const amount = account.balance.minus(estimatedFees);
68
83
  const totalSpent = amount.plus(estimatedFees);
69
84
  const data = {
70
85
  amount,