sol-parser-sdk 0.5.14 → 0.5.16

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 (108) hide show
  1. package/NATIVE_ALIGNMENT.md +312 -0
  2. package/NATIVE_DAMM_FACTORY_ALIGNMENT_20261004.md +16 -0
  3. package/NATIVE_DAMM_FACTORY_EVIDENCE_20261004.json +55 -0
  4. package/NATIVE_MIGRATION.md +38 -0
  5. package/NATIVE_PUMPFUN_NATIVE_DEBIT_ALIGNMENT_20261004.md +18 -0
  6. package/NATIVE_PUMPFUN_NATIVE_DEBIT_EVIDENCE_20261004.json +57 -0
  7. package/NATIVE_PUMPFUN_SETTLEMENT_ALIGNMENT_20261004.md +11 -0
  8. package/NATIVE_PUMPFUN_SETTLEMENT_EVIDENCE_20261004.json +70 -0
  9. package/README.md +24 -1
  10. package/README_CN.md +21 -1
  11. package/dist/accounts/mod.js +7 -0
  12. package/dist/accounts/pumpfun.js +17 -0
  13. package/dist/accounts/pumpswap.js +18 -3
  14. package/dist/core/account_dispatcher_rpc.js +24 -4
  15. package/dist/core/account_fill_meteora.d.ts +1 -1
  16. package/dist/core/account_fill_meteora.js +12 -1
  17. package/dist/core/account_fill_raydium.js +12 -2
  18. package/dist/core/account_fill_raydium_launchlab.js +54 -0
  19. package/dist/core/clock.js +1 -1
  20. package/dist/core/common_filler_rpc.d.ts +2 -2
  21. package/dist/core/common_filler_rpc.js +66 -0
  22. package/dist/core/dex_event.d.ts +157 -0
  23. package/dist/core/metadata.d.ts +9 -5
  24. package/dist/core/metadata.js +28 -4
  25. package/dist/core/unified_parser.d.ts +7 -7
  26. package/dist/grpc/block_meta.d.ts +9 -0
  27. package/dist/grpc/block_meta.js +26 -0
  28. package/dist/grpc/client.d.ts +24 -9
  29. package/dist/grpc/client.js +129 -67
  30. package/dist/grpc/geyser_connect.d.ts +3 -3
  31. package/dist/grpc/geyser_connect.js +13 -15
  32. package/dist/grpc/log_instr_dedup.js +6 -0
  33. package/dist/grpc/native_client.d.ts +26 -0
  34. package/dist/grpc/native_client.js +101 -0
  35. package/dist/grpc/order_buffer.d.ts +1 -1
  36. package/dist/grpc/order_buffer.js +10 -9
  37. package/dist/grpc/program_ids.js +2 -0
  38. package/dist/grpc/protocol/LICENSE +202 -0
  39. package/dist/grpc/protocol/NOTICE +4 -0
  40. package/dist/grpc/protocol/geyser.d.ts +342 -0
  41. package/dist/grpc/protocol/geyser.js +37 -0
  42. package/dist/grpc/protocol/geyser.proto +326 -0
  43. package/dist/grpc/protocol/solana-storage.d.ts +139 -0
  44. package/dist/grpc/protocol/solana-storage.js +14 -0
  45. package/dist/grpc/protocol/solana-storage.proto +151 -0
  46. package/dist/grpc/rpc_to_grpc.d.ts +1 -1
  47. package/dist/grpc/subscribe_builder.d.ts +5 -3
  48. package/dist/grpc/subscribe_builder.js +11 -3
  49. package/dist/grpc/transaction_meta.d.ts +1 -1
  50. package/dist/grpc/types.d.ts +8 -8
  51. package/dist/grpc/types.js +15 -2
  52. package/dist/grpc/yellowstone_parse.d.ts +3 -3
  53. package/dist/grpc/yellowstone_parse.js +6 -8
  54. package/dist/grpc/yellowstone_transaction_adapter.d.ts +1 -1
  55. package/dist/index.d.ts +11 -1
  56. package/dist/index.js +23 -5
  57. package/dist/instr/inner.d.ts +2 -2
  58. package/dist/instr/inner.js +1 -1
  59. package/dist/instr/meteora_damm_ix.d.ts +1 -1
  60. package/dist/instr/meteora_damm_ix.js +41 -79
  61. package/dist/instr/meteora_dlmm_ix.d.ts +1 -1
  62. package/dist/instr/meteora_dlmm_ix.js +10 -0
  63. package/dist/instr/meteora_pools_ix.d.ts +1 -1
  64. package/dist/instr/mod.d.ts +1 -1
  65. package/dist/instr/orca_whirlpool_ix.d.ts +1 -1
  66. package/dist/instr/pump_fees_ix.d.ts +1 -1
  67. package/dist/instr/pumpfun_ix.d.ts +1 -1
  68. package/dist/instr/pumpfun_ix.js +16 -0
  69. package/dist/instr/pumpswap_ix.d.ts +1 -1
  70. package/dist/instr/pumpswap_ix.js +13 -5
  71. package/dist/instr/raydium_amm_v4_ix.d.ts +1 -1
  72. package/dist/instr/raydium_amm_v4_ix.js +9 -5
  73. package/dist/instr/raydium_clmm_ix.d.ts +1 -1
  74. package/dist/instr/raydium_cpmm_ix.d.ts +1 -1
  75. package/dist/instr/raydium_launchlab_ix.d.ts +1 -1
  76. package/dist/instr/raydium_launchlab_ix.js +62 -2
  77. package/dist/instr/utils.d.ts +2 -2
  78. package/dist/instr/utils.js +2 -7
  79. package/dist/liquidity_snapshot.d.ts +54 -0
  80. package/dist/liquidity_snapshot.js +85 -0
  81. package/dist/logs/meteora_damm.d.ts +17 -1
  82. package/dist/logs/meteora_damm.js +386 -12
  83. package/dist/logs/meteora_dlmm.d.ts +1 -1
  84. package/dist/logs/meteora_dlmm.js +10 -0
  85. package/dist/logs/optimized_matcher.d.ts +3 -3
  86. package/dist/logs/optimized_matcher.js +35 -1
  87. package/dist/logs/program_log_discriminators.d.ts +5 -0
  88. package/dist/logs/program_log_discriminators.js +5 -0
  89. package/dist/logs/pump.js +10 -0
  90. package/dist/logs/pump_amm.js +22 -1
  91. package/dist/logs/raydium_launchlab.js +19 -1
  92. package/dist/rpc_transaction.d.ts +4 -3
  93. package/dist/rpc_transaction.js +3 -2
  94. package/dist/shredstream/client.js +3 -7
  95. package/dist/shredstream/entries_decode.js +9 -85
  96. package/dist/shredstream/instruction_parse.d.ts +3 -3
  97. package/dist/shredstream/proto_types.d.ts +1 -1
  98. package/dist/shredstream/wire_to_shred_tx.d.ts +1 -1
  99. package/dist/shredstream/wire_to_shred_tx.js +9 -44
  100. package/dist/simulation_route.d.ts +6 -0
  101. package/dist/simulation_route.js +242 -0
  102. package/dist/stonkfun_registry.d.ts +30 -0
  103. package/dist/stonkfun_registry.js +137 -0
  104. package/dist/transaction_route.d.ts +84 -0
  105. package/dist/transaction_route.js +477 -0
  106. package/dist/wire_transaction.d.ts +35 -0
  107. package/dist/wire_transaction.js +191 -0
  108. package/package.json +7 -4
@@ -5,15 +5,10 @@ exports.ixMeta = ixMeta;
5
5
  exports.getAccount = getAccount;
6
6
  exports.readBorshStrAt = readBorshStrAt;
7
7
  exports.readPubkeyIx = readPubkeyIx;
8
+ const metadata_js_1 = require("../core/metadata.js");
8
9
  const binary_js_1 = require("../util/binary.js");
9
10
  function ixMeta(signature, slot, txIndex, blockTimeUs, grpcRecvUs) {
10
- return {
11
- signature,
12
- slot,
13
- tx_index: txIndex,
14
- block_time_us: blockTimeUs ?? 0,
15
- grpc_recv_us: grpcRecvUs,
16
- };
11
+ return (0, metadata_js_1.makeMetadata)(signature, slot, txIndex, blockTimeUs, grpcRecvUs);
17
12
  }
18
13
  function getAccount(accounts, i) {
19
14
  return accounts[i];
@@ -0,0 +1,54 @@
1
+ import type { AccountData } from "./accounts/types.js";
2
+ import type { EventMetadata } from "./core/metadata.js";
3
+ export interface RawAccountSnapshotEvent {
4
+ metadata: EventMetadata;
5
+ account: AccountData;
6
+ write_version: bigint;
7
+ is_startup: boolean;
8
+ }
9
+ export type LiquiditySnapshotKind = "LaunchLabGlobalConfig" | "LaunchLabPlatformConfig" | {
10
+ LaunchLabPool: {
11
+ base_mint: string;
12
+ quote_mint: string;
13
+ global_config: string;
14
+ platform_config: string;
15
+ };
16
+ } | {
17
+ DlmmPool: {
18
+ token_x_mint: string;
19
+ token_y_mint: string;
20
+ active_id: number;
21
+ bin_step: number;
22
+ };
23
+ } | {
24
+ DlmmBinArray: {
25
+ pool: string;
26
+ index: bigint;
27
+ };
28
+ } | {
29
+ DlmmBitmap: {
30
+ pool: string;
31
+ };
32
+ } | {
33
+ OrcaDynamicTickArray: {
34
+ pool: string;
35
+ start_tick_index: number;
36
+ tick_bitmap: bigint;
37
+ };
38
+ } | {
39
+ OrcaAdaptiveOracle: {
40
+ pool: string;
41
+ };
42
+ } | {
43
+ ClmmBitmap: {
44
+ pool: string;
45
+ };
46
+ };
47
+ export interface LiquidityAccountSnapshotEvent {
48
+ metadata: EventMetadata;
49
+ pubkey: string;
50
+ owner: string;
51
+ kind: LiquiditySnapshotKind;
52
+ data: Uint8Array;
53
+ }
54
+ export declare function parseLiquidityAccount(account: AccountData, metadata: EventMetadata): LiquidityAccountSnapshotEvent | null;
@@ -0,0 +1,85 @@
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.parseLiquidityAccount = parseLiquidityAccount;
7
+ /** Full subscription bytes and validated liquidity identities, without RPC. */
8
+ const bs58_1 = __importDefault(require("bs58"));
9
+ const transaction_route_js_1 = require("./transaction_route.js");
10
+ function parseLiquidityAccount(account, metadata) {
11
+ if (account.lamports <= 0n || account.executable)
12
+ return null;
13
+ const d = Buffer.from(account.data), disc = d.subarray(0, 8).toString("hex"), owner = account.owner, key = (o) => bs58_1.default.encode(d.subarray(o, o + 32));
14
+ let kind;
15
+ if (owner === transaction_route_js_1.ROUTE_PROGRAMS.LaunchLab) {
16
+ if (disc === "f7ede3f5d7c3de46" && d.length >= 429)
17
+ kind = {
18
+ LaunchLabPool: {
19
+ base_mint: key(205),
20
+ quote_mint: key(237),
21
+ global_config: key(141),
22
+ platform_config: key(173),
23
+ },
24
+ };
25
+ else if (disc === "95089ccaa0fcb0d9" && d.length >= 35)
26
+ kind = "LaunchLabGlobalConfig";
27
+ else if (disc === "a04e8000f853e6a0" && d.length >= 728)
28
+ kind = "LaunchLabPlatformConfig";
29
+ }
30
+ else if (owner === transaction_route_js_1.ROUTE_PROGRAMS.MeteoraDlmm) {
31
+ if (disc === "210b3162b565b10d" && d.length >= 904)
32
+ kind = {
33
+ DlmmPool: {
34
+ token_x_mint: key(88),
35
+ token_y_mint: key(120),
36
+ active_id: d.readInt32LE(76),
37
+ bin_step: d.readUInt16LE(80),
38
+ },
39
+ };
40
+ else if (disc === "5c8e5cdc059446b5" && d.length >= 10136)
41
+ kind = { DlmmBinArray: { pool: key(24), index: d.readBigInt64LE(8) } };
42
+ else if (disc === "506f7c7137ed1205" && d.length >= 1576)
43
+ kind = { DlmmBitmap: { pool: key(8) } };
44
+ }
45
+ else if (owner === transaction_route_js_1.ROUTE_PROGRAMS.OrcaWhirlpool) {
46
+ if (disc === "11d8f68ee1c7da38" && d.length >= 148) {
47
+ const bitmap = d.readBigUInt64LE(44) + (d.readBigUInt64LE(52) << 64n);
48
+ if (bitmap >> 88n)
49
+ return null;
50
+ let offset = 60;
51
+ for (let i = 0; i < 88; i++) {
52
+ const tag = d[offset];
53
+ if (offset >= d.length ||
54
+ (tag !== 0 && tag !== 1) ||
55
+ tag !== Number((bitmap >> BigInt(i)) & 1n))
56
+ return null;
57
+ offset += 1 + (tag ? 112 : 0);
58
+ if (offset > d.length)
59
+ return null;
60
+ }
61
+ kind = {
62
+ OrcaDynamicTickArray: {
63
+ pool: key(12),
64
+ start_tick_index: d.readInt32LE(8),
65
+ tick_bitmap: bitmap,
66
+ },
67
+ };
68
+ }
69
+ else if (disc === "8bc283b38cb3e5f4" && d.length >= 254)
70
+ kind = { OrcaAdaptiveOracle: { pool: key(8) } };
71
+ }
72
+ else if (owner === transaction_route_js_1.ROUTE_PROGRAMS.RaydiumClmm &&
73
+ disc === "3c9624db61808b99" &&
74
+ d.length >= 1832)
75
+ kind = { ClmmBitmap: { pool: key(8) } };
76
+ return kind
77
+ ? {
78
+ metadata,
79
+ pubkey: account.pubkey,
80
+ owner,
81
+ kind,
82
+ data: Uint8Array.from(d),
83
+ }
84
+ : null;
85
+ }
@@ -1,5 +1,21 @@
1
+ import { type EventMetadata } from "../core/metadata.js";
1
2
  import type { DexEvent } from "../core/dex_event.js";
3
+ /**
4
+ * Mainnet upgrade that replaced `trading_fee/partner_fee` in `EvtSwap2` with
5
+ * `claiming_fee/compounding_fee` without changing discriminator or size.
6
+ */
7
+ export declare const COMPOUNDING_FEE_LAYOUT_ACTIVATION_SLOT = 406048752;
8
+ /** Aligns with Rust `parse_swap2_from_data` (full 180-byte EvtSwap2 layout). */
9
+ export declare function parseSwap2FromData(data: Uint8Array, meta: EventMetadata): DexEvent | null;
10
+ export declare function parseAddLiquidityFromData(data: Uint8Array, meta: EventMetadata): DexEvent | null;
11
+ export declare function parseRemoveLiquidityFromData(data: Uint8Array, meta: EventMetadata): DexEvent | null;
12
+ /** Parse current `EvtLiquidityChange`; `change_type` 0 = add, 1 = remove. */
13
+ export declare function parseLiquidityChangeFromData(data: Uint8Array, meta: EventMetadata): DexEvent | null;
14
+ export declare function parseUpdateDelegatePermissionFromData(data: Uint8Array, meta: EventMetadata): DexEvent | null;
15
+ export declare function parseWithdrawDeadLiquidityRewardFromData(data: Uint8Array, meta: EventMetadata): DexEvent | null;
16
+ export declare function parseCreateConfigFromData(data: Uint8Array, meta: EventMetadata): DexEvent | null;
17
+ export declare function parseCreateDynamicConfigFromData(data: Uint8Array, meta: EventMetadata): DexEvent | null;
2
18
  /**
3
19
  * Meteora DAMM Program data 入口;与 Rust `logs/meteora_damm.rs` 一致。
4
20
  */
5
- export declare function parseMeteoraDammLog(log: string, signature: string, slot: number, txIndex: number, blockTimeUs: number | undefined, grpcRecvUs: number): DexEvent | null;
21
+ export declare function parseMeteoraDammLog(log: string, signature: string, slot: number | bigint | string, txIndex: number | bigint | string, blockTimeUs: number | bigint | string | undefined, grpcRecvUs: number | bigint | string): DexEvent | null;