four-flap-meme-sdk 1.4.92 → 1.4.93

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 (142) hide show
  1. package/README.zh-CN.pdf +0 -0
  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 +1 -1
  6. package/package.json +3 -38
  7. package/dist/sol/constants.d.ts +0 -126
  8. package/dist/sol/constants.js +0 -145
  9. package/dist/sol/dex/blockrazor/client.d.ts +0 -51
  10. package/dist/sol/dex/blockrazor/client.js +0 -96
  11. package/dist/sol/dex/blockrazor/constants.d.ts +0 -34
  12. package/dist/sol/dex/blockrazor/constants.js +0 -55
  13. package/dist/sol/dex/blockrazor/geyser.d.ts +0 -128
  14. package/dist/sol/dex/blockrazor/geyser.js +0 -530
  15. package/dist/sol/dex/blockrazor/index.d.ts +0 -18
  16. package/dist/sol/dex/blockrazor/index.js +0 -23
  17. package/dist/sol/dex/blockrazor/send.d.ts +0 -135
  18. package/dist/sol/dex/blockrazor/send.js +0 -254
  19. package/dist/sol/dex/blockrazor/types.d.ts +0 -191
  20. package/dist/sol/dex/blockrazor/types.js +0 -5
  21. package/dist/sol/dex/index.d.ts +0 -10
  22. package/dist/sol/dex/index.js +0 -16
  23. package/dist/sol/dex/jup/client.d.ts +0 -33
  24. package/dist/sol/dex/jup/client.js +0 -110
  25. package/dist/sol/dex/jup/index.d.ts +0 -16
  26. package/dist/sol/dex/jup/index.js +0 -148
  27. package/dist/sol/dex/jup/legacy.d.ts +0 -623
  28. package/dist/sol/dex/jup/legacy.js +0 -416
  29. package/dist/sol/dex/jup/lend.d.ts +0 -640
  30. package/dist/sol/dex/jup/lend.js +0 -603
  31. package/dist/sol/dex/jup/portfolio.d.ts +0 -362
  32. package/dist/sol/dex/jup/portfolio.js +0 -367
  33. package/dist/sol/dex/jup/price.d.ts +0 -173
  34. package/dist/sol/dex/jup/price.js +0 -220
  35. package/dist/sol/dex/jup/recurring.d.ts +0 -437
  36. package/dist/sol/dex/jup/recurring.js +0 -320
  37. package/dist/sol/dex/jup/send.d.ts +0 -282
  38. package/dist/sol/dex/jup/send.js +0 -295
  39. package/dist/sol/dex/jup/studio.d.ts +0 -457
  40. package/dist/sol/dex/jup/studio.js +0 -488
  41. package/dist/sol/dex/jup/tokens.d.ts +0 -767
  42. package/dist/sol/dex/jup/tokens.js +0 -697
  43. package/dist/sol/dex/jup/trigger.d.ts +0 -511
  44. package/dist/sol/dex/jup/trigger.js +0 -397
  45. package/dist/sol/dex/jup/types.d.ts +0 -433
  46. package/dist/sol/dex/jup/types.js +0 -5
  47. package/dist/sol/dex/jup/ultra.d.ts +0 -646
  48. package/dist/sol/dex/jup/ultra.js +0 -853
  49. package/dist/sol/dex/meteora/client.d.ts +0 -76
  50. package/dist/sol/dex/meteora/client.js +0 -219
  51. package/dist/sol/dex/meteora/damm-v1-bundle.d.ts +0 -61
  52. package/dist/sol/dex/meteora/damm-v1-bundle.js +0 -112
  53. package/dist/sol/dex/meteora/damm-v1.d.ts +0 -118
  54. package/dist/sol/dex/meteora/damm-v1.js +0 -315
  55. package/dist/sol/dex/meteora/damm-v2-bundle.d.ts +0 -82
  56. package/dist/sol/dex/meteora/damm-v2-bundle.js +0 -242
  57. package/dist/sol/dex/meteora/damm-v2.d.ts +0 -172
  58. package/dist/sol/dex/meteora/damm-v2.js +0 -632
  59. package/dist/sol/dex/meteora/dbc-bundle.d.ts +0 -123
  60. package/dist/sol/dex/meteora/dbc-bundle.js +0 -304
  61. package/dist/sol/dex/meteora/dbc.d.ts +0 -192
  62. package/dist/sol/dex/meteora/dbc.js +0 -619
  63. package/dist/sol/dex/meteora/dlmm-bundle.d.ts +0 -39
  64. package/dist/sol/dex/meteora/dlmm-bundle.js +0 -189
  65. package/dist/sol/dex/meteora/dlmm.d.ts +0 -157
  66. package/dist/sol/dex/meteora/dlmm.js +0 -671
  67. package/dist/sol/dex/meteora/index.d.ts +0 -25
  68. package/dist/sol/dex/meteora/index.js +0 -65
  69. package/dist/sol/dex/meteora/types.d.ts +0 -787
  70. package/dist/sol/dex/meteora/types.js +0 -110
  71. package/dist/sol/dex/orca/index.d.ts +0 -10
  72. package/dist/sol/dex/orca/index.js +0 -16
  73. package/dist/sol/dex/orca/orca-bundle.d.ts +0 -41
  74. package/dist/sol/dex/orca/orca-bundle.js +0 -173
  75. package/dist/sol/dex/orca/orca.d.ts +0 -65
  76. package/dist/sol/dex/orca/orca.js +0 -474
  77. package/dist/sol/dex/orca/types.d.ts +0 -263
  78. package/dist/sol/dex/orca/types.js +0 -38
  79. package/dist/sol/dex/orca/wavebreak-bundle.d.ts +0 -34
  80. package/dist/sol/dex/orca/wavebreak-bundle.js +0 -198
  81. package/dist/sol/dex/orca/wavebreak-types.d.ts +0 -227
  82. package/dist/sol/dex/orca/wavebreak-types.js +0 -23
  83. package/dist/sol/dex/orca/wavebreak.d.ts +0 -78
  84. package/dist/sol/dex/orca/wavebreak.js +0 -497
  85. package/dist/sol/dex/pump/index.d.ts +0 -9
  86. package/dist/sol/dex/pump/index.js +0 -14
  87. package/dist/sol/dex/pump/pump-bundle.d.ts +0 -92
  88. package/dist/sol/dex/pump/pump-bundle.js +0 -383
  89. package/dist/sol/dex/pump/pump-swap-bundle.d.ts +0 -103
  90. package/dist/sol/dex/pump/pump-swap-bundle.js +0 -380
  91. package/dist/sol/dex/pump/pump-swap.d.ts +0 -46
  92. package/dist/sol/dex/pump/pump-swap.js +0 -199
  93. package/dist/sol/dex/pump/pump.d.ts +0 -35
  94. package/dist/sol/dex/pump/pump.js +0 -352
  95. package/dist/sol/dex/pump/types.d.ts +0 -215
  96. package/dist/sol/dex/pump/types.js +0 -5
  97. package/dist/sol/dex/raydium/index.d.ts +0 -8
  98. package/dist/sol/dex/raydium/index.js +0 -12
  99. package/dist/sol/dex/raydium/launchlab.d.ts +0 -68
  100. package/dist/sol/dex/raydium/launchlab.js +0 -210
  101. package/dist/sol/dex/raydium/raydium-bundle.d.ts +0 -64
  102. package/dist/sol/dex/raydium/raydium-bundle.js +0 -324
  103. package/dist/sol/dex/raydium/raydium.d.ts +0 -40
  104. package/dist/sol/dex/raydium/raydium.js +0 -366
  105. package/dist/sol/dex/raydium/types.d.ts +0 -240
  106. package/dist/sol/dex/raydium/types.js +0 -5
  107. package/dist/sol/index.d.ts +0 -10
  108. package/dist/sol/index.js +0 -16
  109. package/dist/sol/jito/bundle.d.ts +0 -90
  110. package/dist/sol/jito/bundle.js +0 -263
  111. package/dist/sol/jito/index.d.ts +0 -7
  112. package/dist/sol/jito/index.js +0 -7
  113. package/dist/sol/jito/tip.d.ts +0 -51
  114. package/dist/sol/jito/tip.js +0 -83
  115. package/dist/sol/jito/types.d.ts +0 -100
  116. package/dist/sol/jito/types.js +0 -5
  117. package/dist/sol/token/create-complete.d.ts +0 -115
  118. package/dist/sol/token/create-complete.js +0 -235
  119. package/dist/sol/token/create-token.d.ts +0 -57
  120. package/dist/sol/token/create-token.js +0 -230
  121. package/dist/sol/token/index.d.ts +0 -9
  122. package/dist/sol/token/index.js +0 -14
  123. package/dist/sol/token/metadata-upload.d.ts +0 -86
  124. package/dist/sol/token/metadata-upload.js +0 -173
  125. package/dist/sol/token/metadata.d.ts +0 -92
  126. package/dist/sol/token/metadata.js +0 -274
  127. package/dist/sol/token/types.d.ts +0 -153
  128. package/dist/sol/token/types.js +0 -5
  129. package/dist/sol/types.d.ts +0 -176
  130. package/dist/sol/types.js +0 -7
  131. package/dist/sol/utils/balance.d.ts +0 -160
  132. package/dist/sol/utils/balance.js +0 -638
  133. package/dist/sol/utils/connection.d.ts +0 -78
  134. package/dist/sol/utils/connection.js +0 -168
  135. package/dist/sol/utils/index.d.ts +0 -9
  136. package/dist/sol/utils/index.js +0 -9
  137. package/dist/sol/utils/lp-inspect.d.ts +0 -129
  138. package/dist/sol/utils/lp-inspect.js +0 -900
  139. package/dist/sol/utils/transfer.d.ts +0 -196
  140. package/dist/sol/utils/transfer.js +0 -307
  141. package/dist/sol/utils/wallet.d.ts +0 -107
  142. package/dist/sol/utils/wallet.js +0 -210
@@ -1,640 +0,0 @@
1
- /**
2
- * Jupiter Lend API (Jupiter Earn)
3
- * @module sol/dex/jup/lend
4
- *
5
- * Lend API 提供存款赚息功能
6
- * 用户可以存入代币获取 APY 收益
7
- */
8
- import type { JupiterConfig } from './types.js';
9
- /** 存款请求参数 */
10
- export interface LendDepositParams {
11
- /** 代币 Mint 地址 */
12
- asset: string;
13
- /** 签名者/用户公钥 */
14
- signer: string;
15
- /** 存款数量 (UI 数量,如 "5" 表示 5 USDC) */
16
- amount: string;
17
- }
18
- /** 取款请求参数 */
19
- export interface LendWithdrawParams {
20
- /** 代币 Mint 地址 */
21
- asset: string;
22
- /** 签名者/用户公钥 */
23
- signer: string;
24
- /** 取款数量 (UI 数量) */
25
- amount: string;
26
- }
27
- /** Mint 请求参数 (按份额存款) */
28
- export interface LendMintParams {
29
- /** 代币 Mint 地址 */
30
- asset: string;
31
- /** 签名者/用户公钥 */
32
- signer: string;
33
- /** 份额数量 (最小单位) */
34
- shares: string;
35
- }
36
- /** Burn 请求参数 (按份额取款) */
37
- export interface LendBurnParams {
38
- /** 代币 Mint 地址 */
39
- asset: string;
40
- /** 签名者/用户公钥 */
41
- signer: string;
42
- /** 份额数量 (最小单位) */
43
- shares: string;
44
- }
45
- /** Redeem 请求参数 (按份额赎回) */
46
- export interface LendRedeemParams {
47
- /** 代币 Mint 地址 */
48
- asset: string;
49
- /** 签名者/用户公钥 */
50
- signer: string;
51
- /** 份额数量 (最小单位) */
52
- shares: string;
53
- }
54
- /** 交易响应 */
55
- export interface LendTransactionResponse {
56
- /** Base64 编码的未签名交易 */
57
- transaction: string;
58
- }
59
- /** 账户信息 */
60
- export interface LendInstructionAccount {
61
- /** 账户公钥 */
62
- pubkey: string;
63
- /** 是否是签名者 */
64
- isSigner: boolean;
65
- /** 是否可写 */
66
- isWritable: boolean;
67
- }
68
- /** 指令响应 */
69
- export interface LendInstructionResponse {
70
- /** Program ID */
71
- programId: string;
72
- /** 账户列表 */
73
- accounts: LendInstructionAccount[];
74
- /** 指令数据 (Base64) */
75
- data: string;
76
- }
77
- /** 底层资产信息 */
78
- export interface LendUnderlyingAsset {
79
- /** 资产地址 */
80
- address: string;
81
- /** 链 ID */
82
- chainId: string;
83
- /** 名称 */
84
- name: string;
85
- /** 符号 */
86
- symbol: string;
87
- /** 精度 */
88
- decimals: number;
89
- /** Logo URL */
90
- logoUrl: string;
91
- /** 价格 (USD) */
92
- price: string;
93
- /** CoinGecko ID */
94
- coingeckoId: string;
95
- }
96
- /** 流动性供应数据 */
97
- export interface LendLiquiditySupplyData {
98
- /** 带利息模式 */
99
- modeWithInterest: boolean;
100
- /** 总供应量 */
101
- supply: string;
102
- /** 提款限额 */
103
- withdrawalLimit: string;
104
- /** 最后更新时间戳 */
105
- lastUpdateTimestamp: string;
106
- /** 扩展百分比 */
107
- expandPercent: number;
108
- /** 扩展持续时间 */
109
- expandDuration: string;
110
- /** 基础提款限额 */
111
- baseWithdrawalLimit: string;
112
- /** 距离限额可提款金额 */
113
- withdrawableUntilLimit: string;
114
- /** 可提款金额 */
115
- withdrawable: string;
116
- }
117
- /** Earn 代币信息 */
118
- export interface LendTokenInfo {
119
- /** ID */
120
- id: number;
121
- /** jl 代币地址 (如 jlUSDC) */
122
- address: string;
123
- /** 名称 (如 "jupiter lend USDC") */
124
- name: string;
125
- /** 符号 (如 "jlUSDC") */
126
- symbol: string;
127
- /** 精度 */
128
- decimals: number;
129
- /** 底层资产地址 */
130
- assetAddress: string;
131
- /** 底层资产信息 */
132
- asset: LendUnderlyingAsset;
133
- /** 总资产 (最小单位) */
134
- totalAssets: string;
135
- /** 总供应量 (最小单位) */
136
- totalSupply: string;
137
- /** 资产转份额比率 */
138
- convertToShares: string;
139
- /** 份额转资产比率 */
140
- convertToAssets: string;
141
- /** 奖励率 (基点) */
142
- rewardsRate: string;
143
- /** 供应率 (基点) */
144
- supplyRate: string;
145
- /** 总收益率 (基点) = rewardsRate + supplyRate */
146
- totalRate: string;
147
- /** 再平衡差异 */
148
- rebalanceDifference: string;
149
- /** 流动性供应数据 */
150
- liquiditySupplyData: LendLiquiditySupplyData;
151
- /** 奖励列表 */
152
- rewards: unknown[];
153
- }
154
- /** 用户存款仓位 */
155
- export interface LendPosition {
156
- /** 代币信息 */
157
- token: LendTokenInfo;
158
- /** 持有者地址 */
159
- ownerAddress: string;
160
- /** 份额数量 (最小单位) */
161
- shares: string;
162
- /** 底层资产数量 (最小单位) */
163
- underlyingAssets: string;
164
- /** 底层资产余额 (最小单位) */
165
- underlyingBalance: string;
166
- /** 授权额度 */
167
- allowance: string;
168
- }
169
- /** 用户收益信息 */
170
- export interface LendEarnings {
171
- /** jl 代币地址 */
172
- address: string;
173
- /** 用户地址 */
174
- ownerAddress: string;
175
- /** 总存款 */
176
- totalDeposits: string;
177
- /** 总取款 */
178
- totalWithdraws: string;
179
- /** 总余额 */
180
- totalBalance: string;
181
- /** 总资产 */
182
- totalAssets: string;
183
- /** 收益 (利息) */
184
- earnings: string;
185
- }
186
- /**
187
- * 构建存款交易
188
- *
189
- * 将代币存入 Jupiter Earn 赚取利息。
190
- *
191
- * @param params 存款参数
192
- * @param config Jupiter 配置
193
- * @returns 未签名交易
194
- *
195
- * @example
196
- * ```typescript
197
- * import { Sol } from 'four-flap-meme-sdk'
198
- *
199
- * Sol.setJupiterConfig({ apiKey: 'your-api-key' })
200
- *
201
- * // 存入 5 USDC
202
- * const result = await Sol.buildLendDeposit({
203
- * asset: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC
204
- * signer: wallet.publicKey.toBase58(),
205
- * amount: '5', // 5 USDC
206
- * })
207
- *
208
- * // 签名并发送
209
- * const tx = VersionedTransaction.deserialize(
210
- * Buffer.from(result.transaction, 'base64')
211
- * )
212
- * tx.sign([wallet])
213
- * const signature = await connection.sendTransaction(tx)
214
- * ```
215
- */
216
- export declare function buildLendDeposit(params: LendDepositParams, config?: JupiterConfig): Promise<LendTransactionResponse>;
217
- /**
218
- * 构建取款交易
219
- *
220
- * 从 Jupiter Earn 取出存款和收益。
221
- *
222
- * @param params 取款参数
223
- * @param config Jupiter 配置
224
- * @returns 未签名交易
225
- *
226
- * @example
227
- * ```typescript
228
- * // 取出 5 USDC
229
- * const result = await Sol.buildLendWithdraw({
230
- * asset: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
231
- * signer: wallet.publicKey.toBase58(),
232
- * amount: '5',
233
- * })
234
- *
235
- * // 签名并发送
236
- * const tx = VersionedTransaction.deserialize(
237
- * Buffer.from(result.transaction, 'base64')
238
- * )
239
- * tx.sign([wallet])
240
- * await connection.sendTransaction(tx)
241
- * ```
242
- */
243
- export declare function buildLendWithdraw(params: LendWithdrawParams, config?: JupiterConfig): Promise<LendTransactionResponse>;
244
- /**
245
- * 构建 Mint 交易 (按份额存款)
246
- *
247
- * 使用份额 (shares) 而非代币数量来存款。
248
- * 这是更底层的接口,适合精确控制份额的场景。
249
- *
250
- * @param params Mint 参数
251
- * @param config Jupiter 配置
252
- * @returns 未签名交易
253
- *
254
- * @example
255
- * ```typescript
256
- * const result = await Sol.buildLendMint({
257
- * asset: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
258
- * signer: wallet.publicKey.toBase58(),
259
- * shares: '1000000', // 份额数量
260
- * })
261
- * ```
262
- */
263
- export declare function buildLendMint(params: LendMintParams, config?: JupiterConfig): Promise<LendTransactionResponse>;
264
- /**
265
- * 构建 Burn 交易 (按份额取款)
266
- *
267
- * 使用份额 (shares) 而非代币数量来取款。
268
- * 这是更底层的接口,适合精确控制份额的场景。
269
- *
270
- * @param params Burn 参数
271
- * @param config Jupiter 配置
272
- * @returns 未签名交易
273
- *
274
- * @example
275
- * ```typescript
276
- * const result = await Sol.buildLendBurn({
277
- * asset: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
278
- * signer: wallet.publicKey.toBase58(),
279
- * shares: '1000000', // 份额数量
280
- * })
281
- * ```
282
- */
283
- export declare function buildLendBurn(params: LendBurnParams, config?: JupiterConfig): Promise<LendTransactionResponse>;
284
- /**
285
- * 构建 Redeem 交易 (按份额赎回)
286
- *
287
- * 与 Burn 类似,使用份额来赎回代币。
288
- *
289
- * @param params Redeem 参数
290
- * @param config Jupiter 配置
291
- * @returns 未签名交易
292
- *
293
- * @example
294
- * ```typescript
295
- * const result = await Sol.buildLendRedeem({
296
- * asset: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
297
- * signer: wallet.publicKey.toBase58(),
298
- * shares: '1000000',
299
- * })
300
- * ```
301
- */
302
- export declare function buildLendRedeem(params: LendRedeemParams, config?: JupiterConfig): Promise<LendTransactionResponse>;
303
- /**
304
- * 获取存款指令
305
- *
306
- * 返回单个指令而非完整交易,适合自定义组装交易。
307
- *
308
- * @param params 存款参数
309
- * @param config Jupiter 配置
310
- * @returns 指令
311
- *
312
- * @example
313
- * ```typescript
314
- * const instruction = await Sol.getLendDepositInstruction({
315
- * asset: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
316
- * signer: wallet.publicKey.toBase58(),
317
- * amount: '5',
318
- * })
319
- *
320
- * // 反序列化为 TransactionInstruction
321
- * const ix = new TransactionInstruction({
322
- * programId: new PublicKey(instruction.programId),
323
- * keys: instruction.accounts.map(acc => ({
324
- * pubkey: new PublicKey(acc.pubkey),
325
- * isSigner: acc.isSigner,
326
- * isWritable: acc.isWritable,
327
- * })),
328
- * data: Buffer.from(instruction.data, 'base64'),
329
- * })
330
- * ```
331
- */
332
- export declare function getLendDepositInstruction(params: LendDepositParams, config?: JupiterConfig): Promise<LendInstructionResponse>;
333
- /**
334
- * 获取取款指令
335
- *
336
- * @param params 取款参数
337
- * @param config Jupiter 配置
338
- * @returns 指令
339
- */
340
- export declare function getLendWithdrawInstruction(params: LendWithdrawParams, config?: JupiterConfig): Promise<LendInstructionResponse>;
341
- /**
342
- * 获取 Mint 指令
343
- *
344
- * @param params Mint 参数
345
- * @param config Jupiter 配置
346
- * @returns 指令
347
- */
348
- export declare function getLendMintInstruction(params: LendMintParams, config?: JupiterConfig): Promise<LendInstructionResponse>;
349
- /**
350
- * 获取 Burn 指令
351
- *
352
- * @param params Burn 参数
353
- * @param config Jupiter 配置
354
- * @returns 指令
355
- */
356
- export declare function getLendBurnInstruction(params: LendBurnParams, config?: JupiterConfig): Promise<LendInstructionResponse>;
357
- /**
358
- * 获取 Redeem 指令
359
- *
360
- * @param params Redeem 参数
361
- * @param config Jupiter 配置
362
- * @returns 指令
363
- */
364
- export declare function getLendRedeemInstruction(params: LendRedeemParams, config?: JupiterConfig): Promise<LendInstructionResponse>;
365
- /**
366
- * 获取所有 Earn 支持的代币
367
- *
368
- * 返回详细的代币信息,包括:
369
- * - jl 代币地址和底层资产地址
370
- * - 当前收益率 (APY)
371
- * - 总存款量和总供应量
372
- * - 份额转换比率
373
- * - 流动性数据
374
- *
375
- * @param config Jupiter 配置
376
- * @returns 代币信息数组
377
- *
378
- * @example
379
- * ```typescript
380
- * const tokens = await Sol.getEarnTokens()
381
- *
382
- * tokens.forEach(token => {
383
- * // 计算 APY (基点转百分比)
384
- * const apy = Number(token.totalRate) / 100
385
- *
386
- * console.log(`${token.symbol}:`)
387
- * console.log(` APY: ${apy.toFixed(2)}%`)
388
- * console.log(` 底层资产: ${token.asset.symbol}`)
389
- * console.log(` 价格: $${token.asset.price}`)
390
- * console.log(` jl代币地址: ${token.address}`)
391
- * console.log(` 资产地址: ${token.assetAddress}`)
392
- * })
393
- *
394
- * // 示例输出:
395
- * // jlUSDC:
396
- * // APY: 5.46%
397
- * // 底层资产: USDC
398
- * // 价格: $0.999730840125
399
- * ```
400
- */
401
- export declare function getEarnTokens(config?: JupiterConfig): Promise<LendTokenInfo[]>;
402
- /**
403
- * 获取单个代币的 Earn 信息
404
- *
405
- * @param assetMint 底层资产 Mint 地址
406
- * @param config Jupiter 配置
407
- * @returns 代币信息或 null
408
- *
409
- * @example
410
- * ```typescript
411
- * const usdcInfo = await Sol.getEarnTokenByAsset(
412
- * 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
413
- * )
414
- *
415
- * if (usdcInfo) {
416
- * console.log('USDC APY:', Number(usdcInfo.totalRate) / 100, '%')
417
- * }
418
- * ```
419
- */
420
- export declare function getEarnTokenByAsset(assetMint: string, config?: JupiterConfig): Promise<LendTokenInfo | null>;
421
- /**
422
- * 获取所有 Earn APY 信息
423
- *
424
- * @param config Jupiter 配置
425
- * @returns APY 映射 { assetMint: { symbol, apy, supplyRate, rewardsRate } }
426
- *
427
- * @example
428
- * ```typescript
429
- * const apys = await Sol.getEarnApys()
430
- *
431
- * // { 'EPj...': { symbol: 'USDC', apy: 5.46, ... }, ... }
432
- * console.log('USDC APY:', apys['EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'].apy)
433
- * ```
434
- */
435
- export declare function getEarnApys(config?: JupiterConfig): Promise<Record<string, {
436
- symbol: string;
437
- jlSymbol: string;
438
- apy: number;
439
- supplyRate: number;
440
- rewardsRate: number;
441
- price: number;
442
- }>>;
443
- /**
444
- * 计算份额对应的资产数量
445
- *
446
- * @param shares 份额数量 (最小单位)
447
- * @param tokenInfo 代币信息
448
- * @returns 资产数量 (最小单位)
449
- */
450
- export declare function sharesToAssets(shares: string | bigint, tokenInfo: LendTokenInfo): bigint;
451
- /**
452
- * 计算资产数量对应的份额
453
- *
454
- * @param assets 资产数量 (最小单位)
455
- * @param tokenInfo 代币信息
456
- * @returns 份额数量 (最小单位)
457
- */
458
- export declare function assetsToShares(assets: string | bigint, tokenInfo: LendTokenInfo): bigint;
459
- /**
460
- * 获取用户的 Earn 仓位
461
- *
462
- * 返回用户在所有 Earn 代币的存款仓位。
463
- *
464
- * @param users 用户地址(支持单个或多个,逗号分隔)
465
- * @param config Jupiter 配置
466
- * @returns 仓位数组
467
- *
468
- * @example
469
- * ```typescript
470
- * const positions = await Sol.getEarnPositions(
471
- * '9yFqMjJgsEcZ8GnEtFqxw1oFbPPVpypMVgYzQWgECFNy'
472
- * )
473
- *
474
- * positions.forEach(pos => {
475
- * if (BigInt(pos.shares) > 0n) {
476
- * console.log(`${pos.token.asset.symbol}:`)
477
- * console.log(` 份额: ${pos.shares}`)
478
- * console.log(` 底层资产: ${pos.underlyingAssets}`)
479
- * console.log(` APY: ${Number(pos.token.totalRate) / 100}%`)
480
- * }
481
- * })
482
- * ```
483
- */
484
- export declare function getEarnPositions(users: string | string[], config?: JupiterConfig): Promise<LendPosition[]>;
485
- /**
486
- * 获取用户在指定代币的 Earn 仓位
487
- *
488
- * @param user 用户地址
489
- * @param assetMint 底层资产 Mint 地址
490
- * @param config Jupiter 配置
491
- * @returns 仓位或 null
492
- *
493
- * @example
494
- * ```typescript
495
- * const usdcPosition = await Sol.getEarnPositionByAsset(
496
- * '9yFqMjJgsEcZ8GnEtFqxw1oFbPPVpypMVgYzQWgECFNy',
497
- * 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC
498
- * )
499
- *
500
- * if (usdcPosition && BigInt(usdcPosition.shares) > 0n) {
501
- * console.log('USDC 存款:', usdcPosition.underlyingAssets)
502
- * }
503
- * ```
504
- */
505
- export declare function getEarnPositionByAsset(user: string, assetMint: string, config?: JupiterConfig): Promise<LendPosition | null>;
506
- /**
507
- * 获取用户的非零 Earn 仓位
508
- *
509
- * @param user 用户地址
510
- * @param config Jupiter 配置
511
- * @returns 非零仓位数组
512
- *
513
- * @example
514
- * ```typescript
515
- * const activePositions = await Sol.getActiveEarnPositions(
516
- * '9yFqMjJgsEcZ8GnEtFqxw1oFbPPVpypMVgYzQWgECFNy'
517
- * )
518
- *
519
- * activePositions.forEach(pos => {
520
- * console.log(`${pos.token.asset.symbol}: ${pos.underlyingAssets}`)
521
- * })
522
- * ```
523
- */
524
- export declare function getActiveEarnPositions(user: string, config?: JupiterConfig): Promise<LendPosition[]>;
525
- /**
526
- * 获取用户的 Earn 资产总值 (USD)
527
- *
528
- * @param user 用户地址
529
- * @param config Jupiter 配置
530
- * @returns 总值 USD
531
- *
532
- * @example
533
- * ```typescript
534
- * const totalValue = await Sol.getEarnTotalValue(
535
- * '9yFqMjJgsEcZ8GnEtFqxw1oFbPPVpypMVgYzQWgECFNy'
536
- * )
537
- * console.log('Earn 总值: $' + totalValue.toFixed(2))
538
- * ```
539
- */
540
- export declare function getEarnTotalValue(user: string, config?: JupiterConfig): Promise<number>;
541
- /**
542
- * 获取用户的收益统计
543
- *
544
- * 返回用户的存款、取款和收益汇总。
545
- *
546
- * @param user 用户地址(可选,不传则获取所有)
547
- * @param config Jupiter 配置
548
- * @returns 收益信息数组
549
- *
550
- * @example
551
- * ```typescript
552
- * const earnings = await Sol.getEarnEarnings(
553
- * '9yFqMjJgsEcZ8GnEtFqxw1oFbPPVpypMVgYzQWgECFNy'
554
- * )
555
- *
556
- * earnings.forEach(e => {
557
- * console.log(`代币: ${e.address}`)
558
- * console.log(` 总存款: ${e.totalDeposits}`)
559
- * console.log(` 总取款: ${e.totalWithdraws}`)
560
- * console.log(` 当前余额: ${e.totalBalance}`)
561
- * console.log(` 收益: ${e.earnings}`)
562
- * })
563
- * ```
564
- */
565
- export declare function getEarnEarnings(user?: string, config?: JupiterConfig): Promise<LendEarnings[]>;
566
- /**
567
- * 获取用户在指定代币的收益
568
- *
569
- * @param user 用户地址
570
- * @param jlTokenAddress jl 代币地址(如 jlUSDC 地址)
571
- * @param config Jupiter 配置
572
- * @returns 收益信息或 null
573
- */
574
- export declare function getEarnEarningsByToken(user: string, jlTokenAddress: string, config?: JupiterConfig): Promise<LendEarnings | null>;
575
- /**
576
- * 获取用户的总收益汇总
577
- *
578
- * @param user 用户地址
579
- * @param config Jupiter 配置
580
- * @returns 汇总信息
581
- *
582
- * @example
583
- * ```typescript
584
- * const summary = await Sol.getEarnEarningsSummary(user)
585
- * console.log('总存款:', summary.totalDeposits)
586
- * console.log('总取款:', summary.totalWithdraws)
587
- * console.log('总收益:', summary.totalEarnings)
588
- * ```
589
- */
590
- export declare function getEarnEarningsSummary(user: string, config?: JupiterConfig): Promise<{
591
- totalDeposits: bigint;
592
- totalWithdraws: bigint;
593
- totalBalance: bigint;
594
- totalEarnings: bigint;
595
- }>;
596
- /** 常见的 Earn 支持代币 */
597
- export declare const LEND_SUPPORTED_ASSETS: {
598
- /** USDC */
599
- readonly USDC: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
600
- /** USDT */
601
- readonly USDT: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB";
602
- /** SOL */
603
- readonly SOL: "So11111111111111111111111111111111111111112";
604
- };
605
- /**
606
- * 存入 USDC
607
- *
608
- * @param signer 签名者公钥
609
- * @param amount 数量 (UI 数量,如 "100" 表示 100 USDC)
610
- * @param config Jupiter 配置
611
- * @returns 未签名交易
612
- */
613
- export declare function depositUsdc(signer: string, amount: string, config?: JupiterConfig): Promise<LendTransactionResponse>;
614
- /**
615
- * 取出 USDC
616
- *
617
- * @param signer 签名者公钥
618
- * @param amount 数量
619
- * @param config Jupiter 配置
620
- * @returns 未签名交易
621
- */
622
- export declare function withdrawUsdc(signer: string, amount: string, config?: JupiterConfig): Promise<LendTransactionResponse>;
623
- /**
624
- * 存入 SOL
625
- *
626
- * @param signer 签名者公钥
627
- * @param amount 数量 (UI 数量,如 "1" 表示 1 SOL)
628
- * @param config Jupiter 配置
629
- * @returns 未签名交易
630
- */
631
- export declare function depositSol(signer: string, amount: string, config?: JupiterConfig): Promise<LendTransactionResponse>;
632
- /**
633
- * 取出 SOL
634
- *
635
- * @param signer 签名者公钥
636
- * @param amount 数量
637
- * @param config Jupiter 配置
638
- * @returns 未签名交易
639
- */
640
- export declare function withdrawSol(signer: string, amount: string, config?: JupiterConfig): Promise<LendTransactionResponse>;