Skip to content

@liquality.bitcoin ledger.<internal>.BitcoinBaseWalletProvider

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

Class: BitcoinBaseWalletProvider<T, S>

@liquality/bitcoin-ledger..BitcoinBaseWalletProvider

Type parameters

Name Type
T extends BitcoinBaseChainProvider = any
S any

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new BitcoinBaseWalletProvider<T, S>(options, chainProvider)

Type parameters

Name Type
T extends BitcoinBaseChainProvider<T> = any
S any

Parameters

Name Type
options BitcoinWalletProviderOptions
chainProvider Chain<T, Network>

Overrides

Wallet.constructor

Defined in

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

Properties

_addressType

Protected _addressType: AddressType

Defined in

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


_baseDerivationPath

Protected _baseDerivationPath: string

Defined in

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


_derivationCache

Protected _derivationCache: DerivationCache

Defined in

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


_network

Protected _network: BitcoinNetwork

Defined in

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


chainProvider

Protected chainProvider: Chain<T, Network>

Inherited from

Wallet.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[] }>

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>>

Defined in

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


baseDerivationNode

Protected Abstract baseDerivationNode(): Promise<BIP32Interface>

Returns

Promise<BIP32Interface>

Defined in

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


buildSweepTransaction

Protected Abstract buildSweepTransaction(externalChangeAddress, feePerByte?): Promise<{ fee: number ; hex: string }>

Parameters

Name Type
externalChangeAddress string
feePerByte? number

Returns

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

Defined in

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


buildTransaction

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

Parameters

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

Returns

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

Defined in

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


canUpdateFee

Abstract canUpdateFee(): boolean

Returns

boolean

Inherited from

Wallet.canUpdateFee

Defined in

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


exportPrivateKey

Abstract 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>

Inherited from

Wallet.exportPrivateKey

Defined in

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


findAddress

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

Parameters

Name Type
addresses string[]
change? boolean

Returns

Promise<Address>

Defined in

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


getAddress

Abstract getAddress(): Promise<AddressType>

Returns

Promise<AddressType>

Inherited from

Wallet.getAddress

Defined in

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


getAddressFromPublicKey

Protected getAddressFromPublicKey(publicKey): string

Parameters

Name Type
publicKey Buffer

Returns

string

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[]>

Overrides

Wallet.getAddresses

Defined in

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


getBalance

Abstract getBalance(assets): Promise<BigNumber[]>

Parameters

Name Type
assets Asset[]

Returns

Promise<BigNumber[]>

Inherited from

Wallet.getBalance

Defined in

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


getChainProvider

getChainProvider(): Chain<T, Network>

Returns

Chain<T, Network>

Inherited from

Wallet.getChainProvider

Defined in

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


getConnectedNetwork

Abstract getConnectedNetwork(): Promise<Network>

Retrieve the network connected to by the wallet

Returns

Promise<Network>

Inherited from

Wallet.getConnectedNetwork

Defined in

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


getDerivationCache

getDerivationCache(): DerivationCache

Returns

DerivationCache

Defined in

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


getDerivationPathAddress

Protected getDerivationPathAddress(path): Promise<Address>

Parameters

Name Type
path string

Returns

Promise<Address>

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[] }>

Defined in

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


getPaymentVariantFromPublicKey

Protected getPaymentVariantFromPublicKey(publicKey): Payment

Parameters

Name Type
publicKey Buffer

Returns

Payment

Defined in

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


getSigner

Abstract getSigner(): S

Returns

S

Inherited from

Wallet.getSigner

Defined in

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


getTotalFee

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

Parameters

Name Type
opts TransactionRequest
max boolean

Returns

Promise<number>

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>

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>

Overrides

Wallet.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[]>

Overrides

Wallet.getUsedAddresses

Defined in

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


getWalletAddress

getWalletAddress(address): Promise<Address>

Parameters

Name Type
address string

Returns

Promise<Address>

Defined in

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


isWalletAvailable

Abstract isWalletAvailable(): Promise<boolean>

Retrieve the availability status of the wallet

Returns

Promise<boolean>

Inherited from

Wallet.isWalletAvailable

Defined in

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


sendBatchTransaction

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

Create, sign & broad a transaction with multiple outputs.

Parameters

Name Type
transactions TransactionRequest[]

Returns

Promise<Transaction<Transaction>[]>

Overrides

Wallet.sendBatchTransaction

Defined in

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


sendOptionsToOutputs

Protected sendOptionsToOutputs(transactions): OutputTarget[]

Parameters

Name Type
transactions TransactionRequest[]

Returns

OutputTarget[]

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>>

Overrides

Wallet.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>>

Overrides

Wallet.sendTransaction

Defined in

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


setChainProvider

setChainProvider(chainProvider): void

Parameters

Name Type
chainProvider Chain<T, Network>

Returns

void

Inherited from

Wallet.setChainProvider

Defined in

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


signBatchP2SHTransaction

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

Parameters

Name Type
inputs P2SHInput[]
addresses string
tx any
lockTime? number
segwit? boolean

Returns

Promise<Buffer[]>

Defined in

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


signMessage

Abstract signMessage(message, from): Promise<string>

Sign a message.

Parameters

Name Type
message string
from AddressType

Returns

Promise<string>

Inherited from

Wallet.signMessage

Defined in

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


signPSBT

Abstract signPSBT(data, inputs): Promise<string>

Parameters

Name Type
data string
inputs PsbtInputTarget[]

Returns

Promise<string>

Defined in

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


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>>

Overrides

Wallet.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>

Defined in

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

Clone this wiki locally