diff --git a/MIGRATION.md b/MIGRATION.md index 2a69194..bdd8c41 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -42,7 +42,7 @@ const deflex = new DeflexClient({ // After const router = new RouterClient({ - apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e' // Free tier (60 requests/min) + apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm' // Free tier (60 requests/min) }) ``` @@ -162,8 +162,8 @@ DEFLEX_API_KEY=your-api-key VITE_DEFLEX_API_KEY=your-api-key # After -HAYSTACK_ROUTER_API_KEY=1b72df7e-1131-4449-8ce1-29b79dd3f51e -VITE_HAYSTACK_ROUTER_API_KEY=1b72df7e-1131-4449-8ce1-29b79dd3f51e +HAYSTACK_ROUTER_API_KEY=hay_pk_4zhj33wahuxfplteyif5xpcgnm +VITE_HAYSTACK_ROUTER_API_KEY=hay_pk_4zhj33wahuxfplteyif5xpcgnm ``` ## No Functional Changes diff --git a/README.md b/README.md index b5a3e31..b93c924 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ const { activeAddress, transactionSigner } = useWallet() // Initialize client const router = new RouterClient({ - apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min) + apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm', // Free tier (60 requests/min) }) // Get quote diff --git a/examples/README.md b/examples/README.md index 1dff5ca..03843f5 100644 --- a/examples/README.md +++ b/examples/README.md @@ -102,13 +102,13 @@ Each example includes a `.env.example` file with the free tier API key pre-confi ### React / React Query ```bash -VITE_HAYSTACK_ROUTER_API_KEY=1b72df7e-1131-4449-8ce1-29b79dd3f51e # Free tier (60 requests/min) +VITE_HAYSTACK_ROUTER_API_KEY=hay_pk_4zhj33wahuxfplteyif5xpcgnm # Free tier (60 requests/min) ``` ### Node.js CLI ```bash -HAYSTACK_ROUTER_API_KEY=1b72df7e-1131-4449-8ce1-29b79dd3f51e # Free tier (60 requests/min) +HAYSTACK_ROUTER_API_KEY=hay_pk_4zhj33wahuxfplteyif5xpcgnm # Free tier (60 requests/min) ACCOUNT_MNEMONIC="your 25 word mnemonic phrase" ``` diff --git a/examples/node-cli/.env.example b/examples/node-cli/.env.example index 078155a..4669282 100644 --- a/examples/node-cli/.env.example +++ b/examples/node-cli/.env.example @@ -1,5 +1,5 @@ # Haystack Router API Configuration - Free tier (60 requests/min) -HAYSTACK_ROUTER_API_KEY=1b72df7e-1131-4449-8ce1-29b79dd3f51e +HAYSTACK_ROUTER_API_KEY=hay_pk_4zhj33wahuxfplteyif5xpcgnm # Algorand Account Mnemonic (25 words) # WARNING: Never commit this file with your real mnemonic! diff --git a/examples/node-cli/README.md b/examples/node-cli/README.md index 8ce6231..a2a5b25 100644 --- a/examples/node-cli/README.md +++ b/examples/node-cli/README.md @@ -35,7 +35,7 @@ cp .env.example .env ```env # Haystack Router API key - Free tier (60 requests/min) -HAYSTACK_ROUTER_API_KEY=1b72df7e-1131-4449-8ce1-29b79dd3f51e +HAYSTACK_ROUTER_API_KEY=hay_pk_4zhj33wahuxfplteyif5xpcgnm # Required: Your 25-word account mnemonic # WARNING: Keep this file private and never commit it! diff --git a/examples/react-query/.env.example b/examples/react-query/.env.example index 93502a5..706099a 100644 --- a/examples/react-query/.env.example +++ b/examples/react-query/.env.example @@ -1 +1 @@ -VITE_HAYSTACK_ROUTER_API_KEY=1b72df7e-1131-4449-8ce1-29b79dd3f51e +VITE_HAYSTACK_ROUTER_API_KEY=hay_pk_4zhj33wahuxfplteyif5xpcgnm diff --git a/examples/react/.env.example b/examples/react/.env.example index 93502a5..706099a 100644 --- a/examples/react/.env.example +++ b/examples/react/.env.example @@ -1 +1 @@ -VITE_HAYSTACK_ROUTER_API_KEY=1b72df7e-1131-4449-8ce1-29b79dd3f51e +VITE_HAYSTACK_ROUTER_API_KEY=hay_pk_4zhj33wahuxfplteyif5xpcgnm diff --git a/packages/haystack/MIDDLEWARE.md b/packages/haystack/MIDDLEWARE.md index 4ce10d7..3fd40da 100644 --- a/packages/haystack/MIDDLEWARE.md +++ b/packages/haystack/MIDDLEWARE.md @@ -370,7 +370,7 @@ const middleware = new CustomAssetMiddleware({ }) const router = new RouterClient({ - apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min) + apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm', // Free tier (60 requests/min) middleware: [middleware], }) diff --git a/packages/haystack/README.md b/packages/haystack/README.md index 1e93269..a201195 100644 --- a/packages/haystack/README.md +++ b/packages/haystack/README.md @@ -17,9 +17,11 @@ TypeScript/JavaScript SDK for [Haystack Order Router](https://txnlab.gitbook.io/ | Tier | Key | Rate Limit | Use Case | | --- | --- | --- | --- | -| **Free** | `1b72df7e-1131-4449-8ce1-29b79dd3f51e` | 60 requests/min | Development, testing, low-volume integrations | +| **Free** | `hay_pk_4zhj33wahuxfplteyif5xpcgnm` | 60 requests/min | Development, testing, low-volume integrations | | **Production** | Request from [support@txnlab.dev](mailto:support@txnlab.dev) | Higher limits | Production applications | +The previous free key, `1b72df7e-1131-4449-8ce1-29b79dd3f51e`, is deprecated: its limit falls to 10 requests/min between December 1, 2026 and March 1, 2027, and it stops working on April 1, 2027. + The SDK sends the key in the `X-API-Key` header, never in the URL, so it stays out of server logs, browser history and caches. ## Installation @@ -40,7 +42,7 @@ const { activeAddress, transactionSigner } = useWallet() // Initialize the client const router = new RouterClient({ - apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min) + apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm', // Free tier (60 requests/min) }) // Get a quote @@ -72,12 +74,12 @@ import { RouterClient } from '@txnlab/haystack-router' // Basic initialization const router = new RouterClient({ - apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min) + apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm', // Free tier (60 requests/min) }) // Custom Algod configuration const router = new RouterClient({ - apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min) + apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm', // Free tier (60 requests/min) algodUri: 'https://mainnet-api.4160.nodely.dev/', algodToken: '', algodPort: 443, @@ -86,7 +88,7 @@ const router = new RouterClient({ // Earn fees with the referral program const router = new RouterClient({ - apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min) + apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm', // Free tier (60 requests/min) referrerAddress: 'YOUR_ALGORAND_ADDRESS', // Earns 25% of swap fees feeBps: 15, // 0.15% fee (max: 300 = 3%) }) @@ -332,7 +334,7 @@ const myAsset = new MyAssetMiddleware({ // Pass middleware to RouterClient const router = new RouterClient({ - apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min) + apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm', // Free tier (60 requests/min) middleware: [myAsset], // Middleware is applied automatically }) @@ -360,7 +362,7 @@ const autoOptOut = new AutoOptOutMiddleware({ }) const router = new RouterClient({ - apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min) + apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm', // Free tier (60 requests/min) middleware: [autoOptOut], }) @@ -381,7 +383,7 @@ If you're not using `autoOptIn: true`, you can manually check if opt-in is neede ```typescript const router = new RouterClient({ - apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min) + apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm', // Free tier (60 requests/min) autoOptIn: false, // Default if not provided }) diff --git a/packages/haystack/src/client.ts b/packages/haystack/src/client.ts index 658a31f..5b788bf 100644 --- a/packages/haystack/src/client.ts +++ b/packages/haystack/src/client.ts @@ -40,14 +40,14 @@ import type { * @example * ```typescript * const router = new RouterClient({ - * apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min) + * apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm', // Free tier (60 requests/min) * }) * ``` * * @example * ```typescript * const router = new RouterClient({ - * apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min) + * apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm', // Free tier (60 requests/min) * apiBaseUrl: 'https://hayrouter.txnlab.dev', * algodUri: 'https://mainnet-api.4160.nodely.dev/', * algodToken: '', diff --git a/packages/haystack/src/middleware.ts b/packages/haystack/src/middleware.ts index 11d0b90..4aa62d2 100644 --- a/packages/haystack/src/middleware.ts +++ b/packages/haystack/src/middleware.ts @@ -255,7 +255,7 @@ export interface AutoOptOutConfig { * }) * * const router = new RouterClient({ - * apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min) + * apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm', // Free tier (60 requests/min) * middleware: [autoOptOut], * }) *