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.
- package/LICENSE +21 -0
- package/README.md +449 -0
- package/README_CN.md +343 -0
- package/dist/accounts/mod.d.ts +11 -0
- package/dist/accounts/mod.js +53 -0
- package/dist/accounts/nonce.d.ts +5 -0
- package/dist/accounts/nonce.js +32 -0
- package/dist/accounts/pumpswap.d.ts +8 -0
- package/dist/accounts/pumpswap.js +192 -0
- package/dist/accounts/token.d.ts +5 -0
- package/dist/accounts/token.js +98 -0
- package/dist/accounts/types.d.ts +9 -0
- package/dist/accounts/types.js +2 -0
- package/dist/accounts/utils.d.ts +1 -0
- package/dist/accounts/utils.js +12 -0
- package/dist/core/account_dispatcher_rpc.d.ts +11 -0
- package/dist/core/account_dispatcher_rpc.js +155 -0
- package/dist/core/account_fill_bonk.d.ts +4 -0
- package/dist/core/account_fill_bonk.js +20 -0
- package/dist/core/account_fill_meteora.d.ts +14 -0
- package/dist/core/account_fill_meteora.js +26 -0
- package/dist/core/account_fill_orca.d.ts +5 -0
- package/dist/core/account_fill_orca.js +18 -0
- package/dist/core/account_fill_pumpfun.d.ts +7 -0
- package/dist/core/account_fill_pumpfun.js +75 -0
- package/dist/core/account_fill_pumpswap.d.ts +10 -0
- package/dist/core/account_fill_pumpswap.js +78 -0
- package/dist/core/account_fill_raydium.d.ts +20 -0
- package/dist/core/account_fill_raydium.js +104 -0
- package/dist/core/clock.d.ts +2 -0
- package/dist/core/clock.js +7 -0
- package/dist/core/common_filler_rpc.d.ts +6 -0
- package/dist/core/common_filler_rpc.js +21 -0
- package/dist/core/dex_event.d.ts +1009 -0
- package/dist/core/dex_event.js +14 -0
- package/dist/core/error.d.ts +43 -0
- package/dist/core/error.js +16 -0
- package/dist/core/json_utils.d.ts +8 -0
- package/dist/core/json_utils.js +18 -0
- package/dist/core/metadata.d.ts +10 -0
- package/dist/core/metadata.js +13 -0
- package/dist/core/rpc_invoke_map.d.ts +23 -0
- package/dist/core/rpc_invoke_map.js +157 -0
- package/dist/core/unified_parser.d.ts +19 -0
- package/dist/core/unified_parser.js +48 -0
- package/dist/grpc/client.d.ts +52 -0
- package/dist/grpc/client.js +309 -0
- package/dist/grpc/client_stub.d.ts +5 -0
- package/dist/grpc/client_stub.js +5 -0
- package/dist/grpc/types.d.ts +132 -0
- package/dist/grpc/types.js +304 -0
- package/dist/grpc/yellowstone_parse.d.ts +9 -0
- package/dist/grpc/yellowstone_parse.js +46 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +99 -0
- package/dist/instr/bonk_ix.d.ts +5 -0
- package/dist/instr/bonk_ix.js +52 -0
- package/dist/instr/meteora_damm_ix.d.ts +6 -0
- package/dist/instr/meteora_damm_ix.js +349 -0
- package/dist/instr/mod.d.ts +15 -0
- package/dist/instr/mod.js +95 -0
- package/dist/instr/orca_whirlpool_ix.d.ts +5 -0
- package/dist/instr/orca_whirlpool_ix.js +73 -0
- package/dist/instr/program_ids.d.ts +14 -0
- package/dist/instr/program_ids.js +18 -0
- package/dist/instr/pumpfun_ix.d.ts +5 -0
- package/dist/instr/pumpfun_ix.js +167 -0
- package/dist/instr/pumpswap_ix.d.ts +5 -0
- package/dist/instr/pumpswap_ix.js +215 -0
- package/dist/instr/raydium_amm_v4_ix.d.ts +6 -0
- package/dist/instr/raydium_amm_v4_ix.js +46 -0
- package/dist/instr/raydium_clmm_ix.d.ts +5 -0
- package/dist/instr/raydium_clmm_ix.js +85 -0
- package/dist/instr/raydium_cpmm_ix.d.ts +5 -0
- package/dist/instr/raydium_cpmm_ix.js +63 -0
- package/dist/instr/utils.d.ts +10 -0
- package/dist/instr/utils.js +33 -0
- package/dist/logs/meteora_amm.d.ts +8 -0
- package/dist/logs/meteora_amm.js +113 -0
- package/dist/logs/meteora_damm.d.ts +6 -0
- package/dist/logs/meteora_damm.js +509 -0
- package/dist/logs/meteora_dlmm.d.ts +6 -0
- package/dist/logs/meteora_dlmm.js +201 -0
- package/dist/logs/optimized_matcher.d.ts +5 -0
- package/dist/logs/optimized_matcher.js +194 -0
- package/dist/logs/orca.d.ts +6 -0
- package/dist/logs/orca.js +148 -0
- package/dist/logs/program_data.d.ts +2 -0
- package/dist/logs/program_data.js +22 -0
- package/dist/logs/program_log_discriminators.d.ts +59 -0
- package/dist/logs/program_log_discriminators.js +67 -0
- package/dist/logs/pump.d.ts +12 -0
- package/dist/logs/pump.js +251 -0
- package/dist/logs/pump_amm.d.ts +9 -0
- package/dist/logs/pump_amm.js +418 -0
- package/dist/logs/raydium_amm.d.ts +9 -0
- package/dist/logs/raydium_amm.js +224 -0
- package/dist/logs/raydium_clmm.d.ts +8 -0
- package/dist/logs/raydium_clmm.js +141 -0
- package/dist/logs/raydium_cpmm.d.ts +7 -0
- package/dist/logs/raydium_cpmm.js +121 -0
- package/dist/logs/raydium_launchpad.d.ts +12 -0
- package/dist/logs/raydium_launchpad.js +92 -0
- package/dist/parser_alias.d.ts +3 -0
- package/dist/parser_alias.js +2 -0
- package/dist/rpc_parser.d.ts +16 -0
- package/dist/rpc_parser.js +36 -0
- package/dist/rpc_transaction.d.ts +25 -0
- package/dist/rpc_transaction.js +111 -0
- package/dist/util/binary.d.ts +14 -0
- package/dist/util/binary.js +82 -0
- package/dist/warmup.d.ts +3 -0
- package/dist/warmup.js +23 -0
- package/package.json +44 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ALL_EVENT_TYPES = void 0;
|
|
4
|
+
exports.defaultClientConfig = defaultClientConfig;
|
|
5
|
+
exports.newTransactionFilter = newTransactionFilter;
|
|
6
|
+
exports.eventTypeFilterIncludeOnly = eventTypeFilterIncludeOnly;
|
|
7
|
+
exports.eventTypeFilterExclude = eventTypeFilterExclude;
|
|
8
|
+
exports.eventTypeFilterIncludesPumpfun = eventTypeFilterIncludesPumpfun;
|
|
9
|
+
exports.eventTypeFilterIncludesPumpswap = eventTypeFilterIncludesPumpswap;
|
|
10
|
+
exports.eventTypeFilterIncludesMeteoraDammV2 = eventTypeFilterIncludesMeteoraDammV2;
|
|
11
|
+
exports.eventTypeFilterIncludesRaydiumClmm = eventTypeFilterIncludesRaydiumClmm;
|
|
12
|
+
exports.eventTypeFilterIncludesRaydiumCpmm = eventTypeFilterIncludesRaydiumCpmm;
|
|
13
|
+
exports.eventTypeFilterIncludesRaydiumAmmV4 = eventTypeFilterIncludesRaydiumAmmV4;
|
|
14
|
+
exports.eventTypeFilterIncludesOrcaWhirlpool = eventTypeFilterIncludesOrcaWhirlpool;
|
|
15
|
+
exports.eventTypeFilterIncludesBonk = eventTypeFilterIncludesBonk;
|
|
16
|
+
exports.eventTypeFilterAllowsInstructionParsing = eventTypeFilterAllowsInstructionParsing;
|
|
17
|
+
function defaultClientConfig() {
|
|
18
|
+
return {
|
|
19
|
+
enable_metrics: false,
|
|
20
|
+
connection_timeout_ms: 8000,
|
|
21
|
+
request_timeout_ms: 15000,
|
|
22
|
+
enable_tls: true,
|
|
23
|
+
max_retries: 3,
|
|
24
|
+
retry_delay_ms: 1000,
|
|
25
|
+
max_concurrent_streams: 100,
|
|
26
|
+
keep_alive_interval_ms: 30000,
|
|
27
|
+
keep_alive_timeout_ms: 5000,
|
|
28
|
+
buffer_size: 8192,
|
|
29
|
+
order_mode: "Unordered",
|
|
30
|
+
order_timeout_ms: 100,
|
|
31
|
+
micro_batch_us: 100,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function newTransactionFilter() {
|
|
35
|
+
return { account_include: [], account_exclude: [], account_required: [] };
|
|
36
|
+
}
|
|
37
|
+
/** 所有事件类型列表 */
|
|
38
|
+
exports.ALL_EVENT_TYPES = [
|
|
39
|
+
// Block
|
|
40
|
+
"BlockMeta",
|
|
41
|
+
// PumpFun
|
|
42
|
+
"PumpFunTrade",
|
|
43
|
+
"PumpFunBuy",
|
|
44
|
+
"PumpFunSell",
|
|
45
|
+
"PumpFunBuyExactSolIn",
|
|
46
|
+
"PumpFunCreate",
|
|
47
|
+
"PumpFunCreateV2",
|
|
48
|
+
"PumpFunComplete",
|
|
49
|
+
"PumpFunMigrate",
|
|
50
|
+
// PumpSwap
|
|
51
|
+
"PumpSwapTrade",
|
|
52
|
+
"PumpSwapBuy",
|
|
53
|
+
"PumpSwapSell",
|
|
54
|
+
"PumpSwapCreatePool",
|
|
55
|
+
"PumpSwapLiquidityAdded",
|
|
56
|
+
"PumpSwapLiquidityRemoved",
|
|
57
|
+
// Raydium CLMM
|
|
58
|
+
"RaydiumClmmSwap",
|
|
59
|
+
"RaydiumClmmIncreaseLiquidity",
|
|
60
|
+
"RaydiumClmmDecreaseLiquidity",
|
|
61
|
+
"RaydiumClmmCreatePool",
|
|
62
|
+
"RaydiumClmmOpenPosition",
|
|
63
|
+
"RaydiumClmmOpenPositionWithTokenExtNft",
|
|
64
|
+
"RaydiumClmmClosePosition",
|
|
65
|
+
"RaydiumClmmCollectFee",
|
|
66
|
+
// Raydium CPMM
|
|
67
|
+
"RaydiumCpmmSwap",
|
|
68
|
+
"RaydiumCpmmDeposit",
|
|
69
|
+
"RaydiumCpmmWithdraw",
|
|
70
|
+
"RaydiumCpmmInitialize",
|
|
71
|
+
// Raydium AMM V4
|
|
72
|
+
"RaydiumAmmV4Swap",
|
|
73
|
+
"RaydiumAmmV4Deposit",
|
|
74
|
+
"RaydiumAmmV4Withdraw",
|
|
75
|
+
"RaydiumAmmV4WithdrawPnl",
|
|
76
|
+
"RaydiumAmmV4Initialize2",
|
|
77
|
+
// Orca Whirlpool
|
|
78
|
+
"OrcaWhirlpoolSwap",
|
|
79
|
+
"OrcaWhirlpoolLiquidityIncreased",
|
|
80
|
+
"OrcaWhirlpoolLiquidityDecreased",
|
|
81
|
+
"OrcaWhirlpoolPoolInitialized",
|
|
82
|
+
// Meteora Pools
|
|
83
|
+
"MeteoraPoolsSwap",
|
|
84
|
+
"MeteoraPoolsAddLiquidity",
|
|
85
|
+
"MeteoraPoolsRemoveLiquidity",
|
|
86
|
+
"MeteoraPoolsBootstrapLiquidity",
|
|
87
|
+
"MeteoraPoolsPoolCreated",
|
|
88
|
+
"MeteoraPoolsSetPoolFees",
|
|
89
|
+
// Meteora DAMM V2
|
|
90
|
+
"MeteoraDammV2Swap",
|
|
91
|
+
"MeteoraDammV2AddLiquidity",
|
|
92
|
+
"MeteoraDammV2RemoveLiquidity",
|
|
93
|
+
"MeteoraDammV2CreatePosition",
|
|
94
|
+
"MeteoraDammV2ClosePosition",
|
|
95
|
+
"MeteoraDammV2InitializePool",
|
|
96
|
+
// Meteora DLMM
|
|
97
|
+
"MeteoraDlmmSwap",
|
|
98
|
+
"MeteoraDlmmAddLiquidity",
|
|
99
|
+
"MeteoraDlmmRemoveLiquidity",
|
|
100
|
+
"MeteoraDlmmInitializePool",
|
|
101
|
+
"MeteoraDlmmInitializeBinArray",
|
|
102
|
+
"MeteoraDlmmCreatePosition",
|
|
103
|
+
"MeteoraDlmmClosePosition",
|
|
104
|
+
"MeteoraDlmmClaimFee",
|
|
105
|
+
// Bonk
|
|
106
|
+
"BonkTrade",
|
|
107
|
+
"BonkPoolCreate",
|
|
108
|
+
"BonkMigrateAmm",
|
|
109
|
+
// Account types
|
|
110
|
+
"TokenAccount",
|
|
111
|
+
"TokenInfo",
|
|
112
|
+
"NonceAccount",
|
|
113
|
+
"AccountPumpSwapGlobalConfig",
|
|
114
|
+
"AccountPumpSwapPool",
|
|
115
|
+
];
|
|
116
|
+
function eventTypeFilterIncludeOnly(types) {
|
|
117
|
+
const include_only = types;
|
|
118
|
+
return {
|
|
119
|
+
include_only,
|
|
120
|
+
shouldInclude(eventType) {
|
|
121
|
+
if (include_only.includes(eventType))
|
|
122
|
+
return true;
|
|
123
|
+
if (eventType === "PumpFunTrade") {
|
|
124
|
+
return include_only.some((t) => ["PumpFunBuy", "PumpFunSell", "PumpFunBuyExactSolIn"].includes(t));
|
|
125
|
+
}
|
|
126
|
+
return false;
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function eventTypeFilterExclude(types) {
|
|
131
|
+
const exclude_types = types;
|
|
132
|
+
return {
|
|
133
|
+
exclude_types,
|
|
134
|
+
shouldInclude(eventType) {
|
|
135
|
+
return !exclude_types.includes(eventType);
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/** 过滤器是否包含 PumpFun 相关类型 */
|
|
140
|
+
function eventTypeFilterIncludesPumpfun(filter) {
|
|
141
|
+
if (filter.include_only) {
|
|
142
|
+
return filter.include_only.some((t) => [
|
|
143
|
+
"PumpFunTrade",
|
|
144
|
+
"PumpFunBuy",
|
|
145
|
+
"PumpFunSell",
|
|
146
|
+
"PumpFunBuyExactSolIn",
|
|
147
|
+
"PumpFunCreate",
|
|
148
|
+
"PumpFunCreateV2",
|
|
149
|
+
"PumpFunComplete",
|
|
150
|
+
"PumpFunMigrate",
|
|
151
|
+
].includes(t));
|
|
152
|
+
}
|
|
153
|
+
if (filter.exclude_types) {
|
|
154
|
+
return !filter.exclude_types.some((t) => [
|
|
155
|
+
"PumpFunTrade",
|
|
156
|
+
"PumpFunBuy",
|
|
157
|
+
"PumpFunSell",
|
|
158
|
+
"PumpFunBuyExactSolIn",
|
|
159
|
+
"PumpFunCreate",
|
|
160
|
+
"PumpFunCreateV2",
|
|
161
|
+
"PumpFunComplete",
|
|
162
|
+
"PumpFunMigrate",
|
|
163
|
+
].includes(t));
|
|
164
|
+
}
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
/** 过滤器是否包含 PumpSwap 相关类型 */
|
|
168
|
+
function eventTypeFilterIncludesPumpswap(filter) {
|
|
169
|
+
if (filter.include_only) {
|
|
170
|
+
return filter.include_only.some((t) => [
|
|
171
|
+
"PumpSwapBuy",
|
|
172
|
+
"PumpSwapSell",
|
|
173
|
+
"PumpSwapCreatePool",
|
|
174
|
+
"PumpSwapLiquidityAdded",
|
|
175
|
+
"PumpSwapLiquidityRemoved",
|
|
176
|
+
].includes(t));
|
|
177
|
+
}
|
|
178
|
+
if (filter.exclude_types) {
|
|
179
|
+
return !filter.exclude_types.some((t) => [
|
|
180
|
+
"PumpSwapBuy",
|
|
181
|
+
"PumpSwapSell",
|
|
182
|
+
"PumpSwapCreatePool",
|
|
183
|
+
"PumpSwapLiquidityAdded",
|
|
184
|
+
"PumpSwapLiquidityRemoved",
|
|
185
|
+
].includes(t));
|
|
186
|
+
}
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
/** 过滤器是否包含 Meteora DAMM V2 相关类型 */
|
|
190
|
+
function eventTypeFilterIncludesMeteoraDammV2(filter) {
|
|
191
|
+
if (filter.include_only) {
|
|
192
|
+
return filter.include_only.some((t) => [
|
|
193
|
+
"MeteoraDammV2Swap",
|
|
194
|
+
"MeteoraDammV2AddLiquidity",
|
|
195
|
+
"MeteoraDammV2CreatePosition",
|
|
196
|
+
"MeteoraDammV2ClosePosition",
|
|
197
|
+
"MeteoraDammV2InitializePool",
|
|
198
|
+
"MeteoraDammV2RemoveLiquidity",
|
|
199
|
+
].includes(t));
|
|
200
|
+
}
|
|
201
|
+
if (filter.exclude_types) {
|
|
202
|
+
return !filter.exclude_types.some((t) => [
|
|
203
|
+
"MeteoraDammV2Swap",
|
|
204
|
+
"MeteoraDammV2AddLiquidity",
|
|
205
|
+
"MeteoraDammV2CreatePosition",
|
|
206
|
+
"MeteoraDammV2ClosePosition",
|
|
207
|
+
"MeteoraDammV2InitializePool",
|
|
208
|
+
"MeteoraDammV2RemoveLiquidity",
|
|
209
|
+
].includes(t));
|
|
210
|
+
}
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
/** 过滤器是否包含 Raydium CLMM 相关类型 */
|
|
214
|
+
function eventTypeFilterIncludesRaydiumClmm(filter) {
|
|
215
|
+
if (filter.include_only) {
|
|
216
|
+
return filter.include_only.some((t) => [
|
|
217
|
+
"RaydiumClmmSwap",
|
|
218
|
+
"RaydiumClmmIncreaseLiquidity",
|
|
219
|
+
"RaydiumClmmDecreaseLiquidity",
|
|
220
|
+
"RaydiumClmmCreatePool",
|
|
221
|
+
].includes(t));
|
|
222
|
+
}
|
|
223
|
+
if (filter.exclude_types) {
|
|
224
|
+
return !filter.exclude_types.some((t) => [
|
|
225
|
+
"RaydiumClmmSwap",
|
|
226
|
+
"RaydiumClmmIncreaseLiquidity",
|
|
227
|
+
"RaydiumClmmDecreaseLiquidity",
|
|
228
|
+
"RaydiumClmmCreatePool",
|
|
229
|
+
].includes(t));
|
|
230
|
+
}
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
/** 过滤器是否包含 Raydium CPMM 相关类型 */
|
|
234
|
+
function eventTypeFilterIncludesRaydiumCpmm(filter) {
|
|
235
|
+
if (filter.include_only) {
|
|
236
|
+
return filter.include_only.some((t) => [
|
|
237
|
+
"RaydiumCpmmSwap",
|
|
238
|
+
"RaydiumCpmmDeposit",
|
|
239
|
+
"RaydiumCpmmWithdraw",
|
|
240
|
+
].includes(t));
|
|
241
|
+
}
|
|
242
|
+
if (filter.exclude_types) {
|
|
243
|
+
return !filter.exclude_types.some((t) => [
|
|
244
|
+
"RaydiumCpmmSwap",
|
|
245
|
+
"RaydiumCpmmDeposit",
|
|
246
|
+
"RaydiumCpmmWithdraw",
|
|
247
|
+
].includes(t));
|
|
248
|
+
}
|
|
249
|
+
return true;
|
|
250
|
+
}
|
|
251
|
+
/** 过滤器是否包含 Raydium AMM V4 相关类型 */
|
|
252
|
+
function eventTypeFilterIncludesRaydiumAmmV4(filter) {
|
|
253
|
+
if (filter.include_only) {
|
|
254
|
+
return filter.include_only.some((t) => ["RaydiumAmmV4Swap"].includes(t));
|
|
255
|
+
}
|
|
256
|
+
if (filter.exclude_types) {
|
|
257
|
+
return !filter.exclude_types.some((t) => ["RaydiumAmmV4Swap"].includes(t));
|
|
258
|
+
}
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
/** 过滤器是否包含 Orca Whirlpool 相关类型 */
|
|
262
|
+
function eventTypeFilterIncludesOrcaWhirlpool(filter) {
|
|
263
|
+
if (filter.include_only) {
|
|
264
|
+
return filter.include_only.some((t) => [
|
|
265
|
+
"OrcaWhirlpoolSwap",
|
|
266
|
+
"OrcaWhirlpoolLiquidityIncreased",
|
|
267
|
+
"OrcaWhirlpoolLiquidityDecreased",
|
|
268
|
+
].includes(t));
|
|
269
|
+
}
|
|
270
|
+
if (filter.exclude_types) {
|
|
271
|
+
return !filter.exclude_types.some((t) => [
|
|
272
|
+
"OrcaWhirlpoolSwap",
|
|
273
|
+
"OrcaWhirlpoolLiquidityIncreased",
|
|
274
|
+
"OrcaWhirlpoolLiquidityDecreased",
|
|
275
|
+
].includes(t));
|
|
276
|
+
}
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
/** 过滤器是否包含 Bonk Launchpad 相关类型 */
|
|
280
|
+
function eventTypeFilterIncludesBonk(filter) {
|
|
281
|
+
if (filter.include_only) {
|
|
282
|
+
return filter.include_only.some((t) => ["BonkTrade", "BonkPoolCreate"].includes(t));
|
|
283
|
+
}
|
|
284
|
+
if (filter.exclude_types) {
|
|
285
|
+
return !filter.exclude_types.some((t) => ["BonkTrade", "BonkPoolCreate"].includes(t));
|
|
286
|
+
}
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* `parseInstructionUnified` 前置白名单:仅当 `include_only` 与下列指令相关类型有交集时才解析指令。
|
|
291
|
+
* 若白名单中不含下列任一类型,则整条指令解析入口返回 null。
|
|
292
|
+
*/
|
|
293
|
+
function eventTypeFilterAllowsInstructionParsing(includeOnly) {
|
|
294
|
+
const ix = [
|
|
295
|
+
"PumpFunMigrate",
|
|
296
|
+
"MeteoraDammV2Swap",
|
|
297
|
+
"MeteoraDammV2AddLiquidity",
|
|
298
|
+
"MeteoraDammV2CreatePosition",
|
|
299
|
+
"MeteoraDammV2ClosePosition",
|
|
300
|
+
"MeteoraDammV2InitializePool",
|
|
301
|
+
"MeteoraDammV2RemoveLiquidity",
|
|
302
|
+
];
|
|
303
|
+
return includeOnly.some((t) => ix.includes(t));
|
|
304
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DexEvent } from "../core/dex_event.js";
|
|
2
|
+
import type { SubscribeUpdateTransactionInfo } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* 从 gRPC 回调中的 `SubscribeUpdateTransactionInfo`(须含 `transactionRaw` + `metaRaw` 原始 proto)
|
|
5
|
+
* 解析 `DexEvent[]`,并对 PumpSwap/PumpFun 等补齐 mint、池子 ATA 等(与 Rust 订阅路径一致)。
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseDexEventsFromGrpcTransactionInfo(info: SubscribeUpdateTransactionInfo, slot: string | bigint, options?: {
|
|
8
|
+
blockTimeUs?: number;
|
|
9
|
+
}): DexEvent[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseDexEventsFromGrpcTransactionInfo = parseDexEventsFromGrpcTransactionInfo;
|
|
7
|
+
/**
|
|
8
|
+
* Yellowstone gRPC 单笔交易:日志解析 + 与 Rust `parse_logs` 相同的账户/数据填充。
|
|
9
|
+
* 依赖 `@triton-one/yellowstone-grpc` 的 `txEncode`(Binary)得到与 web3 兼容的 meta + 反序列化交易。
|
|
10
|
+
*/
|
|
11
|
+
const yellowstone_grpc_1 = require("@triton-one/yellowstone-grpc");
|
|
12
|
+
const yellowstone_grpc_solana_encoding_wasm_js_1 = require("@triton-one/yellowstone-grpc/dist/encoding/yellowstone_grpc_solana_encoding_wasm.js");
|
|
13
|
+
const bs58_1 = __importDefault(require("bs58"));
|
|
14
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
15
|
+
const unified_parser_js_1 = require("../core/unified_parser.js");
|
|
16
|
+
const rpc_transaction_js_1 = require("../rpc_transaction.js");
|
|
17
|
+
/**
|
|
18
|
+
* 从 gRPC 回调中的 `SubscribeUpdateTransactionInfo`(须含 `transactionRaw` + `metaRaw` 原始 proto)
|
|
19
|
+
* 解析 `DexEvent[]`,并对 PumpSwap/PumpFun 等补齐 mint、池子 ATA 等(与 Rust 订阅路径一致)。
|
|
20
|
+
*/
|
|
21
|
+
function parseDexEventsFromGrpcTransactionInfo(info, slot, options) {
|
|
22
|
+
const tr = info.transactionRaw;
|
|
23
|
+
const mr = info.metaRaw;
|
|
24
|
+
if (!tr || !mr)
|
|
25
|
+
return [];
|
|
26
|
+
const y = {
|
|
27
|
+
signature: info.signature,
|
|
28
|
+
isVote: info.isVote,
|
|
29
|
+
transaction: tr,
|
|
30
|
+
meta: mr,
|
|
31
|
+
index: String(info.index),
|
|
32
|
+
};
|
|
33
|
+
const enc = yellowstone_grpc_1.txEncode.encode(y, yellowstone_grpc_solana_encoding_wasm_js_1.WasmUiTransactionEncoding.Binary, 0, false);
|
|
34
|
+
const vt = web3_js_1.VersionedTransaction.deserialize(bs58_1.default.decode(enc.transaction));
|
|
35
|
+
const meta = enc.meta;
|
|
36
|
+
const logs = meta?.logMessages;
|
|
37
|
+
if (!Array.isArray(logs) || logs.length === 0)
|
|
38
|
+
return [];
|
|
39
|
+
const slotNum = typeof slot === "bigint" ? Number(slot) : Number(slot);
|
|
40
|
+
const sigHint = bs58_1.default.encode(Uint8Array.from(info.signature)) + "...";
|
|
41
|
+
const events = (0, unified_parser_js_1.parseLogsOnly)(logs, sigHint, slotNum, options?.blockTimeUs);
|
|
42
|
+
if (events.length === 0)
|
|
43
|
+
return [];
|
|
44
|
+
(0, rpc_transaction_js_1.applyAccountFillsToLogEvents)(events, vt.message, meta);
|
|
45
|
+
return events;
|
|
46
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type { DexEvent } from "./core/dex_event.js";
|
|
2
|
+
export { bigintToJsonReplacer, dexEventToJsonString } from "./core/json_utils.js";
|
|
3
|
+
export type { EventMetadata } from "./core/metadata.js";
|
|
4
|
+
export type { ParseError } from "./core/error.js";
|
|
5
|
+
export { formatParseError } from "./core/error.js";
|
|
6
|
+
export { parseTransactionEvents, parseLogsOnly, parseTransactionWithListener, parseTransactionEventsStreaming, parseLogsStreaming, parseTransactionWithStreamingListener, parseLog, nowUs, type EventListener, type StreamingEventListener, } from "./core/unified_parser.js";
|
|
7
|
+
export { warmupParser, isWarmedUp } from "./warmup.js";
|
|
8
|
+
export { parseTransactionFromRpc, parseRpcTransaction, fillAccountsFromTransactionDataRpc, fillDataRpc, applyAccountFillsToLogEvents, } from "./rpc_parser.js";
|
|
9
|
+
export { parseDexEventsFromGrpcTransactionInfo } from "./grpc/yellowstone_parse.js";
|
|
10
|
+
export { type OrderMode, type ClientConfig, type TransactionFilter, type EventType, type EventTypeFilter, defaultClientConfig, newTransactionFilter, eventTypeFilterIncludeOnly, eventTypeFilterExclude, eventTypeFilterIncludesPumpfun, eventTypeFilterIncludesPumpswap, eventTypeFilterIncludesMeteoraDammV2, eventTypeFilterAllowsInstructionParsing, } from "./grpc/types.js";
|
|
11
|
+
export { parseLogUnified, parseLogOptimized } from "./logs/optimized_matcher.js";
|
|
12
|
+
export { parseMeteoraDammLog, parseInitializePoolEvent } from "./logs/meteora_damm.js";
|
|
13
|
+
export { PROGRAM_LOG_DISC, PUMPSWAP_DISC, u64leDiscriminator, type ProgramLogDiscriminatorKey, } from "./logs/program_log_discriminators.js";
|
|
14
|
+
export type { ParsedEvent } from "./parser_alias.js";
|
|
15
|
+
export { parseAccountUnified, type AccountData, parseNonceAccount, isNonceAccount, parseTokenAccount, parsePumpswapGlobalConfig, parsePumpswapPool, parsePumpswapAccount, isGlobalConfigAccount, isPoolAccount, hasDiscriminator, } from "./accounts/mod.js";
|
|
16
|
+
export { parseInstructionUnified, parsePumpfunInstruction, parsePumpswapInstruction, parseMeteoraDammInstruction, } from "./instr/mod.js";
|
|
17
|
+
export * as programIds from "./instr/program_ids.js";
|
|
18
|
+
export { YellowstoneGrpc, type SubscribeCallbacks } from "./grpc/client.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
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 = exports.programIds = exports.parseMeteoraDammInstruction = exports.parsePumpswapInstruction = exports.parsePumpfunInstruction = exports.parseInstructionUnified = exports.hasDiscriminator = exports.isPoolAccount = exports.isGlobalConfigAccount = exports.parsePumpswapAccount = exports.parsePumpswapPool = exports.parsePumpswapGlobalConfig = exports.parseTokenAccount = exports.isNonceAccount = exports.parseNonceAccount = exports.parseAccountUnified = exports.u64leDiscriminator = exports.PUMPSWAP_DISC = exports.PROGRAM_LOG_DISC = exports.parseInitializePoolEvent = exports.parseMeteoraDammLog = exports.parseLogOptimized = exports.parseLogUnified = exports.eventTypeFilterAllowsInstructionParsing = exports.eventTypeFilterIncludesMeteoraDammV2 = exports.eventTypeFilterIncludesPumpswap = exports.eventTypeFilterIncludesPumpfun = exports.eventTypeFilterExclude = exports.eventTypeFilterIncludeOnly = exports.newTransactionFilter = exports.defaultClientConfig = exports.parseDexEventsFromGrpcTransactionInfo = exports.applyAccountFillsToLogEvents = exports.fillDataRpc = exports.fillAccountsFromTransactionDataRpc = exports.parseRpcTransaction = exports.parseTransactionFromRpc = exports.isWarmedUp = exports.warmupParser = exports.nowUs = exports.parseLog = exports.parseTransactionWithStreamingListener = exports.parseLogsStreaming = exports.parseTransactionEventsStreaming = exports.parseTransactionWithListener = exports.parseLogsOnly = exports.parseTransactionEvents = exports.formatParseError = exports.dexEventToJsonString = exports.bigintToJsonReplacer = void 0;
|
|
37
|
+
var json_utils_js_1 = require("./core/json_utils.js");
|
|
38
|
+
Object.defineProperty(exports, "bigintToJsonReplacer", { enumerable: true, get: function () { return json_utils_js_1.bigintToJsonReplacer; } });
|
|
39
|
+
Object.defineProperty(exports, "dexEventToJsonString", { enumerable: true, get: function () { return json_utils_js_1.dexEventToJsonString; } });
|
|
40
|
+
var error_js_1 = require("./core/error.js");
|
|
41
|
+
Object.defineProperty(exports, "formatParseError", { enumerable: true, get: function () { return error_js_1.formatParseError; } });
|
|
42
|
+
var unified_parser_js_1 = require("./core/unified_parser.js");
|
|
43
|
+
Object.defineProperty(exports, "parseTransactionEvents", { enumerable: true, get: function () { return unified_parser_js_1.parseTransactionEvents; } });
|
|
44
|
+
Object.defineProperty(exports, "parseLogsOnly", { enumerable: true, get: function () { return unified_parser_js_1.parseLogsOnly; } });
|
|
45
|
+
Object.defineProperty(exports, "parseTransactionWithListener", { enumerable: true, get: function () { return unified_parser_js_1.parseTransactionWithListener; } });
|
|
46
|
+
Object.defineProperty(exports, "parseTransactionEventsStreaming", { enumerable: true, get: function () { return unified_parser_js_1.parseTransactionEventsStreaming; } });
|
|
47
|
+
Object.defineProperty(exports, "parseLogsStreaming", { enumerable: true, get: function () { return unified_parser_js_1.parseLogsStreaming; } });
|
|
48
|
+
Object.defineProperty(exports, "parseTransactionWithStreamingListener", { enumerable: true, get: function () { return unified_parser_js_1.parseTransactionWithStreamingListener; } });
|
|
49
|
+
Object.defineProperty(exports, "parseLog", { enumerable: true, get: function () { return unified_parser_js_1.parseLog; } });
|
|
50
|
+
Object.defineProperty(exports, "nowUs", { enumerable: true, get: function () { return unified_parser_js_1.nowUs; } });
|
|
51
|
+
var warmup_js_1 = require("./warmup.js");
|
|
52
|
+
Object.defineProperty(exports, "warmupParser", { enumerable: true, get: function () { return warmup_js_1.warmupParser; } });
|
|
53
|
+
Object.defineProperty(exports, "isWarmedUp", { enumerable: true, get: function () { return warmup_js_1.isWarmedUp; } });
|
|
54
|
+
var rpc_parser_js_1 = require("./rpc_parser.js");
|
|
55
|
+
Object.defineProperty(exports, "parseTransactionFromRpc", { enumerable: true, get: function () { return rpc_parser_js_1.parseTransactionFromRpc; } });
|
|
56
|
+
Object.defineProperty(exports, "parseRpcTransaction", { enumerable: true, get: function () { return rpc_parser_js_1.parseRpcTransaction; } });
|
|
57
|
+
Object.defineProperty(exports, "fillAccountsFromTransactionDataRpc", { enumerable: true, get: function () { return rpc_parser_js_1.fillAccountsFromTransactionDataRpc; } });
|
|
58
|
+
Object.defineProperty(exports, "fillDataRpc", { enumerable: true, get: function () { return rpc_parser_js_1.fillDataRpc; } });
|
|
59
|
+
Object.defineProperty(exports, "applyAccountFillsToLogEvents", { enumerable: true, get: function () { return rpc_parser_js_1.applyAccountFillsToLogEvents; } });
|
|
60
|
+
var yellowstone_parse_js_1 = require("./grpc/yellowstone_parse.js");
|
|
61
|
+
Object.defineProperty(exports, "parseDexEventsFromGrpcTransactionInfo", { enumerable: true, get: function () { return yellowstone_parse_js_1.parseDexEventsFromGrpcTransactionInfo; } });
|
|
62
|
+
var types_js_1 = require("./grpc/types.js");
|
|
63
|
+
Object.defineProperty(exports, "defaultClientConfig", { enumerable: true, get: function () { return types_js_1.defaultClientConfig; } });
|
|
64
|
+
Object.defineProperty(exports, "newTransactionFilter", { enumerable: true, get: function () { return types_js_1.newTransactionFilter; } });
|
|
65
|
+
Object.defineProperty(exports, "eventTypeFilterIncludeOnly", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludeOnly; } });
|
|
66
|
+
Object.defineProperty(exports, "eventTypeFilterExclude", { enumerable: true, get: function () { return types_js_1.eventTypeFilterExclude; } });
|
|
67
|
+
Object.defineProperty(exports, "eventTypeFilterIncludesPumpfun", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesPumpfun; } });
|
|
68
|
+
Object.defineProperty(exports, "eventTypeFilterIncludesPumpswap", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesPumpswap; } });
|
|
69
|
+
Object.defineProperty(exports, "eventTypeFilterIncludesMeteoraDammV2", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesMeteoraDammV2; } });
|
|
70
|
+
Object.defineProperty(exports, "eventTypeFilterAllowsInstructionParsing", { enumerable: true, get: function () { return types_js_1.eventTypeFilterAllowsInstructionParsing; } });
|
|
71
|
+
var optimized_matcher_js_1 = require("./logs/optimized_matcher.js");
|
|
72
|
+
Object.defineProperty(exports, "parseLogUnified", { enumerable: true, get: function () { return optimized_matcher_js_1.parseLogUnified; } });
|
|
73
|
+
Object.defineProperty(exports, "parseLogOptimized", { enumerable: true, get: function () { return optimized_matcher_js_1.parseLogOptimized; } });
|
|
74
|
+
var meteora_damm_js_1 = require("./logs/meteora_damm.js");
|
|
75
|
+
Object.defineProperty(exports, "parseMeteoraDammLog", { enumerable: true, get: function () { return meteora_damm_js_1.parseMeteoraDammLog; } });
|
|
76
|
+
Object.defineProperty(exports, "parseInitializePoolEvent", { enumerable: true, get: function () { return meteora_damm_js_1.parseInitializePoolEvent; } });
|
|
77
|
+
var program_log_discriminators_js_1 = require("./logs/program_log_discriminators.js");
|
|
78
|
+
Object.defineProperty(exports, "PROGRAM_LOG_DISC", { enumerable: true, get: function () { return program_log_discriminators_js_1.PROGRAM_LOG_DISC; } });
|
|
79
|
+
Object.defineProperty(exports, "PUMPSWAP_DISC", { enumerable: true, get: function () { return program_log_discriminators_js_1.PUMPSWAP_DISC; } });
|
|
80
|
+
Object.defineProperty(exports, "u64leDiscriminator", { enumerable: true, get: function () { return program_log_discriminators_js_1.u64leDiscriminator; } });
|
|
81
|
+
var mod_js_1 = require("./accounts/mod.js");
|
|
82
|
+
Object.defineProperty(exports, "parseAccountUnified", { enumerable: true, get: function () { return mod_js_1.parseAccountUnified; } });
|
|
83
|
+
Object.defineProperty(exports, "parseNonceAccount", { enumerable: true, get: function () { return mod_js_1.parseNonceAccount; } });
|
|
84
|
+
Object.defineProperty(exports, "isNonceAccount", { enumerable: true, get: function () { return mod_js_1.isNonceAccount; } });
|
|
85
|
+
Object.defineProperty(exports, "parseTokenAccount", { enumerable: true, get: function () { return mod_js_1.parseTokenAccount; } });
|
|
86
|
+
Object.defineProperty(exports, "parsePumpswapGlobalConfig", { enumerable: true, get: function () { return mod_js_1.parsePumpswapGlobalConfig; } });
|
|
87
|
+
Object.defineProperty(exports, "parsePumpswapPool", { enumerable: true, get: function () { return mod_js_1.parsePumpswapPool; } });
|
|
88
|
+
Object.defineProperty(exports, "parsePumpswapAccount", { enumerable: true, get: function () { return mod_js_1.parsePumpswapAccount; } });
|
|
89
|
+
Object.defineProperty(exports, "isGlobalConfigAccount", { enumerable: true, get: function () { return mod_js_1.isGlobalConfigAccount; } });
|
|
90
|
+
Object.defineProperty(exports, "isPoolAccount", { enumerable: true, get: function () { return mod_js_1.isPoolAccount; } });
|
|
91
|
+
Object.defineProperty(exports, "hasDiscriminator", { enumerable: true, get: function () { return mod_js_1.hasDiscriminator; } });
|
|
92
|
+
var mod_js_2 = require("./instr/mod.js");
|
|
93
|
+
Object.defineProperty(exports, "parseInstructionUnified", { enumerable: true, get: function () { return mod_js_2.parseInstructionUnified; } });
|
|
94
|
+
Object.defineProperty(exports, "parsePumpfunInstruction", { enumerable: true, get: function () { return mod_js_2.parsePumpfunInstruction; } });
|
|
95
|
+
Object.defineProperty(exports, "parsePumpswapInstruction", { enumerable: true, get: function () { return mod_js_2.parsePumpswapInstruction; } });
|
|
96
|
+
Object.defineProperty(exports, "parseMeteoraDammInstruction", { enumerable: true, get: function () { return mod_js_2.parseMeteoraDammInstruction; } });
|
|
97
|
+
exports.programIds = __importStar(require("./instr/program_ids.js"));
|
|
98
|
+
var client_js_1 = require("./grpc/client.js");
|
|
99
|
+
Object.defineProperty(exports, "YellowstoneGrpc", { enumerable: true, get: function () { return client_js_1.YellowstoneGrpc; } });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bonk Launchpad 指令解析
|
|
3
|
+
*/
|
|
4
|
+
import type { DexEvent } from "../core/dex_event.js";
|
|
5
|
+
export declare function parseBonkInstruction(instructionData: Uint8Array, accounts: string[], signature: string, slot: number, txIndex: number, blockTimeUs: number | undefined, grpcRecvUs: number): DexEvent | null;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseBonkInstruction = parseBonkInstruction;
|
|
4
|
+
const dex_event_js_1 = require("../core/dex_event.js");
|
|
5
|
+
const utils_js_1 = require("./utils.js");
|
|
6
|
+
const Z = (0, dex_event_js_1.defaultPubkey)();
|
|
7
|
+
// Discriminators (little-endian u64)
|
|
8
|
+
const DISC = {
|
|
9
|
+
TRADE: 397092801079849094n, // disc8(2, 3, 4, 5, 6, 7, 8, 9)
|
|
10
|
+
POOL_CREATE: 578530140957057025n, // disc8(1, 2, 3, 4, 5, 6, 7, 8)
|
|
11
|
+
};
|
|
12
|
+
function discEq(data, disc) {
|
|
13
|
+
if (data.length < 8)
|
|
14
|
+
return false;
|
|
15
|
+
const v = (0, utils_js_1.readU64LE)(data, 0);
|
|
16
|
+
return v === disc;
|
|
17
|
+
}
|
|
18
|
+
function parseBonkInstruction(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs) {
|
|
19
|
+
if (instructionData.length < 8)
|
|
20
|
+
return null;
|
|
21
|
+
const meta = (0, utils_js_1.ixMeta)(signature, slot, txIndex, blockTimeUs, grpcRecvUs);
|
|
22
|
+
if (discEq(instructionData, DISC.TRADE)) {
|
|
23
|
+
return {
|
|
24
|
+
BonkTrade: {
|
|
25
|
+
metadata: meta,
|
|
26
|
+
pool_state: (0, utils_js_1.getAccount)(accounts, 1) ?? Z,
|
|
27
|
+
user: (0, utils_js_1.getAccount)(accounts, 0) ?? Z,
|
|
28
|
+
amount_in: 0n,
|
|
29
|
+
amount_out: 0n,
|
|
30
|
+
is_buy: true,
|
|
31
|
+
trade_direction: "Buy",
|
|
32
|
+
exact_in: true,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
if (discEq(instructionData, DISC.POOL_CREATE)) {
|
|
37
|
+
return {
|
|
38
|
+
BonkPoolCreate: {
|
|
39
|
+
metadata: meta,
|
|
40
|
+
base_mint_param: {
|
|
41
|
+
symbol: "BONK",
|
|
42
|
+
name: "Bonk Pool",
|
|
43
|
+
uri: "https://bonk.com",
|
|
44
|
+
decimals: 5,
|
|
45
|
+
},
|
|
46
|
+
pool_state: (0, utils_js_1.getAccount)(accounts, 1) ?? Z,
|
|
47
|
+
creator: (0, utils_js_1.getAccount)(accounts, 8) ?? Z,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Meteora DAMM V2 指令解析
|
|
3
|
+
* CPI 布局:前 8 字节为外层 Anchor discriminator,8..16 为事件 log discriminator,16.. 为载荷。
|
|
4
|
+
*/
|
|
5
|
+
import type { DexEvent } from "../core/dex_event.js";
|
|
6
|
+
export declare function parseMeteoraDammInstruction(instructionData: Uint8Array, _accounts: string[], signature: string, slot: number, txIndex: number, blockTimeUs: number | undefined, grpcRecvUs: number): DexEvent | null;
|