Reputation: 39
I need to submit transactions from a server program to Solana blockchain for processing.
My programs is not JavaScript, therefore, I cannot use web3js.
I use the JSON RPC API sendTransaction: https://docs.solana.com/developing/clients/jsonrpc-api#sendtransaction
I need to form the transaction in the program.
Where is the documentation for transaction specification for various types, eg. transfer, approve, revoke, etc?
Eg. How do I form a "transfer" transaction? What's the spec for that? What parameters are required and their names and types?
Best regards, Configentia
Upvotes: 1
Views: 726
Reputation: 667
You have to create a signed transaction locally first using the transfer instruction then encode it as a string and send it in sendTransaction
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "sendTransaction",
"params": [
"4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWWPSAZBZSHptvWRL3BjCvzUXRdKvHL2b7yGrRQcWyaqsaBCncVG7BFggS8w9snUts67BSh3EqKpXLUm5UMHfD7ZBe9GhARjbNQMLJ1QD3Spr6oMTBU6EhdB4RD8CP2xUxr2u3d6fos36PD98XS6oX8TQjLpsMwncs5DAMiD4nNnR8NBfyghGCWvCVifVwvA8B8TJxE1aiyiv2L429BCWfyzAme5sZW8rDb14NeCQHhZbtNqfXhcp2tAnaAT"
]
}
I'm not sure how you can create a signed transaction locally without a solana package, maybe you can but it would be a lot harder, solana has sdks for python, js/ts, golang, java, rust, c++
Upvotes: 1