# SolanaSwapProgram

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:53](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L53)

Solana swap (escrow manager) program representation handling PrTLC (on-chain) and HTLC (lightning) based swaps.

## Extends

* `SolanaProgramBase`<`SwapProgram`>

## Implements

* [`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md)<[`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md), [`SolanaTx`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/type-aliases/SolanaTx.md), `SolanaPreFetchData`, `SolanaPreFetchVerification`, [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md), `"SOLANA"`>

## Constructors

### Constructor

```
new SolanaSwapProgram(

   chainInterface, 

   btcRelay, 

   storage, 

   programAddress?): SolanaSwapProgram;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:156](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L156)

#### Parameters

| Parameter         | Type                                                                                                                                  |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `chainInterface`  | [`SolanaChainInterface`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaChainInterface.md)      |
| `btcRelay`        | [`SolanaBtcRelay`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaBtcRelay.md)<`any`>           |
| `storage`         | [`IStorageManager`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IStorageManager.md)<`StoredDataAccount`> |
| `programAddress?` | `string`                                                                                                                              |

#### Returns

`SolanaSwapProgram`

#### Overrides

```
SolanaProgramBase<SwapProgram>.constructor
```

## Properties

### \_SwapEscrowState

```
readonly _SwapEscrowState: any;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:98](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L98)

***

### \_SwapUserVault

```
readonly _SwapUserVault: any;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:92](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L92)

***

### \_SwapVault

```
readonly _SwapVault: any;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:84](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L84)

***

### \_SwapVaultAuthority

```
readonly _SwapVaultAuthority: PublicKey;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:78](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L78)

***

### chainId

```
readonly chainId: "SOLANA" = "SOLANA";
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:105](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L105)

Chain identifier string

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`chainId`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#chainid-1)

***

### claimWithSecretTimeout

```
readonly claimWithSecretTimeout: number = 45;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:109](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L109)

A timeout to be used when claiming the escrow with a secret (HTLC), recommended to wait at least this long after sending a transaction before considering it a failure

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`claimWithSecretTimeout`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#claimwithsecrettimeout)

***

### claimWithTxDataTimeout

```
readonly claimWithTxDataTimeout: number = 120;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:113](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L113)

A timeout to be used when claiming the escrow with bitcoin transaction data (PrTLC), recommended to wait at least this long after sending a transaction before considering it a failure

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`claimWithTxDataTimeout`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#claimwithtxdatatimeout)

***

### ESCROW\_STATE\_RENT\_EXEMPT

```
readonly ESCROW_STATE_RENT_EXEMPT: 2658720 = 2658720;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:69](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L69)

Rent-exempt amount (lamports) for escrow state accounts.

***

### program

```
program: Program<T>;
```

Defined in: [atomiq-chain-solana/src/solana/program/SolanaProgramBase.ts:21](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/program/SolanaProgramBase.ts#L21)

#### Inherited from

```
SolanaProgramBase.program
```

***

### refundTimeout

```
readonly refundTimeout: number = 45;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:117](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L117)

A timeout to be used when refunding the escrow, recommended to wait at least this long after sending a transaction before considering it a failure

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`refundTimeout`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#refundtimeout)

## Methods

### claimDeposits()

```
claimDeposits(signer): Promise<{

  count: number;

  totalValue: bigint;

  txIds: string[];

}>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:188](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L188)

Claims the funds from claimable deposits

#### Parameters

| Parameter | Type                                                                                                             | Description                               |
| --------- | ---------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| `signer`  | [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md) | Owner of the deposits, transaction signer |

#### Returns

`Promise`<{ `count`: `number`; `totalValue`: `bigint`; `txIds`: `string`\[]; }>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`claimDeposits`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#claimdeposits)

***

### claimWithSecret()

```
claimWithSecret(

   signer, 

   swapData, 

   secret, 

   checkExpiry?, 

   initAta?, 

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

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:790](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L790)

Signs & sends transactions required for claiming an HTLC swap

#### Parameters

| Parameter      | Type                                                                                                                 | Description                                                                                                  |
| -------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `signer`       | [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md)     | Signer for which the transaction should be created (doesn't need to match the claimer)                       |
| `swapData`     | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to claim                                                                                                |
| `secret`       | `string`                                                                                                             | Secret pre-image that hashes to the swap hash                                                                |
| `checkExpiry?` | `boolean`                                                                                                            | Whether to check expiration of the swap before executing transactions                                        |
| `initAta?`     | `boolean`                                                                                                            | Whether to initialize a token account if it doesn't exist (applies to e.g. Solana, with token specific ATAs) |
| `txOptions?`   | `TransactionConfirmationOptions`                                                                                     | Transaction options                                                                                          |

#### Returns

`Promise`<`string`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`claimWithSecret`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#claimwithsecret)

***

### claimWithTxData()

```
claimWithTxData(

   signer, 

   swapData, 

   tx, 

   requiredConfirmations, 

   vout, 

   commitedHeader?, 

   synchronizer?, 

   initAta?, 

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

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:806](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L806)

Signs & sends transactions required for claiming an on-chain PTLC (proof-time locked contract) swap

#### Parameters

| Parameter                | Type                                                                                                                                             | Description                                                                                                  |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `signer`                 | [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md)                                 | Signer for which the transaction should be created (doesn't need to match the claimer)                       |
| `swapData`               | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md)                             | Swap to claim                                                                                                |
| `tx`                     | { `blockhash`: `string`; `confirmations`: `number`; `height`: `number`; `hex`: `string`; `txid`: `string`; }                                     | Bitcoin transaction containing the required output                                                           |
| `tx.blockhash`           | `string`                                                                                                                                         | -                                                                                                            |
| `tx.confirmations`       | `number`                                                                                                                                         | -                                                                                                            |
| `tx.height`              | `number`                                                                                                                                         | -                                                                                                            |
| `tx.hex?`                | `string`                                                                                                                                         | -                                                                                                            |
| `tx.txid?`               | `string`                                                                                                                                         | -                                                                                                            |
| `requiredConfirmations?` | `number`                                                                                                                                         | Required confirmations for the escrow to be claimed                                                          |
| `vout?`                  | `number`                                                                                                                                         | Bitcoin tx's output index of the required output                                                             |
| `commitedHeader?`        | [`SolanaBtcStoredHeader`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaBtcStoredHeader.md)               | Optional already retrieved stored header to use for proving                                                  |
| `synchronizer?`          | `RelaySynchronizer`<`any`, [`SolanaTx`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/type-aliases/SolanaTx.md), `any`> | Optiona synchronizer to be used if BTC relay contract is not synced up to the required blockheight           |
| `initAta?`               | `boolean`                                                                                                                                        | Whether to initialize a token account if it doesn't exist (applies to e.g. Solana, with token specific ATAs) |
| `txOptions?`             | `TransactionConfirmationOptions`                                                                                                                 | Transaction options                                                                                          |

#### Returns

`Promise`<`string`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`claimWithTxData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#claimwithtxdata)

***

### createSwapData()

```
createSwapData(

   type, 

   offerer, 

   claimer, 

   token, 

   amount, 

   claimHash, 

   sequence, 

   expiry, 

   payIn, 

   payOut, 

   securityDeposit, 

   claimerBounty, 

depositToken?): Promise<SolanaSwapData>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:616](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L616)

Create a swap data for this given chain

#### Parameters

| Parameter         | Type            | Description                                                                                                                              |
| ----------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `type`            | `ChainSwapType` | Type of the swap                                                                                                                         |
| `offerer`         | `string`        | Offerer address                                                                                                                          |
| `claimer`         | `string`        | Claimer addres                                                                                                                           |
| `token`           | `string`        | Token to use for the swap                                                                                                                |
| `amount`          | `bigint`        | Amount of tokens for the swap                                                                                                            |
| `claimHash`       | `string`        | Payment hash identifying the swap                                                                                                        |
| `sequence`        | `bigint`        | Swap sequence uniquelly defining this swap                                                                                               |
| `expiry`          | `bigint`        | Expiration of the swap                                                                                                                   |
| `payIn`           | `boolean`       | Whether the swap is payIn (offerer paying to the contract, or not payIn offerer using funds in his LP vault)                             |
| `payOut`          | `boolean`       | Whether the swap is payOut (claimer getting the funds to his on-chain address, or no payOut claimer getting his funds into his LP vault) |
| `securityDeposit` | `bigint`        | Security deposit for the swap paid by the claimer (options premium)                                                                      |
| `claimerBounty`   | `bigint`        | Bounty for the claimer of the swap (used for watchtowers)                                                                                |
| `depositToken?`   | `string`        | Token to be used for security deposit and claimer bounty                                                                                 |

#### Returns

`Promise`<[`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md)>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`createSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#createswapdata)

***

### deposit()

```
deposit(

   signer, 

   token, 

   amount, 

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

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:925](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L925)

Deposits funds to the trading LP vault

#### Parameters

| Parameter    | Type                                                                                                             | Description                     |
| ------------ | ---------------------------------------------------------------------------------------------------------------- | ------------------------------- |
| `signer`     | [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md) | Signer to sign the deposit with |
| `token`      | `string`                                                                                                         | Token to deposit                |
| `amount`     | `bigint`                                                                                                         | Amount of the token to deposit  |
| `txOptions?` | `TransactionConfirmationOptions`                                                                                 | Transaction options             |

#### Returns

`Promise`<`string`>

#### Implementation of

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

***

### getBalance()

```
getBalance(

   signer, 

   tokenAddress, 

inContract): Promise<bigint>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:665](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L665)

Returns the token balance of a given signer's address

#### Parameters

| Parameter      | Type      | Description                                                                                |
| -------------- | --------- | ------------------------------------------------------------------------------------------ |
| `signer`       | `string`  | Address to check the balance of                                                            |
| `tokenAddress` | `string`  | Token                                                                                      |
| `inContract`   | `boolean` | Whether we are checking the liquidity deposited into the LP vault or just on-chain balance |

#### Returns

`Promise`<`bigint`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getBalance`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getbalance)

***

### getClaimableDeposits()

```
getClaimableDeposits(signer): Promise<{

  count: number;

  totalValue: bigint;

}>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:181](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L181)

Returns the amount of deposits (in native token) that we can claim back (this is useful for SVM chains with the PDAs requiring you to put some deposit in order to store data)

#### Parameters

| Parameter | Type     | Description                                |
| --------- | -------- | ------------------------------------------ |
| `signer`  | `string` | Signer to check the claimable deposits for |

#### Returns

`Promise`<{ `count`: `number`; `totalValue`: `bigint`; }>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getClaimableDeposits`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getclaimabledeposits)

***

### getClaimFee()

```
getClaimFee(

   signer, 

   swapData, 

feeRate?): Promise<bigint>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:981](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L981)

Returns the fee in native token base units to claim the swap

#### Parameters

| Parameter  | Type                                                                                                                 | Description                                           |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `signer`   | `string`                                                                                                             | Signer claiming the swap                              |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to claim                                         |
| `feeRate?` | `string`                                                                                                             | Optional fee rate (fetched on-demand if not provided) |

#### Returns

`Promise`<`bigint`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getClaimFee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getclaimfee)

***

### getClaimFeeRate()

```
getClaimFeeRate(signer, swapData): Promise<string>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:974](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L974)

Returns the fee rate for claiming a swap as a specific signer

#### Parameters

| Parameter  | Type                                                                                                                 | Description              |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `signer`   | `string`                                                                                                             | Signer claiming the swap |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to claim            |

#### Returns

`Promise`<`string`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getClaimFeeRate`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getclaimfeerate)

***

### getClaimHashStatus()

```
getClaimHashStatus(claimHash): Promise<SwapCommitStateType>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:426](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L426)

#### Parameters

| Parameter   | Type     |
| ----------- | -------- |
| `claimHash` | `string` |

#### Returns

`Promise`<`SwapCommitStateType`>

#### Inherit Doc

***

### getCommitedData()

```
getCommitedData(claimHashHex): Promise<SolanaSwapData>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:458](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L458)

#### Parameters

| Parameter      | Type     |
| -------------- | -------- |
| `claimHashHex` | `string` |

#### Returns

`Promise`<[`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md)>

#### Inherit Doc

***

### getCommitFee()

```
getCommitFee(

   signer, 

   swapData, 

feeRate?): Promise<bigint>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:995](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L995)

Returns the fee in native token base units to commit (initiate) the swap

#### Parameters

| Parameter  | Type                                                                                                                 | Description                                           |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `signer`   | `string`                                                                                                             |                                                       |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to initiate                                      |
| `feeRate?` | `string`                                                                                                             | Optional fee rate (fetched on-demand if not provided) |

#### Returns

`Promise`<`bigint`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getCommitFee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getcommitfee)

***

### getCommitStatus()

```
getCommitStatus(signer, data): Promise<SwapCommitState>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:347](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L347)

Returns the full status of the swap, expiry is handled by the isExpired function so also requires a signer/sender

#### Parameters

| Parameter | Type                                                                                                                 | Description |
| --------- | -------------------------------------------------------------------------------------------------------------------- | ----------- |
| `signer`  | `string`                                                                                                             |             |
| `data`    | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) |             |

#### Returns

`Promise`<`SwapCommitState`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getCommitStatus`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getcommitstatus)

***

### getCommitStatuses()

```
getCommitStatuses(request): Promise<{

[p: string]: SwapCommitState;

}>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:403](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L403)

Returns the full status of the passed swaps, expiry is handled by the isExpired function so also requires a signer/sender

#### Parameters

| Parameter | Type        | Description |
| --------- | ----------- | ----------- |
| `request` | `object`\[] |             |

#### Returns

`Promise`<{ \[`p`: `string`]: `SwapCommitState`; }>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getCommitStatuses`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getcommitstatuses)

***

### getDataSignature()

```
getDataSignature(signer, data): Promise<string>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:253](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L253)

Signs the given data with the provided signer

#### Parameters

| Parameter | Type                                                                                                             | Description                |
| --------- | ---------------------------------------------------------------------------------------------------------------- | -------------------------- |
| `signer`  | [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md) | Signer to sign the message |
| `data`    | `Buffer`                                                                                                         | Data to sign               |

#### Returns

`Promise`<`string`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getDataSignature`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getdatasignature)

***

### getExtraData()

```
getExtraData(

   outputScript, 

   amount, 

   confirmations, 

   nonce?): Buffer;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:1023](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L1023)

Returns additional data to be included in the data-carrier (extra data) part of the PrTLC escrow initialization this provides helpers for 3rd party claimers

#### Parameters

| Parameter       | Type     | Description                                                                                |
| --------------- | -------- | ------------------------------------------------------------------------------------------ |
| `outputScript`  | `Buffer` | A bitcoin output script required in the bitcoin transaction to claim the escrow            |
| `amount`        | `bigint` | An amount of bitcoin (in satoshis) required in the bitcoin transaction to claim the escrow |
| `confirmations` | `number` | Confirmations of the bitcoin transaction required for claiming the escrow                  |
| `nonce?`        | `bigint` | An optional nonce applied to the transaction                                               |

#### Returns

`Buffer`

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getExtraData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getextradata)

***

### getHashForHtlc()

```
getHashForHtlc(swapHash): Buffer;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:323](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L323)

Compute the claim hash for an HTLC swap with a given swap hash

#### Parameters

| Parameter  | Type     | Description |
| ---------- | -------- | ----------- |
| `swapHash` | `Buffer` |             |

#### Returns

`Buffer`

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getHashForHtlc`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#gethashforhtlc)

***

### getHashForOnchain()

```
getHashForOnchain(

   outputScript, 

   amount, 

   confirmations, 

   nonce?): Buffer;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:310](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L310)

Compute the claim hash for a given transaction output, either nonced or just output locked

#### Parameters

| Parameter       | Type     | Description                                                   |
| --------------- | -------- | ------------------------------------------------------------- |
| `outputScript`  | `Buffer` | Bitcoin output locking script                                 |
| `amount`        | `bigint` | Amount of sats in the output                                  |
| `confirmations` | `number` | Required number of confirmations for the swap to be claimable |
| `nonce?`        | `bigint` | Nonce to be used as replay protection                         |

#### Returns

`Buffer`

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getHashForOnchain`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#gethashforonchain)

***

### getHashForTxId()

```
getHashForTxId(txId, confirmations): Buffer;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:334](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L334)

Compute the claim hash for a given transaction id

#### Parameters

| Parameter       | Type     | Description                                                   |
| --------------- | -------- | ------------------------------------------------------------- |
| `txId`          | `string` | Bitcoin transaction ID                                        |
| `confirmations` | `number` | Required number of confirmations for the swap to be claimable |

#### Returns

`Buffer`

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getHashForTxId`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#gethashfortxid)

***

### getHistoricalSwaps()

```
getHistoricalSwaps(signer, startBlockheight?): Promise<{

  latestBlockheight?: number;

  swaps: {

   [escrowHash: string]: object;

  };

}>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:474](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L474)

Returns the full history as fetched from the chain for a specific signer

#### Parameters

| Parameter           | Type     | Description |
| ------------------- | -------- | ----------- |
| `signer`            | `string` |             |
| `startBlockheight?` | `number` |             |

#### Returns

`Promise`<{ `latestBlockheight?`: `number`; `swaps`: { \[`escrowHash`: `string`]: `object`; }; }>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getHistoricalSwaps`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#gethistoricalswaps)

***

### getInitAuthorizationExpiry()

```
getInitAuthorizationExpiry(

   swapData, 

   sig, 

preFetchedData?): Promise<number>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:225](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L225)

Returns the expiry timestamp (UNIX milliseconds) of the authorization

#### Parameters

| Parameter         | Type                                                                                                                 | Description                                                 |
| ----------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| `swapData`        | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap                                                        |
| `sig`             | `SignatureData`                                                                                                      | Signature data                                              |
| `preFetchedData?` | `SolanaPreFetchVerification`                                                                                         | Optional pre-fetched data required for signature validation |

#### Returns

`Promise`<`number`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getInitAuthorizationExpiry`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getinitauthorizationexpiry)

***

### getInitFeeRate()

```
getInitFeeRate(

   offerer?, 

   claimer?, 

   token?, 

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

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:954](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L954)

Returns the fee rate for committing (initializing) a non-payIn swap

#### Parameters

| Parameter    | Type     | Description           |
| ------------ | -------- | --------------------- |
| `offerer?`   | `string` | Offerer of the swap   |
| `claimer?`   | `string` | Claimer of the swap   |
| `token?`     | `string` | Token to be swapped   |
| `claimHash?` | `string` | Optional payment hash |

#### Returns

`Promise`<`string`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getInitFeeRate`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getinitfeerate)

***

### getInitPayInFeeRate()

```
getInitPayInFeeRate(

   offerer?, 

   claimer?, 

   token?, 

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

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:941](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L941)

Returns the fee rate for committing (initializing) a payIn swap

#### Parameters

| Parameter    | Type     | Description           |
| ------------ | -------- | --------------------- |
| `offerer?`   | `string` | Offerer of the swap   |
| `claimer?`   | `string` | Claimer of the swap   |
| `token?`     | `string` | Token to be swapped   |
| `claimHash?` | `string` | Optional payment hash |

#### Returns

`Promise`<`string`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getInitPayInFeeRate`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getinitpayinfeerate)

***

### getInitSignature()

```
getInitSignature(

   signer, 

   swapData, 

   authorizationTimeout, 

   preFetchedBlockData?, 

feeRate?): Promise<SignatureData>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:211](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L211)

Generates the initialization signature

#### Parameters

| Parameter              | Type                                                                                                                 | Description                                                   |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| `signer`               | [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md)     | Signer to use for signing the message                         |
| `swapData`             | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to sign                                                  |
| `authorizationTimeout` | `number`                                                                                                             | Timeout of the authorization                                  |
| `preFetchedBlockData?` | `SolanaPreFetchData`                                                                                                 | Optional pre-fetched data required for creating the signature |
| `feeRate?`             | `string`                                                                                                             | Optional fee rate to use for the authorization                |

#### Returns

`Promise`<`SignatureData`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getInitSignature`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getinitsignature)

***

### getIntermediaryBalance()

```
getIntermediaryBalance(address, token): Promise<bigint>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:699](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L699)

Returns intermediary vault balance for a specific token.

#### Parameters

| Parameter | Type        | Description          |
| --------- | ----------- | -------------------- |
| `address` | `PublicKey` | Intermediary address |
| `token`   | `PublicKey` | Token mint           |

#### Returns

`Promise`<`bigint`>

***

### getIntermediaryData()

```
getIntermediaryData(address, token): Promise<{

  balance: bigint;

  reputation: IntermediaryReputationType;

}>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:679](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L679)

#### Parameters

| Parameter | Type     |
| --------- | -------- |
| `address` | `string` |
| `token`   | `string` |

#### Returns

`Promise`<{ `balance`: `bigint`; `reputation`: `IntermediaryReputationType`; }>

#### Inherit Doc

***

### getIntermediaryReputation()

```
getIntermediaryReputation(address, token): Promise<IntermediaryReputationType>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:689](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L689)

Returns intermediary's reputation for a given token swaps

#### Parameters

| Parameter | Type     | Description |
| --------- | -------- | ----------- |
| `address` | `string` |             |
| `token`   | `string` |             |

#### Returns

`Promise`<`IntermediaryReputationType`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getIntermediaryReputation`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getintermediaryreputation)

***

### getRawClaimFee()

```
getRawClaimFee(

   signer, 

   swapData, 

feeRate?): Promise<bigint>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:988](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L988)

Returns raw fee (not including any refunds we might get that would make the getClaimFee negative) for claiming the swap

#### Parameters

| Parameter  | Type                                                                                                                 | Description                                           |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `signer`   | `string`                                                                                                             | Signer claiming the swap                              |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to claim                                         |
| `feeRate?` | `string`                                                                                                             | Optional fee rate (fetched on-demand if not provided) |

#### Returns

`Promise`<`bigint`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getRawClaimFee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getrawclaimfee)

***

### getRawCommitFee()

```
getRawCommitFee(

   signer, 

   swapData, 

feeRate?): Promise<bigint>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:1002](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L1002)

Returns raw fee (not including any account deposits we might need) for initiating the swap

#### Parameters

| Parameter  | Type                                                                                                                 | Description                                           |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `signer`   | `string`                                                                                                             |                                                       |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to initiate                                      |
| `feeRate?` | `string`                                                                                                             | Optional fee rate (fetched on-demand if not provided) |

#### Returns

`Promise`<`bigint`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getRawCommitFee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getrawcommitfee)

***

### getRawRefundFee()

```
getRawRefundFee(

   signer, 

   swapData, 

feeRate?): Promise<bigint>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:1016](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L1016)

Returns raw fee (not including any refunds we might get that would make the getRefundFee negative) for claiming the swap

#### Parameters

| Parameter  | Type                                                                                                                 | Description                                           |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `signer`   | `string`                                                                                                             |                                                       |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to claim                                         |
| `feeRate?` | `string`                                                                                                             | Optional fee rate (fetched on-demand if not provided) |

#### Returns

`Promise`<`bigint`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getRawRefundFee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getrawrefundfee)

***

### getRefundFee()

```
getRefundFee(

   signer, 

   swapData, 

feeRate?): Promise<bigint>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:1009](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L1009)

Returns the fee in native token base units to refund the swap

#### Parameters

| Parameter  | Type                                                                                                                 | Description                                           |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `signer`   | `string`                                                                                                             |                                                       |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to refund                                        |
| `feeRate?` | `string`                                                                                                             | Optional fee rate (fetched on-demand if not provided) |

#### Returns

`Promise`<`bigint`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getRefundFee`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getrefundfee)

***

### getRefundFeeRate()

```
getRefundFeeRate(swapData): Promise<string>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:967](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L967)

Returns the fee rate for refunding a swap

#### Parameters

| Parameter  | Type                                                                                                                 | Description    |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | -------------- |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to refund |

#### Returns

`Promise`<`string`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getRefundFeeRate`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getrefundfeerate)

***

### getRefundSignature()

```
getRefundSignature(

   signer, 

   swapData, 

authorizationTimeout): Promise<SignatureData>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:239](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L239)

Generates the refund signature for a given swap allowing the offerer to refund before expiration

#### Parameters

| Parameter              | Type                                                                                                                 | Description                                                                      |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| `signer`               | [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md)     | Signer to use for signing the message (must be the same as offerer in swap data) |
| `swapData`             | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to refund                                                                   |
| `authorizationTimeout` | `number`                                                                                                             | Timeout of the provided refund authorization                                     |

#### Returns

`Promise`<`SignatureData`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`getRefundSignature`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#getrefundsignature)

***

### init()

```
init(

   signer, 

   swapData, 

   signature, 

   skipChecks?, 

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

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:868](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L868)

Signs & sends transactions for initializing a non-payIn swap (BTC -> SC)

#### Parameters

| Parameter     | Type                                                                                                                 | Description                                                                               |
| ------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `signer`      | [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md)     | Signer to use for the transaction (must match claimer in swap data)                       |
| `swapData`    | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to init                                                                              |
| `signature`   | `SignatureData`                                                                                                      | Signature data from the offerer                                                           |
| `skipChecks?` | `boolean`                                                                                                            | Whether to skip verification of the signature & checking if the swap is already committed |
| `txOptions?`  | `TransactionConfirmationOptions`                                                                                     | Transaction options                                                                       |

#### Returns

`Promise`<`string`>

#### Implementation of

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

***

### initAndClaimWithSecret()

```
initAndClaimWithSecret(

   signer, 

   swapData, 

   signature, 

   secret, 

   skipChecks?, 

txOptions?): Promise<string[]>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:891](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L891)

Signs & sends transactions for initializing and instantly (upon init confirmation) claiming the HTLC, used for BTC-LN -> SC swaps

#### Parameters

| Parameter     | Type                                                                                                                 | Description                                                                               |
| ------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `signer`      | [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md)     | Signer to use for the transaction (must match claimer in swap data)                       |
| `swapData`    | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to process                                                                           |
| `signature`   | `SignatureData`                                                                                                      | Signature data from the offerer                                                           |
| `secret`      | `string`                                                                                                             | Secret pre-image that hashes to the swap hash                                             |
| `skipChecks?` | `boolean`                                                                                                            | Whether to skip verification of the signature & checking if the swap is already committed |
| `txOptions?`  | `TransactionConfirmationOptions`                                                                                     | Transaction options                                                                       |

#### Returns

`Promise`<`string`\[]>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`initAndClaimWithSecret`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#initandclaimwithsecret)

***

### isClaimable()

```
isClaimable(signer, data): Promise<boolean>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:269](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L269)

Checks whether a swap is claimable for the signer, i.e. it is not expired yet and is committed on-chain

#### Parameters

| Parameter | Type                                                                                                                 | Description |
| --------- | -------------------------------------------------------------------------------------------------------------------- | ----------- |
| `signer`  | `string`                                                                                                             |             |
| `data`    | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) |             |

#### Returns

`Promise`<`boolean`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`isClaimable`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#isclaimable)

***

### isCommited()

```
isCommited(swapData): Promise<boolean>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:278](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L278)

Checks whether a given swap is committed on chain (initialized)

#### Parameters

| Parameter  | Type                                                                                                                 | Description |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | ----------- |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) |             |

#### Returns

`Promise`<`boolean`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`isCommited`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#iscommited)

***

### isExpired()

```
isExpired(signer, data): Promise<boolean>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:290](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L290)

Checks whether a swap is already expired, swap expires a bit sooner for the claimer & a bit later for offerer, this is used to account for possible on-chain time skew

#### Parameters

| Parameter | Type                                                                                                                 | Description                           |
| --------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| `signer`  | `string`                                                                                                             | Signer to use for checking the expiry |
| `data`    | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to check                         |

#### Returns

`Promise`<`boolean`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`isExpired`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#isexpired)

***

### isInitAuthorizationExpired()

```
isInitAuthorizationExpired(swapData, sig): Promise<boolean>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:232](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L232)

Checks whether a given init signature is already expired

#### Parameters

| Parameter  | Type                                                                                                                 | Description    |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | -------------- |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap           |
| `sig`      | `SignatureData`                                                                                                      | Signature data |

#### Returns

`Promise`<`boolean`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`isInitAuthorizationExpired`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#isinitauthorizationexpired)

***

### isRequestRefundable()

```
isRequestRefundable(signer, data): Promise<boolean>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:300](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L300)

Checks whether a given swap is refundable by us, i.e. it is already expired, we are offerer & swap is committed on-chain

#### Parameters

| Parameter | Type                                                                                                                 | Description |
| --------- | -------------------------------------------------------------------------------------------------------------------- | ----------- |
| `signer`  | `string`                                                                                                             |             |
| `data`    | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) |             |

#### Returns

`Promise`<`boolean`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`isRequestRefundable`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#isrequestrefundable)

***

### isValidDataSignature()

```
isValidDataSignature(

   data, 

   signature, 

publicKey): Promise<boolean>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:260](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L260)

Checks whether a provided data is signature is valid

#### Parameters

| Parameter   | Type     | Description              |
| ----------- | -------- | ------------------------ |
| `data`      | `Buffer` | Data to sign             |
| `signature` | `string` | Signature                |
| `publicKey` | `string` | Public key of the signer |

#### Returns

`Promise`<`boolean`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`isValidDataSignature`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#isvaliddatasignature)

***

### isValidInitAuthorization()

```
isValidInitAuthorization(

   signer, 

   swapData, 

   sig, 

   feeRate?, 

preFetchedData?): Promise<Buffer<ArrayBufferLike>>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:218](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L218)

Checks whether a signature is a valid initialization signature for a given swap

#### Parameters

| Parameter         | Type                                                                                                                 | Description                                                                  |
| ----------------- | -------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| `signer`          | `string`                                                                                                             | Address of the sender of the transaction (must be either offerer or claimer) |
| `swapData`        | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to initialize                                                           |
| `sig`             | `SignatureData`                                                                                                      | Signature data                                                               |
| `feeRate?`        | `string`                                                                                                             | Fee rate used for the authorization                                          |
| `preFetchedData?` | `SolanaPreFetchVerification`                                                                                         | Optional pre-fetched data required for signature validation                  |

#### Returns

`Promise`<`Buffer`<`ArrayBufferLike`>>

The message being signed if valid or null if invalid signature

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`isValidInitAuthorization`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#isvalidinitauthorization)

***

### isValidRefundAuthorization()

```
isValidRefundAuthorization(swapData, sig): Promise<Buffer<ArrayBufferLike>>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:246](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L246)

Checks whether a given refund signature is valid

#### Parameters

| Parameter  | Type                                                                                                                 | Description                         |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to refund                      |
| `sig`      | `SignatureData`                                                                                                      | Signature received from the claimer |

#### Returns

`Promise`<`Buffer`<`ArrayBufferLike`>>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`isValidRefundAuthorization`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#isvalidrefundauthorization)

***

### preFetchBlockDataForSignatures()

```
preFetchBlockDataForSignatures(): Promise<SolanaPreFetchData>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:204](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L204)

Pre-fetches data required for creating init signature

#### Returns

`Promise`<`SolanaPreFetchData`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`preFetchBlockDataForSignatures`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#prefetchblockdataforsignatures)

***

### preFetchForInitSignatureVerification()

```
preFetchForInitSignatureVerification(data): Promise<SolanaPreFetchVerification>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:197](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L197)

Pre-fetches data required for init signature verification

#### Parameters

| Parameter | Type                 | Description |
| --------- | -------------------- | ----------- |
| `data`    | `SolanaPreFetchData` |             |

#### Returns

`Promise`<`SolanaPreFetchVerification`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`preFetchForInitSignatureVerification`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#prefetchforinitsignatureverification)

***

### refund()

```
refund(

   signer, 

   swapData, 

   check?, 

   initAta?, 

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

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:833](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L833)

Signs & sends transactions for refunding a timed out swap

#### Parameters

| Parameter    | Type                                                                                                                 | Description                                                                                                  |
| ------------ | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `signer`     | [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md)     | Signer to use for the transaction (must match offerer in swap data)                                          |
| `swapData`   | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to refund                                                                                               |
| `check?`     | `boolean`                                                                                                            | Whether to check if the swap contract still exists on-chain                                                  |
| `initAta?`   | `boolean`                                                                                                            | Whether to initialize a token account if it doesn't exist (applies to e.g. Solana, with token specific ATAs) |
| `txOptions?` | `TransactionConfirmationOptions`                                                                                     | Transaction options                                                                                          |

#### Returns

`Promise`<`string`>

#### Implementation of

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

***

### refundWithAuthorization()

```
refundWithAuthorization(

   signer, 

   swapData, 

   signature, 

   check?, 

   initAta?, 

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

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:850](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L850)

Signs & sends transactions for refunding a swap with a valid refund signature from the claimer

#### Parameters

| Parameter    | Type                                                                                                                 | Description                                                                                                  |
| ------------ | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `signer`     | [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md)     | Signer to use for the transaction (must match offerer in swap data)                                          |
| `swapData`   | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to refund                                                                                               |
| `signature`  | `SignatureData`                                                                                                      | Refund signature received from the claimer                                                                   |
| `check?`     | `boolean`                                                                                                            | Whether to check if the swap contract still exists on-chain                                                  |
| `initAta?`   | `boolean`                                                                                                            | Whether to initialize a token account if it doesn't exist (applies to e.g. Solana, with token specific ATAs) |
| `txOptions?` | `TransactionConfirmationOptions`                                                                                     | Transaction options                                                                                          |

#### Returns

`Promise`<`string`>

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`refundWithAuthorization`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#refundwithauthorization)

***

### start()

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

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:174](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L174)

Initializes the swap contract

#### Returns

`Promise`<`void`>

#### Implementation of

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

***

### txsClaimWithSecret()

```
txsClaimWithSecret(

   signer, 

   swapData, 

   secret, 

   checkExpiry?, 

   initAta?, 

   feeRate?, 

skipAtaCheck?): Promise<SolanaTx[]>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:708](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L708)

Returns the unsigned transactions required for claiming an HTLC swap

#### Parameters

| Parameter       | Type                                                                                                                         | Description                                                                                                  |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `signer`        | `string` \| [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md) | Signer for which the transaction should be created (doesn't need to match the claimer)                       |
| `swapData`      | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md)         | Swap to claim                                                                                                |
| `secret`        | `string`                                                                                                                     | Secret pre-image that hashes to the swap hash                                                                |
| `checkExpiry?`  | `boolean`                                                                                                                    | Whether to check expiration of the swap before returning the transactions                                    |
| `initAta?`      | `boolean`                                                                                                                    | Whether to initialize a token account if it doesn't exist (applies to e.g. Solana, with token specific ATAs) |
| `feeRate?`      | `string`                                                                                                                     | Fee rate to use for the transactions                                                                         |
| `skipAtaCheck?` | `boolean`                                                                                                                    | Whether to skip checking if token account exists                                                             |

#### Returns

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

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`txsClaimWithSecret`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#txsclaimwithsecret)

***

### txsClaimWithTxData()

```
txsClaimWithTxData(

   signer, 

   swapData, 

   tx, 

   requiredConfirmations, 

   vout, 

   commitedHeader?, 

   synchronizer?, 

   initAta?, 

feeRate?): Promise<SolanaTx[]>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:723](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L723)

Returns the unsigned transactions required for claiming an on-chain PTLC (proof-time locked contract) swap

#### Parameters

| Parameter                | Type                                                                                                                                             | Description                                                                                                  |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `signer`                 | `string` \| [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md)                     | Signer for which the transaction should be created (doesn't need to match the claimer)                       |
| `swapData`               | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md)                             | Swap to claim                                                                                                |
| `tx`                     | { `blockhash`: `string`; `confirmations`: `number`; `height`: `number`; `hex`: `string`; `txid`: `string`; }                                     | Bitcoin transaction containing the required output                                                           |
| `tx.blockhash`           | `string`                                                                                                                                         | -                                                                                                            |
| `tx.confirmations`       | `number`                                                                                                                                         | -                                                                                                            |
| `tx.height`              | `number`                                                                                                                                         | -                                                                                                            |
| `tx.hex?`                | `string`                                                                                                                                         | -                                                                                                            |
| `tx.txid?`               | `string`                                                                                                                                         | -                                                                                                            |
| `requiredConfirmations?` | `number`                                                                                                                                         | Required confirmations for the escrow to be claimed                                                          |
| `vout?`                  | `number`                                                                                                                                         | Bitcoin tx's output index of the required output                                                             |
| `commitedHeader?`        | [`SolanaBtcStoredHeader`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaBtcStoredHeader.md)               | Optional already retrieved stored header to use for proving                                                  |
| `synchronizer?`          | `RelaySynchronizer`<`any`, [`SolanaTx`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/type-aliases/SolanaTx.md), `any`> | Optiona synchronizer to be used if BTC relay contract is not synced up to the required blockheight           |
| `initAta?`               | `boolean`                                                                                                                                        | Whether to initialize a token account if it doesn't exist (applies to e.g. Solana, with token specific ATAs) |
| `feeRate?`               | `string`                                                                                                                                         | Fee rate to use for the transactions                                                                         |

#### Returns

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

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`txsClaimWithTxData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#txsclaimwithtxdata)

***

### txsDeposit()

```
txsDeposit(

   signer, 

   token, 

   amount, 

feeRate?): Promise<SolanaTx[]>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:781](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L781)

Returns transactions required for signer to deposit funds to the trading LP vault

#### Parameters

| Parameter  | Type     | Description                                                                      |
| ---------- | -------- | -------------------------------------------------------------------------------- |
| `signer`   | `string` | Owner of the funds                                                               |
| `token`    | `string` | Token to deposit                                                                 |
| `amount`   | `bigint` | Amount of the token to deposit                                                   |
| `feeRate?` | `string` | Optional fee rate to use for the transaction (fetched on-demand if not provided) |

#### Returns

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

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`txsDeposit`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#txsdeposit)

***

### txsInit()

```
txsInit(

   sender, 

   swapData, 

   sig, 

   skipChecks?, 

feeRate?): Promise<SolanaTx[]>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:761](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L761)

Returns the unsigned transactions required for initializing a non-payIn swap (BTC -> SC)

#### Parameters

| Parameter     | Type                                                                                                                 | Description                                                                               |
| ------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `sender`      | `string`                                                                                                             | Transaction sender address, must be either offerer or claimer                             |
| `swapData`    | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to init                                                                              |
| `sig`         | `SignatureData`                                                                                                      | Signature data from the offerer                                                           |
| `skipChecks?` | `boolean`                                                                                                            | Whether to skip verification of the signature & checking if the swap is already committed |
| `feeRate?`    | `string`                                                                                                             | Fee rate to use for the transaction                                                       |

#### Returns

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

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`txsInit`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#txsinit)

***

### txsRefund()

```
txsRefund(

   signer, 

   swapData, 

   check?, 

   initAta?, 

feeRate?): Promise<SolanaTx[]>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:745](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L745)

Returns the transactions for refunding a timed out swap

#### Parameters

| Parameter  | Type                                                                                                                 | Description                                                                                                  |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `signer`   | `string`                                                                                                             | Signer of the refund transaction                                                                             |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to refund                                                                                               |
| `check?`   | `boolean`                                                                                                            | Whether to check if the swap contract still exists on-chain                                                  |
| `initAta?` | `boolean`                                                                                                            | Whether to initialize a token account if it doesn't exist (applies to e.g. Solana, with token specific ATAs) |
| `feeRate?` | `string`                                                                                                             | Fee rate to use for the transactions                                                                         |

#### Returns

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

#### Implementation of

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

***

### txsRefundWithAuthorization()

```
txsRefundWithAuthorization(

   signer, 

   swapData, 

   sig, 

   check?, 

   initAta?, 

feeRate?): Promise<SolanaTx[]>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:753](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L753)

Returns the transactions for refunding a swap with a valid refund signature from the claimer

#### Parameters

| Parameter  | Type                                                                                                                 | Description                                                                                                  |
| ---------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `signer`   | `string`                                                                                                             | Signer of the refund transaction                                                                             |
| `swapData` | [`SolanaSwapData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSwapData.md) | Swap to refund                                                                                               |
| `sig`      | `SignatureData`                                                                                                      | Refund signature received from the claimer                                                                   |
| `check?`   | `boolean`                                                                                                            | Whether to check if the swap contract still exists on-chain                                                  |
| `initAta?` | `boolean`                                                                                                            | Whether to initialize a token account if it doesn't exist (applies to e.g. Solana, with token specific ATAs) |
| `feeRate?` | `string`                                                                                                             | Fee rate to use for the transactions                                                                         |

#### Returns

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

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`txsRefundWithAuthorization`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#txsrefundwithauthorization)

***

### txsWithdraw()

```
txsWithdraw(

   signer, 

   token, 

   amount, 

feeRate?): Promise<SolanaTx[]>;
```

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:774](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L774)

Returns transactions required for signer to withdraw funds from the trading LP vault

#### Parameters

| Parameter  | Type     | Description                                                                      |
| ---------- | -------- | -------------------------------------------------------------------------------- |
| `signer`   | `string` | Owner of the funds                                                               |
| `token`    | `string` | Token to withdraw                                                                |
| `amount`   | `bigint` | Amount of the token to withdraw                                                  |
| `feeRate?` | `string` | Optional fee rate to use for the transaction (fetched on-demand if not provided) |

#### Returns

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

#### Implementation of

[`SwapContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md).[`txsWithdraw`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md#txswithdraw)

***

### withdraw()

```
withdraw(

   signer, 

   token, 

   amount, 

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

Defined in: [atomiq-chain-solana/src/solana/swaps/SolanaSwapProgram.ts:911](https://github.com/atomiqlabs/atomiq-chain-solana/blob/4094a4a5b53d0864511200476446f3034a3c7c10/src/solana/swaps/SolanaSwapProgram.ts#L911)

Withdraws funds from the trading LP vault

#### Parameters

| Parameter    | Type                                                                                                             | Description                        |
| ------------ | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| `signer`     | [`SolanaSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/classes/SolanaSigner.md) | Signer to sign the withdrawal with |
| `token`      | `string`                                                                                                         | Token to withdraw                  |
| `amount`     | `bigint`                                                                                                         | Amount of the token to withdraw    |
| `txOptions?` | `TransactionConfirmationOptions`                                                                                 | Transaction options                |

#### Returns

`Promise`<`string`>

#### Implementation of

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