@ledgerhq/coin-solana 0.7.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 (521) hide show
  1. package/.eslintrc.js +20 -0
  2. package/.turbo/turbo-build.log +4 -0
  3. package/.unimportedrc.json +16 -0
  4. package/CHANGELOG.md +13 -0
  5. package/LICENSE.txt +21 -0
  6. package/jest.config.js +9 -0
  7. package/lib/api/cached.d.ts +3 -0
  8. package/lib/api/cached.d.ts.map +1 -0
  9. package/lib/api/cached.js +40 -0
  10. package/lib/api/cached.js.map +1 -0
  11. package/lib/api/chain/account/index.d.ts +2 -0
  12. package/lib/api/chain/account/index.d.ts.map +1 -0
  13. package/lib/api/chain/account/index.js +8 -0
  14. package/lib/api/chain/account/index.js.map +1 -0
  15. package/lib/api/chain/account/parser.d.ts +10 -0
  16. package/lib/api/chain/account/parser.d.ts.map +1 -0
  17. package/lib/api/chain/account/parser.js +56 -0
  18. package/lib/api/chain/account/parser.js.map +1 -0
  19. package/lib/api/chain/account/stake.d.ts +237 -0
  20. package/lib/api/chain/account/stake.d.ts.map +1 -0
  21. package/lib/api/chain/account/stake.js +38 -0
  22. package/lib/api/chain/account/stake.js.map +1 -0
  23. package/lib/api/chain/account/token.d.ts +116 -0
  24. package/lib/api/chain/account/token.d.ts.map +1 -0
  25. package/lib/api/chain/account/token.js +42 -0
  26. package/lib/api/chain/account/token.js.map +1 -0
  27. package/lib/api/chain/account/vote.d.ts +252 -0
  28. package/lib/api/chain/account/vote.d.ts.map +1 -0
  29. package/lib/api/chain/account/vote.js +44 -0
  30. package/lib/api/chain/account/vote.js.map +1 -0
  31. package/lib/api/chain/index.d.ts +29 -0
  32. package/lib/api/chain/index.d.ts.map +1 -0
  33. package/lib/api/chain/index.js +99 -0
  34. package/lib/api/chain/index.js.map +1 -0
  35. package/lib/api/chain/instruction/associated-token-account/index.d.ts +15 -0
  36. package/lib/api/chain/instruction/associated-token-account/index.d.ts.map +1 -0
  37. package/lib/api/chain/instruction/associated-token-account/index.js +21 -0
  38. package/lib/api/chain/instruction/associated-token-account/index.js.map +1 -0
  39. package/lib/api/chain/instruction/associated-token-account/types.d.ts +30 -0
  40. package/lib/api/chain/instruction/associated-token-account/types.d.ts.map +1 -0
  41. package/lib/api/chain/instruction/associated-token-account/types.js +19 -0
  42. package/lib/api/chain/instruction/associated-token-account/types.js.map +1 -0
  43. package/lib/api/chain/instruction/memo/index.d.ts +15 -0
  44. package/lib/api/chain/instruction/memo/index.d.ts.map +1 -0
  45. package/lib/api/chain/instruction/memo/index.js +14 -0
  46. package/lib/api/chain/instruction/memo/index.js.map +1 -0
  47. package/lib/api/chain/instruction/memo/types.d.ts +21 -0
  48. package/lib/api/chain/instruction/memo/types.d.ts.map +1 -0
  49. package/lib/api/chain/instruction/memo/types.js +16 -0
  50. package/lib/api/chain/instruction/memo/types.js.map +1 -0
  51. package/lib/api/chain/instruction/stake/index.d.ts +15 -0
  52. package/lib/api/chain/instruction/stake/index.d.ts.map +1 -0
  53. package/lib/api/chain/instruction/stake/index.js +20 -0
  54. package/lib/api/chain/instruction/stake/index.js.map +1 -0
  55. package/lib/api/chain/instruction/stake/types.d.ts +215 -0
  56. package/lib/api/chain/instruction/stake/types.d.ts.map +1 -0
  57. package/lib/api/chain/instruction/stake/types.js +80 -0
  58. package/lib/api/chain/instruction/stake/types.js.map +1 -0
  59. package/lib/api/chain/instruction/system/index.d.ts +15 -0
  60. package/lib/api/chain/instruction/system/index.d.ts.map +1 -0
  61. package/lib/api/chain/instruction/system/index.js +20 -0
  62. package/lib/api/chain/instruction/system/index.js.map +1 -0
  63. package/lib/api/chain/instruction/system/types.d.ts +298 -0
  64. package/lib/api/chain/instruction/system/types.d.ts.map +1 -0
  65. package/lib/api/chain/instruction/system/types.js +117 -0
  66. package/lib/api/chain/instruction/system/types.js.map +1 -0
  67. package/lib/api/chain/instruction/token/index.d.ts +15 -0
  68. package/lib/api/chain/instruction/token/index.d.ts.map +1 -0
  69. package/lib/api/chain/instruction/token/index.js +20 -0
  70. package/lib/api/chain/instruction/token/index.js.map +1 -0
  71. package/lib/api/chain/instruction/token/types.d.ts +497 -0
  72. package/lib/api/chain/instruction/token/types.d.ts.map +1 -0
  73. package/lib/api/chain/instruction/token/types.js +200 -0
  74. package/lib/api/chain/instruction/token/types.js.map +1 -0
  75. package/lib/api/chain/program/constants.d.ts +11 -0
  76. package/lib/api/chain/program/constants.d.ts.map +1 -0
  77. package/lib/api/chain/program/constants.js +14 -0
  78. package/lib/api/chain/program/constants.js.map +1 -0
  79. package/lib/api/chain/program/index.d.ts +2 -0
  80. package/lib/api/chain/program/index.d.ts.map +1 -0
  81. package/lib/api/chain/program/index.js +7 -0
  82. package/lib/api/chain/program/index.js.map +1 -0
  83. package/lib/api/chain/program/parser.d.ts +35 -0
  84. package/lib/api/chain/program/parser.d.ts.map +1 -0
  85. package/lib/api/chain/program/parser.js +66 -0
  86. package/lib/api/chain/program/parser.js.map +1 -0
  87. package/lib/api/chain/validators/bignum.d.ts +3 -0
  88. package/lib/api/chain/validators/bignum.d.ts.map +1 -0
  89. package/lib/api/chain/validators/bignum.js +11 -0
  90. package/lib/api/chain/validators/bignum.js.map +1 -0
  91. package/lib/api/chain/validators/index.d.ts +10 -0
  92. package/lib/api/chain/validators/index.d.ts.map +1 -0
  93. package/lib/api/chain/validators/index.js +10 -0
  94. package/lib/api/chain/validators/index.js.map +1 -0
  95. package/lib/api/chain/validators/pubkey.d.ts +3 -0
  96. package/lib/api/chain/validators/pubkey.d.ts.map +1 -0
  97. package/lib/api/chain/validators/pubkey.js +7 -0
  98. package/lib/api/chain/validators/pubkey.js.map +1 -0
  99. package/lib/api/chain/web3.d.ts +43 -0
  100. package/lib/api/chain/web3.d.ts.map +1 -0
  101. package/lib/api/chain/web3.js +274 -0
  102. package/lib/api/chain/web3.js.map +1 -0
  103. package/lib/api/index.d.ts +5 -0
  104. package/lib/api/index.d.ts.map +1 -0
  105. package/lib/api/index.js +25 -0
  106. package/lib/api/index.js.map +1 -0
  107. package/lib/api/logged.d.ts +3 -0
  108. package/lib/api/logged.d.ts.map +1 -0
  109. package/lib/api/logged.js +69 -0
  110. package/lib/api/logged.js.map +1 -0
  111. package/lib/api/queued.d.ts +3 -0
  112. package/lib/api/queued.d.ts.map +1 -0
  113. package/lib/api/queued.js +27 -0
  114. package/lib/api/queued.js.map +1 -0
  115. package/lib/api/traced.d.ts +3 -0
  116. package/lib/api/traced.d.ts.map +1 -0
  117. package/lib/api/traced.js +80 -0
  118. package/lib/api/traced.js.map +1 -0
  119. package/lib/bridge/bridge.d.ts +15 -0
  120. package/lib/bridge/bridge.d.ts.map +1 -0
  121. package/lib/bridge/bridge.js +139 -0
  122. package/lib/bridge/bridge.js.map +1 -0
  123. package/lib/bridge/js.d.ts +7 -0
  124. package/lib/bridge/js.d.ts.map +1 -0
  125. package/lib/bridge/js.js +28 -0
  126. package/lib/bridge/js.js.map +1 -0
  127. package/lib/bridge.integration.test.d.ts +4 -0
  128. package/lib/bridge.integration.test.d.ts.map +1 -0
  129. package/lib/bridge.integration.test.js +990 -0
  130. package/lib/bridge.integration.test.js.map +1 -0
  131. package/lib/cli-transaction.d.ts +19 -0
  132. package/lib/cli-transaction.d.ts.map +1 -0
  133. package/lib/cli-transaction.js +196 -0
  134. package/lib/cli-transaction.js.map +1 -0
  135. package/lib/datasets/solana.scanAccounts.1.d.ts +6 -0
  136. package/lib/datasets/solana.scanAccounts.1.d.ts.map +1 -0
  137. package/lib/datasets/solana.scanAccounts.1.js +12 -0
  138. package/lib/datasets/solana.scanAccounts.1.js.map +1 -0
  139. package/lib/deviceTransactionConfig.d.ts +10 -0
  140. package/lib/deviceTransactionConfig.d.ts.map +1 -0
  141. package/lib/deviceTransactionConfig.js +228 -0
  142. package/lib/deviceTransactionConfig.js.map +1 -0
  143. package/lib/errors.d.ts +61 -0
  144. package/lib/errors.d.ts.map +1 -0
  145. package/lib/errors.js +25 -0
  146. package/lib/errors.js.map +1 -0
  147. package/lib/hw-getAddress.d.ts +6 -0
  148. package/lib/hw-getAddress.d.ts.map +1 -0
  149. package/lib/hw-getAddress.js +28 -0
  150. package/lib/hw-getAddress.js.map +1 -0
  151. package/lib/js-broadcast.d.ts +7 -0
  152. package/lib/js-broadcast.d.ts.map +1 -0
  153. package/lib/js-broadcast.js +37 -0
  154. package/lib/js-broadcast.js.map +1 -0
  155. package/lib/js-buildTransaction.d.ts +5 -0
  156. package/lib/js-buildTransaction.d.ts.map +1 -0
  157. package/lib/js-buildTransaction.js +67 -0
  158. package/lib/js-buildTransaction.js.map +1 -0
  159. package/lib/js-createTransaction.d.ts +5 -0
  160. package/lib/js-createTransaction.d.ts.map +1 -0
  161. package/lib/js-createTransaction.js +19 -0
  162. package/lib/js-createTransaction.js.map +1 -0
  163. package/lib/js-estimateMaxSpendable.d.ts +11 -0
  164. package/lib/js-estimateMaxSpendable.d.ts.map +1 -0
  165. package/lib/js-estimateMaxSpendable.js +62 -0
  166. package/lib/js-estimateMaxSpendable.js.map +1 -0
  167. package/lib/js-getTransactionStatus.d.ts +5 -0
  168. package/lib/js-getTransactionStatus.d.ts.map +1 -0
  169. package/lib/js-getTransactionStatus.js +71 -0
  170. package/lib/js-getTransactionStatus.js.map +1 -0
  171. package/lib/js-preload-data.d.ts +7 -0
  172. package/lib/js-preload-data.d.ts.map +1 -0
  173. package/lib/js-preload-data.js +45 -0
  174. package/lib/js-preload-data.js.map +1 -0
  175. package/lib/js-preload.d.ts +7 -0
  176. package/lib/js-preload.d.ts.map +1 -0
  177. package/lib/js-preload.js +67 -0
  178. package/lib/js-preload.js.map +1 -0
  179. package/lib/js-preload.test.d.ts +2 -0
  180. package/lib/js-preload.test.d.ts.map +1 -0
  181. package/lib/js-preload.test.js +9 -0
  182. package/lib/js-preload.test.js.map +1 -0
  183. package/lib/js-prepareTransaction.d.ts +5 -0
  184. package/lib/js-prepareTransaction.d.ts.map +1 -0
  185. package/lib/js-prepareTransaction.js +500 -0
  186. package/lib/js-prepareTransaction.js.map +1 -0
  187. package/lib/js-signOperation.d.ts +7 -0
  188. package/lib/js-signOperation.d.ts.map +1 -0
  189. package/lib/js-signOperation.js +153 -0
  190. package/lib/js-signOperation.js.map +1 -0
  191. package/lib/js-synchronization.d.ts +5 -0
  192. package/lib/js-synchronization.d.ts.map +1 -0
  193. package/lib/js-synchronization.js +464 -0
  194. package/lib/js-synchronization.js.map +1 -0
  195. package/lib/logic.d.ts +29 -0
  196. package/lib/logic.d.ts.map +1 -0
  197. package/lib/logic.js +102 -0
  198. package/lib/logic.js.map +1 -0
  199. package/lib/serialization.d.ts +9 -0
  200. package/lib/serialization.d.ts.map +1 -0
  201. package/lib/serialization.js +69 -0
  202. package/lib/serialization.js.map +1 -0
  203. package/lib/signer.d.ts +11 -0
  204. package/lib/signer.d.ts.map +1 -0
  205. package/lib/signer.js +3 -0
  206. package/lib/signer.js.map +1 -0
  207. package/lib/specs.d.ts +7 -0
  208. package/lib/specs.d.ts.map +1 -0
  209. package/lib/specs.js +409 -0
  210. package/lib/specs.js.map +1 -0
  211. package/lib/speculos-deviceActions.d.ts +8 -0
  212. package/lib/speculos-deviceActions.d.ts.map +1 -0
  213. package/lib/speculos-deviceActions.js +217 -0
  214. package/lib/speculos-deviceActions.js.map +1 -0
  215. package/lib/transaction.d.ts +15 -0
  216. package/lib/transaction.d.ts.map +1 -0
  217. package/lib/transaction.js +153 -0
  218. package/lib/transaction.js.map +1 -0
  219. package/lib/tx-fees.d.ts +4 -0
  220. package/lib/tx-fees.d.ts.map +1 -0
  221. package/lib/tx-fees.js +167 -0
  222. package/lib/tx-fees.js.map +1 -0
  223. package/lib/types.d.ts +222 -0
  224. package/lib/types.d.ts.map +1 -0
  225. package/lib/types.js +3 -0
  226. package/lib/types.js.map +1 -0
  227. package/lib/utils.d.ts +24 -0
  228. package/lib/utils.d.ts.map +1 -0
  229. package/lib/utils.js +172 -0
  230. package/lib/utils.js.map +1 -0
  231. package/lib/validator-app/index.d.ts +22 -0
  232. package/lib/validator-app/index.d.ts.map +1 -0
  233. package/lib/validator-app/index.js +62 -0
  234. package/lib/validator-app/index.js.map +1 -0
  235. package/lib-es/api/cached.d.ts +3 -0
  236. package/lib-es/api/cached.d.ts.map +1 -0
  237. package/lib-es/api/cached.js +33 -0
  238. package/lib-es/api/cached.js.map +1 -0
  239. package/lib-es/api/chain/account/index.d.ts +2 -0
  240. package/lib-es/api/chain/account/index.d.ts.map +1 -0
  241. package/lib-es/api/chain/account/index.js +2 -0
  242. package/lib-es/api/chain/account/index.js.map +1 -0
  243. package/lib-es/api/chain/account/parser.d.ts +10 -0
  244. package/lib-es/api/chain/account/parser.d.ts.map +1 -0
  245. package/lib-es/api/chain/account/parser.js +48 -0
  246. package/lib-es/api/chain/account/parser.js.map +1 -0
  247. package/lib-es/api/chain/account/stake.d.ts +237 -0
  248. package/lib-es/api/chain/account/stake.d.ts.map +1 -0
  249. package/lib-es/api/chain/account/stake.js +35 -0
  250. package/lib-es/api/chain/account/stake.js.map +1 -0
  251. package/lib-es/api/chain/account/token.d.ts +116 -0
  252. package/lib-es/api/chain/account/token.d.ts.map +1 -0
  253. package/lib-es/api/chain/account/token.js +39 -0
  254. package/lib-es/api/chain/account/token.js.map +1 -0
  255. package/lib-es/api/chain/account/vote.d.ts +252 -0
  256. package/lib-es/api/chain/account/vote.d.ts.map +1 -0
  257. package/lib-es/api/chain/account/vote.js +41 -0
  258. package/lib-es/api/chain/account/vote.js.map +1 -0
  259. package/lib-es/api/chain/index.d.ts +29 -0
  260. package/lib-es/api/chain/index.d.ts.map +1 -0
  261. package/lib-es/api/chain/index.js +95 -0
  262. package/lib-es/api/chain/index.js.map +1 -0
  263. package/lib-es/api/chain/instruction/associated-token-account/index.d.ts +15 -0
  264. package/lib-es/api/chain/instruction/associated-token-account/index.d.ts.map +1 -0
  265. package/lib-es/api/chain/instruction/associated-token-account/index.js +17 -0
  266. package/lib-es/api/chain/instruction/associated-token-account/index.js.map +1 -0
  267. package/lib-es/api/chain/instruction/associated-token-account/types.d.ts +30 -0
  268. package/lib-es/api/chain/instruction/associated-token-account/types.d.ts.map +1 -0
  269. package/lib-es/api/chain/instruction/associated-token-account/types.js +16 -0
  270. package/lib-es/api/chain/instruction/associated-token-account/types.js.map +1 -0
  271. package/lib-es/api/chain/instruction/memo/index.d.ts +15 -0
  272. package/lib-es/api/chain/instruction/memo/index.d.ts.map +1 -0
  273. package/lib-es/api/chain/instruction/memo/index.js +10 -0
  274. package/lib-es/api/chain/instruction/memo/index.js.map +1 -0
  275. package/lib-es/api/chain/instruction/memo/types.d.ts +21 -0
  276. package/lib-es/api/chain/instruction/memo/types.d.ts.map +1 -0
  277. package/lib-es/api/chain/instruction/memo/types.js +13 -0
  278. package/lib-es/api/chain/instruction/memo/types.js.map +1 -0
  279. package/lib-es/api/chain/instruction/stake/index.d.ts +15 -0
  280. package/lib-es/api/chain/instruction/stake/index.d.ts.map +1 -0
  281. package/lib-es/api/chain/instruction/stake/index.js +16 -0
  282. package/lib-es/api/chain/instruction/stake/index.js.map +1 -0
  283. package/lib-es/api/chain/instruction/stake/types.d.ts +215 -0
  284. package/lib-es/api/chain/instruction/stake/types.d.ts.map +1 -0
  285. package/lib-es/api/chain/instruction/stake/types.js +77 -0
  286. package/lib-es/api/chain/instruction/stake/types.js.map +1 -0
  287. package/lib-es/api/chain/instruction/system/index.d.ts +15 -0
  288. package/lib-es/api/chain/instruction/system/index.d.ts.map +1 -0
  289. package/lib-es/api/chain/instruction/system/index.js +16 -0
  290. package/lib-es/api/chain/instruction/system/index.js.map +1 -0
  291. package/lib-es/api/chain/instruction/system/types.d.ts +298 -0
  292. package/lib-es/api/chain/instruction/system/types.d.ts.map +1 -0
  293. package/lib-es/api/chain/instruction/system/types.js +114 -0
  294. package/lib-es/api/chain/instruction/system/types.js.map +1 -0
  295. package/lib-es/api/chain/instruction/token/index.d.ts +15 -0
  296. package/lib-es/api/chain/instruction/token/index.d.ts.map +1 -0
  297. package/lib-es/api/chain/instruction/token/index.js +16 -0
  298. package/lib-es/api/chain/instruction/token/index.js.map +1 -0
  299. package/lib-es/api/chain/instruction/token/types.d.ts +497 -0
  300. package/lib-es/api/chain/instruction/token/types.d.ts.map +1 -0
  301. package/lib-es/api/chain/instruction/token/types.js +197 -0
  302. package/lib-es/api/chain/instruction/token/types.js.map +1 -0
  303. package/lib-es/api/chain/program/constants.d.ts +11 -0
  304. package/lib-es/api/chain/program/constants.d.ts.map +1 -0
  305. package/lib-es/api/chain/program/constants.js +11 -0
  306. package/lib-es/api/chain/program/constants.js.map +1 -0
  307. package/lib-es/api/chain/program/index.d.ts +2 -0
  308. package/lib-es/api/chain/program/index.d.ts.map +1 -0
  309. package/lib-es/api/chain/program/index.js +2 -0
  310. package/lib-es/api/chain/program/index.js.map +1 -0
  311. package/lib-es/api/chain/program/parser.d.ts +35 -0
  312. package/lib-es/api/chain/program/parser.d.ts.map +1 -0
  313. package/lib-es/api/chain/program/parser.js +61 -0
  314. package/lib-es/api/chain/program/parser.js.map +1 -0
  315. package/lib-es/api/chain/validators/bignum.d.ts +3 -0
  316. package/lib-es/api/chain/validators/bignum.d.ts.map +1 -0
  317. package/lib-es/api/chain/validators/bignum.js +8 -0
  318. package/lib-es/api/chain/validators/bignum.js.map +1 -0
  319. package/lib-es/api/chain/validators/index.d.ts +10 -0
  320. package/lib-es/api/chain/validators/index.d.ts.map +1 -0
  321. package/lib-es/api/chain/validators/index.js +7 -0
  322. package/lib-es/api/chain/validators/index.js.map +1 -0
  323. package/lib-es/api/chain/validators/pubkey.d.ts +3 -0
  324. package/lib-es/api/chain/validators/pubkey.d.ts.map +1 -0
  325. package/lib-es/api/chain/validators/pubkey.js +4 -0
  326. package/lib-es/api/chain/validators/pubkey.js.map +1 -0
  327. package/lib-es/api/chain/web3.d.ts +43 -0
  328. package/lib-es/api/chain/web3.d.ts.map +1 -0
  329. package/lib-es/api/chain/web3.js +251 -0
  330. package/lib-es/api/chain/web3.js.map +1 -0
  331. package/lib-es/api/index.d.ts +5 -0
  332. package/lib-es/api/index.d.ts.map +1 -0
  333. package/lib-es/api/index.js +5 -0
  334. package/lib-es/api/index.js.map +1 -0
  335. package/lib-es/api/logged.d.ts +3 -0
  336. package/lib-es/api/logged.d.ts.map +1 -0
  337. package/lib-es/api/logged.js +65 -0
  338. package/lib-es/api/logged.js.map +1 -0
  339. package/lib-es/api/queued.d.ts +3 -0
  340. package/lib-es/api/queued.d.ts.map +1 -0
  341. package/lib-es/api/queued.js +23 -0
  342. package/lib-es/api/queued.js.map +1 -0
  343. package/lib-es/api/traced.d.ts +3 -0
  344. package/lib-es/api/traced.d.ts.map +1 -0
  345. package/lib-es/api/traced.js +76 -0
  346. package/lib-es/api/traced.js.map +1 -0
  347. package/lib-es/bridge/bridge.d.ts +15 -0
  348. package/lib-es/bridge/bridge.d.ts.map +1 -0
  349. package/lib-es/bridge/bridge.js +132 -0
  350. package/lib-es/bridge/bridge.js.map +1 -0
  351. package/lib-es/bridge/js.d.ts +7 -0
  352. package/lib-es/bridge/js.d.ts.map +1 -0
  353. package/lib-es/bridge/js.js +24 -0
  354. package/lib-es/bridge/js.js.map +1 -0
  355. package/lib-es/bridge.integration.test.d.ts +4 -0
  356. package/lib-es/bridge.integration.test.d.ts.map +1 -0
  357. package/lib-es/bridge.integration.test.js +988 -0
  358. package/lib-es/bridge.integration.test.js.map +1 -0
  359. package/lib-es/cli-transaction.d.ts +19 -0
  360. package/lib-es/cli-transaction.d.ts.map +1 -0
  361. package/lib-es/cli-transaction.js +190 -0
  362. package/lib-es/cli-transaction.js.map +1 -0
  363. package/lib-es/datasets/solana.scanAccounts.1.d.ts +6 -0
  364. package/lib-es/datasets/solana.scanAccounts.1.d.ts.map +1 -0
  365. package/lib-es/datasets/solana.scanAccounts.1.js +10 -0
  366. package/lib-es/datasets/solana.scanAccounts.1.js.map +1 -0
  367. package/lib-es/deviceTransactionConfig.d.ts +10 -0
  368. package/lib-es/deviceTransactionConfig.d.ts.map +1 -0
  369. package/lib-es/deviceTransactionConfig.js +223 -0
  370. package/lib-es/deviceTransactionConfig.js.map +1 -0
  371. package/lib-es/errors.d.ts +61 -0
  372. package/lib-es/errors.d.ts.map +1 -0
  373. package/lib-es/errors.js +22 -0
  374. package/lib-es/errors.js.map +1 -0
  375. package/lib-es/hw-getAddress.d.ts +6 -0
  376. package/lib-es/hw-getAddress.d.ts.map +1 -0
  377. package/lib-es/hw-getAddress.js +23 -0
  378. package/lib-es/hw-getAddress.js.map +1 -0
  379. package/lib-es/js-broadcast.d.ts +7 -0
  380. package/lib-es/js-broadcast.d.ts.map +1 -0
  381. package/lib-es/js-broadcast.js +33 -0
  382. package/lib-es/js-broadcast.js.map +1 -0
  383. package/lib-es/js-buildTransaction.d.ts +5 -0
  384. package/lib-es/js-buildTransaction.d.ts.map +1 -0
  385. package/lib-es/js-buildTransaction.js +63 -0
  386. package/lib-es/js-buildTransaction.js.map +1 -0
  387. package/lib-es/js-createTransaction.d.ts +5 -0
  388. package/lib-es/js-createTransaction.d.ts.map +1 -0
  389. package/lib-es/js-createTransaction.js +17 -0
  390. package/lib-es/js-createTransaction.js.map +1 -0
  391. package/lib-es/js-estimateMaxSpendable.d.ts +11 -0
  392. package/lib-es/js-estimateMaxSpendable.d.ts.map +1 -0
  393. package/lib-es/js-estimateMaxSpendable.js +55 -0
  394. package/lib-es/js-estimateMaxSpendable.js.map +1 -0
  395. package/lib-es/js-getTransactionStatus.d.ts +5 -0
  396. package/lib-es/js-getTransactionStatus.d.ts.map +1 -0
  397. package/lib-es/js-getTransactionStatus.js +69 -0
  398. package/lib-es/js-getTransactionStatus.js.map +1 -0
  399. package/lib-es/js-preload-data.d.ts +7 -0
  400. package/lib-es/js-preload-data.d.ts.map +1 -0
  401. package/lib-es/js-preload-data.js +39 -0
  402. package/lib-es/js-preload-data.js.map +1 -0
  403. package/lib-es/js-preload.d.ts +7 -0
  404. package/lib-es/js-preload.d.ts.map +1 -0
  405. package/lib-es/js-preload.js +62 -0
  406. package/lib-es/js-preload.js.map +1 -0
  407. package/lib-es/js-preload.test.d.ts +2 -0
  408. package/lib-es/js-preload.test.d.ts.map +1 -0
  409. package/lib-es/js-preload.test.js +7 -0
  410. package/lib-es/js-preload.test.js.map +1 -0
  411. package/lib-es/js-prepareTransaction.d.ts +5 -0
  412. package/lib-es/js-prepareTransaction.d.ts.map +1 -0
  413. package/lib-es/js-prepareTransaction.js +497 -0
  414. package/lib-es/js-prepareTransaction.js.map +1 -0
  415. package/lib-es/js-signOperation.d.ts +7 -0
  416. package/lib-es/js-signOperation.d.ts.map +1 -0
  417. package/lib-es/js-signOperation.js +146 -0
  418. package/lib-es/js-signOperation.js.map +1 -0
  419. package/lib-es/js-synchronization.d.ts +5 -0
  420. package/lib-es/js-synchronization.d.ts.map +1 -0
  421. package/lib-es/js-synchronization.js +457 -0
  422. package/lib-es/js-synchronization.js.map +1 -0
  423. package/lib-es/logic.d.ts +29 -0
  424. package/lib-es/logic.d.ts.map +1 -0
  425. package/lib-es/logic.js +87 -0
  426. package/lib-es/logic.js.map +1 -0
  427. package/lib-es/serialization.d.ts +9 -0
  428. package/lib-es/serialization.d.ts.map +1 -0
  429. package/lib-es/serialization.js +60 -0
  430. package/lib-es/serialization.js.map +1 -0
  431. package/lib-es/signer.d.ts +11 -0
  432. package/lib-es/signer.d.ts.map +1 -0
  433. package/lib-es/signer.js +2 -0
  434. package/lib-es/signer.js.map +1 -0
  435. package/lib-es/specs.d.ts +7 -0
  436. package/lib-es/specs.d.ts.map +1 -0
  437. package/lib-es/specs.js +404 -0
  438. package/lib-es/specs.js.map +1 -0
  439. package/lib-es/speculos-deviceActions.d.ts +8 -0
  440. package/lib-es/speculos-deviceActions.d.ts.map +1 -0
  441. package/lib-es/speculos-deviceActions.js +211 -0
  442. package/lib-es/speculos-deviceActions.js.map +1 -0
  443. package/lib-es/transaction.d.ts +15 -0
  444. package/lib-es/transaction.d.ts.map +1 -0
  445. package/lib-es/transaction.js +147 -0
  446. package/lib-es/transaction.js.map +1 -0
  447. package/lib-es/tx-fees.d.ts +4 -0
  448. package/lib-es/tx-fees.d.ts.map +1 -0
  449. package/lib-es/tx-fees.js +160 -0
  450. package/lib-es/tx-fees.js.map +1 -0
  451. package/lib-es/types.d.ts +222 -0
  452. package/lib-es/types.d.ts.map +1 -0
  453. package/lib-es/types.js +2 -0
  454. package/lib-es/types.js.map +1 -0
  455. package/lib-es/utils.d.ts +24 -0
  456. package/lib-es/utils.d.ts.map +1 -0
  457. package/lib-es/utils.js +157 -0
  458. package/lib-es/utils.js.map +1 -0
  459. package/lib-es/validator-app/index.d.ts +22 -0
  460. package/lib-es/validator-app/index.d.ts.map +1 -0
  461. package/lib-es/validator-app/index.js +55 -0
  462. package/lib-es/validator-app/index.js.map +1 -0
  463. package/package.json +89 -0
  464. package/src/api/cached.ts +87 -0
  465. package/src/api/chain/account/index.ts +1 -0
  466. package/src/api/chain/account/parser.ts +63 -0
  467. package/src/api/chain/account/stake.ts +45 -0
  468. package/src/api/chain/account/token.ts +63 -0
  469. package/src/api/chain/account/vote.ts +55 -0
  470. package/src/api/chain/index.ts +203 -0
  471. package/src/api/chain/instruction/associated-token-account/index.ts +33 -0
  472. package/src/api/chain/instruction/associated-token-account/types.ts +23 -0
  473. package/src/api/chain/instruction/memo/index.ts +24 -0
  474. package/src/api/chain/instruction/memo/types.ts +18 -0
  475. package/src/api/chain/instruction/stake/index.ts +29 -0
  476. package/src/api/chain/instruction/stake/types.ts +95 -0
  477. package/src/api/chain/instruction/system/index.ts +30 -0
  478. package/src/api/chain/instruction/system/types.ts +141 -0
  479. package/src/api/chain/instruction/token/index.ts +30 -0
  480. package/src/api/chain/instruction/token/types.ts +222 -0
  481. package/src/api/chain/program/constants.ts +10 -0
  482. package/src/api/chain/program/index.ts +1 -0
  483. package/src/api/chain/program/parser.ts +120 -0
  484. package/src/api/chain/validators/bignum.ts +7 -0
  485. package/src/api/chain/validators/index.ts +9 -0
  486. package/src/api/chain/validators/pubkey.ts +8 -0
  487. package/src/api/chain/web3.ts +399 -0
  488. package/src/api/index.ts +4 -0
  489. package/src/api/logged.ts +70 -0
  490. package/src/api/queued.ts +25 -0
  491. package/src/api/traced.ts +89 -0
  492. package/src/bridge/bridge.ts +195 -0
  493. package/src/bridge/js.ts +44 -0
  494. package/src/bridge.integration.test.ts +1106 -0
  495. package/src/cli-transaction.ts +246 -0
  496. package/src/datasets/solana.scanAccounts.1.ts +9 -0
  497. package/src/deviceTransactionConfig.ts +302 -0
  498. package/src/errors.ts +61 -0
  499. package/src/hw-getAddress.ts +26 -0
  500. package/src/js-broadcast.ts +38 -0
  501. package/src/js-buildTransaction.ts +81 -0
  502. package/src/js-createTransaction.ts +20 -0
  503. package/src/js-estimateMaxSpendable.ts +72 -0
  504. package/src/js-getTransactionStatus.ts +72 -0
  505. package/src/js-preload-data.ts +46 -0
  506. package/src/js-preload.test.ts +14 -0
  507. package/src/js-preload.ts +74 -0
  508. package/src/js-prepareTransaction.ts +686 -0
  509. package/src/js-signOperation.ts +329 -0
  510. package/src/js-synchronization.ts +729 -0
  511. package/src/logic.ts +123 -0
  512. package/src/serialization.ts +81 -0
  513. package/src/signer.ts +21 -0
  514. package/src/specs.ts +514 -0
  515. package/src/speculos-deviceActions.ts +229 -0
  516. package/src/transaction.ts +194 -0
  517. package/src/tx-fees.ts +206 -0
  518. package/src/types.ts +284 -0
  519. package/src/utils.ts +176 -0
  520. package/src/validator-app/index.ts +79 -0
  521. package/tsconfig.json +12 -0
package/.eslintrc.js ADDED
@@ -0,0 +1,20 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es6: true,
5
+ },
6
+ overrides: [
7
+ {
8
+ files: ["src/**/*.test.{ts,tsx}"],
9
+ env: {
10
+ "jest/globals": true,
11
+ },
12
+ plugins: ["jest"],
13
+ },
14
+ ],
15
+ rules: {
16
+ "no-console": ["error", { allow: ["warn", "error"] }],
17
+ "@typescript-eslint/no-empty-function": "off",
18
+ "@typescript-eslint/no-explicit-any": "warn",
19
+ },
20
+ };
@@ -0,0 +1,4 @@
1
+
2
+ > @ledgerhq/coin-solana@0.6.0 build /home/runner/work/ledger-live/ledger-live/libs/coin-modules/coin-solana
3
+ > tsc && tsc -m ES6 --outDir lib-es
4
+
@@ -0,0 +1,16 @@
1
+ {
2
+ "entry": [
3
+ "src/api/index.ts",
4
+ "src/bridge/js.ts",
5
+ "src/cli-transaction.ts",
6
+ "src/deviceTransactionConfig.ts",
7
+ "src/errors.ts",
8
+ "src/hw-getAddress.ts",
9
+ "src/serialization.ts",
10
+ "src/specs.ts",
11
+ "src/transaction.ts"
12
+ ],
13
+ "ignorePatterns": ["**/node_modules/**", "**/*.fixture.ts", "**/*.mock.ts", "**/*.test.{js,jsx,ts,tsx}"],
14
+ "ignoreUnresolved": [],
15
+ "ignoreUnimported": ["src/datasets/solana.scanAccounts.1.ts"]
16
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # @ledgerhq/coin-solana
2
+
3
+ ## 0.7.0-nightly.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#6721](https://github.com/LedgerHQ/ledger-live/pull/6721) [`1cee8ff`](https://github.com/LedgerHQ/ledger-live/commit/1cee8ff557fdd6e44f55d4d396805e02c2733cc1) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Solana as a coin module
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`a115d6c`](https://github.com/LedgerHQ/ledger-live/commit/a115d6cd5dcbcc753d02dedb80f5eb1693d1a249)]:
12
+ - @ledgerhq/types-live@6.47.0-nightly.3
13
+ - @ledgerhq/coin-framework@0.12.1-nightly.4
package/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2017-present Ledger https://www.ledger.com/
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/jest.config.js ADDED
@@ -0,0 +1,9 @@
1
+ /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2
+ module.exports = {
3
+ preset: 'ts-jest',
4
+ testEnvironment: 'node',
5
+ testPathIgnorePatterns: [
6
+ "lib/",
7
+ "lib-es/"
8
+ ]
9
+ };
@@ -0,0 +1,3 @@
1
+ import { ChainAPI } from "./chain";
2
+ export declare function cached(api: ChainAPI): ChainAPI;
3
+ //# sourceMappingURL=cached.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cached.d.ts","sourceRoot":"","sources":["../../src/api/cached.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAWnC,wBAAgB,MAAM,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAyE9C"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.cached = void 0;
7
+ const cache_1 = require("@ledgerhq/live-network/cache");
8
+ const object_hash_1 = __importDefault(require("object-hash"));
9
+ const cacheKeyAddress = (address) => address;
10
+ const cacheKeyEmpty = () => "";
11
+ const cacheKeyAssocTokenAccAddress = (owner, mint) => `${owner}:${mint}`;
12
+ const cacheKeyMinimumBalanceForRentExemption = (dataLengt) => dataLengt.toString();
13
+ const cacheKeyTransactions = (signatures) => (0, object_hash_1.default)([...signatures].sort());
14
+ const cacheKeyByArgs = (...args) => (0, object_hash_1.default)(args);
15
+ function cached(api) {
16
+ return {
17
+ findAssocTokenAccAddress: (0, cache_1.makeLRUCache)(api.findAssocTokenAccAddress, cacheKeyAssocTokenAccAddress, (0, cache_1.minutes)(1000)),
18
+ getAccountInfo: (0, cache_1.makeLRUCache)(api.getAccountInfo, cacheKeyAddress, (0, cache_1.seconds)(30)),
19
+ getAssocTokenAccMinNativeBalance: (0, cache_1.makeLRUCache)(api.getAssocTokenAccMinNativeBalance, cacheKeyEmpty, (0, cache_1.minutes)(5)),
20
+ getBalance: (0, cache_1.makeLRUCache)(api.getBalance, cacheKeyAddress, (0, cache_1.seconds)(30)),
21
+ getBalanceAndContext: (0, cache_1.makeLRUCache)(api.getBalanceAndContext, cacheKeyAddress, (0, cache_1.seconds)(30)),
22
+ getParsedTransactions: (0, cache_1.makeLRUCache)(api.getParsedTransactions, cacheKeyTransactions, (0, cache_1.seconds)(30)),
23
+ getParsedTokenAccountsByOwner: (0, cache_1.makeLRUCache)(api.getParsedTokenAccountsByOwner, cacheKeyAddress, (0, cache_1.minutes)(1)),
24
+ getStakeAccountsByStakeAuth: (0, cache_1.makeLRUCache)(api.getStakeAccountsByStakeAuth, cacheKeyAddress, (0, cache_1.minutes)(1)),
25
+ getStakeAccountsByWithdrawAuth: (0, cache_1.makeLRUCache)(api.getStakeAccountsByWithdrawAuth, cacheKeyAddress, (0, cache_1.minutes)(1)),
26
+ getStakeActivation: (0, cache_1.makeLRUCache)(api.getStakeActivation, cacheKeyAddress, (0, cache_1.minutes)(1)),
27
+ getInflationReward: (0, cache_1.makeLRUCache)(api.getInflationReward, cacheKeyByArgs, (0, cache_1.minutes)(5)),
28
+ getVoteAccounts: (0, cache_1.makeLRUCache)(api.getVoteAccounts, cacheKeyEmpty, (0, cache_1.minutes)(1)),
29
+ getLatestBlockhash: (0, cache_1.makeLRUCache)(api.getLatestBlockhash, cacheKeyEmpty, (0, cache_1.seconds)(15)),
30
+ getFeeForMessage: (0, cache_1.makeLRUCache)(api.getFeeForMessage, msg => msg.serialize().toString(), (0, cache_1.minutes)(1)),
31
+ getSignaturesForAddress: (0, cache_1.makeLRUCache)(api.getSignaturesForAddress, cacheKeyByArgs, (0, cache_1.seconds)(30)),
32
+ getMinimumBalanceForRentExemption: (0, cache_1.makeLRUCache)(api.getMinimumBalanceForRentExemption, cacheKeyMinimumBalanceForRentExemption, (0, cache_1.minutes)(5)),
33
+ // do not cache
34
+ sendRawTransaction: api.sendRawTransaction,
35
+ getEpochInfo: (0, cache_1.makeLRUCache)(api.getEpochInfo, cacheKeyEmpty, (0, cache_1.minutes)(1)),
36
+ config: api.config,
37
+ };
38
+ }
39
+ exports.cached = cached;
40
+ //# sourceMappingURL=cached.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cached.js","sourceRoot":"","sources":["../../src/api/cached.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA8E;AAC9E,8DAA+B;AAG/B,MAAM,eAAe,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC;AACrD,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,EAAW,CAAC;AACxC,MAAM,4BAA4B,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,IAAI,EAAE,CAAC;AACzF,MAAM,sCAAsC,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;AAE3F,MAAM,oBAAoB,GAAG,CAAC,UAAoB,EAAE,EAAE,CAAC,IAAA,qBAAI,EAAC,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAEpF,MAAM,cAAc,GAAG,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,IAAA,qBAAI,EAAC,IAAI,CAAC,CAAC;AAEtD,SAAgB,MAAM,CAAC,GAAa;IAClC,OAAO;QACL,wBAAwB,EAAE,IAAA,oBAAY,EACpC,GAAG,CAAC,wBAAwB,EAC5B,4BAA4B,EAC5B,IAAA,eAAO,EAAC,IAAI,CAAC,CACd;QAED,cAAc,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,cAAc,EAAE,eAAe,EAAE,IAAA,eAAO,EAAC,EAAE,CAAC,CAAC;QAE9E,gCAAgC,EAAE,IAAA,oBAAY,EAC5C,GAAG,CAAC,gCAAgC,EACpC,aAAa,EACb,IAAA,eAAO,EAAC,CAAC,CAAC,CACX;QAED,UAAU,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,IAAA,eAAO,EAAC,EAAE,CAAC,CAAC;QAEtE,oBAAoB,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,oBAAoB,EAAE,eAAe,EAAE,IAAA,eAAO,EAAC,EAAE,CAAC,CAAC;QAE1F,qBAAqB,EAAE,IAAA,oBAAY,EACjC,GAAG,CAAC,qBAAqB,EACzB,oBAAoB,EACpB,IAAA,eAAO,EAAC,EAAE,CAAC,CACZ;QAED,6BAA6B,EAAE,IAAA,oBAAY,EACzC,GAAG,CAAC,6BAA6B,EACjC,eAAe,EACf,IAAA,eAAO,EAAC,CAAC,CAAC,CACX;QAED,2BAA2B,EAAE,IAAA,oBAAY,EACvC,GAAG,CAAC,2BAA2B,EAC/B,eAAe,EACf,IAAA,eAAO,EAAC,CAAC,CAAC,CACX;QAED,8BAA8B,EAAE,IAAA,oBAAY,EAC1C,GAAG,CAAC,8BAA8B,EAClC,eAAe,EACf,IAAA,eAAO,EAAC,CAAC,CAAC,CACX;QAED,kBAAkB,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,kBAAkB,EAAE,eAAe,EAAE,IAAA,eAAO,EAAC,CAAC,CAAC,CAAC;QAErF,kBAAkB,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,kBAAkB,EAAE,cAAc,EAAE,IAAA,eAAO,EAAC,CAAC,CAAC,CAAC;QAEpF,eAAe,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,eAAe,EAAE,aAAa,EAAE,IAAA,eAAO,EAAC,CAAC,CAAC,CAAC;QAE7E,kBAAkB,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,kBAAkB,EAAE,aAAa,EAAE,IAAA,eAAO,EAAC,EAAE,CAAC,CAAC;QAEpF,gBAAgB,EAAE,IAAA,oBAAY,EAC5B,GAAG,CAAC,gBAAgB,EACpB,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,EACjC,IAAA,eAAO,EAAC,CAAC,CAAC,CACX;QAED,uBAAuB,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,uBAAuB,EAAE,cAAc,EAAE,IAAA,eAAO,EAAC,EAAE,CAAC,CAAC;QAE/F,iCAAiC,EAAE,IAAA,oBAAY,EAC7C,GAAG,CAAC,iCAAiC,EACrC,sCAAsC,EACtC,IAAA,eAAO,EAAC,CAAC,CAAC,CACX;QAED,eAAe;QACf,kBAAkB,EAAE,GAAG,CAAC,kBAAkB;QAE1C,YAAY,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,IAAA,eAAO,EAAC,CAAC,CAAC,CAAC;QAEvE,MAAM,EAAE,GAAG,CAAC,MAAM;KACnB,CAAC;AACJ,CAAC;AAzED,wBAyEC"}
@@ -0,0 +1,2 @@
1
+ export { tryParseAsTokenAccount, parseTokenAccountInfo, tryParseAsVoteAccount } from "./parser";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tryParseAsVoteAccount = exports.parseTokenAccountInfo = exports.tryParseAsTokenAccount = void 0;
4
+ var parser_1 = require("./parser");
5
+ Object.defineProperty(exports, "tryParseAsTokenAccount", { enumerable: true, get: function () { return parser_1.tryParseAsTokenAccount; } });
6
+ Object.defineProperty(exports, "parseTokenAccountInfo", { enumerable: true, get: function () { return parser_1.parseTokenAccountInfo; } });
7
+ Object.defineProperty(exports, "tryParseAsVoteAccount", { enumerable: true, get: function () { return parser_1.tryParseAsVoteAccount; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/chain/account/index.ts"],"names":[],"mappings":";;;AAAA,mCAAgG;AAAvF,gHAAA,sBAAsB,OAAA;AAAE,+GAAA,qBAAqB,OAAA;AAAE,+GAAA,qBAAqB,OAAA"}
@@ -0,0 +1,10 @@
1
+ import { ParsedAccountData } from "@solana/web3.js";
2
+ import { StakeAccountInfo } from "./stake";
3
+ import { TokenAccountInfo } from "./token";
4
+ import { VoteAccountInfo } from "./vote";
5
+ export declare function parseTokenAccountInfo(info: unknown): TokenAccountInfo;
6
+ export declare function tryParseAsTokenAccount(data: ParsedAccountData): TokenAccountInfo | undefined | Error;
7
+ export declare function parseVoteAccountInfo(info: unknown): VoteAccountInfo;
8
+ export declare function tryParseAsVoteAccount(data: ParsedAccountData): VoteAccountInfo | undefined | Error;
9
+ export declare function parseStakeAccountInfo(info: unknown): StakeAccountInfo;
10
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/account/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAgB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAe,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEtD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,gBAAgB,CAErE;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,iBAAiB,GACtB,gBAAgB,GAAG,SAAS,GAAG,KAAK,CAetC;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,CAEnE;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,iBAAiB,GACtB,eAAe,GAAG,SAAS,GAAG,KAAK,CAarC;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,gBAAgB,CAErE"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseStakeAccountInfo = exports.tryParseAsVoteAccount = exports.parseVoteAccountInfo = exports.tryParseAsTokenAccount = exports.parseTokenAccountInfo = void 0;
4
+ const superstruct_1 = require("superstruct");
5
+ const constants_1 = require("../program/constants");
6
+ const validators_1 = require("../validators");
7
+ const stake_1 = require("./stake");
8
+ const token_1 = require("./token");
9
+ const vote_1 = require("./vote");
10
+ function parseTokenAccountInfo(info) {
11
+ return (0, superstruct_1.create)(info, token_1.TokenAccountInfo);
12
+ }
13
+ exports.parseTokenAccountInfo = parseTokenAccountInfo;
14
+ function tryParseAsTokenAccount(data) {
15
+ const routine = () => {
16
+ const info = (0, superstruct_1.create)(data.parsed, validators_1.ParsedInfo);
17
+ if (data.program === "spl-token") {
18
+ const parsed = (0, superstruct_1.create)(info, token_1.TokenAccount);
19
+ if (parsed.type === "account") {
20
+ return parseTokenAccountInfo(parsed.info);
21
+ }
22
+ }
23
+ return undefined;
24
+ };
25
+ return onThrowReturnError(routine);
26
+ }
27
+ exports.tryParseAsTokenAccount = tryParseAsTokenAccount;
28
+ function parseVoteAccountInfo(info) {
29
+ return (0, superstruct_1.create)(info, vote_1.VoteAccountInfo);
30
+ }
31
+ exports.parseVoteAccountInfo = parseVoteAccountInfo;
32
+ function tryParseAsVoteAccount(data) {
33
+ const routine = () => {
34
+ const info = (0, superstruct_1.create)(data.parsed, validators_1.ParsedInfo);
35
+ if (data.program === constants_1.PARSED_PROGRAMS.VOTE) {
36
+ const parsed = (0, superstruct_1.create)(info, vote_1.VoteAccount);
37
+ return parseVoteAccountInfo(parsed.info);
38
+ }
39
+ return undefined;
40
+ };
41
+ return onThrowReturnError(routine);
42
+ }
43
+ exports.tryParseAsVoteAccount = tryParseAsVoteAccount;
44
+ function parseStakeAccountInfo(info) {
45
+ return (0, superstruct_1.create)(info, stake_1.StakeAccountInfo);
46
+ }
47
+ exports.parseStakeAccountInfo = parseStakeAccountInfo;
48
+ function onThrowReturnError(fn) {
49
+ try {
50
+ return fn();
51
+ }
52
+ catch (e) {
53
+ return e instanceof Error ? e : new Error(JSON.stringify(e));
54
+ }
55
+ }
56
+ //# sourceMappingURL=parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/api/chain/account/parser.ts"],"names":[],"mappings":";;;AACA,6CAAqC;AACrC,oDAAuD;AACvD,8CAA2C;AAC3C,mCAA2C;AAC3C,mCAAyD;AACzD,iCAAsD;AAEtD,SAAgB,qBAAqB,CAAC,IAAa;IACjD,OAAO,IAAA,oBAAM,EAAC,IAAI,EAAE,wBAAgB,CAAC,CAAC;AACxC,CAAC;AAFD,sDAEC;AAED,SAAgB,sBAAsB,CACpC,IAAuB;IAEvB,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,MAAM,IAAI,GAAG,IAAA,oBAAM,EAAC,IAAI,CAAC,MAAM,EAAE,uBAAU,CAAC,CAAC;QAE7C,IAAI,IAAI,CAAC,OAAO,KAAK,WAAW,EAAE;YAChC,MAAM,MAAM,GAAG,IAAA,oBAAM,EAAC,IAAI,EAAE,oBAAY,CAAC,CAAC;YAC1C,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE;gBAC7B,OAAO,qBAAqB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAC3C;SACF;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAjBD,wDAiBC;AAED,SAAgB,oBAAoB,CAAC,IAAa;IAChD,OAAO,IAAA,oBAAM,EAAC,IAAI,EAAE,sBAAe,CAAC,CAAC;AACvC,CAAC;AAFD,oDAEC;AAED,SAAgB,qBAAqB,CACnC,IAAuB;IAEvB,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,MAAM,IAAI,GAAG,IAAA,oBAAM,EAAC,IAAI,CAAC,MAAM,EAAE,uBAAU,CAAC,CAAC;QAE7C,IAAI,IAAI,CAAC,OAAO,KAAK,2BAAe,CAAC,IAAI,EAAE;YACzC,MAAM,MAAM,GAAG,IAAA,oBAAM,EAAC,IAAI,EAAE,kBAAW,CAAC,CAAC;YACzC,OAAO,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC1C;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAfD,sDAeC;AAED,SAAgB,qBAAqB,CAAC,IAAa;IACjD,OAAO,IAAA,oBAAM,EAAC,IAAI,EAAE,wBAAgB,CAAC,CAAC;AACxC,CAAC;AAFD,sDAEC;AAED,SAAS,kBAAkB,CAAI,EAAW;IACxC,IAAI;QACF,OAAO,EAAE,EAAE,CAAC;KACb;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;KAC9D;AACH,CAAC"}
@@ -0,0 +1,237 @@
1
+ /// <reference types="@solana/web3.js" />
2
+ import { Infer } from "superstruct";
3
+ export type StakeAccountType = Infer<typeof StakeAccountType>;
4
+ export declare const StakeAccountType: import("superstruct").Struct<"uninitialized" | "initialized" | "delegated" | "rewardsPool", {
5
+ uninitialized: "uninitialized";
6
+ initialized: "initialized";
7
+ delegated: "delegated";
8
+ rewardsPool: "rewardsPool";
9
+ }>;
10
+ export type StakeMeta = Infer<typeof StakeMeta>;
11
+ export declare const StakeMeta: import("superstruct").Struct<{
12
+ rentExemptReserve: import("bignumber.js").BigNumber;
13
+ authorized: {
14
+ staker: import("@solana/web3.js").PublicKey;
15
+ withdrawer: import("@solana/web3.js").PublicKey;
16
+ };
17
+ lockup: {
18
+ unixTimestamp: number;
19
+ epoch: number;
20
+ custodian: import("@solana/web3.js").PublicKey;
21
+ };
22
+ }, {
23
+ rentExemptReserve: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
24
+ authorized: import("superstruct").Struct<{
25
+ staker: import("@solana/web3.js").PublicKey;
26
+ withdrawer: import("@solana/web3.js").PublicKey;
27
+ }, {
28
+ staker: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
29
+ withdrawer: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
30
+ }>;
31
+ lockup: import("superstruct").Struct<{
32
+ unixTimestamp: number;
33
+ epoch: number;
34
+ custodian: import("@solana/web3.js").PublicKey;
35
+ }, {
36
+ unixTimestamp: import("superstruct").Struct<number, null>;
37
+ epoch: import("superstruct").Struct<number, null>;
38
+ custodian: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
39
+ }>;
40
+ }>;
41
+ export type StakeAccountInfo = Infer<typeof StakeAccountInfo>;
42
+ export declare const StakeAccountInfo: import("superstruct").Struct<{
43
+ meta: {
44
+ rentExemptReserve: import("bignumber.js").BigNumber;
45
+ authorized: {
46
+ staker: import("@solana/web3.js").PublicKey;
47
+ withdrawer: import("@solana/web3.js").PublicKey;
48
+ };
49
+ lockup: {
50
+ unixTimestamp: number;
51
+ epoch: number;
52
+ custodian: import("@solana/web3.js").PublicKey;
53
+ };
54
+ };
55
+ stake: {
56
+ delegation: {
57
+ stake: import("bignumber.js").BigNumber;
58
+ voter: import("@solana/web3.js").PublicKey;
59
+ activationEpoch: import("bignumber.js").BigNumber;
60
+ deactivationEpoch: import("bignumber.js").BigNumber;
61
+ warmupCooldownRate: number;
62
+ };
63
+ creditsObserved: number;
64
+ } | null;
65
+ }, {
66
+ meta: import("superstruct").Struct<{
67
+ rentExemptReserve: import("bignumber.js").BigNumber;
68
+ authorized: {
69
+ staker: import("@solana/web3.js").PublicKey;
70
+ withdrawer: import("@solana/web3.js").PublicKey;
71
+ };
72
+ lockup: {
73
+ unixTimestamp: number;
74
+ epoch: number;
75
+ custodian: import("@solana/web3.js").PublicKey;
76
+ };
77
+ }, {
78
+ rentExemptReserve: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
79
+ authorized: import("superstruct").Struct<{
80
+ staker: import("@solana/web3.js").PublicKey;
81
+ withdrawer: import("@solana/web3.js").PublicKey;
82
+ }, {
83
+ staker: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
84
+ withdrawer: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
85
+ }>;
86
+ lockup: import("superstruct").Struct<{
87
+ unixTimestamp: number;
88
+ epoch: number;
89
+ custodian: import("@solana/web3.js").PublicKey;
90
+ }, {
91
+ unixTimestamp: import("superstruct").Struct<number, null>;
92
+ epoch: import("superstruct").Struct<number, null>;
93
+ custodian: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
94
+ }>;
95
+ }>;
96
+ stake: import("superstruct").Struct<{
97
+ delegation: {
98
+ stake: import("bignumber.js").BigNumber;
99
+ voter: import("@solana/web3.js").PublicKey;
100
+ activationEpoch: import("bignumber.js").BigNumber;
101
+ deactivationEpoch: import("bignumber.js").BigNumber;
102
+ warmupCooldownRate: number;
103
+ };
104
+ creditsObserved: number;
105
+ } | null, {
106
+ delegation: import("superstruct").Struct<{
107
+ stake: import("bignumber.js").BigNumber;
108
+ voter: import("@solana/web3.js").PublicKey;
109
+ activationEpoch: import("bignumber.js").BigNumber;
110
+ deactivationEpoch: import("bignumber.js").BigNumber;
111
+ warmupCooldownRate: number;
112
+ }, {
113
+ voter: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
114
+ stake: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
115
+ activationEpoch: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
116
+ deactivationEpoch: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
117
+ warmupCooldownRate: import("superstruct").Struct<number, null>;
118
+ }>;
119
+ creditsObserved: import("superstruct").Struct<number, null>;
120
+ }>;
121
+ }>;
122
+ export type StakeAccount = Infer<typeof StakeAccount>;
123
+ export declare const StakeAccount: import("superstruct").Struct<{
124
+ type: "uninitialized" | "initialized" | "delegated" | "rewardsPool";
125
+ info: {
126
+ meta: {
127
+ rentExemptReserve: import("bignumber.js").BigNumber;
128
+ authorized: {
129
+ staker: import("@solana/web3.js").PublicKey;
130
+ withdrawer: import("@solana/web3.js").PublicKey;
131
+ };
132
+ lockup: {
133
+ unixTimestamp: number;
134
+ epoch: number;
135
+ custodian: import("@solana/web3.js").PublicKey;
136
+ };
137
+ };
138
+ stake: {
139
+ delegation: {
140
+ stake: import("bignumber.js").BigNumber;
141
+ voter: import("@solana/web3.js").PublicKey;
142
+ activationEpoch: import("bignumber.js").BigNumber;
143
+ deactivationEpoch: import("bignumber.js").BigNumber;
144
+ warmupCooldownRate: number;
145
+ };
146
+ creditsObserved: number;
147
+ } | null;
148
+ };
149
+ }, {
150
+ type: import("superstruct").Struct<"uninitialized" | "initialized" | "delegated" | "rewardsPool", {
151
+ uninitialized: "uninitialized";
152
+ initialized: "initialized";
153
+ delegated: "delegated";
154
+ rewardsPool: "rewardsPool";
155
+ }>;
156
+ info: import("superstruct").Struct<{
157
+ meta: {
158
+ rentExemptReserve: import("bignumber.js").BigNumber;
159
+ authorized: {
160
+ staker: import("@solana/web3.js").PublicKey;
161
+ withdrawer: import("@solana/web3.js").PublicKey;
162
+ };
163
+ lockup: {
164
+ unixTimestamp: number;
165
+ epoch: number;
166
+ custodian: import("@solana/web3.js").PublicKey;
167
+ };
168
+ };
169
+ stake: {
170
+ delegation: {
171
+ stake: import("bignumber.js").BigNumber;
172
+ voter: import("@solana/web3.js").PublicKey;
173
+ activationEpoch: import("bignumber.js").BigNumber;
174
+ deactivationEpoch: import("bignumber.js").BigNumber;
175
+ warmupCooldownRate: number;
176
+ };
177
+ creditsObserved: number;
178
+ } | null;
179
+ }, {
180
+ meta: import("superstruct").Struct<{
181
+ rentExemptReserve: import("bignumber.js").BigNumber;
182
+ authorized: {
183
+ staker: import("@solana/web3.js").PublicKey;
184
+ withdrawer: import("@solana/web3.js").PublicKey;
185
+ };
186
+ lockup: {
187
+ unixTimestamp: number;
188
+ epoch: number;
189
+ custodian: import("@solana/web3.js").PublicKey;
190
+ };
191
+ }, {
192
+ rentExemptReserve: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
193
+ authorized: import("superstruct").Struct<{
194
+ staker: import("@solana/web3.js").PublicKey;
195
+ withdrawer: import("@solana/web3.js").PublicKey;
196
+ }, {
197
+ staker: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
198
+ withdrawer: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
199
+ }>;
200
+ lockup: import("superstruct").Struct<{
201
+ unixTimestamp: number;
202
+ epoch: number;
203
+ custodian: import("@solana/web3.js").PublicKey;
204
+ }, {
205
+ unixTimestamp: import("superstruct").Struct<number, null>;
206
+ epoch: import("superstruct").Struct<number, null>;
207
+ custodian: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
208
+ }>;
209
+ }>;
210
+ stake: import("superstruct").Struct<{
211
+ delegation: {
212
+ stake: import("bignumber.js").BigNumber;
213
+ voter: import("@solana/web3.js").PublicKey;
214
+ activationEpoch: import("bignumber.js").BigNumber;
215
+ deactivationEpoch: import("bignumber.js").BigNumber;
216
+ warmupCooldownRate: number;
217
+ };
218
+ creditsObserved: number;
219
+ } | null, {
220
+ delegation: import("superstruct").Struct<{
221
+ stake: import("bignumber.js").BigNumber;
222
+ voter: import("@solana/web3.js").PublicKey;
223
+ activationEpoch: import("bignumber.js").BigNumber;
224
+ deactivationEpoch: import("bignumber.js").BigNumber;
225
+ warmupCooldownRate: number;
226
+ }, {
227
+ voter: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
228
+ stake: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
229
+ activationEpoch: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
230
+ deactivationEpoch: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
231
+ warmupCooldownRate: import("superstruct").Struct<number, null>;
232
+ }>;
233
+ creditsObserved: import("superstruct").Struct<number, null>;
234
+ }>;
235
+ }>;
236
+ }>;
237
+ //# sourceMappingURL=stake.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stake.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/account/stake.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAiC,MAAM,aAAa,CAAC;AAInE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9D,eAAO,MAAM,gBAAgB;;;;;EAAsE,CAAC;AAEpG,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAChD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWpB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc3B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACtD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvB,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-redeclare */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.StakeAccount = exports.StakeAccountInfo = exports.StakeMeta = exports.StakeAccountType = void 0;
5
+ const superstruct_1 = require("superstruct");
6
+ const pubkey_1 = require("../validators/pubkey");
7
+ const bignum_1 = require("../validators/bignum");
8
+ exports.StakeAccountType = (0, superstruct_1.enums)(["uninitialized", "initialized", "delegated", "rewardsPool"]);
9
+ exports.StakeMeta = (0, superstruct_1.type)({
10
+ rentExemptReserve: bignum_1.BigNumFromString,
11
+ authorized: (0, superstruct_1.type)({
12
+ staker: pubkey_1.PublicKeyFromString,
13
+ withdrawer: pubkey_1.PublicKeyFromString,
14
+ }),
15
+ lockup: (0, superstruct_1.type)({
16
+ unixTimestamp: (0, superstruct_1.number)(),
17
+ epoch: (0, superstruct_1.number)(),
18
+ custodian: pubkey_1.PublicKeyFromString,
19
+ }),
20
+ });
21
+ exports.StakeAccountInfo = (0, superstruct_1.type)({
22
+ meta: exports.StakeMeta,
23
+ stake: (0, superstruct_1.nullable)((0, superstruct_1.type)({
24
+ delegation: (0, superstruct_1.type)({
25
+ voter: pubkey_1.PublicKeyFromString,
26
+ stake: bignum_1.BigNumFromString,
27
+ activationEpoch: bignum_1.BigNumFromString,
28
+ deactivationEpoch: bignum_1.BigNumFromString,
29
+ warmupCooldownRate: (0, superstruct_1.number)(),
30
+ }),
31
+ creditsObserved: (0, superstruct_1.number)(),
32
+ })),
33
+ });
34
+ exports.StakeAccount = (0, superstruct_1.type)({
35
+ type: exports.StakeAccountType,
36
+ info: exports.StakeAccountInfo,
37
+ });
38
+ //# sourceMappingURL=stake.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stake.js","sourceRoot":"","sources":["../../../../src/api/chain/account/stake.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,6CAAmE;AACnE,iDAA2D;AAC3D,iDAAwD;AAG3C,QAAA,gBAAgB,GAAG,IAAA,mBAAK,EAAC,CAAC,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;AAGvF,QAAA,SAAS,GAAG,IAAA,kBAAI,EAAC;IAC5B,iBAAiB,EAAE,yBAAgB;IACnC,UAAU,EAAE,IAAA,kBAAI,EAAC;QACf,MAAM,EAAE,4BAAmB;QAC3B,UAAU,EAAE,4BAAmB;KAChC,CAAC;IACF,MAAM,EAAE,IAAA,kBAAI,EAAC;QACX,aAAa,EAAE,IAAA,oBAAM,GAAE;QACvB,KAAK,EAAE,IAAA,oBAAM,GAAE;QACf,SAAS,EAAE,4BAAmB;KAC/B,CAAC;CACH,CAAC,CAAC;AAGU,QAAA,gBAAgB,GAAG,IAAA,kBAAI,EAAC;IACnC,IAAI,EAAE,iBAAS;IACf,KAAK,EAAE,IAAA,sBAAQ,EACb,IAAA,kBAAI,EAAC;QACH,UAAU,EAAE,IAAA,kBAAI,EAAC;YACf,KAAK,EAAE,4BAAmB;YAC1B,KAAK,EAAE,yBAAgB;YACvB,eAAe,EAAE,yBAAgB;YACjC,iBAAiB,EAAE,yBAAgB;YACnC,kBAAkB,EAAE,IAAA,oBAAM,GAAE;SAC7B,CAAC;QACF,eAAe,EAAE,IAAA,oBAAM,GAAE;KAC1B,CAAC,CACH;CACF,CAAC,CAAC;AAGU,QAAA,YAAY,GAAG,IAAA,kBAAI,EAAC;IAC/B,IAAI,EAAE,wBAAgB;IACtB,IAAI,EAAE,wBAAgB;CACvB,CAAC,CAAC"}
@@ -0,0 +1,116 @@
1
+ /// <reference types="@solana/web3.js" />
2
+ import { Infer } from "superstruct";
3
+ export type TokenAccountType = Infer<typeof TokenAccountType>;
4
+ export declare const TokenAccountType: import("superstruct").Struct<"mint" | "account" | "multisig", {
5
+ mint: "mint";
6
+ account: "account";
7
+ multisig: "multisig";
8
+ }>;
9
+ export type TokenAccountState = Infer<typeof AccountState>;
10
+ declare const AccountState: import("superstruct").Struct<"uninitialized" | "initialized" | "frozen", {
11
+ uninitialized: "uninitialized";
12
+ initialized: "initialized";
13
+ frozen: "frozen";
14
+ }>;
15
+ export type TokenAccountInfo = Infer<typeof TokenAccountInfo>;
16
+ export declare const TokenAccountInfo: import("superstruct").Struct<{
17
+ mint: import("@solana/web3.js").PublicKey;
18
+ owner: import("@solana/web3.js").PublicKey;
19
+ tokenAmount: {
20
+ amount: string;
21
+ decimals: number;
22
+ uiAmountString: string;
23
+ };
24
+ state: "uninitialized" | "initialized" | "frozen";
25
+ isNative: boolean;
26
+ rentExemptReserve?: {
27
+ amount: string;
28
+ decimals: number;
29
+ uiAmountString: string;
30
+ } | undefined;
31
+ delegate?: import("@solana/web3.js").PublicKey | undefined;
32
+ delegatedAmount?: {
33
+ amount: string;
34
+ decimals: number;
35
+ uiAmountString: string;
36
+ } | undefined;
37
+ closeAuthority?: import("@solana/web3.js").PublicKey | undefined;
38
+ }, {
39
+ mint: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
40
+ owner: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
41
+ tokenAmount: import("superstruct").Struct<{
42
+ amount: string;
43
+ decimals: number;
44
+ uiAmountString: string;
45
+ }, {
46
+ decimals: import("superstruct").Struct<number, null>;
47
+ uiAmountString: import("superstruct").Struct<string, null>;
48
+ amount: import("superstruct").Struct<string, null>;
49
+ }>;
50
+ delegate: import("superstruct").Struct<import("@solana/web3.js").PublicKey | undefined, null>;
51
+ state: import("superstruct").Struct<"uninitialized" | "initialized" | "frozen", {
52
+ uninitialized: "uninitialized";
53
+ initialized: "initialized";
54
+ frozen: "frozen";
55
+ }>;
56
+ isNative: import("superstruct").Struct<boolean, null>;
57
+ rentExemptReserve: import("superstruct").Struct<{
58
+ amount: string;
59
+ decimals: number;
60
+ uiAmountString: string;
61
+ } | undefined, {
62
+ decimals: import("superstruct").Struct<number, null>;
63
+ uiAmountString: import("superstruct").Struct<string, null>;
64
+ amount: import("superstruct").Struct<string, null>;
65
+ }>;
66
+ delegatedAmount: import("superstruct").Struct<{
67
+ amount: string;
68
+ decimals: number;
69
+ uiAmountString: string;
70
+ } | undefined, {
71
+ decimals: import("superstruct").Struct<number, null>;
72
+ uiAmountString: import("superstruct").Struct<string, null>;
73
+ amount: import("superstruct").Struct<string, null>;
74
+ }>;
75
+ closeAuthority: import("superstruct").Struct<import("@solana/web3.js").PublicKey | undefined, null>;
76
+ }>;
77
+ export type MintAccountInfo = Infer<typeof MintAccountInfo>;
78
+ export declare const MintAccountInfo: import("superstruct").Struct<{
79
+ decimals: number;
80
+ mintAuthority: import("@solana/web3.js").PublicKey | null;
81
+ supply: string;
82
+ isInitialized: boolean;
83
+ freezeAuthority: import("@solana/web3.js").PublicKey | null;
84
+ }, {
85
+ mintAuthority: import("superstruct").Struct<import("@solana/web3.js").PublicKey | null, null>;
86
+ supply: import("superstruct").Struct<string, null>;
87
+ decimals: import("superstruct").Struct<number, null>;
88
+ isInitialized: import("superstruct").Struct<boolean, null>;
89
+ freezeAuthority: import("superstruct").Struct<import("@solana/web3.js").PublicKey | null, null>;
90
+ }>;
91
+ export type MultisigAccountInfo = Infer<typeof MultisigAccountInfo>;
92
+ export declare const MultisigAccountInfo: import("superstruct").Struct<{
93
+ isInitialized: boolean;
94
+ numRequiredSigners: number;
95
+ numValidSigners: number;
96
+ signers: import("@solana/web3.js").PublicKey[];
97
+ }, {
98
+ numRequiredSigners: import("superstruct").Struct<number, null>;
99
+ numValidSigners: import("superstruct").Struct<number, null>;
100
+ isInitialized: import("superstruct").Struct<boolean, null>;
101
+ signers: import("superstruct").Struct<import("@solana/web3.js").PublicKey[], import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>>;
102
+ }>;
103
+ export type TokenAccount = Infer<typeof TokenAccount>;
104
+ export declare const TokenAccount: import("superstruct").Struct<{
105
+ type: "mint" | "account" | "multisig";
106
+ info?: any;
107
+ }, {
108
+ type: import("superstruct").Struct<"mint" | "account" | "multisig", {
109
+ mint: "mint";
110
+ account: "account";
111
+ multisig: "multisig";
112
+ }>;
113
+ info: import("superstruct").Struct<any, null>;
114
+ }>;
115
+ export {};
116
+ //# sourceMappingURL=token.d.ts.map