Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Solana Paymaster endpoints

All Solana Paymaster endpoints follow the JSON-RPC 2.0 specification and are available at:

https://api.openfort.io/rpc/solana/{cluster}

Include your Openfort publishable key in the Authorization header:

Authorization: Bearer YOUR_OPENFORT_PUBLISHABLE_KEY

signAndSendTransaction

Signs a transaction with the Openfort fee payer and immediately broadcasts it to the Solana network.

Request

{
  "jsonrpc": "2.0",
  "method": "signAndSendTransaction",
  "params": {
    "transaction": "base64EncodedTransaction",
    "signer_key": "signerPublicKey",
    "sig_verify": true
  },
  "id": 1
}

Parameters

ParameterTypeRequiredDescription
transactionstringYesBase64-encoded transaction to sign and send
signer_keystringNoSpecific signer public key to use
sig_verifybooleanNoWhether to verify signatures before sending

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "signature": "base58Signature",
    "signed_transaction": "base64EncodedSignedTransaction",
    "signer_pubkey": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE"
  }
}

Response fields

FieldDescription
signatureTransaction signature in base58 encoding
signed_transactionThe complete signed transaction in base64 format
signer_pubkeyPublic key of the fee payer signer

Example

const response = await fetch('https://api.openfort.io/rpc/solana/devnet', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_OPENFORT_PUBLISHABLE_KEY',
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'signAndSendTransaction',
    params: {
      transaction: base64EncodedTransaction,
      sig_verify: true
    },
    id: 1
  }),
})
 
const { result } = await response.json()
console.log('Transaction signature:', result.signature)

signTransaction

Signs a transaction with the Openfort fee payer without broadcasting it. The transaction must include necessary payment instructions to the fee payer.

Request

{
  "jsonrpc": "2.0",
  "method": "signTransaction",
  "params": {
    "transaction": "base64EncodedTransaction",
    "signer_key": "signerPublicKey",
    "sig_verify": true
  },
  "id": 1
}

Parameters

ParameterTypeRequiredDescription
transactionstringYesBase64-encoded transaction with fee payment instructions
signer_keystringNoSpecific signer public key to use
sig_verifybooleanNoWhether to verify signatures

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "signed_transaction": "base64EncodedSignedTransaction",
    "signer_pubkey": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE"
  }
}

Response fields

FieldDescription
signed_transactionThe complete signed transaction in base64 format
signer_pubkeyPublic key of the fee payer signer

transferTransaction

Creates a token transfer transaction with Openfort as the fee payer, enabling gasless token transfers.

Request

{
  "jsonrpc": "2.0",
  "method": "transferTransaction",
  "params": {
    "amount": 1000000,
    "token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "source": "sourceWalletPublicKey",
    "destination": "destinationWalletPublicKey",
    "signer_key": "signerPublicKey"
  },
  "id": 1
}

Parameters

ParameterTypeRequiredDescription
amountintegerYesTransfer amount in smallest token units (must be a non-negative integer)
tokenstringYesToken mint address (e.g., USDC)
sourcestringYesSource wallet public key
destinationstringYesDestination wallet public key
signer_keystringNoSpecific signer public key to use

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "transaction": "base64EncodedTransaction",
    "message": "base64EncodedMessage",
    "blockhash": "base58Blockhash",
    "signer_pubkey": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE"
  }
}

Response fields

FieldDescription
transactionBase64-encoded transaction ready for signing
messageBase64-encoded transaction message
blockhashBlockhash used in the transaction
signer_pubkeyPublic key of the signer used

estimateTransactionFee

Estimates the transaction fee in both lamports and optionally in the specified token.

Request

{
  "jsonrpc": "2.0",
  "method": "estimateTransactionFee",
  "params": {
    "transaction": "base64EncodedTransaction",
    "fee_token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "signer_key": "signerPublicKey",
    "sig_verify": true
  },
  "id": 1
}

Parameters

ParameterTypeRequiredDescription
transactionstringYesBase64-encoded transaction
fee_tokenstringNoToken mint address for fee calculation in token units
signer_keystringNoSpecific signer public key to use for estimation
sig_verifybooleanNoWhether to verify signatures

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "fee_in_lamports": 5000,
    "fee_in_token": 1000000,
    "signer_pubkey": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE",
    "payment_address": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE"
  }
}

Response fields

FieldDescription
fee_in_lamportsTransaction fee in lamports (SOL's smallest unit)
fee_in_tokenEquivalent fee amount in the specified token (only present if fee_token was provided)
signer_pubkeyPublic key of the signer used for fee estimation
payment_addressDestination address for fee payment

getSupportedTokens

Retrieves the list of tokens accepted for fee payment.

Request

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

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tokens": [
      "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
    ]
  }
}

Response fields

FieldDescription
tokensArray of token mint addresses accepted for fee payment

getConfig

Retrieves the current server configuration including enabled methods and fee payers.

Request

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

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "enabled_methods": {},
    "fee_payers": [
      "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE"
    ],
    "validation_config": {}
  }
}

Response fields

FieldDescription
enabled_methodsDictionary of available RPC methods and their enabled status
fee_payersList of authorized fee payer public keys
validation_configServer-side validation configuration

getPayerSigner

Retrieves the payer signer and payment destination addresses.

Request

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

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "payment_address": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE",
    "signer_address": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE"
  }
}

Response fields

FieldDescription
payment_addressAddress receiving fee payments
signer_addressAddress signing transactions as fee payer

getBlockhash

Gets the latest blockhash from the Solana network.

Request

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

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "blockhash": "base58Blockhash"
  }
}

Response fields

FieldDescription
blockhashBase58-encoded blockhash for transaction composition
Copyright © 2023-present Alamas Labs, Inc