# IEscrowSelfInitSwap\<T, D, S>

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

Base class for escrow-based swaps (i.e. swaps utilizing PrTLC and HTLC primitives) where the user needs to initiate the escrow on the smart chain side

## Extends

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

## Extended by

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

## 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)                                                                                                  |
| `D` *extends* `IEscrowSelfInitSwapDefinition`<`T`, [`IEscrowSwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwapWrapper.md)<`T`, `D`>, `IEscrowSelfInitSwap`<`T`, `D`, `S`>> | `IEscrowSwapDefinition`<`T`, [`IEscrowSwapWrapper`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwapWrapper.md)<`T`, `any`>, `IEscrowSelfInitSwap`<`T`, `any`, `any`>> |
| `S` *extends* `number`                                                                                                                                                                                                  | `number`                                                                                                                                                                                                |

## Constructors

### Constructor

```
protected new IEscrowSelfInitSwap<T, D, S>(wrapper, obj): IEscrowSelfInitSwap<T, D, S>;
```

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

#### Parameters

| Parameter | Type              |
| --------- | ----------------- |
| `wrapper` | `D`\[`"Wrapper"`] |
| `obj`     | `any`             |

#### Returns

`IEscrowSelfInitSwap`<`T`, `D`, `S`>

#### Overrides

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

### Constructor

```
protected new IEscrowSelfInitSwap<T, D, S>(wrapper, swapInit): IEscrowSelfInitSwap<T, D, S>;
```

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

#### Parameters

| Parameter  | Type                                      |
| ---------- | ----------------------------------------- |
| `wrapper`  | `D`\[`"Wrapper"`]                         |
| `swapInit` | `IEscrowSelfInitSwapInit`<`T`\[`"Data"`]> |

#### Returns

`IEscrowSelfInitSwap`<`T`, `D`, `S`>

#### Overrides

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`constructor`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`chainIdentifier`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

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

***

### events

```
readonly events: EventEmitter<{

  swapState: [D["Swap"]];

}>;
```

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

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`events`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`exactIn`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

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

***

### TYPE

```
abstract protected readonly TYPE: SwapType;
```

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

Swap type

#### Inherited from

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`TYPE`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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`>

#### Overrides

```
IEscrowSwap._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`>

#### Overrides

```
IEscrowSwap._verifyQuoteValid
```

***

### commit()

```
abstract commit(

   _signer, 

   abortSignal?, 

   skipChecks?, 

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

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

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`>

***

### execute()

```
abstract execute(...args): Promise<boolean>;
```

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

Executes the swap with the provided wallet, the exact arguments for this functions differ for various swap types. Check the `execute()` function signature in the respective swap class to see the required arguments.

#### Parameters

| Parameter | Type     | Description                                                                                                                            |
| --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| ...`args` | `any`\[] | Execution arguments, usually contains a source wallet object, callbacks and options, for exact syntax check the respective swap class. |

#### Returns

`Promise`<`boolean`>

Whether a swap was successfully executed or not, if it wasn't the user can refund or claim manually

#### Inherited from

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`execute`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

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

***

### 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

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`getDirection`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`getEscrowClaimTxId`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`getEscrowHash`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`getEscrowInitTxId`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

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

***

### getExecutionAction()

```
abstract getExecutionAction(options?): Promise<SwapExecutionAction>;
```

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

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?` | `any` | 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 |

#### Returns

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

#### Inherited from

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

***

### getExecutionStatus()

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

  currentAction: SwapExecutionAction;

  stateInfo: SwapStateInfo<S>;

  steps: SwapExecutionStep[];

}>;
```

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

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?` | `any` | Optional options argument for the additional execution status context, see the actual type in the respective swap classes |

#### Returns

`Promise`<{ `currentAction`: [`SwapExecutionAction`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionAction.md); `stateInfo`: [`SwapStateInfo`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapStateInfo.md)<`S`>; `steps`: [`SwapExecutionStep`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionStep.md)\[]; }>

#### Inherited from

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

***

### getExecutionSteps()

```
abstract getExecutionSteps(options?): Promise<SwapExecutionStep[]>;
```

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

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).

#### Parameters

| Parameter  | Type  | Description                                                                                                                                        |
| ---------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options?` | `any` | Optional options argument for the additional steps context (i.e. automatic settlement timeout), see the actual type in the respective swap classes |

#### Returns

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

#### Inherited from

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

***

### getFee()

```
abstract getFee(): Fee;
```

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

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)

#### Inherited from

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

***

### getFeeBreakdown()

```
abstract getFeeBreakdown(): FeeBreakdown<T["ChainId"]>;
```

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

Returns the breakdown of all the fees paid

#### Returns

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

#### Inherited from

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`getFeeBreakdown`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

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

***

### getInput()

```
abstract getInput(): TokenAmount;
```

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

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)

#### Inherited from

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

***

### getInputAddress()

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

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

Returns source address of the swap

#### Returns

`string`

#### Inherited from

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

***

### getInputToken()

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

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

Returns the input token of the swap

#### Returns

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

#### Inherited from

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

***

### getInputTxId()

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

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

Returns swap input transaction ID on the source chain

#### Returns

`string`

#### Inherited from

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

***

### getInputWithoutFee()

```
abstract getInputWithoutFee(): TokenAmount;
```

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

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)

#### Inherited from

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

***

### getOutput()

```
abstract getOutput(): TokenAmount;
```

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

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)

#### Inherited from

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

***

### getOutputAddress()

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

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

Returns destination address of the swap

#### Returns

`string`

#### Inherited from

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

***

### getOutputToken()

```
abstract getOutputToken(): Token<T["ChainId"]>;
```

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

Returns the output token of the swap

#### Returns

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

#### Inherited from

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

***

### getOutputTxId()

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

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

Returns swap output transaction ID on the destination chain

#### Returns

`string`

#### Inherited from

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

***

### 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

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`getPriceInfo`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

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

***

### 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`>>

***

### getState()

```
getState(): S;
```

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

`S`

#### Inherited from

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

***

### getStateInfo()

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

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)<`S`>

#### Inherited from

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

***

### 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

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

***

### hasEnoughForTxFees()

```
abstract hasEnoughForTxFees(): Promise<{

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

  enoughBalance: boolean;

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

}>;
```

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

Checks if the initiator/sender has enough balance on the smart chain side to cover the transaction fee for processing 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`>; }>

***

### 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

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

***

### isFailed()

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

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

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

#### Returns

`boolean`

#### Inherited from

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

***

### isFinished()

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

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

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

#### Returns

`boolean`

#### Inherited from

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`isFinished`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

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

***

### isInProgress()

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

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

Returns whether the swap is currently being processed

#### Returns

`boolean`

#### Inherited from

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

***

### isQuoteExpired()

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

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

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

#### Returns

`boolean`

#### Inherited from

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

***

### isQuoteSoftExpired()

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

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

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

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

***

### isSuccessful()

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

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

Returns whether the swap finished successful

#### Returns

`boolean`

#### Inherited from

[`IEscrowSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md).[`isSuccessful`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.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

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

***

### requiresAction()

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

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

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

#### Returns

`boolean`

#### Inherited from

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

***

### serialize()

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

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

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

#### Returns

`any`

#### Overrides

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

***

### txsCommit()

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

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

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"`]\[]>

***

### waitTillCommited()

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

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

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`>
