@@ -32,6 +32,7 @@ import {
32
32
import { chainContracts } from "./config" ;
33
33
const axios = require ( "axios" ) ;
34
34
const retry = require ( "async-retry" ) ;
35
+ import * as sui from "../helper/sui" ;
35
36
36
37
// If you are trying to test the adapter locally and it failed, try to comment out the lines related with dogechain and fuse
37
38
// any bridgeOnETH contracts are not used and are just for info purposes
@@ -434,30 +435,30 @@ async function nearMint(address: string, decimals: number) {
434
435
} ;
435
436
}
436
437
437
- async function suiBridged ( ) {
438
+ async function suiWormholeBridged ( ) {
438
439
return async function (
439
440
_timestamp : number ,
440
441
_ethBlock : number ,
441
442
_chainBlocks : ChainBlocks
442
443
) {
443
444
let balances = { } as Balances ;
444
- const res = await axios . get (
445
- `https://kx58j6x5me.execute-api.us-east-1.amazonaws.com/sui/usdt`
446
- ) ;
447
- const totalSupply = parseInt (
448
- res . data . find ( ( t : any ) => t . coin === "USDT_ETH" ) . cumulative_balance
449
- ) ;
450
- sumSingleBalance (
451
- balances ,
452
- "peggedUSD" ,
453
- totalSupply ,
454
- "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c" ,
455
- true
456
- ) ;
445
+ const res = await axios . get ( `https://kx58j6x5me.execute-api.us-east-1.amazonaws.com/sui/usdt` )
446
+ const totalSupply = parseInt ( res . data . find ( ( t :any ) => t . coin === "USDT_ETH" ) . cumulative_balance ) ;
447
+ sumSingleBalance ( balances , "peggedUSD" , totalSupply , "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c" , true ) ;
457
448
return balances ;
458
449
} ;
459
450
}
460
451
452
+ async function suiBridged ( ) : Promise < Balances > {
453
+ let balances = { } as Balances ;
454
+ const supply = await sui . getTokenSupply (
455
+ "0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT" ,
456
+ ) ;
457
+ sumSingleBalance ( balances , "peggedUSD" , supply , 'issued' , false ) ;
458
+ return balances ;
459
+ }
460
+
461
+
461
462
async function polyNetworkBridged (
462
463
chainID : number ,
463
464
chainName : string ,
@@ -711,7 +712,13 @@ const adapter: PeggedIssuanceAdapter = {
711
712
*/
712
713
} ,
713
714
sui : {
714
- ethereum : suiBridged ( ) ,
715
+ ethereum : sumMultipleBalanceFunctions (
716
+ [
717
+ suiWormholeBridged ( ) ,
718
+ suiBridged
719
+ ] ,
720
+ "peggedUSD"
721
+ ) ,
715
722
} ,
716
723
syscoin : {
717
724
ethereum : bridgedSupply (
0 commit comments