# ToBTCLNSwap\<T>

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:41](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L41)

Escrow based (HTLC) swap for Smart chains -> Bitcoin lightning

## Extends

* [`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md)<`T`, `ToBTCLNDefinition`<`T`>>

## Type Parameters

| Type Parameter                                                                                                       | Default type                                                                                           |
| -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `T` *extends* [`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md) | [`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md) |

## Constructors

### Constructor

```
new ToBTCLNSwap<T>(wrapper, init): ToBTCLNSwap<T>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:70](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L70)

#### Parameters

| Parameter | Type                                                                                                             |
| --------- | ---------------------------------------------------------------------------------------------------------------- |
| `wrapper` | [`ToBTCLNWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ToBTCLNWrapper.md)<`T`> |
| `init`    | `ToBTCLNSwapInit`<`T`\[`"Data"`]>                                                                                |

#### Returns

`ToBTCLNSwap`<`T`>

#### Overrides

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`constructor`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#constructor)

### Constructor

```
new ToBTCLNSwap<T>(wrapper, obj): ToBTCLNSwap<T>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:71](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L71)

#### Parameters

| Parameter | Type                                                                                                             |
| --------- | ---------------------------------------------------------------------------------------------------------------- |
| `wrapper` | [`ToBTCLNWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ToBTCLNWrapper.md)<`T`> |
| `obj`     | `any`                                                                                                            |

#### Returns

`ToBTCLNSwap`<`T`>

#### Overrides

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`constructor`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#constructor)

## Properties

### chainIdentifier

```
readonly chainIdentifier: T["ChainId"];
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:168](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L168)

Smart chain identifier string corresponding to this swap

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`chainIdentifier`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#chainidentifier)

***

### createdAt

```
createdAt: number;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:176](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L176)

A UNIX milliseconds timestamps of when this swap was created

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`createdAt`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#createdat)

***

### events

```
readonly events: EventEmitter<{

  swapState: [ToBTCLNSwap<T>];

}>;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:160](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L160)

Event emitter emitting `"swapState"` event when swap's state changes

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`events`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#events)

***

### exactIn

```
readonly exactIn: boolean;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:172](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L172)

Whether a swap is an exact input swap

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`exactIn`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#exactin)

***

### url?

```
readonly optional url: string;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:164](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L164)

URL of the intermediary (LP) used for this swap, already has the swap service specific path appended

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`url`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#url)

***

### TYPE

```
protected readonly TYPE: TO_BTCLN = SwapType.TO_BTCLN;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:42](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L42)

Swap type

#### Overrides

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`TYPE`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#type)

## Methods

### \_verifyQuoteDefinitelyExpired()

```
_verifyQuoteDefinitelyExpired(): Promise<boolean>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/IEscrowSelfInitSwap.ts:178](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/IEscrowSelfInitSwap.ts#L178)

Checks if the swap's quote is expired for good (i.e. the swap strictly cannot be committed on-chain anymore)

#### Returns

`Promise`<`boolean`>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`_verifyQuoteDefinitelyExpired`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#_verifyquotedefinitelyexpired)

***

### \_verifyQuoteValid()

```
_verifyQuoteValid(): Promise<boolean>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/IEscrowSelfInitSwap.ts:189](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/IEscrowSelfInitSwap.ts#L189)

Checks if the swap's quote is still valid

#### Returns

`Promise`<`boolean`>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`_verifyQuoteValid`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#_verifyquotevalid)

***

### commit()

```
commit(

   _signer, 

   abortSignal?, 

   skipChecks?, 

onBeforeTxSent?): Promise<string>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:823](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L823)

Initiates (commits) the escrow on the smart chain side

#### Parameters

| Parameter         | Type                                       | Description                                                                                                                                                                                  |
| ----------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `_signer`         | `T`\[`"Signer"`] \| `T`\[`"NativeSigner"`] | Signer to sign the transactions with, must be the same as used in the initialization                                                                                                         |
| `abortSignal?`    | `AbortSignal`                              | Abort signal                                                                                                                                                                                 |
| `skipChecks?`     | `boolean`                                  | Skip checks like making sure init signature is still valid and swap wasn't commited yet (this is handled on swap creation, if you commit right after quoting, you can use `skipChecks=true`) |
| `onBeforeTxSent?` | (`txId`) => `void`                         | Callback called before the transactions are broadcasted                                                                                                                                      |

#### Returns

`Promise`<`string`>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`commit`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#commit)

***

### execute()

```
execute(

   signer, 

   callbacks?, 

options?): Promise<boolean>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:505](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L505)

Executes the swap with the provided smart chain wallet/signer

#### Parameters

| Parameter                                  | Type                                                                                                                                                                  | Description                                                                     |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `signer`                                   | `T`\[`"Signer"`] \| `T`\[`"NativeSigner"`]                                                                                                                            | Smart chain wallet/signer to use to sign the transaction on the source chain    |
| `callbacks?`                               | { `onSourceTransactionConfirmed?`: (`sourceTxId`) => `void`; `onSourceTransactionSent?`: (`sourceTxId`) => `void`; `onSwapSettled?`: (`destinationTxId`) => `void`; } | Callbacks to track the progress of the swap                                     |
| `callbacks.onSourceTransactionConfirmed?`  | (`sourceTxId`) => `void`                                                                                                                                              | -                                                                               |
| `callbacks.onSourceTransactionSent?`       | (`sourceTxId`) => `void`                                                                                                                                              | -                                                                               |
| `callbacks.onSwapSettled?`                 | (`destinationTxId`) => `void`                                                                                                                                         | -                                                                               |
| `options?`                                 | { `abortSignal?`: `AbortSignal`; `maxWaitTillSwapProcessedSeconds?`: `number`; `paymentCheckIntervalSeconds?`: `number`; }                                            | Optional options for the swap like feeRate, AbortSignal, and timeouts/intervals |
| `options.abortSignal?`                     | `AbortSignal`                                                                                                                                                         | -                                                                               |
| `options.maxWaitTillSwapProcessedSeconds?` | `number`                                                                                                                                                              | -                                                                               |
| `options.paymentCheckIntervalSeconds?`     | `number`                                                                                                                                                              | -                                                                               |

#### Returns

`Promise`<`boolean`>

Whether the swap was successfully processed by the LP, in case `false` is returned the user can refund their funds back on the source chain by calling [refund](#refund)

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`execute`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#execute)

***

### getClaimHash()

```
getClaimHash(): string;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/IEscrowSwap.ts:130](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/IEscrowSwap.ts#L130)

Returns the claim data hash specifying the claim path of the escrow - i.e. hash passed to the claim handler

#### Returns

`string`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getClaimHash`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getclaimhash)

***

### getConfidence()

```
getConfidence(): number;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:174](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L174)

Returns the confidence of the intermediary that this payment will succeed.

#### Returns

`number`

Decimal value between 0 and 1, where 0 is not likely and 1 is very likely

***

### getDirection()

```
getDirection(): SwapDirection;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:560](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L560)

Returns the direction of the swap

#### Returns

[`SwapDirection`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapDirection.md)

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getDirection`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getdirection)

***

### getEscrowClaimTxId()

```
getEscrowClaimTxId(): string;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/IEscrowSwap.ts:151](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/IEscrowSwap.ts#L151)

Returns the smart chain transaction ID of the tx that claimed (settled) the escrow

#### Returns

`string`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getEscrowClaimTxId`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getescrowclaimtxid)

***

### getEscrowHash()

```
getEscrowHash(): string;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/IEscrowSwap.ts:123](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/IEscrowSwap.ts#L123)

Returns the escrow hash - i.e. hash of the escrow data

#### Returns

`string`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getEscrowHash`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getescrowhash)

***

### getEscrowInitTxId()

```
getEscrowInitTxId(): string;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/IEscrowSwap.ts:144](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/IEscrowSwap.ts#L144)

Returns the smart chain transaction ID of the tx that initiated the escrow

#### Returns

`string`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getEscrowInitTxId`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getescrowinittxid)

***

### getEscrowRefundTxId()

```
getEscrowRefundTxId(): string;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/IEscrowSwap.ts:158](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/IEscrowSwap.ts#L158)

Returns the smart chain transaction ID of the tx that refunded the escrow

#### Returns

`string`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getEscrowRefundTxId`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getescrowrefundtxid)

***

### getExecutionAction()

```
getExecutionAction(options?): Promise<

  | SwapExecutionActionWait<"LP">

| SwapExecutionActionSignSmartChainTx<T>>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:746](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L746)

Returns a current state-dependent action for the user to execute, or `undefined` if there is no more action required for this swap - this means that the swap is probably finished (either expired, failed or settled).

#### Parameters

| Parameter                         | Type                                                                                                             | Description                                                                                                                                                                                                            |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options?`                        | { `refundSmartChainSigner?`: `string` \| `T`\[`"Signer"`] \| `T`\[`"NativeSigner"`]; `skipChecks?`: `boolean`; } | Optional options argument for the additional action context (i.e. passing bitcoin wallet info to get funded PSBTs or passing the externally-generated swap secret), see the actual type in the respective swap classes |
| `options.refundSmartChainSigner?` | `string` \| `T`\[`"Signer"`] \| `T`\[`"NativeSigner"`]                                                           | Optional smart chain signer to use when creating refunds transactions                                                                                                                                                  |
| `options.skipChecks?`             | `boolean`                                                                                                        | Skip checks like making sure init signature is still valid and swap wasn't commited yet (this is handled on swap creation, if you commit right after quoting, you can use `skipChecks=true`)                           |

#### Returns

`Promise`< | [`SwapExecutionActionWait`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionActionWait.md)<`"LP"`> | [`SwapExecutionActionSignSmartChainTx`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionActionSignSmartChainTx.md)<`T`>>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getExecutionAction`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getexecutionaction)

***

### getExecutionStatus()

```
getExecutionStatus(options?): Promise<{

  currentAction:   | SwapExecutionActionWait<"LP">

     | SwapExecutionActionSignSmartChainTx<T>;

  stateInfo: SwapStateInfo<ToBTCSwapState>;

  steps: [SwapExecutionStepPayment<T["ChainId"]>, SwapExecutionStepSettlement<"BITCOIN" | "LIGHTNING", "soft_settled">, SwapExecutionStepRefund<T["ChainId"]>];

}>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:761](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L761)

Returns the current action and the full execution steps for a given swap. Prefer this to calling [getExecutionSteps](#getexecutionsteps) and [getExecutionAction](#getexecutionaction) separately - if called sequentially they might return the respective steps/actions in different states if you hit the state transition boundary.

#### Parameters

| Parameter                         | Type                                                                                                                                               | Description                                                                                                               |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `options?`                        | { `refundSmartChainSigner?`: `string` \| `T`\[`"Signer"`] \| `T`\[`"NativeSigner"`]; `skipBuildingAction?`: `boolean`; `skipChecks?`: `boolean`; } | Optional options argument for the additional execution status context, see the actual type in the respective swap classes |
| `options.refundSmartChainSigner?` | `string` \| `T`\[`"Signer"`] \| `T`\[`"NativeSigner"`]                                                                                             | -                                                                                                                         |
| `options.skipBuildingAction?`     | `boolean`                                                                                                                                          | -                                                                                                                         |
| `options.skipChecks?`             | `boolean`                                                                                                                                          | -                                                                                                                         |

#### Returns

`Promise`<{ `currentAction`: | [`SwapExecutionActionWait`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionActionWait.md)<`"LP"`> | [`SwapExecutionActionSignSmartChainTx`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionActionSignSmartChainTx.md)<`T`>; `stateInfo`: [`SwapStateInfo`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapStateInfo.md)<[`ToBTCSwapState`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/ToBTCSwapState.md)>; `steps`: \[[`SwapExecutionStepPayment`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionStepPayment.md)<`T`\[`"ChainId"`]>, [`SwapExecutionStepSettlement`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionStepSettlement.md)<`"BITCOIN"` | `"LIGHTNING"`, `"soft_settled"`>, [`SwapExecutionStepRefund`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionStepRefund.md)<`T`\[`"ChainId"`]>]; }>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getExecutionStatus`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getexecutionstatus)

***

### getExecutionSteps()

```
getExecutionSteps(): Promise<[SwapExecutionStepPayment<T["ChainId"]>, SwapExecutionStepSettlement<"BITCOIN" | "LIGHTNING", "soft_settled">, SwapExecutionStepRefund<T["ChainId"]>]>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:788](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L788)

Returns a list of execution steps the user has to go through for a given swap, to see the possible execution steps check out [SwapExecutionStep](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionStep.md).

#### Returns

`Promise`<\[[`SwapExecutionStepPayment`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionStepPayment.md)<`T`\[`"ChainId"`]>, [`SwapExecutionStepSettlement`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionStepSettlement.md)<`"BITCOIN"` | `"LIGHTNING"`, `"soft_settled"`>, [`SwapExecutionStepRefund`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionStepRefund.md)<`T`\[`"ChainId"`]>]>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getExecutionSteps`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getexecutionsteps)

***

### getExpiry()

```
getExpiry(): number;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:321](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L321)

Returns the time (in UNIX milliseconds) at which the swap expires and the user is able to unilaterally refund it with the [refund](#refund) or [txsRefund](#txsrefund) function.

#### Returns

`number`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getExpiry`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getexpiry)

***

### getFee()

```
getFee(): Fee<T["ChainId"], SCToken<T["ChainId"]>, BtcToken>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:388](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L388)

Returns total fee for the swap, the fee is represented in source currency & destination currency, but is paid only once

#### Returns

[`Fee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Fee.md)<`T`\[`"ChainId"`], [`SCToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SCToken.md)<`T`\[`"ChainId"`]>, [`BtcToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/BtcToken.md)>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getFee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getfee)

***

### getFeeBreakdown()

```
getFeeBreakdown(): [{

  fee: Fee<T["ChainId"], SCToken<T["ChainId"]>, BtcToken>;

  type: SWAP;

}, {

  fee: Fee<T["ChainId"], SCToken<T["ChainId"]>, BtcToken>;

  type: NETWORK_OUTPUT;

}];
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:407](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L407)

Returns the breakdown of all the fees paid

#### Returns

\[{ `fee`: [`Fee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Fee.md)<`T`\[`"ChainId"`], [`SCToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SCToken.md)<`T`\[`"ChainId"`]>, [`BtcToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/BtcToken.md)>; `type`: [`SWAP`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/FeeType.md#swap); }, { `fee`: [`Fee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Fee.md)<`T`\[`"ChainId"`], [`SCToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SCToken.md)<`T`\[`"ChainId"`]>, [`BtcToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/BtcToken.md)>; `type`: [`NETWORK_OUTPUT`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/FeeType.md#network_output); }]

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getFeeBreakdown`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getfeebreakdown)

***

### getId()

```
getId(): string;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/IEscrowSwap.ts:137](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/IEscrowSwap.ts#L137)

Returns the ID of the swap, as used in the storage

#### Returns

`string`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getId`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getid)

***

### getInput()

```
getInput(): TokenAmount<SCToken<T["ChainId"]>, true>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:433](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L433)

Returns input amount of the swap, user needs to pay this much

#### Returns

[`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<[`SCToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SCToken.md)<`T`\[`"ChainId"`]>, `true`>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getInput`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getinput)

***

### getInputAddress()

```
getInputAddress(): string;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:250](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L250)

Returns source address of the swap

#### Returns

`string`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getInputAddress`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getinputaddress)

***

### getInputToken()

```
getInputToken(): SCToken<T["ChainId"]>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:426](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L426)

Returns the input token of the swap

#### Returns

[`SCToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SCToken.md)<`T`\[`"ChainId"`]>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getInputToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getinputtoken)

***

### getInputTxId()

```
getInputTxId(): string;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:257](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L257)

Returns swap input transaction ID on the source chain

#### Returns

`string`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getInputTxId`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getinputtxid)

***

### getInputWithoutFee()

```
getInputWithoutFee(): TokenAmount<SCToken<T["ChainId"]>, true>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:443](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L443)

Returns input amount of the swap without the fees (swap fee, network fee)

#### Returns

[`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<[`SCToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SCToken.md)<`T`\[`"ChainId"`]>, `true`>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getInputWithoutFee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getinputwithoutfee)

***

### getLNURL()

```
getLNURL(): string;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:266](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L266)

Gets the used LNURL-pay link or `null` if this is not an LNURL-pay swap

#### Returns

`string`

***

### getOutput()

```
getOutput(): TokenAmount<BtcToken<true>>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:133](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L133)

Returns output amount of the swap, user receives this much

#### Returns

[`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<[`BtcToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/BtcToken.md)<`true`>>

#### Overrides

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getOutput`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getoutput)

***

### getOutputAddress()

```
getOutputAddress(): string;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:158](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L158)

Returns destination address of the swap

#### Returns

`string`

#### Overrides

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getOutputAddress`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getoutputaddress)

***

### getOutputToken()

```
getOutputToken(): BtcToken<true>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:126](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L126)

Returns the output token of the swap

#### Returns

[`BtcToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/BtcToken.md)<`true`>

#### Overrides

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getOutputToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getoutputtoken)

***

### getOutputTxId()

```
getOutputTxId(): string;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:149](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L149)

Returns swap output transaction ID on the destination chain

#### Returns

`string`

#### Overrides

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getOutputTxId`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getoutputtxid)

***

### getPaymentHash()

```
getPaymentHash(): Buffer<ArrayBufferLike>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:242](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L242)

Returns the payment hash of the swap, i.e. a payment hash of the lightning network invoice that is about to be paid

#### Returns

`Buffer`<`ArrayBufferLike`>

***

### getPriceInfo()

```
getPriceInfo(): object;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:388](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L388)

Returns pricing info about the swap

#### Returns

`object`

| Name           | Type                                                                                                           | Defined in                                                                                                                                          |
| -------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `difference`   | [`PercentagePPM`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/PercentagePPM.md) | [atomiq-sdk/src/swaps/ISwap.ts:391](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L391) |
| `marketPrice?` | `number`                                                                                                       | [atomiq-sdk/src/swaps/ISwap.ts:389](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L389) |
| `swapPrice`    | `number`                                                                                                       | [atomiq-sdk/src/swaps/ISwap.ts:390](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L390) |

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getPriceInfo`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getpriceinfo)

***

### getQuoteExpiry()

```
getQuoteExpiry(): number;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:546](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L546)

Returns quote expiry in UNIX millis

#### Returns

`number`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getQuoteExpiry`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getquoteexpiry)

***

### getRefundNetworkFee()

```
getRefundNetworkFee(): Promise<TokenAmount<SCToken<T["ChainId"]>, true>>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:1041](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L1041)

Get the estimated smart chain transaction fee of the refund transaction

#### Returns

`Promise`<[`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<[`SCToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SCToken.md)<`T`\[`"ChainId"`]>, `true`>>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getRefundNetworkFee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getrefundnetworkfee)

***

### getSecret()

```
getSecret(): string;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:165](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L165)

Returns payment secret (pre-image) as a proof of payment

#### Returns

`string`

***

### getSmartChainNetworkFee()

```
getSmartChainNetworkFee(): Promise<TokenAmount<SCToken<T["ChainId"]>, true>>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/IEscrowSelfInitSwap.ts:115](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/IEscrowSelfInitSwap.ts#L115)

Returns the transaction fee paid on the smart chain side to initiate the escrow

#### Returns

`Promise`<[`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<[`SCToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SCToken.md)<`T`\[`"ChainId"`]>, `true`>>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getSmartChainNetworkFee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getsmartchainnetworkfee)

***

### getState()

```
getState(): ToBTCSwapState;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:567](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L567)

Returns the current state of the swap

#### Returns

[`ToBTCSwapState`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/ToBTCSwapState.md)

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getState`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getstate)

***

### getStateInfo()

```
getStateInfo(): SwapStateInfo<ToBTCSwapState>;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:574](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L574)

Returns the current state of the swap along with the human-readable description of the state

#### Returns

[`SwapStateInfo`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapStateInfo.md)<[`ToBTCSwapState`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/ToBTCSwapState.md)>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getStateInfo`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#getstateinfo)

***

### getSuccessAction()

```
getSuccessAction(): LNURLDecodedSuccessAction;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:280](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L280)

Returns the success action after a successful payment, else `null`

#### Returns

[`LNURLDecodedSuccessAction`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LNURLDecodedSuccessAction.md)

***

### getType()

```
getType(): SwapType;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:553](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L553)

Returns the type of the swap

#### Returns

[`SwapType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md)

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`getType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#gettype)

***

### hasEnoughBalance()

```
hasEnoughBalance(): Promise<{

  balance: TokenAmount<SCToken<T["ChainId"]>, true>;

  enoughBalance: boolean;

  required: TokenAmount<SCToken<T["ChainId"]>, true>;

}>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:453](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L453)

Checks if the initiator/sender on the source chain has enough balance to go through with the swap

#### Returns

`Promise`<{ `balance`: [`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<[`SCToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SCToken.md)<`T`\[`"ChainId"`]>, `true`>; `enoughBalance`: `boolean`; `required`: [`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<[`SCToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SCToken.md)<`T`\[`"ChainId"`]>, `true`>; }>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`hasEnoughBalance`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#hasenoughbalance)

***

### hasEnoughForTxFees()

```
hasEnoughForTxFees(): Promise<{

  balance: TokenAmount<SCToken<T["ChainId"]>, true>;

  enoughBalance: boolean;

  required: TokenAmount<SCToken<T["ChainId"]>, true>;

}>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:475](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L475)

Checks if the initiator/sender on the source chain has enough native token balance to cover the transaction fee of initiating the swap

#### Returns

`Promise`<{ `balance`: [`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<[`SCToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SCToken.md)<`T`\[`"ChainId"`]>, `true`>; `enoughBalance`: `boolean`; `required`: [`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<[`SCToken`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SCToken.md)<`T`\[`"ChainId"`]>, `true`>; }>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`hasEnoughForTxFees`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#hasenoughfortxfees)

***

### hasSuccessAction()

```
hasSuccessAction(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:273](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L273)

Checks whether this LNURL-pay payment contains a success action

#### Returns

`boolean`

***

### hasValidPrice()

```
hasValidPrice(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:380](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L380)

Checks if the pricing for the swap is valid, according to max allowed price difference set in the ISwapPrice

#### Returns

`boolean`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`hasValidPrice`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#hasvalidprice)

***

### isFailed()

```
isFailed(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:306](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L306)

Returns whether the swap failed (e.g. was refunded)

#### Returns

`boolean`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`isFailed`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#isfailed)

***

### isFinished()

```
isFinished(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:271](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L271)

Returns whether the swap is finished and in its terminal state (this can mean successful, refunded or failed)

#### Returns

`boolean`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`isFinished`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#isfinished)

***

### isInitiated()

```
isInitiated(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:539](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L539)

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`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`isInitiated`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#isinitiated)

***

### isInProgress()

```
isInProgress(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:313](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L313)

Returns whether the swap is currently being processed

#### Returns

`boolean`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`isInProgress`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#isinprogress)

***

### isLNURL()

```
isLNURL(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:259](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L259)

Whether this is an LNURL-pay swap

#### Returns

`boolean`

***

### isPayingToNonCustodialWallet()

```
isPayingToNonCustodialWallet(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:201](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L201)

Tries to detect if the target lightning invoice is a non-custodial mobile wallet, extract care must be taken for such a wallet **to be online** when attempting to make a swap sending to such a wallet

#### Returns

`boolean`

***

### isQuoteExpired()

```
isQuoteExpired(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:285](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L285)

Checks whether the swap's quote has definitely expired and cannot be committed anymore, we can remove such swap

#### Returns

`boolean`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`isQuoteExpired`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#isquoteexpired)

***

### isQuoteSoftExpired()

```
isQuoteSoftExpired(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:292](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L292)

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`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`isQuoteSoftExpired`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#isquotesoftexpired)

***

### isRefundable()

```
isRefundable(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:278](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L278)

Checks whether a swap is currently refundable

#### Returns

`boolean`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`isRefundable`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#isrefundable)

***

### isSuccessful()

```
isSuccessful(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:299](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L299)

Returns whether the swap finished successful

#### Returns

`boolean`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`isSuccessful`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#issuccessful)

***

### refreshPriceData()

```
refreshPriceData(): Promise<void>;
```

Defined in: [atomiq-sdk/src/swaps/ISwap.ts:336](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/ISwap.ts#L336)

Re-fetches & revalidates the price data based on the current market prices

#### Returns

`Promise`<`void`>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`refreshPriceData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#refreshpricedata)

***

### refund()

```
refund(_signer, abortSignal?): Promise<string>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:1096](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L1096)

Refunds the swap if the swap is in refundable state, you can check so with [isRefundable](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IRefundableSwap.md#isrefundable)

#### Parameters

| Parameter      | Type                                       | Description                                                                          |
| -------------- | ------------------------------------------ | ------------------------------------------------------------------------------------ |
| `_signer`      | `T`\[`"Signer"`] \| `T`\[`"NativeSigner"`] | Signer to sign the transactions with, must be the same as used in the initialization |
| `abortSignal?` | `AbortSignal`                              | Abort signal                                                                         |

#### Returns

`Promise`<`string`>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`refund`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#refund)

***

### requiresAction()

```
requiresAction(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:264](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L264)

Checks whether there is some action required from the user for this swap - can mean either refundable or claimable

#### Returns

`boolean`

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`requiresAction`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#requiresaction)

***

### serialize()

```
serialize(): any;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:291](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L291)

Serializes the swap to a JSON stringifiable representation (i.e. no bigints, buffers etc.)

#### Returns

`any`

#### Overrides

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`serialize`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#serialize)

***

### txsCommit()

```
txsCommit(skipChecks?): Promise<T["TX"][]>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:804](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L804)

Returns transactions for initiating (committing) the escrow on the smart chain side. After sending the transactions manually be sure to call the [waitTillCommited](#waittillcommited) function to wait till the initiation transaction is observed, processed by the SDK and state of the swap properly updated.

#### Parameters

| Parameter     | Type      | Description                                                                                                                                                                                  |
| ------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `skipChecks?` | `boolean` | Skip checks like making sure init signature is still valid and swap wasn't commited yet (this is handled on swap creation, if you commit right after quoting, you can use `skipChecks=true`) |

#### Returns

`Promise`<`T`\[`"TX"`]\[]>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`txsCommit`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#txscommit)

***

### txsRefund()

```
txsRefund(_signer?): Promise<T["TX"][]>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:1057](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L1057)

Returns transactions for refunding the swap if the swap is in refundable state, you can check so with [isRefundable](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IRefundableSwap.md#isrefundable). After sending the transaction manually be sure to call the [waitTillRefunded](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IRefundableSwap.md#waittillrefunded) function to wait till the refund transaction is observed, processed by the SDK and state of the swap properly updated.

#### Parameters

| Parameter  | Type                                                   | Description                                                 |
| ---------- | ------------------------------------------------------ | ----------------------------------------------------------- |
| `_signer?` | `string` \| `T`\[`"Signer"`] \| `T`\[`"NativeSigner"`] | Address of the signer to create the refund transactions for |

#### Returns

`Promise`<`T`\[`"TX"`]\[]>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`txsRefund`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#txsrefund)

***

### waitForPayment()

```
waitForPayment(

   maxWaitTimeSeconds?, 

   checkIntervalSeconds?, 

abortSignal?): Promise<boolean>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:974](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L974)

A blocking promise resolving when swap was concluded by the intermediary (LP), rejecting in case of failure

#### Parameters

| Parameter               | Type          | Description                                                                                                            |
| ----------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `maxWaitTimeSeconds?`   | `number`      | Maximum time in seconds to wait for the swap to be settled, an error is thrown if the swap is taking too long to claim |
| `checkIntervalSeconds?` | `number`      | How often to poll the intermediary for answer                                                                          |
| `abortSignal?`          | `AbortSignal` | Abort signal                                                                                                           |

#### Returns

`Promise`<`boolean`>

`true` if swap was successful, `false` if swap failed and we can refund

#### Throws

If a swap is determined expired by the intermediary, but it is actually still valid

#### Throws

If the swap should be cooperatively refundable but the intermediary returned invalid refund signature

#### Throws

When swap expires or if the swap has invalid state (must be [ToBTCSwapState.COMMITED](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/ToBTCSwapState.md#commited))

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`waitForPayment`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#waitforpayment)

***

### waitTillCommited()

```
waitTillCommited(abortSignal?): Promise<void>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:848](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L848)

Waits till a swap is initiated (committed) on-chain, should be called after sending the commit transactions ([txsCommit](#txscommit)) manually to wait till the SDK processes the escrow initialization and updates the swap state accordingly

#### Parameters

| Parameter      | Type          | Description |
| -------------- | ------------- | ----------- |
| `abortSignal?` | `AbortSignal` | AbortSignal |

#### Returns

`Promise`<`void`>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`waitTillCommited`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#waittillcommited)

***

### waitTillRefunded()

```
waitTillRefunded(abortSignal?): Promise<void>;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/IToBTCSwap.ts:1114](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts#L1114)

Waits till a swap is refunded, should be called after sending the refund transactions manually to wait till the SDK processes the refund and updates the swap state accordingly

#### Parameters

| Parameter      | Type          | Description |
| -------------- | ------------- | ----------- |
| `abortSignal?` | `AbortSignal` | AbortSignal |

#### Returns

`Promise`<`void`>

#### Inherited from

[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md).[`waitTillRefunded`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md#waittillrefunded)

***

### willLikelyFail()

```
willLikelyFail(): boolean;
```

Defined in: [atomiq-sdk/src/swaps/escrow\_swaps/tobtc/ln/ToBTCLNSwap.ts:181](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts#L181)

Checks whether a swap is likely to fail, based on the confidence as reported by the intermediary (LP)

#### Returns

`boolean`
