Git Product home page Git Product logo

node-red-contrib-kraken's Introduction

Kraken Node

Node-RED node to interact with Kraken.

Install

Run the following command in the root directory of your Node-RED instance:

npm install --save node-red-contrib-kraken

Usage

This is a Kraken API client node. It makes API requests by sending msg.payload data to the specified API endpoint and outputs the response data as msg.payload.

Configuration

You first need to create a new API Key:

  1. Go to API Key Management on your Kraken account
  2. Click the Generate New Key button
  3. Enter a description and set permissions based on what API methods you'd execute
  4. Click the Generate Key button

Now you need to configure your Kraken client:

  1. Open your Node-RED instance
  2. Drag & drop the kraken api node from the palette to the workspace and double-click on it, to open the node editor
  3. In the Client dropdown menu pick the Add New kraken-api-config option and press the pencil button at the right to add a new API configuration
  4. Copy-paste API Key and Private Key from the key page on Kraken to the node editor
  5. Push Update

Making API requests

To make requests using the kraken-api node, you need to pick the api method the node will call. This can be either specified in the node settings, or provided in msg.method (if the method set to "via msg.method"). And msg.payload is the api input data.

After executing a request the node returns a message with the response data set to msg.payload.

Examples

Getting Account Balance

This example enables to get your account balance by clicking the inject button. The "Balance Data" node outputs your balance data to Debug window.

Getting Balance

Flow json for Node-RED: kraken-getting-balance.json

Adding Orders

This example implements a simple way to add pre-configured (in the "🔨 Order params" node) orders by clicking the inject button. The "Order Confirmation" node outputs the order description info to Debug window.

Adding Orders

Flow json for Node-RED: kraken-adding-orders.json

More Examples

API Reference

Kraken API Reference: https://www.kraken.com/features/api

Backers 💝

Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer

[Donate] Thank you for your support! 🙌

Developing Nodes

Build & Test in Watch mode:

yarn dev

Testing Node Set in Node-RED

Read Node-RED docs on how to install the node set into your Node-RED runtime.

License

MIT © Alex Kaul

node-red-contrib-kraken's People

Contributors

alexk111 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node-red-contrib-kraken's Issues

ticker call error messages

I am sometimes having connectivity issues while pulling ticker information. I just checked with Kraken support to troubleshoot the root of the problem.
They say, the error message is not from their system as they look different. That means the error message is from the node itself.

This is the error from the catch-node:

{"message":"FetchError: request to https://api.kraken.com/0/public/Ticker failed, reason: getaddrinfo EAI_AGAIN api.kraken.com api.kraken.com:443","source":{"id":"811a8cad.487b3","type":"kraken-api","count":1},"stack":"FetchError: request to https://api.kraken.com/0/public/Ticker failed, reason: getaddrinfo EAI_AGAIN api.kraken.com api.kraken.com:443\n    at ClientRequest.<anonymous> (/data/node_modules/node-fetch/lib/index.js:1461:11)\n    at ClientRequest.emit (events.js:198:13)\n    at TLSSocket.socketErrorListener (_http_client.js:401:9)\n    at TLSSocket.emit (events.js:198:13)\n    at emitErrorNT (internal/streams/destroy.js:91:8)\n    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)\n    at process._tickCallback (internal/process/next_tick.js:63:19)"}

I am doing 64 ticker calls (1 every 2 seconds) every 5 minutes. Every 15mins or so I am getting these error messages, that break my flows. Sometimes its just one. sometimes, I can barely get the flows to runs for minutes or hours at a time.

I am running node red on raspiOS Buster

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.