delta-rest-client

1.0.0 • Public • Published

Delta Rest Client

Delta Exchange is a crypto derivatives exchange where you can trade bitcoin, ethereum, ripple futures at 20x leverage. This npm package is a wrapper around rest apis of Delta Exchange.

Get started

  1. Create an account on https://www.delta.exchange/app
  2. Generate your api key and api secret
  3. Install the package:
npm install --save delta-rest-client
  1. Follow the below snippet to trade on testnet:
const DeltaRestClient = require("delta-rest-client");
new DeltaRestClient(api_key, api_secret).then(client => {
  // Get List of Products
  client.apis.Products.getProducts().then(function(response) {
    var products = JSON.parse(response.data.toString());
    console.log("\nProducts:\n----\n", JSON.stringify(products));
  });
 
  // Get Open orders for product_id = 3
  client.apis.Orders.getOrders({ product_id: 3, state: "open" }).then(function(
    response
  ) {
    var orders = JSON.parse(response.data.toString());
    console.log("Open Orders:", orders);
  });
 
  // Place new order
  client.apis.Orders.placeOrder({
    order: {
      product_id: 13,
      size: 100,
      side: "sell",
      limit_price: "4400",
      order_type: "limit_order"
    }
  }).then((response) => console.log(JSON.parse(response.data.toString()));
});
  1. Checkout documentation & swagger file for all available operations

Readme

Keywords

none

Package Sidebar

Install

npm i delta-rest-client

Weekly Downloads

1

Version

1.0.0

License

none

Unpacked Size

8.29 kB

Total Files

5

Last publish

Collaborators

  • saurabh.goyal