Catalog npm
Back to packageRELEASE DETAILS

1.0.1

npm

@0xproject/asset-buyer

Convenience package for buying assets

Published25 Sept 2018
Direct dependencies29
Transitive dependenciesNot calculated

README

Current package documentation

@0xproject/asset-buyer

Warning: In Beta, has not been extensively tested.

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, which allows users to execute Wrapped Ether 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.

In its more advanced and useful form, it integrates with the 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

yarn add @0xproject/asset-buyer

Import

import { AssetBuyer } from '@0xproject/asset-buyer';

or

var AssetBuyer = require('@0xproject/asset-buyer').AssetBuyer;

If your project is in TypeScript, add the following to your tsconfig.json:

"compilerOptions": {
    "typeRoots": ["node_modules/@0xproject/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=@0xproject/asset-buyer yarn build

Or continuously rebuild on change:

PKG=@0xproject/asset-buyer yarn watch

Clean

yarn clean

Lint

yarn lint

Run Tests

yarn test

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 29

Native requirements
29 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@0xproject/assert
Environment
{
  "local_name": "@0xproject/assert",
  "alias": false,
  "peer_metadata": null
}
^1.0.11runtime
@0xproject/connect
Environment
{
  "local_name": "@0xproject/connect",
  "alias": false,
  "peer_metadata": null
}
^2.0.4runtime
@0xproject/contract-wrappers
Environment
{
  "local_name": "@0xproject/contract-wrappers",
  "alias": false,
  "peer_metadata": null
}
^2.0.0runtime
@0xproject/json-schemas
Environment
{
  "local_name": "@0xproject/json-schemas",
  "alias": false,
  "peer_metadata": null
}
^1.0.4runtime
@0xproject/order-utils
Environment
{
  "local_name": "@0xproject/order-utils",
  "alias": false,
  "peer_metadata": null
}
^1.0.5runtime
@0xproject/subproviders
Environment
{
  "local_name": "@0xproject/subproviders",
  "alias": false,
  "peer_metadata": null
}
^2.0.5runtime
@0xproject/types
Environment
{
  "local_name": "@0xproject/types",
  "alias": false,
  "peer_metadata": null
}
^1.1.1runtime
@0xproject/typescript-typings
Environment
{
  "local_name": "@0xproject/typescript-typings",
  "alias": false,
  "peer_metadata": null
}
^2.0.2runtime
@0xproject/utils
Environment
{
  "local_name": "@0xproject/utils",
  "alias": false,
  "peer_metadata": null
}
^1.0.11runtime
@0xproject/web3-wrapper
Environment
{
  "local_name": "@0xproject/web3-wrapper",
  "alias": false,
  "peer_metadata": null
}
^3.0.1runtime
ethereum-types
Environment
{
  "local_name": "ethereum-types",
  "alias": false,
  "peer_metadata": null
}
^1.0.8runtime
lodash
Environment
{
  "local_name": "lodash",
  "alias": false,
  "peer_metadata": null
}
^4.17.10runtime
@0xproject/tslint-config
Environment
{
  "local_name": "@0xproject/tslint-config",
  "alias": false,
  "peer_metadata": null
}
^1.0.7development
@types/lodash
Environment
{
  "local_name": "@types/lodash",
  "alias": false,
  "peer_metadata": null
}
^4.14.116development
@types/mocha
Environment
{
  "local_name": "@types/mocha",
  "alias": false,
  "peer_metadata": null
}
^2.2.42development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
*development
chai
Environment
{
  "local_name": "chai",
  "alias": false,
  "peer_metadata": null
}
^4.0.1development
chai-as-promised
Environment
{
  "local_name": "chai-as-promised",
  "alias": false,
  "peer_metadata": null
}
^7.1.0development
chai-bignumber
Environment
{
  "local_name": "chai-bignumber",
  "alias": false,
  "peer_metadata": null
}
^2.0.1development
copyfiles
Environment
{
  "local_name": "copyfiles",
  "alias": false,
  "peer_metadata": null
}
^1.2.0development
dirty-chai
Environment
{
  "local_name": "dirty-chai",
  "alias": false,
  "peer_metadata": null
}
^2.0.1development
make-promises-safe
Environment
{
  "local_name": "make-promises-safe",
  "alias": false,
  "peer_metadata": null
}
^1.1.0development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^4.1.0development
npm-run-all
Environment
{
  "local_name": "npm-run-all",
  "alias": false,
  "peer_metadata": null
}
^4.1.2development
nyc
Environment
{
  "local_name": "nyc",
  "alias": false,
  "peer_metadata": null
}
^11.0.1development
shx
Environment
{
  "local_name": "shx",
  "alias": false,
  "peer_metadata": null
}
^0.2.2development
tslint
Environment
{
  "local_name": "tslint",
  "alias": false,
  "peer_metadata": null
}
5.11.0development
typedoc
Environment
{
  "local_name": "typedoc",
  "alias": false,
  "peer_metadata": null
}
0.12.0development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
3.0.1development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-oTZMiSWuCiHFeL5xuI1h4DCgNPXBrd0Qw+np9bfLD2KR/eccnO6DLpbwmuFLrk4QnYczcxFayCk4vetcNs6jJQ==",
  "shasum": "768f19a523b2c7c6ae53ac2b2d58f893ba7496be",
  "tarball": "https://registry.npmjs.org/@0xproject/asset-buyer/-/asset-buyer-1.0.1.tgz",
  "fileCount": 58,
  "unpackedSize": 128426,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqp9kCRA9TVsSAnZWagAAxMIP/1jPlFkSMLYVncZmPqNK\naYT0TlbMbSeLJAWa6OokBtMbU1wmkdplXxRz9VgSKJFnf4Wea9Nwqe3HduVE\nsCEFzutWbRW+JqSrJFNMJs7apAyRHutihjKfkF5VabWToZTCvYhbZ+Mi34aP\nWcr89rxFlSems9OwznjjumhIZD4XKvDykkzSmpqTaTB6vqdQ1ecv0GnPAKPI\nA3Fpi+RTTrxgBTyeJbyXkjuW4mqQiWyiVDTpPAsgeSu6rkIQsGfnPgrV2n6S\nwGnJqEPbT29pykWY1g4Kgk8XqSla/qTLktVhgpYZXMLihf6tvZvCLKQi8R49\ncj+guiCOKIPcl/7IariOZHe9BWYOUq9giDzqugjTrUE4sr+pzlypHmw+j7qV\nP+J9Rb6Wn/TaJuu3NtUObfrr3KhLa86QC4ql6ez7VuHzsPbh+Yq99OpJupPw\nXHR0Z1GUgxZx/XWuhrKeEgPNgfXiduTb2aeFNXekhqbY5HUTeUmWoPnfUuv0\nSQp3ONkfiIXZ4kd+hDgyLsMwNy2UVx7l3VYHOf73SJkVd9rXbeHBwe12vnev\ng867CcoEeFVwz/AE7HKcIEcJNbcKg3iTQIGTsU1Mr5jRqWb+5ilLYf7Atbtd\nlguJqgooerXaTDNRYgxNbtLWmmK17Ug3GXMnYiF8hNiBTeNtJ/wDirvFr5FV\nbJZ2\r\n=B0vj\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIQDnqt5FMeQVEC/ols3zYK5W5kLndq0Q7L+M4TpHrGw49wIgaGARuCV5AUYT3e/3qo52rCvR4qZtEUn9cwkYddH7P7Q="
    }
  ]
}

Repository

PENDING
0xproject/0x-monorepo

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:31 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:387174aecdf052d56d3dac5d9093887a55614c4ddd4aec668e82332685149741

Other collected versions

2.0.04 Oct1.0.228 Sept1.0.025 SeptView all collected versions →