Paymaster Client
A function to create a Paymaster Client.
A Paymaster Client is an interface to interact with ERC-7677 compliant Paymasters and provides the ability to sponsor User Operation gas fees.
Import
import { } from 'viem/account-abstraction'Usage
import { } from 'viem'
import {
,
,
} from 'viem/account-abstraction'
import { } from 'viem/chains'
const = ({
: ('https://public.pimlico.io/v2/11155111/rpc'),
})
const = ({
: ,
: ,
: ('https://public.pimlico.io/v2/11155111/rpc'),
})Parameters
key (optional)
- Type:
string - Default:
"paymaster"
A key for the Client.
const = ({
: 'foo',
: ('https://public.pimlico.io/v2/11155111/rpc')
})name (optional)
- Type:
string - Default:
"Paymaster Client"
A name for the Client.
const = ({
: 'Foo Bundler Client',
: ('https://public.pimlico.io/v2/11155111/rpc')
})pollingInterval (optional)
- Type:
number - Default:
4_000
Frequency (in ms) for polling enabled Actions.
const = ({
: 10_000,
: ('https://public.pimlico.io/v2/11155111/rpc')
})rpcSchema (optional)
- Type:
RpcSchema - Default:
PaymasterRpcSchema
Typed JSON-RPC schema for the client.
import { } from 'viem'
type = [{
: 'eth_wagmi',
: [string]
: string
}]
const = ({
: <>(),
: ('https://public.pimlico.io/v2/11155111/rpc')
})
const = await .({
: 'eth_wa // [!code focus]
: ['hello'],
}) transport
- Type:
Transport
The Transport of the Paymaster Client.
const = ({
: ('https://public.pimlico.io/v2/11155111/rpc'),
})