GetInvestTransaction
Sending investment transaction information
Parameter​
- fromAddr: Initiator's address
- toAddr: Invested address
- investAmount: investment amount
- investType: Investment type
- 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","toAddr":"69b34b7538DeB6913f2b9f59Cbc8610059442e5A","investAmount":"1000", "investType" : "0","pumpingPercentage": "5", "isFindUtxo": false, "txInfo": ""}"
}
Response​
- code
- 0: success
- -1: Failed to get the current highest block height
- -2: Check parameters failed
- -3: The initiator address is incorrect
- -4: The receiver address is incorrect
- -5: investment amount less
35 - -6: Unknown invest type
- -7: The information entered exceeds the specified length
- -8: FindUtxo failed
- -9: Utxo is empty
- -10: Tx owner is empty
- -11: gas cannot be 0
- -12: The total amount is less than expend
- -13: GetBlockPackager error
- -101: The investor have already invested in a node
- -102: The investment amount is less than
35 - -103: The account to be invested has not spent 500 to access the Internet
- -104: Get invest addrs by node failed
- -105: The account number to be invested have been invested by 999 people
- -106: GetBonusAddrInvestUtxosByBonusAddr failed
- -107: GetTransactionByHash failed
- -108: Failed to parse transaction body
- -109: The total amount invested in a single node will be more than
65000
- 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": "GetInvestTransaction",
"result": {
"code": 0,
"gas": "32000",
"height": "590",
"message": "success",
"time": "1717146585760939",
"txJson": "{\"time\":\"1717146585760939\",\"identity\":\"8fFb06c288C30F3e62b31d6c5FD34328A964774a\",\"utxo\":{\"owner\":[\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"],\"vin\":[{\"prevOut\":[{\"hash\":\"ed71842812bd3d5e0032d40f5a01ff8db1b0018a0a36c11292ed97e3783b2a78\"}]}],\"vout\":[{\"value\":\"1000000000000\",\"addr\":\"VirtualInvest\"},{\"value\":\"899899621300\",\"addr\":\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"},{\"value\":\"32000\",\"addr\":\"VirtualBurnGas\"}]},\"type\":\"Tx\",\"consensus\":7,\"txType\":4,\"data\":\"{\\\"TxInfo\\\":{\\\"BonusAddr\\\":\\\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\\\",\\\"InvestAmount\\\":1000000000000,\\\"InvestType\\\":\\\"Normal\\\"}}\"}",
"txType": "0",
"vrfJson": "{}"
}
}
The call to the GetInvestTransaction 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.