@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/account/token.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,KAAK,EAUN,MAAM,aAAa,CAAC;AAGrB,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9D,eAAO,MAAM,gBAAgB;;;;EAAyC,CAAC;AAEvE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAC3D,QAAA,MAAM,YAAY;;;;EAAoD,CAAC;AAQvE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU3B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC5D,eAAO,MAAM,eAAe;;;;;;;;;;;;EAM1B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACpE,eAAO,MAAM,mBAAmB;;;;;;;;;;EAK9B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACtD,eAAO,MAAM,YAAY;;;;;;;;;;EAGvB,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-redeclare */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TokenAccount = exports.MultisigAccountInfo = exports.MintAccountInfo = exports.TokenAccountInfo = exports.TokenAccountType = void 0;
5
+ const superstruct_1 = require("superstruct");
6
+ const pubkey_1 = require("../validators/pubkey");
7
+ exports.TokenAccountType = (0, superstruct_1.enums)(["mint", "account", "multisig"]);
8
+ const AccountState = (0, superstruct_1.enums)(["initialized", "uninitialized", "frozen"]);
9
+ const TokenAmount = (0, superstruct_1.type)({
10
+ decimals: (0, superstruct_1.number)(),
11
+ uiAmountString: (0, superstruct_1.string)(),
12
+ amount: (0, superstruct_1.string)(),
13
+ });
14
+ exports.TokenAccountInfo = (0, superstruct_1.type)({
15
+ mint: pubkey_1.PublicKeyFromString,
16
+ owner: pubkey_1.PublicKeyFromString,
17
+ tokenAmount: TokenAmount,
18
+ delegate: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
19
+ state: AccountState,
20
+ isNative: (0, superstruct_1.boolean)(),
21
+ rentExemptReserve: (0, superstruct_1.optional)(TokenAmount),
22
+ delegatedAmount: (0, superstruct_1.optional)(TokenAmount),
23
+ closeAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
24
+ });
25
+ exports.MintAccountInfo = (0, superstruct_1.type)({
26
+ mintAuthority: (0, superstruct_1.nullable)(pubkey_1.PublicKeyFromString),
27
+ supply: (0, superstruct_1.string)(),
28
+ decimals: (0, superstruct_1.number)(),
29
+ isInitialized: (0, superstruct_1.boolean)(),
30
+ freezeAuthority: (0, superstruct_1.nullable)(pubkey_1.PublicKeyFromString),
31
+ });
32
+ exports.MultisigAccountInfo = (0, superstruct_1.type)({
33
+ numRequiredSigners: (0, superstruct_1.number)(),
34
+ numValidSigners: (0, superstruct_1.number)(),
35
+ isInitialized: (0, superstruct_1.boolean)(),
36
+ signers: (0, superstruct_1.array)(pubkey_1.PublicKeyFromString),
37
+ });
38
+ exports.TokenAccount = (0, superstruct_1.type)({
39
+ type: exports.TokenAccountType,
40
+ info: (0, superstruct_1.any)(),
41
+ });
42
+ //# sourceMappingURL=token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../src/api/chain/account/token.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,6CAWqB;AACrB,iDAA2D;AAG9C,QAAA,gBAAgB,GAAG,IAAA,mBAAK,EAAC,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAGvE,MAAM,YAAY,GAAG,IAAA,mBAAK,EAAC,CAAC,aAAa,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEvE,MAAM,WAAW,GAAG,IAAA,kBAAI,EAAC;IACvB,QAAQ,EAAE,IAAA,oBAAM,GAAE;IAClB,cAAc,EAAE,IAAA,oBAAM,GAAE;IACxB,MAAM,EAAE,IAAA,oBAAM,GAAE;CACjB,CAAC,CAAC;AAGU,QAAA,gBAAgB,GAAG,IAAA,kBAAI,EAAC;IACnC,IAAI,EAAE,4BAAmB;IACzB,KAAK,EAAE,4BAAmB;IAC1B,WAAW,EAAE,WAAW;IACxB,QAAQ,EAAE,IAAA,sBAAQ,EAAC,4BAAmB,CAAC;IACvC,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,IAAA,qBAAO,GAAE;IACnB,iBAAiB,EAAE,IAAA,sBAAQ,EAAC,WAAW,CAAC;IACxC,eAAe,EAAE,IAAA,sBAAQ,EAAC,WAAW,CAAC;IACtC,cAAc,EAAE,IAAA,sBAAQ,EAAC,4BAAmB,CAAC;CAC9C,CAAC,CAAC;AAGU,QAAA,eAAe,GAAG,IAAA,kBAAI,EAAC;IAClC,aAAa,EAAE,IAAA,sBAAQ,EAAC,4BAAmB,CAAC;IAC5C,MAAM,EAAE,IAAA,oBAAM,GAAE;IAChB,QAAQ,EAAE,IAAA,oBAAM,GAAE;IAClB,aAAa,EAAE,IAAA,qBAAO,GAAE;IACxB,eAAe,EAAE,IAAA,sBAAQ,EAAC,4BAAmB,CAAC;CAC/C,CAAC,CAAC;AAGU,QAAA,mBAAmB,GAAG,IAAA,kBAAI,EAAC;IACtC,kBAAkB,EAAE,IAAA,oBAAM,GAAE;IAC5B,eAAe,EAAE,IAAA,oBAAM,GAAE;IACzB,aAAa,EAAE,IAAA,qBAAO,GAAE;IACxB,OAAO,EAAE,IAAA,mBAAK,EAAC,4BAAmB,CAAC;CACpC,CAAC,CAAC;AAGU,QAAA,YAAY,GAAG,IAAA,kBAAI,EAAC;IAC/B,IAAI,EAAE,wBAAgB;IACtB,IAAI,EAAE,IAAA,iBAAG,GAAE;CACZ,CAAC,CAAC"}
@@ -0,0 +1,252 @@
1
+ /// <reference types="@solana/web3.js" />
2
+ import { Infer } from "superstruct";
3
+ export type VoteAccountType = Infer<typeof VoteAccountType>;
4
+ export declare const VoteAccountType: import("superstruct").Struct<"vote", {
5
+ vote: "vote";
6
+ }>;
7
+ export type AuthorizedVoter = Infer<typeof AuthorizedVoter>;
8
+ export declare const AuthorizedVoter: import("superstruct").Struct<{
9
+ epoch: number;
10
+ authorizedVoter: import("@solana/web3.js").PublicKey;
11
+ }, {
12
+ authorizedVoter: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
13
+ epoch: import("superstruct").Struct<number, null>;
14
+ }>;
15
+ export type PriorVoter = Infer<typeof PriorVoter>;
16
+ export declare const PriorVoter: import("superstruct").Struct<{
17
+ authorizedPubkey: import("@solana/web3.js").PublicKey;
18
+ epochOfLastAuthorizedSwitch: number;
19
+ targetEpoch: number;
20
+ }, {
21
+ authorizedPubkey: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
22
+ epochOfLastAuthorizedSwitch: import("superstruct").Struct<number, null>;
23
+ targetEpoch: import("superstruct").Struct<number, null>;
24
+ }>;
25
+ export type EpochCredits = Infer<typeof EpochCredits>;
26
+ export declare const EpochCredits: import("superstruct").Struct<{
27
+ epoch: number;
28
+ credits: string;
29
+ previousCredits: string;
30
+ }, {
31
+ epoch: import("superstruct").Struct<number, null>;
32
+ credits: import("superstruct").Struct<string, null>;
33
+ previousCredits: import("superstruct").Struct<string, null>;
34
+ }>;
35
+ export type Vote = Infer<typeof Vote>;
36
+ export declare const Vote: import("superstruct").Struct<{
37
+ slot: number;
38
+ confirmationCount: number;
39
+ }, {
40
+ slot: import("superstruct").Struct<number, null>;
41
+ confirmationCount: import("superstruct").Struct<number, null>;
42
+ }>;
43
+ export type VoteAccountInfo = Infer<typeof VoteAccountInfo>;
44
+ export declare const VoteAccountInfo: import("superstruct").Struct<{
45
+ commission: number;
46
+ authorizedVoters: {
47
+ epoch: number;
48
+ authorizedVoter: import("@solana/web3.js").PublicKey;
49
+ }[];
50
+ authorizedWithdrawer: import("@solana/web3.js").PublicKey;
51
+ epochCredits: {
52
+ epoch: number;
53
+ credits: string;
54
+ previousCredits: string;
55
+ }[];
56
+ lastTimestamp: {
57
+ slot: number;
58
+ timestamp: number;
59
+ };
60
+ nodePubkey: import("@solana/web3.js").PublicKey;
61
+ priorVoters: {
62
+ authorizedPubkey: import("@solana/web3.js").PublicKey;
63
+ epochOfLastAuthorizedSwitch: number;
64
+ targetEpoch: number;
65
+ }[];
66
+ rootSlot: number | null;
67
+ votes: {
68
+ slot: number;
69
+ confirmationCount: number;
70
+ }[];
71
+ }, {
72
+ authorizedVoters: import("superstruct").Struct<{
73
+ epoch: number;
74
+ authorizedVoter: import("@solana/web3.js").PublicKey;
75
+ }[], import("superstruct").Struct<{
76
+ epoch: number;
77
+ authorizedVoter: import("@solana/web3.js").PublicKey;
78
+ }, {
79
+ authorizedVoter: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
80
+ epoch: import("superstruct").Struct<number, null>;
81
+ }>>;
82
+ authorizedWithdrawer: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
83
+ commission: import("superstruct").Struct<number, null>;
84
+ epochCredits: import("superstruct").Struct<{
85
+ epoch: number;
86
+ credits: string;
87
+ previousCredits: string;
88
+ }[], import("superstruct").Struct<{
89
+ epoch: number;
90
+ credits: string;
91
+ previousCredits: string;
92
+ }, {
93
+ epoch: import("superstruct").Struct<number, null>;
94
+ credits: import("superstruct").Struct<string, null>;
95
+ previousCredits: import("superstruct").Struct<string, null>;
96
+ }>>;
97
+ lastTimestamp: import("superstruct").Struct<{
98
+ slot: number;
99
+ timestamp: number;
100
+ }, {
101
+ slot: import("superstruct").Struct<number, null>;
102
+ timestamp: import("superstruct").Struct<number, null>;
103
+ }>;
104
+ nodePubkey: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
105
+ priorVoters: import("superstruct").Struct<{
106
+ authorizedPubkey: import("@solana/web3.js").PublicKey;
107
+ epochOfLastAuthorizedSwitch: number;
108
+ targetEpoch: number;
109
+ }[], import("superstruct").Struct<{
110
+ authorizedPubkey: import("@solana/web3.js").PublicKey;
111
+ epochOfLastAuthorizedSwitch: number;
112
+ targetEpoch: number;
113
+ }, {
114
+ authorizedPubkey: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
115
+ epochOfLastAuthorizedSwitch: import("superstruct").Struct<number, null>;
116
+ targetEpoch: import("superstruct").Struct<number, null>;
117
+ }>>;
118
+ rootSlot: import("superstruct").Struct<number | null, null>;
119
+ votes: import("superstruct").Struct<{
120
+ slot: number;
121
+ confirmationCount: number;
122
+ }[], import("superstruct").Struct<{
123
+ slot: number;
124
+ confirmationCount: number;
125
+ }, {
126
+ slot: import("superstruct").Struct<number, null>;
127
+ confirmationCount: import("superstruct").Struct<number, null>;
128
+ }>>;
129
+ }>;
130
+ export type VoteAccount = Infer<typeof VoteAccount>;
131
+ export declare const VoteAccount: import("superstruct").Struct<{
132
+ type: "vote";
133
+ info: {
134
+ commission: number;
135
+ authorizedVoters: {
136
+ epoch: number;
137
+ authorizedVoter: import("@solana/web3.js").PublicKey;
138
+ }[];
139
+ authorizedWithdrawer: import("@solana/web3.js").PublicKey;
140
+ epochCredits: {
141
+ epoch: number;
142
+ credits: string;
143
+ previousCredits: string;
144
+ }[];
145
+ lastTimestamp: {
146
+ slot: number;
147
+ timestamp: number;
148
+ };
149
+ nodePubkey: import("@solana/web3.js").PublicKey;
150
+ priorVoters: {
151
+ authorizedPubkey: import("@solana/web3.js").PublicKey;
152
+ epochOfLastAuthorizedSwitch: number;
153
+ targetEpoch: number;
154
+ }[];
155
+ rootSlot: number | null;
156
+ votes: {
157
+ slot: number;
158
+ confirmationCount: number;
159
+ }[];
160
+ };
161
+ }, {
162
+ type: import("superstruct").Struct<"vote", {
163
+ vote: "vote";
164
+ }>;
165
+ info: import("superstruct").Struct<{
166
+ commission: number;
167
+ authorizedVoters: {
168
+ epoch: number;
169
+ authorizedVoter: import("@solana/web3.js").PublicKey;
170
+ }[];
171
+ authorizedWithdrawer: import("@solana/web3.js").PublicKey;
172
+ epochCredits: {
173
+ epoch: number;
174
+ credits: string;
175
+ previousCredits: string;
176
+ }[];
177
+ lastTimestamp: {
178
+ slot: number;
179
+ timestamp: number;
180
+ };
181
+ nodePubkey: import("@solana/web3.js").PublicKey;
182
+ priorVoters: {
183
+ authorizedPubkey: import("@solana/web3.js").PublicKey;
184
+ epochOfLastAuthorizedSwitch: number;
185
+ targetEpoch: number;
186
+ }[];
187
+ rootSlot: number | null;
188
+ votes: {
189
+ slot: number;
190
+ confirmationCount: number;
191
+ }[];
192
+ }, {
193
+ authorizedVoters: import("superstruct").Struct<{
194
+ epoch: number;
195
+ authorizedVoter: import("@solana/web3.js").PublicKey;
196
+ }[], import("superstruct").Struct<{
197
+ epoch: number;
198
+ authorizedVoter: import("@solana/web3.js").PublicKey;
199
+ }, {
200
+ authorizedVoter: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
201
+ epoch: import("superstruct").Struct<number, null>;
202
+ }>>;
203
+ authorizedWithdrawer: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
204
+ commission: import("superstruct").Struct<number, null>;
205
+ epochCredits: import("superstruct").Struct<{
206
+ epoch: number;
207
+ credits: string;
208
+ previousCredits: string;
209
+ }[], import("superstruct").Struct<{
210
+ epoch: number;
211
+ credits: string;
212
+ previousCredits: string;
213
+ }, {
214
+ epoch: import("superstruct").Struct<number, null>;
215
+ credits: import("superstruct").Struct<string, null>;
216
+ previousCredits: import("superstruct").Struct<string, null>;
217
+ }>>;
218
+ lastTimestamp: import("superstruct").Struct<{
219
+ slot: number;
220
+ timestamp: number;
221
+ }, {
222
+ slot: import("superstruct").Struct<number, null>;
223
+ timestamp: import("superstruct").Struct<number, null>;
224
+ }>;
225
+ nodePubkey: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
226
+ priorVoters: import("superstruct").Struct<{
227
+ authorizedPubkey: import("@solana/web3.js").PublicKey;
228
+ epochOfLastAuthorizedSwitch: number;
229
+ targetEpoch: number;
230
+ }[], import("superstruct").Struct<{
231
+ authorizedPubkey: import("@solana/web3.js").PublicKey;
232
+ epochOfLastAuthorizedSwitch: number;
233
+ targetEpoch: number;
234
+ }, {
235
+ authorizedPubkey: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
236
+ epochOfLastAuthorizedSwitch: import("superstruct").Struct<number, null>;
237
+ targetEpoch: import("superstruct").Struct<number, null>;
238
+ }>>;
239
+ rootSlot: import("superstruct").Struct<number | null, null>;
240
+ votes: import("superstruct").Struct<{
241
+ slot: number;
242
+ confirmationCount: number;
243
+ }[], import("superstruct").Struct<{
244
+ slot: number;
245
+ confirmationCount: number;
246
+ }, {
247
+ slot: import("superstruct").Struct<number, null>;
248
+ confirmationCount: import("superstruct").Struct<number, null>;
249
+ }>>;
250
+ }>;
251
+ }>;
252
+ //# sourceMappingURL=vote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/account/vote.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAgD,MAAM,aAAa,CAAC;AAGlF,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC5D,eAAO,MAAM,eAAe;;EAAkB,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC5D,eAAO,MAAM,eAAe;;;;;;EAG1B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAClD,eAAO,MAAM,UAAU;;;;;;;;EAIrB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACtD,eAAO,MAAM,YAAY;;;;;;;;EAIvB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACtC,eAAO,MAAM,IAAI;;;;;;EAGf,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC5D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa1B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACpD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtB,CAAC"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-redeclare */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.VoteAccount = exports.VoteAccountInfo = exports.Vote = exports.EpochCredits = exports.PriorVoter = exports.AuthorizedVoter = exports.VoteAccountType = void 0;
5
+ const superstruct_1 = require("superstruct");
6
+ const pubkey_1 = require("../validators/pubkey");
7
+ exports.VoteAccountType = (0, superstruct_1.enums)(["vote"]);
8
+ exports.AuthorizedVoter = (0, superstruct_1.type)({
9
+ authorizedVoter: pubkey_1.PublicKeyFromString,
10
+ epoch: (0, superstruct_1.number)(),
11
+ });
12
+ exports.PriorVoter = (0, superstruct_1.type)({
13
+ authorizedPubkey: pubkey_1.PublicKeyFromString,
14
+ epochOfLastAuthorizedSwitch: (0, superstruct_1.number)(),
15
+ targetEpoch: (0, superstruct_1.number)(),
16
+ });
17
+ exports.EpochCredits = (0, superstruct_1.type)({
18
+ epoch: (0, superstruct_1.number)(),
19
+ credits: (0, superstruct_1.string)(),
20
+ previousCredits: (0, superstruct_1.string)(),
21
+ });
22
+ exports.Vote = (0, superstruct_1.type)({
23
+ slot: (0, superstruct_1.number)(),
24
+ confirmationCount: (0, superstruct_1.number)(),
25
+ });
26
+ exports.VoteAccountInfo = (0, superstruct_1.type)({
27
+ authorizedVoters: (0, superstruct_1.array)(exports.AuthorizedVoter),
28
+ authorizedWithdrawer: pubkey_1.PublicKeyFromString,
29
+ commission: (0, superstruct_1.number)(),
30
+ epochCredits: (0, superstruct_1.array)(exports.EpochCredits),
31
+ lastTimestamp: (0, superstruct_1.type)({
32
+ slot: (0, superstruct_1.number)(),
33
+ timestamp: (0, superstruct_1.number)(),
34
+ }),
35
+ nodePubkey: pubkey_1.PublicKeyFromString,
36
+ priorVoters: (0, superstruct_1.array)(exports.PriorVoter),
37
+ rootSlot: (0, superstruct_1.nullable)((0, superstruct_1.number)()),
38
+ votes: (0, superstruct_1.array)(exports.Vote),
39
+ });
40
+ exports.VoteAccount = (0, superstruct_1.type)({
41
+ type: exports.VoteAccountType,
42
+ info: exports.VoteAccountInfo,
43
+ });
44
+ //# sourceMappingURL=vote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vote.js","sourceRoot":"","sources":["../../../../src/api/chain/account/vote.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,6CAAkF;AAClF,iDAA2D;AAG9C,QAAA,eAAe,GAAG,IAAA,mBAAK,EAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAGlC,QAAA,eAAe,GAAG,IAAA,kBAAI,EAAC;IAClC,eAAe,EAAE,4BAAmB;IACpC,KAAK,EAAE,IAAA,oBAAM,GAAE;CAChB,CAAC,CAAC;AAGU,QAAA,UAAU,GAAG,IAAA,kBAAI,EAAC;IAC7B,gBAAgB,EAAE,4BAAmB;IACrC,2BAA2B,EAAE,IAAA,oBAAM,GAAE;IACrC,WAAW,EAAE,IAAA,oBAAM,GAAE;CACtB,CAAC,CAAC;AAGU,QAAA,YAAY,GAAG,IAAA,kBAAI,EAAC;IAC/B,KAAK,EAAE,IAAA,oBAAM,GAAE;IACf,OAAO,EAAE,IAAA,oBAAM,GAAE;IACjB,eAAe,EAAE,IAAA,oBAAM,GAAE;CAC1B,CAAC,CAAC;AAGU,QAAA,IAAI,GAAG,IAAA,kBAAI,EAAC;IACvB,IAAI,EAAE,IAAA,oBAAM,GAAE;IACd,iBAAiB,EAAE,IAAA,oBAAM,GAAE;CAC5B,CAAC,CAAC;AAGU,QAAA,eAAe,GAAG,IAAA,kBAAI,EAAC;IAClC,gBAAgB,EAAE,IAAA,mBAAK,EAAC,uBAAe,CAAC;IACxC,oBAAoB,EAAE,4BAAmB;IACzC,UAAU,EAAE,IAAA,oBAAM,GAAE;IACpB,YAAY,EAAE,IAAA,mBAAK,EAAC,oBAAY,CAAC;IACjC,aAAa,EAAE,IAAA,kBAAI,EAAC;QAClB,IAAI,EAAE,IAAA,oBAAM,GAAE;QACd,SAAS,EAAE,IAAA,oBAAM,GAAE;KACpB,CAAC;IACF,UAAU,EAAE,4BAAmB;IAC/B,WAAW,EAAE,IAAA,mBAAK,EAAC,kBAAU,CAAC;IAC9B,QAAQ,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC5B,KAAK,EAAE,IAAA,mBAAK,EAAC,YAAI,CAAC;CACnB,CAAC,CAAC;AAGU,QAAA,WAAW,GAAG,IAAA,kBAAI,EAAC;IAC9B,IAAI,EAAE,uBAAe;IACrB,IAAI,EAAE,uBAAe;CACtB,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { Connection, VersionedMessage, SignaturesForAddressOptions } from "@solana/web3.js";
2
+ import { Awaited } from "../../logic";
3
+ export declare const LATEST_BLOCKHASH_MOCK = "EEbZs6DmDyDjucyYbo3LwVJU7pQYuVopYcYTSEZXskW3";
4
+ export type Config = {
5
+ readonly endpoint: string;
6
+ };
7
+ export type ChainAPI = Readonly<{
8
+ getBalance: (address: string) => Promise<number>;
9
+ getLatestBlockhash: () => Promise<string>;
10
+ getFeeForMessage: (message: VersionedMessage) => Promise<number | null>;
11
+ getBalanceAndContext: (address: string) => ReturnType<Connection["getBalanceAndContext"]>;
12
+ getParsedTokenAccountsByOwner: (address: string) => ReturnType<Connection["getParsedTokenAccountsByOwner"]>;
13
+ getStakeAccountsByStakeAuth: (authAddr: string) => ReturnType<Connection["getParsedProgramAccounts"]>;
14
+ getStakeAccountsByWithdrawAuth: (authAddr: string) => ReturnType<Connection["getParsedProgramAccounts"]>;
15
+ getStakeActivation: (stakeAccAddr: string) => ReturnType<Connection["getStakeActivation"]>;
16
+ getInflationReward: (addresses: string[]) => ReturnType<Connection["getInflationReward"]>;
17
+ getVoteAccounts: () => ReturnType<Connection["getVoteAccounts"]>;
18
+ getSignaturesForAddress: (address: string, opts?: SignaturesForAddressOptions) => ReturnType<Connection["getSignaturesForAddress"]>;
19
+ getParsedTransactions: (signatures: string[]) => ReturnType<Connection["getParsedTransactions"]>;
20
+ getAccountInfo: (address: string) => Promise<Awaited<ReturnType<Connection["getParsedAccountInfo"]>>["value"]>;
21
+ sendRawTransaction: (buffer: Buffer) => ReturnType<Connection["sendRawTransaction"]>;
22
+ findAssocTokenAccAddress: (owner: string, mint: string) => Promise<string>;
23
+ getAssocTokenAccMinNativeBalance: () => Promise<number>;
24
+ getMinimumBalanceForRentExemption: (dataLength: number) => Promise<number>;
25
+ getEpochInfo: () => ReturnType<Connection["getEpochInfo"]>;
26
+ config: Config;
27
+ }>;
28
+ export declare function getChainAPI(config: Config, logger?: (url: string, options: any) => void): ChainAPI;
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/chain/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,UAAU,EAEV,gBAAgB,EAGhB,2BAA2B,EAE5B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,eAAO,MAAM,qBAAqB,iDAAiD,CAAC;AAEpF,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC9B,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjD,kBAAkB,EAAE,MAAM,OAAO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E,CAAC,MAAM,EAAE,MAAM,KAAK,UAAU,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAErF,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3E,gCAAgC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAExD,iCAAiC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3E,YAAY,EAAE,MAAM,UAAU,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAE3D,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAOH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,IAAI,GAC3C,QAAQ,CAuHV"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getChainAPI = exports.LATEST_BLOCKHASH_MOCK = void 0;
4
+ const spl_token_1 = require("@solana/spl-token");
5
+ const web3_js_1 = require("@solana/web3.js");
6
+ const live_env_1 = require("@ledgerhq/live-env");
7
+ const errors_1 = require("@ledgerhq/errors");
8
+ exports.LATEST_BLOCKHASH_MOCK = "EEbZs6DmDyDjucyYbo3LwVJU7pQYuVopYcYTSEZXskW3";
9
+ // Naive mode, allow us to filter in sentry all this error comming from Sol RPC node
10
+ const remapErrors = (e) => {
11
+ throw new errors_1.NetworkError(e === null || e === void 0 ? void 0 : e.message);
12
+ };
13
+ function getChainAPI(config, logger) {
14
+ const fetchMiddleware = logger === undefined
15
+ ? undefined
16
+ : (url, options, fetch) => {
17
+ logger(url, options);
18
+ fetch(url, options);
19
+ };
20
+ const connection = () => {
21
+ return new web3_js_1.Connection(config.endpoint, {
22
+ commitment: "finalized",
23
+ fetchMiddleware,
24
+ confirmTransactionInitialTimeout: (0, live_env_1.getEnv)("SOLANA_TX_CONFIRMATION_TIMEOUT"),
25
+ });
26
+ };
27
+ return {
28
+ getBalance: (address) => connection().getBalance(new web3_js_1.PublicKey(address)).catch(remapErrors),
29
+ getLatestBlockhash: () => connection()
30
+ .getLatestBlockhash()
31
+ .then(r => r.blockhash)
32
+ .catch(remapErrors),
33
+ getFeeForMessage: (msg) => connection()
34
+ .getFeeForMessage(msg)
35
+ .then(r => r.value)
36
+ .catch(remapErrors),
37
+ getBalanceAndContext: (address) => connection().getBalanceAndContext(new web3_js_1.PublicKey(address)).catch(remapErrors),
38
+ getParsedTokenAccountsByOwner: (address) => connection()
39
+ .getParsedTokenAccountsByOwner(new web3_js_1.PublicKey(address), {
40
+ programId: spl_token_1.TOKEN_PROGRAM_ID,
41
+ })
42
+ .catch(remapErrors),
43
+ getStakeAccountsByStakeAuth: (authAddr) => connection()
44
+ .getParsedProgramAccounts(web3_js_1.StakeProgram.programId, {
45
+ filters: [
46
+ {
47
+ memcmp: {
48
+ offset: 12,
49
+ bytes: authAddr,
50
+ },
51
+ },
52
+ ],
53
+ })
54
+ .catch(remapErrors),
55
+ getStakeAccountsByWithdrawAuth: (authAddr) => connection()
56
+ .getParsedProgramAccounts(web3_js_1.StakeProgram.programId, {
57
+ filters: [
58
+ {
59
+ memcmp: {
60
+ offset: 44,
61
+ bytes: authAddr,
62
+ },
63
+ },
64
+ ],
65
+ })
66
+ .catch(remapErrors),
67
+ getStakeActivation: (stakeAccAddr) => connection().getStakeActivation(new web3_js_1.PublicKey(stakeAccAddr)).catch(remapErrors),
68
+ getInflationReward: (addresses) => connection()
69
+ .getInflationReward(addresses.map(addr => new web3_js_1.PublicKey(addr)))
70
+ .catch(remapErrors),
71
+ getVoteAccounts: () => connection().getVoteAccounts().catch(remapErrors),
72
+ getSignaturesForAddress: (address, opts) => connection().getSignaturesForAddress(new web3_js_1.PublicKey(address), opts).catch(remapErrors),
73
+ getParsedTransactions: (signatures) => connection()
74
+ .getParsedTransactions(signatures, {
75
+ maxSupportedTransactionVersion: 0,
76
+ })
77
+ .catch(remapErrors),
78
+ getAccountInfo: (address) => connection()
79
+ .getParsedAccountInfo(new web3_js_1.PublicKey(address))
80
+ .then(r => r.value)
81
+ .catch(remapErrors),
82
+ sendRawTransaction: (buffer) => {
83
+ return (0, web3_js_1.sendAndConfirmRawTransaction)(connection(), buffer, {
84
+ commitment: "confirmed",
85
+ }).catch(remapErrors);
86
+ },
87
+ findAssocTokenAccAddress: (owner, mint) => {
88
+ return (0, spl_token_1.getAssociatedTokenAddress)(new web3_js_1.PublicKey(mint), new web3_js_1.PublicKey(owner))
89
+ .then(r => r.toBase58())
90
+ .catch(remapErrors);
91
+ },
92
+ getAssocTokenAccMinNativeBalance: () => (0, spl_token_1.getMinimumBalanceForRentExemptAccount)(connection()).catch(remapErrors),
93
+ getMinimumBalanceForRentExemption: (dataLength) => connection().getMinimumBalanceForRentExemption(dataLength).catch(remapErrors),
94
+ getEpochInfo: () => connection().getEpochInfo().catch(remapErrors),
95
+ config,
96
+ };
97
+ }
98
+ exports.getChainAPI = getChainAPI;
99
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/chain/index.ts"],"names":[],"mappings":";;;AAAA,iDAI2B;AAC3B,6CAQyB;AACzB,iDAA4C;AAE5C,6CAAgD;AAEnC,QAAA,qBAAqB,GAAG,8CAA8C,CAAC;AAyDpF,oFAAoF;AACpF,MAAM,WAAW,GAAG,CAAC,CAAQ,EAAE,EAAE;IAC/B,MAAM,IAAI,qBAAY,CAAC,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,SAAgB,WAAW,CACzB,MAAc,EACd,MAA4C;IAE5C,MAAM,eAAe,GACnB,MAAM,KAAK,SAAS;QAClB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,CAAC,GA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js";
3
+ import { AssociatedTokenAccountInstructionType, IX_STRUCTS, IX_TITLES } from "./types";
4
+ import { PARSED_PROGRAMS } from "../../program/constants";
5
+ export declare function parseAssociatedTokenAccountInstruction(ix: ParsedInstruction & {
6
+ program: typeof PARSED_PROGRAMS.SPL_ASSOCIATED_TOKEN_ACCOUNT;
7
+ }): AssociatedTokenAccountInstructionDescriptor;
8
+ export type AssociatedTokenAccountInstructionDescriptor = {
9
+ [K in AssociatedTokenAccountInstructionType]: {
10
+ title: (typeof IX_TITLES)[K];
11
+ type: K;
12
+ info: Infer<(typeof IX_STRUCTS)[K]>;
13
+ };
14
+ }[AssociatedTokenAccountInstructionType];
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/chain/instruction/associated-token-account/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,qCAAqC,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEvF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,wBAAgB,sCAAsC,CACpD,EAAE,EAAE,iBAAiB,GAAG;IACtB,OAAO,EAAE,OAAO,eAAe,CAAC,4BAA4B,CAAC;CAC9D,GACA,2CAA2C,CAa7C;AAED,MAAM,MAAM,2CAA2C,GAAG;KACvD,CAAC,IAAI,qCAAqC,GAAG;QAC5C,KAAK,EAAE,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,EAAE,CAAC,CAAC;QACR,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACrC;CACF,CAAC,qCAAqC,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseAssociatedTokenAccountInstruction = void 0;
4
+ const validators_1 = require("../../validators");
5
+ const superstruct_1 = require("superstruct");
6
+ const types_1 = require("./types");
7
+ function parseAssociatedTokenAccountInstruction(ix) {
8
+ // TODO: check this
9
+ const parsed = (0, superstruct_1.create)(ix.parsed, validators_1.ParsedInfo);
10
+ //const { type: rawType, info } = parsed;
11
+ const type = "associate";
12
+ const title = types_1.IX_TITLES[type];
13
+ const struct = types_1.IX_STRUCTS[type];
14
+ return {
15
+ type: "associate",
16
+ title: title,
17
+ info: (0, superstruct_1.create)(parsed.info, struct),
18
+ };
19
+ }
20
+ exports.parseAssociatedTokenAccountInstruction = parseAssociatedTokenAccountInstruction;
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/chain/instruction/associated-token-account/index.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAC9C,6CAA4C;AAE5C,mCAAuF;AAIvF,SAAgB,sCAAsC,CACpD,EAEC;IAED,mBAAmB;IACnB,MAAM,MAAM,GAAG,IAAA,oBAAM,EAAC,EAAE,CAAC,MAAM,EAAE,uBAAU,CAAC,CAAC;IAC7C,yCAAyC;IACzC,MAAM,IAAI,GAA0C,WAAW,CAAC;IAChE,MAAM,KAAK,GAAG,iBAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG,kBAAU,CAAC,IAAI,CAAC,CAAC;IAEhC,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAA,oBAAM,EAAC,MAAM,CAAC,IAAI,EAAE,MAAa,CAAQ;KAChD,CAAC;AACJ,CAAC;AAjBD,wFAiBC"}
@@ -0,0 +1,30 @@
1
+ /// <reference types="@solana/web3.js" />
2
+ import { Infer } from "superstruct";
3
+ export declare const AssociateInfo: import("superstruct").Struct<{
4
+ mint: import("@solana/web3.js").PublicKey;
5
+ account: import("@solana/web3.js").PublicKey;
6
+ wallet: import("@solana/web3.js").PublicKey;
7
+ }, {
8
+ account: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
9
+ mint: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
10
+ wallet: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
11
+ }>;
12
+ export type AssociatedTokenAccountInstructionType = Infer<typeof AssociatedTokenAccountInstructionType>;
13
+ export declare const AssociatedTokenAccountInstructionType: import("superstruct").Struct<"associate", {
14
+ associate: "associate";
15
+ }>;
16
+ export declare const IX_STRUCTS: {
17
+ readonly associate: import("superstruct").Struct<{
18
+ mint: import("@solana/web3.js").PublicKey;
19
+ account: import("@solana/web3.js").PublicKey;
20
+ wallet: import("@solana/web3.js").PublicKey;
21
+ }, {
22
+ account: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
23
+ mint: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
24
+ wallet: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
25
+ }>;
26
+ };
27
+ export declare const IX_TITLES: {
28
+ readonly associate: "Associate";
29
+ };
30
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/api/chain/instruction/associated-token-account/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAe,KAAK,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa;;;;;;;;EAIxB,CAAC;AAEH,MAAM,MAAM,qCAAqC,GAAG,KAAK,CACvD,OAAO,qCAAqC,CAC7C,CAAC;AAEF,eAAO,MAAM,qCAAqC;;EAAuB,CAAC;AAE1E,eAAO,MAAM,UAAU;;;;;;;;;;CAEb,CAAC;AAEX,eAAO,MAAM,SAAS;;CAEZ,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IX_TITLES = exports.IX_STRUCTS = exports.AssociatedTokenAccountInstructionType = exports.AssociateInfo = void 0;
4
+ const superstruct_1 = require("superstruct");
5
+ const pubkey_1 = require("../../validators/pubkey");
6
+ exports.AssociateInfo = (0, superstruct_1.type)({
7
+ account: pubkey_1.PublicKeyFromString,
8
+ mint: pubkey_1.PublicKeyFromString,
9
+ wallet: pubkey_1.PublicKeyFromString,
10
+ });
11
+ // not a real instruction type, added for structure
12
+ exports.AssociatedTokenAccountInstructionType = (0, superstruct_1.enums)(["associate"]);
13
+ exports.IX_STRUCTS = {
14
+ associate: exports.AssociateInfo,
15
+ };
16
+ exports.IX_TITLES = {
17
+ associate: "Associate",
18
+ };
19
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/api/chain/instruction/associated-token-account/types.ts"],"names":[],"mappings":";;;AAAA,6CAAiD;AACjD,oDAA8D;AAGjD,QAAA,aAAa,GAAG,IAAA,kBAAI,EAAC;IAChC,OAAO,EAAE,4BAAmB;IAC5B,IAAI,EAAE,4BAAmB;IACzB,MAAM,EAAE,4BAAmB;CAC5B,CAAC,CAAC;AAKH,mDAAmD;AACtC,QAAA,qCAAqC,GAAG,IAAA,mBAAK,EAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAE7D,QAAA,UAAU,GAAG;IACxB,SAAS,EAAE,qBAAa;CAChB,CAAC;AAEE,QAAA,SAAS,GAAG;IACvB,SAAS,EAAE,WAAW;CACd,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ParsedInstruction } from "@solana/web3.js";
2
+ import { IX_STRUCTS, IX_TITLES, MemoInstructionType } from "./types";
3
+ import { Infer } from "superstruct";
4
+ import { PARSED_PROGRAMS } from "../../program/constants";
5
+ export declare function parseSplMemoInstruction(ix: ParsedInstruction & {
6
+ program: typeof PARSED_PROGRAMS.SPL_MEMO;
7
+ }): MemoInstructionDescriptor;
8
+ export type MemoInstructionDescriptor = {
9
+ [K in MemoInstructionType]: {
10
+ title: (typeof IX_TITLES)[K];
11
+ type: K;
12
+ info: Infer<(typeof IX_STRUCTS)[K]>;
13
+ };
14
+ }[MemoInstructionType];
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/chain/instruction/memo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,iBAAiB,GAAG;IAAE,OAAO,EAAE,OAAO,eAAe,CAAC,QAAQ,CAAA;CAAE,GACnE,yBAAyB,CAQ3B;AAED,MAAM,MAAM,yBAAyB,GAAG;KACrC,CAAC,IAAI,mBAAmB,GAAG;QAC1B,KAAK,EAAE,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,EAAE,CAAC,CAAC;QACR,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACrC;CACF,CAAC,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseSplMemoInstruction = void 0;
4
+ function parseSplMemoInstruction(ix) {
5
+ return {
6
+ title: "Save",
7
+ type: "save",
8
+ info: {
9
+ data: ix.parsed,
10
+ },
11
+ };
12
+ }
13
+ exports.parseSplMemoInstruction = parseSplMemoInstruction;
14
+ //# sourceMappingURL=index.js.map