trait WalletApi extends StartStopAsync[WalletApi]
API for the wallet project.
This wallet API is BIP44 compliant.
- See also
- Alphabetic
- By Inheritance
- WalletApi
- StartStopAsync
- StartStop
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def bumpFeeCPFP(txId: DoubleSha256DigestBE, feeRate: FeeUnit): Future[Transaction]
Bumps the fee of the parent transaction with a new child transaction with the given fee rate
- abstract def bumpFeeRBF(txId: DoubleSha256DigestBE, newFeeRate: FeeUnit): Future[Transaction]
- abstract val chainQueryApi: ChainQueryApi
- abstract def clearAllAddresses(): Future[WalletApi]
- abstract def clearAllUtxos(): Future[WalletApi]
Removes all utxos from the wallet.
Removes all utxos from the wallet. Don't call this unless you are sure you can recover your wallet
- abstract val creationTime: Instant
- abstract def dropAddressTag(addressTagDb: AddressTagDb): Future[Int]
- abstract def dropAddressTagName(address: BitcoinAddress, tagName: AddressTagName): Future[Int]
- abstract def dropAddressTagType(address: BitcoinAddress, addressTagType: AddressTagType): Future[Int]
- abstract def dropAddressTagType(addressTagType: AddressTagType): Future[Int]
- abstract val feeRateApi: FeeRateApi
- abstract def findByOutPoints(outPoints: Vector[TransactionOutPoint]): Future[Vector[SpendingInfoDb]]
- abstract def findByScriptPubKey(scriptPubKey: ScriptPubKey): Future[Vector[SpendingInfoDb]]
- abstract def findByTxIds(txIds: Vector[DoubleSha256DigestBE]): Future[Vector[TransactionDb]]
- abstract def findOutputsBeingSpent(tx: Transaction): Future[Vector[SpendingInfoDb]]
Finds all the outputs in our wallet being spent in the given transaction
- abstract def findTransaction(txId: DoubleSha256DigestBE): Future[Option[TransactionDb]]
- abstract def fundRawTransaction(destinations: Vector[TransactionOutput], feeRate: FeeUnit, fromTagOpt: Option[AddressTag], markAsReserved: Boolean): Future[FundRawTxHelper[ShufflingNonInteractiveFinalizer]]
Funds a transaction from the wallet.
Funds a transaction from the wallet.
- returns
funded transaction send funds to desinations with the given fee rate
- abstract def getAddressInfo(address: BitcoinAddress): Future[Option[AddressInfo]]
Mimics the
getaddressinfo
RPC call in Bitcoin CoreMimics the
getaddressinfo
RPC call in Bitcoin Core- returns
If the address is found in our database
Some(address)
is returned, otherwiseNone
- abstract def getAddressTags(tagType: AddressTagType): Future[Vector[AddressTagDb]]
- abstract def getAddressTags(): Future[Vector[AddressTagDb]]
- abstract def getAddressTags(address: BitcoinAddress, tagType: AddressTagType): Future[Vector[AddressTagDb]]
- abstract def getAddressTags(address: BitcoinAddress): Future[Vector[AddressTagDb]]
- abstract def getConfirmedBalance(tag: AddressTag): Future[CurrencyUnit]
- abstract def getConfirmedBalance(): Future[CurrencyUnit]
Gets the sum of all confirmed UTXOs in this wallet
- abstract def getInfo(): Future[WalletInfo]
- abstract def getNewAddress(tags: Vector[AddressTag]): Future[BitcoinAddress]
- abstract def getNewAddress(addressType: AddressType, tags: Vector[AddressTag]): Future[BitcoinAddress]
- abstract def getNewAddress(): Future[BitcoinAddress]
Gets a new external address Calling this method multiple times will return the same address, until it has received funds.
- abstract def getNewAddress(addressType: AddressType): Future[BitcoinAddress]
Gets a new external address with the specified type.
- abstract def getNewChangeAddress()(implicit ec: ExecutionContext): Future[BitcoinAddress]
Generates a new change address
Generates a new change address
- Attributes
- protected[wallet]
- abstract def getSyncDescriptorOpt(): Future[Option[SyncHeightDescriptor]]
- abstract def getSyncState(): Future[BlockSyncState]
- abstract def getUnconfirmedBalance(tag: AddressTag): Future[CurrencyUnit]
- abstract def getUnconfirmedBalance(): Future[CurrencyUnit]
Gets the sum of all unconfirmed UTXOs in this wallet
- abstract def getUnusedAddress: Future[BitcoinAddress]
Gets a external address.
Gets a external address. Calling this method multiple times will return the same address, until it has received funds.
- abstract def getUnusedAddress(addressType: AddressType): Future[BitcoinAddress]
Gets a external address the given AddressType.
Gets a external address the given AddressType. Calling this method multiple times will return the same address, until it has received funds.
- abstract def getWalletName(): Future[String]
- abstract def isChange(output: TransactionOutput): Future[Boolean]
Determines if the given output is from this wallet and is a change output from this wallet
- abstract def isEmpty(): Future[Boolean]
Checks if the wallet contains any data
- abstract def isRescanning(): Future[Boolean]
- abstract def keyManager: KeyManagerApi
- abstract def listAddresses(): Future[Vector[AddressDb]]
- abstract def listFundedAddresses(): Future[Vector[(AddressDb, CurrencyUnit)]]
- abstract def listScriptPubKeys(): Future[Vector[ScriptPubKeyDb]]
- abstract def listSpentAddresses(): Future[Vector[AddressDb]]
- abstract def listTransactions(): Future[Vector[TransactionDb]]
- abstract def listUnusedAddresses(): Future[Vector[AddressDb]]
- abstract def listUtxos(state: TxoState): Future[Vector[SpendingInfoDb]]
- abstract def listUtxos(tag: AddressTag): Future[Vector[SpendingInfoDb]]
- abstract def listUtxos(): Future[Vector[SpendingInfoDb]]
Lists unspent transaction outputs in the wallet
Lists unspent transaction outputs in the wallet
- returns
Vector[SpendingInfoDb]
- abstract def makeOpReturnCommitment(message: String, hashMessage: Boolean, feeRate: FeeUnit)(implicit ec: ExecutionContext): Future[Transaction]
- abstract def markUTXOsAsReserved(tx: Transaction): Future[Vector[SpendingInfoDb]]
Marks all utxos that are ours in this transactions as reserved
- abstract def markUTXOsAsReserved(utxos: Vector[SpendingInfoDb]): Future[Vector[SpendingInfoDb]]
- abstract val nodeApi: NodeApi
- abstract def processBlock(block: Block): Future[WalletApi]
Processes the give block, updating our DB state if it's relevant to us.
Processes the give block, updating our DB state if it's relevant to us.
- block
The block we're processing
- abstract def processOurTransaction(transaction: Transaction, feeRate: FeeUnit, inputAmount: CurrencyUnit, sentAmount: CurrencyUnit, blockHashOpt: Option[DoubleSha256DigestBE], newTags: Vector[AddressTag]): Future[ProcessTxResult]
Processes TXs originating from our wallet.
Processes TXs originating from our wallet. This is called right after we've signed a TX, updating our UTXO state.
- abstract def processTransaction(transaction: Transaction, blockHashOpt: Option[DoubleSha256DigestBE]): Future[WalletApi]
Processes the given transaction, updating our DB state if it's relevant to us.
Processes the given transaction, updating our DB state if it's relevant to us.
- transaction
The transaction we're processing
- abstract def sendFromOutPoints(outPoints: Vector[TransactionOutPoint], address: BitcoinAddress, feeRate: FeeUnit)(implicit ec: ExecutionContext): Future[Transaction]
- abstract def sendFromOutPoints(outPoints: Vector[TransactionOutPoint], address: BitcoinAddress, amount: CurrencyUnit, feeRate: FeeUnit)(implicit ec: ExecutionContext): Future[Transaction]
- abstract def sendToAddress(address: BitcoinAddress, amount: CurrencyUnit, feeRate: FeeUnit)(implicit ec: ExecutionContext): Future[Transaction]
Sends money to the address
Sends money to the address
todo: add error handling to signature
- abstract def sendToAddresses(addresses: Vector[BitcoinAddress], amounts: Vector[CurrencyUnit], feeRate: FeeUnit)(implicit ec: ExecutionContext): Future[Transaction]
- abstract def sendToOutputs(outputs: Vector[TransactionOutput], feeRate: FeeUnit)(implicit ec: ExecutionContext): Future[Transaction]
- abstract def sendWithAlgo(address: BitcoinAddress, amount: CurrencyUnit, feeRate: FeeUnit, algo: CoinSelectionAlgo)(implicit ec: ExecutionContext): Future[Transaction]
- abstract def start(): Future[WalletApi]
- abstract def stop(): Future[WalletApi]
- abstract def sweepWallet(address: BitcoinAddress, feeRate: FeeUnit)(implicit ec: ExecutionContext): Future[Transaction]
Sends the entire wallet balance to the given address
- abstract def tagAddress(address: BitcoinAddress, tag: AddressTag): Future[AddressTagDb]
Tags the address with the address tag, updates the tag if one of tag's TagType already exists
- abstract def unmarkUTXOsAsReserved(tx: Transaction): Future[Vector[SpendingInfoDb]]
Unmarks all utxos that are ours in this transactions indicating they are no longer reserved
- abstract def unmarkUTXOsAsReserved(utxos: Vector[SpendingInfoDb]): Future[Vector[SpendingInfoDb]]
- abstract def updateUtxoPendingStates(): Future[Vector[SpendingInfoDb]]
Takes in a block header and updates our TxoStates to the new chain tip
- abstract def watchScriptPubKey(scriptPubKey: ScriptPubKey): Future[ScriptPubKeyDb]
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def broadcastTransaction(transaction: Transaction): Future[Unit]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def determineFeeRate(feeRateOpt: Option[FeeUnit]): Future[FeeUnit]
- Attributes
- protected
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def findByOutPoint(outPoint: TransactionOutPoint)(implicit ec: ExecutionContext): Future[Option[SpendingInfoDb]]
- def findByTxId(txId: DoubleSha256Digest)(implicit ec: ExecutionContext): Future[Option[TransactionDb]]
- def findByTxId(txId: DoubleSha256DigestBE)(implicit ec: ExecutionContext): Future[Option[TransactionDb]]
- def getAddressInfo(spendingInfoDb: SpendingInfoDb, networkParameters: NetworkParameters): Future[Option[AddressInfo]]
- def getBalance(tag: AddressTag)(implicit ec: ExecutionContext): Future[CurrencyUnit]
Gets the sum of all UTXOs in this wallet with the address tag
- def getBalance()(implicit ec: ExecutionContext): Future[CurrencyUnit]
Gets the sum of all UTXOs in this wallet
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getFeeRate(): Future[FeeUnit]
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def makeOpReturnCommitment(message: String, hashMessage: Boolean, feeRateOpt: Option[FeeUnit])(implicit ec: ExecutionContext): Future[Transaction]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def processTransactions(transactions: Vector[Transaction], blockHashOpt: Option[DoubleSha256DigestBE])(implicit ec: ExecutionContext): Future[WalletApi]
- def sendFromOutPoints(outPoints: Vector[TransactionOutPoint], address: BitcoinAddress, feeRateOpt: Option[FeeUnit])(implicit ec: ExecutionContext): Future[Transaction]
- def sendFromOutPoints(outPoints: Vector[TransactionOutPoint], address: BitcoinAddress, amount: CurrencyUnit, feeRateOpt: Option[FeeUnit])(implicit ec: ExecutionContext): Future[Transaction]
- def sendToAddress(address: BitcoinAddress, amount: CurrencyUnit, feeRateOpt: Option[FeeUnit])(implicit ec: ExecutionContext): Future[Transaction]
- def sendToAddresses(addresses: Vector[BitcoinAddress], amounts: Vector[CurrencyUnit], feeRateOpt: Option[FeeUnit])(implicit ec: ExecutionContext): Future[Transaction]
Sends funds to each address
- def sendToOutputs(outputs: Vector[TransactionOutput], feeRateOpt: Option[FeeUnit])(implicit ec: ExecutionContext): Future[Transaction]
Sends funds using the specified outputs
Sends funds using the specified outputs
todo: add error handling to signature
- def sendWithAlgo(address: BitcoinAddress, amount: CurrencyUnit, feeRateOpt: Option[FeeUnit], algo: CoinSelectionAlgo)(implicit ec: ExecutionContext): Future[Transaction]
- def sweepWallet(address: BitcoinAddress, feeRateOpt: Option[FeeUnit])(implicit ec: ExecutionContext): Future[Transaction]
Sends the entire wallet balance to the given address
- def sweepWallet(address: BitcoinAddress)(implicit ec: ExecutionContext): Future[Transaction]
Sends the entire wallet balance to the given address
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()