clanker-sdk 4.2.2 → 4.2.3

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.
@@ -0,0 +1,682 @@
1
+ // src/legacyFeeClaims/index.ts
2
+ import { StandardMerkleTree } from "@openzeppelin/merkle-tree";
3
+ import { simulateContract, writeContract } from "viem/actions";
4
+
5
+ // src/abi/legacyFeeClaims/ClankerSafeErc20Spender.ts
6
+ var Clanker_v0_abi = [
7
+ {
8
+ type: "constructor",
9
+ inputs: [
10
+ { name: "owner_", type: "address", internalType: "address" },
11
+ { name: "teamSpender_", type: "address", internalType: "address" },
12
+ { name: "teamGrantedTokens_", type: "address[]", internalType: "address[]" }
13
+ ],
14
+ stateMutability: "nonpayable"
15
+ },
16
+ {
17
+ type: "function",
18
+ name: "initializeTokenCreator",
19
+ inputs: [
20
+ { name: "token", type: "address", internalType: "address" },
21
+ { name: "newCreator", type: "address", internalType: "address" },
22
+ { name: "proof", type: "bytes32[]", internalType: "bytes32[]" }
23
+ ],
24
+ outputs: [],
25
+ stateMutability: "nonpayable"
26
+ },
27
+ {
28
+ type: "function",
29
+ name: "owner",
30
+ inputs: [],
31
+ outputs: [{ name: "", type: "address", internalType: "address" }],
32
+ stateMutability: "view"
33
+ },
34
+ {
35
+ type: "function",
36
+ name: "renounceOwnership",
37
+ inputs: [],
38
+ outputs: [],
39
+ stateMutability: "nonpayable"
40
+ },
41
+ {
42
+ type: "function",
43
+ name: "setTeamSpender",
44
+ inputs: [{ name: "teamSpender_", type: "address", internalType: "address" }],
45
+ outputs: [],
46
+ stateMutability: "nonpayable"
47
+ },
48
+ {
49
+ type: "function",
50
+ name: "setTokenCreatorRoot",
51
+ inputs: [{ name: "tokenCreatorRoot_", type: "bytes32", internalType: "bytes32" }],
52
+ outputs: [],
53
+ stateMutability: "nonpayable"
54
+ },
55
+ {
56
+ type: "function",
57
+ name: "teamGrantedTokens",
58
+ inputs: [{ name: "", type: "uint256", internalType: "uint256" }],
59
+ outputs: [{ name: "", type: "address", internalType: "address" }],
60
+ stateMutability: "view"
61
+ },
62
+ {
63
+ type: "function",
64
+ name: "teamGrantedTokensMap",
65
+ inputs: [{ name: "token", type: "address", internalType: "address" }],
66
+ outputs: [{ name: "teamGranted", type: "bool", internalType: "bool" }],
67
+ stateMutability: "view"
68
+ },
69
+ {
70
+ type: "function",
71
+ name: "teamSpender",
72
+ inputs: [],
73
+ outputs: [{ name: "", type: "address", internalType: "address" }],
74
+ stateMutability: "view"
75
+ },
76
+ {
77
+ type: "function",
78
+ name: "teamTransfer",
79
+ inputs: [
80
+ { name: "safe", type: "address", internalType: "address" },
81
+ { name: "token", type: "address", internalType: "address" },
82
+ { name: "recipient", type: "address", internalType: "address" },
83
+ { name: "amount", type: "uint256", internalType: "uint256" }
84
+ ],
85
+ outputs: [],
86
+ stateMutability: "nonpayable"
87
+ },
88
+ {
89
+ type: "function",
90
+ name: "teamTransferEth",
91
+ inputs: [{ name: "safe", type: "address", internalType: "address" }],
92
+ outputs: [],
93
+ stateMutability: "nonpayable"
94
+ },
95
+ {
96
+ type: "function",
97
+ name: "tokenCreator",
98
+ inputs: [{ name: "token", type: "address", internalType: "address" }],
99
+ outputs: [{ name: "creator", type: "address", internalType: "address" }],
100
+ stateMutability: "view"
101
+ },
102
+ {
103
+ type: "function",
104
+ name: "tokenCreatorRoot",
105
+ inputs: [],
106
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
107
+ stateMutability: "view"
108
+ },
109
+ {
110
+ type: "function",
111
+ name: "tokenCreatorTransfer",
112
+ inputs: [
113
+ { name: "safe", type: "address", internalType: "address" },
114
+ { name: "token", type: "address", internalType: "address" },
115
+ { name: "recipient", type: "address", internalType: "address" }
116
+ ],
117
+ outputs: [],
118
+ stateMutability: "nonpayable"
119
+ },
120
+ {
121
+ type: "function",
122
+ name: "transferOwnership",
123
+ inputs: [{ name: "newOwner", type: "address", internalType: "address" }],
124
+ outputs: [],
125
+ stateMutability: "nonpayable"
126
+ },
127
+ {
128
+ type: "function",
129
+ name: "updateTokenCreator",
130
+ inputs: [
131
+ { name: "token", type: "address", internalType: "address" },
132
+ { name: "newCreator", type: "address", internalType: "address" }
133
+ ],
134
+ outputs: [],
135
+ stateMutability: "nonpayable"
136
+ },
137
+ {
138
+ type: "event",
139
+ name: "InitializeTokenCreator",
140
+ inputs: [
141
+ { name: "token", type: "address", indexed: false, internalType: "address" },
142
+ { name: "initializer", type: "address", indexed: false, internalType: "address" },
143
+ { name: "creator", type: "address", indexed: false, internalType: "address" }
144
+ ],
145
+ anonymous: false
146
+ },
147
+ {
148
+ type: "event",
149
+ name: "OwnershipTransferred",
150
+ inputs: [
151
+ { name: "previousOwner", type: "address", indexed: true, internalType: "address" },
152
+ { name: "newOwner", type: "address", indexed: true, internalType: "address" }
153
+ ],
154
+ anonymous: false
155
+ },
156
+ {
157
+ type: "event",
158
+ name: "SetTeamSpender",
159
+ inputs: [
160
+ { name: "previousTeamSpender", type: "address", indexed: true, internalType: "address" },
161
+ { name: "newTeamSpender", type: "address", indexed: true, internalType: "address" }
162
+ ],
163
+ anonymous: false
164
+ },
165
+ {
166
+ type: "event",
167
+ name: "SetTokenCreatorRoot",
168
+ inputs: [
169
+ { name: "tokenCreatorRoot", type: "bytes32", indexed: false, internalType: "bytes32" }
170
+ ],
171
+ anonymous: false
172
+ },
173
+ {
174
+ type: "event",
175
+ name: "Transfer",
176
+ inputs: [
177
+ { name: "safe", type: "address", indexed: true, internalType: "address" },
178
+ { name: "token", type: "address", indexed: true, internalType: "address" },
179
+ { name: "amount", type: "uint256", indexed: false, internalType: "uint256" },
180
+ { name: "spender", type: "address", indexed: false, internalType: "address" },
181
+ { name: "recipient", type: "address", indexed: true, internalType: "address" }
182
+ ],
183
+ anonymous: false
184
+ },
185
+ {
186
+ type: "event",
187
+ name: "UpdateTokenCreator",
188
+ inputs: [
189
+ { name: "token", type: "address", indexed: false, internalType: "address" },
190
+ { name: "previousCreator", type: "address", indexed: false, internalType: "address" },
191
+ { name: "newCreator", type: "address", indexed: false, internalType: "address" }
192
+ ],
193
+ anonymous: false
194
+ },
195
+ {
196
+ type: "error",
197
+ name: "InsufficientBalance",
198
+ inputs: [
199
+ { name: "safe", type: "address", internalType: "address" },
200
+ { name: "token", type: "address", internalType: "address" },
201
+ { name: "balance", type: "uint256", internalType: "uint256" }
202
+ ]
203
+ },
204
+ { type: "error", name: "InvalidProof", inputs: [] },
205
+ {
206
+ type: "error",
207
+ name: "NotAuthorizedToSpend",
208
+ inputs: [
209
+ { name: "sender", type: "address", internalType: "address" },
210
+ { name: "token", type: "address", internalType: "address" }
211
+ ]
212
+ },
213
+ {
214
+ type: "error",
215
+ name: "OwnableInvalidOwner",
216
+ inputs: [{ name: "owner", type: "address", internalType: "address" }]
217
+ },
218
+ {
219
+ type: "error",
220
+ name: "OwnableUnauthorizedAccount",
221
+ inputs: [{ name: "account", type: "address", internalType: "address" }]
222
+ },
223
+ {
224
+ type: "error",
225
+ name: "TokenCreatorAlreadyInitialized",
226
+ inputs: [
227
+ { name: "token", type: "address", internalType: "address" },
228
+ { name: "delegate", type: "address", internalType: "address" }
229
+ ]
230
+ },
231
+ {
232
+ type: "error",
233
+ name: "TokenCreatorRootAlreadySet",
234
+ inputs: [{ name: "tokenCreatorRoot", type: "bytes32", internalType: "bytes32" }]
235
+ },
236
+ { type: "error", name: "TokenCreatorRootNotSet", inputs: [] },
237
+ {
238
+ type: "error",
239
+ name: "Unauthorized",
240
+ inputs: [{ name: "unauthorized", type: "address", internalType: "address" }]
241
+ }
242
+ ];
243
+
244
+ // src/utils/errors.ts
245
+ import { BaseError, ContractFunctionRevertedError, InsufficientFundsError } from "viem";
246
+ var ClankerError = class _ClankerError extends Error {
247
+ constructor(error, data) {
248
+ super(data.label);
249
+ this.error = error;
250
+ this.data = data;
251
+ }
252
+ static unknown(e, name) {
253
+ return new _ClankerError(e, {
254
+ type: "unknown",
255
+ label: "Something went wrong",
256
+ rawName: name || "unknown"
257
+ });
258
+ }
259
+ };
260
+ var SignatureToError = {
261
+ "0x7e5ba1ad": {
262
+ type: "state",
263
+ label: "Hook not enabled.",
264
+ rawName: "HookNotEnabled"
265
+ },
266
+ "0x8b063d73": {
267
+ type: "state",
268
+ label: "Too little received (likely dev buy).",
269
+ rawName: "V4TooLittleReceived"
270
+ }
271
+ };
272
+ var ErrorMapping = {
273
+ NoFeesToClaim: {
274
+ type: "state",
275
+ label: "No fees to claim",
276
+ rawName: "NoFeesToClaim"
277
+ },
278
+ InvalidVaultConfiguration: {
279
+ type: "caller",
280
+ label: "Invalid vault configuration",
281
+ rawName: "InvalidVault"
282
+ },
283
+ BaseFeeTooLow: {
284
+ type: "caller",
285
+ label: "Base fee is set too low",
286
+ rawName: "BaseFeeTooLow"
287
+ }
288
+ };
289
+ var understandError = (e) => {
290
+ if (!(e instanceof Error)) return ClankerError.unknown(new Error(`${e}`));
291
+ if (!(e instanceof BaseError)) return ClankerError.unknown(e);
292
+ const revertError = e.walk((e2) => e2 instanceof ContractFunctionRevertedError);
293
+ if (revertError instanceof ContractFunctionRevertedError) {
294
+ const errorName = revertError.data?.errorName ?? "";
295
+ const mapping = ErrorMapping[errorName];
296
+ if (mapping) return new ClankerError(e, mapping);
297
+ const signatureToError = SignatureToError[revertError.signature || "0x"];
298
+ if (signatureToError) return new ClankerError(e, signatureToError);
299
+ return ClankerError.unknown(e, errorName);
300
+ }
301
+ const fundsError = e.walk((e2) => e2 instanceof InsufficientFundsError);
302
+ if (fundsError instanceof InsufficientFundsError) {
303
+ return new ClankerError(fundsError, {
304
+ type: "caller",
305
+ label: "Insufficient funds.",
306
+ rawName: "InsufficientFundsError"
307
+ });
308
+ }
309
+ return ClankerError.unknown(e);
310
+ };
311
+
312
+ // src/legacyFeeClaims/index.ts
313
+ var LEGACY_FEE_CLAIMS_ADDRESS = "0x10F4485d6f90239B72c6A5eaD2F2320993D285E4";
314
+ var LegacyFeeClaims = class {
315
+ wallet;
316
+ publicClient;
317
+ constructor(config) {
318
+ this.wallet = config?.wallet;
319
+ this.publicClient = config?.publicClient;
320
+ }
321
+ /**
322
+ * Get an abi-typed transaction for initializing token creator ownership.
323
+ *
324
+ * This must be called once per token by the original creator to claim ownership
325
+ * of the token's fees. During this call, the creator can optionally set a different
326
+ * admin key to manage the token's rewards.
327
+ *
328
+ * @param token The token address to initialize a creator for
329
+ * @param newCreator The address to set as the creator for this token (can be different from msg.sender)
330
+ * @param proof The Merkle proof demonstrating msg.sender is authorized for this token
331
+ * @returns Abi transaction config
332
+ */
333
+ getInitializeTokenCreatorTransaction({
334
+ token,
335
+ newCreator,
336
+ proof
337
+ }) {
338
+ return {
339
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
340
+ abi: Clanker_v0_abi,
341
+ functionName: "initializeTokenCreator",
342
+ args: [token, newCreator, proof]
343
+ };
344
+ }
345
+ /**
346
+ * Simulate initializing token creator ownership.
347
+ *
348
+ * @param token The token address to initialize a creator for
349
+ * @param newCreator The address to set as the creator for this token
350
+ * @param proof The Merkle proof demonstrating msg.sender is authorized for this token
351
+ * @param account Optional account to simulate calling for
352
+ * @returns The simulated output
353
+ */
354
+ async initializeTokenCreatorSimulate({
355
+ token,
356
+ newCreator,
357
+ proof
358
+ }, account) {
359
+ const acc = account || this.wallet?.account;
360
+ if (!acc) throw new Error("Account or wallet client required for simulation");
361
+ if (!this.publicClient) throw new Error("Public client required");
362
+ try {
363
+ return await simulateContract(this.publicClient, {
364
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
365
+ abi: Clanker_v0_abi,
366
+ functionName: "initializeTokenCreator",
367
+ args: [token, newCreator, proof],
368
+ account: acc
369
+ });
370
+ } catch (e) {
371
+ return { error: understandError(e) };
372
+ }
373
+ }
374
+ /**
375
+ * Initialize token creator ownership to enable fee claims.
376
+ *
377
+ * This must be called once per token by the original creator. The proof must be
378
+ * obtained from the Clanker team or frontend. During initialization, you can
379
+ * optionally set a different admin address to manage future claims.
380
+ *
381
+ * @param token The token address to initialize a creator for
382
+ * @param newCreator The address to set as the creator for this token (can be different from msg.sender)
383
+ * @param proof The Merkle proof demonstrating msg.sender is authorized for this token
384
+ * @returns Transaction hash or error
385
+ */
386
+ async initializeTokenCreator({
387
+ token,
388
+ newCreator,
389
+ proof
390
+ }) {
391
+ if (!this.wallet) throw new Error("Wallet client required");
392
+ if (!this.publicClient) throw new Error("Public client required");
393
+ try {
394
+ const txHash = await writeContract(this.wallet, {
395
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
396
+ abi: Clanker_v0_abi,
397
+ functionName: "initializeTokenCreator",
398
+ args: [token, newCreator, proof]
399
+ });
400
+ return { txHash, error: void 0 };
401
+ } catch (e) {
402
+ console.error(JSON.stringify(e, null, 2));
403
+ return { txHash: void 0, error: understandError(e) };
404
+ }
405
+ }
406
+ /**
407
+ * Get an abi-typed transaction for updating the token creator admin address.
408
+ *
409
+ * This allows the current creator to change the address that can trigger claims.
410
+ * Only callable by the current creator address for the specified token.
411
+ *
412
+ * @param token The token address to update the creator for
413
+ * @param newCreator The new creator/admin address
414
+ * @returns Abi transaction config
415
+ */
416
+ getUpdateTokenCreatorTransaction({
417
+ token,
418
+ newCreator
419
+ }) {
420
+ return {
421
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
422
+ abi: Clanker_v0_abi,
423
+ functionName: "updateTokenCreator",
424
+ args: [token, newCreator]
425
+ };
426
+ }
427
+ /**
428
+ * Simulate updating the token creator admin address.
429
+ *
430
+ * @param token The token address to update the creator for
431
+ * @param newCreator The new creator/admin address
432
+ * @param account Optional account to simulate calling for
433
+ * @returns The simulated output
434
+ */
435
+ async updateTokenCreatorSimulate({
436
+ token,
437
+ newCreator
438
+ }, account) {
439
+ const acc = account || this.wallet?.account;
440
+ if (!acc) throw new Error("Account or wallet client required for simulation");
441
+ if (!this.publicClient) throw new Error("Public client required");
442
+ try {
443
+ return await simulateContract(this.publicClient, {
444
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
445
+ abi: Clanker_v0_abi,
446
+ functionName: "updateTokenCreator",
447
+ args: [token, newCreator],
448
+ account: acc
449
+ });
450
+ } catch (e) {
451
+ return { error: understandError(e) };
452
+ }
453
+ }
454
+ /**
455
+ * Update the token creator admin address.
456
+ *
457
+ * This allows you to change which address can trigger fee claims for your token.
458
+ * Only callable by the current creator address.
459
+ *
460
+ * @param token The token address to update the creator for
461
+ * @param newCreator The new creator/admin address
462
+ * @returns Transaction hash or error
463
+ */
464
+ async updateTokenCreator({
465
+ token,
466
+ newCreator
467
+ }) {
468
+ if (!this.wallet) throw new Error("Wallet client required");
469
+ if (!this.publicClient) throw new Error("Public client required");
470
+ try {
471
+ const txHash = await writeContract(this.wallet, {
472
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
473
+ abi: Clanker_v0_abi,
474
+ functionName: "updateTokenCreator",
475
+ args: [token, newCreator]
476
+ });
477
+ return { txHash, error: void 0 };
478
+ } catch (e) {
479
+ return { txHash: void 0, error: understandError(e) };
480
+ }
481
+ }
482
+ /**
483
+ * Get an abi-typed transaction for claiming token creator fees.
484
+ *
485
+ * This allows the authorized creator to transfer all accumulated fees from the
486
+ * Safe wallet to any recipient address. Only callable by the authorized creator
487
+ * for the specified token.
488
+ *
489
+ * @param safe The Safe wallet address holding the fees
490
+ * @param token The ERC20 token address to transfer
491
+ * @param recipient The address to receive the fees
492
+ * @returns Abi transaction config
493
+ */
494
+ getTokenCreatorTransferTransaction({
495
+ safe,
496
+ token,
497
+ recipient
498
+ }) {
499
+ return {
500
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
501
+ abi: Clanker_v0_abi,
502
+ functionName: "tokenCreatorTransfer",
503
+ args: [safe, token, recipient]
504
+ };
505
+ }
506
+ /**
507
+ * Simulate claiming token creator fees.
508
+ *
509
+ * @param safe The Safe wallet address holding the fees
510
+ * @param token The ERC20 token address to transfer
511
+ * @param recipient The address to receive the fees
512
+ * @param account Optional account to simulate calling for
513
+ * @returns The simulated output
514
+ */
515
+ async tokenCreatorTransferSimulate({
516
+ safe,
517
+ token,
518
+ recipient
519
+ }, account) {
520
+ const acc = account || this.wallet?.account;
521
+ if (!acc) throw new Error("Account or wallet client required for simulation");
522
+ if (!this.publicClient) throw new Error("Public client required");
523
+ try {
524
+ return await simulateContract(this.publicClient, {
525
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
526
+ abi: Clanker_v0_abi,
527
+ functionName: "tokenCreatorTransfer",
528
+ args: [safe, token, recipient],
529
+ account: acc
530
+ });
531
+ } catch (e) {
532
+ return { error: understandError(e) };
533
+ }
534
+ }
535
+ /**
536
+ * Claim token creator fees by transferring them from the Safe to a recipient.
537
+ *
538
+ * This transfers all accumulated fees for your token to the specified recipient.
539
+ * Only callable by the authorized creator address for the token.
540
+ *
541
+ * Note: Not all Clanker tokens can be sent to the zero address. If you get an error,
542
+ * consider sending to 0x000000000000000000000000000000000000dEaD instead.
543
+ *
544
+ * @param safe The Safe wallet address holding the fees
545
+ * @param token The ERC20 token address to transfer
546
+ * @param recipient The address to receive the fees
547
+ * @returns Transaction hash or error
548
+ */
549
+ async tokenCreatorTransfer({
550
+ safe,
551
+ token,
552
+ recipient
553
+ }) {
554
+ if (!this.wallet) throw new Error("Wallet client required");
555
+ if (!this.publicClient) throw new Error("Public client required");
556
+ try {
557
+ const txHash = await writeContract(this.wallet, {
558
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
559
+ abi: Clanker_v0_abi,
560
+ functionName: "tokenCreatorTransfer",
561
+ args: [safe, token, recipient]
562
+ });
563
+ return { txHash, error: void 0 };
564
+ } catch (e) {
565
+ return { txHash: void 0, error: understandError(e) };
566
+ }
567
+ }
568
+ /**
569
+ * Get the stored creator address for a token.
570
+ *
571
+ * Returns the address that is authorized to claim fees for this token.
572
+ * Returns zero address if the token creator has not been initialized yet.
573
+ *
574
+ * @param token The token address to check
575
+ * @returns The creator address for the token
576
+ */
577
+ async getTokenCreator({ token }) {
578
+ if (!this.publicClient) throw new Error("Public client required");
579
+ return this.publicClient.readContract({
580
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
581
+ abi: Clanker_v0_abi,
582
+ functionName: "tokenCreator",
583
+ args: [token]
584
+ });
585
+ }
586
+ /**
587
+ * Get the current Merkle root used for verifying token creator proofs.
588
+ *
589
+ * This is used internally by the contract to verify initialization proofs.
590
+ *
591
+ * @returns The current token creator Merkle root
592
+ */
593
+ async getTokenCreatorRoot() {
594
+ if (!this.publicClient) throw new Error("Public client required");
595
+ return this.publicClient.readContract({
596
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
597
+ abi: Clanker_v0_abi,
598
+ functionName: "tokenCreatorRoot",
599
+ args: []
600
+ });
601
+ }
602
+ };
603
+ function getTokenCreatorMerkleProof(entries, targetToken) {
604
+ const normalizedTarget = targetToken.toLowerCase();
605
+ const targetIndex = entries.findIndex((e) => e.tokenAddress.toLowerCase() === normalizedTarget);
606
+ if (targetIndex === -1) {
607
+ return null;
608
+ }
609
+ const targetEntry = entries[targetIndex];
610
+ const values = entries.map((e) => [e.tokenAddress, e.currentCreator]);
611
+ const tree = StandardMerkleTree.of(values, ["address", "address"]);
612
+ const proof = tree.getProof(targetIndex);
613
+ const leafHash = tree.leafHash([
614
+ targetEntry.tokenAddress,
615
+ targetEntry.currentCreator
616
+ ]);
617
+ return {
618
+ tokenAddress: targetEntry.tokenAddress,
619
+ currentCreator: targetEntry.currentCreator,
620
+ proof,
621
+ leafHash,
622
+ root: tree.root,
623
+ index: targetIndex
624
+ };
625
+ }
626
+ function parseTokenCreatorCSV(csvContent) {
627
+ const lines = csvContent.trim().split("\n");
628
+ const dataLines = lines.slice(1);
629
+ return dataLines.map((line) => {
630
+ const [tokenAddress, currentCreator] = line.split(",").map((s) => s.trim());
631
+ return {
632
+ tokenAddress,
633
+ currentCreator
634
+ };
635
+ });
636
+ }
637
+ var EXPECTED_MERKLE_ROOT = "0xa7dcc91a2136ef1b3c708dbab901cbeb075f6df5cf5987494fedc340c57f7025";
638
+ function getInitializeTokenCreatorTransaction({
639
+ token,
640
+ newCreator,
641
+ proof
642
+ }) {
643
+ return {
644
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
645
+ abi: Clanker_v0_abi,
646
+ functionName: "initializeTokenCreator",
647
+ args: [token, newCreator, proof]
648
+ };
649
+ }
650
+ function getUpdateTokenCreatorTransaction({
651
+ token,
652
+ newCreator
653
+ }) {
654
+ return {
655
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
656
+ abi: Clanker_v0_abi,
657
+ functionName: "updateTokenCreator",
658
+ args: [token, newCreator]
659
+ };
660
+ }
661
+ function getTokenCreatorTransferTransaction({
662
+ safe,
663
+ token,
664
+ recipient
665
+ }) {
666
+ return {
667
+ address: LEGACY_FEE_CLAIMS_ADDRESS,
668
+ abi: Clanker_v0_abi,
669
+ functionName: "tokenCreatorTransfer",
670
+ args: [safe, token, recipient]
671
+ };
672
+ }
673
+ export {
674
+ EXPECTED_MERKLE_ROOT,
675
+ LEGACY_FEE_CLAIMS_ADDRESS,
676
+ LegacyFeeClaims,
677
+ getInitializeTokenCreatorTransaction,
678
+ getTokenCreatorMerkleProof,
679
+ getTokenCreatorTransferTransaction,
680
+ getUpdateTokenCreatorTransaction,
681
+ parseTokenCreatorCSV
682
+ };
@@ -1,8 +1,9 @@
1
- import { C as ClankerTransactionConfig, a as Clanker_v3_1_abi, b as ClankerError, c as ClankerFactory, d as ClankerResult } from '../write-clanker-contracts-DVM3LXMa.js';
1
+ import { C as ClankerTransactionConfig, a as Clanker_v3_1_abi, b as ClankerFactory, c as ClankerResult } from '../write-clanker-contracts-B4LSHPv2.js';
2
2
  import * as viem from 'viem';
3
3
  import { WalletClient, Transport, Chain, Account, PublicClient } from 'viem';
4
4
  import { C as ClankerToken_v3_1_abi } from '../ClankerToken-Dra5lppJ.js';
5
5
  import { C as ClankerTokenV3 } from '../clankerTokenV3-BqHTF9QY.js';
6
+ import { C as ClankerError } from '../errors-5Gv28Tkr.js';
6
7
  import 'zod/v4';
7
8
 
8
9
  type ClankerConfig = {
@@ -1,8 +1,9 @@
1
- import { C as ClankerTransactionConfig, g as ClankerAirdrop_v4_abi, d as ClankerResult, h as Clanker_PresaleEthToCreator_v4_1_abi, b as ClankerError } from '../../write-clanker-contracts-DVM3LXMa.js';
1
+ import { C as ClankerTransactionConfig, f as ClankerAirdrop_v4_abi, c as ClankerResult, g as Clanker_PresaleEthToCreator_v4_1_abi } from '../../write-clanker-contracts-B4LSHPv2.js';
2
2
  import { MerkleTree } from '@openzeppelin/merkle-tree/dist/merkletree.js';
3
3
  import * as z from 'zod/v4';
4
- import { a as Chain, C as ClankerTokenV4 } from '../../clankerTokenV4-CYKWWpwe.js';
4
+ import { a as Chain, C as ClankerTokenV4 } from '../../clankerTokenV4-Btn0ZN4v.js';
5
5
  import { Clanker } from '../index.js';
6
+ import { C as ClankerError } from '../../errors-5Gv28Tkr.js';
6
7
  import 'viem';
7
8
  import '../../ClankerToken-Dra5lppJ.js';
8
9