A faremeter plugin for SKALE Network. Provides encrypted and confidential token payment handlers for the x402 protocol on SKALE chains.
This is a plugin for faremeter, not a standalone library. It extends faremeter's infrastructure with SKALE-specific payment capabilities.
import { wrap } from '@faremeter/fetch';
import { skale } from '@skalenetwork/faremeter-plugin/client';
import { skaleBaseMainnet } from '@skalenetwork/faremeter-plugin';
const handler = skale.charge({
walletClient,
publicClient,
account,
chain: skaleBaseMainnet,
});
const paidFetch = wrap(globalThis.fetch, { handlers: [handler] });import { middleware } from '@faremeter/middleware';
import { createFacilitatorHandler, skaleBaseMainnet } from '@skalenetwork/faremeter-plugin/server';
const handler = await createFacilitatorHandler(
skaleBaseMainnet,
process.env.SERVER_PRIVATE_KEY,
'USDC.e'
);
app.use(middleware({ x402Handlers: [handler] }));See AGENTS.md for full documentation and examples/ for code samples.
npm install @skalenetwork/faremeter-plugin
# or
bun install @skalenetwork/faremeter-pluginMIT © SKALE Labs