Connect 4337
Cometh ConnectCometh MarketplaceCometh Checkout
  • 🚀Quick start
    • What is Connect 4337
    • Getting started
    • Supported Networks
  • 🛠️CORE FEATURES
    • Create a Wallet
    • Send transactions
    • Go Gasless
    • Sign/Verify a message
    • Retrieve a wallet address
    • Handle owners
    • Import a safe into connect
  • 🥷ADVANCED
    • Session Keys
      • Tutorial
      • Policies
        • Sudo policy
        • Action policy
    • Social recovery
    • Add a passkey signer on a different OS
    • Capabilities
      • sendCalls
      • getCallsStatus
      • getCapabilities
      • grantPermissions
    • Other signers (Auth Providers)
      • EOA wallets (Metamask, Phantom...)
      • Magic signer
      • Web3Auth signer
      • Turnkey signer
      • Privy signer
  • 🔌Integrations
    • React hooks
      • ConnectProvider
      • useAccount
      • useConnect
      • useDisconnect
      • useGetGasPrice
      • useSendTransaction
      • useSignMessage
      • useVerifyMessage
      • useWriteContract
      • Handle owners
        • useRemoveOwner
        • useValidateAddDevice
        • useCreateNewSigner
        • useAddOwner
        • useGetOwners/EnrichedOwners
      • Session Keys
        • useGrantPermission
        • useSendPermission
        • useSessionKeyClient
        • useSessionKeySigner
      • Recovery
        • useIsRecoveryActive
        • useSetUpRecovery
        • useGetRecoveryRequest
        • useCancelRecoveryRequest
    • Mobile SDKs
      • IOS
      • Android
      • React Native
    • Wagmi
  • SDK Core
    • Signers (Auth Providers)
      • EOA wallets (Metamask, Phantom...)
      • Magic signer
      • Web3Auth signer
      • Turnkey signer
      • Privy signer
    • Handle owners
    • Capabilities
      • sendCalls
      • getCallsStatus
      • getCapabilities
  • SDK Session Keys
    • Setup Smart Account Client
    • Manage session keys
    • Policies
      • Sudo policy
      • Action policy
  • 📦Bundler
    • Bundler API
      • eth_sendUserOperation
      • eth_estimateUserOperationGas
      • eth_getUserOperationByHash
      • eth_getUserOperationReceipt
      • eth_supportedEntryPoints
  • 💳Paymaster
    • Paymaster API
  • 📖RESOURCES
    • Migrate from the connect legacy SDK
    • Connect Legacy SDKs (Unity, JS)
    • FAQ
Powered by GitBook
On this page
  • What is a Paymaster ?
  • How to sponsor transactions
  • Endpoints
  • pm_sponsorUserOperation
  • pm_supportedEntryPoints
  • Routes for Sponsored Addresses
  • Routes for Sponsored Chains
  1. Paymaster

Paymaster API

Previouseth_supportedEntryPointsNextMigrate from the connect legacy SDK

Last updated 1 month ago

What is a Paymaster ?

Paymasters are smart contracts designed to facilitate transaction sponsorship.

They allow third parties to sponsor the gas fees for transactions, enabling users to interact with the blockchain without having to pay for gas themselves.

This can be particularly useful for onboarding new users, running promotional campaigns, or supporting decentralized applications where the end-user experience is improved by abstracting away transaction costs.

How to sponsor transactions

To authorize the sponsorship of a given contract address, you need to add it to your sponsored addressesed in the dashboard. From there, we will accept sponsoring transactions targeting this contract.

At the end of each month, you will receive an invoice with the total amount of gas fees covered. This fee is then billed through the payment method in your Cometh Connect account.

With Cometh Connect, there is no overhead on the price you pay. Depending on your license type, you have a max number of transactions you can sponsor each month.

Have a look at the "Gasless with Paymaster" section of the SDK documentation to see how to integrate it seamlessly.

Endpoints

URL

https://paymaster.cometh.io/CHAIN_ID?apikey=API_KEY

Example for Arbitrum Sepolia : https://paymaster.cometh.io/421614?apikey=API_KEY

pm_sponsorUserOperation

Submit a UserOperation to the paymaster. If approved for sponsorship, it returns the paymasterAndData along with updated gas values

Request

{
    "jsonrpc": "2.0",
    "id": 13,
    "method": "pm_sponsorUserOperation",
    "params": [
        {
            "sender": "0x8Fb8E6461F278c1651cb0Be92f27817e7Af128D9",
            "nonce": "0x09",
            "callData": "0x7bb374280000000000000000000000004fbf9ee4b2af774d4617eab027ac2901a41a7b5f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000406661abd00000000000000000000000000000000000000000000000000000000",
            "callGasLimit": "0x0",
            "verificationGasLimit": "0x0",
            "preVerificationGas": "0x0",
            "maxFeePerGas": "0xe4e1c00",
            "maxPriorityFeePerGas": "0x7270e00",
            "signature": "0xecececececececececececececececececececececececececececececececec"
        },
        "0x0000000071727De22E5E9d8BAf0edAc6f37da032"
    ]
}

Response

{
	"jsonrpc": "2.0",
	"id": 13,
	"result": {
		"paymaster": "0xc49d6e93bB127A2FDf349FAdBD90De6853Bf40ff",
		"paymasterData": "0x0000000000000000000000000000000000000000000000000000000067108be20000000000000000000000000000000000000000000000000000000000001234bbdf2f2f5c456f14c1c72a3fb87c73a64dc8157caa5a8243213f4e0beab664335c31160514ee572b2006e78b77dee3749303d737f3ecf58b27cbeddf24120bac1c",
		"paymasterPostOpGasLimit": "0x01",
		"paymasterVerificationGasLimit": "0x0927c0",
		"hash": "0x2a079aad99c4d17456e487153e689bcedbb55707146b597172b05ab6721cf2b5",
		"signature": "0xbbdf2f2f5c456f14c1c72a3fb87c73a64dc8157caa5a8243213f4e0beab664335c31160514ee572b2006e78b77dee3749303d737f3ecf58b27cbeddf24120bac1c",
		"preVerificationGas": "0x51a257",
		"verificationGasLimit": "0x1987c",
		"callGasLimit": "0x19afb"
	}
}

pm_supportedEntryPoints

Returns an array of supported EntryPoint addresses.

Request

{
   "method":"pm_supportedEntryPoints",
   "id":1,
   "params":[],
   "jsonrpc":"2.0"
}

Response

{
	"jsonrpc": "2.0",
	"id": 1,
	"result": [
		"0x0000000071727De22E5E9d8BAf0edAc6f37da032"
	]
}

Routes for Sponsored Addresses

Retrieve Sponsored Addresses

Use the following GET request to obtain the list of sponsored addresses for a specific chain.

curl --request GET \
  --url 'https://paymaster.cometh.io/sponsored-address/CHAIN_ID/?apikey=APIKEY' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: insomnia/9.2.0'

Set Sponsored Address

To add a new sponsored address, send a POST request with the target address and chain ID.

curl --request POST \
  --url 'https://paymaster.cometh.io/sponsored-address/?apisecret=API_SECRET' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: insomnia/9.2.0' \
  --data '{
    "targetAddress": "0xE1e5072de1d9B120Cc33C57EbADBCD33DBC6dD62",
    "chainId": 100
}'

Routes for Sponsored Chains

Retrieve Sponsored Chains

The following GET request can be used to get information about sponsored chains.

curl --request GET \
  --url 'https://paymaster.cometh.io/sponsored-chain/CHAIN_ID/?apikey=APIKEY' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: insomnia/9.2.0'

Set Sponsored Chain

This route enables users to sponsor an entire chain, allowing transactions on the chain to benefit from sponsorship.

curl --request POST \
  --url 'https://paymaster.cometh.io/sponsored-chain/' \
  --header 'Content-Type: application/json' \
  --header 'apisecret: API_SECRET' \
  --data '{
    "chainId": 100
}'

We support multiple chains for the paymaster services, you just need to modify the chainId and apiKey to your network. Here the

💳
Go Gasless
list of our current supported networks.
Add a sponsored contract address