EVMSwapData
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:16
Represents swap data for executing PrTLC (on-chain) or HTLC (lightning) based swaps.
Extends
Constructors
Constructor
new EVMSwapData(
offerer,
claimer,
token,
refundHandler,
claimHandler,
payOut,
payIn,
reputation,
sequence,
claimData,
refundData,
amount,
depositToken,
securityDeposit,
claimerBounty,
kind,
extraData?,
successActionCommitment?): EVMSwapData;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:62
Parameters
| Parameter | Type |
|---|---|
offerer | string |
claimer | string |
token | string |
refundHandler | string |
claimHandler | string |
payOut | boolean |
payIn | boolean |
reputation | boolean |
sequence | bigint |
claimData | string |
refundData | string |
amount | bigint |
depositToken | string |
securityDeposit | bigint |
claimerBounty | bigint |
kind | ChainSwapType |
extraData? | string |
successActionCommitment? | string |
Returns
EVMSwapData
Overrides
Constructor
new EVMSwapData(data): EVMSwapData;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:82
Parameters
| Parameter | Type |
|---|---|
data | any |
Returns
EVMSwapData
Overrides
SwapData.constructor
Properties
amount
amount: bigint;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:50
claimData
claimData: string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:47
claimer
claimer: string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:35
claimerBounty
claimerBounty: bigint;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:54
claimHandler
claimHandler: string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:39
depositToken
depositToken: string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:52
deserializers
static deserializers: object = {};
Defined in: atomiq-base/src/swaps/SwapData.ts:14
A mapping of deserializers for different escrow swap data types coming from different smart chain implementations
Index Signature
[type: string]: (serialized) => any
Inherited from
extraData?
optional extraData: string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:56
kind
kind: ChainSwapType;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:60
offerer
offerer: string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:34
payIn
payIn: boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:43
payOut
payOut: boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:42
refundData
refundData: string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:48
refundHandler
refundHandler: string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:38
reputation
reputation: boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:44
securityDeposit
securityDeposit: bigint;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:53
sequence
sequence: bigint;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:45
successActionCommitment
successActionCommitment: string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:58
token
token: string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:36
Methods
deserialize()
static deserialize<T>(data): T;
Defined in: atomiq-base/src/swaps/SwapData.ts:23
Deserializer parsing the chain-specific escrow swap data from a JSON-compatible object representation
Type Parameters
| Type Parameter |
|---|
T extends SwapData |
Parameters
| Parameter | Type | Description |
|---|---|---|
data | any |
Returns
T
Inherited from
deserializeFromStruct()
static deserializeFromStruct(struct, claimHandlerImpl): EVMSwapData;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:491
Deserializes swap data from an on-chain escrow struct.
Parameters
| Parameter | Type | Description |
|---|---|---|
struct | EscrowDataStruct | Escrow struct as returned by the contract |
claimHandlerImpl | IClaimHandler<any, any> | Claim handler implementation used to resolve swap type |
Returns
EVMSwapData
equals()
equals(other): boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:439
Checks equality between 2 swap data objects
Parameters
| Parameter | Type | Description |
|---|---|---|
other | EVMSwapData |
Returns
boolean
Overrides
getAmount()
getAmount(): bigint;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:228
Gets the amount of token deposited into the vault by the offerer
Returns
bigint
Overrides
getClaimer()
getClaimer(): string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:184
Gets the claim, which receives funds from the escrow
Returns
string
Overrides
getClaimerBounty()
getClaimerBounty(): bigint;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:364
Gets the claimer bounty, an amount of native tokens deposited by the caller (initiator) on escrow initialization, that is paid out to a caller which claims the escrow as a reward, otherwise returned to the claimer if escrow is refunded
Returns
bigint
Overrides
getClaimHash()
getClaimHash(): string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:300
Returns the claim hash of the escrow, this specifies a condition that needs to be satisfied to claim the funds from the escrow
Returns
string
Overrides
getConfirmationsHint()
getConfirmationsHint(): number;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:316
Retrieves required number of confirmations as a hint from the extra data provided, or null if no extra
data has been provided when creating the escrow
Returns
number
Overrides
getDepositToken()
getDepositToken(): string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:378
Returns the token used for the deposit (security deposit & claimer bounty) (usually a native token of the underlying smart chain)
Returns
string
Overrides
getEscrowHash()
getEscrowHash(): string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:284
Returns a unique hash of this escrow
Returns
string
Overrides
getExpiry()
getExpiry(): bigint;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:256
Returns the expiration time of this escrow, after the timeout an offerer is able to refund unilaterally. taking back funds from the escrow
Returns
bigint
Overrides
getExtraData()
getExtraData(): string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:343
Gets the extraneous data specified when creating this escrow, this provides helpers for 3rd party claimers
Returns
string
Overrides
getHTLCHashHint()
getHTLCHashHint(): string;
Defined in: atomiq-base/src/swaps/SwapData.ts:164
Retrieves a hint providing an HTLC hash from the extra data provided, or null if no extra data
has been provided when creating the escrow
Returns
string
Inherited from
getNonceHint()
getNonceHint(): bigint;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:325
Retrieves the PrTLC transaction nonce as a hint from the extra data provided, or null if no extra
data has been provided when creating the escrow
Returns
bigint
Overrides
getOfferer()
getOfferer(): string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:169
Gets the offerer, which funds the escrow
Returns
string
Overrides
getSecurityDeposit()
getSecurityDeposit(): bigint;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:357
Gets the security deposit, which is an amount of native tokens deposited by the caller (initiator) on escrow initialization to guarantee the execution, this acts as a compensation for offerer if he has to refund the escrow, otherwise it is returned back to claimer after a successful claim of the escrow
Returns
bigint
Overrides
getSequence()
getSequence(): bigint;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:309
Returns a random variable sequence of this vault, used to ensure the escrow hash is always different
Returns
bigint
Overrides
getToken()
getToken(): string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:235
Gets the address of the deposited token in a vault
Returns
string
Overrides
getTotalDeposit()
getTotalDeposit(): bigint;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:371
Returns the total deposit in native token to be deposited by the caller (initiator) on escrow initialization, due to how claimer bounty and security deposits work, this is basically a max(claimer bounty, security deposit), because either a swap is claimed (and claimer bounty is paid) or a swap is refunded (and security deposit is paid), never both!
Returns
bigint
Overrides
getTxoHashHint()
getTxoHashHint(): string;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:334
Retrieves the PrTLC transaction txo (transaction output) hash as a hint from the extra data provided,
or null if no extra data has been provided when creating the escrow
Returns
string
Overrides
getType()
getType(): ChainSwapType;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:249
Returns the type of this escrow
Returns
ChainSwapType
Overrides
hasSuccessAction()
hasSuccessAction(): boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:481
Checks whether the escrow contains an execution action (swap+)
Returns
boolean
Overrides
isClaimData()
isClaimData(data): boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:431
Checks if the passed data matches the swap's claim data.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | string |
Returns
boolean
isClaimer()
isClaimer(address): boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:393
Checks whether the provided address is a claimer for this escrow
Parameters
| Parameter | Type | Description |
|---|---|---|
address | string |
Returns
boolean
Overrides
isClaimHandler()
isClaimHandler(address): boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:421
Checks whether the passed address is specified as the claim handler for the swap.
Parameters
| Parameter | Type | Description |
|---|---|---|
address | string |
Returns
boolean
isDepositToken()
isDepositToken(token): boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:385
Checks whether a provided token is used as a deposit token (security deposit & claimer bounty) for the escrow
Parameters
| Parameter | Type | Description |
|---|---|---|
token | string |
Returns
boolean
Overrides
isOfferer()
isOfferer(address): boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:401
Checks whether the provided address is an offerer for this escrow
Parameters
| Parameter | Type | Description |
|---|---|---|
address | string |
Returns
boolean
Overrides
isPayIn()
isPayIn(): boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:263
Whether this escrow will be funded from the offerer's wallet or from the offerer's vault inside the contract,
when true it takes funds normally from the offerer's address, when false it pulls the funds from the
offerer's vault inside the contract
Returns
boolean
Overrides
isPayOut()
isPayOut(): boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:270
Whether this escrow will pay out the claimer, when true it pays out normally to the claimer's address, when
false it instead keeps the funds inside the contract and assigns them to the claimer's vault inside the
contract
Returns
boolean
Overrides
isRefundHandler()
isRefundHandler(address): boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:411
Checks whether the passed address is specified as the refund handler for the swap.
Parameters
| Parameter | Type | Description |
|---|---|---|
address | string |
Returns
boolean
isToken()
isToken(token): boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:242
Checks whether the provided token address is the actual token used by this escrow
Parameters
| Parameter | Type | Description |
|---|---|---|
token | string |
Returns
boolean
Overrides
isTrackingReputation()
isTrackingReputation(): boolean;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:277
Whether the outcome of this escrow should be used to track reputation of the claimer
Returns
boolean
Overrides
serialize()
serialize(): any;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:201
Serializes the object to a JSON-compatible object (i.e. no bigints, functions, etc.)
Returns
any
Overrides
setClaimer()
setClaimer(newClaimer): void;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:191
Sets the claimer which receives funds from the escrow
Parameters
| Parameter | Type | Description |
|---|---|---|
newClaimer | string |
Returns
void
Overrides
setExtraData()
setExtraData(extraData): void;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:350
Sets the extra data with hints for this escrow
Parameters
| Parameter | Type | Description |
|---|---|---|
extraData | string |
Returns
void
Overrides
setOfferer()
setOfferer(newOfferer): void;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:176
Sets the offerer to fund the escrow
Parameters
| Parameter | Type | Description |
|---|---|---|
newOfferer | string |
Returns
void
Overrides
toEscrowStruct()
toEscrowStruct(): EscrowDataStruct;
Defined in: atomiq-chain-evm/src/evm/swaps/EVMSwapData.ts:460
Serializes the swap data into the EVM escrow-manager struct representation.
Returns
EscrowDataStruct