Skip to content

Commit

Permalink
Merge pull request #364 from ElliotFriend/add-stellar-glo-dollar
Browse files Browse the repository at this point in the history
Add Glo Dollar on Stellar
  • Loading branch information
realdealshaman authored Jul 18, 2024
2 parents 5b210b6 + 3f38977 commit c8f3e6f
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions src/adapters/peggedAssets/glo-dollar/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
const chainContracts = {
import { addChainExports } from "../helper/getSupply";
import { sumSingleBalance } from "../helper/generalUtil";
import {
Balances,
ChainBlocks,
PeggedIssuanceAdapter, ChainContracts,
} from "../peggedAsset.type";
import { getTotalSupply as stellarGetTotalSupply } from "../helper/stellar";

const chainContracts: ChainContracts = {
ethereum: {
issued: ["0x4F604735c1cF31399C6E711D5962b2B3E0225AD3"],
},
Expand All @@ -19,6 +28,24 @@ const chainContracts = {
},
}

import { addChainExports } from "../helper/getSupply";
const adapter = addChainExports(chainContracts);
async function stellarMinted(assetID: string) {
return async function (
_timestamp: number,
_ethBlock: number,
_chainBlocks: ChainBlocks
) {
let balances = {} as Balances;
const totalSupply = await stellarGetTotalSupply(assetID);
sumSingleBalance(balances, "peggedUSD", totalSupply, "issued", false);
return balances;
};
}

const adapter: PeggedIssuanceAdapter = {
...addChainExports(chainContracts),
stellar: {
minted: stellarMinted("USDGLO:GBBS25EGYQPGEZCGCFBKG4OAGFXU6DSOQBGTHELLJT3HZXZJ34HWS6XV"),
},
};

export default adapter;

0 comments on commit c8f3e6f

Please sign in to comment.