@ledgerhq/coin-tezos 0.4.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 (325) hide show
  1. package/.eslintrc.js +20 -0
  2. package/.turbo/turbo-build.log +4 -0
  3. package/.unimportedrc.json +39 -0
  4. package/CHANGELOG.md +12 -0
  5. package/LICENSE.txt +21 -0
  6. package/jest.config.js +6 -0
  7. package/lib/api/bakers.d.ts +14 -0
  8. package/lib/api/bakers.d.ts.map +1 -0
  9. package/lib/api/bakers.integration.test.d.ts +2 -0
  10. package/lib/api/bakers.integration.test.d.ts.map +1 -0
  11. package/lib/api/bakers.integration.test.js +61 -0
  12. package/lib/api/bakers.integration.test.js.map +1 -0
  13. package/lib/api/bakers.js +141 -0
  14. package/lib/api/bakers.js.map +1 -0
  15. package/lib/api/bakers.test.d.ts +2 -0
  16. package/lib/api/bakers.test.d.ts.map +1 -0
  17. package/lib/api/bakers.test.js +146 -0
  18. package/lib/api/bakers.test.js.map +1 -0
  19. package/lib/api/bakers.whitelist-default.d.ts +4 -0
  20. package/lib/api/bakers.whitelist-default.d.ts.map +1 -0
  21. package/lib/api/bakers.whitelist-default.js +34 -0
  22. package/lib/api/bakers.whitelist-default.js.map +1 -0
  23. package/lib/api/index.d.ts +3 -0
  24. package/lib/api/index.d.ts.map +1 -0
  25. package/lib/api/index.js +19 -0
  26. package/lib/api/index.js.map +1 -0
  27. package/lib/api/tzkt.d.ts +81 -0
  28. package/lib/api/tzkt.d.ts.map +1 -0
  29. package/lib/api/tzkt.js +52 -0
  30. package/lib/api/tzkt.js.map +1 -0
  31. package/lib/bridge/broadcast.d.ts +6 -0
  32. package/lib/bridge/broadcast.d.ts.map +1 -0
  33. package/lib/bridge/broadcast.js +22 -0
  34. package/lib/bridge/broadcast.js.map +1 -0
  35. package/lib/bridge/broadcast.test.d.ts +2 -0
  36. package/lib/bridge/broadcast.test.d.ts.map +1 -0
  37. package/lib/bridge/broadcast.test.js +40 -0
  38. package/lib/bridge/broadcast.test.js.map +1 -0
  39. package/lib/bridge/createTransaction.d.ts +3 -0
  40. package/lib/bridge/createTransaction.d.ts.map +1 -0
  41. package/lib/bridge/createTransaction.js +23 -0
  42. package/lib/bridge/createTransaction.js.map +1 -0
  43. package/lib/bridge/deviceTransactionConfig.d.ts +19 -0
  44. package/lib/bridge/deviceTransactionConfig.d.ts.map +1 -0
  45. package/lib/bridge/deviceTransactionConfig.js +44 -0
  46. package/lib/bridge/deviceTransactionConfig.js.map +1 -0
  47. package/lib/bridge/estimateMaxSpendable.d.ts +10 -0
  48. package/lib/bridge/estimateMaxSpendable.d.ts.map +1 -0
  49. package/lib/bridge/estimateMaxSpendable.js +29 -0
  50. package/lib/bridge/estimateMaxSpendable.js.map +1 -0
  51. package/lib/bridge/getAccountShape.d.ts +5 -0
  52. package/lib/bridge/getAccountShape.d.ts.map +1 -0
  53. package/lib/bridge/getAccountShape.js +253 -0
  54. package/lib/bridge/getAccountShape.js.map +1 -0
  55. package/lib/bridge/getAccountShape.test.d.ts +2 -0
  56. package/lib/bridge/getAccountShape.test.d.ts.map +1 -0
  57. package/lib/bridge/getAccountShape.test.js +33 -0
  58. package/lib/bridge/getAccountShape.test.js.map +1 -0
  59. package/lib/bridge/index.d.ts +8 -0
  60. package/lib/bridge/index.d.ts.map +1 -0
  61. package/lib/bridge/index.js +58 -0
  62. package/lib/bridge/index.js.map +1 -0
  63. package/lib/bridge/preload.d.ts +9 -0
  64. package/lib/bridge/preload.d.ts.map +1 -0
  65. package/lib/bridge/preload.js +32 -0
  66. package/lib/bridge/preload.js.map +1 -0
  67. package/lib/bridge/prepareTransaction.d.ts +9 -0
  68. package/lib/bridge/prepareTransaction.d.ts.map +1 -0
  69. package/lib/bridge/prepareTransaction.js +157 -0
  70. package/lib/bridge/prepareTransaction.js.map +1 -0
  71. package/lib/bridge/serialization.d.ts +7 -0
  72. package/lib/bridge/serialization.d.ts.map +1 -0
  73. package/lib/bridge/serialization.js +27 -0
  74. package/lib/bridge/serialization.js.map +1 -0
  75. package/lib/bridge/signOperation.d.ts +19 -0
  76. package/lib/bridge/signOperation.d.ts.map +1 -0
  77. package/lib/bridge/signOperation.js +147 -0
  78. package/lib/bridge/signOperation.js.map +1 -0
  79. package/lib/bridge/signOperation.test.d.ts +2 -0
  80. package/lib/bridge/signOperation.test.d.ts.map +1 -0
  81. package/lib/bridge/signOperation.test.js +223 -0
  82. package/lib/bridge/signOperation.test.js.map +1 -0
  83. package/lib/bridge/transaction.d.ts +15 -0
  84. package/lib/bridge/transaction.d.ts.map +1 -0
  85. package/lib/bridge/transaction.js +52 -0
  86. package/lib/bridge/transaction.js.map +1 -0
  87. package/lib/bridge/transactionStatus.d.ts +3 -0
  88. package/lib/bridge/transactionStatus.d.ts.map +1 -0
  89. package/lib/bridge/transactionStatus.js +114 -0
  90. package/lib/bridge/transactionStatus.js.map +1 -0
  91. package/lib/datasets/tezos.scanAccounts.1.d.ts +7 -0
  92. package/lib/datasets/tezos.scanAccounts.1.d.ts.map +1 -0
  93. package/lib/datasets/tezos.scanAccounts.1.js +38 -0
  94. package/lib/datasets/tezos.scanAccounts.1.js.map +1 -0
  95. package/lib/index.d.ts +3 -0
  96. package/lib/index.d.ts.map +1 -0
  97. package/lib/index.js +21 -0
  98. package/lib/index.js.map +1 -0
  99. package/lib/signer/getAddress.d.ts +6 -0
  100. package/lib/signer/getAddress.d.ts.map +1 -0
  101. package/lib/signer/getAddress.js +19 -0
  102. package/lib/signer/getAddress.js.map +1 -0
  103. package/lib/signer/index.d.ts +6 -0
  104. package/lib/signer/index.d.ts.map +1 -0
  105. package/lib/signer/index.js +11 -0
  106. package/lib/signer/index.js.map +1 -0
  107. package/lib/test/bot-deviceActions.d.ts +4 -0
  108. package/lib/test/bot-deviceActions.d.ts.map +1 -0
  109. package/lib/test/bot-deviceActions.js +74 -0
  110. package/lib/test/bot-deviceActions.js.map +1 -0
  111. package/lib/test/bot-specs.d.ts +7 -0
  112. package/lib/test/bot-specs.d.ts.map +1 -0
  113. package/lib/test/bot-specs.js +154 -0
  114. package/lib/test/bot-specs.js.map +1 -0
  115. package/lib/test/bridgeDatasetTest.d.ts +5 -0
  116. package/lib/test/bridgeDatasetTest.d.ts.map +1 -0
  117. package/lib/test/bridgeDatasetTest.js +99 -0
  118. package/lib/test/bridgeDatasetTest.js.map +1 -0
  119. package/lib/test/cli.d.ts +78 -0
  120. package/lib/test/cli.d.ts.map +1 -0
  121. package/lib/test/cli.js +97 -0
  122. package/lib/test/cli.js.map +1 -0
  123. package/lib/test/index.d.ts +2 -0
  124. package/lib/test/index.d.ts.map +1 -0
  125. package/lib/test/index.js +18 -0
  126. package/lib/test/index.js.map +1 -0
  127. package/lib/types/errors.d.ts +4 -0
  128. package/lib/types/errors.d.ts.map +1 -0
  129. package/lib/types/errors.js +6 -0
  130. package/lib/types/errors.js.map +1 -0
  131. package/lib/types/index.d.ts +4 -0
  132. package/lib/types/index.d.ts.map +1 -0
  133. package/lib/types/index.js +20 -0
  134. package/lib/types/index.js.map +1 -0
  135. package/lib/types/model.d.ts +92 -0
  136. package/lib/types/model.d.ts.map +1 -0
  137. package/lib/types/model.fixture.d.ts +5 -0
  138. package/lib/types/model.fixture.d.ts.map +1 -0
  139. package/lib/types/model.fixture.js +85 -0
  140. package/lib/types/model.fixture.js.map +1 -0
  141. package/lib/types/model.js +8 -0
  142. package/lib/types/model.js.map +1 -0
  143. package/lib/types/signer.d.ts +37 -0
  144. package/lib/types/signer.d.ts.map +1 -0
  145. package/lib/types/signer.js +3 -0
  146. package/lib/types/signer.js.map +1 -0
  147. package/lib-es/api/bakers.d.ts +14 -0
  148. package/lib-es/api/bakers.d.ts.map +1 -0
  149. package/lib-es/api/bakers.integration.test.d.ts +2 -0
  150. package/lib-es/api/bakers.integration.test.d.ts.map +1 -0
  151. package/lib-es/api/bakers.integration.test.js +56 -0
  152. package/lib-es/api/bakers.integration.test.js.map +1 -0
  153. package/lib-es/api/bakers.js +125 -0
  154. package/lib-es/api/bakers.js.map +1 -0
  155. package/lib-es/api/bakers.test.d.ts +2 -0
  156. package/lib-es/api/bakers.test.d.ts.map +1 -0
  157. package/lib-es/api/bakers.test.js +141 -0
  158. package/lib-es/api/bakers.test.js.map +1 -0
  159. package/lib-es/api/bakers.whitelist-default.d.ts +4 -0
  160. package/lib-es/api/bakers.whitelist-default.d.ts.map +1 -0
  161. package/lib-es/api/bakers.whitelist-default.js +31 -0
  162. package/lib-es/api/bakers.whitelist-default.js.map +1 -0
  163. package/lib-es/api/index.d.ts +3 -0
  164. package/lib-es/api/index.d.ts.map +1 -0
  165. package/lib-es/api/index.js +3 -0
  166. package/lib-es/api/index.js.map +1 -0
  167. package/lib-es/api/tzkt.d.ts +81 -0
  168. package/lib-es/api/tzkt.d.ts.map +1 -0
  169. package/lib-es/api/tzkt.js +47 -0
  170. package/lib-es/api/tzkt.js.map +1 -0
  171. package/lib-es/bridge/broadcast.d.ts +6 -0
  172. package/lib-es/bridge/broadcast.d.ts.map +1 -0
  173. package/lib-es/bridge/broadcast.js +20 -0
  174. package/lib-es/bridge/broadcast.js.map +1 -0
  175. package/lib-es/bridge/broadcast.test.d.ts +2 -0
  176. package/lib-es/bridge/broadcast.test.d.ts.map +1 -0
  177. package/lib-es/bridge/broadcast.test.js +35 -0
  178. package/lib-es/bridge/broadcast.test.js.map +1 -0
  179. package/lib-es/bridge/createTransaction.d.ts +3 -0
  180. package/lib-es/bridge/createTransaction.d.ts.map +1 -0
  181. package/lib-es/bridge/createTransaction.js +17 -0
  182. package/lib-es/bridge/createTransaction.js.map +1 -0
  183. package/lib-es/bridge/deviceTransactionConfig.d.ts +19 -0
  184. package/lib-es/bridge/deviceTransactionConfig.d.ts.map +1 -0
  185. package/lib-es/bridge/deviceTransactionConfig.js +42 -0
  186. package/lib-es/bridge/deviceTransactionConfig.js.map +1 -0
  187. package/lib-es/bridge/estimateMaxSpendable.d.ts +10 -0
  188. package/lib-es/bridge/estimateMaxSpendable.d.ts.map +1 -0
  189. package/lib-es/bridge/estimateMaxSpendable.js +24 -0
  190. package/lib-es/bridge/estimateMaxSpendable.js.map +1 -0
  191. package/lib-es/bridge/getAccountShape.d.ts +5 -0
  192. package/lib-es/bridge/getAccountShape.d.ts.map +1 -0
  193. package/lib-es/bridge/getAccountShape.js +245 -0
  194. package/lib-es/bridge/getAccountShape.js.map +1 -0
  195. package/lib-es/bridge/getAccountShape.test.d.ts +2 -0
  196. package/lib-es/bridge/getAccountShape.test.d.ts.map +1 -0
  197. package/lib-es/bridge/getAccountShape.test.js +31 -0
  198. package/lib-es/bridge/getAccountShape.test.js.map +1 -0
  199. package/lib-es/bridge/index.d.ts +8 -0
  200. package/lib-es/bridge/index.d.ts.map +1 -0
  201. package/lib-es/bridge/index.js +51 -0
  202. package/lib-es/bridge/index.js.map +1 -0
  203. package/lib-es/bridge/preload.d.ts +9 -0
  204. package/lib-es/bridge/preload.d.ts.map +1 -0
  205. package/lib-es/bridge/preload.js +26 -0
  206. package/lib-es/bridge/preload.js.map +1 -0
  207. package/lib-es/bridge/prepareTransaction.d.ts +9 -0
  208. package/lib-es/bridge/prepareTransaction.d.ts.map +1 -0
  209. package/lib-es/bridge/prepareTransaction.js +150 -0
  210. package/lib-es/bridge/prepareTransaction.js.map +1 -0
  211. package/lib-es/bridge/serialization.d.ts +7 -0
  212. package/lib-es/bridge/serialization.d.ts.map +1 -0
  213. package/lib-es/bridge/serialization.js +20 -0
  214. package/lib-es/bridge/serialization.js.map +1 -0
  215. package/lib-es/bridge/signOperation.d.ts +19 -0
  216. package/lib-es/bridge/signOperation.d.ts.map +1 -0
  217. package/lib-es/bridge/signOperation.js +143 -0
  218. package/lib-es/bridge/signOperation.js.map +1 -0
  219. package/lib-es/bridge/signOperation.test.d.ts +2 -0
  220. package/lib-es/bridge/signOperation.test.d.ts.map +1 -0
  221. package/lib-es/bridge/signOperation.test.js +195 -0
  222. package/lib-es/bridge/signOperation.test.js.map +1 -0
  223. package/lib-es/bridge/transaction.d.ts +15 -0
  224. package/lib-es/bridge/transaction.d.ts.map +1 -0
  225. package/lib-es/bridge/transaction.js +46 -0
  226. package/lib-es/bridge/transaction.js.map +1 -0
  227. package/lib-es/bridge/transactionStatus.d.ts +3 -0
  228. package/lib-es/bridge/transactionStatus.d.ts.map +1 -0
  229. package/lib-es/bridge/transactionStatus.js +107 -0
  230. package/lib-es/bridge/transactionStatus.js.map +1 -0
  231. package/lib-es/datasets/tezos.scanAccounts.1.d.ts +7 -0
  232. package/lib-es/datasets/tezos.scanAccounts.1.d.ts.map +1 -0
  233. package/lib-es/datasets/tezos.scanAccounts.1.js +36 -0
  234. package/lib-es/datasets/tezos.scanAccounts.1.js.map +1 -0
  235. package/lib-es/index.d.ts +3 -0
  236. package/lib-es/index.d.ts.map +1 -0
  237. package/lib-es/index.js +3 -0
  238. package/lib-es/index.js.map +1 -0
  239. package/lib-es/signer/getAddress.d.ts +6 -0
  240. package/lib-es/signer/getAddress.d.ts.map +1 -0
  241. package/lib-es/signer/getAddress.js +17 -0
  242. package/lib-es/signer/getAddress.js.map +1 -0
  243. package/lib-es/signer/index.d.ts +6 -0
  244. package/lib-es/signer/index.d.ts.map +1 -0
  245. package/lib-es/signer/index.js +6 -0
  246. package/lib-es/signer/index.js.map +1 -0
  247. package/lib-es/test/bot-deviceActions.d.ts +4 -0
  248. package/lib-es/test/bot-deviceActions.d.ts.map +1 -0
  249. package/lib-es/test/bot-deviceActions.js +71 -0
  250. package/lib-es/test/bot-deviceActions.js.map +1 -0
  251. package/lib-es/test/bot-specs.d.ts +7 -0
  252. package/lib-es/test/bot-specs.d.ts.map +1 -0
  253. package/lib-es/test/bot-specs.js +149 -0
  254. package/lib-es/test/bot-specs.js.map +1 -0
  255. package/lib-es/test/bridgeDatasetTest.d.ts +5 -0
  256. package/lib-es/test/bridgeDatasetTest.d.ts.map +1 -0
  257. package/lib-es/test/bridgeDatasetTest.js +93 -0
  258. package/lib-es/test/bridgeDatasetTest.js.map +1 -0
  259. package/lib-es/test/cli.d.ts +78 -0
  260. package/lib-es/test/cli.d.ts.map +1 -0
  261. package/lib-es/test/cli.js +91 -0
  262. package/lib-es/test/cli.js.map +1 -0
  263. package/lib-es/test/index.d.ts +2 -0
  264. package/lib-es/test/index.d.ts.map +1 -0
  265. package/lib-es/test/index.js +2 -0
  266. package/lib-es/test/index.js.map +1 -0
  267. package/lib-es/types/errors.d.ts +4 -0
  268. package/lib-es/types/errors.d.ts.map +1 -0
  269. package/lib-es/types/errors.js +3 -0
  270. package/lib-es/types/errors.js.map +1 -0
  271. package/lib-es/types/index.d.ts +4 -0
  272. package/lib-es/types/index.d.ts.map +1 -0
  273. package/lib-es/types/index.js +4 -0
  274. package/lib-es/types/index.js.map +1 -0
  275. package/lib-es/types/model.d.ts +92 -0
  276. package/lib-es/types/model.d.ts.map +1 -0
  277. package/lib-es/types/model.fixture.d.ts +5 -0
  278. package/lib-es/types/model.fixture.d.ts.map +1 -0
  279. package/lib-es/types/model.fixture.js +76 -0
  280. package/lib-es/types/model.fixture.js.map +1 -0
  281. package/lib-es/types/model.js +4 -0
  282. package/lib-es/types/model.js.map +1 -0
  283. package/lib-es/types/signer.d.ts +37 -0
  284. package/lib-es/types/signer.d.ts.map +1 -0
  285. package/lib-es/types/signer.js +2 -0
  286. package/lib-es/types/signer.js.map +1 -0
  287. package/package.json +116 -0
  288. package/src/README.md +29 -0
  289. package/src/api/bakers.integration.test.ts +61 -0
  290. package/src/api/bakers.test.ts +140 -0
  291. package/src/api/bakers.ts +139 -0
  292. package/src/api/bakers.whitelist-default.ts +33 -0
  293. package/src/api/index.ts +2 -0
  294. package/src/api/tzkt.ts +112 -0
  295. package/src/bridge/broadcast.test.ts +30 -0
  296. package/src/bridge/broadcast.ts +18 -0
  297. package/src/bridge/createTransaction.ts +18 -0
  298. package/src/bridge/deviceTransactionConfig.ts +74 -0
  299. package/src/bridge/estimateMaxSpendable.ts +32 -0
  300. package/src/bridge/getAccountShape.test.ts +22 -0
  301. package/src/bridge/getAccountShape.ts +289 -0
  302. package/src/bridge/index.ts +65 -0
  303. package/src/bridge/preload.ts +18 -0
  304. package/src/bridge/prepareTransaction.ts +160 -0
  305. package/src/bridge/serialization.ts +27 -0
  306. package/src/bridge/signOperation.test.ts +211 -0
  307. package/src/bridge/signOperation.ts +213 -0
  308. package/src/bridge/transaction.ts +94 -0
  309. package/src/bridge/transactionStatus.ts +130 -0
  310. package/src/datasets/tezos.scanAccounts.1.ts +35 -0
  311. package/src/index.ts +3 -0
  312. package/src/signer/getAddress.ts +13 -0
  313. package/src/signer/index.ts +7 -0
  314. package/src/test/bot-deviceActions.ts +79 -0
  315. package/src/test/bot-specs.ts +152 -0
  316. package/src/test/bridgeDatasetTest.ts +132 -0
  317. package/src/test/cli.ts +137 -0
  318. package/src/test/index.ts +1 -0
  319. package/src/types/errors.ts +5 -0
  320. package/src/types/index.ts +3 -0
  321. package/src/types/model.fixture.ts +89 -0
  322. package/src/types/model.ts +123 -0
  323. package/src/types/signer.ts +48 -0
  324. package/tsconfig.json +13 -0
  325. package/types/@taquito/ledger-signer/index.d.ts +3 -0
@@ -0,0 +1,123 @@
1
+ import type {
2
+ Account,
3
+ AccountRaw,
4
+ Operation,
5
+ TransactionCommon,
6
+ TransactionCommonRaw,
7
+ TransactionStatusCommon,
8
+ TransactionStatusCommonRaw,
9
+ } from "@ledgerhq/types-live";
10
+ import type { BigNumber } from "bignumber.js";
11
+
12
+ export type TezosResources = {
13
+ revealed: boolean;
14
+ counter: number;
15
+ };
16
+
17
+ export type TezosResourcesRaw = {
18
+ revealed: boolean;
19
+ counter: number;
20
+ };
21
+
22
+ export type TezosOperationMode = "send" | "delegate" | "undelegate";
23
+
24
+ export type NetworkInfo = {
25
+ family: "tezos";
26
+ fees: BigNumber;
27
+ };
28
+
29
+ export type NetworkInfoRaw = {
30
+ family: "tezos";
31
+ fees: string;
32
+ };
33
+
34
+ // TODO add a field for indicating if staking
35
+ export type Transaction = TransactionCommon & {
36
+ family: "tezos";
37
+ mode: TezosOperationMode;
38
+ networkInfo: NetworkInfo | null | undefined;
39
+ fees: BigNumber | null | undefined;
40
+ gasLimit: BigNumber | null | undefined;
41
+ storageLimit: BigNumber | null | undefined;
42
+ estimatedFees: BigNumber | null | undefined;
43
+ taquitoError: string | null | undefined;
44
+ };
45
+
46
+ export type TransactionRaw = TransactionCommonRaw & {
47
+ family: "tezos";
48
+ mode: TezosOperationMode;
49
+ networkInfo: NetworkInfoRaw | null | undefined;
50
+ fees: string | null | undefined;
51
+ gasLimit: string | null | undefined;
52
+ storageLimit: string | null | undefined;
53
+ estimatedFees: string | null | undefined;
54
+ taquitoError: string | null | undefined;
55
+ };
56
+
57
+ type CapacityStatus = "normal" | "full";
58
+
59
+ export type Baker = {
60
+ address: string;
61
+ name: string;
62
+ logoURL: string;
63
+ nominalYield: `${number} %`;
64
+ capacityStatus: CapacityStatus;
65
+ };
66
+
67
+ // type used by UI to facilitate business logic of current delegation data
68
+ export type Delegation = {
69
+ // delegator address
70
+ address: string;
71
+ // if not defined, we need to render "Unknown" on the UI. we don't know who is delegator.
72
+ baker: Baker | null | undefined;
73
+ // operation related to delegation (to know the date info)
74
+ operation: Operation;
75
+ // true if the delegation is pending (optimistic update)
76
+ isPending: boolean;
77
+ // true if a receive should inform it will top up the delegation
78
+ receiveShouldWarnDelegation: boolean;
79
+ // true if a send should inform it will top down the delegation
80
+ sendShouldWarnDelegation: boolean;
81
+ };
82
+
83
+ export type API_BAKER = {
84
+ address: string;
85
+ name: string;
86
+ logo: string;
87
+ balance: number;
88
+ stakingBalance: number;
89
+ stakingCapacity: number;
90
+ maxStakingBalance: number;
91
+ freeSpace: number;
92
+ fee: number;
93
+ minDelegation: number;
94
+ payoutDelay: number;
95
+ payoutPeriod: number;
96
+ openForDelegation: true;
97
+ estimatedRoi: number;
98
+ serviceType: string;
99
+ serviceHealth: string;
100
+ payoutTiming: string;
101
+ payoutAccuracy: string;
102
+ audit?: string;
103
+ insuranceCoverage: number;
104
+ };
105
+
106
+ export type TezosAccount = Account & { tezosResources: TezosResources };
107
+ export function isTezosAccount(account: Account): account is TezosAccount {
108
+ return "tezosResources" in account;
109
+ }
110
+
111
+ export type TezosAccountRaw = AccountRaw & {
112
+ tezosResources: TezosResourcesRaw;
113
+ };
114
+
115
+ export type TransactionStatus = TransactionStatusCommon;
116
+
117
+ export type TransactionStatusRaw = TransactionStatusCommonRaw;
118
+
119
+ export type TezosOperation = Operation<TezosOperationExtra>;
120
+
121
+ export type TezosOperationExtra = {
122
+ id?: number; // Used as most recent operation id for incremental sync
123
+ };
@@ -0,0 +1,48 @@
1
+ export type TezosAddress = {
2
+ address: string;
3
+ publicKey: string;
4
+ };
5
+ export type TezosSignature = {
6
+ signature: string;
7
+ };
8
+ // Type coming from hw-app-tezos
9
+ type TezosCurves = {
10
+ ED25519: 0x00;
11
+ SECP256K1: 0x01;
12
+ SECP256R1: 0x02;
13
+ };
14
+ export type Curve = TezosCurves[keyof TezosCurves];
15
+
16
+ export type LedgerSigner = {
17
+ publicKey(): Promise<string>;
18
+ publicKeyHash(): Promise<string>;
19
+ sign(
20
+ bytes: string,
21
+ watermark?: Uint8Array,
22
+ ): Promise<{
23
+ bytes: string;
24
+ sig: string;
25
+ prefixSig: string;
26
+ sbytes: string;
27
+ }>;
28
+ secretKey(): Promise<string | undefined>;
29
+ };
30
+ export interface TezosSigner {
31
+ getAddress(
32
+ path: string,
33
+ options: {
34
+ verify?: boolean;
35
+ curve?: Curve;
36
+ ins?: number;
37
+ },
38
+ ): Promise<TezosAddress>;
39
+ signOperation(
40
+ path: string,
41
+ rawTxHex: string,
42
+ options: {
43
+ curve?: Curve;
44
+ },
45
+ ): Promise<TezosSignature>;
46
+ // Tezos [LedgerSigner](https://www.npmjs.com/package/@taquito/ledger-signer)
47
+ createLedgerSigner(path: string, prompt: boolean, derivationType: number): LedgerSigner;
48
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "../../../tsconfig.base",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "declarationMap": true,
6
+ "module": "commonjs",
7
+ "downlevelIteration": true,
8
+ "lib": ["es2020", "dom"],
9
+ "outDir": "lib",
10
+ "typeRoots": ["./node_modules/@types", "./types/@taquito"]
11
+ },
12
+ "include": ["src/**/*"]
13
+ }
@@ -0,0 +1,3 @@
1
+ declare module "@taquito/ledger-signer/dist/lib/utils" {
2
+ export * from "@taquito/ledger-signer/dist/types/utils";
3
+ }