@clawnch/clawncher-sdk 0.1.0
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/README.md +603 -0
- package/dist/abis.d.ts +935 -0
- package/dist/abis.d.ts.map +1 -0
- package/dist/abis.js +486 -0
- package/dist/abis.js.map +1 -0
- package/dist/addresses.d.ts +51 -0
- package/dist/addresses.d.ts.map +1 -0
- package/dist/addresses.js +80 -0
- package/dist/addresses.js.map +1 -0
- package/dist/api-deployer-types.d.ts +165 -0
- package/dist/api-deployer-types.d.ts.map +1 -0
- package/dist/api-deployer-types.js +9 -0
- package/dist/api-deployer-types.js.map +1 -0
- package/dist/api-deployer.d.ts +114 -0
- package/dist/api-deployer.d.ts.map +1 -0
- package/dist/api-deployer.js +309 -0
- package/dist/api-deployer.js.map +1 -0
- package/dist/claimer.d.ts +197 -0
- package/dist/claimer.d.ts.map +1 -0
- package/dist/claimer.js +311 -0
- package/dist/claimer.js.map +1 -0
- package/dist/deployer.d.ts +229 -0
- package/dist/deployer.d.ts.map +1 -0
- package/dist/deployer.js +305 -0
- package/dist/deployer.js.map +1 -0
- package/dist/erc8004-types.d.ts +94 -0
- package/dist/erc8004-types.d.ts.map +1 -0
- package/dist/erc8004-types.js +8 -0
- package/dist/erc8004-types.js.map +1 -0
- package/dist/errors.d.ts +62 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +75 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +204 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +358 -0
- package/dist/index.js.map +1 -0
- package/dist/liquidity-types.d.ts +198 -0
- package/dist/liquidity-types.d.ts.map +1 -0
- package/dist/liquidity-types.js +8 -0
- package/dist/liquidity-types.js.map +1 -0
- package/dist/liquidity.d.ts +111 -0
- package/dist/liquidity.d.ts.map +1 -0
- package/dist/liquidity.js +608 -0
- package/dist/liquidity.js.map +1 -0
- package/dist/molten-types.d.ts +282 -0
- package/dist/molten-types.d.ts.map +1 -0
- package/dist/molten-types.js +8 -0
- package/dist/molten-types.js.map +1 -0
- package/dist/molten.d.ts +336 -0
- package/dist/molten.d.ts.map +1 -0
- package/dist/molten.js +560 -0
- package/dist/molten.js.map +1 -0
- package/dist/portfolio.d.ts +129 -0
- package/dist/portfolio.d.ts.map +1 -0
- package/dist/portfolio.js +218 -0
- package/dist/portfolio.js.map +1 -0
- package/dist/reader.d.ts +249 -0
- package/dist/reader.d.ts.map +1 -0
- package/dist/reader.js +488 -0
- package/dist/reader.js.map +1 -0
- package/dist/swap-types.d.ts +159 -0
- package/dist/swap-types.d.ts.map +1 -0
- package/dist/swap-types.js +22 -0
- package/dist/swap-types.js.map +1 -0
- package/dist/swap.d.ts +762 -0
- package/dist/swap.d.ts.map +1 -0
- package/dist/swap.js +345 -0
- package/dist/swap.js.map +1 -0
- package/dist/token-verification-data.d.ts +4 -0
- package/dist/token-verification-data.d.ts.map +1 -0
- package/dist/token-verification-data.js +6 -0
- package/dist/token-verification-data.js.map +1 -0
- package/dist/types.d.ts +244 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/uniswap-abis.d.ts +470 -0
- package/dist/uniswap-abis.d.ts.map +1 -0
- package/dist/uniswap-abis.js +322 -0
- package/dist/uniswap-abis.js.map +1 -0
- package/dist/uniswap-addresses.d.ts +38 -0
- package/dist/uniswap-addresses.d.ts.map +1 -0
- package/dist/uniswap-addresses.js +67 -0
- package/dist/uniswap-addresses.js.map +1 -0
- package/dist/vanity.d.ts +115 -0
- package/dist/vanity.d.ts.map +1 -0
- package/dist/vanity.js +166 -0
- package/dist/vanity.js.map +1 -0
- package/dist/verify.d.ts +88 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +181 -0
- package/dist/verify.js.map +1 -0
- package/dist/watcher.d.ts +112 -0
- package/dist/watcher.d.ts.map +1 -0
- package/dist/watcher.js +132 -0
- package/dist/watcher.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClawnchPortfolio - Portfolio tracking for Clawncher token deployers
|
|
3
|
+
*
|
|
4
|
+
* Aggregates token holdings, fee balances, and vault allocations
|
|
5
|
+
* for a wallet across all their deployed/participated tokens.
|
|
6
|
+
*
|
|
7
|
+
* Since Clanker's FeeLocker doesn't have efficient enumeration,
|
|
8
|
+
* this class uses two approaches:
|
|
9
|
+
* 1. Accept a known token list (fast, no event scanning)
|
|
10
|
+
* 2. Scan factory TokenCreated events for a wallet (comprehensive but slower)
|
|
11
|
+
*/
|
|
12
|
+
import { type PublicClient, type Address } from 'viem';
|
|
13
|
+
import { type NetworkName } from './addresses.js';
|
|
14
|
+
/**
|
|
15
|
+
* Token info within a portfolio
|
|
16
|
+
*/
|
|
17
|
+
export interface PortfolioToken {
|
|
18
|
+
/** Token contract address */
|
|
19
|
+
address: Address;
|
|
20
|
+
/** Token name */
|
|
21
|
+
name: string;
|
|
22
|
+
/** Token symbol */
|
|
23
|
+
symbol: string;
|
|
24
|
+
/** Reward BPS this wallet receives (out of 10000) */
|
|
25
|
+
bps: number;
|
|
26
|
+
/** Claimable WETH fees */
|
|
27
|
+
claimableWeth: bigint;
|
|
28
|
+
/** Claimable token fees */
|
|
29
|
+
claimableToken: bigint;
|
|
30
|
+
/** Formatted claimable WETH */
|
|
31
|
+
formattedWeth: string;
|
|
32
|
+
/** Formatted claimable token */
|
|
33
|
+
formattedToken: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Aggregated claimable amounts
|
|
37
|
+
*/
|
|
38
|
+
export interface TotalClaimable {
|
|
39
|
+
/** Total claimable WETH across all tokens */
|
|
40
|
+
weth: bigint;
|
|
41
|
+
/** Formatted total WETH */
|
|
42
|
+
formattedWeth: string;
|
|
43
|
+
/** Per-token claimable amounts */
|
|
44
|
+
tokens: Array<{
|
|
45
|
+
address: Address;
|
|
46
|
+
symbol: string;
|
|
47
|
+
amount: bigint;
|
|
48
|
+
formatted: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Portfolio configuration
|
|
53
|
+
*/
|
|
54
|
+
export interface PortfolioConfig {
|
|
55
|
+
/** Public client for reading chain data */
|
|
56
|
+
publicClient: PublicClient;
|
|
57
|
+
/** Network to read from */
|
|
58
|
+
network: NetworkName;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* ClawnchPortfolio - Track tokens and fees for a wallet
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* import { ClawnchPortfolio } from '@clawnch/clawncher-sdk';
|
|
66
|
+
* import { createPublicClient, http } from 'viem';
|
|
67
|
+
* import { base } from 'viem/chains';
|
|
68
|
+
*
|
|
69
|
+
* const publicClient = createPublicClient({
|
|
70
|
+
* chain: base,
|
|
71
|
+
* transport: http(),
|
|
72
|
+
* });
|
|
73
|
+
*
|
|
74
|
+
* const portfolio = new ClawnchPortfolio({
|
|
75
|
+
* publicClient,
|
|
76
|
+
* network: 'mainnet',
|
|
77
|
+
* });
|
|
78
|
+
*
|
|
79
|
+
* // Get portfolio for known tokens
|
|
80
|
+
* const tokens = await portfolio.getTokensForWallet(
|
|
81
|
+
* walletAddress,
|
|
82
|
+
* [token1, token2, token3],
|
|
83
|
+
* );
|
|
84
|
+
*
|
|
85
|
+
* // Get total claimable
|
|
86
|
+
* const claimable = await portfolio.getTotalClaimable(
|
|
87
|
+
* walletAddress,
|
|
88
|
+
* [token1, token2],
|
|
89
|
+
* );
|
|
90
|
+
* console.log(`Total WETH: ${claimable.formattedWeth}`);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare class ClawnchPortfolio {
|
|
94
|
+
readonly publicClient: PublicClient;
|
|
95
|
+
readonly network: NetworkName;
|
|
96
|
+
constructor(config: PortfolioConfig);
|
|
97
|
+
/**
|
|
98
|
+
* Get contract addresses for configured network
|
|
99
|
+
*/
|
|
100
|
+
private getAddresses;
|
|
101
|
+
/**
|
|
102
|
+
* Get all tokens where wallet is a reward recipient.
|
|
103
|
+
*
|
|
104
|
+
* Checks each provided token to see if the wallet is listed as a
|
|
105
|
+
* reward recipient in the LP locker, and fetches fee balances.
|
|
106
|
+
*
|
|
107
|
+
* @param wallet - The wallet address to check
|
|
108
|
+
* @param tokens - Known token addresses to check against
|
|
109
|
+
*/
|
|
110
|
+
getTokensForWallet(wallet: Address, tokens: Address[]): Promise<PortfolioToken[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Get total claimable fees across all specified tokens for a wallet.
|
|
113
|
+
*
|
|
114
|
+
* @param wallet - The wallet address
|
|
115
|
+
* @param tokens - Token addresses to aggregate
|
|
116
|
+
*/
|
|
117
|
+
getTotalClaimable(wallet: Address, tokens: Address[]): Promise<TotalClaimable>;
|
|
118
|
+
/**
|
|
119
|
+
* Discover tokens deployed by a wallet by scanning factory events.
|
|
120
|
+
*
|
|
121
|
+
* Scans TokenCreated events where tokenAdmin matches the wallet.
|
|
122
|
+
* This is slower than providing a known list but finds all tokens.
|
|
123
|
+
*
|
|
124
|
+
* @param wallet - The deployer wallet address
|
|
125
|
+
* @param fromBlock - Block to start scanning from (default: last 100k blocks)
|
|
126
|
+
*/
|
|
127
|
+
discoverTokens(wallet: Address, fromBlock?: bigint): Promise<Address[]>;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=portfolio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portfolio.d.ts","sourceRoot":"","sources":["../src/portfolio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EAGb,MAAM,MAAM,CAAC;AASd,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGhE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,OAAO,EAAE,OAAO,C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;IAuDpF;;;;;;;;OAQG;IACG,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAyB9E"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClawnchPortfolio - Portfolio tracking for Clawncher token deployers
|
|
3
|
+
*
|
|
4
|
+
* Aggregates token holdings, fee balances, and vault allocations
|
|
5
|
+
* for a wallet across all their deployed/participated tokens.
|
|
6
|
+
*
|
|
7
|
+
* Since Clanker's FeeLocker doesn't have efficient enumeration,
|
|
8
|
+
* this class uses two approaches:
|
|
9
|
+
* 1. Accept a known token list (fast, no event scanning)
|
|
10
|
+
* 2. Scan factory TokenCreated events for a wallet (comprehensive but slower)
|
|
11
|
+
*/
|
|
12
|
+
import { formatEther, } from 'viem';
|
|
13
|
+
import { ClawnchFactoryABI, ClawnchFeeLockerABI, ClawnchLpLockerABI, ERC20ABI, } from './abis.js';
|
|
14
|
+
import { getAddresses } from './addresses.js';
|
|
15
|
+
/**
|
|
16
|
+
* ClawnchPortfolio - Track tokens and fees for a wallet
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import { ClawnchPortfolio } from '@clawnch/clawncher-sdk';
|
|
21
|
+
* import { createPublicClient, http } from 'viem';
|
|
22
|
+
* import { base } from 'viem/chains';
|
|
23
|
+
*
|
|
24
|
+
* const publicClient = createPublicClient({
|
|
25
|
+
* chain: base,
|
|
26
|
+
* transport: http(),
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* const portfolio = new ClawnchPortfolio({
|
|
30
|
+
* publicClient,
|
|
31
|
+
* network: 'mainnet',
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* // Get portfolio for known tokens
|
|
35
|
+
* const tokens = await portfolio.getTokensForWallet(
|
|
36
|
+
* walletAddress,
|
|
37
|
+
* [token1, token2, token3],
|
|
38
|
+
* );
|
|
39
|
+
*
|
|
40
|
+
* // Get total claimable
|
|
41
|
+
* const claimable = await portfolio.getTotalClaimable(
|
|
42
|
+
* walletAddress,
|
|
43
|
+
* [token1, token2],
|
|
44
|
+
* );
|
|
45
|
+
* console.log(`Total WETH: ${claimable.formattedWeth}`);
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export class ClawnchPortfolio {
|
|
49
|
+
publicClient;
|
|
50
|
+
network;
|
|
51
|
+
constructor(config) {
|
|
52
|
+
this.publicClient = config.publicClient;
|
|
53
|
+
this.network = config.network;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get contract addresses for configured network
|
|
57
|
+
*/
|
|
58
|
+
getAddresses() {
|
|
59
|
+
return getAddresses(this.network);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get all tokens where wallet is a reward recipient.
|
|
63
|
+
*
|
|
64
|
+
* Checks each provided token to see if the wallet is listed as a
|
|
65
|
+
* reward recipient in the LP locker, and fetches fee balances.
|
|
66
|
+
*
|
|
67
|
+
* @param wallet - The wallet address to check
|
|
68
|
+
* @param tokens - Known token addresses to check against
|
|
69
|
+
*/
|
|
70
|
+
async getTokensForWallet(wallet, tokens) {
|
|
71
|
+
const addresses = this.getAddresses();
|
|
72
|
+
const results = [];
|
|
73
|
+
for (const token of tokens) {
|
|
74
|
+
try {
|
|
75
|
+
// Get reward info from LP locker
|
|
76
|
+
const rewards = await this.publicClient.readContract({
|
|
77
|
+
address: addresses.clawnch.locker,
|
|
78
|
+
abi: ClawnchLpLockerABI,
|
|
79
|
+
functionName: 'tokenRewards',
|
|
80
|
+
args: [token],
|
|
81
|
+
});
|
|
82
|
+
// Find this wallet in the reward recipients
|
|
83
|
+
const recipientIndex = rewards.rewardRecipients.findIndex((r) => r.toLowerCase() === wallet.toLowerCase());
|
|
84
|
+
if (recipientIndex === -1)
|
|
85
|
+
continue;
|
|
86
|
+
// Get token info and fee balances in parallel
|
|
87
|
+
const [name, symbol, claimableWeth, claimableToken] = await Promise.all([
|
|
88
|
+
this.publicClient.readContract({
|
|
89
|
+
address: token,
|
|
90
|
+
abi: ERC20ABI,
|
|
91
|
+
functionName: 'name',
|
|
92
|
+
}).catch(() => 'Unknown'),
|
|
93
|
+
this.publicClient.readContract({
|
|
94
|
+
address: token,
|
|
95
|
+
abi: ERC20ABI,
|
|
96
|
+
functionName: 'symbol',
|
|
97
|
+
}).catch(() => '???'),
|
|
98
|
+
this.publicClient.readContract({
|
|
99
|
+
address: addresses.clawnch.feeLocker,
|
|
100
|
+
abi: ClawnchFeeLockerABI,
|
|
101
|
+
functionName: 'availableFees',
|
|
102
|
+
args: [wallet, addresses.infrastructure.weth],
|
|
103
|
+
}).catch(() => 0n),
|
|
104
|
+
this.publicClient.readContract({
|
|
105
|
+
address: addresses.clawnch.feeLocker,
|
|
106
|
+
abi: ClawnchFeeLockerABI,
|
|
107
|
+
functionName: 'availableFees',
|
|
108
|
+
args: [wallet, token],
|
|
109
|
+
}).catch(() => 0n),
|
|
110
|
+
]);
|
|
111
|
+
results.push({
|
|
112
|
+
address: token,
|
|
113
|
+
name: name,
|
|
114
|
+
symbol: symbol,
|
|
115
|
+
bps: rewards.rewardBps[recipientIndex],
|
|
116
|
+
claimableWeth,
|
|
117
|
+
claimableToken,
|
|
118
|
+
formattedWeth: formatEther(claimableWeth),
|
|
119
|
+
formattedToken: formatEther(claimableToken),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
// Skip tokens that fail (may not be Clawncher tokens)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return results;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Get total claimable fees across all specified tokens for a wallet.
|
|
130
|
+
*
|
|
131
|
+
* @param wallet - The wallet address
|
|
132
|
+
* @param tokens - Token addresses to aggregate
|
|
133
|
+
*/
|
|
134
|
+
async getTotalClaimable(wallet, tokens) {
|
|
135
|
+
const addresses = this.getAddresses();
|
|
136
|
+
let totalWeth = 0n;
|
|
137
|
+
const tokenAmounts = [];
|
|
138
|
+
// Check WETH fees (these are per-feeOwner, not per-token, but we check anyway)
|
|
139
|
+
try {
|
|
140
|
+
totalWeth = await this.publicClient.readContract({
|
|
141
|
+
address: addresses.clawnch.feeLocker,
|
|
142
|
+
abi: ClawnchFeeLockerABI,
|
|
143
|
+
functionName: 'availableFees',
|
|
144
|
+
args: [wallet, addresses.infrastructure.weth],
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
// No WETH fees
|
|
149
|
+
}
|
|
150
|
+
// Check each token's fees
|
|
151
|
+
for (const token of tokens) {
|
|
152
|
+
try {
|
|
153
|
+
const [symbol, amount] = await Promise.all([
|
|
154
|
+
this.publicClient.readContract({
|
|
155
|
+
address: token,
|
|
156
|
+
abi: ERC20ABI,
|
|
157
|
+
functionName: 'symbol',
|
|
158
|
+
}).catch(() => '???'),
|
|
159
|
+
this.publicClient.readContract({
|
|
160
|
+
address: addresses.clawnch.feeLocker,
|
|
161
|
+
abi: ClawnchFeeLockerABI,
|
|
162
|
+
functionName: 'availableFees',
|
|
163
|
+
args: [wallet, token],
|
|
164
|
+
}).catch(() => 0n),
|
|
165
|
+
]);
|
|
166
|
+
if (amount > 0n) {
|
|
167
|
+
tokenAmounts.push({
|
|
168
|
+
address: token,
|
|
169
|
+
symbol,
|
|
170
|
+
amount,
|
|
171
|
+
formatted: formatEther(amount),
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
// Skip tokens that fail
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
weth: totalWeth,
|
|
181
|
+
formattedWeth: formatEther(totalWeth),
|
|
182
|
+
tokens: tokenAmounts,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Discover tokens deployed by a wallet by scanning factory events.
|
|
187
|
+
*
|
|
188
|
+
* Scans TokenCreated events where tokenAdmin matches the wallet.
|
|
189
|
+
* This is slower than providing a known list but finds all tokens.
|
|
190
|
+
*
|
|
191
|
+
* @param wallet - The deployer wallet address
|
|
192
|
+
* @param fromBlock - Block to start scanning from (default: last 100k blocks)
|
|
193
|
+
*/
|
|
194
|
+
async discoverTokens(wallet, fromBlock) {
|
|
195
|
+
const addresses = this.getAddresses();
|
|
196
|
+
const startBlock = fromBlock ?? await this.publicClient.getBlockNumber()
|
|
197
|
+
.then(n => n > 100000n ? n - 100000n : 0n);
|
|
198
|
+
try {
|
|
199
|
+
const logs = await this.publicClient.getContractEvents({
|
|
200
|
+
address: addresses.clawnch.factory,
|
|
201
|
+
abi: ClawnchFactoryABI,
|
|
202
|
+
eventName: 'TokenCreated',
|
|
203
|
+
args: {
|
|
204
|
+
tokenAdmin: wallet,
|
|
205
|
+
},
|
|
206
|
+
fromBlock: startBlock,
|
|
207
|
+
});
|
|
208
|
+
return logs.map(log => {
|
|
209
|
+
const args = log.args;
|
|
210
|
+
return args.tokenAddress;
|
|
211
|
+
}).filter((addr) => !!addr);
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
return [];
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=portfolio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portfolio.js","sourceRoot":"","sources":["../src/portfolio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAGL,WAAW,GAEZ,MAAM,MAAM,CAAC;AAEd,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAElB,QAAQ,GACT,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAoDhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,OAAO,gBAAgB;IAClB,YAAY,CAAe;IAC3B,OAAO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
|
|
2
|
+
* ClawnchReader - Read on-chain token data from Clanker's contracts
|
|
3
|
+
*
|
|
4
|
+
* v3: Reads from Clanker's approved infrastructure (same ABI, different addresses).
|
|
5
|
+
* Provides read-only access to token deployment info, vault allocations,
|
|
6
|
+
* fee configurations, and reward info.
|
|
7
|
+
*
|
|
8
|
+
* Used by frontends to display token detail pages and admin functionality.
|
|
9
|
+
*/
|
|
10
|
+
import { type PublicClient, type Address, type Chain } from 'viem';
|
|
11
|
+
import { type NetworkName } from './addresses.js';
|
|
12
|
+
/**
|
|
13
|
+
* Vault allocation info
|
|
14
|
+
*/
|
|
15
|
+
export interface VaultAllocation {
|
|
16
|
+
token: Address;
|
|
17
|
+
amountTotal: bigint;
|
|
18
|
+
amountClaimed: bigint;
|
|
19
|
+
lockupEndTime: bigint;
|
|
20
|
+
vestingEndTime: bigint;
|
|
21
|
+
admin: Address;
|
|
22
|
+
/** Amount currently available to claim */
|
|
23
|
+
amountAvailable: bigint;
|
|
24
|
+
/** Whether lockup has ended */
|
|
25
|
+
isUnlocked: boolean;
|
|
26
|
+
/** Whether fully vested */
|
|
27
|
+
isFullyVested: boolean;
|
|
28
|
+
/** Percentage vested (0-100) */
|
|
29
|
+
percentVested: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Vested dev buy allocation info
|
|
33
|
+
*/
|
|
34
|
+
export interface VestedDevBuyAllocation {
|
|
35
|
+
token: Address;
|
|
36
|
+
amountTotal: bigint;
|
|
37
|
+
amountClaimed: bigint;
|
|
38
|
+
lockupEndTime: bigint;
|
|
39
|
+
vestingEndTime: bigint;
|
|
40
|
+
admin: Address;
|
|
41
|
+
/** Amount currently available to claim */
|
|
42
|
+
amountAvailable: bigint;
|
|
43
|
+
/** Whether lockup has ended */
|
|
44
|
+
isUnlocked: boolean;
|
|
45
|
+
/** Whether fully vested */
|
|
46
|
+
isFullyVested: boolean;
|
|
47
|
+
/** Percentage vested (0-100) */
|
|
48
|
+
percentVested: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Reward recipient info from LP locker (read result)
|
|
52
|
+
*/
|
|
53
|
+
export interface RewardRecipientInfo {
|
|
54
|
+
recipient: Address;
|
|
55
|
+
admin: Address;
|
|
56
|
+
bps: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Token deployment info
|
|
60
|
+
*/
|
|
61
|
+
export interface TokenDeploymentInfo {
|
|
62
|
+
token: Address;
|
|
63
|
+
hook: Address;
|
|
64
|
+
locker: Address;
|
|
65
|
+
extensions: Address[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Token reward info from LP locker
|
|
69
|
+
*/
|
|
70
|
+
export interface TokenRewardInfo {
|
|
71
|
+
token: Address;
|
|
72
|
+
poolKey: {
|
|
73
|
+
currency0: Address;
|
|
74
|
+
currency1: Address;
|
|
75
|
+
fee: number;
|
|
76
|
+
tickSpacing: number;
|
|
77
|
+
hooks: Address;
|
|
78
|
+
};
|
|
79
|
+
positionId: bigint;
|
|
80
|
+
numPositions: bigint;
|
|
81
|
+
rewardBps: number[];
|
|
82
|
+
rewardAdmins: Address[];
|
|
83
|
+
rewardRecipients: Address[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* MEV protection config (read result)
|
|
87
|
+
*/
|
|
88
|
+
export interface MevConfigInfo {
|
|
89
|
+
startingFee: number;
|
|
90
|
+
endingFee: number;
|
|
91
|
+
secondsToDecay: bigint;
|
|
92
|
+
poolStartTime: bigint;
|
|
93
|
+
/** Computed: poolStartTime + secondsToDecay */
|
|
94
|
+
decayEndTime: bigint;
|
|
95
|
+
currentFee: number;
|
|
96
|
+
isDecayComplete: boolean;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Full token details for UI
|
|
100
|
+
*/
|
|
101
|
+
export interface TokenDetails {
|
|
102
|
+
address: Address;
|
|
103
|
+
name: string;
|
|
104
|
+
symbol: string;
|
|
105
|
+
decimals: number;
|
|
106
|
+
totalSupply: bigint;
|
|
107
|
+
tokenAdmin: Address;
|
|
108
|
+
originalAdmin: Address;
|
|
109
|
+
image: string;
|
|
110
|
+
metadata: string;
|
|
111
|
+
context: string;
|
|
112
|
+
deployment: TokenDeploymentInfo;
|
|
113
|
+
rewards: TokenRewardInfo | null;
|
|
114
|
+
vault: VaultAllocation | null;
|
|
115
|
+
vestedDevBuy: VestedDevBuyAllocation | null;
|
|
116
|
+
mev: MevConfigInfo | null;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Fee info for a wallet across tokens
|
|
120
|
+
*/
|
|
121
|
+
export interface WalletFeeInfo {
|
|
122
|
+
wallet: Address;
|
|
123
|
+
tokens: Array<{
|
|
124
|
+
token: Address;
|
|
125
|
+
symbol: string;
|
|
126
|
+
availableFees: bigint;
|
|
127
|
+
formattedFees: string;
|
|
128
|
+
}>;
|
|
129
|
+
totalWeth: bigint;
|
|
130
|
+
formattedTotalWeth: string;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Reader configuration
|
|
134
|
+
*/
|
|
135
|
+
export interface ReaderConfig {
|
|
136
|
+
/** Public client for reading chain data */
|
|
137
|
+
publicClient: PublicClient;
|
|
138
|
+
/** Network to read from */
|
|
139
|
+
network: NetworkName;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* ClawnchReader - Read on-chain token data
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* import { ClawnchReader } from '@clawnch/clawncher-sdk';
|
|
147
|
+
* import { createPublicClient, http } from 'viem';
|
|
148
|
+
* import { baseSepolia } from 'viem/chains';
|
|
149
|
+
*
|
|
150
|
+
* const publicClient = createPublicClient({
|
|
151
|
+
* chain: baseSepolia,
|
|
152
|
+
* transport: http(),
|
|
153
|
+
* });
|
|
154
|
+
*
|
|
155
|
+
* const reader = new ClawnchReader({
|
|
156
|
+
* publicClient,
|
|
157
|
+
* network: 'sepolia',
|
|
158
|
+
* });
|
|
159
|
+
*
|
|
160
|
+
* // Get full token details
|
|
161
|
+
* const details = await reader.getTokenDetails('0x...');
|
|
162
|
+
*
|
|
163
|
+
* // Get vault allocation
|
|
164
|
+
* const vault = await reader.getVaultAllocation('0x...');
|
|
165
|
+
*
|
|
166
|
+
* // Get vested dev buy allocation
|
|
167
|
+
* const vested = await reader.getVestedDevBuyAllocation('0x...');
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
export declare class ClawnchReader {
|
|
171
|
+
readonly publicClient: PublicClient;
|
|
172
|
+
readonly network: NetworkName;
|
|
173
|
+
constructor(config: ReaderConfig);
|
|
174
|
+
/**
|
|
175
|
+
* Get contract addresses for configured network
|
|
176
|
+
*/
|
|
177
|
+
getAddresses(): import("./addresses.js").NetworkAddresses;
|
|
178
|
+
/**
|
|
179
|
+
* Get the chain for the configured network
|
|
180
|
+
*/
|
|
181
|
+
getChain(): Chain;
|
|
182
|
+
/**
|
|
183
|
+
* Get basic ERC20 token info
|
|
184
|
+
*/
|
|
185
|
+
getTokenInfo(token: Address): Promise<{
|
|
186
|
+
name: string;
|
|
187
|
+
symbol: string;
|
|
188
|
+
decimals: number;
|
|
189
|
+
totalSupply: bigint;
|
|
190
|
+
}>;
|
|
191
|
+
/**
|
|
192
|
+
* Get Clawncher token metadata using allData() single call
|
|
193
|
+
*
|
|
194
|
+
* Returns originalAdmin, admin, imageUrl, metadata, context in one RPC call.
|
|
195
|
+
*/
|
|
196
|
+
getTokenMetadata(token: Address): Promise<{
|
|
197
|
+
tokenAdmin: Address;
|
|
198
|
+
originalAdmin: Address;
|
|
199
|
+
image: string;
|
|
200
|
+
metadata: string;
|
|
201
|
+
context: string;
|
|
202
|
+
}>;
|
|
203
|
+
/**
|
|
204
|
+
* Get token deployment info from factory
|
|
205
|
+
*/
|
|
206
|
+
getDeploymentInfo(token: Address): Promise<TokenDeploymentInfo | null>;
|
|
207
|
+
/**
|
|
208
|
+
* Get vault allocation for a token
|
|
209
|
+
*/
|
|
210
|
+
getVaultAllocation(token: Address): Promise<VaultAllocation | null>;
|
|
211
|
+
/**
|
|
212
|
+
* Get vested dev buy allocation for a token
|
|
213
|
+
*/
|
|
214
|
+
getVestedDevBuyAllocation(token: Address): Promise<VestedDevBuyAllocation | null>;
|
|
215
|
+
/**
|
|
216
|
+
* Get token reward info (recipients, positions) from LP locker
|
|
217
|
+
*/
|
|
218
|
+
getTokenRewards(token: Address): Promise<TokenRewardInfo | null>;
|
|
219
|
+
/**
|
|
220
|
+
* Get available fees for a wallet on a specific token
|
|
221
|
+
*/
|
|
222
|
+
getAvailableFees(wallet: Address, token: Address): Promise<bigint>;
|
|
223
|
+
/**
|
|
224
|
+
* Get all available fees for a wallet across multiple tokens
|
|
225
|
+
*/
|
|
226
|
+
getWalletFees(wallet: Address, tokens: Address[]): Promise<WalletFeeInfo>;
|
|
227
|
+
/**
|
|
228
|
+
* Get MEV protection config for a pool by its poolId (bytes32)
|
|
229
|
+
*
|
|
230
|
+
* Use `getMevConfigForToken()` if you have a token address instead of poolId.
|
|
231
|
+
*/
|
|
232
|
+
getMevConfig(poolId: `0x${string}`): Promise<MevConfigInfo | null>;
|
|
233
|
+
/**
|
|
234
|
+
* Get MEV protection config for a token (resolves poolId via LP locker first)
|
|
235
|
+
*/
|
|
236
|
+
getMevConfigForToken(token: Address): Promise<MevConfigInfo | null>;
|
|
237
|
+
/**
|
|
238
|
+
* Get complete token details for UI display
|
|
239
|
+
*
|
|
240
|
+
* Combines basic token info, deployment info, vault, vested dev buy,
|
|
241
|
+
* reward recipients, and MEV config into a single response.
|
|
242
|
+
*/
|
|
243
|
+
getTokenDetails(token: Address): Promise<TokenDetails | null>;
|
|
244
|
+
/**
|
|
245
|
+
* Check if a token was deployed via Clawncher
|
|
246
|
+
*/
|
|
247
|
+
isClawnchToken(token: Address): Promise<boolean>;
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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