getPaymentInstruction
Creates a payment instruction to append to a transaction for fee payment to the Kora paymaster.
Client-Side Only Method: This method is only available in the TypeScript SDK and does not make actual JSON-RPC calls to the server. It constructs payment instructions locally.
TypeScript SDK Usage
const paymentInfo = await client.getPaymentInstruction({
transaction: 'base64EncodedTransaction',
fee_token: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
source_wallet: 'sourceWalletPublicKey'
});
// Append paymentInfo.payment_instruction to your transactionResponse Structure
The method returns a payment instruction object with the following structure:
{
"original_transaction": "base64EncodedTransaction",
"payment_address": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE",
"payment_amount": 0,
"payment_instruction": {},
"payment_token": "exampleValue",
"signer_address": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE"
}