Interface IGeneratorSettingsObject

Configuration for the transaction Generator. This interface allows you to specify UTXO sources, transaction outputs, change address, priority fee, and other transaction parameters.

If the total number of UTXOs needed to satisfy the transaction outputs exceeds maximum allowed number of UTXOs per transaction (limited by the maximum transaction mass), the Generator will produce multiple chained transactions to the change address and then used these transactions as a source for the "final" transaction.

interface IGeneratorSettingsObject {
    changeAddress: string | Address;
    entries: IUtxoEntry[] | UtxoContext | UtxoEntryReference[];
    minimumSignatures?: number;
    networkId?: string | NetworkId;
    outputs: IPaymentOutput[] | PaymentOutput;
    payload?: string | Uint8Array;
    priorityFee?: bigint | IFees;
    sigOpCount?: number;
}

Properties

changeAddress: string | Address

Address to be used for change, if any.

UTXO entries to be used for the transaction. This can be an array of UtxoEntry instances, objects matching IUtxoEntry interface, or a UtxoContext instance.

minimumSignatures?: number

Optional minimum number of signatures required for the transaction.

networkId?: string | NetworkId

Optional NetworkId or network id as string (i.e. mainnet or testnet-11). Required when IGeneratorSettingsObject.entries is array

Final transaction outputs (do not supply change transaction).

Typical usage: { address: "spectre:...", amount: 1000n }

payload?: string | Uint8Array

Optional data payload to be included in the transaction.

priorityFee?: bigint | IFees

Priority fee in SOMPI.

If supplying bigint value, it will be interpreted as a sender-pays fee. Alternatively you can supply an object with amount and source properties where source contains the FeeSource enum.

*IMPORTANT: When sending an outbound transaction (transaction that contains outputs), the priorityFee must be set, even if it is zero. However, if the transaction is missing outputs (and thus you are creating a compound transaction against your change address), priorityFee should not be set (i.e. it should be undefined).

sigOpCount?: number

Optional number of signature operations in the transaction.