clanker-sdk 4.2.9 → 4.2.11
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 +30 -3
- package/dist/cli/create-clanker.js +28 -1
- package/dist/{deploy-BvFgwMVl.d.ts → deploy-ydUPEH-J.d.ts} +1821 -3
- package/dist/index.d.ts +23 -4
- package/dist/index.js +35 -1
- package/dist/legacyFeeClaims/index.js +24 -0
- package/dist/v3/index.js +27 -0
- package/dist/v4/extensions/index.d.ts +1 -1
- package/dist/v4/extensions/index.js +27 -0
- package/dist/v4/index.d.ts +888 -2
- package/dist/v4/index.js +69 -0
- package/package.json +1 -1
package/dist/v4/index.js
CHANGED
|
@@ -1918,6 +1918,7 @@ import {
|
|
|
1918
1918
|
arbitrum,
|
|
1919
1919
|
base,
|
|
1920
1920
|
baseSepolia,
|
|
1921
|
+
bsc,
|
|
1921
1922
|
mainnet,
|
|
1922
1923
|
monadTestnet,
|
|
1923
1924
|
unichain
|
|
@@ -1950,9 +1951,11 @@ var monad = /* @__PURE__ */ defineChain({
|
|
|
1950
1951
|
});
|
|
1951
1952
|
|
|
1952
1953
|
// src/constants.ts
|
|
1954
|
+
var WBNB_ADDRESS = "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c";
|
|
1953
1955
|
var WETH_ADDRESSES = {
|
|
1954
1956
|
[mainnet.id]: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
1955
1957
|
[arbitrum.id]: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
|
|
1958
|
+
[bsc.id]: WBNB_ADDRESS,
|
|
1956
1959
|
[base.id]: "0x4200000000000000000000000000000000000006",
|
|
1957
1960
|
[baseSepolia.id]: "0x4200000000000000000000000000000000000006",
|
|
1958
1961
|
[unichain.id]: "0x4200000000000000000000000000000000000006",
|
|
@@ -3869,6 +3872,7 @@ import {
|
|
|
3869
3872
|
arbitrum as arbitrum2,
|
|
3870
3873
|
base as base2,
|
|
3871
3874
|
baseSepolia as baseSepolia2,
|
|
3875
|
+
bsc as bsc2,
|
|
3872
3876
|
mainnet as mainnet2,
|
|
3873
3877
|
monadTestnet as monadTestnet2,
|
|
3874
3878
|
unichain as unichain2
|
|
@@ -6583,6 +6587,29 @@ var CLANKERS = {
|
|
|
6583
6587
|
feeStaticHookV2: "0x94F802a9EFE4dd542FdBd77a25D9e69A6dC828Cc",
|
|
6584
6588
|
feeDynamicHook: "0x0000000000000000000000000000000000000000"
|
|
6585
6589
|
}
|
|
6590
|
+
},
|
|
6591
|
+
clanker_v4_bnb: {
|
|
6592
|
+
abi: Clanker_v4_abi,
|
|
6593
|
+
token: {
|
|
6594
|
+
abi: ClankerToken_v4_abi,
|
|
6595
|
+
bytecode: ClankerToken_v4_bytecode
|
|
6596
|
+
},
|
|
6597
|
+
chainId: bsc2.id,
|
|
6598
|
+
type: "clanker_v4",
|
|
6599
|
+
address: "0xea30438E0B5f99096cb05A8Da63be55A6A298F6a",
|
|
6600
|
+
related: {
|
|
6601
|
+
locker: "0x1166022e1becc70E7E9aB2250aF1aC7842B9B420",
|
|
6602
|
+
vault: "0x15ee8382DBd8Fb991F653B59CA11bf504a07372D",
|
|
6603
|
+
airdrop: "0xBB0f069b995e0205cD5F92C84a1dF056a3F47900",
|
|
6604
|
+
devbuy: "0x302989E1cA167B6E78f9711e5a08d1BD555DdAc4",
|
|
6605
|
+
mevModule: "0xEE2940CC010820B7F22DF627e081d707693989a6",
|
|
6606
|
+
mevModuleV2: "0xec1310cf227a2D671176000aE0849DE6417b175a",
|
|
6607
|
+
feeLocker: "0x67D04Ae42F03D9b63dE0E6F2d82bB186A0306bBb",
|
|
6608
|
+
feeStaticHook: "0xC5d309026BCAb6630888d51CE21154AD2f4828cC",
|
|
6609
|
+
feeStaticHookV2: "0xC5d309026BCAb6630888d51CE21154AD2f4828cC",
|
|
6610
|
+
feeDynamicHook: "0x0000000000000000000000000000000000000000",
|
|
6611
|
+
feeDynamicHookV2: "0x011a8ed40095F2D7E9c19125B8254b19678D68Cc"
|
|
6612
|
+
}
|
|
6586
6613
|
}
|
|
6587
6614
|
};
|
|
6588
6615
|
var Chains = [...new Set(Object.values(CLANKERS).map(({ chainId }) => chainId))];
|
|
@@ -7787,6 +7814,48 @@ var Clanker = class {
|
|
|
7787
7814
|
const input = await this.getUpdateMetadataTransaction({ token, metadata });
|
|
7788
7815
|
return writeClankerContract(this.publicClient, this.wallet, input);
|
|
7789
7816
|
}
|
|
7817
|
+
/**
|
|
7818
|
+
* Get the transaction config for reading token rewards information from the locker contract.
|
|
7819
|
+
*
|
|
7820
|
+
* @param token The token address to get rewards info for
|
|
7821
|
+
* @param options Optional chain configuration
|
|
7822
|
+
* @returns Abi transaction config for reading token rewards
|
|
7823
|
+
*/
|
|
7824
|
+
async getTokenRewardsTransaction({ token }, options) {
|
|
7825
|
+
const chain = this.publicClient?.chain || options?.chain || base3;
|
|
7826
|
+
const config = clankerConfigFor(
|
|
7827
|
+
chain.id,
|
|
7828
|
+
"clanker_v4"
|
|
7829
|
+
);
|
|
7830
|
+
if (!config) throw new Error(`Clanker is not ready on ${chain.id}`);
|
|
7831
|
+
return {
|
|
7832
|
+
address: config.related.locker,
|
|
7833
|
+
abi: ClankerLocker_v4_abi,
|
|
7834
|
+
functionName: "tokenRewards",
|
|
7835
|
+
args: [token]
|
|
7836
|
+
};
|
|
7837
|
+
}
|
|
7838
|
+
/**
|
|
7839
|
+
* Get the token rewards information from the locker contract.
|
|
7840
|
+
* This is useful for obtaining the rewardIndex needed for updateRewardRecipient and updateRewardAdmin.
|
|
7841
|
+
*
|
|
7842
|
+
* The returned object contains:
|
|
7843
|
+
* - token: The token address
|
|
7844
|
+
* - poolKey: The Uniswap V4 pool key
|
|
7845
|
+
* - positionId: The LP position ID
|
|
7846
|
+
* - numPositions: Number of LP positions
|
|
7847
|
+
* - rewardBps: Array of reward basis points for each recipient
|
|
7848
|
+
* - rewardAdmins: Array of admin addresses (index = rewardIndex)
|
|
7849
|
+
* - rewardRecipients: Array of recipient addresses (index = rewardIndex)
|
|
7850
|
+
*
|
|
7851
|
+
* @param token The token address to get rewards info for
|
|
7852
|
+
* @returns Token rewards information including rewardAdmins and rewardRecipients arrays
|
|
7853
|
+
*/
|
|
7854
|
+
async getTokenRewards({ token }) {
|
|
7855
|
+
if (!this.publicClient) throw new Error("Public client required");
|
|
7856
|
+
const tx = await this.getTokenRewardsTransaction({ token });
|
|
7857
|
+
return this.publicClient.readContract(tx);
|
|
7858
|
+
}
|
|
7790
7859
|
};
|
|
7791
7860
|
export {
|
|
7792
7861
|
Clanker,
|