Skip to content

Commit

Permalink
Rootstock bridge: Change wrbtc to rbtc
Browse files Browse the repository at this point in the history
  • Loading branch information
vrtnd committed Feb 16, 2024
1 parent 37f7085 commit 08d95eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/handlers/getBridgeStatsOnDay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { queryAggregatedDailyDataAtTimestamp, queryConfig } from "../utils/wrapp
import { getLlamaPrices } from "../utils/prices";
import { importBridgeNetwork } from "../data/importBridgeNetwork";
import BigNumber from "bignumber.js";
import { normalizeChain } from "../utils/normalizeChain";
import { normalizeChain, normlizeTokenSymbol } from "../utils/normalizeChain";

const numberOfTokensToReturn = 30 // also determines # of addresses returned

Expand Down Expand Up @@ -70,7 +70,7 @@ const sumTokenTxs = async (

Object.entries(dailyTokensRecordBn).map(([token, tokenData]) => {
dailyTokensRecord[token].amount = tokenData.amountBn?.toFixed() ?? "0";
dailyTokensRecord[token].symbol = prices?.[token]?.symbol ?? "";
dailyTokensRecord[token].symbol = normlizeTokenSymbol(prices?.[token]?.symbol ?? "");
dailyTokensRecord[token].decimals = prices?.[token]?.decimals ?? 0;
});
};
Expand Down
9 changes: 8 additions & 1 deletion src/utils/normalizeChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ export const chainCoingeckoIds = {
cmcId: null,
categories: ["EVM"],
},
"Mode": {
Mode: {
geckoId: null,
symbol: null,
cmcId: null,
Expand Down Expand Up @@ -1152,3 +1152,10 @@ export function getDisplayChain(chains: string[]) {
return chains[0];
}
}

export const normlizeTokenSymbol = (symbol: string) => {
if (symbol === "WRBTC") {
return "RBTC";
}
return symbol;
};

0 comments on commit 08d95eb

Please sign in to comment.