@defillama/sdk 5.0.99 → 5.0.102
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 +6 -0
- package/build/abi/abi2.js +1 -1
- package/build/abi/multicall.js +4 -0
- package/build/abi/multicall3.js +5 -0
- package/build/providers.json +1 -1116
- package/build/util/updateProviderList.js +12 -1
- package/package.json +1 -1
|
@@ -9,8 +9,19 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
9
9
|
const debugLog_1 = require("./debugLog");
|
|
10
10
|
const promise_pool_1 = __importDefault(require("@supercharge/promise-pool"));
|
|
11
11
|
const providerList = providers_json_1.default;
|
|
12
|
+
async function getChainData() {
|
|
13
|
+
try {
|
|
14
|
+
const { data: chainData } = await (0, axios_1.default)('https://chainlist.org/rpcs.json');
|
|
15
|
+
return chainData;
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
console.log('Failed to fetch chainlist.org, falling back to local copy');
|
|
19
|
+
// https://unpkg.com/@defillama/sdk@latest/build/providers.json
|
|
20
|
+
return require(__dirname + '/chainlistOrgCache.json');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
12
23
|
async function main() {
|
|
13
|
-
let
|
|
24
|
+
let chainData = await getChainData();
|
|
14
25
|
const providerIDMap = {};
|
|
15
26
|
Object.values(providerList).forEach((i) => providerIDMap[i.chainId] = i.rpc);
|
|
16
27
|
chainData = chainData
|