clanker-sdk 4.2.3-canary.0 → 4.2.4
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/dist/index.d.ts +17 -2
- package/dist/index.js +50 -1
- package/dist/legacyFeeClaims/index.d.ts +8 -17
- package/dist/legacyFeeClaims/index.js +5 -8
- package/dist/v4/extensions/index.js +42 -0
- package/dist/v4/index.js +42 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ declare const WETH_ADDRESSES: Record<Chain, `0x${string}`>;
|
|
|
17
17
|
declare const DEFAULT_SUPPLY = 100000000000000000000000000000n;
|
|
18
18
|
declare enum PoolPositions {
|
|
19
19
|
Standard = "Standard",
|
|
20
|
-
Project = "Project"
|
|
20
|
+
Project = "Project",
|
|
21
|
+
TwentyETH = "TwentyETH"
|
|
21
22
|
}
|
|
22
23
|
type PoolPosition = {
|
|
23
24
|
tickLower: number;
|
|
@@ -54,6 +55,20 @@ declare const getTickFromMarketCap: (marketCap: number) => {
|
|
|
54
55
|
tickIfToken0IsClanker: number;
|
|
55
56
|
tickSpacing: number;
|
|
56
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* Calculate the tick for a desired market cap in USDC
|
|
60
|
+
*
|
|
61
|
+
* @param marketCapUSDC - Desired market cap in USDC (e.g., 10 for $10)
|
|
62
|
+
* @param tickSpacing - Tick spacing (must be multiple of this, default 200)
|
|
63
|
+
* @returns The tick value rounded to the nearest tickSpacing
|
|
64
|
+
*
|
|
65
|
+
* Formula:
|
|
66
|
+
* - Total supply: 100B tokens (10^11 * 10^18 with decimals = 10^29)
|
|
67
|
+
* - USDC: 6 decimals (10^6)
|
|
68
|
+
* - Price per token = (marketCap * 10^6) / 10^29 = marketCap / 10^23
|
|
69
|
+
* - tick = log(price) / log(1.0001)
|
|
70
|
+
*/
|
|
71
|
+
declare function getTickFromMarketCapUSDC(marketCapUSDC: number, tickSpacing?: number): number;
|
|
57
72
|
|
|
58
73
|
interface AirdropEntry {
|
|
59
74
|
account: `0x${string}`;
|
|
@@ -67,4 +82,4 @@ declare function createMerkleTree(entries: AirdropEntry[]): {
|
|
|
67
82
|
declare function getMerkleProof(tree: StandardMerkleTree<[string, string]>, entries: [string, string][], account: `0x${string}`, amount: number): `0x${string}`[];
|
|
68
83
|
declare function encodeAirdropData(merkleRoot: `0x${string}`, lockupDuration: number, vestingDuration: number): `0x${string}`;
|
|
69
84
|
|
|
70
|
-
export { A0X_ADDRESS, ANON_ADDRESS, type AirdropEntry, CB_BTC_ADDRESS, CLANKER_ADDRESS, Chain, ClankerDeployment, ClankerTokenV4, DEFAULT_SUPPLY, DEGEN_ADDRESS, FEE_CONFIGS, FeeConfigs, HIGHER_ADDRESS, NATIVE_ADDRESS, POOL_POSITIONS, PoolPositions, WETH_ADDRESSES, createMerkleTree, encodeAirdropData, findVanityAddress, findVanityAddressV4, getMerkleProof, getTickFromMarketCap };
|
|
85
|
+
export { A0X_ADDRESS, ANON_ADDRESS, type AirdropEntry, CB_BTC_ADDRESS, CLANKER_ADDRESS, Chain, ClankerDeployment, ClankerTokenV4, DEFAULT_SUPPLY, DEGEN_ADDRESS, FEE_CONFIGS, FeeConfigs, HIGHER_ADDRESS, NATIVE_ADDRESS, POOL_POSITIONS, PoolPositions, WETH_ADDRESSES, createMerkleTree, encodeAirdropData, findVanityAddress, findVanityAddressV4, getMerkleProof, getTickFromMarketCap, getTickFromMarketCapUSDC };
|
package/dist/index.js
CHANGED
|
@@ -58,6 +58,7 @@ var DEFAULT_SUPPLY = 100000000000000000000000000000n;
|
|
|
58
58
|
var PoolPositions = /* @__PURE__ */ ((PoolPositions2) => {
|
|
59
59
|
PoolPositions2["Standard"] = "Standard";
|
|
60
60
|
PoolPositions2["Project"] = "Project";
|
|
61
|
+
PoolPositions2["TwentyETH"] = "TwentyETH";
|
|
61
62
|
return PoolPositions2;
|
|
62
63
|
})(PoolPositions || {});
|
|
63
64
|
var POOL_POSITIONS = {
|
|
@@ -112,6 +113,48 @@ var POOL_POSITIONS = {
|
|
|
112
113
|
positionBps: 500
|
|
113
114
|
// 5% of LP
|
|
114
115
|
}
|
|
116
|
+
],
|
|
117
|
+
TwentyETH: [
|
|
118
|
+
{
|
|
119
|
+
tickLower: -223400,
|
|
120
|
+
// 20 ETH (starting tick)
|
|
121
|
+
tickUpper: -212e3,
|
|
122
|
+
// ~$180K
|
|
123
|
+
positionBps: 1e3
|
|
124
|
+
// 10% of LP
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
tickLower: -212e3,
|
|
128
|
+
// ~$180K
|
|
129
|
+
tickUpper: -155e3,
|
|
130
|
+
// ~$50M
|
|
131
|
+
positionBps: 5e3
|
|
132
|
+
// 50% of LP
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
tickLower: -201e3,
|
|
136
|
+
// ~$500K
|
|
137
|
+
tickUpper: -155e3,
|
|
138
|
+
// ~$50M
|
|
139
|
+
positionBps: 1500
|
|
140
|
+
// 15% of LP
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
tickLower: -155e3,
|
|
144
|
+
// ~$50M
|
|
145
|
+
tickUpper: -12e4,
|
|
146
|
+
// ~$1.5B
|
|
147
|
+
positionBps: 2e3
|
|
148
|
+
// 20% of LP
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
tickLower: -141e3,
|
|
152
|
+
// ~$200M
|
|
153
|
+
tickUpper: -12e4,
|
|
154
|
+
// ~$1.5B
|
|
155
|
+
positionBps: 500
|
|
156
|
+
// 5% of LP
|
|
157
|
+
}
|
|
115
158
|
]
|
|
116
159
|
};
|
|
117
160
|
var FeeConfigs = /* @__PURE__ */ ((FeeConfigs2) => {
|
|
@@ -5730,6 +5773,11 @@ var getTickFromMarketCap = (marketCap) => {
|
|
|
5730
5773
|
tickSpacing
|
|
5731
5774
|
};
|
|
5732
5775
|
};
|
|
5776
|
+
function getTickFromMarketCapUSDC(marketCapUSDC, tickSpacing = 200) {
|
|
5777
|
+
const price = marketCapUSDC / 1e23;
|
|
5778
|
+
const rawTick = Math.log(price) / Math.log(1.0001);
|
|
5779
|
+
return Math.floor(rawTick / tickSpacing) * tickSpacing;
|
|
5780
|
+
}
|
|
5733
5781
|
|
|
5734
5782
|
// src/utils/merkleTree.ts
|
|
5735
5783
|
import { StandardMerkleTree } from "@openzeppelin/merkle-tree";
|
|
@@ -5786,5 +5834,6 @@ export {
|
|
|
5786
5834
|
findVanityAddress,
|
|
5787
5835
|
findVanityAddressV4,
|
|
5788
5836
|
getMerkleProof,
|
|
5789
|
-
getTickFromMarketCap
|
|
5837
|
+
getTickFromMarketCap,
|
|
5838
|
+
getTickFromMarketCapUSDC
|
|
5790
5839
|
};
|
|
@@ -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,
|
|
@@ -7023,6 +7023,48 @@ var POOL_POSITIONS = {
|
|
|
7023
7023
|
positionBps: 500
|
|
7024
7024
|
// 5% of LP
|
|
7025
7025
|
}
|
|
7026
|
+
],
|
|
7027
|
+
TwentyETH: [
|
|
7028
|
+
{
|
|
7029
|
+
tickLower: -223400,
|
|
7030
|
+
// 20 ETH (starting tick)
|
|
7031
|
+
tickUpper: -212e3,
|
|
7032
|
+
// ~$180K
|
|
7033
|
+
positionBps: 1e3
|
|
7034
|
+
// 10% of LP
|
|
7035
|
+
},
|
|
7036
|
+
{
|
|
7037
|
+
tickLower: -212e3,
|
|
7038
|
+
// ~$180K
|
|
7039
|
+
tickUpper: -155e3,
|
|
7040
|
+
// ~$50M
|
|
7041
|
+
positionBps: 5e3
|
|
7042
|
+
// 50% of LP
|
|
7043
|
+
},
|
|
7044
|
+
{
|
|
7045
|
+
tickLower: -201e3,
|
|
7046
|
+
// ~$500K
|
|
7047
|
+
tickUpper: -155e3,
|
|
7048
|
+
// ~$50M
|
|
7049
|
+
positionBps: 1500
|
|
7050
|
+
// 15% of LP
|
|
7051
|
+
},
|
|
7052
|
+
{
|
|
7053
|
+
tickLower: -155e3,
|
|
7054
|
+
// ~$50M
|
|
7055
|
+
tickUpper: -12e4,
|
|
7056
|
+
// ~$1.5B
|
|
7057
|
+
positionBps: 2e3
|
|
7058
|
+
// 20% of LP
|
|
7059
|
+
},
|
|
7060
|
+
{
|
|
7061
|
+
tickLower: -141e3,
|
|
7062
|
+
// ~$200M
|
|
7063
|
+
tickUpper: -12e4,
|
|
7064
|
+
// ~$1.5B
|
|
7065
|
+
positionBps: 500
|
|
7066
|
+
// 5% of LP
|
|
7067
|
+
}
|
|
7026
7068
|
]
|
|
7027
7069
|
};
|
|
7028
7070
|
|
package/dist/v4/index.js
CHANGED
|
@@ -2014,6 +2014,48 @@ var POOL_POSITIONS = {
|
|
|
2014
2014
|
positionBps: 500
|
|
2015
2015
|
// 5% of LP
|
|
2016
2016
|
}
|
|
2017
|
+
],
|
|
2018
|
+
TwentyETH: [
|
|
2019
|
+
{
|
|
2020
|
+
tickLower: -223400,
|
|
2021
|
+
// 20 ETH (starting tick)
|
|
2022
|
+
tickUpper: -212e3,
|
|
2023
|
+
// ~$180K
|
|
2024
|
+
positionBps: 1e3
|
|
2025
|
+
// 10% of LP
|
|
2026
|
+
},
|
|
2027
|
+
{
|
|
2028
|
+
tickLower: -212e3,
|
|
2029
|
+
// ~$180K
|
|
2030
|
+
tickUpper: -155e3,
|
|
2031
|
+
// ~$50M
|
|
2032
|
+
positionBps: 5e3
|
|
2033
|
+
// 50% of LP
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
tickLower: -201e3,
|
|
2037
|
+
// ~$500K
|
|
2038
|
+
tickUpper: -155e3,
|
|
2039
|
+
// ~$50M
|
|
2040
|
+
positionBps: 1500
|
|
2041
|
+
// 15% of LP
|
|
2042
|
+
},
|
|
2043
|
+
{
|
|
2044
|
+
tickLower: -155e3,
|
|
2045
|
+
// ~$50M
|
|
2046
|
+
tickUpper: -12e4,
|
|
2047
|
+
// ~$1.5B
|
|
2048
|
+
positionBps: 2e3
|
|
2049
|
+
// 20% of LP
|
|
2050
|
+
},
|
|
2051
|
+
{
|
|
2052
|
+
tickLower: -141e3,
|
|
2053
|
+
// ~$200M
|
|
2054
|
+
tickUpper: -12e4,
|
|
2055
|
+
// ~$1.5B
|
|
2056
|
+
positionBps: 500
|
|
2057
|
+
// 5% of LP
|
|
2058
|
+
}
|
|
2017
2059
|
]
|
|
2018
2060
|
};
|
|
2019
2061
|
|