@tokemak/queries 0.6.0 → 0.8.1
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/functions/getAutopools.d.ts +3 -1
- package/dist/functions/getAutopools.d.ts.map +1 -1
- package/dist/functions/getChainAutopools.d.ts +19 -17
- package/dist/functions/getChainAutopools.d.ts.map +1 -1
- package/dist/functions/getDeprecatedAutopools.d.ts +347 -0
- package/dist/functions/getDeprecatedAutopools.d.ts.map +1 -0
- package/dist/functions/getEthAutoLP.d.ts +1 -1
- package/dist/functions/getEthAutoLP.d.ts.map +1 -1
- package/dist/functions/getEthPriceAtBlock.d.ts +2 -2
- package/dist/functions/getEthPriceAtBlock.d.ts.map +1 -1
- package/dist/functions/getPoolsAndDestinations.d.ts +4 -2
- package/dist/functions/getPoolsAndDestinations.d.ts.map +1 -1
- package/dist/functions/getRebalanceStats.d.ts +5 -4
- package/dist/functions/getRebalanceStats.d.ts.map +1 -1
- package/dist/functions/getUniV4Pool.d.ts +13 -17
- package/dist/functions/getUniV4Pool.d.ts.map +1 -1
- package/dist/functions/getUserUniV4Positions.d.ts +1 -0
- package/dist/functions/getUserUniV4Positions.d.ts.map +1 -1
- package/dist/functions/index.d.ts +3 -23
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/uniV4Subgraph.d.ts +45 -0
- package/dist/functions/uniV4Subgraph.d.ts.map +1 -0
- package/dist/index.js +456 -1728
- package/dist/index.mjs +328 -1603
- package/dist/safe.js +49 -22
- package/dist/safe.mjs +45 -18
- package/dist/utils/getChainsForEnv.d.ts +12 -3
- package/dist/utils/getChainsForEnv.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/functions/getAllowance.d.ts +0 -8
- package/dist/functions/getAllowance.d.ts.map +0 -1
- package/dist/functions/getAutopoolsRebalances.d.ts +0 -53
- package/dist/functions/getAutopoolsRebalances.d.ts.map +0 -1
- package/dist/functions/getChainCycleRolloverBlockNumber.d.ts +0 -7
- package/dist/functions/getChainCycleRolloverBlockNumber.d.ts.map +0 -1
- package/dist/functions/getChainSToke.d.ts +0 -15
- package/dist/functions/getChainSToke.d.ts.map +0 -1
- package/dist/functions/getChainSTokeRewards.d.ts +0 -16
- package/dist/functions/getChainSTokeRewards.d.ts.map +0 -1
- package/dist/functions/getChainUserSToke.d.ts +0 -33
- package/dist/functions/getChainUserSToke.d.ts.map +0 -1
- package/dist/functions/getChainUserSTokeRewards.d.ts +0 -30
- package/dist/functions/getChainUserSTokeRewards.d.ts.map +0 -1
- package/dist/functions/getCombinedRewards.d.ts +0 -11
- package/dist/functions/getCombinedRewards.d.ts.map +0 -1
- package/dist/functions/getCurveLP.d.ts +0 -3
- package/dist/functions/getCurveLP.d.ts.map +0 -1
- package/dist/functions/getCycleV1.d.ts +0 -10
- package/dist/functions/getCycleV1.d.ts.map +0 -1
- package/dist/functions/getEthPrice.d.ts +0 -2
- package/dist/functions/getEthPrice.d.ts.map +0 -1
- package/dist/functions/getLayerzeroStatus.d.ts +0 -24
- package/dist/functions/getLayerzeroStatus.d.ts.map +0 -1
- package/dist/functions/getMultipleAutopoolRebalances.d.ts +0 -54
- package/dist/functions/getMultipleAutopoolRebalances.d.ts.map +0 -1
- package/dist/functions/getProtocolStats.d.ts +0 -41
- package/dist/functions/getProtocolStats.d.ts.map +0 -1
- package/dist/functions/getSToke.d.ts +0 -23
- package/dist/functions/getSToke.d.ts.map +0 -1
- package/dist/functions/getSTokeRewards.d.ts +0 -22
- package/dist/functions/getSTokeRewards.d.ts.map +0 -1
- package/dist/functions/getSushiLP.d.ts +0 -14
- package/dist/functions/getSushiLP.d.ts.map +0 -1
- package/dist/functions/getTokenList.d.ts +0 -3
- package/dist/functions/getTokenList.d.ts.map +0 -1
- package/dist/functions/getUserCurveLP.d.ts +0 -16
- package/dist/functions/getUserCurveLP.d.ts.map +0 -1
- package/dist/functions/getUserSToke.d.ts +0 -40
- package/dist/functions/getUserSToke.d.ts.map +0 -1
- package/dist/functions/getUserSTokeRewards.d.ts +0 -38
- package/dist/functions/getUserSTokeRewards.d.ts.map +0 -1
- package/dist/functions/getUserSushiLP.d.ts +0 -23
- package/dist/functions/getUserSushiLP.d.ts.map +0 -1
- package/dist/functions/getUserV1.d.ts +0 -18
- package/dist/functions/getUserV1.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserUniV4Positions.d.ts","sourceRoot":"","sources":["../../functions/getUserUniV4Positions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,OAAO,EAAe,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"getUserUniV4Positions.d.ts","sourceRoot":"","sources":["../../functions/getUserUniV4Positions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,OAAO,EAAe,MAAM,MAAM,CAAC;AAO5C,OAAO,EAAiB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAyE7D,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE;QACN,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB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AO,CAAC,wBAAwB,CAAC,CAanC"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
export * from "./getBlobData";
|
|
2
|
-
export * from "./getEthPrice";
|
|
3
2
|
export * from "./getTokePrice";
|
|
4
3
|
export * from "./getTokenPrice";
|
|
5
4
|
export * from "./getAutopools";
|
|
5
|
+
export * from "./getDeprecatedAutopools";
|
|
6
6
|
export * from "./getAutopoolRebalances";
|
|
7
|
-
export * from "./getAutopoolsRebalances";
|
|
8
7
|
export * from "./getAutopoolHistory";
|
|
9
8
|
export * from "./getAutopoolsHistory";
|
|
10
9
|
export * from "./getAutopoolUser";
|
|
11
10
|
export * from "./getAutopoolUserActivity";
|
|
12
11
|
export * from "./getAutopoolUserHistory";
|
|
13
|
-
export * from "./getCurveLP";
|
|
14
|
-
export * from "./getSushiLP";
|
|
15
12
|
export * from "./getUniV4Pool";
|
|
13
|
+
export * from "./uniV4Subgraph";
|
|
16
14
|
export * from "./getUserUniV4Positions";
|
|
17
15
|
export * from "./getDefillamaPoolApr";
|
|
18
16
|
export * from "./getEthAutoLP";
|
|
@@ -21,36 +19,20 @@ export * from "./getChainUserActivity";
|
|
|
21
19
|
export * from "./getRewardsPayloadV1";
|
|
22
20
|
export * from "./getUserAutoEthRewards";
|
|
23
21
|
export * from "./getUserRewardsV1";
|
|
24
|
-
export * from "./getUserV1";
|
|
25
22
|
export * from "./getUserAutopoolsHistory";
|
|
26
|
-
export * from "./getUserSushiLP";
|
|
27
|
-
export * from "./getUserCurveLP";
|
|
28
|
-
export * from "./getMultipleAutopoolRebalances";
|
|
29
23
|
export * from "./getAutopoolDayData";
|
|
30
24
|
export * from "./getAutopoolsHistory";
|
|
31
25
|
export * from "./getChainAutopools";
|
|
32
|
-
export * from "./getSystemConfig";
|
|
33
26
|
export * from "./getUserAutopools";
|
|
34
27
|
export * from "./getChainUserAutopools";
|
|
35
28
|
export * from "./getUserAutopool";
|
|
36
29
|
export * from "./getUserTokenBalances";
|
|
37
|
-
export * from "./getTokenList";
|
|
38
30
|
export * from "./getTopAutopoolHolders";
|
|
39
|
-
export * from "./getAllowance";
|
|
40
31
|
export * from "./getUserActivity";
|
|
41
32
|
export * from "./getUserAutopoolsRewards";
|
|
42
33
|
export * from "./getAmountWithdrawn";
|
|
43
34
|
export * from "./getAmountDeposited";
|
|
44
35
|
export * from "./getBridgeFee";
|
|
45
|
-
export * from "./getLayerzeroStatus";
|
|
46
|
-
export * from "./getUserSToke";
|
|
47
|
-
export * from "./getSToke";
|
|
48
|
-
export * from "./getChainSToke";
|
|
49
|
-
export * from "./getChainUserSToke";
|
|
50
|
-
export * from "./getChainCycleRolloverBlockNumber";
|
|
51
|
-
export * from "./getChainSTokeRewards";
|
|
52
|
-
export * from "./getSTokeRewards";
|
|
53
|
-
export * from "./getChainUserSTokeRewards";
|
|
54
36
|
export * from "./getCurrentCycleId";
|
|
55
37
|
export * from "./getAutopilotRouter";
|
|
56
38
|
export * from "./getAddressFromSystemRegistry";
|
|
@@ -62,8 +44,6 @@ export * from "./getTokenPrices";
|
|
|
62
44
|
export * from "./getSubgraphStatus";
|
|
63
45
|
export * from "./getPoolsAndDestinations";
|
|
64
46
|
export * from "./getChainSubgraphStatus";
|
|
65
|
-
export * from "./getCycleV1";
|
|
66
|
-
export * from "./getProtocolStats";
|
|
67
47
|
export * from "./getRebalanceStats";
|
|
68
48
|
export * from "./getEthPriceAtBlock";
|
|
69
49
|
export * from "./updateRebalanceStats";
|
|
@@ -78,5 +58,5 @@ export * from "./getUserEthAutoLPRewards";
|
|
|
78
58
|
export * from "./getMerklPoolApr";
|
|
79
59
|
export * from "./getMerklCreatorApr";
|
|
80
60
|
export * from "./getSAutoApr";
|
|
81
|
-
export * from "./
|
|
61
|
+
export * from "./getSystemConfig";
|
|
82
62
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,e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c,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const V4_SUBGRAPH_IDS: Record<number, string>;
|
|
2
|
+
/**
|
|
3
|
+
* Same-origin proxy route (mounted in the dapp) that injects the server-only
|
|
4
|
+
* GRAPH_API_KEY and forwards V4 subgraph queries to the gateway. Used on the
|
|
5
|
+
* client so the billable gateway key never ships to the browser bundle.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GRAPH_V4_SUBGRAPH_PROXY_PATH = "/api/uniswap/v4-subgraph";
|
|
8
|
+
/**
|
|
9
|
+
* Build the V4 subgraph URL for a chain.
|
|
10
|
+
*
|
|
11
|
+
* - With an explicit `apiKey` (the server-side proxy route, and tests): query
|
|
12
|
+
* the decentralized gateway directly.
|
|
13
|
+
* - On the client with no key: route through the same-origin proxy, which adds
|
|
14
|
+
* the server-only key. This keeps the key out of client JS.
|
|
15
|
+
* - No key and not in a browser: fall back to the unauthenticated gateway.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getV4SubgraphUrl(chainId: number, apiKey?: string): string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Pool-level TVL fields from the Uniswap V4 subgraph. These mirror exactly
|
|
20
|
+
* what Uniswap's own UI renders for a pool.
|
|
21
|
+
*
|
|
22
|
+
* - totalValueLockedToken0/1: real token reserves (sum of every position's
|
|
23
|
+
* tick-bounded amounts), NOT the full-range virtual reserves.
|
|
24
|
+
* - totalValueLockedUSD: the pool's TVL in USD.
|
|
25
|
+
* - token0Price / token1Price: token0-per-token1 and token1-per-token0.
|
|
26
|
+
*
|
|
27
|
+
* All values are high-precision decimal strings.
|
|
28
|
+
*/
|
|
29
|
+
export interface V4PoolTvl {
|
|
30
|
+
id: string;
|
|
31
|
+
totalValueLockedToken0: string;
|
|
32
|
+
totalValueLockedToken1: string;
|
|
33
|
+
totalValueLockedUSD: string;
|
|
34
|
+
token0Price: string;
|
|
35
|
+
token1Price: string;
|
|
36
|
+
}
|
|
37
|
+
export declare const GET_V4_POOL_TVL: string;
|
|
38
|
+
/**
|
|
39
|
+
* Fetch a V4 pool's real reserves + USD TVL from the subgraph.
|
|
40
|
+
*
|
|
41
|
+
* Returns null (rather than throwing) when the subgraph is unavailable or the
|
|
42
|
+
* pool isn't indexed yet, so callers can fall back to an on-chain estimate.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getV4PoolTvlFromSubgraph(poolId: string, chainId: number, apiKey?: string): Promise<V4PoolTvl | null>;
|
|
45
|
+
//# sourceMappingURL=uniV4Subgraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniV4Subgraph.d.ts","sourceRoot":"","sources":["../../functions/uniV4Subgraph.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAElD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,6BAA6B,CAAC;AAEvE;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,GAAG,IAAI,CAef;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,sBAAsB,EAAE,MAAM,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,eAAe,QAW3B,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAe3B"}
|