SwapInfo class

Represents the details of an on-going swap.

Once this SwapInfo is created it will be monitored on-chain and its state is saved to the persistent storage.

The SwapInfo has a status which changes accordingly, documented in SwapStatus.

Constructors

SwapInfo({required String bitcoinAddress, required int createdAt, required int lockHeight, required Uint8List paymentHash, required Uint8List preimage, required Uint8List privateKey, required Uint8List publicKey, required Uint8List swapperPublicKey, required Uint8List script, String? bolt11, required int paidMsat, required int totalIncomingTxs, required int confirmedSats, required int unconfirmedSats, required SwapStatus status, required List<String> refundTxIds, required List<String> unconfirmedTxIds, required List<String> confirmedTxIds, required int minAllowedDeposit, required int maxAllowedDeposit, required int maxSwapperPayable, String? lastRedeemError, OpeningFeeParams? channelOpeningFees, int? confirmedAt})
const

Properties

bitcoinAddress String
Bitcoin address for this swap. Sats sent to this address will be swapped.
final
bolt11 String?
bolt11 invoice to claim the sent funds.
final
channelOpeningFees OpeningFeeParams?
The dynamic fees which is set if a channel opening is needed.
final
confirmedAt int?
The block height when the swap was confirmed.
final
confirmedSats int
Confirmed onchain sats to be claim with an bolt11 invoice or refunded if swap fails.
final
confirmedTxIds List<String>
Transaction IDs that have been confirmed on-chain.
final
createdAt int
Relative time lock start, received from SwapperAPI::create_swap.
final
hashCode int
The hash code for this object.
no setterinherited
lastRedeemError String?
Error reason for when swap fails.
final
lockHeight int
Relative time lock for the timeout for the script to be redeemed before swap fails.
final
maxAllowedDeposit int
The maximum amount of sats one can send in order for the swap to succeed. This is determined based on max_swapper_payable and the node's local balance.
final
maxSwapperPayable int
The absolute maximum value payable by the swapper. Received from SwapperAPI::create_swap.
final
minAllowedDeposit int
The minimum amount of sats one can send in order for the swap to succeed. Received from SwapperAPI::create_swap.
final
paidMsat int
Amount of millisatoshis claimed from sent funds and paid for via bolt11 invoice.
final
paymentHash Uint8List
sha256 hash of preimage to used in the claim sript.
final
preimage Uint8List
Secret to claim the swap.
final
privateKey Uint8List
Secret claim key for the bitcoin address.
final
publicKey Uint8List
Public key in binary format of the private claim private key.
final
refundTxIds List<String>
Transaction IDs for failed swap attempts.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
script Uint8List
The locking script for the generated bitcoin address. Received from SwapperAPI::create_swap.
final
status SwapStatus
Shows the current status of the swap, either Initial or Expired.
final
swapperPublicKey Uint8List
The public key in binary format from the swapping service. Received from SwapperAPI::create_swap.
final
totalIncomingTxs int
Total count of transactions sent to the swap address.
final
unconfirmedSats int
Unconfirmed sats waiting to be confirmed onchain.
final
unconfirmedTxIds List<String>
Refund transaction IDs for ongoing swap awaiting confirmation.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited