-
Notifications
You must be signed in to change notification settings - Fork 69
@liquality.bitcoin.<internal>.Swap
@liquality/bitcoin..Swap
Name | Type |
---|---|
T |
T |
S |
S |
WalletProvider |
extends Wallet <T , S > = any
|
-
Swap
- 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 |
client/dist/lib/Swap.d.ts:5
• Protected
walletProvider: WalletProvider
client/dist/lib/Swap.d.ts:4
▸ Abstract
canUpdateFee(): boolean
boolean
client/dist/lib/Swap.d.ts:18
▸ 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
>>
client/dist/lib/Swap.d.ts:13
▸ Protected
Abstract
doesTransactionMatchInitiation(swapParams
, transaction
): boolean
| Promise
<boolean
>
Name | Type |
---|---|
swapParams |
SwapParams |
transaction |
Transaction <any > |
boolean
| Promise
<boolean
>
client/dist/lib/Swap.d.ts:20
▸ 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
client/dist/lib/Swap.d.ts:14
▸ Abstract
findInitiateSwapTransaction(swapParams
, _blockNumber?
): Promise
<Transaction
<any
>>
Find swap transaction from parameters
Name | Type |
---|---|
swapParams |
SwapParams |
_blockNumber? |
number |
Promise
<Transaction
<any
>>
SwapProvider.findInitiateSwapTransaction
client/dist/lib/Swap.d.ts:12
▸ Abstract
findRefundSwapTransaction(swapParams
, initiationTxHash
, blockNumber?
): Promise
<Transaction
<any
>>
Refund the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initiationTxHash |
string |
blockNumber? |
number |
Promise
<Transaction
<any
>>
SwapProvider.findRefundSwapTransaction
client/dist/lib/Swap.d.ts:16
▸ generateSecret(message
): Promise
<string
>
Generate a secret.
Name | Type |
---|---|
message |
string |
Promise
<string
>
client/dist/lib/Swap.d.ts:10
▸ Abstract
getSwapSecret(claimTxHash
, initTxHash?
): Promise
<string
>
Get secret from claim transaction hash.
Name | Type |
---|---|
claimTxHash |
string |
initTxHash? |
string |
Promise
<string
>
client/dist/lib/Swap.d.ts:17
▸ getWallet(): WalletProvider
WalletProvider
client/dist/lib/Swap.d.ts:7
▸ Abstract
initiateSwap(swapParams
, fee?
): Promise
<Transaction
<any
>>
Initiate a swap
Name | Type |
---|---|
swapParams |
SwapParams |
fee? |
FeeType |
Promise
<Transaction
<any
>>
client/dist/lib/Swap.d.ts:11
▸ Abstract
refundSwap(swapParams
, initTx
, fee?
): Promise
<Transaction
<any
>>
Refund the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initTx |
string |
fee? |
FeeType |
Promise
<Transaction
<any
>>
client/dist/lib/Swap.d.ts:15
▸ setWallet(wallet
): void
Name | Type |
---|---|
wallet |
WalletProvider |
void
client/dist/lib/Swap.d.ts:6
▸ Abstract
updateTransactionFee(tx
, newFee
): Promise
<Transaction
<any
>>
Name | Type |
---|---|
tx |
string | Transaction <any > |
newFee |
FeeType |
Promise
<Transaction
<any
>>
client/dist/lib/Swap.d.ts:19
▸ 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
>
SwapProvider.verifyInitiateSwapTransaction
client/dist/lib/Swap.d.ts:8