@defillama/sdk 5.0.102 → 5.0.103

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.
@@ -16,7 +16,7 @@ export declare function getCurrentBlocks(chains?: Chain[] | undefined): Promise<
16
16
  [chain: string]: number;
17
17
  };
18
18
  }>;
19
- export declare function getBlock(chain: Chain, timestamp?: number): Promise<Block>;
19
+ export declare function getBlock(chain: Chain, timestamp?: number, options?: LookupBlockOptionalParams): Promise<Block>;
20
20
  export declare function getBlockNumber(chain: Chain, timestamp?: number): Promise<number>;
21
21
  export declare function getCurrentChainBlock(chain?: Chain): Promise<Block>;
22
22
  export declare const getLatestBlock: typeof getCurrentChainBlock;
@@ -46,13 +46,13 @@ async function getCurrentBlocks(chains = undefined) {
46
46
  };
47
47
  }
48
48
  exports.getCurrentBlocks = getCurrentBlocks;
49
- async function getBlock(chain, timestamp) {
49
+ async function getBlock(chain, timestamp, options = {}) {
50
50
  if (!timestamp)
51
51
  return getCurrentChainBlock(chain);
52
52
  let error;
53
53
  for (let i = 0; i < blockRetries; i++) {
54
54
  try {
55
- let res = await lookupBlock(timestamp, { chain, });
55
+ let res = await lookupBlock(timestamp, { ...options, chain, });
56
56
  return res;
57
57
  }
58
58
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defillama/sdk",
3
- "version": "5.0.102",
3
+ "version": "5.0.103",
4
4
  "description": "SDK for calculating TVL",
5
5
  "main": "build/index.js",
6
6
  "scripts": {