clanker-sdk 4.2.3-canary.0 → 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.
|
@@ -4,7 +4,7 @@ import { C as ClankerError } from '../errors-5Gv28Tkr.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Contract address for ClankerSafeErc20Spender on Base network
|
|
6
6
|
*/
|
|
7
|
-
declare const LEGACY_FEE_CLAIMS_ADDRESS: "
|
|
7
|
+
declare const LEGACY_FEE_CLAIMS_ADDRESS: "0x10F4485d6f90239B72c6A5eaD2F2320993D285E4";
|
|
8
8
|
type LegacyFeeClaimsConfig = {
|
|
9
9
|
wallet?: WalletClient<Transport, Chain, Account>;
|
|
10
10
|
publicClient?: PublicClient;
|
|
@@ -41,7 +41,7 @@ declare class LegacyFeeClaims {
|
|
|
41
41
|
newCreator: `0x${string}`;
|
|
42
42
|
proof: `0x${string}`[];
|
|
43
43
|
}): {
|
|
44
|
-
address: "
|
|
44
|
+
address: "0x10F4485d6f90239B72c6A5eaD2F2320993D285E4";
|
|
45
45
|
abi: readonly [{
|
|
46
46
|
readonly type: "constructor";
|
|
47
47
|
readonly inputs: readonly [{
|
|
@@ -493,7 +493,7 @@ declare class LegacyFeeClaims {
|
|
|
493
493
|
token: `0x${string}`;
|
|
494
494
|
newCreator: `0x${string}`;
|
|
495
495
|
}): {
|
|
496
|
-
address: "
|
|
496
|
+
address: "0x10F4485d6f90239B72c6A5eaD2F2320993D285E4";
|
|
497
497
|
abi: readonly [{
|
|
498
498
|
readonly type: "constructor";
|
|
499
499
|
readonly inputs: readonly [{
|
|
@@ -943,7 +943,7 @@ declare class LegacyFeeClaims {
|
|
|
943
943
|
token: `0x${string}`;
|
|
944
944
|
recipient: `0x${string}`;
|
|
945
945
|
}): {
|
|
946
|
-
address: "
|
|
946
|
+
address: "0x10F4485d6f90239B72c6A5eaD2F2320993D285E4";
|
|
947
947
|
abi: readonly [{
|
|
948
948
|
readonly type: "constructor";
|
|
949
949
|
readonly inputs: readonly [{
|
|
@@ -1422,15 +1422,6 @@ interface MerkleProofResult {
|
|
|
1422
1422
|
root: `0x${string}`;
|
|
1423
1423
|
index: number;
|
|
1424
1424
|
}
|
|
1425
|
-
/**
|
|
1426
|
-
* Generate a leaf hash for a token-creator pair.
|
|
1427
|
-
* This matches the Solidity implementation: keccak256(abi.encodePacked(tokenAddress, currentCreator))
|
|
1428
|
-
*
|
|
1429
|
-
* @param tokenAddress The token address
|
|
1430
|
-
* @param currentCreator The creator address
|
|
1431
|
-
* @returns The leaf hash
|
|
1432
|
-
*/
|
|
1433
|
-
declare function generateLeafHash(tokenAddress: `0x${string}`, currentCreator: `0x${string}`): `0x${string}`;
|
|
1434
1425
|
/**
|
|
1435
1426
|
* Build a merkle tree from token-creator entries and get a proof for a specific token.
|
|
1436
1427
|
*
|
|
@@ -1464,7 +1455,7 @@ declare function getInitializeTokenCreatorTransaction({ token, newCreator, proof
|
|
|
1464
1455
|
newCreator: `0x${string}`;
|
|
1465
1456
|
proof: `0x${string}`[];
|
|
1466
1457
|
}): {
|
|
1467
|
-
address: "
|
|
1458
|
+
address: "0x10F4485d6f90239B72c6A5eaD2F2320993D285E4";
|
|
1468
1459
|
abi: readonly [{
|
|
1469
1460
|
readonly type: "constructor";
|
|
1470
1461
|
readonly inputs: readonly [{
|
|
@@ -1876,7 +1867,7 @@ declare function getUpdateTokenCreatorTransaction({ token, newCreator, }: {
|
|
|
1876
1867
|
token: `0x${string}`;
|
|
1877
1868
|
newCreator: `0x${string}`;
|
|
1878
1869
|
}): {
|
|
1879
|
-
address: "
|
|
1870
|
+
address: "0x10F4485d6f90239B72c6A5eaD2F2320993D285E4";
|
|
1880
1871
|
abi: readonly [{
|
|
1881
1872
|
readonly type: "constructor";
|
|
1882
1873
|
readonly inputs: readonly [{
|
|
@@ -2290,7 +2281,7 @@ declare function getTokenCreatorTransferTransaction({ safe, token, recipient, }:
|
|
|
2290
2281
|
token: `0x${string}`;
|
|
2291
2282
|
recipient: `0x${string}`;
|
|
2292
2283
|
}): {
|
|
2293
|
-
address: "
|
|
2284
|
+
address: "0x10F4485d6f90239B72c6A5eaD2F2320993D285E4";
|
|
2294
2285
|
abi: readonly [{
|
|
2295
2286
|
readonly type: "constructor";
|
|
2296
2287
|
readonly inputs: readonly [{
|
|
@@ -2692,4 +2683,4 @@ declare function getTokenCreatorTransferTransaction({ safe, token, recipient, }:
|
|
|
2692
2683
|
args: readonly [`0x${string}`, `0x${string}`, `0x${string}`];
|
|
2693
2684
|
};
|
|
2694
2685
|
|
|
2695
|
-
export { EXPECTED_MERKLE_ROOT, LEGACY_FEE_CLAIMS_ADDRESS, LegacyFeeClaims, type MerkleProofResult, type TokenCreatorEntry,
|
|
2686
|
+
export { EXPECTED_MERKLE_ROOT, LEGACY_FEE_CLAIMS_ADDRESS, LegacyFeeClaims, type MerkleProofResult, type TokenCreatorEntry, getInitializeTokenCreatorTransaction, getTokenCreatorMerkleProof, getTokenCreatorTransferTransaction, getUpdateTokenCreatorTransaction, parseTokenCreatorCSV };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// src/legacyFeeClaims/index.ts
|
|
2
2
|
import { StandardMerkleTree } from "@openzeppelin/merkle-tree";
|
|
3
|
-
import { keccak256 } from "viem";
|
|
4
3
|
import { simulateContract, writeContract } from "viem/actions";
|
|
5
4
|
|
|
6
5
|
// src/abi/legacyFeeClaims/ClankerSafeErc20Spender.ts
|
|
@@ -311,7 +310,7 @@ var understandError = (e) => {
|
|
|
311
310
|
};
|
|
312
311
|
|
|
313
312
|
// src/legacyFeeClaims/index.ts
|
|
314
|
-
var LEGACY_FEE_CLAIMS_ADDRESS = "
|
|
313
|
+
var LEGACY_FEE_CLAIMS_ADDRESS = "0x10F4485d6f90239B72c6A5eaD2F2320993D285E4";
|
|
315
314
|
var LegacyFeeClaims = class {
|
|
316
315
|
wallet;
|
|
317
316
|
publicClient;
|
|
@@ -601,10 +600,6 @@ var LegacyFeeClaims = class {
|
|
|
601
600
|
});
|
|
602
601
|
}
|
|
603
602
|
};
|
|
604
|
-
function generateLeafHash(tokenAddress, currentCreator) {
|
|
605
|
-
const packed = `0x${tokenAddress.slice(2)}${currentCreator.slice(2)}`;
|
|
606
|
-
return keccak256(packed);
|
|
607
|
-
}
|
|
608
603
|
function getTokenCreatorMerkleProof(entries, targetToken) {
|
|
609
604
|
const normalizedTarget = targetToken.toLowerCase();
|
|
610
605
|
const targetIndex = entries.findIndex((e) => e.tokenAddress.toLowerCase() === normalizedTarget);
|
|
@@ -615,7 +610,10 @@ function getTokenCreatorMerkleProof(entries, targetToken) {
|
|
|
615
610
|
const values = entries.map((e) => [e.tokenAddress, e.currentCreator]);
|
|
616
611
|
const tree = StandardMerkleTree.of(values, ["address", "address"]);
|
|
617
612
|
const proof = tree.getProof(targetIndex);
|
|
618
|
-
const leafHash =
|
|
613
|
+
const leafHash = tree.leafHash([
|
|
614
|
+
targetEntry.tokenAddress,
|
|
615
|
+
targetEntry.currentCreator
|
|
616
|
+
]);
|
|
619
617
|
return {
|
|
620
618
|
tokenAddress: targetEntry.tokenAddress,
|
|
621
619
|
currentCreator: targetEntry.currentCreator,
|
|
@@ -676,7 +674,6 @@ export {
|
|
|
676
674
|
EXPECTED_MERKLE_ROOT,
|
|
677
675
|
LEGACY_FEE_CLAIMS_ADDRESS,
|
|
678
676
|
LegacyFeeClaims,
|
|
679
|
-
generateLeafHash,
|
|
680
677
|
getInitializeTokenCreatorTransaction,
|
|
681
678
|
getTokenCreatorMerkleProof,
|
|
682
679
|
getTokenCreatorTransferTransaction,
|