Skip to content

Commit d45d09c

Browse files
dricharclaude
andcommitted
docs(haystack-router): add free tier API key to all examples
Replace placeholder `'your-api-key'` values with the free tier key (`1b72df7e-1131-4449-8ce1-29b79dd3f51e`) across all haystack-router skill files. This reflects the free tier added in TxnLab/haystack-js#8. - Add API Key Tiers section to configuration.md with free/production tiers - Update SKILL.md to mention the free key and link to configuration.md - Remove "API key — request from support" prerequisite from getting-started.md - Replace all placeholder keys in code examples across 7 reference files - Update .env example in node-automation.md with the free tier key Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b14ddb9 commit d45d09c

7 files changed

Lines changed: 45 additions & 22 deletions

File tree

skills/haystack-router/SKILL.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ Formerly known as Deflex (originally developed by Defly and Alammex), acquired b
2323
npm install @txnlab/haystack-router algosdk
2424
```
2525

26-
**API key required.** Request one from support@txnlab.dev.
26+
**API key required.** A free tier key is available for immediate use — see [configuration.md](references/configuration.md) for details.
2727

2828
## Core Flow
2929

3030
```typescript
3131
import { RouterClient } from '@txnlab/haystack-router'
3232

3333
// 1. Initialize
34-
const router = new RouterClient({ apiKey: 'your-api-key' })
34+
const router = new RouterClient({
35+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
36+
})
3537

3638
// 2. Get a quote
3739
const quote = await router.newQuote({

skills/haystack-router/references/configuration.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# Configuration
22

3+
## API Key Tiers
4+
5+
| Tier | Key | Rate Limit | Use Case |
6+
| -------------- | -------------------------------------- | --------------- | --------------------------------------------- |
7+
| **Free** | `1b72df7e-1131-4449-8ce1-29b79dd3f51e` | 60 requests/min | Development, testing, low-volume integrations |
8+
| **Production** | Request from support@txnlab.dev | Higher limits | Production applications |
9+
10+
The free tier key requires no registration and works immediately. The rate limit applies to all API calls (both `fetchQuote` and `fetchExecuteSwapTxns`), not just quotes.
11+
12+
For production integrations with higher rate limits, contact support@txnlab.dev for a dedicated key.
13+
314
## RouterClient Options
415

516
```typescript
617
import { RouterClient } from '@txnlab/haystack-router'
718

819
const router = new RouterClient({
920
// Required
10-
apiKey: 'your-api-key',
21+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
1122

1223
// Optional
1324
apiBaseUrl: undefined, // Override API endpoint (SDK manages defaults)
@@ -27,7 +38,9 @@ const router = new RouterClient({
2738
### MainNet (Default)
2839

2940
```typescript
30-
const router = new RouterClient({ apiKey: 'your-api-key' })
41+
const router = new RouterClient({
42+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e',
43+
})
3144
```
3245

3346
Uses default Nodely MainNet algod endpoint.
@@ -36,7 +49,7 @@ Uses default Nodely MainNet algod endpoint.
3649

3750
```typescript
3851
const router = new RouterClient({
39-
apiKey: 'your-api-key',
52+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
4053
algodUri: 'https://testnet-api.4160.nodely.dev/',
4154
})
4255
```
@@ -45,7 +58,7 @@ const router = new RouterClient({
4558

4659
```typescript
4760
const router = new RouterClient({
48-
apiKey: 'your-api-key',
61+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
4962
algodUri: 'http://localhost:4001',
5063
algodToken:
5164
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
@@ -78,7 +91,7 @@ Slippage is verified on the **final output** of the swap, not on individual hops
7891

7992
```typescript
8093
const router = new RouterClient({
81-
apiKey: 'your-api-key',
94+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
8295
feeBps: 15, // 0.15% output fee
8396
})
8497
```
@@ -94,7 +107,7 @@ Earn 25% of swap fees by setting a referrer address:
94107

95108
```typescript
96109
const router = new RouterClient({
97-
apiKey: 'your-api-key',
110+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
98111
referrerAddress: 'YOUR_ALGORAND_ADDRESS',
99112
})
100113
```
@@ -107,7 +120,7 @@ When `autoOptIn: true`, the SDK automatically checks if the user needs to opt in
107120

108121
```typescript
109122
const router = new RouterClient({
110-
apiKey: 'your-api-key',
123+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
111124
autoOptIn: true,
112125
})
113126

@@ -133,7 +146,7 @@ const autoOptOut = new AutoOptOutMiddleware({
133146
})
134147

135148
const router = new RouterClient({
136-
apiKey: 'your-api-key',
149+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
137150
middleware: [autoOptOut],
138151
})
139152
```
@@ -144,7 +157,7 @@ See [api-reference.md](api-reference.md) for the `SwapMiddleware` interface.
144157

145158
```typescript
146159
const router = new RouterClient({
147-
apiKey: 'your-api-key',
160+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
148161
debugLevel: 'info',
149162
})
150163
```

skills/haystack-router/references/fees-and-referrals.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
```typescript
1212
const router = new RouterClient({
13-
apiKey: 'your-api-key',
13+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
1414
feeBps: 15, // 0.15%
1515
})
1616
```
@@ -36,7 +36,7 @@ Pass your Algorand address as the `referrerAddress` when creating the RouterClie
3636

3737
```typescript
3838
const router = new RouterClient({
39-
apiKey: 'your-api-key',
39+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
4040
referrerAddress: 'YOUR_ALGORAND_ADDRESS',
4141
})
4242
```

skills/haystack-router/references/getting-started.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
## Prerequisites
44

5-
- **API key** — request from support@txnlab.dev
65
- **Node.js** >= 20
76
- **algosdk** 3.x (peer dependency)
87

@@ -18,15 +17,15 @@ npm install @txnlab/haystack-router algosdk
1817
import { RouterClient } from '@txnlab/haystack-router'
1918

2019
const router = new RouterClient({
21-
apiKey: 'your-api-key',
20+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
2221
})
2322
```
2423

2524
### With Options
2625

2726
```typescript
2827
const router = new RouterClient({
29-
apiKey: 'your-api-key',
28+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
3029
autoOptIn: true, // Auto-detect asset opt-in needs
3130
referrerAddress: 'ABC...', // Earn 25% of swap fees
3231
feeBps: 15, // Fee in basis points (default: 10)
@@ -40,7 +39,7 @@ Override the algod connection and API base URL for TestNet:
4039

4140
```typescript
4241
const router = new RouterClient({
43-
apiKey: 'your-api-key',
42+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
4443
algodUri: 'https://testnet-api.4160.nodely.dev/',
4544
// Set apiBaseUrl if using a TestNet-specific API endpoint
4645
})
@@ -51,7 +50,9 @@ const router = new RouterClient({
5150
```typescript
5251
import { RouterClient } from '@txnlab/haystack-router'
5352

54-
const router = new RouterClient({ apiKey: 'your-api-key' })
53+
const router = new RouterClient({
54+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
55+
})
5556

5657
// Get a quote: swap 1 ALGO → USDC
5758
const quote = await router.newQuote({

skills/haystack-router/references/node-automation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ npm install @txnlab/haystack-router algosdk
1212

1313
```bash
1414
# .env
15-
HAYSTACK_API_KEY=your-api-key
15+
HAYSTACK_API_KEY=1b72df7e-1131-4449-8ce1-29b79dd3f51e # Free tier (60 requests/min)
1616
MNEMONIC=your-25-word-mnemonic
1717
```
1818

skills/haystack-router/references/quotes.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
```typescript
66
import { RouterClient } from '@txnlab/haystack-router'
77

8-
const router = new RouterClient({ apiKey: 'your-api-key' })
8+
const router = new RouterClient({
9+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
10+
})
911

1012
const quote = await router.newQuote({
1113
fromASAID: 0, // ALGO
@@ -120,7 +122,10 @@ Before quoting, check if the user needs to opt into the output asset:
120122

121123
```typescript
122124
// Option 1: Set autoOptIn on the client
123-
const router = new RouterClient({ apiKey: 'key', autoOptIn: true })
125+
const router = new RouterClient({
126+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
127+
autoOptIn: true,
128+
})
124129
const quote = await router.newQuote({
125130
fromASAID: 0,
126131
toASAID: 31566704,

skills/haystack-router/references/swaps.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
```typescript
66
import { RouterClient } from '@txnlab/haystack-router'
77

8-
const router = new RouterClient({ apiKey: 'your-api-key' })
8+
const router = new RouterClient({
9+
apiKey: '1b72df7e-1131-4449-8ce1-29b79dd3f51e', // Free tier (60 requests/min)
10+
})
911

1012
// 1. Get a quote
1113
const quote = await router.newQuote({

0 commit comments

Comments
 (0)