Skip to content

docs(examples): add kraken-examples-nodejs.md (one page of copy-ready snippets) - #71

Open
harbourlark wants to merge 1 commit into
sieblyio:mainfrom
harbourlark:docs/examples-markdown
Open

harbourlark wants to merge 1 commit into
sieblyio:mainfrom
harbourlark:docs/examples-markdown

Conversation

@harbourlark

Copy link
Copy Markdown

Adds examples/kraken-examples-nodejs.md, a single page of short, copy-ready snippets in the same style as kucoin-api/examples/kucoin-*-examples-nodejs.md and the new hyperliquid-api examples page (sieblyio/hyperliquid-api#19).

Why: Context7 parses markdown, and its benchmark for /sieblyio/kraken-api is 25 after the 27 Nov refresh, the lowest of the Siebly SDKs, while kucoin-api (with examples markdown) scores 73.88 and okx-api 75.78. The runnable .ts examples and examples/apidoc stay as they are; this page gives indexers and readers one place to find each task.

Covers: which client to use, client setup (public and private Spot, Derivatives, CommonJS), the retired Futures demo note, Spot market data (time and status, ticker, order book, OHLC, trades and spreads, assets and pairs), Spot account (balances, open and closed orders, trade history, ledgers), Spot trading (limit with cl_ord_id, market, post-only, validate-only, batch, amend, cancel, cancel all, dead man's switch), Derivatives market data (tickers, order book, candles, instruments, public executions), Derivatives account and trading (accounts, positions, fills, limit, market, reduce-only, edit, cancel, cancel all), WebSockets (Spot v2 public and private incl. level3, Futures public and private, unsubscribe and close), the Spot WebSocket API, and error handling.

Checked against @siebly/kraken-api 1.1.12:

  • All 32 snippets compile as standalone files under tsc --strict (module nodenext); the CommonJS one ran under Node.
  • Every public REST snippet, both public WebSocket snippets (Spot v2 and Futures) and the unsubscribe/close snippet ran live against Kraken.
  • Private snippets were exercised with dummy keys only (Spot answered EAPI:Invalid key, Futures authenticationError), so no orders were placed.
  • Prices and sizes in the trading snippets mirror the existing examples (far from market, small sizes).

Once #62 (Unified WebSocket) is released, a Unified section can be added to this page.

Add comprehensive examples for Kraken API using Node.js, JavaScript, and TypeScript SDK, covering installation, client creation, market data, account management, trading, and WebSocket usage.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant