Skip to main content

StarknetSpvWithdrawalData

Defined in: atomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:13

Represents parsed data for withdrawal (calling claim()) of the assets in the SPV vault (UTXO-controlled vault)

Extends

Constructors

Constructor

new StarknetSpvWithdrawalData(btcTx): StarknetSpvWithdrawalData;

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

Parses and creates a withdrawal data from the bitcoin transaction

Parameters

ParameterType
btcTxBtcTx

Returns

StarknetSpvWithdrawalData

Throws

If the bitcoin transaction has invalid formatting

Inherited from

SpvWithdrawalTransactionData.constructor

Properties

btcTx

readonly btcTx: BtcTx;

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

A bitcoin transaction which contains this vault withdrawal data

Inherited from

SpvWithdrawalTransactionData.btcTx


callerFeeRate

readonly callerFeeRate: bigint;

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

Inherited from

SpvWithdrawalTransactionData.callerFeeRate


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

Inherited from

SpvWithdrawalTransactionData.deserializers


executionExpiry

readonly executionExpiry: number;

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

Inherited from

SpvWithdrawalTransactionData.executionExpiry


executionFeeRate

readonly executionFeeRate: bigint;

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

Inherited from

SpvWithdrawalTransactionData.executionFeeRate


executionHash?

readonly optional executionHash: string;

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

Inherited from

SpvWithdrawalTransactionData.executionHash


frontingFeeRate

readonly frontingFeeRate: bigint;

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

Inherited from

SpvWithdrawalTransactionData.frontingFeeRate


rawAmounts

readonly rawAmounts: bigint[];

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

Inherited from

SpvWithdrawalTransactionData.rawAmounts


recipient

readonly recipient: string;

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

Inherited from

SpvWithdrawalTransactionData.recipient

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

Inherited from

SpvWithdrawalTransactionData.deserialize


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[]

Inherited from

SpvWithdrawalTransactionData.getCallerFee


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

Inherited from

SpvWithdrawalTransactionData.getCreatedVaultUtxo


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

Inherited from

SpvWithdrawalTransactionData.getExecutionData


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[]

Inherited from

SpvWithdrawalTransactionData.getExecutionFee


getFrontingAmount()

getFrontingAmount(): bigint[];

Defined in: atomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:41

Returns

bigint[]

Inherit Doc


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[]

Inherited from

SpvWithdrawalTransactionData.getFrontingFee


getFrontingId()

getFrontingId(): string;

Defined in: atomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:97

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

Returns

string

Overrides

SpvWithdrawalTransactionData.getFrontingId


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

Inherited from

SpvWithdrawalTransactionData.getNewVaultBtcAmount


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

Inherited from

SpvWithdrawalTransactionData.getNewVaultScript


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[]

Inherited from

SpvWithdrawalTransactionData.getOutputWithoutFees


getRecipient()

getRecipient(): string;

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

Gets the recipient of the funds for this withdrawal

Returns

string

Inherited from

SpvWithdrawalTransactionData.getRecipient


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

Inherited from

SpvWithdrawalTransactionData.getSpentVaultUtxo


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

Inherited from

SpvWithdrawalTransactionData.getTotalOutput


getTxHash()

getTxHash(): bigint;

Defined in: atomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:34

Returns

bigint

Inherit Doc


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

Inherited from

SpvWithdrawalTransactionData.getTxId


isRecipient()

isRecipient(address): boolean;

Defined in: atomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:27

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

Parameters

ParameterTypeDescription
addressstring

Returns

boolean

Overrides

SpvWithdrawalTransactionData.isRecipient


serialize()

serialize(): any;

Defined in: atomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:48

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

Returns

any

Overrides

SpvWithdrawalTransactionData.serialize


serializeToFelts()

serializeToFelts(): BigNumberish[];

Defined in: atomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:76

Serializes the withdrawal data to a raw array of felt252 of length 10

Returns

BigNumberish[]


serializeToStruct()

serializeToStruct(): object;

Defined in: atomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:58

Serializes the withdrawal data to a starknet.js struct

Returns

object

NameTypeDefined in
amountanyatomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:64
caller_feeanyatomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:65
execution_expirybigintatomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:69
execution_handler_fee_amount_0bigintatomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:67
execution_hashbigintatomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:68
fronting_feeanyatomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:66
recipientstringatomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:63

fromOpReturnData()

protected fromOpReturnData(data): object;

Defined in: atomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:20

Parameters

ParameterTypeDescription
dataBuffer

Returns

object

NameTypeDefined in
executionHash?stringatomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:20
rawAmountsbigint[]atomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:20
recipientstringatomiq-chain-starknet/src/starknet/spv_swap/StarknetSpvWithdrawalData.ts:20

Overrides

SpvWithdrawalTransactionData.fromOpReturnData