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[] | UtxoEntryReference[] | UtxoContext;
    feeRate?: number;
    minimumSignatures?: number;
    networkId?: string | NetworkId;
    outputs: IPaymentOutput[] | PaymentOutput;
    payload?: string | Uint8Array;
    priorityEntries?: IUtxoEntry[] | UtxoEntryReference[];
    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.

feeRate?: number

Fee rate in SOMPI per 1 gram of mass.

Fee rate is applied to all transactions generated by the Generator. This includes batch and final transactions. If not set, the fee rate is not applied.

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: "kaspa:...", amount: 1000n }

payload?: string | Uint8Array

Optional data payload to be included in the transaction.

priorityEntries?: IUtxoEntry[] | UtxoEntryReference[]

Optional UTXO entries that will be consumed before those available in entries. You can use this property to apply custom input selection logic. Please note that these inputs are consumed first, then entries are consumed to generate a desirable transaction output amount. If transaction mass overflows, these inputs will be consumed into a batch/sweep transaction where the destination if the changeAddress.

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.

Generated using TypeDoc