JSON-RPC 请求
{"jsonrpc": "2.0","id": 1,"method": "transferTransaction","params": {"amount": 1000000,"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","source": "sourcePublicKey","destination": "destinationPublicKey"}}
JSON-RPC 响应
{"jsonrpc": "2.0","id": 1,"result": {"blockhash": "base58Blockhash","instructions": "exampleValue","message": "exampleValue","signer_pubkey": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE","transaction": "base64EncodedTransaction"}}
cURL 示例
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);
Is this page helpful?