Skip to content

Commit

Permalink
Merge pull request #3 from notional-finance/fix-allowance
Browse files Browse the repository at this point in the history
Fixing typed big number allowance
  • Loading branch information
jeffywu authored Oct 13, 2021
2 parents 0bafe72 + dd2ed3a commit f4632d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@notional-finance/sdk-v2",
"version": "0.0.3",
"version": "0.0.4",
"description": "Notional Finance SDK V2",
"author": "Jeff Wu <jeff@notional.finance>",
"homepage": "https://notional.finance",
Expand Down
5 changes: 3 additions & 2 deletions src/account/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@ export default class Account extends AccountRefresh {
}

const currency = System.getSystem().getCurrencyBySymbol(symbol);
const contract = currency.symbol === symbol ? currency.contract : (currency.underlyingContract as ERC20);
const isUnderlying = currency.underlyingSymbol === symbol;
const contract = isUnderlying ? currency.contract : (currency.underlyingContract as ERC20);
const allowance = await contract.allowance(this.address, this.notionalProxy.address);
return TypedBigNumber.from(allowance, BigNumberType.ExternalUnderlying, symbol);
return TypedBigNumber.fromBalance(allowance, symbol, false);
}

/**
Expand Down

0 comments on commit f4632d6

Please sign in to comment.