INNER CODE UNIT · JavaScript
chains
nirholas/XActions · packages/xactions-edge/index.js:65
const chains = accepts.map((entry) => NETWORK_NAMES[entry.network] || entry.network);
super(
`${tool} costs ${price} in USDC (${chains.join(' or ') || 'x402'}). `
+ 'Pay with an x402 client and retry: https://xactions.app/docs/guides/x402',
{ tool, status: 402 },
);
this.name = 'PaymentRequiredError';
this.price = price;
this.amount = amount;
this.currency = 'USDC';
this.networks = accepts.map((entry) => entry.network);
this.chains = chains;
this.accepts = accepts;
this.resource = payload?.resource?.url || first.resource || null;
}
}
const NETWORK_NAMES = {