@ledgerhq/coin-tezos 6.6.0-nightly.1 → 6.6.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 (331) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.unimportedrc.json +30 -4
  3. package/CHANGELOG.md +17 -8
  4. package/jest.integ.config.js +0 -1
  5. package/lib/api/index.d.ts.map +1 -1
  6. package/lib/api/index.js +40 -188
  7. package/lib/api/index.js.map +1 -1
  8. package/lib/api/index.test.js +10 -79
  9. package/lib/api/index.test.js.map +1 -1
  10. package/lib/api/types.d.ts +5 -7
  11. package/lib/api/types.d.ts.map +1 -1
  12. package/lib/bridge/broadcast.d.ts +4 -0
  13. package/lib/bridge/broadcast.d.ts.map +1 -0
  14. package/lib/bridge/broadcast.js +11 -0
  15. package/lib/bridge/broadcast.js.map +1 -0
  16. package/lib/bridge/broadcast.test.d.ts +2 -0
  17. package/lib/bridge/broadcast.test.d.ts.map +1 -0
  18. package/lib/bridge/broadcast.test.js +36 -0
  19. package/lib/bridge/broadcast.test.js.map +1 -0
  20. package/lib/bridge/buildOptimisticOperation.d.ts +4 -0
  21. package/lib/bridge/buildOptimisticOperation.d.ts.map +1 -0
  22. package/lib/bridge/buildOptimisticOperation.js +28 -0
  23. package/lib/bridge/buildOptimisticOperation.js.map +1 -0
  24. package/lib/bridge/createTransaction.d.ts +4 -0
  25. package/lib/bridge/createTransaction.d.ts.map +1 -0
  26. package/lib/bridge/createTransaction.js +24 -0
  27. package/lib/bridge/createTransaction.js.map +1 -0
  28. package/lib/bridge/estimateMaxSpendable.d.ts +5 -0
  29. package/lib/bridge/estimateMaxSpendable.d.ts.map +1 -0
  30. package/lib/bridge/estimateMaxSpendable.js +30 -0
  31. package/lib/bridge/estimateMaxSpendable.js.map +1 -0
  32. package/lib/bridge/getFeesForTransaction.d.ts +21 -0
  33. package/lib/bridge/getFeesForTransaction.d.ts.map +1 -0
  34. package/lib/bridge/getFeesForTransaction.js +39 -0
  35. package/lib/bridge/getFeesForTransaction.js.map +1 -0
  36. package/lib/bridge/getTransactionStatus.d.ts +4 -0
  37. package/lib/bridge/getTransactionStatus.d.ts.map +1 -0
  38. package/lib/bridge/getTransactionStatus.js +108 -0
  39. package/lib/bridge/getTransactionStatus.js.map +1 -0
  40. package/lib/bridge/getTransactionStatus.test.d.ts +2 -0
  41. package/lib/bridge/getTransactionStatus.test.d.ts.map +1 -0
  42. package/lib/bridge/getTransactionStatus.test.js +107 -0
  43. package/lib/bridge/getTransactionStatus.test.js.map +1 -0
  44. package/lib/bridge/index.d.ts +10 -0
  45. package/lib/bridge/index.d.ts.map +1 -0
  46. package/lib/bridge/index.js +59 -0
  47. package/lib/bridge/index.js.map +1 -0
  48. package/lib/bridge/logic.d.ts +10 -0
  49. package/lib/bridge/logic.d.ts.map +1 -0
  50. package/lib/bridge/logic.js +155 -0
  51. package/lib/bridge/logic.js.map +1 -0
  52. package/lib/bridge/preload.d.ts +9 -0
  53. package/lib/bridge/preload.d.ts.map +1 -0
  54. package/lib/bridge/preload.js +23 -0
  55. package/lib/bridge/preload.js.map +1 -0
  56. package/lib/bridge/prepareTransaction.d.ts +5 -0
  57. package/lib/bridge/prepareTransaction.d.ts.map +1 -0
  58. package/lib/bridge/prepareTransaction.integ.test.d.ts +2 -0
  59. package/lib/bridge/prepareTransaction.integ.test.d.ts.map +1 -0
  60. package/lib/bridge/prepareTransaction.integ.test.js +34 -0
  61. package/lib/bridge/prepareTransaction.integ.test.js.map +1 -0
  62. package/lib/bridge/prepareTransaction.js +57 -0
  63. package/lib/bridge/prepareTransaction.js.map +1 -0
  64. package/lib/bridge/prepareTransaction.test.d.ts +2 -0
  65. package/lib/bridge/prepareTransaction.test.d.ts.map +1 -0
  66. package/lib/bridge/prepareTransaction.test.js +178 -0
  67. package/lib/bridge/prepareTransaction.test.js.map +1 -0
  68. package/lib/bridge/serialization.d.ts +7 -0
  69. package/lib/bridge/serialization.d.ts.map +1 -0
  70. package/lib/bridge/serialization.js +26 -0
  71. package/lib/bridge/serialization.js.map +1 -0
  72. package/lib/bridge/signOperation.d.ts +16 -0
  73. package/lib/bridge/signOperation.d.ts.map +1 -0
  74. package/lib/bridge/signOperation.js +88 -0
  75. package/lib/bridge/signOperation.js.map +1 -0
  76. package/lib/bridge/signOperation.test.d.ts +2 -0
  77. package/lib/bridge/signOperation.test.d.ts.map +1 -0
  78. package/lib/bridge/signOperation.test.js +283 -0
  79. package/lib/bridge/signOperation.test.js.map +1 -0
  80. package/lib/bridge/synchronization.d.ts +5 -0
  81. package/lib/bridge/synchronization.d.ts.map +1 -0
  82. package/lib/bridge/synchronization.integ.test.d.ts +2 -0
  83. package/lib/bridge/synchronization.integ.test.d.ts.map +1 -0
  84. package/lib/bridge/synchronization.integ.test.js +32 -0
  85. package/lib/bridge/synchronization.integ.test.js.map +1 -0
  86. package/lib/bridge/synchronization.js +100 -0
  87. package/lib/bridge/synchronization.js.map +1 -0
  88. package/lib/{transaction.d.ts → bridge/transaction.d.ts} +1 -1
  89. package/lib/bridge/transaction.d.ts.map +1 -0
  90. package/lib/{transaction.js → bridge/transaction.js} +3 -3
  91. package/lib/bridge/transaction.js.map +1 -0
  92. package/lib/config.d.ts +3 -4
  93. package/lib/config.d.ts.map +1 -1
  94. package/lib/config.js.map +1 -1
  95. package/lib/index.d.ts +1 -1
  96. package/lib/index.d.ts.map +1 -1
  97. package/lib/index.js +3 -1
  98. package/lib/index.js.map +1 -1
  99. package/lib/logic/craftTransaction.d.ts.map +1 -1
  100. package/lib/logic/craftTransaction.js +0 -7
  101. package/lib/logic/craftTransaction.js.map +1 -1
  102. package/lib/logic/craftTransaction.test.js +0 -1
  103. package/lib/logic/craftTransaction.test.js.map +1 -1
  104. package/lib/logic/estimateFees.d.ts.map +1 -1
  105. package/lib/logic/estimateFees.integ.test.js +2 -8
  106. package/lib/logic/estimateFees.integ.test.js.map +1 -1
  107. package/lib/logic/estimateFees.js +45 -119
  108. package/lib/logic/estimateFees.js.map +1 -1
  109. package/lib/logic/getBalance.js +1 -1
  110. package/lib/logic/getBalance.js.map +1 -1
  111. package/lib/logic/index.d.ts +0 -2
  112. package/lib/logic/index.d.ts.map +1 -1
  113. package/lib/logic/index.js +1 -5
  114. package/lib/logic/index.js.map +1 -1
  115. package/lib/logic/listOperations.d.ts.map +1 -1
  116. package/lib/logic/listOperations.js +10 -56
  117. package/lib/logic/listOperations.js.map +1 -1
  118. package/lib/logic/listOperations.test.js +10 -14
  119. package/lib/logic/listOperations.test.js.map +1 -1
  120. package/lib/types/bridge.d.ts +0 -3
  121. package/lib/types/bridge.d.ts.map +1 -1
  122. package/lib/types/bridge.fixture.d.ts.map +1 -1
  123. package/lib/types/bridge.fixture.js +0 -1
  124. package/lib/types/bridge.fixture.js.map +1 -1
  125. package/lib/types/bridge.js.map +1 -1
  126. package/lib-es/api/index.d.ts.map +1 -1
  127. package/lib-es/api/index.js +41 -189
  128. package/lib-es/api/index.js.map +1 -1
  129. package/lib-es/api/index.test.js +10 -79
  130. package/lib-es/api/index.test.js.map +1 -1
  131. package/lib-es/api/types.d.ts +5 -7
  132. package/lib-es/api/types.d.ts.map +1 -1
  133. package/lib-es/bridge/broadcast.d.ts +4 -0
  134. package/lib-es/bridge/broadcast.d.ts.map +1 -0
  135. package/lib-es/bridge/broadcast.js +7 -0
  136. package/lib-es/bridge/broadcast.js.map +1 -0
  137. package/lib-es/bridge/broadcast.test.d.ts +2 -0
  138. package/lib-es/bridge/broadcast.test.d.ts.map +1 -0
  139. package/lib-es/bridge/broadcast.test.js +31 -0
  140. package/lib-es/bridge/broadcast.test.js.map +1 -0
  141. package/lib-es/bridge/buildOptimisticOperation.d.ts +4 -0
  142. package/lib-es/bridge/buildOptimisticOperation.d.ts.map +1 -0
  143. package/lib-es/bridge/buildOptimisticOperation.js +21 -0
  144. package/lib-es/bridge/buildOptimisticOperation.js.map +1 -0
  145. package/lib-es/bridge/createTransaction.d.ts +4 -0
  146. package/lib-es/bridge/createTransaction.d.ts.map +1 -0
  147. package/lib-es/bridge/createTransaction.js +17 -0
  148. package/lib-es/bridge/createTransaction.js.map +1 -0
  149. package/lib-es/bridge/estimateMaxSpendable.d.ts +5 -0
  150. package/lib-es/bridge/estimateMaxSpendable.d.ts.map +1 -0
  151. package/lib-es/bridge/estimateMaxSpendable.js +23 -0
  152. package/lib-es/bridge/estimateMaxSpendable.js.map +1 -0
  153. package/lib-es/bridge/getFeesForTransaction.d.ts +21 -0
  154. package/lib-es/bridge/getFeesForTransaction.d.ts.map +1 -0
  155. package/lib-es/bridge/getFeesForTransaction.js +33 -0
  156. package/lib-es/bridge/getFeesForTransaction.js.map +1 -0
  157. package/lib-es/bridge/getTransactionStatus.d.ts +4 -0
  158. package/lib-es/bridge/getTransactionStatus.d.ts.map +1 -0
  159. package/lib-es/bridge/getTransactionStatus.js +101 -0
  160. package/lib-es/bridge/getTransactionStatus.js.map +1 -0
  161. package/lib-es/bridge/getTransactionStatus.test.d.ts +2 -0
  162. package/lib-es/bridge/getTransactionStatus.test.d.ts.map +1 -0
  163. package/lib-es/bridge/getTransactionStatus.test.js +102 -0
  164. package/lib-es/bridge/getTransactionStatus.test.js.map +1 -0
  165. package/lib-es/bridge/index.d.ts +10 -0
  166. package/lib-es/bridge/index.d.ts.map +1 -0
  167. package/lib-es/bridge/index.js +53 -0
  168. package/lib-es/bridge/index.js.map +1 -0
  169. package/lib-es/bridge/logic.d.ts +10 -0
  170. package/lib-es/bridge/logic.d.ts.map +1 -0
  171. package/lib-es/bridge/logic.js +145 -0
  172. package/lib-es/bridge/logic.js.map +1 -0
  173. package/lib-es/bridge/preload.d.ts +9 -0
  174. package/lib-es/bridge/preload.d.ts.map +1 -0
  175. package/lib-es/bridge/preload.js +17 -0
  176. package/lib-es/bridge/preload.js.map +1 -0
  177. package/lib-es/bridge/prepareTransaction.d.ts +5 -0
  178. package/lib-es/bridge/prepareTransaction.d.ts.map +1 -0
  179. package/lib-es/bridge/prepareTransaction.integ.test.d.ts +2 -0
  180. package/lib-es/bridge/prepareTransaction.integ.test.d.ts.map +1 -0
  181. package/lib-es/bridge/prepareTransaction.integ.test.js +29 -0
  182. package/lib-es/bridge/prepareTransaction.integ.test.js.map +1 -0
  183. package/lib-es/bridge/prepareTransaction.js +50 -0
  184. package/lib-es/bridge/prepareTransaction.js.map +1 -0
  185. package/lib-es/bridge/prepareTransaction.test.d.ts +2 -0
  186. package/lib-es/bridge/prepareTransaction.test.d.ts.map +1 -0
  187. package/lib-es/bridge/prepareTransaction.test.js +173 -0
  188. package/lib-es/bridge/prepareTransaction.test.js.map +1 -0
  189. package/lib-es/bridge/serialization.d.ts +7 -0
  190. package/lib-es/bridge/serialization.d.ts.map +1 -0
  191. package/lib-es/bridge/serialization.js +20 -0
  192. package/lib-es/bridge/serialization.js.map +1 -0
  193. package/lib-es/bridge/signOperation.d.ts +16 -0
  194. package/lib-es/bridge/signOperation.d.ts.map +1 -0
  195. package/lib-es/bridge/signOperation.js +83 -0
  196. package/lib-es/bridge/signOperation.js.map +1 -0
  197. package/lib-es/bridge/signOperation.test.d.ts +2 -0
  198. package/lib-es/bridge/signOperation.test.d.ts.map +1 -0
  199. package/lib-es/bridge/signOperation.test.js +255 -0
  200. package/lib-es/bridge/signOperation.test.js.map +1 -0
  201. package/lib-es/bridge/synchronization.d.ts +5 -0
  202. package/lib-es/bridge/synchronization.d.ts.map +1 -0
  203. package/lib-es/bridge/synchronization.integ.test.d.ts +2 -0
  204. package/lib-es/bridge/synchronization.integ.test.d.ts.map +1 -0
  205. package/lib-es/bridge/synchronization.integ.test.js +27 -0
  206. package/lib-es/bridge/synchronization.integ.test.js.map +1 -0
  207. package/lib-es/bridge/synchronization.js +70 -0
  208. package/lib-es/bridge/synchronization.js.map +1 -0
  209. package/lib-es/{transaction.d.ts → bridge/transaction.d.ts} +1 -1
  210. package/lib-es/bridge/transaction.d.ts.map +1 -0
  211. package/lib-es/{transaction.js → bridge/transaction.js} +3 -3
  212. package/lib-es/bridge/transaction.js.map +1 -0
  213. package/lib-es/config.d.ts +3 -4
  214. package/lib-es/config.d.ts.map +1 -1
  215. package/lib-es/config.js.map +1 -1
  216. package/lib-es/index.d.ts +1 -1
  217. package/lib-es/index.d.ts.map +1 -1
  218. package/lib-es/index.js +1 -1
  219. package/lib-es/index.js.map +1 -1
  220. package/lib-es/logic/craftTransaction.d.ts.map +1 -1
  221. package/lib-es/logic/craftTransaction.js +0 -7
  222. package/lib-es/logic/craftTransaction.js.map +1 -1
  223. package/lib-es/logic/craftTransaction.test.js +0 -1
  224. package/lib-es/logic/craftTransaction.test.js.map +1 -1
  225. package/lib-es/logic/estimateFees.d.ts.map +1 -1
  226. package/lib-es/logic/estimateFees.integ.test.js +2 -8
  227. package/lib-es/logic/estimateFees.integ.test.js.map +1 -1
  228. package/lib-es/logic/estimateFees.js +45 -119
  229. package/lib-es/logic/estimateFees.js.map +1 -1
  230. package/lib-es/logic/getBalance.js +1 -1
  231. package/lib-es/logic/getBalance.js.map +1 -1
  232. package/lib-es/logic/index.d.ts +0 -2
  233. package/lib-es/logic/index.d.ts.map +1 -1
  234. package/lib-es/logic/index.js +0 -2
  235. package/lib-es/logic/index.js.map +1 -1
  236. package/lib-es/logic/listOperations.d.ts.map +1 -1
  237. package/lib-es/logic/listOperations.js +10 -56
  238. package/lib-es/logic/listOperations.js.map +1 -1
  239. package/lib-es/logic/listOperations.test.js +10 -14
  240. package/lib-es/logic/listOperations.test.js.map +1 -1
  241. package/lib-es/types/bridge.d.ts +0 -3
  242. package/lib-es/types/bridge.d.ts.map +1 -1
  243. package/lib-es/types/bridge.fixture.d.ts.map +1 -1
  244. package/lib-es/types/bridge.fixture.js +0 -1
  245. package/lib-es/types/bridge.fixture.js.map +1 -1
  246. package/lib-es/types/bridge.js.map +1 -1
  247. package/package.json +14 -11
  248. package/src/api/index.test.ts +15 -87
  249. package/src/api/index.ts +55 -204
  250. package/src/api/types.ts +6 -11
  251. package/src/bridge/broadcast.test.ts +36 -0
  252. package/src/bridge/broadcast.ts +13 -0
  253. package/src/bridge/buildOptimisticOperation.ts +28 -0
  254. package/src/bridge/createTransaction.ts +19 -0
  255. package/src/bridge/estimateMaxSpendable.ts +37 -0
  256. package/src/bridge/getFeesForTransaction.ts +49 -0
  257. package/src/bridge/getTransactionStatus.test.ts +124 -0
  258. package/src/bridge/getTransactionStatus.ts +123 -0
  259. package/src/bridge/index.ts +74 -0
  260. package/src/bridge/logic.ts +171 -0
  261. package/src/bridge/preload.ts +18 -0
  262. package/src/bridge/prepareTransaction.integ.test.ts +35 -0
  263. package/src/bridge/prepareTransaction.test.ts +205 -0
  264. package/src/bridge/prepareTransaction.ts +69 -0
  265. package/src/bridge/serialization.ts +27 -0
  266. package/src/bridge/signOperation.test.ts +284 -0
  267. package/src/bridge/signOperation.ts +130 -0
  268. package/src/bridge/synchronization.integ.test.ts +33 -0
  269. package/src/bridge/synchronization.ts +100 -0
  270. package/src/{transaction.ts → bridge/transaction.ts} +4 -4
  271. package/src/config.ts +2 -9
  272. package/src/index.ts +2 -1
  273. package/src/logic/craftTransaction.test.ts +0 -1
  274. package/src/logic/craftTransaction.ts +0 -8
  275. package/src/logic/estimateFees.integ.test.ts +2 -8
  276. package/src/logic/estimateFees.ts +49 -140
  277. package/src/logic/getBalance.ts +1 -1
  278. package/src/logic/index.ts +0 -2
  279. package/src/logic/listOperations.test.ts +54 -64
  280. package/src/logic/listOperations.ts +9 -57
  281. package/src/types/bridge.fixture.ts +0 -1
  282. package/src/types/bridge.ts +1 -6
  283. package/lib/logic/getStakes.d.ts +0 -3
  284. package/lib/logic/getStakes.d.ts.map +0 -1
  285. package/lib/logic/getStakes.js +0 -26
  286. package/lib/logic/getStakes.js.map +0 -1
  287. package/lib/logic/getStakes.test.d.ts +0 -2
  288. package/lib/logic/getStakes.test.d.ts.map +0 -1
  289. package/lib/logic/getStakes.test.js +0 -133
  290. package/lib/logic/getStakes.test.js.map +0 -1
  291. package/lib/logic/validateIntent.d.ts +0 -3
  292. package/lib/logic/validateIntent.d.ts.map +0 -1
  293. package/lib/logic/validateIntent.js +0 -179
  294. package/lib/logic/validateIntent.js.map +0 -1
  295. package/lib/logic/validateIntent.test.d.ts +0 -2
  296. package/lib/logic/validateIntent.test.d.ts.map +0 -1
  297. package/lib/logic/validateIntent.test.js +0 -249
  298. package/lib/logic/validateIntent.test.js.map +0 -1
  299. package/lib/transaction.d.ts.map +0 -1
  300. package/lib/transaction.js.map +0 -1
  301. package/lib/utils.d.ts +0 -48
  302. package/lib/utils.d.ts.map +0 -1
  303. package/lib/utils.js +0 -112
  304. package/lib/utils.js.map +0 -1
  305. package/lib-es/logic/getStakes.d.ts +0 -3
  306. package/lib-es/logic/getStakes.d.ts.map +0 -1
  307. package/lib-es/logic/getStakes.js +0 -20
  308. package/lib-es/logic/getStakes.js.map +0 -1
  309. package/lib-es/logic/getStakes.test.d.ts +0 -2
  310. package/lib-es/logic/getStakes.test.d.ts.map +0 -1
  311. package/lib-es/logic/getStakes.test.js +0 -128
  312. package/lib-es/logic/getStakes.test.js.map +0 -1
  313. package/lib-es/logic/validateIntent.d.ts +0 -3
  314. package/lib-es/logic/validateIntent.d.ts.map +0 -1
  315. package/lib-es/logic/validateIntent.js +0 -173
  316. package/lib-es/logic/validateIntent.js.map +0 -1
  317. package/lib-es/logic/validateIntent.test.d.ts +0 -2
  318. package/lib-es/logic/validateIntent.test.d.ts.map +0 -1
  319. package/lib-es/logic/validateIntent.test.js +0 -221
  320. package/lib-es/logic/validateIntent.test.js.map +0 -1
  321. package/lib-es/transaction.d.ts.map +0 -1
  322. package/lib-es/transaction.js.map +0 -1
  323. package/lib-es/utils.d.ts +0 -48
  324. package/lib-es/utils.d.ts.map +0 -1
  325. package/lib-es/utils.js +0 -105
  326. package/lib-es/utils.js.map +0 -1
  327. package/src/logic/getStakes.test.ts +0 -145
  328. package/src/logic/getStakes.ts +0 -20
  329. package/src/logic/validateIntent.test.ts +0 -262
  330. package/src/logic/validateIntent.ts +0 -207
  331. package/src/utils.ts +0 -115
@@ -0,0 +1,130 @@
1
+ import { Observable } from "rxjs";
2
+ import { FeeNotLoaded } from "@ledgerhq/errors";
3
+ import { SignerContext } from "@ledgerhq/coin-framework/signer";
4
+ import type { SignOperationEvent, AccountBridge } from "@ledgerhq/types-live";
5
+ import type { TezosAccount, TezosSigner, Transaction, TransactionStatus } from "../types";
6
+ import { buildOptimisticOperation } from "./buildOptimisticOperation";
7
+ import { craftTransaction, rawEncode } from "../logic";
8
+ import { getTezosToolkit } from "../logic/tezosToolkit";
9
+
10
+ // Exported for test purpose only
11
+ export async function getOperationContents({
12
+ account,
13
+ transaction,
14
+ counter,
15
+ public_key,
16
+ public_key_hash,
17
+ }: {
18
+ account: TezosAccount;
19
+ transaction: Transaction;
20
+ counter: number;
21
+ public_key: string;
22
+ public_key_hash: string;
23
+ }) {
24
+ let publicKey = undefined;
25
+ if (!account.tezosResources.revealed) {
26
+ publicKey = {
27
+ publicKey: public_key,
28
+ publicKeyHash: public_key_hash,
29
+ };
30
+ }
31
+
32
+ return craftTransaction(
33
+ {
34
+ address: account.freshAddress,
35
+ counter,
36
+ },
37
+ {
38
+ type: transaction.mode,
39
+ recipient: transaction.recipient,
40
+ amount: BigInt(transaction.amount.toString()),
41
+ fee: {
42
+ fees: (transaction.fees || 0).toString(),
43
+ gasLimit: (transaction.gasLimit || 0).toString(),
44
+ storageLimit: (transaction.storageLimit || 0).toString(),
45
+ },
46
+ },
47
+ publicKey,
48
+ );
49
+ }
50
+
51
+ export const buildSignOperation =
52
+ (
53
+ signerContext: SignerContext<TezosSigner>,
54
+ ): AccountBridge<Transaction, TezosAccount, TransactionStatus>["signOperation"] =>
55
+ ({ account, deviceId, transaction }): Observable<SignOperationEvent> =>
56
+ new Observable(o => {
57
+ let cancelled = false;
58
+
59
+ async function main() {
60
+ const { fees } = transaction;
61
+ if (!fees) throw new FeeNotLoaded();
62
+
63
+ const { freshAddressPath, freshAddress } = account;
64
+
65
+ const signedInfo = await signerContext(deviceId, async signer => {
66
+ const ledgerSigner = signer.createLedgerSigner(freshAddressPath, false, 0);
67
+
68
+ const tezosToolkit = getTezosToolkit();
69
+ tezosToolkit.setProvider({ signer: ledgerSigner });
70
+
71
+ const publicKey = await ledgerSigner.publicKey();
72
+ const publicKeyHash = await ledgerSigner.publicKeyHash();
73
+
74
+ const sourceData = await tezosToolkit.rpc.getContract(freshAddress);
75
+
76
+ o.next({ type: "device-signature-requested" });
77
+
78
+ if (cancelled) {
79
+ return;
80
+ }
81
+
82
+ const { type, contents } = await getOperationContents({
83
+ account,
84
+ transaction,
85
+ counter: Number(sourceData.counter),
86
+ public_key: publicKey,
87
+ public_key_hash: publicKeyHash,
88
+ });
89
+
90
+ const forgedBytes = await rawEncode(contents);
91
+
92
+ const signature = await ledgerSigner.sign(forgedBytes);
93
+
94
+ return {
95
+ type,
96
+ signature,
97
+ };
98
+ });
99
+
100
+ if (!signedInfo) {
101
+ return;
102
+ }
103
+
104
+ o.next({ type: "device-signature-granted" });
105
+
106
+ const { type, signature } = signedInfo;
107
+ const operation = buildOptimisticOperation(account, transaction, type);
108
+
109
+ o.next({
110
+ type: "signed",
111
+ signedOperation: {
112
+ operation,
113
+ // we slice the signature to remove the `03` prefix
114
+ // which souldn't be included in the signature
115
+ signature: signature.sbytes.slice(2),
116
+ },
117
+ });
118
+ }
119
+
120
+ main().then(
121
+ () => o.complete(),
122
+ e => o.error(e),
123
+ );
124
+
125
+ return () => {
126
+ cancelled = true;
127
+ };
128
+ });
129
+
130
+ export default buildSignOperation;
@@ -0,0 +1,33 @@
1
+ import coinConfig, { TezosCoinConfig } from "../config";
2
+ import { fetchAllTransactions } from "../network/tzkt";
3
+ import { mockConfig } from "../test/config";
4
+
5
+ jest.setTimeout(2 * 60 * 1000);
6
+
7
+ describe("TEZOS_MAX_TX_QUERIES", () => {
8
+ const tezosConfig = mockConfig as TezosCoinConfig;
9
+ const bigAccount = "tz1boBHAVpwcvKkNFAQHYr7mjxAz1PpVgKq7";
10
+
11
+ test("default have more than 100 txs", async () => {
12
+ // Given
13
+ coinConfig.setCoinConfig((): TezosCoinConfig => tezosConfig);
14
+
15
+ const txs = await fetchAllTransactions(bigAccount);
16
+ expect(txs.length).toBeGreaterThan(100);
17
+ });
18
+ test("lowering it to 1 will only fetch a few txs", async () => {
19
+ // Given
20
+ coinConfig.setCoinConfig(
21
+ (): TezosCoinConfig => ({
22
+ ...tezosConfig,
23
+ explorer: {
24
+ url: "https://xtz-tzkt-explorer.api.live.ledger.com",
25
+ maxTxQuery: 1,
26
+ },
27
+ }),
28
+ );
29
+
30
+ const txs = await fetchAllTransactions(bigAccount);
31
+ expect(txs.length).toBeLessThanOrEqual(100);
32
+ });
33
+ });
@@ -0,0 +1,100 @@
1
+ import invariant from "invariant";
2
+ import { BigNumber } from "bignumber.js";
3
+ import type { TokenAccount } from "@ledgerhq/types-live";
4
+ import { GetAccountShape, makeSync, mergeOps } from "@ledgerhq/coin-framework/bridge/jsHelpers";
5
+ import { encodeAccountId, areAllOperationsLoaded } from "@ledgerhq/coin-framework/account/index";
6
+ import { encodeAddress, isStringHex, reconciliatePublicKey, txToOp } from "./logic";
7
+ import api, { fetchAllTransactions } from "../network/tzkt";
8
+ import { TezosAccount, TezosOperation } from "../types";
9
+
10
+ export const getAccountShape: GetAccountShape<TezosAccount> = async ({
11
+ initialAccount,
12
+ rest,
13
+ currency,
14
+ derivationMode,
15
+ }) => {
16
+ const publicKey = reconciliatePublicKey(rest?.publicKey, initialAccount);
17
+ invariant(
18
+ isStringHex(publicKey),
19
+ `Invalid public key (${publicKey}). Please reimport your Tezos accounts`,
20
+ );
21
+ const hex = Buffer.from(publicKey, "hex");
22
+ const address = encodeAddress(hex);
23
+
24
+ const accountId = encodeAccountId({
25
+ type: "js",
26
+ version: "2",
27
+ currencyId: currency.id,
28
+ xpubOrAddress: publicKey,
29
+ derivationMode,
30
+ });
31
+
32
+ const initialStableOperations = (
33
+ initialAccount && initialAccount.id === accountId ? initialAccount.operations : []
34
+ ) as TezosOperation[];
35
+
36
+ // fetch transactions, incrementally if possible
37
+ const mostRecentStableOperation = initialStableOperations[0];
38
+
39
+ const lastId =
40
+ initialAccount && areAllOperationsLoaded(initialAccount) && mostRecentStableOperation
41
+ ? mostRecentStableOperation.extra.id || undefined
42
+ : undefined;
43
+
44
+ const apiAccountPromise = api.getAccountByAddress(address);
45
+ const blocksCountPromise = api.getBlockCount();
46
+
47
+ const [apiAccount, blockHeight] = await Promise.all([apiAccountPromise, blocksCountPromise]);
48
+
49
+ if (apiAccount.type === "empty") {
50
+ return {
51
+ id: accountId,
52
+ xpub: publicKey,
53
+ freshAddress: address,
54
+ blockHeight,
55
+ lastSyncDate: new Date(),
56
+ tezosResources: {
57
+ revealed: false,
58
+ counter: 0,
59
+ },
60
+ };
61
+ }
62
+
63
+ const fullySupported = apiAccount.type === "user";
64
+
65
+ const apiOperations = fullySupported ? await fetchAllTransactions(address, lastId) : [];
66
+
67
+ const { revealed, counter } = apiAccount;
68
+
69
+ const tezosResources = {
70
+ revealed,
71
+ counter,
72
+ };
73
+
74
+ const balance = new BigNumber(apiAccount.balance);
75
+ const subAccounts: TokenAccount[] = [];
76
+
77
+ const newOps = apiOperations
78
+ .map(txToOp({ address, accountId }))
79
+ .filter(Boolean) as unknown as TezosOperation[]; // force cast because `filter(Boolean)` remove undefined and null value
80
+
81
+ const operations = mergeOps(initialStableOperations, newOps);
82
+
83
+ const accountShape = {
84
+ id: accountId,
85
+ xpub: publicKey,
86
+ freshAddress: address,
87
+ operations,
88
+ operationsCount: operations.length,
89
+ balance,
90
+ subAccounts,
91
+ spendableBalance: balance,
92
+ blockHeight,
93
+ lastSyncDate: new Date(),
94
+ tezosResources,
95
+ };
96
+
97
+ return accountShape;
98
+ };
99
+
100
+ export const sync = makeSync({ getAccountShape });
@@ -1,5 +1,5 @@
1
1
  import { BigNumber } from "bignumber.js";
2
- import type { Transaction, TransactionRaw } from "./types";
2
+ import type { Transaction, TransactionRaw } from "../types";
3
3
  import { formatTransactionStatus } from "@ledgerhq/coin-framework/formatters";
4
4
  import {
5
5
  fromTransactionCommonRaw,
@@ -58,9 +58,9 @@ export const fromTransactionRaw = (tr: TransactionRaw): Transaction => {
58
58
  fees: new BigNumber(networkInfo.fees),
59
59
  },
60
60
  fees: tr.fees ? new BigNumber(tr.fees) : null,
61
- gasLimit: tr.gasLimit ? new BigNumber(tr.gasLimit) : undefined,
62
- storageLimit: tr.storageLimit ? new BigNumber(tr.storageLimit) : undefined,
63
- estimatedFees: tr.estimatedFees ? new BigNumber(tr.estimatedFees) : undefined,
61
+ gasLimit: tr.gasLimit ? new BigNumber(tr.gasLimit) : null,
62
+ storageLimit: tr.storageLimit ? new BigNumber(tr.storageLimit) : null,
63
+ estimatedFees: tr.estimatedFees ? new BigNumber(tr.estimatedFees) : null,
64
64
  taquitoError: tr.taquitoError,
65
65
  };
66
66
  };
package/src/config.ts CHANGED
@@ -1,8 +1,4 @@
1
- import buildCoinConfig, {
2
- type CoinConfig,
3
- type CurrencyConfig,
4
- } from "@ledgerhq/coin-framework/config";
5
- import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
1
+ import buildCoinConfig, { type CurrencyConfig } from "@ledgerhq/coin-framework/config";
6
2
 
7
3
  export type TezosConfig = {
8
4
  baker: {
@@ -26,9 +22,6 @@ export type TezosConfig = {
26
22
 
27
23
  export type TezosCoinConfig = CurrencyConfig & TezosConfig;
28
24
 
29
- const coinConfig: {
30
- setCoinConfig: (config: CoinConfig<TezosCoinConfig>) => void;
31
- getCoinConfig: (currency?: CryptoCurrency) => TezosCoinConfig;
32
- } = buildCoinConfig<TezosCoinConfig>();
25
+ const coinConfig = buildCoinConfig<TezosCoinConfig>();
33
26
 
34
27
  export default coinConfig;
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./types";
2
- export * from "./transaction";
2
+
3
+ export { createBridges } from "./bridge/index";
@@ -21,7 +21,6 @@ describe("craftTransaction", () => {
21
21
  estimate: {
22
22
  reveal: jest.fn(),
23
23
  },
24
- setProvider: jest.fn(),
25
24
  };
26
25
 
27
26
  beforeEach(() => {
@@ -3,7 +3,6 @@ import { getRevealFee } from "@taquito/taquito";
3
3
  import coinConfig from "../config";
4
4
  import { UnsupportedTransactionMode } from "../types/errors";
5
5
  import { getTezosToolkit } from "./tezosToolkit";
6
- import { createMockSigner } from "../utils";
7
6
 
8
7
  export type TransactionFee = {
9
8
  fees?: string;
@@ -38,13 +37,6 @@ export async function craftTransaction(
38
37
 
39
38
  const tezosToolkit = getTezosToolkit();
40
39
 
41
- // Configure signer for Taquito operations (same as in estimateFees)
42
- if (publicKey) {
43
- tezosToolkit.setProvider({
44
- signer: createMockSigner(publicKey.publicKeyHash, publicKey.publicKey),
45
- });
46
- }
47
-
48
40
  const sourceData = await tezosToolkit.rpc.getContract(address);
49
41
  const counter = account.counter ?? Number(sourceData.counter);
50
42
 
@@ -22,10 +22,7 @@ describe("estimateFees", () => {
22
22
  },
23
23
  ];
24
24
 
25
- it.each([
26
- [accounts[0], "with xpub"],
27
- [accounts[1], "without xpub"],
28
- ])("returns correct value %s", async (account, _description) => {
25
+ it.each(accounts)("returns correct value", async account => {
29
26
  // Given
30
27
  const transaction = {
31
28
  mode: "send",
@@ -45,10 +42,7 @@ describe("estimateFees", () => {
45
42
  });
46
43
  });
47
44
 
48
- it.each([
49
- [accounts[0], "with xpub"],
50
- [accounts[1], "without xpub"],
51
- ])("returns correct value when useAllAmount %s", async (account, _description) => {
45
+ it.each(accounts)("returns correct value when useAllAmount", async account => {
52
46
  // Given
53
47
  const transaction = {
54
48
  mode: "send",
@@ -1,17 +1,11 @@
1
+ import { DerivationType } from "@taquito/ledger-signer";
2
+ import { compressPublicKey } from "@taquito/ledger-signer/dist/lib/utils";
1
3
  import { COST_PER_BYTE, getRevealFee, ORIGINATION_SIZE, Estimate } from "@taquito/taquito";
2
- import { validatePublicKey, ValidationResult } from "@taquito/utils";
4
+ import { b58Encode, PrefixV2 } from "@taquito/utils";
3
5
  import { log } from "@ledgerhq/logs";
4
6
  import { getTezosToolkit } from "./tezosToolkit";
5
7
  import { TezosOperationMode } from "../types/model";
6
8
  import { UnsupportedTransactionMode } from "../types/errors";
7
- import {
8
- createFallbackEstimation,
9
- createMockSigner,
10
- DUST_MARGIN_MUTEZ,
11
- MIN_SUGGESTED_FEE_SMALL_TRANSFER,
12
- OP_SIZE_XTZ_TRANSFER,
13
- normalizePublicKeyForAddress,
14
- } from "../utils";
15
9
 
16
10
  export type CoreAccountInfo = {
17
11
  address: string;
@@ -47,43 +41,54 @@ export async function estimateFees({
47
41
  account: CoreAccountInfo;
48
42
  transaction: CoreTransactionInfo;
49
43
  }): Promise<EstimatedFees> {
50
- // Normalize public key (hex -> base58) when provided (may be undefined for unrevealed accounts)
51
- // before the device is connected
52
- const encodedPubKey = account.xpub
53
- ? normalizePublicKeyForAddress(account.xpub, account.address)
54
- : undefined;
55
-
56
- const tezosToolkit = getTezosToolkit();
57
- if (encodedPubKey && validatePublicKey(encodedPubKey) === ValidationResult.VALID) {
58
- tezosToolkit.setProvider({ signer: createMockSigner(account.address, encodedPubKey) });
44
+ let derivationType: DerivationType;
45
+ let prefix: PrefixV2;
46
+ if (account.address?.startsWith("tz1")) {
47
+ derivationType = DerivationType.ED25519;
48
+ prefix = PrefixV2.Ed25519PublicKey;
49
+ } else if (account.address?.startsWith("tz2")) {
50
+ derivationType = DerivationType.SECP256K1;
51
+ prefix = PrefixV2.Secp256k1PublicKey;
52
+ } else if (account.address?.startsWith("tz3")) {
53
+ derivationType = DerivationType.P256;
54
+ prefix = PrefixV2.P256PublicKey;
59
55
  } else {
60
- tezosToolkit.setProvider({ signer: createMockSigner(account.address, "") });
56
+ throw Error(`Failed detecting key derivation type from address ${account.address}`);
61
57
  }
62
58
 
59
+ const encodedPubKey = b58Encode(
60
+ compressPublicKey(Buffer.from(account.xpub || "", "hex"), derivationType),
61
+ prefix,
62
+ );
63
+
64
+ const tezosToolkit = getTezosToolkit();
65
+ tezosToolkit.setProvider({
66
+ signer: {
67
+ publicKeyHash: async () => account.address,
68
+ publicKey: async () => encodedPubKey,
69
+ sign: () => Promise.reject(new Error("unsupported")),
70
+ secretKey: () => Promise.reject(new Error("unsupported")),
71
+ },
72
+ });
73
+
63
74
  const estimation: EstimatedFees = {
64
- fees: 0n,
65
- gasLimit: 0n,
66
- storageLimit: 0n,
67
- estimatedFees: 0n,
75
+ fees: BigInt(0),
76
+ gasLimit: BigInt(0),
77
+ storageLimit: BigInt(0),
78
+ estimatedFees: BigInt(0),
68
79
  };
69
80
 
70
81
  // For legacy compatibility
71
- if (account.balance === 0n) {
72
- return transaction.useAllAmount ? { ...estimation, amount: 0n } : estimation;
82
+ if (account.balance === BigInt(0)) {
83
+ return transaction.useAllAmount ? { ...estimation, amount: BigInt(0) } : estimation;
73
84
  }
74
85
 
75
86
  let amount = transaction.amount;
76
- if (transaction.useAllAmount || amount === 0n) {
77
- amount = 1n; // send max do a pre-estimation with minimum amount (taquito refuses 0)
87
+ if (transaction.useAllAmount) {
88
+ amount = BigInt(1); // send max do a pre-estimation with minimum amount (taquito refuses 0)
78
89
  }
79
90
 
80
91
  try {
81
- if (transaction.mode === "send" && !transaction.recipient) {
82
- return {
83
- ...estimation,
84
- ...createFallbackEstimation(),
85
- };
86
- }
87
92
  let estimate: Estimate;
88
93
  switch (transaction.mode) {
89
94
  case "send":
@@ -91,7 +96,6 @@ export async function estimateFees({
91
96
  mutez: true,
92
97
  to: transaction.recipient,
93
98
  amount: Number(amount),
94
- source: account.address, // avoid requiring signer for estimation
95
99
  storageLimit: ORIGINATION_SIZE, // https://github.com/TezTech/eztz/blob/master/PROTO_003_FEES.md for originating an account
96
100
  });
97
101
  break;
@@ -125,14 +129,16 @@ export async function estimateFees({
125
129
  // NOTE: from https://github.com/ecadlabs/taquito/blob/a70c64c4b105381bb9f1d04c9c70e8ef26e9241c/integration-tests/contract-empty-implicit-account-into-new-implicit-account.spec.ts#L33
126
130
  // Temporary fix, see https://gitlab.com/tezos/tezos/-/issues/1754
127
131
  // we need to increase the gasLimit and fee returned by the estimation
132
+ const gasBuffer = 500;
128
133
  const MINIMAL_FEE_PER_GAS_MUTEZ = 0.1;
129
134
  const increasedFee = (gasBuffer: number, opSize: number) => {
130
135
  return gasBuffer * MINIMAL_FEE_PER_GAS_MUTEZ + opSize;
131
136
  };
132
- const incr = increasedFee(DUST_MARGIN_MUTEZ, Number(estimate.opSize));
137
+ const incr = increasedFee(gasBuffer, Number(estimate.opSize));
138
+
139
+ const maxMinusBuff = maxAmount - (gasBuffer - incr);
140
+ estimation.amount = maxMinusBuff > 0 ? BigInt(maxMinusBuff) : BigInt(0);
133
141
 
134
- const maxMinusBuff = maxAmount - (DUST_MARGIN_MUTEZ - incr);
135
- estimation.amount = maxMinusBuff > 0 ? BigInt(maxMinusBuff) : 0n;
136
142
  estimation.fees = BigInt(estimate.suggestedFeeMutez);
137
143
  estimation.gasLimit = BigInt(estimate.gasLimit);
138
144
  } else {
@@ -140,7 +146,6 @@ export async function estimateFees({
140
146
  estimation.gasLimit = BigInt(estimate.gasLimit);
141
147
  estimation.amount = transaction.amount;
142
148
  }
143
-
144
149
  estimation.storageLimit = BigInt(estimate.storageLimit);
145
150
  estimation.estimatedFees = estimation.fees;
146
151
  if (!account.revealed) {
@@ -152,109 +157,13 @@ export async function estimateFees({
152
157
  estimation.taquitoError = (e as { id: string }).id;
153
158
  log("taquito-error", "taquito got error " + e.id);
154
159
  } else if ("status" in e) {
155
- const errorMessage = String((e as unknown as { message: string }).message || "");
156
- if (
157
- errorMessage.includes("Public key not found") ||
158
- errorMessage.includes("wallet or contract API")
159
- ) {
160
- log(
161
- "taquito-network-error",
162
- "Recipient address not found (new account), using default fees",
163
- {
164
- transaction: transaction,
165
- },
166
- );
167
- const fallback = createFallbackEstimation();
168
- estimation.fees = fallback.fees;
169
- estimation.gasLimit = fallback.gasLimit;
170
- estimation.storageLimit = fallback.storageLimit;
171
- estimation.estimatedFees = fallback.fees;
172
- if (!account.revealed) {
173
- estimation.estimatedFees =
174
- estimation.estimatedFees + BigInt(getRevealFee(account.address));
175
- }
176
- // Handle useAllAmount also for send mode when estimation falls back
177
- if (transaction.useAllAmount) {
178
- // Approximate Taquito behavior for send-max using stable constants
179
- const suggestedFee =
180
- transaction.mode === "send"
181
- ? MIN_SUGGESTED_FEE_SMALL_TRANSFER
182
- : Number(estimation.fees);
183
-
184
- // For display consistency in tests, align fees to suggestedFee in send-max
185
- if (transaction.mode === "send") {
186
- estimation.fees = BigInt(suggestedFee);
187
- estimation.estimatedFees = BigInt(suggestedFee);
188
- if (!account.revealed) {
189
- estimation.estimatedFees =
190
- estimation.estimatedFees + BigInt(getRevealFee(account.address));
191
- }
192
- }
193
-
194
- const burnFeeMutez = Number(estimation.storageLimit) * COST_PER_BYTE;
195
- const totalFees =
196
- suggestedFee + (burnFeeMutez > 0 ? burnFeeMutez - 20 * COST_PER_BYTE : 0);
197
-
198
- const revealFee = account.revealed ? 0 : getRevealFee(account.address);
199
- const maxAmount = Number.parseInt(account.balance.toString()) - (totalFees + revealFee);
200
-
201
- const MINIMAL_FEE_PER_GAS_MUTEZ = 0.1;
202
- const incr = OP_SIZE_XTZ_TRANSFER + DUST_MARGIN_MUTEZ * MINIMAL_FEE_PER_GAS_MUTEZ;
203
- const maxMinusBuff = maxAmount - (DUST_MARGIN_MUTEZ - incr);
204
- estimation.amount = maxMinusBuff > 0 ? BigInt(Math.floor(maxMinusBuff)) : 0n;
205
- } else {
206
- // preserve input amount in fallback for readability/tests
207
- estimation.amount = transaction.amount;
208
- }
209
- } else {
210
- log("taquito-network-error", errorMessage, {
211
- transaction: transaction,
212
- });
213
- throw e;
214
- }
160
+ // in case of http 400, log & ignore (more case to handle)
161
+ log("taquito-network-error", String((e as unknown as { message: string }).message || ""), {
162
+ transaction: transaction,
163
+ });
164
+ throw e;
215
165
  } else {
216
- const msg = String((e as any).message || "");
217
- if (msg.includes("No signer has been configured")) {
218
- const fallback = createFallbackEstimation();
219
- estimation.fees = fallback.fees;
220
- estimation.gasLimit = fallback.gasLimit;
221
- estimation.storageLimit = fallback.storageLimit;
222
- estimation.estimatedFees = fallback.estimatedFees;
223
- if (!account.revealed) {
224
- estimation.estimatedFees =
225
- estimation.estimatedFees + BigInt(getRevealFee(account.address));
226
- }
227
- if (transaction.useAllAmount) {
228
- const suggestedFee =
229
- transaction.mode === "send"
230
- ? MIN_SUGGESTED_FEE_SMALL_TRANSFER
231
- : Number(estimation.fees);
232
-
233
- if (transaction.mode === "send") {
234
- estimation.fees = BigInt(suggestedFee);
235
- estimation.estimatedFees = BigInt(suggestedFee);
236
- if (!account.revealed) {
237
- estimation.estimatedFees =
238
- estimation.estimatedFees + BigInt(getRevealFee(account.address));
239
- }
240
- }
241
-
242
- const burnFeeMutez = Number(estimation.storageLimit) * COST_PER_BYTE;
243
- const totalFees =
244
- suggestedFee + (burnFeeMutez > 0 ? burnFeeMutez - 20 * COST_PER_BYTE : 0);
245
- const revealFee = account.revealed ? 0 : getRevealFee(account.address);
246
- const maxAmount = Number.parseInt(account.balance.toString()) - (totalFees + revealFee);
247
- const MINIMAL_FEE_PER_GAS_MUTEZ = 0.1;
248
- const incr = OP_SIZE_XTZ_TRANSFER + DUST_MARGIN_MUTEZ * MINIMAL_FEE_PER_GAS_MUTEZ;
249
- const maxMinusBuff = maxAmount - (DUST_MARGIN_MUTEZ - incr);
250
- estimation.amount = maxMinusBuff > 0 ? BigInt(Math.floor(maxMinusBuff)) : 0n;
251
- } else {
252
- // preserve input amount in fallback for readability/tests
253
- estimation.amount = transaction.amount;
254
- }
255
- } else {
256
- throw e;
257
- }
166
+ throw e;
258
167
  }
259
168
  }
260
169
  return estimation;
@@ -6,5 +6,5 @@ import api from "../network/tzkt";
6
6
  */
7
7
  export async function getBalance(address: string): Promise<bigint> {
8
8
  const apiAccount = await api.getAccountByAddress(address);
9
- return apiAccount.type === "user" ? BigInt(apiAccount.balance) : -1n;
9
+ return apiAccount.type === "user" ? BigInt(apiAccount.balance) : BigInt(-1);
10
10
  }
@@ -7,5 +7,3 @@ export { estimateFees } from "./estimateFees";
7
7
  export { getBalance } from "./getBalance";
8
8
  export { lastBlock } from "./lastBlock";
9
9
  export { listOperations } from "./listOperations";
10
- export { validateIntent } from "./validateIntent";
11
- export { getStakes } from "./getStakes";