@wafermapxyz/cli 0.4.7 → 0.4.8
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/CHANGELOG.md +9 -0
- package/README.md +3 -3
- package/dist/cli.js +20 -15
- package/dist/index.js +7 -4
- package/dist/types/shared/x402client.d.ts +1 -1
- package/dist/types/src/core.d.ts +1 -1
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.8 (5 Nov 2026)
|
|
4
|
+
|
|
5
|
+
**Two more payment networks: Arc and Soneium.**
|
|
6
|
+
|
|
7
|
+
- `--network arc` pays in USDC on Arc (eip155:5042, the ERC-20 face of Arc's native USDC at `0x3600…0000`, 6 decimals) and `--network soneium` in bridged USDC.e on Soneium (eip155:1868). Both are EIP-3009 transfers, gasless for you; Wafermap settles them through the Elsa facilitator. The EIP-712 domains (`"USDC", "2"` and `"Bridged USDC (Soneium)", "2"`) were checked against each token's `DOMAIN_SEPARATOR()`.
|
|
8
|
+
- `balance`, `withdraw` and `history --verify` cover both. RPCs: `WAFERMAP_RPC_ARC`, `WAFERMAP_RPC_SONEIUM` (public ones by default). On Arc the gas token is USDC itself; on Soneium it is ETH.
|
|
9
|
+
- The MCP server's `network` option takes `arc` and `soneium`.
|
|
10
|
+
- LLM resources can stream: pass `accept: text/event-stream` to `x402fetch` and read `delta`, `receipt` and `done` events (https://wafermap.xyz/docs#streaming). Payment works as before and settles once the model finished.
|
|
11
|
+
|
|
3
12
|
## 0.4.7 (4 Nov 2026)
|
|
4
13
|
|
|
5
14
|
**`history --verify` checks Solana payments.** Until now they showed `unknown`.
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ The CLI, SDK and MCP server behind [Wafermap](https://wafermap.xyz): an x402 wal
|
|
|
6
6
|
- **discover** third-party x402 services in the open x402 index and **pay** them
|
|
7
7
|
- **swap** tokens through the KyberSwap aggregator
|
|
8
8
|
|
|
9
|
-
Every payment is checked against a per-payment cap and a daily cap before anything is signed. Swaps have their own per-swap cap. Payments settle in USDG on Robinhood Chain or USDC on Solana, Base, Arbitrum or
|
|
9
|
+
Every payment is checked against a per-payment cap and a daily cap before anything is signed. Swaps have their own per-swap cap. Payments settle in USDG on Robinhood Chain or USDC on Solana, Base, Arbitrum, Polygon, Arc or Soneium and are gasless; swaps need a little ETH for gas.
|
|
10
10
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
@@ -35,7 +35,7 @@ wafermap swap 0.01 ETH USDG
|
|
|
35
35
|
wafermap history
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Add `--yes` to skip the confirmation prompt (caps still apply), `--network base`, `arbitrum`, `polygon` or `solana` to pay in USDC on that network (swaps run on `robinhood` or `base`). Set `WAFERMAP_PASSWORD` to avoid the password prompt in scripts.
|
|
38
|
+
Add `--yes` to skip the confirmation prompt (caps still apply), `--network base`, `arbitrum`, `polygon`, `arc`, `soneium` or `solana` to pay in USDC on that network (swaps run on `robinhood` or `base`). Set `WAFERMAP_PASSWORD` to avoid the password prompt in scripts.
|
|
39
39
|
|
|
40
40
|
## MCP server
|
|
41
41
|
|
|
@@ -82,7 +82,7 @@ Pass `approve: (a) => boolean` to confirm each payment or swap yourself, and `le
|
|
|
82
82
|
|
|
83
83
|
## $WAFERMAP holder discount
|
|
84
84
|
|
|
85
|
-
A wallet that holds at least 100,000 $WAFERMAP on Robinhood Chain pays 50% less for Wafermap's own resources when it pays on an EVM network (Robinhood Chain, Base, Arbitrum, Polygon). Nothing to set up: `wafermap call` names the wallet to Wafermap and the quote comes back discounted; the server re-checks the balance of the wallet that signs. Marketplace listings and Solana payments keep the regular price. Check a wallet: https://wafermap.xyz/api/holder?address=0x…, or run `wafermap holder`.
|
|
85
|
+
A wallet that holds at least 100,000 $WAFERMAP on Robinhood Chain pays 50% less for Wafermap's own resources when it pays on an EVM network (Robinhood Chain, Base, Arbitrum, Polygon, Arc, Soneium). Nothing to set up: `wafermap call` names the wallet to Wafermap and the quote comes back discounted; the server re-checks the balance of the wallet that signs. Marketplace listings and Solana payments keep the regular price. Check a wallet: https://wafermap.xyz/api/holder?address=0x…, or run `wafermap holder`.
|
|
86
86
|
|
|
87
87
|
Wafermap's own resources can also be **paid in $WAFERMAP at 50% off, and the tokens are burned**: `wafermap approve-wafermap` once (a Permit2 approval, one Robinhood Chain transaction), then `wafermap call <id> --pay wafermap`. Each payment is a Permit2 signature for one exact amount, usable for two minutes only by Wafermap's relayer (fixed in the client), checked against a market price the client reads itself.
|
|
88
88
|
|
package/dist/cli.js
CHANGED
|
@@ -447,7 +447,7 @@ function choose(q, prefer = CHAIN_KEYS) {
|
|
|
447
447
|
const r = q.accepts.find((a) => a.chain.key === k);
|
|
448
448
|
if (r) return r;
|
|
449
449
|
}
|
|
450
|
-
throw new X402Error("no_supported_payment", q.offered.length ? `This service only accepts ${[...new Set(q.offered)].join(", ")}. Wafermap pays USDG on Robinhood Chain or USDC on Solana, Base, Arbitrum or
|
|
450
|
+
throw new X402Error("no_supported_payment", q.offered.length ? `This service only accepts ${[...new Set(q.offered)].join(", ")}. Wafermap pays USDG on Robinhood Chain or USDC on Solana, Base, Arbitrum, Polygon, Arc or Soneium.` : "The service offered no payment option.");
|
|
451
451
|
}
|
|
452
452
|
async function signPayment(signer, req, resource, solana) {
|
|
453
453
|
if (req.chain.vm === "svm") {
|
|
@@ -535,7 +535,10 @@ var init_x402client = __esm({
|
|
|
535
535
|
{ key: "solana", vm: "svm", id: 0, caip: SOLANA_CAIP, v1: "solana", stable: SOLANA_USDC, symbol: "USDC", name: "Solana" },
|
|
536
536
|
{ key: "base", vm: "evm", id: 8453, caip: "eip155:8453", v1: "base", stable: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", symbol: "USDC", name: "Base", domain: USDC_DOMAIN },
|
|
537
537
|
{ key: "arbitrum", vm: "evm", id: 42161, caip: "eip155:42161", v1: "arbitrum", stable: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", symbol: "USDC", name: "Arbitrum", domain: USDC_DOMAIN },
|
|
538
|
-
{ key: "polygon", vm: "evm", id: 137, caip: "eip155:137", v1: "polygon", stable: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", symbol: "USDC", name: "Polygon", domain: USDC_DOMAIN }
|
|
538
|
+
{ key: "polygon", vm: "evm", id: 137, caip: "eip155:137", v1: "polygon", stable: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", symbol: "USDC", name: "Polygon", domain: USDC_DOMAIN },
|
|
539
|
+
// EIP-712 domains read from the token contracts (name(), version()) and checked against DOMAIN_SEPARATOR().
|
|
540
|
+
{ key: "arc", vm: "evm", id: 5042, caip: "eip155:5042", v1: "arc", stable: "0x3600000000000000000000000000000000000000", symbol: "USDC", name: "Arc", domain: { name: "USDC", version: "2" } },
|
|
541
|
+
{ key: "soneium", vm: "evm", id: 1868, caip: "eip155:1868", v1: "soneium", stable: "0xbA9986D2381edf1DA03B0B9c1f8b00dc4AacC369", symbol: "USDC", name: "Soneium", domain: { name: "Bridged USDC (Soneium)", version: "2" } }
|
|
539
542
|
];
|
|
540
543
|
EVM_CHAINS = PAY_CHAINS.filter((c) => c.vm === "evm");
|
|
541
544
|
CHAIN_KEYS = PAY_CHAINS.map((c) => c.key);
|
|
@@ -643,7 +646,7 @@ __export(core_exports, {
|
|
|
643
646
|
});
|
|
644
647
|
import { createPublicClient, createWalletClient, erc20Abi as erc20Abi2, formatUnits as formatUnits2, http, pad, parseAbiItem, toEventSelector } from "viem";
|
|
645
648
|
import { privateKeyToAccount } from "viem/accounts";
|
|
646
|
-
import { arbitrum, base, polygon, robinhood } from "viem/chains";
|
|
649
|
+
import { arbitrum, arc, base, polygon, robinhood, soneium } from "viem/chains";
|
|
647
650
|
function mergeLog(entries) {
|
|
648
651
|
const outcomes = new Map(entries.filter((e) => e.of).map((e) => [e.of, e]));
|
|
649
652
|
return entries.filter((e) => !e.of).map((e) => {
|
|
@@ -748,7 +751,7 @@ var init_core = __esm({
|
|
|
748
751
|
}
|
|
749
752
|
code;
|
|
750
753
|
};
|
|
751
|
-
CHAINS = { robinhood, base, arbitrum, polygon };
|
|
754
|
+
CHAINS = { robinhood, base, arbitrum, polygon, arc, soneium };
|
|
752
755
|
AUTH_STATE_ABI = [{ type: "function", name: "authorizationState", stateMutability: "view", inputs: [{ name: "authorizer", type: "address" }, { name: "nonce", type: "bytes32" }], outputs: [{ type: "bool" }] }];
|
|
753
756
|
AUTH_USED = parseAbiItem("event AuthorizationUsed(address indexed authorizer, bytes32 indexed nonce)");
|
|
754
757
|
DEFAULT_LIMITS = { perPayment: 0.1, perDay: 1, perSwap: 25 };
|
|
@@ -1226,7 +1229,7 @@ function openWallet(password2, approve) {
|
|
|
1226
1229
|
limits: c.limits,
|
|
1227
1230
|
ledger: { entries: spendLog, record: appendSpend },
|
|
1228
1231
|
approve,
|
|
1229
|
-
rpc: { robinhood: process.env.WAFERMAP_RPC_ROBINHOOD, base: process.env.WAFERMAP_RPC_BASE, arbitrum: process.env.WAFERMAP_RPC_ARBITRUM, polygon: process.env.WAFERMAP_RPC_POLYGON, solana: process.env.WAFERMAP_RPC_SOLANA }
|
|
1232
|
+
rpc: { robinhood: process.env.WAFERMAP_RPC_ROBINHOOD, base: process.env.WAFERMAP_RPC_BASE, arbitrum: process.env.WAFERMAP_RPC_ARBITRUM, polygon: process.env.WAFERMAP_RPC_POLYGON, arc: process.env.WAFERMAP_RPC_ARC, soneium: process.env.WAFERMAP_RPC_SONEIUM, solana: process.env.WAFERMAP_RPC_SOLANA }
|
|
1230
1233
|
});
|
|
1231
1234
|
if (wm.solanaAddress) rememberSolana(wm.solanaAddress);
|
|
1232
1235
|
return wm;
|
|
@@ -1244,7 +1247,7 @@ var VERSION;
|
|
|
1244
1247
|
var init_version = __esm({
|
|
1245
1248
|
"src/version.ts"() {
|
|
1246
1249
|
"use strict";
|
|
1247
|
-
VERSION = "0.4.
|
|
1250
|
+
VERSION = "0.4.8";
|
|
1248
1251
|
}
|
|
1249
1252
|
});
|
|
1250
1253
|
|
|
@@ -1363,7 +1366,7 @@ async function runMcp() {
|
|
|
1363
1366
|
"wafermap_discover",
|
|
1364
1367
|
{
|
|
1365
1368
|
title: "Discover x402 services",
|
|
1366
|
-
description: "Search the open x402 index for third-party paid APIs (weather, search, enrichment, data\u2026). Services marked payable accept USDG on Robinhood Chain or USDC on Solana, Base, Arbitrum or
|
|
1369
|
+
description: "Search the open x402 index for third-party paid APIs (weather, search, enrichment, data\u2026). Services marked payable accept USDG on Robinhood Chain or USDC on Solana, Base, Arbitrum, Polygon, Arc or Soneium and can be called with wafermap_pay.",
|
|
1367
1370
|
inputSchema: { query: z.string().min(2).describe("What you need, in a few words."), limit: z.number().int().min(1).max(20).optional() }
|
|
1368
1371
|
},
|
|
1369
1372
|
async ({ query, limit }) => {
|
|
@@ -1441,7 +1444,7 @@ var init_mcp = __esm({
|
|
|
1441
1444
|
init_local();
|
|
1442
1445
|
init_store();
|
|
1443
1446
|
init_version();
|
|
1444
|
-
NET = z.enum(["robinhood", "solana", "base", "arbitrum", "polygon"]).optional().describe("Payment network: robinhood (USDG), or solana, base, arbitrum or
|
|
1447
|
+
NET = z.enum(["robinhood", "solana", "base", "arbitrum", "polygon", "arc", "soneium"]).optional().describe("Payment network: robinhood (USDG), or solana, base, arbitrum, polygon, arc or soneium (USDC). Defaults to your configured network.");
|
|
1445
1448
|
SWAP_NET = z.enum(["robinhood", "base"]).optional().describe("Swap network: robinhood or base. Defaults to your configured network when it is one of these, else robinhood.");
|
|
1446
1449
|
}
|
|
1447
1450
|
});
|
|
@@ -1775,7 +1778,9 @@ var PAY_NETWORKS = {
|
|
|
1775
1778
|
solana: { id: 0, caip: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", name: "Solana", asset: "USDC", explorer: "https://solscan.io", vm: "svm" },
|
|
1776
1779
|
base: { ...NETWORKS.base, vm: "evm" },
|
|
1777
1780
|
arbitrum: { id: 42161, caip: "eip155:42161", name: "Arbitrum", asset: "USDC", explorer: "https://arbiscan.io", vm: "evm" },
|
|
1778
|
-
polygon: { id: 137, caip: "eip155:137", name: "Polygon", asset: "USDC", explorer: "https://polygonscan.com", vm: "evm" }
|
|
1781
|
+
polygon: { id: 137, caip: "eip155:137", name: "Polygon", asset: "USDC", explorer: "https://polygonscan.com", vm: "evm" },
|
|
1782
|
+
arc: { id: 5042, caip: "eip155:5042", name: "Arc", asset: "USDC", explorer: "https://explorer.arc.io", vm: "evm" },
|
|
1783
|
+
soneium: { id: 1868, caip: "eip155:1868", name: "Soneium", asset: "USDC", explorer: "https://soneium.blockscout.com", vm: "evm" }
|
|
1779
1784
|
};
|
|
1780
1785
|
function payNetworkOf(v) {
|
|
1781
1786
|
const s = String(v ?? "").toLowerCase();
|
|
@@ -1790,7 +1795,7 @@ init_local();
|
|
|
1790
1795
|
init_solana();
|
|
1791
1796
|
init_store();
|
|
1792
1797
|
init_version();
|
|
1793
|
-
var HELP = `wafermap ${VERSION}: an x402 wallet for agents (Robinhood Chain, Solana, Base, Arbitrum, Polygon)
|
|
1798
|
+
var HELP = `wafermap ${VERSION}: an x402 wallet for agents (Robinhood Chain, Solana, Base, Arbitrum, Polygon, Arc, Soneium)
|
|
1794
1799
|
|
|
1795
1800
|
Wallet
|
|
1796
1801
|
wafermap init [--import] create (or import) the agent wallet, encrypted with a password
|
|
@@ -1817,7 +1822,7 @@ Trade
|
|
|
1817
1822
|
Agents
|
|
1818
1823
|
wafermap mcp run as an MCP server (stdio); password from \`wafermap keychain on\` or WAFERMAP_PASSWORD
|
|
1819
1824
|
|
|
1820
|
-
Common flags: --network robinhood|solana|base|arbitrum|polygon --yes (skip the confirmation)
|
|
1825
|
+
Common flags: --network robinhood|solana|base|arbitrum|polygon|arc|soneium --yes (skip the confirmation)
|
|
1821
1826
|
Files live in ${HOME}. Docs: https://wafermap.xyz/docs#cli`;
|
|
1822
1827
|
function parse(argv) {
|
|
1823
1828
|
const out = { _: [], flags: {} };
|
|
@@ -1919,7 +1924,7 @@ async function main() {
|
|
|
1919
1924
|
console.log(`\u2713 Agent wallet ${acct.address}
|
|
1920
1925
|
Solana address ${sol} (derived from the same key)
|
|
1921
1926
|
Key encrypted in ${HOME}/keystore.json. Forget the password and the key is gone: run \`wafermap export-key\` to back it up.
|
|
1922
|
-
Fund it with a few dollars of USDC on Solana (Solana address), or USDG on Robinhood Chain or USDC on Base, Arbitrum or
|
|
1927
|
+
Fund it with a few dollars of USDC on Solana (Solana address), or USDG on Robinhood Chain or USDC on Base, Arbitrum, Polygon, Arc or Soneium (EVM address). Payments are gasless; swaps need a little ETH.
|
|
1923
1928
|
Caps: $0.10 per payment, $1 per day, $25 per swap. Change with \`wafermap limits\`.`);
|
|
1924
1929
|
return;
|
|
1925
1930
|
}
|
|
@@ -1994,7 +1999,7 @@ async function main() {
|
|
|
1994
1999
|
const rows = mergeLog(spendLog()).filter((e) => e.at >= since).reverse();
|
|
1995
2000
|
if (!rows.length) return console.log(`Nothing in the last ${days} days.`);
|
|
1996
2001
|
const verify = a.flags.verify !== void 0;
|
|
1997
|
-
const RPC = { robinhood: process.env.WAFERMAP_RPC_ROBINHOOD, base: process.env.WAFERMAP_RPC_BASE, arbitrum: process.env.WAFERMAP_RPC_ARBITRUM, polygon: process.env.WAFERMAP_RPC_POLYGON, solana: process.env.WAFERMAP_RPC_SOLANA };
|
|
2002
|
+
const RPC = { robinhood: process.env.WAFERMAP_RPC_ROBINHOOD, base: process.env.WAFERMAP_RPC_BASE, arbitrum: process.env.WAFERMAP_RPC_ARBITRUM, polygon: process.env.WAFERMAP_RPC_POLYGON, arc: process.env.WAFERMAP_RPC_ARC, soneium: process.env.WAFERMAP_RPC_SONEIUM, solana: process.env.WAFERMAP_RPC_SOLANA };
|
|
1998
2003
|
const chain = [];
|
|
1999
2004
|
if (verify) {
|
|
2000
2005
|
const txCount = /* @__PURE__ */ new Map();
|
|
@@ -2039,7 +2044,7 @@ Total $${total.toFixed(4)} in ${pays.length} payments. From 0.3.3 every payment
|
|
|
2039
2044
|
${s.description.slice(0, 140)}${s.input ? `
|
|
2040
2045
|
input: ${JSON.stringify(s.input).slice(0, 140)}` : ""}`);
|
|
2041
2046
|
return console.log(`
|
|
2042
|
-
\u25CF payable with USDG (Robinhood Chain) or USDC (Solana, Base, Arbitrum, Polygon) \u25CB other networks only`);
|
|
2047
|
+
\u25CF payable with USDG (Robinhood Chain) or USDC (Solana, Base, Arbitrum, Polygon, Arc, Soneium) \u25CB other networks only`);
|
|
2043
2048
|
}
|
|
2044
2049
|
case "call": {
|
|
2045
2050
|
const id = a._[0] ?? die("Which resource? e.g. wafermap call gas-now network=base");
|
|
@@ -2063,7 +2068,7 @@ Total $${total.toFixed(4)} in ${pays.length} payments. From 0.3.3 every payment
|
|
|
2063
2068
|
case "balance": {
|
|
2064
2069
|
const addr = keystoreAddress() ?? die("No wallet yet. Run `wafermap init`.");
|
|
2065
2070
|
const { Wafermap: Wafermap2 } = await Promise.resolve().then(() => (init_core(), core_exports));
|
|
2066
|
-
const wm = new Wafermap2({ account: { ...privateKeyToAccount2(generatePrivateKey()), address: addr }, solanaAddress: keystoreSolana() ?? void 0, baseUrl: process.env.WAFERMAP_URL, rpc: { robinhood: process.env.WAFERMAP_RPC_ROBINHOOD, base: process.env.WAFERMAP_RPC_BASE, arbitrum: process.env.WAFERMAP_RPC_ARBITRUM, polygon: process.env.WAFERMAP_RPC_POLYGON, solana: process.env.WAFERMAP_RPC_SOLANA } });
|
|
2071
|
+
const wm = new Wafermap2({ account: { ...privateKeyToAccount2(generatePrivateKey()), address: addr }, solanaAddress: keystoreSolana() ?? void 0, baseUrl: process.env.WAFERMAP_URL, rpc: { robinhood: process.env.WAFERMAP_RPC_ROBINHOOD, base: process.env.WAFERMAP_RPC_BASE, arbitrum: process.env.WAFERMAP_RPC_ARBITRUM, polygon: process.env.WAFERMAP_RPC_POLYGON, arc: process.env.WAFERMAP_RPC_ARC, soneium: process.env.WAFERMAP_RPC_SONEIUM, solana: process.env.WAFERMAP_RPC_SOLANA } });
|
|
2067
2072
|
const b = await wm.balances();
|
|
2068
2073
|
console.log(addr);
|
|
2069
2074
|
for (const n of NETS) console.log(` ${n.padEnd(10)} ${b[n] ? `${Number(b[n].stable).toFixed(4)} ${b[n].symbol} ${Number(b[n].eth).toPrecision(4)} ${b[n].gas}` : n === "solana" && !wm.solanaAddress ? "run `wafermap address` once with WAFERMAP_PASSWORD set" : "unreadable (RPC did not answer)"}`);
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/core.ts
|
|
2
2
|
import { createPublicClient, createWalletClient, erc20Abi as erc20Abi2, formatUnits as formatUnits2, http, pad, parseAbiItem, toEventSelector } from "viem";
|
|
3
3
|
import { privateKeyToAccount } from "viem/accounts";
|
|
4
|
-
import { arbitrum, base, polygon, robinhood } from "viem/chains";
|
|
4
|
+
import { arbitrum, arc, base, polygon, robinhood, soneium } from "viem/chains";
|
|
5
5
|
|
|
6
6
|
// shared/swap.ts
|
|
7
7
|
import { decodeFunctionData, erc20Abi, formatUnits, getAddress, isAddress, parseAbi, parseUnits } from "viem";
|
|
@@ -357,7 +357,10 @@ var PAY_CHAINS = [
|
|
|
357
357
|
{ key: "solana", vm: "svm", id: 0, caip: SOLANA_CAIP, v1: "solana", stable: SOLANA_USDC, symbol: "USDC", name: "Solana" },
|
|
358
358
|
{ key: "base", vm: "evm", id: 8453, caip: "eip155:8453", v1: "base", stable: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", symbol: "USDC", name: "Base", domain: USDC_DOMAIN },
|
|
359
359
|
{ key: "arbitrum", vm: "evm", id: 42161, caip: "eip155:42161", v1: "arbitrum", stable: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", symbol: "USDC", name: "Arbitrum", domain: USDC_DOMAIN },
|
|
360
|
-
{ key: "polygon", vm: "evm", id: 137, caip: "eip155:137", v1: "polygon", stable: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", symbol: "USDC", name: "Polygon", domain: USDC_DOMAIN }
|
|
360
|
+
{ key: "polygon", vm: "evm", id: 137, caip: "eip155:137", v1: "polygon", stable: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", symbol: "USDC", name: "Polygon", domain: USDC_DOMAIN },
|
|
361
|
+
// EIP-712 domains read from the token contracts (name(), version()) and checked against DOMAIN_SEPARATOR().
|
|
362
|
+
{ key: "arc", vm: "evm", id: 5042, caip: "eip155:5042", v1: "arc", stable: "0x3600000000000000000000000000000000000000", symbol: "USDC", name: "Arc", domain: { name: "USDC", version: "2" } },
|
|
363
|
+
{ key: "soneium", vm: "evm", id: 1868, caip: "eip155:1868", v1: "soneium", stable: "0xbA9986D2381edf1DA03B0B9c1f8b00dc4AacC369", symbol: "USDC", name: "Soneium", domain: { name: "Bridged USDC (Soneium)", version: "2" } }
|
|
361
364
|
];
|
|
362
365
|
var EVM_CHAINS = PAY_CHAINS.filter((c) => c.vm === "evm");
|
|
363
366
|
var CHAIN_KEYS = PAY_CHAINS.map((c) => c.key);
|
|
@@ -466,7 +469,7 @@ function choose(q, prefer = CHAIN_KEYS) {
|
|
|
466
469
|
const r = q.accepts.find((a) => a.chain.key === k);
|
|
467
470
|
if (r) return r;
|
|
468
471
|
}
|
|
469
|
-
throw new X402Error("no_supported_payment", q.offered.length ? `This service only accepts ${[...new Set(q.offered)].join(", ")}. Wafermap pays USDG on Robinhood Chain or USDC on Solana, Base, Arbitrum or
|
|
472
|
+
throw new X402Error("no_supported_payment", q.offered.length ? `This service only accepts ${[...new Set(q.offered)].join(", ")}. Wafermap pays USDG on Robinhood Chain or USDC on Solana, Base, Arbitrum, Polygon, Arc or Soneium.` : "The service offered no payment option.");
|
|
470
473
|
}
|
|
471
474
|
var TYPES = {
|
|
472
475
|
TransferWithAuthorization: [
|
|
@@ -601,7 +604,7 @@ var WafermapError = class extends Error {
|
|
|
601
604
|
}
|
|
602
605
|
code;
|
|
603
606
|
};
|
|
604
|
-
var CHAINS = { robinhood, base, arbitrum, polygon };
|
|
607
|
+
var CHAINS = { robinhood, base, arbitrum, polygon, arc, soneium };
|
|
605
608
|
var AUTH_STATE_ABI = [{ type: "function", name: "authorizationState", stateMutability: "view", inputs: [{ name: "authorizer", type: "address" }, { name: "nonce", type: "bytes32" }], outputs: [{ type: "bool" }] }];
|
|
606
609
|
function mergeLog(entries) {
|
|
607
610
|
const outcomes = new Map(entries.filter((e) => e.of).map((e) => [e.of, e]));
|
|
@@ -10,7 +10,7 @@ export type Signer = {
|
|
|
10
10
|
message: any;
|
|
11
11
|
}) => Promise<Hex>;
|
|
12
12
|
};
|
|
13
|
-
export type ChainKey = "robinhood" | "base" | "arbitrum" | "polygon" | "solana";
|
|
13
|
+
export type ChainKey = "robinhood" | "base" | "arbitrum" | "polygon" | "arc" | "soneium" | "solana";
|
|
14
14
|
export type Chain = {
|
|
15
15
|
key: ChainKey;
|
|
16
16
|
vm: "evm" | "svm";
|
package/dist/types/src/core.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export type WafermapOptions = {
|
|
|
61
61
|
solanaAddress?: string;
|
|
62
62
|
/** Default https://wafermap.xyz */
|
|
63
63
|
baseUrl?: string;
|
|
64
|
-
/** Preferred payment network. Default robinhood (USDG); base, arbitrum, polygon and solana pay in USDC. */
|
|
64
|
+
/** Preferred payment network. Default robinhood (USDG); base, arbitrum, polygon, arc, soneium and solana pay in USDC. */
|
|
65
65
|
network?: Net;
|
|
66
66
|
limits?: Partial<Limits>;
|
|
67
67
|
/** Where spending is remembered for the daily cap. Default: in memory. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wafermapxyz/cli",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "Wafermap for agents: an encrypted local wallet that pays x402 resources, discovers and pays third-party x402 services (USDG on Robinhood Chain; USDC on Solana, Base, Arbitrum, Polygon), and swaps on Robinhood Chain and Base. CLI, SDK and MCP server.",
|
|
3
|
+
"version": "0.4.8",
|
|
4
|
+
"description": "Wafermap for agents: an encrypted local wallet that pays x402 resources, discovers and pays third-party x402 services (USDG on Robinhood Chain; USDC on Solana, Base, Arbitrum, Polygon, Arc, Soneium), and swaps on Robinhood Chain and Base. CLI, SDK and MCP server.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"wafermap": "dist/cli.js"
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
"base",
|
|
37
37
|
"arbitrum",
|
|
38
38
|
"polygon",
|
|
39
|
+
"arc",
|
|
40
|
+
"soneium",
|
|
39
41
|
"solana",
|
|
40
42
|
"usdg",
|
|
41
43
|
"usdc"
|