Commit 3d76a8f
committed
TxBuilder: max output size + multiple change address support
Users with many NFTs could run into problems creating certain txs that
returned many of them as a change output as it would surpass the maximum
output size limit in the ledger. The TxBuilder now takes this limit into
account and errors if it is passed, and during the change output
creation will attempt to spread out the NFTs over multiple outputs to
not surpass the ledger limit.
This is done as a greedy selection for now as the limit is currently 4kb
or so and each asset is at most 64 bytes each so this should suffice.1 parent 0825673 commit 3d76a8f
3 files changed
+303
-65
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
| 388 | + | |
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| |||
2461 | 2461 | | |
2462 | 2462 | | |
2463 | 2463 | | |
2464 | | - | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
2465 | 2467 | | |
2466 | 2468 | | |
2467 | 2469 | | |
| |||
2488 | 2490 | | |
2489 | 2491 | | |
2490 | 2492 | | |
2491 | | - | |
| 2493 | + | |
2492 | 2494 | | |
2493 | 2495 | | |
2494 | 2496 | | |
| |||
0 commit comments