- 0x.js@6.0.12 - @0x/abi-gen-wrappers@5.0.2 - @0x/asset-buyer@6.1.8 - @0x/asset-swapper@0.0.4 - @0x/connect@5.0.13 - @0x/contract-addresses@3.0.2 - @0x/contract-wrappers@9.1.7 - @0x/fill-scenarios@3.0.13 - @0x/instant@1.0.27 - @0x/metacoin@0.0.54 - @0x/migrations@4.1.9 - @0x/order-utils@8.2.2 - @0x/order-watcher@4.0.14 - @0x/testnet-faucets@1.0.83 - @0x/website@0.0.86 - @0x/contracts-asset-proxy@2.2.2 - @0x/contracts-coordinator@2.0.7 - @0x/contracts-dev-utils@0.0.4 - @0x/contracts-erc1155@1.1.9 - @0x/contracts-erc20@2.2.8 - @0x/contracts-erc721@2.1.9 - @0x/contracts-exchange@2.1.8 - @0x/contracts-exchange-forwarder@3.0.6 - @0x/contracts-exchange-libs@3.0.2 - @0x/contracts-extensions@4.0.2 - @0x/contracts-multisig@3.1.8 - @0x/contracts-test-utils@3.1.10 - @0x/contracts-utils@3.1.9
@0x/asset-swapper
Convenience package for buying assets represented on the Ethereum blockchain using 0x.
Installation
yarn add @0x/asset-swapper
Import
import { SwapQuoter } from '@0x/asset-swapper';
or
var SwapQuoter = require('@0x/asset-buyer').SwapQuoter;
If your project is in TypeScript, add the following to your tsconfig.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 before getting started.
Install dependencies
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
yarn config set workspaces-experimental true
Then install dependencies
yarn install
Build
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
PKG=@0x/asset-swapper yarn build
Or continuously rebuild on change:
PKG=@0x/asset-swapper yarn watch
Clean
yarn clean
Lint
yarn lint
Run Tests
yarn test