sol-parser-sdk 0.5.9

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 (190) hide show
  1. package/.env.example +24 -0
  2. package/LICENSE +21 -0
  3. package/README.md +236 -0
  4. package/README_CN.md +236 -0
  5. package/dist/accounts/mod.d.ts +15 -0
  6. package/dist/accounts/mod.js +173 -0
  7. package/dist/accounts/nonce.d.ts +5 -0
  8. package/dist/accounts/nonce.js +32 -0
  9. package/dist/accounts/pumpfun.d.ts +16 -0
  10. package/dist/accounts/pumpfun.js +538 -0
  11. package/dist/accounts/pumpswap.d.ts +8 -0
  12. package/dist/accounts/pumpswap.js +192 -0
  13. package/dist/accounts/raydium_orca.d.ts +26 -0
  14. package/dist/accounts/raydium_orca.js +453 -0
  15. package/dist/accounts/rpc_wallet.d.ts +5 -0
  16. package/dist/accounts/rpc_wallet.js +18 -0
  17. package/dist/accounts/rust_aliases.d.ts +10 -0
  18. package/dist/accounts/rust_aliases.js +21 -0
  19. package/dist/accounts/token.d.ts +5 -0
  20. package/dist/accounts/token.js +98 -0
  21. package/dist/accounts/types.d.ts +9 -0
  22. package/dist/accounts/types.js +2 -0
  23. package/dist/accounts/utils.d.ts +1 -0
  24. package/dist/accounts/utils.js +12 -0
  25. package/dist/accounts/wallet_resolve.d.ts +1 -0
  26. package/dist/accounts/wallet_resolve.js +28 -0
  27. package/dist/common/constants.d.ts +10 -0
  28. package/dist/common/constants.js +13 -0
  29. package/dist/core/account_dispatcher_rpc.d.ts +11 -0
  30. package/dist/core/account_dispatcher_rpc.js +155 -0
  31. package/dist/core/account_fill_bonk.d.ts +4 -0
  32. package/dist/core/account_fill_bonk.js +20 -0
  33. package/dist/core/account_fill_meteora.d.ts +15 -0
  34. package/dist/core/account_fill_meteora.js +27 -0
  35. package/dist/core/account_fill_orca.d.ts +5 -0
  36. package/dist/core/account_fill_orca.js +18 -0
  37. package/dist/core/account_fill_pumpfun.d.ts +7 -0
  38. package/dist/core/account_fill_pumpfun.js +167 -0
  39. package/dist/core/account_fill_pumpswap.d.ts +10 -0
  40. package/dist/core/account_fill_pumpswap.js +128 -0
  41. package/dist/core/account_fill_raydium.d.ts +20 -0
  42. package/dist/core/account_fill_raydium.js +104 -0
  43. package/dist/core/account_fill_raydium_launchlab.d.ts +4 -0
  44. package/dist/core/account_fill_raydium_launchlab.js +20 -0
  45. package/dist/core/account_pubkey_cache.d.ts +12 -0
  46. package/dist/core/account_pubkey_cache.js +26 -0
  47. package/dist/core/clock.d.ts +8 -0
  48. package/dist/core/clock.js +20 -0
  49. package/dist/core/common_filler_rpc.d.ts +6 -0
  50. package/dist/core/common_filler_rpc.js +21 -0
  51. package/dist/core/dex_event.d.ts +1704 -0
  52. package/dist/core/dex_event.js +14 -0
  53. package/dist/core/error.d.ts +43 -0
  54. package/dist/core/error.js +16 -0
  55. package/dist/core/json_utils.d.ts +8 -0
  56. package/dist/core/json_utils.js +18 -0
  57. package/dist/core/metadata.d.ts +11 -0
  58. package/dist/core/metadata.js +13 -0
  59. package/dist/core/pumpfun_fee_enrich.d.ts +6 -0
  60. package/dist/core/pumpfun_fee_enrich.js +159 -0
  61. package/dist/core/rpc_invoke_map.d.ts +23 -0
  62. package/dist/core/rpc_invoke_map.js +157 -0
  63. package/dist/core/unified_parser.d.ts +19 -0
  64. package/dist/core/unified_parser.js +50 -0
  65. package/dist/grpc/client.d.ts +83 -0
  66. package/dist/grpc/client.js +645 -0
  67. package/dist/grpc/client_stub.d.ts +5 -0
  68. package/dist/grpc/client_stub.js +5 -0
  69. package/dist/grpc/event_parser.d.ts +6 -0
  70. package/dist/grpc/event_parser.js +15 -0
  71. package/dist/grpc/geyser_connect.d.ts +30 -0
  72. package/dist/grpc/geyser_connect.js +40 -0
  73. package/dist/grpc/log_instr_dedup.d.ts +2 -0
  74. package/dist/grpc/log_instr_dedup.js +402 -0
  75. package/dist/grpc/order_buffer.d.ts +27 -0
  76. package/dist/grpc/order_buffer.js +166 -0
  77. package/dist/grpc/program_ids.d.ts +27 -0
  78. package/dist/grpc/program_ids.js +61 -0
  79. package/dist/grpc/rpc_to_grpc.d.ts +18 -0
  80. package/dist/grpc/rpc_to_grpc.js +127 -0
  81. package/dist/grpc/subscribe_builder.d.ts +13 -0
  82. package/dist/grpc/subscribe_builder.js +66 -0
  83. package/dist/grpc/transaction_meta.d.ts +29 -0
  84. package/dist/grpc/transaction_meta.js +208 -0
  85. package/dist/grpc/types.d.ts +195 -0
  86. package/dist/grpc/types.js +551 -0
  87. package/dist/grpc/yellowstone_parse.d.ts +16 -0
  88. package/dist/grpc/yellowstone_parse.js +62 -0
  89. package/dist/index.d.ts +50 -0
  90. package/dist/index.js +298 -0
  91. package/dist/instr/bonk_ix.d.ts +8 -0
  92. package/dist/instr/bonk_ix.js +131 -0
  93. package/dist/instr/inner.d.ts +4 -0
  94. package/dist/instr/inner.js +453 -0
  95. package/dist/instr/meteora_damm_ix.d.ts +8 -0
  96. package/dist/instr/meteora_damm_ix.js +601 -0
  97. package/dist/instr/meteora_dlmm_ix.d.ts +2 -0
  98. package/dist/instr/meteora_dlmm_ix.js +134 -0
  99. package/dist/instr/meteora_pools_ix.d.ts +2 -0
  100. package/dist/instr/meteora_pools_ix.js +78 -0
  101. package/dist/instr/mod.d.ts +18 -0
  102. package/dist/instr/mod.js +129 -0
  103. package/dist/instr/orca_whirlpool_ix.d.ts +8 -0
  104. package/dist/instr/orca_whirlpool_ix.js +119 -0
  105. package/dist/instr/program_ids.d.ts +4 -0
  106. package/dist/instr/program_ids.js +20 -0
  107. package/dist/instr/pump_fees_ix.d.ts +2 -0
  108. package/dist/instr/pump_fees_ix.js +168 -0
  109. package/dist/instr/pumpfun_ix.d.ts +6 -0
  110. package/dist/instr/pumpfun_ix.js +448 -0
  111. package/dist/instr/pumpswap_ix.d.ts +5 -0
  112. package/dist/instr/pumpswap_ix.js +270 -0
  113. package/dist/instr/raydium_amm_v4_ix.d.ts +6 -0
  114. package/dist/instr/raydium_amm_v4_ix.js +112 -0
  115. package/dist/instr/raydium_clmm_ix.d.ts +5 -0
  116. package/dist/instr/raydium_clmm_ix.js +184 -0
  117. package/dist/instr/raydium_cpmm_ix.d.ts +5 -0
  118. package/dist/instr/raydium_cpmm_ix.js +109 -0
  119. package/dist/instr/raydium_launchlab_ix.d.ts +8 -0
  120. package/dist/instr/raydium_launchlab_ix.js +125 -0
  121. package/dist/instr/rust_aliases.d.ts +10 -0
  122. package/dist/instr/rust_aliases.js +20 -0
  123. package/dist/instr/utils.d.ts +10 -0
  124. package/dist/instr/utils.js +35 -0
  125. package/dist/logs/discriminator_lut.d.ts +19 -0
  126. package/dist/logs/discriminator_lut.js +62 -0
  127. package/dist/logs/meteora_amm.d.ts +8 -0
  128. package/dist/logs/meteora_amm.js +113 -0
  129. package/dist/logs/meteora_damm.d.ts +5 -0
  130. package/dist/logs/meteora_damm.js +367 -0
  131. package/dist/logs/meteora_dbc.d.ts +11 -0
  132. package/dist/logs/meteora_dbc.js +142 -0
  133. package/dist/logs/meteora_dlmm.d.ts +6 -0
  134. package/dist/logs/meteora_dlmm.js +201 -0
  135. package/dist/logs/optimized_matcher.d.ts +11 -0
  136. package/dist/logs/optimized_matcher.js +941 -0
  137. package/dist/logs/orca.d.ts +6 -0
  138. package/dist/logs/orca.js +148 -0
  139. package/dist/logs/program_data.d.ts +2 -0
  140. package/dist/logs/program_data.js +20 -0
  141. package/dist/logs/program_log_discriminators.d.ts +80 -0
  142. package/dist/logs/program_log_discriminators.js +88 -0
  143. package/dist/logs/pump.d.ts +14 -0
  144. package/dist/logs/pump.js +378 -0
  145. package/dist/logs/pump_amm.d.ts +9 -0
  146. package/dist/logs/pump_amm.js +418 -0
  147. package/dist/logs/pump_fees.d.ts +23 -0
  148. package/dist/logs/pump_fees.js +364 -0
  149. package/dist/logs/raydium_amm.d.ts +9 -0
  150. package/dist/logs/raydium_amm.js +224 -0
  151. package/dist/logs/raydium_clmm.d.ts +17 -0
  152. package/dist/logs/raydium_clmm.js +624 -0
  153. package/dist/logs/raydium_cpmm.d.ts +7 -0
  154. package/dist/logs/raydium_cpmm.js +121 -0
  155. package/dist/logs/raydium_launchlab.d.ts +10 -0
  156. package/dist/logs/raydium_launchlab.js +84 -0
  157. package/dist/logs/raydium_launchpad.d.ts +12 -0
  158. package/dist/logs/raydium_launchpad.js +92 -0
  159. package/dist/logs/rust_aliases.d.ts +7 -0
  160. package/dist/logs/rust_aliases.js +16 -0
  161. package/dist/parser_alias.d.ts +3 -0
  162. package/dist/parser_alias.js +2 -0
  163. package/dist/rpc_parser.d.ts +17 -0
  164. package/dist/rpc_parser.js +39 -0
  165. package/dist/rpc_transaction.d.ts +27 -0
  166. package/dist/rpc_transaction.js +416 -0
  167. package/dist/shredstream/alt_lookup.d.ts +9 -0
  168. package/dist/shredstream/alt_lookup.js +70 -0
  169. package/dist/shredstream/client.d.ts +65 -0
  170. package/dist/shredstream/client.js +403 -0
  171. package/dist/shredstream/config.d.ts +30 -0
  172. package/dist/shredstream/config.js +34 -0
  173. package/dist/shredstream/entries_decode.d.ts +28 -0
  174. package/dist/shredstream/entries_decode.js +251 -0
  175. package/dist/shredstream/index.d.ts +17 -0
  176. package/dist/shredstream/index.js +33 -0
  177. package/dist/shredstream/instruction_parse.d.ts +34 -0
  178. package/dist/shredstream/instruction_parse.js +79 -0
  179. package/dist/shredstream/proto_types.d.ts +9 -0
  180. package/dist/shredstream/proto_types.js +2 -0
  181. package/dist/shredstream/shredstream.proto +15 -0
  182. package/dist/shredstream/wire_to_shred_tx.d.ts +2 -0
  183. package/dist/shredstream/wire_to_shred_tx.js +59 -0
  184. package/dist/util/binary.d.ts +14 -0
  185. package/dist/util/binary.js +82 -0
  186. package/dist/util/market.d.ts +18 -0
  187. package/dist/util/market.js +54 -0
  188. package/dist/warmup.d.ts +3 -0
  189. package/dist/warmup.js +23 -0
  190. package/package.json +61 -0
@@ -0,0 +1,418 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PUMPSWAP_DISC = void 0;
4
+ exports.parseBuyFromData = parseBuyFromData;
5
+ exports.parseSellFromData = parseSellFromData;
6
+ exports.parseCreatePoolFromData = parseCreatePoolFromData;
7
+ exports.parseAddLiquidityFromData = parseAddLiquidityFromData;
8
+ exports.parseRemoveLiquidityFromData = parseRemoveLiquidityFromData;
9
+ const dex_event_js_1 = require("../core/dex_event.js");
10
+ const binary_js_1 = require("../util/binary.js");
11
+ const program_log_discriminators_js_1 = require("./program_log_discriminators.js");
12
+ Object.defineProperty(exports, "PUMPSWAP_DISC", { enumerable: true, get: function () { return program_log_discriminators_js_1.PUMPSWAP_DISC; } });
13
+ function bn64(v) {
14
+ return v ?? 0n;
15
+ }
16
+ function bnI64(v) {
17
+ return v ?? 0n;
18
+ }
19
+ const ZP = (0, dex_event_js_1.defaultPubkey)();
20
+ function parseBuyFromData(data, metadata) {
21
+ const MIN = 16 * 8 + 7 * 32 + 1 + 5 * 8 + 4;
22
+ if (data.length < MIN)
23
+ return null;
24
+ let o = 0;
25
+ const timestamp = bnI64((0, binary_js_1.readI64LE)(data, o));
26
+ o += 8;
27
+ const base_amount_out = bn64((0, binary_js_1.readU64LE)(data, o));
28
+ o += 8;
29
+ const max_quote_amount_in = bn64((0, binary_js_1.readU64LE)(data, o));
30
+ o += 8;
31
+ const user_base_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
32
+ o += 8;
33
+ const user_quote_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
34
+ o += 8;
35
+ const pool_base_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
36
+ o += 8;
37
+ const pool_quote_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
38
+ o += 8;
39
+ const quote_amount_in = bn64((0, binary_js_1.readU64LE)(data, o));
40
+ o += 8;
41
+ const lp_fee_basis_points = bn64((0, binary_js_1.readU64LE)(data, o));
42
+ o += 8;
43
+ const lp_fee = bn64((0, binary_js_1.readU64LE)(data, o));
44
+ o += 8;
45
+ const protocol_fee_basis_points = bn64((0, binary_js_1.readU64LE)(data, o));
46
+ o += 8;
47
+ const protocol_fee = bn64((0, binary_js_1.readU64LE)(data, o));
48
+ o += 8;
49
+ const quote_amount_in_with_lp_fee = bn64((0, binary_js_1.readU64LE)(data, o));
50
+ o += 8;
51
+ const user_quote_amount_in = bn64((0, binary_js_1.readU64LE)(data, o));
52
+ o += 8;
53
+ const pool = (0, binary_js_1.readPubkey)(data, o);
54
+ o += 32;
55
+ const user = (0, binary_js_1.readPubkey)(data, o);
56
+ o += 32;
57
+ const user_base_token_account = (0, binary_js_1.readPubkey)(data, o);
58
+ o += 32;
59
+ const user_quote_token_account = (0, binary_js_1.readPubkey)(data, o);
60
+ o += 32;
61
+ const protocol_fee_recipient = (0, binary_js_1.readPubkey)(data, o);
62
+ o += 32;
63
+ const protocol_fee_recipient_token_account = (0, binary_js_1.readPubkey)(data, o);
64
+ o += 32;
65
+ const coin_creator = (0, binary_js_1.readPubkey)(data, o);
66
+ o += 32;
67
+ const coin_creator_fee_basis_points = bn64((0, binary_js_1.readU64LE)(data, o));
68
+ o += 8;
69
+ const coin_creator_fee = bn64((0, binary_js_1.readU64LE)(data, o));
70
+ o += 8;
71
+ const track_volume = (0, binary_js_1.readBool)(data, o);
72
+ o += 1;
73
+ const total_unclaimed_tokens = bn64((0, binary_js_1.readU64LE)(data, o));
74
+ o += 8;
75
+ const total_claimed_tokens = bn64((0, binary_js_1.readU64LE)(data, o));
76
+ o += 8;
77
+ const current_sol_volume = bn64((0, binary_js_1.readU64LE)(data, o));
78
+ o += 8;
79
+ const last_update_timestamp = bnI64((0, binary_js_1.readI64LE)(data, o));
80
+ o += 8;
81
+ const min_base_amount_out = bn64((0, binary_js_1.readU64LE)(data, o));
82
+ o += 8;
83
+ let ix_name = "";
84
+ if (o + 4 <= data.length) {
85
+ const len = (0, binary_js_1.readU32LE)(data, o);
86
+ o += 4;
87
+ if (o + len <= data.length) {
88
+ ix_name = new TextDecoder().decode(data.subarray(o, o + len));
89
+ }
90
+ }
91
+ const ev = {
92
+ metadata,
93
+ timestamp,
94
+ base_amount_out,
95
+ max_quote_amount_in,
96
+ user_base_token_reserves,
97
+ user_quote_token_reserves,
98
+ pool_base_token_reserves,
99
+ pool_quote_token_reserves,
100
+ quote_amount_in,
101
+ lp_fee_basis_points,
102
+ lp_fee,
103
+ protocol_fee_basis_points,
104
+ protocol_fee,
105
+ quote_amount_in_with_lp_fee,
106
+ user_quote_amount_in,
107
+ pool,
108
+ user,
109
+ user_base_token_account,
110
+ user_quote_token_account,
111
+ protocol_fee_recipient,
112
+ protocol_fee_recipient_token_account,
113
+ coin_creator,
114
+ coin_creator_fee_basis_points,
115
+ coin_creator_fee,
116
+ track_volume,
117
+ total_unclaimed_tokens,
118
+ total_claimed_tokens,
119
+ current_sol_volume,
120
+ last_update_timestamp,
121
+ min_base_amount_out,
122
+ ix_name,
123
+ cashback_fee_basis_points: 0n,
124
+ cashback: 0n,
125
+ is_pump_pool: false,
126
+ base_mint: ZP,
127
+ quote_mint: ZP,
128
+ pool_base_token_account: ZP,
129
+ pool_quote_token_account: ZP,
130
+ coin_creator_vault_ata: ZP,
131
+ coin_creator_vault_authority: ZP,
132
+ base_token_program: ZP,
133
+ quote_token_program: ZP,
134
+ };
135
+ return { PumpSwapBuy: ev };
136
+ }
137
+ function parseSellFromData(data, metadata) {
138
+ const REQUIRED = 13 * 8 + 7 * 32;
139
+ if (data.length < REQUIRED)
140
+ return null;
141
+ let o = 0;
142
+ const timestamp = bnI64((0, binary_js_1.readI64LE)(data, o));
143
+ o += 8;
144
+ const base_amount_in = bn64((0, binary_js_1.readU64LE)(data, o));
145
+ o += 8;
146
+ const min_quote_amount_out = bn64((0, binary_js_1.readU64LE)(data, o));
147
+ o += 8;
148
+ const user_base_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
149
+ o += 8;
150
+ const user_quote_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
151
+ o += 8;
152
+ const pool_base_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
153
+ o += 8;
154
+ const pool_quote_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
155
+ o += 8;
156
+ const quote_amount_out = bn64((0, binary_js_1.readU64LE)(data, o));
157
+ o += 8;
158
+ const lp_fee_basis_points = bn64((0, binary_js_1.readU64LE)(data, o));
159
+ o += 8;
160
+ const lp_fee = bn64((0, binary_js_1.readU64LE)(data, o));
161
+ o += 8;
162
+ const protocol_fee_basis_points = bn64((0, binary_js_1.readU64LE)(data, o));
163
+ o += 8;
164
+ const protocol_fee = bn64((0, binary_js_1.readU64LE)(data, o));
165
+ o += 8;
166
+ const quote_amount_out_without_lp_fee = bn64((0, binary_js_1.readU64LE)(data, o));
167
+ o += 8;
168
+ const user_quote_amount_out = bn64((0, binary_js_1.readU64LE)(data, o));
169
+ o += 8;
170
+ const pool = (0, binary_js_1.readPubkey)(data, o);
171
+ o += 32;
172
+ const user = (0, binary_js_1.readPubkey)(data, o);
173
+ o += 32;
174
+ const user_base_token_account = (0, binary_js_1.readPubkey)(data, o);
175
+ o += 32;
176
+ const user_quote_token_account = (0, binary_js_1.readPubkey)(data, o);
177
+ o += 32;
178
+ const protocol_fee_recipient = (0, binary_js_1.readPubkey)(data, o);
179
+ o += 32;
180
+ const protocol_fee_recipient_token_account = (0, binary_js_1.readPubkey)(data, o);
181
+ o += 32;
182
+ const coin_creator = (0, binary_js_1.readPubkey)(data, o);
183
+ o += 32;
184
+ const coin_creator_fee_basis_points = bn64((0, binary_js_1.readU64LE)(data, o));
185
+ o += 8;
186
+ const coin_creator_fee = bn64((0, binary_js_1.readU64LE)(data, o));
187
+ o += 8;
188
+ let cashback_fee_basis_points = 0n;
189
+ let cashback = 0n;
190
+ if (data.length >= 368) {
191
+ cashback_fee_basis_points = bn64((0, binary_js_1.readU64LE)(data, 352));
192
+ cashback = bn64((0, binary_js_1.readU64LE)(data, 360));
193
+ }
194
+ const ev = {
195
+ metadata,
196
+ timestamp,
197
+ base_amount_in,
198
+ min_quote_amount_out,
199
+ user_base_token_reserves,
200
+ user_quote_token_reserves,
201
+ pool_base_token_reserves,
202
+ pool_quote_token_reserves,
203
+ quote_amount_out,
204
+ lp_fee_basis_points,
205
+ lp_fee,
206
+ protocol_fee_basis_points,
207
+ protocol_fee,
208
+ quote_amount_out_without_lp_fee,
209
+ user_quote_amount_out,
210
+ pool,
211
+ user,
212
+ user_base_token_account,
213
+ user_quote_token_account,
214
+ protocol_fee_recipient,
215
+ protocol_fee_recipient_token_account,
216
+ coin_creator,
217
+ coin_creator_fee_basis_points,
218
+ coin_creator_fee,
219
+ cashback_fee_basis_points,
220
+ cashback,
221
+ is_pump_pool: false,
222
+ base_mint: ZP,
223
+ quote_mint: ZP,
224
+ pool_base_token_account: ZP,
225
+ pool_quote_token_account: ZP,
226
+ coin_creator_vault_ata: ZP,
227
+ coin_creator_vault_authority: ZP,
228
+ base_token_program: ZP,
229
+ quote_token_program: ZP,
230
+ };
231
+ return { PumpSwapSell: ev };
232
+ }
233
+ function parseCreatePoolFromData(data, metadata) {
234
+ const REQUIRED = 8 + 2 + 32 * 6 + 2 + 8 * 7 + 1;
235
+ if (data.length < REQUIRED)
236
+ return null;
237
+ let o = 0;
238
+ const timestamp = bnI64((0, binary_js_1.readI64LE)(data, o));
239
+ o += 8;
240
+ const index = (0, binary_js_1.readU16LE)(data, o);
241
+ o += 2;
242
+ const creator = (0, binary_js_1.readPubkey)(data, o);
243
+ o += 32;
244
+ const base_mint = (0, binary_js_1.readPubkey)(data, o);
245
+ o += 32;
246
+ const quote_mint = (0, binary_js_1.readPubkey)(data, o);
247
+ o += 32;
248
+ const base_mint_decimals = (0, binary_js_1.readU8)(data, o);
249
+ o += 1;
250
+ const quote_mint_decimals = (0, binary_js_1.readU8)(data, o);
251
+ o += 1;
252
+ const base_amount_in = bn64((0, binary_js_1.readU64LE)(data, o));
253
+ o += 8;
254
+ const quote_amount_in = bn64((0, binary_js_1.readU64LE)(data, o));
255
+ o += 8;
256
+ const pool_base_amount = bn64((0, binary_js_1.readU64LE)(data, o));
257
+ o += 8;
258
+ const pool_quote_amount = bn64((0, binary_js_1.readU64LE)(data, o));
259
+ o += 8;
260
+ const minimum_liquidity = bn64((0, binary_js_1.readU64LE)(data, o));
261
+ o += 8;
262
+ const initial_liquidity = bn64((0, binary_js_1.readU64LE)(data, o));
263
+ o += 8;
264
+ const lp_token_amount_out = bn64((0, binary_js_1.readU64LE)(data, o));
265
+ o += 8;
266
+ const pool_bump = (0, binary_js_1.readU8)(data, o);
267
+ o += 1;
268
+ const pool = (0, binary_js_1.readPubkey)(data, o);
269
+ o += 32;
270
+ const lp_mint = (0, binary_js_1.readPubkey)(data, o);
271
+ o += 32;
272
+ const user_base_token_account = (0, binary_js_1.readPubkey)(data, o);
273
+ o += 32;
274
+ const user_quote_token_account = (0, binary_js_1.readPubkey)(data, o);
275
+ o += 32;
276
+ const coin_creator = (0, binary_js_1.readPubkey)(data, o);
277
+ o += 32;
278
+ const is_mayhem_mode = data.length > 325 && (0, binary_js_1.readBool)(data, 325) === true;
279
+ const ev = {
280
+ metadata,
281
+ timestamp,
282
+ index,
283
+ creator,
284
+ base_mint,
285
+ quote_mint,
286
+ base_mint_decimals,
287
+ quote_mint_decimals,
288
+ base_amount_in,
289
+ quote_amount_in,
290
+ pool_base_amount,
291
+ pool_quote_amount,
292
+ minimum_liquidity,
293
+ initial_liquidity,
294
+ lp_token_amount_out,
295
+ pool_bump,
296
+ pool,
297
+ lp_mint,
298
+ user_base_token_account,
299
+ user_quote_token_account,
300
+ coin_creator,
301
+ is_mayhem_mode,
302
+ };
303
+ return { PumpSwapCreatePool: ev };
304
+ }
305
+ function parseAddLiquidityFromData(data, metadata) {
306
+ const REQUIRED = 10 * 8 + 5 * 32;
307
+ if (data.length < REQUIRED)
308
+ return null;
309
+ let o = 0;
310
+ const timestamp = bnI64((0, binary_js_1.readI64LE)(data, o));
311
+ o += 8;
312
+ const lp_token_amount_out = bn64((0, binary_js_1.readU64LE)(data, o));
313
+ o += 8;
314
+ const max_base_amount_in = bn64((0, binary_js_1.readU64LE)(data, o));
315
+ o += 8;
316
+ const max_quote_amount_in = bn64((0, binary_js_1.readU64LE)(data, o));
317
+ o += 8;
318
+ const user_base_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
319
+ o += 8;
320
+ const user_quote_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
321
+ o += 8;
322
+ const pool_base_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
323
+ o += 8;
324
+ const pool_quote_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
325
+ o += 8;
326
+ const base_amount_in = bn64((0, binary_js_1.readU64LE)(data, o));
327
+ o += 8;
328
+ const quote_amount_in = bn64((0, binary_js_1.readU64LE)(data, o));
329
+ o += 8;
330
+ const lp_mint_supply = bn64((0, binary_js_1.readU64LE)(data, o));
331
+ o += 8;
332
+ const pool = (0, binary_js_1.readPubkey)(data, o);
333
+ o += 32;
334
+ const user = (0, binary_js_1.readPubkey)(data, o);
335
+ o += 32;
336
+ const user_base_token_account = (0, binary_js_1.readPubkey)(data, o);
337
+ o += 32;
338
+ const user_quote_token_account = (0, binary_js_1.readPubkey)(data, o);
339
+ o += 32;
340
+ const user_pool_token_account = (0, binary_js_1.readPubkey)(data, o);
341
+ const ev = {
342
+ metadata,
343
+ timestamp,
344
+ lp_token_amount_out,
345
+ max_base_amount_in,
346
+ max_quote_amount_in,
347
+ user_base_token_reserves,
348
+ user_quote_token_reserves,
349
+ pool_base_token_reserves,
350
+ pool_quote_token_reserves,
351
+ base_amount_in,
352
+ quote_amount_in,
353
+ lp_mint_supply,
354
+ pool,
355
+ user,
356
+ user_base_token_account,
357
+ user_quote_token_account,
358
+ user_pool_token_account,
359
+ };
360
+ return { PumpSwapLiquidityAdded: ev };
361
+ }
362
+ function parseRemoveLiquidityFromData(data, metadata) {
363
+ const REQUIRED = 10 * 8 + 5 * 32;
364
+ if (data.length < REQUIRED)
365
+ return null;
366
+ let o = 0;
367
+ const timestamp = bnI64((0, binary_js_1.readI64LE)(data, o));
368
+ o += 8;
369
+ const lp_token_amount_in = bn64((0, binary_js_1.readU64LE)(data, o));
370
+ o += 8;
371
+ const min_base_amount_out = bn64((0, binary_js_1.readU64LE)(data, o));
372
+ o += 8;
373
+ const min_quote_amount_out = bn64((0, binary_js_1.readU64LE)(data, o));
374
+ o += 8;
375
+ const user_base_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
376
+ o += 8;
377
+ const user_quote_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
378
+ o += 8;
379
+ const pool_base_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
380
+ o += 8;
381
+ const pool_quote_token_reserves = bn64((0, binary_js_1.readU64LE)(data, o));
382
+ o += 8;
383
+ const base_amount_out = bn64((0, binary_js_1.readU64LE)(data, o));
384
+ o += 8;
385
+ const quote_amount_out = bn64((0, binary_js_1.readU64LE)(data, o));
386
+ o += 8;
387
+ const lp_mint_supply = bn64((0, binary_js_1.readU64LE)(data, o));
388
+ o += 8;
389
+ const pool = (0, binary_js_1.readPubkey)(data, o);
390
+ o += 32;
391
+ const user = (0, binary_js_1.readPubkey)(data, o);
392
+ o += 32;
393
+ const user_base_token_account = (0, binary_js_1.readPubkey)(data, o);
394
+ o += 32;
395
+ const user_quote_token_account = (0, binary_js_1.readPubkey)(data, o);
396
+ o += 32;
397
+ const user_pool_token_account = (0, binary_js_1.readPubkey)(data, o);
398
+ const ev = {
399
+ metadata,
400
+ timestamp,
401
+ lp_token_amount_in,
402
+ min_base_amount_out,
403
+ min_quote_amount_out,
404
+ user_base_token_reserves,
405
+ user_quote_token_reserves,
406
+ pool_base_token_reserves,
407
+ pool_quote_token_reserves,
408
+ base_amount_out,
409
+ quote_amount_out,
410
+ lp_mint_supply,
411
+ pool,
412
+ user,
413
+ user_base_token_account,
414
+ user_quote_token_account,
415
+ user_pool_token_account,
416
+ };
417
+ return { PumpSwapLiquidityRemoved: ev };
418
+ }
@@ -0,0 +1,23 @@
1
+ import type { EventMetadata } from "../core/metadata.js";
2
+ import type { DexEvent, PumpFeesFeeTier, PumpFeesFees, PumpFeesShareholder } from "../core/dex_event.js";
3
+ export declare function readFeesAt(data: Uint8Array, offset: number): {
4
+ value: PumpFeesFees;
5
+ next: number;
6
+ } | null;
7
+ export declare function readShareholdersVec(data: Uint8Array, offset: number): {
8
+ value: PumpFeesShareholder[];
9
+ next: number;
10
+ } | null;
11
+ export declare function readFeeTiersVec(data: Uint8Array, offset: number): {
12
+ value: PumpFeesFeeTier[];
13
+ next: number;
14
+ } | null;
15
+ export declare function parseCreateFeeSharingConfigFromData(data: Uint8Array, metadata: EventMetadata): DexEvent | null;
16
+ export declare function parseInitializeFeeConfigFromData(data: Uint8Array, metadata: EventMetadata): DexEvent | null;
17
+ export declare function parseResetFeeSharingConfigFromData(data: Uint8Array, metadata: EventMetadata): DexEvent | null;
18
+ export declare function parseRevokeFeeSharingAuthorityFromData(data: Uint8Array, metadata: EventMetadata): DexEvent | null;
19
+ export declare function parseTransferFeeSharingAuthorityFromData(data: Uint8Array, metadata: EventMetadata): DexEvent | null;
20
+ export declare function parseUpdateAdminFromData(data: Uint8Array, metadata: EventMetadata): DexEvent | null;
21
+ export declare function parseUpdateFeeConfigFromData(data: Uint8Array, metadata: EventMetadata): DexEvent | null;
22
+ export declare function parseUpdateFeeSharesFromData(data: Uint8Array, metadata: EventMetadata): DexEvent | null;
23
+ export declare function parseUpsertFeeTiersFromData(data: Uint8Array, metadata: EventMetadata): DexEvent | null;