four-flap-meme-sdk 1.3.89 → 1.3.91

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 (122) hide show
  1. package/dist/clients/blockrazor.js +1 -0
  2. package/dist/contracts/tm-bundle-merkle/core.js +3 -6
  3. package/dist/contracts/tm-bundle-merkle/pancake-proxy.js +38 -30
  4. package/dist/contracts/tm-bundle-merkle/swap-buy-first.d.ts +1 -0
  5. package/dist/contracts/tm-bundle-merkle/swap-buy-first.js +3 -4
  6. package/dist/contracts/tm-bundle-merkle/swap.d.ts +3 -0
  7. package/dist/contracts/tm-bundle-merkle/swap.js +2 -2
  8. package/dist/flap/portal-bundle-merkle/core.js +6 -2
  9. package/dist/flap/portal-bundle-merkle/pancake-proxy.js +35 -55
  10. package/dist/flap/portal-bundle-merkle/swap-buy-first.d.ts +2 -0
  11. package/dist/flap/portal-bundle-merkle/swap-buy-first.js +11 -6
  12. package/dist/flap/portal-bundle-merkle/swap.d.ts +2 -0
  13. package/dist/flap/portal-bundle-merkle/swap.js +22 -10
  14. package/dist/index.d.ts +2 -1
  15. package/dist/index.js +1 -0
  16. package/dist/pancake/bundle-buy-first.d.ts +1 -0
  17. package/dist/pancake/bundle-buy-first.js +9 -4
  18. package/dist/pancake/bundle-swap.d.ts +4 -0
  19. package/dist/pancake/bundle-swap.js +14 -7
  20. package/dist/sol/constants.d.ts +126 -0
  21. package/dist/sol/constants.js +145 -0
  22. package/dist/sol/dex/index.d.ts +8 -0
  23. package/dist/sol/dex/index.js +12 -0
  24. package/dist/sol/dex/meteora/client.d.ts +76 -0
  25. package/dist/sol/dex/meteora/client.js +219 -0
  26. package/dist/sol/dex/meteora/damm-v1-bundle.d.ts +61 -0
  27. package/dist/sol/dex/meteora/damm-v1-bundle.js +112 -0
  28. package/dist/sol/dex/meteora/damm-v1.d.ts +118 -0
  29. package/dist/sol/dex/meteora/damm-v1.js +315 -0
  30. package/dist/sol/dex/meteora/damm-v2-bundle.d.ts +82 -0
  31. package/dist/sol/dex/meteora/damm-v2-bundle.js +242 -0
  32. package/dist/sol/dex/meteora/damm-v2.d.ts +172 -0
  33. package/dist/sol/dex/meteora/damm-v2.js +632 -0
  34. package/dist/sol/dex/meteora/dbc-bundle.d.ts +123 -0
  35. package/dist/sol/dex/meteora/dbc-bundle.js +304 -0
  36. package/dist/sol/dex/meteora/dbc.d.ts +192 -0
  37. package/dist/sol/dex/meteora/dbc.js +619 -0
  38. package/dist/sol/dex/meteora/dlmm-bundle.d.ts +39 -0
  39. package/dist/sol/dex/meteora/dlmm-bundle.js +189 -0
  40. package/dist/sol/dex/meteora/dlmm.d.ts +146 -0
  41. package/dist/sol/dex/meteora/dlmm.js +593 -0
  42. package/dist/sol/dex/meteora/index.d.ts +25 -0
  43. package/dist/sol/dex/meteora/index.js +65 -0
  44. package/dist/sol/dex/meteora/types.d.ts +787 -0
  45. package/dist/sol/dex/meteora/types.js +110 -0
  46. package/dist/sol/dex/orca/index.d.ts +10 -0
  47. package/dist/sol/dex/orca/index.js +16 -0
  48. package/dist/sol/dex/orca/orca-bundle.d.ts +41 -0
  49. package/dist/sol/dex/orca/orca-bundle.js +173 -0
  50. package/dist/sol/dex/orca/orca.d.ts +65 -0
  51. package/dist/sol/dex/orca/orca.js +474 -0
  52. package/dist/sol/dex/orca/types.d.ts +263 -0
  53. package/dist/sol/dex/orca/types.js +38 -0
  54. package/dist/sol/dex/orca/wavebreak-bundle.d.ts +34 -0
  55. package/dist/sol/dex/orca/wavebreak-bundle.js +198 -0
  56. package/dist/sol/dex/orca/wavebreak-types.d.ts +227 -0
  57. package/dist/sol/dex/orca/wavebreak-types.js +23 -0
  58. package/dist/sol/dex/orca/wavebreak.d.ts +78 -0
  59. package/dist/sol/dex/orca/wavebreak.js +497 -0
  60. package/dist/sol/dex/pump/index.d.ts +9 -0
  61. package/dist/sol/dex/pump/index.js +14 -0
  62. package/dist/sol/dex/pump/pump-bundle.d.ts +92 -0
  63. package/dist/sol/dex/pump/pump-bundle.js +383 -0
  64. package/dist/sol/dex/pump/pump-swap-bundle.d.ts +103 -0
  65. package/dist/sol/dex/pump/pump-swap-bundle.js +380 -0
  66. package/dist/sol/dex/pump/pump-swap.d.ts +46 -0
  67. package/dist/sol/dex/pump/pump-swap.js +199 -0
  68. package/dist/sol/dex/pump/pump.d.ts +35 -0
  69. package/dist/sol/dex/pump/pump.js +352 -0
  70. package/dist/sol/dex/pump/types.d.ts +215 -0
  71. package/dist/sol/dex/pump/types.js +5 -0
  72. package/dist/sol/dex/raydium/index.d.ts +8 -0
  73. package/dist/sol/dex/raydium/index.js +12 -0
  74. package/dist/sol/dex/raydium/launchlab.d.ts +68 -0
  75. package/dist/sol/dex/raydium/launchlab.js +210 -0
  76. package/dist/sol/dex/raydium/raydium-bundle.d.ts +64 -0
  77. package/dist/sol/dex/raydium/raydium-bundle.js +324 -0
  78. package/dist/sol/dex/raydium/raydium.d.ts +40 -0
  79. package/dist/sol/dex/raydium/raydium.js +366 -0
  80. package/dist/sol/dex/raydium/types.d.ts +240 -0
  81. package/dist/sol/dex/raydium/types.js +5 -0
  82. package/dist/sol/index.d.ts +10 -0
  83. package/dist/sol/index.js +16 -0
  84. package/dist/sol/jito/bundle.d.ts +90 -0
  85. package/dist/sol/jito/bundle.js +263 -0
  86. package/dist/sol/jito/index.d.ts +7 -0
  87. package/dist/sol/jito/index.js +7 -0
  88. package/dist/sol/jito/tip.d.ts +51 -0
  89. package/dist/sol/jito/tip.js +83 -0
  90. package/dist/sol/jito/types.d.ts +100 -0
  91. package/dist/sol/jito/types.js +5 -0
  92. package/dist/sol/token/create-complete.d.ts +115 -0
  93. package/dist/sol/token/create-complete.js +235 -0
  94. package/dist/sol/token/create-token.d.ts +57 -0
  95. package/dist/sol/token/create-token.js +230 -0
  96. package/dist/sol/token/index.d.ts +9 -0
  97. package/dist/sol/token/index.js +14 -0
  98. package/dist/sol/token/metadata-upload.d.ts +86 -0
  99. package/dist/sol/token/metadata-upload.js +173 -0
  100. package/dist/sol/token/metadata.d.ts +92 -0
  101. package/dist/sol/token/metadata.js +274 -0
  102. package/dist/sol/token/types.d.ts +153 -0
  103. package/dist/sol/token/types.js +5 -0
  104. package/dist/sol/types.d.ts +176 -0
  105. package/dist/sol/types.js +7 -0
  106. package/dist/sol/utils/balance.d.ts +160 -0
  107. package/dist/sol/utils/balance.js +638 -0
  108. package/dist/sol/utils/connection.d.ts +78 -0
  109. package/dist/sol/utils/connection.js +168 -0
  110. package/dist/sol/utils/index.d.ts +9 -0
  111. package/dist/sol/utils/index.js +9 -0
  112. package/dist/sol/utils/lp-inspect.d.ts +129 -0
  113. package/dist/sol/utils/lp-inspect.js +529 -0
  114. package/dist/sol/utils/transfer.d.ts +125 -0
  115. package/dist/sol/utils/transfer.js +220 -0
  116. package/dist/sol/utils/wallet.d.ts +107 -0
  117. package/dist/sol/utils/wallet.js +210 -0
  118. package/dist/utils/erc20.d.ts +2 -108
  119. package/dist/utils/erc20.js +17 -65
  120. package/package.json +39 -4
  121. package/dist/flap/portal-bundle-merkle/encryption.d.ts +0 -16
  122. package/dist/flap/portal-bundle-merkle/encryption.js +0 -146
@@ -0,0 +1,242 @@
1
+ /**
2
+ * Meteora DAMM v2 (CP-AMM) Bundle 批量交易
3
+ *
4
+ * 支持 Jito Bundle 的批量买卖
5
+ */
6
+ import { PublicKey, } from '@solana/web3.js';
7
+ import { getTokenProgram } from '@meteora-ag/cp-amm-sdk';
8
+ import { getConnection, getCpAmmClient } from './client.js';
9
+ import { buildTipInstruction } from '../../jito/tip.js';
10
+ // ============================================================================
11
+ // Bundle 批量买入
12
+ // ============================================================================
13
+ /**
14
+ * 签名 DAMM v2 Bundle 批量买入交易
15
+ *
16
+ * @param params Bundle 参数
17
+ * @param connection 可选连接
18
+ */
19
+ export async function signDammV2BundleBuy(params, connection) {
20
+ const conn = getConnection(connection);
21
+ const cpAmm = getCpAmmClient(connection);
22
+ const poolPubkey = new PublicKey(params.poolAddress);
23
+ const poolState = await cpAmm.fetchPoolState(poolPubkey);
24
+ // 获取当前 slot 和时间用于报价
25
+ const currentSlot = await conn.getSlot();
26
+ const blockTime = await conn.getBlockTime(currentSlot);
27
+ const signedTransactions = [];
28
+ const { blockhash, lastValidBlockHeight } = await conn.getLatestBlockhash();
29
+ const tokenADecimal = params.tokenADecimal ?? 9;
30
+ const tokenBDecimal = params.tokenBDecimal ?? 9;
31
+ const slippage = params.slippagePercent ?? 0.5;
32
+ for (let i = 0; i < params.trades.length; i++) {
33
+ const trade = params.trades[i];
34
+ let minAmountOut = trade.minAmountOut;
35
+ // 如果没有指定 minAmountOut,使用 getQuote 获取准确报价
36
+ if (!minAmountOut) {
37
+ const quote = await cpAmm.getQuote({
38
+ inAmount: trade.amountIn,
39
+ inputTokenMint: new PublicKey(params.inputMint),
40
+ slippage,
41
+ poolState,
42
+ currentTime: blockTime || Math.floor(Date.now() / 1000),
43
+ currentSlot,
44
+ tokenADecimal,
45
+ tokenBDecimal,
46
+ hasReferral: false,
47
+ });
48
+ minAmountOut = quote.minSwapOutAmount;
49
+ }
50
+ // swap 返回 TxBuilder,需要调用 .transaction() 获取 Transaction
51
+ const swapTxBuilder = await cpAmm.swap({
52
+ payer: trade.wallet.publicKey,
53
+ pool: poolPubkey,
54
+ inputTokenMint: new PublicKey(params.inputMint),
55
+ outputTokenMint: new PublicKey(params.outputMint),
56
+ amountIn: trade.amountIn,
57
+ minimumAmountOut: minAmountOut,
58
+ tokenAMint: poolState.tokenAMint,
59
+ tokenBMint: poolState.tokenBMint,
60
+ tokenAVault: poolState.tokenAVault,
61
+ tokenBVault: poolState.tokenBVault,
62
+ tokenAProgram: getTokenProgram(poolState.tokenAFlag),
63
+ tokenBProgram: getTokenProgram(poolState.tokenBFlag),
64
+ referralTokenAccount: null,
65
+ });
66
+ // 处理 TxBuilder 或 Transaction 返回类型
67
+ const swapTx = 'transaction' in swapTxBuilder
68
+ ? await swapTxBuilder.transaction()
69
+ : swapTxBuilder;
70
+ // 如果是最后一笔交易,添加 Jito tip
71
+ if (i === params.trades.length - 1 && params.jitoTipLamports) {
72
+ const tipIx = buildTipInstruction(trade.wallet.publicKey, BigInt(params.jitoTipLamports));
73
+ swapTx.add(tipIx);
74
+ }
75
+ swapTx.recentBlockhash = blockhash;
76
+ swapTx.lastValidBlockHeight = lastValidBlockHeight;
77
+ swapTx.feePayer = trade.wallet.publicKey;
78
+ swapTx.sign(trade.wallet);
79
+ signedTransactions.push(swapTx);
80
+ }
81
+ return {
82
+ signedTransactions,
83
+ type: 'damm_v2_bundle_buy',
84
+ poolAddress: params.poolAddress,
85
+ tradeCount: params.trades.length,
86
+ jitoTipLamports: params.jitoTipLamports || 0,
87
+ };
88
+ }
89
+ // ============================================================================
90
+ // Bundle 批量卖出
91
+ // ============================================================================
92
+ /**
93
+ * 签名 DAMM v2 Bundle 批量卖出交易
94
+ *
95
+ * @param params Bundle 参数
96
+ * @param connection 可选连接
97
+ */
98
+ export async function signDammV2BundleSell(params, connection) {
99
+ const conn = getConnection(connection);
100
+ const cpAmm = getCpAmmClient(connection);
101
+ const poolPubkey = new PublicKey(params.poolAddress);
102
+ const poolState = await cpAmm.fetchPoolState(poolPubkey);
103
+ // 获取当前 slot 和时间用于报价
104
+ const currentSlot = await conn.getSlot();
105
+ const blockTime = await conn.getBlockTime(currentSlot);
106
+ const signedTransactions = [];
107
+ const { blockhash, lastValidBlockHeight } = await conn.getLatestBlockhash();
108
+ const tokenADecimal = params.tokenADecimal ?? 9;
109
+ const tokenBDecimal = params.tokenBDecimal ?? 9;
110
+ const slippage = params.slippagePercent ?? 0.5;
111
+ for (let i = 0; i < params.trades.length; i++) {
112
+ const trade = params.trades[i];
113
+ let minAmountOut = trade.minAmountOut;
114
+ // 如果没有指定 minAmountOut,使用 getQuote 获取准确报价
115
+ if (!minAmountOut) {
116
+ const quote = await cpAmm.getQuote({
117
+ inAmount: trade.amountIn,
118
+ inputTokenMint: new PublicKey(params.inputMint),
119
+ slippage,
120
+ poolState,
121
+ currentTime: blockTime || Math.floor(Date.now() / 1000),
122
+ currentSlot,
123
+ tokenADecimal,
124
+ tokenBDecimal,
125
+ hasReferral: false,
126
+ });
127
+ minAmountOut = quote.minSwapOutAmount;
128
+ }
129
+ // swap 返回 TxBuilder,需要调用 .transaction() 获取 Transaction
130
+ const swapTxBuilder = await cpAmm.swap({
131
+ payer: trade.wallet.publicKey,
132
+ pool: poolPubkey,
133
+ inputTokenMint: new PublicKey(params.inputMint),
134
+ outputTokenMint: new PublicKey(params.outputMint),
135
+ amountIn: trade.amountIn,
136
+ minimumAmountOut: minAmountOut,
137
+ tokenAMint: poolState.tokenAMint,
138
+ tokenBMint: poolState.tokenBMint,
139
+ tokenAVault: poolState.tokenAVault,
140
+ tokenBVault: poolState.tokenBVault,
141
+ tokenAProgram: getTokenProgram(poolState.tokenAFlag),
142
+ tokenBProgram: getTokenProgram(poolState.tokenBFlag),
143
+ referralTokenAccount: null,
144
+ });
145
+ // 处理 TxBuilder 或 Transaction 返回类型
146
+ const swapTx = 'transaction' in swapTxBuilder
147
+ ? await swapTxBuilder.transaction()
148
+ : swapTxBuilder;
149
+ // 如果是最后一笔交易,添加 Jito tip
150
+ if (i === params.trades.length - 1 && params.jitoTipLamports) {
151
+ const tipIx = buildTipInstruction(trade.wallet.publicKey, BigInt(params.jitoTipLamports));
152
+ swapTx.add(tipIx);
153
+ }
154
+ swapTx.recentBlockhash = blockhash;
155
+ swapTx.lastValidBlockHeight = lastValidBlockHeight;
156
+ swapTx.feePayer = trade.wallet.publicKey;
157
+ swapTx.sign(trade.wallet);
158
+ signedTransactions.push(swapTx);
159
+ }
160
+ return {
161
+ signedTransactions,
162
+ type: 'damm_v2_bundle_sell',
163
+ poolAddress: params.poolAddress,
164
+ tradeCount: params.trades.length,
165
+ jitoTipLamports: params.jitoTipLamports || 0,
166
+ };
167
+ }
168
+ // ============================================================================
169
+ // Bundle 通用 Swap
170
+ // ============================================================================
171
+ /**
172
+ * 签名 DAMM v2 Bundle 通用 Swap 交易
173
+ *
174
+ * @param params Bundle 参数
175
+ * @param isBuy 是否买入 (true = 买入, false = 卖出)
176
+ * @param connection 可选连接
177
+ */
178
+ export async function signDammV2BundleSwap(params, isBuy, connection) {
179
+ if (isBuy) {
180
+ return signDammV2BundleBuy(params, connection);
181
+ }
182
+ else {
183
+ return signDammV2BundleSell(params, connection);
184
+ }
185
+ }
186
+ /**
187
+ * 将 Bundle 结果转换为后端 API 请求格式
188
+ */
189
+ export function toDammV2BundleApiRequest(result) {
190
+ return {
191
+ transactions: result.signedTransactions.map((tx) => tx.serialize().toString('base64')),
192
+ type: result.type,
193
+ poolAddress: result.poolAddress,
194
+ tradeCount: result.tradeCount,
195
+ jitoTipLamports: result.jitoTipLamports,
196
+ };
197
+ }
198
+ // ============================================================================
199
+ // 辅助函数:批量获取报价
200
+ // ============================================================================
201
+ /**
202
+ * 批量获取 DAMM v2 Swap 报价
203
+ *
204
+ * @param poolAddress 池地址
205
+ * @param inputMint 输入代币地址
206
+ * @param amounts 输入金额列表
207
+ * @param tokenADecimal Token A 精度
208
+ * @param tokenBDecimal Token B 精度
209
+ * @param slippagePercent 滑点百分比
210
+ * @param connection 可选连接
211
+ */
212
+ export async function getDammV2BundleQuotes(poolAddress, inputMint, amounts, tokenADecimal = 9, tokenBDecimal = 9, slippagePercent = 0.5, connection) {
213
+ const conn = getConnection(connection);
214
+ const cpAmm = getCpAmmClient(connection);
215
+ const poolPubkey = new PublicKey(poolAddress);
216
+ const poolState = await cpAmm.fetchPoolState(poolPubkey);
217
+ const currentSlot = await conn.getSlot();
218
+ const blockTime = await conn.getBlockTime(currentSlot);
219
+ const quotes = [];
220
+ for (const amountIn of amounts) {
221
+ const quote = await cpAmm.getQuote({
222
+ inAmount: amountIn,
223
+ inputTokenMint: new PublicKey(inputMint),
224
+ slippage: slippagePercent,
225
+ poolState,
226
+ currentTime: blockTime || Math.floor(Date.now() / 1000),
227
+ currentSlot,
228
+ tokenADecimal,
229
+ tokenBDecimal,
230
+ hasReferral: false,
231
+ });
232
+ quotes.push({
233
+ swapOutAmount: quote.swapOutAmount.toString(),
234
+ minSwapOutAmount: quote.minSwapOutAmount.toString(),
235
+ totalFee: quote.totalFee.toString(),
236
+ priceImpact: typeof quote.priceImpact === 'number'
237
+ ? quote.priceImpact
238
+ : Number(quote.priceImpact),
239
+ });
240
+ }
241
+ return quotes;
242
+ }
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Meteora DAMM v2 (CP-AMM) 集成
3
+ *
4
+ * 基于 https://github.com/MeteoraAg/cp-amm-sdk 源码分析
5
+ * DAMM v2 是 DBC 迁移后的目标池之一,使用 NFT 代表仓位
6
+ */
7
+ import { Connection, Keypair } from '@solana/web3.js';
8
+ import BN from 'bn.js';
9
+ import type { DammV2PoolInfo, DammV2SwapParams, DammV2AddLiquidityParams, DammV2RemoveLiquidityParams, MeteoraSignedResult } from './types.js';
10
+ /**
11
+ * 获取 DAMM v2 池信息
12
+ * @param poolAddress 池地址
13
+ * @param connection 可选连接
14
+ */
15
+ export declare function getDammV2PoolInfo(poolAddress: string, connection?: Connection): Promise<DammV2PoolInfo>;
16
+ /**
17
+ * 签名 DAMM v2 Swap 交易
18
+ * @param params Swap 参数
19
+ * @param wallet 钱包
20
+ * @param connection 可选连接
21
+ */
22
+ export declare function signDammV2Swap(params: DammV2SwapParams, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
23
+ /**
24
+ * 签名 DAMM v2 添加流动性交易(创建新仓位)
25
+ */
26
+ export declare function signDammV2AddLiquidity(params: DammV2AddLiquidityParams, wallet: Keypair, positionNftKeypair?: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
27
+ /**
28
+ * 签名 DAMM v2 移除流动性交易
29
+ */
30
+ export declare function signDammV2RemoveLiquidity(params: DammV2RemoveLiquidityParams, positionAddress: string, positionNftAccount: string, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
31
+ /**
32
+ * 签名领取 Position 费用交易
33
+ */
34
+ export declare function signDammV2ClaimPositionFee(poolAddress: string, positionAddress: string, positionNftAccount: string, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
35
+ /**
36
+ * 签名永久锁定 Position 交易
37
+ */
38
+ export declare function signDammV2PermanentLockPosition(poolAddress: string, positionAddress: string, positionNftAccount: string, unlockedLiquidity: BN, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
39
+ /**
40
+ * 获取用户在池中的所有 Position
41
+ */
42
+ export declare function getDammV2UserPositions(poolAddress: string, userAddress: string, connection?: Connection): Promise<any[]>;
43
+ /**
44
+ * 派生池地址
45
+ */
46
+ export declare function deriveDammV2PoolAddress(config: string, tokenAMint: string, tokenBMint: string): string;
47
+ /**
48
+ * 派生 Position 地址
49
+ */
50
+ export declare function deriveDammV2PositionAddress(positionNft: string): string;
51
+ /**
52
+ * 签名创建 DAMM v2 池交易
53
+ * @param params 创建池参数
54
+ * @param positionNftKeypair Position NFT Keypair
55
+ * @param wallet 钱包
56
+ * @param connection 可选连接
57
+ */
58
+ export declare function signDammV2CreatePool(params: {
59
+ configAddress: string;
60
+ tokenAMint: string;
61
+ tokenBMint: string;
62
+ tokenAAmount: BN;
63
+ tokenBAmount: BN;
64
+ initSqrtPrice: BN;
65
+ liquidityDelta: BN;
66
+ activationPoint?: BN | null;
67
+ }, positionNftKeypair: Keypair, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
68
+ /**
69
+ * 签名创建 Position(空仓位)交易
70
+ * @param poolAddress 池地址
71
+ * @param positionNftKeypair Position NFT Keypair
72
+ * @param wallet 钱包
73
+ * @param connection 可选连接
74
+ */
75
+ export declare function signDammV2CreatePosition(poolAddress: string, positionNftKeypair: Keypair, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
76
+ /**
77
+ * 获取 DAMM v2 Swap 报价
78
+ * @param poolAddress 池地址
79
+ * @param inputMint 输入 Mint
80
+ * @param amountIn 输入数量
81
+ * @param slippage 滑点百分比 (例如 0.5 表示 0.5%)
82
+ * @param tokenADecimal Token A 精度
83
+ * @param tokenBDecimal Token B 精度
84
+ * @param connection 可选连接
85
+ */
86
+ export declare function getDammV2SwapQuote(poolAddress: string, inputMint: string, amountIn: BN, slippage?: number, tokenADecimal?: number, tokenBDecimal?: number, connection?: Connection): Promise<{
87
+ swapInAmount: string;
88
+ consumedInAmount: string;
89
+ swapOutAmount: string;
90
+ minSwapOutAmount: string;
91
+ totalFee: string;
92
+ priceImpact: number;
93
+ }>;
94
+ /**
95
+ * 计算流动性增量
96
+ * @param poolAddress 池地址
97
+ * @param maxAmountA 最大 Token A 数量
98
+ * @param maxAmountB 最大 Token B 数量
99
+ * @param connection 可选连接
100
+ */
101
+ export declare function getDammV2LiquidityDelta(poolAddress: string, maxAmountA: BN, maxAmountB: BN, connection?: Connection): Promise<{
102
+ liquidityDelta: string;
103
+ tokenAAmount: string;
104
+ tokenBAmount: string;
105
+ }>;
106
+ /**
107
+ * 签名关闭 Position 交易(需要先移除所有流动性)
108
+ * @param poolAddress 池地址
109
+ * @param positionAddress Position 地址
110
+ * @param positionNftMint Position NFT Mint
111
+ * @param positionNftAccount Position NFT 账户
112
+ * @param wallet 钱包
113
+ * @param connection 可选连接
114
+ */
115
+ export declare function signDammV2ClosePosition(poolAddress: string, positionAddress: string, positionNftMint: string, positionNftAccount: string, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
116
+ /**
117
+ * 签名移除所有流动性交易
118
+ * @param poolAddress 池地址
119
+ * @param positionAddress Position 地址
120
+ * @param positionNftAccount Position NFT 账户
121
+ * @param liquidity 要移除的流动性数量
122
+ * @param wallet 钱包
123
+ * @param connection 可选连接
124
+ */
125
+ export declare function signDammV2RemoveAllLiquidity(poolAddress: string, positionAddress: string, positionNftAccount: string, liquidity: BN, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
126
+ /**
127
+ * 签名锁定 Position 交易(带 vesting)
128
+ * @param poolAddress 池地址
129
+ * @param positionAddress Position 地址
130
+ * @param positionNftAccount Position NFT 账户
131
+ * @param vestingParams Vesting 参数
132
+ * @param vestingAccountKeypair Vesting 账户 Keypair
133
+ * @param wallet 钱包
134
+ * @param connection 可选连接
135
+ */
136
+ export declare function signDammV2LockPosition(poolAddress: string, positionAddress: string, positionNftAccount: string, vestingParams: {
137
+ cliffPoint: BN | null;
138
+ periodFrequency: BN;
139
+ cliffUnlockLiquidity: BN;
140
+ liquidityPerPeriod: BN;
141
+ numberOfPeriod: number;
142
+ }, vestingAccountKeypair: Keypair, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
143
+ /**
144
+ * 签名领取奖励交易
145
+ * @param poolAddress 池地址
146
+ * @param positionAddress Position 地址
147
+ * @param positionNftAccount Position NFT 账户
148
+ * @param rewardIndex 奖励索引
149
+ * @param wallet 钱包
150
+ * @param connection 可选连接
151
+ */
152
+ export declare function signDammV2ClaimReward(poolAddress: string, positionAddress: string, positionNftAccount: string, rewardIndex: number, wallet: Keypair, connection?: Connection): Promise<MeteoraSignedResult>;
153
+ /**
154
+ * 获取 Position 详细信息
155
+ * @param positionAddress Position 地址
156
+ * @param connection 可选连接
157
+ */
158
+ export declare function getDammV2PositionInfo(positionAddress: string, connection?: Connection): Promise<{
159
+ unlockedLiquidity: string;
160
+ vestedLiquidity: string;
161
+ permanentLockedLiquidity: string;
162
+ pool: string;
163
+ nftMint: string;
164
+ feeAPending: string;
165
+ feeBPending: string;
166
+ }>;
167
+ /**
168
+ * 获取池配置信息
169
+ * @param configAddress 配置地址
170
+ * @param connection 可选连接
171
+ */
172
+ export declare function getDammV2ConfigInfo(configAddress: string, connection?: Connection): Promise<any>;