-
Notifications
You must be signed in to change notification settings - Fork 69
@liquality.bitcoin ledger.BitcoinLedgerProvider
@liquality/bitcoin-ledger.BitcoinLedgerProvider
-
↳
BitcoinLedgerProvider
- _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 BitcoinLedgerProvider(options
, chainProvider
)
Name | Type |
---|---|
options |
BitcoinLedgerProviderOptions |
chainProvider |
Chain <BitcoinBaseChainProvider , Network > |
BitcoinBaseWalletProvider.constructor
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:17
• Protected
_addressType: AddressType
BitcoinBaseWalletProvider._addressType
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:20
• Protected
_baseDerivationPath: string
BitcoinBaseWalletProvider._baseDerivationPath
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:18
• Protected
_derivationCache: DerivationCache
BitcoinBaseWalletProvider._derivationCache
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:21
• Protected
_network: BitcoinNetwork
BitcoinBaseWalletProvider._network
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:19
• Protected
chainProvider: Chain
<any
, Network
>
BitcoinBaseWalletProvider.chainProvider
client/dist/lib/Wallet.d.ts:4
▸ Protected
_getUsedUnusedAddresses(numAddressPerCall
, addressType
): Promise
<{ unusedAddress
: { change
: Address
; external
: Address
} ; usedAddresses
: Address
[] }>
Name | Type |
---|---|
numAddressPerCall |
number |
addressType |
AddressSearchType |
Promise
<{ unusedAddress
: { change
: Address
; external
: Address
} ; usedAddresses
: Address
[] }>
BitcoinBaseWalletProvider._getUsedUnusedAddresses
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:47
▸ Protected
_sendTransaction(transactions
, feePerByte?
): Promise
<Transaction
<Transaction
>>
Name | Type |
---|---|
transactions |
OutputTarget [] |
feePerByte? |
number |
Promise
<Transaction
<Transaction
>>
BitcoinBaseWalletProvider._sendTransaction
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:43
▸ Protected
baseDerivationNode(): Promise
<BIP32Interface
>
Promise
<BIP32Interface
>
BitcoinBaseWalletProvider.baseDerivationNode
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:241
▸ Protected
buildSweepTransaction(_externalChangeAddress
, _feePerByte?
): Promise
<{ fee
: number
; hex
: string
}>
Name | Type |
---|---|
_externalChangeAddress |
string |
_feePerByte? |
number |
Promise
<{ fee
: number
; hex
: string
}>
BitcoinBaseWalletProvider.buildSweepTransaction
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:237
▸ 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-ledger/lib/BitcoinLedgerProvider.ts:255
▸ canUpdateFee(): boolean
boolean
BitcoinBaseWalletProvider.canUpdateFee
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:58
▸ 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
>
BitcoinBaseWalletProvider.exportPrivateKey
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:50
▸ Protected
findAddress(addresses
, change?
): Promise
<Address
>
Name | Type |
---|---|
addresses |
string [] |
change? |
boolean |
Promise
<Address
>
BitcoinBaseWalletProvider.findAddress
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:44
▸ getAddress(): Promise
<AddressType
>
Promise
<AddressType
>
BitcoinBaseWalletProvider.getAddress
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:40
▸ Protected
getAddressFromPublicKey(publicKey
): string
Name | Type |
---|---|
publicKey |
Buffer |
string
BitcoinBaseWalletProvider.getAddressFromPublicKey
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:63
▸ getAddresses(startingIndex?
, numAddresses?
, change?
): Promise
<Address
[]>
Get addresses/accounts of the user.
Name | Type |
---|---|
startingIndex? |
number |
numAddresses? |
number |
change? |
boolean |
Promise
<Address
[]>
BitcoinBaseWalletProvider.getAddresses
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:37
▸ getBalance(assets
): Promise
<BigNumber
[]>
Name | Type |
---|---|
assets |
Asset [] |
Promise
<BigNumber
[]>
BitcoinBaseWalletProvider.getBalance
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:45
▸ getChainProvider(): Chain
<any
, Network
>
BitcoinBaseWalletProvider.getChainProvider
client/dist/lib/Wallet.d.ts:7
▸ getConnectedNetwork(): Promise
<Network
>
Retrieve the network connected to by the wallet
Promise
<Network
>
BitcoinBaseWalletProvider.getConnectedNetwork
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:32
▸ getDerivationCache(): DerivationCache
BitcoinBaseWalletProvider.getDerivationCache
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:34
▸ Protected
getDerivationPathAddress(path
): Promise
<Address
>
Name | Type |
---|---|
path |
string |
Promise
<Address
>
BitcoinBaseWalletProvider.getDerivationPathAddress
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:46
▸ Protected
getInputsForAmount(_targets
, feePerByte?
, fixedInputs?
, numAddressPerCall?
, sweep?
): Promise
<{ change
: CoinSelectTarget
; fee
: number
; inputs
: UTXO
[] ; outputs
: CoinSelectTarget
[] }>
Name | Type |
---|---|
_targets |
OutputTarget [] |
feePerByte? |
number |
fixedInputs? |
Input [] |
numAddressPerCall? |
number |
sweep? |
boolean |
Promise
<{ change
: CoinSelectTarget
; fee
: number
; inputs
: UTXO
[] ; outputs
: CoinSelectTarget
[] }>
BitcoinBaseWalletProvider.getInputsForAmount
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:56
▸ Protected
getPaymentVariantFromPublicKey(publicKey
): Payment
Name | Type |
---|---|
publicKey |
Buffer |
Payment
BitcoinBaseWalletProvider.getPaymentVariantFromPublicKey
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:64
▸ getSigner(): Promise
<null
>
Promise
<null
>
BitcoinBaseWalletProvider.getSigner
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:36
▸ Protected
getTotalFee(opts
, max
): Promise
<number
>
Name | Type |
---|---|
opts |
TransactionRequest |
max |
boolean |
Promise
<number
>
BitcoinBaseWalletProvider.getTotalFee
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:55
▸ getTotalFees(transactions
, max
): Promise
<any
>
Name | Type |
---|---|
transactions |
TransactionRequest [] |
max |
boolean |
Promise
<any
>
BitcoinBaseWalletProvider.getTotalFees
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:42
▸ getUnusedAddress(change?
, numAddressPerCall?
): Promise
<Address
>
Get unused address/account of the user.
Name | Type |
---|---|
change? |
boolean |
numAddressPerCall? |
number |
Promise
<Address
>
BitcoinBaseWalletProvider.getUnusedAddress
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:35
▸ getUsedAddresses(numAddressPerCall?
): Promise
<Address
[]>
Get used addresses/accounts of the user.
Name | Type |
---|---|
numAddressPerCall? |
number |
Promise
<Address
[]>
BitcoinBaseWalletProvider.getUsedAddresses
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:36
▸ getWalletAddress(address
): Promise
<Address
>
Name | Type |
---|---|
address |
string |
Promise
<Address
>
BitcoinBaseWalletProvider.getWalletAddress
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:45
▸ isWalletAvailable(): Promise
<boolean
>
Retrieve the availability status of the wallet
Promise
<boolean
>
BitcoinBaseWalletProvider.isWalletAvailable
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:54
▸ sendBatchTransaction(transactions
): Promise
<Transaction
<Transaction
>[]>
Create, sign & broad a transaction with multiple outputs.
Name | Type |
---|---|
transactions |
TransactionRequest [] |
Promise
<Transaction
<Transaction
>[]>
BitcoinBaseWalletProvider.sendBatchTransaction
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:39
▸ Protected
sendOptionsToOutputs(transactions
): OutputTarget
[]
Name | Type |
---|---|
transactions |
TransactionRequest [] |
BitcoinBaseWalletProvider.sendOptionsToOutputs
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:62
▸ sendSweepTransaction(externalChangeAddress
, _asset
, feePerByte
): Promise
<Transaction
<Transaction
>>
Create, sign & broadcast a sweep transaction.
Name | Type |
---|---|
externalChangeAddress |
AddressType |
_asset |
Asset |
feePerByte |
number |
Promise
<Transaction
<Transaction
>>
BitcoinBaseWalletProvider.sendSweepTransaction
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:40
▸ sendTransaction(options
): Promise
<Transaction
<Transaction
>>
Create, sign & broadcast a transaction.
Name | Type |
---|---|
options |
TransactionRequest |
Promise
<Transaction
<Transaction
>>
BitcoinBaseWalletProvider.sendTransaction
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:38
▸ setChainProvider(chainProvider
): void
Name | Type |
---|---|
chainProvider |
Chain <any , Network > |
void
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 ; vout : any }] |
addresses |
string |
tx |
any |
lockTime? |
number |
segwit? |
boolean |
Promise
<Buffer
[]>
BitcoinBaseWalletProvider.signBatchP2SHTransaction
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:187
▸ signMessage(message
, from
): Promise
<string
>
Sign a message.
Name | Type |
---|---|
message |
string |
from |
string |
Promise
<string
>
BitcoinBaseWalletProvider.signMessage
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:24
▸ signPSBT(data
, inputs
): Promise
<string
>
Name | Type |
---|---|
data |
string |
inputs |
PsbtInputTarget [] |
Promise
<string
>
BitcoinBaseWalletProvider.signPSBT
bitcoin-ledger/lib/BitcoinLedgerProvider.ts:62
▸ updateTransactionFee(tx
, newFeePerByte
): Promise
<Transaction
<Transaction
>>
Update the fee of a transaction.
Name | Type |
---|---|
tx |
string | Transaction <Transaction > |
newFeePerByte |
number |
Promise
<Transaction
<Transaction
>>
BitcoinBaseWalletProvider.updateTransactionFee
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:41
▸ Protected
withCachedUtxos(func
): Promise
<any
>
Name | Type |
---|---|
func |
() => any
|
Promise
<any
>
BitcoinBaseWalletProvider.withCachedUtxos
bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:54