Skip to content

Commit

Permalink
fix xdai supply
Browse files Browse the repository at this point in the history
  • Loading branch information
0xngmi committed Dec 26, 2023
1 parent 456d960 commit 9b65d31
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/adapters/peggedAssets/dai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,12 @@ async function chainMinted(chain: string, decimals: number) {
};
}

export async function fromETH(
async function fromETH(
owner: string,
decimals: number,
pegType?: PeggedAssetType
) {

const targets = [
"0x83F20F44975D03b1b09e64809B757c47f942BEeA",
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
Expand All @@ -299,13 +299,23 @@ export async function fromETH(
let assetPegType = pegType ? pegType : ("peggedUSD" as PeggedAssetType);

for (const target of targets) {
const bridged = (
let bridged = (
await sdk.api.erc20.balanceOf({
target: target,
owner: owner,
block: _ethBlock,
})
).output;
if(target === "0x83F20F44975D03b1b09e64809B757c47f942BEeA"){
bridged = (
await sdk.api.abi.call({
target: target,
abi: "function convertToAssets(uint256 shares) public view returns (uint256)",
params: [bridged],
block: _ethBlock,
})
).output;
}

sumSingleBalance(
balances,
Expand Down

0 comments on commit 9b65d31

Please sign in to comment.