@blockrun/clawrouter 0.12.317 → 0.12.318
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 +43 -35
- package/dist/cli.js +48 -5
- package/dist/index.d.ts +7 -0
- package/dist/index.js +34 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -571,6 +571,41 @@ Live per-model prices: [blockrun.ai/pricing](https://blockrun.ai/pricing) (agent
|
|
|
571
571
|
|
|
572
572
|
---
|
|
573
573
|
|
|
574
|
+
### Shared model catalog
|
|
575
|
+
|
|
576
|
+
ClawRouter refreshes model metadata through `@blockrun/model-catalog`, pinned to
|
|
577
|
+
an immutable commit and bundled into the plugin. The active Base, Solana or
|
|
578
|
+
API-key gateway supplies live chat model IDs, prices and limits. A background
|
|
579
|
+
refresh at startup and every five minutes updates `/v1/models`, price estimates,
|
|
580
|
+
and the plugin's OpenClaw provider/allowlist and per-agent model caches. Newly discovered chat models become
|
|
581
|
+
explicit picker choices without rebuilding ClawRouter. OpenClaw must reload its
|
|
582
|
+
provider configuration to display a changed list; the proxy serves the updated
|
|
583
|
+
list immediately.
|
|
584
|
+
|
|
585
|
+
Restart an already-running proxy once after installing this integration. Reusing
|
|
586
|
+
an older external proxy cannot give that process the new refresh behavior.
|
|
587
|
+
|
|
588
|
+
The public picker policy defaults to
|
|
589
|
+
`https://raw.githubusercontent.com/BlockRunAI/model-catalog/main/dist/snapshot.v1.json`.
|
|
590
|
+
Set `BLOCKRUN_MODEL_CATALOG_URL` to another policy URL, or an empty string to use
|
|
591
|
+
the bundled policy with live gateway rows. Policy requests never receive the API
|
|
592
|
+
key; catalog redirects are refused. Each proxy owns its cache. Network failures
|
|
593
|
+
retain the last complete view, and offline startup retains the existing bundled
|
|
594
|
+
ClawRouter catalog. Invalid policy keeps the last good policy while valid gateway
|
|
595
|
+
rows can still refresh.
|
|
596
|
+
|
|
597
|
+
Existing aliases, curated legacy entries, virtual routes, free fallback order,
|
|
598
|
+
and Auto routing candidates remain product policy. Live rows update prices for
|
|
599
|
+
known models and add new chat choices; they do not promote a new model into Auto
|
|
600
|
+
or assume that a `coding` category proves structured tool support. Known
|
|
601
|
+
capability overrides remain in place. A gateway update cannot reclassify a pinned
|
|
602
|
+
`free/` choice as paid. Models absent from a later refresh lose newly discovered
|
|
603
|
+
picker entries; legacy pinned IDs remain available for gateway redirects.
|
|
604
|
+
|
|
605
|
+
This integrates metadata, not payment signing or upstream protocol support.
|
|
606
|
+
New protocols still require gateway compatibility. Gateway payment quotes and
|
|
607
|
+
account settlement remain authoritative; catalog prices are estimates.
|
|
608
|
+
|
|
574
609
|
## Payment
|
|
575
610
|
|
|
576
611
|
Two rails. This section covers the wallet one; the card/API-key one is
|
|
@@ -967,6 +1002,14 @@ wallet, no key, no signup. See [Paying with a credit card](#paying-with-a-credit
|
|
|
967
1002
|
|
|
968
1003
|
ClawRouter itself is free and MIT licensed. You pay only for the LLM API calls routed through it — and several open-weight models (`nemotron-3.5-lightning`, `laguna-xs-2.1`, `north-mini-code`, `nemotron-3.5-bolt`, `nemotron-3-nano-omni-30b-a3b-reasoning`, `nemotron-3-super-120b`, `nemotron-3-ultra-550b`, `muse-glimmer-30b`) are completely free, and Bolt also reads images. Use `/model free` for the free default, or pick any by name.
|
|
969
1004
|
|
|
1005
|
+
## Thanks
|
|
1006
|
+
|
|
1007
|
+
Thanks to [@Tyagiquamar](https://github.com/Tyagiquamar) for a run of careful fixes:
|
|
1008
|
+
SSRF guard hardening for IPv6 link-local and IPv4-embedded addresses (#534, #547),
|
|
1009
|
+
a `/stats` window fallback for invalid day counts (#535), prerelease-aware semver
|
|
1010
|
+
comparison in the updater (#617), and full-content deduplication in the
|
|
1011
|
+
observation compression layer (#621).
|
|
1012
|
+
|
|
970
1013
|
---
|
|
971
1014
|
|
|
972
1015
|
<div align="center">
|
|
@@ -976,38 +1019,3 @@ ClawRouter itself is free and MIT licensed. You pay only for the LLM API calls r
|
|
|
976
1019
|
⭐ If ClawRouter powers your agents, consider starring the repo!
|
|
977
1020
|
|
|
978
1021
|
</div>
|
|
979
|
-
|
|
980
|
-
### Shared model catalog
|
|
981
|
-
|
|
982
|
-
ClawRouter refreshes model metadata through `@blockrun/model-catalog`, pinned to
|
|
983
|
-
an immutable commit and bundled into the plugin. The active Base, Solana or
|
|
984
|
-
API-key gateway supplies live chat model IDs, prices and limits. A background
|
|
985
|
-
refresh at startup and every five minutes updates `/v1/models`, price estimates,
|
|
986
|
-
and the plugin's OpenClaw provider/allowlist and per-agent model caches. Newly discovered chat models become
|
|
987
|
-
explicit picker choices without rebuilding ClawRouter. OpenClaw must reload its
|
|
988
|
-
provider configuration to display a changed list; the proxy serves the updated
|
|
989
|
-
list immediately.
|
|
990
|
-
|
|
991
|
-
Restart an already-running proxy once after installing this integration. Reusing
|
|
992
|
-
an older external proxy cannot give that process the new refresh behavior.
|
|
993
|
-
|
|
994
|
-
The public picker policy defaults to
|
|
995
|
-
`https://raw.githubusercontent.com/BlockRunAI/model-catalog/main/dist/snapshot.v1.json`.
|
|
996
|
-
Set `BLOCKRUN_MODEL_CATALOG_URL` to another policy URL, or an empty string to use
|
|
997
|
-
the bundled policy with live gateway rows. Policy requests never receive the API
|
|
998
|
-
key; catalog redirects are refused. Each proxy owns its cache. Network failures
|
|
999
|
-
retain the last complete view, and offline startup retains the existing bundled
|
|
1000
|
-
ClawRouter catalog. Invalid policy keeps the last good policy while valid gateway
|
|
1001
|
-
rows can still refresh.
|
|
1002
|
-
|
|
1003
|
-
Existing aliases, curated legacy entries, virtual routes, free fallback order,
|
|
1004
|
-
and Auto routing candidates remain product policy. Live rows update prices for
|
|
1005
|
-
known models and add new chat choices; they do not promote a new model into Auto
|
|
1006
|
-
or assume that a `coding` category proves structured tool support. Known
|
|
1007
|
-
capability overrides remain in place. A gateway update cannot reclassify a pinned
|
|
1008
|
-
`free/` choice as paid. Models absent from a later refresh lose newly discovered
|
|
1009
|
-
picker entries; legacy pinned IDs remain available for gateway redirects.
|
|
1010
|
-
|
|
1011
|
-
This integrates metadata, not payment signing or upstream protocol support.
|
|
1012
|
-
New protocols still require gateway compatibility. Gateway payment quotes and
|
|
1013
|
-
account settlement remain authoritative; catalog prices are estimates.
|
package/dist/cli.js
CHANGED
|
@@ -10048,6 +10048,25 @@ var init_models = __esm({
|
|
|
10048
10048
|
}
|
|
10049
10049
|
});
|
|
10050
10050
|
|
|
10051
|
+
// src/platform-fee.ts
|
|
10052
|
+
function validPercent(value) {
|
|
10053
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
10054
|
+
}
|
|
10055
|
+
function platformFeePercentOf(row) {
|
|
10056
|
+
if (row.billing_mode !== "paid") return 0;
|
|
10057
|
+
const pricing = row.pricing && typeof row.pricing === "object" ? row.pricing : void 0;
|
|
10058
|
+
return validPercent(pricing?.platform_fee_percent) ?? validPercent(row.platform_fee_percent) ?? 0;
|
|
10059
|
+
}
|
|
10060
|
+
function withPlatformFee(tokenCostUsd, platformFeePercent) {
|
|
10061
|
+
const percent = validPercent(platformFeePercent) ?? 0;
|
|
10062
|
+
return tokenCostUsd * (1 + percent / 100);
|
|
10063
|
+
}
|
|
10064
|
+
var init_platform_fee = __esm({
|
|
10065
|
+
"src/platform-fee.ts"() {
|
|
10066
|
+
"use strict";
|
|
10067
|
+
}
|
|
10068
|
+
});
|
|
10069
|
+
|
|
10051
10070
|
// src/model-catalog.ts
|
|
10052
10071
|
function fallbackCatalog() {
|
|
10053
10072
|
return {
|
|
@@ -10098,7 +10117,10 @@ function projectClawCatalog(state) {
|
|
|
10098
10117
|
model.outputPrice = row.billing_mode === "paid" ? row.pricing.output : 0;
|
|
10099
10118
|
delete model.promo;
|
|
10100
10119
|
delete model.flatPrice;
|
|
10120
|
+
delete model.platformFeePercent;
|
|
10101
10121
|
if (row.billing_mode === "flat") model.flatPrice = row.pricing.flat;
|
|
10122
|
+
const feePercent = platformFeePercentOf(row);
|
|
10123
|
+
if (feePercent > 0) model.platformFeePercent = feePercent;
|
|
10102
10124
|
if (row.context_window) model.contextWindow = row.context_window;
|
|
10103
10125
|
if (row.max_output) model.maxOutput = row.max_output;
|
|
10104
10126
|
if (!old) {
|
|
@@ -10180,6 +10202,7 @@ function fingerprint(view) {
|
|
|
10180
10202
|
m.inputPrice,
|
|
10181
10203
|
m.outputPrice,
|
|
10182
10204
|
m.flatPrice ?? null,
|
|
10205
|
+
m.platformFeePercent ?? 0,
|
|
10183
10206
|
m.contextWindow,
|
|
10184
10207
|
m.maxOutput
|
|
10185
10208
|
]),
|
|
@@ -10193,6 +10216,7 @@ var init_model_catalog = __esm({
|
|
|
10193
10216
|
init_runtime();
|
|
10194
10217
|
init_api_key();
|
|
10195
10218
|
init_models();
|
|
10219
|
+
init_platform_fee();
|
|
10196
10220
|
}
|
|
10197
10221
|
});
|
|
10198
10222
|
|
|
@@ -91200,7 +91224,7 @@ function deduplicateLargeBlocks(messages) {
|
|
|
91200
91224
|
if (!msg.content || typeof msg.content !== "string" || msg.content.length < 500) {
|
|
91201
91225
|
return msg;
|
|
91202
91226
|
}
|
|
91203
|
-
const blockKey = msg.content
|
|
91227
|
+
const blockKey = msg.content;
|
|
91204
91228
|
if (blockHashes.has(blockKey)) {
|
|
91205
91229
|
const firstIdx = blockHashes.get(blockKey);
|
|
91206
91230
|
const original = msg.content;
|
|
@@ -157356,7 +157380,10 @@ function estimateAmount(modelId, bodyLength, maxTokens, models = BLOCKRUN_MODEL_
|
|
|
157356
157380
|
} else {
|
|
157357
157381
|
const estimatedInputTokens = Math.ceil(bodyLength / 4);
|
|
157358
157382
|
const estimatedOutputTokens = maxTokens || model.maxOutput || 4096;
|
|
157359
|
-
costUsd =
|
|
157383
|
+
costUsd = withPlatformFee(
|
|
157384
|
+
estimatedInputTokens / 1e6 * model.inputPrice + estimatedOutputTokens / 1e6 * model.outputPrice,
|
|
157385
|
+
model.platformFeePercent
|
|
157386
|
+
);
|
|
157360
157387
|
}
|
|
157361
157388
|
if (costUsd > 0) costUsd += 1e-3;
|
|
157362
157389
|
const amountMicros = Math.max(1e3, Math.ceil(costUsd * 1.2 * 1e6));
|
|
@@ -161764,7 +161791,10 @@ data: [DONE]
|
|
|
161764
161791
|
} else if (apiKeyPricing) {
|
|
161765
161792
|
const inTokens = responseInputTokens ?? chargedInputTokens;
|
|
161766
161793
|
const outTokens = responseOutputTokens ?? 0;
|
|
161767
|
-
logCost2 = (
|
|
161794
|
+
logCost2 = withPlatformFee(
|
|
161795
|
+
(inTokens * (apiKeyPricing.inputPrice ?? 0) + outTokens * (apiKeyPricing.outputPrice ?? 0)) / 1e6,
|
|
161796
|
+
modelsById.get(logModel)?.platformFeePercent
|
|
161797
|
+
);
|
|
161768
161798
|
logSavings = costs.baselineCost > 0 ? Math.max(0, (costs.baselineCost - logCost2) / costs.baselineCost) : 0;
|
|
161769
161799
|
} else {
|
|
161770
161800
|
logCost2 = costs.costEstimate;
|
|
@@ -161806,6 +161836,7 @@ var init_proxy = __esm({
|
|
|
161806
161836
|
init_router();
|
|
161807
161837
|
init_models();
|
|
161808
161838
|
init_max_tokens();
|
|
161839
|
+
init_platform_fee();
|
|
161809
161840
|
init_logger();
|
|
161810
161841
|
init_stats();
|
|
161811
161842
|
init_dedup();
|
|
@@ -312753,6 +312784,16 @@ var init_redeem = __esm({
|
|
|
312753
312784
|
}
|
|
312754
312785
|
});
|
|
312755
312786
|
|
|
312787
|
+
// src/polymarket/units.ts
|
|
312788
|
+
function usdToBaseUnits(usd2, decimals) {
|
|
312789
|
+
return BigInt(Math.round(usd2 * 10 ** decimals));
|
|
312790
|
+
}
|
|
312791
|
+
var init_units = __esm({
|
|
312792
|
+
"src/polymarket/units.ts"() {
|
|
312793
|
+
"use strict";
|
|
312794
|
+
}
|
|
312795
|
+
});
|
|
312796
|
+
|
|
312756
312797
|
// src/polymarket/withdraw.ts
|
|
312757
312798
|
async function rawPusdBalance(owner) {
|
|
312758
312799
|
return getPublicClient().readContract({
|
|
@@ -312785,7 +312826,7 @@ async function withdrawFunds(input2, deps) {
|
|
|
312785
312826
|
isError: true
|
|
312786
312827
|
};
|
|
312787
312828
|
}
|
|
312788
|
-
const amountRaw = input2.amount_usd !== void 0 ?
|
|
312829
|
+
const amountRaw = input2.amount_usd !== void 0 ? usdToBaseUnits(input2.amount_usd, PUSD_DECIMALS) : balanceRaw;
|
|
312789
312830
|
if (amountRaw > balanceRaw) {
|
|
312790
312831
|
return {
|
|
312791
312832
|
text: `Requested $${input2.amount_usd} exceeds the pUSD balance of $${balanceUsd.toFixed(2)}.`,
|
|
@@ -312908,6 +312949,7 @@ var init_withdraw = __esm({
|
|
|
312908
312949
|
init_relayer();
|
|
312909
312950
|
init_setup();
|
|
312910
312951
|
init_spend_policy();
|
|
312952
|
+
init_units();
|
|
312911
312953
|
}
|
|
312912
312954
|
});
|
|
312913
312955
|
|
|
@@ -312979,7 +313021,7 @@ async function fundVault(input2, deps) {
|
|
|
312979
313021
|
};
|
|
312980
313022
|
}
|
|
312981
313023
|
const privateKey = getOrCreateWalletKey();
|
|
312982
|
-
const amountMicro = String(
|
|
313024
|
+
const amountMicro = String(usdToBaseUnits(amountUsd, USDC_DECIMALS));
|
|
312983
313025
|
const network = `eip155:${BASE_CHAIN_ID3}`;
|
|
312984
313026
|
const depositAuthorization = await signUnderSpendPolicy(
|
|
312985
313027
|
deps,
|
|
@@ -313036,6 +313078,7 @@ var init_fund = __esm({
|
|
|
313036
313078
|
init_positions();
|
|
313037
313079
|
init_setup();
|
|
313038
313080
|
init_spend_policy();
|
|
313081
|
+
init_units();
|
|
313039
313082
|
FUND_FEE_USD = 0.01;
|
|
313040
313083
|
USDC_DECIMALS = 6;
|
|
313041
313084
|
FUND_MIN_USD = Number(process.env.POLYMARKET_FUND_MIN_USD || "2");
|
package/dist/index.d.ts
CHANGED
|
@@ -422,6 +422,13 @@ type BlockRunModel = {
|
|
|
422
422
|
* Unlike promo, this never expires. Takes precedence over promo.
|
|
423
423
|
*/
|
|
424
424
|
flatPrice?: number;
|
|
425
|
+
/**
|
|
426
|
+
* Platform fee percent the gateway adds to this model's per-token cost
|
|
427
|
+
* (`platform_fee_percent` on its `/v1/models` row; see platform-fee.ts).
|
|
428
|
+
* Set only from a live catalog; absent means 0. The bundled list below never
|
|
429
|
+
* carries it, so the fee is never a number typed here.
|
|
430
|
+
*/
|
|
431
|
+
platformFeePercent?: number;
|
|
425
432
|
};
|
|
426
433
|
declare const BLOCKRUN_MODELS: BlockRunModel[];
|
|
427
434
|
/**
|
package/dist/index.js
CHANGED
|
@@ -278216,6 +278216,20 @@ var HINTS = {
|
|
|
278216
278216
|
404: `api.blockrun.ai does not serve this endpoint. Chat, Anthropic-shaped messages, images, speech, video and the partner APIs (Exa, prediction markets, phone lookup) all work on an API key. The wallet-only exceptions are the routes that bind a lease or a position to a payer address \u2014 buying/renewing/releasing phone numbers, and Polymarket trading \u2014 which need a wallet to own the thing being bought. For those, unset BLOCKRUN_API_KEY and run "clawrouter logout".`
|
|
278217
278217
|
};
|
|
278218
278218
|
|
|
278219
|
+
// src/platform-fee.ts
|
|
278220
|
+
function validPercent(value) {
|
|
278221
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
278222
|
+
}
|
|
278223
|
+
function platformFeePercentOf(row) {
|
|
278224
|
+
if (row.billing_mode !== "paid") return 0;
|
|
278225
|
+
const pricing = row.pricing && typeof row.pricing === "object" ? row.pricing : void 0;
|
|
278226
|
+
return validPercent(pricing?.platform_fee_percent) ?? validPercent(row.platform_fee_percent) ?? 0;
|
|
278227
|
+
}
|
|
278228
|
+
function withPlatformFee(tokenCostUsd, platformFeePercent) {
|
|
278229
|
+
const percent = validPercent(platformFeePercent) ?? 0;
|
|
278230
|
+
return tokenCostUsd * (1 + percent / 100);
|
|
278231
|
+
}
|
|
278232
|
+
|
|
278219
278233
|
// src/model-catalog.ts
|
|
278220
278234
|
function fallbackCatalog() {
|
|
278221
278235
|
return {
|
|
@@ -278266,7 +278280,10 @@ function projectClawCatalog(state) {
|
|
|
278266
278280
|
model.outputPrice = row.billing_mode === "paid" ? row.pricing.output : 0;
|
|
278267
278281
|
delete model.promo;
|
|
278268
278282
|
delete model.flatPrice;
|
|
278283
|
+
delete model.platformFeePercent;
|
|
278269
278284
|
if (row.billing_mode === "flat") model.flatPrice = row.pricing.flat;
|
|
278285
|
+
const feePercent = platformFeePercentOf(row);
|
|
278286
|
+
if (feePercent > 0) model.platformFeePercent = feePercent;
|
|
278270
278287
|
if (row.context_window) model.contextWindow = row.context_window;
|
|
278271
278288
|
if (row.max_output) model.maxOutput = row.max_output;
|
|
278272
278289
|
if (!old) {
|
|
@@ -278348,6 +278365,7 @@ function fingerprint(view) {
|
|
|
278348
278365
|
m.inputPrice,
|
|
278349
278366
|
m.outputPrice,
|
|
278350
278367
|
m.flatPrice ?? null,
|
|
278368
|
+
m.platformFeePercent ?? 0,
|
|
278351
278369
|
m.contextWindow,
|
|
278352
278370
|
m.maxOutput
|
|
278353
278371
|
]),
|
|
@@ -290672,7 +290690,7 @@ function deduplicateLargeBlocks(messages) {
|
|
|
290672
290690
|
if (!msg.content || typeof msg.content !== "string" || msg.content.length < 500) {
|
|
290673
290691
|
return msg;
|
|
290674
290692
|
}
|
|
290675
|
-
const blockKey = msg.content
|
|
290693
|
+
const blockKey = msg.content;
|
|
290676
290694
|
if (blockHashes.has(blockKey)) {
|
|
290677
290695
|
const firstIdx = blockHashes.get(blockKey);
|
|
290678
290696
|
const original = msg.content;
|
|
@@ -293565,7 +293583,10 @@ function estimateAmount(modelId, bodyLength, maxTokens, models = BLOCKRUN_MODEL_
|
|
|
293565
293583
|
} else {
|
|
293566
293584
|
const estimatedInputTokens = Math.ceil(bodyLength / 4);
|
|
293567
293585
|
const estimatedOutputTokens = maxTokens || model.maxOutput || 4096;
|
|
293568
|
-
costUsd =
|
|
293586
|
+
costUsd = withPlatformFee(
|
|
293587
|
+
estimatedInputTokens / 1e6 * model.inputPrice + estimatedOutputTokens / 1e6 * model.outputPrice,
|
|
293588
|
+
model.platformFeePercent
|
|
293589
|
+
);
|
|
293569
293590
|
}
|
|
293570
293591
|
if (costUsd > 0) costUsd += 1e-3;
|
|
293571
293592
|
const amountMicros = Math.max(1e3, Math.ceil(costUsd * 1.2 * 1e6));
|
|
@@ -298113,7 +298134,10 @@ data: [DONE]
|
|
|
298113
298134
|
} else if (apiKeyPricing) {
|
|
298114
298135
|
const inTokens = responseInputTokens ?? chargedInputTokens;
|
|
298115
298136
|
const outTokens = responseOutputTokens ?? 0;
|
|
298116
|
-
logCost2 = (
|
|
298137
|
+
logCost2 = withPlatformFee(
|
|
298138
|
+
(inTokens * (apiKeyPricing.inputPrice ?? 0) + outTokens * (apiKeyPricing.outputPrice ?? 0)) / 1e6,
|
|
298139
|
+
modelsById.get(logModel)?.platformFeePercent
|
|
298140
|
+
);
|
|
298117
298141
|
logSavings = costs.baselineCost > 0 ? Math.max(0, (costs.baselineCost - logCost2) / costs.baselineCost) : 0;
|
|
298118
298142
|
} else {
|
|
298119
298143
|
logCost2 = costs.costEstimate;
|
|
@@ -309807,6 +309831,11 @@ async function redeemPosition(input2, deps) {
|
|
|
309807
309831
|
}
|
|
309808
309832
|
}
|
|
309809
309833
|
|
|
309834
|
+
// src/polymarket/units.ts
|
|
309835
|
+
function usdToBaseUnits(usd, decimals) {
|
|
309836
|
+
return BigInt(Math.round(usd * 10 ** decimals));
|
|
309837
|
+
}
|
|
309838
|
+
|
|
309810
309839
|
// src/polymarket/withdraw.ts
|
|
309811
309840
|
async function rawPusdBalance(owner) {
|
|
309812
309841
|
return getPublicClient().readContract({
|
|
@@ -309839,7 +309868,7 @@ async function withdrawFunds(input2, deps) {
|
|
|
309839
309868
|
isError: true
|
|
309840
309869
|
};
|
|
309841
309870
|
}
|
|
309842
|
-
const amountRaw = input2.amount_usd !== void 0 ?
|
|
309871
|
+
const amountRaw = input2.amount_usd !== void 0 ? usdToBaseUnits(input2.amount_usd, PUSD_DECIMALS) : balanceRaw;
|
|
309843
309872
|
if (amountRaw > balanceRaw) {
|
|
309844
309873
|
return {
|
|
309845
309874
|
text: `Requested $${input2.amount_usd} exceeds the pUSD balance of $${balanceUsd.toFixed(2)}.`,
|
|
@@ -310022,7 +310051,7 @@ async function fundVault(input2, deps) {
|
|
|
310022
310051
|
};
|
|
310023
310052
|
}
|
|
310024
310053
|
const privateKey = getOrCreateWalletKey();
|
|
310025
|
-
const amountMicro = String(
|
|
310054
|
+
const amountMicro = String(usdToBaseUnits(amountUsd, USDC_DECIMALS));
|
|
310026
310055
|
const network = `eip155:${BASE_CHAIN_ID3}`;
|
|
310027
310056
|
const depositAuthorization = await signUnderSpendPolicy(
|
|
310028
310057
|
deps,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockrun/clawrouter",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.318",
|
|
4
4
|
"description": "Smart LLM router — save 84% on inference costs. 91 models (8 free). Pay by credit card (API key) or USDC (x402 wallet).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|