Skip to main content

SpvWithdrawalTransactionData

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:20

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

Extended by

Implements

Constructors

Constructor

new SpvWithdrawalTransactionData(btcTx): SpvWithdrawalTransactionData;

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:69

Parses and creates a withdrawal data from the bitcoin transaction

Parameters

ParameterType
btcTxBtcTx

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

A bitcoin transaction which contains this vault withdrawal data


callerFeeRate

readonly callerFeeRate: bigint;

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:52


deserializers

static deserializers: object = {};

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:25

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


executionFeeRate

readonly executionFeeRate: bigint;

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:53


executionHash?

readonly optional executionHash: string;

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:56


frontingFeeRate

readonly frontingFeeRate: bigint;

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:54


rawAmounts

readonly rawAmounts: bigint[];

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:50


recipient

readonly recipient: string;

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:49

Methods

deserialize()

static deserialize<T>(data): T;

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:34

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

Type Parameters

Type Parameter
T extends SpvWithdrawalTransactionData

Parameters

ParameterTypeDescription
dataany

Returns

T


getCallerFee()

getCallerFee(): bigint[];

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:164

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

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

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

Returns

ExecutionData


getExecutionFee()

getExecutionFee(): bigint[];

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:183

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

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

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

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

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

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

Gets the recipient of the funds for this withdrawal

Returns

string


getSpentVaultUtxo()

getSpentVaultUtxo(): string;

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:241

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

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

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

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

Parameters

ParameterTypeDescription
addressstring

Returns

boolean


serialize()

serialize(): any;

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:126

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

Returns

any

Implementation of

StorageObject.serialize


fromOpReturnData()

abstract protected fromOpReturnData(data): object;

Defined in: atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:47

Parses the data from the OP_RETURN script for a specific underlying chain

Parameters

ParameterTypeDescription
dataBuffer

Returns

object

NameTypeDefined in
executionHash?stringatomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:47
rawAmountsbigint[]atomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:47
recipientstringatomiq-base/src/spv_swap/SpvWithdrawalTransactionData.ts:47