-
Notifications
You must be signed in to change notification settings - Fork 69
@liquality.client.Swap
@liquality/client.Swap
Name | Type |
---|---|
T |
T |
S |
S |
WalletProvider |
extends Wallet <T , S > = any
|
- canUpdateFee
- claimSwap
- doesTransactionMatchInitiation
- findClaimSwapTransaction
- findInitiateSwapTransaction
- findRefundSwapTransaction
- generateSecret
- getSwapSecret
- getWallet
- initiateSwap
- refundSwap
- setWallet
- updateTransactionFee
- validateSwapParams
- verifyInitiateSwapTransaction
• new Swap<T
, S
, WalletProvider
>(walletProvider?
)
Name | Type |
---|---|
T |
T |
S |
S |
WalletProvider |
extends Wallet <T , S , WalletProvider > = any
|
Name | Type |
---|---|
walletProvider? |
WalletProvider |
• Protected
walletProvider: WalletProvider
▸ Abstract
canUpdateFee(): boolean
boolean
▸ Abstract
claimSwap(swapParams
, initTx
, secret
, fee?
): Promise
<Transaction
<any
>>
Claim the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initTx |
string |
secret |
string |
fee? |
FeeType |
Promise
<Transaction
<any
>>
▸ Protected
Abstract
doesTransactionMatchInitiation(swapParams
, transaction
): boolean
| Promise
<boolean
>
Name | Type |
---|---|
swapParams |
SwapParams |
transaction |
Transaction <any > |
boolean
| Promise
<boolean
>
▸ Abstract
findClaimSwapTransaction(swapParams
, initTxHash
, blockNumber?
): Promise
<Transaction
<any
>>
Find swap claim transaction from parameters
Name | Type |
---|---|
swapParams |
SwapParams |
initTxHash |
string |
blockNumber? |
number |
Promise
<Transaction
<any
>>
SwapProvider.findClaimSwapTransaction
▸ Abstract
findInitiateSwapTransaction(swapParams
, _blockNumber?
): Promise
<Transaction
<any
>>
Find swap transaction from parameters
Name | Type |
---|---|
swapParams |
SwapParams |
_blockNumber? |
number |
Promise
<Transaction
<any
>>
SwapProvider.findInitiateSwapTransaction
▸ Abstract
findRefundSwapTransaction(swapParams
, initiationTxHash
, blockNumber?
): Promise
<Transaction
<any
>>
Refund the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initiationTxHash |
string |
blockNumber? |
number |
Promise
<Transaction
<any
>>
SwapProvider.findRefundSwapTransaction
▸ generateSecret(message
): Promise
<string
>
Generate a secret.
Name | Type |
---|---|
message |
string |
Promise
<string
>
▸ Abstract
getSwapSecret(claimTxHash
, initTxHash?
): Promise
<string
>
Get secret from claim transaction hash.
Name | Type |
---|---|
claimTxHash |
string |
initTxHash? |
string |
Promise
<string
>
▸ getWallet(): WalletProvider
WalletProvider
▸ Abstract
initiateSwap(swapParams
, fee?
): Promise
<Transaction
<any
>>
Initiate a swap
Name | Type |
---|---|
swapParams |
SwapParams |
fee? |
FeeType |
Promise
<Transaction
<any
>>
▸ Abstract
refundSwap(swapParams
, initTx
, fee?
): Promise
<Transaction
<any
>>
Refund the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initTx |
string |
fee? |
FeeType |
Promise
<Transaction
<any
>>
▸ setWallet(wallet
): void
Name | Type |
---|---|
wallet |
WalletProvider |
void
▸ Abstract
updateTransactionFee(tx
, newFee
): Promise
<Transaction
<any
>>
Name | Type |
---|---|
tx |
string | Transaction <any > |
newFee |
FeeType |
Promise
<Transaction
<any
>>
▸ validateSwapParams(swapParams
): void
Name | Type |
---|---|
swapParams |
SwapParams |
void
▸ 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
>