Skip to content

@liquality.evm.EvmSwapProvider

Krasimir Raykov edited this page Mar 30, 2022 · 3 revisions

Class: EvmSwapProvider

@liquality/evm.EvmSwapProvider

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new EvmSwapProvider(swapOptions, walletProvider)

Parameters

Name Type
swapOptions EvmSwapOptions
walletProvider EvmBaseWalletProvider<BaseProvider, Signer>

Overrides

EvmBaseSwapProvider.constructor

Defined in

evm/lib/swap/EvmSwapProvider.ts:12

Properties

contract

Protected contract: LiqualityHTLC

Inherited from

EvmBaseSwapProvider.contract

Defined in

evm/lib/swap/EvmBaseSwapProvider.ts:16


swapOptions

Protected swapOptions: EvmSwapOptions

Inherited from

EvmBaseSwapProvider.swapOptions

Defined in

evm/lib/swap/EvmBaseSwapProvider.ts:17


walletProvider

Protected walletProvider: EvmBaseWalletProvider<BaseProvider, Signer>

Overrides

EvmBaseSwapProvider.walletProvider

Defined in

evm/lib/swap/EvmSwapProvider.ts:10

Methods

canUpdateFee

canUpdateFee(): boolean

Returns

boolean

Inherited from

EvmBaseSwapProvider.canUpdateFee

Defined in

evm/lib/swap/EvmBaseSwapProvider.ts:136


claimSwap

claimSwap(swapParams, initTxHash, secret, fee): Promise<Transaction<TransactionResponse>>

Claim the swap

Parameters

Name Type
swapParams SwapParams
initTxHash string
secret string
fee FeeType

Returns

Promise<Transaction<TransactionResponse>>

Inherited from

EvmBaseSwapProvider.claimSwap

Defined in

evm/lib/swap/EvmBaseSwapProvider.ts:50


doesTransactionMatchInitiation

Protected doesTransactionMatchInitiation(swapParams, transaction): boolean

Parameters

Name Type
swapParams SwapParams
transaction Transaction<InitiateEvent>

Returns

boolean

Inherited from

EvmBaseSwapProvider.doesTransactionMatchInitiation

Defined in

evm/lib/swap/EvmBaseSwapProvider.ts:93


findClaimSwapTransaction

findClaimSwapTransaction(swapParams, initTxHash): Promise<Transaction<ClaimEvent>>

Find swap claim transaction from parameters

Parameters

Name Type
swapParams SwapParams
initTxHash string

Returns

Promise<Transaction<ClaimEvent>>

Overrides

EvmBaseSwapProvider.findClaimSwapTransaction

Defined in

evm/lib/swap/EvmSwapProvider.ts:36


findInitiateSwapTransaction

findInitiateSwapTransaction(swapParams): Promise<Transaction<InitiateEvent>>

Find swap transaction from parameters

Parameters

Name Type
swapParams SwapParams

Returns

Promise<Transaction<InitiateEvent>>

Overrides

EvmBaseSwapProvider.findInitiateSwapTransaction

Defined in

evm/lib/swap/EvmSwapProvider.ts:16


findRefundSwapTransaction

findRefundSwapTransaction(swapParams, initTxHash): Promise<Transaction<RefundEvent>>

Refund the swap

Parameters

Name Type
swapParams SwapParams
initTxHash string

Returns

Promise<Transaction<RefundEvent>>

Overrides

EvmBaseSwapProvider.findRefundSwapTransaction

Defined in

evm/lib/swap/EvmSwapProvider.ts:44


generateSecret

generateSecret(message): Promise<string>

Generate a secret.

Parameters

Name Type
message string

Returns

Promise<string>

Inherited from

EvmBaseSwapProvider.generateSecret

Defined in

client/dist/lib/Swap.d.ts:10


getSwapSecret

getSwapSecret(claimTx): Promise<string>

Get secret from claim transaction hash.

Parameters

Name Type
claimTx string

Returns

Promise<string>

Inherited from

EvmBaseSwapProvider.getSwapSecret

Defined in

evm/lib/swap/EvmBaseSwapProvider.ts:119


getWallet

getWallet(): any

Returns

any

Inherited from

EvmBaseSwapProvider.getWallet

Defined in

client/dist/lib/Swap.d.ts:7


initiateSwap

initiateSwap(swapParams, fee): Promise<Transaction<TransactionResponse>>

Initiate a swap

Parameters

Name Type
swapParams SwapParams
fee FeeType

Returns

Promise<Transaction<TransactionResponse>>

Inherited from

EvmBaseSwapProvider.initiateSwap

Defined in

evm/lib/swap/EvmBaseSwapProvider.ts:29


refundSwap

refundSwap(swapParams, initTxHash, fee): Promise<Transaction<TransactionResponse>>

Refund the swap

Parameters

Name Type
swapParams SwapParams
initTxHash string
fee FeeType

Returns

Promise<Transaction<TransactionResponse>>

Inherited from

EvmBaseSwapProvider.refundSwap

Defined in

evm/lib/swap/EvmBaseSwapProvider.ts:75


setWallet

setWallet(wallet): void

Parameters

Name Type
wallet any

Returns

void

Inherited from

EvmBaseSwapProvider.setWallet

Defined in

client/dist/lib/Swap.d.ts:6


tryParseLog

Protected tryParseLog(log): LogDescription

Parameters

Name Type
log Log

Returns

LogDescription

Inherited from

EvmBaseSwapProvider.tryParseLog

Defined in

evm/lib/swap/EvmBaseSwapProvider.ts:144


updateTransactionFee

updateTransactionFee(_tx, _newFee): Promise<Transaction<any>>

Parameters

Name Type
_tx string | Transaction<any>
_newFee FeeType

Returns

Promise<Transaction<any>>

Inherited from

EvmBaseSwapProvider.updateTransactionFee

Defined in

evm/lib/swap/EvmBaseSwapProvider.ts:140


validateSwapParams

validateSwapParams(swapParams): void

Parameters

Name Type
swapParams SwapParams

Returns

void

Inherited from

EvmBaseSwapProvider.validateSwapParams

Defined in

client/dist/lib/Swap.d.ts:9


verifyInitiateSwapTransaction

verifyInitiateSwapTransaction(swapParams, initTx): Promise<boolean>

Verifies that the given initiation transaction matches the given swap params

Parameters

Name Type
swapParams SwapParams
initTx string | Transaction<any>

Returns

Promise<boolean>

Inherited from

EvmBaseSwapProvider.verifyInitiateSwapTransaction

Defined in

client/dist/lib/Swap.d.ts:8

Clone this wiki locally