FromBTCLNAutoSwap<T>
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:143
New escrow based (HTLC) swaps for Bitcoin Lightning -> Smart chain swaps not requiring manual settlement on the destination by the user, and instead letting the LP initiate the escrow. Permissionless watchtower network handles the claiming of HTLC, with the swap secret broadcasted over Nostr. Also adds a possibility for the user to receive a native token on the destination chain as part of the swap (a "gas drop" feature).
Extends
IEscrowSwap<T,FromBTCLNAutoDefinition<T>>
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends ChainType | ChainType |
Implements
IAddressSwapISwapWithGasDrop<T>IClaimableSwap<T,FromBTCLNAutoDefinition<T>,FromBTCLNAutoSwapState>
Constructors
Constructor
new FromBTCLNAutoSwap<T>(wrapper, init): FromBTCLNAutoSwap<T>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:210
Parameters
| Parameter | Type |
|---|---|
wrapper | FromBTCLNAutoWrapper<T> |
init | FromBTCLNAutoSwapInit<T["Data"]> |
Returns
FromBTCLNAutoSwap<T>
Overrides
Constructor
new FromBTCLNAutoSwap<T>(wrapper, obj): FromBTCLNAutoSwap<T>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:211
Parameters
| Parameter | Type |
|---|---|
wrapper | FromBTCLNAutoWrapper<T> |
obj | any |
Returns
FromBTCLNAutoSwap<T>
Overrides
Properties
chainIdentifier
readonly chainIdentifier: T["ChainId"];
Defined in: atomiq-sdk/src/swaps/ISwap.ts:148
Smart chain identifier string corresponding to this swap
Implementation of
IClaimableSwap.chainIdentifier
Inherited from
createdAt
createdAt: number;
Defined in: atomiq-sdk/src/swaps/ISwap.ts:156
A UNIX milliseconds timestamps of when this swap was created
Implementation of
Inherited from
events
readonly events: EventEmitter<{
swapState: [FromBTCLNAutoSwap<T>];
}>;
Defined in: atomiq-sdk/src/swaps/ISwap.ts:140
Event emitter emitting "swapState" event when swap's state changes
Implementation of
Inherited from
exactIn
readonly exactIn: boolean;
Defined in: atomiq-sdk/src/swaps/ISwap.ts:152
Whether a swap is an exact input swap
Implementation of
Inherited from
url?
readonly optional url: string;
Defined in: atomiq-sdk/src/swaps/ISwap.ts:144
URL of the intermediary (LP) used for this swap, already has the swap service specific path appended
Implementation of
Inherited from
TYPE
protected readonly TYPE: FROM_BTCLN_AUTO = SwapType.FROM_BTCLN_AUTO;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:147
Swap type
Implementation of
Overrides
Methods
_verifyQuoteDefinitelyExpired()
_verifyQuoteDefinitelyExpired(): Promise<boolean>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:500
Returns
Promise<boolean>
Inherit Doc
Implementation of
IClaimableSwap._verifyQuoteDefinitelyExpired
Overrides
IEscrowSwap._verifyQuoteDefinitelyExpired
_verifyQuoteValid()
_verifyQuoteValid(): Promise<boolean>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:507
Returns
Promise<boolean>
Inherit Doc
Implementation of
IClaimableSwap._verifyQuoteValid
Overrides
IEscrowSwap._verifyQuoteValid
claim()
claim(
_signer,
abortSignal?,
onBeforeTxSent?,
secret?): Promise<string>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:1174
Settles the swap by claiming the funds on the destination chain if the swap requires manual settlement, you can check so with isClaimable
Parameters
| Parameter | Type | Description |
|---|---|---|
_signer | T["Signer"] | T["NativeSigner"] | Signer to sign the transactions with, can also be different to the initializer |
abortSignal? | AbortSignal | Abort signal to stop waiting for transaction confirmation |
onBeforeTxSent? | (txId) => void | |
secret? | string | A swap secret to use for the claim transaction, generally only needed if the swap was recovered from on-chain data, or the pre-image was generated outside the SDK |
Returns
Promise<string>
Implementation of
execute()
execute(
walletOrLnurlWithdraw?,
callbacks?,
options?): Promise<boolean>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:771
Executes the swap with the provided bitcoin lightning network wallet or LNURL
Parameters
| Parameter | Type | Description |
|---|---|---|
walletOrLnurlWithdraw? | | string | LNURLWithdraw | MinimalLightningNetworkWalletInterface | Bitcoin lightning wallet to use to pay the lightning network invoice, or an LNURL-withdraw link, wallet is not required and the LN invoice can be paid externally as well (just pass null or undefined here) |
callbacks? | { onSourceTransactionReceived?: (sourceTxId) => void; onSwapSettled?: (destinationTxId) => void; } | Callbacks to track the progress of the swap |
callbacks.onSourceTransactionReceived? | (sourceTxId) => void | - |
callbacks.onSwapSettled? | (destinationTxId) => void | - |
options? | { abortSignal?: AbortSignal; lightningTxCheckIntervalSeconds?: number; maxWaitTillAutomaticSettlementSeconds?: number; secret?: string; } | Optional options for the swap like AbortSignal, and timeouts/intervals |
options.abortSignal? | AbortSignal | - |
options.lightningTxCheckIntervalSeconds? | number | - |
options.maxWaitTillAutomaticSettlementSeconds? | number | - |
options.secret? | string | A swap secret to broadcast to watchtowers, generally only needed if the swap was recovered from on-chain data, or the pre-image was generated outside the SDK |
Returns
Promise<boolean>
Whether a swap was settled automatically by swap watchtowers or requires manual claim by the
user, in case false is returned the user should call swap.claim() to settle the swap on the destination manually
Implementation of
Overrides
getAddress()
getAddress(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:413
Returns the lightning network BOLT11 invoice that needs to be paid as an input to the swap
Returns
string
Implementation of
getClaimHash()
getClaimHash(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSwap.ts:123
Returns the claim data hash specifying the claim path of the escrow - i.e. hash passed to the claim handler
Returns
string
Inherited from
getCurrentActions()
getCurrentActions(options?): Promise<SwapExecutionAction<T>[]>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:860
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | { manualSettlementSmartChainSigner?: string | T["Signer"] | T["NativeSigner"]; maxWaitTillAutomaticSettlementSeconds?: number; secret?: string; } | - |
options.manualSettlementSmartChainSigner? | string | T["Signer"] | T["NativeSigner"] | Optional smart chain signer to create a manual claim (settlement) transaction |
options.maxWaitTillAutomaticSettlementSeconds? | number | Maximum time to wait for an automatic settlement after the bitcoin transaction is confirmed (defaults to 60 seconds) |
options.secret? | string | A swap secret to broadcast to watchtowers, generally only needed if the swap was recovered from on-chain data, or the pre-image was generated outside the SDK |
Returns
Promise<SwapExecutionAction<T>[]>
Implementation of
IClaimableSwap.getCurrentActions
Overrides
getDefinitiveExpiryTime()
getDefinitiveExpiryTime(): number;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:428
Returns the timeout time (in UNIX milliseconds) when the swap will definitelly be considered as expired if the LP doesn't make it expired sooner
Returns
number
getDirection()
getDirection(): SwapDirection;
Defined in: atomiq-sdk/src/swaps/ISwap.ts:506
Returns the direction of the swap
Returns
Implementation of
Inherited from
getEscrowClaimTxId()
getEscrowClaimTxId(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSwap.ts:144
Returns the smart chain transaction ID of the tx that claimed (settled) the escrow
Returns
string
Inherited from
IEscrowSwap.getEscrowClaimTxId
getEscrowHash()
getEscrowHash(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSwap.ts:116
Returns the escrow hash - i.e. hash of the escrow data
Returns
string
Inherited from
getEscrowInitTxId()
getEscrowInitTxId(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSwap.ts:137
Returns the smart chain transaction ID of the tx that initiated the escrow
Returns
string
Inherited from
getEscrowRefundTxId()
getEscrowRefundTxId(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSwap.ts:151
Returns the smart chain transaction ID of the tx that refunded the escrow
Returns
string
Inherited from
IEscrowSwap.getEscrowRefundTxId
getFee()
getFee(): Fee<T["ChainId"], BtcToken<true>, SCToken<T["ChainId"]>>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:690
Returns total fee for the swap, the fee is represented in source currency & destination currency, but is paid only once
Returns
Fee<T["ChainId"], BtcToken<true>, SCToken<T["ChainId"]>>
Implementation of
Overrides
getFeeBreakdown()
getFeeBreakdown(): [{
fee: Fee<T["ChainId"], BtcToken<true>, SCToken<T["ChainId"]>>;
type: SWAP;
}, {
fee: Fee<T["ChainId"], BtcToken<true>, SCToken<T["ChainId"]>>;
type: NETWORK_OUTPUT;
}];
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:713
Returns the breakdown of all the fees paid
Returns
[{
fee: Fee<T["ChainId"], BtcToken<true>, SCToken<T["ChainId"]>>;
type: SWAP;
}, {
fee: Fee<T["ChainId"], BtcToken<true>, SCToken<T["ChainId"]>>;
type: NETWORK_OUTPUT;
}]
Implementation of
IClaimableSwap.getFeeBreakdown
Overrides
getGasDropOutput()
getGasDropOutput(): TokenAmount<T["ChainId"], SCToken<T["ChainId"]>, true>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:620
Returns the output of the "gas drop", additional native token received by the user on the destination chain
Returns
TokenAmount<T["ChainId"], SCToken<T["ChainId"]>, true>
Implementation of
ISwapWithGasDrop.getGasDropOutput
getHtlcTimeoutTime()
getHtlcTimeoutTime(): number;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:441
Returns timeout time (in UNIX milliseconds) when the swap htlc will expire
Returns
number
getHyperlink()
getHyperlink(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:420
A hyperlink representation of the address + amount that the user needs to sends on the source chain. This is suitable to be displayed in a form of QR code.
Returns
string
Implementation of
getId()
getId(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:341
Returns the ID of the swap, as used in the storage
Returns
string
Implementation of
Overrides
getInput()
getInput(): TokenAmount<T["ChainId"], BtcToken<true>>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:592
Returns input amount of the swap, user needs to pay this much
Returns
TokenAmount<T["ChainId"], BtcToken<true>>
Implementation of
Overrides
getInputAddress()
getInputAddress(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:397
Returns source address of the swap
Returns
string
Implementation of
IClaimableSwap.getInputAddress
Overrides
getInputToken()
getInputToken(): BtcToken<true>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:585
Returns the input token of the swap
Returns
BtcToken<true>
Implementation of
Overrides
getInputTxId()
getInputTxId(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:404
Returns swap input transaction ID on the source chain
Returns
string
Implementation of
Overrides
getInputWithoutFee()
getInputWithoutFee(): TokenAmount<T["ChainId"], BtcToken<true>>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:599
Returns input amount of the swap without the fees (swap fee, network fee)
Returns
TokenAmount<T["ChainId"], BtcToken<true>>
Implementation of
IClaimableSwap.getInputWithoutFee
Overrides
IEscrowSwap.getInputWithoutFee
getLNURL()
getLNURL(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:1283
Gets the used LNURL or null if this is not an LNURL-withdraw swap
Returns
string
getOutput()
getOutput(): TokenAmount<T["ChainId"], SCToken<T["ChainId"]>, true>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:613
Returns output amount of the swap, user receives this much
Returns
TokenAmount<T["ChainId"], SCToken<T["ChainId"]>, true>
Implementation of
Overrides
getOutputAddress()
getOutputAddress(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:348
Returns destination address of the swap
Returns
string
Implementation of
IClaimableSwap.getOutputAddress
Overrides
getOutputToken()
getOutputToken(): SCToken<T["ChainId"]>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:606
Returns the output token of the swap
Returns
SCToken<T["ChainId"]>
Implementation of
Overrides
getOutputTxId()
getOutputTxId(): string;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:355
Returns swap output transaction ID on the destination chain
Returns
string
Implementation of
Overrides
getPriceInfo()
getPriceInfo(): object;
Defined in: atomiq-sdk/src/swaps/ISwap.ts:346
Returns pricing info about the swap
Returns
object
| Name | Type | Defined in |
|---|---|---|
difference | PercentagePPM | atomiq-sdk/src/swaps/ISwap.ts:349 |
marketPrice? | number | atomiq-sdk/src/swaps/ISwap.ts:347 |
swapPrice | number | atomiq-sdk/src/swaps/ISwap.ts:348 |
Implementation of
Inherited from
getQuoteExpiry()
getQuoteExpiry(): number;
Defined in: atomiq-sdk/src/swaps/ISwap.ts:492
Returns quote expiry in UNIX millis
Returns
number
Implementation of
Inherited from
getState()
getState(): number;
Defined in: atomiq-sdk/src/swaps/ISwap.ts:513
Returns the current state of the swap
Returns
number
Implementation of
Inherited from
getStateInfo()
getStateInfo(): SwapStateInfo<number>;
Defined in: atomiq-sdk/src/swaps/ISwap.ts:520
Returns the current state of the swap along with the human-readable description of the state
Returns
SwapStateInfo<number>
Implementation of
Inherited from
getType()
getType(): SwapType;
Defined in: atomiq-sdk/src/swaps/ISwap.ts:499
Returns the type of the swap
Returns
Implementation of
Inherited from
hasSecretPreimage()
hasSecretPreimage(): boolean;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:750
Returns whether the secret preimage for this swap is known
Returns
boolean
hasValidPrice()
hasValidPrice(): boolean;
Defined in: atomiq-sdk/src/swaps/ISwap.ts:338
Checks if the pricing for the swap is valid, according to max allowed price difference set in the ISwapPrice
Returns
boolean
Implementation of
Inherited from
isClaimable()
isClaimable(): boolean;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:455
Checks whether a swap currently requires a manual claiming (settlement)
Returns
boolean
Implementation of
isFailed()
isFailed(): boolean;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:469
Returns whether the swap failed (e.g. was refunded)
Returns
boolean
Implementation of
Overrides
isFinished()
isFinished(): boolean;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:448
Returns whether the swap is finished and in its terminal state (this can mean successful, refunded or failed)
Returns
boolean
Implementation of
Overrides
isInitiated()
isInitiated(): boolean;
Defined in: atomiq-sdk/src/swaps/ISwap.ts:485
Whether a swap was initialized, a swap is considered initialized on first interaction with it, i.e. calling commit() on a Smart chain -> Bitcoin swaps, calling waitForPayment() or similar on the other direction. Not initiated swaps are not saved to the persistent storage by default (see SwapperOptions.saveUninitializedSwaps)
Returns
boolean
Implementation of
Inherited from
isInProgress()
isInProgress(): boolean;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:476
Returns whether the swap is currently being processed
Returns
boolean
Implementation of
Overrides
isLNURL()
isLNURL(): boolean;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:1276
Whether this swap uses an LNURL-withdraw link
Returns
boolean
isQuoteExpired()
isQuoteExpired(): boolean;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:486
Checks whether the swap's quote has definitely expired and cannot be committed anymore, we can remove such swap
Returns
boolean
Implementation of
Overrides
isQuoteSoftExpired()
isQuoteSoftExpired(): boolean;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:493
Checks whether the swap's quote is soft expired (this means there is not enough time buffer for it to commit, but it still can happen)
Returns
boolean
Implementation of
IClaimableSwap.isQuoteSoftExpired
Overrides
IEscrowSwap.isQuoteSoftExpired
isSuccessful()
isSuccessful(): boolean;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:462
Returns whether the swap finished successful
Returns
boolean
Implementation of
Overrides
refreshPriceData()
refreshPriceData(): Promise<void>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:303
Re-fetches & revalidates the price data based on the current market prices
Returns
Promise<void>
Implementation of
IClaimableSwap.refreshPriceData
Overrides
requiresAction()
requiresAction(): boolean;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:362
Checks whether there is some action required from the user for this swap - can mean either refundable or claimable
Returns
boolean
Implementation of
Overrides
serialize()
serialize(): any;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:1330
Serializes the swap to a JSON stringifiable representation (i.e. no bigints, buffers etc.)
Returns
any
Implementation of
Overrides
setSecretPreimage()
setSecretPreimage(secret): void;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:742
Sets the secret preimage for the swap, in case it is not known already
Parameters
| Parameter | Type | Description |
|---|---|---|
secret | string | Secret preimage that matches the expected payment hash |
Returns
void
Throws
If an invalid secret preimage is provided
settleWithLNURLWithdraw()
settleWithLNURLWithdraw(lnurl): Promise<void>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:1295
Pay the generated lightning network invoice with an LNURL-withdraw link, this is useful when you want to display a lightning payment QR code and also want to allow payments using LNURL-withdraw NFC cards.
Note that the swap needs to be created without an LNURL to begin with for this function to work. If this swap is already using an LNURL-withdraw link, this function throws.
Parameters
| Parameter | Type |
|---|---|
lnurl | string | LNURLWithdraw |
Returns
Promise<void>
txsClaim()
txsClaim(_signer?, secret?): Promise<T["TX"][]>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:1147
Returns transactions for settling (claiming) the swap if the swap requires manual settlement, you can check so with isClaimable. After sending the transaction manually be sure to call the waitTillClaimed function to wait till the claim transaction is observed, processed by the SDK and state of the swap properly updated.
Parameters
| Parameter | Type | Description |
|---|---|---|
_signer? | T["Signer"] | T["NativeSigner"] | Optional signer address to use for claiming the swap, can also be different from the initializer |
secret? | string | A swap secret to use for the claim transaction, generally only needed if the swap was recovered from on-chain data, or the pre-image was generated outside the SDK |
Returns
Promise<T["TX"][]>
Implementation of
txsExecute()
txsExecute(): Promise<object[]>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:830
Returns a list of steps or transactions required to finish and settle the swap
Returns
Promise<object[]>
Implementation of
Overrides
waitForPayment()
waitForPayment(
onPaymentReceived?,
checkIntervalSeconds?,
abortSignal?): Promise<boolean>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:994
Waits till a lightning network payment is received by the intermediary, and the intermediary initiates the swap HTLC on the smart chain side. After the HTLC is initiated you can wait for an automatic settlement by the watchtowers with the waitTillClaimed function, or settle manually using the claim or txsClaim functions.
If this swap is using an LNURL-withdraw link as input, it automatically posts the generated invoice to the LNURL service to pay it.
Parameters
| Parameter | Type | Description |
|---|---|---|
onPaymentReceived? | (txId) => void | Callback as for when the LP reports having received the ln payment |
checkIntervalSeconds? | number | How often to poll the intermediary for answer (default 5 seconds) |
abortSignal? | AbortSignal | Abort signal to stop waiting for payment |
Returns
Promise<boolean>
waitTillClaimed()
waitTillClaimed(
maxWaitTimeSeconds?,
abortSignal?,
secret?): Promise<boolean>;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:1206
Waits till the swap is successfully settled (claimed), should be called after sending the claim (settlement) transactions manually to wait till the SDK processes the settlement and updates the swap state accordingly.
Parameters
| Parameter | Type | Description |
|---|---|---|
maxWaitTimeSeconds? | number | Maximum time in seconds to wait for the swap to be settled |
abortSignal? | AbortSignal | AbortSignal |
secret? | string | A swap secret to broadcast to watchtowers, generally only needed if the swap was recovered from on-chain data, or the pre-image was generated outside the SDK |
Returns
Promise<boolean>
whether the swap was claimed in time or not
Throws
If swap is in invalid state (must be FromBTCLNAutoSwapState.CLAIM_COMMITED)
Throws
If the LP refunded sooner than we were able to claim
Implementation of
IClaimableSwap.waitTillClaimed
getWatchtowerFeeAmountBtc()
protected getWatchtowerFeeAmountBtc(): bigint;
Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts:536
Returns the watchtower fee paid in BTC satoshis, or null if known (i.e. if the swap was recovered from on-chain data)
Returns
bigint