Skip to main content

IFromBTCSelfInitSwap<T, D, S>

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:20

Base class for legacy escrow-based Bitcoin (on-chain & lightning) -> Smart chain swaps, which require the user to manually initiate the escrow on the destination smart chain

Extends​

Extended by​

Type Parameters​

Type ParameterDefault type
T extends ChainTypeChainType
D extends IFromBTCSelfInitDefinition<T, IFromBTCWrapper<T, D>, IFromBTCSelfInitSwap<T, D, S>>IFromBTCSelfInitDefinition<T, IFromBTCWrapper<T, any>, IFromBTCSelfInitSwap<T, any, any>>
S extends numbernumber

Implements​

Constructors​

Constructor​

protected new IFromBTCSelfInitSwap<T, D, S>(wrapper, init): IFromBTCSelfInitSwap<T, D, S>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:30

Parameters​

ParameterType
wrapperD["Wrapper"]
initIEscrowSelfInitSwapInit<T["Data"]>

Returns​

IFromBTCSelfInitSwap<T, D, S>

Overrides​

IEscrowSelfInitSwap.constructor

Constructor​

protected new IFromBTCSelfInitSwap<T, D, S>(wrapper, obj): IFromBTCSelfInitSwap<T, D, S>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:31

Parameters​

ParameterType
wrapperD["Wrapper"]
objany

Returns​

IFromBTCSelfInitSwap<T, D, S>

Overrides​

IEscrowSelfInitSwap.constructor

Properties​

chainIdentifier​

readonly chainIdentifier: T["ChainId"];

Defined in: atomiq-sdk/src/swaps/ISwap.ts:168

Smart chain identifier string corresponding to this swap

Implementation of​

IClaimableSwap.chainIdentifier

Inherited from​

IEscrowSelfInitSwap.chainIdentifier


createdAt​

createdAt: number;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:176

A UNIX milliseconds timestamps of when this swap was created

Implementation of​

IClaimableSwap.createdAt

Inherited from​

IEscrowSelfInitSwap.createdAt


events​

readonly events: EventEmitter<{
swapState: [D["Swap"]];
}>;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:160

Event emitter emitting "swapState" event when swap's state changes

Implementation of​

IClaimableSwap.events

Inherited from​

IEscrowSelfInitSwap.events


exactIn​

readonly exactIn: boolean;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:172

Whether a swap is an exact input swap

Implementation of​

IClaimableSwap.exactIn

Inherited from​

IEscrowSelfInitSwap.exactIn


url?​

readonly optional url: string;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:164

URL of the intermediary (LP) used for this swap, already has the swap service specific path appended

Implementation of​

IClaimableSwap.url

Inherited from​

IEscrowSelfInitSwap.url


TYPE​

abstract protected readonly TYPE: SwapType;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:62

Swap type

Implementation of​

IClaimableSwap.TYPE

Inherited from​

IEscrowSelfInitSwap.TYPE

Methods​

_verifyQuoteDefinitelyExpired()​

_verifyQuoteDefinitelyExpired(): Promise<boolean>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSelfInitSwap.ts:178

Checks if the swap's quote is expired for good (i.e. the swap strictly cannot be committed on-chain anymore)

Returns​

Promise<boolean>

Implementation of​

IClaimableSwap._verifyQuoteDefinitelyExpired

Inherited from​

IEscrowSelfInitSwap._verifyQuoteDefinitelyExpired


_verifyQuoteValid()​

_verifyQuoteValid(): Promise<boolean>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSelfInitSwap.ts:189

Checks if the swap's quote is still valid

Returns​

Promise<boolean>

Implementation of​

IClaimableSwap._verifyQuoteValid

Inherited from​

IEscrowSelfInitSwap._verifyQuoteValid


claim()​

abstract claim(signer, abortSignal?): Promise<string>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:293

Settles the swap by claiming the funds on the destination chain if the swap requires manual settlement, you can check so with isClaimable

Parameters​

ParameterTypeDescription
signerT["Signer"] | T["NativeSigner"]Signer to use for signing the settlement transactions
abortSignal?AbortSignalAbort signal

Returns​

Promise<string>

Implementation of​

IClaimableSwap.claim


commit()​

abstract commit(
signer,
abortSignal?,
skipChecks?): Promise<string>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:266

Creates the escrow on the destination smart chain side, pre-locking the tokens from the intermediary (LP) into an escrow.

Parameters​

ParameterTypeDescription
signerT["Signer"] | T["NativeSigner"]Signer to sign the transactions with, must be the same as used in the initialization
abortSignal?AbortSignalAbort signal
skipChecks?booleanSkip checks like making sure init signature is still valid and swap wasn't commited yet (this is handled on swap creation, if you commit right after quoting, you can use skipChecks=true)

Returns​

Promise<string>

Throws​

If invalid signer is provided that doesn't match the swap data

Overrides​

IEscrowSelfInitSwap.commit


execute()​

abstract execute(...args): Promise<boolean>;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:279

Executes the swap with the provided wallet, the exact arguments for this functions differ for various swap types. Check the execute() function signature in the respective swap class to see the required arguments.

Parameters​

ParameterTypeDescription
...argsany[]Execution arguments, usually contains a source wallet object, callbacks and options, for exact syntax check the respective swap class.

Returns​

Promise<boolean>

Whether a swap was successfully executed or not, if it wasn't the user can refund or claim manually

Implementation of​

IClaimableSwap.execute

Inherited from​

IEscrowSelfInitSwap.execute


getAddress()​

abstract getAddress(): string;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:58

An address to which the user needs to send funds on the source chain

Returns​

string

Implementation of​

IAddressSwap.getAddress


getClaimHash()​

getClaimHash(): string;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSwap.ts:130

Returns the claim data hash specifying the claim path of the escrow - i.e. hash passed to the claim handler

Returns​

string

Inherited from​

IEscrowSelfInitSwap.getClaimHash


getClaimNetworkFee()​

getClaimNetworkFee(): Promise<TokenAmount<SCToken<T["ChainId"]>, true>>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:276

Returns the transaction fee required for the claim transaction to settle the escrow on the destination smart chain

Returns​

Promise<TokenAmount<SCToken<T["ChainId"]>, true>>


getDirection()​

getDirection(): SwapDirection;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:560

Returns the direction of the swap

Returns​

SwapDirection

Implementation of​

IClaimableSwap.getDirection

Inherited from​

IEscrowSelfInitSwap.getDirection


getEscrowClaimTxId()​

getEscrowClaimTxId(): string;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSwap.ts:151

Returns the smart chain transaction ID of the tx that claimed (settled) the escrow

Returns​

string

Inherited from​

IEscrowSelfInitSwap.getEscrowClaimTxId


getEscrowHash()​

getEscrowHash(): string;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSwap.ts:123

Returns the escrow hash - i.e. hash of the escrow data

Returns​

string

Inherited from​

IEscrowSelfInitSwap.getEscrowHash


getEscrowInitTxId()​

getEscrowInitTxId(): string;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSwap.ts:144

Returns the smart chain transaction ID of the tx that initiated the escrow

Returns​

string

Inherited from​

IEscrowSelfInitSwap.getEscrowInitTxId


getEscrowRefundTxId()​

getEscrowRefundTxId(): string;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSwap.ts:158

Returns the smart chain transaction ID of the tx that refunded the escrow

Returns​

string

Inherited from​

IEscrowSelfInitSwap.getEscrowRefundTxId


getExecutionAction()​

abstract getExecutionAction(options?): Promise<SwapExecutionAction>;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:586

Returns a current state-dependent action for the user to execute, or undefined if there is no more action required for this swap - this means that the swap is probably finished (either expired, failed or settled).

Parameters​

ParameterTypeDescription
options?anyOptional options argument for the additional action context (i.e. passing bitcoin wallet info to get funded PSBTs or passing the externally-generated swap secret), see the actual type in the respective swap classes

Returns​

Promise<SwapExecutionAction>

Implementation of​

IClaimableSwap.getExecutionAction

Inherited from​

IEscrowSelfInitSwap.getExecutionAction


getExecutionStatus()​

abstract getExecutionStatus(options?): Promise<{
currentAction: SwapExecutionAction;
stateInfo: SwapStateInfo<S>;
steps: SwapExecutionStep[];
}>;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:605

Returns the current action and the full execution steps for a given swap. Prefer this to calling getExecutionSteps and getExecutionAction separately - if called sequentially they might return the respective steps/actions in different states if you hit the state transition boundary.

Parameters​

ParameterTypeDescription
options?anyOptional options argument for the additional execution status context, see the actual type in the respective swap classes

Returns​

Promise<{ currentAction: SwapExecutionAction; stateInfo: SwapStateInfo<S>; steps: SwapExecutionStep[]; }>

Implementation of​

IClaimableSwap.getExecutionStatus

Inherited from​

IEscrowSelfInitSwap.getExecutionStatus


getExecutionSteps()​

abstract getExecutionSteps(options?): Promise<SwapExecutionStep[]>;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:595

Returns a list of execution steps the user has to go through for a given swap, to see the possible execution steps check out SwapExecutionStep.

Parameters​

ParameterTypeDescription
options?anyOptional options argument for the additional steps context (i.e. automatic settlement timeout), see the actual type in the respective swap classes

Returns​

Promise<SwapExecutionStep[]>

Implementation of​

IClaimableSwap.getExecutionSteps

Inherited from​

IEscrowSelfInitSwap.getExecutionSteps


getFee()​

getFee(): Fee;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:148

Returns total fee for the swap, the fee is represented in source currency & destination currency, but is paid only once

Returns​

Fee

Implementation of​

IClaimableSwap.getFee

Overrides​

IEscrowSelfInitSwap.getFee


getFeeBreakdown()​

getFeeBreakdown(): [{
fee: Fee<T["ChainId"], BtcToken, SCToken<T["ChainId"]>>;
type: SWAP;
}];

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:155

Returns the breakdown of all the fees paid

Returns​

[{ fee: Fee<T["ChainId"], BtcToken, SCToken<T["ChainId"]>>; type: SWAP; }]

Implementation of​

IClaimableSwap.getFeeBreakdown

Overrides​

IEscrowSelfInitSwap.getFeeBreakdown


abstract getHyperlink(): string;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:63

A hyperlink representation of the address + amount that the user needs to sends on the source chain. This is suitable to be displayed in a form of QR code.

Returns​

string

Implementation of​

IAddressSwap.getHyperlink


getId()​

getId(): string;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSwap.ts:137

Returns the ID of the swap, as used in the storage

Returns​

string

Implementation of​

IClaimableSwap.getId

Inherited from​

IEscrowSelfInitSwap.getId


getInput()​

abstract getInput(): TokenAmount<BtcToken>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:179

Returns input amount of the swap, user needs to pay this much

Returns​

TokenAmount<BtcToken>

Implementation of​

IClaimableSwap.getInput

Overrides​

IEscrowSelfInitSwap.getInput


getInputAddress()​

abstract getInputAddress(): string;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:475

Returns source address of the swap

Returns​

string

Implementation of​

IClaimableSwap.getInputAddress

Inherited from​

IEscrowSelfInitSwap.getInputAddress


getInputToken()​

abstract getInputToken(): Token<T["ChainId"]>;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:653

Returns the input token of the swap

Returns​

Token<T["ChainId"]>

Implementation of​

IClaimableSwap.getInputToken

Inherited from​

IEscrowSelfInitSwap.getInputToken


getInputTxId()​

abstract getInputTxId(): string;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:485

Returns swap input transaction ID on the source chain

Returns​

string

Implementation of​

IClaimableSwap.getInputTxId

Inherited from​

IEscrowSelfInitSwap.getInputTxId


getInputWithoutFee()​

getInputWithoutFee(): TokenAmount<BtcToken>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:184

Returns input amount of the swap without the fees (swap fee, network fee)

Returns​

TokenAmount<BtcToken>

Implementation of​

IClaimableSwap.getInputWithoutFee

Overrides​

IEscrowSelfInitSwap.getInputWithoutFee


getOutput()​

getOutput(): TokenAmount<SCToken<T["ChainId"]>, true>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:172

Returns output amount of the swap, user receives this much

Returns​

TokenAmount<SCToken<T["ChainId"]>, true>

Implementation of​

IClaimableSwap.getOutput

Overrides​

IEscrowSelfInitSwap.getOutput


getOutputAddress()​

getOutputAddress(): string;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:94

Returns destination address of the swap

Returns​

string

Implementation of​

IClaimableSwap.getOutputAddress

Overrides​

IEscrowSelfInitSwap.getOutputAddress


getOutputToken()​

getOutputToken(): SCToken<T["ChainId"]>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:165

Returns the output token of the swap

Returns​

SCToken<T["ChainId"]>

Implementation of​

IClaimableSwap.getOutputToken

Overrides​

IEscrowSelfInitSwap.getOutputToken


getOutputTxId()​

getOutputTxId(): string;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:87

Returns swap output transaction ID on the destination chain

Returns​

string

Implementation of​

IClaimableSwap.getOutputTxId

Overrides​

IEscrowSelfInitSwap.getOutputTxId


getPriceInfo()​

getPriceInfo(): object;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:388

Returns pricing info about the swap

Returns​

object

NameTypeDefined in
differencePercentagePPMatomiq-sdk/src/swaps/ISwap.ts:391
marketPrice?numberatomiq-sdk/src/swaps/ISwap.ts:389
swapPricenumberatomiq-sdk/src/swaps/ISwap.ts:390

Implementation of​

IClaimableSwap.getPriceInfo

Inherited from​

IEscrowSelfInitSwap.getPriceInfo


getQuoteExpiry()​

getQuoteExpiry(): number;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:546

Returns quote expiry in UNIX millis

Returns​

number

Implementation of​

IClaimableSwap.getQuoteExpiry

Inherited from​

IEscrowSelfInitSwap.getQuoteExpiry


getSecurityDeposit()​

getSecurityDeposit(): TokenAmount<SCToken<T["ChainId"]>, true>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:215

Returns the amount of native token of the destination chain locked up during initialization of the escrow to act as a security deposit that can be taken by the intermediary (LP) if the user doesn't go through with the swap

Returns​

TokenAmount<SCToken<T["ChainId"]>, true>


getSmartChainNetworkFee()​

getSmartChainNetworkFee(): Promise<TokenAmount<SCToken<T["ChainId"]>, true>>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSelfInitSwap.ts:115

Returns the transaction fee paid on the smart chain side to initiate the escrow

Returns​

Promise<TokenAmount<SCToken<T["ChainId"]>, true>>

Inherited from​

IEscrowSelfInitSwap.getSmartChainNetworkFee


getState()​

getState(): S;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:567

Returns the current state of the swap

Returns​

S

Implementation of​

IClaimableSwap.getState

Inherited from​

IEscrowSelfInitSwap.getState


getStateInfo()​

getStateInfo(): SwapStateInfo<S>;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:574

Returns the current state of the swap along with the human-readable description of the state

Returns​

SwapStateInfo<S>

Implementation of​

IClaimableSwap.getStateInfo

Inherited from​

IEscrowSelfInitSwap.getStateInfo


getTotalDeposit()​

getTotalDeposit(): TokenAmount<SCToken<T["ChainId"]>, true>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:224

Returns the total amount of native token of the destination chain locked up during initialization of the escrow. This covers the security deposit and the watchtower fee (if applicable), it is calculated a maximum of those two values.

Returns​

TokenAmount<SCToken<T["ChainId"]>, true>


getType()​

getType(): SwapType;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:553

Returns the type of the swap

Returns​

SwapType

Implementation of​

IClaimableSwap.getType

Inherited from​

IEscrowSelfInitSwap.getType


hasEnoughForTxFees()​

hasEnoughForTxFees(): Promise<{
balance: TokenAmount<SCToken<T["ChainId"]>, true>;
enoughBalance: boolean;
required: TokenAmount<SCToken<T["ChainId"]>, true>;
}>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:193

Checks if the initiator/sender has enough balance on the smart chain side to cover the transaction fee for processing the swap

Returns​

Promise<{ balance: TokenAmount<SCToken<T["ChainId"]>, true>; enoughBalance: boolean; required: TokenAmount<SCToken<T["ChainId"]>, true>; }>

Overrides​

IEscrowSelfInitSwap.hasEnoughForTxFees


hasValidPrice()​

hasValidPrice(): boolean;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:380

Checks if the pricing for the swap is valid, according to max allowed price difference set in the ISwapPrice

Returns​

boolean

Implementation of​

IClaimableSwap.hasValidPrice

Inherited from​

IEscrowSelfInitSwap.hasValidPrice


isClaimable()​

abstract isClaimable(): boolean;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:68

Checks whether a swap currently requires a manual claiming (settlement)

Returns​

boolean

Implementation of​

IClaimableSwap.isClaimable


isFailed()​

abstract isFailed(): boolean;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:526

Returns whether the swap failed (e.g. was refunded)

Returns​

boolean

Implementation of​

IClaimableSwap.isFailed

Inherited from​

IEscrowSelfInitSwap.isFailed


isFinished()​

abstract isFinished(): boolean;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:505

Returns whether the swap is finished and in its terminal state (this can mean successful, refunded or failed)

Returns​

boolean

Implementation of​

IClaimableSwap.isFinished

Inherited from​

IEscrowSelfInitSwap.isFinished


isInitiated()​

isInitiated(): boolean;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:539

Whether a swap was initialized, a swap is considered initialized on first interaction with it, i.e. calling commit() on a Smart chain -> Bitcoin swaps, calling waitForPayment() or similar on the other direction. Not initiated swaps are not saved to the persistent storage by default (see SwapperOptions.saveUninitializedSwaps)

Returns​

boolean

Implementation of​

IClaimableSwap.isInitiated

Inherited from​

IEscrowSelfInitSwap.isInitiated


isInProgress()​

abstract isInProgress(): boolean;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:531

Returns whether the swap is currently being processed

Returns​

boolean

Implementation of​

IClaimableSwap.isInProgress

Inherited from​

IEscrowSelfInitSwap.isInProgress


isQuoteExpired()​

abstract isQuoteExpired(): boolean;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:510

Checks whether the swap's quote has definitely expired and cannot be committed anymore, we can remove such swap

Returns​

boolean

Implementation of​

IClaimableSwap.isQuoteExpired

Inherited from​

IEscrowSelfInitSwap.isQuoteExpired


isQuoteSoftExpired()​

abstract isQuoteSoftExpired(): boolean;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:516

Checks whether the swap's quote is soft expired (this means there is not enough time buffer for it to commit, but it still can happen)

Returns​

boolean

Implementation of​

IClaimableSwap.isQuoteSoftExpired

Inherited from​

IEscrowSelfInitSwap.isQuoteSoftExpired


isSuccessful()​

abstract isSuccessful(): boolean;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:521

Returns whether the swap finished successful

Returns​

boolean

Implementation of​

IClaimableSwap.isSuccessful

Inherited from​

IEscrowSelfInitSwap.isSuccessful


refreshPriceData()​

refreshPriceData(): Promise<void>;

Defined in: atomiq-sdk/src/swaps/ISwap.ts:336

Re-fetches & revalidates the price data based on the current market prices

Returns​

Promise<void>

Implementation of​

IClaimableSwap.refreshPriceData

Inherited from​

IEscrowSelfInitSwap.refreshPriceData


requiresAction()​

requiresAction(): boolean;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:101

Checks whether there is some action required from the user for this swap - can mean either refundable or claimable

Returns​

boolean

Implementation of​

IClaimableSwap.requiresAction

Overrides​

IEscrowSelfInitSwap.requiresAction


serialize()​

serialize(): any;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSelfInitSwap.ts:208

Serializes the swap to a JSON stringifiable representation (i.e. no bigints, buffers etc.)

Returns​

any

Implementation of​

IClaimableSwap.serialize

Inherited from​

IEscrowSelfInitSwap.serialize


txsClaim()​

abstract txsClaim(signer?): Promise<T["TX"][]>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:288

Returns transactions for settling (claiming) the swap if the swap requires manual settlement, you can check so with isClaimable. After sending the transaction manually be sure to call the waitTillClaimed function to wait till the claim transaction is observed, processed by the SDK and state of the swap properly updated.

Parameters​

ParameterTypeDescription
signer?string | T["Signer"] | T["NativeSigner"]Address of the signer to create the settlement (claim) transactions for

Returns​

Promise<T["TX"][]>

Implementation of​

IClaimableSwap.txsClaim


txsCommit()​

txsCommit(skipChecks?): Promise<T["TX"][]>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:241

Returns transactions for initiating (committing) the escrow on the destination smart chain side, pre-locking the tokens from the intermediary (LP) into an escrow.

Parameters​

ParameterTypeDescription
skipChecks?booleanSkip checks like making sure init signature is still valid and swap wasn't commited yet (this is handled on swap creation, if you commit right after quoting, you can use skipChecks=true)

Returns​

Promise<T["TX"][]>

Throws​

When in invalid state to commit the swap

Overrides​

IEscrowSelfInitSwap.txsCommit


waitTillClaimed()​

abstract waitTillClaimed(maxWaitTimeSeconds?, abortSignal?): Promise<boolean>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts:298

Waits till the swap is successfully settled (claimed), should be called after sending the claim (settlement) transactions manually to wait till the SDK processes the settlement and updates the swap state accordingly

Parameters​

ParameterTypeDescription
maxWaitTimeSeconds?numberMaximum time in seconds to wait for the swap to be settled
abortSignal?AbortSignalAbortSignal

Returns​

Promise<boolean>

whether the swap was claimed in time or not

Implementation of​

IClaimableSwap.waitTillClaimed


waitTillCommited()​

abstract waitTillCommited(abortSignal?): Promise<void>;

Defined in: atomiq-sdk/src/swaps/escrow_swaps/IEscrowSelfInitSwap.ts:170

Waits till a swap is initiated (committed) on-chain, should be called after sending the commit transactions (txsCommit) manually to wait till the SDK processes the escrow initialization and updates the swap state accordingly

Parameters​

ParameterTypeDescription
abortSignal?AbortSignalAbortSignal

Returns​

Promise<void>

Inherited from​

IEscrowSelfInitSwap.waitTillCommited