@ledgerhq/coin-tezos 6.5.0 → 6.6.0-nightly.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 (330) hide show
  1. package/.unimportedrc.json +4 -30
  2. package/CHANGELOG.md +13 -0
  3. package/jest.integ.config.js +1 -0
  4. package/lib/api/index.d.ts.map +1 -1
  5. package/lib/api/index.js +188 -40
  6. package/lib/api/index.js.map +1 -1
  7. package/lib/api/index.test.js +79 -10
  8. package/lib/api/index.test.js.map +1 -1
  9. package/lib/api/types.d.ts +7 -5
  10. package/lib/api/types.d.ts.map +1 -1
  11. package/lib/config.d.ts +4 -3
  12. package/lib/config.d.ts.map +1 -1
  13. package/lib/config.js.map +1 -1
  14. package/lib/index.d.ts +1 -1
  15. package/lib/index.d.ts.map +1 -1
  16. package/lib/index.js +1 -3
  17. package/lib/index.js.map +1 -1
  18. package/lib/logic/craftTransaction.d.ts.map +1 -1
  19. package/lib/logic/craftTransaction.js +7 -0
  20. package/lib/logic/craftTransaction.js.map +1 -1
  21. package/lib/logic/craftTransaction.test.js +1 -0
  22. package/lib/logic/craftTransaction.test.js.map +1 -1
  23. package/lib/logic/estimateFees.d.ts.map +1 -1
  24. package/lib/logic/estimateFees.integ.test.js +8 -2
  25. package/lib/logic/estimateFees.integ.test.js.map +1 -1
  26. package/lib/logic/estimateFees.js +119 -45
  27. package/lib/logic/estimateFees.js.map +1 -1
  28. package/lib/logic/getBalance.js +1 -1
  29. package/lib/logic/getBalance.js.map +1 -1
  30. package/lib/logic/getStakes.d.ts +3 -0
  31. package/lib/logic/getStakes.d.ts.map +1 -0
  32. package/lib/logic/getStakes.js +26 -0
  33. package/lib/logic/getStakes.js.map +1 -0
  34. package/lib/logic/getStakes.test.d.ts +2 -0
  35. package/lib/logic/getStakes.test.d.ts.map +1 -0
  36. package/lib/logic/getStakes.test.js +133 -0
  37. package/lib/logic/getStakes.test.js.map +1 -0
  38. package/lib/logic/index.d.ts +2 -0
  39. package/lib/logic/index.d.ts.map +1 -1
  40. package/lib/logic/index.js +5 -1
  41. package/lib/logic/index.js.map +1 -1
  42. package/lib/logic/listOperations.d.ts.map +1 -1
  43. package/lib/logic/listOperations.js +56 -10
  44. package/lib/logic/listOperations.js.map +1 -1
  45. package/lib/logic/listOperations.test.js +14 -10
  46. package/lib/logic/listOperations.test.js.map +1 -1
  47. package/lib/logic/validateIntent.d.ts +3 -0
  48. package/lib/logic/validateIntent.d.ts.map +1 -0
  49. package/lib/logic/validateIntent.js +179 -0
  50. package/lib/logic/validateIntent.js.map +1 -0
  51. package/lib/logic/validateIntent.test.d.ts +2 -0
  52. package/lib/logic/validateIntent.test.d.ts.map +1 -0
  53. package/lib/logic/validateIntent.test.js +249 -0
  54. package/lib/logic/validateIntent.test.js.map +1 -0
  55. package/{lib-es/bridge → lib}/transaction.d.ts +1 -1
  56. package/lib/transaction.d.ts.map +1 -0
  57. package/lib/{bridge/transaction.js → transaction.js} +3 -3
  58. package/lib/transaction.js.map +1 -0
  59. package/lib/types/bridge.d.ts +3 -0
  60. package/lib/types/bridge.d.ts.map +1 -1
  61. package/lib/types/bridge.fixture.d.ts.map +1 -1
  62. package/lib/types/bridge.fixture.js +1 -0
  63. package/lib/types/bridge.fixture.js.map +1 -1
  64. package/lib/types/bridge.js.map +1 -1
  65. package/lib/utils.d.ts +48 -0
  66. package/lib/utils.d.ts.map +1 -0
  67. package/lib/utils.js +112 -0
  68. package/lib/utils.js.map +1 -0
  69. package/lib-es/api/index.d.ts.map +1 -1
  70. package/lib-es/api/index.js +189 -41
  71. package/lib-es/api/index.js.map +1 -1
  72. package/lib-es/api/index.test.js +79 -10
  73. package/lib-es/api/index.test.js.map +1 -1
  74. package/lib-es/api/types.d.ts +7 -5
  75. package/lib-es/api/types.d.ts.map +1 -1
  76. package/lib-es/config.d.ts +4 -3
  77. package/lib-es/config.d.ts.map +1 -1
  78. package/lib-es/config.js.map +1 -1
  79. package/lib-es/index.d.ts +1 -1
  80. package/lib-es/index.d.ts.map +1 -1
  81. package/lib-es/index.js +1 -1
  82. package/lib-es/index.js.map +1 -1
  83. package/lib-es/logic/craftTransaction.d.ts.map +1 -1
  84. package/lib-es/logic/craftTransaction.js +7 -0
  85. package/lib-es/logic/craftTransaction.js.map +1 -1
  86. package/lib-es/logic/craftTransaction.test.js +1 -0
  87. package/lib-es/logic/craftTransaction.test.js.map +1 -1
  88. package/lib-es/logic/estimateFees.d.ts.map +1 -1
  89. package/lib-es/logic/estimateFees.integ.test.js +8 -2
  90. package/lib-es/logic/estimateFees.integ.test.js.map +1 -1
  91. package/lib-es/logic/estimateFees.js +119 -45
  92. package/lib-es/logic/estimateFees.js.map +1 -1
  93. package/lib-es/logic/getBalance.js +1 -1
  94. package/lib-es/logic/getBalance.js.map +1 -1
  95. package/lib-es/logic/getStakes.d.ts +3 -0
  96. package/lib-es/logic/getStakes.d.ts.map +1 -0
  97. package/lib-es/logic/getStakes.js +20 -0
  98. package/lib-es/logic/getStakes.js.map +1 -0
  99. package/lib-es/logic/getStakes.test.d.ts +2 -0
  100. package/lib-es/logic/getStakes.test.d.ts.map +1 -0
  101. package/lib-es/logic/getStakes.test.js +128 -0
  102. package/lib-es/logic/getStakes.test.js.map +1 -0
  103. package/lib-es/logic/index.d.ts +2 -0
  104. package/lib-es/logic/index.d.ts.map +1 -1
  105. package/lib-es/logic/index.js +2 -0
  106. package/lib-es/logic/index.js.map +1 -1
  107. package/lib-es/logic/listOperations.d.ts.map +1 -1
  108. package/lib-es/logic/listOperations.js +56 -10
  109. package/lib-es/logic/listOperations.js.map +1 -1
  110. package/lib-es/logic/listOperations.test.js +14 -10
  111. package/lib-es/logic/listOperations.test.js.map +1 -1
  112. package/lib-es/logic/validateIntent.d.ts +3 -0
  113. package/lib-es/logic/validateIntent.d.ts.map +1 -0
  114. package/lib-es/logic/validateIntent.js +173 -0
  115. package/lib-es/logic/validateIntent.js.map +1 -0
  116. package/lib-es/logic/validateIntent.test.d.ts +2 -0
  117. package/lib-es/logic/validateIntent.test.d.ts.map +1 -0
  118. package/lib-es/logic/validateIntent.test.js +221 -0
  119. package/lib-es/logic/validateIntent.test.js.map +1 -0
  120. package/{lib/bridge → lib-es}/transaction.d.ts +1 -1
  121. package/lib-es/transaction.d.ts.map +1 -0
  122. package/lib-es/{bridge/transaction.js → transaction.js} +3 -3
  123. package/lib-es/transaction.js.map +1 -0
  124. package/lib-es/types/bridge.d.ts +3 -0
  125. package/lib-es/types/bridge.d.ts.map +1 -1
  126. package/lib-es/types/bridge.fixture.d.ts.map +1 -1
  127. package/lib-es/types/bridge.fixture.js +1 -0
  128. package/lib-es/types/bridge.fixture.js.map +1 -1
  129. package/lib-es/types/bridge.js.map +1 -1
  130. package/lib-es/utils.d.ts +48 -0
  131. package/lib-es/utils.d.ts.map +1 -0
  132. package/lib-es/utils.js +105 -0
  133. package/lib-es/utils.js.map +1 -0
  134. package/package.json +9 -12
  135. package/src/api/index.test.ts +87 -15
  136. package/src/api/index.ts +204 -55
  137. package/src/api/types.ts +11 -6
  138. package/src/config.ts +9 -2
  139. package/src/index.ts +1 -2
  140. package/src/logic/craftTransaction.test.ts +1 -0
  141. package/src/logic/craftTransaction.ts +8 -0
  142. package/src/logic/estimateFees.integ.test.ts +8 -2
  143. package/src/logic/estimateFees.ts +140 -49
  144. package/src/logic/getBalance.ts +1 -1
  145. package/src/logic/getStakes.test.ts +145 -0
  146. package/src/logic/getStakes.ts +20 -0
  147. package/src/logic/index.ts +2 -0
  148. package/src/logic/listOperations.test.ts +64 -54
  149. package/src/logic/listOperations.ts +57 -9
  150. package/src/logic/validateIntent.test.ts +262 -0
  151. package/src/logic/validateIntent.ts +207 -0
  152. package/src/{bridge/transaction.ts → transaction.ts} +4 -4
  153. package/src/types/bridge.fixture.ts +1 -0
  154. package/src/types/bridge.ts +6 -1
  155. package/src/utils.ts +115 -0
  156. package/lib/bridge/broadcast.d.ts +0 -4
  157. package/lib/bridge/broadcast.d.ts.map +0 -1
  158. package/lib/bridge/broadcast.js +0 -11
  159. package/lib/bridge/broadcast.js.map +0 -1
  160. package/lib/bridge/broadcast.test.d.ts +0 -2
  161. package/lib/bridge/broadcast.test.d.ts.map +0 -1
  162. package/lib/bridge/broadcast.test.js +0 -36
  163. package/lib/bridge/broadcast.test.js.map +0 -1
  164. package/lib/bridge/buildOptimisticOperation.d.ts +0 -4
  165. package/lib/bridge/buildOptimisticOperation.d.ts.map +0 -1
  166. package/lib/bridge/buildOptimisticOperation.js +0 -28
  167. package/lib/bridge/buildOptimisticOperation.js.map +0 -1
  168. package/lib/bridge/createTransaction.d.ts +0 -4
  169. package/lib/bridge/createTransaction.d.ts.map +0 -1
  170. package/lib/bridge/createTransaction.js +0 -24
  171. package/lib/bridge/createTransaction.js.map +0 -1
  172. package/lib/bridge/estimateMaxSpendable.d.ts +0 -5
  173. package/lib/bridge/estimateMaxSpendable.d.ts.map +0 -1
  174. package/lib/bridge/estimateMaxSpendable.js +0 -30
  175. package/lib/bridge/estimateMaxSpendable.js.map +0 -1
  176. package/lib/bridge/getFeesForTransaction.d.ts +0 -21
  177. package/lib/bridge/getFeesForTransaction.d.ts.map +0 -1
  178. package/lib/bridge/getFeesForTransaction.js +0 -39
  179. package/lib/bridge/getFeesForTransaction.js.map +0 -1
  180. package/lib/bridge/getTransactionStatus.d.ts +0 -4
  181. package/lib/bridge/getTransactionStatus.d.ts.map +0 -1
  182. package/lib/bridge/getTransactionStatus.js +0 -108
  183. package/lib/bridge/getTransactionStatus.js.map +0 -1
  184. package/lib/bridge/getTransactionStatus.test.d.ts +0 -2
  185. package/lib/bridge/getTransactionStatus.test.d.ts.map +0 -1
  186. package/lib/bridge/getTransactionStatus.test.js +0 -107
  187. package/lib/bridge/getTransactionStatus.test.js.map +0 -1
  188. package/lib/bridge/index.d.ts +0 -10
  189. package/lib/bridge/index.d.ts.map +0 -1
  190. package/lib/bridge/index.js +0 -59
  191. package/lib/bridge/index.js.map +0 -1
  192. package/lib/bridge/logic.d.ts +0 -10
  193. package/lib/bridge/logic.d.ts.map +0 -1
  194. package/lib/bridge/logic.js +0 -155
  195. package/lib/bridge/logic.js.map +0 -1
  196. package/lib/bridge/preload.d.ts +0 -9
  197. package/lib/bridge/preload.d.ts.map +0 -1
  198. package/lib/bridge/preload.js +0 -23
  199. package/lib/bridge/preload.js.map +0 -1
  200. package/lib/bridge/prepareTransaction.d.ts +0 -5
  201. package/lib/bridge/prepareTransaction.d.ts.map +0 -1
  202. package/lib/bridge/prepareTransaction.integ.test.d.ts +0 -2
  203. package/lib/bridge/prepareTransaction.integ.test.d.ts.map +0 -1
  204. package/lib/bridge/prepareTransaction.integ.test.js +0 -34
  205. package/lib/bridge/prepareTransaction.integ.test.js.map +0 -1
  206. package/lib/bridge/prepareTransaction.js +0 -57
  207. package/lib/bridge/prepareTransaction.js.map +0 -1
  208. package/lib/bridge/prepareTransaction.test.d.ts +0 -2
  209. package/lib/bridge/prepareTransaction.test.d.ts.map +0 -1
  210. package/lib/bridge/prepareTransaction.test.js +0 -178
  211. package/lib/bridge/prepareTransaction.test.js.map +0 -1
  212. package/lib/bridge/serialization.d.ts +0 -7
  213. package/lib/bridge/serialization.d.ts.map +0 -1
  214. package/lib/bridge/serialization.js +0 -26
  215. package/lib/bridge/serialization.js.map +0 -1
  216. package/lib/bridge/signOperation.d.ts +0 -16
  217. package/lib/bridge/signOperation.d.ts.map +0 -1
  218. package/lib/bridge/signOperation.js +0 -88
  219. package/lib/bridge/signOperation.js.map +0 -1
  220. package/lib/bridge/signOperation.test.d.ts +0 -2
  221. package/lib/bridge/signOperation.test.d.ts.map +0 -1
  222. package/lib/bridge/signOperation.test.js +0 -283
  223. package/lib/bridge/signOperation.test.js.map +0 -1
  224. package/lib/bridge/synchronization.d.ts +0 -5
  225. package/lib/bridge/synchronization.d.ts.map +0 -1
  226. package/lib/bridge/synchronization.integ.test.d.ts +0 -2
  227. package/lib/bridge/synchronization.integ.test.d.ts.map +0 -1
  228. package/lib/bridge/synchronization.integ.test.js +0 -32
  229. package/lib/bridge/synchronization.integ.test.js.map +0 -1
  230. package/lib/bridge/synchronization.js +0 -100
  231. package/lib/bridge/synchronization.js.map +0 -1
  232. package/lib/bridge/transaction.d.ts.map +0 -1
  233. package/lib/bridge/transaction.js.map +0 -1
  234. package/lib-es/bridge/broadcast.d.ts +0 -4
  235. package/lib-es/bridge/broadcast.d.ts.map +0 -1
  236. package/lib-es/bridge/broadcast.js +0 -7
  237. package/lib-es/bridge/broadcast.js.map +0 -1
  238. package/lib-es/bridge/broadcast.test.d.ts +0 -2
  239. package/lib-es/bridge/broadcast.test.d.ts.map +0 -1
  240. package/lib-es/bridge/broadcast.test.js +0 -31
  241. package/lib-es/bridge/broadcast.test.js.map +0 -1
  242. package/lib-es/bridge/buildOptimisticOperation.d.ts +0 -4
  243. package/lib-es/bridge/buildOptimisticOperation.d.ts.map +0 -1
  244. package/lib-es/bridge/buildOptimisticOperation.js +0 -21
  245. package/lib-es/bridge/buildOptimisticOperation.js.map +0 -1
  246. package/lib-es/bridge/createTransaction.d.ts +0 -4
  247. package/lib-es/bridge/createTransaction.d.ts.map +0 -1
  248. package/lib-es/bridge/createTransaction.js +0 -17
  249. package/lib-es/bridge/createTransaction.js.map +0 -1
  250. package/lib-es/bridge/estimateMaxSpendable.d.ts +0 -5
  251. package/lib-es/bridge/estimateMaxSpendable.d.ts.map +0 -1
  252. package/lib-es/bridge/estimateMaxSpendable.js +0 -23
  253. package/lib-es/bridge/estimateMaxSpendable.js.map +0 -1
  254. package/lib-es/bridge/getFeesForTransaction.d.ts +0 -21
  255. package/lib-es/bridge/getFeesForTransaction.d.ts.map +0 -1
  256. package/lib-es/bridge/getFeesForTransaction.js +0 -33
  257. package/lib-es/bridge/getFeesForTransaction.js.map +0 -1
  258. package/lib-es/bridge/getTransactionStatus.d.ts +0 -4
  259. package/lib-es/bridge/getTransactionStatus.d.ts.map +0 -1
  260. package/lib-es/bridge/getTransactionStatus.js +0 -101
  261. package/lib-es/bridge/getTransactionStatus.js.map +0 -1
  262. package/lib-es/bridge/getTransactionStatus.test.d.ts +0 -2
  263. package/lib-es/bridge/getTransactionStatus.test.d.ts.map +0 -1
  264. package/lib-es/bridge/getTransactionStatus.test.js +0 -102
  265. package/lib-es/bridge/getTransactionStatus.test.js.map +0 -1
  266. package/lib-es/bridge/index.d.ts +0 -10
  267. package/lib-es/bridge/index.d.ts.map +0 -1
  268. package/lib-es/bridge/index.js +0 -53
  269. package/lib-es/bridge/index.js.map +0 -1
  270. package/lib-es/bridge/logic.d.ts +0 -10
  271. package/lib-es/bridge/logic.d.ts.map +0 -1
  272. package/lib-es/bridge/logic.js +0 -145
  273. package/lib-es/bridge/logic.js.map +0 -1
  274. package/lib-es/bridge/preload.d.ts +0 -9
  275. package/lib-es/bridge/preload.d.ts.map +0 -1
  276. package/lib-es/bridge/preload.js +0 -17
  277. package/lib-es/bridge/preload.js.map +0 -1
  278. package/lib-es/bridge/prepareTransaction.d.ts +0 -5
  279. package/lib-es/bridge/prepareTransaction.d.ts.map +0 -1
  280. package/lib-es/bridge/prepareTransaction.integ.test.d.ts +0 -2
  281. package/lib-es/bridge/prepareTransaction.integ.test.d.ts.map +0 -1
  282. package/lib-es/bridge/prepareTransaction.integ.test.js +0 -29
  283. package/lib-es/bridge/prepareTransaction.integ.test.js.map +0 -1
  284. package/lib-es/bridge/prepareTransaction.js +0 -50
  285. package/lib-es/bridge/prepareTransaction.js.map +0 -1
  286. package/lib-es/bridge/prepareTransaction.test.d.ts +0 -2
  287. package/lib-es/bridge/prepareTransaction.test.d.ts.map +0 -1
  288. package/lib-es/bridge/prepareTransaction.test.js +0 -173
  289. package/lib-es/bridge/prepareTransaction.test.js.map +0 -1
  290. package/lib-es/bridge/serialization.d.ts +0 -7
  291. package/lib-es/bridge/serialization.d.ts.map +0 -1
  292. package/lib-es/bridge/serialization.js +0 -20
  293. package/lib-es/bridge/serialization.js.map +0 -1
  294. package/lib-es/bridge/signOperation.d.ts +0 -16
  295. package/lib-es/bridge/signOperation.d.ts.map +0 -1
  296. package/lib-es/bridge/signOperation.js +0 -83
  297. package/lib-es/bridge/signOperation.js.map +0 -1
  298. package/lib-es/bridge/signOperation.test.d.ts +0 -2
  299. package/lib-es/bridge/signOperation.test.d.ts.map +0 -1
  300. package/lib-es/bridge/signOperation.test.js +0 -255
  301. package/lib-es/bridge/signOperation.test.js.map +0 -1
  302. package/lib-es/bridge/synchronization.d.ts +0 -5
  303. package/lib-es/bridge/synchronization.d.ts.map +0 -1
  304. package/lib-es/bridge/synchronization.integ.test.d.ts +0 -2
  305. package/lib-es/bridge/synchronization.integ.test.d.ts.map +0 -1
  306. package/lib-es/bridge/synchronization.integ.test.js +0 -27
  307. package/lib-es/bridge/synchronization.integ.test.js.map +0 -1
  308. package/lib-es/bridge/synchronization.js +0 -70
  309. package/lib-es/bridge/synchronization.js.map +0 -1
  310. package/lib-es/bridge/transaction.d.ts.map +0 -1
  311. package/lib-es/bridge/transaction.js.map +0 -1
  312. package/src/bridge/broadcast.test.ts +0 -36
  313. package/src/bridge/broadcast.ts +0 -13
  314. package/src/bridge/buildOptimisticOperation.ts +0 -28
  315. package/src/bridge/createTransaction.ts +0 -19
  316. package/src/bridge/estimateMaxSpendable.ts +0 -37
  317. package/src/bridge/getFeesForTransaction.ts +0 -49
  318. package/src/bridge/getTransactionStatus.test.ts +0 -124
  319. package/src/bridge/getTransactionStatus.ts +0 -123
  320. package/src/bridge/index.ts +0 -74
  321. package/src/bridge/logic.ts +0 -171
  322. package/src/bridge/preload.ts +0 -18
  323. package/src/bridge/prepareTransaction.integ.test.ts +0 -35
  324. package/src/bridge/prepareTransaction.test.ts +0 -205
  325. package/src/bridge/prepareTransaction.ts +0 -69
  326. package/src/bridge/serialization.ts +0 -27
  327. package/src/bridge/signOperation.test.ts +0 -284
  328. package/src/bridge/signOperation.ts +0 -130
  329. package/src/bridge/synchronization.integ.test.ts +0 -33
  330. package/src/bridge/synchronization.ts +0 -100
@@ -0,0 +1,262 @@
1
+ import { validateIntent } from "./validateIntent";
2
+ import * as estimateFeesModule from "./estimateFees";
3
+ import tzktApi from "../network/tzkt";
4
+ import coinConfig from "../config";
5
+ import {
6
+ RecipientRequired,
7
+ InvalidAddress,
8
+ InvalidAddressBecauseDestinationIsAlsoSource,
9
+ AmountRequired,
10
+ NotEnoughBalance,
11
+ } from "@ledgerhq/errors";
12
+
13
+ describe("validateIntent", () => {
14
+ const senderAddress = "tz1TzrmTBSuiVHV2VfMnGRMYvTEPCP42oSM8";
15
+ const validRecipient = "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx";
16
+
17
+ const mockEstimateFees = jest.spyOn(estimateFeesModule, "estimateFees");
18
+ const mockGetAccountByAddress = jest.spyOn(tzktApi, "getAccountByAddress");
19
+
20
+ beforeEach(() => {
21
+ jest.clearAllMocks();
22
+
23
+ coinConfig.setCoinConfig(() => ({
24
+ status: { type: "active" },
25
+ baker: { url: "http://baker.example.com" },
26
+ explorer: { url: "http://tezos.explorer.com", maxTxQuery: 100 },
27
+ node: { url: "http://tezos.node.com" },
28
+ fees: {
29
+ minGasLimit: 600,
30
+ minRevealGasLimit: 300,
31
+ minStorageLimit: 0,
32
+ minFees: 500,
33
+ minEstimatedFees: 500,
34
+ },
35
+ }));
36
+
37
+ mockEstimateFees.mockResolvedValue({
38
+ fees: BigInt(1000),
39
+ gasLimit: BigInt(10000),
40
+ storageLimit: BigInt(0),
41
+ estimatedFees: BigInt(1000),
42
+ });
43
+
44
+ mockGetAccountByAddress.mockResolvedValue({
45
+ type: "user",
46
+ address: senderAddress,
47
+ publicKey: "edpk...",
48
+ balance: 5000000,
49
+ revealed: true,
50
+ counter: 0,
51
+ delegationLevel: 0,
52
+ delegationTime: "2021-01-01T00:00:00Z",
53
+ numTransactions: 0,
54
+ firstActivityTime: "2021-01-01T00:00:00Z",
55
+ });
56
+ });
57
+
58
+ describe("recipient validation", () => {
59
+ it("should return RecipientRequired error when recipient is missing", async () => {
60
+ const result = await validateIntent({
61
+ asset: { type: "native" },
62
+ type: "send",
63
+ sender: senderAddress,
64
+ recipient: "",
65
+ amount: BigInt(1000),
66
+ });
67
+
68
+ expect(result.errors.recipient).toBeInstanceOf(RecipientRequired);
69
+ });
70
+
71
+ it("should return InvalidAddress error for invalid recipient", async () => {
72
+ const result = await validateIntent({
73
+ asset: { type: "native" },
74
+ type: "send",
75
+ sender: senderAddress,
76
+ recipient: "invalid_address",
77
+ amount: BigInt(1000),
78
+ });
79
+
80
+ expect(result.errors.recipient).toBeInstanceOf(InvalidAddress);
81
+ });
82
+
83
+ it("should return InvalidAddressBecauseDestinationIsAlsoSource when sender equals recipient", async () => {
84
+ const result = await validateIntent({
85
+ asset: { type: "native" },
86
+ type: "send",
87
+ sender: senderAddress,
88
+ recipient: senderAddress,
89
+ amount: BigInt(1000),
90
+ });
91
+
92
+ expect(result.errors.recipient).toBeInstanceOf(InvalidAddressBecauseDestinationIsAlsoSource);
93
+ });
94
+ });
95
+
96
+ describe("amount validation", () => {
97
+ it("should return AmountRequired error when amount is zero and not useAllAmount", async () => {
98
+ const result = await validateIntent({
99
+ asset: { type: "native" },
100
+ type: "send",
101
+ sender: senderAddress,
102
+ recipient: validRecipient,
103
+ amount: BigInt(0),
104
+ useAllAmount: false,
105
+ });
106
+
107
+ expect(result.errors.amount).toBeInstanceOf(AmountRequired);
108
+ });
109
+
110
+ it("should not return AmountRequired error when useAllAmount is true", async () => {
111
+ const result = await validateIntent({
112
+ asset: { type: "native" },
113
+ type: "send",
114
+ sender: senderAddress,
115
+ recipient: validRecipient,
116
+ amount: BigInt(0),
117
+ useAllAmount: true,
118
+ });
119
+
120
+ expect(result.errors.amount).toBeUndefined();
121
+ });
122
+ });
123
+
124
+ describe("balance validation", () => {
125
+ it("should return NotEnoughBalance error when amount exceeds balance", async () => {
126
+ const balance = 1000000; // 1 XTZ
127
+ const amount = 2000000; // 2 XTZ
128
+
129
+ mockGetAccountByAddress.mockResolvedValue({
130
+ type: "user",
131
+ address: senderAddress,
132
+ publicKey: "edpk...",
133
+ balance,
134
+ revealed: true,
135
+ counter: 0,
136
+ delegationLevel: 0,
137
+ delegationTime: "2021-01-01T00:00:00Z",
138
+ numTransactions: 0,
139
+ firstActivityTime: "2021-01-01T00:00:00Z",
140
+ });
141
+
142
+ const result = await validateIntent({
143
+ asset: { type: "native" },
144
+ type: "send",
145
+ sender: senderAddress,
146
+ recipient: validRecipient,
147
+ amount: BigInt(amount),
148
+ });
149
+
150
+ expect(result.errors.amount).toBeInstanceOf(NotEnoughBalance);
151
+ });
152
+
153
+ it("should pass validation when amount is within balance", async () => {
154
+ const balance = 5000000; // 5 XTZ
155
+ const amount = 1000000; // 1 XTZ
156
+
157
+ mockGetAccountByAddress.mockResolvedValue({
158
+ type: "user",
159
+ address: senderAddress,
160
+ publicKey: "edpk...",
161
+ balance,
162
+ revealed: true,
163
+ counter: 0,
164
+ delegationLevel: 0,
165
+ delegationTime: "2021-01-01T00:00:00Z",
166
+ numTransactions: 0,
167
+ firstActivityTime: "2021-01-01T00:00:00Z",
168
+ });
169
+
170
+ const result = await validateIntent({
171
+ asset: { type: "native" },
172
+ type: "send",
173
+ sender: senderAddress,
174
+ recipient: validRecipient,
175
+ amount: BigInt(amount),
176
+ });
177
+
178
+ expect(result.errors.amount).toBeUndefined();
179
+ expect(result.amount).toBe(BigInt(amount));
180
+ });
181
+ });
182
+
183
+ describe("transaction types", () => {
184
+ it("should pass validation for delegate transaction", async () => {
185
+ const result = await validateIntent({
186
+ asset: { type: "native" },
187
+ type: "delegate",
188
+ sender: senderAddress,
189
+ recipient: validRecipient,
190
+ amount: BigInt(0),
191
+ });
192
+
193
+ expect(result.errors).toEqual({});
194
+ });
195
+
196
+ it("should pass validation for undelegate transaction", async () => {
197
+ const result = await validateIntent({
198
+ asset: { type: "native" },
199
+ type: "undelegate",
200
+ sender: senderAddress,
201
+ recipient: "",
202
+ amount: BigInt(0),
203
+ });
204
+
205
+ expect(result.errors).toEqual({});
206
+ });
207
+
208
+ it("should handle stake intent (mapped to delegate)", async () => {
209
+ const result = await validateIntent({
210
+ asset: { type: "native" },
211
+ type: "stake",
212
+ sender: senderAddress,
213
+ recipient: validRecipient,
214
+ amount: BigInt(0),
215
+ });
216
+
217
+ expect(result.errors).toEqual({});
218
+ });
219
+
220
+ it("should handle unstake intent (mapped to undelegate)", async () => {
221
+ const result = await validateIntent({
222
+ asset: { type: "native" },
223
+ type: "unstake",
224
+ sender: senderAddress,
225
+ recipient: "",
226
+ amount: BigInt(0),
227
+ });
228
+
229
+ expect(result.errors).toEqual({});
230
+ });
231
+ });
232
+
233
+ describe("successful validation", () => {
234
+ it("should return valid result with correct values", async () => {
235
+ const amount = BigInt(1000000);
236
+ const estimatedFees = BigInt(1500);
237
+
238
+ mockEstimateFees.mockResolvedValue({
239
+ fees: BigInt(1000),
240
+ gasLimit: BigInt(10000),
241
+ storageLimit: BigInt(0),
242
+ estimatedFees,
243
+ });
244
+
245
+ const result = await validateIntent({
246
+ asset: { type: "native" },
247
+ type: "send",
248
+ sender: senderAddress,
249
+ recipient: validRecipient,
250
+ amount,
251
+ });
252
+
253
+ expect(result).toMatchObject({
254
+ errors: {},
255
+ warnings: {},
256
+ estimatedFees,
257
+ amount,
258
+ totalSpent: amount + estimatedFees,
259
+ });
260
+ });
261
+ });
262
+ });
@@ -0,0 +1,207 @@
1
+ import type { TransactionIntent, TransactionValidation } from "@ledgerhq/coin-framework/api/types";
2
+ import {
3
+ InvalidAddress,
4
+ RecipientRequired,
5
+ RecommendUndelegation,
6
+ NotEnoughBalance,
7
+ NotEnoughBalanceToDelegate,
8
+ AmountRequired,
9
+ InvalidAddressBecauseDestinationIsAlsoSource,
10
+ } from "@ledgerhq/errors";
11
+ import { validateAddress, ValidationResult } from "@taquito/utils";
12
+ import api from "../network/tzkt";
13
+ import { estimateFees } from "./estimateFees";
14
+ import { InvalidAddressBecauseAlreadyDelegated } from "../types/errors";
15
+ import { mapIntentTypeToTezosMode } from "../utils";
16
+
17
+ /**
18
+ * Validates basic recipient and amount for send transactions
19
+ */
20
+ function validateBasicSendParams(intent: TransactionIntent): Record<string, Error> {
21
+ const errors: Record<string, Error> = {};
22
+
23
+ if (intent.type !== "send") {
24
+ return errors;
25
+ }
26
+
27
+ if (!intent.recipient) {
28
+ errors.recipient = new RecipientRequired("");
29
+ } else if (validateAddress(intent.recipient) !== ValidationResult.VALID) {
30
+ errors.recipient = new InvalidAddress(undefined, { currencyName: "Tezos" });
31
+ } else if (intent.sender === intent.recipient) {
32
+ errors.recipient = new InvalidAddressBecauseDestinationIsAlsoSource();
33
+ }
34
+
35
+ if (intent.amount === 0n && !intent.useAllAmount) {
36
+ errors.amount = new AmountRequired();
37
+ } else if (intent.amount < 0n) {
38
+ errors.amount = new NotEnoughBalance();
39
+ }
40
+
41
+ return errors;
42
+ }
43
+
44
+ /**
45
+ * Validates specific transaction constraints based on account state
46
+ */
47
+ function validateTransactionConstraints(
48
+ intent: TransactionIntent,
49
+ senderInfo: any,
50
+ ): Record<string, Error> {
51
+ const errors: Record<string, Error> = {};
52
+
53
+ // send max not allowed on delegated accounts (must undelegate acc first)
54
+ if (intent.type === "send" && intent.useAllAmount) {
55
+ if (senderInfo.type === "user" && senderInfo.delegate?.address) {
56
+ errors.amount = new RecommendUndelegation();
57
+ }
58
+ }
59
+
60
+ // stake requires non-zero balance
61
+ if (intent.type === "stake") {
62
+ const balance = BigInt(senderInfo.balance || "0");
63
+ if (balance === 0n) {
64
+ errors.amount = new NotEnoughBalanceToDelegate();
65
+ }
66
+ }
67
+
68
+ return errors;
69
+ }
70
+
71
+ /**
72
+ * Maps Taquito-specific errors to our error types
73
+ */
74
+ function mapTaquitoErrors(taquitoError: string, intentType: string): Record<string, Error> {
75
+ const errors: Record<string, Error> = {};
76
+
77
+ if (taquitoError.endsWith("balance_too_low") || taquitoError.endsWith("subtraction_underflow")) {
78
+ if (intentType === "stake") {
79
+ errors.amount = new NotEnoughBalanceToDelegate();
80
+ } else {
81
+ errors.amount = new NotEnoughBalance();
82
+ }
83
+ } else if (taquitoError.endsWith("delegate.unchanged") && intentType === "stake") {
84
+ errors.recipient = new InvalidAddressBecauseAlreadyDelegated();
85
+ } else if (taquitoError.includes("empty_implicit_contract")) {
86
+ errors.amount = new NotEnoughBalanceToDelegate();
87
+ } else {
88
+ errors.amount = new Error(taquitoError);
89
+ }
90
+
91
+ return errors;
92
+ }
93
+
94
+ /**
95
+ * Calculates final amounts based on transaction type
96
+ */
97
+ function calculateAmounts(
98
+ intent: TransactionIntent,
99
+ senderInfo: any,
100
+ estimatedFees: bigint,
101
+ ): { amount: bigint; totalSpent: bigint } {
102
+ if (intent.type === "stake" || intent.type === "unstake") {
103
+ const amount = BigInt(senderInfo.type === "user" ? senderInfo.balance : 0);
104
+ return { amount, totalSpent: estimatedFees };
105
+ }
106
+
107
+ if (intent.type === "send" && intent.useAllAmount) {
108
+ if (senderInfo.type === "user") {
109
+ const balance = BigInt(senderInfo.balance);
110
+ const amount = balance > estimatedFees ? balance - estimatedFees : 0n;
111
+ return { amount, totalSpent: amount + estimatedFees };
112
+ }
113
+ return { amount: 0n, totalSpent: 0n };
114
+ }
115
+
116
+ const amount = intent.amount;
117
+ return { amount, totalSpent: amount + estimatedFees };
118
+ }
119
+
120
+ /**
121
+ * Validates balance coverage for the transaction
122
+ */
123
+ function validateBalanceCoverage(senderInfo: any, totalSpent: bigint): Record<string, Error> {
124
+ const errors: Record<string, Error> = {};
125
+
126
+ if (senderInfo.type === "user") {
127
+ const accountBalance = BigInt(senderInfo.balance);
128
+ if (totalSpent > accountBalance) {
129
+ errors.amount = new NotEnoughBalance();
130
+ }
131
+ }
132
+
133
+ return errors;
134
+ }
135
+
136
+ export async function validateIntent(intent: TransactionIntent): Promise<TransactionValidation> {
137
+ const errors: Record<string, Error> = {};
138
+ const warnings: Record<string, Error> = {};
139
+ let estimatedFees: bigint;
140
+ let amount: bigint;
141
+ let totalSpent: bigint;
142
+
143
+ // Basic validation for send transactions
144
+ const basicErrors = validateBasicSendParams(intent);
145
+ Object.assign(errors, basicErrors);
146
+
147
+ if (Object.keys(errors).length > 0) {
148
+ return { errors, warnings, estimatedFees: 0n, amount: 0n, totalSpent: 0n };
149
+ }
150
+
151
+ try {
152
+ // Get sender account information
153
+ const senderInfo = await api.getAccountByAddress(intent.sender);
154
+ if (senderInfo.type !== "user") throw new Error("unexpected account type");
155
+
156
+ // Validate transaction-specific constraints
157
+ const constraintErrors = validateTransactionConstraints(intent, senderInfo);
158
+ Object.assign(errors, constraintErrors);
159
+
160
+ if (Object.keys(errors).length > 0) {
161
+ return { errors, warnings, estimatedFees: 0n, amount: 0n, totalSpent: 0n };
162
+ }
163
+
164
+ // Estimate fees
165
+ if (senderInfo.revealed) {
166
+ const estimation = await estimateFees({
167
+ account: {
168
+ address: intent.sender,
169
+ revealed: senderInfo.revealed,
170
+ balance: BigInt(senderInfo.balance),
171
+ xpub: intent.senderPublicKey ?? senderInfo.publicKey,
172
+ },
173
+ transaction: {
174
+ mode: mapIntentTypeToTezosMode(intent.type),
175
+ recipient: intent.recipient,
176
+ amount: intent.amount,
177
+ useAllAmount: !!intent.useAllAmount,
178
+ },
179
+ });
180
+ estimatedFees = estimation.estimatedFees;
181
+
182
+ // Handle Taquito errors
183
+ if (estimation.taquitoError) {
184
+ const taquitoErrors = mapTaquitoErrors(estimation.taquitoError, intent.type);
185
+ Object.assign(errors, taquitoErrors);
186
+ }
187
+ } else {
188
+ estimatedFees = 2000n;
189
+ }
190
+
191
+ // Calculate final amounts
192
+ const amounts = calculateAmounts(intent, senderInfo, estimatedFees);
193
+ amount = amounts.amount;
194
+ totalSpent = amounts.totalSpent;
195
+
196
+ // Final balance validation
197
+ const balanceErrors = validateBalanceCoverage(senderInfo, totalSpent);
198
+ Object.assign(errors, balanceErrors);
199
+ } catch (e) {
200
+ errors.estimation = e as Error;
201
+ estimatedFees = 0n;
202
+ amount = intent.amount;
203
+ totalSpent = intent.amount;
204
+ }
205
+
206
+ return { errors, warnings, estimatedFees, amount, totalSpent };
207
+ }
@@ -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) : null,
62
- storageLimit: tr.storageLimit ? new BigNumber(tr.storageLimit) : null,
63
- estimatedFees: tr.estimatedFees ? new BigNumber(tr.estimatedFees) : 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,
64
64
  taquitoError: tr.taquitoError,
65
65
  };
66
66
  };
@@ -47,6 +47,7 @@ export function createFixtureAccount(account?: Partial<TezosAccount>): TezosAcco
47
47
  swapHistory: [],
48
48
 
49
49
  tezosResources,
50
+ stakingPositions: account?.stakingPositions || [],
50
51
  };
51
52
  }
52
53
 
@@ -7,6 +7,7 @@ import type {
7
7
  TransactionStatusCommon,
8
8
  TransactionStatusCommonRaw,
9
9
  } from "@ledgerhq/types-live";
10
+ import type { Stake } from "@ledgerhq/coin-framework/api/index";
10
11
  import type { BigNumber } from "bignumber.js";
11
12
  import { TezosOperationMode } from "./model";
12
13
 
@@ -79,7 +80,11 @@ export type Delegation = {
79
80
  sendShouldWarnDelegation: boolean;
80
81
  };
81
82
 
82
- export type TezosAccount = Account & { tezosResources: TezosResources };
83
+ export type StakingPosition = Stake;
84
+ export type TezosAccount = Account & {
85
+ tezosResources: TezosResources;
86
+ stakingPositions: StakingPosition[];
87
+ };
83
88
  export function isTezosAccount(account: Account): account is TezosAccount {
84
89
  return "tezosResources" in account;
85
90
  }
package/src/utils.ts ADDED
@@ -0,0 +1,115 @@
1
+ import { validatePublicKey, ValidationResult, b58Encode, PrefixV2 } from "@taquito/utils";
2
+ import { DerivationType } from "@taquito/ledger-signer";
3
+ import { compressPublicKey } from "@taquito/ledger-signer/dist/lib/utils";
4
+
5
+ /**
6
+ * Default limits and fees for Tezos operations
7
+ */
8
+ // Safe fallback values aligned with Taquito estimation defaults for a simple transfer
9
+ // These are used when network estimation is unavailable (e.g., signer not configured)
10
+ const DEFAULT_LIMITS = {
11
+ GAS: 2169n,
12
+ STORAGE: 277n,
13
+ BASE_FEE: 491n,
14
+ };
15
+
16
+ /**
17
+ * Dust margin in mutez to prevent transaction failures on send max operations
18
+ * This ensures a small safety buffer remains in the account after send max
19
+ * Based on production behavior where ~281-287 mutez typically remain
20
+ * Increased to 500 to handle edge cases and fee estimation variations
21
+ */
22
+ export const DUST_MARGIN_MUTEZ = 500;
23
+
24
+ /**
25
+ * Suggested fee returned by Taquito for a minimal amount pre-estimation (mutez)
26
+ * Used as a stable fallback for send-max when RPC estimation is unavailable.
27
+ */
28
+ export const MIN_SUGGESTED_FEE_SMALL_TRANSFER = 489;
29
+
30
+ /**
31
+ * Typical operation size (bytes) for a simple XTZ transfer used to approximate
32
+ * the increased fee component when computing send-max in fallback mode.
33
+ * Chosen to match Taquito’s behavior closely in integration tests.
34
+ */
35
+ export const OP_SIZE_XTZ_TRANSFER = 154;
36
+
37
+ /**
38
+ * Helper function to map generic staking intents to Tezos operation modes
39
+ */
40
+ export function mapIntentTypeToTezosMode(intentType: string): "send" | "delegate" | "undelegate" {
41
+ switch (intentType) {
42
+ case "stake":
43
+ case "delegate":
44
+ return "delegate";
45
+ case "unstake":
46
+ case "undelegate":
47
+ return "undelegate";
48
+ default:
49
+ return "send";
50
+ }
51
+ }
52
+
53
+ /**
54
+ * Creates a mock signer for Taquito operations (estimation and crafting)
55
+ */
56
+ export function createMockSigner(publicKeyHash: string, publicKey: string) {
57
+ return {
58
+ publicKeyHash: async () => publicKeyHash,
59
+ publicKey: async () => publicKey,
60
+ sign: () => Promise.reject(new Error("unsupported")),
61
+ secretKey: () => Promise.reject(new Error("unsupported")),
62
+ };
63
+ }
64
+
65
+ /**
66
+ * Normalize a Tezos public key to base58 format (edpk/sppk/p2pk) based on the
67
+ * sender address prefix (tz1/tz2/tz3). Accepts either an already base58-encoded
68
+ * key or a hex key returned by the Ledger app. Returns undefined if input is
69
+ * empty or cannot be parsed.
70
+ */
71
+ export function normalizePublicKeyForAddress(
72
+ maybeKey: string | undefined,
73
+ address: string,
74
+ ): string | undefined {
75
+ if (!maybeKey) return undefined;
76
+
77
+ // If it's already a valid base58 public key, keep it
78
+ if (validatePublicKey(maybeKey) === ValidationResult.VALID) return maybeKey;
79
+
80
+ // Attempt to convert hex → base58 according to address curve
81
+ try {
82
+ const pkHex = maybeKey.trim().toLowerCase();
83
+ if (pkHex === "") return undefined;
84
+ const keyBuf = Buffer.from(pkHex, "hex");
85
+
86
+ // Choose curve/prefix from address tz1/tz2/tz3
87
+ // default are values for tz1 and fallbacks to it
88
+ let derivationType: DerivationType = DerivationType.ED25519;
89
+ let prefix: PrefixV2 = PrefixV2.Ed25519PublicKey;
90
+
91
+ if (address.startsWith("tz2")) {
92
+ derivationType = DerivationType.SECP256K1;
93
+ prefix = PrefixV2.Secp256k1PublicKey;
94
+ } else if (address.startsWith("tz3")) {
95
+ derivationType = DerivationType.P256;
96
+ prefix = PrefixV2.P256PublicKey;
97
+ }
98
+
99
+ return b58Encode(compressPublicKey(keyBuf, derivationType), prefix);
100
+ } catch {
101
+ return undefined;
102
+ }
103
+ }
104
+
105
+ /**
106
+ * Creates default fallback estimation values
107
+ */
108
+ export function createFallbackEstimation() {
109
+ return {
110
+ fees: DEFAULT_LIMITS.BASE_FEE,
111
+ gasLimit: DEFAULT_LIMITS.GAS,
112
+ storageLimit: DEFAULT_LIMITS.STORAGE,
113
+ estimatedFees: DEFAULT_LIMITS.BASE_FEE,
114
+ };
115
+ }
@@ -1,4 +0,0 @@
1
- import { AccountBridge } from "@ledgerhq/types-live";
2
- import { Transaction } from "../types";
3
- export declare const broadcast: AccountBridge<Transaction>["broadcast"];
4
- //# sourceMappingURL=broadcast.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"broadcast.d.ts","sourceRoot":"","sources":["../../src/bridge/broadcast.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAmB,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,eAAO,MAAM,SAAS,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,WAAW,CAO7D,CAAC"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.broadcast = void 0;
4
- const operation_1 = require("@ledgerhq/coin-framework/operation");
5
- const logic_1 = require("../logic");
6
- const broadcast = async ({ signedOperation: { operation, signature }, }) => {
7
- const hash = await (0, logic_1.broadcast)(signature);
8
- return (0, operation_1.patchOperationWithHash)(operation, hash);
9
- };
10
- exports.broadcast = broadcast;
11
- //# sourceMappingURL=broadcast.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"broadcast.js","sourceRoot":"","sources":["../../src/bridge/broadcast.ts"],"names":[],"mappings":";;;AAAA,kEAA4E;AAG5E,oCAAuD;AAEhD,MAAM,SAAS,GAA4C,KAAK,EAAE,EACvE,eAAe,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,GAG1C,EAAE,EAAE;IACH,MAAM,IAAI,GAAG,MAAM,IAAA,iBAAc,EAAC,SAAS,CAAC,CAAC;IAC7C,OAAO,IAAA,kCAAsB,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AACjD,CAAC,CAAC;AAPW,QAAA,SAAS,aAOpB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=broadcast.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"broadcast.test.d.ts","sourceRoot":"","sources":["../../src/bridge/broadcast.test.ts"],"names":[],"mappings":""}