Catalog npm
Back to packageRELEASE DETAILS

6.2.0-beta.3

npm

@0x/asset-buyer

Convenience package for discovering and buying assets with Ether.

Published20 Nov 2019
Direct dependencies30
Transitive dependenciesNot calculated

README

Version 6.2.0-beta.3 documentation

@0x/asset-buyer

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 @0x/asset-buyer

Import

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

or

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

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-buyer yarn build

Or continuously rebuild on change:

PKG=@0x/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 30

Native requirements
30 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
lodash
Environment
{
  "local_name": "lodash",
  "alias": false,
  "peer_metadata": null
}
^4.17.11runtime
@0x/types
Environment
{
  "local_name": "@0x/types",
  "alias": false,
  "peer_metadata": null
}
^2.5.0-beta.2runtime
@0x/utils
Environment
{
  "local_name": "@0x/utils",
  "alias": false,
  "peer_metadata": null
}
^4.6.0-beta.2runtime
@0x/assert
Environment
{
  "local_name": "@0x/assert",
  "alias": false,
  "peer_metadata": null
}
^2.2.0-beta.2runtime
@0x/connect
Environment
{
  "local_name": "@0x/connect",
  "alias": false,
  "peer_metadata": null
}
^5.1.0-beta.2runtime
ethereum-types
Environment
{
  "local_name": "ethereum-types",
  "alias": false,
  "peer_metadata": null
}
^2.2.0-beta.2runtime
@0x/order-utils
Environment
{
  "local_name": "@0x/order-utils",
  "alias": false,
  "peer_metadata": null
}
^8.5.0-beta.3runtime
@0x/json-schemas
Environment
{
  "local_name": "@0x/json-schemas",
  "alias": false,
  "peer_metadata": null
}
^4.1.0-beta.2runtime
@0x/subproviders
Environment
{
  "local_name": "@0x/subproviders",
  "alias": false,
  "peer_metadata": null
}
^5.1.0-beta.2runtime
@0x/web3-wrapper
Environment
{
  "local_name": "@0x/web3-wrapper",
  "alias": false,
  "peer_metadata": null
}
^6.1.0-beta.2runtime
@0x/contract-wrappers
Environment
{
  "local_name": "@0x/contract-wrappers",
  "alias": false,
  "peer_metadata": null
}
^12.2.0-beta.3runtime
@0x/typescript-typings
Environment
{
  "local_name": "@0x/typescript-typings",
  "alias": false,
  "peer_metadata": null
}
^4.4.0-beta.2runtime
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
chai
Environment
{
  "local_name": "chai",
  "alias": false,
  "peer_metadata": null
}
^4.0.1development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^6.2.0development
tslint
Environment
{
  "local_name": "tslint",
  "alias": false,
  "peer_metadata": null
}
5.11.0development
typedoc
Environment
{
  "local_name": "typedoc",
  "alias": false,
  "peer_metadata": null
}
^0.15.0development
typemoq
Environment
{
  "local_name": "typemoq",
  "alias": false,
  "peer_metadata": null
}
^2.1.0development
dirty-chai
Environment
{
  "local_name": "dirty-chai",
  "alias": false,
  "peer_metadata": null
}
^2.0.1development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
3.0.1development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
*development
npm-run-all
Environment
{
  "local_name": "npm-run-all",
  "alias": false,
  "peer_metadata": null
}
^4.1.2development
@types/mocha
Environment
{
  "local_name": "@types/mocha",
  "alias": false,
  "peer_metadata": null
}
^5.2.7development
@types/lodash
Environment
{
  "local_name": "@types/lodash",
  "alias": false,
  "peer_metadata": null
}
4.14.104development
@0x/ts-doc-gen
Environment
{
  "local_name": "@0x/ts-doc-gen",
  "alias": false,
  "peer_metadata": null
}
^0.0.22development
chai-bignumber
Environment
{
  "local_name": "chai-bignumber",
  "alias": false,
  "peer_metadata": null
}
^3.0.0development
chai-as-promised
Environment
{
  "local_name": "chai-as-promised",
  "alias": false,
  "peer_metadata": null
}
^7.1.0development
@0x/tslint-config
Environment
{
  "local_name": "@0x/tslint-config",
  "alias": false,
  "peer_metadata": null
}
^3.1.0-beta.2development
make-promises-safe
Environment
{
  "local_name": "make-promises-safe",
  "alias": false,
  "peer_metadata": null
}
^1.1.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "f12f037f6aedf26fcc0dd7be0adb678e5666f437",
  "tarball": "https://registry.npmjs.org/@0x/asset-buyer/-/asset-buyer-6.2.0-beta.3.tgz",
  "fileCount": 96,
  "integrity": "sha512-E0/F3hBOsM1eVlMFqlJs9Ek9mO7hEhbGfwuvSwyoOBuAQfwtomJKrKKO16gSGlA0Yn0jfZFiajBx4NNs0z7xzA==",
  "signatures": [
    {
      "sig": "MEUCIQCTRjZ0Fei1RGyW+N/gELPOl0nrizyQRMYzbe0cvTRyBAIgfd/eBw3SXsJA1XkhNE3Bxlwl3dUXMayvhAW8UQnJ0F4=",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 295842,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1PrCCRA9TVsSAnZWagAAZagP/AzDSOH/Ap9qdVaGeQQA\n/UFEt26/vD8QXjRaXivYfiGTfi7E6byQwMMvf91/1Qz4bc7TUTkSvLTsbX5+\nlFL7uLii7UTX03wTzwagEOdYqTF9Y5eTCm5/KHaZpd/7iBG/YIeJI3nAj+KO\nJmq8v4/gJw4XVU9cJpB0zn783XbOl/nwsqxYmmAF4fsjUFTzJxkHHv327LTU\nOlSI36ZNoLMTrPLdTOXj23OGIdf6lchXQfqeIaQHK1VrKlvZsgzAPOyoYU7l\n14ANiE4MqVmNWTv0yZunAxgLtn1tcOmSMkbgtl6HMqLfmKMdTtcSFB3/7zD9\nDvhcUxe5Id1kS2lko2eF/XgDIVtmAc5iQ2nOCdlatNfgEImfZ7TtqjxjmoeU\naZv/GrnOC4MsqzP1xFTxxdOlL9z/aE23pciJrG18ZhfEZjqxRyXz9liXGk4p\nQNVttJbBRa/d4S3F97TynR2HvOE9ARCT2l1HTludrg5Sz+nfnKJidvMVM37x\nhHH3Orn02q8FHE26F2Hjmln0IwiSg/MZTxqUqYCooA2KKhtXZL2ALWdO6/Bd\nV5dxuK4onPU70Nka5NzVHIOXQ94eq5I9xD8SliLDOfLraGmHsm7XiUnZhINb\nRMq+SbfLURLO+CqiG+pjCnDZG/Gv32NqBSf7/18s515hQ9rPOF6aSpu7S2uI\nSa97\r\n=Jgfo\r\n-----END PGP SIGNATURE-----\r\n"
}

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 20 Oct, 22:21 UTC

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

Record identity

package_version:200e91d1c73c2f448040e050695e5d99059bdb241cd94ec9a2510b116dff0afa

Other collected versions

6.2.0-beta.217 Nov6.2.0-beta.17 Nov6.2.0-beta.03 Oct6.1.1417 Sept6.1.133 Sept6.1.1222 AugView all collected versions →