four-flap-meme-sdk 1.3.85 → 1.3.86

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 (104) hide show
  1. package/dist/clients/blockrazor.js +0 -1
  2. package/dist/flap/portal-bundle-merkle/encryption.d.ts +16 -0
  3. package/dist/flap/portal-bundle-merkle/encryption.js +146 -0
  4. package/dist/index.d.ts +0 -1
  5. package/dist/index.js +0 -1
  6. package/package.json +4 -39
  7. package/dist/sol/constants.d.ts +0 -136
  8. package/dist/sol/constants.js +0 -156
  9. package/dist/sol/dex/index.d.ts +0 -8
  10. package/dist/sol/dex/index.js +0 -12
  11. package/dist/sol/dex/meteora/client.d.ts +0 -75
  12. package/dist/sol/dex/meteora/client.js +0 -218
  13. package/dist/sol/dex/meteora/damm-v1-bundle.d.ts +0 -61
  14. package/dist/sol/dex/meteora/damm-v1-bundle.js +0 -112
  15. package/dist/sol/dex/meteora/damm-v1.d.ts +0 -118
  16. package/dist/sol/dex/meteora/damm-v1.js +0 -315
  17. package/dist/sol/dex/meteora/damm-v2-bundle.d.ts +0 -82
  18. package/dist/sol/dex/meteora/damm-v2-bundle.js +0 -242
  19. package/dist/sol/dex/meteora/damm-v2.d.ts +0 -172
  20. package/dist/sol/dex/meteora/damm-v2.js +0 -632
  21. package/dist/sol/dex/meteora/dbc-bundle.d.ts +0 -123
  22. package/dist/sol/dex/meteora/dbc-bundle.js +0 -304
  23. package/dist/sol/dex/meteora/dbc.d.ts +0 -192
  24. package/dist/sol/dex/meteora/dbc.js +0 -619
  25. package/dist/sol/dex/meteora/dlmm-bundle.d.ts +0 -39
  26. package/dist/sol/dex/meteora/dlmm-bundle.js +0 -189
  27. package/dist/sol/dex/meteora/dlmm.d.ts +0 -146
  28. package/dist/sol/dex/meteora/dlmm.js +0 -593
  29. package/dist/sol/dex/meteora/index.d.ts +0 -25
  30. package/dist/sol/dex/meteora/index.js +0 -65
  31. package/dist/sol/dex/meteora/types.d.ts +0 -787
  32. package/dist/sol/dex/meteora/types.js +0 -110
  33. package/dist/sol/dex/orca/index.d.ts +0 -10
  34. package/dist/sol/dex/orca/index.js +0 -16
  35. package/dist/sol/dex/orca/orca-bundle.d.ts +0 -41
  36. package/dist/sol/dex/orca/orca-bundle.js +0 -140
  37. package/dist/sol/dex/orca/orca.d.ts +0 -65
  38. package/dist/sol/dex/orca/orca.js +0 -426
  39. package/dist/sol/dex/orca/types.d.ts +0 -263
  40. package/dist/sol/dex/orca/types.js +0 -38
  41. package/dist/sol/dex/orca/wavebreak-bundle.d.ts +0 -34
  42. package/dist/sol/dex/orca/wavebreak-bundle.js +0 -189
  43. package/dist/sol/dex/orca/wavebreak-types.d.ts +0 -227
  44. package/dist/sol/dex/orca/wavebreak-types.js +0 -23
  45. package/dist/sol/dex/orca/wavebreak.d.ts +0 -78
  46. package/dist/sol/dex/orca/wavebreak.js +0 -469
  47. package/dist/sol/dex/pump/index.d.ts +0 -9
  48. package/dist/sol/dex/pump/index.js +0 -14
  49. package/dist/sol/dex/pump/pump-bundle.d.ts +0 -92
  50. package/dist/sol/dex/pump/pump-bundle.js +0 -383
  51. package/dist/sol/dex/pump/pump-swap-bundle.d.ts +0 -103
  52. package/dist/sol/dex/pump/pump-swap-bundle.js +0 -380
  53. package/dist/sol/dex/pump/pump-swap.d.ts +0 -46
  54. package/dist/sol/dex/pump/pump-swap.js +0 -199
  55. package/dist/sol/dex/pump/pump.d.ts +0 -35
  56. package/dist/sol/dex/pump/pump.js +0 -352
  57. package/dist/sol/dex/pump/types.d.ts +0 -215
  58. package/dist/sol/dex/pump/types.js +0 -5
  59. package/dist/sol/dex/raydium/index.d.ts +0 -8
  60. package/dist/sol/dex/raydium/index.js +0 -12
  61. package/dist/sol/dex/raydium/launchlab.d.ts +0 -68
  62. package/dist/sol/dex/raydium/launchlab.js +0 -210
  63. package/dist/sol/dex/raydium/raydium-bundle.d.ts +0 -64
  64. package/dist/sol/dex/raydium/raydium-bundle.js +0 -324
  65. package/dist/sol/dex/raydium/raydium.d.ts +0 -40
  66. package/dist/sol/dex/raydium/raydium.js +0 -366
  67. package/dist/sol/dex/raydium/types.d.ts +0 -240
  68. package/dist/sol/dex/raydium/types.js +0 -5
  69. package/dist/sol/index.d.ts +0 -10
  70. package/dist/sol/index.js +0 -16
  71. package/dist/sol/jito/bundle.d.ts +0 -90
  72. package/dist/sol/jito/bundle.js +0 -263
  73. package/dist/sol/jito/index.d.ts +0 -7
  74. package/dist/sol/jito/index.js +0 -7
  75. package/dist/sol/jito/tip.d.ts +0 -51
  76. package/dist/sol/jito/tip.js +0 -83
  77. package/dist/sol/jito/types.d.ts +0 -100
  78. package/dist/sol/jito/types.js +0 -5
  79. package/dist/sol/token/create-complete.d.ts +0 -115
  80. package/dist/sol/token/create-complete.js +0 -235
  81. package/dist/sol/token/create-token.d.ts +0 -57
  82. package/dist/sol/token/create-token.js +0 -230
  83. package/dist/sol/token/index.d.ts +0 -9
  84. package/dist/sol/token/index.js +0 -14
  85. package/dist/sol/token/metadata-upload.d.ts +0 -86
  86. package/dist/sol/token/metadata-upload.js +0 -173
  87. package/dist/sol/token/metadata.d.ts +0 -92
  88. package/dist/sol/token/metadata.js +0 -274
  89. package/dist/sol/token/types.d.ts +0 -153
  90. package/dist/sol/token/types.js +0 -5
  91. package/dist/sol/types.d.ts +0 -176
  92. package/dist/sol/types.js +0 -7
  93. package/dist/sol/utils/balance.d.ts +0 -160
  94. package/dist/sol/utils/balance.js +0 -638
  95. package/dist/sol/utils/connection.d.ts +0 -69
  96. package/dist/sol/utils/connection.js +0 -156
  97. package/dist/sol/utils/index.d.ts +0 -9
  98. package/dist/sol/utils/index.js +0 -9
  99. package/dist/sol/utils/lp-inspect.d.ts +0 -129
  100. package/dist/sol/utils/lp-inspect.js +0 -515
  101. package/dist/sol/utils/transfer.d.ts +0 -125
  102. package/dist/sol/utils/transfer.js +0 -220
  103. package/dist/sol/utils/wallet.d.ts +0 -107
  104. package/dist/sol/utils/wallet.js +0 -210
@@ -1,218 +0,0 @@
1
- /**
2
- * Meteora SDK 客户端管理器
3
- *
4
- * 统一管理 RPC 连接和 SDK 实例,避免重复实例化
5
- */
6
- import { PublicKey } from '@solana/web3.js';
7
- import { createConnection } from '../../utils/connection.js';
8
- // SDK 导入 - 使用类型断言绕过 TypeScript 类型检查
9
- import DLMMModule from '@meteora-ag/dlmm';
10
- import AmmImplModule from '@meteora-ag/dynamic-amm-sdk';
11
- import { CpAmm } from '@meteora-ag/cp-amm-sdk';
12
- import { DynamicBondingCurveClient } from '@meteora-ag/dynamic-bonding-curve-sdk';
13
- const DLMM = DLMMModule;
14
- const AmmImpl = AmmImplModule;
15
- // ============================================================================
16
- // 连接管理
17
- // ============================================================================
18
- /** 默认连接实例 */
19
- let defaultConnection = null;
20
- /**
21
- * 获取或创建默认连接
22
- * @param connection 可选的自定义连接
23
- */
24
- export function getConnection(connection) {
25
- if (connection) {
26
- return connection;
27
- }
28
- if (!defaultConnection) {
29
- defaultConnection = createConnection();
30
- }
31
- return defaultConnection;
32
- }
33
- /**
34
- * 设置默认连接
35
- * @param connection 新的连接实例
36
- */
37
- export function setDefaultConnection(connection) {
38
- defaultConnection = connection;
39
- }
40
- /**
41
- * 重置默认连接
42
- */
43
- export function resetDefaultConnection() {
44
- defaultConnection = null;
45
- }
46
- // ============================================================================
47
- // DLMM 实例缓存
48
- // ============================================================================
49
- /** DLMM 池实例缓存 */
50
- const dlmmPoolCache = new Map();
51
- /** 缓存过期时间 (毫秒) - 默认 30 秒 */
52
- const CACHE_TTL = 30 * 1000;
53
- /**
54
- * 获取或创建 DLMM 池实例
55
- * @param poolAddress 池地址
56
- * @param connection 可选连接
57
- * @param forceRefresh 强制刷新缓存
58
- */
59
- export async function getDlmmPool(poolAddress, connection, forceRefresh = false) {
60
- const conn = getConnection(connection);
61
- const cacheKey = poolAddress;
62
- // 检查缓存
63
- if (!forceRefresh) {
64
- const cached = dlmmPoolCache.get(cacheKey);
65
- if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
66
- return cached.instance;
67
- }
68
- }
69
- // 创建新实例
70
- const instance = await DLMM.create(conn, new PublicKey(poolAddress));
71
- // 存入缓存
72
- dlmmPoolCache.set(cacheKey, {
73
- instance,
74
- timestamp: Date.now(),
75
- });
76
- return instance;
77
- }
78
- /**
79
- * 获取所有 DLMM 池列表
80
- * @param connection 可选连接
81
- */
82
- export async function getAllDlmmPools(connection) {
83
- const conn = getConnection(connection);
84
- return DLMM.getLbPairs(conn);
85
- }
86
- /**
87
- * 清除 DLMM 池缓存
88
- * @param poolAddress 可选,指定池地址;不传则清除全部
89
- */
90
- export function clearDlmmCache(poolAddress) {
91
- if (poolAddress) {
92
- dlmmPoolCache.delete(poolAddress);
93
- }
94
- else {
95
- dlmmPoolCache.clear();
96
- }
97
- }
98
- // ============================================================================
99
- // DBC 客户端管理
100
- // ============================================================================
101
- /** DBC 客户端实例缓存 */
102
- let dbcClient = null;
103
- let dbcClientConnection = null;
104
- /**
105
- * 获取或创建 DBC 客户端
106
- * @param connection 可选连接
107
- */
108
- export function getDbcClient(connection) {
109
- const conn = getConnection(connection);
110
- // 如果连接相同,复用现有客户端
111
- if (dbcClient && dbcClientConnection === conn) {
112
- return dbcClient;
113
- }
114
- // 创建新客户端
115
- dbcClient = DynamicBondingCurveClient.create(conn, 'confirmed');
116
- dbcClientConnection = conn;
117
- return dbcClient;
118
- }
119
- /**
120
- * 重置 DBC 客户端
121
- */
122
- export function resetDbcClient() {
123
- dbcClient = null;
124
- dbcClientConnection = null;
125
- }
126
- // ============================================================================
127
- // DAMM v1 实例缓存
128
- // ============================================================================
129
- /** DAMM v1 池实例缓存 */
130
- const dammV1PoolCache = new Map();
131
- /**
132
- * 获取或创建 DAMM v1 池实例
133
- * @param poolAddress 池地址
134
- * @param connection 可选连接
135
- * @param forceRefresh 强制刷新缓存
136
- */
137
- export async function getDammV1Pool(poolAddress, connection, forceRefresh = false) {
138
- const conn = getConnection(connection);
139
- const cacheKey = poolAddress;
140
- // 检查缓存
141
- if (!forceRefresh) {
142
- const cached = dammV1PoolCache.get(cacheKey);
143
- if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
144
- return cached.instance;
145
- }
146
- }
147
- // 创建新实例
148
- const instance = await AmmImpl.create(conn, new PublicKey(poolAddress));
149
- // 存入缓存
150
- dammV1PoolCache.set(cacheKey, {
151
- instance,
152
- timestamp: Date.now(),
153
- });
154
- return instance;
155
- }
156
- /**
157
- * 清除 DAMM v1 池缓存
158
- * @param poolAddress 可选,指定池地址;不传则清除全部
159
- */
160
- export function clearDammV1Cache(poolAddress) {
161
- if (poolAddress) {
162
- dammV1PoolCache.delete(poolAddress);
163
- }
164
- else {
165
- dammV1PoolCache.clear();
166
- }
167
- }
168
- // ============================================================================
169
- // DAMM v2 客户端管理
170
- // ============================================================================
171
- /** DAMM v2 客户端实例缓存 */
172
- let cpAmmClient = null;
173
- let cpAmmClientConnection = null;
174
- /**
175
- * 获取或创建 DAMM v2 (CpAmm) 客户端
176
- * @param connection 可选连接
177
- */
178
- export function getCpAmmClient(connection) {
179
- const conn = getConnection(connection);
180
- // 如果连接相同,复用现有客户端
181
- if (cpAmmClient && cpAmmClientConnection === conn) {
182
- return cpAmmClient;
183
- }
184
- // 创建新客户端
185
- cpAmmClient = new CpAmm(conn);
186
- cpAmmClientConnection = conn;
187
- return cpAmmClient;
188
- }
189
- /**
190
- * 重置 DAMM v2 客户端
191
- */
192
- export function resetCpAmmClient() {
193
- cpAmmClient = null;
194
- cpAmmClientConnection = null;
195
- }
196
- // ============================================================================
197
- // 全局缓存管理
198
- // ============================================================================
199
- /**
200
- * 清除所有 Meteora 缓存
201
- */
202
- export function clearAllMeteoraCache() {
203
- clearDlmmCache();
204
- clearDammV1Cache();
205
- resetDbcClient();
206
- resetCpAmmClient();
207
- }
208
- /**
209
- * 设置缓存 TTL (毫秒)
210
- * 注意: 这会影响新创建的缓存项,不会影响已存在的
211
- */
212
- let cacheTtl = CACHE_TTL;
213
- export function setCacheTtl(ttlMs) {
214
- cacheTtl = ttlMs;
215
- }
216
- export function getCacheTtl() {
217
- return cacheTtl;
218
- }
@@ -1,61 +0,0 @@
1
- /**
2
- * Meteora DAMM v1 Bundle 批量交易
3
- *
4
- * 支持 Jito Bundle 的批量买卖
5
- */
6
- import { Connection, Keypair } from '@solana/web3.js';
7
- import BN from 'bn.js';
8
- import type { MeteoraBundleSignedResult } from './types.js';
9
- /**
10
- * DAMM v1 Bundle Swap 参数
11
- */
12
- export interface DammV1BundleSwapParams {
13
- /** 池地址 */
14
- poolAddress: string;
15
- /** 输入代币地址 */
16
- inputMint: string;
17
- /** 输出代币地址 */
18
- outputMint: string;
19
- /** 交易列表 */
20
- trades: {
21
- wallet: Keypair;
22
- amountIn: BN;
23
- minAmountOut?: BN;
24
- }[];
25
- /** 滑点 (bps) */
26
- slippageBps?: number;
27
- /** Jito 小费 */
28
- jitoTipLamports?: number;
29
- }
30
- /**
31
- * 签名 DAMM v1 Bundle 批量买入交易
32
- *
33
- * @param params Bundle 参数
34
- * @param connection 可选连接
35
- */
36
- export declare function signDammV1BundleBuy(params: DammV1BundleSwapParams, connection?: Connection): Promise<MeteoraBundleSignedResult>;
37
- /**
38
- * 签名 DAMM v1 Bundle 批量卖出交易
39
- *
40
- * @param params Bundle 参数
41
- * @param connection 可选连接
42
- */
43
- export declare function signDammV1BundleSell(params: DammV1BundleSwapParams, connection?: Connection): Promise<MeteoraBundleSignedResult>;
44
- /**
45
- * 签名 DAMM v1 Bundle 通用 Swap 交易
46
- *
47
- * @param params Bundle 参数
48
- * @param isBuy 是否买入 (true = 买入, false = 卖出)
49
- * @param connection 可选连接
50
- */
51
- export declare function signDammV1BundleSwap(params: DammV1BundleSwapParams, isBuy: boolean, connection?: Connection): Promise<MeteoraBundleSignedResult>;
52
- /**
53
- * 将 Bundle 结果转换为后端 API 请求格式
54
- */
55
- export declare function toDammV1BundleApiRequest(result: MeteoraBundleSignedResult): {
56
- transactions: string[];
57
- type: string;
58
- poolAddress: string;
59
- tradeCount: number;
60
- jitoTipLamports: number;
61
- };
@@ -1,112 +0,0 @@
1
- /**
2
- * Meteora DAMM v1 Bundle 批量交易
3
- *
4
- * 支持 Jito Bundle 的批量买卖
5
- */
6
- import { PublicKey, } from '@solana/web3.js';
7
- import { getConnection, getDammV1Pool } from './client.js';
8
- import { buildTipInstruction } from '../../jito/tip.js';
9
- // ============================================================================
10
- // Bundle 批量买入
11
- // ============================================================================
12
- /**
13
- * 签名 DAMM v1 Bundle 批量买入交易
14
- *
15
- * @param params Bundle 参数
16
- * @param connection 可选连接
17
- */
18
- export async function signDammV1BundleBuy(params, connection) {
19
- const conn = getConnection(connection);
20
- const pool = await getDammV1Pool(params.poolAddress, connection);
21
- const signedTransactions = [];
22
- for (let i = 0; i < params.trades.length; i++) {
23
- const trade = params.trades[i];
24
- const swapQuote = pool.getSwapQuote(new PublicKey(params.inputMint), trade.amountIn, params.slippageBps || 100);
25
- const minAmountOut = trade.minAmountOut || swapQuote.minSwapOutAmount;
26
- const swapTx = await pool.swap(trade.wallet.publicKey, new PublicKey(params.inputMint), trade.amountIn, minAmountOut);
27
- if (i === params.trades.length - 1 && params.jitoTipLamports) {
28
- const tipIx = buildTipInstruction(trade.wallet.publicKey, BigInt(params.jitoTipLamports));
29
- swapTx.add(tipIx);
30
- }
31
- const { blockhash, lastValidBlockHeight } = await conn.getLatestBlockhash();
32
- swapTx.recentBlockhash = blockhash;
33
- swapTx.lastValidBlockHeight = lastValidBlockHeight;
34
- swapTx.feePayer = trade.wallet.publicKey;
35
- swapTx.sign(trade.wallet);
36
- signedTransactions.push(swapTx);
37
- }
38
- return {
39
- signedTransactions,
40
- type: 'damm_v1_bundle_buy',
41
- poolAddress: params.poolAddress,
42
- tradeCount: params.trades.length,
43
- jitoTipLamports: params.jitoTipLamports || 0,
44
- };
45
- }
46
- // ============================================================================
47
- // Bundle 批量卖出
48
- // ============================================================================
49
- /**
50
- * 签名 DAMM v1 Bundle 批量卖出交易
51
- *
52
- * @param params Bundle 参数
53
- * @param connection 可选连接
54
- */
55
- export async function signDammV1BundleSell(params, connection) {
56
- const conn = getConnection(connection);
57
- const pool = await getDammV1Pool(params.poolAddress, connection);
58
- const signedTransactions = [];
59
- for (let i = 0; i < params.trades.length; i++) {
60
- const trade = params.trades[i];
61
- const swapQuote = pool.getSwapQuote(new PublicKey(params.inputMint), trade.amountIn, params.slippageBps || 100);
62
- const minAmountOut = trade.minAmountOut || swapQuote.minSwapOutAmount;
63
- const swapTx = await pool.swap(trade.wallet.publicKey, new PublicKey(params.inputMint), trade.amountIn, minAmountOut);
64
- if (i === params.trades.length - 1 && params.jitoTipLamports) {
65
- const tipIx = buildTipInstruction(trade.wallet.publicKey, BigInt(params.jitoTipLamports));
66
- swapTx.add(tipIx);
67
- }
68
- const { blockhash, lastValidBlockHeight } = await conn.getLatestBlockhash();
69
- swapTx.recentBlockhash = blockhash;
70
- swapTx.lastValidBlockHeight = lastValidBlockHeight;
71
- swapTx.feePayer = trade.wallet.publicKey;
72
- swapTx.sign(trade.wallet);
73
- signedTransactions.push(swapTx);
74
- }
75
- return {
76
- signedTransactions,
77
- type: 'damm_v1_bundle_sell',
78
- poolAddress: params.poolAddress,
79
- tradeCount: params.trades.length,
80
- jitoTipLamports: params.jitoTipLamports || 0,
81
- };
82
- }
83
- // ============================================================================
84
- // Bundle 通用 Swap
85
- // ============================================================================
86
- /**
87
- * 签名 DAMM v1 Bundle 通用 Swap 交易
88
- *
89
- * @param params Bundle 参数
90
- * @param isBuy 是否买入 (true = 买入, false = 卖出)
91
- * @param connection 可选连接
92
- */
93
- export async function signDammV1BundleSwap(params, isBuy, connection) {
94
- if (isBuy) {
95
- return signDammV1BundleBuy(params, connection);
96
- }
97
- else {
98
- return signDammV1BundleSell(params, connection);
99
- }
100
- }
101
- /**
102
- * 将 Bundle 结果转换为后端 API 请求格式
103
- */
104
- export function toDammV1BundleApiRequest(result) {
105
- return {
106
- transactions: result.signedTransactions.map((tx) => tx.serialize().toString('base64')),
107
- type: result.type,
108
- poolAddress: result.poolAddress,
109
- tradeCount: result.tradeCount,
110
- jitoTipLamports: result.jitoTipLamports,
111
- };
112
- }
@@ -1,118 +0,0 @@
1
- /**
2
- * Meteora DAMM v1 (Dynamic AMM) 集成
3
- *
4
- * 基于 https://github.com/MeteoraAg/dynamic-amm-sdk 源码分析
5
- * DAMM v1 是 DBC 迁移后的目标池之一
6
- */
7
- import { Connection, Keypair } from '@solana/web3.js';
8
- import BN from 'bn.js';
9
- import type { DammV1PoolInfo, DammV1SwapParams, MeteoraSignedResult } from './types.js';
10
- /**
11
- * 获取 DAMM v1 池信息
12
- * @param poolAddress 池地址
13
- * @param connection 可选连接
14
- */
15
- export declare function getDammV1PoolInfo(poolAddress: string, connection?: Connection): Promise<DammV1PoolInfo>;
16
- /**
17
- * 签名 DAMM v1 Swap 交易
18
- * @param params Swap 参数
19
- * @param wallet 钱包
20
- * @param connection 可选连接
21
- */
22
- export declare function signDammV1Swap(params: DammV1SwapParams, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
23
- /**
24
- * 签名 DAMM v1 添加流动性交易
25
- */
26
- export declare function signDammV1Deposit(poolAddress: string, amountA: BN, amountB: BN, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
27
- /**
28
- * 签名 DAMM v1 移除流动性交易
29
- */
30
- export declare function signDammV1Withdraw(poolAddress: string, lpAmount: BN, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
31
- /**
32
- * 签名锁定 LP 交易
33
- */
34
- export declare function signDammV1LockLiquidity(poolAddress: string, lpAmount: BN, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
35
- /**
36
- * 签名领取锁定 LP 费用交易
37
- */
38
- export declare function signDammV1ClaimLockFee(poolAddress: string, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
39
- /**
40
- * 获取 LP Token Mint 地址
41
- */
42
- export declare function getDammV1LpMint(poolAddress: string, connection?: Connection): Promise<string>;
43
- /**
44
- * 获取 LP 供应量
45
- */
46
- export declare function getDammV1LpSupply(poolAddress: string, connection?: Connection): Promise<BN>;
47
- /**
48
- * 获取锁定的 LP 数量
49
- */
50
- export declare function getDammV1LockedLpAmount(poolAddress: string, connection?: Connection): Promise<BN>;
51
- /**
52
- * 签名创建 DAMM v1 池交易
53
- * @param tokenAMint Token A Mint
54
- * @param tokenBMint Token B Mint
55
- * @param tokenAAmount 初始 Token A 数量
56
- * @param tokenBAmount 初始 Token B 数量
57
- * @param wallet 钱包
58
- * @param connection 可选连接
59
- */
60
- export declare function signDammV1CreatePool(tokenAMint: string, tokenBMint: string, tokenAAmount: BN, tokenBAmount: BN, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
61
- /**
62
- * 获取 DAMM v1 Swap 报价
63
- * @param poolAddress 池地址
64
- * @param inputMint 输入 Mint
65
- * @param amountIn 输入数量
66
- * @param slippageBps 滑点 (bps)
67
- * @param connection 可选连接
68
- */
69
- export declare function getDammV1SwapQuote(poolAddress: string, inputMint: string, amountIn: BN, slippageBps?: number, connection?: Connection): Promise<{
70
- swapInAmount: string;
71
- swapOutAmount: string;
72
- minSwapOutAmount: string;
73
- priceImpact: string;
74
- fee: string;
75
- }>;
76
- /**
77
- * 获取 DAMM v1 存款报价
78
- * @param poolAddress 池地址
79
- * @param tokenAAmount Token A 数量
80
- * @param tokenBAmount Token B 数量
81
- * @param slippageBps 滑点 (bps)
82
- * @param connection 可选连接
83
- */
84
- export declare function getDammV1DepositQuote(poolAddress: string, tokenAAmount: BN, tokenBAmount: BN, slippageBps?: number, connection?: Connection): Promise<{
85
- tokenAInAmount: string;
86
- tokenBInAmount: string;
87
- poolTokenAmountOut: string;
88
- minPoolTokenAmountOut: string;
89
- }>;
90
- /**
91
- * 获取 DAMM v1 提款报价
92
- * @param poolAddress 池地址
93
- * @param lpAmount LP 数量
94
- * @param slippageBps 滑点 (bps)
95
- * @param connection 可选连接
96
- */
97
- export declare function getDammV1WithdrawQuote(poolAddress: string, lpAmount: BN, slippageBps?: number, connection?: Connection): Promise<{
98
- tokenAOutAmount: string;
99
- tokenBOutAmount: string;
100
- minTokenAOutAmount: string;
101
- minTokenBOutAmount: string;
102
- }>;
103
- /**
104
- * 获取用户的 LP 余额
105
- * @param poolAddress 池地址
106
- * @param userAddress 用户地址
107
- * @param connection 可选连接
108
- */
109
- export declare function getDammV1UserLpBalance(poolAddress: string, userAddress: string, connection?: Connection): Promise<{
110
- balance: string;
111
- lockedBalance: string;
112
- }>;
113
- /**
114
- * 获取池的虚拟价格
115
- * @param poolAddress 池地址
116
- * @param connection 可选连接
117
- */
118
- export declare function getDammV1VirtualPrice(poolAddress: string, connection?: Connection): Promise<number>;