# EVMSpvVaultContract\<ChainId>

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:66](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L66)

EVM SPV vault (UTXO-controlled vault) contract representation.

## Extends

* `EVMContractBase`<`SpvVaultManager`>

## Type Parameters

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

## Implements

* [`SpvVaultContract`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SpvVaultContract.md)<[`EVMTx`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/type-aliases/EVMTx.md), [`EVMSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSigner.md), `ChainId`, [`EVMSpvWithdrawalData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvWithdrawalData.md), [`EVMSpvVaultData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvVaultData.md)>

## Constructors

### Constructor

```
new EVMSpvVaultContract<ChainId>(

   chainInterface, 

   btcRelay, 

   bitcoinRpc, 

   contractAddress, 

contractDeploymentHeight?): EVMSpvVaultContract<ChainId>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:101](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L101)

#### Parameters

| Parameter                   | Type                                                                                                                               |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `chainInterface`            | [`EVMChainInterface`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMChainInterface.md)<`ChainId`> |
| `btcRelay`                  | [`EVMBtcRelay`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMBtcRelay.md)<`any`>                 |
| `bitcoinRpc`                | [`BitcoinRpc`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpc.md)<`any`>                      |
| `contractAddress`           | `string`                                                                                                                           |
| `contractDeploymentHeight?` | `number`                                                                                                                           |

#### Returns

`EVMSpvVaultContract`<`ChainId`>

#### Overrides

```
EVMContractBase<SpvVaultManager>.constructor
```

## Properties

### chainId

```
readonly chainId: ChainId;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:93](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L93)

Chain identifier string

#### Implementation of

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

***

### claimTimeout

```
readonly claimTimeout: number = 180;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:94](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L94)

***

### contract

```
readonly contract: SpvVaultManager;
```

Defined in: [atomiq-chain-evm/src/evm/contract/EVMContractBase.ts:33](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/contract/EVMContractBase.ts#L33)

#### Inherited from

```
EVMContractBase.contract
```

***

### Chain

```
protected readonly Chain: EVMChainInterface<any>;
```

Defined in: [atomiq-chain-evm/src/evm/contract/EVMContractBase.ts:39](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/contract/EVMContractBase.ts#L39)

#### Inherited from

```
EVMContractBase.Chain
```

## Methods

### checkWithdrawalTx()

```
checkWithdrawalTx(tx): Promise<void>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:193](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L193)

Checks if given withdrawal tx is valid and correctly parses on-chain, throws error when there is any issue with the validation

#### Parameters

| Parameter | Type                                                                                                                                    | Description |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| `tx`      | [`SpvWithdrawalTransactionData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/SpvWithdrawalTransactionData.md) |             |

#### Returns

`Promise`<`void`>

#### Implementation of

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

***

### claim()

```
claim(

   signer, 

   vault, 

   txs, 

   synchronizer?, 

   initAta?, 

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

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:682](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L682)

Signs & sends transactions for claiming the funds from a specific vault

#### Parameters

| Parameter       | Type                                                                                                                | Description                                                                                                  |
| --------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `signer`        | [`EVMSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSigner.md)             | Signer to use for the transaction                                                                            |
| `vault`         | [`EVMSpvVaultData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvVaultData.md) | Vault to claim from                                                                                          |
| `txs`           | `object`\[]                                                                                                         |                                                                                                              |
| `synchronizer?` | `RelaySynchronizer`<`any`, `any`, `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

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

***

### createVaultData()

```
createVaultData(

   owner, 

   vaultId, 

   utxo, 

   confirmations, 

tokenData): Promise<EVMSpvVaultData>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:201](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L201)

Creates vault data for a new vault

#### Parameters

| Parameter       | Type                   | Description                                                                          |
| --------------- | ---------------------- | ------------------------------------------------------------------------------------ |
| `owner`         | `string`               | Vault owner                                                                          |
| `vaultId`       | `bigint`               | Vault ID                                                                             |
| `utxo`          | `string`               | Utxo on which to assign the vault initially                                          |
| `confirmations` | `number`               | Required number of bitcoin confirmations to be able to withdraw funds from the vault |
| `tokenData`     | `SpvVaultTokenData`\[] | Data about the tokens in the vault                                                   |

#### Returns

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

#### Implementation of

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

***

### deposit()

```
deposit(

   signer, 

   vault, 

   rawAmounts, 

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

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:691](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L691)

Signs & sends transactions for depositing funds to a specific spv vault

#### Parameters

| Parameter    | Type                                                                                                                | Description                                    |
| ------------ | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| `signer`     | [`EVMSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSigner.md)             | Signer to use for the transaction (can be any) |
| `vault`      | [`EVMSpvVaultData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvVaultData.md) | Vault to deposit to                            |
| `rawAmounts` | `bigint`\[]                                                                                                         | Raw amounts to deposit (these are unscaled)    |
| `txOptions?` | `TransactionConfirmationOptions`                                                                                    | Transaction options                            |

#### Returns

`Promise`<`string`>

#### Implementation of

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

***

### fromOpReturnData()

```
static fromOpReturnData(data): object;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:613](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L613)

Parses withdrawal params from OP\_RETURN data.

#### Parameters

| Parameter | Type     | Description                                                   |
| --------- | -------- | ------------------------------------------------------------- |
| `data`    | `Buffer` | Data as specified in the OP\_RETURN output of the transaction |

#### Returns

`object`

| Name             | Type        | Defined in                                                                                                                                                                                                 |
| ---------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `executionHash?` | `string`    | [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:613](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L613) |
| `rawAmounts`     | `bigint`\[] | [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:613](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L613) |
| `recipient`      | `string`    | [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:613](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L613) |

***

### fromOpReturnData()

```
fromOpReturnData(data): object;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:604](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L604)

Parses withdrawal params from OP\_RETURN data

#### Parameters

| Parameter | Type     | Description                                                   |
| --------- | -------- | ------------------------------------------------------------- |
| `data`    | `Buffer` | data as specified in the OP\_RETURN output of the transaction |

#### Returns

`object`

| Name             | Type        | Defined in                                                                                                                                                                                                 |
| ---------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `executionHash?` | `string`    | [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:604](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L604) |
| `rawAmounts`     | `bigint`\[] | [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:604](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L604) |
| `recipient`      | `string`    | [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:604](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L604) |

#### Implementation of

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

***

### frontLiquidity()

```
frontLiquidity(

   signer, 

   vault, 

   realWithdrawalTx, 

   withdrawSequence, 

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

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:700](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L700)

Signs & sends transactions for fronting liquidity for a specific withdrawal btc transaction

#### Parameters

| Parameter          | Type                                                                                                                          | Description                                                                                                                                                                         |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `signer`           | [`EVMSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSigner.md)                       | Signer to use for the transaction (payer of the fronted liquidity)                                                                                                                  |
| `vault`            | [`EVMSpvVaultData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvVaultData.md)           | Vault to deposit to                                                                                                                                                                 |
| `realWithdrawalTx` | [`EVMSpvWithdrawalData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvWithdrawalData.md) | Real withdrawal transaction data                                                                                                                                                    |
| `withdrawSequence` | `number`                                                                                                                      | Sequence number of the withdrawal that is being fronted, this used as race condition prevention, such that fronting will not happen if the withdrawal tx is already used in claim() |
| `txOptions?`       | `TransactionConfirmationOptions`                                                                                              | Transaction options                                                                                                                                                                 |

#### Returns

`Promise`<`string`>

#### Implementation of

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

***

### getAllVaults()

```
getAllVaults(owner?): Promise<EVMSpvVaultData[]>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:353](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L353)

Returns all currently opened vaults NOTE: This will take a long time, since the implementation will have to go through all the prior events

#### Parameters

| Parameter | Type     |
| --------- | -------- |
| `owner?`  | `string` |

#### Returns

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

#### Implementation of

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

***

### getClaimFee()

```
getClaimFee(

   signer, 

   vault?, 

   withdrawalData?, 

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

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:926](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L926)

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

#### Parameters

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

#### Returns

`Promise`<`bigint`>

#### Implementation of

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

***

### getClaimGas()

```
getClaimGas(

   signer, 

   vault?, 

   data?): number;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:878](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L878)

Returns an estimated gas amount for a claim transaction.

#### Parameters

| Parameter | Type                                                                                                                          | Description                                 |
| --------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| `signer`  | `string`                                                                                                                      | Signer address executing the claim          |
| `vault?`  | [`EVMSpvVaultData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvVaultData.md)           | Vault data used to determine transfer paths |
| `data?`   | [`EVMSpvWithdrawalData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvWithdrawalData.md) | Parsed withdrawal data                      |

#### Returns

`number`

***

### getFronterAddress()

```
getFronterAddress(

   owner, 

   vaultId, 

withdrawal): Promise<string>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:236](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L236)

Returns the party which currently fronted the withdrawal transaction

#### Parameters

| Parameter    | Type                                                                                                                          | Description                                      |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| `owner`      | `string`                                                                                                                      | Owner of the vault                               |
| `vaultId`    | `bigint`                                                                                                                      | Vault ID                                         |
| `withdrawal` | [`EVMSpvWithdrawalData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvWithdrawalData.md) | Withdrawal transaction to check the fronting for |

#### Returns

`Promise`<`string`>

#### Implementation of

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

***

### getFronterAddresses()

```
getFronterAddresses(withdrawals): Promise<{

[btcTxId: string]: string;

}>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:245](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L245)

Returns the parties which currently fronted the withdrawal transactions

#### Parameters

| Parameter     | Type        | Description          |
| ------------- | ----------- | -------------------- |
| `withdrawals` | `object`\[] | withdrawals to query |

#### Returns

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

#### Implementation of

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

***

### getFrontFee()

```
getFrontFee(

   signer, 

   vault?, 

   withdrawalData?, 

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

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:934](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L934)

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

#### Parameters

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

#### Returns

`Promise`<`bigint`>

#### Implementation of

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

***

### getFrontGas()

```
getFrontGas(

   signer, 

   vault, 

   data?): number;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:907](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L907)

Returns an estimated gas amount for a front-liquidity transaction.

#### Parameters

| Parameter | Type                                                                                                                          | Description                                 |
| --------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| `signer`  | `string`                                                                                                                      | Signer address executing the front action   |
| `vault`   | [`EVMSpvVaultData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvVaultData.md)           | Vault data used to determine transfer paths |
| `data?`   | [`EVMSpvWithdrawalData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvWithdrawalData.md) | Parsed withdrawal data                      |

#### Returns

`number`

***

### getHistoricalWithdrawalStates()

```
getHistoricalWithdrawalStates(recipient, startBlockheight?): Promise<{

  latestBlockheight?: number;

  withdrawals: {

   [btcTxId: string]: SpvWithdrawalFrontedState | SpvWithdrawalClaimedState;

  };

}>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:569](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L569)

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

#### Parameters

| Parameter           | Type     | Description                          |
| ------------------- | -------- | ------------------------------------ |
| `recipient`         | `string` | A recipient to check the history for |
| `startBlockheight?` | `number` |                                      |

#### Returns

`Promise`<{ `latestBlockheight?`: `number`; `withdrawals`: { \[`btcTxId`: `string`]: `SpvWithdrawalFrontedState` | `SpvWithdrawalClaimedState`; }; }>

#### Implementation of

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

***

### getMultipleVaultData()

```
getMultipleVaultData(vaults): Promise<{

[owner: string]: object;

}>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:301](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L301)

Returns current vault data for multiple vaults

#### Parameters

| Parameter | Type        | Description         |
| --------- | ----------- | ------------------- |
| `vaults`  | `object`\[] | Vault data to query |

#### Returns

`Promise`<{ \[`owner`: `string`]: `object`; }>

#### Implementation of

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

***

### getVaultData()

```
getVaultData(owner, vaultId): Promise<EVMSpvVaultData>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:269](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L269)

Returns current vault data

#### Parameters

| Parameter | Type     | Description        |
| --------- | -------- | ------------------ |
| `owner`   | `string` | Owner of the vault |
| `vaultId` | `bigint` | Vault ID           |

#### Returns

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

#### Implementation of

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

***

### getVaultLatestUtxo()

```
getVaultLatestUtxo(owner, vaultId): Promise<string>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:322](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L322)

Returns the latest utxo of a vault (or null if vault closed or not found)

#### Parameters

| Parameter | Type     | Description        |
| --------- | -------- | ------------------ |
| `owner`   | `string` | Owner of the vault |
| `vaultId` | `bigint` | Vault ID           |

#### Returns

`Promise`<`string`>

#### Implementation of

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

***

### getVaultLatestUtxos()

```
getVaultLatestUtxos(vaults): Promise<{

[owner: string]: object;

}>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:332](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L332)

Returns the latest utxos of for multiple vaults (or null if vault closed or not found)

#### Parameters

| Parameter | Type        | Description         |
| --------- | ----------- | ------------------- |
| `vaults`  | `object`\[] | Vault data to query |

#### Returns

`Promise`<{ \[`owner`: `string`]: `object`; }>

#### Implementation of

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

***

### getWithdrawalData()

```
getWithdrawalData(btcTx): Promise<EVMSpvWithdrawalData>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:596](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L596)

Parses withdrawal data from the parsed bitcoin transaction

#### Parameters

| Parameter | Type    | Description |
| --------- | ------- | ----------- |
| `btcTx`   | `BtcTx` |             |

#### Returns

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

#### Implementation of

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

***

### getWithdrawalState()

```
getWithdrawalState(withdrawalTx, scStartHeight?): Promise<SpvWithdrawalState>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:452](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L452)

Returns current state of the withdrawal, optionally only check withdrawals from the provided block height

#### Parameters

| Parameter        | Type                                                                                                                          | Description |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------- |
| `withdrawalTx`   | [`EVMSpvWithdrawalData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvWithdrawalData.md) |             |
| `scStartHeight?` | `number`                                                                                                                      |             |

#### Returns

`Promise`<`SpvWithdrawalState`>

#### Implementation of

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

***

### getWithdrawalStates()

```
getWithdrawalStates(withdrawalTxs): Promise<{

[btcTxId: string]: SpvWithdrawalState;

}>;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:492](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L492)

Returns current state of the withdrawals, optionally only check withdrawals from the provided block height

#### Parameters

| Parameter       | Type        | Description                                                            |
| --------------- | ----------- | ---------------------------------------------------------------------- |
| `withdrawalTxs` | `object`\[] | Object with the withdrawal tx to check + an optional start blockheight |

#### Returns

`Promise`<{ \[`btcTxId`: `string`]: `SpvWithdrawalState`; }>

#### Implementation of

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

***

### open()

```
open(

   signer, 

   vault, 

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

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:709](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L709)

Signs & sends transactions for opening a specific spv vault

#### Parameters

| Parameter    | Type                                                                                                                | Description                                                   |
| ------------ | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| `signer`     | [`EVMSigner`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSigner.md)             | Signer to use for the transaction (must match owner in vault) |
| `vault`      | [`EVMSpvVaultData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvVaultData.md) | Vault to init                                                 |
| `txOptions?` | `TransactionConfirmationOptions`                                                                                    | Transaction options                                           |

#### Returns

`Promise`<`string`>

#### Implementation of

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

***

### toOpReturnData()

```
static toOpReturnData(

   recipient, 

   rawAmounts, 

   executionHash?): Buffer;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:653](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L653)

Serializes withdrawal params to OP\_RETURN data.

#### Parameters

| Parameter        | Type        | Description                                       |
| ---------------- | ----------- | ------------------------------------------------- |
| `recipient`      | `string`    | Recipient of the withdrawn tokens                 |
| `rawAmounts`     | `bigint`\[] | Raw amount of tokens to withdraw                  |
| `executionHash?` | `string`    | Optional execution hash of the actions to execute |

#### Returns

`Buffer`

***

### toOpReturnData()

```
toOpReturnData(

   recipient, 

   rawAmounts, 

   executionHash?): Buffer;
```

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:642](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L642)

Serializes the withdrawal params to the OP\_RETURN data

#### Parameters

| Parameter        | Type        | Description                                       |
| ---------------- | ----------- | ------------------------------------------------- |
| `recipient`      | `string`    | Recipient of the withdrawn tokens                 |
| `rawAmounts`     | `bigint`\[] | Raw amount of tokens to withdraw                  |
| `executionHash?` | `string`    | Optional execution hash of the actions to execute |

#### Returns

`Buffer`

#### Implementation of

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

***

### txsClaim()

```
txsClaim(

   signer, 

   vault, 

   txs, 

   synchronizer?, 

   initAta?, 

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

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:719](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L719)

Returns the unsigned transactions for claiming the funds from a specific vault

#### Parameters

| Parameter       | Type                                                                                                                | Description                                                                                                  |
| --------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `signer`        | `string`                                                                                                            | Signer to use for the transaction                                                                            |
| `vault`         | [`EVMSpvVaultData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvVaultData.md) | Vault to claim from                                                                                          |
| `txs`           | `object`\[]                                                                                                         |                                                                                                              |
| `synchronizer?` | `RelaySynchronizer`<`any`, `any`, `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 transaction                                                                          |

#### Returns

`Promise`<`TransactionRequest`\[]>

#### Implementation of

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

***

### txsDeposit()

```
txsDeposit(

   signer, 

   vault, 

   rawAmounts, 

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

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:773](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L773)

Returns the unsigned transactions for depositing funds to a specific spv vault

#### Parameters

| Parameter    | Type                                                                                                                | Description                                    |
| ------------ | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| `signer`     | `string`                                                                                                            | Signer to use for the transaction (can be any) |
| `vault`      | [`EVMSpvVaultData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvVaultData.md) | Vault to deposit to                            |
| `rawAmounts` | `bigint`\[]                                                                                                         | Raw amounts to deposit (these are unscaled)    |
| `feeRate?`   | `string`                                                                                                            | Fee rate to use for the transaction            |

#### Returns

`Promise`<`TransactionRequest`\[]>

#### Implementation of

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

***

### txsFrontLiquidity()

```
txsFrontLiquidity(

   signer, 

   vault, 

   realWithdrawalTx, 

   withdrawSequence, 

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

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:815](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L815)

Returns the unsigned transactions for fronting liquidity for a specific withdrawal btc transaction

#### Parameters

| Parameter          | Type                                                                                                                          | Description                                                                                                                                                                         |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `signer`           | `string`                                                                                                                      | Signer to use for the transaction (payer of the fronted liquidity)                                                                                                                  |
| `vault`            | [`EVMSpvVaultData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvVaultData.md)           | Vault to deposit to                                                                                                                                                                 |
| `realWithdrawalTx` | [`EVMSpvWithdrawalData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvWithdrawalData.md) | Real withdrawal transaction data                                                                                                                                                    |
| `withdrawSequence` | `number`                                                                                                                      | Sequence number of the withdrawal that is being fronted, this used as race condition prevention, such that fronting will not happen if the withdrawal tx is already used in claim() |
| `feeRate?`         | `string`                                                                                                                      | Fee rate to use for the transaction                                                                                                                                                 |

#### Returns

`Promise`<`TransactionRequest`\[]>

#### Implementation of

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

***

### txsOpen()

```
txsOpen(

   signer, 

   vault, 

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

Defined in: [atomiq-chain-evm/src/evm/spv\_swap/EVMSpvVaultContract.ts:859](https://github.com/atomiqlabs/atomiq-chain-evm/blob/98ca6f16fbfb37e521f8c27b4f942642fe00c2ee/src/evm/spv_swap/EVMSpvVaultContract.ts#L859)

Returns the unsigned transactions for opening a specific spv vault

#### Parameters

| Parameter  | Type                                                                                                                | Description                                                   |
| ---------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| `signer`   | `string`                                                                                                            | Signer to use for the transaction (must match owner in vault) |
| `vault`    | [`EVMSpvVaultData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvVaultData.md) | Vault to init                                                 |
| `feeRate?` | `string`                                                                                                            | Fee rate to use for the transaction                           |

#### Returns

`Promise`<`TransactionRequest`\[]>

#### Implementation of

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