HeliosLang / compiler

Helios is a DSL for writing Cardano smart contracts. This library lets you compile Helios scripts and build Cardano transactions.
https://www.hyperion-bt.org/helios-book
BSD 3-Clause "New" or "Revised" License
139 stars 30 forks source link

feat: Add support for maximum assets per change output #103

Closed gavinharris-dev closed 11 months ago

gavinharris-dev commented 11 months ago

This commit adds a new configuration option MAX_ASSETS_PER_CHANGE_OUTPUT to the config.js file. If the value is set, it limits the maximum number of assets per change output. The Tx class in tx-builder.js now checks this configuration and splits the change output into multiple outputs if the number of assets exceeds the limit.

gavinharris-dev commented 11 months ago

This may help with #102 - probably will not 'solve' the issue however it will help when the users 'unfrack' their Wallets

christianschmitz commented 11 months ago

Thanks for this contribution Gavin!

At first I thought it would be better to keep this out of the library and leave it up to the user to implement such functionality during tx building.

But this addition is clean and only a few lines of code, and at some point in the future we can set MAX_ASSETS_PER_CHANGE_OUTPUT to a sane default so a typical Helios dev never has to think about this.