clanker-sdk 4.2.12 → 4.2.13
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/cli/cli.js +35 -1
- package/dist/cli/commands/deploy.js +35 -1
- package/dist/v3/index.d.ts +2 -2
- package/dist/v4/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/cli/cli.js
CHANGED
|
@@ -9977,6 +9977,17 @@ async function interactiveDeployV4(flags) {
|
|
|
9977
9977
|
const n = Number(v);
|
|
9978
9978
|
return !Number.isNaN(n) && n >= 0 && n <= 10 || "Must be 0-10";
|
|
9979
9979
|
}
|
|
9980
|
+
},
|
|
9981
|
+
{
|
|
9982
|
+
type: "list",
|
|
9983
|
+
name: "feePreference",
|
|
9984
|
+
message: "Fee preference (which token to receive fees in):",
|
|
9985
|
+
choices: [
|
|
9986
|
+
{ name: "Both tokens", value: "Both" },
|
|
9987
|
+
{ name: "Paired token only", value: "Paired" },
|
|
9988
|
+
{ name: "New token only", value: "Clanker" }
|
|
9989
|
+
],
|
|
9990
|
+
default: "Both"
|
|
9980
9991
|
}
|
|
9981
9992
|
]);
|
|
9982
9993
|
const ext = await inquirer.prompt([
|
|
@@ -10108,6 +10119,10 @@ function buildV4Config(f) {
|
|
|
10108
10119
|
vestingDuration: Number(f.airdropVestingDays || 0) * 24 * 60 * 60
|
|
10109
10120
|
};
|
|
10110
10121
|
}
|
|
10122
|
+
const feePreference = f.feePreference || "Both";
|
|
10123
|
+
const validFeePreference = ["Both", "Paired", "Clanker"].includes(
|
|
10124
|
+
feePreference
|
|
10125
|
+
) ? feePreference : "Both";
|
|
10111
10126
|
let rewardsConfig;
|
|
10112
10127
|
if (f.rewardRecipients && typeof f.rewardRecipients === "string") {
|
|
10113
10128
|
const parsed = JSON.parse(f.rewardRecipients);
|
|
@@ -10119,6 +10134,17 @@ function buildV4Config(f) {
|
|
|
10119
10134
|
token: r.token
|
|
10120
10135
|
}))
|
|
10121
10136
|
};
|
|
10137
|
+
} else if (validFeePreference !== "Both") {
|
|
10138
|
+
rewardsConfig = {
|
|
10139
|
+
recipients: [
|
|
10140
|
+
{
|
|
10141
|
+
admin: f.tokenAdmin || "0x0000000000000000000000000000000000000000",
|
|
10142
|
+
recipient: f.tokenAdmin || "0x0000000000000000000000000000000000000000",
|
|
10143
|
+
bps: 1e4,
|
|
10144
|
+
token: validFeePreference
|
|
10145
|
+
}
|
|
10146
|
+
]
|
|
10147
|
+
};
|
|
10122
10148
|
}
|
|
10123
10149
|
let sniperFeesConfig;
|
|
10124
10150
|
if (f.sniperStartingFee || f.sniperEndingFee || f.sniperDecaySeconds) {
|
|
@@ -10187,7 +10213,7 @@ function registerDeployCommand(program2) {
|
|
|
10187
10213
|
).option(
|
|
10188
10214
|
"--fee-config <type>",
|
|
10189
10215
|
"fee config: Static, Dynamic3 (or legacy StaticBasic, DynamicBasic)"
|
|
10190
|
-
).option("--static-fee-percent <n>", "static fee percentage (0-10, default 1)").option("--pool-positions <type>", "pool positions: Standard, Project, TwentyETH").option("--vault-percentage <n>", "vault percentage (0-90)").option("--vault-lockup-days <n>", "vault lockup in days (min 7)").option("--dev-buy-eth <amount>", "dev buy amount in ETH").option("--description <text>", "token description").option("--website <url>", "website URL").option("--twitter <url>", "twitter URL").option("--telegram <url>", "telegram URL").option("--farcaster <url>", "farcaster URL").option("--salt <hex>", "custom CREATE2 salt (0x-prefixed, skips vanity address)").option("--airdrop-csv <path>", "CSV file for airdrop (address,amount)").option("--airdrop-lockup-days <n>", "airdrop lockup in days (min 1)", "1").option("--airdrop-vesting-days <n>", "airdrop vesting in days", "0").option(
|
|
10216
|
+
).option("--static-fee-percent <n>", "static fee percentage (0-10, default 1)").option("--pool-positions <type>", "pool positions: Standard, Project, TwentyETH").option("--vault-percentage <n>", "vault percentage (0-90)").option("--vault-lockup-days <n>", "vault lockup in days (min 7)").option("--dev-buy-eth <amount>", "dev buy amount in ETH").option("--fee-preference <type>", "fee preference: Both, Paired, Clanker (default: Both)").option("--description <text>", "token description").option("--website <url>", "website URL").option("--twitter <url>", "twitter URL").option("--telegram <url>", "telegram URL").option("--farcaster <url>", "farcaster URL").option("--salt <hex>", "custom CREATE2 salt (0x-prefixed, skips vanity address)").option("--airdrop-csv <path>", "CSV file for airdrop (address,amount)").option("--airdrop-lockup-days <n>", "airdrop lockup in days (min 1)", "1").option("--airdrop-vesting-days <n>", "airdrop vesting in days", "0").option(
|
|
10191
10217
|
"--reward-recipients <json>",
|
|
10192
10218
|
"JSON array of reward recipients [{admin,recipient,bps,token}]"
|
|
10193
10219
|
).option("--sniper-starting-fee <n>", "sniper starting fee in unibps (default 666777)").option("--sniper-ending-fee <n>", "sniper ending fee in unibps (default 41673)").option("--sniper-decay-seconds <n>", "sniper fee decay duration in seconds (default 15)").action(async (_opts, command) => {
|
|
@@ -10233,6 +10259,13 @@ async function deployV4(opts, jsonMode) {
|
|
|
10233
10259
|
if (!tokenConfig.tokenAdmin) {
|
|
10234
10260
|
tokenConfig.tokenAdmin = walletClient.account.address;
|
|
10235
10261
|
}
|
|
10262
|
+
if (tokenConfig.rewards?.recipients) {
|
|
10263
|
+
const zero = "0x0000000000000000000000000000000000000000";
|
|
10264
|
+
for (const r of tokenConfig.rewards.recipients) {
|
|
10265
|
+
if (r.admin === zero) r.admin = tokenConfig.tokenAdmin;
|
|
10266
|
+
if (r.recipient === zero) r.recipient = tokenConfig.tokenAdmin;
|
|
10267
|
+
}
|
|
10268
|
+
}
|
|
10236
10269
|
const pool = tokenConfig.pool;
|
|
10237
10270
|
const positions = pool && "positions" in pool ? pool.positions : void 0;
|
|
10238
10271
|
if (!jsonMode) {
|
|
@@ -10248,6 +10281,7 @@ async function deployV4(opts, jsonMode) {
|
|
|
10248
10281
|
tickUpper: positions[positions.length - 1].tickUpper
|
|
10249
10282
|
} : {},
|
|
10250
10283
|
fees: tokenConfig.fees?.type === "static" ? `static ${tokenConfig.fees.clankerFee ? (tokenConfig.fees.clankerFee / 100).toFixed(1) : "1"}%` : `dynamic (up to ${tokenConfig.fees.maxFee ? (tokenConfig.fees.maxFee / 100).toFixed(0) : "?"}%)`,
|
|
10284
|
+
feePreference: tokenConfig.rewards?.recipients?.[0]?.token ?? "Both",
|
|
10251
10285
|
...tokenConfig.vault ? { vault: `${tokenConfig.vault.percentage}%` } : {},
|
|
10252
10286
|
...tokenConfig.devBuy ? { devBuy: `${tokenConfig.devBuy.ethAmount} ETH` } : {},
|
|
10253
10287
|
...tokenConfig.airdrop ? { airdrop: `${tokenConfig.airdrop.amount} tokens` } : {},
|
|
@@ -9495,6 +9495,17 @@ async function interactiveDeployV4(flags) {
|
|
|
9495
9495
|
const n = Number(v);
|
|
9496
9496
|
return !Number.isNaN(n) && n >= 0 && n <= 10 || "Must be 0-10";
|
|
9497
9497
|
}
|
|
9498
|
+
},
|
|
9499
|
+
{
|
|
9500
|
+
type: "list",
|
|
9501
|
+
name: "feePreference",
|
|
9502
|
+
message: "Fee preference (which token to receive fees in):",
|
|
9503
|
+
choices: [
|
|
9504
|
+
{ name: "Both tokens", value: "Both" },
|
|
9505
|
+
{ name: "Paired token only", value: "Paired" },
|
|
9506
|
+
{ name: "New token only", value: "Clanker" }
|
|
9507
|
+
],
|
|
9508
|
+
default: "Both"
|
|
9498
9509
|
}
|
|
9499
9510
|
]);
|
|
9500
9511
|
const ext = await inquirer.prompt([
|
|
@@ -9626,6 +9637,10 @@ function buildV4Config(f) {
|
|
|
9626
9637
|
vestingDuration: Number(f.airdropVestingDays || 0) * 24 * 60 * 60
|
|
9627
9638
|
};
|
|
9628
9639
|
}
|
|
9640
|
+
const feePreference = f.feePreference || "Both";
|
|
9641
|
+
const validFeePreference = ["Both", "Paired", "Clanker"].includes(
|
|
9642
|
+
feePreference
|
|
9643
|
+
) ? feePreference : "Both";
|
|
9629
9644
|
let rewardsConfig;
|
|
9630
9645
|
if (f.rewardRecipients && typeof f.rewardRecipients === "string") {
|
|
9631
9646
|
const parsed = JSON.parse(f.rewardRecipients);
|
|
@@ -9637,6 +9652,17 @@ function buildV4Config(f) {
|
|
|
9637
9652
|
token: r.token
|
|
9638
9653
|
}))
|
|
9639
9654
|
};
|
|
9655
|
+
} else if (validFeePreference !== "Both") {
|
|
9656
|
+
rewardsConfig = {
|
|
9657
|
+
recipients: [
|
|
9658
|
+
{
|
|
9659
|
+
admin: f.tokenAdmin || "0x0000000000000000000000000000000000000000",
|
|
9660
|
+
recipient: f.tokenAdmin || "0x0000000000000000000000000000000000000000",
|
|
9661
|
+
bps: 1e4,
|
|
9662
|
+
token: validFeePreference
|
|
9663
|
+
}
|
|
9664
|
+
]
|
|
9665
|
+
};
|
|
9640
9666
|
}
|
|
9641
9667
|
let sniperFeesConfig;
|
|
9642
9668
|
if (f.sniperStartingFee || f.sniperEndingFee || f.sniperDecaySeconds) {
|
|
@@ -9705,7 +9731,7 @@ function registerDeployCommand(program) {
|
|
|
9705
9731
|
).option(
|
|
9706
9732
|
"--fee-config <type>",
|
|
9707
9733
|
"fee config: Static, Dynamic3 (or legacy StaticBasic, DynamicBasic)"
|
|
9708
|
-
).option("--static-fee-percent <n>", "static fee percentage (0-10, default 1)").option("--pool-positions <type>", "pool positions: Standard, Project, TwentyETH").option("--vault-percentage <n>", "vault percentage (0-90)").option("--vault-lockup-days <n>", "vault lockup in days (min 7)").option("--dev-buy-eth <amount>", "dev buy amount in ETH").option("--description <text>", "token description").option("--website <url>", "website URL").option("--twitter <url>", "twitter URL").option("--telegram <url>", "telegram URL").option("--farcaster <url>", "farcaster URL").option("--salt <hex>", "custom CREATE2 salt (0x-prefixed, skips vanity address)").option("--airdrop-csv <path>", "CSV file for airdrop (address,amount)").option("--airdrop-lockup-days <n>", "airdrop lockup in days (min 1)", "1").option("--airdrop-vesting-days <n>", "airdrop vesting in days", "0").option(
|
|
9734
|
+
).option("--static-fee-percent <n>", "static fee percentage (0-10, default 1)").option("--pool-positions <type>", "pool positions: Standard, Project, TwentyETH").option("--vault-percentage <n>", "vault percentage (0-90)").option("--vault-lockup-days <n>", "vault lockup in days (min 7)").option("--dev-buy-eth <amount>", "dev buy amount in ETH").option("--fee-preference <type>", "fee preference: Both, Paired, Clanker (default: Both)").option("--description <text>", "token description").option("--website <url>", "website URL").option("--twitter <url>", "twitter URL").option("--telegram <url>", "telegram URL").option("--farcaster <url>", "farcaster URL").option("--salt <hex>", "custom CREATE2 salt (0x-prefixed, skips vanity address)").option("--airdrop-csv <path>", "CSV file for airdrop (address,amount)").option("--airdrop-lockup-days <n>", "airdrop lockup in days (min 1)", "1").option("--airdrop-vesting-days <n>", "airdrop vesting in days", "0").option(
|
|
9709
9735
|
"--reward-recipients <json>",
|
|
9710
9736
|
"JSON array of reward recipients [{admin,recipient,bps,token}]"
|
|
9711
9737
|
).option("--sniper-starting-fee <n>", "sniper starting fee in unibps (default 666777)").option("--sniper-ending-fee <n>", "sniper ending fee in unibps (default 41673)").option("--sniper-decay-seconds <n>", "sniper fee decay duration in seconds (default 15)").action(async (_opts, command) => {
|
|
@@ -9751,6 +9777,13 @@ async function deployV4(opts, jsonMode) {
|
|
|
9751
9777
|
if (!tokenConfig.tokenAdmin) {
|
|
9752
9778
|
tokenConfig.tokenAdmin = walletClient.account.address;
|
|
9753
9779
|
}
|
|
9780
|
+
if (tokenConfig.rewards?.recipients) {
|
|
9781
|
+
const zero = "0x0000000000000000000000000000000000000000";
|
|
9782
|
+
for (const r of tokenConfig.rewards.recipients) {
|
|
9783
|
+
if (r.admin === zero) r.admin = tokenConfig.tokenAdmin;
|
|
9784
|
+
if (r.recipient === zero) r.recipient = tokenConfig.tokenAdmin;
|
|
9785
|
+
}
|
|
9786
|
+
}
|
|
9754
9787
|
const pool = tokenConfig.pool;
|
|
9755
9788
|
const positions = pool && "positions" in pool ? pool.positions : void 0;
|
|
9756
9789
|
if (!jsonMode) {
|
|
@@ -9766,6 +9799,7 @@ async function deployV4(opts, jsonMode) {
|
|
|
9766
9799
|
tickUpper: positions[positions.length - 1].tickUpper
|
|
9767
9800
|
} : {},
|
|
9768
9801
|
fees: tokenConfig.fees?.type === "static" ? `static ${tokenConfig.fees.clankerFee ? (tokenConfig.fees.clankerFee / 100).toFixed(1) : "1"}%` : `dynamic (up to ${tokenConfig.fees.maxFee ? (tokenConfig.fees.maxFee / 100).toFixed(0) : "?"}%)`,
|
|
9802
|
+
feePreference: tokenConfig.rewards?.recipients?.[0]?.token ?? "Both",
|
|
9769
9803
|
...tokenConfig.vault ? { vault: `${tokenConfig.vault.percentage}%` } : {},
|
|
9770
9804
|
...tokenConfig.devBuy ? { devBuy: `${tokenConfig.devBuy.ethAmount} ETH` } : {},
|
|
9771
9805
|
...tokenConfig.airdrop ? { airdrop: `${tokenConfig.airdrop.amount} tokens` } : {},
|
package/dist/v3/index.d.ts
CHANGED
|
@@ -877,7 +877,7 @@ declare class Clanker {
|
|
|
877
877
|
}];
|
|
878
878
|
readonly stateMutability: "view";
|
|
879
879
|
readonly type: "function";
|
|
880
|
-
}], "
|
|
880
|
+
}], "claimRewards" | "deployToken" | "deployTokenWithCustomTeamRewardRecipient" | "deployTokenZeroSupply" | "initialize" | "renounceOwnership" | "setAdmin" | "setDeprecated" | "transferOwnership" | "updateLiquidityLocker" | "updateVault"> & {
|
|
881
881
|
error?: undefined;
|
|
882
882
|
}) | ({
|
|
883
883
|
result?: undefined;
|
|
@@ -4519,7 +4519,7 @@ declare class Clanker {
|
|
|
4519
4519
|
* @param requestorAddress Requestor for the deployment. Various admins will fall back to this.
|
|
4520
4520
|
* @returns Abi transaction
|
|
4521
4521
|
*/
|
|
4522
|
-
deploySimulate(token: ClankerTokenV3, account?: Account): Promise<(viem.SimulateContractReturnType<ClankerFactory, "
|
|
4522
|
+
deploySimulate(token: ClankerTokenV3, account?: Account): Promise<(viem.SimulateContractReturnType<ClankerFactory, "claimRewards" | "deployToken" | "deployTokenWithCustomTeamRewardRecipient" | "deployTokenZeroSupply" | "initialize" | "renounceOwnership" | "setAdmin" | "setDeprecated" | "transferOwnership" | "updateLiquidityLocker" | "updateVault" | "claimTeamFees" | "setExtension" | "setHook" | "setLocker" | "setMevModule" | "setTeamFeeRecipient"> & {
|
|
4523
4523
|
error?: undefined;
|
|
4524
4524
|
}) | ({
|
|
4525
4525
|
result?: undefined;
|
package/dist/v4/index.d.ts
CHANGED
|
@@ -332,7 +332,7 @@ declare class Clanker {
|
|
|
332
332
|
readonly outputs: readonly [];
|
|
333
333
|
readonly stateMutability: "nonpayable";
|
|
334
334
|
readonly type: "function";
|
|
335
|
-
}], "
|
|
335
|
+
}], "renounceOwnership" | "transferOwnership" | "claim" | "addDepositor" | "storeFees"> & {
|
|
336
336
|
error?: undefined;
|
|
337
337
|
}) | ({
|
|
338
338
|
result?: undefined;
|
|
@@ -1507,7 +1507,7 @@ declare class Clanker {
|
|
|
1507
1507
|
* @param account Optional account for the deployer
|
|
1508
1508
|
* @returns Abi transaction
|
|
1509
1509
|
*/
|
|
1510
|
-
deploySimulate(token: ClankerTokenV4, account?: Account): Promise<(viem.SimulateContractReturnType<ClankerFactory, "
|
|
1510
|
+
deploySimulate(token: ClankerTokenV4, account?: Account): Promise<(viem.SimulateContractReturnType<ClankerFactory, "claimRewards" | "deployToken" | "deployTokenWithCustomTeamRewardRecipient" | "deployTokenZeroSupply" | "initialize" | "renounceOwnership" | "setAdmin" | "setDeprecated" | "transferOwnership" | "updateLiquidityLocker" | "updateVault" | "claimTeamFees" | "setExtension" | "setHook" | "setLocker" | "setMevModule" | "setTeamFeeRecipient"> & {
|
|
1511
1511
|
error?: undefined;
|
|
1512
1512
|
}) | ({
|
|
1513
1513
|
result?: undefined;
|