@sentio/sdk 2.0.0-rc.13 → 2.0.0-rc.15

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 (240) hide show
  1. package/lib/aptos/api.d.ts +5 -0
  2. package/lib/aptos/api.js +21 -0
  3. package/lib/aptos/api.js.map +1 -0
  4. package/lib/aptos/aptos-plugin.d.ts +14 -0
  5. package/lib/aptos/aptos-plugin.js +146 -0
  6. package/lib/aptos/aptos-plugin.js.map +1 -0
  7. package/lib/aptos/aptos-processor.d.ts +72 -0
  8. package/lib/aptos/aptos-processor.js +201 -0
  9. package/lib/aptos/aptos-processor.js.map +1 -0
  10. package/lib/aptos/builtin/0x1.d.ts +2140 -0
  11. package/lib/aptos/builtin/0x1.js +2727 -0
  12. package/lib/aptos/builtin/0x1.js.map +1 -0
  13. package/lib/aptos/builtin/0x3.d.ts +573 -0
  14. package/lib/aptos/builtin/0x3.js +496 -0
  15. package/lib/aptos/builtin/0x3.js.map +1 -0
  16. package/lib/aptos/builtin/index.d.ts +2 -0
  17. package/lib/aptos/builtin/index.js +6 -0
  18. package/lib/aptos/builtin/index.js.map +1 -0
  19. package/lib/aptos/codegen/codegen.d.ts +23 -0
  20. package/lib/aptos/codegen/codegen.js +388 -0
  21. package/lib/aptos/codegen/codegen.js.map +1 -0
  22. package/lib/aptos/codegen/index.d.ts +1 -0
  23. package/lib/aptos/codegen/index.js +2 -0
  24. package/lib/aptos/codegen/index.js.map +1 -0
  25. package/lib/aptos/codegen/typegen.d.ts +18 -0
  26. package/lib/aptos/codegen/typegen.js +145 -0
  27. package/lib/aptos/codegen/typegen.js.map +1 -0
  28. package/lib/aptos/codegen/typegen.test.d.ts +1 -0
  29. package/lib/aptos/codegen/typegen.test.js.map +1 -0
  30. package/lib/aptos/context.d.ts +21 -0
  31. package/lib/aptos/context.js +59 -0
  32. package/lib/aptos/context.js.map +1 -0
  33. package/lib/aptos/index.d.ts +9 -0
  34. package/lib/aptos/index.js +8 -0
  35. package/lib/aptos/index.js.map +1 -0
  36. package/lib/aptos/models.d.ts +37 -0
  37. package/lib/aptos/models.js +2 -0
  38. package/lib/aptos/models.js.map +1 -0
  39. package/lib/aptos/move-coder.d.ts +22 -0
  40. package/lib/aptos/move-coder.js +164 -0
  41. package/lib/aptos/move-coder.js.map +1 -0
  42. package/lib/aptos/move-types.d.ts +10 -0
  43. package/lib/aptos/move-types.js +2 -0
  44. package/lib/aptos/move-types.js.map +1 -0
  45. package/lib/aptos/network.d.ts +11 -0
  46. package/lib/aptos/network.js +27 -0
  47. package/lib/aptos/network.js.map +1 -0
  48. package/lib/aptos/run-codegen.d.ts +1 -0
  49. package/lib/aptos/run-codegen.js +12 -0
  50. package/lib/aptos/run-codegen.js.map +1 -0
  51. package/lib/aptos/tests/aptos.test.d.ts +1 -0
  52. package/lib/aptos/tests/aptos.test.js.map +1 -0
  53. package/lib/aptos/tests/souffl3.d.ts +1 -0
  54. package/lib/aptos/tests/souffl3.js +44 -0
  55. package/lib/aptos/tests/souffl3.js.map +1 -0
  56. package/lib/aptos/tests/types/index.d.ts +3 -0
  57. package/lib/aptos/tests/types/index.js +7 -0
  58. package/lib/aptos/tests/types/index.js.map +1 -0
  59. package/lib/aptos/tests/types/reserved.d.ts +445 -0
  60. package/lib/aptos/tests/types/reserved.js +301 -0
  61. package/lib/aptos/tests/types/reserved.js.map +1 -0
  62. package/lib/aptos/tests/types/soffl3.d.ts +1065 -0
  63. package/lib/aptos/tests/types/soffl3.js +548 -0
  64. package/lib/aptos/tests/types/soffl3.js.map +1 -0
  65. package/lib/aptos/tests/types/souffle.d.ts +440 -0
  66. package/lib/aptos/tests/types/souffle.js +295 -0
  67. package/lib/aptos/tests/types/souffle.js.map +1 -0
  68. package/lib/aptos/types.d.ts +9 -0
  69. package/lib/aptos/types.js +130 -0
  70. package/lib/aptos/types.js.map +1 -0
  71. package/lib/aptos/types.test.d.ts +1 -0
  72. package/lib/aptos/types.test.js.map +1 -0
  73. package/lib/aptos/utils.d.ts +7 -0
  74. package/lib/aptos/utils.js +20 -0
  75. package/lib/aptos/utils.js.map +1 -0
  76. package/lib/builtin/internal/eacaggregatorproxy_processor.js +90 -180
  77. package/lib/builtin/internal/eacaggregatorproxy_processor.js.map +1 -1
  78. package/lib/builtin/internal/erc1155_processor.js +25 -50
  79. package/lib/builtin/internal/erc1155_processor.js.map +1 -1
  80. package/lib/builtin/internal/erc20_processor.js +40 -80
  81. package/lib/builtin/internal/erc20_processor.js.map +1 -1
  82. package/lib/builtin/internal/erc20bytes_processor.js +30 -60
  83. package/lib/builtin/internal/erc20bytes_processor.js.map +1 -1
  84. package/lib/builtin/internal/erc721_processor.js +45 -90
  85. package/lib/builtin/internal/erc721_processor.js.map +1 -1
  86. package/lib/builtin/internal/weth9_processor.js +30 -60
  87. package/lib/builtin/internal/weth9_processor.js.map +1 -1
  88. package/lib/{utils/chain.d.ts → chain.d.ts} +0 -0
  89. package/lib/{utils/chain.js → chain.js} +0 -0
  90. package/lib/chain.js.map +1 -0
  91. package/lib/core/context.js +1 -1
  92. package/lib/core/context.js.map +1 -1
  93. package/lib/core/sui-plugin.js +1 -1
  94. package/lib/core/sui-plugin.js.map +1 -1
  95. package/lib/error.d.ts +1 -1
  96. package/lib/error.js +10 -12
  97. package/lib/error.js.map +1 -1
  98. package/lib/eth/base-processor-template.d.ts +3 -3
  99. package/lib/eth/base-processor-template.js.map +1 -1
  100. package/lib/eth/base-processor.d.ts +3 -3
  101. package/lib/eth/base-processor.js.map +1 -1
  102. package/lib/eth/{eth-event.d.ts → eth.d.ts} +1 -1
  103. package/lib/eth/eth.js +2 -0
  104. package/lib/eth/eth.js.map +1 -0
  105. package/lib/eth/index.d.ts +1 -0
  106. package/lib/eth/index.js +1 -0
  107. package/lib/eth/index.js.map +1 -1
  108. package/lib/index.d.ts +2 -2
  109. package/lib/index.js +2 -2
  110. package/lib/index.js.map +1 -1
  111. package/lib/solana/builtin/index.d.ts +1 -0
  112. package/lib/solana/builtin/index.js +2 -0
  113. package/lib/solana/builtin/index.js.map +1 -0
  114. package/lib/solana/builtin/spl-token-processor.d.ts +39 -0
  115. package/lib/solana/builtin/spl-token-processor.js +254 -0
  116. package/lib/solana/builtin/spl-token-processor.js.map +1 -0
  117. package/lib/solana/builtin/types.d.ts +427 -0
  118. package/lib/solana/builtin/types.js +200 -0
  119. package/lib/solana/builtin/types.js.map +1 -0
  120. package/lib/solana/codegen/codegen.d.ts +1 -0
  121. package/lib/solana/codegen/codegen.js +122 -0
  122. package/lib/solana/codegen/codegen.js.map +1 -0
  123. package/lib/solana/codegen/index.d.ts +1 -0
  124. package/lib/solana/codegen/index.js +2 -0
  125. package/lib/solana/codegen/index.js.map +1 -0
  126. package/lib/solana/index.d.ts +4 -0
  127. package/lib/solana/index.js +5 -0
  128. package/lib/solana/index.js.map +1 -0
  129. package/lib/solana/run-codegen.d.ts +2 -0
  130. package/lib/solana/run-codegen.js +12 -0
  131. package/lib/solana/run-codegen.js.map +1 -0
  132. package/lib/solana/solana-context.d.ts +9 -0
  133. package/lib/solana/solana-context.js +28 -0
  134. package/lib/solana/solana-context.js.map +1 -0
  135. package/lib/solana/solana-options.d.ts +10 -0
  136. package/lib/solana/solana-options.js +10 -0
  137. package/lib/solana/solana-options.js.map +1 -0
  138. package/lib/solana/solana-plugin.d.ts +9 -0
  139. package/lib/solana/solana-plugin.js +87 -0
  140. package/lib/solana/solana-plugin.js.map +1 -0
  141. package/lib/solana/solana-processor.d.ts +43 -0
  142. package/lib/solana/solana-processor.js +72 -0
  143. package/lib/solana/solana-processor.js.map +1 -0
  144. package/lib/solana/tests/solana.test.d.ts +1 -0
  145. package/lib/solana/tests/solana.test.js.map +1 -0
  146. package/lib/solana/tests/types/basic_1.d.ts +26 -0
  147. package/lib/solana/tests/types/basic_1.js +63 -0
  148. package/lib/solana/tests/types/basic_1.js.map +1 -0
  149. package/lib/solana/tests/types/basic_1_processor.d.ts +21 -0
  150. package/lib/solana/tests/types/basic_1_processor.js +35 -0
  151. package/lib/solana/tests/types/basic_1_processor.js.map +1 -0
  152. package/lib/solana/tests/types/token_bridge.d.ts +29 -0
  153. package/lib/solana/tests/types/token_bridge.js +938 -0
  154. package/lib/solana/tests/types/token_bridge.js.map +1 -0
  155. package/lib/solana/tests/types/token_bridge_processor.d.ts +212 -0
  156. package/lib/solana/tests/types/token_bridge_processor.js +134 -0
  157. package/lib/solana/tests/types/token_bridge_processor.js.map +1 -0
  158. package/lib/solana/tests/wormhole-token-bridge.d.ts +15 -0
  159. package/lib/solana/tests/wormhole-token-bridge.js +79 -0
  160. package/lib/solana/tests/wormhole-token-bridge.js.map +1 -0
  161. package/lib/target-ethers-sentio/view-function.cjs +4 -9
  162. package/lib/target-ethers-sentio/view-function.cjs.map +1 -1
  163. package/lib/testing/test-processor-server.js +1 -1
  164. package/lib/testing/test-processor-server.js.map +1 -1
  165. package/lib/testing/test-provider.js +1 -1
  166. package/lib/testing/test-provider.js.map +1 -1
  167. package/lib/utils/index.d.ts +0 -1
  168. package/lib/utils/index.js +0 -1
  169. package/lib/utils/index.js.map +1 -1
  170. package/package.json +34 -11
  171. package/src/aptos/abis/0x1.json +9205 -0
  172. package/src/aptos/abis/0x3.json +1515 -0
  173. package/src/aptos/api.ts +23 -0
  174. package/src/aptos/aptos-plugin.ts +183 -0
  175. package/src/aptos/aptos-processor.ts +331 -0
  176. package/src/aptos/builtin/0x1.ts +4911 -0
  177. package/src/aptos/builtin/0x3.ts +1092 -0
  178. package/src/aptos/builtin/index.ts +5 -0
  179. package/src/aptos/codegen/codegen.ts +470 -0
  180. package/src/aptos/codegen/index.ts +1 -0
  181. package/src/aptos/codegen/tsconfig.json +8 -0
  182. package/src/aptos/codegen/typegen.ts +165 -0
  183. package/src/aptos/context.ts +72 -0
  184. package/src/aptos/index.ts +10 -0
  185. package/src/aptos/models.ts +47 -0
  186. package/src/aptos/move-coder.ts +201 -0
  187. package/src/aptos/move-types.ts +11 -0
  188. package/src/aptos/network.ts +29 -0
  189. package/src/aptos/run-codegen.ts +13 -0
  190. package/src/aptos/tests/abis/reserved.json +402 -0
  191. package/src/aptos/tests/abis/soffl3.json +1411 -0
  192. package/src/aptos/tests/abis/souffle.json +389 -0
  193. package/src/aptos/tests/souffl3.ts +57 -0
  194. package/src/aptos/tests/types/index.ts +6 -0
  195. package/src/aptos/tests/types/reserved.ts +881 -0
  196. package/src/aptos/tests/types/soffl3.ts +1820 -0
  197. package/src/aptos/tests/types/souffle.ts +880 -0
  198. package/src/aptos/types.ts +149 -0
  199. package/src/aptos/utils.ts +26 -0
  200. package/src/builtin/internal/eacaggregatorproxy_processor.ts +90 -162
  201. package/src/builtin/internal/erc1155_processor.ts +25 -49
  202. package/src/builtin/internal/erc20_processor.ts +40 -72
  203. package/src/builtin/internal/erc20bytes_processor.ts +30 -54
  204. package/src/builtin/internal/erc721_processor.ts +45 -81
  205. package/src/builtin/internal/weth9_processor.ts +30 -54
  206. package/src/{utils/chain.ts → chain.ts} +0 -0
  207. package/src/core/context.ts +1 -1
  208. package/src/core/sui-plugin.ts +1 -1
  209. package/src/error.ts +12 -14
  210. package/src/eth/base-processor-template.ts +3 -3
  211. package/src/eth/base-processor.ts +4 -4
  212. package/src/eth/{eth-event.ts → eth.ts} +1 -1
  213. package/src/eth/index.ts +2 -0
  214. package/src/index.ts +2 -2
  215. package/src/solana/builtin/index.ts +1 -0
  216. package/src/solana/builtin/spl-token-processor.ts +298 -0
  217. package/src/solana/builtin/types.ts +279 -0
  218. package/src/solana/codegen/codegen.ts +140 -0
  219. package/src/solana/codegen/index.ts +1 -0
  220. package/src/solana/codegen/tsconfig.json +8 -0
  221. package/src/solana/index.ts +4 -0
  222. package/src/solana/run-codegen.ts +13 -0
  223. package/src/solana/solana-context.ts +30 -0
  224. package/src/solana/solana-options.ts +11 -0
  225. package/src/solana/solana-plugin.ts +103 -0
  226. package/src/solana/solana-processor.ts +102 -0
  227. package/src/solana/tests/abis/basic_1.json +62 -0
  228. package/src/solana/tests/abis/token_bridge.json +937 -0
  229. package/src/solana/tests/types/basic_1.ts +62 -0
  230. package/src/solana/tests/types/basic_1_processor.ts +42 -0
  231. package/src/solana/tests/types/token_bridge.ts +937 -0
  232. package/src/solana/tests/types/token_bridge_processor.ts +150 -0
  233. package/src/solana/tests/wormhole-token-bridge.ts +96 -0
  234. package/src/target-ethers-sentio/view-function.cts +4 -11
  235. package/src/testing/test-processor-server.ts +1 -1
  236. package/src/testing/test-provider.ts +1 -1
  237. package/src/utils/index.ts +0 -1
  238. package/lib/eth/eth-event.js +0 -2
  239. package/lib/eth/eth-event.js.map +0 -1
  240. package/lib/utils/chain.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spl-token-processor.js","sourceRoot":"","sources":["../../../src/solana/builtin/spl-token-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAoC,MAAM,oBAAoB,CAAA;AAI1F,MAAM,OAAO,iBAAkB,SAAQ,mBAAmB;IACxD,MAAM,CAAC,IAAI,CAAC,OAA0B;QACpC,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YAC5B,OAAO,CAAC,IAAI,GAAG,mBAAmB,CAAA;SACnC;QACD,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAA;IACvC,CAAC;IAED,qBAAqB,GAAqE,CAAC,WAAwC,EAAE,EAAE;QACrI,MAAM,eAAe,GAAG,WAAW,CAAC,IAAI,CAAA;QACxC,IAAI,CAAC,eAAe,EAAE;YACpB,OAAO,IAAI,CAAA;SACZ;QACD,OAAO;YACL,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,IAAI,EAAE;gBACJ,GAAG,WAAW,CAAC,IAAI;aACpB;SACF,CAAA;IACH,CAAC,CAAA;IAEM,gBAAgB,CACrB,OAA2D;QAE3D,IAAI,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC,GAAgB,EAAE,GAAG,EAAE,EAAE;YAC7D,IAAI,GAAG,EAAE;gBACP,OAAO,CAAC,GA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AG,CAAC,IAA4B,EAAE,GAAG,CAAC,CAAA;aAC/C;QACH,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,8BAA8B,CAAC,OAAyE;QAC7G,IAAI,CAAC,aAAa,CAAC,8BAA8B,EAAE,CAAC,GAAgB,EAAE,GAAG,EAAE,EAAE;YAC3E,IAAI,GAAG,EAAE;gBACP,OAAO,CAAC,GAAG,CAAC,IAAoC,EAAE,GAAG,CAAC,CAAA;aACvD;QACH,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,YAAY,CAAC,OAAuD;QACzE,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC,GAAgB,EAAE,GAAG,EAAE,EAAE;YACzD,IAAI,GAAG,EAAE;gBACP,OAAO,CAAC,GAAG,CAAC,IAAkB,EAAE,GAAG,CAAC,CAAA;aACrC;QACH,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,uBAAuB,CAAC,OAAkE;QAC/F,IAAI,CAAC,aAAa,CAAC,uBAAuB,EAAE,CAAC,GAAgB,EAAE,GAAG,EAAE,EAAE;YACpE,IAAI,GAAG,EAAE;gBACP,OAAO,CAAC,GAAG,CAAC,IAA6B,EAAE,GAAG,CAAC,CAAA;aAChD;QACH,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,kBAAkB,CAAC,OAA6D;QACrF,IAAI,CAAC,aAAa,CAAC,kBAAkB,EAAE,CAAC,GAAgB,EAAE,GAAG,EAAE,EAAE;YAC/D,IAAI,GAAG,EAAE;gBACP,OAAO,CAAC,GAAG,CAAC,IAAwB,EAAE,GAAG,CAAC,CAAA;aAC3C;QACH,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;CAGF","sourcesContent":["import { SolanaBaseProcessor, SolanaContext, SolanaBindOptions } from '@sentio/sdk/solana'\nimport { Instruction } from '@project-serum/anchor'\nimport { AmountToUiAmount, Approve, ApproveChecked, Burn, BurnChecked, CloseAccount, CreateNativeMint, DefaultAccountStateExtension, FreezeAccount, GetAccountDataSize, InitializeAccount, InitializeAccount2, InitializeAccount3, InitializeImmutableOwner, InitializeMint, InitializeMintCloseAuthority, InitializeMultisig, MemoTransferExtension, MintTo, MintToChecked, Reallocate, Revoke, SyncNative, ThawAccount, Transfer, TransferChecked, TransferFeeExtension, UiAmountToAmount } from './types.js';\n\nexport class SPLTokenProcessor extends SolanaBaseProcessor {\n static bind(options: SolanaBindOptions): SPLTokenProcessor {\n if (options && !options.name) {\n options.name = 'SPL Token Program'\n }\n return new SPLTokenProcessor(options)\n }\n\n fromParsedInstruction: (instruction: { type: string, info: any }) => Instruction | null = (instruction: { type: string, info: any }) => {\n const instructionType = instruction.type\n if (!instructionType) {\n return null\n }\n return {\n name: instruction.type,\n data: {\n ...instruction.info,\n },\n }\n }\n\n public onInitializeMint(\n handler: (data: InitializeMint, ctx: SolanaContext) => void\n ): SPLTokenProcessor {\n this.onInstruction('initializeMint', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeMint, ctx)\n }\n })\n return this\n }\n\n public onInitializeAccount(\n hanlder: (data: InitializeAccount, ctx: SolanaContext) => void\n ): SPLTokenProcessor {\n this.onInstruction('initializeAccount', (ins: Instruction, ctx) => {\n if (ins) {\n hanlder(ins.data as InitializeAccount, ctx)\n }\n })\n return this\n }\n\n public onInitializeAccount2(\n hanlder: (data: InitializeAccount2, ctx: SolanaContext) => void\n ): SPLTokenProcessor {\n this.onInstruction('initializeAccount2', (ins: Instruction, ctx) => {\n if (ins) {\n hanlder(ins.data as InitializeAccount2, ctx)\n }\n })\n return this\n }\n\n public onInitializeAccount3(\n hanlder: (data: InitializeAccount3, ctx: SolanaContext) => void\n ): SPLTokenProcessor {\n this.onInstruction('initializeAccount3', (ins: Instruction, ctx) => {\n if (ins) {\n hanlder(ins.data as InitializeAccount3, ctx)\n }\n })\n return this\n }\n\n public onInitializeMultisig(\n handler: (data: InitializeMultisig, ctx: SolanaContext) => void\n ): SPLTokenProcessor {\n this.onInstruction('initializeMultisig', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeMultisig, ctx)\n }\n })\n return this\n }\n\n public onTransfer(handler: (data: Transfer, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('transfer', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Transfer, ctx)\n }\n })\n return this\n }\n\n public onApprovend(handler: (data: Approve, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('approve', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Approve, ctx)\n }\n })\n return this\n }\n\n public onRevoke(handler: (data: Revoke, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('revoke', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Revoke, ctx)\n }\n })\n return this\n }\n\n public onSetAuthority(handler: (data: any, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('setAuthority', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as any, ctx)\n }\n })\n return this\n }\n\n public onMintTo(handler: (data: MintTo, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('mintTo', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as MintTo, ctx)\n }\n })\n return this\n }\n\n public onBurn(handler: (data: Burn, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('burn', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Burn, ctx)\n }\n })\n return this\n }\n\n public onCloseAccount(handler: (data: CloseAccount, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('closeAccount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as CloseAccount, ctx)\n }\n })\n return this\n }\n\n public onFreezeAccount(handler: (data: FreezeAccount, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('freezeAccount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as FreezeAccount, ctx)\n }\n })\n return this\n }\n\n public onThawAccount(handler: (data: ThawAccount, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('thawAccount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as ThawAccount, ctx)\n }\n })\n return this\n }\n\n public onTransferChecked(handler: (data: TransferChecked, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('transferChecked', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as TransferChecked, ctx)\n }\n })\n return this\n }\n\n public onApproveChecked(handler: (data: ApproveChecked, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('approveChecked', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as ApproveChecked, ctx)\n }\n })\n return this\n }\n\n public onMintToChecked(handler: (data: MintToChecked, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('mintToChecked', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as MintToChecked, ctx)\n }\n })\n return this\n }\n\n public onBurnChecked(handler: (data: BurnChecked, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('burnChecked', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as BurnChecked, ctx)\n }\n })\n return this\n }\n\n public onSyncNative(handler: (data: SyncNative, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('syncNative', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as SyncNative, ctx)\n }\n })\n return this\n }\n\n public onGetAccountDataSize(handler: (data: GetAccountDataSize, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('getAccountDataSize', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as GetAccountDataSize, ctx)\n }\n })\n return this\n }\n\n public onInitializeImmutableOwner(handler: (data: InitializeImmutableOwner, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('initializeImmutableOwner', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeImmutableOwner, ctx)\n }\n })\n return this\n }\n\n public onAmountToUiAmount(handler: (data: AmountToUiAmount, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('amountToUiAmount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as AmountToUiAmount, ctx)\n }\n })\n return this\n }\n\n public onUiAmountToAmount(handler: (data: UiAmountToAmount, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('uiAmountToAmount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as UiAmountToAmount, ctx)\n }\n })\n return this\n }\n\n public onInitializeMintCloseAuthority(handler: (data: InitializeMintCloseAuthority, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('initializeMintCloseAuthority', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeMintCloseAuthority, ctx)\n }\n })\n return this\n }\n\n public onTransferFeeExtension(handler: (data: TransferFeeExtension, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('transferFeeExtension', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as TransferFeeExtension, ctx)\n }\n })\n return this\n }\n\n public onDefaultAccountStateExtension(handler: (data: DefaultAccountStateExtension, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('defaultAccountStateExtension', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as DefaultAccountStateExtension, ctx)\n }\n })\n return this\n }\n\n public onReallocate(handler: (data: Reallocate, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('reallocate', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Reallocate, ctx)\n }\n })\n return this\n }\n\n public onMemoTransferExtension(handler: (data: MemoTransferExtension, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('memoTransferExtension', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as MemoTransferExtension, ctx)\n }\n })\n return this\n }\n\n public onCreateNativeMint(handler: (data: CreateNativeMint, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('createNativeMint', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as CreateNativeMint, ctx)\n }\n })\n return this\n }\n\n // Todo(pcxu): auto gen this file\n}\n"]}
@@ -0,0 +1,427 @@
1
+ import { Infer } from "superstruct";
2
+ export declare const PublicKeyFromString: import("superstruct").Struct<String, null>;
3
+ export type TokenAmountUi = Infer<typeof TokenAmountUi>;
4
+ export type MintTo = Infer<typeof MintTo>;
5
+ export type Burn = Infer<typeof Burn>;
6
+ export type InitializeMint = Infer<typeof InitializeMint>;
7
+ export type InitializeAccount = Infer<typeof InitializeAccount>;
8
+ export type InitializeAccount2 = Infer<typeof InitializeAccount2>;
9
+ export type InitializeAccount3 = Infer<typeof InitializeAccount3>;
10
+ export type InitializeMultisig = Infer<typeof InitializeMultisig>;
11
+ export declare const TokenAmountUi: import("superstruct").Struct<{
12
+ amount: string;
13
+ decimals: number;
14
+ uiAmountString: string;
15
+ }, {
16
+ amount: import("superstruct").Struct<string, null>;
17
+ decimals: import("superstruct").Struct<number, null>;
18
+ uiAmountString: import("superstruct").Struct<string, null>;
19
+ }>;
20
+ declare const InitializeMint: import("superstruct").Struct<{
21
+ decimals: number;
22
+ mint: String;
23
+ mintAuthority: String;
24
+ rentSysvar: String;
25
+ freezeAuthority?: String | undefined;
26
+ }, {
27
+ mint: import("superstruct").Struct<String, null>;
28
+ decimals: import("superstruct").Struct<number, null>;
29
+ mintAuthority: import("superstruct").Struct<String, null>;
30
+ rentSysvar: import("superstruct").Struct<String, null>;
31
+ freezeAuthority: import("superstruct").Struct<String | undefined, null>;
32
+ }>;
33
+ declare const InitializeAccount: import("superstruct").Struct<{
34
+ account: String;
35
+ mint: String;
36
+ rentSysvar: String;
37
+ owner: String;
38
+ }, {
39
+ account: import("superstruct").Struct<String, null>;
40
+ mint: import("superstruct").Struct<String, null>;
41
+ owner: import("superstruct").Struct<String, null>;
42
+ rentSysvar: import("superstruct").Struct<String, null>;
43
+ }>;
44
+ declare const InitializeAccount2: import("superstruct").Struct<{
45
+ account: String;
46
+ mint: String;
47
+ rentSysvar: String;
48
+ owner: String;
49
+ }, {
50
+ account: import("superstruct").Struct<String, null>;
51
+ mint: import("superstruct").Struct<String, null>;
52
+ rentSysvar: import("superstruct").Struct<String, null>;
53
+ owner: import("superstruct").Struct<String, null>;
54
+ }>;
55
+ declare const InitializeAccount3: import("superstruct").Struct<{
56
+ account: String;
57
+ mint: String;
58
+ owner: String;
59
+ }, {
60
+ account: import("superstruct").Struct<String, null>;
61
+ mint: import("superstruct").Struct<String, null>;
62
+ owner: import("superstruct").Struct<String, null>;
63
+ }>;
64
+ declare const InitializeMultisig: import("superstruct").Struct<{
65
+ signers: String[];
66
+ rentSysvar: String;
67
+ multisig: String;
68
+ m: number;
69
+ }, {
70
+ multisig: import("superstruct").Struct<String, null>;
71
+ rentSysvar: import("superstruct").Struct<String, null>;
72
+ signers: import("superstruct").Struct<String[], import("superstruct").Struct<String, null>>;
73
+ m: import("superstruct").Struct<number, null>;
74
+ }>;
75
+ export type Transfer = Infer<typeof Transfer>;
76
+ export declare const Transfer: import("superstruct").Struct<{
77
+ amount: string | number;
78
+ source: String;
79
+ destination: String;
80
+ signers?: String[] | undefined;
81
+ authority?: String | undefined;
82
+ multisigAuthority?: String | undefined;
83
+ }, {
84
+ source: import("superstruct").Struct<String, null>;
85
+ destination: import("superstruct").Struct<String, null>;
86
+ amount: import("superstruct").Struct<string | number, null>;
87
+ authority: import("superstruct").Struct<String | undefined, null>;
88
+ multisigAuthority: import("superstruct").Struct<String | undefined, null>;
89
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
90
+ }>;
91
+ export type Approve = Infer<typeof Approve>;
92
+ declare const Approve: import("superstruct").Struct<{
93
+ amount: string | number;
94
+ source: String;
95
+ delegate: String;
96
+ signers?: String[] | undefined;
97
+ owner?: String | undefined;
98
+ multisigOwner?: String | undefined;
99
+ }, {
100
+ source: import("superstruct").Struct<String, null>;
101
+ delegate: import("superstruct").Struct<String, null>;
102
+ amount: import("superstruct").Struct<string | number, null>;
103
+ owner: import("superstruct").Struct<String | undefined, null>;
104
+ multisigOwner: import("superstruct").Struct<String | undefined, null>;
105
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
106
+ }>;
107
+ export type Revoke = Infer<typeof Revoke>;
108
+ declare const Revoke: import("superstruct").Struct<{
109
+ source: String;
110
+ signers?: String[] | undefined;
111
+ owner?: String | undefined;
112
+ multisigOwner?: String | undefined;
113
+ }, {
114
+ source: import("superstruct").Struct<String, null>;
115
+ owner: import("superstruct").Struct<String | undefined, null>;
116
+ multisigOwner: import("superstruct").Struct<String | undefined, null>;
117
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
118
+ }>;
119
+ export type SetAuthority = Infer<typeof SetAuthority>;
120
+ declare const SetAuthority: import("superstruct").Struct<{
121
+ authorityType: "mintTokens" | "freezeAccount" | "accountOwner" | "closeAccount";
122
+ newAuthority: String | null;
123
+ account?: String | undefined;
124
+ mint?: String | undefined;
125
+ signers?: String[] | undefined;
126
+ authority?: String | undefined;
127
+ multisigAuthority?: String | undefined;
128
+ }, {
129
+ mint: import("superstruct").Struct<String | undefined, null>;
130
+ account: import("superstruct").Struct<String | undefined, null>;
131
+ authorityType: import("superstruct").Struct<"mintTokens" | "freezeAccount" | "accountOwner" | "closeAccount", {
132
+ mintTokens: "mintTokens";
133
+ freezeAccount: "freezeAccount";
134
+ accountOwner: "accountOwner";
135
+ closeAccount: "closeAccount";
136
+ }>;
137
+ newAuthority: import("superstruct").Struct<String | null, null>;
138
+ authority: import("superstruct").Struct<String | undefined, null>;
139
+ multisigAuthority: import("superstruct").Struct<String | undefined, null>;
140
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
141
+ }>;
142
+ declare const MintTo: import("superstruct").Struct<{
143
+ account: String;
144
+ amount: string | number;
145
+ mint: String;
146
+ mintAuthority?: String | undefined;
147
+ multisigMintAuthority?: String | undefined;
148
+ signers?: String[] | undefined;
149
+ }, {
150
+ mint: import("superstruct").Struct<String, null>;
151
+ account: import("superstruct").Struct<String, null>;
152
+ amount: import("superstruct").Struct<string | number, null>;
153
+ mintAuthority: import("superstruct").Struct<String | undefined, null>;
154
+ multisigMintAuthority: import("superstruct").Struct<String | undefined, null>;
155
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
156
+ }>;
157
+ declare const Burn: import("superstruct").Struct<{
158
+ account: String;
159
+ amount: string | number;
160
+ mint: String;
161
+ signers?: String[] | undefined;
162
+ authority?: String | undefined;
163
+ multisigAuthority?: String | undefined;
164
+ }, {
165
+ account: import("superstruct").Struct<String, null>;
166
+ mint: import("superstruct").Struct<String, null>;
167
+ amount: import("superstruct").Struct<string | number, null>;
168
+ authority: import("superstruct").Struct<String | undefined, null>;
169
+ multisigAuthority: import("superstruct").Struct<String | undefined, null>;
170
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
171
+ }>;
172
+ declare const CloseAccount: import("superstruct").Struct<{
173
+ account: String;
174
+ destination: String;
175
+ signers?: String[] | undefined;
176
+ owner?: String | undefined;
177
+ multisigOwner?: String | undefined;
178
+ }, {
179
+ account: import("superstruct").Struct<String, null>;
180
+ destination: import("superstruct").Struct<String, null>;
181
+ owner: import("superstruct").Struct<String | undefined, null>;
182
+ multisigOwner: import("superstruct").Struct<String | undefined, null>;
183
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
184
+ }>;
185
+ export type CloseAccount = Infer<typeof CloseAccount>;
186
+ export type FreezeAccount = Infer<typeof FreezeAccount>;
187
+ declare const FreezeAccount: import("superstruct").Struct<{
188
+ account: String;
189
+ mint: String;
190
+ signers?: String[] | undefined;
191
+ freezeAuthority?: String | undefined;
192
+ multisigFreezeAuthority?: String | undefined;
193
+ }, {
194
+ account: import("superstruct").Struct<String, null>;
195
+ mint: import("superstruct").Struct<String, null>;
196
+ freezeAuthority: import("superstruct").Struct<String | undefined, null>;
197
+ multisigFreezeAuthority: import("superstruct").Struct<String | undefined, null>;
198
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
199
+ }>;
200
+ export type ThawAccount = Infer<typeof ThawAccount>;
201
+ declare const ThawAccount: import("superstruct").Struct<{
202
+ account: String;
203
+ mint: String;
204
+ signers?: String[] | undefined;
205
+ freezeAuthority?: String | undefined;
206
+ multisigFreezeAuthority?: String | undefined;
207
+ }, {
208
+ account: import("superstruct").Struct<String, null>;
209
+ mint: import("superstruct").Struct<String, null>;
210
+ freezeAuthority: import("superstruct").Struct<String | undefined, null>;
211
+ multisigFreezeAuthority: import("superstruct").Struct<String | undefined, null>;
212
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
213
+ }>;
214
+ export type TransferChecked = Infer<typeof TransferChecked>;
215
+ export declare const TransferChecked: import("superstruct").Struct<{
216
+ mint: String;
217
+ source: String;
218
+ destination: String;
219
+ tokenAmount: {
220
+ amount: string;
221
+ decimals: number;
222
+ uiAmountString: string;
223
+ };
224
+ signers?: String[] | undefined;
225
+ authority?: String | undefined;
226
+ multisigAuthority?: String | undefined;
227
+ }, {
228
+ source: import("superstruct").Struct<String, null>;
229
+ mint: import("superstruct").Struct<String, null>;
230
+ destination: import("superstruct").Struct<String, null>;
231
+ authority: import("superstruct").Struct<String | undefined, null>;
232
+ multisigAuthority: import("superstruct").Struct<String | undefined, null>;
233
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
234
+ tokenAmount: import("superstruct").Struct<{
235
+ amount: string;
236
+ decimals: number;
237
+ uiAmountString: string;
238
+ }, {
239
+ amount: import("superstruct").Struct<string, null>;
240
+ decimals: import("superstruct").Struct<number, null>;
241
+ uiAmountString: import("superstruct").Struct<string, null>;
242
+ }>;
243
+ }>;
244
+ export type ApproveChecked = Infer<typeof ApproveChecked>;
245
+ declare const ApproveChecked: import("superstruct").Struct<{
246
+ mint: String;
247
+ source: String;
248
+ delegate: String;
249
+ tokenAmount: {
250
+ amount: string;
251
+ decimals: number;
252
+ uiAmountString: string;
253
+ };
254
+ signers?: String[] | undefined;
255
+ owner?: String | undefined;
256
+ multisigOwner?: String | undefined;
257
+ }, {
258
+ source: import("superstruct").Struct<String, null>;
259
+ mint: import("superstruct").Struct<String, null>;
260
+ delegate: import("superstruct").Struct<String, null>;
261
+ owner: import("superstruct").Struct<String | undefined, null>;
262
+ multisigOwner: import("superstruct").Struct<String | undefined, null>;
263
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
264
+ tokenAmount: import("superstruct").Struct<{
265
+ amount: string;
266
+ decimals: number;
267
+ uiAmountString: string;
268
+ }, {
269
+ amount: import("superstruct").Struct<string, null>;
270
+ decimals: import("superstruct").Struct<number, null>;
271
+ uiAmountString: import("superstruct").Struct<string, null>;
272
+ }>;
273
+ }>;
274
+ export type MintToChecked = Infer<typeof MintToChecked>;
275
+ declare const MintToChecked: import("superstruct").Struct<{
276
+ account: String;
277
+ mint: String;
278
+ tokenAmount: {
279
+ amount: string;
280
+ decimals: number;
281
+ uiAmountString: string;
282
+ };
283
+ mintAuthority?: String | undefined;
284
+ multisigMintAuthority?: String | undefined;
285
+ signers?: String[] | undefined;
286
+ }, {
287
+ account: import("superstruct").Struct<String, null>;
288
+ mint: import("superstruct").Struct<String, null>;
289
+ mintAuthority: import("superstruct").Struct<String | undefined, null>;
290
+ multisigMintAuthority: import("superstruct").Struct<String | undefined, null>;
291
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
292
+ tokenAmount: import("superstruct").Struct<{
293
+ amount: string;
294
+ decimals: number;
295
+ uiAmountString: string;
296
+ }, {
297
+ amount: import("superstruct").Struct<string, null>;
298
+ decimals: import("superstruct").Struct<number, null>;
299
+ uiAmountString: import("superstruct").Struct<string, null>;
300
+ }>;
301
+ }>;
302
+ export type BurnChecked = Infer<typeof BurnChecked>;
303
+ declare const BurnChecked: import("superstruct").Struct<{
304
+ account: String;
305
+ mint: String;
306
+ tokenAmount: {
307
+ amount: string;
308
+ decimals: number;
309
+ uiAmountString: string;
310
+ };
311
+ signers?: String[] | undefined;
312
+ authority?: String | undefined;
313
+ multisigAuthority?: String | undefined;
314
+ }, {
315
+ account: import("superstruct").Struct<String, null>;
316
+ mint: import("superstruct").Struct<String, null>;
317
+ authority: import("superstruct").Struct<String | undefined, null>;
318
+ multisigAuthority: import("superstruct").Struct<String | undefined, null>;
319
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
320
+ tokenAmount: import("superstruct").Struct<{
321
+ amount: string;
322
+ decimals: number;
323
+ uiAmountString: string;
324
+ }, {
325
+ amount: import("superstruct").Struct<string, null>;
326
+ decimals: import("superstruct").Struct<number, null>;
327
+ uiAmountString: import("superstruct").Struct<string, null>;
328
+ }>;
329
+ }>;
330
+ export type SyncNative = Infer<typeof BurnChecked>;
331
+ export type GetAccountDataSize = Infer<typeof GetAccountDataSize>;
332
+ declare const GetAccountDataSize: import("superstruct").Struct<{
333
+ mint: String;
334
+ extensionTypes?: string[] | undefined;
335
+ }, {
336
+ mint: import("superstruct").Struct<String, null>;
337
+ extensionTypes: import("superstruct").Struct<string[] | undefined, import("superstruct").Struct<string, null>>;
338
+ }>;
339
+ export type InitializeImmutableOwner = Infer<typeof InitializeImmutableOwner>;
340
+ declare const InitializeImmutableOwner: import("superstruct").Struct<{
341
+ account: String;
342
+ }, {
343
+ account: import("superstruct").Struct<String, null>;
344
+ }>;
345
+ export type AmountToUiAmount = Infer<typeof AmountToUiAmount>;
346
+ declare const AmountToUiAmount: import("superstruct").Struct<{
347
+ amount: string | number;
348
+ mint: String;
349
+ }, {
350
+ mint: import("superstruct").Struct<String, null>;
351
+ amount: import("superstruct").Struct<string | number, null>;
352
+ }>;
353
+ export type UiAmountToAmount = Infer<typeof UiAmountToAmount>;
354
+ declare const UiAmountToAmount: import("superstruct").Struct<{
355
+ mint: String;
356
+ uiAmount: string;
357
+ }, {
358
+ mint: import("superstruct").Struct<String, null>;
359
+ uiAmount: import("superstruct").Struct<string, null>;
360
+ }>;
361
+ export type InitializeMintCloseAuthority = Infer<typeof InitializeMintCloseAuthority>;
362
+ declare const InitializeMintCloseAuthority: import("superstruct").Struct<{
363
+ mint: String;
364
+ newAuthority: String;
365
+ }, {
366
+ mint: import("superstruct").Struct<String, null>;
367
+ newAuthority: import("superstruct").Struct<String, null>;
368
+ }>;
369
+ export type TransferFeeExtension = Infer<typeof TransferFeeExtension>;
370
+ declare const TransferFeeExtension: import("superstruct").Struct<{
371
+ mint: String;
372
+ transferFeeConfigAuthority: String;
373
+ withdrawWitheldAuthority: String;
374
+ transferFeeBasisPoints: number;
375
+ maximumFee: number;
376
+ }, {
377
+ mint: import("superstruct").Struct<String, null>;
378
+ transferFeeConfigAuthority: import("superstruct").Struct<String, null>;
379
+ withdrawWitheldAuthority: import("superstruct").Struct<String, null>;
380
+ transferFeeBasisPoints: import("superstruct").Struct<number, null>;
381
+ maximumFee: import("superstruct").Struct<number, null>;
382
+ }>;
383
+ export type DefaultAccountStateExtension = Infer<typeof DefaultAccountStateExtension>;
384
+ declare const DefaultAccountStateExtension: import("superstruct").Struct<{
385
+ mint: String;
386
+ accountState: string;
387
+ freezeAuthority?: String | undefined;
388
+ }, {
389
+ mint: import("superstruct").Struct<String, null>;
390
+ accountState: import("superstruct").Struct<string, null>;
391
+ freezeAuthority: import("superstruct").Struct<String | undefined, null>;
392
+ }>;
393
+ export type Reallocate = Infer<typeof Reallocate>;
394
+ declare const Reallocate: import("superstruct").Struct<{
395
+ account: String;
396
+ extensionTypes: string[];
397
+ payer: String;
398
+ systemProgram: String;
399
+ }, {
400
+ account: import("superstruct").Struct<String, null>;
401
+ payer: import("superstruct").Struct<String, null>;
402
+ systemProgram: import("superstruct").Struct<String, null>;
403
+ extensionTypes: import("superstruct").Struct<string[], import("superstruct").Struct<string, null>>;
404
+ }>;
405
+ export type MemoTransferExtension = Infer<typeof MemoTransferExtension>;
406
+ declare const MemoTransferExtension: import("superstruct").Struct<{
407
+ account: String;
408
+ signers?: String[] | undefined;
409
+ owner?: String | undefined;
410
+ multisigOwner?: String | undefined;
411
+ }, {
412
+ account: import("superstruct").Struct<String, null>;
413
+ owner: import("superstruct").Struct<String | undefined, null>;
414
+ multisigOwner: import("superstruct").Struct<String | undefined, null>;
415
+ signers: import("superstruct").Struct<String[] | undefined, import("superstruct").Struct<String, null>>;
416
+ }>;
417
+ export type CreateNativeMint = Infer<typeof CreateNativeMint>;
418
+ declare const CreateNativeMint: import("superstruct").Struct<{
419
+ payer: String;
420
+ systemProgram: String;
421
+ nativeMint: String;
422
+ }, {
423
+ payer: import("superstruct").Struct<String, null>;
424
+ nativeMint: import("superstruct").Struct<String, null>;
425
+ systemProgram: import("superstruct").Struct<String, null>;
426
+ }>;
427
+ export {};
@@ -0,0 +1,200 @@
1
+ /* eslint-disable @typescript-eslint/no-redeclare */
2
+ // copy from https://github.com/solana-labs/solana/blob/master/explorer/src/components/instruction/token/types.ts
3
+ import { enums, type, number, string, optional, array, nullable, union, coerce, instance, } from "superstruct";
4
+ // Replace with string
5
+ export const PublicKeyFromString = coerce(instance(String), string(), (value) => (value));
6
+ export const TokenAmountUi = type({
7
+ amount: string(),
8
+ decimals: number(),
9
+ uiAmountString: string(),
10
+ });
11
+ const InitializeMint = type({
12
+ mint: PublicKeyFromString,
13
+ decimals: number(),
14
+ mintAuthority: PublicKeyFromString,
15
+ rentSysvar: PublicKeyFromString,
16
+ freezeAuthority: optional(PublicKeyFromString),
17
+ });
18
+ const InitializeAccount = type({
19
+ account: PublicKeyFromString,
20
+ mint: PublicKeyFromString,
21
+ owner: PublicKeyFromString,
22
+ rentSysvar: PublicKeyFromString,
23
+ });
24
+ const InitializeAccount2 = type({
25
+ account: PublicKeyFromString,
26
+ mint: PublicKeyFromString,
27
+ rentSysvar: PublicKeyFromString,
28
+ owner: PublicKeyFromString,
29
+ });
30
+ const InitializeAccount3 = type({
31
+ account: PublicKeyFromString,
32
+ mint: PublicKeyFromString,
33
+ owner: PublicKeyFromString,
34
+ });
35
+ const InitializeMultisig = type({
36
+ multisig: PublicKeyFromString,
37
+ rentSysvar: PublicKeyFromString,
38
+ signers: array(PublicKeyFromString),
39
+ m: number(),
40
+ });
41
+ export const Transfer = type({
42
+ source: PublicKeyFromString,
43
+ destination: PublicKeyFromString,
44
+ amount: union([string(), number()]),
45
+ authority: optional(PublicKeyFromString),
46
+ multisigAuthority: optional(PublicKeyFromString),
47
+ signers: optional(array(PublicKeyFromString)),
48
+ });
49
+ const Approve = type({
50
+ source: PublicKeyFromString,
51
+ delegate: PublicKeyFromString,
52
+ amount: union([string(), number()]),
53
+ owner: optional(PublicKeyFromString),
54
+ multisigOwner: optional(PublicKeyFromString),
55
+ signers: optional(array(PublicKeyFromString)),
56
+ });
57
+ const Revoke = type({
58
+ source: PublicKeyFromString,
59
+ owner: optional(PublicKeyFromString),
60
+ multisigOwner: optional(PublicKeyFromString),
61
+ signers: optional(array(PublicKeyFromString)),
62
+ });
63
+ const AuthorityType = enums([
64
+ "mintTokens",
65
+ "freezeAccount",
66
+ "accountOwner",
67
+ "closeAccount",
68
+ ]);
69
+ const SetAuthority = type({
70
+ mint: optional(PublicKeyFromString),
71
+ account: optional(PublicKeyFromString),
72
+ authorityType: AuthorityType,
73
+ newAuthority: nullable(PublicKeyFromString),
74
+ authority: optional(PublicKeyFromString),
75
+ multisigAuthority: optional(PublicKeyFromString),
76
+ signers: optional(array(PublicKeyFromString)),
77
+ });
78
+ const MintTo = type({
79
+ mint: PublicKeyFromString,
80
+ account: PublicKeyFromString,
81
+ amount: union([string(), number()]),
82
+ mintAuthority: optional(PublicKeyFromString),
83
+ multisigMintAuthority: optional(PublicKeyFromString),
84
+ signers: optional(array(PublicKeyFromString)),
85
+ });
86
+ const Burn = type({
87
+ account: PublicKeyFromString,
88
+ mint: PublicKeyFromString,
89
+ amount: union([string(), number()]),
90
+ authority: optional(PublicKeyFromString),
91
+ multisigAuthority: optional(PublicKeyFromString),
92
+ signers: optional(array(PublicKeyFromString)),
93
+ });
94
+ const CloseAccount = type({
95
+ account: PublicKeyFromString,
96
+ destination: PublicKeyFromString,
97
+ owner: optional(PublicKeyFromString),
98
+ multisigOwner: optional(PublicKeyFromString),
99
+ signers: optional(array(PublicKeyFromString)),
100
+ });
101
+ const FreezeAccount = type({
102
+ account: PublicKeyFromString,
103
+ mint: PublicKeyFromString,
104
+ freezeAuthority: optional(PublicKeyFromString),
105
+ multisigFreezeAuthority: optional(PublicKeyFromString),
106
+ signers: optional(array(PublicKeyFromString)),
107
+ });
108
+ const ThawAccount = type({
109
+ account: PublicKeyFromString,
110
+ mint: PublicKeyFromString,
111
+ freezeAuthority: optional(PublicKeyFromString),
112
+ multisigFreezeAuthority: optional(PublicKeyFromString),
113
+ signers: optional(array(PublicKeyFromString)),
114
+ });
115
+ export const TransferChecked = type({
116
+ source: PublicKeyFromString,
117
+ mint: PublicKeyFromString,
118
+ destination: PublicKeyFromString,
119
+ authority: optional(PublicKeyFromString),
120
+ multisigAuthority: optional(PublicKeyFromString),
121
+ signers: optional(array(PublicKeyFromString)),
122
+ tokenAmount: TokenAmountUi,
123
+ });
124
+ const ApproveChecked = type({
125
+ source: PublicKeyFromString,
126
+ mint: PublicKeyFromString,
127
+ delegate: PublicKeyFromString,
128
+ owner: optional(PublicKeyFromString),
129
+ multisigOwner: optional(PublicKeyFromString),
130
+ signers: optional(array(PublicKeyFromString)),
131
+ tokenAmount: TokenAmountUi,
132
+ });
133
+ const MintToChecked = type({
134
+ account: PublicKeyFromString,
135
+ mint: PublicKeyFromString,
136
+ mintAuthority: optional(PublicKeyFromString),
137
+ multisigMintAuthority: optional(PublicKeyFromString),
138
+ signers: optional(array(PublicKeyFromString)),
139
+ tokenAmount: TokenAmountUi,
140
+ });
141
+ const BurnChecked = type({
142
+ account: PublicKeyFromString,
143
+ mint: PublicKeyFromString,
144
+ authority: optional(PublicKeyFromString),
145
+ multisigAuthority: optional(PublicKeyFromString),
146
+ signers: optional(array(PublicKeyFromString)),
147
+ tokenAmount: TokenAmountUi,
148
+ });
149
+ const SyncNative = type({
150
+ account: PublicKeyFromString,
151
+ });
152
+ const GetAccountDataSize = type({
153
+ mint: PublicKeyFromString,
154
+ extensionTypes: optional(array(string())),
155
+ });
156
+ const InitializeImmutableOwner = type({
157
+ account: PublicKeyFromString,
158
+ });
159
+ const AmountToUiAmount = type({
160
+ mint: PublicKeyFromString,
161
+ amount: union([string(), number()]),
162
+ });
163
+ const UiAmountToAmount = type({
164
+ mint: PublicKeyFromString,
165
+ uiAmount: string(),
166
+ });
167
+ const InitializeMintCloseAuthority = type({
168
+ mint: PublicKeyFromString,
169
+ newAuthority: PublicKeyFromString,
170
+ });
171
+ const TransferFeeExtension = type({
172
+ mint: PublicKeyFromString,
173
+ transferFeeConfigAuthority: PublicKeyFromString,
174
+ withdrawWitheldAuthority: PublicKeyFromString,
175
+ transferFeeBasisPoints: number(),
176
+ maximumFee: number(),
177
+ });
178
+ const DefaultAccountStateExtension = type({
179
+ mint: PublicKeyFromString,
180
+ accountState: string(),
181
+ freezeAuthority: optional(PublicKeyFromString),
182
+ });
183
+ const Reallocate = type({
184
+ account: PublicKeyFromString,
185
+ payer: PublicKeyFromString,
186
+ systemProgram: PublicKeyFromString,
187
+ extensionTypes: array(string()),
188
+ });
189
+ const MemoTransferExtension = type({
190
+ account: PublicKeyFromString,
191
+ owner: optional(PublicKeyFromString),
192
+ multisigOwner: optional(PublicKeyFromString),
193
+ signers: optional(array(PublicKeyFromString)),
194
+ });
195
+ const CreateNativeMint = type({
196
+ payer: PublicKeyFromString,
197
+ nativeMint: PublicKeyFromString,
198
+ systemProgram: PublicKeyFromString,
199
+ });
200
+ //# sourceMappingURL=types.js.map