@defillama/sdk 5.0.74 → 5.0.77

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/types.d.ts CHANGED
@@ -19,6 +19,7 @@ export type CallOptions = {
19
19
  skipCache?: boolean;
20
20
  logArray?: LogArray;
21
21
  permitFailure?: boolean;
22
+ field?: string;
22
23
  };
23
24
  export type Chain = string;
24
25
  export type MulticallOptions = {
@@ -33,10 +34,12 @@ export type MulticallOptions = {
33
34
  permitFailure?: boolean;
34
35
  excludeFailed?: boolean;
35
36
  logArray?: LogArray;
37
+ field?: string;
36
38
  };
37
39
  export type FetchListOptions = {
38
40
  lengthAbi?: string | any;
39
41
  itemAbi: string | any;
42
+ itemAbi2?: string | any;
40
43
  block?: Block;
41
44
  startFrom?: number;
42
45
  target?: Address;
@@ -50,6 +53,8 @@ export type FetchListOptions = {
50
53
  logArray?: LogArray;
51
54
  groupedByInput?: boolean;
52
55
  excludeFailed?: boolean;
56
+ field?: string;
57
+ field2?: string;
53
58
  };
54
59
  export type ByteCodeCallOptions = {
55
60
  bytecode: string;
@@ -106,6 +106,12 @@ class LlamaProvider extends ethers_1.FallbackProvider {
106
106
  runners.splice(1, 0, primaryRunner);
107
107
  }
108
108
  runners = runners.slice(0, attempts);
109
+ if (this.chainName === 'rsk' && method === 'getLogs') {
110
+ const hostString = (0, env_1.getEnvValue)('RSK_ARCHIVAL_RPC');
111
+ if (!hostString)
112
+ throw new Error('RSK public nodes dont support getLogs. need to set RSK_ARCHIVAL_RPC');
113
+ runners = hostString.split(',').map(host => ({ url: host }));
114
+ }
109
115
  for (const runner of runners) {
110
116
  try {
111
117
  const result = await httpRPC[method](runner.url, params);
@@ -149,7 +155,8 @@ function createProvider(name, rpcString, chainId = 400069, archivalRPCList = [])
149
155
  function getProviderObject(url, chain) {
150
156
  const jsonRpcApiProviderOptions = { staticNetwork: true, batchMaxCount: 1, };
151
157
  if (url.startsWith('wss://')) {
152
- return new ethers_1.WebSocketProvider(url, networkish, jsonRpcApiProviderOptions);
158
+ return null; // websocket provider is not supported
159
+ // return new WebSocketProvider(url, networkish, jsonRpcApiProviderOptions)
153
160
  }
154
161
  return new ethers_1.JsonRpcProvider(url, networkish, jsonRpcApiProviderOptions);
155
162
  }
@@ -56,6 +56,8 @@ async function main() {
56
56
  delete providerList[i];
57
57
  });
58
58
  for (const [key, shorName] of Object.entries(chainShortNameMapping)) {
59
+ if (providerList[key])
60
+ continue;
59
61
  providerList[key] = providerList[shorName];
60
62
  }
61
63
  fs_1.default.writeFileSync(__dirname + '/../providers.json', JSON.stringify(providerList));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defillama/sdk",
3
- "version": "5.0.74",
3
+ "version": "5.0.77",
4
4
  "description": "SDK for calculating TVL",
5
5
  "main": "build/index.js",
6
6
  "scripts": {