-
Notifications
You must be signed in to change notification settings - Fork 69
@liquality.bitcoin.BitcoinSwapEsploraProvider
@liquality/bitcoin.BitcoinSwapEsploraProvider
-
↳
BitcoinSwapEsploraProvider
- canUpdateFee
- claimSwap
- doesTransactionMatchInitiation
- doesTransactionMatchRedeem
- extractSwapParams
- findClaimSwapTransaction
- findInitiateSwapTransaction
- findRefundSwapTransaction
- findSwapTransaction
- generateSecret
- getInputScript
- getSwapOutput
- getSwapPaymentVariants
- getSwapSecret
- getWallet
- initiateSwap
- refundSwap
- setWallet
- updateTransactionFee
- validateSwapParams
- verifyInitiateSwapTransaction
• new BitcoinSwapEsploraProvider(options
, walletProvider
)
Name | Type |
---|---|
options |
BitcoinSwapProviderOptions |
walletProvider |
BitcoinBaseWalletProvider <any , any > |
BitcoinSwapBaseProvider.constructor
bitcoin/lib/swap/BitcoinSwapEsploraProvider.ts:11
• Protected
_mode: SwapMode
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:20
• Protected
_network: BitcoinNetwork
BitcoinSwapBaseProvider._network
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:19
• Protected
walletProvider: IBitcoinWallet
<BitcoinBaseChainProvider
, any
>
BitcoinSwapBaseProvider.walletProvider
client/dist/lib/Swap.d.ts:4
▸ canUpdateFee(): boolean
boolean
BitcoinSwapBaseProvider.canUpdateFee
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:355
▸ claimSwap(swapParams
, initiationTxHash
, secret
, feePerByte
): Promise
<Transaction
<Transaction
>>
Claim the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initiationTxHash |
string |
secret |
string |
feePerByte |
number |
Promise
<Transaction
<Transaction
>>
BitcoinSwapBaseProvider.claimSwap
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:53
▸ Protected
doesTransactionMatchInitiation(swapParams
, transaction
): boolean
Name | Type |
---|---|
swapParams |
SwapParams |
transaction |
Transaction <Transaction > |
boolean
BitcoinSwapBaseProvider.doesTransactionMatchInitiation
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:410
▸ Protected
doesTransactionMatchRedeem(initiationTxHash
, tx
, isRefund
): boolean
Name | Type |
---|---|
initiationTxHash |
string |
tx |
Transaction <Transaction > |
isRefund |
boolean |
boolean
BitcoinSwapBaseProvider.doesTransactionMatchRedeem
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:397
▸ Protected
extractSwapParams(outputScript
): Object
Name | Type |
---|---|
outputScript |
string |
Object
Name | Type |
---|---|
expiration |
number |
recipientPublicKey |
string |
refundPublicKey |
string |
secretHash |
string |
BitcoinSwapBaseProvider.extractSwapParams
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:325
▸ findClaimSwapTransaction(swapParams
, initTxHash
, blockNumber?
): Promise
<Transaction
<any
>>
Find swap claim transaction from parameters
Name | Type |
---|---|
swapParams |
SwapParams |
initTxHash |
string |
blockNumber? |
number |
Promise
<Transaction
<any
>>
BitcoinSwapBaseProvider.findClaimSwapTransaction
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:90
▸ findInitiateSwapTransaction(swapParams
, blockNumber?
): Promise
<Transaction
<any
>>
Find swap transaction from parameters
Name | Type |
---|---|
swapParams |
SwapParams |
blockNumber? |
number |
Promise
<Transaction
<any
>>
BitcoinSwapBaseProvider.findInitiateSwapTransaction
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:67
▸ findRefundSwapTransaction(swapParams
, initiationTxHash
, blockNumber?
): Promise
<Transaction
<any
>>
Refund the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initiationTxHash |
string |
blockNumber? |
number |
Promise
<Transaction
<any
>>
BitcoinSwapBaseProvider.findRefundSwapTransaction
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:111
▸ findSwapTransaction(swapParams
, _blockNumber
, predicate
): Promise
<Transaction
<Transaction
>>
Name | Type |
---|---|
swapParams |
SwapParams |
_blockNumber |
number |
predicate |
TransactionMatchesFunction |
Promise
<Transaction
<Transaction
>>
BitcoinSwapBaseProvider.findSwapTransaction
bitcoin/lib/swap/BitcoinSwapEsploraProvider.ts:16
▸ generateSecret(message
): Promise
<string
>
Generate a secret.
Name | Type |
---|---|
message |
string |
Promise
<string
>
BitcoinSwapBaseProvider.generateSecret
client/dist/lib/Swap.d.ts:10
▸ Protected
getInputScript(vin
): string
[]
Name | Type |
---|---|
vin |
Input |
string
[]
BitcoinSwapBaseProvider.getInputScript
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:390
▸ Protected
getSwapOutput(swapParams
): Buffer
Name | Type |
---|---|
swapParams |
SwapParams |
Buffer
BitcoinSwapBaseProvider.getSwapOutput
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:124
▸ Protected
getSwapPaymentVariants(swapOutput
): Object
Name | Type |
---|---|
swapOutput |
Buffer |
Object
Name | Type |
---|---|
p2sh |
Payment |
p2shSegwit |
Payment |
p2wsh |
Payment |
BitcoinSwapBaseProvider.getSwapPaymentVariants
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:169
▸ getSwapSecret(claimTxHash
, initTxHash
): Promise
<string
>
Get secret from claim transaction hash.
Name | Type |
---|---|
claimTxHash |
string |
initTxHash |
string |
Promise
<string
>
BitcoinSwapBaseProvider.getSwapSecret
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:74
▸ getWallet(): IBitcoinWallet
<BitcoinBaseChainProvider
, any
>
IBitcoinWallet
<BitcoinBaseChainProvider
, any
>
BitcoinSwapBaseProvider.getWallet
client/dist/lib/Swap.d.ts:7
▸ initiateSwap(swapParams
, feePerByte
): Promise
<Transaction
<any
>>
Initiate a swap
Name | Type |
---|---|
swapParams |
SwapParams |
feePerByte |
number |
Promise
<Transaction
<any
>>
BitcoinSwapBaseProvider.initiateSwap
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:41
▸ refundSwap(swapParams
, initiationTxHash
, feePerByte
): Promise
<Transaction
<Transaction
>>
Refund the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initiationTxHash |
string |
feePerByte |
number |
Promise
<Transaction
<Transaction
>>
BitcoinSwapBaseProvider.refundSwap
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:61
▸ setWallet(wallet
): void
Name | Type |
---|---|
wallet |
IBitcoinWallet <BitcoinBaseChainProvider , any > |
void
BitcoinSwapBaseProvider.setWallet
client/dist/lib/Swap.d.ts:6
▸ updateTransactionFee(tx
, newFeePerByte
): Promise
<Transaction
<any
>>
Name | Type |
---|---|
tx |
string | Transaction <Transaction > |
newFeePerByte |
number |
Promise
<Transaction
<any
>>
BitcoinSwapBaseProvider.updateTransactionFee
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:359
▸ validateSwapParams(swapParams
): void
Name | Type |
---|---|
swapParams |
SwapParams |
void
BitcoinSwapBaseProvider.validateSwapParams
bitcoin/lib/swap/BitcoinSwapBaseProvider.ts:33
▸ 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
>
BitcoinSwapBaseProvider.verifyInitiateSwapTransaction
client/dist/lib/Swap.d.ts:8