Catalog npm
Back to packageRELEASE DETAILS

9.1.5

npm

0x.js

A javascript library for interacting with the 0x protocol

0x.js0xprojectethereumexchangetokens
Published3 Mar 2020
Direct dependencies45
Transitive dependenciesNot calculated

README

Current package documentation

0x.js

A TypeScript/Javascript library for interacting with the 0x protocol. It is a high level package which combines a number of underlying packages such as order-utils and asset-data-utils.

Read the Documentation.

Installation

0x.js ships as both a UMD module and a CommonJS package.

Install

npm install 0x.js --save

Import

import {
    assetDataUtils,
    BigNumber,
    ContractWrappers,
    generatePseudoRandomSalt,
    orderHashUtils,
    signatureUtils,
} from '0x.js';

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

"compilerOptions": {
    "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}

UMD:

Install

Download the UMD module from our releases page and add it to your project.

Import

<script type="text/javascript" src="0x.js"></script>

Webpack config

If bundling your project with Webpack, add the following to your webpack.config.js:

If building for web:

node: {
    fs: 'empty';
}

If building a node library:

externals: {
    fs: true;
}

ContractWrappers uses WebAssembly to simulate Ethereum calls. This toolchain involves generated 'glue' code that requires the fs built-in, but won't actually use it in a web environment. We tell Webpack not to resolve them since we won't need them. The specific dependency is here.

Also see:

Contributing

We strongly recommend that the community help us make improvements and determine the future direction of 0x protocol. 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.js yarn build

Or continuously rebuild on change:

PKG=0x.js 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 45

Native requirements
45 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@0x/abi-gen-wrappers
Environment
{
  "local_name": "@0x/abi-gen-wrappers",
  "alias": false,
  "peer_metadata": null
}
^5.4.0-beta.3runtime
@0x/assert
Environment
{
  "local_name": "@0x/assert",
  "alias": false,
  "peer_metadata": null
}
^3.0.7runtime
@0x/asset-swapper
Environment
{
  "local_name": "@0x/asset-swapper",
  "alias": false,
  "peer_metadata": null
}
^4.4.0runtime
@0x/base-contract
Environment
{
  "local_name": "@0x/base-contract",
  "alias": false,
  "peer_metadata": null
}
^6.2.1runtime
@0x/contract-wrappers
Environment
{
  "local_name": "@0x/contract-wrappers",
  "alias": false,
  "peer_metadata": null
}
^13.6.3runtime
@0x/order-utils
Environment
{
  "local_name": "@0x/order-utils",
  "alias": false,
  "peer_metadata": null
}
^10.2.4runtime
@0x/subproviders
Environment
{
  "local_name": "@0x/subproviders",
  "alias": false,
  "peer_metadata": null
}
^6.0.8runtime
@0x/types
Environment
{
  "local_name": "@0x/types",
  "alias": false,
  "peer_metadata": null
}
^3.1.2runtime
@0x/typescript-typings
Environment
{
  "local_name": "@0x/typescript-typings",
  "alias": false,
  "peer_metadata": null
}
^5.0.2runtime
@0x/utils
Environment
{
  "local_name": "@0x/utils",
  "alias": false,
  "peer_metadata": null
}
^5.4.1runtime
@0x/web3-wrapper
Environment
{
  "local_name": "@0x/web3-wrapper",
  "alias": false,
  "peer_metadata": null
}
^7.0.7runtime
@types/web3-provider-engine
Environment
{
  "local_name": "@types/web3-provider-engine",
  "alias": false,
  "peer_metadata": null
}
^14.0.0runtime
ethereum-types
Environment
{
  "local_name": "ethereum-types",
  "alias": false,
  "peer_metadata": null
}
^3.1.0runtime
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": null
}
~4.0.4runtime
lodash
Environment
{
  "local_name": "lodash",
  "alias": false,
  "peer_metadata": null
}
^4.17.11runtime
web3-provider-engine
Environment
{
  "local_name": "web3-provider-engine",
  "alias": false,
  "peer_metadata": null
}
14.0.6runtime
@0x/contract-addresses
Environment
{
  "local_name": "@0x/contract-addresses",
  "alias": false,
  "peer_metadata": null
}
^4.9.0development
@0x/dev-utils
Environment
{
  "local_name": "@0x/dev-utils",
  "alias": false,
  "peer_metadata": null
}
^3.2.1development
@0x/migrations
Environment
{
  "local_name": "@0x/migrations",
  "alias": false,
  "peer_metadata": null
}
^6.2.4development
@0x/ts-doc-gen
Environment
{
  "local_name": "@0x/ts-doc-gen",
  "alias": false,
  "peer_metadata": null
}
^0.0.22development
@0x/tslint-config
Environment
{
  "local_name": "@0x/tslint-config",
  "alias": false,
  "peer_metadata": null
}
^4.0.0development
@types/lodash
Environment
{
  "local_name": "@types/lodash",
  "alias": false,
  "peer_metadata": null
}
4.14.104development
@types/mocha
Environment
{
  "local_name": "@types/mocha",
  "alias": false,
  "peer_metadata": null
}
^5.2.7development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
*development
@types/sinon
Environment
{
  "local_name": "@types/sinon",
  "alias": false,
  "peer_metadata": null
}
^2.2.2development
awesome-typescript-loader
Environment
{
  "local_name": "awesome-typescript-loader",
  "alias": false,
  "peer_metadata": null
}
^5.2.1development
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
}
^3.0.0development
copyfiles
Environment
{
  "local_name": "copyfiles",
  "alias": false,
  "peer_metadata": null
}
^2.0.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
}
^6.2.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
opn-cli
Environment
{
  "local_name": "opn-cli",
  "alias": false,
  "peer_metadata": null
}
^3.1.0development
shx
Environment
{
  "local_name": "shx",
  "alias": false,
  "peer_metadata": null
}
^0.2.2development
sinon
Environment
{
  "local_name": "sinon",
  "alias": false,
  "peer_metadata": null
}
^4.0.0development
source-map-support
Environment
{
  "local_name": "source-map-support",
  "alias": false,
  "peer_metadata": null
}
^0.5.0development
terser-webpack-plugin
Environment
{
  "local_name": "terser-webpack-plugin",
  "alias": false,
  "peer_metadata": null
}
^2.0.1development
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
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
3.0.1development
uglifyjs-webpack-plugin
Environment
{
  "local_name": "uglifyjs-webpack-plugin",
  "alias": false,
  "peer_metadata": null
}
^2.0.1development
webpack
Environment
{
  "local_name": "webpack",
  "alias": false,
  "peer_metadata": null
}
^4.20.2development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-Aopxd3zzJgQjX1yosm0L6p4ddNy33UvtcL1mkZhadG7aJ6u9LGLn47QxpA+BqLf0JNvS+iwctOFkKFx0ZKCi2g==",
  "shasum": "def75e8cacdf573d67f0c3f677135640a0efaca6",
  "tarball": "https://registry.npmjs.org/0x.js/-/0x.js-9.1.5.tgz",
  "fileCount": 15,
  "unpackedSize": 30358033,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXgcvCRA9TVsSAnZWagAANzAP/jZvWT/dpFubMVJo8dZU\nnSiJ51KNmVsX47Q06Q6U50h09riF/MMtMOjBM3Zt7ulteqW02mFzxK2ZVRKJ\nitGTXOJ3BKtAkCoI3IVgDsw3iQvm2QVr5kRQ4iCsapzfQJ0RDEA1M8+TVSDo\ncXalBpEMkvmTGTlZxkKRnjV96bLIffmWQtXOunUrt+MZ41enodqAu1k3Q4T1\ndwwCQWxXVnhnC58RuHkb6GImJef9qmDhqQV2IVkbtRgEOjjRJ8TEg/Nq54Z6\n+rHA5Utlk5CSgbEqM2GOO9OcZ8nyuwkJmW3KIL8r8KR0+TsB9ucpkN55+a6G\nNRhBupfSLDEWt7h60D5xmiU5PhhupAht6eCb2F+dq9xfglR5Qu6ImHdvEYCg\noQx9ELO+Tbz+ytq9sYaWy3XDi23zsySfFxAm9esoU4qtyHPkwYaq8aF1t5gT\nvPS4g4NSNIpgK2r4mOrNLrbed2/SHFpra+RbNhEmx26hr2ZIoI3sjWGIrpQt\nZBq5QiLmrAllyWRWpAQD3lU81ZPMROwomSS5ehHMD0D8pibvJ0CS3Z55oQ0E\n2/J22JyUrrabLMPZ10FqAf+GJwlEExf7kzRYDW2tIVbBsmii3hBlmQpqwnlZ\nMtngXKKkwFPrpo0HuStcrWfDPS1Rpdoue/kVYitMRh5kQ+nZSP9bLtNHQXkX\nKxcs\r\n=+f9Q\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIDbLW12MKu6v5nehAJhC9uc6ddjEevCPf4E+IuG1NRrtAiEAm1Ishnr21wI4vdO6FiZAJ+mj94k101Ja0sYhtuhnAaA="
    }
  ]
}

Repository

PENDING
0xproject/0x-monorepo

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
0xproject/0x.js

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:47 UTC

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

Record identity

package_version:37a8c6a95db47f7646083e0417ee1d69b8db97b8ea6bcc273dfe250592020bf2

Other collected versions

9.2.015 Jul9.1.624 Jun9.1.427 Feb9.1.326 Feb9.1.225 Feb9.1.115 FebView all collected versions →