@buildaureon/sdk 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +640 -532
- package/config/network.json +10 -10
- package/dist/index.d.ts +88 -9
- package/dist/index.js +56 -5
- package/dist/index.js.map +1 -1
- package/docs/architecture.md +206 -205
- package/docs/auth.md +174 -215
- package/docs/client-api.md +605 -604
- package/docs/data-contracts.md +635 -632
- package/docs/error-model.md +217 -182
- package/docs/integration-guide.md +257 -196
- package/docs/security.md +120 -74
- package/docs/transport.md +142 -128
- package/examples/e2e-policy-rebalance/main.ts +24 -36
- package/examples/e2e-policy-rebalance/underrun.ts +28 -24
- package/examples/e2e-policy-rebalance/verify-sizing.ts +29 -26
- package/examples/e2e-vault-flow/main.ts +36 -90
- package/examples/market-event/main.ts +65 -65
- package/examples/quickstart/main.ts +72 -71
- package/examples/registry-register/main.ts +44 -0
- package/examples/sdk-demo-terminal/main.ts +171 -0
- package/fixtures/reference-objectives.json +18 -18
- package/fixtures/reference-portfolio.json +10 -10
- package/package.json +61 -64
|
@@ -1,196 +1,257 @@
|
|
|
1
|
-
# Production Integration Guide
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```mermaid
|
|
12
|
-
flowchart TD
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
import { createAureonClient
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Step
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
1
|
+
# Production Integration Guide
|
|
2
|
+
|
|
3
|
+
Integrate `@buildaureon/sdk` into server-side agents and automated rebalancing loops against the live AUREON API.
|
|
4
|
+
|
|
5
|
+
**Automation note:** SDK integrations support **Automatic mode only** (`automationMode: "auto"` — the default). Do not build Manual Approve agent loops with the SDK; use the operator utility for Manual workflows.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. End-to-end agent loop
|
|
10
|
+
|
|
11
|
+
```mermaid
|
|
12
|
+
flowchart TD
|
|
13
|
+
Init[1_issued_API_key_client] --> Sync[2_sync_Capital_Book]
|
|
14
|
+
Sync --> Fund[3_fund_vault_if_empty]
|
|
15
|
+
Fund --> Obj[4_create_Auto_objective]
|
|
16
|
+
Obj --> Loop[5_watchdog_heartbeat]
|
|
17
|
+
Loop -->|breach| Plan[6_restore_plan]
|
|
18
|
+
Plan --> Restore[7_restoreObjective]
|
|
19
|
+
Restore --> Loop
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Step 1 — Client
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { createAureonClient } from "@buildaureon/sdk";
|
|
26
|
+
|
|
27
|
+
export const aureon = createAureonClient({
|
|
28
|
+
baseUrl: process.env.AUREON_API_URL || "https://api.aureonlabs.network",
|
|
29
|
+
apiKey: process.env.AUREON_API_KEY!, // issued Developers key
|
|
30
|
+
timeoutMs: 30_000,
|
|
31
|
+
maxRetries: 2,
|
|
32
|
+
retryDelayMs: 500,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const me = await aureon.me();
|
|
36
|
+
console.log("operating as", me.walletAddress);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Optional Bearer (usually unnecessary with an issued key):
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import { createAureonClient, createSessionTokenProvider } from "@buildaureon/sdk";
|
|
43
|
+
|
|
44
|
+
const session = createSessionTokenProvider(process.env.AUREON_TOKEN ?? null);
|
|
45
|
+
export const aureon = createAureonClient({
|
|
46
|
+
baseUrl: process.env.AUREON_API_URL || "https://api.aureonlabs.network",
|
|
47
|
+
apiKey: process.env.AUREON_API_KEY ?? null,
|
|
48
|
+
getAccessToken: session.getAccessToken,
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Step 2 — Sync Capital Book
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
const { portfolio, chainId } = await aureon.syncPortfolio();
|
|
56
|
+
console.log({
|
|
57
|
+
chainId,
|
|
58
|
+
positions: portfolio.positions.length,
|
|
59
|
+
totalNotionalUsd: portfolio.totalNotionalUsd,
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Prefer `syncPortfolio()` over hand-seeded books in production. Use `setPortfolio` only for controlled rehearsals.
|
|
64
|
+
|
|
65
|
+
### Step 3 — Fund vault when needed
|
|
66
|
+
|
|
67
|
+
Automatic restores require vault capital. Prepare returns **unsigned** steps — your host signs and broadcasts.
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import type { VaultPrepareResult } from "@buildaureon/sdk";
|
|
71
|
+
|
|
72
|
+
async function ensureVaultFunded(
|
|
73
|
+
symbol: string,
|
|
74
|
+
amount: string,
|
|
75
|
+
broadcast: (step: VaultPrepareResult["steps"][number]) => Promise<string>
|
|
76
|
+
) {
|
|
77
|
+
const status = await aureon.getVaultStatus();
|
|
78
|
+
if (!status.empty && status.canRestore) return status;
|
|
79
|
+
|
|
80
|
+
const prep = await aureon.prepareVaultDeposit({ symbol, amount });
|
|
81
|
+
for (const step of prep.steps) {
|
|
82
|
+
const hash = await broadcast(step);
|
|
83
|
+
console.log(step.label, hash);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return aureon.getVaultStatus();
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Typical broadcast (viem sketch):
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
// host-owned — not part of the SDK
|
|
94
|
+
await walletClient.sendTransaction({
|
|
95
|
+
to: step.to,
|
|
96
|
+
data: step.data,
|
|
97
|
+
value: step.value ? BigInt(step.value) : 0n,
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Step 4 — Create an Automatic objective
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
const objective = await aureon.createObjective({
|
|
105
|
+
name: "Maintain 20% WETH",
|
|
106
|
+
kind: "balanced_portfolio",
|
|
107
|
+
targetWeight: 0.2,
|
|
108
|
+
tolerance: 0.03,
|
|
109
|
+
targetSymbol: "WETH",
|
|
110
|
+
// automationMode defaults to "auto" — keep it that way for SDK agents
|
|
111
|
+
priority: "medium",
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Locks:** `targetSymbol` and `automationMode` cannot change after create. Recreate the objective to change token or mode.
|
|
116
|
+
|
|
117
|
+
### Step 5 — Watchdog heartbeat
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
async function heartbeat() {
|
|
121
|
+
const refreshed = await aureon.refreshWatchdog();
|
|
122
|
+
console.log("breaches", refreshed.breaches.length);
|
|
123
|
+
|
|
124
|
+
for (const breach of refreshed.breaches) {
|
|
125
|
+
const plan = await aureon.getRestorePlan(breach.objectiveId);
|
|
126
|
+
console.log("plan", plan.kind, plan);
|
|
127
|
+
|
|
128
|
+
const receipt = await aureon.restoreObjective(breach.objectiveId);
|
|
129
|
+
console.log({
|
|
130
|
+
settlement: receipt.settlement, // "vault" | "staged"
|
|
131
|
+
status: receipt.status,
|
|
132
|
+
tx: receipt.transactionHash,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const health = await aureon.getHealth();
|
|
137
|
+
return health;
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Step 6 — Verify
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
await aureon.getHealth(objective.id);
|
|
145
|
+
await aureon.getTimeline(objective.id);
|
|
146
|
+
await aureon.listExecutions(objective.id);
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Always branch UI/agent copy on `receipt.settlement`.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 2. Recommended objective kinds for agents
|
|
154
|
+
|
|
155
|
+
| Kind | Typical use |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| `balanced_portfolio` | Hold `targetSymbol` near a weight band |
|
|
158
|
+
| `stable_allocation` | Keep a stable sleeve near a weight |
|
|
159
|
+
| `risk_ceiling` | Cap portfolio risk score |
|
|
160
|
+
| `reward_reinvestment` | Sweep rewards into a sleeve |
|
|
161
|
+
|
|
162
|
+
Start with one Automatic `balanced_portfolio` objective and a funded vault before adding more policies.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 3. Daemon runners
|
|
167
|
+
|
|
168
|
+
### PM2
|
|
169
|
+
|
|
170
|
+
```js
|
|
171
|
+
module.exports = {
|
|
172
|
+
apps: [
|
|
173
|
+
{
|
|
174
|
+
name: "aureon-agent-loop",
|
|
175
|
+
script: "./dist/index.js",
|
|
176
|
+
instances: 1,
|
|
177
|
+
autorestart: true,
|
|
178
|
+
env: {
|
|
179
|
+
NODE_ENV: "production",
|
|
180
|
+
AUREON_API_URL: "https://api.aureonlabs.network",
|
|
181
|
+
// AUREON_API_KEY from secret store / PM2 ecosystem secrets
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
};
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### systemd
|
|
189
|
+
|
|
190
|
+
```ini
|
|
191
|
+
[Unit]
|
|
192
|
+
Description=AUREON Automatic restore agent
|
|
193
|
+
After=network.target
|
|
194
|
+
|
|
195
|
+
[Service]
|
|
196
|
+
Type=simple
|
|
197
|
+
User=node
|
|
198
|
+
WorkingDirectory=/home/node/app
|
|
199
|
+
ExecStart=/usr/bin/node dist/index.js
|
|
200
|
+
Restart=on-failure
|
|
201
|
+
RestartSec=10
|
|
202
|
+
Environment=NODE_ENV=production
|
|
203
|
+
|
|
204
|
+
[Install]
|
|
205
|
+
WantedBy=multi-user.target
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Logging
|
|
209
|
+
|
|
210
|
+
```ts
|
|
211
|
+
import { createAureonClient } from "@buildaureon/sdk";
|
|
212
|
+
|
|
213
|
+
const aureon = createAureonClient({
|
|
214
|
+
apiKey: process.env.AUREON_API_KEY!,
|
|
215
|
+
logger: {
|
|
216
|
+
debug: (msg, ctx) => console.debug(msg, ctx),
|
|
217
|
+
info: (msg, ctx) => console.info(msg, ctx),
|
|
218
|
+
warn: (msg, ctx) => console.warn(msg, ctx),
|
|
219
|
+
error: (msg, ctx) => console.error(msg, ctx),
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Never log API keys, Bearer tokens, or private keys.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## 4. Frontend / SPA notes
|
|
229
|
+
|
|
230
|
+
- Do not ship issued API keys in public browser bundles.
|
|
231
|
+
- Prefer a backend proxy for agent credentials.
|
|
232
|
+
- Keep `refreshWatchdog` / `restoreObjective` loops on the server.
|
|
233
|
+
- Browser operator UX is the utility app (wallet session), not the SDK agent path.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## 5. Troubleshooting
|
|
238
|
+
|
|
239
|
+
| Symptom | Likely cause | Fix |
|
|
240
|
+
| --- | --- | --- |
|
|
241
|
+
| 401 invalid key | Wrong / paused / revoked key | Rotate in Developers |
|
|
242
|
+
| 401 need issued key | Env bootstrap key alone | Use an issued Developers key |
|
|
243
|
+
| Vault empty / cannot restore | No vault capital | `prepareVaultDeposit` → broadcast → sync |
|
|
244
|
+
| Update rejects symbol/mode | Locked at create | Recreate objective |
|
|
245
|
+
| Restore receipt `staged` | Ledger-local path | Do not claim on-chain |
|
|
246
|
+
| Health still violated after restore | Prices / sizing / liquidity | Re-read plan, vault balances, timeline |
|
|
247
|
+
| Network / timeout | RPC or API latency | Raise `timeoutMs`, set `maxRetries` |
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## 6. Related docs
|
|
252
|
+
|
|
253
|
+
- [Auth](./auth.md)
|
|
254
|
+
- [Architecture](./architecture.md)
|
|
255
|
+
- [Client API](./client-api.md)
|
|
256
|
+
- [Error model](./error-model.md)
|
|
257
|
+
- [Security](./security.md)
|
package/docs/security.md
CHANGED
|
@@ -1,74 +1,120 @@
|
|
|
1
|
-
# Security Model and Practices
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Host -->|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Vault
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
# Security Model and Practices
|
|
2
|
+
|
|
3
|
+
Security architecture for `@buildaureon/sdk`: trust boundaries, credentials, vault signing, and production checklist.
|
|
4
|
+
|
|
5
|
+
**Automation note:** SDK agents should run **Automatic** objectives only. Manual Approve flows are utility concerns, not SDK security surface.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Gateway trust boundaries
|
|
10
|
+
|
|
11
|
+
AUREON is non-custodial. The API is a policy engine, price indexer, and coordinator. It does not hold private keys and does not broadcast owner withdrawals for you.
|
|
12
|
+
|
|
13
|
+
```mermaid
|
|
14
|
+
flowchart TD
|
|
15
|
+
Host[Host_application] -->|1_request_calldata| Gateway[Aureon_API]
|
|
16
|
+
Gateway -->|2_unsigned_steps| Host
|
|
17
|
+
Host -->|3_sign_locally| Wallet[Private_key_or_KMS]
|
|
18
|
+
Wallet -->|4_broadcast| Chain[Robinhood_Chain_RPC]
|
|
19
|
+
|
|
20
|
+
subgraph OnChain [Smart_contract_controls]
|
|
21
|
+
Vault[Smart_Vault]
|
|
22
|
+
DX[Allowlisted_DEX_routes]
|
|
23
|
+
Vault -->|keeper_swaps_only| DX
|
|
24
|
+
end
|
|
25
|
+
Wallet -.->|owner_deposit_withdraw| Vault
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 1.1 Private key isolation
|
|
29
|
+
|
|
30
|
+
The SDK never loads, stores, or transmits private keys or mnemonics. Signing stays in the host (viem, ethers, HSM, KMS). A gateway breach cannot drain vaults by itself.
|
|
31
|
+
|
|
32
|
+
### 1.2 Issued API keys are wallet credentials
|
|
33
|
+
|
|
34
|
+
An **issued** developer key identifies the bound wallet for control-plane operations (sync, objectives, health, restore, prepare). Treat it like a password:
|
|
35
|
+
|
|
36
|
+
- Create in utility **Developers**
|
|
37
|
+
- Store in env / secret manager
|
|
38
|
+
- Pause or revoke on leak
|
|
39
|
+
- Prefer one key per agent host
|
|
40
|
+
|
|
41
|
+
Env bootstrap keys on the server unlock product access only. They do **not** identify a wallet and must not be used as agent identity.
|
|
42
|
+
|
|
43
|
+
### 1.3 Unsigned calldata
|
|
44
|
+
|
|
45
|
+
`prepareVaultDeposit` / `prepareVaultWithdraw` return structured steps. Decode against published ABIs before signing. Broadcast is always host-side.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 2. What a compromised API key can and cannot do
|
|
50
|
+
|
|
51
|
+
| Can | Cannot |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| Read portfolio, vault, health, timeline | Sign owner deposit/withdraw txs |
|
|
54
|
+
| Create / update / pause Auto objectives | Withdraw vault funds to arbitrary addresses |
|
|
55
|
+
| Request restore plans and trigger Automatic restore coordination | Bypass vault keeper allowlists |
|
|
56
|
+
| Create additional developer keys under the same wallet | Recover a private key |
|
|
57
|
+
|
|
58
|
+
Keeper-driven Automatic restores execute allowlisted vault swaps. Keepers cannot send vault assets to arbitrary third parties.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 3. Smart vault access control
|
|
63
|
+
|
|
64
|
+
- **Owner path:** deposits and withdrawals require owner-signed txs from prepare steps.
|
|
65
|
+
- **Keeper path:** Automatic restores use registered keepers on allowlisted routes only.
|
|
66
|
+
- **Slippage / limits:** vault and planner enforce execution bounds to reduce bad fills.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 4. Settlement honesty
|
|
71
|
+
|
|
72
|
+
Every execution receipt includes `settlement`:
|
|
73
|
+
|
|
74
|
+
| Value | Meaning | UI rule |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| `vault` | On-chain vault / keeper settlement with verifiable hash | May show as on-chain |
|
|
77
|
+
| `staged` | Ledger-local / rehearsal — not a chain settlement | Must **not** be labeled as on-chain |
|
|
78
|
+
|
|
79
|
+
Never collapse staged into “confirmed on Robinhood Chain.”
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 5. Transport and logging hygiene
|
|
84
|
+
|
|
85
|
+
- Prefer HTTPS production base URL `https://api.aureonlabs.network`.
|
|
86
|
+
- Do not log raw `Authorization` or `X-Aureon-Api-Key`.
|
|
87
|
+
- Redact prepare step calldata in public logs if it includes sensitive amounts in your threat model.
|
|
88
|
+
- Set `timeoutMs` / `maxRetries` deliberately for agent loops (see [transport.md](./transport.md)).
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 6. Frontend vs agent hosts
|
|
93
|
+
|
|
94
|
+
| Host | Guidance |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| Server agent / cron | Issued API key in secret store; private key in KMS if broadcasting deposits |
|
|
97
|
+
| Browser SPA | Do **not** embed issued API keys in public bundles; proxy through your backend |
|
|
98
|
+
| Operator utility | Wallet Bearer only — separate from SDK agent auth |
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 7. Production checklist
|
|
103
|
+
|
|
104
|
+
- [ ] Issued developer key (not a shared env bootstrap key) in secrets
|
|
105
|
+
- [ ] Private keys isolated from the API key and never logged
|
|
106
|
+
- [ ] Deposit/withdraw broadcast path reviewed and ABI-checked
|
|
107
|
+
- [ ] Automatic objectives only in SDK loops
|
|
108
|
+
- [ ] UI / agent summaries honor `settlement: vault | staged`
|
|
109
|
+
- [ ] Gas reserve on the signing wallet for owner txs
|
|
110
|
+
- [ ] Key rotation plan (pause/revoke in Developers)
|
|
111
|
+
- [ ] Error handling branches on `error.code` (see [error-model.md](./error-model.md))
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 8. Related docs
|
|
116
|
+
|
|
117
|
+
- [Auth](./auth.md)
|
|
118
|
+
- [Architecture](./architecture.md)
|
|
119
|
+
- [Integration guide](./integration-guide.md)
|
|
120
|
+
- [Error model](./error-model.md)
|