# LnForGasSwap\<T>

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:88](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L88)

Trusted swap for Bitcoin Lightning -> Smart chains, to be used for minor amounts to get gas tokens on the destination chain, which is only needed for Solana, which still uses legacy swaps

## Extends

* [`ISwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md)<`T`, `LnForGasSwapTypeDefinition`<`T`>, [`LnForGasSwapState`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/LnForGasSwapState.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) |

## Implements

* [`IAddressSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IAddressSwap.md)

## Constructors

### Constructor

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:122](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L122)

#### Parameters

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

#### Returns

`LnForGasSwap`<`T`>

#### Overrides

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

### Constructor

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:123](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L123)

#### Parameters

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

#### Returns

`LnForGasSwap`<`T`>

#### Overrides

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

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

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

***

### events

```
readonly events: EventEmitter<{

  swapState: [LnForGasSwap<T>];

}>;
```

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

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

#### Inherited from

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

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

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

***

### TYPE

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:89](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L89)

Swap type

#### Overrides

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

## Methods

### execute()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:416](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L416)

#### Returns

`Promise`<`boolean`>

#### Remarks

Not supported

#### Overrides

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

***

### getAddress()

```
getAddress(): string;
```

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:230](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L230)

Returns the lightning network BOLT11 invoice that needs to be paid as an input to the swap

#### Returns

`string`

#### Implementation of

[`IAddressSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IAddressSwap.md).[`getAddress`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IAddressSwap.md#getaddress)

***

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

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

***

### getExecutionAction()

```
getExecutionAction(): Promise<

  | SwapExecutionActionSendToAddress<true>

| SwapExecutionActionWait<"LP">>;
```

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

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

#### Returns

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

#### Overrides

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

***

### getExecutionStatus()

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

  currentAction:   | SwapExecutionActionSendToAddress<true>

     | SwapExecutionActionWait<"LP">;

  stateInfo: SwapStateInfo<LnForGasSwapState>;

  steps: [SwapExecutionStepPayment<"LIGHTNING">, SwapExecutionStepSettlement<T["ChainId"], never>];

}>;
```

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:572](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L572)

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?`                    | { `skipBuildingAction?`: `boolean`; } | Optional options argument for the additional execution status context, see the actual type in the respective swap classes |
| `options.skipBuildingAction?` | `boolean`                             | -                                                                                                                         |

#### Returns

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

#### Overrides

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

***

### getExecutionSteps()

```
getExecutionSteps(): Promise<[SwapExecutionStepPayment<"LIGHTNING">, SwapExecutionStepSettlement<T["ChainId"], never>]>;
```

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:594](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L594)

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

#### Returns

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

#### Overrides

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

***

### getFee()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:395](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L395)

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

#### Returns

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

#### Overrides

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

***

### getFeeBreakdown()

```
getFeeBreakdown(): [{

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

  type: SWAP;

}];
```

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:402](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L402)

Returns the breakdown of all the fees paid

#### Returns

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

#### Overrides

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

***

### getHyperlink()

```
getHyperlink(): string;
```

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:237](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L237)

Returns a string that can be displayed as QR code representation of the lightning invoice (with lightning: prefix)

#### Returns

`string`

#### Implementation of

[`IAddressSwap`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IAddressSwap.md).[`getHyperlink`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IAddressSwap.md#gethyperlink)

***

### getId()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:220](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L220)

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

#### Returns

`string`

#### Overrides

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

***

### getInput()

```
getInput(): TokenAmount<BtcToken<true>, true>;
```

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:346](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L346)

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

#### Overrides

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

***

### getInputAddress()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:199](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L199)

Returns source address of the swap

#### Returns

`string`

#### Overrides

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

***

### getInputToken()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:339](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L339)

Returns the input token of the swap

#### Returns

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

#### Overrides

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

***

### getInputTxId()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:206](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L206)

Returns swap input transaction ID on the source chain

#### Returns

`string`

#### Overrides

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

***

### getInputWithoutFee()

```
getInputWithoutFee(): TokenAmount<BtcToken<true>, true>;
```

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:357](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L357)

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

#### Overrides

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

***

### getOutput()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:329](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L329)

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

#### Overrides

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

***

### getOutputAddress()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:192](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L192)

Returns destination address of the swap

#### Returns

`string`

#### Overrides

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

***

### getOutputToken()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:322](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L322)

Returns the output token of the swap

#### Returns

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

#### Overrides

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

***

### getOutputTxId()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:213](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L213)

Returns swap output transaction ID on the destination chain

#### Returns

`string`

#### Overrides

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

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

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

***

### getState()

```
getState(): LnForGasSwapState;
```

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

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

#### Inherited from

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

***

### getStateInfo()

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

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

#### Inherited from

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

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

***

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

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

***

### isFailed()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:272](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L272)

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

#### Returns

`boolean`

#### Overrides

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

***

### isFinished()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:251](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L251)

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

#### Returns

`boolean`

#### Overrides

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

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

***

### isInProgress()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:286](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L286)

Returns whether the swap is currently being processed

#### Returns

`boolean`

#### Overrides

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

***

### isQuoteExpired()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:258](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L258)

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

#### Returns

`boolean`

#### Overrides

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

***

### isQuoteSoftExpired()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:265](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L265)

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`

#### Overrides

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

***

### isSuccessful()

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

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

Returns whether the swap finished successful

#### Returns

`boolean`

#### Overrides

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

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

***

### requiresAction()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:244](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L244)

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

#### Returns

`boolean`

#### Overrides

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

***

### serialize()

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:706](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L706)

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

#### Returns

`any`

#### Overrides

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

***

### waitForPayment()

```
waitForPayment(

   checkIntervalSeconds?, 

   abortSignal?, 

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

Defined in: [atomiq-sdk/src/swaps/trusted/ln/LnForGasSwap.ts:672](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/swaps/trusted/ln/LnForGasSwap.ts#L672)

A blocking promise resolving when payment was received by the intermediary and client can continue, rejecting in case of failure. The swap must be in [LnForGasSwapState.PR\_CREATED](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/LnForGasSwapState.md#pr_created) or [LnForGasSwapState.PR\_PAID](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/LnForGasSwapState.md#pr_paid) state!

#### Parameters

| Parameter               | Type               | Description                                                        |
| ----------------------- | ------------------ | ------------------------------------------------------------------ |
| `checkIntervalSeconds?` | `number`           | How often to poll the intermediary for answer (default 5 seconds)  |
| `abortSignal?`          | `AbortSignal`      | Abort signal                                                       |
| `onPaymentReceived?`    | (`txId`) => `void` | Callback as for when the LP reports having received the ln payment |

#### Returns

`Promise`<`boolean`>

#### Throws

When in invalid state (not PR\_CREATED)
