zend_oo icon indicating copy to clipboard operation
zend_oo copied to clipboard

send_to_sidechain and sc_send RPC commands are redundant

Open cronicc opened this issue 3 years ago • 0 comments

Both commands accomplish the same thing using different APIs.

Investigate where both commands are used and if choosing one and removing the other is possible. If API features in one command are missing from the other, investigate if a unified command that incorporates all necessary API features makes more sense.

A decision on the API should be made before the first official release of zend_oo, after the first release changing the API would be problematic.

send_to_sidechain {...}

Arguments:
1. "outputs"                       (string, required) A json array of json objects representing the amounts to send.
[{
   "scid": id                      (string, required) The uint256 side chain ID
   "toaddress":scaddr              (string, required) The receiver PublicKey25519Proposition in the SC
   "amount":amount                 (numeric, required) Value expressed in ZEN
},...,]
2. "params"                        (string, optional) A json object with the command parameters
{
   "fromaddress":taddr             (string, optional) The taddr to send the funds from. If omitted funds are taken from all available UTXO
   "changeaddress":taddr           (string, optional) The taddr to send the change to, if any. If not set, "fromaddress" is used. If the latter is not set too, a new generated address will be used
   "minconf":conf                  (numeric, optional, default=1) Only use funds confirmed at least this many times.
   "fee":fee                       (numeric, optional, default=0.00001) The fee amount to attach to this transaction.
}

Result:
"transactionid"    (string) The resulting transaction id.

Examples:
> zen-cli send_to_sidechain '{TODO}]'
sc_send "address" amount "scid"

Send a ZEN amount to an address of the given SC

Arguments:
1. "address"        (string, required) The uint256 hex representation of the PublicKey25519Proposition in the SC to send to.
2. "amount"         (numeric, required) The amount in zen to send. eg 0.1
3. "side chain ID"  (string, required) The uint256 side chain ID

Result:
"transactionid"  (string) The transaction id.

Examples:
> zen-cli sc_send "1a3e7ccbfd40c4e2304c3215f76d204e4de63c578ad835510f580d529516a874" 0.1 "ea3e7ccbfd40c4e2304c4215f76d204e4de63c578ad835510f580d529516a874"

cronicc avatar Jul 26 '21 12:07 cronicc