GetStakeTransaction
Send stake transaction
Parameter​
- fromAddr: Initiator's address
- stakeAmount: stake amount
- PledgeType: Stake type
- pumpingPercentage: Node extraction ratio
- isFindUtxo: Is the current status of UTXO being explored across the entire network
- txInfo: Transaction description information
{
"id" : "1",
"jsonrpc": "2.0",
"params" :
"{
"fromAddr" : "69b34b7538DeB6913f2b9f59Cbc8610059442e5A",
"stakeAmount" : "1000",
"PledgeType" : "0",
"CommissionRate": "5",
"isFindUtxo": true,
"txInfo": ""
}"
}
Response​
- code: Return code
- 0: success
- -1: input pumping percentage error
- -2: Failed to get the current highest block height
- -3: Check parameters failed
- -4: From address invlaid
- -5: Stake amount is zero
- -6: The pledge amount must be greater than Minimum pledge value
- -7: Unknown stake type
- -8: There has been a pledge transaction before !
- -9: The information entered exceeds the specified length
- -10: FindUtxo failed
- -11: Utxo is empty
- -12: Tx owner is invalid
- -13: The commission ratio is not in the range
- -14: The gas charge cannot be 0
- -15: The total amount is less than gas
- -16: Failed to get the packager
- message: Return value information
- txJson: Transaction entity information
- height: height
- vrfJson: VRF information
- txType: transaction type
- time: Time of sending transaction
- gas: Fuel
Return to Example​
{
"id": "1",
"jsonrpc": "2.0",
"method": "GetStakeTransaction",
"result": {
"code": 0,
"gas": "28100",
"height": "593",
"message": "success",
"time": "1717146934713506",
"txJson": "{\"time\":\"1717146934713506\",\"identity\":\"8F66e288547032026dd1ddFb992ff7eEcD9261f0\",\"utxo\":{\"owner\":[\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"],\"vin\":[{\"prevOut\":[{\"hash\":\"1a9446933109a33766fde80ced93142b261f81e315bc8afd9abd5306239842c1\"}]}],\"vout\":[{\"value\":\"100000000000\",\"addr\":\"VirtualStake\"},{\"value\":\"1899899508900\",\"addr\":\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"},{\"value\":\"28100\",\"addr\":\"VirtualBurnGas\"}]},\"type\":\"Tx\",\"consensus\":7,\"txType\":2,\"data\":\"{\\\"TxInfo\\\":{\\\"CommissionRate\\\":0.05,\\\"StakeAmount\\\":100000000000,\\\"StakeType\\\":\\\"Net\\\"}}\"}",
"txType": "0",
"vrfJson": "{}"
}
}
The call to the GetTakeTransaction
interface is completed, and the SDK is used to sign the returned transaction body.
After signing, the transaction body is broadcasted through sendMessage
. The process is the same as GetTransaction
.