clanker-sdk 3.5.0 → 3.6.0
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 +48 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,6 +66,43 @@ async function deployToken() {
|
|
|
66
66
|
deployToken().catch(console.error);
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
### Using with OnchainKit (Frontend)
|
|
70
|
+
|
|
71
|
+
For frontend applications using OnchainKit, you can use the `prepareDeployToken` method to get the transaction data without executing it:
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { Clanker } from 'clanker-sdk';
|
|
75
|
+
import { createPublicClient, http } from 'viem';
|
|
76
|
+
import { base } from 'viem/chains';
|
|
77
|
+
|
|
78
|
+
// Initialize SDK without wallet for frontend use
|
|
79
|
+
const publicClient = createPublicClient({
|
|
80
|
+
chain: base,
|
|
81
|
+
transport: http(),
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const clanker = new Clanker({
|
|
85
|
+
publicClient,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// In your component/hook:
|
|
89
|
+
async function prepareTokenDeployment() {
|
|
90
|
+
// Get transaction data
|
|
91
|
+
const tx = await clanker.prepareDeployToken({
|
|
92
|
+
name: "Clanker Test Token",
|
|
93
|
+
symbol: "TEST",
|
|
94
|
+
image: "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi",
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// Use with OnchainKit
|
|
98
|
+
return {
|
|
99
|
+
to: tx.to,
|
|
100
|
+
data: tx.data,
|
|
101
|
+
value: tx.value, // For dev-buy (0 if none)
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
69
106
|
## Configuration Options
|
|
70
107
|
|
|
71
108
|
### Basic Token Configuration
|
|
@@ -142,6 +179,17 @@ const tokenAddress = await clanker.deployToken({
|
|
|
142
179
|
|
|
143
180
|
See the [examples](./examples) directory for more deployment scenarios.
|
|
144
181
|
|
|
182
|
+
## Development Methods
|
|
183
|
+
|
|
184
|
+
### `deployToken(config: SimpleTokenConfig): Promise<Address>`
|
|
185
|
+
Deploys a new token with the specified configuration. Requires a wallet to be configured.
|
|
186
|
+
|
|
187
|
+
### `prepareDeployToken(config: SimpleTokenConfig): Promise<PreparedDeployTx>`
|
|
188
|
+
Prepares the transaction data for deploying a token without executing it. Perfect for frontend integrations with OnchainKit or similar tools. Returns:
|
|
189
|
+
- `to`: Contract address to call
|
|
190
|
+
- `data`: Encoded calldata
|
|
191
|
+
- `value`: ETH value to send (for dev-buy, 0 if none)
|
|
192
|
+
|
|
145
193
|
## Development
|
|
146
194
|
|
|
147
195
|
```bash
|