@defillama/sdk 2.3.35 → 2.3.39
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/general.d.ts +4 -1
- package/build/general.js +12 -5
- package/package.json +1 -1
package/build/general.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ethers, BigNumber } from "ethers";
|
|
2
|
-
export declare
|
|
2
|
+
export declare const providers: {
|
|
3
|
+
[chain: string]: ethers.providers.BaseProvider;
|
|
4
|
+
};
|
|
5
|
+
export declare type Chain = "ethereum" | "bsc" | "polygon" | "heco" | "fantom" | "rsk" | "tomochain" | "xdai" | "avax" | "wan" | "iotex" | "harmony" | "thundercore" | "okexchain" | "optimism" | "arbitrum" | "energyweb" | "songbird" | "hpb" | "gochain" | "ethclassic" | "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";
|
|
3
6
|
export declare function getProvider(chain?: Chain): ethers.providers.BaseProvider;
|
|
4
7
|
export declare const TEN: ethers.BigNumber;
|
|
5
8
|
export declare function handleDecimals(num: BigNumber, decimals?: number): string;
|
package/build/general.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setProvider = exports.ETHER_ADDRESS = exports.handleDecimals = exports.TEN = exports.getProvider = void 0;
|
|
3
|
+
exports.setProvider = exports.ETHER_ADDRESS = exports.handleDecimals = exports.TEN = exports.getProvider = exports.providers = void 0;
|
|
4
4
|
var ethers_1 = require("ethers");
|
|
5
5
|
function createProvider(name, defaultRpc, chainId) {
|
|
6
6
|
var _a, _b, _c;
|
|
@@ -23,7 +23,7 @@ function createProvider(name, defaultRpc, chainId) {
|
|
|
23
23
|
}); }), 1);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
exports.providers = {
|
|
27
27
|
// https://ethereumnodes.com/
|
|
28
28
|
ethereum: createProvider("ethereum", "https://eth-mainnet.gateway.pokt.network/v1/5f3453978e354ab992c4da79,https://cloudflare-eth.com/,https://main-light.eth.linkpool.io/,https://api.mycryptoapi.com/eth", 1),
|
|
29
29
|
bsc: createProvider("bsc", "https://bsc-dataseed.binance.org/,https://bsc-dataseed1.defibit.io/,https://bsc-dataseed1.ninicoin.io/,https://bsc-dataseed2.defibit.io/,https://bsc-dataseed2.ninicoin.io/", 56),
|
|
@@ -35,7 +35,7 @@ var providers = {
|
|
|
35
35
|
xdai: createProvider("xdai", "https://rpc.xdaichain.com/,https://xdai.poanetwork.dev,https://dai.poa.network,https://xdai-archive.blockscout.com", 100),
|
|
36
36
|
avax: createProvider("avax", "https://api.avax.network/ext/bc/C/rpc", 43114),
|
|
37
37
|
wan: createProvider("wan", "https://gwan-ssl.wandevs.org:56891", 888),
|
|
38
|
-
harmony: createProvider("harmony", "https://api.harmony.one,https://api.s0.t.hmny.io", 1666600000),
|
|
38
|
+
harmony: createProvider("harmony", "https://harmony-0-rpc.gateway.pokt.network,https://api.harmony.one,https://api.s0.t.hmny.io", 1666600000),
|
|
39
39
|
thundercore: createProvider("thundercore", "https://mainnet-rpc.thundercore.com", 108),
|
|
40
40
|
okexchain: createProvider("okexchain", "https://exchainrpc.okex.org", 66),
|
|
41
41
|
optimism: createProvider("optimism", "https://mainnet.optimism.io/", 10),
|
|
@@ -71,10 +71,17 @@ var providers = {
|
|
|
71
71
|
callisto: createProvider("callisto", "https://clo-geth.0xinfra.com/", 820),
|
|
72
72
|
klaytn: createProvider("klaytn", "http://175.209.78.135:8551", 8217),
|
|
73
73
|
csc: createProvider("csc", "https://rpc.coinex.net/,https://rpc1.coinex.net/,https://rpc2.coinex.net/,https://rpc3.coinex.net/,https://rpc4.coinex.net/", 52),
|
|
74
|
+
nahmii: createProvider("nahmii", "https://l2.nahmii.io/", 5551),
|
|
75
|
+
liquidchain: createProvider("xlc", "https://rpc.liquidchain.net/,https://rpc.xlcscan.com/", 5050),
|
|
76
|
+
meter: createProvider("meter", 'https://rpc.meter.io', 82),
|
|
77
|
+
theta: createProvider("theta", 'https://eth-rpc-api.thetatoken.org/rpc', 361),
|
|
78
|
+
oasis: createProvider("oasis", 'https://emerald.oasis.dev/', 42262),
|
|
79
|
+
syscoin: createProvider("syscoin", 'https://rpc.syscoin.org', 57),
|
|
80
|
+
moonbeam: createProvider("moonbeam", 'https://rpc.api.moonbeam.network', 1284)
|
|
74
81
|
};
|
|
75
82
|
function getProvider(chain) {
|
|
76
83
|
if (chain === void 0) { chain = "ethereum"; }
|
|
77
|
-
return providers[chain];
|
|
84
|
+
return exports.providers[chain];
|
|
78
85
|
}
|
|
79
86
|
exports.getProvider = getProvider;
|
|
80
87
|
exports.TEN = ethers_1.BigNumber.from(10);
|
|
@@ -89,6 +96,6 @@ function handleDecimals(num, decimals) {
|
|
|
89
96
|
exports.handleDecimals = handleDecimals;
|
|
90
97
|
exports.ETHER_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
91
98
|
function setProvider(chain, provider) {
|
|
92
|
-
providers[chain] = provider;
|
|
99
|
+
exports.providers[chain] = provider;
|
|
93
100
|
}
|
|
94
101
|
exports.setProvider = setProvider;
|