four-flap-meme-sdk 1.5.56 → 1.5.58

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.
@@ -15,6 +15,11 @@ export interface SolanaBondingCurveInfo {
15
15
  reserveQuoteRaw: bigint;
16
16
  reserveToken: string;
17
17
  reserveTokenRaw: bigint;
18
+ realQuoteReserve?: string;
19
+ realQuoteReserveRaw?: bigint;
20
+ realTokenReserve?: string;
21
+ realTokenReserveRaw?: bigint;
22
+ liquidity?: number;
18
23
  price?: number;
19
24
  progress?: number;
20
25
  creator?: string;
@@ -33,6 +33,10 @@ async function detectPumpBondingCurve(mint, connection, debug) {
33
33
  reserveQuoteRaw: info.virtualSolReserves,
34
34
  reserveToken: (Number(info.virtualTokenReserves) / 1e6).toFixed(0),
35
35
  reserveTokenRaw: info.virtualTokenReserves,
36
+ realQuoteReserve: (Number(info.realSolReserves) / 1e9).toFixed(4),
37
+ realQuoteReserveRaw: info.realSolReserves,
38
+ realTokenReserve: (Number(info.realTokenReserves) / 1e6).toFixed(0),
39
+ realTokenReserveRaw: info.realTokenReserves,
36
40
  price,
37
41
  progress,
38
42
  creator: info.creator,
@@ -62,6 +66,10 @@ async function detectMeteoraDbc(mint, connection, debug) {
62
66
  reserveQuoteRaw: BigInt(poolInfo.quoteReserve),
63
67
  reserveToken: poolInfo.baseReserve,
64
68
  reserveTokenRaw: BigInt(poolInfo.baseReserve),
69
+ realQuoteReserve: poolInfo.quoteReserve,
70
+ realQuoteReserveRaw: BigInt(poolInfo.quoteReserve),
71
+ realTokenReserve: poolInfo.baseReserve,
72
+ realTokenReserveRaw: BigInt(poolInfo.baseReserve),
65
73
  price: poolInfo.currentPrice,
66
74
  progress: poolInfo.progressPercent,
67
75
  creator: poolInfo.creator,
@@ -104,6 +112,8 @@ async function detectRaydiumLaunchLab(mint, connection, debug) {
104
112
  reserveQuoteRaw: BigInt(poolInfo.totalFundRaisingB?.toString() || '0'),
105
113
  reserveToken: "0", // Simplified
106
114
  reserveTokenRaw: 0n,
115
+ realQuoteReserve: (Number(poolInfo.totalFundRaisingB || 0) / 1e9).toFixed(4),
116
+ realQuoteReserveRaw: BigInt(poolInfo.totalFundRaisingB?.toString() || '0'),
107
117
  price: currentPrice,
108
118
  creator: poolInfo.creator?.toBase58(),
109
119
  };
@@ -144,6 +154,7 @@ async function detectWithJupiter(mint, debug) {
144
154
  launchpad: info.launchpad,
145
155
  organicScore: info.organicScore,
146
156
  stats24h: info.stats24h,
157
+ reserveBase: info.liquidity && info.usdPrice ? (info.liquidity / 2 / info.usdPrice).toString() : undefined,
147
158
  }
148
159
  };
149
160
  }
@@ -188,6 +199,16 @@ export async function inspectSolanaTokenLP(mint, options = {}) {
188
199
  ]);
189
200
  const bc = pump || meteora || raydium;
190
201
  if (bc && !bc.complete) {
202
+ // 计算内盘估算流动性 (USD)
203
+ try {
204
+ const { getSolPrice } = await import('../dex/jup/price.js');
205
+ const solPrice = await getSolPrice();
206
+ if (solPrice) {
207
+ const realSol = Number(bc.realQuoteReserve || 0);
208
+ bc.liquidity = realSol * solPrice * 2; // 简单估算:SOL价值 * 2
209
+ }
210
+ }
211
+ catch { }
191
212
  result.bondingCurve = bc;
192
213
  result.platform = bc.type === 'pump' ? 'PUMP_BONDING_CURVE' :
193
214
  bc.type === 'meteora_dbc' ? 'METEORA_DBC' : 'RAYDIUM_LAUNCHLAB';
@@ -32,7 +32,7 @@ export class AAAccountManager {
32
32
  this.chainId = config.chainId ?? XLAYER_CHAIN_ID;
33
33
  const rpcUrl = config.rpcUrl ?? DEFAULT_RPC_URL;
34
34
  this.rpcUrl = rpcUrl;
35
- this.provider = new JsonRpcProvider(rpcUrl, { chainId: this.chainId, name: 'xlayer' }, {
35
+ this.provider = new JsonRpcProvider(rpcUrl, { chainId: this.chainId, name: 'xlayer', ensAddress: undefined }, {
36
36
  // 防止 ethers 自动攒太大的 JSON-RPC batch(XLayer 节点对“大 batch”很敏感)
37
37
  batchMaxCount: 20,
38
38
  batchStallTime: 30,
@@ -824,7 +824,7 @@ export async function predictSender(ownerAddress, config) {
824
824
  export function createWallet(privateKey, config) {
825
825
  const rpcUrl = config?.rpcUrl ?? DEFAULT_RPC_URL;
826
826
  const chainId = config?.chainId ?? XLAYER_CHAIN_ID;
827
- const provider = new JsonRpcProvider(rpcUrl, { chainId, name: 'xlayer' });
827
+ const provider = new JsonRpcProvider(rpcUrl, { chainId, name: 'xlayer', ensAddress: undefined });
828
828
  return new Wallet(privateKey, provider);
829
829
  }
830
830
  /**
@@ -94,7 +94,7 @@ export class DexQuery {
94
94
  constructor(config = {}) {
95
95
  const rpcUrl = config.rpcUrl ?? DEFAULT_RPC_URL;
96
96
  const chainId = config.chainId ?? XLAYER_CHAIN_ID;
97
- this.provider = new JsonRpcProvider(rpcUrl, { chainId, name: 'xlayer' });
97
+ this.provider = new JsonRpcProvider(rpcUrl, { chainId, name: 'xlayer', ensAddress: undefined });
98
98
  this.routerAddress = config.routerAddress ?? POTATOSWAP_V2_ROUTER;
99
99
  this.wokb = config.wokbAddress ?? WOKB;
100
100
  this.router = new Contract(this.routerAddress, POTATOSWAP_V2_ROUTER_ABI, this.provider);
@@ -100,7 +100,7 @@ export class PortalQuery {
100
100
  constructor(config = {}) {
101
101
  const rpcUrl = config.rpcUrl ?? DEFAULT_RPC_URL;
102
102
  const chainId = config.chainId ?? XLAYER_CHAIN_ID;
103
- this.provider = new JsonRpcProvider(rpcUrl, { chainId, name: 'xlayer' }, {
103
+ this.provider = new JsonRpcProvider(rpcUrl, { chainId, name: 'xlayer', ensAddress: undefined }, {
104
104
  batchMaxCount: 20,
105
105
  batchStallTime: 30,
106
106
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "four-flap-meme-sdk",
3
- "version": "1.5.56",
3
+ "version": "1.5.58",
4
4
  "description": "SDK for Flap bonding curve and four.meme TokenManager",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",