Catalog npm
Back to packageRELEASE DETAILS

0.0.2

npm

0x-exchange-events

A library that queries 0x exchange events from a 0x subgraph deployed on graphprotocol

Published19 Feb 2019
Direct dependencies16
Transitive dependenciesNot calculated

README

Current package documentation

0x Exchange Events

This repository provides a library that queries 0x exchange events from a 0x subgraph deployed on graphprotocol.

Unlike the 0x-event-extractor or extracting event logs via the getLogsAsync method of 0x.js, this client does not require a server and allows event filtering beyond the indexed event arguments (i.e. makerAddress, feeRecipientAddress, orderHash for the Fill event).

Import this module and easily filter for the exchange event you need.

Install

yarn add 0x-exchange-events

Usage

You get started by constructing an instance of the HttpEventClient

import { HttpEventClient } from "0x-exchange-events";
const client = new HttpEventClient();

Get Fill Events

Get 50 fill events on version 2 of the 0x protocol, filtered by makerAssetData and takerAssetData

const FillEvents = await client.getFillEventsAsync(50, {
  // Filter arguments
  makerAssetDataV2: "0xf47261b0000000000000000000000000e45b7cd82ac0f3f6cfc9ecd165b79d6f87ed2875",
  takerAssetDataV2: "0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  ...
});

Example output:

{
  "data": {
    "filledOrders": [
      {
        "__typename": "FilledOrder",
        "feeRecipient": "0x8124071f810d533ff63de61d0c98db99eeb99d64",
        "id": "0x92287ef67032a57bd324a3b31b7c0af4f33c397ff77fcaa43e211b74eeb78bf8",
        "maker": "0xd964af361d1e6a7941126532b80fe5fcc726eefa",
        "makerAssetDataV2": "0xf47261b0000000000000000000000000e45b7cd82ac0f3f6cfc9ecd165b79d6f87ed2875",
        "makerAssetFilledAmount": "2712000000000000000000",
        "makerFeePaid": "0",
        "senderV2": "0x0681e844593a051e2882ec897ecd5444efe19ff2",
        "taker": "0x0681e844593a051e2882ec897ecd5444efe19ff2",
        "takerAssetDataV2": "0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "takerAssetFilledAmount": "2110010000000000",
        "takerFeePaid": "0"
      },
      {
        "__typename": "FilledOrder",
        "feeRecipient": "0x8124071f810d533ff63de61d0c98db99eeb99d64",
        "id": "0xba583c97f2dd534993b229329ff4bf851e6cf12ea15b889aafd1f288bee82f39",
        "maker": "0x322f68d55eab8e2e98e573519c60930797892d25",
        "makerAssetDataV2": "0xf47261b0000000000000000000000000e45b7cd82ac0f3f6cfc9ecd165b79d6f87ed2875",
        "makerAssetFilledAmount": "2768827972093705",
        "makerFeePaid": "0",
        "senderV2": "0x0681e844593a051e2882ec897ecd5444efe19ff2",
        "taker": "0x0681e844593a051e2882ec897ecd5444efe19ff2",
        "takerAssetDataV2": "0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "takerAssetFilledAmount": "2712000000000000000000",
        "takerFeePaid": "0"
      },
      ...
    ]
  },
  "loading": false,
  "networkStatus": 7,
  "stale": false,
  "totalEntries": 50
}

Get Cancel Events

Get 50 cancel events on version 2 of the 0x protocol, filtered by makerAssetData and takerAssetData

const CancelEvents = await client.getCancelEventsAsync(50, {
  // Filter arguments
  makerAssetDataV2: "0xf47261b000000000000000000000000022365168c8705e95b2d08876c23a8c13e3ad72e2",
  takerAssetDataV2: "0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  ...
});

Example output:

{
  "data": {
    "cancelledOrders": [
      {
        "__typename": "CancelledOrder",
        "feeRecipient": "0x0000000000000000000000000000000000000000",
        "id": "0xf8bdd90394afc6d2c8c2da63fc447e42414811e024fb658a0ca46852adf748b8",
        "maker": "0x7284bfcad25b9d16c5bacf72783c8a16bde5763b",
        "makerAssetDataV2": "0xf47261b000000000000000000000000022365168c8705e95b2d08876c23a8c13e3ad72e2",
        "senderV2": "0x7284bfcad25b9d16c5bacf72783c8a16bde5763b",
        "takerAssetDataV2": "0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
      },
      {
        "__typename": "CancelledOrder",
        "feeRecipient": "0x0000000000000000000000000000000000000000",
        "id": "0xcd912c91059f1de6bb3aa6baa2c3d521a891723ea0120480f491287ed086a119",
        "maker": "0xbf8d14e03394eac425caa7ea6eb5de3fd766cfd4",
        "makerAssetDataV2": "0xf47261b000000000000000000000000022365168c8705e95b2d08876c23a8c13e3ad72e2",
        "senderV2": "0xbf8d14e03394eac425caa7ea6eb5de3fd766cfd4",
        "takerAssetDataV2": "0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
      },
      ...
    ]
  },
  "loading": false,
  "networkStatus": 7,
  "stale": false,
  "totalEntries": 50
}

TODO

  • Handle ordering
  • Support version 1 of the 0x exchange contract
  • Support Rinkeby and Kovan

Downloads & popularity

Awaiting observations

No metric observations yet

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

Declared dependencies 16

Native requirements
16 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
apollo-boost
Environment
{
  "local_name": "apollo-boost",
  "alias": false,
  "peer_metadata": null
}
^0.1.28runtime
bignumber.js
Environment
{
  "local_name": "bignumber.js",
  "alias": false,
  "peer_metadata": null
}
^8.0.2runtime
cross-fetch
Environment
{
  "local_name": "cross-fetch",
  "alias": false,
  "peer_metadata": null
}
^3.0.1runtime
detect-node
Environment
{
  "local_name": "detect-node",
  "alias": false,
  "peer_metadata": null
}
^2.0.4runtime
graphql
Environment
{
  "local_name": "graphql",
  "alias": false,
  "peer_metadata": null
}
^14.1.1runtime
@0x/order-utils
Environment
{
  "local_name": "@0x/order-utils",
  "alias": false,
  "peer_metadata": null
}
^6.1.0development
@0x/tslint-config
Environment
{
  "local_name": "@0x/tslint-config",
  "alias": false,
  "peer_metadata": null
}
^3.0.0development
@types/detect-node
Environment
{
  "local_name": "@types/detect-node",
  "alias": false,
  "peer_metadata": null
}
^2.0.0development
@types/graphql
Environment
{
  "local_name": "@types/graphql",
  "alias": false,
  "peer_metadata": null
}
^14.0.7development
@types/jest
Environment
{
  "local_name": "@types/jest",
  "alias": false,
  "peer_metadata": null
}
^24.0.5development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^11.9.4development
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^24.1.0development
ts-jest
Environment
{
  "local_name": "ts-jest",
  "alias": false,
  "peer_metadata": null
}
^23.10.5development
tslint
Environment
{
  "local_name": "tslint",
  "alias": false,
  "peer_metadata": null
}
^5.12.1development
tslint-config-prettier
Environment
{
  "local_name": "tslint-config-prettier",
  "alias": false,
  "peer_metadata": null
}
^1.18.0development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^3.3.3development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-ToRTPNJZ/USEG0yva65dsvizMYi4ro0Rmy5KvZvgrHokq0vUP8jzhyrYrjWNM6aQJurceN2CGtQOZICclozb2g==",
  "shasum": "affec82c1175bf7b2a7d244413b07ba59c39b800",
  "tarball": "https://registry.npmjs.org/0x-exchange-events/-/0x-exchange-events-0.0.2.tgz",
  "fileCount": 22,
  "unpackedSize": 218760,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJca5YRCRA9TVsSAnZWagAAQ5QQAIBQNnkDYcdXpPztP+o7\n1RrU8dY7wJTutxylamWDTHjfLRxwkBZfhcBxM1iZyxad2E/SiZUuqUmyGqQ1\nuYJGREbkWMGDaZey6FsH61Pkj7bzmtDlGeJMCgwQ/rrYUUpHB2p4Xci4/POm\nVyXiYozjizFAR5tdMtVqKK0otdgfENaLu843t/EyW11uOOnMwv2t7AxK4utP\nna4Qe7tGE0FlW9mng6Xoe284XsQOv3aURc0ipZMEoIvb6vakk+i4fV4+6t2Y\nGoHD4dVjE5tpuIZmh8gLW6q1iAr0RvvC9mVGnO0ilVGRVIUhJ+XJWcdw1e3x\nRwCMl1LBQ+I3vEJv0Ikp0st36vk2hy07iO/ZR97Z3EnHHhjYXmcOHGnLgh19\noFnRAFYS13ksKC/KVGjumaB3ehvnkBFbXC+15dxhEM1HI7BNeUiWv4NVb9ow\nKwXT/MVNkA2xHG9sJxU7E/MkhG00Z0fpndyl7mkuIf7sagObgRYF1eXz7vrg\nQumB2QFp9lFMyXwnU0R8Zhn7aqXKLjcIgS0nEROE0Vh4tn27RxRH6HO19+1F\nNFzh+l4cLQrj+gI7kiUqpw/e05WPIlZxldoeRjsvkdgeLWOcsRZM3ko27IwB\nAUV6NTmBLps597glMCx2tyTf0sWuQIlTCR0XPaW36QXI6R4xBGY7GdNlZbpx\nxrIR\r\n=I7rw\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIEh1UE3MV1VRlAGFxE95uXPr6CbwGcgatMvX4XgMa285AiEAoyVEDye/dvYAw9tidfVL8UM+Q0dXPfwnRihuiV+6CYc="
    }
  ]
}

Repository

PENDING
michaelhly/0x-exchange-events

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:711f66c2f48ffb53fffe0178e2ba29dada78271b46e1f85487b6e2d77b0f2cdf

Other collected versions

0.0.119 FebView all collected versions →