diff --git a/docs/wallet/wallet.md b/docs/wallet/wallet.md index e1a4db1055..a2a80ba64e 100644 --- a/docs/wallet/wallet.md +++ b/docs/wallet/wallet.md @@ -71,6 +71,16 @@ import com.typesafe.config.ConfigFactory import java.nio.file.Files import java.time.Instant import scala.concurrent._ + +val chainApi = new ChainQueryApi { + override def epochSecondToBlockHeight(time: Long): Future[Int] = Future.successful(0) + override def getBlockHeight(blockHash: DoubleSha256DigestBE): Future[Option[Int]] = Future.successful(None) + override def getBestBlockHash(): Future[DoubleSha256DigestBE] = Future.successful(DoubleSha256DigestBE.empty) + override def getNumberOfConfirmations(blockHashOpt: DoubleSha256DigestBE): Future[Option[Int]] = Future.successful(None) + override def getFilterCount(): Future[Int] = Future.successful(0) + override def getHeightByBlockStamp(blockStamp: BlockStamp): Future[Int] = Future.successful(0) + override def getFiltersBetweenHeights(startHeight: Int, endHeight: Int): Future[Vector[FilterResponse]] = Future.successful(Vector.empty) + } ``` ```scala mdoc:compile-only @@ -146,15 +156,7 @@ val keyManager = BIP39KeyManager.initialize(aesPasswordOpt, walletConfig.kmParam val wallet = Wallet(keyManager, new NodeApi { override def broadcastTransaction(tx: Transaction): Future[Unit] = Future.successful(()) override def downloadBlocks(blockHashes: Vector[DoubleSha256Digest]): Future[Unit] = Future.successful(()) - }, new ChainQueryApi { - override def epochSecondToBlockHeight(time: Long): Future[Int] = Future.successful(0) - override def getBlockHeight(blockHash: DoubleSha256DigestBE): Future[Option[Int]] = Future.successful(None) - override def getBestBlockHash(): Future[DoubleSha256DigestBE] = Future.successful(DoubleSha256DigestBE.empty) - override def getNumberOfConfirmations(blockHashOpt: DoubleSha256DigestBE): Future[Option[Int]] = Future.successful(None) - override def getFilterCount: Future[Int] = Future.successful(0) - override def getHeightByBlockStamp(blockStamp: BlockStamp): Future[Int] = Future.successful(0) - override def getFiltersBetweenHeights(startHeight: Int, endHeight: Int): Future[Vector[FilterResponse]] = Future.successful(Vector.empty) - }, ConstantFeeRateProvider(SatoshisPerVirtualByte.one), creationTime = Instant.now) + }, chainApi, ConstantFeeRateProvider(SatoshisPerVirtualByte.one), creationTime = Instant.now) val walletF: Future[WalletApi] = configF.flatMap { _ => Wallet.initialize(wallet,bip39PasswordOpt) } @@ -181,5 +183,4 @@ val balanceF: Future[CurrencyUnit] = for { balanceF.foreach { balance => println(s"Bitcoin-S wallet balance: $balance") } - ```