sol-parser-sdk-nodejs 0.3.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 (114) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +449 -0
  3. package/README_CN.md +343 -0
  4. package/dist/accounts/mod.d.ts +11 -0
  5. package/dist/accounts/mod.js +53 -0
  6. package/dist/accounts/nonce.d.ts +5 -0
  7. package/dist/accounts/nonce.js +32 -0
  8. package/dist/accounts/pumpswap.d.ts +8 -0
  9. package/dist/accounts/pumpswap.js +192 -0
  10. package/dist/accounts/token.d.ts +5 -0
  11. package/dist/accounts/token.js +98 -0
  12. package/dist/accounts/types.d.ts +9 -0
  13. package/dist/accounts/types.js +2 -0
  14. package/dist/accounts/utils.d.ts +1 -0
  15. package/dist/accounts/utils.js +12 -0
  16. package/dist/core/account_dispatcher_rpc.d.ts +11 -0
  17. package/dist/core/account_dispatcher_rpc.js +155 -0
  18. package/dist/core/account_fill_bonk.d.ts +4 -0
  19. package/dist/core/account_fill_bonk.js +20 -0
  20. package/dist/core/account_fill_meteora.d.ts +14 -0
  21. package/dist/core/account_fill_meteora.js +26 -0
  22. package/dist/core/account_fill_orca.d.ts +5 -0
  23. package/dist/core/account_fill_orca.js +18 -0
  24. package/dist/core/account_fill_pumpfun.d.ts +7 -0
  25. package/dist/core/account_fill_pumpfun.js +75 -0
  26. package/dist/core/account_fill_pumpswap.d.ts +10 -0
  27. package/dist/core/account_fill_pumpswap.js +78 -0
  28. package/dist/core/account_fill_raydium.d.ts +20 -0
  29. package/dist/core/account_fill_raydium.js +104 -0
  30. package/dist/core/clock.d.ts +2 -0
  31. package/dist/core/clock.js +7 -0
  32. package/dist/core/common_filler_rpc.d.ts +6 -0
  33. package/dist/core/common_filler_rpc.js +21 -0
  34. package/dist/core/dex_event.d.ts +1009 -0
  35. package/dist/core/dex_event.js +14 -0
  36. package/dist/core/error.d.ts +43 -0
  37. package/dist/core/error.js +16 -0
  38. package/dist/core/json_utils.d.ts +8 -0
  39. package/dist/core/json_utils.js +18 -0
  40. package/dist/core/metadata.d.ts +10 -0
  41. package/dist/core/metadata.js +13 -0
  42. package/dist/core/rpc_invoke_map.d.ts +23 -0
  43. package/dist/core/rpc_invoke_map.js +157 -0
  44. package/dist/core/unified_parser.d.ts +19 -0
  45. package/dist/core/unified_parser.js +48 -0
  46. package/dist/grpc/client.d.ts +52 -0
  47. package/dist/grpc/client.js +309 -0
  48. package/dist/grpc/client_stub.d.ts +5 -0
  49. package/dist/grpc/client_stub.js +5 -0
  50. package/dist/grpc/types.d.ts +132 -0
  51. package/dist/grpc/types.js +304 -0
  52. package/dist/grpc/yellowstone_parse.d.ts +9 -0
  53. package/dist/grpc/yellowstone_parse.js +46 -0
  54. package/dist/index.d.ts +18 -0
  55. package/dist/index.js +99 -0
  56. package/dist/instr/bonk_ix.d.ts +5 -0
  57. package/dist/instr/bonk_ix.js +52 -0
  58. package/dist/instr/meteora_damm_ix.d.ts +6 -0
  59. package/dist/instr/meteora_damm_ix.js +349 -0
  60. package/dist/instr/mod.d.ts +15 -0
  61. package/dist/instr/mod.js +95 -0
  62. package/dist/instr/orca_whirlpool_ix.d.ts +5 -0
  63. package/dist/instr/orca_whirlpool_ix.js +73 -0
  64. package/dist/instr/program_ids.d.ts +14 -0
  65. package/dist/instr/program_ids.js +18 -0
  66. package/dist/instr/pumpfun_ix.d.ts +5 -0
  67. package/dist/instr/pumpfun_ix.js +167 -0
  68. package/dist/instr/pumpswap_ix.d.ts +5 -0
  69. package/dist/instr/pumpswap_ix.js +215 -0
  70. package/dist/instr/raydium_amm_v4_ix.d.ts +6 -0
  71. package/dist/instr/raydium_amm_v4_ix.js +46 -0
  72. package/dist/instr/raydium_clmm_ix.d.ts +5 -0
  73. package/dist/instr/raydium_clmm_ix.js +85 -0
  74. package/dist/instr/raydium_cpmm_ix.d.ts +5 -0
  75. package/dist/instr/raydium_cpmm_ix.js +63 -0
  76. package/dist/instr/utils.d.ts +10 -0
  77. package/dist/instr/utils.js +33 -0
  78. package/dist/logs/meteora_amm.d.ts +8 -0
  79. package/dist/logs/meteora_amm.js +113 -0
  80. package/dist/logs/meteora_damm.d.ts +6 -0
  81. package/dist/logs/meteora_damm.js +509 -0
  82. package/dist/logs/meteora_dlmm.d.ts +6 -0
  83. package/dist/logs/meteora_dlmm.js +201 -0
  84. package/dist/logs/optimized_matcher.d.ts +5 -0
  85. package/dist/logs/optimized_matcher.js +194 -0
  86. package/dist/logs/orca.d.ts +6 -0
  87. package/dist/logs/orca.js +148 -0
  88. package/dist/logs/program_data.d.ts +2 -0
  89. package/dist/logs/program_data.js +22 -0
  90. package/dist/logs/program_log_discriminators.d.ts +59 -0
  91. package/dist/logs/program_log_discriminators.js +67 -0
  92. package/dist/logs/pump.d.ts +12 -0
  93. package/dist/logs/pump.js +251 -0
  94. package/dist/logs/pump_amm.d.ts +9 -0
  95. package/dist/logs/pump_amm.js +418 -0
  96. package/dist/logs/raydium_amm.d.ts +9 -0
  97. package/dist/logs/raydium_amm.js +224 -0
  98. package/dist/logs/raydium_clmm.d.ts +8 -0
  99. package/dist/logs/raydium_clmm.js +141 -0
  100. package/dist/logs/raydium_cpmm.d.ts +7 -0
  101. package/dist/logs/raydium_cpmm.js +121 -0
  102. package/dist/logs/raydium_launchpad.d.ts +12 -0
  103. package/dist/logs/raydium_launchpad.js +92 -0
  104. package/dist/parser_alias.d.ts +3 -0
  105. package/dist/parser_alias.js +2 -0
  106. package/dist/rpc_parser.d.ts +16 -0
  107. package/dist/rpc_parser.js +36 -0
  108. package/dist/rpc_transaction.d.ts +25 -0
  109. package/dist/rpc_transaction.js +111 -0
  110. package/dist/util/binary.d.ts +14 -0
  111. package/dist/util/binary.js +82 -0
  112. package/dist/warmup.d.ts +3 -0
  113. package/dist/warmup.js +23 -0
  114. package/package.json +44 -0
@@ -0,0 +1,309 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.YellowstoneGrpc = void 0;
37
+ /**
38
+ * Yellowstone gRPC 客户端实现 - 基于 @triton-one/yellowstone-grpc
39
+ */
40
+ const yellowstone_grpc_1 = __importStar(require("@triton-one/yellowstone-grpc"));
41
+ const types_js_1 = require("./types.js");
42
+ /** Yellowstone gRPC 客户端包装器 */
43
+ class YellowstoneGrpc {
44
+ client;
45
+ config;
46
+ connected = false;
47
+ subscribers = new Map();
48
+ constructor(endpoint, xToken, config = (0, types_js_1.defaultClientConfig)()) {
49
+ this.config = config;
50
+ this.client = new yellowstone_grpc_1.default(endpoint, xToken || undefined, undefined);
51
+ }
52
+ /** 连接到 gRPC 服务器 */
53
+ async connect() {
54
+ if (this.connected) {
55
+ return;
56
+ }
57
+ this.connected = true;
58
+ }
59
+ /** 断开连接 */
60
+ async disconnect() {
61
+ for (const [, sub] of this.subscribers) {
62
+ sub.cancel();
63
+ }
64
+ this.subscribers.clear();
65
+ this.connected = false;
66
+ }
67
+ /** 检查是否已连接 */
68
+ isConnected() {
69
+ return this.connected;
70
+ }
71
+ /** 获取客户端配置 */
72
+ getConfig() {
73
+ return this.config;
74
+ }
75
+ /** 转换 SlotStatus */
76
+ convertSlotStatus(status) {
77
+ const map = {
78
+ 0: "Processed",
79
+ 1: "Confirmed",
80
+ 2: "Finalized",
81
+ 3: "FirstShredReceived",
82
+ 4: "Completed",
83
+ 5: "CreatedBank",
84
+ 6: "Dead",
85
+ };
86
+ return map[status] ?? "Processed";
87
+ }
88
+ /** 转换订阅更新 */
89
+ convertUpdate(update) {
90
+ const result = {
91
+ filters: update.filters,
92
+ };
93
+ if (update.account) {
94
+ const acc = update.account;
95
+ result.account = {
96
+ slot: acc.slot,
97
+ isStartup: acc.isStartup,
98
+ };
99
+ if (acc.account) {
100
+ result.account.account = {
101
+ pubkey: acc.account.pubkey,
102
+ lamports: acc.account.lamports,
103
+ owner: acc.account.owner,
104
+ executable: acc.account.executable,
105
+ rentEpoch: acc.account.rentEpoch,
106
+ data: acc.account.data,
107
+ writeVersion: acc.account.writeVersion,
108
+ txnSignature: acc.account.txnSignature,
109
+ };
110
+ }
111
+ }
112
+ if (update.slot) {
113
+ const slot = update.slot;
114
+ result.slot = {
115
+ slot: slot.slot,
116
+ status: this.convertSlotStatus(slot.status),
117
+ };
118
+ if (slot.parent !== undefined) {
119
+ result.slot.parent = slot.parent;
120
+ }
121
+ if (slot.deadError !== undefined) {
122
+ result.slot.deadError = slot.deadError;
123
+ }
124
+ }
125
+ if (update.transaction) {
126
+ const tx = update.transaction;
127
+ result.transaction = {
128
+ slot: tx.slot,
129
+ };
130
+ if (tx.transaction) {
131
+ result.transaction.transaction = {
132
+ signature: tx.transaction.signature,
133
+ isVote: tx.transaction.isVote,
134
+ transactionRaw: tx.transaction.transaction,
135
+ metaRaw: tx.transaction.meta,
136
+ index: tx.transaction.index,
137
+ };
138
+ }
139
+ }
140
+ if (update.block) {
141
+ const block = update.block;
142
+ result.block = {
143
+ slot: block.slot,
144
+ blockhash: block.blockhash,
145
+ parentSlot: block.parentSlot,
146
+ parentBlockhash: block.parentBlockhash,
147
+ executedTransactionCount: block.executedTransactionCount,
148
+ };
149
+ }
150
+ if (update.blockMeta) {
151
+ const meta = update.blockMeta;
152
+ result.blockMeta = {
153
+ slot: meta.slot,
154
+ blockhash: meta.blockhash,
155
+ parentSlot: meta.parentSlot,
156
+ parentBlockhash: meta.parentBlockhash,
157
+ executedTransactionCount: meta.executedTransactionCount,
158
+ };
159
+ }
160
+ if (update.ping) {
161
+ result.ping = {};
162
+ }
163
+ if (update.pong) {
164
+ result.pong = {
165
+ id: update.pong.id,
166
+ };
167
+ }
168
+ return result;
169
+ }
170
+ /** 订阅交易 */
171
+ async subscribeTransactions(filter, callbacks) {
172
+ const id = `sub_${Date.now()}_${Math.random().toString(36).slice(2)}`;
173
+ let isCancelled = false;
174
+ const cancel = () => {
175
+ isCancelled = true;
176
+ };
177
+ this.subscribers.set(id, { filter, callbacks, cancel });
178
+ (async () => {
179
+ try {
180
+ const stream = await this.client.subscribe();
181
+ await new Promise((resolve, reject) => {
182
+ stream.write({
183
+ transactions: {
184
+ client: {
185
+ accountInclude: filter.account_include,
186
+ accountExclude: filter.account_exclude,
187
+ accountRequired: filter.account_required,
188
+ vote: filter.vote,
189
+ failed: filter.failed,
190
+ signature: filter.signature,
191
+ },
192
+ },
193
+ accounts: {},
194
+ slots: {},
195
+ transactionsStatus: {},
196
+ entry: {},
197
+ blocks: {},
198
+ blocksMeta: {},
199
+ commitment: yellowstone_grpc_1.CommitmentLevel.CONFIRMED,
200
+ accountsDataSlice: [],
201
+ ping: undefined,
202
+ }, (err) => {
203
+ if (err)
204
+ reject(err);
205
+ else
206
+ resolve();
207
+ });
208
+ });
209
+ stream.on("data", (update) => {
210
+ if (isCancelled)
211
+ return;
212
+ if (!callbacks.onUpdate)
213
+ return;
214
+ try {
215
+ const converted = this.convertUpdate(update);
216
+ callbacks.onUpdate(converted);
217
+ }
218
+ catch (err) {
219
+ // 用户 onUpdate 内抛错(如同步 IO/画图)若未捕获,会破坏 gRPC duplex 流并触发 RST_STREAM。
220
+ const e = err instanceof Error ? err : new Error(String(err));
221
+ if (callbacks.onError) {
222
+ callbacks.onError(e);
223
+ }
224
+ }
225
+ });
226
+ stream.on("error", (err) => {
227
+ if (isCancelled)
228
+ return;
229
+ if (callbacks.onError) {
230
+ callbacks.onError(err);
231
+ }
232
+ });
233
+ stream.on("end", () => {
234
+ if (isCancelled)
235
+ return;
236
+ this.subscribers.delete(id);
237
+ if (callbacks.onEnd) {
238
+ callbacks.onEnd();
239
+ }
240
+ });
241
+ while (!isCancelled) {
242
+ await new Promise((resolve) => setTimeout(resolve, 100));
243
+ }
244
+ stream.end();
245
+ }
246
+ catch (err) {
247
+ if (isCancelled)
248
+ return;
249
+ this.subscribers.delete(id);
250
+ if (callbacks.onError) {
251
+ callbacks.onError(err);
252
+ }
253
+ }
254
+ })();
255
+ return {
256
+ id,
257
+ cancel: () => {
258
+ cancel();
259
+ this.subscribers.delete(id);
260
+ },
261
+ };
262
+ }
263
+ /** 取消订阅 */
264
+ unsubscribe(subId) {
265
+ const sub = this.subscribers.get(subId);
266
+ if (sub) {
267
+ sub.cancel();
268
+ this.subscribers.delete(subId);
269
+ }
270
+ }
271
+ /** 获取最新区块哈希 */
272
+ async getLatestBlockhash(commitment) {
273
+ const resp = await this.client.getLatestBlockhash(commitment);
274
+ return {
275
+ slot: Number(resp.slot),
276
+ blockhash: resp.blockhash,
277
+ lastValidBlockHeight: Number(resp.lastValidBlockHeight),
278
+ };
279
+ }
280
+ /** 获取区块高度 */
281
+ async getBlockHeight(commitment) {
282
+ const resp = await this.client.getBlockHeight(commitment);
283
+ return Number(resp);
284
+ }
285
+ /** 获取当前 Slot */
286
+ async getSlot(commitment) {
287
+ const resp = await this.client.getSlot(commitment);
288
+ return Number(resp);
289
+ }
290
+ /** 获取服务器版本 */
291
+ async getVersion() {
292
+ const resp = await this.client.getVersion();
293
+ return String(resp);
294
+ }
295
+ /** 验证区块哈希是否有效 */
296
+ async isBlockhashValid(blockhash, commitment) {
297
+ const resp = await this.client.isBlockhashValid(blockhash, commitment);
298
+ return {
299
+ slot: Number(resp.slot),
300
+ valid: resp.valid,
301
+ };
302
+ }
303
+ /** 发送 Ping 请求 */
304
+ async ping(count) {
305
+ const resp = await this.client.ping(count);
306
+ return Number(resp);
307
+ }
308
+ }
309
+ exports.YellowstoneGrpc = YellowstoneGrpc;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 此文件保留以兼容旧引用,实际实现已移至 client.ts
3
+ */
4
+ export type { SubscribeCallbacks } from "./client.js";
5
+ export { YellowstoneGrpc } from "./client.js";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.YellowstoneGrpc = void 0;
4
+ var client_js_1 = require("./client.js");
5
+ Object.defineProperty(exports, "YellowstoneGrpc", { enumerable: true, get: function () { return client_js_1.YellowstoneGrpc; } });
@@ -0,0 +1,132 @@
1
+ /** gRPC 订阅顺序模式 */
2
+ export type OrderMode = "Unordered" | "Ordered" | "StreamingOrdered" | "MicroBatch";
3
+ export type SlotStatus = "Processed" | "Confirmed" | "Finalized" | "FirstShredReceived" | "Completed" | "CreatedBank" | "Dead";
4
+ export interface SubscribeUpdateAccountInfo {
5
+ pubkey: Uint8Array;
6
+ lamports: string | bigint;
7
+ owner: Uint8Array;
8
+ executable: boolean;
9
+ rentEpoch: string | bigint;
10
+ data: Uint8Array;
11
+ writeVersion: string | bigint;
12
+ txnSignature?: Uint8Array;
13
+ }
14
+ export interface SubscribeUpdateAccount {
15
+ slot: string | bigint;
16
+ isStartup: boolean;
17
+ account?: SubscribeUpdateAccountInfo;
18
+ }
19
+ export interface SubscribeUpdateSlot {
20
+ slot: string | bigint;
21
+ parent?: string | bigint;
22
+ status: SlotStatus;
23
+ deadError?: string;
24
+ }
25
+ export interface SubscribeUpdateTransactionInfo {
26
+ signature: Uint8Array;
27
+ isVote: boolean;
28
+ /** 原始 proto Transaction 对象 */
29
+ transactionRaw?: unknown;
30
+ /** 原始 proto TransactionStatusMeta 对象(含 logMessages) */
31
+ metaRaw?: {
32
+ logMessages?: string[];
33
+ logMessagesNone?: boolean;
34
+ err?: unknown;
35
+ preBalances?: string[];
36
+ postBalances?: string[];
37
+ [key: string]: unknown;
38
+ };
39
+ index: string | bigint;
40
+ }
41
+ export interface SubscribeUpdateTransaction {
42
+ slot: string | bigint;
43
+ transaction?: SubscribeUpdateTransactionInfo;
44
+ }
45
+ export interface SubscribeUpdateBlock {
46
+ slot: string | bigint;
47
+ blockhash: string;
48
+ parentSlot: string | bigint;
49
+ parentBlockhash: string;
50
+ executedTransactionCount: string | bigint;
51
+ }
52
+ export interface SubscribeUpdateBlockMeta {
53
+ slot: string | bigint;
54
+ blockhash: string;
55
+ parentSlot: string | bigint;
56
+ parentBlockhash: string;
57
+ executedTransactionCount: string | bigint;
58
+ }
59
+ export interface SubscribeUpdatePing {
60
+ }
61
+ export interface SubscribeUpdatePong {
62
+ id: number;
63
+ }
64
+ export interface SubscribeUpdate {
65
+ filters: string[];
66
+ account?: SubscribeUpdateAccount;
67
+ slot?: SubscribeUpdateSlot;
68
+ transaction?: SubscribeUpdateTransaction;
69
+ block?: SubscribeUpdateBlock;
70
+ blockMeta?: SubscribeUpdateBlockMeta;
71
+ ping?: SubscribeUpdatePing;
72
+ pong?: SubscribeUpdatePong;
73
+ }
74
+ export interface SubscribeCallbacks {
75
+ onUpdate?: (update: SubscribeUpdate) => void;
76
+ onError?: (err: Error) => void;
77
+ onEnd?: () => void;
78
+ }
79
+ export interface ClientConfig {
80
+ enable_metrics: boolean;
81
+ connection_timeout_ms: number;
82
+ request_timeout_ms: number;
83
+ enable_tls: boolean;
84
+ max_retries: number;
85
+ retry_delay_ms: number;
86
+ max_concurrent_streams: number;
87
+ keep_alive_interval_ms: number;
88
+ keep_alive_timeout_ms: number;
89
+ buffer_size: number;
90
+ order_mode: OrderMode;
91
+ order_timeout_ms: number;
92
+ micro_batch_us: number;
93
+ }
94
+ export declare function defaultClientConfig(): ClientConfig;
95
+ export interface TransactionFilter {
96
+ account_include: string[];
97
+ account_exclude: string[];
98
+ account_required: string[];
99
+ }
100
+ export declare function newTransactionFilter(): TransactionFilter;
101
+ /** 事件类型过滤标签 */
102
+ export type EventType = "BlockMeta" | "PumpFunTrade" | "PumpFunBuy" | "PumpFunSell" | "PumpFunBuyExactSolIn" | "PumpFunCreate" | "PumpFunCreateV2" | "PumpFunComplete" | "PumpFunMigrate" | "PumpSwapTrade" | "PumpSwapBuy" | "PumpSwapSell" | "PumpSwapCreatePool" | "PumpSwapLiquidityAdded" | "PumpSwapLiquidityRemoved" | "RaydiumClmmSwap" | "RaydiumClmmIncreaseLiquidity" | "RaydiumClmmDecreaseLiquidity" | "RaydiumClmmCreatePool" | "RaydiumClmmOpenPosition" | "RaydiumClmmOpenPositionWithTokenExtNft" | "RaydiumClmmClosePosition" | "RaydiumClmmCollectFee" | "RaydiumCpmmSwap" | "RaydiumCpmmDeposit" | "RaydiumCpmmWithdraw" | "RaydiumCpmmInitialize" | "RaydiumAmmV4Swap" | "RaydiumAmmV4Deposit" | "RaydiumAmmV4Withdraw" | "RaydiumAmmV4WithdrawPnl" | "RaydiumAmmV4Initialize2" | "OrcaWhirlpoolSwap" | "OrcaWhirlpoolLiquidityIncreased" | "OrcaWhirlpoolLiquidityDecreased" | "OrcaWhirlpoolPoolInitialized" | "MeteoraPoolsSwap" | "MeteoraPoolsAddLiquidity" | "MeteoraPoolsRemoveLiquidity" | "MeteoraPoolsBootstrapLiquidity" | "MeteoraPoolsPoolCreated" | "MeteoraPoolsSetPoolFees" | "MeteoraDammV2Swap" | "MeteoraDammV2AddLiquidity" | "MeteoraDammV2RemoveLiquidity" | "MeteoraDammV2CreatePosition" | "MeteoraDammV2ClosePosition" | "MeteoraDammV2InitializePool" | "MeteoraDlmmSwap" | "MeteoraDlmmAddLiquidity" | "MeteoraDlmmRemoveLiquidity" | "MeteoraDlmmInitializePool" | "MeteoraDlmmInitializeBinArray" | "MeteoraDlmmCreatePosition" | "MeteoraDlmmClosePosition" | "MeteoraDlmmClaimFee" | "BonkTrade" | "BonkPoolCreate" | "BonkMigrateAmm" | "TokenAccount" | "TokenInfo" | "NonceAccount" | "AccountPumpSwapGlobalConfig" | "AccountPumpSwapPool";
103
+ /** 所有事件类型列表 */
104
+ export declare const ALL_EVENT_TYPES: EventType[];
105
+ export interface EventTypeFilter {
106
+ include_only?: EventType[];
107
+ exclude_types?: EventType[];
108
+ shouldInclude(eventType: EventType): boolean;
109
+ }
110
+ export declare function eventTypeFilterIncludeOnly(types: EventType[]): EventTypeFilter;
111
+ export declare function eventTypeFilterExclude(types: EventType[]): EventTypeFilter;
112
+ /** 过滤器是否包含 PumpFun 相关类型 */
113
+ export declare function eventTypeFilterIncludesPumpfun(filter: EventTypeFilter): boolean;
114
+ /** 过滤器是否包含 PumpSwap 相关类型 */
115
+ export declare function eventTypeFilterIncludesPumpswap(filter: EventTypeFilter): boolean;
116
+ /** 过滤器是否包含 Meteora DAMM V2 相关类型 */
117
+ export declare function eventTypeFilterIncludesMeteoraDammV2(filter: EventTypeFilter): boolean;
118
+ /** 过滤器是否包含 Raydium CLMM 相关类型 */
119
+ export declare function eventTypeFilterIncludesRaydiumClmm(filter: EventTypeFilter): boolean;
120
+ /** 过滤器是否包含 Raydium CPMM 相关类型 */
121
+ export declare function eventTypeFilterIncludesRaydiumCpmm(filter: EventTypeFilter): boolean;
122
+ /** 过滤器是否包含 Raydium AMM V4 相关类型 */
123
+ export declare function eventTypeFilterIncludesRaydiumAmmV4(filter: EventTypeFilter): boolean;
124
+ /** 过滤器是否包含 Orca Whirlpool 相关类型 */
125
+ export declare function eventTypeFilterIncludesOrcaWhirlpool(filter: EventTypeFilter): boolean;
126
+ /** 过滤器是否包含 Bonk Launchpad 相关类型 */
127
+ export declare function eventTypeFilterIncludesBonk(filter: EventTypeFilter): boolean;
128
+ /**
129
+ * `parseInstructionUnified` 前置白名单:仅当 `include_only` 与下列指令相关类型有交集时才解析指令。
130
+ * 若白名单中不含下列任一类型,则整条指令解析入口返回 null。
131
+ */
132
+ export declare function eventTypeFilterAllowsInstructionParsing(includeOnly: EventType[]): boolean;