At a glance
The Node.js and Python samples use only the standard library: no packages to install.
The samples
Quickstart
samples/http/quickstart.sh, samples/node/quickstart.mjs and samples/python/quickstart.py: list assets, quote, order and follow.Request signing
request-signing in Node.js and Python, checked against the published test values.Webhook verification
webhook-verify in cURL, Node.js and Python: verifies a delivery and refuses a changed body or a stale timestamp.All samples
Every script the guides show, by language.
How the samples behave
How the samples behave
Each API script reads its settings from environment variables (
TETRAFI_BASE_URL, TETRAFI_API_KEY, TETRAFI_SIGNING_SECRET, and its own options listed at its top), signs requests when the key has request signing on, and prints one JSON summary as its last line; the webhook verifiers also run offline against a built-in test vector. A script that can place an order stops before ordering unless you set TETRAFI_PLACE_ORDER=1, and saves the order record it needs to recover the order before it sends.Next
Quickstart
Run your first quote and order.
Test before you trade
What you can try without moving assets.