transferTransaction

Creates a token transfer transaction with Kora as the fee payer.

JSON-RPC Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "transferTransaction",
  "params": {
    "amount": 1000000,
    "token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "source": "sourcePublicKey",
    "destination": "destinationPublicKey"
  }
}

JSON-RPC Response

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

cURL Example

curl -X POST http://localhost:8080 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"transferTransaction","params":{"amount":1000000,"token":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","source":"sourcePublicKey","destination":"destinationPublicKey"}}'

TypeScript SDK

const transfer = await client.transferTransaction({
  amount: 1000000, // 1 USDC (6 decimals)
  token: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
  source: 'sourceWalletPublicKey',
  destination: 'destinationWalletPublicKey'
});
console.log('Transaction:', transfer.transaction);
console.log('Message:', transfer.message);
console.log('Instructions:', transfer.instructions);