Is it possible to "send all" with SingleWalletAddress ? #425
-
Hi! Is it possible to construct a transaction without change output using SingleWalletAddress instance? I am trying to do a "Send All" feature (I am not sending any tokens, only ADA). So far I can build and send "normal" transactions, but when I try to use all available coins in The code I use looks like const available = await firstValueFrom(singleWalletInstance.balance.utxo.available$)
const address = 'any_address'
const tx = await singleWalletInstance.initializeTx({
outputs: new Set([{ address, value: { coins: available.coins } }]),
}) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, unfortunately this use case is currently unsupported. We're planning to add it in the future, but it's currently low priority. This feature is more complicated than it might look as
In your case (sending coin only, no assets) it is not as complicated. You could try to re-implement |
Beta Was this translation helpful? Give feedback.
Hi, unfortunately this use case is currently unsupported. We're planning to add it in the future, but it's currently low priority.
This feature is more complicated than it might look as
In your case (sending coin only, no assets) it is not as complicated. You could try to re-implement
initializeTx
by referencing SDK code and replacing the call to input selection with a simpler implementation that selects all utxo and balances the output(s) with fee in a a way that doesn't need any change.