@1claw/sdk 0.28.0 → 0.29.1

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 CHANGED
@@ -96,12 +96,14 @@ await client.auth.verifyEmailChange({ code: "123456" });
96
96
  | `client.auth` | `login`, `signup`, `agentToken`, `apiKeyToken`, `google`, `changePassword`, `setPassword`, `changeEmail`, `verifyEmailChange`, `forgotPassword`, `resetPassword`, `exportData`, `exchangeFederatedToken`, `logout`, `getMe`, `updateMe`, `deleteMe` |
97
97
  | `client.apiKeys` | `create`, `list`, `revoke` |
98
98
  | `client.treasury` | `create`, `list`, `get`, `update`, `delete`, `addSigner`, `removeSigner`, `requestAccess`, `listAccessRequests`, `approveAccess`, `denyAccess`, `propose`, `listProposals`, `getProposal`, `signProposal`, `executeProposal` |
99
- | `client.treasuryWallets` | `generateWallets`, `listWallets`, `getWallet`, `exportWallet`, `rotateWallet`, `deactivateWallet` |
99
+ | `client.treasuryWallets` | `generateWallets`, `listWallets`, `getWallet`, `getWalletBalance`, `sendFromWallet`, `swapFromWallet`, `exportWallet`, `rotateWallet`, `deactivateWallet` |
100
100
  | `client.signingKeys` | `create`, `list`, `rotate`, `deactivate`, `export` |
101
101
  | `client.platform` | `createApp`, `listApps`, `getApp`, `updateApp`, `deleteApp`, `createTemplate`, `listTemplates`, `upsertUser`, `listUsers`, `bootstrapUser`, `claimPreview`, `claimRedeem`, `listConnectedApps`, `disconnectApp` |
102
+ | `client.devices` | `register`, `list`, `delete`, `challenge`, `attest`, `setPushToken` |
103
+ | `client.passkeys` | `list`, `registerBegin`, `registerComplete`, `assertBegin`, `assertComplete`, `delete` |
104
+ | `client.x402` | `getPaymentRequirement`, `pay`, `verifyReceipt`, `withPayment` |
102
105
 
103
106
  **Platform bootstrap response:** `bootstrapUser()` returns a `summary` object containing `agent_api_key` (one-time, not retrievable later) and `signing_keys[]` (with chain, address, and public_key for each provisioned key).
104
- | `client.x402` | `getPaymentRequirement`, `pay`, `verifyReceipt`, `withPayment` |
105
107
 
106
108
  **Agent create response:** `agents.create()` returns `{ agent: AgentResponse, api_key?: string }`. The `api_key` is only present for `auth_method: "api_key"` and is shown once — use `data.agent.id` and `data.api_key` from the response.
107
109
 
@@ -1432,6 +1432,27 @@ export interface paths {
1432
1432
  patch?: never;
1433
1433
  trace?: never;
1434
1434
  };
1435
+ "/v1/agents/{agent_id}/signing-keys/{chain}/balance": {
1436
+ parameters: {
1437
+ query?: never;
1438
+ header?: never;
1439
+ path?: never;
1440
+ cookie?: never;
1441
+ };
1442
+ /**
1443
+ * Get signing key balance
1444
+ * @description Returns the native token balance for the agent's signing key address
1445
+ * on the specified chain.
1446
+ */
1447
+ get: operations["getSigningKeyBalance"];
1448
+ put?: never;
1449
+ post?: never;
1450
+ delete?: never;
1451
+ options?: never;
1452
+ head?: never;
1453
+ patch?: never;
1454
+ trace?: never;
1455
+ };
1435
1456
  "/v1/agents/{agent_id}/sign": {
1436
1457
  parameters: {
1437
1458
  query?: never;
@@ -2284,6 +2305,108 @@ export interface paths {
2284
2305
  patch?: never;
2285
2306
  trace?: never;
2286
2307
  };
2308
+ "/v1/treasury/wallets/{chain}/balance": {
2309
+ parameters: {
2310
+ query?: never;
2311
+ header?: never;
2312
+ path?: never;
2313
+ cookie?: never;
2314
+ };
2315
+ /**
2316
+ * Get wallet balance
2317
+ * @description Returns the native and token balances for the user's active wallet
2318
+ * on the specified chain.
2319
+ */
2320
+ get: operations["getTreasuryWalletBalance"];
2321
+ put?: never;
2322
+ post?: never;
2323
+ delete?: never;
2324
+ options?: never;
2325
+ head?: never;
2326
+ patch?: never;
2327
+ trace?: never;
2328
+ };
2329
+ "/v1/treasury/wallets/{chain}/send": {
2330
+ parameters: {
2331
+ query?: never;
2332
+ header?: never;
2333
+ path?: never;
2334
+ cookie?: never;
2335
+ };
2336
+ get?: never;
2337
+ put?: never;
2338
+ /**
2339
+ * Send from treasury wallet
2340
+ * @description Signs and broadcasts a transaction from the user's active wallet on
2341
+ * the specified chain. Requires re-authentication via `X-Auth-Confirm`
2342
+ * header (account password). Human users only.
2343
+ */
2344
+ post: operations["sendFromTreasuryWallet"];
2345
+ delete?: never;
2346
+ options?: never;
2347
+ head?: never;
2348
+ patch?: never;
2349
+ trace?: never;
2350
+ };
2351
+ "/v1/treasury/wallets/{chain}/swap": {
2352
+ parameters: {
2353
+ query?: never;
2354
+ header?: never;
2355
+ path?: never;
2356
+ cookie?: never;
2357
+ };
2358
+ get?: never;
2359
+ put?: never;
2360
+ /**
2361
+ * Swap tokens via DEX aggregator
2362
+ * @description Executes a token swap through a DEX aggregator from the user's active
2363
+ * wallet on the specified chain. Requires re-authentication via
2364
+ * `X-Auth-Confirm` header (account password). Human users only.
2365
+ */
2366
+ post: operations["swapFromTreasuryWallet"];
2367
+ delete?: never;
2368
+ options?: never;
2369
+ head?: never;
2370
+ patch?: never;
2371
+ trace?: never;
2372
+ };
2373
+ "/v1/webhooks": {
2374
+ parameters: {
2375
+ query?: never;
2376
+ header?: never;
2377
+ path?: never;
2378
+ cookie?: never;
2379
+ };
2380
+ /** List webhooks */
2381
+ get: operations["listWebhooks"];
2382
+ put?: never;
2383
+ /** Register a webhook */
2384
+ post: operations["createWebhook"];
2385
+ delete?: never;
2386
+ options?: never;
2387
+ head?: never;
2388
+ patch?: never;
2389
+ trace?: never;
2390
+ };
2391
+ "/v1/webhooks/{id}": {
2392
+ parameters: {
2393
+ query?: never;
2394
+ header?: never;
2395
+ path?: never;
2396
+ cookie?: never;
2397
+ };
2398
+ /** Get webhook */
2399
+ get: operations["getWebhook"];
2400
+ put?: never;
2401
+ post?: never;
2402
+ /** Delete webhook */
2403
+ delete: operations["deleteWebhook"];
2404
+ options?: never;
2405
+ head?: never;
2406
+ /** Update webhook */
2407
+ patch: operations["updateWebhook"];
2408
+ trace?: never;
2409
+ };
2287
2410
  "/v1/admin/settings": {
2288
2411
  parameters: {
2289
2412
  query?: never;
@@ -4442,6 +4565,11 @@ export interface components {
4442
4565
  * @enum {string}
4443
4566
  */
4444
4567
  mode: "eoa" | "smart_account";
4568
+ /**
4569
+ * @description Whether to submit as a gasless (sponsored) transaction
4570
+ * @default false
4571
+ */
4572
+ gasless: boolean;
4445
4573
  };
4446
4574
  SignTransactionRequest: {
4447
4575
  /** @description Destination address (0x-prefixed) */
@@ -5144,6 +5272,109 @@ export interface components {
5144
5272
  /** @description Raw private key in hex encoding. Handle with extreme care. */
5145
5273
  private_key_hex?: string;
5146
5274
  };
5275
+ TreasuryWalletBalanceResponse: {
5276
+ chain: string;
5277
+ address: string;
5278
+ native: {
5279
+ symbol: string;
5280
+ balance_wei: string;
5281
+ balance_display: string;
5282
+ };
5283
+ tokens?: {
5284
+ contract_address: string;
5285
+ balance_raw: string;
5286
+ }[];
5287
+ };
5288
+ TreasuryWalletSendRequest: {
5289
+ /** @description Destination address (0x-prefixed) */
5290
+ to: string;
5291
+ /** @description Value in wei */
5292
+ value_wei: string;
5293
+ /** @description Hex-encoded calldata (optional) */
5294
+ data?: string;
5295
+ /** @description Gas limit override */
5296
+ gas_limit?: number;
5297
+ /**
5298
+ * @description When true, submits as a gasless (ERC-4337) transaction via Pimlico paymaster. The paymaster sponsors the gas cost.
5299
+ * @default false
5300
+ */
5301
+ gasless: boolean;
5302
+ };
5303
+ TreasuryWalletSendResponse: {
5304
+ tx_hash: string;
5305
+ from: string;
5306
+ to: string;
5307
+ value_wei: string;
5308
+ chain: string;
5309
+ status: string;
5310
+ /** @description UserOperation hash (only present for gasless sends via paymaster) */
5311
+ user_op_hash?: string;
5312
+ };
5313
+ TreasuryWalletSwapRequest: {
5314
+ /** @description Address of the token to sell (or "native" for ETH) */
5315
+ sell_token: string;
5316
+ /** @description Address of the token to buy (or "native" for ETH) */
5317
+ buy_token: string;
5318
+ /** @description Amount to sell in token's smallest unit */
5319
+ sell_amount: string;
5320
+ };
5321
+ TreasuryWalletSwapResponse: {
5322
+ tx_hash: string;
5323
+ sell_token: string;
5324
+ buy_token: string;
5325
+ sell_amount: string;
5326
+ buy_amount: string;
5327
+ chain: string;
5328
+ status: string;
5329
+ };
5330
+ CreateWebhookRequest: {
5331
+ /**
5332
+ * Format: uri
5333
+ * @description HTTPS URL to deliver webhook events to
5334
+ */
5335
+ url: string;
5336
+ /** @description Event types to subscribe to */
5337
+ events: string[];
5338
+ description?: string;
5339
+ };
5340
+ UpdateWebhookRequest: {
5341
+ /** Format: uri */
5342
+ url?: string;
5343
+ events?: string[];
5344
+ is_active?: boolean;
5345
+ description?: string;
5346
+ };
5347
+ WebhookCreatedResponse: {
5348
+ /** Format: uuid */
5349
+ id: string;
5350
+ /** Format: uri */
5351
+ url: string;
5352
+ events: string[];
5353
+ /** @description HMAC signing secret for verifying payloads (shown only once) */
5354
+ secret: string;
5355
+ /** Format: date-time */
5356
+ created_at: string;
5357
+ };
5358
+ WebhookResponse: {
5359
+ /** Format: uuid */
5360
+ id: string;
5361
+ /** Format: uri */
5362
+ url: string;
5363
+ events: string[];
5364
+ is_active: boolean;
5365
+ description?: string;
5366
+ /** Format: date-time */
5367
+ created_at: string;
5368
+ };
5369
+ WebhookListResponse: {
5370
+ webhooks: components["schemas"]["WebhookResponse"][];
5371
+ };
5372
+ SigningKeyBalanceResponse: {
5373
+ chain: string;
5374
+ address: string;
5375
+ balance_wei: string;
5376
+ balance_display: string;
5377
+ };
5147
5378
  PaymentRequirement: {
5148
5379
  x402Version?: number;
5149
5380
  accepts?: {
@@ -8036,6 +8267,32 @@ export interface operations {
8036
8267
  404: components["responses"]["NotFound"];
8037
8268
  };
8038
8269
  };
8270
+ getSigningKeyBalance: {
8271
+ parameters: {
8272
+ query?: never;
8273
+ header?: never;
8274
+ path: {
8275
+ agent_id: components["parameters"]["AgentId"];
8276
+ chain: string;
8277
+ };
8278
+ cookie?: never;
8279
+ };
8280
+ requestBody?: never;
8281
+ responses: {
8282
+ /** @description Signing key balance */
8283
+ 200: {
8284
+ headers: {
8285
+ [name: string]: unknown;
8286
+ };
8287
+ content: {
8288
+ "application/json": components["schemas"]["SigningKeyBalanceResponse"];
8289
+ };
8290
+ };
8291
+ 401: components["responses"]["Unauthorized"];
8292
+ 403: components["responses"]["Forbidden"];
8293
+ 404: components["responses"]["NotFound"];
8294
+ };
8295
+ };
8039
8296
  signIntent: {
8040
8297
  parameters: {
8041
8298
  query?: never;
@@ -9406,6 +9663,222 @@ export interface operations {
9406
9663
  404: components["responses"]["NotFound"];
9407
9664
  };
9408
9665
  };
9666
+ getTreasuryWalletBalance: {
9667
+ parameters: {
9668
+ query?: {
9669
+ /** @description Optional list of ERC-20 contract addresses to query balances for */
9670
+ tokens?: string[];
9671
+ };
9672
+ header?: never;
9673
+ path: {
9674
+ chain: string;
9675
+ };
9676
+ cookie?: never;
9677
+ };
9678
+ requestBody?: never;
9679
+ responses: {
9680
+ /** @description Wallet balance */
9681
+ 200: {
9682
+ headers: {
9683
+ [name: string]: unknown;
9684
+ };
9685
+ content: {
9686
+ "application/json": components["schemas"]["TreasuryWalletBalanceResponse"];
9687
+ };
9688
+ };
9689
+ 401: components["responses"]["Unauthorized"];
9690
+ 403: components["responses"]["Forbidden"];
9691
+ 404: components["responses"]["NotFound"];
9692
+ };
9693
+ };
9694
+ sendFromTreasuryWallet: {
9695
+ parameters: {
9696
+ query?: never;
9697
+ header: {
9698
+ /** @description Account password for re-authentication */
9699
+ "X-Auth-Confirm": string;
9700
+ };
9701
+ path: {
9702
+ chain: string;
9703
+ };
9704
+ cookie?: never;
9705
+ };
9706
+ requestBody: {
9707
+ content: {
9708
+ "application/json": components["schemas"]["TreasuryWalletSendRequest"];
9709
+ };
9710
+ };
9711
+ responses: {
9712
+ /** @description Transaction sent */
9713
+ 200: {
9714
+ headers: {
9715
+ [name: string]: unknown;
9716
+ };
9717
+ content: {
9718
+ "application/json": components["schemas"]["TreasuryWalletSendResponse"];
9719
+ };
9720
+ };
9721
+ 400: components["responses"]["BadRequest"];
9722
+ 401: components["responses"]["Unauthorized"];
9723
+ 403: components["responses"]["Forbidden"];
9724
+ 404: components["responses"]["NotFound"];
9725
+ };
9726
+ };
9727
+ swapFromTreasuryWallet: {
9728
+ parameters: {
9729
+ query?: never;
9730
+ header: {
9731
+ /** @description Account password for re-authentication */
9732
+ "X-Auth-Confirm": string;
9733
+ };
9734
+ path: {
9735
+ chain: string;
9736
+ };
9737
+ cookie?: never;
9738
+ };
9739
+ requestBody: {
9740
+ content: {
9741
+ "application/json": components["schemas"]["TreasuryWalletSwapRequest"];
9742
+ };
9743
+ };
9744
+ responses: {
9745
+ /** @description Swap executed */
9746
+ 200: {
9747
+ headers: {
9748
+ [name: string]: unknown;
9749
+ };
9750
+ content: {
9751
+ "application/json": components["schemas"]["TreasuryWalletSwapResponse"];
9752
+ };
9753
+ };
9754
+ 400: components["responses"]["BadRequest"];
9755
+ 401: components["responses"]["Unauthorized"];
9756
+ 403: components["responses"]["Forbidden"];
9757
+ 404: components["responses"]["NotFound"];
9758
+ };
9759
+ };
9760
+ listWebhooks: {
9761
+ parameters: {
9762
+ query?: never;
9763
+ header?: never;
9764
+ path?: never;
9765
+ cookie?: never;
9766
+ };
9767
+ requestBody?: never;
9768
+ responses: {
9769
+ /** @description Webhook list */
9770
+ 200: {
9771
+ headers: {
9772
+ [name: string]: unknown;
9773
+ };
9774
+ content: {
9775
+ "application/json": components["schemas"]["WebhookListResponse"];
9776
+ };
9777
+ };
9778
+ 401: components["responses"]["Unauthorized"];
9779
+ };
9780
+ };
9781
+ createWebhook: {
9782
+ parameters: {
9783
+ query?: never;
9784
+ header?: never;
9785
+ path?: never;
9786
+ cookie?: never;
9787
+ };
9788
+ requestBody: {
9789
+ content: {
9790
+ "application/json": components["schemas"]["CreateWebhookRequest"];
9791
+ };
9792
+ };
9793
+ responses: {
9794
+ /** @description Webhook registered */
9795
+ 201: {
9796
+ headers: {
9797
+ [name: string]: unknown;
9798
+ };
9799
+ content: {
9800
+ "application/json": components["schemas"]["WebhookCreatedResponse"];
9801
+ };
9802
+ };
9803
+ 400: components["responses"]["BadRequest"];
9804
+ 401: components["responses"]["Unauthorized"];
9805
+ };
9806
+ };
9807
+ getWebhook: {
9808
+ parameters: {
9809
+ query?: never;
9810
+ header?: never;
9811
+ path: {
9812
+ id: string;
9813
+ };
9814
+ cookie?: never;
9815
+ };
9816
+ requestBody?: never;
9817
+ responses: {
9818
+ /** @description Webhook details */
9819
+ 200: {
9820
+ headers: {
9821
+ [name: string]: unknown;
9822
+ };
9823
+ content: {
9824
+ "application/json": components["schemas"]["WebhookResponse"];
9825
+ };
9826
+ };
9827
+ 401: components["responses"]["Unauthorized"];
9828
+ 404: components["responses"]["NotFound"];
9829
+ };
9830
+ };
9831
+ deleteWebhook: {
9832
+ parameters: {
9833
+ query?: never;
9834
+ header?: never;
9835
+ path: {
9836
+ id: string;
9837
+ };
9838
+ cookie?: never;
9839
+ };
9840
+ requestBody?: never;
9841
+ responses: {
9842
+ /** @description Webhook deleted */
9843
+ 204: {
9844
+ headers: {
9845
+ [name: string]: unknown;
9846
+ };
9847
+ content?: never;
9848
+ };
9849
+ 401: components["responses"]["Unauthorized"];
9850
+ 404: components["responses"]["NotFound"];
9851
+ };
9852
+ };
9853
+ updateWebhook: {
9854
+ parameters: {
9855
+ query?: never;
9856
+ header?: never;
9857
+ path: {
9858
+ id: string;
9859
+ };
9860
+ cookie?: never;
9861
+ };
9862
+ requestBody: {
9863
+ content: {
9864
+ "application/json": components["schemas"]["UpdateWebhookRequest"];
9865
+ };
9866
+ };
9867
+ responses: {
9868
+ /** @description Webhook updated */
9869
+ 200: {
9870
+ headers: {
9871
+ [name: string]: unknown;
9872
+ };
9873
+ content: {
9874
+ "application/json": components["schemas"]["WebhookResponse"];
9875
+ };
9876
+ };
9877
+ 400: components["responses"]["BadRequest"];
9878
+ 401: components["responses"]["Unauthorized"];
9879
+ 404: components["responses"]["NotFound"];
9880
+ };
9881
+ };
9409
9882
  adminListSettings: {
9410
9883
  parameters: {
9411
9884
  query?: never;