Skip to main content
SELAT Router SDK supports three signer patterns. Pick the simplest one that matches your security model.

Private key signer

Use this when you need the fastest path to get started and the private key is acceptable in-process.
import { RouterClient, createViemSigner } from "@selat-ai/router-client";

const signer = createViemSigner(process.env.X402_CLIENT_PRIVATE_KEY as `0x${string}`);

const client = new RouterClient({
  chain: "base",
  signer
});

Circle Agent Wallet signer

Use this when you want the signer to stay outside the SDK process and you already manage a Circle Agent Wallet.
import { RouterClient, createCircleAgentWalletSigner } from "@selat-ai/router-client";

const signer = createCircleAgentWalletSigner({
  address: process.env.SELAT_SIGNER_ADDRESS as `0x${string}`,
  chain: "base"
});

const client = new RouterClient({
  chain: "base",
  signer
});
This is the recommended option for production when you want to keep keys out of the application runtime.

Remote signer

Use this when signing happens in a wallet service, HSM, or KMS.
import { RouterClient, createRemoteSigner } from "@selat-ai/router-client";

const signer = createRemoteSigner(
  "0x1111111111111111111111111111111111111111",
  async ({ address, typedData }) => {
    const response = await fetch("https://signer.example.com/sign-typed-data", {
      method: "POST",
      headers: { "content-type": "application/json" },
      body: JSON.stringify({ address, typedData })
    });

    const data = await response.json() as { signature: `0x${string}` };
    return data.signature;
  }
);

Choosing a signer

  • Use a private key for the quickest prototype.
  • Use Circle Agent Wallets for production when the wallet should remain outside the SDK process.
  • Use a remote signer when your org already centralizes signing in a separate service.