@1claw/sdk 0.41.1 → 0.41.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/README.md CHANGED
@@ -322,6 +322,32 @@ When `execution_require_tee` is true:
322
322
 
323
323
  Both require `intents_api_enabled` / `execution_intents_enabled` to be on first.
324
324
 
325
+ ### Overhead Budget and Transaction Count Limits
326
+
327
+ Protect against non-value drain attacks (ATA rent drain, XRP reserve exhaustion, Tron energy drain):
328
+
329
+ ```typescript
330
+ await client.agents.update(agentId, {
331
+ tx_max_per_day: 100, // Cap transactions per UTC day
332
+ tx_overhead_budget: { // Per-chain non-value cost budgets (native units)
333
+ solana: "0.5",
334
+ xrp: "100",
335
+ ethereum: "0.01",
336
+ },
337
+ solana_ata_allowlist: [ // Only these addresses may have ATAs created
338
+ "7nYzKqAqfaGEhN6oeKCQVFjduQ9qH1dWs2gVFkNKBpQF",
339
+ ],
340
+ per_chain_guardrails: { // Per-chain overrides
341
+ solana: { max_per_day: 20, overhead_budget: "0.2", max_ata_creates_per_day: 5 },
342
+ },
343
+ });
344
+
345
+ // Check current spend:
346
+ const agent = await client.agents.get(agentId);
347
+ console.log(agent.data?.tx_count_today); // e.g. 42
348
+ console.log(agent.data?.tx_overhead_today_by_chain); // e.g. { "solana": "0.12" }
349
+ ```
350
+
325
351
  ## OIDC Federation (Anthropic WIF, GCP STS, AWS STS)
326
352
 
327
353
  `https://api.1claw.xyz` is a fully OpenID Connect–compliant issuer. External relying parties — Anthropic Workload Identity Federation, GCP STS, AWS STS, Stytch, etc. — can validate 1claw-issued JWTs by fetching:
@@ -5033,12 +5033,20 @@ export interface components {
5033
5033
  xrpl_allowed_tx_types?: string[];
5034
5034
  /**
5035
5035
  * @description Per-chain guardrail overrides. Keys are signing chains (ethereum, bitcoin, solana, xrp, cardano, tron).
5036
- * Each value may include max_value, daily_limit, to_allowlist, token_allowlist (legacy *_eth keys accepted).
5036
+ * Each value may include max_value, daily_limit, to_allowlist, token_allowlist, max_per_day, overhead_budget, max_ata_creates_per_day.
5037
5037
  * Strictest of global and per-chain limits wins. Daily limits apply per chain family spend, not cross-chain totals.
5038
5038
  */
5039
5039
  per_chain_guardrails?: {
5040
5040
  [key: string]: unknown;
5041
5041
  };
5042
+ /** @description Max transactions per UTC calendar day. Null = unlimited. */
5043
+ tx_max_per_day?: number | null;
5044
+ /** @description Per-chain daily overhead budget in native units (e.g. {"solana":"0.5","xrp":"100"}). */
5045
+ tx_overhead_budget?: {
5046
+ [key: string]: string;
5047
+ } | null;
5048
+ /** @description Solana wallet addresses whose ATAs may be created. Empty = unrestricted. */
5049
+ solana_ata_allowlist?: string[];
5042
5050
  /**
5043
5051
  * Format: date-time
5044
5052
  * @description Optional expiration time for the agent's API key.
@@ -5083,6 +5091,14 @@ export interface components {
5083
5091
  intents_require_tee?: boolean;
5084
5092
  /** @description When true, execute requests must arrive via TEE and all direct secret reads are blocked (Pro+ only) */
5085
5093
  execution_require_tee?: boolean;
5094
+ /** @description Max transactions per UTC calendar day. Null = unlimited. */
5095
+ tx_max_per_day?: number | null;
5096
+ /** @description Per-chain daily overhead budget in native units. */
5097
+ tx_overhead_budget?: {
5098
+ [key: string]: string;
5099
+ } | null;
5100
+ /** @description Solana wallet addresses whose ATAs may be created. */
5101
+ solana_ata_allowlist?: string[];
5086
5102
  /**
5087
5103
  * @description Enable OIDC federation (RFC 8693 token-exchange) for this agent.
5088
5104
  * When true, the agent may call POST /v1/auth/federated-token to mint
@@ -5182,6 +5198,20 @@ export interface components {
5182
5198
  intents_require_tee?: boolean;
5183
5199
  /** @description When true, execute requests must arrive via TEE and all direct secret reads are blocked (Pro+ only) */
5184
5200
  execution_require_tee?: boolean;
5201
+ /** @description Max transactions per UTC calendar day. Null = unlimited. */
5202
+ tx_max_per_day?: number | null;
5203
+ /** @description Per-chain daily overhead budget in native units. */
5204
+ tx_overhead_budget?: {
5205
+ [key: string]: string;
5206
+ } | null;
5207
+ /** @description Solana wallet addresses whose ATAs may be created. */
5208
+ solana_ata_allowlist?: string[];
5209
+ /** @description Today's transaction count (UTC calendar day). Present when intents_api_enabled. */
5210
+ tx_count_today?: number;
5211
+ /** @description Today's overhead spend by chain in native units. */
5212
+ tx_overhead_today_by_chain?: {
5213
+ [key: string]: string;
5214
+ };
5185
5215
  /**
5186
5216
  * @description Whether this agent may mint OIDC federation tokens via
5187
5217
  * POST /v1/auth/federated-token. False by default.