Skip to main content

EVMSpvVaultData

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:46

Represents the state of the EVM SPV vault (UTXO-controlled vault).

Extends​

Constructors​

Constructor​

new EVMSpvVaultData(
owner,
vaultId,
state,
params,
initialUtxo?): EVMSpvVaultData;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:68

Parameters​

ParameterType
ownerstring
vaultIdbigint
stateSpvVaultStateStruct
paramsSpvVaultParametersStruct
initialUtxo?string

Returns​

EVMSpvVaultData

Overrides​

SpvVaultData.constructor

Constructor​

new EVMSpvVaultData(serializedObj): EVMSpvVaultData;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:69

Parameters​

ParameterType
serializedObjany

Returns​

EVMSpvVaultData

Overrides​

SpvVaultData<EVMSpvWithdrawalData>.constructor

Properties​

confirmations​

readonly confirmations: number;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:64


depositCount​

depositCount: number;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:66


deserializers​

static deserializers: object = {};

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

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

Index Signature​

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

Inherited from​

SpvVaultData.deserializers


initialUtxo?​

readonly optional initialUtxo: string;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:62


owner​

readonly owner: string;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:48


relayContract​

readonly relayContract: string;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:51


token0​

readonly token0: object;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:52

multiplier​

multiplier: bigint;

rawAmount​

rawAmount: bigint;

token​

token: string;

token1​

readonly token1: object;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:57

multiplier​

multiplier: bigint;

rawAmount​

rawAmount: bigint;

token​

token: string;

utxo​

utxo: string;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:63


vaultId​

readonly vaultId: bigint;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:49


withdrawCount​

withdrawCount: number;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:65

Methods​

calculateStateAfter()​

calculateStateAfter(priorWithdrawalTxs): object;

Defined in: atomiq-base/src/spv_swap/SpvVaultData.ts:129

A helper function which calculates the vault balances after processing an array of claims (withdrawals)

Parameters​

ParameterTypeDescription
priorWithdrawalTxsEVMSpvWithdrawalData[]

Returns​

object

NameTypeDefined in
balancesSpvVaultTokenBalance[]atomiq-base/src/spv_swap/SpvVaultData.ts:129
withdrawalCountnumberatomiq-base/src/spv_swap/SpvVaultData.ts:129

Inherited from​

SpvVaultData.calculateStateAfter


deserialize()​

static deserialize<T>(data): T;

Defined in: atomiq-base/src/spv_swap/SpvVaultData.ts:59

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

Type Parameters​

Type Parameter
T extends SpvVaultData<SpvWithdrawalTransactionData>

Parameters​

ParameterTypeDescription
dataany

Returns​

T

Inherited from​

SpvVaultData.deserialize


getBalances()​

getBalances(): SpvVaultTokenBalance[];

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:120

Returns the token balance currently available in the vault

Returns​

SpvVaultTokenBalance[]

Overrides​

SpvVaultData.getBalances


getConfirmations()​

getConfirmations(): number;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:130

Gets the required number of confirmations that a bitcoin transaction has to get in order for the vault claim (withdrawal) to be authorized

Returns​

number

Overrides​

SpvVaultData.getConfirmations


getDepositCount()​

getDepositCount(): number;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:242

Returns the current number of deposits deposited into the vault

Returns​

number

Overrides​

SpvVaultData.getDepositCount


getOwner()​

getOwner(): string;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:137

Gets the owner of the vault

Returns​

string

Overrides​

SpvVaultData.getOwner


getTokenData()​

getTokenData(): SpvVaultTokenData[];

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:144

Returns the configuration of the tokens supported by the vault

Returns​

SpvVaultTokenData[]

Overrides​

SpvVaultData.getTokenData


getUtxo()​

getUtxo(): string;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:151

Returns the UTXO in [txId]:[vout] format which currently controls the vault

Returns​

string

Overrides​

SpvVaultData.getUtxo


getVaultId()​

getVaultId(): bigint;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:158

Gets the vault ID, this along with the owner uniquely identifies a vault

Returns​

bigint

Overrides​

SpvVaultData.getVaultId


getWithdrawalCount()​

getWithdrawalCount(): number;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:165

Returns the current number of claims (withdrawals) processed by the vault

Returns​

number

Overrides​

SpvVaultData.getWithdrawalCount


isOpened()​

isOpened(): boolean;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:172

Checks whether a vault is opened and available to process claims (withdrawals)

Returns​

boolean

Overrides​

SpvVaultData.isOpened


serialize()​

serialize(): any;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:179

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

Returns​

any

Overrides​

SpvVaultData.serialize


updateState()​

updateState(withdrawalTxOrEvent): void;

Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:206

Updates the state of the spv vault data from either an on-chain event or a SpvWithdrawalTransactionData

Parameters​

ParameterTypeDescription
withdrawalTxOrEvent| SpvVaultOpenEvent | SpvVaultDepositEvent | SpvVaultClaimEvent | SpvVaultCloseEvent | EVMSpvWithdrawalData

Returns​

void

Overrides​

SpvVaultData.updateState