agent402-openclaw 0.5.6 → 0.5.7

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
@@ -107,7 +107,7 @@ of a cent and a long one pays for what it asks. `--flat` (or
107
107
  Either way OpenClaw's per-token cost fields stay zero; the price is per call. A model sent to another flat
108
108
  tier's route is priced at its home tier: the 402 quotes that tier's price, and the paid call is served under
109
109
  that tier's caps (the answer says so in `agent402_tier`). The router, grounded and stealth tiers still answer a
110
- 400 naming the right route; nothing is charged. A client-supplied `Idempotency-Key`
110
+ 400 naming the right route; nothing is charged on x402. A client-supplied `Idempotency-Key`
111
111
  is passed through: on a credits key, a retry with the same key replays the paid
112
112
  answer; on a wallet, each forwarded call signs a fresh payment, which the server
113
113
  treats as a new purchase. Without a key, each call is its own payment.
package/known-assets.js CHANGED
@@ -32,10 +32,46 @@ export const KNOWN_ASSETS = Object.freeze({
32
32
  "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1": [{ asset: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", decimals: 6, symbol: "USDC" }], // devnet
33
33
  // Stellar: the USDC Stellar Asset Contract (7 decimals on Stellar).
34
34
  "stellar:pubnet": [{ asset: "CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75", decimals: 7, symbol: "USDC" }],
35
- // Algorand: USDC is ASA 31566704.
35
+ // Algorand: USDC is ASA 31566704. Mainnet is named by its CAIP-2 id (the
36
+ // first 32 characters of the base64 genesis hash) and, by sellers that
37
+ // predate it, by the full hash.
38
+ "algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73k": [{ asset: "31566704", decimals: 6, symbol: "USDC" }],
36
39
  "algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=": [{ asset: "31566704", decimals: 6, symbol: "USDC" }],
37
40
  });
38
41
 
42
+ /** Chain name -> every network id in the table that names that chain. A
43
+ * chain spelled two ways on the wire lists both, so a buyer's preference by
44
+ * name, or by either spelling, matches a seller's accept in the other. */
45
+ export const NETWORK_NAMES = Object.freeze({
46
+ base: ["eip155:8453"],
47
+ "base-sepolia": ["eip155:84532"],
48
+ polygon: ["eip155:137"],
49
+ arbitrum: ["eip155:42161"],
50
+ monad: ["eip155:143"],
51
+ celo: ["eip155:42220"],
52
+ avalanche: ["eip155:43114"],
53
+ sei: ["eip155:1329"],
54
+ optimism: ["eip155:10"],
55
+ arc: ["eip155:5042"],
56
+ robinhood: ["eip155:4663"],
57
+ solana: ["solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"],
58
+ "solana-devnet": ["solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"],
59
+ stellar: ["stellar:pubnet"],
60
+ algorand: ["algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73k", "algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8="],
61
+ });
62
+
63
+ /** The network ids a preference names: a chain name's ids; for an id, every
64
+ * id of the chain it belongs to (so either spelling matches the other); an
65
+ * id the table does not know passes through as itself. */
66
+ export function networkIdsOf(pref) {
67
+ const p = String(pref || "").trim();
68
+ if (!p) return [];
69
+ const byName = NETWORK_NAMES[p.toLowerCase()];
70
+ if (byName) return [...byName];
71
+ for (const ids of Object.values(NETWORK_NAMES)) if (ids.some((id) => id.toLowerCase() === p.toLowerCase())) return [...ids];
72
+ return [p];
73
+ }
74
+
39
75
  const EVM_ADDRESS = /^0x[0-9a-fA-F]{40}$/;
40
76
  // EVM addresses compare without case (checksum casing is presentation);
41
77
  // base58, Stellar and Algorand identifiers compare exactly.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent402-openclaw",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "OpenClaw model provider for Agent402: an auto-routed tier at a flat per-call price and explicit LLM models priced per request, paid in USDC over x402, or with a prepaid credits key, through a local proxy. Zero dependencies; x402 wallet payment is an optional peer.",
5
5
  "type": "module",
6
6
  "main": "index.js",