Skip to content

@liquality.bitcoin ledger.BitcoinLedgerProvider

Krasimir Raykov edited this page Mar 30, 2022 · 4 revisions

Class: BitcoinLedgerProvider

@liquality/bitcoin-ledger.BitcoinLedgerProvider

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new BitcoinLedgerProvider(options, chainProvider)

Parameters

Name Type
options BitcoinLedgerProviderOptions
chainProvider Chain<BitcoinBaseChainProvider, Network>

Overrides

BitcoinBaseWalletProvider.constructor

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:17

Properties

_addressType

Protected _addressType: AddressType

Inherited from

BitcoinBaseWalletProvider._addressType

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:20


_baseDerivationPath

Protected _baseDerivationPath: string

Inherited from

BitcoinBaseWalletProvider._baseDerivationPath

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:18


_derivationCache

Protected _derivationCache: DerivationCache

Inherited from

BitcoinBaseWalletProvider._derivationCache

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:21


_network

Protected _network: BitcoinNetwork

Inherited from

BitcoinBaseWalletProvider._network

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:19


chainProvider

Protected chainProvider: Chain<any, Network>

Inherited from

BitcoinBaseWalletProvider.chainProvider

Defined in

client/dist/lib/Wallet.d.ts:4

Methods

_getUsedUnusedAddresses

Protected _getUsedUnusedAddresses(numAddressPerCall, addressType): Promise<{ unusedAddress: { change: Address ; external: Address } ; usedAddresses: Address[] }>

Parameters

Name Type
numAddressPerCall number
addressType AddressSearchType

Returns

Promise<{ unusedAddress: { change: Address ; external: Address } ; usedAddresses: Address[] }>

Inherited from

BitcoinBaseWalletProvider._getUsedUnusedAddresses

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:47


_sendTransaction

Protected _sendTransaction(transactions, feePerByte?): Promise<Transaction<Transaction>>

Parameters

Name Type
transactions OutputTarget[]
feePerByte? number

Returns

Promise<Transaction<Transaction>>

Inherited from

BitcoinBaseWalletProvider._sendTransaction

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:43


baseDerivationNode

Protected baseDerivationNode(): Promise<BIP32Interface>

Returns

Promise<BIP32Interface>

Overrides

BitcoinBaseWalletProvider.baseDerivationNode

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:241


buildSweepTransaction

Protected buildSweepTransaction(_externalChangeAddress, _feePerByte?): Promise<{ fee: number ; hex: string }>

Parameters

Name Type
_externalChangeAddress string
_feePerByte? number

Returns

Promise<{ fee: number ; hex: string }>

Overrides

BitcoinBaseWalletProvider.buildSweepTransaction

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:237


buildTransaction

Protected buildTransaction(targets, feePerByte?, fixedInputs?): Promise<{ fee: number ; hex: string }>

Parameters

Name Type
targets OutputTarget[]
feePerByte? number
fixedInputs? Input[]

Returns

Promise<{ fee: number ; hex: string }>

Overrides

BitcoinBaseWalletProvider.buildTransaction

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:255


canUpdateFee

canUpdateFee(): boolean

Returns

boolean

Overrides

BitcoinBaseWalletProvider.canUpdateFee

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:58


exportPrivateKey

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

Returns

Promise<string>

Overrides

BitcoinBaseWalletProvider.exportPrivateKey

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:50


findAddress

Protected findAddress(addresses, change?): Promise<Address>

Parameters

Name Type
addresses string[]
change? boolean

Returns

Promise<Address>

Inherited from

BitcoinBaseWalletProvider.findAddress

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:44


getAddress

getAddress(): Promise<AddressType>

Returns

Promise<AddressType>

Overrides

BitcoinBaseWalletProvider.getAddress

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:40


getAddressFromPublicKey

Protected getAddressFromPublicKey(publicKey): string

Parameters

Name Type
publicKey Buffer

Returns

string

Inherited from

BitcoinBaseWalletProvider.getAddressFromPublicKey

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:63


getAddresses

getAddresses(startingIndex?, numAddresses?, change?): Promise<Address[]>

Get addresses/accounts of the user.

Parameters

Name Type
startingIndex? number
numAddresses? number
change? boolean

Returns

Promise<Address[]>

Inherited from

BitcoinBaseWalletProvider.getAddresses

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:37


getBalance

getBalance(assets): Promise<BigNumber[]>

Parameters

Name Type
assets Asset[]

Returns

Promise<BigNumber[]>

Overrides

BitcoinBaseWalletProvider.getBalance

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:45


getChainProvider

getChainProvider(): Chain<any, Network>

Returns

Chain<any, Network>

Inherited from

BitcoinBaseWalletProvider.getChainProvider

Defined in

client/dist/lib/Wallet.d.ts:7


getConnectedNetwork

getConnectedNetwork(): Promise<Network>

Retrieve the network connected to by the wallet

Returns

Promise<Network>

Overrides

BitcoinBaseWalletProvider.getConnectedNetwork

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:32


getDerivationCache

getDerivationCache(): DerivationCache

Returns

DerivationCache

Inherited from

BitcoinBaseWalletProvider.getDerivationCache

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:34


getDerivationPathAddress

Protected getDerivationPathAddress(path): Promise<Address>

Parameters

Name Type
path string

Returns

Promise<Address>

Inherited from

BitcoinBaseWalletProvider.getDerivationPathAddress

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:46


getInputsForAmount

Protected getInputsForAmount(_targets, feePerByte?, fixedInputs?, numAddressPerCall?, sweep?): Promise<{ change: CoinSelectTarget ; fee: number ; inputs: UTXO[] ; outputs: CoinSelectTarget[] }>

Parameters

Name Type
_targets OutputTarget[]
feePerByte? number
fixedInputs? Input[]
numAddressPerCall? number
sweep? boolean

Returns

Promise<{ change: CoinSelectTarget ; fee: number ; inputs: UTXO[] ; outputs: CoinSelectTarget[] }>

Inherited from

BitcoinBaseWalletProvider.getInputsForAmount

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:56


getPaymentVariantFromPublicKey

Protected getPaymentVariantFromPublicKey(publicKey): Payment

Parameters

Name Type
publicKey Buffer

Returns

Payment

Inherited from

BitcoinBaseWalletProvider.getPaymentVariantFromPublicKey

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:64


getSigner

getSigner(): Promise<null>

Returns

Promise<null>

Overrides

BitcoinBaseWalletProvider.getSigner

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:36


getTotalFee

Protected getTotalFee(opts, max): Promise<number>

Parameters

Name Type
opts TransactionRequest
max boolean

Returns

Promise<number>

Inherited from

BitcoinBaseWalletProvider.getTotalFee

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:55


getTotalFees

getTotalFees(transactions, max): Promise<any>

Parameters

Name Type
transactions TransactionRequest[]
max boolean

Returns

Promise<any>

Inherited from

BitcoinBaseWalletProvider.getTotalFees

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:42


getUnusedAddress

getUnusedAddress(change?, numAddressPerCall?): Promise<Address>

Get unused address/account of the user.

Parameters

Name Type
change? boolean
numAddressPerCall? number

Returns

Promise<Address>

Inherited from

BitcoinBaseWalletProvider.getUnusedAddress

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:35


getUsedAddresses

getUsedAddresses(numAddressPerCall?): Promise<Address[]>

Get used addresses/accounts of the user.

Parameters

Name Type
numAddressPerCall? number

Returns

Promise<Address[]>

Inherited from

BitcoinBaseWalletProvider.getUsedAddresses

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:36


getWalletAddress

getWalletAddress(address): Promise<Address>

Parameters

Name Type
address string

Returns

Promise<Address>

Inherited from

BitcoinBaseWalletProvider.getWalletAddress

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:45


isWalletAvailable

isWalletAvailable(): Promise<boolean>

Retrieve the availability status of the wallet

Returns

Promise<boolean>

Overrides

BitcoinBaseWalletProvider.isWalletAvailable

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:54


sendBatchTransaction

sendBatchTransaction(transactions): Promise<Transaction<Transaction>[]>

Create, sign & broad a transaction with multiple outputs.

Parameters

Name Type
transactions TransactionRequest[]

Returns

Promise<Transaction<Transaction>[]>

Inherited from

BitcoinBaseWalletProvider.sendBatchTransaction

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:39


sendOptionsToOutputs

Protected sendOptionsToOutputs(transactions): OutputTarget[]

Parameters

Name Type
transactions TransactionRequest[]

Returns

OutputTarget[]

Inherited from

BitcoinBaseWalletProvider.sendOptionsToOutputs

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:62


sendSweepTransaction

sendSweepTransaction(externalChangeAddress, _asset, feePerByte): Promise<Transaction<Transaction>>

Create, sign & broadcast a sweep transaction.

Parameters

Name Type
externalChangeAddress AddressType
_asset Asset
feePerByte number

Returns

Promise<Transaction<Transaction>>

Inherited from

BitcoinBaseWalletProvider.sendSweepTransaction

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:40


sendTransaction

sendTransaction(options): Promise<Transaction<Transaction>>

Create, sign & broadcast a transaction.

Parameters

Name Type
options TransactionRequest

Returns

Promise<Transaction<Transaction>>

Inherited from

BitcoinBaseWalletProvider.sendTransaction

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:38


setChainProvider

setChainProvider(chainProvider): void

Parameters

Name Type
chainProvider Chain<any, Network>

Returns

void

Inherited from

BitcoinBaseWalletProvider.setChainProvider

Defined in

client/dist/lib/Wallet.d.ts:6


signBatchP2SHTransaction

signBatchP2SHTransaction(inputs, addresses, tx, lockTime?, segwit?): Promise<Buffer[]>

Parameters

Name Type
inputs [{ index: number ; inputTxHex: string ; outputScript: Buffer ; vout: any }]
addresses string
tx any
lockTime? number
segwit? boolean

Returns

Promise<Buffer[]>

Overrides

BitcoinBaseWalletProvider.signBatchP2SHTransaction

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:187


signMessage

signMessage(message, from): Promise<string>

Sign a message.

Parameters

Name Type
message string
from string

Returns

Promise<string>

Overrides

BitcoinBaseWalletProvider.signMessage

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:24


signPSBT

signPSBT(data, inputs): Promise<string>

Parameters

Name Type
data string
inputs PsbtInputTarget[]

Returns

Promise<string>

Overrides

BitcoinBaseWalletProvider.signPSBT

Defined in

bitcoin-ledger/lib/BitcoinLedgerProvider.ts:62


updateTransactionFee

updateTransactionFee(tx, newFeePerByte): Promise<Transaction<Transaction>>

Update the fee of a transaction.

Parameters

Name Type
tx string | Transaction<Transaction>
newFeePerByte number

Returns

Promise<Transaction<Transaction>>

Inherited from

BitcoinBaseWalletProvider.updateTransactionFee

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:41


withCachedUtxos

Protected withCachedUtxos(func): Promise<any>

Parameters

Name Type
func () => any

Returns

Promise<any>

Inherited from

BitcoinBaseWalletProvider.withCachedUtxos

Defined in

bitcoin/dist/lib/wallet/BitcoinBaseWallet.d.ts:54

Clone this wiki locally