updated README.md

This commit is contained in:
David Sun
2019-07-11 10:05:56 -07:00
parent ff9a2b2d9a
commit 8734b70f83

View File

@@ -1,25 +1,23 @@
## @0x/asset-buyer ## @0x/asset-swapper
Convenience package for buying assets represented on the Ethereum blockchain using 0x. In its simplest form, the package helps in the usage of the [0x forwarder contract](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/forwarder-specification.md), which allows users to execute [Wrapped Ether](https://weth.io/) based 0x orders without having to set allowances, wrap Ether or own ZRX, meaning they can buy tokens with Ether alone. Given some liquidity (0x signed orders), it helps estimate the Ether cost of buying a certain asset (giving a range) and then buying that asset. Convenience package for buying assets represented on the Ethereum blockchain using 0x.
In its more advanced and useful form, it integrates with the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api) and takes care of sourcing liquidity for you given an SRA compliant endpoint. The final result is a library that tells you what assets are available, provides an Ether based quote for any asset desired, and allows you to buy that asset using Ether alone.
## Installation ## Installation
```bash ```bash
yarn add @0x/asset-buyer yarn add @0x/asset-swapper
``` ```
**Import** **Import**
```typescript ```typescript
import { AssetBuyer } from '@0x/asset-buyer'; import { SwapQuoter } from '@0x/asset-swapper';
``` ```
or or
```javascript ```javascript
var AssetBuyer = require('@0x/asset-buyer').AssetBuyer; var SwapQuoter = require('@0x/asset-buyer').SwapQuoter;
``` ```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
@@ -55,13 +53,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory: To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash ```bash
PKG=@0x/asset-buyer yarn build PKG=@0x/asset-swapper yarn build
``` ```
Or continuously rebuild on change: Or continuously rebuild on change:
```bash ```bash
PKG=@0x/asset-buyer yarn watch PKG=@0x/asset-swapper yarn watch
``` ```
### Clean ### Clean