Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gnosis.pm/dex-pricegraph

Package Overview
Dependencies
Maintainers
14
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gnosis.pm/dex-pricegraph

This crate provides WebAssembly bindings to the `pricegraph` crate so that it can be used from JS environments.

  • 0.0.1-alpha.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
14
Created
Source

Pricegraph Wasm Bindings

This crate provides WebAssembly bindings to the pricegraph crate so that it can be used from JS environments.

Usage

The Wasm bindings can be used from JavaScript or TypeScript by importing the generated NodeJS module:

import { PriceEstimator } from "@gnosis.pm/dex-pricegraph";

const estimator = new PriceEstimator(encodedOrders);
const [WETH, DAI] = [1, 7];
console.log(
    "WETH/DAI price estimate:",
    estimator.estimatePrice(WETH, DAI, 100 * 10e18),
);
esimator.free();

Building

This crate and the resulting npm package are created using wasm-pack.

To run integration tests inside a NodeJS environment:

cd pricegraph/wasm
wasm-pack test --node

To generate the pkg/ directory containing the npm package:

cd pricegraph/wasm
wasm-pack build --scope gnosis.pm --target nodejs

FAQs

Package last updated on 19 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc