# Swapper\<T>

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:262](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L262)

Core orchestrator for all atomiq swap operations

## Extends

* `EventEmitter`<{ `lpsAdded`: \[[`Intermediary`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/Intermediary.md)\[]]; `lpsRemoved`: \[[`Intermediary`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/Intermediary.md)\[]]; `swapLimitsChanged`: \[]; `swapState`: \[[`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)]; }>

## Type Parameters

| Type Parameter             |
| -------------------------- |
| `T` *extends* `MultiChain` |

## Properties

### intermediaryDiscovery

```
readonly intermediaryDiscovery: IntermediaryDiscovery;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:324](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L324)

Intermediary discovery instance

***

### lpApi

```
readonly lpApi: IntermediaryAPI;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:320](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L320)

API for contacting LPs

***

### prices

```
readonly prices: ISwapPrice<T>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:316](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L316)

Pricing API used by the SDK

***

### SwapTypeInfo

```
readonly SwapTypeInfo: Record<SwapType, {

  requiresInputWallet: boolean;

  requiresOutputWallet: boolean;

  supportsGasDrop: boolean;

}>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:2294](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2294)

Helper information about various swap protocol and their features:

* `requiresInputWallet`: Whether a swap requires a connected wallet on the input chain able to sign arbitrary transaction
* `requiresOutputWallet`: Whether a swap requires a connected wallet on the output chain able to sign arbitrary transactions
* `supportsGasDrop`: Whether a swap supports the "gas drop" feature, allowing to user to receive a small amount of native token as part of the swap when swapping to smart chains

Uses a `Record` type here, use the [SwapProtocolInfo](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/variables/SwapProtocolInfo.md) import for a literal readonly type, with pre-filled exact values in the type.

***

### Utils

```
readonly Utils: SwapperUtils<T>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:328](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L328)

Miscellaneous utility functions

## Methods

### \_pollChainEvents()

```
_pollChainEvents<C>(chainId, lastEventCursorState?): Promise<any>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1954](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1954)

When the swapper is initiated with the `noEvents` config this function allows you to manually poll for on-chain events. It returns an events cursor which you should save and pass to the next call to the `poll()` function.

#### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

#### Parameters

| Parameter               | Type  | Description                                                             |
| ----------------------- | ----- | ----------------------------------------------------------------------- |
| `chainId`               | `C`   | Chain for which to poll the chain events listener for                   |
| `lastEventCursorState?` | `any` | Event cursor state returned from the last call to the `poll()` function |

#### Returns

`Promise`<`any`>

***

### \_syncSwaps()

```
_syncSwaps<C>(chainId?, signer?): Promise<void>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1937](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1937)

Synchronizes swaps from on-chain, this is ran automatically when SDK is initialized, hence should only be ran manually when `dontCheckPastSwaps=true` is passed in the swapper options, also deletes expired quotes

#### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

#### Parameters

| Parameter  | Type     | Description                                                              |
| ---------- | -------- | ------------------------------------------------------------------------ |
| `chainId?` | `C`      | Optional chain identifier to only run swap sync for a single smart chain |
| `signer?`  | `string` | Optional signer to only run swap sync for swaps initiated by this signer |

#### Returns

`Promise`<`void`>

***

### ~~create()~~

```
create<C>(

   signer, 

   srcToken, 

   dstToken, 

   amount, 

   exactIn, 

addressLnurlLightningInvoice?): Promise<ISwap<T[C], SwapTypeDefinition<T[C], ISwapWrapper<T[C], any, ISwapWrapperOptions>, ISwap<T[C], any, any>>, number>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1476](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1476)

Creates a swap from srcToken to dstToken, of a specific token amount, either specifying input amount (exactIn=true) or output amount (exactIn=false), NOTE: For regular -> BTC-LN (lightning) swaps the passed amount is ignored and invoice's pre-set amount is used instead.

#### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

#### Parameters

| Parameter                       | Type                                                                                                                                                                                                                                  | Description                                                                                              |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `signer`                        | `string`                                                                                                                                                                                                                              | Smartchain (Solana, Starknet, etc.) address of the user                                                  |
| `srcToken`                      | [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)<`C`>                                                                                                                                   | Source token of the swap, user pays this token                                                           |
| `dstToken`                      | [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)<`C`>                                                                                                                                   | Destination token of the swap, user receives this token                                                  |
| `amount`                        | `bigint`                                                                                                                                                                                                                              | Amount of the swap                                                                                       |
| `exactIn`                       | `boolean`                                                                                                                                                                                                                             | Whether the amount specified is an input amount (exactIn=true) or an output amount (exactIn=false)       |
| `addressLnurlLightningInvoice?` | \| `string` \| [`LNURLPay`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LNURLPay.md) \| [`LNURLWithdraw`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LNURLWithdraw.md) | Bitcoin on-chain address, lightning invoice, LNURL-pay to pay or LNURL-withdrawal to withdraw money from |

#### Returns

`Promise`<[`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `SwapTypeDefinition`<`T`\[`C`], [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<`T`\[`C`], `any`, `ISwapWrapperOptions`>, [`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `any`, `any`>>, `number`>>

#### Deprecated

Use [swap](#swap) instead

***

### createFromBTCLNSwap()

```
createFromBTCLNSwap<ChainIdentifier>(

   chainIdentifier, 

   recipient, 

   tokenAddress, 

   amount, 

   exactOut, 

   additionalParams, 

options?): Promise<FromBTCLNSwap<T[ChainIdentifier]>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1224](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1224)

Creates LEGACY Bitcoin Lightning -> Smart chain ([SwapType.FROM\_BTCLN](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#from_btcln)) swap

#### Type Parameters

| Type Parameter                       |
| ------------------------------------ |
| `ChainIdentifier` *extends* `string` |

#### Parameters

| Parameter          | Type                      | Default value | Description                                                                                           |
| ------------------ | ------------------------- | ------------- | ----------------------------------------------------------------------------------------------------- |
| `chainIdentifier`  | `ChainIdentifier`         | `undefined`   | Chain identifier string of the destination smart chain                                                |
| `recipient`        | `string`                  | `undefined`   | Recipient address on the destination chain                                                            |
| `tokenAddress`     | `string`                  | `undefined`   | Token address to receive                                                                              |
| `amount`           | `bigint`                  | `undefined`   | Amount to send in satoshis (if `exactOut=false`) or receive in token based units (if `exactOut=true`) |
| `exactOut`         | `boolean`                 | `false`       | Whether to use a exact out instead of exact in                                                        |
| `additionalParams` | `Record`<`string`, `any`> | `...`         | Additional parameters sent to the LP when creating the swap                                           |
| `options?`         | `FromBTCLNOptions`        | `undefined`   | Additional options for the swap                                                                       |

#### Returns

`Promise`<[`FromBTCLNSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/FromBTCLNSwap.md)<`T`\[`ChainIdentifier`]>>

***

### createFromBTCLNSwapNew()

```
createFromBTCLNSwapNew<ChainIdentifier>(

   chainIdentifier, 

   recipient, 

   tokenAddress, 

   amount, 

   exactOut, 

   additionalParams, 

options?): Promise<FromBTCLNAutoSwap<T[ChainIdentifier]>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1315](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1315)

Creates Bitcoin Lightning -> Smart chain ([SwapType.FROM\_BTCLN\_AUTO](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#from_btcln_auto)) swap

#### Type Parameters

| Type Parameter                       |
| ------------------------------------ |
| `ChainIdentifier` *extends* `string` |

#### Parameters

| Parameter          | Type                      | Default value | Description                                                                                           |
| ------------------ | ------------------------- | ------------- | ----------------------------------------------------------------------------------------------------- |
| `chainIdentifier`  | `ChainIdentifier`         | `undefined`   | Chain identifier string of the destination smart chain                                                |
| `recipient`        | `string`                  | `undefined`   | Recipient address on the destination chain                                                            |
| `tokenAddress`     | `string`                  | `undefined`   | Token address to receive                                                                              |
| `amount`           | `bigint`                  | `undefined`   | Amount to send in satoshis (if `exactOut=false`) or receive in token based units (if `exactOut=true`) |
| `exactOut`         | `boolean`                 | `false`       | Whether to use a exact out instead of exact in                                                        |
| `additionalParams` | `Record`<`string`, `any`> | `...`         | Additional parameters sent to the LP when creating the swap                                           |
| `options?`         | `FromBTCLNAutoOptions`    | `undefined`   | Additional options for the swap                                                                       |

#### Returns

`Promise`<[`FromBTCLNAutoSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/FromBTCLNAutoSwap.md)<`T`\[`ChainIdentifier`]>>

***

### createFromBTCLNSwapNewViaLNURL()

```
createFromBTCLNSwapNewViaLNURL<ChainIdentifier>(

   chainIdentifier, 

   recipient, 

   tokenAddress, 

   lnurl, 

   amount, 

   exactOut, 

   additionalParams, 

options?): Promise<FromBTCLNAutoSwap<T[ChainIdentifier]>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1361](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1361)

Creates Bitcoin Lightning -> Smart chain ([SwapType.FROM\_BTCLN\_AUTO](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#from_btcln_auto)) swap, withdrawing from an LNURL-withdraw link

#### Type Parameters

| Type Parameter                       |
| ------------------------------------ |
| `ChainIdentifier` *extends* `string` |

#### Parameters

| Parameter          | Type                                                                                                                       | Default value | Description                                                                                           |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------- |
| `chainIdentifier`  | `ChainIdentifier`                                                                                                          | `undefined`   | Chain identifier string of the destination smart chain                                                |
| `recipient`        | `string`                                                                                                                   | `undefined`   | Recipient address on the destination chain                                                            |
| `tokenAddress`     | `string`                                                                                                                   | `undefined`   | Token address to receive                                                                              |
| `lnurl`            | `string` \| [`LNURLWithdraw`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LNURLWithdraw.md) | `undefined`   | LNURL-withdraw link to pull the funds from                                                            |
| `amount`           | `bigint`                                                                                                                   | `undefined`   | Amount to send in satoshis (if `exactOut=false`) or receive in token based units (if `exactOut=true`) |
| `exactOut`         | `boolean`                                                                                                                  | `false`       | Whether to use a exact out instead of exact in                                                        |
| `additionalParams` | `Record`<`string`, `any`>                                                                                                  | `...`         | Additional parameters sent to the LP when creating the swap                                           |
| `options?`         | `FromBTCLNAutoOptions`                                                                                                     | `undefined`   | Additional options for the swap                                                                       |

#### Returns

`Promise`<[`FromBTCLNAutoSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/FromBTCLNAutoSwap.md)<`T`\[`ChainIdentifier`]>>

***

### createFromBTCLNSwapViaLNURL()

```
createFromBTCLNSwapViaLNURL<ChainIdentifier>(

   chainIdentifier, 

   recipient, 

   tokenAddress, 

   lnurl, 

   amount, 

   exactOut, 

   additionalParams, 

options?): Promise<FromBTCLNSwap<T[ChainIdentifier]>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1269](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1269)

Creates LEGACY Bitcoin Lightning -> Smart chain ([SwapType.FROM\_BTCLN](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#from_btcln)) swap, withdrawing from an LNURL-withdraw link

#### Type Parameters

| Type Parameter                       |
| ------------------------------------ |
| `ChainIdentifier` *extends* `string` |

#### Parameters

| Parameter          | Type                                                                                                                       | Default value | Description                                                                                           |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------- |
| `chainIdentifier`  | `ChainIdentifier`                                                                                                          | `undefined`   | Chain identifier string of the destination smart chain                                                |
| `recipient`        | `string`                                                                                                                   | `undefined`   | Recipient address on the destination chain                                                            |
| `tokenAddress`     | `string`                                                                                                                   | `undefined`   | Token address to receive                                                                              |
| `lnurl`            | `string` \| [`LNURLWithdraw`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LNURLWithdraw.md) | `undefined`   | LNURL-withdraw link to pull the funds from                                                            |
| `amount`           | `bigint`                                                                                                                   | `undefined`   | Amount to send in satoshis (if `exactOut=false`) or receive in token based units (if `exactOut=true`) |
| `exactOut`         | `boolean`                                                                                                                  | `false`       | Whether to use a exact out instead of exact in                                                        |
| `additionalParams` | `Record`<`string`, `any`>                                                                                                  | `...`         | Additional parameters sent to the LP when creating the swap                                           |
| `options?`         | `FromBTCLNOptions`                                                                                                         | `undefined`   | Additional options for the swap                                                                       |

#### Returns

`Promise`<[`FromBTCLNSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/FromBTCLNSwap.md)<`T`\[`ChainIdentifier`]>>

***

### createFromBTCSwap()

```
createFromBTCSwap<ChainIdentifier>(

   chainIdentifier, 

   recipient, 

   tokenAddress, 

   amount, 

   exactOut, 

   additionalParams, 

options?): Promise<FromBTCSwap<T[ChainIdentifier]>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1181](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1181)

Creates LEGACY Bitcoin -> Smart chain ([SwapType.FROM\_BTC](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#from_btc)) swap

#### Type Parameters

| Type Parameter                       |
| ------------------------------------ |
| `ChainIdentifier` *extends* `string` |

#### Parameters

| Parameter          | Type                      | Default value | Description                                                                                           |
| ------------------ | ------------------------- | ------------- | ----------------------------------------------------------------------------------------------------- |
| `chainIdentifier`  | `ChainIdentifier`         | `undefined`   | Chain identifier string of the destination smart chain                                                |
| `recipient`        | `string`                  | `undefined`   | Recipient address on the destination chain                                                            |
| `tokenAddress`     | `string`                  | `undefined`   | Token address to receive                                                                              |
| `amount`           | `bigint`                  | `undefined`   | Amount to send in satoshis (if `exactOut=false`) or receive in token based units (if `exactOut=true`) |
| `exactOut`         | `boolean`                 | `false`       | Whether to use a exact out instead of exact in                                                        |
| `additionalParams` | `Record`<`string`, `any`> | `...`         | Additional parameters sent to the LP when creating the swap                                           |
| `options?`         | `FromBTCOptions`          | `undefined`   | Additional options for the swap                                                                       |

#### Returns

`Promise`<[`FromBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/FromBTCSwap.md)<`T`\[`ChainIdentifier`]>>

***

### createFromBTCSwapNew()

```
createFromBTCSwapNew<ChainIdentifier>(

   chainIdentifier, 

   recipient, 

   tokenAddress, 

   amount, 

   exactOut, 

   additionalParams, 

options?): Promise<SpvFromBTCSwap<T[ChainIdentifier]>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1137](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1137)

Creates Bitcoin -> Smart chain ([SwapType.SPV\_VAULT\_FROM\_BTC](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#spv_vault_from_btc)) swap

#### Type Parameters

| Type Parameter                       |
| ------------------------------------ |
| `ChainIdentifier` *extends* `string` |

#### Parameters

| Parameter          | Type                      | Default value | Description                                                                                           |
| ------------------ | ------------------------- | ------------- | ----------------------------------------------------------------------------------------------------- |
| `chainIdentifier`  | `ChainIdentifier`         | `undefined`   | Chain identifier string of the destination smart chain                                                |
| `recipient`        | `string`                  | `undefined`   | Recipient address on the destination chain                                                            |
| `tokenAddress`     | `string`                  | `undefined`   | Token address to receive                                                                              |
| `amount`           | `bigint`                  | `undefined`   | Amount to send in satoshis (if `exactOut=false`) or receive in token based units (if `exactOut=true`) |
| `exactOut`         | `boolean`                 | `false`       | Whether to use a exact out instead of exact in                                                        |
| `additionalParams` | `Record`<`string`, `any`> | `...`         | Additional parameters sent to the LP when creating the swap                                           |
| `options?`         | `SpvFromBTCOptions`       | `undefined`   | Additional options for the swap                                                                       |

#### Returns

`Promise`<[`SpvFromBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/SpvFromBTCSwap.md)<`T`\[`ChainIdentifier`]>>

***

### createToBTCLNSwap()

```
createToBTCLNSwap<ChainIdentifier>(

   chainIdentifier, 

   signer, 

   tokenAddress, 

   paymentRequest, 

   additionalParams, 

options?): Promise<ToBTCLNSwap<T[ChainIdentifier]>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:997](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L997)

Creates Smart chain -> Bitcoin Lightning ([SwapType.TO\_BTCLN](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#to_btcln)) swap

#### Type Parameters

| Type Parameter                       |
| ------------------------------------ |
| `ChainIdentifier` *extends* `string` |

#### Parameters

| Parameter          | Type                      | Description                                                                                                                                                                  |
| ------------------ | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `chainIdentifier`  | `ChainIdentifier`         | Chain identifier string of the source smart chain                                                                                                                            |
| `signer`           | `string`                  | Signer's address on the source chain                                                                                                                                         |
| `tokenAddress`     | `string`                  | Token address to pay with                                                                                                                                                    |
| `paymentRequest`   | `string`                  | BOLT11 lightning network invoice to be paid (needs to have a fixed amount), and the swap amount is taken from this fixed amount, hence only exact output swaps are supported |
| `additionalParams` | `Record`<`string`, `any`> | Additional parameters sent to the LP when creating the swap                                                                                                                  |
| `options?`         | `ToBTCLNOptions`          | Additional options for the swap                                                                                                                                              |

#### Returns

`Promise`<[`ToBTCLNSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ToBTCLNSwap.md)<`T`\[`ChainIdentifier`]>>

***

### createToBTCLNSwapViaInvoiceCreateService()

```
createToBTCLNSwapViaInvoiceCreateService<ChainIdentifier>(

   chainIdentifier, 

   signer, 

   tokenAddress, 

   service, 

   amount, 

   exactIn, 

   additionalParams, 

options?): Promise<ToBTCLNSwap<T[ChainIdentifier]>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1092](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1092)

Creates Smart chain -> Bitcoin Lightning ([SwapType.TO\_BTCLN](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#to_btcln)) swap via [LightningInvoiceCreateService](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LightningInvoiceCreateService.md)

#### Type Parameters

| Type Parameter                       |
| ------------------------------------ |
| `ChainIdentifier` *extends* `string` |

#### Parameters

| Parameter          | Type                                                                                                                                           | Default value | Description                                                                                         |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------- |
| `chainIdentifier`  | `ChainIdentifier`                                                                                                                              | `undefined`   | Chain identifier string of the source smart chain                                                   |
| `signer`           | `string`                                                                                                                                       | `undefined`   | Signer's address on the source chain                                                                |
| `tokenAddress`     | `string`                                                                                                                                       | `undefined`   | Token address to pay with                                                                           |
| `service`          | [`LightningInvoiceCreateService`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LightningInvoiceCreateService.md) | `undefined`   | Invoice create service object which facilitates the creation of fixed amount LN invoices            |
| `amount`           | `bigint`                                                                                                                                       | `undefined`   | Amount to send in token based units (if `exactIn=true`) or receive in satoshis (if `exactIn=false`) |
| `exactIn`          | `boolean`                                                                                                                                      | `false`       | Whether to do an exact in swap instead of exact out                                                 |
| `additionalParams` | `Record`<`string`, `any`>                                                                                                                      | `...`         | Additional parameters sent to the LP when creating the swap                                         |
| `options?`         | `ToBTCLNOptions`                                                                                                                               | `undefined`   | Additional options for the swap                                                                     |

#### Returns

`Promise`<[`ToBTCLNSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ToBTCLNSwap.md)<`T`\[`ChainIdentifier`]>>

***

### createToBTCLNSwapViaLNURL()

```
createToBTCLNSwapViaLNURL<ChainIdentifier>(

   chainIdentifier, 

   signer, 

   tokenAddress, 

   lnurlPay, 

   amount, 

   exactIn, 

   additionalParams, 

options?): Promise<ToBTCLNSwap<T[ChainIdentifier]>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1045](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1045)

Creates Smart chain -> Bitcoin Lightning ([SwapType.TO\_BTCLN](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#to_btcln)) swap via LNURL-pay link

#### Type Parameters

| Type Parameter                       |
| ------------------------------------ |
| `ChainIdentifier` *extends* `string` |

#### Parameters

| Parameter          | Type                                                                                                             | Default value | Description                                                                                         |
| ------------------ | ---------------------------------------------------------------------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------- |
| `chainIdentifier`  | `ChainIdentifier`                                                                                                | `undefined`   | Chain identifier string of the source smart chain                                                   |
| `signer`           | `string`                                                                                                         | `undefined`   | Signer's address on the source chain                                                                |
| `tokenAddress`     | `string`                                                                                                         | `undefined`   | Token address to pay with                                                                           |
| `lnurlPay`         | `string` \| [`LNURLPay`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LNURLPay.md) | `undefined`   | LNURL-pay link to use for the payment                                                               |
| `amount`           | `bigint`                                                                                                         | `undefined`   | Amount to send in token based units (if `exactIn=true`) or receive in satoshis (if `exactIn=false`) |
| `exactIn`          | `boolean`                                                                                                        | `false`       | Whether to do an exact in swap instead of exact out                                                 |
| `additionalParams` | `Record`<`string`, `any`>                                                                                        | `...`         | Additional parameters sent to the LP when creating the swap                                         |
| `options?`         | `ToBTCLNOptions` & `object`                                                                                      | `undefined`   | Additional options for the swap                                                                     |

#### Returns

`Promise`<[`ToBTCLNSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ToBTCLNSwap.md)<`T`\[`ChainIdentifier`]>>

***

### createToBTCSwap()

```
createToBTCSwap<ChainIdentifier>(

   chainIdentifier, 

   signer, 

   tokenAddress, 

   address, 

   amount, 

   exactIn, 

   additionalParams, 

options?): Promise<ToBTCSwap<T[ChainIdentifier]>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:948](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L948)

Creates Smart chain -> Bitcoin ([SwapType.TO\_BTC](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#to_btc)) swap

#### Type Parameters

| Type Parameter                       |
| ------------------------------------ |
| `ChainIdentifier` *extends* `string` |

#### Parameters

| Parameter          | Type                      | Default value | Description                                                                                         |
| ------------------ | ------------------------- | ------------- | --------------------------------------------------------------------------------------------------- |
| `chainIdentifier`  | `ChainIdentifier`         | `undefined`   | Chain identifier string of the source smart chain                                                   |
| `signer`           | `string`                  | `undefined`   | Signer's address on the source chain                                                                |
| `tokenAddress`     | `string`                  | `undefined`   | Token address to pay with                                                                           |
| `address`          | `string`                  | `undefined`   | Recipient's bitcoin address                                                                         |
| `amount`           | `bigint`                  | `undefined`   | Amount to send in token based units (if `exactIn=true`) or receive in satoshis (if `exactIn=false`) |
| `exactIn`          | `boolean`                 | `false`       | Whether to use exact in instead of exact out                                                        |
| `additionalParams` | `Record`<`string`, `any`> | `...`         | Additional parameters sent to the LP when creating the swap                                         |
| `options?`         | `ToBTCOptions`            | `undefined`   | Additional options for the swap                                                                     |

#### Returns

`Promise`<[`ToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ToBTCSwap.md)<`T`\[`ChainIdentifier`]>>

***

### createTrustedLNForGasSwap()

```
createTrustedLNForGasSwap<C>(

   chainIdentifier, 

   recipient, 

   amount, 

trustedIntermediaryOrUrl?): Promise<LnForGasSwap<T[C]>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1406](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1406)

Creates a trusted Bitcoin Lightning -> Smart chain ([SwapType.TRUSTED\_FROM\_BTCLN](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#trusted_from_btcln)) gas swap

#### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

#### Parameters

| Parameter                   | Type                                                                                                                | Description                                                                           |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `chainIdentifier`           | `C`                                                                                                                 | Chain identifier string of the destination smart chain                                |
| `recipient`                 | `string`                                                                                                            | Recipient address on the destination chain                                            |
| `amount`                    | `bigint`                                                                                                            | Amount of native token to receive, in base units                                      |
| `trustedIntermediaryOrUrl?` | `string` \| [`Intermediary`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/Intermediary.md) | URL or Intermediary object of the trusted intermediary to use, otherwise uses default |

#### Returns

`Promise`<[`LnForGasSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/LnForGasSwap.md)<`T`\[`C`]>>

#### Throws

If no trusted intermediary specified

***

### createTrustedOnchainForGasSwap()

```
createTrustedOnchainForGasSwap<C>(

   chainIdentifier, 

   recipient, 

   amount, 

   refundAddress?, 

trustedIntermediaryOrUrl?): Promise<OnchainForGasSwap<T[C]>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1427](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1427)

Creates a trusted Bitcoin -> Smart chain ([SwapType.TRUSTED\_FROM\_BTC](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#trusted_from_btc)) gas swap

#### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

#### Parameters

| Parameter                   | Type                                                                                                                | Description                                                                           |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `chainIdentifier`           | `C`                                                                                                                 | Chain identifier string of the destination smart chain                                |
| `recipient`                 | `string`                                                                                                            | Recipient address on the destination chain                                            |
| `amount`                    | `bigint`                                                                                                            | Amount of native token to receive, in base units                                      |
| `refundAddress?`            | `string`                                                                                                            | Bitcoin refund address, in case the swap fails the funds are refunded here            |
| `trustedIntermediaryOrUrl?` | `string` \| [`Intermediary`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/Intermediary.md) | URL or Intermediary object of the trusted intermediary to use, otherwise uses default |

#### Returns

`Promise`<[`OnchainForGasSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/OnchainForGasSwap.md)<`T`\[`C`]>>

#### Throws

If no trusted intermediary specified

***

### getActionableSwaps()

#### Call Signature

```
getActionableSwaps(): Promise<ISwap<ChainType, SwapTypeDefinition<ChainType, ISwapWrapper<ChainType, any, ISwapWrapperOptions>, ISwap<ChainType, any, any>>, number>[]>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1682](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1682)

Returns all swaps where an action is required (either claim or refund)

##### Returns

`Promise`<[`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `SwapTypeDefinition`<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `any`, `ISwapWrapperOptions`>, [`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `any`, `any`>>, `number`>\[]>

#### Call Signature

```
getActionableSwaps<C>(chainId, signer?): Promise<ISwap<T[C], SwapTypeDefinition<T[C], ISwapWrapper<T[C], any, ISwapWrapperOptions>, ISwap<T[C], any, any>>, number>[]>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1686](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1686)

Returns swaps where an action is required (either claim or refund) for the specific chain, and optionally also for a specific signer's address

##### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

##### Parameters

| Parameter | Type     |
| --------- | -------- |
| `chainId` | `C`      |
| `signer?` | `string` |

##### Returns

`Promise`<[`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `SwapTypeDefinition`<`T`\[`C`], [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<`T`\[`C`], `any`, `ISwapWrapperOptions`>, [`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `any`, `any`>>, `number`>\[]>

***

### getAllSwaps()

#### Call Signature

```
getAllSwaps(): Promise<ISwap<ChainType, SwapTypeDefinition<ChainType, ISwapWrapper<ChainType, any, ISwapWrapperOptions>, ISwap<ChainType, any, any>>, number>[]>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1621](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1621)

Returns all swaps

##### Returns

`Promise`<[`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `SwapTypeDefinition`<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `any`, `ISwapWrapperOptions`>, [`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `any`, `any`>>, `number`>\[]>

#### Call Signature

```
getAllSwaps<C>(chainId, signer?): Promise<ISwap<T[C], SwapTypeDefinition<T[C], ISwapWrapper<T[C], any, ISwapWrapperOptions>, ISwap<T[C], any, any>>, number>[]>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1625](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1625)

Returns all swaps for the specific chain, and optionally also for a specific signer's address

##### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

##### Parameters

| Parameter | Type     |
| --------- | -------- |
| `chainId` | `C`      |
| `signer?` | `string` |

##### Returns

`Promise`<[`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `SwapTypeDefinition`<`T`\[`C`], [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<`T`\[`C`], `any`, `ISwapWrapperOptions`>, [`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `any`, `any`>>, `number`>\[]>

***

### getClaimableSwaps()

#### Call Signature

```
getClaimableSwaps(): Promise<IClaimableSwap<ChainType, SwapTypeDefinition<ChainType, ISwapWrapper<ChainType, any, ISwapWrapperOptions>, IClaimableSwap<ChainType, any, any>>, number>[]>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1734](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1734)

Returns all swaps that are manually claimable

##### Returns

`Promise`<[`IClaimableSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IClaimableSwap.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `SwapTypeDefinition`<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `any`, `ISwapWrapperOptions`>, [`IClaimableSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IClaimableSwap.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `any`, `any`>>, `number`>\[]>

#### Call Signature

```
getClaimableSwaps<C>(chainId, signer?): Promise<IClaimableSwap<T[C], SwapTypeDefinition<T[C], ISwapWrapper<T[C], any, ISwapWrapperOptions>, IClaimableSwap<T[C], any, any>>, number>[]>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1738](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1738)

Returns all swaps that are manually claimable for the specific chain, and optionally also for a specific signer's address

##### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

##### Parameters

| Parameter | Type     |
| --------- | -------- |
| `chainId` | `C`      |
| `signer?` | `string` |

##### Returns

`Promise`<[`IClaimableSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IClaimableSwap.md)<`T`\[`C`], `SwapTypeDefinition`<`T`\[`C`], [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<`T`\[`C`], `any`, `ISwapWrapperOptions`>, [`IClaimableSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IClaimableSwap.md)<`T`\[`C`], `any`, `any`>>, `number`>\[]>

***

### getPendingSwaps()

#### Call Signature

```
getPendingSwaps(): Promise<ISwap<ChainType, SwapTypeDefinition<ChainType, ISwapWrapper<ChainType, any, ISwapWrapperOptions>, ISwap<ChainType, any, any>>, number>[]>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1645](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1645)

Returns all swaps which are pending (i.e. not in their final state yet)

##### Returns

`Promise`<[`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `SwapTypeDefinition`<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `any`, `ISwapWrapperOptions`>, [`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `any`, `any`>>, `number`>\[]>

#### Call Signature

```
getPendingSwaps<C>(chainId, signer?): Promise<ISwap<T[C], SwapTypeDefinition<T[C], ISwapWrapper<T[C], any, ISwapWrapperOptions>, ISwap<T[C], any, any>>, number>[]>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1649](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1649)

Returns swaps which are pending (i.e. not in their final state yet) for the specific chain, and optionally also for a specific signer's address

##### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

##### Parameters

| Parameter | Type     |
| --------- | -------- |
| `chainId` | `C`      |
| `signer?` | `string` |

##### Returns

`Promise`<[`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `SwapTypeDefinition`<`T`\[`C`], [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<`T`\[`C`], `any`, `ISwapWrapperOptions`>, [`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `any`, `any`>>, `number`>\[]>

***

### getRefundableSwaps()

#### Call Signature

```
getRefundableSwaps(): Promise<IToBTCSwap<ChainType, IToBTCDefinition<ChainType, IToBTCWrapper<ChainType, any, ISwapWrapperOptions>, IToBTCSwap<ChainType, any>>>[]>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1698](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1698)

Returns all swaps that are refundable

##### Returns

`Promise`<[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `IToBTCDefinition`<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), [`IToBTCWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCWrapper.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `any`, `ISwapWrapperOptions`>, [`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `any`>>>\[]>

#### Call Signature

```
getRefundableSwaps<C>(chainId, signer?): Promise<IToBTCSwap<T[C], IToBTCDefinition<T[C], IToBTCWrapper<T[C], any, ISwapWrapperOptions>, IToBTCSwap<T[C], any>>>[]>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1702](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1702)

Returns swaps which are refundable for the specific chain, and optionally also for a specific signer's address

##### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

##### Parameters

| Parameter | Type     |
| --------- | -------- |
| `chainId` | `C`      |
| `signer?` | `string` |

##### Returns

`Promise`<[`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md)<`T`\[`C`], `IToBTCDefinition`<`T`\[`C`], [`IToBTCWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCWrapper.md)<`T`\[`C`], `any`, `ISwapWrapperOptions`>, [`IToBTCSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IToBTCSwap.md)<`T`\[`C`], `any`>>>\[]>

***

### getSmartChains()

```
getSmartChains(): ChainIds<T>[];
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:2209](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2209)

Returns an array of all the supported smart chains

#### Returns

`ChainIds`<`T`>\[]

***

### getSupportedTokens()

```
getSupportedTokens(input): Token[];
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:2342](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2342)

Returns an array of supported tokens either on the input or on the output of a swap

#### Parameters

| Parameter | Type                                                                                                              | Description                                     |
| --------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| `input`   | `boolean` \| [`SwapSide`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapSide.md) | Whether to return input tokens or output tokens |

#### Returns

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

***

### getSwapById()

#### Call Signature

```
getSwapById(id): Promise<ISwap<ChainType, SwapTypeDefinition<ChainType, ISwapWrapper<ChainType, any, ISwapWrapperOptions>, ISwap<ChainType, any, any>>, number>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1772](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1772)

Returns swap with a specific id (identifier)

##### Parameters

| Parameter | Type     |
| --------- | -------- |
| `id`      | `string` |

##### Returns

`Promise`<[`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `SwapTypeDefinition`<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `any`, `ISwapWrapperOptions`>, [`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<[`ChainType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/ChainType.md), `any`, `any`>>, `number`>>

#### Call Signature

```
getSwapById<C>(

   id, 

   chainId, 

signer?): Promise<ISwap<T[C], SwapTypeDefinition<T[C], ISwapWrapper<T[C], any, ISwapWrapperOptions>, ISwap<T[C], any, any>>, number>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1776](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1776)

Returns swap with a specific id (identifier) on a specific chain and optionally with a signer

##### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

##### Parameters

| Parameter | Type     |
| --------- | -------- |
| `id`      | `string` |
| `chainId` | `C`      |
| `signer?` | `string` |

##### Returns

`Promise`<[`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `SwapTypeDefinition`<`T`\[`C`], [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<`T`\[`C`], `any`, `ISwapWrapperOptions`>, [`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `any`, `any`>>, `number`>>

***

### getSwapCounterTokens()

```
getSwapCounterTokens(token, input): Token[];
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:2445](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2445)

Returns tokens that you can swap to (if input=true) from a given token, or tokens that you can swap from (if input=false) to a given token

#### Parameters

| Parameter | Type                                                                                                              |
| --------- | ----------------------------------------------------------------------------------------------------------------- |
| `token`   | [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)                    |
| `input`   | `boolean` \| [`SwapSide`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapSide.md) |

#### Returns

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

***

### getSwapLimits()

```
getSwapLimits<C, A, B>(srcToken, dstToken): object;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:2306](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2306)

Returns minimum/maximum limits for inputs and outputs for a swap between given tokens

#### Type Parameters

| Type Parameter                                                                                                    |
| ----------------------------------------------------------------------------------------------------------------- |
| `C` *extends* `string`                                                                                            |
| `A` *extends* [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)<`C`> |
| `B` *extends* [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)<`C`> |

#### Parameters

| Parameter  | Type | Description       |
| ---------- | ---- | ----------------- |
| `srcToken` | `A`  | Source token      |
| `dstToken` | `B`  | Destination token |

#### Returns

`object`

| Name          | Type                                                                                                            | Defined in                                                                                                                                                    |
| ------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input`       | `object`                                                                                                        | [atomiq-sdk/src/swapper/Swapper.ts:2307](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2307) |
| `input.max?`  | [`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<`A`> | [atomiq-sdk/src/swapper/Swapper.ts:2307](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2307) |
| `input.min`   | [`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<`A`> | [atomiq-sdk/src/swapper/Swapper.ts:2307](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2307) |
| `output`      | `object`                                                                                                        | [atomiq-sdk/src/swapper/Swapper.ts:2308](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2308) |
| `output.max?` | [`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<`B`> | [atomiq-sdk/src/swapper/Swapper.ts:2308](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2308) |
| `output.min`  | [`TokenAmount`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md)<`B`> | [atomiq-sdk/src/swapper/Swapper.ts:2308](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2308) |

***

### getSwapType()

```
getSwapType<C>(srcToken, dstToken): 

  | FROM_BTC

  | FROM_BTCLN

  | TO_BTC

  | TO_BTCLN

  | SPV_VAULT_FROM_BTC

  | FROM_BTCLN_AUTO;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:2248](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2248)

Returns type of the swap based on input and output tokens specified

#### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

#### Parameters

| Parameter  | Type                                                                                                | Description       |
| ---------- | --------------------------------------------------------------------------------------------------- | ----------------- |
| `srcToken` | [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)<`C`> | Source token      |
| `dstToken` | [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)<`C`> | Destination token |

#### Returns

\| [`FROM_BTC`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#from_btc) | [`FROM_BTCLN`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#from_btcln) | [`TO_BTC`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#to_btc) | [`TO_BTCLN`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#to_btcln) | [`SPV_VAULT_FROM_BTC`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#spv_vault_from_btc) | [`FROM_BTCLN_AUTO`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md#from_btcln_auto)

***

### getToken()

Returns the [Token](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md) object for a given token

#### Param

Token to return the object for, can use multiple formats:

* a) token ticker, such as `"BTC"`, `"SOL"`, etc.
* b) token ticker prefixed with smart chain identifier, such as `"SOLANA-SOL"`, `"SOLANA-USDC"`, etc.
* c) token address

#### Call Signature

```
getToken(ticker): BtcToken<false>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:2151](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2151)

##### Parameters

| Parameter | Type                       |
| --------- | -------------------------- |
| `ticker`  | `"BTC"` \| `"BITCOIN-BTC"` |

##### Returns

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

#### Call Signature

```
getToken(ticker): BtcToken<true>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:2152](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2152)

##### Parameters

| Parameter | Type                                         |
| --------- | -------------------------------------------- |
| `ticker`  | `"BTCLN"` \| `"BTC-LN"` \| `"LIGHTNING-BTC"` |

##### Returns

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

#### Call Signature

```
getToken<ChainIdentifier>(ticker): SCToken<ChainIdentifier>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:2153](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2153)

##### Type Parameters

| Type Parameter                       |
| ------------------------------------ |
| `ChainIdentifier` *extends* `string` |

##### Parameters

| Parameter | Type                                 |
| --------- | ------------------------------------ |
| `ticker`  | `` `${ChainIdentifier}-${string}` `` |

##### Returns

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

#### Call Signature

```
getToken(tickerOrAddress): Token<ChainIds<T>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:2154](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2154)

##### Parameters

| Parameter         | Type     |
| ----------------- | -------- |
| `tickerOrAddress` | `string` |

##### Returns

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

***

### getTypedSwapById()

```
getTypedSwapById<C, S>(

   id, 

   chainId, 

   swapType, 

signer?): Promise<SwapTypeMapping<T[C]>[S]>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1830](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1830)

Returns the swap with a proper return type, or `undefined` if not found or has wrong type

#### Type Parameters

| Type Parameter                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------ |
| `C` *extends* `string`                                                                                             |
| `S` *extends* [`SwapType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md) |

#### Parameters

| Parameter  | Type     | Description                                                                                                             |
| ---------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `id`       | `string` | An ID of the swap ([ISwap.getId](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md#getid)) |
| `chainId`  | `C`      | Chain identifier of the smart chain where the swap was initiated                                                        |
| `swapType` | `S`      | Type of the swap                                                                                                        |
| `signer?`  | `string` | An optional required smart chain signer address to fetch the swap for                                                   |

#### Returns

`Promise`<[`SwapTypeMapping`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapTypeMapping.md)<`T`\[`C`]>\[`S`]>

***

### init()

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

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:719](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L719)

Initializes the swap storage and loads existing swaps, needs to be called before any other action

#### Returns

`Promise`<`void`>

***

### isInitialized()

```
isInitialized(): boolean;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:741](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L741)

Whether the SDK is initialized (after [init](#init) is called)

#### Returns

`boolean`

***

### recoverSwaps()

```
recoverSwaps<C>(

   chainId, 

   signer, 

startBlockheight?): Promise<ISwap<T[C], SwapTypeDefinition<T[C], ISwapWrapper<T[C], any, ISwapWrapperOptions>, ISwap<T[C], any, any>>, number>[]>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1973](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1973)

Recovers swaps from on-chain historical data.

Please note that the recovered swaps might not be complete (i.e. missing amounts or addresses), as some of the swap data is purely off-chain and can never be recovered purely from on-chain data. This functions tries to recover as much swap data as possible.

#### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

#### Parameters

| Parameter           | Type     | Description                                                                                                  |
| ------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `chainId`           | `C`      | Smart chain identifier string to recover the swaps from                                                      |
| `signer`            | `string` | Signer address to recover the swaps for                                                                      |
| `startBlockheight?` | `number` | Optional starting blockheight for swap data recovery, will only check swaps initiated after this blockheight |

#### Returns

`Promise`<[`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `SwapTypeDefinition`<`T`\[`C`], [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<`T`\[`C`], `any`, `ISwapWrapperOptions`>, [`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `any`, `any`>>, `number`>\[]>

***

### stop()

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

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:748](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L748)

Stops listening for onchain events and closes this Swapper instance

#### Returns

`Promise`<`void`>

***

### supportsSwapType()

```
supportsSwapType<ChainIdentifier, Type>(chainId, swapType): SupportsSwapType<T[ChainIdentifier], Type>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:2219](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2219)

Returns whether the SDK supports a given swap type on a given chain based on currently known LPs

#### Type Parameters

| Type Parameter                                                                                                        |
| --------------------------------------------------------------------------------------------------------------------- |
| `ChainIdentifier` *extends* `string`                                                                                  |
| `Type` *extends* [`SwapType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapType.md) |

#### Parameters

| Parameter  | Type              | Description                   |
| ---------- | ----------------- | ----------------------------- |
| `chainId`  | `ChainIdentifier` | Smart chain identifier string |
| `swapType` | `Type`            | Swap protocol type            |

#### Returns

`SupportsSwapType`<`T`\[`ChainIdentifier`], `Type`>

***

### swap()

```
swap<C>(

   srcToken, 

   dstToken, 

   amount, 

   exactIn, 

   src, 

   dst, 

options?): Promise<ISwap<T[C], SwapTypeDefinition<T[C], ISwapWrapper<T[C], any, ISwapWrapperOptions>, ISwap<T[C], any, any>>, number>>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1532](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1532)

Creates a swap from srcToken to dstToken, of a specific token amount, either specifying input amount (if `exactIn=true`) or output amount (if `exactIn=false`), NOTE: For regular Smart chain -> BTC-LN (lightning) swaps the passed amount is ignored and invoice's pre-set amount is used instead, use LNURL-pay links for dynamic amounts

#### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

#### Parameters

| Parameter  | Type                                                                                                                                                                                                                                                                  | Description                                                                                                 |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `srcToken` | `string` \| [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)<`C`>                                                                                                                                                       | Source token of the swap, user pays this token                                                              |
| `dstToken` | `string` \| [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)<`C`>                                                                                                                                                       | Destination token of the swap, user receives this token                                                     |
| `amount`   | `string` \| `bigint`                                                                                                                                                                                                                                                  | Amount of the swap either in base units as {bigint} or in human readable format (with decimals) as {string} |
| `exactIn`  | `boolean` \| [`SwapAmountType`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/SwapAmountType.md)                                                                                                                                         | Whether the amount specified is an input amount (exactIn=true) or an output amount (exactIn=false)          |
| `src`      | `string` \| [`LNURLWithdraw`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LNURLWithdraw.md)                                                                                                                                            | Source wallet/lnurl-withdraw of the swap                                                                    |
| `dst`      | \| `string` \| [`LNURLPay`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LNURLPay.md) \| [`LightningInvoiceCreateService`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LightningInvoiceCreateService.md) | Destination smart chain address, bitcoin on-chain address, lightning invoice, LNURL-pay                     |
| `options?` | \| `ToBTCOptions` \| `SpvFromBTCOptions` \| `FromBTCOptions` \| `FromBTCLNOptions` \| `FromBTCLNAutoOptions` \| `ToBTCLNOptions` & `object`                                                                                                                           | Options for the swap                                                                                        |

#### Returns

`Promise`<[`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `SwapTypeDefinition`<`T`\[`C`], [`ISwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapWrapper.md)<`T`\[`C`], `any`, `ISwapWrapperOptions`>, [`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`\[`C`], `any`, `any`>>, `number`>>

***

### wipeStorage()

```
wipeStorage<C>(chainId?, signer?): Promise<void>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:1905](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L1905)

Deletes the swaps from the persistent storage backend. Note that some data (like lightning network amounts and bolt11 invoices) are purely off-chain and can never be recovered later just from on-chain data!

#### Type Parameters

| Type Parameter         |
| ---------------------- |
| `C` *extends* `string` |

#### Parameters

| Parameter  | Type     | Description                                                                                                            |
| ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| `chainId?` | `C`      | Optional, to only delete swaps for this smart chain                                                                    |
| `signer?`  | `string` | Optional, to only delete swaps for this smart chain signer (`chainId` param must be set to delete only signer's swaps) |

#### Returns

`Promise`<`void`>

***

### withChain()

```
withChain<ChainIdentifier>(chainIdentifier): SwapperWithChain<T, ChainIdentifier>;
```

Defined in: [atomiq-sdk/src/swapper/Swapper.ts:2201](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swapper/Swapper.ts#L2201)

Creates a child swapper instance with a given smart chain

#### Type Parameters

| Type Parameter                       |
| ------------------------------------ |
| `ChainIdentifier` *extends* `string` |

#### Parameters

| Parameter         | Type              | Description                                                   |
| ----------------- | ----------------- | ------------------------------------------------------------- |
| `chainIdentifier` | `ChainIdentifier` | Smart chain identifier for the created child swapper instance |

#### Returns

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