The coins are not 'burned' - you are creating a tx without a change output so you are overpaying the fee.
There are two places where you can set changeTo:
When when instantiate the Forge, eg: new Forge(opts)
In this case changeTo is an optional option - we can't throw an error if it is undefined as its perfectly valid to leave it undefined - for example if you are setting a custom changeScript or you don't want a change output at all.
By calling the changeTo function on the forge instance, eg: forge.changeTo(address)
In this case you will get an error if you pass the address as undefined.
The coins are not 'burned' - you are creating a tx without a change output so you are overpaying the fee.
There are two places where you can set
changeTo
:When when instantiate the Forge, eg:
new Forge(opts)
In this casechangeTo
is an optional option - we can't throw an error if it is undefined as its perfectly valid to leave it undefined - for example if you are setting a customchangeScript
or you don't want a change output at all.By calling the changeTo function on the forge instance, eg: forge.changeTo(address) In this case you will get an error if you pass the address as undefined.