Skip to content

Commit

Permalink
Merge pull request #419 from Define101/master
Browse files Browse the repository at this point in the history
add sui to first digital dollar
  • Loading branch information
Define101 authored Dec 13, 2024
2 parents d6a95ac + 764bebc commit f1de3d7
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/adapters/peggedAssets/first-digital-usd/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const sdk = require("@defillama/sdk");
import { sumSingleBalance } from "../helper/generalUtil";

import * as sui from "../helper/sui";
import {
ChainBlocks,
PeggedIssuanceAdapter,
Balances, ChainContracts,
Balances,
ChainContracts,
} from "../peggedAsset.type";


const chainContracts: ChainContracts = {
ethereum: {
issued: ["0xc5f0f7b66764F6ec8C8Dff7BA683102295E16409"],
Expand All @@ -18,6 +18,15 @@ const chainContracts: ChainContracts = {
},
};

async function suiMinted(): Promise<Balances> {
let balances = {} as Balances;
const supply = await sui.getTokenSupply(
"0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD"
);
sumSingleBalance(balances, "peggedUSD", supply, "issued", false);
return balances;
}

async function chainMinted(chain: string, decimals: number) {
return async function (
_timestamp: number,
Expand Down Expand Up @@ -80,6 +89,9 @@ const adapter: PeggedIssuanceAdapter = {
bsc: {
minted: chainMinted("bsc", 18),
},
sui: {
minted: suiMinted,
},
};

export default adapter;

0 comments on commit f1de3d7

Please sign in to comment.