Fee Estimates

Get a fee cost of your transaction

As the name suggests, fee estimation functions offer a means of computing the expense of a STAS transaction before officially constructing it. This is accomplished using the minimum necessary arguments, which creates a transaction template that can then be used to determine the cost in satoshis based on the fee rate. The fee rate settings can be located in the utility.js file as follows:

this.SATS = 50 // Don't change this setting unless you know what you're doing
this.PERBYTE = 1000 // Don't change this setting unless you know what you're doing

Here is an example of using the fee estimate functions for the stasTransfer Function :

const feeEstimate = await stasTransfer.feeEstimate(stasUtxo)

The function will return a number in satoshi value that can then be used for pre processing conditions where UTXOs for fees are required to be prepared beforehand. All transaction functions in the library contain a feeEstimate function with varying required arguments.

Last updated