# SpvWithdrawalTransactionData

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:20](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L20)

Represents the data of a single SPV vault (UTXO-controlled) vault withdrawal

## Extended by

* [`StarknetSpvWithdrawalData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-starknet/src/classes/StarknetSpvWithdrawalData.md)
* [`EVMSpvWithdrawalData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/classes/EVMSpvWithdrawalData.md)

## Implements

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

## Constructors

### Constructor

```
new SpvWithdrawalTransactionData(btcTx): SpvWithdrawalTransactionData;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:69](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L69)

Parses and creates a withdrawal data from the bitcoin transaction

#### Parameters

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

#### Returns

`SpvWithdrawalTransactionData`

#### Throws

If the bitcoin transaction has invalid formatting

## Properties

### btcTx

```
readonly btcTx: BtcTx;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:62](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L62)

A bitcoin transaction which contains this vault withdrawal data

***

### callerFeeRate

```
readonly callerFeeRate: bigint;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:52](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L52)

***

### deserializers

```
static deserializers: object = {};
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:25](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L25)

A mapping of deserializers for different spv vault withdrawal data types coming from different smart chain implementations

#### Index Signature

```
[type: string]: (serialized) => any
```

***

### executionExpiry

```
readonly executionExpiry: number;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:57](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L57)

***

### executionFeeRate

```
readonly executionFeeRate: bigint;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:53](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L53)

***

### executionHash?

```
readonly optional executionHash: string;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:56](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L56)

***

### frontingFeeRate

```
readonly frontingFeeRate: bigint;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:54](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L54)

***

### rawAmounts

```
readonly rawAmounts: bigint[];
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:50](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L50)

***

### recipient

```
readonly recipient: string;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:49](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L49)

## Methods

### deserialize()

```
static deserialize<T>(data): T;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:34](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L34)

Deserializer parsing the chain-specific spv vault withdrawal data from a JSON-compatible object representation

#### Type Parameters

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

#### Parameters

| Parameter | Type  | Description |
| --------- | ----- | ----------- |
| `data`    | `any` |             |

#### Returns

`T`

***

### getCallerFee()

```
getCallerFee(): bigint[];
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:164](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L164)

Returns the fee paid out to the caller which submits the withdrawal transaction data on the smart chain, the fee is paid out from all the respective tokens being withdrawn from the vault (NOTE: This returns raw token amounts, which must be scaled by their respective vault configured multiplier to represent the actual amount of tokens)

#### Returns

`bigint`\[]

***

### getCreatedVaultUtxo()

```
getCreatedVaultUtxo(): string;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:249](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L249)

Gets the new vault ownership UTXO created by this transaction

#### Returns

`string`

***

### getExecutionData()

```
getExecutionData(): ExecutionData;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:223](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L223)

Returns the execution action to be scheduled via the execution contract (swap+) or `null` if none specified

#### Returns

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

***

### getExecutionFee()

```
getExecutionFee(): bigint[];
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:183](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L183)

Returns the fee that is transferred to the execution contract if swap+ execution action is assigned, (NOTE: This returns raw token amounts, which must be scaled by their respective vault configured multiplier to represent the actual amount of tokens)

#### Returns

`bigint`\[]

***

### getFrontingFee()

```
getFrontingFee(): bigint[];
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:174](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L174)

Returns the fee paid out to the fronter which fronts the actual withdrawal on the smart chain, the fee is paid out from all the respective tokens being withdrawn from the vault (NOTE: This returns raw token amounts, which must be scaled by their respective vault configured multiplier to represent the actual amount of tokens)

#### Returns

`bigint`\[]

***

### getFrontingId()

```
abstract getFrontingId(): string;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:147](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L147)

Computes a unique withdrawal fronting ID that is to be used when fronting the withdrawal

#### Returns

`string`

***

### getNewVaultBtcAmount()

```
getNewVaultBtcAmount(): number;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:263](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L263)

Gets the output btc amount (in satoshis) assigned to the new vault ownership UTXO

#### Returns

`number`

***

### getNewVaultScript()

```
getNewVaultScript(): Buffer;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:256](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L256)

Gets the output locking script used for the new vault ownership UTXO

#### Returns

`Buffer`

***

### getOutputWithoutFees()

```
getOutputWithoutFees(): bigint[];
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:154](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L154)

Returns the amounts of tokens that the recipient is gonna receive (NOTE: This returns raw token amounts, which must be scaled by their respective vault configured multiplier to represent the actual amount of tokens)

#### Returns

`bigint`\[]

***

### getRecipient()

```
getRecipient(): string;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:133](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L133)

Gets the recipient of the funds for this withdrawal

#### Returns

`string`

***

### getSpentVaultUtxo()

```
getSpentVaultUtxo(): string;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:241](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L241)

Gets the vault ownership UTXO that the bitcoin transaction spends

#### Returns

`string`

***

### getTotalOutput()

```
getTotalOutput(): bigint[];
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:194](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L194)

Returns the total amount of tokens withdrawn from the vault (including all the fees) (NOTE: This returns raw token amounts, which must be scaled by their respective vault configured multiplier to represent the actual amount of tokens)

#### Returns

`bigint`\[]

#### Throws

In case the amounts overflow

***

### getTxId()

```
getTxId(): string;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:234](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L234)

Gets the transaction ID of the bitcoin transaction authorizing the withdrawal

#### Returns

`string`

***

### isRecipient()

```
abstract isRecipient(address): boolean;
```

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:142](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L142)

Checks if the provided recipient is the actual recipient of the funds in this withdrawal

#### Parameters

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

#### Returns

`boolean`

***

### serialize()

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

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:126](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L126)

Serializes the object to a JSON-compatible object (i.e. no bigints, functions, etc.)

#### Returns

`any`

#### Implementation of

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

***

### fromOpReturnData()

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

Defined in: [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:47](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L47)

Parses the data from the OP\_RETURN script for a specific underlying chain

#### Parameters

| Parameter | Type     | Description |
| --------- | -------- | ----------- |
| `data`    | `Buffer` |             |

#### Returns

`object`

| Name             | Type        | Defined in                                                                                                                                                                                               |
| ---------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `executionHash?` | `string`    | [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:47](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L47) |
| `rawAmounts`     | `bigint`\[] | [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:47](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L47) |
| `recipient`      | `string`    | [atomiq-base/src/spv\_swap/SpvWithdrawalTransactionData.ts:47](https://github.com/atomiqlabs/atomiq-base/blob/df344bedbab9ab3de863e3c2d9246e90bd861d04/src/spv_swap/SpvWithdrawalTransactionData.ts#L47) |
