Skip to content

Commit 52f034f

Browse files
authored
fix: update vToken2 parameter in API calls and remove unused filecoin… (#16839)
Co-authored-by: chen cheng <chen>
1 parent 047b443 commit 52f034f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

projects/bifrost-dex/api.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,16 @@ function formatToken(token, type) {
3737
return "vGLMR";
3838
case `{"VToken2":"4"}`:
3939
return "vFIL";
40+
case `{"VToken2":"8"}`:
41+
return "vMANTA";
4042
case `{"Token2":"4"}`:
4143
return "FIL";
4244
case `{"VToken2":"3"}`:
4345
return "vASTR";
4446
case `{"Token2":"3"}`:
4547
return "ASTR";
48+
case `{"Token2":"8"}`:
49+
return "MANTA";
4650
case `{"VToken":"BNC"}`:
4751
return "vBNC";
4852
case `{"VToken":"MOVR"}`:
@@ -83,6 +87,8 @@ function formatTokenAmount(amount, tokenSymbol) {
8387
case "vFIL":
8488
case "ASTR":
8589
case "vASTR":
90+
case "MANTA":
91+
case "vMANTA":
8692
decimals = 18;
8793
break;
8894
}
@@ -100,7 +106,8 @@ const tokenToCoingecko = {
100106
ZLK: "zenlink-network-token",
101107
USDT: "tether",
102108
FIL: "filecoin",
103-
ASTR: "astar"
109+
ASTR: "astar",
110+
MANTA: "manta"
104111
};
105112

106113
async function tvl() {
@@ -125,7 +132,7 @@ async function tvl() {
125132
currentToken = isVtoken ? currentToken.slice(1) : currentToken;
126133

127134
if (isVtoken) {
128-
const tokenPool = await kusamaApi.query.vtokenMinting.tokenPool(currentToken === "BNC" ? { "native": currentToken } : { "token": currentToken });
135+
const tokenPool = await kusamaApi.query.vtokenMinting.tokenPool( { "vToken": currentToken });
129136
const totalIssuance = await kusamaApi.query.tokens.totalIssuance({ "vToken": currentToken });
130137
ratio = new BigNumber(tokenPool).div(totalIssuance).toNumber();
131138
}
@@ -157,7 +164,7 @@ async function tvl() {
157164
currentToken = isVtoken ? currentToken.slice(1) : currentToken;
158165

159166
if (isVtoken) {
160-
const tokenPool = await polkadotApi.query.vtokenMinting.tokenPool({ "token2": poolTokens[0][0].toHuman()[1].VToken2 });
167+
const tokenPool = await polkadotApi.query.vtokenMinting.tokenPool({ "vToken2": poolTokens[0][0].toHuman()[1].VToken2 });
161168
const totalIssuance = await polkadotApi.query.tokens.totalIssuance({ "vToken2": poolTokens[0][0].toHuman()[1].VToken2 });
162169
ratio = new BigNumber(tokenPool).div(totalIssuance).toNumber();
163170
}
@@ -186,7 +193,7 @@ async function tvl() {
186193
currentToken = isVtoken ? currentToken.slice(1) : currentToken;
187194
currentToken = isVstoken ? currentToken.slice(2) : currentToken;
188195
if (isVtoken) {
189-
const tokenPool = await kusamaApi.query.vtokenMinting.tokenPool(currentToken === "BNC" ? { "native": currentToken } : { "token": currentToken });
196+
const tokenPool = await kusamaApi.query.vtokenMinting.tokenPool({ "vToken": currentToken });
190197
const totalIssuance = await kusamaApi.query.tokens.totalIssuance({ "vToken": currentToken });
191198
ratio = new BigNumber(tokenPool).div(totalIssuance).toNumber();
192199
}
@@ -221,7 +228,7 @@ async function tvl() {
221228
currentToken = isVstoken ? currentToken.slice(2) : currentToken;
222229

223230
if (isVtoken) {
224-
const tokenPool = await polkadotApi.query.vtokenMinting.tokenPool({ "token2": token.VToken2 });
231+
const tokenPool = await polkadotApi.query.vtokenMinting.tokenPool({ "vToken2": token.VToken2 });
225232
const totalIssuance = await polkadotApi.query.tokens.totalIssuance({ "vToken2": token.VToken2 });
226233
ratio = new BigNumber(tokenPool).div(totalIssuance).toNumber();
227234
}

projects/bifrost-staking/index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@ module.exports = {
4141
};
4242
},
4343
},
44-
filecoin: {
45-
tvl: async () => {
46-
const { bifrost } = getExports("bifrost-staking", ["bifrost"]);
47-
const { filecoin } = await bifrost.tvl();
48-
return { filecoin };
49-
},
50-
},
5144
astar: {
5245
tvl: async () => {
5346
const { bifrost } = getExports("bifrost-staking", ["bifrost"]);

0 commit comments

Comments
 (0)