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,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fillRaydiumClmmSwapAccounts = fillRaydiumClmmSwapAccounts;
|
|
4
|
+
exports.fillRaydiumClmmCreatePoolAccounts = fillRaydiumClmmCreatePoolAccounts;
|
|
5
|
+
exports.fillRaydiumClmmOpenPositionAccounts = fillRaydiumClmmOpenPositionAccounts;
|
|
6
|
+
exports.fillRaydiumClmmOpenPositionWithTokenExtNftAccounts = fillRaydiumClmmOpenPositionWithTokenExtNftAccounts;
|
|
7
|
+
exports.fillRaydiumClmmClosePositionAccounts = fillRaydiumClmmClosePositionAccounts;
|
|
8
|
+
exports.fillRaydiumClmmIncreaseLiquidityAccounts = fillRaydiumClmmIncreaseLiquidityAccounts;
|
|
9
|
+
exports.fillRaydiumClmmDecreaseLiquidityAccounts = fillRaydiumClmmDecreaseLiquidityAccounts;
|
|
10
|
+
exports.fillRaydiumCpmmSwapAccounts = fillRaydiumCpmmSwapAccounts;
|
|
11
|
+
exports.fillRaydiumCpmmDepositAccounts = fillRaydiumCpmmDepositAccounts;
|
|
12
|
+
exports.fillRaydiumCpmmWithdrawAccounts = fillRaydiumCpmmWithdrawAccounts;
|
|
13
|
+
exports.fillRaydiumCpmmInitializeAccounts = fillRaydiumCpmmInitializeAccounts;
|
|
14
|
+
exports.fillRaydiumAmmV4SwapAccounts = fillRaydiumAmmV4SwapAccounts;
|
|
15
|
+
exports.fillRaydiumAmmV4DepositAccounts = fillRaydiumAmmV4DepositAccounts;
|
|
16
|
+
exports.fillRaydiumAmmV4WithdrawAccounts = fillRaydiumAmmV4WithdrawAccounts;
|
|
17
|
+
const dex_event_js_1 = require("./dex_event.js");
|
|
18
|
+
const Z = () => (0, dex_event_js_1.defaultPubkey)();
|
|
19
|
+
function fillRaydiumClmmSwapAccounts(e, get) {
|
|
20
|
+
const zero = Z();
|
|
21
|
+
if (!e.pool_state || e.pool_state === zero)
|
|
22
|
+
e.pool_state = get(2);
|
|
23
|
+
if (!e.sender || e.sender === zero)
|
|
24
|
+
e.sender = get(0);
|
|
25
|
+
}
|
|
26
|
+
function fillRaydiumClmmCreatePoolAccounts(e, get) {
|
|
27
|
+
const zero = Z();
|
|
28
|
+
if (!e.creator || e.creator === zero)
|
|
29
|
+
e.creator = get(0);
|
|
30
|
+
}
|
|
31
|
+
function fillRaydiumClmmOpenPositionAccounts(e, get) {
|
|
32
|
+
const zero = Z();
|
|
33
|
+
if (!e.user || e.user === zero)
|
|
34
|
+
e.user = get(0);
|
|
35
|
+
if (!e.position_nft_mint || e.position_nft_mint === zero)
|
|
36
|
+
e.position_nft_mint = get(2);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* `fill_clmm_open_position_accounts` 账户索引相同(openPosition / token-ext 变体共用 IDL 布局)。
|
|
40
|
+
* 参考实现未对该 `DexEvent` 变体做账户调度;本包在 RPC 路径补全。
|
|
41
|
+
*/
|
|
42
|
+
function fillRaydiumClmmOpenPositionWithTokenExtNftAccounts(e, get) {
|
|
43
|
+
const zero = Z();
|
|
44
|
+
if (!e.user || e.user === zero)
|
|
45
|
+
e.user = get(0);
|
|
46
|
+
if (!e.position_nft_mint || e.position_nft_mint === zero)
|
|
47
|
+
e.position_nft_mint = get(2);
|
|
48
|
+
}
|
|
49
|
+
function fillRaydiumClmmClosePositionAccounts(e, get) {
|
|
50
|
+
const zero = Z();
|
|
51
|
+
if (!e.user || e.user === zero)
|
|
52
|
+
e.user = get(0);
|
|
53
|
+
if (!e.position_nft_mint || e.position_nft_mint === zero)
|
|
54
|
+
e.position_nft_mint = get(1);
|
|
55
|
+
}
|
|
56
|
+
function fillRaydiumClmmIncreaseLiquidityAccounts(e, get) {
|
|
57
|
+
const zero = Z();
|
|
58
|
+
if (!e.user || e.user === zero)
|
|
59
|
+
e.user = get(0);
|
|
60
|
+
}
|
|
61
|
+
function fillRaydiumClmmDecreaseLiquidityAccounts(e, get) {
|
|
62
|
+
const zero = Z();
|
|
63
|
+
if (!e.user || e.user === zero)
|
|
64
|
+
e.user = get(0);
|
|
65
|
+
}
|
|
66
|
+
function fillRaydiumCpmmSwapAccounts(_e, _get) { }
|
|
67
|
+
function fillRaydiumCpmmDepositAccounts(e, get) {
|
|
68
|
+
const zero = Z();
|
|
69
|
+
if (!e.user || e.user === zero)
|
|
70
|
+
e.user = get(0);
|
|
71
|
+
}
|
|
72
|
+
function fillRaydiumCpmmWithdrawAccounts(e, get) {
|
|
73
|
+
const zero = Z();
|
|
74
|
+
if (!e.user || e.user === zero)
|
|
75
|
+
e.user = get(0);
|
|
76
|
+
}
|
|
77
|
+
function fillRaydiumCpmmInitializeAccounts(e, get) {
|
|
78
|
+
const zero = Z();
|
|
79
|
+
if (!e.creator || e.creator === zero)
|
|
80
|
+
e.creator = get(0);
|
|
81
|
+
if (!e.pool || e.pool === zero)
|
|
82
|
+
e.pool = get(3);
|
|
83
|
+
}
|
|
84
|
+
function fillRaydiumAmmV4SwapAccounts(e, get) {
|
|
85
|
+
const zero = Z();
|
|
86
|
+
if (!e.amm || e.amm === zero)
|
|
87
|
+
e.amm = get(1);
|
|
88
|
+
}
|
|
89
|
+
function fillRaydiumAmmV4DepositAccounts(e, get) {
|
|
90
|
+
const zero = Z();
|
|
91
|
+
if (!e.token_program || e.token_program === zero)
|
|
92
|
+
e.token_program = get(0);
|
|
93
|
+
if (!e.amm_authority || e.amm_authority === zero)
|
|
94
|
+
e.amm_authority = get(2);
|
|
95
|
+
}
|
|
96
|
+
function fillRaydiumAmmV4WithdrawAccounts(e, get) {
|
|
97
|
+
const zero = Z();
|
|
98
|
+
if (!e.token_program || e.token_program === zero)
|
|
99
|
+
e.token_program = get(0);
|
|
100
|
+
if (!e.amm_authority || e.amm_authority === zero)
|
|
101
|
+
e.amm_authority = get(2);
|
|
102
|
+
if (!e.amm_open_orders || e.amm_open_orders === zero)
|
|
103
|
+
e.amm_open_orders = get(3);
|
|
104
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** RPC / web3 路径补充字段(如 PumpSwap fees 指令 → `is_pump_pool`) */
|
|
2
|
+
import type { DexEvent } from "./dex_event.js";
|
|
3
|
+
import type { InvokePair } from "./rpc_invoke_map.js";
|
|
4
|
+
import type { Message, MessageV0 } from "@solana/web3.js";
|
|
5
|
+
import type { ConfirmedTransactionMeta } from "@solana/web3.js";
|
|
6
|
+
export declare function fillDataRpc(ev: DexEvent, message: Message | MessageV0, meta: ConfirmedTransactionMeta | null, programInvokes: Map<string, InvokePair[]>): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fillDataRpc = fillDataRpc;
|
|
4
|
+
const program_ids_js_1 = require("../instr/program_ids.js");
|
|
5
|
+
const rpc_invoke_map_js_1 = require("./rpc_invoke_map.js");
|
|
6
|
+
function fillDataRpc(ev, message, meta, programInvokes) {
|
|
7
|
+
const list = programInvokes.get(program_ids_js_1.PUMPSWAP_FEES_PROGRAM_ID);
|
|
8
|
+
const last = list?.[list.length - 1];
|
|
9
|
+
if (!last)
|
|
10
|
+
return;
|
|
11
|
+
const data = (0, rpc_invoke_map_js_1.getInstructionDataBytes)(message, meta, last);
|
|
12
|
+
if (!data || data.length <= 9)
|
|
13
|
+
return;
|
|
14
|
+
const isPumpPool = data[9] !== 0;
|
|
15
|
+
if ("PumpSwapBuy" in ev) {
|
|
16
|
+
ev.PumpSwapBuy.is_pump_pool = isPumpPool;
|
|
17
|
+
}
|
|
18
|
+
else if ("PumpSwapSell" in ev) {
|
|
19
|
+
ev.PumpSwapSell.is_pump_pool = isPumpPool;
|
|
20
|
+
}
|
|
21
|
+
}
|