four-flap-meme-sdk 4.0.4 → 4.0.5
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.
- package/README.en.md +17 -2
- package/README.zh-CN.md +17 -2
- package/dist/bundle/four-meme/core/create-openfour.d.ts +3 -0
- package/dist/bundle/four-meme/core/create-openfour.js +3 -0
- package/dist/bundle/four-meme/core/create-token.js +3 -0
- package/dist/bundle/four-meme/types/index.d.ts +6 -0
- package/dist/core/clients/four.d.ts +3 -0
- package/dist/core/clients/four.js +3 -0
- package/dist/domains/flap/ipfs.d.ts +3 -0
- package/dist/domains/flap/ipfs.js +20 -1
- package/dist/domains/flows/create.d.ts +3 -0
- package/dist/domains/flows/create.js +3 -0
- package/dist/domains/four/contracts/tm-bundle-create.js +3 -0
- package/dist/domains/four/contracts/tm-bundle-helpers.d.ts +3 -0
- package/dist/domains/openfour/types.d.ts +3 -0
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -410,6 +410,9 @@ const result = await createTokenFlow({
|
|
|
410
410
|
webUrl: 'https://example.com',
|
|
411
411
|
twitterUrl: 'https://twitter.com/...',
|
|
412
412
|
telegramUrl: 'https://t.me/...',
|
|
413
|
+
githubUrl: 'https://github.com/...',
|
|
414
|
+
youtubeUrl: 'https://youtube.com/...',
|
|
415
|
+
deboxUrl: 'https://debox.pro/...',
|
|
413
416
|
}
|
|
414
417
|
});
|
|
415
418
|
|
|
@@ -443,6 +446,9 @@ console.log('Your address:', result.accountAddress);
|
|
|
443
446
|
| `webUrl` | string | ❌ | Project website |
|
|
444
447
|
| `twitterUrl` | string | ❌ | Twitter/X profile |
|
|
445
448
|
| `telegramUrl` | string | ❌ | Telegram group/channel |
|
|
449
|
+
| `githubUrl` | string | ❌ | GitHub |
|
|
450
|
+
| `youtubeUrl` | string | ❌ | YouTube |
|
|
451
|
+
| `deboxUrl` | string | ❌ | DeBox |
|
|
446
452
|
|
|
447
453
|
### Return Value:
|
|
448
454
|
|
|
@@ -537,6 +543,9 @@ const { createArg, signature } = await four.createToken(accessToken, {
|
|
|
537
543
|
webUrl: 'https://...',
|
|
538
544
|
twitterUrl: 'https://...',
|
|
539
545
|
telegramUrl: 'https://...',
|
|
546
|
+
githubUrl: 'https://...',
|
|
547
|
+
youtubeUrl: 'https://...',
|
|
548
|
+
deboxUrl: 'https://...',
|
|
540
549
|
});
|
|
541
550
|
```
|
|
542
551
|
|
|
@@ -1035,7 +1044,10 @@ const { createArg, signature } = await four.createToken(
|
|
|
1035
1044
|
onlyMPC?: boolean, // MPC-exclusive flag
|
|
1036
1045
|
webUrl?: string, // Optional website
|
|
1037
1046
|
twitterUrl?: string, // Optional Twitter
|
|
1038
|
-
telegramUrl?: string
|
|
1047
|
+
telegramUrl?: string, // Optional Telegram
|
|
1048
|
+
githubUrl?: string, // Optional GitHub
|
|
1049
|
+
youtubeUrl?: string, // Optional YouTube
|
|
1050
|
+
deboxUrl?: string // Optional DeBox
|
|
1039
1051
|
}
|
|
1040
1052
|
);
|
|
1041
1053
|
```
|
|
@@ -2139,7 +2151,10 @@ const cid = await uploadTokenMeta(
|
|
|
2139
2151
|
creator: walletAddress,
|
|
2140
2152
|
website: 'https://example.com',
|
|
2141
2153
|
twitter: 'https://x.com/mytoken',
|
|
2142
|
-
telegram: 'https://t.me/mytoken'
|
|
2154
|
+
telegram: 'https://t.me/mytoken',
|
|
2155
|
+
github: 'https://github.com/mytoken',
|
|
2156
|
+
youtube: 'https://youtube.com/@mytoken',
|
|
2157
|
+
debox: 'https://debox.pro/mytoken',
|
|
2143
2158
|
},
|
|
2144
2159
|
'https://your-ipfs-graphql.example'
|
|
2145
2160
|
);
|
package/README.zh-CN.md
CHANGED
|
@@ -425,6 +425,9 @@ const result = await createTokenFlow({
|
|
|
425
425
|
webUrl: 'https://example.com',
|
|
426
426
|
twitterUrl: 'https://twitter.com/...',
|
|
427
427
|
telegramUrl: 'https://t.me/...',
|
|
428
|
+
githubUrl: 'https://github.com/...',
|
|
429
|
+
youtubeUrl: 'https://youtube.com/...',
|
|
430
|
+
deboxUrl: 'https://debox.pro/...',
|
|
428
431
|
}
|
|
429
432
|
});
|
|
430
433
|
|
|
@@ -460,6 +463,9 @@ console.log('你的地址:', result.accountAddress);
|
|
|
460
463
|
| `webUrl` | string | ❌ | 项目网站 |
|
|
461
464
|
| `twitterUrl` | string | ❌ | Twitter/X 账号 |
|
|
462
465
|
| `telegramUrl` | string | ❌ | Telegram 群组/频道 |
|
|
466
|
+
| `githubUrl` | string | ❌ | GitHub |
|
|
467
|
+
| `youtubeUrl` | string | ❌ | YouTube |
|
|
468
|
+
| `deboxUrl` | string | ❌ | DeBox |
|
|
463
469
|
|
|
464
470
|
### 返回值:
|
|
465
471
|
|
|
@@ -555,6 +561,9 @@ const { createArg, signature } = await four.createToken(accessToken, {
|
|
|
555
561
|
webUrl: 'https://...',
|
|
556
562
|
twitterUrl: 'https://...',
|
|
557
563
|
telegramUrl: 'https://...',
|
|
564
|
+
githubUrl: 'https://...',
|
|
565
|
+
youtubeUrl: 'https://...',
|
|
566
|
+
deboxUrl: 'https://...',
|
|
558
567
|
});
|
|
559
568
|
```
|
|
560
569
|
|
|
@@ -1035,7 +1044,10 @@ const { createArg, signature } = await four.createToken(
|
|
|
1035
1044
|
onlyMPC?: boolean, // MPC 专属标志
|
|
1036
1045
|
webUrl?: string, // 可选网站
|
|
1037
1046
|
twitterUrl?: string, // 可选 Twitter
|
|
1038
|
-
telegramUrl?: string
|
|
1047
|
+
telegramUrl?: string, // 可选 Telegram
|
|
1048
|
+
githubUrl?: string, // 可选 GitHub
|
|
1049
|
+
youtubeUrl?: string, // 可选 YouTube
|
|
1050
|
+
deboxUrl?: string // 可选 DeBox
|
|
1039
1051
|
}
|
|
1040
1052
|
);
|
|
1041
1053
|
```
|
|
@@ -2505,7 +2517,10 @@ const cid = await uploadTokenMeta(imageFile as File, {
|
|
|
2505
2517
|
creator: yourAddress,
|
|
2506
2518
|
website: 'https://example.com',
|
|
2507
2519
|
twitter: 'https://x.com/mytoken',
|
|
2508
|
-
telegram: 'https://t.me/mytoken'
|
|
2520
|
+
telegram: 'https://t.me/mytoken',
|
|
2521
|
+
github: 'https://github.com/mytoken',
|
|
2522
|
+
youtube: 'https://youtube.com/@mytoken',
|
|
2523
|
+
debox: 'https://debox.pro/mytoken',
|
|
2509
2524
|
}, 'https://your-ipfs-graphql.example');
|
|
2510
2525
|
```
|
|
2511
2526
|
|
|
@@ -57,6 +57,9 @@ export async function createOpenFourTokenMerkle(params) {
|
|
|
57
57
|
webUrl: tokenInfo.webUrl,
|
|
58
58
|
twitterUrl: tokenInfo.twitterUrl,
|
|
59
59
|
telegramUrl: tokenInfo.telegramUrl,
|
|
60
|
+
githubUrl: tokenInfo.githubUrl,
|
|
61
|
+
youtubeUrl: tokenInfo.youtubeUrl,
|
|
62
|
+
deboxUrl: tokenInfo.deboxUrl,
|
|
60
63
|
presaleQuote: preSale,
|
|
61
64
|
feePlan: Boolean(tokenInfo.feePlan),
|
|
62
65
|
initParams: tokenInfo.initParams,
|
|
@@ -41,6 +41,9 @@ export async function createTokenWithBundleBuyMerkle(params) {
|
|
|
41
41
|
webUrl: tokenInfo.webUrl,
|
|
42
42
|
twitterUrl: tokenInfo.twitterUrl,
|
|
43
43
|
telegramUrl: tokenInfo.telegramUrl,
|
|
44
|
+
githubUrl: tokenInfo.githubUrl,
|
|
45
|
+
youtubeUrl: tokenInfo.youtubeUrl,
|
|
46
|
+
deboxUrl: tokenInfo.deboxUrl,
|
|
44
47
|
preSale: effectivePreSaleStr || '0',
|
|
45
48
|
onlyMPC: false,
|
|
46
49
|
...(tokenInfo.feePlan ? { feePlan: true } : {}),
|
|
@@ -102,6 +102,9 @@ export type FourCreateWithBundleBuyMerkleParams = {
|
|
|
102
102
|
webUrl?: string;
|
|
103
103
|
twitterUrl?: string;
|
|
104
104
|
telegramUrl?: string;
|
|
105
|
+
githubUrl?: string;
|
|
106
|
+
youtubeUrl?: string;
|
|
107
|
+
deboxUrl?: string;
|
|
105
108
|
/** ✅ AntiSniperFeeMode(开盘高税模式) */
|
|
106
109
|
feePlan?: boolean;
|
|
107
110
|
/** ✅ 税币配置(Tax Token, creatorType=5) */
|
|
@@ -128,6 +131,9 @@ export type FourCreateWithBundleBuySignParams = {
|
|
|
128
131
|
webUrl?: string;
|
|
129
132
|
twitterUrl?: string;
|
|
130
133
|
telegramUrl?: string;
|
|
134
|
+
githubUrl?: string;
|
|
135
|
+
youtubeUrl?: string;
|
|
136
|
+
deboxUrl?: string;
|
|
131
137
|
/** ✅ AntiSniperFeeMode(开盘高税模式) */
|
|
132
138
|
feePlan?: boolean;
|
|
133
139
|
/** ✅ 税币配置(Tax Token, creatorType=5) */
|
|
@@ -14,6 +14,9 @@ export function buildCreateTokenReq(custom, raisedToken) {
|
|
|
14
14
|
webUrl: custom.webUrl,
|
|
15
15
|
twitterUrl: custom.twitterUrl,
|
|
16
16
|
telegramUrl: custom.telegramUrl,
|
|
17
|
+
githubUrl: custom.githubUrl,
|
|
18
|
+
youtubeUrl: custom.youtubeUrl,
|
|
19
|
+
deboxUrl: custom.deboxUrl,
|
|
17
20
|
preSale: custom.preSale,
|
|
18
21
|
onlyMPC: custom.onlyMPC ?? false,
|
|
19
22
|
...(custom.feePlan ? { feePlan: true } : {}),
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import { FLAP_IPFS_API_URL } from './constants.js';
|
|
2
|
+
function emptyToNull(value) {
|
|
3
|
+
if (value == null)
|
|
4
|
+
return null;
|
|
5
|
+
const trimmed = String(value).trim();
|
|
6
|
+
return trimmed === '' ? null : trimmed;
|
|
7
|
+
}
|
|
8
|
+
function toOfficialIpfsMeta(meta) {
|
|
9
|
+
return {
|
|
10
|
+
creator: meta.creator,
|
|
11
|
+
description: meta.description,
|
|
12
|
+
website: emptyToNull(meta.website),
|
|
13
|
+
telegram: emptyToNull(meta.telegram),
|
|
14
|
+
twitter: emptyToNull(meta.twitter),
|
|
15
|
+
github: emptyToNull(meta.github),
|
|
16
|
+
youtube: emptyToNull(meta.youtube),
|
|
17
|
+
debox: emptyToNull(meta.debox),
|
|
18
|
+
buy: null,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
2
21
|
/**
|
|
3
22
|
* 上传代币元数据到 IPFS
|
|
4
23
|
* @param file 图片文件(File 对象)
|
|
@@ -24,7 +43,7 @@ export async function uploadTokenMeta(file, meta, apiUrl) {
|
|
|
24
43
|
}
|
|
25
44
|
const form = new FormData();
|
|
26
45
|
const MUTATION_CREATE = `mutation Create($file: Upload!, $meta: MetadataInput!) { create(file: $file, meta: $meta) }`;
|
|
27
|
-
form.append('operations', JSON.stringify({ query: MUTATION_CREATE, variables: { file: null, meta } }));
|
|
46
|
+
form.append('operations', JSON.stringify({ query: MUTATION_CREATE, variables: { file: null, meta: toOfficialIpfsMeta(meta) } }));
|
|
28
47
|
form.append('map', JSON.stringify({ '0': ['variables.file'] }));
|
|
29
48
|
form.append('0', file);
|
|
30
49
|
const res = await fetch(endpoint, { method: 'POST', body: form });
|
|
@@ -71,6 +71,9 @@ export async function createTokenFlow(input) {
|
|
|
71
71
|
webUrl: input.payload.webUrl,
|
|
72
72
|
twitterUrl: input.payload.twitterUrl,
|
|
73
73
|
telegramUrl: input.payload.telegramUrl,
|
|
74
|
+
githubUrl: input.payload.githubUrl,
|
|
75
|
+
youtubeUrl: input.payload.youtubeUrl,
|
|
76
|
+
deboxUrl: input.payload.deboxUrl,
|
|
74
77
|
preSale: input.payload.preSale,
|
|
75
78
|
onlyMPC: input.payload.onlyMPC ?? false,
|
|
76
79
|
lpTradingFee: 0.0025,
|
|
@@ -70,6 +70,9 @@ export async function createTokenWithBundleBuy(params) {
|
|
|
70
70
|
webUrl: tokenInfo.webUrl,
|
|
71
71
|
twitterUrl: tokenInfo.twitterUrl,
|
|
72
72
|
telegramUrl: tokenInfo.telegramUrl,
|
|
73
|
+
githubUrl: tokenInfo.githubUrl,
|
|
74
|
+
youtubeUrl: tokenInfo.youtubeUrl,
|
|
75
|
+
deboxUrl: tokenInfo.deboxUrl,
|
|
73
76
|
preSale: tokenInfo.preSale || '0',
|
|
74
77
|
onlyMPC: false,
|
|
75
78
|
lpTradingFee: 0.0025,
|
|
@@ -69,6 +69,9 @@ export type FourCreateWithBundleBuyParams = {
|
|
|
69
69
|
webUrl?: string;
|
|
70
70
|
twitterUrl?: string;
|
|
71
71
|
telegramUrl?: string;
|
|
72
|
+
githubUrl?: string;
|
|
73
|
+
youtubeUrl?: string;
|
|
74
|
+
deboxUrl?: string;
|
|
72
75
|
tokenTaxInfo?: FourTokenTaxInfo;
|
|
73
76
|
feePlan?: boolean;
|
|
74
77
|
quoteSymbol?: string;
|
|
@@ -61,6 +61,9 @@ export type OpenFourCreateReq = {
|
|
|
61
61
|
webUrl?: string;
|
|
62
62
|
telegramUrl?: string;
|
|
63
63
|
twitterUrl?: string;
|
|
64
|
+
githubUrl?: string;
|
|
65
|
+
youtubeUrl?: string;
|
|
66
|
+
deboxUrl?: string;
|
|
64
67
|
presaleQuote: string | number;
|
|
65
68
|
feePlan: boolean;
|
|
66
69
|
initParams: OpenFourInitParams;
|