Skip to main content

SendMessage

After calling interfaces such as GetTransaction, GetStakeTransaction, GetUnStakeTransaction, GetInvestTransaction, GetDisInvestTransaction, GetBouns, etc. use the signature SDK tool to sign the contents of the txJson field, overwrite the signed information with the original txJson field of the interface, and send the entire transaction return information to the node using the Send Message interface to complete the transaction.

  1. Retrieve the txJson field from the information returned by the interface.
  2. Sign txJson fields with SDK.
  3. Overwrite the signed txJson field onto the txJson field of the original interface return information.
  4. Broadcast the updated return information through SendMessage.

Parameter​

The data returned by interfaces such as GetTransaction is signed by calling SDK and the return value is used as a parameter

//Signed data
{
"id": "",
"jsonrpc": "",
"result": {
"code": "",
"gas": "20200",
"height": "600",
"message": "",
"time": "1717148047269517",
"txJson": "{\"time\":\"1717148047269517\",\"identity\":\"2eb2F635320c3Dbf29eadD35E894c13EE3F20bd5\",\"utxo\":{\"owner\":[\"cED97dA085527Fe7e1772CA59Aa1e64A78143128\"],\"vin\":[{\"prevOut\":[{\"hash\":\"3f1342e96e426e2905021ad991787131ec70d31298646b1e80da9d912eeff274\"}],\"vinSign\":{\"sign\":\"ApxL8NDgh9YYDuUXpdbsbVv0cEAr3HyXmr2TICkD4mfuDIZqVlZJNUmaPAKHCs5kkn7JnZx7r12+CpnnR4ZpAg==\",\"pub\":\"MCowBQYDK2VwAyEA89VSBQU7d4uL+jvqAKeCRbgYz2tzk/Rf8DNRhB0sLbg=\"}}],\"vout\":[{\"value\":\"1350000000\",\"addr\":\"06BA76F46631d4F344d1344303895001F1E3Af29\"},{\"value\":\"1982446992477\",\"addr\":\"cED97dA085527Fe7e1772CA59Aa1e64A78143128\"},{\"value\":\"20200\",\"addr\":\"VirtualBurnGas\"}],\"multiSign\":[{\"sign\":\"WCoFsLKML69x1rSpQc7pwbnd+GMfZ0Ce3wTPg96Rdb1v7ezFw9KuEBXwvGecTz264pVZB6T8hzgJIx26GuKVAA==\",\"pub\":\"MCowBQYDK2VwAyEA89VSBQU7d4uL+jvqAKeCRbgYz2tzk/Rf8DNRhB0sLbg=\"}]},\"type\":\"Tx\",\"consensus\":7,\"txType\":1}",
"txType": "1",
"vrfJson": "{\"vrfdata\":{\"hash\":\"6cf89d80c98eecd9138caca4f55d7ad0fda2aed9d8e68dd4642543ae3ee056d6\"},\"Vrfsign\":{\"sign\":\"u5dNZ16Rd77B4nLd8gAcKTwz+GxeHH1HIlcGennGbPaKgIFXUkmFzS/EnVxRC4nmSfESAdWyMEmj4pKBhwuqAg==\",\"pub\":\"MCowBQYDK2VwAyEAcUcydwF7CSr9bjBiUbd3drV+WMd4yd8xFL7HWGA4FTw=\"}}"
}
}

Response​

  • txHash: Transaction hash, used to check whether the transaction is on chain

Return to Example​

{
"id": "1",
"jsonrpc": "2.0",
"method": "SendMessage",
"result": {
"code": 0,
"message": "success",
"txHash": "0x01f46aaee0d0d87f1164d9dda4154544cc67627b70d512805fd85c0f92a45706"
}
}

Use the ConfirmTransaction interface to determine whether to go live on the chain.