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
| Parameter | Type |
|---|---|
owner | string |
vaultId | bigint |
state | SpvVaultStateStruct |
params | SpvVaultParametersStruct |
initialUtxo? | string |
Returns
EVMSpvVaultData
Overrides
Constructor
new EVMSpvVaultData(serializedObj): EVMSpvVaultData;
Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:69
Parameters
| Parameter | Type |
|---|---|
serializedObj | any |
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
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
| Parameter | Type | Description |
|---|---|---|
priorWithdrawalTxs | EVMSpvWithdrawalData[] |
Returns
object
| Name | Type | Defined in |
|---|---|---|
balances | SpvVaultTokenBalance[] | atomiq-base/src/spv_swap/SpvVaultData.ts:129 |
withdrawalCount | number | atomiq-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
| Parameter | Type | Description |
|---|---|---|
data | any |
Returns
T
Inherited from
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
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
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
getOwner()
getOwner(): string;
Defined in: atomiq-chain-evm/src/evm/spv_swap/EVMSpvVaultData.ts:137
Gets the owner of the vault
Returns
string
Overrides
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
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
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
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
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
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
| Parameter | Type | Description |
|---|---|---|
withdrawalTxOrEvent | | SpvVaultOpenEvent | SpvVaultDepositEvent | SpvVaultClaimEvent | SpvVaultCloseEvent | EVMSpvWithdrawalData |
Returns
void