@net-protocol/score 0.1.7 → 0.1.9
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/index.d.mts +107 -31
- package/dist/index.d.ts +107 -31
- package/dist/index.js +471 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +472 -38
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +11 -3
- package/dist/react.d.ts +11 -3
- package/dist/react.js +744 -0
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +745 -2
- package/dist/react.mjs.map +1 -1
- package/dist/{scoreKeyUtils-D-ONTPej.d.mts → scoreKeyUtils-BQl5oCSc.d.mts} +10 -1
- package/dist/{scoreKeyUtils-D-ONTPej.d.ts → scoreKeyUtils-BQl5oCSc.d.ts} +10 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as ScoreClientOptions, G as GetUpvotesOptions, a as GetUpvotesForItemsOptions, b as GetStrategyKeyScoresOptions, c as GetAppKeyScoresOptions,
|
|
2
|
-
export {
|
|
1
|
+
import { S as ScoreClientOptions, G as GetUpvotesOptions, a as GetUpvotesForItemsOptions, b as GetStrategyKeyScoresOptions, c as GetAppKeyScoresOptions, P as PoolDiscoveryPair, d as PoolDiscoveryResult, D as DecodedStrategyMetadata, e as PoolKey } from './scoreKeyUtils-BQl5oCSc.mjs';
|
|
2
|
+
export { f as DecodedUpvoteBlob, F as FeedMessage, g as PoolStrategyMetadata, h as PureAlphaMetadata, i as ScoreItem, U as UseTokenUpvotesOptions, j as UseUpvotePriceOptions, k as UseUpvoteUserOptions, l as UseUpvotesBatchOptions, m as UseUpvotesOptions, n as UseUserUpvotesGivenOptions, o as UseUserUpvotesGivenPerTokenBatchOptions, p as UseUserUpvotesReceivedOptions, q as UseUserUpvotesReceivedPerTokenBatchOptions, r as extractTokenAddressFromScoreKey, s as getFeedContentKey, t as getScoreKey, u as getStorageScoreKey, v as getStorageUpvoteContext, w as getTokenScoreKey, x as isTokenScoreKey } from './scoreKeyUtils-BQl5oCSc.mjs';
|
|
3
3
|
import { Address, WalletClient, PublicClient, Abi } from 'viem';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -149,6 +149,106 @@ declare class UserUpvoteClient {
|
|
|
149
149
|
}): Promise<`0x${string}`>;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Calculate price from sqrtPriceX96 for Uniswap V3/V4 pools.
|
|
154
|
+
*/
|
|
155
|
+
declare function calculatePriceFromSqrtPriceX96(sqrtPriceX96: bigint, token0Decimals: number, token1Decimals: number, isToken0: boolean): number;
|
|
156
|
+
/**
|
|
157
|
+
* Discover the best Uniswap pools for multiple token pairs.
|
|
158
|
+
* Makes two on-chain calls: pool discovery + pool info retrieval.
|
|
159
|
+
*/
|
|
160
|
+
declare function discoverPools({ publicClient, pairs, chainId, }: {
|
|
161
|
+
publicClient: PublicClient;
|
|
162
|
+
pairs: PoolDiscoveryPair[];
|
|
163
|
+
/** Chain ID used to resolve the WETH address. Defaults to Base (8453). */
|
|
164
|
+
chainId?: number;
|
|
165
|
+
}): Promise<PoolDiscoveryResult[]>;
|
|
166
|
+
/**
|
|
167
|
+
* Discover the best WETH pool for a single token.
|
|
168
|
+
* Convenience wrapper around discoverPools.
|
|
169
|
+
*/
|
|
170
|
+
declare function discoverTokenPool({ publicClient, tokenAddress, chainId, }: {
|
|
171
|
+
publicClient: PublicClient;
|
|
172
|
+
tokenAddress: string;
|
|
173
|
+
/** Chain ID used to resolve the WETH address. Defaults to Base (8453). */
|
|
174
|
+
chainId?: number;
|
|
175
|
+
}): Promise<PoolDiscoveryResult | null>;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* How to rank tokens by upvote activity.
|
|
179
|
+
*
|
|
180
|
+
* - `trending`: time-decayed score, recent upvotes weighted higher.
|
|
181
|
+
* Matches the website's "Hot" / default tab on /token/<chain>/trending.
|
|
182
|
+
* - `recent`: latest upvote timestamp
|
|
183
|
+
* - `top`: aggregate upvote count (via UpvoteApp.getUpvotesWithLegacy)
|
|
184
|
+
*/
|
|
185
|
+
type RankingSort = "trending" | "recent" | "top";
|
|
186
|
+
interface RankedToken {
|
|
187
|
+
address: Address;
|
|
188
|
+
name?: string;
|
|
189
|
+
symbol?: string;
|
|
190
|
+
decimals?: number;
|
|
191
|
+
/** Fully Diluted Valuation in USDC, when price + supply are available */
|
|
192
|
+
fdv?: number;
|
|
193
|
+
/** Token price in USDC, derived from the best token/WETH pool and WETH/USDC */
|
|
194
|
+
priceInUsdc?: number;
|
|
195
|
+
/** Aggregate upvote count from UpvoteApp.getUpvotesWithLegacy across all strategies */
|
|
196
|
+
upvotes: number;
|
|
197
|
+
/** Unix timestamp (seconds) of the most recent upvote event seen in the scan window */
|
|
198
|
+
latestUpvoteTimestamp: number;
|
|
199
|
+
}
|
|
200
|
+
interface GetTokenRankingsOptions {
|
|
201
|
+
chainId: number;
|
|
202
|
+
/**
|
|
203
|
+
* Maximum number of tokens to return. The function fetches and ranks more
|
|
204
|
+
* tokens than this internally to account for filtering. Default: 50 (matches
|
|
205
|
+
* the website's /token/<chain>/trending page).
|
|
206
|
+
*/
|
|
207
|
+
maxTokens?: number;
|
|
208
|
+
/** Default: "trending" */
|
|
209
|
+
sort?: RankingSort;
|
|
210
|
+
/**
|
|
211
|
+
* Number of recent messages to scan per contract (legacy + 3 strategies).
|
|
212
|
+
* Larger = more historical coverage, more RPC cost. Default: 150.
|
|
213
|
+
*/
|
|
214
|
+
messageScanWindow?: number;
|
|
215
|
+
/**
|
|
216
|
+
* Two-tier filtering thresholds, copied from the website defaults. Tokens
|
|
217
|
+
* that meet at least one of these qualify for the top slots; others fill
|
|
218
|
+
* remaining slots up to `maxTokens`.
|
|
219
|
+
*/
|
|
220
|
+
thresholds?: {
|
|
221
|
+
/** Minimum aggregate upvotes to qualify for the top slots. Default: 500 */
|
|
222
|
+
minUpvotes?: number;
|
|
223
|
+
/** Minimum FDV (USDC) to qualify for the top slots. Default: 40_000 */
|
|
224
|
+
minMarketCap?: number;
|
|
225
|
+
/**
|
|
226
|
+
* Tokens below `minMarketCap` are dropped entirely if they have no
|
|
227
|
+
* upvotes within this many hours. Default: 48
|
|
228
|
+
*/
|
|
229
|
+
recencyHours?: number;
|
|
230
|
+
};
|
|
231
|
+
/** Optional RPC URL override. If omitted, uses the package's defaults for the chain. */
|
|
232
|
+
rpcUrl?: string | string[];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Compute a token leaderboard ranked by upvote activity, mirroring the
|
|
237
|
+
* /token/<chain>/trending page on netprotocol.app.
|
|
238
|
+
*
|
|
239
|
+
* Reads recent Net Protocol upvote messages for the legacy upvote contract
|
|
240
|
+
* and the three strategy contracts, aggregates them into per-token events,
|
|
241
|
+
* scores them by the chosen sort, then enriches the top results with ERC20
|
|
242
|
+
* metadata, Uniswap pool pricing, and aggregate upvote counts.
|
|
243
|
+
*
|
|
244
|
+
* All reads are live from chain — no off-chain index. Callers should cache
|
|
245
|
+
* results (e.g. HTTP `Cache-Control`) since each call performs ~8 RPC reads.
|
|
246
|
+
*
|
|
247
|
+
* Currently supports only chains in SUPPORTED_SCORE_CHAINS (Base mainnet).
|
|
248
|
+
* Throws synchronously for any other chain.
|
|
249
|
+
*/
|
|
250
|
+
declare function getTokenRankings(options: GetTokenRankingsOptions): Promise<RankedToken[]>;
|
|
251
|
+
|
|
152
252
|
/**
|
|
153
253
|
* Convert token address to bytes32 upvote key.
|
|
154
254
|
*/
|
|
@@ -268,34 +368,6 @@ declare function decodeUpvoteMessage(msg: {
|
|
|
268
368
|
*/
|
|
269
369
|
declare const encodePoolKey: (poolKey?: PoolKey | null) => `0x${string}`;
|
|
270
370
|
|
|
271
|
-
/**
|
|
272
|
-
* Calculate price from sqrtPriceX96 for Uniswap V3/V4 pools.
|
|
273
|
-
*/
|
|
274
|
-
declare function calculatePriceFromSqrtPriceX96(sqrtPriceX96: bigint, token0Decimals: number, token1Decimals: number, isToken0: boolean): number;
|
|
275
|
-
/**
|
|
276
|
-
* Discover the best Uniswap pools for multiple token pairs.
|
|
277
|
-
* Makes two on-chain calls: pool discovery + pool info retrieval.
|
|
278
|
-
*/
|
|
279
|
-
declare function discoverPools({ publicClient, pairs, chainId, }: {
|
|
280
|
-
publicClient: PublicClient;
|
|
281
|
-
pairs: {
|
|
282
|
-
tokenAddress: string;
|
|
283
|
-
baseTokenAddress?: string;
|
|
284
|
-
}[];
|
|
285
|
-
/** Chain ID used to resolve the WETH address. Defaults to Base (8453). */
|
|
286
|
-
chainId?: number;
|
|
287
|
-
}): Promise<PoolDiscoveryResult[]>;
|
|
288
|
-
/**
|
|
289
|
-
* Discover the best WETH pool for a single token.
|
|
290
|
-
* Convenience wrapper around discoverPools.
|
|
291
|
-
*/
|
|
292
|
-
declare function discoverTokenPool({ publicClient, tokenAddress, chainId, }: {
|
|
293
|
-
publicClient: PublicClient;
|
|
294
|
-
tokenAddress: string;
|
|
295
|
-
/** Chain ID used to resolve the WETH address. Defaults to Base (8453). */
|
|
296
|
-
chainId?: number;
|
|
297
|
-
}): Promise<PoolDiscoveryResult | null>;
|
|
298
|
-
|
|
299
371
|
declare const SCORE_CONTRACT: {
|
|
300
372
|
readonly address: Address;
|
|
301
373
|
readonly abi: Abi;
|
|
@@ -342,6 +414,10 @@ declare const USER_UPVOTE_CONTRACT: {
|
|
|
342
414
|
readonly address: Address;
|
|
343
415
|
readonly abi: Abi;
|
|
344
416
|
};
|
|
417
|
+
declare const ERC20_BULK_INFO_HELPER_CONTRACT: {
|
|
418
|
+
readonly address: Address;
|
|
419
|
+
readonly abi: Abi;
|
|
420
|
+
};
|
|
345
421
|
|
|
346
422
|
/**
|
|
347
423
|
* Parse a Net protocol message from the user upvote contract.
|
|
@@ -403,4 +479,4 @@ declare function buildUserUpvoteReceived(parsed: ParsedUserUpvoteMessage, upvote
|
|
|
403
479
|
decimals: number;
|
|
404
480
|
}): UserUpvoteReceived;
|
|
405
481
|
|
|
406
|
-
export { ALL_STRATEGY_ADDRESSES, DYNAMIC_SPLIT_STRATEGY, DecodedStrategyMetadata, GetAppKeyScoresOptions, GetStrategyKeyScoresOptions, GetUpvotesForItemsOptions, GetUpvotesOptions, LEGACY_UPVOTE_V1_ADDRESS, LEGACY_UPVOTE_V2_ADDRESS, MULTI_VERSION_UNISWAP_BULK_POOL_FINDER, MULTI_VERSION_UNISWAP_POOL_INFO_RETRIEVER, NULL_ADDRESS, PURE_ALPHA_STRATEGY, type ParsedUserUpvoteMessage, PoolDiscoveryResult, PoolKey, SCORE_CONTRACT, SUPPORTED_SCORE_CHAINS, ScoreClient, ScoreClientOptions, type TokenAddressExtraction, UNIV234_POOLS_STRATEGY, UPVOTE_APP, UPVOTE_PRICE_ETH, UPVOTE_STORAGE_APP, USER_UPVOTE_CONTRACT, type UserUpvote, UserUpvoteClient, type UserUpvoteClientOptions, type UserUpvoteNetMessage, type UserUpvoteReceived, buildUserUpvote, buildUserUpvoteReceived, calculatePriceFromSqrtPriceX96, calculatePriceInUsdc, calculateUpvoteCost, calculateUserTokenBalance, decodeStrategyMetadata, decodeUpvoteMessage, decodeUpvoteStorageBlob, discoverPools, discoverTokenPool, encodePoolKey, encodeUpvoteKey, extractStrategyAddress, extractTokenAddressesFromMessages, getWethAddress, isDynamicSplitStrategy, isPureAlphaStrategy, isStrategyMessage, isUniv234PoolsStrategy, isUserUpvoteMessage, parseUserUpvoteMessage, selectStrategy, tokenAddressToUpvoteKeyString, validateUpvoteParams, validateUserUpvoteMessage };
|
|
482
|
+
export { ALL_STRATEGY_ADDRESSES, DYNAMIC_SPLIT_STRATEGY, DecodedStrategyMetadata, ERC20_BULK_INFO_HELPER_CONTRACT, GetAppKeyScoresOptions, GetStrategyKeyScoresOptions, type GetTokenRankingsOptions, GetUpvotesForItemsOptions, GetUpvotesOptions, LEGACY_UPVOTE_V1_ADDRESS, LEGACY_UPVOTE_V2_ADDRESS, MULTI_VERSION_UNISWAP_BULK_POOL_FINDER, MULTI_VERSION_UNISWAP_POOL_INFO_RETRIEVER, NULL_ADDRESS, PURE_ALPHA_STRATEGY, type ParsedUserUpvoteMessage, PoolDiscoveryPair, PoolDiscoveryResult, PoolKey, type RankedToken, type RankingSort, SCORE_CONTRACT, SUPPORTED_SCORE_CHAINS, ScoreClient, ScoreClientOptions, type TokenAddressExtraction, UNIV234_POOLS_STRATEGY, UPVOTE_APP, UPVOTE_PRICE_ETH, UPVOTE_STORAGE_APP, USER_UPVOTE_CONTRACT, type UserUpvote, UserUpvoteClient, type UserUpvoteClientOptions, type UserUpvoteNetMessage, type UserUpvoteReceived, buildUserUpvote, buildUserUpvoteReceived, calculatePriceFromSqrtPriceX96, calculatePriceInUsdc, calculateUpvoteCost, calculateUserTokenBalance, decodeStrategyMetadata, decodeUpvoteMessage, decodeUpvoteStorageBlob, discoverPools, discoverTokenPool, encodePoolKey, encodeUpvoteKey, extractStrategyAddress, extractTokenAddressesFromMessages, getTokenRankings, getWethAddress, isDynamicSplitStrategy, isPureAlphaStrategy, isStrategyMessage, isUniv234PoolsStrategy, isUserUpvoteMessage, parseUserUpvoteMessage, selectStrategy, tokenAddressToUpvoteKeyString, validateUpvoteParams, validateUserUpvoteMessage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as ScoreClientOptions, G as GetUpvotesOptions, a as GetUpvotesForItemsOptions, b as GetStrategyKeyScoresOptions, c as GetAppKeyScoresOptions,
|
|
2
|
-
export {
|
|
1
|
+
import { S as ScoreClientOptions, G as GetUpvotesOptions, a as GetUpvotesForItemsOptions, b as GetStrategyKeyScoresOptions, c as GetAppKeyScoresOptions, P as PoolDiscoveryPair, d as PoolDiscoveryResult, D as DecodedStrategyMetadata, e as PoolKey } from './scoreKeyUtils-BQl5oCSc.js';
|
|
2
|
+
export { f as DecodedUpvoteBlob, F as FeedMessage, g as PoolStrategyMetadata, h as PureAlphaMetadata, i as ScoreItem, U as UseTokenUpvotesOptions, j as UseUpvotePriceOptions, k as UseUpvoteUserOptions, l as UseUpvotesBatchOptions, m as UseUpvotesOptions, n as UseUserUpvotesGivenOptions, o as UseUserUpvotesGivenPerTokenBatchOptions, p as UseUserUpvotesReceivedOptions, q as UseUserUpvotesReceivedPerTokenBatchOptions, r as extractTokenAddressFromScoreKey, s as getFeedContentKey, t as getScoreKey, u as getStorageScoreKey, v as getStorageUpvoteContext, w as getTokenScoreKey, x as isTokenScoreKey } from './scoreKeyUtils-BQl5oCSc.js';
|
|
3
3
|
import { Address, WalletClient, PublicClient, Abi } from 'viem';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -149,6 +149,106 @@ declare class UserUpvoteClient {
|
|
|
149
149
|
}): Promise<`0x${string}`>;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Calculate price from sqrtPriceX96 for Uniswap V3/V4 pools.
|
|
154
|
+
*/
|
|
155
|
+
declare function calculatePriceFromSqrtPriceX96(sqrtPriceX96: bigint, token0Decimals: number, token1Decimals: number, isToken0: boolean): number;
|
|
156
|
+
/**
|
|
157
|
+
* Discover the best Uniswap pools for multiple token pairs.
|
|
158
|
+
* Makes two on-chain calls: pool discovery + pool info retrieval.
|
|
159
|
+
*/
|
|
160
|
+
declare function discoverPools({ publicClient, pairs, chainId, }: {
|
|
161
|
+
publicClient: PublicClient;
|
|
162
|
+
pairs: PoolDiscoveryPair[];
|
|
163
|
+
/** Chain ID used to resolve the WETH address. Defaults to Base (8453). */
|
|
164
|
+
chainId?: number;
|
|
165
|
+
}): Promise<PoolDiscoveryResult[]>;
|
|
166
|
+
/**
|
|
167
|
+
* Discover the best WETH pool for a single token.
|
|
168
|
+
* Convenience wrapper around discoverPools.
|
|
169
|
+
*/
|
|
170
|
+
declare function discoverTokenPool({ publicClient, tokenAddress, chainId, }: {
|
|
171
|
+
publicClient: PublicClient;
|
|
172
|
+
tokenAddress: string;
|
|
173
|
+
/** Chain ID used to resolve the WETH address. Defaults to Base (8453). */
|
|
174
|
+
chainId?: number;
|
|
175
|
+
}): Promise<PoolDiscoveryResult | null>;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* How to rank tokens by upvote activity.
|
|
179
|
+
*
|
|
180
|
+
* - `trending`: time-decayed score, recent upvotes weighted higher.
|
|
181
|
+
* Matches the website's "Hot" / default tab on /token/<chain>/trending.
|
|
182
|
+
* - `recent`: latest upvote timestamp
|
|
183
|
+
* - `top`: aggregate upvote count (via UpvoteApp.getUpvotesWithLegacy)
|
|
184
|
+
*/
|
|
185
|
+
type RankingSort = "trending" | "recent" | "top";
|
|
186
|
+
interface RankedToken {
|
|
187
|
+
address: Address;
|
|
188
|
+
name?: string;
|
|
189
|
+
symbol?: string;
|
|
190
|
+
decimals?: number;
|
|
191
|
+
/** Fully Diluted Valuation in USDC, when price + supply are available */
|
|
192
|
+
fdv?: number;
|
|
193
|
+
/** Token price in USDC, derived from the best token/WETH pool and WETH/USDC */
|
|
194
|
+
priceInUsdc?: number;
|
|
195
|
+
/** Aggregate upvote count from UpvoteApp.getUpvotesWithLegacy across all strategies */
|
|
196
|
+
upvotes: number;
|
|
197
|
+
/** Unix timestamp (seconds) of the most recent upvote event seen in the scan window */
|
|
198
|
+
latestUpvoteTimestamp: number;
|
|
199
|
+
}
|
|
200
|
+
interface GetTokenRankingsOptions {
|
|
201
|
+
chainId: number;
|
|
202
|
+
/**
|
|
203
|
+
* Maximum number of tokens to return. The function fetches and ranks more
|
|
204
|
+
* tokens than this internally to account for filtering. Default: 50 (matches
|
|
205
|
+
* the website's /token/<chain>/trending page).
|
|
206
|
+
*/
|
|
207
|
+
maxTokens?: number;
|
|
208
|
+
/** Default: "trending" */
|
|
209
|
+
sort?: RankingSort;
|
|
210
|
+
/**
|
|
211
|
+
* Number of recent messages to scan per contract (legacy + 3 strategies).
|
|
212
|
+
* Larger = more historical coverage, more RPC cost. Default: 150.
|
|
213
|
+
*/
|
|
214
|
+
messageScanWindow?: number;
|
|
215
|
+
/**
|
|
216
|
+
* Two-tier filtering thresholds, copied from the website defaults. Tokens
|
|
217
|
+
* that meet at least one of these qualify for the top slots; others fill
|
|
218
|
+
* remaining slots up to `maxTokens`.
|
|
219
|
+
*/
|
|
220
|
+
thresholds?: {
|
|
221
|
+
/** Minimum aggregate upvotes to qualify for the top slots. Default: 500 */
|
|
222
|
+
minUpvotes?: number;
|
|
223
|
+
/** Minimum FDV (USDC) to qualify for the top slots. Default: 40_000 */
|
|
224
|
+
minMarketCap?: number;
|
|
225
|
+
/**
|
|
226
|
+
* Tokens below `minMarketCap` are dropped entirely if they have no
|
|
227
|
+
* upvotes within this many hours. Default: 48
|
|
228
|
+
*/
|
|
229
|
+
recencyHours?: number;
|
|
230
|
+
};
|
|
231
|
+
/** Optional RPC URL override. If omitted, uses the package's defaults for the chain. */
|
|
232
|
+
rpcUrl?: string | string[];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Compute a token leaderboard ranked by upvote activity, mirroring the
|
|
237
|
+
* /token/<chain>/trending page on netprotocol.app.
|
|
238
|
+
*
|
|
239
|
+
* Reads recent Net Protocol upvote messages for the legacy upvote contract
|
|
240
|
+
* and the three strategy contracts, aggregates them into per-token events,
|
|
241
|
+
* scores them by the chosen sort, then enriches the top results with ERC20
|
|
242
|
+
* metadata, Uniswap pool pricing, and aggregate upvote counts.
|
|
243
|
+
*
|
|
244
|
+
* All reads are live from chain — no off-chain index. Callers should cache
|
|
245
|
+
* results (e.g. HTTP `Cache-Control`) since each call performs ~8 RPC reads.
|
|
246
|
+
*
|
|
247
|
+
* Currently supports only chains in SUPPORTED_SCORE_CHAINS (Base mainnet).
|
|
248
|
+
* Throws synchronously for any other chain.
|
|
249
|
+
*/
|
|
250
|
+
declare function getTokenRankings(options: GetTokenRankingsOptions): Promise<RankedToken[]>;
|
|
251
|
+
|
|
152
252
|
/**
|
|
153
253
|
* Convert token address to bytes32 upvote key.
|
|
154
254
|
*/
|
|
@@ -268,34 +368,6 @@ declare function decodeUpvoteMessage(msg: {
|
|
|
268
368
|
*/
|
|
269
369
|
declare const encodePoolKey: (poolKey?: PoolKey | null) => `0x${string}`;
|
|
270
370
|
|
|
271
|
-
/**
|
|
272
|
-
* Calculate price from sqrtPriceX96 for Uniswap V3/V4 pools.
|
|
273
|
-
*/
|
|
274
|
-
declare function calculatePriceFromSqrtPriceX96(sqrtPriceX96: bigint, token0Decimals: number, token1Decimals: number, isToken0: boolean): number;
|
|
275
|
-
/**
|
|
276
|
-
* Discover the best Uniswap pools for multiple token pairs.
|
|
277
|
-
* Makes two on-chain calls: pool discovery + pool info retrieval.
|
|
278
|
-
*/
|
|
279
|
-
declare function discoverPools({ publicClient, pairs, chainId, }: {
|
|
280
|
-
publicClient: PublicClient;
|
|
281
|
-
pairs: {
|
|
282
|
-
tokenAddress: string;
|
|
283
|
-
baseTokenAddress?: string;
|
|
284
|
-
}[];
|
|
285
|
-
/** Chain ID used to resolve the WETH address. Defaults to Base (8453). */
|
|
286
|
-
chainId?: number;
|
|
287
|
-
}): Promise<PoolDiscoveryResult[]>;
|
|
288
|
-
/**
|
|
289
|
-
* Discover the best WETH pool for a single token.
|
|
290
|
-
* Convenience wrapper around discoverPools.
|
|
291
|
-
*/
|
|
292
|
-
declare function discoverTokenPool({ publicClient, tokenAddress, chainId, }: {
|
|
293
|
-
publicClient: PublicClient;
|
|
294
|
-
tokenAddress: string;
|
|
295
|
-
/** Chain ID used to resolve the WETH address. Defaults to Base (8453). */
|
|
296
|
-
chainId?: number;
|
|
297
|
-
}): Promise<PoolDiscoveryResult | null>;
|
|
298
|
-
|
|
299
371
|
declare const SCORE_CONTRACT: {
|
|
300
372
|
readonly address: Address;
|
|
301
373
|
readonly abi: Abi;
|
|
@@ -342,6 +414,10 @@ declare const USER_UPVOTE_CONTRACT: {
|
|
|
342
414
|
readonly address: Address;
|
|
343
415
|
readonly abi: Abi;
|
|
344
416
|
};
|
|
417
|
+
declare const ERC20_BULK_INFO_HELPER_CONTRACT: {
|
|
418
|
+
readonly address: Address;
|
|
419
|
+
readonly abi: Abi;
|
|
420
|
+
};
|
|
345
421
|
|
|
346
422
|
/**
|
|
347
423
|
* Parse a Net protocol message from the user upvote contract.
|
|
@@ -403,4 +479,4 @@ declare function buildUserUpvoteReceived(parsed: ParsedUserUpvoteMessage, upvote
|
|
|
403
479
|
decimals: number;
|
|
404
480
|
}): UserUpvoteReceived;
|
|
405
481
|
|
|
406
|
-
export { ALL_STRATEGY_ADDRESSES, DYNAMIC_SPLIT_STRATEGY, DecodedStrategyMetadata, GetAppKeyScoresOptions, GetStrategyKeyScoresOptions, GetUpvotesForItemsOptions, GetUpvotesOptions, LEGACY_UPVOTE_V1_ADDRESS, LEGACY_UPVOTE_V2_ADDRESS, MULTI_VERSION_UNISWAP_BULK_POOL_FINDER, MULTI_VERSION_UNISWAP_POOL_INFO_RETRIEVER, NULL_ADDRESS, PURE_ALPHA_STRATEGY, type ParsedUserUpvoteMessage, PoolDiscoveryResult, PoolKey, SCORE_CONTRACT, SUPPORTED_SCORE_CHAINS, ScoreClient, ScoreClientOptions, type TokenAddressExtraction, UNIV234_POOLS_STRATEGY, UPVOTE_APP, UPVOTE_PRICE_ETH, UPVOTE_STORAGE_APP, USER_UPVOTE_CONTRACT, type UserUpvote, UserUpvoteClient, type UserUpvoteClientOptions, type UserUpvoteNetMessage, type UserUpvoteReceived, buildUserUpvote, buildUserUpvoteReceived, calculatePriceFromSqrtPriceX96, calculatePriceInUsdc, calculateUpvoteCost, calculateUserTokenBalance, decodeStrategyMetadata, decodeUpvoteMessage, decodeUpvoteStorageBlob, discoverPools, discoverTokenPool, encodePoolKey, encodeUpvoteKey, extractStrategyAddress, extractTokenAddressesFromMessages, getWethAddress, isDynamicSplitStrategy, isPureAlphaStrategy, isStrategyMessage, isUniv234PoolsStrategy, isUserUpvoteMessage, parseUserUpvoteMessage, selectStrategy, tokenAddressToUpvoteKeyString, validateUpvoteParams, validateUserUpvoteMessage };
|
|
482
|
+
export { ALL_STRATEGY_ADDRESSES, DYNAMIC_SPLIT_STRATEGY, DecodedStrategyMetadata, ERC20_BULK_INFO_HELPER_CONTRACT, GetAppKeyScoresOptions, GetStrategyKeyScoresOptions, type GetTokenRankingsOptions, GetUpvotesForItemsOptions, GetUpvotesOptions, LEGACY_UPVOTE_V1_ADDRESS, LEGACY_UPVOTE_V2_ADDRESS, MULTI_VERSION_UNISWAP_BULK_POOL_FINDER, MULTI_VERSION_UNISWAP_POOL_INFO_RETRIEVER, NULL_ADDRESS, PURE_ALPHA_STRATEGY, type ParsedUserUpvoteMessage, PoolDiscoveryPair, PoolDiscoveryResult, PoolKey, type RankedToken, type RankingSort, SCORE_CONTRACT, SUPPORTED_SCORE_CHAINS, ScoreClient, ScoreClientOptions, type TokenAddressExtraction, UNIV234_POOLS_STRATEGY, UPVOTE_APP, UPVOTE_PRICE_ETH, UPVOTE_STORAGE_APP, USER_UPVOTE_CONTRACT, type UserUpvote, UserUpvoteClient, type UserUpvoteClientOptions, type UserUpvoteNetMessage, type UserUpvoteReceived, buildUserUpvote, buildUserUpvoteReceived, calculatePriceFromSqrtPriceX96, calculatePriceInUsdc, calculateUpvoteCost, calculateUserTokenBalance, decodeStrategyMetadata, decodeUpvoteMessage, decodeUpvoteStorageBlob, discoverPools, discoverTokenPool, encodePoolKey, encodeUpvoteKey, extractStrategyAddress, extractTokenAddressesFromMessages, getTokenRankings, getWethAddress, isDynamicSplitStrategy, isPureAlphaStrategy, isStrategyMessage, isUniv234PoolsStrategy, isUserUpvoteMessage, parseUserUpvoteMessage, selectStrategy, tokenAddressToUpvoteKeyString, validateUpvoteParams, validateUserUpvoteMessage };
|