@1claw/openapi-spec 0.21.0 → 0.22.0
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/README.md +2 -1
- package/openapi.json +324 -1
- package/openapi.yaml +220 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,13 +40,14 @@ openapi-generator generate \
|
|
|
40
40
|
import spec from "@1claw/openapi-spec/openapi.json";
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
## What's in the spec (v0.
|
|
43
|
+
## What's in the spec (v0.21.x — API `info.version` 2.11.x)
|
|
44
44
|
|
|
45
45
|
- **OIDC Federation (1claw as IdP)** — `GET /.well-known/openid-configuration` (public discovery: issuer, jwks_uri, supported algs `["EdDSA","RS256"]`, supported grant types incl. token-exchange), `GET /.well-known/jwks.json` (public JWKS — every active EdDSA + RS256 key version, keyed by deterministic `kid`), `POST /v1/auth/federated-token` (RFC 8693 token exchange — accepts JSON or `application/x-www-form-urlencoded`; subject token is an agent JWT or `ocv_` API key; returns RS256 JWT scoped to `audience`). Agent fields: `federation_enabled`, `federation_audiences[]`, `federated_token_ttl_seconds`. Designed for Anthropic Workload Identity Federation, GCP STS, AWS STS, etc.
|
|
46
46
|
- **Auth — agent JWT** — `POST /v1/auth/agent-token` documents optional JWT claim **`shroud_config`** when the agent has Shroud enabled (mirrors DB; consumed by Shroud PolicyEngine on LLM requests). Re-exchange after changing agent Shroud settings. Federation tokens use a separate KMS RSA-2048 key and are signed RS256.
|
|
47
47
|
- **Auth — password reset** — `POST /v1/auth/forgot-password`, `POST /v1/auth/reset-password` (public; anti-enumeration on forgot)
|
|
48
48
|
- **Billing — LLM token billing** — `GET /v1/billing/llm-token-billing` (`LlmTokenBillingStatus`: `enabled`, `subscription_status`, optional `credit_balance`, optional `billing_cycle_usage` with `metered_lines[]`), `POST .../subscribe`, `POST .../disable` (Stripe AI Gateway add-on; optional org feature)
|
|
49
49
|
- **Treasury** — Safe multisig treasuries: `POST/GET /v1/treasury`, `GET/PATCH/DELETE /v1/treasury/{id}`, signers, agent access requests (`requests[]` on list)
|
|
50
|
+
- **Treasury Wallets** — Multi-chain wallet generation for human users (replaces CDP embedded wallets): `POST /v1/treasury/wallets/generate`, `GET /v1/treasury/wallets`, `GET /v1/treasury/wallets/{chain}`, `POST .../export`, `POST .../rotate`, `DELETE /v1/treasury/wallets/{chain}`. Supported chains: ethereum, bitcoin, solana, xrp, cardano, tron. Private keys stored in per-org `__treasury-keys` vault with tier-appropriate MPC custody.
|
|
50
51
|
- **Vaults** — CRUD, CMEK enable/disable, key rotation with job tracking, MPC enable/disable (`POST /v1/vaults/{id}/mpc`, `DELETE /v1/vaults/{id}/mpc`)
|
|
51
52
|
- **Secrets** — CRUD, versioning, CMEK-encrypted flag, `client_share` in responses (MPC vaults)
|
|
52
53
|
- **Agents** — CRUD with `auth_method` (api_key, mtls, oidc_client_credentials), auto-generated SSH keypairs, `token_ttl_seconds`, `vault_ids`, Intents API, transaction guardrails (`tx_to_allowlist`, `tx_max_value_eth`, `tx_daily_limit_eth`, `tx_allowed_chains`), **OIDC federation knobs** (`federation_enabled`, `federation_audiences`, `federated_token_ttl_seconds`); **`GET /v1/agents/{id}`** includes **`tx_spent_today_eth`** (rolling UTC-day spend from recorded txs) for clients such as **Shroud** that enforce the daily cap alongside per-tx limits
|
package/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "1Claw API",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.12.0",
|
|
6
6
|
"description": "Secure secret management for AI agents. Provides vaults, secrets,\npolicy-based access control, agent identity, Intents API,\nsharing, billing, and audit logging.\n\nAll endpoints require JWT Bearer authentication unless marked with\n`security: []`.\n",
|
|
7
7
|
"contact": {
|
|
8
8
|
"email": "ops@1claw.xyz"
|
|
@@ -87,6 +87,10 @@
|
|
|
87
87
|
"name": "Treasury",
|
|
88
88
|
"description": "Multi-sig treasury wallets (Safe) and agent access requests"
|
|
89
89
|
},
|
|
90
|
+
{
|
|
91
|
+
"name": "Treasury Wallets",
|
|
92
|
+
"description": "Multi-chain wallet generation for human users (replaces CDP embedded wallets)"
|
|
93
|
+
},
|
|
90
94
|
{
|
|
91
95
|
"name": "Admin",
|
|
92
96
|
"description": "Platform administration"
|
|
@@ -4301,6 +4305,258 @@
|
|
|
4301
4305
|
}
|
|
4302
4306
|
}
|
|
4303
4307
|
},
|
|
4308
|
+
"/v1/treasury/wallets/generate": {
|
|
4309
|
+
"post": {
|
|
4310
|
+
"tags": [
|
|
4311
|
+
"Treasury Wallets"
|
|
4312
|
+
],
|
|
4313
|
+
"summary": "Generate multi-chain wallets for the authenticated user",
|
|
4314
|
+
"description": "Generates keypairs for the requested chains (or all supported chains if omitted).\nPrivate keys are stored in a per-org `__treasury-keys` vault with tier-appropriate\nMPC custody. Skips chains where the user already has an active wallet. Requires\nPro or higher billing tier. Human users only — agents get 403.\n",
|
|
4315
|
+
"operationId": "generateTreasuryWallets",
|
|
4316
|
+
"security": [
|
|
4317
|
+
{
|
|
4318
|
+
"BearerAuth": []
|
|
4319
|
+
}
|
|
4320
|
+
],
|
|
4321
|
+
"requestBody": {
|
|
4322
|
+
"required": true,
|
|
4323
|
+
"content": {
|
|
4324
|
+
"application/json": {
|
|
4325
|
+
"schema": {
|
|
4326
|
+
"$ref": "#/components/schemas/GenerateTreasuryWalletsRequest"
|
|
4327
|
+
}
|
|
4328
|
+
}
|
|
4329
|
+
}
|
|
4330
|
+
},
|
|
4331
|
+
"responses": {
|
|
4332
|
+
"201": {
|
|
4333
|
+
"description": "Wallets generated",
|
|
4334
|
+
"content": {
|
|
4335
|
+
"application/json": {
|
|
4336
|
+
"schema": {
|
|
4337
|
+
"$ref": "#/components/schemas/TreasuryWalletListResponse"
|
|
4338
|
+
}
|
|
4339
|
+
}
|
|
4340
|
+
}
|
|
4341
|
+
},
|
|
4342
|
+
"400": {
|
|
4343
|
+
"$ref": "#/components/responses/BadRequest"
|
|
4344
|
+
},
|
|
4345
|
+
"401": {
|
|
4346
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
4347
|
+
},
|
|
4348
|
+
"403": {
|
|
4349
|
+
"$ref": "#/components/responses/Forbidden"
|
|
4350
|
+
}
|
|
4351
|
+
}
|
|
4352
|
+
}
|
|
4353
|
+
},
|
|
4354
|
+
"/v1/treasury/wallets": {
|
|
4355
|
+
"get": {
|
|
4356
|
+
"tags": [
|
|
4357
|
+
"Treasury Wallets"
|
|
4358
|
+
],
|
|
4359
|
+
"summary": "List the authenticated user's treasury wallets",
|
|
4360
|
+
"operationId": "listTreasuryWallets",
|
|
4361
|
+
"security": [
|
|
4362
|
+
{
|
|
4363
|
+
"BearerAuth": []
|
|
4364
|
+
}
|
|
4365
|
+
],
|
|
4366
|
+
"responses": {
|
|
4367
|
+
"200": {
|
|
4368
|
+
"description": "Wallet list",
|
|
4369
|
+
"content": {
|
|
4370
|
+
"application/json": {
|
|
4371
|
+
"schema": {
|
|
4372
|
+
"$ref": "#/components/schemas/TreasuryWalletListResponse"
|
|
4373
|
+
}
|
|
4374
|
+
}
|
|
4375
|
+
}
|
|
4376
|
+
},
|
|
4377
|
+
"401": {
|
|
4378
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
4379
|
+
},
|
|
4380
|
+
"403": {
|
|
4381
|
+
"$ref": "#/components/responses/Forbidden"
|
|
4382
|
+
}
|
|
4383
|
+
}
|
|
4384
|
+
}
|
|
4385
|
+
},
|
|
4386
|
+
"/v1/treasury/wallets/{chain}": {
|
|
4387
|
+
"get": {
|
|
4388
|
+
"tags": [
|
|
4389
|
+
"Treasury Wallets"
|
|
4390
|
+
],
|
|
4391
|
+
"summary": "Get the user's active wallet for a specific chain",
|
|
4392
|
+
"operationId": "getTreasuryWallet",
|
|
4393
|
+
"security": [
|
|
4394
|
+
{
|
|
4395
|
+
"BearerAuth": []
|
|
4396
|
+
}
|
|
4397
|
+
],
|
|
4398
|
+
"parameters": [
|
|
4399
|
+
{
|
|
4400
|
+
"name": "chain",
|
|
4401
|
+
"in": "path",
|
|
4402
|
+
"required": true,
|
|
4403
|
+
"schema": {
|
|
4404
|
+
"type": "string"
|
|
4405
|
+
},
|
|
4406
|
+
"description": "Chain name (e.g. ethereum, solana, bitcoin)"
|
|
4407
|
+
}
|
|
4408
|
+
],
|
|
4409
|
+
"responses": {
|
|
4410
|
+
"200": {
|
|
4411
|
+
"description": "Wallet details",
|
|
4412
|
+
"content": {
|
|
4413
|
+
"application/json": {
|
|
4414
|
+
"schema": {
|
|
4415
|
+
"$ref": "#/components/schemas/TreasuryWalletResponse"
|
|
4416
|
+
}
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
4419
|
+
},
|
|
4420
|
+
"401": {
|
|
4421
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
4422
|
+
},
|
|
4423
|
+
"403": {
|
|
4424
|
+
"$ref": "#/components/responses/Forbidden"
|
|
4425
|
+
},
|
|
4426
|
+
"404": {
|
|
4427
|
+
"$ref": "#/components/responses/NotFound"
|
|
4428
|
+
}
|
|
4429
|
+
}
|
|
4430
|
+
},
|
|
4431
|
+
"delete": {
|
|
4432
|
+
"tags": [
|
|
4433
|
+
"Treasury Wallets"
|
|
4434
|
+
],
|
|
4435
|
+
"summary": "Deactivate the user's wallet for a specific chain",
|
|
4436
|
+
"operationId": "deactivateTreasuryWallet",
|
|
4437
|
+
"security": [
|
|
4438
|
+
{
|
|
4439
|
+
"BearerAuth": []
|
|
4440
|
+
}
|
|
4441
|
+
],
|
|
4442
|
+
"parameters": [
|
|
4443
|
+
{
|
|
4444
|
+
"name": "chain",
|
|
4445
|
+
"in": "path",
|
|
4446
|
+
"required": true,
|
|
4447
|
+
"schema": {
|
|
4448
|
+
"type": "string"
|
|
4449
|
+
}
|
|
4450
|
+
}
|
|
4451
|
+
],
|
|
4452
|
+
"responses": {
|
|
4453
|
+
"204": {
|
|
4454
|
+
"description": "Wallet deactivated"
|
|
4455
|
+
},
|
|
4456
|
+
"401": {
|
|
4457
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
4458
|
+
},
|
|
4459
|
+
"403": {
|
|
4460
|
+
"$ref": "#/components/responses/Forbidden"
|
|
4461
|
+
}
|
|
4462
|
+
}
|
|
4463
|
+
}
|
|
4464
|
+
},
|
|
4465
|
+
"/v1/treasury/wallets/{chain}/export": {
|
|
4466
|
+
"post": {
|
|
4467
|
+
"tags": [
|
|
4468
|
+
"Treasury Wallets"
|
|
4469
|
+
],
|
|
4470
|
+
"summary": "Export the private key for a treasury wallet",
|
|
4471
|
+
"description": "Returns the raw private key hex for the user's active wallet on\nthe given chain. Audit-logged as `treasury_wallet.export`.\nHuman users only.\n",
|
|
4472
|
+
"operationId": "exportTreasuryWallet",
|
|
4473
|
+
"security": [
|
|
4474
|
+
{
|
|
4475
|
+
"BearerAuth": []
|
|
4476
|
+
}
|
|
4477
|
+
],
|
|
4478
|
+
"parameters": [
|
|
4479
|
+
{
|
|
4480
|
+
"name": "chain",
|
|
4481
|
+
"in": "path",
|
|
4482
|
+
"required": true,
|
|
4483
|
+
"schema": {
|
|
4484
|
+
"type": "string"
|
|
4485
|
+
}
|
|
4486
|
+
}
|
|
4487
|
+
],
|
|
4488
|
+
"responses": {
|
|
4489
|
+
"200": {
|
|
4490
|
+
"description": "Private key exported",
|
|
4491
|
+
"content": {
|
|
4492
|
+
"application/json": {
|
|
4493
|
+
"schema": {
|
|
4494
|
+
"$ref": "#/components/schemas/TreasuryWalletExportResponse"
|
|
4495
|
+
}
|
|
4496
|
+
}
|
|
4497
|
+
}
|
|
4498
|
+
},
|
|
4499
|
+
"401": {
|
|
4500
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
4501
|
+
},
|
|
4502
|
+
"403": {
|
|
4503
|
+
"$ref": "#/components/responses/Forbidden"
|
|
4504
|
+
},
|
|
4505
|
+
"404": {
|
|
4506
|
+
"$ref": "#/components/responses/NotFound"
|
|
4507
|
+
}
|
|
4508
|
+
}
|
|
4509
|
+
}
|
|
4510
|
+
},
|
|
4511
|
+
"/v1/treasury/wallets/{chain}/rotate": {
|
|
4512
|
+
"post": {
|
|
4513
|
+
"tags": [
|
|
4514
|
+
"Treasury Wallets"
|
|
4515
|
+
],
|
|
4516
|
+
"summary": "Rotate the user's wallet key for a chain",
|
|
4517
|
+
"description": "Generates a new keypair, deactivates the old wallet, and creates a\nnew active wallet. The old private key version is retained in the\nvault for audit. Requires Pro or higher.\n",
|
|
4518
|
+
"operationId": "rotateTreasuryWallet",
|
|
4519
|
+
"security": [
|
|
4520
|
+
{
|
|
4521
|
+
"BearerAuth": []
|
|
4522
|
+
}
|
|
4523
|
+
],
|
|
4524
|
+
"parameters": [
|
|
4525
|
+
{
|
|
4526
|
+
"name": "chain",
|
|
4527
|
+
"in": "path",
|
|
4528
|
+
"required": true,
|
|
4529
|
+
"schema": {
|
|
4530
|
+
"type": "string"
|
|
4531
|
+
}
|
|
4532
|
+
}
|
|
4533
|
+
],
|
|
4534
|
+
"responses": {
|
|
4535
|
+
"200": {
|
|
4536
|
+
"description": "Wallet rotated",
|
|
4537
|
+
"content": {
|
|
4538
|
+
"application/json": {
|
|
4539
|
+
"schema": {
|
|
4540
|
+
"$ref": "#/components/schemas/TreasuryWalletResponse"
|
|
4541
|
+
}
|
|
4542
|
+
}
|
|
4543
|
+
}
|
|
4544
|
+
},
|
|
4545
|
+
"400": {
|
|
4546
|
+
"$ref": "#/components/responses/BadRequest"
|
|
4547
|
+
},
|
|
4548
|
+
"401": {
|
|
4549
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
4550
|
+
},
|
|
4551
|
+
"403": {
|
|
4552
|
+
"$ref": "#/components/responses/Forbidden"
|
|
4553
|
+
},
|
|
4554
|
+
"404": {
|
|
4555
|
+
"$ref": "#/components/responses/NotFound"
|
|
4556
|
+
}
|
|
4557
|
+
}
|
|
4558
|
+
}
|
|
4559
|
+
},
|
|
4304
4560
|
"/v1/admin/settings": {
|
|
4305
4561
|
"get": {
|
|
4306
4562
|
"tags": [
|
|
@@ -8978,6 +9234,73 @@
|
|
|
8978
9234
|
}
|
|
8979
9235
|
}
|
|
8980
9236
|
},
|
|
9237
|
+
"GenerateTreasuryWalletsRequest": {
|
|
9238
|
+
"type": "object",
|
|
9239
|
+
"properties": {
|
|
9240
|
+
"chains": {
|
|
9241
|
+
"type": "array",
|
|
9242
|
+
"items": {
|
|
9243
|
+
"type": "string"
|
|
9244
|
+
},
|
|
9245
|
+
"description": "Chains to generate wallets for (e.g. [\"ethereum\", \"solana\"]). Omit for all supported chains."
|
|
9246
|
+
}
|
|
9247
|
+
}
|
|
9248
|
+
},
|
|
9249
|
+
"TreasuryWalletResponse": {
|
|
9250
|
+
"type": "object",
|
|
9251
|
+
"properties": {
|
|
9252
|
+
"id": {
|
|
9253
|
+
"type": "string",
|
|
9254
|
+
"format": "uuid"
|
|
9255
|
+
},
|
|
9256
|
+
"chain": {
|
|
9257
|
+
"type": "string"
|
|
9258
|
+
},
|
|
9259
|
+
"curve": {
|
|
9260
|
+
"type": "string",
|
|
9261
|
+
"description": "Cryptographic curve (e.g. secp256k1, ed25519)"
|
|
9262
|
+
},
|
|
9263
|
+
"public_key_hex": {
|
|
9264
|
+
"type": "string"
|
|
9265
|
+
},
|
|
9266
|
+
"address": {
|
|
9267
|
+
"type": "string"
|
|
9268
|
+
},
|
|
9269
|
+
"is_active": {
|
|
9270
|
+
"type": "boolean"
|
|
9271
|
+
},
|
|
9272
|
+
"created_at": {
|
|
9273
|
+
"type": "string",
|
|
9274
|
+
"format": "date-time"
|
|
9275
|
+
}
|
|
9276
|
+
}
|
|
9277
|
+
},
|
|
9278
|
+
"TreasuryWalletListResponse": {
|
|
9279
|
+
"type": "object",
|
|
9280
|
+
"properties": {
|
|
9281
|
+
"wallets": {
|
|
9282
|
+
"type": "array",
|
|
9283
|
+
"items": {
|
|
9284
|
+
"$ref": "#/components/schemas/TreasuryWalletResponse"
|
|
9285
|
+
}
|
|
9286
|
+
}
|
|
9287
|
+
}
|
|
9288
|
+
},
|
|
9289
|
+
"TreasuryWalletExportResponse": {
|
|
9290
|
+
"type": "object",
|
|
9291
|
+
"properties": {
|
|
9292
|
+
"chain": {
|
|
9293
|
+
"type": "string"
|
|
9294
|
+
},
|
|
9295
|
+
"address": {
|
|
9296
|
+
"type": "string"
|
|
9297
|
+
},
|
|
9298
|
+
"private_key_hex": {
|
|
9299
|
+
"type": "string",
|
|
9300
|
+
"description": "Raw private key in hex encoding. Handle with extreme care."
|
|
9301
|
+
}
|
|
9302
|
+
}
|
|
9303
|
+
},
|
|
8981
9304
|
"PaymentRequirement": {
|
|
8982
9305
|
"type": "object",
|
|
8983
9306
|
"properties": {
|
package/openapi.yaml
CHANGED
|
@@ -2,7 +2,7 @@ openapi: 3.1.0
|
|
|
2
2
|
|
|
3
3
|
info:
|
|
4
4
|
title: 1Claw API
|
|
5
|
-
version: 2.
|
|
5
|
+
version: 2.12.0
|
|
6
6
|
description: |
|
|
7
7
|
Secure secret management for AI agents. Provides vaults, secrets,
|
|
8
8
|
policy-based access control, agent identity, Intents API,
|
|
@@ -56,6 +56,8 @@ tags:
|
|
|
56
56
|
description: IP rules and security configuration
|
|
57
57
|
- name: Treasury
|
|
58
58
|
description: Multi-sig treasury wallets (Safe) and agent access requests
|
|
59
|
+
- name: Treasury Wallets
|
|
60
|
+
description: Multi-chain wallet generation for human users (replaces CDP embedded wallets)
|
|
59
61
|
- name: Admin
|
|
60
62
|
description: Platform administration
|
|
61
63
|
- name: Health
|
|
@@ -2819,6 +2821,172 @@ paths:
|
|
|
2819
2821
|
"404":
|
|
2820
2822
|
$ref: "#/components/responses/NotFound"
|
|
2821
2823
|
|
|
2824
|
+
# ---------------------------------------------------------------------------
|
|
2825
|
+
# Treasury Wallets (multi-chain key generation for human users)
|
|
2826
|
+
# ---------------------------------------------------------------------------
|
|
2827
|
+
|
|
2828
|
+
/v1/treasury/wallets/generate:
|
|
2829
|
+
post:
|
|
2830
|
+
tags: [Treasury Wallets]
|
|
2831
|
+
summary: Generate multi-chain wallets for the authenticated user
|
|
2832
|
+
description: |
|
|
2833
|
+
Generates keypairs for the requested chains (or all supported chains if omitted).
|
|
2834
|
+
Private keys are stored in a per-org `__treasury-keys` vault with tier-appropriate
|
|
2835
|
+
MPC custody. Skips chains where the user already has an active wallet. Requires
|
|
2836
|
+
Pro or higher billing tier. Human users only — agents get 403.
|
|
2837
|
+
operationId: generateTreasuryWallets
|
|
2838
|
+
security:
|
|
2839
|
+
- BearerAuth: []
|
|
2840
|
+
requestBody:
|
|
2841
|
+
required: true
|
|
2842
|
+
content:
|
|
2843
|
+
application/json:
|
|
2844
|
+
schema:
|
|
2845
|
+
$ref: "#/components/schemas/GenerateTreasuryWalletsRequest"
|
|
2846
|
+
responses:
|
|
2847
|
+
"201":
|
|
2848
|
+
description: Wallets generated
|
|
2849
|
+
content:
|
|
2850
|
+
application/json:
|
|
2851
|
+
schema:
|
|
2852
|
+
$ref: "#/components/schemas/TreasuryWalletListResponse"
|
|
2853
|
+
"400":
|
|
2854
|
+
$ref: "#/components/responses/BadRequest"
|
|
2855
|
+
"401":
|
|
2856
|
+
$ref: "#/components/responses/Unauthorized"
|
|
2857
|
+
"403":
|
|
2858
|
+
$ref: "#/components/responses/Forbidden"
|
|
2859
|
+
|
|
2860
|
+
/v1/treasury/wallets:
|
|
2861
|
+
get:
|
|
2862
|
+
tags: [Treasury Wallets]
|
|
2863
|
+
summary: List the authenticated user's treasury wallets
|
|
2864
|
+
operationId: listTreasuryWallets
|
|
2865
|
+
security:
|
|
2866
|
+
- BearerAuth: []
|
|
2867
|
+
responses:
|
|
2868
|
+
"200":
|
|
2869
|
+
description: Wallet list
|
|
2870
|
+
content:
|
|
2871
|
+
application/json:
|
|
2872
|
+
schema:
|
|
2873
|
+
$ref: "#/components/schemas/TreasuryWalletListResponse"
|
|
2874
|
+
"401":
|
|
2875
|
+
$ref: "#/components/responses/Unauthorized"
|
|
2876
|
+
"403":
|
|
2877
|
+
$ref: "#/components/responses/Forbidden"
|
|
2878
|
+
|
|
2879
|
+
/v1/treasury/wallets/{chain}:
|
|
2880
|
+
get:
|
|
2881
|
+
tags: [Treasury Wallets]
|
|
2882
|
+
summary: Get the user's active wallet for a specific chain
|
|
2883
|
+
operationId: getTreasuryWallet
|
|
2884
|
+
security:
|
|
2885
|
+
- BearerAuth: []
|
|
2886
|
+
parameters:
|
|
2887
|
+
- name: chain
|
|
2888
|
+
in: path
|
|
2889
|
+
required: true
|
|
2890
|
+
schema:
|
|
2891
|
+
type: string
|
|
2892
|
+
description: "Chain name (e.g. ethereum, solana, bitcoin)"
|
|
2893
|
+
responses:
|
|
2894
|
+
"200":
|
|
2895
|
+
description: Wallet details
|
|
2896
|
+
content:
|
|
2897
|
+
application/json:
|
|
2898
|
+
schema:
|
|
2899
|
+
$ref: "#/components/schemas/TreasuryWalletResponse"
|
|
2900
|
+
"401":
|
|
2901
|
+
$ref: "#/components/responses/Unauthorized"
|
|
2902
|
+
"403":
|
|
2903
|
+
$ref: "#/components/responses/Forbidden"
|
|
2904
|
+
"404":
|
|
2905
|
+
$ref: "#/components/responses/NotFound"
|
|
2906
|
+
delete:
|
|
2907
|
+
tags: [Treasury Wallets]
|
|
2908
|
+
summary: Deactivate the user's wallet for a specific chain
|
|
2909
|
+
operationId: deactivateTreasuryWallet
|
|
2910
|
+
security:
|
|
2911
|
+
- BearerAuth: []
|
|
2912
|
+
parameters:
|
|
2913
|
+
- name: chain
|
|
2914
|
+
in: path
|
|
2915
|
+
required: true
|
|
2916
|
+
schema:
|
|
2917
|
+
type: string
|
|
2918
|
+
responses:
|
|
2919
|
+
"204":
|
|
2920
|
+
description: Wallet deactivated
|
|
2921
|
+
"401":
|
|
2922
|
+
$ref: "#/components/responses/Unauthorized"
|
|
2923
|
+
"403":
|
|
2924
|
+
$ref: "#/components/responses/Forbidden"
|
|
2925
|
+
|
|
2926
|
+
/v1/treasury/wallets/{chain}/export:
|
|
2927
|
+
post:
|
|
2928
|
+
tags: [Treasury Wallets]
|
|
2929
|
+
summary: Export the private key for a treasury wallet
|
|
2930
|
+
description: |
|
|
2931
|
+
Returns the raw private key hex for the user's active wallet on
|
|
2932
|
+
the given chain. Audit-logged as `treasury_wallet.export`.
|
|
2933
|
+
Human users only.
|
|
2934
|
+
operationId: exportTreasuryWallet
|
|
2935
|
+
security:
|
|
2936
|
+
- BearerAuth: []
|
|
2937
|
+
parameters:
|
|
2938
|
+
- name: chain
|
|
2939
|
+
in: path
|
|
2940
|
+
required: true
|
|
2941
|
+
schema:
|
|
2942
|
+
type: string
|
|
2943
|
+
responses:
|
|
2944
|
+
"200":
|
|
2945
|
+
description: Private key exported
|
|
2946
|
+
content:
|
|
2947
|
+
application/json:
|
|
2948
|
+
schema:
|
|
2949
|
+
$ref: "#/components/schemas/TreasuryWalletExportResponse"
|
|
2950
|
+
"401":
|
|
2951
|
+
$ref: "#/components/responses/Unauthorized"
|
|
2952
|
+
"403":
|
|
2953
|
+
$ref: "#/components/responses/Forbidden"
|
|
2954
|
+
"404":
|
|
2955
|
+
$ref: "#/components/responses/NotFound"
|
|
2956
|
+
|
|
2957
|
+
/v1/treasury/wallets/{chain}/rotate:
|
|
2958
|
+
post:
|
|
2959
|
+
tags: [Treasury Wallets]
|
|
2960
|
+
summary: Rotate the user's wallet key for a chain
|
|
2961
|
+
description: |
|
|
2962
|
+
Generates a new keypair, deactivates the old wallet, and creates a
|
|
2963
|
+
new active wallet. The old private key version is retained in the
|
|
2964
|
+
vault for audit. Requires Pro or higher.
|
|
2965
|
+
operationId: rotateTreasuryWallet
|
|
2966
|
+
security:
|
|
2967
|
+
- BearerAuth: []
|
|
2968
|
+
parameters:
|
|
2969
|
+
- name: chain
|
|
2970
|
+
in: path
|
|
2971
|
+
required: true
|
|
2972
|
+
schema:
|
|
2973
|
+
type: string
|
|
2974
|
+
responses:
|
|
2975
|
+
"200":
|
|
2976
|
+
description: Wallet rotated
|
|
2977
|
+
content:
|
|
2978
|
+
application/json:
|
|
2979
|
+
schema:
|
|
2980
|
+
$ref: "#/components/schemas/TreasuryWalletResponse"
|
|
2981
|
+
"400":
|
|
2982
|
+
$ref: "#/components/responses/BadRequest"
|
|
2983
|
+
"401":
|
|
2984
|
+
$ref: "#/components/responses/Unauthorized"
|
|
2985
|
+
"403":
|
|
2986
|
+
$ref: "#/components/responses/Forbidden"
|
|
2987
|
+
"404":
|
|
2988
|
+
$ref: "#/components/responses/NotFound"
|
|
2989
|
+
|
|
2822
2990
|
# ---------------------------------------------------------------------------
|
|
2823
2991
|
# Admin
|
|
2824
2992
|
# ---------------------------------------------------------------------------
|
|
@@ -6048,6 +6216,57 @@ components:
|
|
|
6048
6216
|
type: string
|
|
6049
6217
|
format: date-time
|
|
6050
6218
|
|
|
6219
|
+
# --- Treasury Wallets ---
|
|
6220
|
+
|
|
6221
|
+
GenerateTreasuryWalletsRequest:
|
|
6222
|
+
type: object
|
|
6223
|
+
properties:
|
|
6224
|
+
chains:
|
|
6225
|
+
type: array
|
|
6226
|
+
items:
|
|
6227
|
+
type: string
|
|
6228
|
+
description: "Chains to generate wallets for (e.g. [\"ethereum\", \"solana\"]). Omit for all supported chains."
|
|
6229
|
+
|
|
6230
|
+
TreasuryWalletResponse:
|
|
6231
|
+
type: object
|
|
6232
|
+
properties:
|
|
6233
|
+
id:
|
|
6234
|
+
type: string
|
|
6235
|
+
format: uuid
|
|
6236
|
+
chain:
|
|
6237
|
+
type: string
|
|
6238
|
+
curve:
|
|
6239
|
+
type: string
|
|
6240
|
+
description: "Cryptographic curve (e.g. secp256k1, ed25519)"
|
|
6241
|
+
public_key_hex:
|
|
6242
|
+
type: string
|
|
6243
|
+
address:
|
|
6244
|
+
type: string
|
|
6245
|
+
is_active:
|
|
6246
|
+
type: boolean
|
|
6247
|
+
created_at:
|
|
6248
|
+
type: string
|
|
6249
|
+
format: date-time
|
|
6250
|
+
|
|
6251
|
+
TreasuryWalletListResponse:
|
|
6252
|
+
type: object
|
|
6253
|
+
properties:
|
|
6254
|
+
wallets:
|
|
6255
|
+
type: array
|
|
6256
|
+
items:
|
|
6257
|
+
$ref: "#/components/schemas/TreasuryWalletResponse"
|
|
6258
|
+
|
|
6259
|
+
TreasuryWalletExportResponse:
|
|
6260
|
+
type: object
|
|
6261
|
+
properties:
|
|
6262
|
+
chain:
|
|
6263
|
+
type: string
|
|
6264
|
+
address:
|
|
6265
|
+
type: string
|
|
6266
|
+
private_key_hex:
|
|
6267
|
+
type: string
|
|
6268
|
+
description: Raw private key in hex encoding. Handle with extreme care.
|
|
6269
|
+
|
|
6051
6270
|
# --- x402 ---
|
|
6052
6271
|
|
|
6053
6272
|
PaymentRequirement:
|