Skip to content

Commit

Permalink
add pub testnet brr token
Browse files Browse the repository at this point in the history
  • Loading branch information
xieqian committed May 7, 2024
1 parent e42e3e9 commit 8b697a9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
21 changes: 15 additions & 6 deletions redux/assetsSlice.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createSlice, createAsyncThunk } from "@reduxjs/toolkit";

import { defaultNetwork, missingPriceTokens } from "../utils/config";
import { defaultNetwork, missingPriceTokens, BRRR_TOKEN } from "../utils/config";
import { transformAssets, transformFarms } from "../transformers/asstets";
import getAssets from "../api/get-assets";
import getFarm, { getAllFarms } from "../api/get-farm";
Expand Down Expand Up @@ -45,11 +45,20 @@ export const assetSlice = createSlice({
missingPriceTokens.forEach((missingToken) => {
const missingTokenId = missingToken[defaultNetwork];
if (missingTokenId && state.data[missingTokenId] && !state.data[missingTokenId]["price"]) {
state.data[missingTokenId]["price"] = {
decimals: action.payload[missingToken.mainnet].decimal,
usd: Number(action.payload[missingToken.mainnet].price),
multiplier: "1",
};
if (missingTokenId === "brrr.ft.ref-labs.testnet") {
// for pubtestnet env
state.data[missingTokenId]["price"] = {
decimals: action.payload[BRRR_TOKEN.mainnet].decimal,
usd: Number(action.payload[BRRR_TOKEN.mainnet].price),
multiplier: "1",
};
} else {
state.data[missingTokenId]["price"] = {
decimals: action.payload[missingToken.mainnet].decimal,
usd: Number(action.payload[missingToken.mainnet].price),
multiplier: "1",
};
}
}
});
});
Expand Down
7 changes: 6 additions & 1 deletion utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ export const BRRR_TOKEN = {
testnet: "test_brrr.1638481328.burrow.testnet",
mainnet: "token.burrow.near",
};
// for pubtestnet env
export const BRRR_LABS_TOKEN = {
testnet: "brrr.ft.ref-labs.testnet",
mainnet: "brrr.ft.ref-labs.testnet",
};

export const WALLET_CONNECT_ID =
process.env.NEXT_PUBLIC_WALLET_CONNECT_ID || ("87e549918631f833447b56c15354e450" as string);

export const missingPriceTokens = [REF_TOKEN, META_TOKEN, BRRR_TOKEN];
export const missingPriceTokens = [REF_TOKEN, META_TOKEN, BRRR_TOKEN, BRRR_LABS_TOKEN];
export const incentiveTokens = [
"853d955acef822db058eb8505911ed77f175b99e.factory.bridge.near",
"17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1",
Expand Down

0 comments on commit 8b697a9

Please sign in to comment.