Skip to content

sendFusionTransaction

AxVultis edited this page Nov 12, 2022 · 2 revisions

The sendFusionTransaction method allows you to send a fusion transaction, by taking funds from selected addresses and transferring them to the destination address. If there aren't any outputs that can be optimized, ** sendFusionTransaction** will return an error. You can use estimateFusion to check the outputs, available for the optimization.

The threshold is the value that determines which outputs will be optimized. Only the outputs, lesser than the threshold value, will be included into a fusion transaction. This value is in atomic units, so 1000 is 0.001000 CCX.

The addresses field is an array of strings, where each string is an address to take the funds from. If the container or addresses field contains only one address, destinationAddress can be left empty and the funds will return to that address.

Request Format

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 18,
  "method": "sendFusionTransaction",
  "params": {
    "anonymity": 0,
    "threshold": 1000,
    "addresses": [
      "ccx7Sh1w3q9jmrzw3XkKPRBa4ZB8mxp5rH4Rm4cWJgDYNNahMKoEuYxgTfHaWbAYRPdUhEXXEeKeEG7okKGHA8CZ3onHF7W6gc"
    ],
    "destinationAddress": "ccx7dehAGh837bfSfo18wJ1WzeCUWnzv3D23hvR8npyhHxoa6E3WXqNgTfHaWbAYRPdUhEXXEeKeEG7okKGHA8CZ3onHHofFDJ"
  }
}

Request Details:

Argument Mandatory Description Format
threshold Yes value that determines which outputs will be optimized. Only the outputs lesser than the threshold value will be included into a fusion transaction. int
anonymity Yes Privacy level (a discrete number from 1 to infinity). Level 5 is recommended, a lower value will be needed for very small inputs amount int
addresses No addresses to take the funds from array of strings
destinationAddress No address where all the funds will be returned array of strings

Response Format

JSON-RPC

 {
  "jsonrpc": "2.0",
  "id": 18,
  "result": {
    "transactionHash": "9b1859d9b3bf42d299f0898bb454539ca445a5c47f3ffa28853bad1151547d1c"
  }
}

Response Details:

Argument Description Format
transactionHash hash of the fusion transaction string
Clone this wiki locally