Skip to content

@hellomoon/ink-paymaster


@hellomoon/ink-paymaster / InkPublicPaymasterClient

Class: InkPublicPaymasterClient ​

Low-level client for public prepaid quotes and EntryPoint 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 ​

readonly bundlerUrl: string

Fully resolved public Alto JSON-RPC endpoint.


deployment ​

readonly deployment: InkPublicPaymasterDeployment

Pinned chain, EntryPoint, paymaster, token, and route metadata.


healthUrl ​

readonly healthUrl: string

Fully resolved service health endpoint.


quoteUrl ​

readonly quoteUrl: string

Fully resolved public quote endpoint.


serviceUrl ​

readonly serviceUrl: string

Normalized service origin without a trailing slash.

Methods ​

estimateUserOperationGas() ​

estimateUserOperationGas(userOperation): Promise<Partial<Pick<RpcUserOperation, "callGasLimit" | "verificationGasLimit" | "preVerificationGas" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit">>>

Requests eth_estimateUserOperationGas from the public Alto endpoint.

Parameters ​

userOperation ​

RpcUserOperation

Returns ​

Promise<Partial<Pick<RpcUserOperation, "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 ​

QuoteUserOperationParameters

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-token quote for a UserOperation.

Parameters ​

parameters ​

QuoteUserOperationParameters

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 UserOperation through eth_sendUserOperation.

Parameters ​

userOperation ​

RpcUserOperation

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>

ERC-4337 paymaster clients for Ink Mainnet