Skip to content

Commit

Permalink
fix layerbank adapter, update schema based on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
melotik authored and Carl committed Jul 3, 2024
1 parent 6078453 commit 1736cc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion adapters/layerbank/hourly_blocks.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
number,timestamp
4243360,1714773599
7043812,1719856798
8 changes: 5 additions & 3 deletions adapters/layerbank/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { CHAINS, PROTOCOLS } from "./sdk/config";
import { getAccountStatesForAddressByPoolAtBlock } from "./sdk/subgraphDetails";
import {
getAccountStatesForAddressByPoolAtBlock,
} from "./sdk/subgraphDetails";

(BigInt.prototype as any).toJSON = function () {
return this.toString();
Expand Down Expand Up @@ -56,7 +58,7 @@ export const getUserTVLByBlock = async (blocks: BlockData) => {
const marketInfo = marketInfos.find(
(mi) => mi.underlyingAddress.toLowerCase() === state.token.toLowerCase()
);

// Check if marketInfo is defined before pushing to csvRows
if (marketInfo) {
csvRows.push({
Expand All @@ -74,7 +76,7 @@ export const getUserTVLByBlock = async (blocks: BlockData) => {
} else {
console.warn(`Market info not found for token: ${state.token}`);
}
});
});

return csvRows;
};
Expand Down

0 comments on commit 1736cc6

Please sign in to comment.