-
Notifications
You must be signed in to change notification settings - Fork 69
@liquality.bitcoin.BitcoinHDWalletProvider
@liquality/bitcoin.BitcoinHDWalletProvider
-
↳
BitcoinHDWalletProvider
- _getUsedUnusedAddresses
- _sendTransaction
- baseDerivationNode
- buildSweepTransaction
- buildTransaction
- canUpdateFee
- exportPrivateKey
- findAddress
- getAddress
- getAddressFromPublicKey
- getAddresses
- getBalance
- getChainProvider
- getConnectedNetwork
- getDerivationCache
- getDerivationPathAddress
- getInputsForAmount
- getPaymentVariantFromPublicKey
- getSigner
- getTotalFee
- getTotalFees
- getUnusedAddress
- getUsedAddresses
- getWalletAddress
- isWalletAvailable
- sendBatchTransaction
- sendOptionsToOutputs
- sendSweepTransaction
- sendTransaction
- setChainProvider
- signBatchP2SHTransaction
- signMessage
- signPSBT
- updateTransactionFee
- withCachedUtxos
• new BitcoinHDWalletProvider(options
, chainProvider
)
Name | Type |
---|---|
options |
BitcoinHDWalletProviderOptions |
chainProvider |
Chain <BitcoinBaseChainProvider , Network > |
BitcoinBaseWalletProvider.constructor
bitcoin/lib/wallet/BitcoinHDWallet.ts:17
• Protected
_addressType: AddressType
BitcoinBaseWalletProvider._addressType
bitcoin/lib/wallet/BitcoinBaseWallet.ts:36
• Protected
_baseDerivationPath: string
BitcoinBaseWalletProvider._baseDerivationPath
bitcoin/lib/wallet/BitcoinBaseWallet.ts:34
• Protected
_derivationCache: DerivationCache
BitcoinBaseWalletProvider._derivationCache
bitcoin/lib/wallet/BitcoinBaseWallet.ts:37
• Protected
_network: BitcoinNetwork
BitcoinBaseWalletProvider._network
bitcoin/lib/wallet/BitcoinBaseWallet.ts:35
• Protected
chainProvider: Chain
<any
, Network
>
BitcoinBaseWalletProvider.chainProvider
client/dist/lib/Wallet.d.ts:4
▸ Protected
_getUsedUnusedAddresses(numAddressPerCall?
, addressType
): Promise
<{ unusedAddress
: { change
: Address
; external
: Address
} = unusedAddressMap; usedAddresses
: Address
[] }>
Name | Type | Default value |
---|---|---|
numAddressPerCall |
number |
100 |
addressType |
AddressSearchType |
undefined |
Promise
<{ unusedAddress
: { change
: Address
; external
: Address
} = unusedAddressMap; usedAddresses
: Address
[] }>
BitcoinBaseWalletProvider._getUsedUnusedAddresses
bitcoin/lib/wallet/BitcoinBaseWallet.ts:211
▸ Protected
_sendTransaction(transactions
, feePerByte?
): Promise
<Transaction
<Transaction
>>
Name | Type |
---|---|
transactions |
OutputTarget [] |
feePerByte? |
number |
Promise
<Transaction
<Transaction
>>
BitcoinBaseWalletProvider._sendTransaction
bitcoin/lib/wallet/BitcoinBaseWallet.ts:157
▸ Protected
baseDerivationNode(): Promise
<BIP32Interface
>
Promise
<BIP32Interface
>
BitcoinBaseWalletProvider.baseDerivationNode
bitcoin/lib/wallet/BitcoinHDWallet.ts:64
▸ Protected
buildSweepTransaction(externalChangeAddress
, feePerByte
): Promise
<{ fee
: number
; hex
: string
}>
Name | Type |
---|---|
externalChangeAddress |
string |
feePerByte |
number |
Promise
<{ fee
: number
; hex
: string
}>
BitcoinBaseWalletProvider.buildSweepTransaction
bitcoin/lib/wallet/BitcoinHDWallet.ts:144
▸ Protected
buildTransaction(targets
, feePerByte?
, fixedInputs?
): Promise
<{ fee
: number
; hex
: string
}>
Name | Type |
---|---|
targets |
OutputTarget [] |
feePerByte? |
number |
fixedInputs? |
Input [] |
Promise
<{ fee
: number
; hex
: string
}>
BitcoinBaseWalletProvider.buildTransaction
bitcoin/lib/wallet/BitcoinHDWallet.ts:73
▸ canUpdateFee(): boolean
boolean
BitcoinBaseWalletProvider.canUpdateFee
bitcoin/lib/wallet/BitcoinHDWallet.ts:27
▸ exportPrivateKey(): Promise
<string
>
Exports the private key for the account for BTC, https://en.bitcoin.it/wiki/Wallet_import_format for ETH, the privateKey for NEAR, the secretKey
Promise
<string
>
IBitcoinWallet.exportPrivateKey
BitcoinBaseWalletProvider.exportPrivateKey
bitcoin/lib/wallet/BitcoinHDWallet.ts:52
▸ Protected
findAddress(addresses
, change?
): Promise
<Address
>
Name | Type | Default value |
---|---|---|
addresses |
string [] |
undefined |
change |
boolean |
false |
Promise
<Address
>
BitcoinBaseWalletProvider.findAddress
bitcoin/lib/wallet/BitcoinBaseWallet.ts:163
▸ getAddress(): Promise
<AddressType
>
Promise
<AddressType
>
BitcoinBaseWalletProvider.getAddress
bitcoin/lib/wallet/BitcoinHDWallet.ts:35
▸ Protected
getAddressFromPublicKey(publicKey
): string
Name | Type |
---|---|
publicKey |
Buffer |
string
BitcoinBaseWalletProvider.getAddressFromPublicKey
bitcoin/lib/wallet/BitcoinBaseWallet.ts:464
▸ getAddresses(startingIndex?
, numAddresses?
, change?
): Promise
<Address
[]>
Get addresses/accounts of the user.
Name | Type | Default value |
---|---|---|
startingIndex |
number |
0 |
numAddresses |
number |
1 |
change |
boolean |
false |
Promise
<Address
[]>
BitcoinBaseWalletProvider.getAddresses
bitcoin/lib/wallet/BitcoinBaseWallet.ts:86
▸ getBalance(_assets
): Promise
<BigNumber
[]>
Name | Type |
---|---|
_assets |
Asset [] |
Promise
<BigNumber
[]>
BitcoinBaseWalletProvider.getBalance
bitcoin/lib/wallet/BitcoinHDWallet.ts:40
▸ getChainProvider(): Chain
<any
, Network
>
IBitcoinWallet.getChainProvider
BitcoinBaseWalletProvider.getChainProvider
client/dist/lib/Wallet.d.ts:7
▸ getConnectedNetwork(): Promise
<BitcoinNetwork
>
Retrieve the network connected to by the wallet
Promise
<BitcoinNetwork
>
IBitcoinWallet.getConnectedNetwork
BitcoinBaseWalletProvider.getConnectedNetwork
bitcoin/lib/wallet/BitcoinHDWallet.ts:56
▸ getDerivationCache(): DerivationCache
BitcoinBaseWalletProvider.getDerivationCache
bitcoin/lib/wallet/BitcoinBaseWallet.ts:70
▸ Protected
getDerivationPathAddress(path
): Promise
<Address
>
Name | Type |
---|---|
path |
string |
Promise
<Address
>
BitcoinBaseWalletProvider.getDerivationPathAddress
bitcoin/lib/wallet/BitcoinBaseWallet.ts:192
▸ Protected
getInputsForAmount(_targets
, feePerByte?
, fixedInputs?
, numAddressPerCall?
, sweep?
): Promise
<{ change
: CoinSelectTarget
; fee
: number
; inputs
: UTXO
[] ; outputs
: CoinSelectTarget
[] }>
Name | Type | Default value |
---|---|---|
_targets |
OutputTarget [] |
undefined |
feePerByte? |
number |
undefined |
fixedInputs |
Input [] |
[] |
numAddressPerCall |
number |
100 |
sweep |
boolean |
false |
Promise
<{ change
: CoinSelectTarget
; fee
: number
; inputs
: UTXO
[] ; outputs
: CoinSelectTarget
[] }>
BitcoinBaseWalletProvider.getInputsForAmount
bitcoin/lib/wallet/BitcoinBaseWallet.ts:317
▸ Protected
getPaymentVariantFromPublicKey(publicKey
): Payment
Name | Type |
---|---|
publicKey |
Buffer |
Payment
BitcoinBaseWalletProvider.getPaymentVariantFromPublicKey
bitcoin/lib/wallet/BitcoinBaseWallet.ts:468
▸ getSigner(): Promise
<null
>
Promise
<null
>
BitcoinBaseWalletProvider.getSigner
bitcoin/lib/wallet/BitcoinHDWallet.ts:31
▸ Protected
getTotalFee(opts
, max
): Promise
<number
>
Name | Type |
---|---|
opts |
TransactionRequest |
max |
boolean |
Promise
<number
>
BitcoinBaseWalletProvider.getTotalFee
bitcoin/lib/wallet/BitcoinBaseWallet.ts:300
▸ getTotalFees(transactions
, max
): Promise
<any
>
Name | Type |
---|---|
transactions |
TransactionRequest [] |
max |
boolean |
Promise
<any
>
BitcoinBaseWalletProvider.getTotalFees
bitcoin/lib/wallet/BitcoinBaseWallet.ts:145
▸ getUnusedAddress(change?
, numAddressPerCall?
): Promise
<Address
>
Get unused address/account of the user.
Name | Type | Default value |
---|---|---|
change |
boolean |
false |
numAddressPerCall |
number |
100 |
Promise
<Address
>
IBitcoinWallet.getUnusedAddress
BitcoinBaseWalletProvider.getUnusedAddress
bitcoin/lib/wallet/BitcoinBaseWallet.ts:74
▸ getUsedAddresses(numAddressPerCall?
): Promise
<Address
[]>
Get used addresses/accounts of the user.
Name | Type | Default value |
---|---|---|
numAddressPerCall |
number |
100 |
Promise
<Address
[]>
IBitcoinWallet.getUsedAddresses
BitcoinBaseWalletProvider.getUsedAddresses
bitcoin/lib/wallet/BitcoinBaseWallet.ts:80
▸ getWalletAddress(address
): Promise
<Address
>
Name | Type |
---|---|
address |
string |
Promise
<Address
>
IBitcoinWallet.getWalletAddress
BitcoinBaseWalletProvider.getWalletAddress
bitcoin/lib/wallet/BitcoinBaseWallet.ts:178
▸ isWalletAvailable(): Promise
<boolean
>
Retrieve the availability status of the wallet
Promise
<boolean
>
IBitcoinWallet.isWalletAvailable
BitcoinBaseWalletProvider.isWalletAvailable
bitcoin/lib/wallet/BitcoinHDWallet.ts:60
▸ sendBatchTransaction(transactions
): Promise
<Transaction
<Transaction
>[]>
Create, sign & broad a transaction with multiple outputs.
Name | Type |
---|---|
transactions |
TransactionRequest [] |
Promise
<Transaction
<Transaction
>[]>
IBitcoinWallet.sendBatchTransaction
BitcoinBaseWalletProvider.sendBatchTransaction
bitcoin/lib/wallet/BitcoinBaseWallet.ts:111
▸ Protected
sendOptionsToOutputs(transactions
): OutputTarget
[]
Name | Type |
---|---|
transactions |
TransactionRequest [] |
BitcoinBaseWalletProvider.sendOptionsToOutputs
bitcoin/lib/wallet/BitcoinBaseWallet.ts:441
▸ sendSweepTransaction(externalChangeAddress
, _asset
, feePerByte
): Promise
<Transaction
<Transaction
>>
Create, sign & broadcast a sweep transaction.
Name | Type |
---|---|
externalChangeAddress |
AddressType |
_asset |
Asset |
feePerByte |
number |
Promise
<Transaction
<Transaction
>>
IBitcoinWallet.sendSweepTransaction
BitcoinBaseWalletProvider.sendSweepTransaction
bitcoin/lib/wallet/BitcoinBaseWallet.ts:115
▸ sendTransaction(options
): Promise
<Transaction
<Transaction
>>
Create, sign & broadcast a transaction.
Name | Type |
---|---|
options |
TransactionRequest |
Promise
<Transaction
<Transaction
>>
IBitcoinWallet.sendTransaction
BitcoinBaseWalletProvider.sendTransaction
bitcoin/lib/wallet/BitcoinBaseWallet.ts:107
▸ setChainProvider(chainProvider
): void
Name | Type |
---|---|
chainProvider |
Chain <any , Network > |
void
IBitcoinWallet.setChainProvider
BitcoinBaseWalletProvider.setChainProvider
client/dist/lib/Wallet.d.ts:6
▸ signBatchP2SHTransaction(inputs
, addresses
, tx
, lockTime?
, segwit?
): Promise
<Buffer
[]>
Name | Type |
---|---|
inputs |
[{ index : number ; inputTxHex : string ; outputScript : Buffer ; txInputIndex? : number ; vout : any }] |
addresses |
string |
tx |
any |
lockTime? |
number |
segwit? |
boolean |
Promise
<Buffer
[]>
BitcoinBaseWalletProvider.signBatchP2SHTransaction
bitcoin/lib/wallet/BitcoinHDWallet.ts:171
▸ signMessage(message
, from
): Promise
<string
>
Sign a message.
Name | Type |
---|---|
message |
string |
from |
string |
Promise
<string
>
BitcoinBaseWalletProvider.signMessage
bitcoin/lib/wallet/BitcoinHDWallet.ts:45
▸ signPSBT(data
, inputs
): Promise
<string
>
Name | Type |
---|---|
data |
string |
inputs |
PsbtInputTarget [] |
Promise
<string
>
BitcoinBaseWalletProvider.signPSBT
bitcoin/lib/wallet/BitcoinHDWallet.ts:162
▸ updateTransactionFee(tx
, newFeePerByte
): Promise
<Transaction
<Transaction
>>
Update the fee of a transaction.
Name | Type |
---|---|
tx |
string | Transaction <Transaction > |
newFeePerByte |
number |
Promise
<Transaction
<Transaction
>>
IBitcoinWallet.updateTransactionFee
BitcoinBaseWalletProvider.updateTransactionFee
bitcoin/lib/wallet/BitcoinBaseWallet.ts:121
▸ Protected
withCachedUtxos(func
): Promise
<any
>
Name | Type |
---|---|
func |
() => any
|
Promise
<any
>