@merkl/api 0.10.349 → 0.10.351
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/src/cache/declaration.d.ts +1 -1
- package/dist/src/cache/declaration.js +1 -1
- package/dist/src/libs/campaigns/campaignTypes/CompoundDynamicData.js +1 -1
- package/dist/src/libs/campaigns/utils/getUniswapV4Pools.js +11 -7
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -54,7 +54,7 @@ export async function CompoundDynamicData(_chainId, campaigns) {
|
|
54
54
|
totalSupplyTargetToken = BN2Number(IonicERC20_INTERFACE.decodeFunctionResult("getTotalUnderlyingSupplied", result[i++])[0], campaign.campaignParameters.decimalsUnderlyingToken);
|
55
55
|
}
|
56
56
|
else {
|
57
|
-
totalSupplyTargetToken = BN2Number(CTokenInterface.decodeFunctionResult("totalSupply", result[i++])[0], campaign.campaignParameters.
|
57
|
+
totalSupplyTargetToken = BN2Number(CTokenInterface.decodeFunctionResult("totalSupply", result[i++])[0], campaign.campaignParameters.decimalsTargetToken);
|
58
58
|
}
|
59
59
|
}
|
60
60
|
catch {
|
@@ -5,10 +5,10 @@ import { ChainInteractionService, ERC20Interface, NETWORK_LABELS, NULL_ADDRESS,
|
|
5
5
|
import { safeFetchLogs } from "./fetchLogs";
|
6
6
|
const UNIV4_CHAINIDS = Object.keys(UniswapV4Addresses).map((x) => Number(x));
|
7
7
|
async function getUniswapV4Pools() {
|
8
|
-
const
|
9
|
-
|
8
|
+
const pools = {};
|
9
|
+
const res = await Promise.all(UNIV4_CHAINIDS.map(async (chainId) => {
|
10
10
|
chainId = chainId;
|
11
|
-
|
11
|
+
const perChainIdRes = {};
|
12
12
|
const poolManagerAddress = UniswapV4Addresses[chainId]?.PoolManager ?? NULL_ADDRESS;
|
13
13
|
const jsonRPCprovider = providers[chainId];
|
14
14
|
try {
|
@@ -81,7 +81,7 @@ async function getUniswapV4Pools() {
|
|
81
81
|
index -= 2;
|
82
82
|
}
|
83
83
|
const id = pool.poolId;
|
84
|
-
|
84
|
+
perChainIdRes[id ?? "unknownKey"] = {
|
85
85
|
chainId: pool.chainId,
|
86
86
|
currency0: pool.currency0,
|
87
87
|
currency1: pool.currency1,
|
@@ -100,10 +100,14 @@ async function getUniswapV4Pools() {
|
|
100
100
|
}
|
101
101
|
}
|
102
102
|
catch (e) {
|
103
|
-
log.error(`issue when fetching UniswapV4 pools on ${chainId}`, e);
|
103
|
+
log.error(`issue when fetching UniswapV4 pools on ${NETWORK_LABELS[chainId]}`, e);
|
104
104
|
}
|
105
|
-
|
105
|
+
return perChainIdRes;
|
106
|
+
}));
|
107
|
+
UNIV4_CHAINIDS.forEach((chainId, i) => {
|
108
|
+
pools[chainId] = res[i];
|
109
|
+
});
|
106
110
|
log.info("✅ successfully fetched pools on UniswapV4");
|
107
|
-
return
|
111
|
+
return pools;
|
108
112
|
}
|
109
113
|
export const getUniswapV4PoolsWithCache = async () => await Redis.getOrSet("UniswapV4Pools", getUniswapV4Pools);
|