Appearance
@hellomoon/ink-paymaster / InkPublicPaymasterClient
Class: InkPublicPaymasterClient
Low-level client for quotes and EntryPoint v0.7 UserOperation RPC methods.
Remarks
Prefer createInkViemPaymaster with a Viem Bundler Client for normal application use. Use this client directly when another account library constructs and signs raw UserOperations.
Constructors
Constructor
new InkPublicPaymasterClient(
options?):InkPublicPaymasterClient
Parameters
options?
InkPublicPaymasterClientOptions = {}
Returns
InkPublicPaymasterClient
Properties
bundlerUrl
readonlybundlerUrl:string
Fully resolved public Alto JSON-RPC endpoint.
deployment
readonlydeployment:object=INK_PUBLIC_PAYMASTER
Pinned chain, EntryPoint, paymaster, token, and route metadata.
bundlerPath
readonlybundlerPath:"/public/rpc"="/public/rpc"
chainId
readonlychainId:57073=57_073
chainName
readonlychainName:"Ink Mainnet"="Ink Mainnet"
entryPoint
readonlyentryPoint:`0x${string}`
entryPointVersion
readonlyentryPointVersion:"0.7"="0.7"
healthPath
readonlyhealthPath:"/healthz"="/healthz"
paymaster
readonlypaymaster:`0x${string}`
quotePath
readonlyquotePath:"/public/quote"="/public/quote"
quoteVersion
readonlyquoteVersion:2=2
serviceUrl
readonlyserviceUrl:"https://ink-paymaster.hellomoon.io"="https://ink-paymaster.hellomoon.io"
token
readonlytoken:object
token.address
readonlyaddress:`0x${string}`
token.decimals
readonlydecimals:6=6
token.symbol
readonlysymbol:"USDC"="USDC"
healthUrl
readonlyhealthUrl:string
Fully resolved service health endpoint.
quoteUrl
readonlyquoteUrl:string
Fully resolved public quote endpoint.
serviceUrl
readonlyserviceUrl:string
Normalized service origin without a trailing slash.
Methods
estimateUserOperationGas()
estimateUserOperationGas(
userOperation):Promise<Partial<Pick<RpcUserOperationV07,"callGasLimit"|"verificationGasLimit"|"preVerificationGas"|"paymasterVerificationGasLimit"|"paymasterPostOpGasLimit">>>
Requests eth_estimateUserOperationGas from the public Alto endpoint.
Parameters
userOperation
Returns
Promise<Partial<Pick<RpcUserOperationV07, "callGasLimit" | "verificationGasLimit" | "preVerificationGas" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit">>>
getChainId()
getChainId():
Promise<number>
Returns the chain ID reported by the public Alto endpoint.
Returns
Promise<number>
getHealth()
getHealth():
Promise<PublicPaymasterHealth>
Fetches and validates the public service health response.
Returns
Promise<PublicPaymasterHealth>
getSupportedEntryPoints()
getSupportedEntryPoints():
Promise<readonly`0x${string}`[]>
Returns the EntryPoint deployments supported by the public Alto endpoint.
Returns
Promise<readonly `0x${string}`[]>
getUserOperationReceipt()
getUserOperationReceipt(
hash):Promise<UserOperationReceipt|null>
Fetches a UserOperation receipt, returning null while the operation is pending or unknown.
Parameters
hash
`0x${string}`
Returns
Promise<UserOperationReceipt | null>
prepareUserOperation()
prepareUserOperation(
parameters):Promise<PreparedUserOperation>
Obtains a quote, attaches its paymaster fields, and applies the bundler gas estimate.
Parameters
parameters
Returns
Promise<PreparedUserOperation>
Remarks
Sign only the returned userOperation; quote and gas fields are not final before this call.
quoteUserOperation()
quoteUserOperation(
parameters):Promise<QuoteUserOperationResult>
Requests and validates a signed prepaid-USDC quote for a v0.7 UserOperation.
Parameters
parameters
Returns
Promise<QuoteUserOperationResult>
Remarks
This method does not estimate gas, attach the quote, or sign the operation.
sendUserOperation()
sendUserOperation(
userOperation):Promise<`0x${string}`>
Submits a signed v0.7 UserOperation through eth_sendUserOperation.
Parameters
userOperation
Returns
Promise<`0x${string}`>
waitForUserOperationReceipt()
waitForUserOperationReceipt(
parameters):Promise<UserOperationReceipt>
Polls until a UserOperation receipt is available or the configured timeout expires.
Parameters
parameters
WaitForUserOperationReceiptParameters
Returns
Promise<UserOperationReceipt>