four-flap-meme-sdk 1.5.6 → 1.5.8

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 (158) hide show
  1. package/README.zh-CN.pdf +0 -0
  2. package/dist/abis/common.js +2 -0
  3. package/dist/contracts/tm-bundle-merkle/config.d.ts +0 -1
  4. package/dist/contracts/tm-bundle-merkle/config.js +0 -1
  5. package/dist/contracts/tm-bundle-merkle/core.js +13 -9
  6. package/dist/flap/portal-bundle-merkle/config.d.ts +0 -1
  7. package/dist/flap/portal-bundle-merkle/config.js +0 -1
  8. package/dist/flap/portal-bundle-merkle/create-to-dex.d.ts +8 -2
  9. package/dist/flap/portal-bundle-merkle/create-to-dex.js +170 -128
  10. package/dist/flap/portal-bundle-merkle/encryption.d.ts +16 -0
  11. package/dist/flap/portal-bundle-merkle/encryption.js +146 -0
  12. package/dist/index.d.ts +0 -1
  13. package/dist/index.js +1 -1
  14. package/package.json +5 -41
  15. package/dist/sol/constants.d.ts +0 -150
  16. package/dist/sol/constants.js +0 -188
  17. package/dist/sol/dex/blockrazor/client.d.ts +0 -51
  18. package/dist/sol/dex/blockrazor/client.js +0 -96
  19. package/dist/sol/dex/blockrazor/constants.d.ts +0 -34
  20. package/dist/sol/dex/blockrazor/constants.js +0 -55
  21. package/dist/sol/dex/blockrazor/geyser.d.ts +0 -128
  22. package/dist/sol/dex/blockrazor/geyser.js +0 -530
  23. package/dist/sol/dex/blockrazor/index.d.ts +0 -18
  24. package/dist/sol/dex/blockrazor/index.js +0 -23
  25. package/dist/sol/dex/blockrazor/send.d.ts +0 -135
  26. package/dist/sol/dex/blockrazor/send.js +0 -254
  27. package/dist/sol/dex/blockrazor/types.d.ts +0 -191
  28. package/dist/sol/dex/blockrazor/types.js +0 -5
  29. package/dist/sol/dex/index.d.ts +0 -10
  30. package/dist/sol/dex/index.js +0 -16
  31. package/dist/sol/dex/jup/client.d.ts +0 -33
  32. package/dist/sol/dex/jup/client.js +0 -110
  33. package/dist/sol/dex/jup/index.d.ts +0 -16
  34. package/dist/sol/dex/jup/index.js +0 -148
  35. package/dist/sol/dex/jup/legacy.d.ts +0 -623
  36. package/dist/sol/dex/jup/legacy.js +0 -416
  37. package/dist/sol/dex/jup/lend.d.ts +0 -640
  38. package/dist/sol/dex/jup/lend.js +0 -603
  39. package/dist/sol/dex/jup/portfolio.d.ts +0 -362
  40. package/dist/sol/dex/jup/portfolio.js +0 -367
  41. package/dist/sol/dex/jup/price.d.ts +0 -173
  42. package/dist/sol/dex/jup/price.js +0 -220
  43. package/dist/sol/dex/jup/recurring.d.ts +0 -437
  44. package/dist/sol/dex/jup/recurring.js +0 -320
  45. package/dist/sol/dex/jup/send.d.ts +0 -282
  46. package/dist/sol/dex/jup/send.js +0 -295
  47. package/dist/sol/dex/jup/studio.d.ts +0 -457
  48. package/dist/sol/dex/jup/studio.js +0 -488
  49. package/dist/sol/dex/jup/tokens.d.ts +0 -767
  50. package/dist/sol/dex/jup/tokens.js +0 -697
  51. package/dist/sol/dex/jup/trigger.d.ts +0 -511
  52. package/dist/sol/dex/jup/trigger.js +0 -397
  53. package/dist/sol/dex/jup/types.d.ts +0 -433
  54. package/dist/sol/dex/jup/types.js +0 -5
  55. package/dist/sol/dex/jup/ultra.d.ts +0 -646
  56. package/dist/sol/dex/jup/ultra.js +0 -853
  57. package/dist/sol/dex/meteora/client.d.ts +0 -76
  58. package/dist/sol/dex/meteora/client.js +0 -219
  59. package/dist/sol/dex/meteora/damm-v1-bundle.d.ts +0 -61
  60. package/dist/sol/dex/meteora/damm-v1-bundle.js +0 -112
  61. package/dist/sol/dex/meteora/damm-v1.d.ts +0 -118
  62. package/dist/sol/dex/meteora/damm-v1.js +0 -315
  63. package/dist/sol/dex/meteora/damm-v2-bundle.d.ts +0 -82
  64. package/dist/sol/dex/meteora/damm-v2-bundle.js +0 -242
  65. package/dist/sol/dex/meteora/damm-v2.d.ts +0 -172
  66. package/dist/sol/dex/meteora/damm-v2.js +0 -632
  67. package/dist/sol/dex/meteora/dbc-bundle.d.ts +0 -123
  68. package/dist/sol/dex/meteora/dbc-bundle.js +0 -304
  69. package/dist/sol/dex/meteora/dbc.d.ts +0 -192
  70. package/dist/sol/dex/meteora/dbc.js +0 -619
  71. package/dist/sol/dex/meteora/dlmm-bundle.d.ts +0 -39
  72. package/dist/sol/dex/meteora/dlmm-bundle.js +0 -189
  73. package/dist/sol/dex/meteora/dlmm.d.ts +0 -157
  74. package/dist/sol/dex/meteora/dlmm.js +0 -671
  75. package/dist/sol/dex/meteora/index.d.ts +0 -25
  76. package/dist/sol/dex/meteora/index.js +0 -65
  77. package/dist/sol/dex/meteora/types.d.ts +0 -787
  78. package/dist/sol/dex/meteora/types.js +0 -110
  79. package/dist/sol/dex/orca/index.d.ts +0 -10
  80. package/dist/sol/dex/orca/index.js +0 -16
  81. package/dist/sol/dex/orca/orca-bundle.d.ts +0 -41
  82. package/dist/sol/dex/orca/orca-bundle.js +0 -173
  83. package/dist/sol/dex/orca/orca.d.ts +0 -65
  84. package/dist/sol/dex/orca/orca.js +0 -474
  85. package/dist/sol/dex/orca/types.d.ts +0 -263
  86. package/dist/sol/dex/orca/types.js +0 -38
  87. package/dist/sol/dex/orca/wavebreak-bundle.d.ts +0 -34
  88. package/dist/sol/dex/orca/wavebreak-bundle.js +0 -198
  89. package/dist/sol/dex/orca/wavebreak-types.d.ts +0 -227
  90. package/dist/sol/dex/orca/wavebreak-types.js +0 -23
  91. package/dist/sol/dex/orca/wavebreak.d.ts +0 -78
  92. package/dist/sol/dex/orca/wavebreak.js +0 -497
  93. package/dist/sol/dex/pump/index.d.ts +0 -9
  94. package/dist/sol/dex/pump/index.js +0 -14
  95. package/dist/sol/dex/pump/pump-bundle.d.ts +0 -92
  96. package/dist/sol/dex/pump/pump-bundle.js +0 -383
  97. package/dist/sol/dex/pump/pump-swap-bundle.d.ts +0 -103
  98. package/dist/sol/dex/pump/pump-swap-bundle.js +0 -380
  99. package/dist/sol/dex/pump/pump-swap.d.ts +0 -46
  100. package/dist/sol/dex/pump/pump-swap.js +0 -199
  101. package/dist/sol/dex/pump/pump.d.ts +0 -35
  102. package/dist/sol/dex/pump/pump.js +0 -352
  103. package/dist/sol/dex/pump/types.d.ts +0 -215
  104. package/dist/sol/dex/pump/types.js +0 -5
  105. package/dist/sol/dex/raydium/index.d.ts +0 -8
  106. package/dist/sol/dex/raydium/index.js +0 -12
  107. package/dist/sol/dex/raydium/launchlab.d.ts +0 -68
  108. package/dist/sol/dex/raydium/launchlab.js +0 -210
  109. package/dist/sol/dex/raydium/raydium-bundle.d.ts +0 -64
  110. package/dist/sol/dex/raydium/raydium-bundle.js +0 -324
  111. package/dist/sol/dex/raydium/raydium.d.ts +0 -40
  112. package/dist/sol/dex/raydium/raydium.js +0 -366
  113. package/dist/sol/dex/raydium/types.d.ts +0 -240
  114. package/dist/sol/dex/raydium/types.js +0 -5
  115. package/dist/sol/index.d.ts +0 -11
  116. package/dist/sol/index.js +0 -18
  117. package/dist/sol/jito/bundle.d.ts +0 -90
  118. package/dist/sol/jito/bundle.js +0 -263
  119. package/dist/sol/jito/index.d.ts +0 -7
  120. package/dist/sol/jito/index.js +0 -7
  121. package/dist/sol/jito/tip.d.ts +0 -51
  122. package/dist/sol/jito/tip.js +0 -83
  123. package/dist/sol/jito/types.d.ts +0 -100
  124. package/dist/sol/jito/types.js +0 -5
  125. package/dist/sol/nozomi/client.d.ts +0 -63
  126. package/dist/sol/nozomi/client.js +0 -222
  127. package/dist/sol/nozomi/index.d.ts +0 -8
  128. package/dist/sol/nozomi/index.js +0 -8
  129. package/dist/sol/nozomi/tip.d.ts +0 -50
  130. package/dist/sol/nozomi/tip.js +0 -80
  131. package/dist/sol/nozomi/types.d.ts +0 -96
  132. package/dist/sol/nozomi/types.js +0 -5
  133. package/dist/sol/token/create-complete.d.ts +0 -115
  134. package/dist/sol/token/create-complete.js +0 -235
  135. package/dist/sol/token/create-token.d.ts +0 -57
  136. package/dist/sol/token/create-token.js +0 -230
  137. package/dist/sol/token/index.d.ts +0 -9
  138. package/dist/sol/token/index.js +0 -14
  139. package/dist/sol/token/metadata-upload.d.ts +0 -86
  140. package/dist/sol/token/metadata-upload.js +0 -173
  141. package/dist/sol/token/metadata.d.ts +0 -92
  142. package/dist/sol/token/metadata.js +0 -274
  143. package/dist/sol/token/types.d.ts +0 -153
  144. package/dist/sol/token/types.js +0 -5
  145. package/dist/sol/types.d.ts +0 -176
  146. package/dist/sol/types.js +0 -7
  147. package/dist/sol/utils/balance.d.ts +0 -160
  148. package/dist/sol/utils/balance.js +0 -638
  149. package/dist/sol/utils/connection.d.ts +0 -78
  150. package/dist/sol/utils/connection.js +0 -168
  151. package/dist/sol/utils/index.d.ts +0 -9
  152. package/dist/sol/utils/index.js +0 -9
  153. package/dist/sol/utils/lp-inspect.d.ts +0 -129
  154. package/dist/sol/utils/lp-inspect.js +0 -900
  155. package/dist/sol/utils/transfer.d.ts +0 -196
  156. package/dist/sol/utils/transfer.js +0 -307
  157. package/dist/sol/utils/wallet.d.ts +0 -107
  158. package/dist/sol/utils/wallet.js +0 -210
@@ -1,295 +0,0 @@
1
- /**
2
- * Jupiter Send API V1
3
- * @module sol/dex/jup/send
4
- *
5
- * Send API 提供代币发送邀请链接功能
6
- * 允许创建邀请链接让他人领取代币
7
- */
8
- import { jupGet, jupPost } from './client.js';
9
- // ============================================================================
10
- // Craft Send - 创建发送邀请
11
- // ============================================================================
12
- /**
13
- * 创建发送邀请交易
14
- *
15
- * 创建一个邀请链接,让他人可以领取指定数量的代币。
16
- *
17
- * @param params 创建参数
18
- * @param config Jupiter 配置
19
- * @returns 创建响应
20
- *
21
- * @example
22
- * ```typescript
23
- * import { Sol } from 'four-flap-meme-sdk'
24
- * import { Keypair } from '@solana/web3.js'
25
- * import crypto from 'crypto'
26
- *
27
- * Sol.setJupiterConfig({ apiKey: 'your-api-key' })
28
- *
29
- * // 生成邀请码(客户端生成,安全保管)
30
- * const inviteCode = crypto.randomBytes(32).toString('hex')
31
- * const inviteHash = crypto.createHash('sha256').update(inviteCode).digest()
32
- * const inviteKeypair = Keypair.fromSeed(inviteHash)
33
- *
34
- * // 创建发送邀请
35
- * const result = await Sol.craftSend({
36
- * inviteSigner: inviteKeypair.publicKey.toBase58(),
37
- * sender: wallet.publicKey.toBase58(),
38
- * amount: '1000000', // 1 USDC
39
- * mint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
40
- * })
41
- *
42
- * console.log(`过期时间: ${new Date(parseInt(result.expiry) * 1000)}`)
43
- * console.log(`费用: ${result.totalFeeLamports} lamports`)
44
- *
45
- * // 签名交易
46
- * const tx = VersionedTransaction.deserialize(Buffer.from(result.tx, 'base64'))
47
- * tx.sign([wallet, inviteKeypair])
48
- *
49
- * // 发送交易...
50
- * // 保存 inviteCode 分享给接收者
51
- * ```
52
- */
53
- export async function craftSend(params, config) {
54
- return jupPost('/send/v1/craft-send', params, config);
55
- }
56
- /**
57
- * 创建 SOL 发送邀请
58
- *
59
- * @param inviteSigner 邀请签名者公钥
60
- * @param sender 发送者地址
61
- * @param amountLamports SOL 数量 (lamports)
62
- * @param config Jupiter 配置
63
- * @returns 创建响应
64
- */
65
- export async function craftSendSol(inviteSigner, sender, amountLamports, config) {
66
- return craftSend({
67
- inviteSigner,
68
- sender,
69
- amount: amountLamports.toString(),
70
- // 不传 mint 默认为 WSOL
71
- }, config);
72
- }
73
- /**
74
- * 创建 USDC 发送邀请
75
- *
76
- * @param inviteSigner 邀请签名者公钥
77
- * @param sender 发送者地址
78
- * @param amountUsdc USDC 数量(原子单位,6位小数)
79
- * @param config Jupiter 配置
80
- * @returns 创建响应
81
- */
82
- export async function craftSendUsdc(inviteSigner, sender, amountUsdc, config) {
83
- return craftSend({
84
- inviteSigner,
85
- sender,
86
- amount: amountUsdc.toString(),
87
- mint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
88
- }, config);
89
- }
90
- // ============================================================================
91
- // Craft Clawback - 撤回邀请
92
- // ============================================================================
93
- /**
94
- * 撤回/取消邀请
95
- *
96
- * 撤回未领取的邀请,资金返还给发送者。
97
- *
98
- * @param params 撤回参数
99
- * @param config Jupiter 配置
100
- * @returns 撤回响应
101
- *
102
- * @example
103
- * ```typescript
104
- * // 撤回邀请
105
- * const result = await Sol.craftClawback({
106
- * invitePDA: 'invitePDAAddress...',
107
- * sender: wallet.publicKey.toBase58(),
108
- * })
109
- *
110
- * // 签名并发送交易
111
- * const tx = VersionedTransaction.deserialize(Buffer.from(result.tx, 'base64'))
112
- * tx.sign([wallet])
113
- * // 发送交易...
114
- * ```
115
- */
116
- export async function craftClawback(params, config) {
117
- return jupPost('/send/v1/craft-clawback', params, config);
118
- }
119
- // ============================================================================
120
- // Pending Invites - 待处理邀请
121
- // ============================================================================
122
- /**
123
- * 获取待处理的邀请
124
- *
125
- * 获取发送者创建的尚未被领取或撤回的邀请。
126
- *
127
- * @param address 发送者地址
128
- * @param page 页码(默认 1)
129
- * @param config Jupiter 配置
130
- * @returns 邀请列表响应
131
- *
132
- * @example
133
- * ```typescript
134
- * const pending = await Sol.getPendingInvites(
135
- * wallet.publicKey.toBase58(),
136
- * 1,
137
- * )
138
- *
139
- * console.log(`待处理邀请: ${pending.invites.length}`)
140
- * pending.invites.forEach(invite => {
141
- * console.log(`金额: ${invite.amount}`)
142
- * console.log(`过期: ${new Date(parseInt(invite.expiry) * 1000)}`)
143
- * })
144
- * ```
145
- */
146
- export async function getPendingInvites(address, page = 1, config) {
147
- return jupGet('/send/v1/pending-invites', { address, page }, config);
148
- }
149
- /**
150
- * 获取所有待处理邀请(自动分页)
151
- *
152
- * @param address 发送者地址
153
- * @param config Jupiter 配置
154
- * @returns 所有待处理邀请
155
- */
156
- export async function getAllPendingInvites(address, config) {
157
- const allInvites = [];
158
- let page = 1;
159
- while (true) {
160
- const response = await getPendingInvites(address, page, config);
161
- allInvites.push(...response.invites);
162
- if (!response.hasMoreData)
163
- break;
164
- page++;
165
- }
166
- return allInvites;
167
- }
168
- // ============================================================================
169
- // Invite History - 邀请历史
170
- // ============================================================================
171
- /**
172
- * 获取邀请历史
173
- *
174
- * 获取地址相关的所有邀请历史(作为发送者或接收者)。
175
- *
176
- * @param address 地址(发送者或接收者)
177
- * @param page 页码(默认 1)
178
- * @param config Jupiter 配置
179
- * @returns 邀请列表响应
180
- *
181
- * @example
182
- * ```typescript
183
- * const history = await Sol.getInviteHistory(
184
- * wallet.publicKey.toBase58(),
185
- * 1,
186
- * )
187
- *
188
- * console.log(`邀请历史: ${history.invites.length}`)
189
- * history.invites.forEach(invite => {
190
- * console.log(`${invite.action}: ${invite.amount}`)
191
- * console.log(` 发送者: ${invite.sender}`)
192
- * console.log(` 接收者: ${invite.receiver}`)
193
- * })
194
- * ```
195
- */
196
- export async function getInviteHistory(address, page = 1, config) {
197
- return jupGet('/send/v1/invite-history', { address, page }, config);
198
- }
199
- /**
200
- * 获取所有邀请历史(自动分页)
201
- *
202
- * @param address 地址
203
- * @param config Jupiter 配置
204
- * @returns 所有邀请历史
205
- */
206
- export async function getAllInviteHistory(address, config) {
207
- const allInvites = [];
208
- let page = 1;
209
- while (true) {
210
- const response = await getInviteHistory(address, page, config);
211
- allInvites.push(...response.invites);
212
- if (!response.hasMoreData)
213
- break;
214
- page++;
215
- }
216
- return allInvites;
217
- }
218
- // ============================================================================
219
- // 便捷方法
220
- // ============================================================================
221
- /**
222
- * 获取待处理邀请总金额
223
- *
224
- * @param address 发送者地址
225
- * @param config Jupiter 配置
226
- * @returns 总金额(按 mint 分组)
227
- */
228
- export async function getPendingInvitesTotal(address, config) {
229
- const invites = await getAllPendingInvites(address, config);
230
- const totals = new Map();
231
- invites.forEach(invite => {
232
- const mint = invite.mint || 'So11111111111111111111111111111111111111112';
233
- const current = totals.get(mint) || BigInt(0);
234
- totals.set(mint, current + BigInt(invite.amount));
235
- });
236
- return totals;
237
- }
238
- /**
239
- * 获取即将过期的邀请
240
- *
241
- * @param address 发送者地址
242
- * @param withinHours 在多少小时内过期(默认 24)
243
- * @param config Jupiter 配置
244
- * @returns 即将过期的邀请
245
- */
246
- export async function getExpiringInvites(address, withinHours = 24, config) {
247
- const invites = await getAllPendingInvites(address, config);
248
- const now = Math.floor(Date.now() / 1000);
249
- const cutoff = now + (withinHours * 3600);
250
- return invites.filter(invite => {
251
- const expiry = parseInt(invite.expiry);
252
- return expiry <= cutoff && expiry > now;
253
- });
254
- }
255
- /**
256
- * 检查邀请是否已过期
257
- *
258
- * @param invite 邀请信息
259
- * @returns 是否已过期
260
- */
261
- export function isInviteExpired(invite) {
262
- const now = Math.floor(Date.now() / 1000);
263
- return parseInt(invite.expiry) <= now;
264
- }
265
- /**
266
- * 获取邀请剩余时间(秒)
267
- *
268
- * @param invite 邀请信息
269
- * @returns 剩余秒数(已过期返回 0)
270
- */
271
- export function getInviteTimeRemaining(invite) {
272
- const now = Math.floor(Date.now() / 1000);
273
- const expiry = parseInt(invite.expiry);
274
- return Math.max(0, expiry - now);
275
- }
276
- /**
277
- * 筛选发送的邀请
278
- *
279
- * @param invites 邀请列表
280
- * @param sender 发送者地址
281
- * @returns 发送的邀请
282
- */
283
- export function filterSentInvites(invites, sender) {
284
- return invites.filter(i => i.sender === sender);
285
- }
286
- /**
287
- * 筛选接收的邀请
288
- *
289
- * @param invites 邀请列表
290
- * @param receiver 接收者地址
291
- * @returns 接收的邀请
292
- */
293
- export function filterReceivedInvites(invites, receiver) {
294
- return invites.filter(i => i.receiver === receiver);
295
- }