Skip to content

Commit

Permalink
track usdt on stacks #375
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Aug 19, 2024
1 parent e077a64 commit 83f13d6
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/adapters/peggedAssets/tether/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
ChainBlocks,
PeggedIssuanceAdapter,
Balances,
PeggedAssetType,
} from "../peggedAsset.type";
import {
getTokenBalance as tronGetTokenBalance,
Expand Down Expand Up @@ -188,7 +189,7 @@ async function tonMinted() {
sumSingleBalance(
balances,
"peggedUSD",
(issued ) / 10 ** 6,
(issued) / 10 ** 6,
"issued",
false
);
Expand Down Expand Up @@ -553,6 +554,20 @@ async function aptosBridged() {
};
}


async function stacksBSCBridged(_api: ChainApi) {
const bridgeName = 'alex'
const bscApi = await getApi('bsc', _api)
let balances = {} as Balances;
let assetPegType = "peggedUSD" as PeggedAssetType
const bscBal = await bscApi.call({ abi: 'erc20:balanceOf', target: '0x55d398326f99059fF775485246999027B3197955', params: '0x7ceC01355aC0791dE5b887e80fd20e391BCB103a'})
sumSingleBalance(balances, assetPegType, bscBal/ 1e18, bridgeName, false, 'bsc')
// const ethApi = await getApi('ethereum', _api)
// const ethBal = await ethApi.call({ abi: 'erc20:balanceOf', target: '0x55d398326f99059fF775485246999027B3197955', params: '0x7ceC01355aC0791dE5b887e80fd20e391BCB103a'})
// sumSingleBalance(balances, assetPegType, ethBal/ 1e6, bridgeName, false, 'ethereum')
return balances;
}

const adapter: PeggedIssuanceAdapter = {
ethereum: {
minted: chainMinted("ethereum", 6),
Expand Down Expand Up @@ -983,6 +998,10 @@ const adapter: PeggedIssuanceAdapter = {
linea: {
ethereum: bridgedSupply("linea", 6, chainContracts.linea.bridgedFromETH),
},
stacks: {
bsc: stacksBSCBridged,
}
};

export default adapter;

0 comments on commit 83f13d6

Please sign in to comment.