clanker-sdk 4.2.8 → 4.2.10
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/legacyFeeClaims/index.d.ts +394 -2
- package/dist/legacyFeeClaims/index.js +6174 -33
- package/dist/v4/index.d.ts +886 -0
- package/dist/v4/index.js +42 -0
- package/package.json +1 -1
package/dist/v4/index.js
CHANGED
|
@@ -7787,6 +7787,48 @@ var Clanker = class {
|
|
|
7787
7787
|
const input = await this.getUpdateMetadataTransaction({ token, metadata });
|
|
7788
7788
|
return writeClankerContract(this.publicClient, this.wallet, input);
|
|
7789
7789
|
}
|
|
7790
|
+
/**
|
|
7791
|
+
* Get the transaction config for reading token rewards information from the locker contract.
|
|
7792
|
+
*
|
|
7793
|
+
* @param token The token address to get rewards info for
|
|
7794
|
+
* @param options Optional chain configuration
|
|
7795
|
+
* @returns Abi transaction config for reading token rewards
|
|
7796
|
+
*/
|
|
7797
|
+
async getTokenRewardsTransaction({ token }, options) {
|
|
7798
|
+
const chain = this.publicClient?.chain || options?.chain || base3;
|
|
7799
|
+
const config = clankerConfigFor(
|
|
7800
|
+
chain.id,
|
|
7801
|
+
"clanker_v4"
|
|
7802
|
+
);
|
|
7803
|
+
if (!config) throw new Error(`Clanker is not ready on ${chain.id}`);
|
|
7804
|
+
return {
|
|
7805
|
+
address: config.related.locker,
|
|
7806
|
+
abi: ClankerLocker_v4_abi,
|
|
7807
|
+
functionName: "tokenRewards",
|
|
7808
|
+
args: [token]
|
|
7809
|
+
};
|
|
7810
|
+
}
|
|
7811
|
+
/**
|
|
7812
|
+
* Get the token rewards information from the locker contract.
|
|
7813
|
+
* This is useful for obtaining the rewardIndex needed for updateRewardRecipient and updateRewardAdmin.
|
|
7814
|
+
*
|
|
7815
|
+
* The returned object contains:
|
|
7816
|
+
* - token: The token address
|
|
7817
|
+
* - poolKey: The Uniswap V4 pool key
|
|
7818
|
+
* - positionId: The LP position ID
|
|
7819
|
+
* - numPositions: Number of LP positions
|
|
7820
|
+
* - rewardBps: Array of reward basis points for each recipient
|
|
7821
|
+
* - rewardAdmins: Array of admin addresses (index = rewardIndex)
|
|
7822
|
+
* - rewardRecipients: Array of recipient addresses (index = rewardIndex)
|
|
7823
|
+
*
|
|
7824
|
+
* @param token The token address to get rewards info for
|
|
7825
|
+
* @returns Token rewards information including rewardAdmins and rewardRecipients arrays
|
|
7826
|
+
*/
|
|
7827
|
+
async getTokenRewards({ token }) {
|
|
7828
|
+
if (!this.publicClient) throw new Error("Public client required");
|
|
7829
|
+
const tx = await this.getTokenRewardsTransaction({ token });
|
|
7830
|
+
return this.publicClient.readContract(tx);
|
|
7831
|
+
}
|
|
7790
7832
|
};
|
|
7791
7833
|
export {
|
|
7792
7834
|
Clanker,
|