-
Notifications
You must be signed in to change notification settings - Fork 69
@liquality.evm.EvmSwapProvider
@liquality/evm.EvmSwapProvider
-
↳
EvmSwapProvider
- canUpdateFee
- claimSwap
- doesTransactionMatchInitiation
- findClaimSwapTransaction
- findInitiateSwapTransaction
- findRefundSwapTransaction
- generateSecret
- getSwapSecret
- getWallet
- initiateSwap
- refundSwap
- setWallet
- tryParseLog
- updateTransactionFee
- validateSwapParams
- verifyInitiateSwapTransaction
• new EvmSwapProvider(swapOptions
, walletProvider
)
Name | Type |
---|---|
swapOptions |
EvmSwapOptions |
walletProvider |
EvmBaseWalletProvider <BaseProvider , Signer > |
EvmBaseSwapProvider.constructor
evm/lib/swap/EvmSwapProvider.ts:12
• Protected
contract: LiqualityHTLC
evm/lib/swap/EvmBaseSwapProvider.ts:16
• Protected
swapOptions: EvmSwapOptions
EvmBaseSwapProvider.swapOptions
evm/lib/swap/EvmBaseSwapProvider.ts:17
• Protected
walletProvider: EvmBaseWalletProvider
<BaseProvider
, Signer
>
EvmBaseSwapProvider.walletProvider
evm/lib/swap/EvmSwapProvider.ts:10
▸ canUpdateFee(): boolean
boolean
EvmBaseSwapProvider.canUpdateFee
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
EvmBaseSwapProvider.doesTransactionMatchInitiation
evm/lib/swap/EvmBaseSwapProvider.ts:93
▸ findClaimSwapTransaction(swapParams
, initTxHash
): Promise
<Transaction
<ClaimEvent
>>
Find swap claim transaction from parameters
Name | Type |
---|---|
swapParams |
SwapParams |
initTxHash |
string |
Promise
<Transaction
<ClaimEvent
>>
EvmBaseSwapProvider.findClaimSwapTransaction
evm/lib/swap/EvmSwapProvider.ts:36
▸ findInitiateSwapTransaction(swapParams
): Promise
<Transaction
<InitiateEvent
>>
Find swap transaction from parameters
Name | Type |
---|---|
swapParams |
SwapParams |
Promise
<Transaction
<InitiateEvent
>>
EvmBaseSwapProvider.findInitiateSwapTransaction
evm/lib/swap/EvmSwapProvider.ts:16
▸ findRefundSwapTransaction(swapParams
, initTxHash
): Promise
<Transaction
<RefundEvent
>>
Refund the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initTxHash |
string |
Promise
<Transaction
<RefundEvent
>>
EvmBaseSwapProvider.findRefundSwapTransaction
evm/lib/swap/EvmSwapProvider.ts:44
▸ generateSecret(message
): Promise
<string
>
Generate a secret.
Name | Type |
---|---|
message |
string |
Promise
<string
>
EvmBaseSwapProvider.generateSecret
client/dist/lib/Swap.d.ts:10
▸ getSwapSecret(claimTx
): Promise
<string
>
Get secret from claim transaction hash.
Name | Type |
---|---|
claimTx |
string |
Promise
<string
>
EvmBaseSwapProvider.getSwapSecret
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
>>
EvmBaseSwapProvider.initiateSwap
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
>>
EvmBaseSwapProvider.refundSwap
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
EvmBaseSwapProvider.tryParseLog
evm/lib/swap/EvmBaseSwapProvider.ts:144
▸ updateTransactionFee(_tx
, _newFee
): Promise
<Transaction
<any
>>
Name | Type |
---|---|
_tx |
string | Transaction <any > |
_newFee |
FeeType |
Promise
<Transaction
<any
>>
EvmBaseSwapProvider.updateTransactionFee
evm/lib/swap/EvmBaseSwapProvider.ts:140
▸ validateSwapParams(swapParams
): void
Name | Type |
---|---|
swapParams |
SwapParams |
void
EvmBaseSwapProvider.validateSwapParams
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
>
EvmBaseSwapProvider.verifyInitiateSwapTransaction
client/dist/lib/Swap.d.ts:8