mirror of
https://github.com/Such-Software/hash-wallet-prices.git
synced 2026-10-17 05:51:28 +02:00
Single endpoint serving USD spot prices for Hash Wallet, sourcing from Kraken (majors) and NonKYC (Wownero), KV-cached and refreshed via cron every minute. Drop-in /v2/rates shape compatible with the existing wallet client; preferred /v1/prices returns everything in one call.
23 lines
757 B
TOML
23 lines
757 B
TOML
name = "hash-wallet-prices"
|
|
main = "src/index.ts"
|
|
compatibility_date = "2026-05-14"
|
|
workers_dev = true
|
|
|
|
# KV namespace for cached prices.
|
|
# Run `wrangler kv:namespace create PRICES` once, then paste the returned id below.
|
|
# (The script also works without KV — it falls back to fetching upstream on each request.)
|
|
[[kv_namespaces]]
|
|
binding = "PRICES"
|
|
id = "REPLACE_ME_WITH_KV_NAMESPACE_ID"
|
|
|
|
# Run the refresh every 60 seconds.
|
|
# Cloudflare cron triggers fire once per minute at minimum.
|
|
[triggers]
|
|
crons = ["* * * * *"]
|
|
|
|
# Optional: route this worker behind a custom domain like prices.suchsoftware.com.
|
|
# Uncomment + edit after pointing DNS at Cloudflare and creating the route.
|
|
# [[routes]]
|
|
# pattern = "prices.suchsoftware.com/*"
|
|
# custom_domain = true
|