@blockrun/clawrouter 0.12.284 → 0.12.286

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/dist/index.d.ts CHANGED
@@ -1066,6 +1066,45 @@ declare function getSessionId(headers: Record<string, string | string[] | undefi
1066
1066
  */
1067
1067
  declare function hashRequestContent(lastUserContent: string, toolCallNames?: string[]): string;
1068
1068
 
1069
+ /**
1070
+ * Solana batch-settlement, paid by @blockrun/llm's SolanaBatchPayer.
1071
+ *
1072
+ * `exact` signs one SPL transfer per call at the call's ceiling (the quote for
1073
+ * `max_tokens`). `batch-settlement` opens a deposit-backed channel once; each
1074
+ * call then carries a signed authorization for its ceiling, and the gateway
1075
+ * charges what the call actually cost. ClawRouter does not implement the
1076
+ * protocol: it uses the same payer `SolanaLLMClient` ships, so both clients
1077
+ * share one hardened path (in-doubt payments are never replaced, the channel
1078
+ * file is locked across processes, 429s cool the wallet down, a refused
1079
+ * deposit parks the wallet on exact).
1080
+ *
1081
+ * The channel's voucher signer is BlockRun's operator key, pinned here as the
1082
+ * only trusted operator. The deposit is escrow under that key, bounded by
1083
+ * `maxDeposit`; spend is the per-call charge. ClawRouter's own spend rules
1084
+ * (SpendControl, the strict session cap) see each batch payment at its
1085
+ * per-call ceiling through `configureClient`, exactly as they see `exact`
1086
+ * payments, and only when the user configured them.
1087
+ */
1088
+
1089
+ interface SolanaBatchSettings {
1090
+ /** Escrow cap per channel, e.g. "$5". Unset: @x402/svm's default ("$1"). */
1091
+ maxDeposit?: string | number;
1092
+ /**
1093
+ * Operator keys trusted to sign vouchers. Default: BlockRun's
1094
+ * (`BLOCKRUN_SOL_OPERATOR`). Only for a key rotation, when both keys are
1095
+ * valid for a while. Never trust the operator a 402 names.
1096
+ */
1097
+ operators?: string[];
1098
+ /**
1099
+ * Where open-channel state is kept: a file path, or `false` for memory only.
1100
+ * Default: @blockrun/llm's `~/.blockrun/solana-batch/<address>.json`, locked
1101
+ * to one process at a time.
1102
+ */
1103
+ channelStore?: string | false;
1104
+ /** @internal Replay budget for a payment in doubt, in ms (tests shorten it). */
1105
+ inDoubtMaxWaitMs?: number;
1106
+ }
1107
+
1069
1108
  /**
1070
1109
  * Local x402 Proxy Server
1071
1110
  *
@@ -1227,6 +1266,16 @@ type ProxyOptions = {
1227
1266
  * ~/.openclaw/blockrun/spending.json. Inject in tests.
1228
1267
  */
1229
1268
  spendControl?: SpendControl;
1269
+ /**
1270
+ * Solana batch-settlement for chat calls on the Solana rail: one deposit
1271
+ * opens a payment channel with BlockRun, then each call is charged what it
1272
+ * actually cost instead of its ceiling. `true` turns it on with the default
1273
+ * escrow cap; an object sets `maxDeposit`. Default: off, unless
1274
+ * CLAWROUTER_SOLANA_BATCH is set.
1275
+ */
1276
+ solanaBatch?: boolean | SolanaBatchSettings;
1277
+ /** @internal Set by startProxy when Solana batch-settlement is active. */
1278
+ _solanaBatchActive?: boolean;
1230
1279
  /**
1231
1280
  * Upstream proxy URL for all outgoing requests.
1232
1281
  * Supports http://, https://, and socks5:// schemes.