You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"paymentAddress": "<Cardano payment address for this bot>"
15
+
}
16
+
```
17
+
18
+
2. Authenticated phase (after pickup):
19
+
20
+
```json
21
+
{
22
+
"baseUrl": "http://localhost:3000",
23
+
"botKeyId": "<from GET /api/v1/botPickupSecret>",
24
+
"secret": "<from GET /api/v1/botPickupSecret>",
14
25
"paymentAddress": "<Cardano payment address for this bot>"
15
26
}
16
27
```
17
28
18
29
-**baseUrl**: API base (e.g. `http://localhost:3000` for dev).
19
-
-**botKeyId** / **secret**: From the Create bot dialog (copy the JSON blob, fill `paymentAddress`).
30
+
-**botKeyId** / **secret**: Returned by `GET /api/v1/botPickupSecret` after a human claims the bot.
20
31
-**paymentAddress**: The bot’s **own** Cardano payment address (a wallet the bot controls, not the owner’s address). One bot, one address. Required for `auth` and for all authenticated calls.
21
32
22
33
Provide config in one of these ways:
@@ -36,7 +47,29 @@ cd scripts/bot-ref
36
47
npm install
37
48
```
38
49
39
-
### 1. Register / get token
50
+
### 1. Register -> claim -> pickup -> auth
51
+
52
+
1. Bot self-registers and receives a claim code:
53
+
54
+
```bash
55
+
curl -sS -X POST http://localhost:3000/api/v1/botRegister \
Returns the bot’s own info: `botId`, `paymentAddress`, `displayName`, `botName`, **`ownerAddress`** (the address of the human who created the bot). No `paymentAddress` in config needed for this command.
113
+
Returns the bot’s own info: `botId`, `paymentAddress`, `displayName`, `botName`, **`ownerAddress`** (the address of the human who claimed the bot). No `paymentAddress` in config needed for this command.
Uses the owner’s address from `botMe` and the bot’s address from config. **The bot must have its own wallet and address** (not the same as the owner). Set `paymentAddress` in `bot-config.json` to the bot’s Cardano address, register it with POST /api/v1/botAuth, then run the script.
147
+
Uses the owner’s address from `botMe` and the bot’s address from config. **The bot must have its own wallet and address** (not the same as the owner). Set `paymentAddress` in `bot-config.json` to the bot’s Cardano address, complete register -> claim -> pickup, then run `auth` and this script.
115
148
116
149
## Cursor agent testing
117
150
118
-
1. Create a bot in the app (User page → Create bot). Copy the JSON blob and add the bot’s `paymentAddress`.
119
-
2. Save as `scripts/bot-ref/bot-config.json` (or pass via `BOT_CONFIG`).
120
-
3. Run auth and use the token:
151
+
1. Self-register the bot (`POST /api/v1/botRegister`) and capture `pendingBotId` + `claimCode`.
152
+
2. Claim it in the app using that ID/code (User page -> Claim a bot).
153
+
3. Call `GET /api/v1/botPickupSecret?pendingBotId=...` and place `botKeyId` + `secret` in `scripts/bot-ref/bot-config.json` with the bot `paymentAddress`.
154
+
4. Run auth and use the token:
121
155
122
156
```bash
123
157
cd /path/to/multisig/scripts/bot-ref
@@ -130,7 +164,7 @@ The reference client only uses **bot-key auth** (POST /api/v1/botAuth). Wallet-b
130
164
131
165
## Governance bot flow
132
166
133
-
For governance automation, grant these bot scopes when creating the bot key:
167
+
For governance automation, request and approve these bot scopes during register/claim:
134
168
135
169
-`governance:read` to call `GET /api/v1/governanceActiveProposals`
136
170
-`ballot:write` to call `POST /api/v1/botBallotsUpsert`
0 commit comments