aboutsummaryrefslogtreecommitdiffstats
path: root/packages/fill-scenarios
diff options
context:
space:
mode:
Diffstat (limited to 'packages/fill-scenarios')
-rw-r--r--packages/fill-scenarios/.npmignore6
-rw-r--r--packages/fill-scenarios/CHANGELOG.json307
-rw-r--r--packages/fill-scenarios/CHANGELOG.md135
-rw-r--r--packages/fill-scenarios/README.md63
-rw-r--r--packages/fill-scenarios/package.json46
-rw-r--r--packages/fill-scenarios/src/constants.ts4
-rw-r--r--packages/fill-scenarios/src/fill_scenarios.ts296
-rw-r--r--packages/fill-scenarios/src/index.ts1
-rw-r--r--packages/fill-scenarios/tsconfig.json8
-rw-r--r--packages/fill-scenarios/tslint.json3
10 files changed, 0 insertions, 869 deletions
diff --git a/packages/fill-scenarios/.npmignore b/packages/fill-scenarios/.npmignore
deleted file mode 100644
index 24e65ad5b..000000000
--- a/packages/fill-scenarios/.npmignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.*
-yarn-error.log
-/scripts/
-/src/
-tsconfig.json
-/lib/monorepo_scripts/
diff --git a/packages/fill-scenarios/CHANGELOG.json b/packages/fill-scenarios/CHANGELOG.json
deleted file mode 100644
index beffdd097..000000000
--- a/packages/fill-scenarios/CHANGELOG.json
+++ /dev/null
@@ -1,307 +0,0 @@
-[
- {
- "version": "2.0.0",
- "changes": [
- {
- "note": "Upgrade the bignumber.js to v8.0.2",
- "pr": 1517
- }
- ]
- },
- {
- "timestamp": 1547561734,
- "version": "1.1.2",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1547225310,
- "version": "1.1.1",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "version": "1.1.0",
- "changes": [
- {
- "note": "Add support for MultiAssetProxy",
- "pr": 1363
- }
- ],
- "timestamp": 1547040760
- },
- {
- "version": "1.0.16",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ],
- "timestamp": 1544739608
- },
- {
- "version": "1.0.15",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ],
- "timestamp": 1544570656
- },
- {
- "timestamp": 1543401373,
- "version": "1.0.14",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1542821676,
- "version": "1.0.13",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1542208198,
- "version": "1.0.12",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1542134075,
- "version": "1.0.11",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1542028948,
- "version": "1.0.10",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "version": "1.0.9",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ],
- "timestamp": 1541740904
- },
- {
- "version": "1.0.8",
- "changes": [
- {
- "note": "Updated to use new @0xproject/contract-artifacts and @0xproject/abi-gen-wrappers packages",
- "pr": 1105
- }
- ],
- "timestamp": 1539871071
- },
- {
- "version": "1.0.7",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ],
- "timestamp": 1538693146
- },
- {
- "timestamp": 1538157789,
- "version": "1.0.6",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1537907159,
- "version": "1.0.5",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1537875740,
- "version": "1.0.4",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1537541580,
- "version": "1.0.3",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "version": "1.0.2",
- "changes": [
- {
- "note": "Drastically reduce the bundle size by removing unused parts of included contract artifacts."
- }
- ],
- "timestamp": 1537369748
- },
- {
- "timestamp": 1536142250,
- "version": "1.0.1",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "version": "1.0.1-rc.5",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ],
- "timestamp": 1535377027
- },
- {
- "version": "1.0.1-rc.4",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ],
- "timestamp": 1535133899
- },
- {
- "version": "1.0.1-rc.3",
- "changes": [
- {
- "note": "Updated to use latest orderFactory interface, fixed `feeRecipient` spelling error in public interface",
- "pr": 936
- },
- {
- "note": "Dependencies updated"
- }
- ],
- "timestamp": 1534210131
- },
- {
- "version": "1.0.1-rc.2",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ],
- "timestamp": 1532619515
- },
- {
- "version": "1.0.1-rc.1",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ],
- "timestamp": 1532605697
- },
- {
- "timestamp": 1532357734,
- "version": "1.0.0",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1532043000,
- "version": "1.0.0-rc.1",
- "changes": [
- {
- "note": "Make fill-scenarios compatible with V2 of 0x protocol",
- "pr": 656
- }
- ]
- },
- {
- "timestamp": 1531919263,
- "version": "0.0.6",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1531149657,
- "version": "0.0.5",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1529397769,
- "version": "0.0.4",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1527616612,
- "version": "0.0.3",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1527008544,
- "version": "0.0.2",
- "changes": [
- {
- "note": "Dependencies updated"
- }
- ]
- },
- {
- "timestamp": 1527008544,
- "version": "0.0.1",
- "changes": [
- {
- "note": "Move FillScenarios out of 0x.js",
- "pr": 579
- }
- ]
- }
-]
diff --git a/packages/fill-scenarios/CHANGELOG.md b/packages/fill-scenarios/CHANGELOG.md
deleted file mode 100644
index 7df8b5ab3..000000000
--- a/packages/fill-scenarios/CHANGELOG.md
+++ /dev/null
@@ -1,135 +0,0 @@
-<!--
-changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
-Edit the package's CHANGELOG.json file only.
--->
-
-CHANGELOG
-
-## v1.1.2 - _January 15, 2019_
-
- * Dependencies updated
-
-## v1.1.1 - _January 11, 2019_
-
- * Dependencies updated
-
-## v1.1.0 - _January 9, 2019_
-
- * Add support for MultiAssetProxy (#1363)
-
-## v1.0.16 - _December 13, 2018_
-
- * Dependencies updated
-
-## v1.0.15 - _December 11, 2018_
-
- * Dependencies updated
-
-## v1.0.14 - _November 28, 2018_
-
- * Dependencies updated
-
-## v1.0.13 - _November 21, 2018_
-
- * Dependencies updated
-
-## v1.0.12 - _November 14, 2018_
-
- * Dependencies updated
-
-## v1.0.11 - _November 13, 2018_
-
- * Dependencies updated
-
-## v1.0.10 - _November 12, 2018_
-
- * Dependencies updated
-
-## v1.0.9 - _November 9, 2018_
-
- * Dependencies updated
-
-## v1.0.8 - _October 18, 2018_
-
- * Updated to use new @0xproject/contract-artifacts and @0xproject/abi-gen-wrappers packages (#1105)
-
-## v1.0.7 - _October 4, 2018_
-
- * Dependencies updated
-
-## v1.0.6 - _September 28, 2018_
-
- * Dependencies updated
-
-## v1.0.5 - _September 25, 2018_
-
- * Dependencies updated
-
-## v1.0.4 - _September 25, 2018_
-
- * Dependencies updated
-
-## v1.0.3 - _September 21, 2018_
-
- * Dependencies updated
-
-## v1.0.2 - _September 19, 2018_
-
- * Drastically reduce the bundle size by removing unused parts of included contract artifacts.
-
-## v1.0.1 - _September 5, 2018_
-
- * Dependencies updated
-
-## v1.0.1-rc.5 - _August 27, 2018_
-
- * Dependencies updated
-
-## v1.0.1-rc.4 - _August 24, 2018_
-
- * Dependencies updated
-
-## v1.0.1-rc.3 - _August 14, 2018_
-
- * Updated to use latest orderFactory interface, fixed `feeRecipient` spelling error in public interface (#936)
- * Dependencies updated
-
-## v1.0.1-rc.2 - _July 26, 2018_
-
- * Dependencies updated
-
-## v1.0.1-rc.1 - _July 26, 2018_
-
- * Dependencies updated
-
-## v1.0.0 - _July 23, 2018_
-
- * Dependencies updated
-
-## v1.0.0-rc.1 - _July 19, 2018_
-
- * Make fill-scenarios compatible with V2 of 0x protocol (#656)
-
-## v0.0.6 - _July 18, 2018_
-
- * Dependencies updated
-
-## v0.0.5 - _July 9, 2018_
-
- * Dependencies updated
-
-## v0.0.4 - _June 19, 2018_
-
- * Dependencies updated
-
-## v0.0.3 - _May 29, 2018_
-
- * Dependencies updated
-
-## v0.0.2 - _May 22, 2018_
-
- * Dependencies updated
-
-## v0.0.1 - _May 22, 2018_
-
- * Move FillScenarios out of 0x.js (#579)
diff --git a/packages/fill-scenarios/README.md b/packages/fill-scenarios/README.md
deleted file mode 100644
index 794b70e56..000000000
--- a/packages/fill-scenarios/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-## @0x/fill-scenarios
-
-0x order fill scenario generator
-
-## Installation
-
-```bash
-yarn add @0x/fill-scenarios
-```
-
-If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
-
-```json
-"compilerOptions": {
- "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
-}
-```
-
-## Contributing
-
-We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
-
-Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
-
-### Install dependencies
-
-If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
-
-```bash
-yarn config set workspaces-experimental true
-```
-
-Then install dependencies
-
-```bash
-yarn install
-```
-
-### Build
-
-To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
-
-```bash
-PKG=@0x/fill-scenarios yarn build
-```
-
-Or continuously rebuild on change:
-
-```bash
-PKG=@0x/fill-scenarios yarn watch
-```
-
-### Clean
-
-```bash
-yarn clean
-```
-
-### Lint
-
-```bash
-yarn lint
-```
diff --git a/packages/fill-scenarios/package.json b/packages/fill-scenarios/package.json
deleted file mode 100644
index d882aba76..000000000
--- a/packages/fill-scenarios/package.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "name": "@0x/fill-scenarios",
- "version": "1.1.2",
- "description": "0x order fill scenario generator",
- "main": "lib/index.js",
- "types": "lib/index.d.ts",
- "scripts": {
- "build": "yarn tsc -b",
- "build:ci": "yarn build",
- "clean": "shx rm -rf lib src/generated_contract_wrappers",
- "lint": "tslint --format stylish --project ."
- },
- "license": "Apache-2.0",
- "repository": {
- "type": "git",
- "url": "https://github.com/0xProject/0x-monorepo.git"
- },
- "bugs": {
- "url": "https://github.com/0xProject/0x-monorepo/issues"
- },
- "homepage": "https://github.com/0xProject/0x-monorepo/packages/fill-scenarios/README.md",
- "devDependencies": {
- "@0x/tslint-config": "^2.0.2",
- "@types/lodash": "4.14.104",
- "make-promises-safe": "^1.1.0",
- "shx": "^0.2.2",
- "tslint": "5.11.0",
- "typescript": "3.0.1"
- },
- "dependencies": {
- "@0x/abi-gen-wrappers": "^2.2.0",
- "@0x/base-contract": "^3.0.13",
- "@0x/contract-artifacts": "^1.3.0",
- "@0x/order-utils": "^3.1.2",
- "@0x/types": "^1.5.2",
- "@0x/typescript-typings": "^3.0.8",
- "@0x/utils": "^3.0.1",
- "@0x/web3-wrapper": "^3.2.4",
- "ethereum-types": "^1.1.6",
- "ethers": "~4.0.4",
- "lodash": "^4.17.5"
- },
- "publishConfig": {
- "access": "public"
- }
-}
diff --git a/packages/fill-scenarios/src/constants.ts b/packages/fill-scenarios/src/constants.ts
deleted file mode 100644
index 5661b059f..000000000
--- a/packages/fill-scenarios/src/constants.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export const constants = {
- AWAIT_TRANSACTION_MINED_MS: 0,
- NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
-};
diff --git a/packages/fill-scenarios/src/fill_scenarios.ts b/packages/fill-scenarios/src/fill_scenarios.ts
deleted file mode 100644
index ce1f7f9ff..000000000
--- a/packages/fill-scenarios/src/fill_scenarios.ts
+++ /dev/null
@@ -1,296 +0,0 @@
-import { DummyERC20TokenContract, DummyERC721TokenContract, ExchangeContract } from '@0x/abi-gen-wrappers';
-import * as artifacts from '@0x/contract-artifacts';
-import { assetDataUtils } from '@0x/order-utils';
-import { orderFactory } from '@0x/order-utils/lib/src/order_factory';
-import { OrderWithoutExchangeAddress, SignedOrder } from '@0x/types';
-import { BigNumber } from '@0x/utils';
-import { Web3Wrapper } from '@0x/web3-wrapper';
-import { Provider } from 'ethereum-types';
-import * as _ from 'lodash';
-
-import { constants } from './constants';
-
-export class FillScenarios {
- private readonly _web3Wrapper: Web3Wrapper;
- private readonly _userAddresses: string[];
- private readonly _coinbase: string;
- private readonly _zrxTokenAddress: string;
- private readonly _exchangeAddress: string;
- private readonly _erc20ProxyAddress: string;
- private readonly _erc721ProxyAddress: string;
- constructor(
- provider: Provider,
- userAddresses: string[],
- zrxTokenAddress: string,
- exchangeAddress: string,
- erc20ProxyAddress: string,
- erc721ProxyAddress: string,
- ) {
- this._web3Wrapper = new Web3Wrapper(provider);
- this._userAddresses = userAddresses;
- this._coinbase = userAddresses[0];
- this._zrxTokenAddress = zrxTokenAddress;
- this._exchangeAddress = exchangeAddress;
- this._erc20ProxyAddress = erc20ProxyAddress;
- this._erc721ProxyAddress = erc721ProxyAddress;
- }
- public async createFillableSignedOrderAsync(
- makerAssetData: string,
- takerAssetData: string,
- makerAddress: string,
- takerAddress: string,
- fillableAmount: BigNumber,
- expirationTimeSeconds?: BigNumber,
- ): Promise<SignedOrder> {
- return this.createAsymmetricFillableSignedOrderAsync(
- makerAssetData,
- takerAssetData,
- makerAddress,
- takerAddress,
- fillableAmount,
- fillableAmount,
- expirationTimeSeconds,
- );
- }
- public async createFillableSignedOrderWithFeesAsync(
- makerAssetData: string,
- takerAssetData: string,
- makerFee: BigNumber,
- takerFee: BigNumber,
- makerAddress: string,
- takerAddress: string,
- fillableAmount: BigNumber,
- feeRecipientAddress: string,
- expirationTimeSeconds?: BigNumber,
- ): Promise<SignedOrder> {
- return this._createAsymmetricFillableSignedOrderWithFeesAsync(
- makerAssetData,
- takerAssetData,
- makerFee,
- takerFee,
- makerAddress,
- takerAddress,
- fillableAmount,
- fillableAmount,
- feeRecipientAddress,
- expirationTimeSeconds,
- );
- }
- public async createAsymmetricFillableSignedOrderAsync(
- makerAssetData: string,
- takerAssetData: string,
- makerAddress: string,
- takerAddress: string,
- makerFillableAmount: BigNumber,
- takerFillableAmount: BigNumber,
- expirationTimeSeconds?: BigNumber,
- ): Promise<SignedOrder> {
- const makerFee = new BigNumber(0);
- const takerFee = new BigNumber(0);
- const feeRecipientAddress = constants.NULL_ADDRESS;
- return this._createAsymmetricFillableSignedOrderWithFeesAsync(
- makerAssetData,
- takerAssetData,
- makerFee,
- takerFee,
- makerAddress,
- takerAddress,
- makerFillableAmount,
- takerFillableAmount,
- feeRecipientAddress,
- expirationTimeSeconds,
- );
- }
- public async createPartiallyFilledSignedOrderAsync(
- makerAssetData: string,
- takerAssetData: string,
- takerAddress: string,
- fillableAmount: BigNumber,
- partialFillAmount: BigNumber,
- ): Promise<SignedOrder> {
- const [makerAddress] = this._userAddresses;
- const signedOrder = await this.createAsymmetricFillableSignedOrderAsync(
- makerAssetData,
- takerAssetData,
- makerAddress,
- takerAddress,
- fillableAmount,
- fillableAmount,
- );
- const exchangeInstance = new ExchangeContract(
- artifacts.Exchange.compilerOutput.abi,
- signedOrder.exchangeAddress,
- this._web3Wrapper.getProvider(),
- this._web3Wrapper.getContractDefaults(),
- );
-
- const orderWithoutExchangeAddress = _.omit(signedOrder, [
- 'signature',
- 'exchangeAddress',
- ]) as OrderWithoutExchangeAddress;
-
- const txHash = await exchangeInstance.fillOrder.sendTransactionAsync(
- orderWithoutExchangeAddress,
- partialFillAmount,
- signedOrder.signature,
- { from: takerAddress },
- );
- await this._web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
- return signedOrder;
- }
- private async _createAsymmetricFillableSignedOrderWithFeesAsync(
- makerAssetData: string,
- takerAssetData: string,
- makerFee: BigNumber,
- takerFee: BigNumber,
- makerAddress: string,
- takerAddress: string,
- makerFillableAmount: BigNumber,
- takerFillableAmount: BigNumber,
- feeRecipientAddress: string,
- expirationTimeSeconds?: BigNumber,
- ): Promise<SignedOrder> {
- await this._increaseBalanceAndAllowanceWithAssetDataAsync(makerAssetData, makerAddress, makerFillableAmount);
- await this._increaseBalanceAndAllowanceWithAssetDataAsync(takerAssetData, takerAddress, takerFillableAmount);
- // Fees
- await Promise.all([
- this._increaseERC20BalanceAndAllowanceAsync(this._zrxTokenAddress, makerAddress, makerFee),
- this._increaseERC20BalanceAndAllowanceAsync(this._zrxTokenAddress, takerAddress, takerFee),
- ]);
- const senderAddress = constants.NULL_ADDRESS;
-
- const signedOrder = await orderFactory.createSignedOrderAsync(
- this._web3Wrapper.getProvider(),
- makerAddress,
- makerFillableAmount,
- makerAssetData,
- takerFillableAmount,
- takerAssetData,
- this._exchangeAddress,
- {
- takerAddress,
- senderAddress,
- makerFee,
- takerFee,
- feeRecipientAddress,
- expirationTimeSeconds,
- },
- );
- return signedOrder;
- }
- private async _increaseERC721BalanceAndAllowanceAsync(
- tokenAddress: string,
- address: string,
- tokenId: BigNumber,
- ): Promise<void> {
- await this._increaseERC721BalanceAsync(tokenAddress, address, tokenId);
- await this._increaseERC721AllowanceAsync(tokenAddress, address, tokenId);
- }
- private async _increaseERC721AllowanceAsync(
- tokenAddress: string,
- address: string,
- tokenId: BigNumber,
- ): Promise<void> {
- const erc721Token = new DummyERC721TokenContract(
- artifacts.DummyERC721Token.compilerOutput.abi,
- tokenAddress,
- this._web3Wrapper.getProvider(),
- this._web3Wrapper.getContractDefaults(),
- );
- const txHash = await erc721Token.approve.sendTransactionAsync(this._erc721ProxyAddress, tokenId, {
- from: address,
- });
- await this._web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
- }
- private async _increaseERC721BalanceAsync(
- tokenAddress: string,
- address: string,
- tokenId: BigNumber,
- ): Promise<void> {
- const erc721Token = new DummyERC721TokenContract(
- artifacts.DummyERC721Token.compilerOutput.abi,
- tokenAddress,
- this._web3Wrapper.getProvider(),
- this._web3Wrapper.getContractDefaults(),
- );
- try {
- const currentOwner = await erc721Token.ownerOf.callAsync(tokenId);
- if (currentOwner !== address) {
- throw new Error(`Token ${tokenAddress}:${tokenId} is already owner by ${currentOwner}`);
- }
- } catch (err) {
- const txHash = await erc721Token.mint.sendTransactionAsync(address, tokenId, { from: this._coinbase });
- await this._web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
- }
- }
- private async _increaseERC20BalanceAndAllowanceAsync(
- tokenAddress: string,
- address: string,
- amount: BigNumber,
- ): Promise<void> {
- if (amount.isZero() || address === constants.NULL_ADDRESS) {
- return; // noop
- }
- await Promise.all([
- this._increaseERC20BalanceAsync(tokenAddress, address, amount),
- this._increaseERC20AllowanceAsync(tokenAddress, address, amount),
- ]);
- }
- private async _increaseERC20BalanceAsync(tokenAddress: string, address: string, amount: BigNumber): Promise<void> {
- const erc20Token = new DummyERC20TokenContract(
- artifacts.DummyERC20Token.compilerOutput.abi,
- tokenAddress,
- this._web3Wrapper.getProvider(),
- this._web3Wrapper.getContractDefaults(),
- );
- const txHash = await erc20Token.transfer.sendTransactionAsync(address, amount, {
- from: this._coinbase,
- });
- await this._web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
- }
- private async _increaseERC20AllowanceAsync(
- tokenAddress: string,
- address: string,
- amount: BigNumber,
- ): Promise<void> {
- const erc20Token = new DummyERC20TokenContract(
- artifacts.DummyERC20Token.compilerOutput.abi,
- tokenAddress,
- this._web3Wrapper.getProvider(),
- this._web3Wrapper.getContractDefaults(),
- );
- const oldMakerAllowance = await erc20Token.allowance.callAsync(address, this._erc20ProxyAddress);
- const newMakerAllowance = oldMakerAllowance.plus(amount);
-
- const txHash = await erc20Token.approve.sendTransactionAsync(this._erc20ProxyAddress, newMakerAllowance, {
- from: address,
- });
- await this._web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
- }
- private async _increaseBalanceAndAllowanceWithAssetDataAsync(
- assetData: string,
- userAddress: string,
- amount: BigNumber,
- ): Promise<void> {
- const decodedAssetData = assetDataUtils.decodeAssetDataOrThrow(assetData);
- if (assetDataUtils.isERC20AssetData(decodedAssetData)) {
- await this._increaseERC20BalanceAndAllowanceAsync(decodedAssetData.tokenAddress, userAddress, amount);
- } else if (assetDataUtils.isERC721AssetData(decodedAssetData)) {
- await this._increaseERC721BalanceAndAllowanceAsync(
- decodedAssetData.tokenAddress,
- userAddress,
- decodedAssetData.tokenId,
- );
- } else if (assetDataUtils.isMultiAssetData(decodedAssetData)) {
- for (const [index, nestedAssetDataElement] of decodedAssetData.nestedAssetData.entries()) {
- const amountsElement = decodedAssetData.amounts[index];
- const totalAmount = amount.times(amountsElement);
- await this._increaseBalanceAndAllowanceWithAssetDataAsync(
- nestedAssetDataElement,
- userAddress,
- totalAmount,
- );
- }
- }
- }
-}
diff --git a/packages/fill-scenarios/src/index.ts b/packages/fill-scenarios/src/index.ts
deleted file mode 100644
index c51145cdb..000000000
--- a/packages/fill-scenarios/src/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { FillScenarios } from './fill_scenarios';
diff --git a/packages/fill-scenarios/tsconfig.json b/packages/fill-scenarios/tsconfig.json
deleted file mode 100644
index 56689eaa3..000000000
--- a/packages/fill-scenarios/tsconfig.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": "../../tsconfig",
- "compilerOptions": {
- "outDir": "lib",
- "rootDir": "src"
- },
- "include": ["src/**/*"]
-}
diff --git a/packages/fill-scenarios/tslint.json b/packages/fill-scenarios/tslint.json
deleted file mode 100644
index dd9053357..000000000
--- a/packages/fill-scenarios/tslint.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "extends": ["@0x/tslint-config"]
-}