@defillama/sdk 2.3.107 → 2.3.109
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/build/abi/multicall.js +3 -0
- package/build/general.d.ts +1 -1
- package/build/general.js +2 -1
- package/build/util/index.js +2 -2
- package/package.json +1 -1
package/build/abi/multicall.js
CHANGED
|
@@ -203,6 +203,7 @@ function networkSupportsMulticall(chain) {
|
|
|
203
203
|
function multicallAddress(chainId) {
|
|
204
204
|
switch (chainId) {
|
|
205
205
|
case 1:
|
|
206
|
+
case 10001:
|
|
206
207
|
return exports.MULTICALL_ADDRESS_MAINNET;
|
|
207
208
|
case 42:
|
|
208
209
|
return exports.MULTICALL_ADDRESS_KOVAN;
|
|
@@ -312,6 +313,8 @@ function multicallAddress(chainId) {
|
|
|
312
313
|
return "0xC43a7181654639556e4caca1bf9219C14a106401";
|
|
313
314
|
case 1818: // cube
|
|
314
315
|
return "0x28d2ebdb36369db1c51355cdc0898754d1a1c3c5";
|
|
316
|
+
case 1234:
|
|
317
|
+
return "0x176CcFFbAB792Aaa0da7C430FE20a7106d969f66";
|
|
315
318
|
default:
|
|
316
319
|
return null;
|
|
317
320
|
}
|
package/build/general.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ethers, BigNumber } from "ethers";
|
|
|
2
2
|
export declare const providers: {
|
|
3
3
|
[chain: string]: ethers.providers.BaseProvider;
|
|
4
4
|
};
|
|
5
|
-
export declare type Chain = "ethereum" | "bsc" | "polygon" | "heco" | "fantom" | "rsk" | "tomochain" | "xdai" | "avax" | "wan" | "iotex" | "harmony" | "thundercore" | "okexchain" | "optimism" | "arbitrum" | "kcc" | "celo" | "moonriver" | "shiden" | "palm" | "energyweb" | "energi" | "songbird" | "hpb" | "gochain" | "ethereumclassic" | "xdaiarb" | "kardia" | "fuse" | "smartbch" | "elastos" | "hoo" | "fusion" | "aurora" | "ronin" | "boba" | "cronos" | "polis" | "zyx" | "telos" | "metis" | "ubiq" | "velas" | "callisto" | "csc" | "nahmii" | "liquidchain" | "meter" | "theta" | "oasis" | "syscoin" | "moonbeam" | "curio" | "astar" | "godwoken" | "evmos" | "conflux" | "milkomeda" | "dfk" | "bittorrent" | "findora" | "candle" | "lachain" | "reichain" | "rei" | "clv" | "echelon" | "multivac" | "sx" | "karura_evm" | "nova" | "ontology_evm" | "jfin" | "bitkub" | "bitgert" | "canto" | "dogechain" | "posi" | "arbitrum_nova" | "ultron" | "tombchain" | "vision" | "ethpow" | "functionx" | "cube" | "xdc";
|
|
5
|
+
export declare type Chain = "ethereum" | "bsc" | "polygon" | "heco" | "fantom" | "rsk" | "tomochain" | "xdai" | "avax" | "wan" | "iotex" | "harmony" | "thundercore" | "okexchain" | "optimism" | "arbitrum" | "kcc" | "celo" | "moonriver" | "shiden" | "palm" | "energyweb" | "energi" | "songbird" | "hpb" | "gochain" | "ethereumclassic" | "xdaiarb" | "kardia" | "fuse" | "smartbch" | "elastos" | "hoo" | "fusion" | "aurora" | "ronin" | "boba" | "cronos" | "polis" | "zyx" | "telos" | "metis" | "ubiq" | "velas" | "callisto" | "csc" | "nahmii" | "liquidchain" | "meter" | "theta" | "oasis" | "syscoin" | "moonbeam" | "curio" | "astar" | "godwoken" | "evmos" | "conflux" | "milkomeda" | "dfk" | "bittorrent" | "findora" | "candle" | "lachain" | "reichain" | "rei" | "clv" | "echelon" | "multivac" | "sx" | "karura_evm" | "nova" | "ontology_evm" | "jfin" | "bitkub" | "bitgert" | "canto" | "dogechain" | "posi" | "arbitrum_nova" | "ultron" | "tombchain" | "vision" | "ethpow" | "functionx" | "cube" | "xdc" | "step";
|
|
6
6
|
export declare function getProvider(chain?: Chain): ethers.providers.BaseProvider;
|
|
7
7
|
export declare const TEN: ethers.BigNumber;
|
|
8
8
|
export declare function handleDecimals(num: BigNumber, decimals?: number): string;
|
package/build/general.js
CHANGED
|
@@ -115,7 +115,8 @@ exports.providers = {
|
|
|
115
115
|
ethpow: createProvider("ethpow", "https://mainnet.ethereumpow.org/", 10001),
|
|
116
116
|
functionx: createProvider("functionx", "https://fx-json-web3.functionx.io:8545", 530),
|
|
117
117
|
xdc: createProvider("xdc", "https://rpc.xinfin.network,https://rpc1.xinfin.network,https://erpc.xinfin.network", 50),
|
|
118
|
-
cube: createProvider("cube", "https://http-mainnet.cube.network/", 1818)
|
|
118
|
+
cube: createProvider("cube", "https://http-mainnet.cube.network/", 1818),
|
|
119
|
+
step: createProvider("step", "https://rpc.step.network/", 1234)
|
|
119
120
|
};
|
|
120
121
|
function getProvider(chain) {
|
|
121
122
|
if (chain === void 0) { chain = "ethereum"; }
|
package/build/util/index.js
CHANGED
|
@@ -130,7 +130,7 @@ function lookupBlock(timestamp, extraParams) {
|
|
|
130
130
|
return [4 /*yield*/, getBlock(provider, "latest", extraParams.chain)];
|
|
131
131
|
case 1:
|
|
132
132
|
lastBlock = _f.sent();
|
|
133
|
-
if ((lastBlock.timestamp - timestamp) < -30 * 60) {
|
|
133
|
+
if (extraParams.chain !== 'bsc' && (lastBlock.timestamp - timestamp) < -30 * 60) {
|
|
134
134
|
throw new Error("Last block of chain \"" + extraParams.chain + "\" is further than 30 minutes into the past. Provider is \"" + ((_b = (_a = provider) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.url) + "\"");
|
|
135
135
|
}
|
|
136
136
|
if (Math.abs(lastBlock.timestamp - timestamp) < 60) {
|
|
@@ -160,7 +160,7 @@ function lookupBlock(timestamp, extraParams) {
|
|
|
160
160
|
if (high - low > 4) return [3 /*break*/, 2];
|
|
161
161
|
_f.label = 5;
|
|
162
162
|
case 5:
|
|
163
|
-
if (Math.abs(block.timestamp - timestamp) > 3600) {
|
|
163
|
+
if (extraParams.chain !== 'bsc' && Math.abs(block.timestamp - timestamp) > 3600) {
|
|
164
164
|
throw new Error("Block selected is more than 1 hour away from the requested timestamp");
|
|
165
165
|
}
|
|
166
166
|
return [2 /*return*/, {
|