diff --git a/adapters/utils/runAdapter.ts b/adapters/utils/runAdapter.ts index ac27d7e4f2..ddb1fa3855 100644 --- a/adapters/utils/runAdapter.ts +++ b/adapters/utils/runAdapter.ts @@ -1,7 +1,11 @@ -import { Balances, ChainApi, getEventLogs, getProvider, elastic } from '@defillama/sdk' +import { Balances, ChainApi, getEventLogs, getProvider, elastic, log } from '@defillama/sdk' import { BaseAdapter, ChainBlocks, DISABLED_ADAPTER_KEY, Fetch, FetchGetLogsOptions, FetchOptions, FetchResultGeneric, FetchV2, } from '../types' import { getBlock } from "../../helpers/getBlock"; import { getUniqStartOfTodayTimestamp } from '../../helpers/getUniSubgraphFees'; +import * as _env from '../../helpers/env' + +// to trigger inclusion of the env.ts file +const _include_env = _env.getEnv('BITLAYER_RPC') const ONE_DAY_IN_SECONDS = 60 * 60 * 24 @@ -93,7 +97,12 @@ export default async function runAdapter(volumeAdapter: BaseAdapter, cleanCurren async function getOptionsObject(timestamp: number, chain: string, chainBlocks: ChainBlocks): Promise { const withinTwoHours = Math.trunc(Date.now() / 1000) - timestamp < 24 * 60 * 60 // 24 hours const createBalances: () => Balances = () => { - return new Balances({ timestamp: closeToCurrentTime ? undefined : timestamp, chain }) + let _chain = chain + // workaround for mismatch in chain names between dimensions repo and rest of the codebase + switch (chain) { + case 'bitlayer': _chain = 'btr'; break; + } + return new Balances({ timestamp: closeToCurrentTime ? undefined : timestamp, chain: _chain }) } const toTimestamp = timestamp - 1 const fromTimestamp = toTimestamp - ONE_DAY_IN_SECONDS diff --git a/options/jaspervault/index.ts b/options/jaspervault/index.ts index b390433055..2afd834cd0 100644 --- a/options/jaspervault/index.ts +++ b/options/jaspervault/index.ts @@ -1,14 +1,10 @@ import { Adapter, FetchOptions, ChainEndpoints } from "../../adapters/types"; import { CHAIN } from "../../helpers/chains"; import { GraphQLClient, gql } from 'graphql-request'; -import { Balances, log } from "@defillama/sdk"; +import { Balances, } from "@defillama/sdk"; import { Chain } from "@defillama/sdk/build/general"; import BigNumber from "bignumber.js"; import ADDRESSES from '../../helpers/coreAssets.json' -import * as _env from '../../helpers/env' - -// to trigger inclusion of the env.ts file -log(_env.getEnv('BITLAYER_RPC'), 'bitlayer') const iBTC_arbitrum = '0x050C24dBf1eEc17babE5fc585F06116A259CC77A' const WSOL_arbitrum = '0x2bcC6D6CdBbDC0a4071e48bb3B969b06B3330c07'