@@ -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
106113async 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 }
0 commit comments