-
Notifications
You must be signed in to change notification settings - Fork 69
@liquality.evm.EvmBaseSwapProvider
@liquality/evm.EvmBaseSwapProvider
-
Swap
<BaseProvider
,Signer
>↳
EvmBaseSwapProvider
- canUpdateFee
- claimSwap
- doesTransactionMatchInitiation
- findClaimSwapTransaction
- findInitiateSwapTransaction
- findRefundSwapTransaction
- generateSecret
- getSwapSecret
- getWallet
- initiateSwap
- refundSwap
- setWallet
- tryParseLog
- updateTransactionFee
- validateSwapParams
- verifyInitiateSwapTransaction
• new EvmBaseSwapProvider(swapOptions
, walletProvider?
)
Name | Type |
---|---|
swapOptions |
EvmSwapOptions |
walletProvider? |
EvmBaseWalletProvider <BaseProvider , Signer > |
evm/lib/swap/EvmBaseSwapProvider.ts:19
• Protected
contract: LiqualityHTLC
evm/lib/swap/EvmBaseSwapProvider.ts:16
• Protected
swapOptions: EvmSwapOptions
evm/lib/swap/EvmBaseSwapProvider.ts:17
• Protected
walletProvider: EvmBaseWalletProvider
<BaseProvider
, Signer
>
evm/lib/swap/EvmBaseSwapProvider.ts:15
▸ canUpdateFee(): boolean
boolean
evm/lib/swap/EvmBaseSwapProvider.ts:136
▸ claimSwap(swapParams
, initTxHash
, secret
, fee
): Promise
<Transaction
<TransactionResponse
>>
Claim the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initTxHash |
string |
secret |
string |
fee |
FeeType |
Promise
<Transaction
<TransactionResponse
>>
evm/lib/swap/EvmBaseSwapProvider.ts:50
▸ Protected
doesTransactionMatchInitiation(swapParams
, transaction
): boolean
Name | Type |
---|---|
swapParams |
SwapParams |
transaction |
Transaction <InitiateEvent > |
boolean
Swap.doesTransactionMatchInitiation
evm/lib/swap/EvmBaseSwapProvider.ts:93
▸ Abstract
findClaimSwapTransaction(swapParams
, initTxHash
, _blockNumber?
): Promise
<Transaction
<ClaimEvent
>>
Find swap claim transaction from parameters
Name | Type |
---|---|
swapParams |
SwapParams |
initTxHash |
string |
_blockNumber? |
number |
Promise
<Transaction
<ClaimEvent
>>
evm/lib/swap/EvmBaseSwapProvider.ts:160
▸ Abstract
findInitiateSwapTransaction(swapParams
, _blockNumber?
): Promise
<Transaction
<InitiateEvent
>>
Find swap transaction from parameters
Name | Type |
---|---|
swapParams |
SwapParams |
_blockNumber? |
number |
Promise
<Transaction
<InitiateEvent
>>
Swap.findInitiateSwapTransaction
evm/lib/swap/EvmBaseSwapProvider.ts:156
▸ Abstract
findRefundSwapTransaction(swapParams
, initTxHash
, blockNumber?
): Promise
<Transaction
<RefundEvent
>>
Refund the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initTxHash |
string |
blockNumber? |
number |
Promise
<Transaction
<RefundEvent
>>
Swap.findRefundSwapTransaction
evm/lib/swap/EvmBaseSwapProvider.ts:158
▸ generateSecret(message
): Promise
<string
>
Generate a secret.
Name | Type |
---|---|
message |
string |
Promise
<string
>
client/dist/lib/Swap.d.ts:10
▸ getSwapSecret(claimTx
): Promise
<string
>
Get secret from claim transaction hash.
Name | Type |
---|---|
claimTx |
string |
Promise
<string
>
evm/lib/swap/EvmBaseSwapProvider.ts:119
▸ getWallet(): any
any
client/dist/lib/Swap.d.ts:7
▸ initiateSwap(swapParams
, fee
): Promise
<Transaction
<TransactionResponse
>>
Initiate a swap
Name | Type |
---|---|
swapParams |
SwapParams |
fee |
FeeType |
Promise
<Transaction
<TransactionResponse
>>
evm/lib/swap/EvmBaseSwapProvider.ts:29
▸ refundSwap(swapParams
, initTxHash
, fee
): Promise
<Transaction
<TransactionResponse
>>
Refund the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initTxHash |
string |
fee |
FeeType |
Promise
<Transaction
<TransactionResponse
>>
evm/lib/swap/EvmBaseSwapProvider.ts:75
▸ setWallet(wallet
): void
Name | Type |
---|---|
wallet |
any |
void
client/dist/lib/Swap.d.ts:6
▸ Protected
tryParseLog(log
): LogDescription
Name | Type |
---|---|
log |
Log |
LogDescription
evm/lib/swap/EvmBaseSwapProvider.ts:144
▸ updateTransactionFee(_tx
, _newFee
): Promise
<Transaction
<any
>>
Name | Type |
---|---|
_tx |
string | Transaction <any > |
_newFee |
FeeType |
Promise
<Transaction
<any
>>
evm/lib/swap/EvmBaseSwapProvider.ts:140
▸ validateSwapParams(swapParams
): void
Name | Type |
---|---|
swapParams |
SwapParams |
void
client/dist/lib/Swap.d.ts:9
▸ verifyInitiateSwapTransaction(swapParams
, initTx
): Promise
<boolean
>
Verifies that the given initiation transaction matches the given swap params
Name | Type |
---|---|
swapParams |
SwapParams |
initTx |
string | Transaction <any > |
Promise
<boolean
>
Swap.verifyInitiateSwapTransaction
client/dist/lib/Swap.d.ts:8