@ledgerhq/live-common 34.54.0-nightly.20251204135727 → 34.54.0-nightly.20251205111238

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 (174) hide show
  1. package/lib/bridge/generic-alpaca/broadcast.d.ts.map +1 -1
  2. package/lib/bridge/generic-alpaca/broadcast.js +3 -3
  3. package/lib/bridge/generic-alpaca/broadcast.js.map +1 -1
  4. package/lib/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
  5. package/lib/bridge/generic-alpaca/currencyBridge.js +1 -3
  6. package/lib/bridge/generic-alpaca/currencyBridge.js.map +1 -1
  7. package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
  8. package/lib/bridge/generic-alpaca/estimateMaxSpendable.js +2 -1
  9. package/lib/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
  10. package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  11. package/lib/bridge/generic-alpaca/getAccountShape.js +16 -7
  12. package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  13. package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
  14. package/lib/bridge/generic-alpaca/getTransactionStatus.js +16 -1
  15. package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
  16. package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  17. package/lib/bridge/generic-alpaca/prepareTransaction.js +38 -4
  18. package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  19. package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
  20. package/lib/bridge/generic-alpaca/signOperation.js +18 -2
  21. package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
  22. package/lib/bridge/generic-alpaca/signer/Eth.d.ts +2 -0
  23. package/lib/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -1
  24. package/lib/bridge/generic-alpaca/signer/Eth.js +8 -1
  25. package/lib/bridge/generic-alpaca/signer/Eth.js.map +1 -1
  26. package/lib/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  27. package/lib/bridge/generic-alpaca/signer/index.js +7 -0
  28. package/lib/bridge/generic-alpaca/signer/index.js.map +1 -1
  29. package/lib/bridge/generic-alpaca/types.d.ts +4 -0
  30. package/lib/bridge/generic-alpaca/types.d.ts.map +1 -1
  31. package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
  32. package/lib/bridge/generic-alpaca/utils.js +11 -3
  33. package/lib/bridge/generic-alpaca/utils.js.map +1 -1
  34. package/lib/bridge/impl.d.ts.map +1 -1
  35. package/lib/bridge/impl.js +14 -3
  36. package/lib/bridge/impl.js.map +1 -1
  37. package/lib/currencies/helpers.d.ts +1 -0
  38. package/lib/currencies/helpers.d.ts.map +1 -1
  39. package/lib/currencies/helpers.js +7 -1
  40. package/lib/currencies/helpers.js.map +1 -1
  41. package/lib/families/canton/config.d.ts.map +1 -1
  42. package/lib/families/canton/config.js +4 -4
  43. package/lib/families/canton/config.js.map +1 -1
  44. package/lib/families/celo/setup.d.ts.map +1 -1
  45. package/lib/families/celo/setup.js +11 -0
  46. package/lib/families/celo/setup.js.map +1 -1
  47. package/lib/families/evm/bridge/mock.d.ts +1 -0
  48. package/lib/families/evm/bridge/mock.d.ts.map +1 -1
  49. package/lib/families/evm/bridge/mock.js +12 -0
  50. package/lib/families/evm/bridge/mock.js.map +1 -1
  51. package/lib/families/evm/setup.d.ts +1 -4
  52. package/lib/families/evm/setup.d.ts.map +1 -1
  53. package/lib/families/evm/setup.js +1 -8
  54. package/lib/families/evm/setup.js.map +1 -1
  55. package/lib/families/evm/walletApiAdapter.d.ts +7 -0
  56. package/lib/families/evm/walletApiAdapter.d.ts.map +1 -1
  57. package/lib/families/evm/walletApiAdapter.js +36 -2
  58. package/lib/families/evm/walletApiAdapter.js.map +1 -1
  59. package/lib/families/stacks/constants.d.ts +1 -1
  60. package/lib/families/stacks/constants.d.ts.map +1 -1
  61. package/lib/families/stacks/constants.js +1 -1
  62. package/lib/families/stacks/constants.js.map +1 -1
  63. package/lib/generated/bridge/js.d.ts +0 -1
  64. package/lib/generated/bridge/js.d.ts.map +1 -1
  65. package/lib/generated/bridge/js.js +30 -32
  66. package/lib/generated/bridge/js.js.map +1 -1
  67. package/lib/generated/bridge/mock.d.ts +1 -0
  68. package/lib/generated/bridge/mock.d.ts.map +1 -1
  69. package/lib/operation.d.ts.map +1 -1
  70. package/lib/operation.js +7 -2
  71. package/lib/operation.js.map +1 -1
  72. package/lib/wallet-api/constants.d.ts +1 -1
  73. package/lib-es/bridge/generic-alpaca/broadcast.d.ts.map +1 -1
  74. package/lib-es/bridge/generic-alpaca/broadcast.js +3 -3
  75. package/lib-es/bridge/generic-alpaca/broadcast.js.map +1 -1
  76. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
  77. package/lib-es/bridge/generic-alpaca/currencyBridge.js +1 -3
  78. package/lib-es/bridge/generic-alpaca/currencyBridge.js.map +1 -1
  79. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
  80. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js +2 -1
  81. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
  82. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  83. package/lib-es/bridge/generic-alpaca/getAccountShape.js +16 -7
  84. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  85. package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
  86. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +16 -1
  87. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
  88. package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  89. package/lib-es/bridge/generic-alpaca/prepareTransaction.js +38 -4
  90. package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  91. package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
  92. package/lib-es/bridge/generic-alpaca/signOperation.js +18 -2
  93. package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
  94. package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts +2 -0
  95. package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -1
  96. package/lib-es/bridge/generic-alpaca/signer/Eth.js +4 -0
  97. package/lib-es/bridge/generic-alpaca/signer/Eth.js.map +1 -1
  98. package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  99. package/lib-es/bridge/generic-alpaca/signer/index.js +7 -0
  100. package/lib-es/bridge/generic-alpaca/signer/index.js.map +1 -1
  101. package/lib-es/bridge/generic-alpaca/types.d.ts +4 -0
  102. package/lib-es/bridge/generic-alpaca/types.d.ts.map +1 -1
  103. package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
  104. package/lib-es/bridge/generic-alpaca/utils.js +11 -3
  105. package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
  106. package/lib-es/bridge/impl.d.ts.map +1 -1
  107. package/lib-es/bridge/impl.js +14 -3
  108. package/lib-es/bridge/impl.js.map +1 -1
  109. package/lib-es/currencies/helpers.d.ts +1 -0
  110. package/lib-es/currencies/helpers.d.ts.map +1 -1
  111. package/lib-es/currencies/helpers.js +5 -0
  112. package/lib-es/currencies/helpers.js.map +1 -1
  113. package/lib-es/families/canton/config.d.ts.map +1 -1
  114. package/lib-es/families/canton/config.js +4 -4
  115. package/lib-es/families/canton/config.js.map +1 -1
  116. package/lib-es/families/celo/setup.d.ts.map +1 -1
  117. package/lib-es/families/celo/setup.js +11 -0
  118. package/lib-es/families/celo/setup.js.map +1 -1
  119. package/lib-es/families/evm/bridge/mock.d.ts +1 -0
  120. package/lib-es/families/evm/bridge/mock.d.ts.map +1 -1
  121. package/lib-es/families/evm/bridge/mock.js +12 -0
  122. package/lib-es/families/evm/bridge/mock.js.map +1 -1
  123. package/lib-es/families/evm/setup.d.ts +1 -4
  124. package/lib-es/families/evm/setup.d.ts.map +1 -1
  125. package/lib-es/families/evm/setup.js +2 -8
  126. package/lib-es/families/evm/setup.js.map +1 -1
  127. package/lib-es/families/evm/walletApiAdapter.d.ts +7 -0
  128. package/lib-es/families/evm/walletApiAdapter.d.ts.map +1 -1
  129. package/lib-es/families/evm/walletApiAdapter.js +30 -1
  130. package/lib-es/families/evm/walletApiAdapter.js.map +1 -1
  131. package/lib-es/families/stacks/constants.d.ts +1 -1
  132. package/lib-es/families/stacks/constants.d.ts.map +1 -1
  133. package/lib-es/families/stacks/constants.js +1 -1
  134. package/lib-es/families/stacks/constants.js.map +1 -1
  135. package/lib-es/generated/bridge/js.d.ts +0 -1
  136. package/lib-es/generated/bridge/js.d.ts.map +1 -1
  137. package/lib-es/generated/bridge/js.js +0 -2
  138. package/lib-es/generated/bridge/js.js.map +1 -1
  139. package/lib-es/generated/bridge/mock.d.ts +1 -0
  140. package/lib-es/generated/bridge/mock.d.ts.map +1 -1
  141. package/lib-es/operation.d.ts.map +1 -1
  142. package/lib-es/operation.js +7 -2
  143. package/lib-es/operation.js.map +1 -1
  144. package/lib-es/wallet-api/constants.d.ts +1 -1
  145. package/package.json +57 -57
  146. package/src/bridge/generic-alpaca/broadcast.ts +6 -3
  147. package/src/bridge/generic-alpaca/currencyBridge.ts +1 -3
  148. package/src/bridge/generic-alpaca/estimateMaxSpendable.ts +2 -1
  149. package/src/bridge/generic-alpaca/getAccountShape.ts +24 -12
  150. package/src/bridge/generic-alpaca/getTransactionStatus.ts +16 -1
  151. package/src/bridge/generic-alpaca/prepareTransaction.ts +44 -10
  152. package/src/bridge/generic-alpaca/signOperation.ts +18 -2
  153. package/src/bridge/generic-alpaca/signer/Eth.ts +5 -1
  154. package/src/bridge/generic-alpaca/signer/index.ts +7 -0
  155. package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +2 -2
  156. package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +32 -0
  157. package/src/bridge/generic-alpaca/types.ts +4 -0
  158. package/src/bridge/generic-alpaca/utils.test.ts +1 -0
  159. package/src/bridge/generic-alpaca/utils.ts +14 -3
  160. package/src/bridge/impl.ts +16 -3
  161. package/src/currencies/helpers.test.ts +10 -1
  162. package/src/currencies/helpers.ts +6 -0
  163. package/src/families/canton/config.ts +5 -4
  164. package/src/families/celo/setup.ts +12 -0
  165. package/src/families/evm/bridge/mock.ts +14 -0
  166. package/src/families/evm/setup.ts +3 -22
  167. package/src/families/evm/walletApiAdapter.ts +33 -1
  168. package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +57 -11
  169. package/src/families/stacks/__snapshots__/bridge.integration.test.ts.snap +1537 -18
  170. package/src/families/stacks/__tests__/sync.integration.test.ts +2 -2
  171. package/src/families/stacks/constants.ts +1 -1
  172. package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +9 -9
  173. package/src/generated/bridge/js.ts +0 -2
  174. package/src/operation.ts +10 -2
@@ -1 +1 @@
1
- {"version":3,"file":"operation.js","sourceRoot":"","sources":["../src/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE1E,OAAO,EACL,mBAAmB,IAAI,sBAAsB,EAC7C,gBAAgB,IAAI,mBAAmB,EACvC,2BAA2B,IAAI,8BAA8B,GAC9D,MAAM,8BAA8B,CAAC;AACtC,cAAc,oCAAoC,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,OAAO,EACP,SAAS,GAIV,EAAW,EAAE;IACZ,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,KAAK,KAAK,EAAE;QACrC,OAAO,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;KACnD;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,MAAM,EACN,SAAS,GAIV,EAAW,EAAE;IACZ,IAAI,MAAM,KAAK,KAAK,EAAE;QACpB,OAAO,mBAAmB,CAAC,SAAS,CAAC,CAAC;KACvC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,OAAoB,EACpB,aAAyC,EAO7B,EAAE;IACd,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAE3D,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,KAAK,KAAK,EAAE;QACzC,OAAO,8BAA8B,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KAC/D;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
1
+ {"version":3,"file":"operation.js","sourceRoot":"","sources":["../src/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE1E,OAAO,EACL,mBAAmB,IAAI,sBAAsB,EAC7C,gBAAgB,IAAI,mBAAmB,EACvC,2BAA2B,IAAI,8BAA8B,GAC9D,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAGpD,cAAc,oCAAoC,CAAC;AAEnD,SAAS,aAAa,CAAC,QAAwB;IAC7C,MAAM,MAAM,GAAG,wBAAwB,CAAgB,QAAQ,CAAC,CAAC;IACjE,OAAO,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,OAAO,EACP,SAAS,GAIV,EAAW,EAAE;IACZ,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,KAAK,KAAK,EAAE;QACrC,OAAO,sBAAsB,CAAC,OAAO,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;KAClE;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,MAAM,EACN,SAAS,GAIV,EAAW,EAAE;IACZ,IAAI,MAAM,KAAK,KAAK,EAAE;QACpB,OAAO,mBAAmB,CAAC,SAAS,CAAC,CAAC;KACvC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,OAAoB,EACpB,aAAyC,EAO7B,EAAE;IACd,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAE3D,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,KAAK,KAAK,EAAE;QACzC,OAAO,8BAA8B,CAAC,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;KAC9E;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
@@ -11,7 +11,7 @@ export declare const FAMILIES_MAPPING_LL_TO_WAPI: Record<"evm" | "multiversx" |
11
11
  * This is not robust, we should have an explicit adapter between the wallet API currencies (families) and live currencies (families)
12
12
  * For example here, the `ethereum` family on `wallet-api` should be mapped to the `evm` family on LL
13
13
  */
14
- export declare const WALLET_API_FAMILIES: ("bitcoin" | "cardano" | "aptos" | "crypto_org" | "evm" | "ethereum" | "vechain" | "internet_computer" | "ton" | "sui" | "casper" | "cosmos" | "near" | "solana" | "tron" | "polkadot" | "tezos" | "algorand" | "multiversx" | "stellar" | "xrp" | "ripple" | "elrond" | "celo" | "filecoin" | "hedera" | "kaspa" | "neo" | "stacks")[];
14
+ export declare const WALLET_API_FAMILIES: ("bitcoin" | "cardano" | "aptos" | "crypto_org" | "evm" | "ethereum" | "vechain" | "internet_computer" | "ton" | "sui" | "casper" | "celo" | "cosmos" | "near" | "solana" | "tron" | "polkadot" | "tezos" | "algorand" | "multiversx" | "stellar" | "xrp" | "ripple" | "elrond" | "filecoin" | "hedera" | "kaspa" | "neo" | "stacks")[];
15
15
  export declare const WALLET_API_VERSION = "2.0.0";
16
16
  export declare const BROWSE_SEARCH_OPTIONS: Fuse.IFuseOptions<AppManifest>;
17
17
  export declare const HTTP_REGEX: RegExp;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ledgerhq/live-common",
3
3
  "description": "Common ground for the Ledger Live apps",
4
- "version": "34.54.0-nightly.20251204135727",
4
+ "version": "34.54.0-nightly.20251205111238",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/LedgerHQ/ledger-live.git"
@@ -115,7 +115,7 @@
115
115
  "@blooo/hw-app-acre": "^1.1.1",
116
116
  "@cardano-foundation/ledgerjs-hw-app-cardano": "^7.1.2",
117
117
  "@ledgerhq/device-management-kit": "0.11.2",
118
- "@ledgerhq/speculos-device-controller": "0.1.0",
118
+ "@ledgerhq/speculos-device-controller": "0.2.0",
119
119
  "@ledgerhq/live-app-sdk": "^0.8.1",
120
120
  "@ledgerhq/wallet-api-client": "^1.12.6",
121
121
  "@ledgerhq/wallet-api-core": "^1.27.0",
@@ -176,78 +176,78 @@
176
176
  "xstate": "^5.19.2",
177
177
  "yargs": "^17.0.0",
178
178
  "zod": "^3.22.4",
179
- "@ledgerhq/coin-aptos": "^3.6.1-nightly.20251204135727",
180
- "@ledgerhq/coin-bitcoin": "^0.26.0-nightly.20251204135727",
181
- "@ledgerhq/coin-canton": "^0.11.0-nightly.20251204135727",
182
- "@ledgerhq/coin-cardano": "^0.15.1-nightly.20251204135727",
183
- "@ledgerhq/coin-casper": "^2.4.1-nightly.20251204135727",
184
- "@ledgerhq/coin-algorand": "^0.14.0-nightly.20251204135727",
185
- "@ledgerhq/coin-celo": "^1.7.2-nightly.20251204135727",
186
- "@ledgerhq/coin-cosmos": "^0.21.0-nightly.20251204135727",
187
- "@ledgerhq/coin-evm": "^2.36.0-nightly.20251204135727",
188
- "@ledgerhq/coin-filecoin": "^1.15.0-nightly.20251204135727",
189
- "@ledgerhq/coin-framework": "^6.10.0-nightly.20251204135727",
190
- "@ledgerhq/coin-hedera": "^1.15.0-nightly.20251204135727",
191
- "@ledgerhq/coin-icon": "^0.15.1-nightly.20251204135727",
192
- "@ledgerhq/coin-mina": "^1.4.2-nightly.20251204135727",
193
- "@ledgerhq/coin-multiversx": "^0.8.1-nightly.20251204135727",
194
- "@ledgerhq/coin-internet_computer": "^1.11.1-nightly.20251204135727",
195
- "@ledgerhq/coin-kaspa": "^1.4.2-nightly.20251204135727",
196
- "@ledgerhq/coin-polkadot": "^6.14.0-nightly.20251204135727",
197
- "@ledgerhq/coin-stacks": "^0.12.1-nightly.20251204135727",
198
- "@ledgerhq/coin-stellar": "^6.8.0-nightly.20251204135727",
199
- "@ledgerhq/coin-solana": "^0.38.0-nightly.20251204135727",
200
- "@ledgerhq/coin-sui": "^0.18.1-nightly.20251204135727",
201
- "@ledgerhq/coin-near": "^0.16.1-nightly.20251204135727",
202
- "@ledgerhq/coin-tezos": "^6.10.0-nightly.20251204135727",
203
- "@ledgerhq/coin-ton": "^0.17.1-nightly.20251204135727",
204
- "@ledgerhq/coin-vechain": "^2.12.2-nightly.20251204135727",
205
- "@ledgerhq/coin-tron": "^5.7.1-nightly.20251204135727",
206
- "@ledgerhq/cryptoassets": "^13.34.0-nightly.20251204135727",
207
- "@ledgerhq/device-core": "^0.6.9-nightly.20251204135727",
179
+ "@ledgerhq/coin-algorand": "^0.14.0-nightly.20251205111238",
180
+ "@ledgerhq/coin-aptos": "^3.6.1-nightly.20251205111238",
181
+ "@ledgerhq/coin-bitcoin": "^0.26.0-nightly.20251205111238",
182
+ "@ledgerhq/coin-canton": "^0.11.0-nightly.20251205111238",
183
+ "@ledgerhq/coin-cardano": "^0.15.1-nightly.20251205111238",
184
+ "@ledgerhq/coin-casper": "^2.4.1-nightly.20251205111238",
185
+ "@ledgerhq/coin-celo": "^1.7.2-nightly.20251205111238",
186
+ "@ledgerhq/coin-cosmos": "^0.21.0-nightly.20251205111238",
187
+ "@ledgerhq/coin-evm": "^2.36.0-nightly.20251205111238",
188
+ "@ledgerhq/coin-filecoin": "^1.15.0-nightly.20251205111238",
189
+ "@ledgerhq/coin-framework": "^6.10.0-nightly.20251205111238",
190
+ "@ledgerhq/coin-hedera": "^1.15.0-nightly.20251205111238",
191
+ "@ledgerhq/coin-icon": "^0.15.1-nightly.20251205111238",
192
+ "@ledgerhq/coin-internet_computer": "^1.11.1-nightly.20251205111238",
193
+ "@ledgerhq/coin-kaspa": "^1.4.2-nightly.20251205111238",
194
+ "@ledgerhq/coin-mina": "^1.4.2-nightly.20251205111238",
195
+ "@ledgerhq/coin-multiversx": "^0.8.1-nightly.20251205111238",
196
+ "@ledgerhq/coin-near": "^0.16.1-nightly.20251205111238",
197
+ "@ledgerhq/coin-polkadot": "^6.14.0-nightly.20251205111238",
198
+ "@ledgerhq/coin-solana": "^0.38.0-nightly.20251205111238",
199
+ "@ledgerhq/coin-stacks": "^0.13.0-nightly.20251205111238",
200
+ "@ledgerhq/coin-stellar": "^6.8.0-nightly.20251205111238",
201
+ "@ledgerhq/coin-sui": "^0.18.1-nightly.20251205111238",
202
+ "@ledgerhq/coin-tezos": "^6.10.0-nightly.20251205111238",
203
+ "@ledgerhq/coin-ton": "^0.17.1-nightly.20251205111238",
204
+ "@ledgerhq/coin-tron": "^5.7.1-nightly.20251205111238",
205
+ "@ledgerhq/coin-vechain": "^2.12.2-nightly.20251205111238",
206
+ "@ledgerhq/coin-xrp": "^7.9.0-nightly.20251205111238",
207
+ "@ledgerhq/cryptoassets": "^13.34.0-nightly.20251205111238",
208
+ "@ledgerhq/device-core": "^0.6.9-nightly.20251205111238",
208
209
  "@ledgerhq/devices": "8.7.0",
209
210
  "@ledgerhq/errors": "^6.27.0",
210
211
  "@ledgerhq/hw-app-algorand": "^6.31.9",
211
- "@ledgerhq/hw-app-btc": "^10.12.1-nightly.20251204135727",
212
212
  "@ledgerhq/hw-app-aptos": "^6.34.9",
213
- "@ledgerhq/hw-app-celo": "^6.35.4-nightly.20251204135727",
214
- "@ledgerhq/coin-xrp": "^7.9.0-nightly.20251204135727",
213
+ "@ledgerhq/hw-app-btc": "^10.12.1-nightly.20251205111238",
214
+ "@ledgerhq/hw-app-celo": "^6.35.4-nightly.20251205111238",
215
215
  "@ledgerhq/hw-app-cosmos": "^6.32.9",
216
- "@ledgerhq/hw-app-eth": "^7.0.0-nightly.20251204135727",
217
- "@ledgerhq/hw-app-exchange": "^0.18.0-nightly.20251204135727",
216
+ "@ledgerhq/hw-app-eth": "^7.0.0-nightly.20251205111238",
217
+ "@ledgerhq/hw-app-exchange": "^0.18.0-nightly.20251205111238",
218
218
  "@ledgerhq/hw-app-hedera": "^1.2.9",
219
- "@ledgerhq/hw-app-kaspa": "^1.3.2",
220
- "@ledgerhq/hw-app-near": "^6.31.9",
221
219
  "@ledgerhq/hw-app-icon": "^1.3.9",
220
+ "@ledgerhq/hw-app-kaspa": "^1.3.2",
222
221
  "@ledgerhq/hw-app-multiversx": "^6.26.0",
222
+ "@ledgerhq/hw-app-near": "^6.31.9",
223
223
  "@ledgerhq/hw-app-polkadot": "^6.34.9",
224
224
  "@ledgerhq/hw-app-str": "^7.2.9",
225
225
  "@ledgerhq/hw-app-sui": "^1.4.0",
226
226
  "@ledgerhq/hw-app-tezos": "^6.31.9",
227
- "@ledgerhq/hw-app-vet": "^0.8.0-nightly.20251204135727",
227
+ "@ledgerhq/hw-app-trx": "^6.31.9",
228
+ "@ledgerhq/hw-app-vet": "^0.8.0-nightly.20251205111238",
228
229
  "@ledgerhq/hw-app-xrp": "^6.32.7",
229
- "@ledgerhq/ledger-cal-service": "^1.9.1-nightly.20251204135727",
230
230
  "@ledgerhq/hw-bolos": "^6.32.9",
231
- "@ledgerhq/hw-transport-mocker": "^6.29.13",
232
- "@ledgerhq/hw-app-trx": "^6.31.9",
233
231
  "@ledgerhq/hw-transport": "6.31.13",
232
+ "@ledgerhq/hw-transport-mocker": "^6.29.13",
233
+ "@ledgerhq/ledger-cal-service": "^1.9.1-nightly.20251205111238",
234
+ "@ledgerhq/ledger-trust-service": "^0.4.3-nightly.20251205111238",
234
235
  "@ledgerhq/live-config": "^3.2.0",
235
- "@ledgerhq/live-countervalues": "^0.10.1-nightly.20251204135727",
236
- "@ledgerhq/live-countervalues-react": "^0.7.3-nightly.20251204135727",
236
+ "@ledgerhq/live-countervalues": "^0.10.1-nightly.20251205111238",
237
+ "@ledgerhq/live-countervalues-react": "^0.7.3-nightly.20251205111238",
237
238
  "@ledgerhq/live-dmk-shared": "^0.15.0",
238
- "@ledgerhq/live-env": "^2.22.0-nightly.20251204135727",
239
- "@ledgerhq/live-network": "^2.1.2-nightly.20251204135727",
240
- "@ledgerhq/live-promise": "^0.1.1",
241
- "@ledgerhq/ledger-trust-service": "^0.4.3-nightly.20251204135727",
239
+ "@ledgerhq/live-env": "^2.22.0-nightly.20251205111238",
242
240
  "@ledgerhq/live-hooks": "0.2.0",
243
- "@ledgerhq/live-signer-solana": "^0.6.2-nightly.20251204135727",
244
- "@ledgerhq/live-signer-evm": "^0.10.2-nightly.20251204135727",
245
- "@ledgerhq/live-signer-canton": "^0.5.2-nightly.20251204135727",
246
- "@ledgerhq/live-wallet": "^0.16.1-nightly.20251204135727",
241
+ "@ledgerhq/live-network": "^2.1.2-nightly.20251205111238",
242
+ "@ledgerhq/live-promise": "^0.1.1",
243
+ "@ledgerhq/live-signer-canton": "^0.5.2-nightly.20251205111238",
244
+ "@ledgerhq/live-signer-evm": "^0.10.2-nightly.20251205111238",
245
+ "@ledgerhq/live-signer-solana": "^0.6.2-nightly.20251205111238",
246
+ "@ledgerhq/live-wallet": "^0.16.1-nightly.20251205111238",
247
247
  "@ledgerhq/logs": "^6.13.0",
248
- "@ledgerhq/speculos-transport": "^0.3.0-nightly.20251204135727",
249
- "@ledgerhq/wallet-api-acre-module": "^0.10.0-nightly.20251204135727",
250
- "@ledgerhq/wallet-api-exchange-module": "^0.19.0-nightly.20251204135727"
248
+ "@ledgerhq/speculos-transport": "^0.3.0-nightly.20251205111238",
249
+ "@ledgerhq/wallet-api-acre-module": "^0.10.0-nightly.20251205111238",
250
+ "@ledgerhq/wallet-api-exchange-module": "^0.19.0-nightly.20251205111238"
251
251
  },
252
252
  "devDependencies": {
253
253
  "@solana/web3.js": "1.95.4",
@@ -294,10 +294,10 @@
294
294
  "undici": "6.19.2",
295
295
  "uuid": "^8.3.2",
296
296
  "ws": "7",
297
+ "@ledgerhq/device-react": "^0.3.3-nightly.20251205111238",
297
298
  "@ledgerhq/types-cryptoassets": "^7.30.0",
298
299
  "@ledgerhq/types-devices": "^6.27.0",
299
- "@ledgerhq/types-live": "^6.90.0-nightly.20251204135727",
300
- "@ledgerhq/device-react": "^0.3.3-nightly.20251204135727"
300
+ "@ledgerhq/types-live": "^6.90.0-nightly.20251205111238"
301
301
  },
302
302
  "scripts": {
303
303
  "build": "zx ./scripts/build-ts.mjs",
@@ -1,11 +1,14 @@
1
1
  import { AccountBridge, TransactionCommon } from "@ledgerhq/types-live";
2
- import { patchOperationWithHash } from "../../operation";
2
+ import { patchOperationWithHash } from "@ledgerhq/coin-framework/operation";
3
3
  import { getAlpacaApi } from "./alpaca";
4
4
 
5
5
  export const genericBroadcast: (network, kind) => AccountBridge<TransactionCommon>["broadcast"] =
6
6
  (network, kind) =>
7
- async ({ signedOperation: { signature, operation }, account }) => {
8
- const hash = await getAlpacaApi(account.currency.id, kind).broadcast(signature);
7
+ async ({ signedOperation: { signature, operation }, account, broadcastConfig }) => {
8
+ const hash = await getAlpacaApi(account.currency.id, kind).broadcast(
9
+ signature,
10
+ broadcastConfig,
11
+ );
9
12
 
10
13
  return patchOperationWithHash(operation, hash);
11
14
  };
@@ -13,9 +13,7 @@ export function getAlpacaCurrencyBridge(
13
13
  const signer = customSigner ?? getSigner(network);
14
14
  return {
15
15
  preload: () => Promise.resolve({}),
16
- hydrate: () => {
17
- return;
18
- },
16
+ hydrate: () => undefined,
19
17
  scanAccounts: makeScanAccounts({
20
18
  getAccountShape: genericGetAccountShape(network, kind),
21
19
  getAddressFn: signer.getAddress.bind(signer),
@@ -30,11 +30,12 @@ export function genericEstimateMaxSpendable(
30
30
  )
31
31
  ).value;
32
32
  }
33
+ // TODO Remove the call to `validateIntent` https://ledgerhq.atlassian.net/browse/LIVE-22229
33
34
  const { amount } = await alpacaApi.validateIntent(
34
35
  transactionToIntent(account, { ...draftTransaction }, alpacaApi.computeIntentType),
35
36
  { value: transaction?.fees ? BigInt(transaction.fees.toString()) : 0n },
36
37
  );
37
- if (["stellar", "tezos"].includes(network)) {
38
+ if (["stellar", "tezos", "evm"].includes(network)) {
38
39
  return amount > 0 ? new BigNumber(amount.toString()) : new BigNumber(0);
39
40
  }
40
41
  const bnFee = BigNumber(fees.toString());
@@ -17,6 +17,10 @@ function isNftCoreOp(operation: Operation): boolean {
17
17
  );
18
18
  }
19
19
 
20
+ function isInternalLiveOp(operation: OperationCommon): boolean {
21
+ return !!operation.extra?.internal;
22
+ }
23
+
20
24
  export function genericGetAccountShape(network: string, kind: string): GetAccountShape {
21
25
  return async (info, syncConfig) => {
22
26
  const { address, initialAccount, currency, derivationMode } = info;
@@ -58,7 +62,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
58
62
 
59
63
  // Calculate minHeight for pagination
60
64
  const minHeight = syncFromScratch ? 0 : (oldOps[0]?.blockHeight ?? 0) + 1;
61
- const paginationParams: Pagination = { minHeight, order: "asc" };
65
+ const paginationParams: Pagination = { minHeight, order: "desc" };
62
66
  if (lastPagingToken && !syncFromScratch) {
63
67
  paginationParams.lastPagingToken = lastPagingToken;
64
68
  }
@@ -74,6 +78,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
74
78
  operation?.extra?.assetOwner &&
75
79
  !["OPT_IN", "OPT_OUT"].includes(operation.type),
76
80
  );
81
+ const newInternalOperations = newOps.filter(isInternalLiveOp);
77
82
  const newSubAccounts = await buildSubAccounts({
78
83
  accountId,
79
84
  allTokenAssetsBalances,
@@ -85,22 +90,29 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
85
90
  ? newSubAccounts
86
91
  : mergeSubAccounts(initialAccount?.subAccounts ?? [], newSubAccounts);
87
92
 
88
- const newOpsWithSubs = newOps.map(op => {
89
- const subOperations = inferSubOperations(op.hash, newSubAccounts);
93
+ const newOpsWithSubs = newOps
94
+ .filter(operation => !isInternalLiveOp(operation))
95
+ .map(op => {
96
+ const subOperations = inferSubOperations(op.hash, newSubAccounts);
97
+ const internalOperations = newInternalOperations.filter(it => it.hash === op.hash);
90
98
 
91
- return cleanedOperation({
92
- ...op,
93
- subOperations,
99
+ return cleanedOperation({
100
+ ...op,
101
+ subOperations,
102
+ internalOperations,
103
+ });
94
104
  });
95
- });
105
+ // Try to refresh known pending operations (if not already updated)
106
+ // Useful for integrations without explorers
107
+ const operationsToRefresh = initialAccount?.pendingOperations.filter(
108
+ pendingOp => !newOpsWithSubs.some(newOp => pendingOp.hash === newOp.hash),
109
+ );
96
110
  const confirmedOperations =
97
- alpacaApi.refreshOperations && initialAccount?.pendingOperations.length
98
- ? await alpacaApi.refreshOperations(initialAccount.pendingOperations)
111
+ alpacaApi.refreshOperations && operationsToRefresh?.length
112
+ ? await alpacaApi.refreshOperations(operationsToRefresh)
99
113
  : [];
100
114
  const newOperations = [...confirmedOperations, ...newOpsWithSubs];
101
- const operations = syncFromScratch
102
- ? newOperations
103
- : (mergeOps(oldOps, newOperations) as OperationCommon[]);
115
+ const operations = mergeOps(syncFromScratch ? [] : oldOps, newOperations) as OperationCommon[];
104
116
 
105
117
  const res: Partial<Account> = {
106
118
  id: accountId,
@@ -26,6 +26,7 @@ export function genericGetTransactionStatus(
26
26
  feesStrategy: transaction.feesStrategy,
27
27
  data: transaction.data,
28
28
  type: transaction.type,
29
+ sponsored: transaction.sponsored,
29
30
  };
30
31
 
31
32
  if (alpacaApi.getChainSpecificRules) {
@@ -37,10 +38,24 @@ export function genericGetTransactionStatus(
37
38
  }
38
39
  }
39
40
 
41
+ const fees = BigInt(transaction.fees?.toString() || "0");
42
+ const feesParameters = {
43
+ ...(transaction.gasLimit ? { gasLimit: BigInt(transaction.gasLimit.toFixed()) } : {}),
44
+ ...(transaction.gasPrice ? { gasPrice: BigInt(transaction.gasPrice.toFixed()) } : {}),
45
+ ...(transaction.maxFeePerGas
46
+ ? { maxFeePerGas: BigInt(transaction.maxFeePerGas.toFixed()) }
47
+ : {}),
48
+ ...(transaction.maxPriorityFeePerGas
49
+ ? { maxPriorityFeePerGas: BigInt(transaction.maxPriorityFeePerGas.toFixed()) }
50
+ : {}),
51
+ ...(transaction.additionalFees
52
+ ? { additionalFees: BigInt(transaction.additionalFees.toFixed()) }
53
+ : {}),
54
+ };
40
55
  const { errors, warnings, estimatedFees, amount, totalSpent, totalFees } =
41
56
  await alpacaApi.validateIntent(
42
57
  transactionToIntent(account, draftTransaction, alpacaApi.computeIntentType),
43
- { value: transaction.fees ? BigInt(transaction.fees.toString()) : 0n },
58
+ { value: fees, parameters: feesParameters },
44
59
  );
45
60
 
46
61
  return {
@@ -31,6 +31,11 @@ function propagateField(estimation: FeeEstimation, field: string, dest: GenericT
31
31
  dest[field] = Number(value.toString());
32
32
  return;
33
33
  case "storageLimit":
34
+ case "gasLimit":
35
+ case "gasPrice":
36
+ case "maxFeePerGas":
37
+ case "maxPriorityFeePerGas":
38
+ case "additionalFees":
34
39
  dest[field] = new BigNumber(value.toString());
35
40
  return;
36
41
  default:
@@ -51,17 +56,37 @@ export function genericPrepareTransaction(
51
56
  ? await getAssetInfos(transaction, account.freshAddress, getAssetFromToken)
52
57
  : assetInfosFallback(transaction);
53
58
  const customParametersFees = transaction.customFees?.parameters?.fees;
59
+
60
+ /**
61
+ * Ticking `useAllAmount` constantly resets the amount to 0. This is problematic
62
+ * because some Blockchain need the actual transaction amount to compute the fees
63
+ * (Example with EVM and ERC20 transactions)
64
+ * In case of `useAllAmount` and token transaction, we read the token account spendable
65
+ * balance instead.
66
+ */
67
+ let amount = transaction.amount;
68
+ if (transaction.useAllAmount && transaction.subAccountId) {
69
+ const subAccount = account.subAccounts?.find(acc => acc.id === transaction.subAccountId);
70
+ amount = subAccount?.spendableBalance ?? amount;
71
+ }
72
+
73
+ // Pass any parameters that help estimating fees
74
+ const intent = transactionToIntent(
75
+ account,
76
+ {
77
+ ...transaction,
78
+ amount,
79
+ },
80
+ computeIntentType,
81
+ );
54
82
  const estimation: FeeEstimation = customParametersFees
55
83
  ? { value: BigInt(customParametersFees.toFixed()) }
56
- : await estimateFees(
57
- transactionToIntent(
58
- account,
59
- {
60
- ...transaction,
61
- },
62
- computeIntentType,
63
- ),
64
- );
84
+ : await estimateFees(intent, {
85
+ gasPrice: transaction.gasPrice,
86
+ maxFeePerGas: transaction.maxFeePerGas,
87
+ maxPriorityFeePerGas: transaction.maxPriorityFeePerGas,
88
+ gasOptions: transaction.gasOptions,
89
+ });
65
90
  const fees = new BigNumber(estimation.value.toString());
66
91
 
67
92
  if (!bnEq(transaction.fees, fees)) {
@@ -78,7 +103,15 @@ export function genericPrepareTransaction(
78
103
  };
79
104
 
80
105
  // Propagate needed fields
81
- const fieldsToPropagate = ["type", "storageLimit"];
106
+ const fieldsToPropagate = [
107
+ "type",
108
+ "storageLimit",
109
+ "gasLimit",
110
+ "gasPrice",
111
+ "maxFeePerGas",
112
+ "maxPriorityFeePerGas",
113
+ "additionalFees",
114
+ ];
82
115
 
83
116
  for (const field of fieldsToPropagate) {
84
117
  propagateField(estimation, field, next);
@@ -86,6 +119,7 @@ export function genericPrepareTransaction(
86
119
 
87
120
  // align with stellar/xrp: when send max (or staking intents), reflect validated amount in UI
88
121
  if (transaction.useAllAmount || ["stake", "unstake"].includes(transaction.mode ?? "")) {
122
+ // TODO Remove the call to `validateIntent` https://ledgerhq.atlassian.net/browse/LIVE-22228
89
123
  const { amount } = await validateIntent(
90
124
  transactionToIntent(
91
125
  account,
@@ -86,6 +86,19 @@ export const genericSignOperation =
86
86
  const alpacaApi = getAlpacaApi(account.currency.id, kind);
87
87
  if (!transaction.fees) throw new FeeNotLoaded();
88
88
  const fees = BigInt(transaction.fees?.toString() || "0");
89
+ const feesParameters = {
90
+ ...(transaction.gasLimit ? { gasLimit: BigInt(transaction.gasLimit.toFixed()) } : {}),
91
+ ...(transaction.gasPrice ? { gasPrice: BigInt(transaction.gasPrice.toFixed()) } : {}),
92
+ ...(transaction.maxFeePerGas
93
+ ? { maxFeePerGas: BigInt(transaction.maxFeePerGas.toFixed()) }
94
+ : {}),
95
+ ...(transaction.maxPriorityFeePerGas
96
+ ? { maxPriorityFeePerGas: BigInt(transaction.maxPriorityFeePerGas.toFixed()) }
97
+ : {}),
98
+ ...(transaction.additionalFees
99
+ ? { additionalFees: BigInt(transaction.additionalFees.toFixed()) }
100
+ : {}),
101
+ };
89
102
  if (transaction.useAllAmount) {
90
103
  const draftTransaction = {
91
104
  mode: transaction.mode,
@@ -98,10 +111,12 @@ export const genericSignOperation =
98
111
  family: transaction.family,
99
112
  feesStrategy: transaction.feesStrategy,
100
113
  data: transaction.data,
114
+ type: transaction.type,
101
115
  };
116
+ // TODO Remove the call to `validateIntent` https://ledgerhq.atlassian.net/browse/LIVE-22227
102
117
  const { amount } = await alpacaApi.validateIntent(
103
118
  transactionToIntent(account, draftTransaction, alpacaApi.computeIntentType),
104
- { value: fees },
119
+ { value: fees, parameters: feesParameters },
105
120
  );
106
121
  transaction.amount = new BigNumber(amount.toString());
107
122
  }
@@ -119,7 +134,7 @@ export const genericSignOperation =
119
134
  // Enrich with memo and asset information
120
135
  transactionIntent = enrichTransactionIntent(transactionIntent, transaction, publicKey);
121
136
 
122
- if (typeof transactionIntent.sequence !== "bigint") {
137
+ if (typeof transactionIntent.sequence !== "bigint" || transactionIntent.sequence < 0n) {
123
138
  // TODO: should compute it and pass it down to craftTransaction (duplicate call right now)
124
139
  const sequenceNumber = await alpacaApi.getSequence(transactionIntent.sender);
125
140
  transactionIntent.sequence = sequenceNumber;
@@ -128,6 +143,7 @@ export const genericSignOperation =
128
143
  /* Craft unsigned blob via Alpaca */
129
144
  const { transaction: unsigned } = await alpacaApi.craftTransaction(transactionIntent, {
130
145
  value: fees,
146
+ parameters: feesParameters,
131
147
  });
132
148
 
133
149
  /* Notify UI that the device is now showing the tx */
@@ -1,6 +1,6 @@
1
1
  import { filter, firstValueFrom } from "rxjs";
2
2
  import { EvmAddress, EvmSignature, EvmSigner } from "@ledgerhq/coin-evm/types/signer";
3
- import { CreateSigner } from "../../setup";
3
+ import { CreateSigner, executeWithSigner } from "../../setup";
4
4
  import { DeviceManagementKit } from "@ledgerhq/device-management-kit";
5
5
  import { DmkSignerEth, LegacySignerEth } from "@ledgerhq/live-signer-evm";
6
6
  import Transport from "@ledgerhq/hw-transport";
@@ -8,6 +8,7 @@ import { getEnv } from "@ledgerhq/live-env";
8
8
  import { ResolutionConfig, LoadConfig } from "@ledgerhq/hw-app-eth/lib/services/types";
9
9
  import { Signature } from "ethers";
10
10
  import type { DomainServiceResolution } from "@ledgerhq/types-live";
11
+ import resolver from "@ledgerhq/coin-evm/hw-getAddress";
11
12
 
12
13
  export type Signer = {
13
14
  getAddress: (path: string) => Promise<EvmAddress>;
@@ -70,3 +71,6 @@ export const createSigner: CreateSigner<Signer> = (transport: Transport) => {
70
71
  },
71
72
  };
72
73
  };
74
+
75
+ export const context = executeWithSigner(createSigner);
76
+ export const getAddress = resolver(context);
@@ -10,6 +10,7 @@ import { AlpacaSigner } from "./types";
10
10
  import { DerivationType, LedgerSigner as TaquitoLedgerSigner } from "@taquito/ledger-signer";
11
11
  import tezosGetAddress from "@ledgerhq/coin-tezos/signer/getAddress";
12
12
  import Tezos from "@ledgerhq/hw-app-tezos";
13
+ import { context as evmContext, getAddress as evmGetAddress } from "./Eth";
13
14
 
14
15
  const createSignerXrp: CreateSigner<Xrp> = (transport: Transport) => {
15
16
  return new Xrp(transport);
@@ -97,6 +98,12 @@ export function getSigner(network: string): AlpacaSigner {
97
98
  context: signerContextTezos,
98
99
  };
99
100
  }
101
+ case "evm": {
102
+ return {
103
+ getAddress: evmGetAddress,
104
+ context: evmContext,
105
+ };
106
+ }
100
107
  }
101
108
  throw new Error(`signer for ${network} not implemented`);
102
109
  }
@@ -71,7 +71,7 @@ describe("genericGetAccountShape", () => {
71
71
  "sync-hash",
72
72
  {
73
73
  minHeight: 11,
74
- order: "asc",
74
+ order: "desc",
75
75
  lastPagingToken: "pt1",
76
76
  },
77
77
  [
@@ -100,7 +100,7 @@ describe("genericGetAccountShape", () => {
100
100
  "outdated-sync-hash",
101
101
  {
102
102
  minHeight: 0,
103
- order: "asc",
103
+ order: "desc",
104
104
  },
105
105
  [
106
106
  {
@@ -2,6 +2,7 @@ import { genericPrepareTransaction } from "../prepareTransaction";
2
2
  import { getAlpacaApi } from "../alpaca";
3
3
  import { transactionToIntent } from "../utils";
4
4
  import BigNumber from "bignumber.js";
5
+ import { GenericTransaction } from "../types";
5
6
 
6
7
  jest.mock("../alpaca", () => ({
7
8
  getAlpacaApi: jest.fn(),
@@ -95,6 +96,11 @@ describe("genericPrepareTransaction", () => {
95
96
  it.each([
96
97
  ["type", 2, 2],
97
98
  ["storageLimit", 300n, new BigNumber(300)],
99
+ ["gasLimit", 300n, new BigNumber(300)],
100
+ ["gasPrice", 300n, new BigNumber(300)],
101
+ ["maxFeePerGas", 300n, new BigNumber(300)],
102
+ ["maxPriorityFeePerGas", 300n, new BigNumber(300)],
103
+ ["additionalFees", 300n, new BigNumber(300)],
98
104
  ])(
99
105
  "propagates %s from estimation parameters",
100
106
  async (parameterName, parameterValue, expectedValue) => {
@@ -122,4 +128,30 @@ describe("genericPrepareTransaction", () => {
122
128
  );
123
129
  },
124
130
  );
131
+
132
+ it("estimates using the token account spendable balance when sending all amount", async () => {
133
+ const estimateFees = jest.fn().mockResolvedValue({ value: new BigNumber(50) });
134
+ (transactionToIntent as jest.Mock).mockImplementation((_, transaction) => ({
135
+ amount: BigInt(transaction.amount.toFixed()),
136
+ }));
137
+ (getAlpacaApi as jest.Mock).mockReturnValue({
138
+ estimateFees,
139
+ validateIntent: intent => Promise.resolve({ amount: intent.amount }),
140
+ });
141
+ const prepareTransaction = genericPrepareTransaction(network, kind);
142
+
143
+ await prepareTransaction(
144
+ {
145
+ ...account,
146
+ subAccounts: [{ id: "test-sub-account", spendableBalance: new BigNumber(100) }],
147
+ },
148
+ {
149
+ subAccountId: "test-sub-account",
150
+ useAllAmount: true,
151
+ amount: new BigNumber(0),
152
+ } as GenericTransaction,
153
+ );
154
+
155
+ expect(estimateFees).toHaveBeenCalledWith(expect.objectContaining({ amount: 100n }), {});
156
+ });
125
157
  });
@@ -70,7 +70,9 @@ export type GenericTransaction = TransactionCommon & {
70
70
  gasPrice?: BigNumber | null;
71
71
  maxFeePerGas?: BigNumber | null;
72
72
  maxPriorityFeePerGas?: BigNumber | null;
73
+ additionalFees?: BigNumber | null;
73
74
  gasOptions?: GasOptions;
75
+ sponsored?: boolean;
74
76
  };
75
77
 
76
78
  export type GenericTransactionRaw = TransactionCommonRaw & {
@@ -104,7 +106,9 @@ export type GenericTransactionRaw = TransactionCommonRaw & {
104
106
  gasPrice?: string | null;
105
107
  maxFeePerGas?: string | null;
106
108
  maxPriorityFeePerGas?: string | null;
109
+ additionalFees?: string | null;
107
110
  gasOptions?: GasOptionsRaw;
111
+ sponsored?: boolean;
108
112
  };
109
113
 
110
114
  export interface OperationCommon extends Operation {
@@ -201,6 +201,7 @@ describe("Alpaca utils", () => {
201
201
  type: expected.subType,
202
202
  senders: ["account-address"],
203
203
  recipients: ["recipient-address"],
204
+ fee: new BigNumber(12),
204
205
  value: new BigNumber(50),
205
206
  blockHash: null,
206
207
  blockHeight: null,