CONFIGURATION
Create a client
Give your existing viem client a native frame-transaction workflow. Keep your transport, chain configuration, and familiar public actions.
API
frameActions({ profile })Usage
TYPESCRIPTcreate-client.ts
import { createPublicClient, defineChain, http } from 'viem';import { frameActions, frameNetworks } from '@framepay/sdk';const network = frameNetworks.devnet; // selected FramePay RPCconst chain = defineChain({ id: network.chainId, name: network.name, nativeCurrency: { name: 'Test Ether', symbol: 'ETH', decimals: 18 }, rpcUrls: { default: { http: [network.rpcUrl] } },});const client = createPublicClient({ chain, transport: http(network.rpcUrl, { retryCount: 0 }),}).extend(frameActions({ profile: 'ethrex-eip8141-tracer' }));Examples use the configured client from Create a client.
Parameters
| Name | Type | Description |
|---|---|---|
profile | 'ethrex-eip8141-tracer' | The explicitly supported workshop profile. Configure your chain with ID 1337. |
Returns
Your viem client, extended with seven typed FramePay actions.
Behavior to know
- createFrameClient({ chain, transport, profile }) is also available as a convenience factory.
- The transport must point to the gateway sidecar. The gateway forwards chain reads and routes frame submissions.
- frameNetworks.devnet, frameNetworks.local and frameNetworks.public identify distinct environments with the same chain ID (1337). Keep keys, nonces, paymasters and pending transactions separate. Chain ID alone does not prevent replay between these devnets.
- The current sidecar follows the workshop’s PR #6 rules, which differ from later ERC-8421 revisions.