diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-13 22:09:04 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-13 22:09:04 +0800 |
commit | 61243b418e4d962cd8d8a1d7a49f04510b3c1c7f (patch) | |
tree | 76dc6976632f74dbf3434ce5780aec9ad33bde3f /packages/contracts/src/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts | |
parent | fe75660e88ed0c37c4f3d461a644bd9305bf6183 (diff) | |
download | dexon-0x-contracts-61243b418e4d962cd8d8a1d7a49f04510b3c1c7f.tar dexon-0x-contracts-61243b418e4d962cd8d8a1d7a49f04510b3c1c7f.tar.gz dexon-0x-contracts-61243b418e4d962cd8d8a1d7a49f04510b3c1c7f.tar.bz2 dexon-0x-contracts-61243b418e4d962cd8d8a1d7a49f04510b3c1c7f.tar.lz dexon-0x-contracts-61243b418e4d962cd8d8a1d7a49f04510b3c1c7f.tar.xz dexon-0x-contracts-61243b418e4d962cd8d8a1d7a49f04510b3c1c7f.tar.zst dexon-0x-contracts-61243b418e4d962cd8d8a1d7a49f04510b3c1c7f.zip |
Implement initial set of orderFill combinatorial tests
Diffstat (limited to 'packages/contracts/src/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts')
-rw-r--r-- | packages/contracts/src/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/contracts/src/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts b/packages/contracts/src/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts new file mode 100644 index 000000000..a295a40c4 --- /dev/null +++ b/packages/contracts/src/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts @@ -0,0 +1,19 @@ +import { AbstractBalanceAndProxyAllowanceFetcher } from '@0xproject/order-utils'; +import { BigNumber } from '@0xproject/utils'; + +import { AssetWrapper } from './asset_wrapper'; + +export class SimpleAssetBalanceAndProxyAllowanceFetcher implements AbstractBalanceAndProxyAllowanceFetcher { + private _assetWrapper: AssetWrapper; + constructor(assetWrapper: AssetWrapper) { + this._assetWrapper = assetWrapper; + } + public async getBalanceAsync(assetData: string, userAddress: string): Promise<BigNumber> { + const balance = await this._assetWrapper.getBalanceAsync(userAddress, assetData); + return balance; + } + public async getProxyAllowanceAsync(assetData: string, userAddress: string): Promise<BigNumber> { + const proxyAllowance = await this._assetWrapper.getProxyAllowanceAsync(userAddress, assetData); + return proxyAllowance; + } +} |