delta-rest-client
v1.0.0
Published
Rest Client for Delta Exchange Apis
Downloads
11
Readme
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
- Create an account on https://www.delta.exchange/app
- Generate your api key and api secret
- Install the package:
npm install --save delta-rest-client
- 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()));
});
- Checkout documentation & swagger file for all available operations