four-flap-meme-sdk 1.4.92 → 1.4.94

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 (144) 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/dist/utils/constants.d.ts +1 -1
  7. package/dist/utils/constants.js +1 -1
  8. package/package.json +3 -38
  9. package/dist/sol/constants.d.ts +0 -126
  10. package/dist/sol/constants.js +0 -145
  11. package/dist/sol/dex/blockrazor/client.d.ts +0 -51
  12. package/dist/sol/dex/blockrazor/client.js +0 -96
  13. package/dist/sol/dex/blockrazor/constants.d.ts +0 -34
  14. package/dist/sol/dex/blockrazor/constants.js +0 -55
  15. package/dist/sol/dex/blockrazor/geyser.d.ts +0 -128
  16. package/dist/sol/dex/blockrazor/geyser.js +0 -530
  17. package/dist/sol/dex/blockrazor/index.d.ts +0 -18
  18. package/dist/sol/dex/blockrazor/index.js +0 -23
  19. package/dist/sol/dex/blockrazor/send.d.ts +0 -135
  20. package/dist/sol/dex/blockrazor/send.js +0 -254
  21. package/dist/sol/dex/blockrazor/types.d.ts +0 -191
  22. package/dist/sol/dex/blockrazor/types.js +0 -5
  23. package/dist/sol/dex/index.d.ts +0 -10
  24. package/dist/sol/dex/index.js +0 -16
  25. package/dist/sol/dex/jup/client.d.ts +0 -33
  26. package/dist/sol/dex/jup/client.js +0 -110
  27. package/dist/sol/dex/jup/index.d.ts +0 -16
  28. package/dist/sol/dex/jup/index.js +0 -148
  29. package/dist/sol/dex/jup/legacy.d.ts +0 -623
  30. package/dist/sol/dex/jup/legacy.js +0 -416
  31. package/dist/sol/dex/jup/lend.d.ts +0 -640
  32. package/dist/sol/dex/jup/lend.js +0 -603
  33. package/dist/sol/dex/jup/portfolio.d.ts +0 -362
  34. package/dist/sol/dex/jup/portfolio.js +0 -367
  35. package/dist/sol/dex/jup/price.d.ts +0 -173
  36. package/dist/sol/dex/jup/price.js +0 -220
  37. package/dist/sol/dex/jup/recurring.d.ts +0 -437
  38. package/dist/sol/dex/jup/recurring.js +0 -320
  39. package/dist/sol/dex/jup/send.d.ts +0 -282
  40. package/dist/sol/dex/jup/send.js +0 -295
  41. package/dist/sol/dex/jup/studio.d.ts +0 -457
  42. package/dist/sol/dex/jup/studio.js +0 -488
  43. package/dist/sol/dex/jup/tokens.d.ts +0 -767
  44. package/dist/sol/dex/jup/tokens.js +0 -697
  45. package/dist/sol/dex/jup/trigger.d.ts +0 -511
  46. package/dist/sol/dex/jup/trigger.js +0 -397
  47. package/dist/sol/dex/jup/types.d.ts +0 -433
  48. package/dist/sol/dex/jup/types.js +0 -5
  49. package/dist/sol/dex/jup/ultra.d.ts +0 -646
  50. package/dist/sol/dex/jup/ultra.js +0 -853
  51. package/dist/sol/dex/meteora/client.d.ts +0 -76
  52. package/dist/sol/dex/meteora/client.js +0 -219
  53. package/dist/sol/dex/meteora/damm-v1-bundle.d.ts +0 -61
  54. package/dist/sol/dex/meteora/damm-v1-bundle.js +0 -112
  55. package/dist/sol/dex/meteora/damm-v1.d.ts +0 -118
  56. package/dist/sol/dex/meteora/damm-v1.js +0 -315
  57. package/dist/sol/dex/meteora/damm-v2-bundle.d.ts +0 -82
  58. package/dist/sol/dex/meteora/damm-v2-bundle.js +0 -242
  59. package/dist/sol/dex/meteora/damm-v2.d.ts +0 -172
  60. package/dist/sol/dex/meteora/damm-v2.js +0 -632
  61. package/dist/sol/dex/meteora/dbc-bundle.d.ts +0 -123
  62. package/dist/sol/dex/meteora/dbc-bundle.js +0 -304
  63. package/dist/sol/dex/meteora/dbc.d.ts +0 -192
  64. package/dist/sol/dex/meteora/dbc.js +0 -619
  65. package/dist/sol/dex/meteora/dlmm-bundle.d.ts +0 -39
  66. package/dist/sol/dex/meteora/dlmm-bundle.js +0 -189
  67. package/dist/sol/dex/meteora/dlmm.d.ts +0 -157
  68. package/dist/sol/dex/meteora/dlmm.js +0 -671
  69. package/dist/sol/dex/meteora/index.d.ts +0 -25
  70. package/dist/sol/dex/meteora/index.js +0 -65
  71. package/dist/sol/dex/meteora/types.d.ts +0 -787
  72. package/dist/sol/dex/meteora/types.js +0 -110
  73. package/dist/sol/dex/orca/index.d.ts +0 -10
  74. package/dist/sol/dex/orca/index.js +0 -16
  75. package/dist/sol/dex/orca/orca-bundle.d.ts +0 -41
  76. package/dist/sol/dex/orca/orca-bundle.js +0 -173
  77. package/dist/sol/dex/orca/orca.d.ts +0 -65
  78. package/dist/sol/dex/orca/orca.js +0 -474
  79. package/dist/sol/dex/orca/types.d.ts +0 -263
  80. package/dist/sol/dex/orca/types.js +0 -38
  81. package/dist/sol/dex/orca/wavebreak-bundle.d.ts +0 -34
  82. package/dist/sol/dex/orca/wavebreak-bundle.js +0 -198
  83. package/dist/sol/dex/orca/wavebreak-types.d.ts +0 -227
  84. package/dist/sol/dex/orca/wavebreak-types.js +0 -23
  85. package/dist/sol/dex/orca/wavebreak.d.ts +0 -78
  86. package/dist/sol/dex/orca/wavebreak.js +0 -497
  87. package/dist/sol/dex/pump/index.d.ts +0 -9
  88. package/dist/sol/dex/pump/index.js +0 -14
  89. package/dist/sol/dex/pump/pump-bundle.d.ts +0 -92
  90. package/dist/sol/dex/pump/pump-bundle.js +0 -383
  91. package/dist/sol/dex/pump/pump-swap-bundle.d.ts +0 -103
  92. package/dist/sol/dex/pump/pump-swap-bundle.js +0 -380
  93. package/dist/sol/dex/pump/pump-swap.d.ts +0 -46
  94. package/dist/sol/dex/pump/pump-swap.js +0 -199
  95. package/dist/sol/dex/pump/pump.d.ts +0 -35
  96. package/dist/sol/dex/pump/pump.js +0 -352
  97. package/dist/sol/dex/pump/types.d.ts +0 -215
  98. package/dist/sol/dex/pump/types.js +0 -5
  99. package/dist/sol/dex/raydium/index.d.ts +0 -8
  100. package/dist/sol/dex/raydium/index.js +0 -12
  101. package/dist/sol/dex/raydium/launchlab.d.ts +0 -68
  102. package/dist/sol/dex/raydium/launchlab.js +0 -210
  103. package/dist/sol/dex/raydium/raydium-bundle.d.ts +0 -64
  104. package/dist/sol/dex/raydium/raydium-bundle.js +0 -324
  105. package/dist/sol/dex/raydium/raydium.d.ts +0 -40
  106. package/dist/sol/dex/raydium/raydium.js +0 -366
  107. package/dist/sol/dex/raydium/types.d.ts +0 -240
  108. package/dist/sol/dex/raydium/types.js +0 -5
  109. package/dist/sol/index.d.ts +0 -10
  110. package/dist/sol/index.js +0 -16
  111. package/dist/sol/jito/bundle.d.ts +0 -90
  112. package/dist/sol/jito/bundle.js +0 -263
  113. package/dist/sol/jito/index.d.ts +0 -7
  114. package/dist/sol/jito/index.js +0 -7
  115. package/dist/sol/jito/tip.d.ts +0 -51
  116. package/dist/sol/jito/tip.js +0 -83
  117. package/dist/sol/jito/types.d.ts +0 -100
  118. package/dist/sol/jito/types.js +0 -5
  119. package/dist/sol/token/create-complete.d.ts +0 -115
  120. package/dist/sol/token/create-complete.js +0 -235
  121. package/dist/sol/token/create-token.d.ts +0 -57
  122. package/dist/sol/token/create-token.js +0 -230
  123. package/dist/sol/token/index.d.ts +0 -9
  124. package/dist/sol/token/index.js +0 -14
  125. package/dist/sol/token/metadata-upload.d.ts +0 -86
  126. package/dist/sol/token/metadata-upload.js +0 -173
  127. package/dist/sol/token/metadata.d.ts +0 -92
  128. package/dist/sol/token/metadata.js +0 -274
  129. package/dist/sol/token/types.d.ts +0 -153
  130. package/dist/sol/token/types.js +0 -5
  131. package/dist/sol/types.d.ts +0 -176
  132. package/dist/sol/types.js +0 -7
  133. package/dist/sol/utils/balance.d.ts +0 -160
  134. package/dist/sol/utils/balance.js +0 -638
  135. package/dist/sol/utils/connection.d.ts +0 -78
  136. package/dist/sol/utils/connection.js +0 -168
  137. package/dist/sol/utils/index.d.ts +0 -9
  138. package/dist/sol/utils/index.js +0 -9
  139. package/dist/sol/utils/lp-inspect.d.ts +0 -129
  140. package/dist/sol/utils/lp-inspect.js +0 -900
  141. package/dist/sol/utils/transfer.d.ts +0 -196
  142. package/dist/sol/utils/transfer.js +0 -307
  143. package/dist/sol/utils/wallet.d.ts +0 -107
  144. 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
- }