@defillama/sdk 5.0.71 → 5.0.74
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/ChainApi.d.ts +11 -9
- package/build/ChainApi.js +11 -2
- package/build/abi/abi2.d.ts +1 -1
- package/build/abi/abi2.js +68 -18
- package/build/abi/multicall.js +6 -0
- package/build/abi/multicall3.js +5 -1
- package/build/providers.json +1 -1
- package/build/types.d.ts +7 -1
- package/build/util/updateProviderList.js +16 -1
- package/package.json +1 -1
package/build/types.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type CallOptions = {
|
|
|
18
18
|
withMetadata?: boolean;
|
|
19
19
|
skipCache?: boolean;
|
|
20
20
|
logArray?: LogArray;
|
|
21
|
+
permitFailure?: boolean;
|
|
21
22
|
};
|
|
22
23
|
export type Chain = string;
|
|
23
24
|
export type MulticallOptions = {
|
|
@@ -30,6 +31,7 @@ export type MulticallOptions = {
|
|
|
30
31
|
withMetadata?: boolean;
|
|
31
32
|
skipCache?: boolean;
|
|
32
33
|
permitFailure?: boolean;
|
|
34
|
+
excludeFailed?: boolean;
|
|
33
35
|
logArray?: LogArray;
|
|
34
36
|
};
|
|
35
37
|
export type FetchListOptions = {
|
|
@@ -37,13 +39,17 @@ export type FetchListOptions = {
|
|
|
37
39
|
itemAbi: string | any;
|
|
38
40
|
block?: Block;
|
|
39
41
|
startFrom?: number;
|
|
40
|
-
target
|
|
42
|
+
target?: Address;
|
|
43
|
+
calls?: Address[];
|
|
44
|
+
targets?: Address[];
|
|
41
45
|
chain?: Chain | string;
|
|
42
46
|
withMetadata?: boolean;
|
|
43
47
|
startFromOne?: boolean;
|
|
44
48
|
itemCount?: number;
|
|
45
49
|
permitFailure?: boolean;
|
|
46
50
|
logArray?: LogArray;
|
|
51
|
+
groupedByInput?: boolean;
|
|
52
|
+
excludeFailed?: boolean;
|
|
47
53
|
};
|
|
48
54
|
export type ByteCodeCallOptions = {
|
|
49
55
|
bytecode: string;
|
|
@@ -23,6 +23,7 @@ async function main() {
|
|
|
23
23
|
.withConcurrency(7)
|
|
24
24
|
.for(chainData)
|
|
25
25
|
.process(async (i) => {
|
|
26
|
+
var _a, _b;
|
|
26
27
|
i.rpc = await filterForWorkingRPCs(i.rpc.map((j) => j.url), i.name, i.chainId);
|
|
27
28
|
if (!i.rpc.length)
|
|
28
29
|
return;
|
|
@@ -33,10 +34,14 @@ async function main() {
|
|
|
33
34
|
(0, debugLog_1.debugLog)(`Duplicate short name ${i.chainId} for ${i.shortName}, doing nothing`);
|
|
34
35
|
}
|
|
35
36
|
else {
|
|
36
|
-
|
|
37
|
+
const label = i.shortName.toLowerCase();
|
|
38
|
+
providerList[label] = {
|
|
37
39
|
rpc: i.rpc,
|
|
38
40
|
chainId: i.chainId
|
|
39
41
|
};
|
|
42
|
+
let explorer = (_b = (_a = i.explorers) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
43
|
+
if (explorer)
|
|
44
|
+
providerList[label].explorer = explorer;
|
|
40
45
|
}
|
|
41
46
|
});
|
|
42
47
|
Object.entries(providerList).forEach(([key, i]) => {
|
|
@@ -50,6 +55,9 @@ async function main() {
|
|
|
50
55
|
if (!providerList[i].rpc.length)
|
|
51
56
|
delete providerList[i];
|
|
52
57
|
});
|
|
58
|
+
for (const [key, shorName] of Object.entries(chainShortNameMapping)) {
|
|
59
|
+
providerList[key] = providerList[shorName];
|
|
60
|
+
}
|
|
53
61
|
fs_1.default.writeFileSync(__dirname + '/../providers.json', JSON.stringify(providerList));
|
|
54
62
|
}
|
|
55
63
|
function filterRPCs(rpc) {
|
|
@@ -68,6 +76,13 @@ function filterRPCs(rpc) {
|
|
|
68
76
|
return i;
|
|
69
77
|
});
|
|
70
78
|
}
|
|
79
|
+
const chainShortNameMapping = {
|
|
80
|
+
real: 're-al',
|
|
81
|
+
taiko: 'tko-mainnet',
|
|
82
|
+
bsquared: 'b2-mainnet',
|
|
83
|
+
ox_chain: 'ox-chain',
|
|
84
|
+
ailayer: 'ailayer-mainnet',
|
|
85
|
+
};
|
|
71
86
|
async function filterForWorkingRPCs(rpc, chain, chainId) {
|
|
72
87
|
if (rpc.length < 10)
|
|
73
88
|
return rpc;
|