clanker-sdk 4.0.18 → 4.0.20

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 CHANGED
@@ -883,7 +883,7 @@ var init_Clanker = __esm({
883
883
 
884
884
  // src/constants.ts
885
885
  import { base, baseSepolia } from "viem/chains";
886
- var CLANKER_FACTORY_V3_1, WETH_ADDRESS, DEGEN_ADDRESS, NATIVE_ADDRESS, CLANKER_ADDRESS, ANON_ADDRESS, HIGHER_ADDRESS, CB_BTC_ADDRESS, A0X_ADDRESS, SUPPORTED_CHAINS, DEFAULT_SUPPLY, CLANKER_FACTORY_V4, CLANKER_LOCKER_V4, CLANKER_VAULT_V4, CLANKER_AIRDROP_V4, CLANKER_DEVBUY_V4, CLANKER_MEV_MODULE_V4, CLANKER_HOOK_STATIC_FEE_V4, CLANKER_HOOK_DYNAMIC_FEE_V4;
886
+ var CLANKER_FACTORY_V3_1, WETH_ADDRESS, DEGEN_ADDRESS, NATIVE_ADDRESS, CLANKER_ADDRESS, ANON_ADDRESS, HIGHER_ADDRESS, CB_BTC_ADDRESS, A0X_ADDRESS, SUPPORTED_CHAINS, DEFAULT_SUPPLY, CLANKER_FACTORY_V4, CLANKER_FEE_LOCKER_V4, CLANKER_LOCKER_V4, CLANKER_VAULT_V4, CLANKER_AIRDROP_V4, CLANKER_DEVBUY_V4, CLANKER_MEV_MODULE_V4, CLANKER_HOOK_STATIC_FEE_V4, CLANKER_HOOK_DYNAMIC_FEE_V4;
887
887
  var init_constants = __esm({
888
888
  "src/constants.ts"() {
889
889
  "use strict";
@@ -900,6 +900,7 @@ var init_constants = __esm({
900
900
  SUPPORTED_CHAINS = [base.id, baseSepolia.id];
901
901
  DEFAULT_SUPPLY = 100000000000000000000000000000n;
902
902
  CLANKER_FACTORY_V4 = "0xE85A59c628F7d27878ACeB4bf3b35733630083a9";
903
+ CLANKER_FEE_LOCKER_V4 = "0xF3622742b1E446D92e45E22923Ef11C2fcD55D68";
903
904
  CLANKER_LOCKER_V4 = "0x29d17C1A8D851d7d4cA97FAe97AcAdb398D9cCE0";
904
905
  CLANKER_VAULT_V4 = "0x8E845EAd15737bF71904A30BdDD3aEE76d6ADF6C";
905
906
  CLANKER_AIRDROP_V4 = "0x56Fa0Da89eD94822e46734e736d34Cab72dF344F";
@@ -4887,6 +4888,10 @@ function buildTokenV4(cfg, chainId, salt) {
4887
4888
  if (cfg.poolConfig.positions.length === 0) {
4888
4889
  throw new Error("Pool configuration must have at least one position");
4889
4890
  }
4891
+ const found = cfg.poolConfig.positions.some((position) => position.tickLower === cfg.poolConfig.tickIfToken0IsClanker);
4892
+ if (!found) {
4893
+ throw new Error("Starting price must have a lower tick position that touches it, please check that your positions align with the starting price.");
4894
+ }
4890
4895
  const deploymentConfig = {
4891
4896
  tokenConfig: {
4892
4897
  tokenAdmin: cfg.tokenAdmin,
@@ -5100,6 +5105,216 @@ var init_v4 = __esm({
5100
5105
  }
5101
5106
  });
5102
5107
 
5108
+ // src/abi/ClankerFeeLocker.ts
5109
+ var ClankerFeeLocker_abi;
5110
+ var init_ClankerFeeLocker = __esm({
5111
+ "src/abi/ClankerFeeLocker.ts"() {
5112
+ "use strict";
5113
+ init_esm_shims();
5114
+ ClankerFeeLocker_abi = [
5115
+ {
5116
+ inputs: [{ internalType: "address", name: "owner_", type: "address" }],
5117
+ stateMutability: "nonpayable",
5118
+ type: "constructor"
5119
+ },
5120
+ { inputs: [], name: "NoFeesToClaim", type: "error" },
5121
+ {
5122
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
5123
+ name: "OwnableInvalidOwner",
5124
+ type: "error"
5125
+ },
5126
+ {
5127
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
5128
+ name: "OwnableUnauthorizedAccount",
5129
+ type: "error"
5130
+ },
5131
+ { inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
5132
+ {
5133
+ inputs: [{ internalType: "address", name: "token", type: "address" }],
5134
+ name: "SafeERC20FailedOperation",
5135
+ type: "error"
5136
+ },
5137
+ { inputs: [], name: "Unauthorized", type: "error" },
5138
+ {
5139
+ anonymous: false,
5140
+ inputs: [{ indexed: true, internalType: "address", name: "depositor", type: "address" }],
5141
+ name: "AddDepositor",
5142
+ type: "event"
5143
+ },
5144
+ {
5145
+ anonymous: false,
5146
+ inputs: [
5147
+ { indexed: true, internalType: "address", name: "feeOwner", type: "address" },
5148
+ { indexed: true, internalType: "address", name: "token", type: "address" },
5149
+ { indexed: false, internalType: "uint256", name: "amountClaimed", type: "uint256" }
5150
+ ],
5151
+ name: "ClaimTokens",
5152
+ type: "event"
5153
+ },
5154
+ {
5155
+ anonymous: false,
5156
+ inputs: [
5157
+ { indexed: true, internalType: "address", name: "feeOwner", type: "address" },
5158
+ { indexed: true, internalType: "address", name: "token", type: "address" },
5159
+ { indexed: false, internalType: "address", name: "recipient", type: "address" },
5160
+ { indexed: false, internalType: "uint256", name: "amountClaimed", type: "uint256" }
5161
+ ],
5162
+ name: "ClaimTokensPermissioned",
5163
+ type: "event"
5164
+ },
5165
+ {
5166
+ anonymous: false,
5167
+ inputs: [
5168
+ { indexed: true, internalType: "address", name: "previousOwner", type: "address" },
5169
+ { indexed: true, internalType: "address", name: "newOwner", type: "address" }
5170
+ ],
5171
+ name: "OwnershipTransferred",
5172
+ type: "event"
5173
+ },
5174
+ {
5175
+ anonymous: false,
5176
+ inputs: [
5177
+ { indexed: true, internalType: "address", name: "sender", type: "address" },
5178
+ { indexed: true, internalType: "address", name: "feeOwner", type: "address" },
5179
+ { indexed: true, internalType: "address", name: "token", type: "address" },
5180
+ { indexed: false, internalType: "uint256", name: "balance", type: "uint256" },
5181
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }
5182
+ ],
5183
+ name: "StoreTokens",
5184
+ type: "event"
5185
+ },
5186
+ {
5187
+ inputs: [{ internalType: "address", name: "depositor", type: "address" }],
5188
+ name: "addDepositor",
5189
+ outputs: [],
5190
+ stateMutability: "nonpayable",
5191
+ type: "function"
5192
+ },
5193
+ {
5194
+ inputs: [{ internalType: "address", name: "depositor", type: "address" }],
5195
+ name: "allowedDepositors",
5196
+ outputs: [{ internalType: "bool", name: "isAllowed", type: "bool" }],
5197
+ stateMutability: "view",
5198
+ type: "function"
5199
+ },
5200
+ {
5201
+ inputs: [
5202
+ { internalType: "address", name: "feeOwner", type: "address" },
5203
+ { internalType: "address", name: "token", type: "address" }
5204
+ ],
5205
+ name: "availableFees",
5206
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
5207
+ stateMutability: "view",
5208
+ type: "function"
5209
+ },
5210
+ {
5211
+ inputs: [
5212
+ { internalType: "address", name: "feeOwner", type: "address" },
5213
+ { internalType: "address", name: "token", type: "address" }
5214
+ ],
5215
+ name: "claim",
5216
+ outputs: [],
5217
+ stateMutability: "nonpayable",
5218
+ type: "function"
5219
+ },
5220
+ {
5221
+ inputs: [
5222
+ { internalType: "address", name: "feeOwner", type: "address" },
5223
+ { internalType: "address", name: "token", type: "address" }
5224
+ ],
5225
+ name: "feesToClaim",
5226
+ outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }],
5227
+ stateMutability: "view",
5228
+ type: "function"
5229
+ },
5230
+ {
5231
+ inputs: [],
5232
+ name: "owner",
5233
+ outputs: [{ internalType: "address", name: "", type: "address" }],
5234
+ stateMutability: "view",
5235
+ type: "function"
5236
+ },
5237
+ {
5238
+ inputs: [],
5239
+ name: "renounceOwnership",
5240
+ outputs: [],
5241
+ stateMutability: "nonpayable",
5242
+ type: "function"
5243
+ },
5244
+ {
5245
+ inputs: [
5246
+ { internalType: "address", name: "feeOwner", type: "address" },
5247
+ { internalType: "address", name: "token", type: "address" },
5248
+ { internalType: "uint256", name: "amount", type: "uint256" }
5249
+ ],
5250
+ name: "storeFees",
5251
+ outputs: [],
5252
+ stateMutability: "nonpayable",
5253
+ type: "function"
5254
+ },
5255
+ {
5256
+ inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
5257
+ name: "supportsInterface",
5258
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
5259
+ stateMutability: "pure",
5260
+ type: "function"
5261
+ },
5262
+ {
5263
+ inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
5264
+ name: "transferOwnership",
5265
+ outputs: [],
5266
+ stateMutability: "nonpayable",
5267
+ type: "function"
5268
+ }
5269
+ ];
5270
+ }
5271
+ });
5272
+
5273
+ // src/fees/claim.ts
5274
+ import { encodeFunctionData as encodeFunctionData3 } from "viem";
5275
+ var claimRewards;
5276
+ var init_claim = __esm({
5277
+ "src/fees/claim.ts"() {
5278
+ "use strict";
5279
+ init_esm_shims();
5280
+ init_ClankerFeeLocker();
5281
+ init_constants();
5282
+ claimRewards = (feeOwnerAddress, tokenAddress) => {
5283
+ const claimRewardsCalldata = encodeFunctionData3({
5284
+ abi: ClankerFeeLocker_abi,
5285
+ functionName: "claim",
5286
+ args: [feeOwnerAddress, tokenAddress]
5287
+ });
5288
+ return {
5289
+ transaction: {
5290
+ to: CLANKER_FEE_LOCKER_V4,
5291
+ data: claimRewardsCalldata
5292
+ }
5293
+ };
5294
+ };
5295
+ }
5296
+ });
5297
+
5298
+ // src/fees/availableFees.ts
5299
+ var availableFees;
5300
+ var init_availableFees = __esm({
5301
+ "src/fees/availableFees.ts"() {
5302
+ "use strict";
5303
+ init_esm_shims();
5304
+ init_ClankerFeeLocker();
5305
+ init_constants();
5306
+ availableFees = async (publicClient, feeOwnerAddress, tokenAddress) => {
5307
+ const availableFees2 = await publicClient.readContract({
5308
+ address: CLANKER_FEE_LOCKER_V4,
5309
+ abi: ClankerFeeLocker_abi,
5310
+ functionName: "availableFees",
5311
+ args: [feeOwnerAddress, tokenAddress]
5312
+ });
5313
+ return availableFees2;
5314
+ };
5315
+ }
5316
+ });
5317
+
5103
5318
  // src/types/token.ts
5104
5319
  var init_token = __esm({
5105
5320
  "src/types/token.ts"() {
@@ -5209,6 +5424,8 @@ var init_index = __esm({
5209
5424
  init_validation();
5210
5425
  init_v3();
5211
5426
  init_v4();
5427
+ init_claim();
5428
+ init_availableFees();
5212
5429
  init_types();
5213
5430
  init_validation();
5214
5431
  init_vanityAddress();
@@ -5236,6 +5453,28 @@ var init_index = __esm({
5236
5453
  this.publicClient = config2.publicClient;
5237
5454
  }
5238
5455
  }
5456
+ /**
5457
+ * Collects rewards from a token
5458
+ * @param tokenAddress - The address of the token to collect rewards from
5459
+ * @returns Promise resolving to the transaction hash
5460
+ * @throws {Error} If wallet client or public client is not configured
5461
+ */
5462
+ claimRewards(feeOwnerAddress, tokenAddress) {
5463
+ return claimRewards(feeOwnerAddress, tokenAddress);
5464
+ }
5465
+ /**
5466
+ * Checks the available fees for a token
5467
+ * @param feeOwnerAddress - The address of the fee owner
5468
+ * @param tokenAddress - The address of the token to check fees for
5469
+ * @returns Promise resolving to the transaction hash
5470
+ * @throws {Error} If wallet client or public client is not configured
5471
+ */
5472
+ async availableFees(feeOwnerAddress, tokenAddress) {
5473
+ if (!this.publicClient) {
5474
+ throw new Error("Public client required for checking available fees");
5475
+ }
5476
+ return availableFees(this.publicClient, feeOwnerAddress, tokenAddress);
5477
+ }
5239
5478
  /**
5240
5479
  * Builds V4 token deployment data without actually deploying
5241
5480
  * @param cfg - Token configuration for V4 deployment
@@ -864,6 +864,7 @@ var A0X_ADDRESS = "0x820C5F0fB255a1D18fd0eBB0F1CCefbC4D546dA7";
864
864
  var SUPPORTED_CHAINS = [base.id, baseSepolia.id];
865
865
  var DEFAULT_SUPPLY = 100000000000000000000000000000n;
866
866
  var CLANKER_FACTORY_V4 = "0xE85A59c628F7d27878ACeB4bf3b35733630083a9";
867
+ var CLANKER_FEE_LOCKER_V4 = "0xF3622742b1E446D92e45E22923Ef11C2fcD55D68";
867
868
  var CLANKER_LOCKER_V4 = "0x29d17C1A8D851d7d4cA97FAe97AcAdb398D9cCE0";
868
869
  var CLANKER_VAULT_V4 = "0x8E845EAd15737bF71904A30BdDD3aEE76d6ADF6C";
869
870
  var CLANKER_AIRDROP_V4 = "0x56Fa0Da89eD94822e46734e736d34Cab72dF344F";
@@ -4772,6 +4773,10 @@ function buildTokenV4(cfg, chainId, salt) {
4772
4773
  if (cfg.poolConfig.positions.length === 0) {
4773
4774
  throw new Error("Pool configuration must have at least one position");
4774
4775
  }
4776
+ const found = cfg.poolConfig.positions.some((position) => position.tickLower === cfg.poolConfig.tickIfToken0IsClanker);
4777
+ if (!found) {
4778
+ throw new Error("Starting price must have a lower tick position that touches it, please check that your positions align with the starting price.");
4779
+ }
4775
4780
  const deploymentConfig = {
4776
4781
  tokenConfig: {
4777
4782
  tokenAdmin: cfg.tokenAdmin,
@@ -4935,6 +4940,191 @@ async function deployTokenV4(cfg, wallet, publicClient) {
4935
4940
  return log.args.tokenAddress;
4936
4941
  }
4937
4942
 
4943
+ // src/abi/ClankerFeeLocker.ts
4944
+ var ClankerFeeLocker_abi = [
4945
+ {
4946
+ inputs: [{ internalType: "address", name: "owner_", type: "address" }],
4947
+ stateMutability: "nonpayable",
4948
+ type: "constructor"
4949
+ },
4950
+ { inputs: [], name: "NoFeesToClaim", type: "error" },
4951
+ {
4952
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
4953
+ name: "OwnableInvalidOwner",
4954
+ type: "error"
4955
+ },
4956
+ {
4957
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
4958
+ name: "OwnableUnauthorizedAccount",
4959
+ type: "error"
4960
+ },
4961
+ { inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
4962
+ {
4963
+ inputs: [{ internalType: "address", name: "token", type: "address" }],
4964
+ name: "SafeERC20FailedOperation",
4965
+ type: "error"
4966
+ },
4967
+ { inputs: [], name: "Unauthorized", type: "error" },
4968
+ {
4969
+ anonymous: false,
4970
+ inputs: [{ indexed: true, internalType: "address", name: "depositor", type: "address" }],
4971
+ name: "AddDepositor",
4972
+ type: "event"
4973
+ },
4974
+ {
4975
+ anonymous: false,
4976
+ inputs: [
4977
+ { indexed: true, internalType: "address", name: "feeOwner", type: "address" },
4978
+ { indexed: true, internalType: "address", name: "token", type: "address" },
4979
+ { indexed: false, internalType: "uint256", name: "amountClaimed", type: "uint256" }
4980
+ ],
4981
+ name: "ClaimTokens",
4982
+ type: "event"
4983
+ },
4984
+ {
4985
+ anonymous: false,
4986
+ inputs: [
4987
+ { indexed: true, internalType: "address", name: "feeOwner", type: "address" },
4988
+ { indexed: true, internalType: "address", name: "token", type: "address" },
4989
+ { indexed: false, internalType: "address", name: "recipient", type: "address" },
4990
+ { indexed: false, internalType: "uint256", name: "amountClaimed", type: "uint256" }
4991
+ ],
4992
+ name: "ClaimTokensPermissioned",
4993
+ type: "event"
4994
+ },
4995
+ {
4996
+ anonymous: false,
4997
+ inputs: [
4998
+ { indexed: true, internalType: "address", name: "previousOwner", type: "address" },
4999
+ { indexed: true, internalType: "address", name: "newOwner", type: "address" }
5000
+ ],
5001
+ name: "OwnershipTransferred",
5002
+ type: "event"
5003
+ },
5004
+ {
5005
+ anonymous: false,
5006
+ inputs: [
5007
+ { indexed: true, internalType: "address", name: "sender", type: "address" },
5008
+ { indexed: true, internalType: "address", name: "feeOwner", type: "address" },
5009
+ { indexed: true, internalType: "address", name: "token", type: "address" },
5010
+ { indexed: false, internalType: "uint256", name: "balance", type: "uint256" },
5011
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }
5012
+ ],
5013
+ name: "StoreTokens",
5014
+ type: "event"
5015
+ },
5016
+ {
5017
+ inputs: [{ internalType: "address", name: "depositor", type: "address" }],
5018
+ name: "addDepositor",
5019
+ outputs: [],
5020
+ stateMutability: "nonpayable",
5021
+ type: "function"
5022
+ },
5023
+ {
5024
+ inputs: [{ internalType: "address", name: "depositor", type: "address" }],
5025
+ name: "allowedDepositors",
5026
+ outputs: [{ internalType: "bool", name: "isAllowed", type: "bool" }],
5027
+ stateMutability: "view",
5028
+ type: "function"
5029
+ },
5030
+ {
5031
+ inputs: [
5032
+ { internalType: "address", name: "feeOwner", type: "address" },
5033
+ { internalType: "address", name: "token", type: "address" }
5034
+ ],
5035
+ name: "availableFees",
5036
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
5037
+ stateMutability: "view",
5038
+ type: "function"
5039
+ },
5040
+ {
5041
+ inputs: [
5042
+ { internalType: "address", name: "feeOwner", type: "address" },
5043
+ { internalType: "address", name: "token", type: "address" }
5044
+ ],
5045
+ name: "claim",
5046
+ outputs: [],
5047
+ stateMutability: "nonpayable",
5048
+ type: "function"
5049
+ },
5050
+ {
5051
+ inputs: [
5052
+ { internalType: "address", name: "feeOwner", type: "address" },
5053
+ { internalType: "address", name: "token", type: "address" }
5054
+ ],
5055
+ name: "feesToClaim",
5056
+ outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }],
5057
+ stateMutability: "view",
5058
+ type: "function"
5059
+ },
5060
+ {
5061
+ inputs: [],
5062
+ name: "owner",
5063
+ outputs: [{ internalType: "address", name: "", type: "address" }],
5064
+ stateMutability: "view",
5065
+ type: "function"
5066
+ },
5067
+ {
5068
+ inputs: [],
5069
+ name: "renounceOwnership",
5070
+ outputs: [],
5071
+ stateMutability: "nonpayable",
5072
+ type: "function"
5073
+ },
5074
+ {
5075
+ inputs: [
5076
+ { internalType: "address", name: "feeOwner", type: "address" },
5077
+ { internalType: "address", name: "token", type: "address" },
5078
+ { internalType: "uint256", name: "amount", type: "uint256" }
5079
+ ],
5080
+ name: "storeFees",
5081
+ outputs: [],
5082
+ stateMutability: "nonpayable",
5083
+ type: "function"
5084
+ },
5085
+ {
5086
+ inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
5087
+ name: "supportsInterface",
5088
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
5089
+ stateMutability: "pure",
5090
+ type: "function"
5091
+ },
5092
+ {
5093
+ inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
5094
+ name: "transferOwnership",
5095
+ outputs: [],
5096
+ stateMutability: "nonpayable",
5097
+ type: "function"
5098
+ }
5099
+ ];
5100
+
5101
+ // src/fees/claim.ts
5102
+ import { encodeFunctionData as encodeFunctionData3 } from "viem";
5103
+ var claimRewards = (feeOwnerAddress, tokenAddress) => {
5104
+ const claimRewardsCalldata = encodeFunctionData3({
5105
+ abi: ClankerFeeLocker_abi,
5106
+ functionName: "claim",
5107
+ args: [feeOwnerAddress, tokenAddress]
5108
+ });
5109
+ return {
5110
+ transaction: {
5111
+ to: CLANKER_FEE_LOCKER_V4,
5112
+ data: claimRewardsCalldata
5113
+ }
5114
+ };
5115
+ };
5116
+
5117
+ // src/fees/availableFees.ts
5118
+ var availableFees = async (publicClient, feeOwnerAddress, tokenAddress) => {
5119
+ const availableFees2 = await publicClient.readContract({
5120
+ address: CLANKER_FEE_LOCKER_V4,
5121
+ abi: ClankerFeeLocker_abi,
5122
+ functionName: "availableFees",
5123
+ args: [feeOwnerAddress, tokenAddress]
5124
+ });
5125
+ return availableFees2;
5126
+ };
5127
+
4938
5128
  // src/extensions/VaultExtension.ts
4939
5129
  import { encodeAbiParameters as encodeAbiParameters3 } from "viem";
4940
5130
 
@@ -4969,6 +5159,28 @@ var Clanker = class {
4969
5159
  this.publicClient = config2.publicClient;
4970
5160
  }
4971
5161
  }
5162
+ /**
5163
+ * Collects rewards from a token
5164
+ * @param tokenAddress - The address of the token to collect rewards from
5165
+ * @returns Promise resolving to the transaction hash
5166
+ * @throws {Error} If wallet client or public client is not configured
5167
+ */
5168
+ claimRewards(feeOwnerAddress, tokenAddress) {
5169
+ return claimRewards(feeOwnerAddress, tokenAddress);
5170
+ }
5171
+ /**
5172
+ * Checks the available fees for a token
5173
+ * @param feeOwnerAddress - The address of the fee owner
5174
+ * @param tokenAddress - The address of the token to check fees for
5175
+ * @returns Promise resolving to the transaction hash
5176
+ * @throws {Error} If wallet client or public client is not configured
5177
+ */
5178
+ async availableFees(feeOwnerAddress, tokenAddress) {
5179
+ if (!this.publicClient) {
5180
+ throw new Error("Public client required for checking available fees");
5181
+ }
5182
+ return availableFees(this.publicClient, feeOwnerAddress, tokenAddress);
5183
+ }
4972
5184
  /**
4973
5185
  * Builds V4 token deployment data without actually deploying
4974
5186
  * @param cfg - Token configuration for V4 deployment
package/dist/index.d.ts CHANGED
@@ -2835,6 +2835,7 @@ declare const VALID_TOKEN_PAIR_ADDRESS: [
2835
2835
  typeof A0X_ADDRESS
2836
2836
  ];
2837
2837
  declare const CLANKER_FACTORY_V4: `0x${string}`;
2838
+ declare const CLANKER_FEE_LOCKER_V4: `0x${string}`;
2838
2839
  declare const CLANKER_LOCKER_V4: `0x${string}`;
2839
2840
  declare const CLANKER_VAULT_V4: `0x${string}`;
2840
2841
  declare const CLANKER_AIRDROP_V4: `0x${string}`;
@@ -2855,8 +2856,7 @@ declare enum PoolPositions {
2855
2856
  Project = "Project"
2856
2857
  }
2857
2858
  declare enum FeeConfigs {
2858
- DynamicBasic = "DynamicBasic",
2859
- DynamicAggressive = "DynamicAggressive"
2859
+ DynamicBasic = "DynamicBasic"
2860
2860
  }
2861
2861
  declare const POOL_POSITIONS: {
2862
2862
  readonly Standard: readonly [{
@@ -2896,15 +2896,6 @@ declare const FEE_CONFIGS: {
2896
2896
  readonly feeControlNumerator: 100000;
2897
2897
  readonly decayFilterBps: 7500;
2898
2898
  };
2899
- readonly DynamicAggressive: {
2900
- readonly baseFee: 10000;
2901
- readonly maxLpFee: 100000;
2902
- readonly referenceTickFilterPeriod: 20;
2903
- readonly resetPeriod: 300;
2904
- readonly resetTickFilter: 200;
2905
- readonly feeControlNumerator: 125000;
2906
- readonly decayFilterBps: 5000;
2907
- };
2908
2899
  };
2909
2900
 
2910
2901
  interface IClankerExtension {
@@ -3134,6 +3125,26 @@ declare class Clanker {
3134
3125
  * @throws {Error} If the provided configuration is invalid
3135
3126
  */
3136
3127
  constructor(config?: ClankerConfig);
3128
+ /**
3129
+ * Collects rewards from a token
3130
+ * @param tokenAddress - The address of the token to collect rewards from
3131
+ * @returns Promise resolving to the transaction hash
3132
+ * @throws {Error} If wallet client or public client is not configured
3133
+ */
3134
+ claimRewards(feeOwnerAddress: `0x${string}`, tokenAddress: `0x${string}`): {
3135
+ transaction: {
3136
+ to: `0x${string}`;
3137
+ data: `0x${string}`;
3138
+ };
3139
+ };
3140
+ /**
3141
+ * Checks the available fees for a token
3142
+ * @param feeOwnerAddress - The address of the fee owner
3143
+ * @param tokenAddress - The address of the token to check fees for
3144
+ * @returns Promise resolving to the transaction hash
3145
+ * @throws {Error} If wallet client or public client is not configured
3146
+ */
3147
+ availableFees(feeOwnerAddress: `0x${string}`, tokenAddress: `0x${string}`): Promise<unknown>;
3137
3148
  /**
3138
3149
  * Builds V4 token deployment data without actually deploying
3139
3150
  * @param cfg - Token configuration for V4 deployment
@@ -3162,4 +3173,4 @@ declare class Clanker {
3162
3173
  deployToken(cfg: TokenConfig): Promise<`0x${string}`>;
3163
3174
  }
3164
3175
 
3165
- export { A0X_ADDRESS, ANON_ADDRESS, type AirdropConfig, type AirdropEntry, AirdropExtension, type BuildV4Result, CB_BTC_ADDRESS, CLANKER_ADDRESS, CLANKER_AIRDROP_ADDRESS_SEPOLIA, CLANKER_AIRDROP_V4, CLANKER_DEVBUY_ADDRESS_SEPOLIA, CLANKER_DEVBUY_V4, CLANKER_FACTORY_V2, CLANKER_FACTORY_V3, CLANKER_FACTORY_V3_1, CLANKER_FACTORY_V4, CLANKER_FACTORY_V4_SEPOLIA, CLANKER_HOOK_DYNAMIC_FEE_ADDRESS_SEPOLIA, CLANKER_HOOK_DYNAMIC_FEE_V4, CLANKER_HOOK_STATIC_FEE_ADDRESS_SEPOLIA, CLANKER_HOOK_STATIC_FEE_V4, CLANKER_LOCKER_V4, CLANKER_LOCKER_V4_SEPOLIA, CLANKER_MEV_MODULE_ADDRESS_SEPOLIA, CLANKER_MEV_MODULE_V4, CLANKER_VAULT_ADDRESS_SEPOLIA, CLANKER_VAULT_V3_1, CLANKER_VAULT_V4, Clanker, type ClankerConfig, type ClankerMetadata, type ClankerSocialContext, DEFAULT_BASE_RPC, DEFAULT_SUPPLY, DEGEN_ADDRESS, type DeployFormData, type DeploymentConfigV4, type DevBuyConfig, type DevBuyExtensionDataV4, type DevBuyPoolKeyConfig, type ExtensionConfigV4, FEE_CONFIGS, FeeConfigs, HIGHER_ADDRESS, type IClankerDeployConfig, INTERFACE_ADMIN_ADDRESS, INTERFACE_REWARD_RECIPIENT_ADDRESS, type IPoolConfig, type ITokenData, LP_LOCKER_V2, LP_LOCKER_V3, LP_LOCKER_V3_1, type LockerConfigV4, type MevModuleConfigV4, NATIVE_ADDRESS, POOL_POSITIONS, type PoolConfig, type PoolConfigV4, PoolPositions, type RewardRecipient, type RewardsConfig, type RewardsConfigV4, SUPPORTED_CHAINS, type TokenConfig, type TokenConfigV4, TokenConfigV4Builder, type TokenPair, VALID_TOKEN_PAIRS, VALID_TOKEN_PAIR_ADDRESS, VALID_TOKEN_PAIR_ADDRESSES, type VaultConfig, type VaultConfigV4, WETH_ADDRESS, type ZodClankerConfig, type ZodDeploymentConfig, type ZodInitialBuyConfig, type ZodPoolConfig, type ZodRewardsConfig, type ZodTokenConfig, type ZodVaultConfig, bpsToPercentage, clankerConfigSchema, createMerkleTree, deploymentConfigSchema, encodeAirdropData, findVanityAddress, findVanityAddressV4, getMerkleProof, initialBuyConfigSchema, isInRange, isValidBps, percentageToBps, poolConfigSchema, rewardsConfigSchema, tokenConfigSchema, validateBpsSum, validateConfig, vaultConfigSchema };
3176
+ export { A0X_ADDRESS, ANON_ADDRESS, type AirdropConfig, type AirdropEntry, AirdropExtension, type BuildV4Result, CB_BTC_ADDRESS, CLANKER_ADDRESS, CLANKER_AIRDROP_ADDRESS_SEPOLIA, CLANKER_AIRDROP_V4, CLANKER_DEVBUY_ADDRESS_SEPOLIA, CLANKER_DEVBUY_V4, CLANKER_FACTORY_V2, CLANKER_FACTORY_V3, CLANKER_FACTORY_V3_1, CLANKER_FACTORY_V4, CLANKER_FACTORY_V4_SEPOLIA, CLANKER_FEE_LOCKER_V4, CLANKER_HOOK_DYNAMIC_FEE_ADDRESS_SEPOLIA, CLANKER_HOOK_DYNAMIC_FEE_V4, CLANKER_HOOK_STATIC_FEE_ADDRESS_SEPOLIA, CLANKER_HOOK_STATIC_FEE_V4, CLANKER_LOCKER_V4, CLANKER_LOCKER_V4_SEPOLIA, CLANKER_MEV_MODULE_ADDRESS_SEPOLIA, CLANKER_MEV_MODULE_V4, CLANKER_VAULT_ADDRESS_SEPOLIA, CLANKER_VAULT_V3_1, CLANKER_VAULT_V4, Clanker, type ClankerConfig, type ClankerMetadata, type ClankerSocialContext, DEFAULT_BASE_RPC, DEFAULT_SUPPLY, DEGEN_ADDRESS, type DeployFormData, type DeploymentConfigV4, type DevBuyConfig, type DevBuyExtensionDataV4, type DevBuyPoolKeyConfig, type ExtensionConfigV4, FEE_CONFIGS, FeeConfigs, HIGHER_ADDRESS, type IClankerDeployConfig, INTERFACE_ADMIN_ADDRESS, INTERFACE_REWARD_RECIPIENT_ADDRESS, type IPoolConfig, type ITokenData, LP_LOCKER_V2, LP_LOCKER_V3, LP_LOCKER_V3_1, type LockerConfigV4, type MevModuleConfigV4, NATIVE_ADDRESS, POOL_POSITIONS, type PoolConfig, type PoolConfigV4, PoolPositions, type RewardRecipient, type RewardsConfig, type RewardsConfigV4, SUPPORTED_CHAINS, type TokenConfig, type TokenConfigV4, TokenConfigV4Builder, type TokenPair, VALID_TOKEN_PAIRS, VALID_TOKEN_PAIR_ADDRESS, VALID_TOKEN_PAIR_ADDRESSES, type VaultConfig, type VaultConfigV4, WETH_ADDRESS, type ZodClankerConfig, type ZodDeploymentConfig, type ZodInitialBuyConfig, type ZodPoolConfig, type ZodRewardsConfig, type ZodTokenConfig, type ZodVaultConfig, bpsToPercentage, clankerConfigSchema, createMerkleTree, deploymentConfigSchema, encodeAirdropData, findVanityAddress, findVanityAddressV4, getMerkleProof, initialBuyConfigSchema, isInRange, isValidBps, percentageToBps, poolConfigSchema, rewardsConfigSchema, tokenConfigSchema, validateBpsSum, validateConfig, vaultConfigSchema };
package/dist/index.js CHANGED
@@ -880,6 +880,7 @@ var VALID_TOKEN_PAIR_ADDRESS = [
880
880
  A0X_ADDRESS
881
881
  ];
882
882
  var CLANKER_FACTORY_V4 = "0xE85A59c628F7d27878ACeB4bf3b35733630083a9";
883
+ var CLANKER_FEE_LOCKER_V4 = "0xF3622742b1E446D92e45E22923Ef11C2fcD55D68";
883
884
  var CLANKER_LOCKER_V4 = "0x29d17C1A8D851d7d4cA97FAe97AcAdb398D9cCE0";
884
885
  var CLANKER_VAULT_V4 = "0x8E845EAd15737bF71904A30BdDD3aEE76d6ADF6C";
885
886
  var CLANKER_AIRDROP_V4 = "0x56Fa0Da89eD94822e46734e736d34Cab72dF344F";
@@ -902,7 +903,6 @@ var PoolPositions = /* @__PURE__ */ ((PoolPositions2) => {
902
903
  })(PoolPositions || {});
903
904
  var FeeConfigs = /* @__PURE__ */ ((FeeConfigs2) => {
904
905
  FeeConfigs2["DynamicBasic"] = "DynamicBasic";
905
- FeeConfigs2["DynamicAggressive"] = "DynamicAggressive";
906
906
  return FeeConfigs2;
907
907
  })(FeeConfigs || {});
908
908
  var POOL_POSITIONS = {
@@ -975,22 +975,6 @@ var FEE_CONFIGS = {
975
975
  // Constant for scaling variable fee component
976
976
  decayFilterBps: 7500
977
977
  // 75% decay after filter period
978
- },
979
- ["DynamicAggressive" /* DynamicAggressive */]: {
980
- baseFee: 1e4,
981
- // 1% minimum fee
982
- maxLpFee: 1e5,
983
- // 10% maximum fee
984
- referenceTickFilterPeriod: 20,
985
- // 20 seconds
986
- resetPeriod: 300,
987
- // 5 minutes
988
- resetTickFilter: 200,
989
- // 2% price movement
990
- feeControlNumerator: 125e3,
991
- // Constant for scaling variable fee component
992
- decayFilterBps: 5e3
993
- // 50% decay after filter period
994
978
  }
995
979
  };
996
980
 
@@ -4894,6 +4878,10 @@ function buildTokenV4(cfg, chainId, salt) {
4894
4878
  if (cfg.poolConfig.positions.length === 0) {
4895
4879
  throw new Error("Pool configuration must have at least one position");
4896
4880
  }
4881
+ const found = cfg.poolConfig.positions.some((position) => position.tickLower === cfg.poolConfig.tickIfToken0IsClanker);
4882
+ if (!found) {
4883
+ throw new Error("Starting price must have a lower tick position that touches it, please check that your positions align with the starting price.");
4884
+ }
4897
4885
  const deploymentConfig = {
4898
4886
  tokenConfig: {
4899
4887
  tokenAdmin: cfg.tokenAdmin,
@@ -5057,6 +5045,191 @@ async function deployTokenV4(cfg, wallet, publicClient) {
5057
5045
  return log.args.tokenAddress;
5058
5046
  }
5059
5047
 
5048
+ // src/abi/ClankerFeeLocker.ts
5049
+ var ClankerFeeLocker_abi = [
5050
+ {
5051
+ inputs: [{ internalType: "address", name: "owner_", type: "address" }],
5052
+ stateMutability: "nonpayable",
5053
+ type: "constructor"
5054
+ },
5055
+ { inputs: [], name: "NoFeesToClaim", type: "error" },
5056
+ {
5057
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
5058
+ name: "OwnableInvalidOwner",
5059
+ type: "error"
5060
+ },
5061
+ {
5062
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
5063
+ name: "OwnableUnauthorizedAccount",
5064
+ type: "error"
5065
+ },
5066
+ { inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
5067
+ {
5068
+ inputs: [{ internalType: "address", name: "token", type: "address" }],
5069
+ name: "SafeERC20FailedOperation",
5070
+ type: "error"
5071
+ },
5072
+ { inputs: [], name: "Unauthorized", type: "error" },
5073
+ {
5074
+ anonymous: false,
5075
+ inputs: [{ indexed: true, internalType: "address", name: "depositor", type: "address" }],
5076
+ name: "AddDepositor",
5077
+ type: "event"
5078
+ },
5079
+ {
5080
+ anonymous: false,
5081
+ inputs: [
5082
+ { indexed: true, internalType: "address", name: "feeOwner", type: "address" },
5083
+ { indexed: true, internalType: "address", name: "token", type: "address" },
5084
+ { indexed: false, internalType: "uint256", name: "amountClaimed", type: "uint256" }
5085
+ ],
5086
+ name: "ClaimTokens",
5087
+ type: "event"
5088
+ },
5089
+ {
5090
+ anonymous: false,
5091
+ inputs: [
5092
+ { indexed: true, internalType: "address", name: "feeOwner", type: "address" },
5093
+ { indexed: true, internalType: "address", name: "token", type: "address" },
5094
+ { indexed: false, internalType: "address", name: "recipient", type: "address" },
5095
+ { indexed: false, internalType: "uint256", name: "amountClaimed", type: "uint256" }
5096
+ ],
5097
+ name: "ClaimTokensPermissioned",
5098
+ type: "event"
5099
+ },
5100
+ {
5101
+ anonymous: false,
5102
+ inputs: [
5103
+ { indexed: true, internalType: "address", name: "previousOwner", type: "address" },
5104
+ { indexed: true, internalType: "address", name: "newOwner", type: "address" }
5105
+ ],
5106
+ name: "OwnershipTransferred",
5107
+ type: "event"
5108
+ },
5109
+ {
5110
+ anonymous: false,
5111
+ inputs: [
5112
+ { indexed: true, internalType: "address", name: "sender", type: "address" },
5113
+ { indexed: true, internalType: "address", name: "feeOwner", type: "address" },
5114
+ { indexed: true, internalType: "address", name: "token", type: "address" },
5115
+ { indexed: false, internalType: "uint256", name: "balance", type: "uint256" },
5116
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }
5117
+ ],
5118
+ name: "StoreTokens",
5119
+ type: "event"
5120
+ },
5121
+ {
5122
+ inputs: [{ internalType: "address", name: "depositor", type: "address" }],
5123
+ name: "addDepositor",
5124
+ outputs: [],
5125
+ stateMutability: "nonpayable",
5126
+ type: "function"
5127
+ },
5128
+ {
5129
+ inputs: [{ internalType: "address", name: "depositor", type: "address" }],
5130
+ name: "allowedDepositors",
5131
+ outputs: [{ internalType: "bool", name: "isAllowed", type: "bool" }],
5132
+ stateMutability: "view",
5133
+ type: "function"
5134
+ },
5135
+ {
5136
+ inputs: [
5137
+ { internalType: "address", name: "feeOwner", type: "address" },
5138
+ { internalType: "address", name: "token", type: "address" }
5139
+ ],
5140
+ name: "availableFees",
5141
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
5142
+ stateMutability: "view",
5143
+ type: "function"
5144
+ },
5145
+ {
5146
+ inputs: [
5147
+ { internalType: "address", name: "feeOwner", type: "address" },
5148
+ { internalType: "address", name: "token", type: "address" }
5149
+ ],
5150
+ name: "claim",
5151
+ outputs: [],
5152
+ stateMutability: "nonpayable",
5153
+ type: "function"
5154
+ },
5155
+ {
5156
+ inputs: [
5157
+ { internalType: "address", name: "feeOwner", type: "address" },
5158
+ { internalType: "address", name: "token", type: "address" }
5159
+ ],
5160
+ name: "feesToClaim",
5161
+ outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }],
5162
+ stateMutability: "view",
5163
+ type: "function"
5164
+ },
5165
+ {
5166
+ inputs: [],
5167
+ name: "owner",
5168
+ outputs: [{ internalType: "address", name: "", type: "address" }],
5169
+ stateMutability: "view",
5170
+ type: "function"
5171
+ },
5172
+ {
5173
+ inputs: [],
5174
+ name: "renounceOwnership",
5175
+ outputs: [],
5176
+ stateMutability: "nonpayable",
5177
+ type: "function"
5178
+ },
5179
+ {
5180
+ inputs: [
5181
+ { internalType: "address", name: "feeOwner", type: "address" },
5182
+ { internalType: "address", name: "token", type: "address" },
5183
+ { internalType: "uint256", name: "amount", type: "uint256" }
5184
+ ],
5185
+ name: "storeFees",
5186
+ outputs: [],
5187
+ stateMutability: "nonpayable",
5188
+ type: "function"
5189
+ },
5190
+ {
5191
+ inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
5192
+ name: "supportsInterface",
5193
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
5194
+ stateMutability: "pure",
5195
+ type: "function"
5196
+ },
5197
+ {
5198
+ inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
5199
+ name: "transferOwnership",
5200
+ outputs: [],
5201
+ stateMutability: "nonpayable",
5202
+ type: "function"
5203
+ }
5204
+ ];
5205
+
5206
+ // src/fees/claim.ts
5207
+ import { encodeFunctionData as encodeFunctionData3 } from "viem";
5208
+ var claimRewards = (feeOwnerAddress, tokenAddress) => {
5209
+ const claimRewardsCalldata = encodeFunctionData3({
5210
+ abi: ClankerFeeLocker_abi,
5211
+ functionName: "claim",
5212
+ args: [feeOwnerAddress, tokenAddress]
5213
+ });
5214
+ return {
5215
+ transaction: {
5216
+ to: CLANKER_FEE_LOCKER_V4,
5217
+ data: claimRewardsCalldata
5218
+ }
5219
+ };
5220
+ };
5221
+
5222
+ // src/fees/availableFees.ts
5223
+ var availableFees = async (publicClient, feeOwnerAddress, tokenAddress) => {
5224
+ const availableFees2 = await publicClient.readContract({
5225
+ address: CLANKER_FEE_LOCKER_V4,
5226
+ abi: ClankerFeeLocker_abi,
5227
+ functionName: "availableFees",
5228
+ args: [feeOwnerAddress, tokenAddress]
5229
+ });
5230
+ return availableFees2;
5231
+ };
5232
+
5060
5233
  // src/types/token.ts
5061
5234
  var VALID_TOKEN_PAIRS = [
5062
5235
  "WETH",
@@ -5499,6 +5672,28 @@ var Clanker = class {
5499
5672
  this.publicClient = config.publicClient;
5500
5673
  }
5501
5674
  }
5675
+ /**
5676
+ * Collects rewards from a token
5677
+ * @param tokenAddress - The address of the token to collect rewards from
5678
+ * @returns Promise resolving to the transaction hash
5679
+ * @throws {Error} If wallet client or public client is not configured
5680
+ */
5681
+ claimRewards(feeOwnerAddress, tokenAddress) {
5682
+ return claimRewards(feeOwnerAddress, tokenAddress);
5683
+ }
5684
+ /**
5685
+ * Checks the available fees for a token
5686
+ * @param feeOwnerAddress - The address of the fee owner
5687
+ * @param tokenAddress - The address of the token to check fees for
5688
+ * @returns Promise resolving to the transaction hash
5689
+ * @throws {Error} If wallet client or public client is not configured
5690
+ */
5691
+ async availableFees(feeOwnerAddress, tokenAddress) {
5692
+ if (!this.publicClient) {
5693
+ throw new Error("Public client required for checking available fees");
5694
+ }
5695
+ return availableFees(this.publicClient, feeOwnerAddress, tokenAddress);
5696
+ }
5502
5697
  /**
5503
5698
  * Builds V4 token deployment data without actually deploying
5504
5699
  * @param cfg - Token configuration for V4 deployment
@@ -5564,6 +5759,7 @@ export {
5564
5759
  CLANKER_FACTORY_V3_1,
5565
5760
  CLANKER_FACTORY_V4,
5566
5761
  CLANKER_FACTORY_V4_SEPOLIA,
5762
+ CLANKER_FEE_LOCKER_V4,
5567
5763
  CLANKER_HOOK_DYNAMIC_FEE_ADDRESS_SEPOLIA,
5568
5764
  CLANKER_HOOK_DYNAMIC_FEE_V4,
5569
5765
  CLANKER_HOOK_STATIC_FEE_ADDRESS_SEPOLIA,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clanker-sdk",
3
- "version": "4.0.18",
3
+ "version": "4.0.20",
4
4
  "description": "SDK for deploying tokens on Base using Clanker",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",