# redbtc/node-red-contrib-kraken architecture

> Architecture diagram of the GitHub repository redbtc/node-red-contrib-kraken, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/redbtc/node-red-contrib-kraken
- Repository: https://github.com/redbtc/node-red-contrib-kraken

## Overview

This package provides Node-RED nodes for making Kraken API requests. A flow supplies a method and payload to the API node; the node uses a configured client, which sends the request and returns the result in the message payload. Users configure API credentials in the editor, and the runtime creates a Kraken client from them. The sampled runtime shows method dispatch and HTTP requests; the README documents the editor setup and message contract. The separate editor flow is documented but its implementation was not sampled.

Main entry points: [`src/nodes/kraken-api/kraken-api.ts`](https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api/kraken-api.ts) (API node), [`src/nodes/kraken-api-config/modules/kraken-client.ts`](https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api-config/modules/kraken-client.ts) (Kraken client), [`src/nodes/kraken-api-config/kraken-api-config.ts`](https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api-config/kraken-api-config.ts) (Config node), [`src/nodes/kraken-api-config/kraken-api-config.html/index.ts`](https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api-config/kraken-api-config.html/index.ts) (Client editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flow["Node-RED flow"]
  node_api_node["API node<br/>[kraken-api.ts]"]
  node_message["Flow message"]
end

subgraph group_editor["Credential editor"]
  node_api_editor["API node editor<br/>[index.ts]"]
  node_config_editor["Client editor<br/>[index.ts]"]
  node_credentials["API credentials<br/>[config.ts]"]
end

subgraph group_runtime["Request runtime"]
  node_config_node["Config node"]
  node_client["Kraken client<br/>[kraken-client.ts]"]
end

node_flow_user(("Flow author"))
node_kraken{{"Kraken API"}}

node_flow_user -->|"configures node"| node_api_editor
node_flow_user -->|"enters credentials"| node_config_editor
node_config_editor -->|"sets credential fields"| node_credentials
node_credentials -->|"provides credentials"| node_config_node
node_config_node -->|"creates client"| node_client
node_flow_user -->|"supplies method and payload"| node_message
node_message -->|"triggers request"| node_api_node
node_api_node -->|"gets configured client"| node_config_node
node_api_node -->|"calls request"| node_client
node_client -->|"posts API request"| node_kraken
node_kraken -->|"returns API result"| node_client
node_api_node -->|"sets result payload"| node_message
node_api_node -->|"sends response message"| node_flow_user

click node_api_editor "https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api/kraken-api.html/index.ts"
click node_config_editor "https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api-config/kraken-api-config.html/index.ts"
click node_credentials "https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api-config/kraken-api-config.html/modules/config.ts"
click node_api_node "https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api/kraken-api.ts"
click node_config_node "https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api-config/kraken-api-config.ts"
click node_client "https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api-config/modules/kraken-client.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api_node,node_message toneBlue
class node_api_editor,node_config_editor,node_credentials toneAmber
class node_config_node,node_client,node_kraken toneMint
class node_flow_user toneIndigo
```

## Components

### Node-RED flow

- [API node](https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api/kraken-api.ts): `src/nodes/kraken-api/kraken-api.ts`
- **Flow message**

### Credential editor

- [API node editor](https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api/kraken-api.html/index.ts): `src/nodes/kraken-api/kraken-api.html/index.ts`
- [Client editor](https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api-config/kraken-api-config.html/index.ts): `src/nodes/kraken-api-config/kraken-api-config.html/index.ts`
- [API credentials](https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api-config/kraken-api-config.html/modules/config.ts): `src/nodes/kraken-api-config/kraken-api-config.html/modules/config.ts`

### Request runtime

- [Config node](https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api-config/kraken-api-config.ts): `src/nodes/kraken-api-config/kraken-api-config.ts`
- [Kraken client](https://github.com/redbtc/node-red-contrib-kraken/blob/master/src/nodes/kraken-api-config/modules/kraken-client.ts): `src/nodes/kraken-api-config/modules/kraken-client.ts`

### Other components

- **Flow author**
- **Kraken API**

## Connections

- Flow author → API node editor: configures node (evidence: `README.md`)
- Flow author → Client editor: enters credentials (evidence: `README.md`)
- Client editor → API credentials: sets credential fields (evidence: `src/nodes/kraken-api-config/kraken-api-config.html/modules/config.ts`)
- API credentials → Config node: provides credentials (evidence: `README.md`)
- Config node → Kraken client: creates client (evidence: `src/nodes/kraken-api-config/kraken-api-config.ts`)
- Flow author → Flow message: supplies method and payload (evidence: `README.md`)
- Flow message → API node: triggers request (evidence: `README.md`)
- API node → Config node: gets configured client (evidence: `src/nodes/kraken-api/kraken-api.ts`)
- API node → Kraken client: calls request (evidence: `src/nodes/kraken-api/kraken-api.ts`)
- Kraken client → Kraken API: posts API request (evidence: `src/nodes/kraken-api-config/modules/kraken-client.ts`)
- Kraken API → Kraken client: returns API result (evidence: `src/nodes/kraken-api-config/modules/kraken-client.ts`)
- API node → Flow message: sets result payload (evidence: `src/nodes/kraken-api/kraken-api.ts`)
- API node → Flow author: sends response message (evidence: `src/nodes/kraken-api/kraken-api.ts`)
