clanker-sdk 3.1.8 → 3.1.9
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.md +28 -102
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Clanker SDK
|
|
2
2
|
|
|
3
|
-
The official TypeScript SDK for deploying tokens using Clanker v3.1.
|
|
3
|
+
The official TypeScript SDK for deploying tokens using Clanker v3.1.9.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install clanker-sdk viem
|
|
8
|
+
npm install clanker-sdk viem
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
@@ -13,99 +13,44 @@ npm install clanker-sdk viem dotenv
|
|
|
13
13
|
1. Create a `.env` file with your configuration:
|
|
14
14
|
```env
|
|
15
15
|
PRIVATE_KEY=your_private_key_here
|
|
16
|
-
FACTORY_ADDRESS=clanker_factory_address_here
|
|
17
|
-
RPC_URL=your_rpc_url_here # Optional
|
|
18
16
|
```
|
|
19
17
|
|
|
20
18
|
2. Create a deployment script:
|
|
21
19
|
```typescript
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const FACTORY_ADDRESS = process.env.FACTORY_ADDRESS;
|
|
34
|
-
const RPC_URL = process.env.RPC_URL;
|
|
35
|
-
|
|
36
|
-
if (!PRIVATE_KEY || !FACTORY_ADDRESS) {
|
|
37
|
-
throw new Error('Missing required environment variables');
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async function main(): Promise<void> {
|
|
41
|
-
// Initialize wallet
|
|
42
|
-
const account = privateKeyToAccount(`0x${PRIVATE_KEY}`);
|
|
43
|
-
const transport = RPC_URL ? http(RPC_URL) : http();
|
|
20
|
+
// Initialize wallet with private key
|
|
21
|
+
const account = privateKeyToAccount(PRIVATE_KEY);
|
|
22
|
+
|
|
23
|
+
// Create transport with optional custom RPC
|
|
24
|
+
const transport = http();
|
|
25
|
+
|
|
26
|
+
const publicClient = createPublicClient({
|
|
27
|
+
chain: base,
|
|
28
|
+
transport,
|
|
29
|
+
});
|
|
30
|
+
|
|
44
31
|
const wallet = createWalletClient({
|
|
45
32
|
account,
|
|
46
33
|
chain: base,
|
|
47
|
-
transport
|
|
34
|
+
transport,
|
|
48
35
|
});
|
|
49
36
|
|
|
50
37
|
// Initialize Clanker SDK
|
|
51
38
|
const clanker = new Clanker({
|
|
52
39
|
wallet,
|
|
53
|
-
|
|
54
|
-
|
|
40
|
+
publicClient,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
console.log("Starting token deployment...");
|
|
44
|
+
|
|
45
|
+
// Deploy the token
|
|
46
|
+
const tokenAddress = await clanker.deployToken({
|
|
47
|
+
name: "Clanker Test Token",
|
|
48
|
+
symbol: "TEST",
|
|
49
|
+
image: "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi",
|
|
55
50
|
});
|
|
56
51
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
tokenConfig: {
|
|
60
|
-
name: 'Test Token',
|
|
61
|
-
symbol: 'TEST',
|
|
62
|
-
salt: `0x${randomBytes(32).toString('hex')}`,
|
|
63
|
-
image: 'ipfs://your_image_hash',
|
|
64
|
-
metadata: 'ipfs://your_metadata_hash',
|
|
65
|
-
context: 'Your deployment context',
|
|
66
|
-
originatingChainId: BigInt(8453) // Base chain ID
|
|
67
|
-
},
|
|
68
|
-
poolConfig: {
|
|
69
|
-
pairedToken: '0x4200000000000000000000000000000000000006' as `0x${string}`, // WETH on Base
|
|
70
|
-
initialMarketCapInPairedToken: parseEther('5') // 5 WETH initial mcap
|
|
71
|
-
},
|
|
72
|
-
vaultConfig: {
|
|
73
|
-
vaultPercentage: 30, // 30% vault
|
|
74
|
-
vaultDuration: BigInt(60 * 24 * 60 * 60) // 60 days vault duration
|
|
75
|
-
},
|
|
76
|
-
initialBuyConfig: {
|
|
77
|
-
pairedTokenPoolFee: 10000, // 1% fee tier (fixed)
|
|
78
|
-
pairedTokenSwapAmountOutMinimum: parseEther('0.001') // 0.001 WETH initial buy
|
|
79
|
-
},
|
|
80
|
-
rewardsConfig: {
|
|
81
|
-
creatorReward: BigInt(40), // 40% creator reward
|
|
82
|
-
creatorAdmin: account.address,
|
|
83
|
-
creatorRewardRecipient: account.address,
|
|
84
|
-
interfaceAdmin: account.address,
|
|
85
|
-
interfaceRewardRecipient: account.address
|
|
86
|
-
}
|
|
87
|
-
} as const;
|
|
88
|
-
|
|
89
|
-
const tokenAddress = await clanker.deploy(deployConfig);
|
|
90
|
-
console.log('Token deployed successfully at:', tokenAddress);
|
|
91
|
-
} catch (error) {
|
|
92
|
-
if (error instanceof Error) {
|
|
93
|
-
console.error('Deployment failed:', error.message);
|
|
94
|
-
} else {
|
|
95
|
-
console.error('Deployment failed with unknown error');
|
|
96
|
-
}
|
|
97
|
-
process.exit(1);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
main().catch((error) => {
|
|
102
|
-
if (error instanceof Error) {
|
|
103
|
-
console.error('Deployment failed:', error.message);
|
|
104
|
-
} else {
|
|
105
|
-
console.error('Deployment failed with unknown error');
|
|
106
|
-
}
|
|
107
|
-
process.exit(1);
|
|
108
|
-
});
|
|
52
|
+
console.log("Token deployed successfully!");
|
|
53
|
+
console.log("Token address:", tokenAddress);
|
|
109
54
|
```
|
|
110
55
|
|
|
111
56
|
## Configuration Options
|
|
@@ -120,29 +65,10 @@ main().catch((error) => {
|
|
|
120
65
|
- `originatingChainId`: Chain ID where token is deployed (8453 for Base)
|
|
121
66
|
|
|
122
67
|
### Pool Configuration
|
|
123
|
-
- Pool fee tier is fixed at 1%
|
|
124
|
-
- Initial market cap in WETH (e.g.,
|
|
68
|
+
- Pool fee tier is fixed at 1%
|
|
69
|
+
- Initial market cap in WETH (e.g., 10 WETH)
|
|
125
70
|
- Paired with WETH on Base (`0x4200000000000000000000000000000000000006`)
|
|
126
71
|
|
|
127
|
-
### Vault Configuration (Optional)
|
|
128
|
-
- `vaultPercentage`: Percentage of tokens to lock (0-100)
|
|
129
|
-
- `vaultDuration`: Duration of the lock in seconds (e.g., 60 days = 5184000 seconds)
|
|
130
|
-
|
|
131
|
-
### Initial Buy Configuration
|
|
132
|
-
- Pool fee tier is fixed at 1% (10000)
|
|
133
|
-
- Initial buy amount in WETH (e.g., 0.001 WETH)
|
|
134
|
-
|
|
135
|
-
### Rewards Configuration
|
|
136
|
-
- `creatorReward`: Percentage of rewards for creator (e.g., 40)
|
|
137
|
-
- Creator and interface admin/recipient addresses
|
|
138
|
-
|
|
139
|
-
## Important Notes
|
|
140
|
-
|
|
141
|
-
1. The pool fee tier is fixed at 1% (10000) for optimal performance
|
|
142
|
-
2. Initial market cap and buy amounts should be specified using `parseEther()`
|
|
143
|
-
3. Vault duration should be specified in seconds
|
|
144
|
-
4. All addresses should be properly formatted as `0x${string}`
|
|
145
|
-
5. Error handling is included for better debugging
|
|
146
72
|
|
|
147
73
|
## Examples
|
|
148
74
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clanker-sdk",
|
|
3
|
-
"version": "3.1.
|
|
4
|
-
"description": "SDK for deploying tokens using Clanker v3.1.
|
|
3
|
+
"version": "3.1.9",
|
|
4
|
+
"description": "SDK for deploying tokens using Clanker v3.1.9",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|