Skip to content

add API support for send-to-many

Luke Champine requested to merge send-to-many into master

This allows users to post a set of amounts and addresses to /wallet/siacoins, the same endpoint currently used for single amount+address pairs. The rationale is to make it easy to split a large input among many outputs without requiring a separate transaction for each (which is slower and can cause fragmentation). To create a send-to-many transaction, post a list of comma-separated amounts/addrs in the amounts/destinations form values, instead of the typical amount/destination form values. The backing logic is implemented in a new SendSiacoinsMulti method of the wallet.

PR'ing this early to invite discussion. Should we create a new route for send-to-many, instead of overloading /wallet/siacoins? Should the api handler construct the transaction itself using a transaction builder? And how should this PR interact with #1849?

Merge request reports