Skip to content

Commit 2262cd9

Browse files
committed
add sui stablecoins
1 parent 1c32e41 commit 2262cd9

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

src/adapters/peggedAssets/tether/index.ts

+19
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,20 @@ async function nearMint(address: string, decimals: number) {
445445
};
446446
}
447447

448+
async function suiBridged() {
449+
return async function (
450+
_timestamp: number,
451+
_ethBlock: number,
452+
_chainBlocks: ChainBlocks
453+
) {
454+
let balances = {} as Balances;
455+
const res = await axios.get(`https://kx58j6x5me.execute-api.us-east-1.amazonaws.com/sui/usdt`)
456+
const totalSupply = parseInt(res.data.find((t:any)=>t.coin==="USDT_ETH").cumulative_balance);
457+
sumSingleBalance(balances, "peggedUSD", totalSupply, "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c", true);
458+
return balances;
459+
};
460+
}
461+
448462
async function polyNetworkBridged(
449463
chainID: number,
450464
chainName: string,
@@ -673,6 +687,11 @@ const adapter: PeggedIssuanceAdapter = {
673687
),
674688
*/
675689
},
690+
sui:{
691+
minted: async () => ({}),
692+
unreleased: async () => ({}),
693+
ethereum: suiBridged()
694+
},
676695
syscoin: {
677696
minted: async () => ({}),
678697
unreleased: async () => ({}),

src/adapters/peggedAssets/usd-coin/index.ts

+22
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,20 @@ async function circleAPIChainMinted(chain: string) {
216216
};
217217
}
218218

219+
async function suiBridged(chain:string) {
220+
return async function (
221+
_timestamp: number,
222+
_ethBlock: number,
223+
_chainBlocks: ChainBlocks
224+
) {
225+
let balances = {} as Balances;
226+
const res = await axios.get(`https://kx58j6x5me.execute-api.us-east-1.amazonaws.com/sui/usdc`)
227+
const totalSupply = parseInt(res.data.find((t:any)=>t.coin===`USDC_${chain}`).cumulative_balance);
228+
sumSingleBalance(balances, "peggedUSD", totalSupply, "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf", true);
229+
return balances;
230+
};
231+
}
232+
219233
async function reinetworkBridged(address: string, decimals: number) {
220234
return async function (
221235
_timestamp: number,
@@ -902,6 +916,14 @@ const adapter: PeggedIssuanceAdapter = {
902916
6
903917
),
904918
},
919+
sui:{
920+
minted: async () => ({}),
921+
unreleased: async () => ({}),
922+
ethereum: suiBridged("ETH"),
923+
bsc: suiBridged("BSC"),
924+
solana: suiBridged("SOLANA"),
925+
arbitrum: suiBridged("ARBITRUM_BRIDGED"),
926+
},
905927
};
906928

907929
export default adapter;

src/peggedData/bridgeData.ts

+8
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,14 @@ export default {
595595
bridge: "wormhole",
596596
sourceChain: formattedSourceChains.sol,
597597
},
598+
"0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf": {
599+
bridge: "wormhole",
600+
sourceChain: formattedSourceChains.eth,
601+
},
602+
"0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c": {
603+
bridge: "wormhole",
604+
sourceChain: formattedSourceChains.eth,
605+
},
598606
"0x05832a0905E516f29344ADBa1c2052a788B10129": {
599607
bridge: "wormhole",
600608
sourceChain: formattedSourceChains.avax,

0 commit comments

Comments
 (0)