├── .github └── workflows │ └── package.yaml ├── .gitignore ├── .gitmodules ├── .mailmap ├── LICENSE ├── README.md ├── build.gradle ├── buildSrc ├── build.gradle └── src │ └── main │ └── java │ └── org │ └── openjfx │ └── gradle │ ├── JavaFXModule.java │ ├── JavaFXOptions.java │ ├── JavaFXPlatform.java │ ├── JavaFXPlugin.java │ └── tasks │ └── ExecTask.java ├── docs ├── README.md └── reproducible.md ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── repackage.sh ├── settings.gradle ├── sparrow ├── sparrow.bat └── src ├── main ├── deploy │ ├── asc.properties │ ├── auth47.properties │ ├── bitcoin.properties │ ├── lightning.properties │ ├── package │ │ ├── linux-headless │ │ │ ├── control │ │ │ └── sparrowserver.spec │ │ ├── linux │ │ │ ├── Sparrow.desktop │ │ │ ├── Sparrow.png │ │ │ ├── control │ │ │ ├── postinst │ │ │ └── sparrowwallet.spec │ │ ├── osx │ │ │ ├── Info.plist │ │ │ ├── Sparrow.entitlements │ │ │ ├── installer-background.png │ │ │ └── sparrow.icns │ │ └── windows │ │ │ ├── main.wxs │ │ │ └── sparrow.ico │ ├── psbt.properties │ └── txn.properties ├── java │ ├── com │ │ └── sparrowwallet │ │ │ └── sparrow │ │ │ ├── AboutController.java │ │ │ ├── AppController.java │ │ │ ├── AppServices.java │ │ │ ├── Args.java │ │ │ ├── BaseController.java │ │ │ ├── BlockSummary.java │ │ │ ├── CurrencyRate.java │ │ │ ├── DefaultInteractionServices.java │ │ │ ├── EventManager.java │ │ │ ├── InteractionServices.java │ │ │ ├── Interface.java │ │ │ ├── Mode.java │ │ │ ├── SparrowDesktop.java │ │ │ ├── SparrowWallet.java │ │ │ ├── SparrowWalletPreloader.java │ │ │ ├── TabData.java │ │ │ ├── Theme.java │ │ │ ├── TransactionParseException.java │ │ │ ├── TransactionTabData.java │ │ │ ├── UnitFormat.java │ │ │ ├── WalletTabData.java │ │ │ ├── WelcomeController.java │ │ │ ├── WelcomeDialog.java │ │ │ ├── control │ │ │ ├── AddAccountDialog.java │ │ │ ├── AddressCell.java │ │ │ ├── AddressLabel.java │ │ │ ├── AddressStringConverter.java │ │ │ ├── AddressTreeTable.java │ │ │ ├── AnimationUtil.java │ │ │ ├── BalanceChart.java │ │ │ ├── BitBoxPairingDialog.java │ │ │ ├── BlockCube.java │ │ │ ├── BlockTargetFeeRatesChart.java │ │ │ ├── CardImportPane.java │ │ │ ├── CardPinDialog.java │ │ │ ├── CoinAxisFormatter.java │ │ │ ├── CoinCell.java │ │ │ ├── CoinLabel.java │ │ │ ├── CoinTextFormatter.java │ │ │ ├── CoinTreeTable.java │ │ │ ├── ComboBoxTextField.java │ │ │ ├── ConfirmationProgressIndicator.java │ │ │ ├── ConfirmationsListener.java │ │ │ ├── CopyableCoinLabel.java │ │ │ ├── CopyableLabel.java │ │ │ ├── CopyableTextField.java │ │ │ ├── DateAxisFormatter.java │ │ │ ├── DateCell.java │ │ │ ├── DateLabel.java │ │ │ ├── DateStringConverter.java │ │ │ ├── DescriptorArea.java │ │ │ ├── DescriptorQRDisplayDialog.java │ │ │ ├── DeviceDialog.java │ │ │ ├── DeviceDisplayAddressDialog.java │ │ │ ├── DeviceGetAddressDialog.java │ │ │ ├── DeviceKeystoreDiscoverDialog.java │ │ │ ├── DevicePane.java │ │ │ ├── DeviceSignDialog.java │ │ │ ├── DeviceSignMessageDialog.java │ │ │ ├── DeviceUnsealDialog.java │ │ │ ├── DialogImage.java │ │ │ ├── DownloadVerifierDialog.java │ │ │ ├── DynamicForm.java │ │ │ ├── DynamicUpdate.java │ │ │ ├── EntryCell.java │ │ │ ├── FeeRangeSlider.java │ │ │ ├── FiatCell.java │ │ │ ├── FiatLabel.java │ │ │ ├── FileImportPane.java │ │ │ ├── FileKeystoreExportPane.java │ │ │ ├── FileKeystoreImportPane.java │ │ │ ├── FileWalletExportPane.java │ │ │ ├── FileWalletImportPane.java │ │ │ ├── FileWalletKeystoreImportPane.java │ │ │ ├── HelpLabel.java │ │ │ ├── IdLabel.java │ │ │ ├── IntegerSpinner.java │ │ │ ├── KeystoreExportDialog.java │ │ │ ├── KeystorePassphraseDialog.java │ │ │ ├── LabelCell.java │ │ │ ├── LifeHashIcon.java │ │ │ ├── MasterKeyDisplayDialog.java │ │ │ ├── MempoolSizeFeeRatesChart.java │ │ │ ├── MessageSignDialog.java │ │ │ ├── MixStatusCell.java │ │ │ ├── MnemonicGridDialog.java │ │ │ ├── MnemonicKeystoreDisplayPane.java │ │ │ ├── MnemonicKeystoreEntryPane.java │ │ │ ├── MnemonicKeystoreImportPane.java │ │ │ ├── MnemonicKeystorePane.java │ │ │ ├── MnemonicShareKeystoreImportPane.java │ │ │ ├── MnemonicWalletKeystoreImportPane.java │ │ │ ├── NumberCell.java │ │ │ ├── PayNymAvatar.java │ │ │ ├── PayNymCell.java │ │ │ ├── PaymentCodeTextField.java │ │ │ ├── PrivateKeySweepDialog.java │ │ │ ├── ProgressTimer.java │ │ │ ├── QRDensity.java │ │ │ ├── QRDisplayDialog.java │ │ │ ├── QRScanDialog.java │ │ │ ├── RecentBlocksView.java │ │ │ ├── RecursiveTreeItem.java │ │ │ ├── RelativeTimelockSpinner.java │ │ │ ├── ScriptArea.java │ │ │ ├── ScriptContextMenu.java │ │ │ ├── SearchWalletDialog.java │ │ │ ├── SeedDisplayDialog.java │ │ │ ├── SeedEntryDialog.java │ │ │ ├── SelectableCodeArea.java │ │ │ ├── SendToManyDialog.java │ │ │ ├── ServiceProgressDialog.java │ │ │ ├── SignaturesProgressBar.java │ │ │ ├── TextAreaDialog.java │ │ │ ├── TextDecoration.java │ │ │ ├── TextFieldValidator.java │ │ │ ├── TextUtils.java │ │ │ ├── TextfieldDialog.java │ │ │ ├── TitledDescriptionPane.java │ │ │ ├── TorStatusLabel.java │ │ │ ├── TransactionDiagram.java │ │ │ ├── TransactionDiagramLabel.java │ │ │ ├── TransactionHexArea.java │ │ │ ├── TransactionIdDialog.java │ │ │ ├── TransactionsTreeTable.java │ │ │ ├── TrayManager.java │ │ │ ├── TreeTableColumnConfig.java │ │ │ ├── TreeTableConfig.java │ │ │ ├── UnlabeledToggleSwitch.java │ │ │ ├── UsbStatusButton.java │ │ │ ├── UtxosChart.java │ │ │ ├── UtxosTreeTable.java │ │ │ ├── ViewPasswordField.java │ │ │ ├── ViewPasswordFieldSkin.java │ │ │ ├── WalletBirthDateDialog.java │ │ │ ├── WalletExportDialog.java │ │ │ ├── WalletIcon.java │ │ │ ├── WalletImportDialog.java │ │ │ ├── WalletLabelDialog.java │ │ │ ├── WalletModelImage.java │ │ │ ├── WalletNameDialog.java │ │ │ ├── WalletPasswordDialog.java │ │ │ ├── WalletSummaryDialog.java │ │ │ ├── WebcamPixelFormat.java │ │ │ ├── WebcamResolution.java │ │ │ ├── WebcamService.java │ │ │ ├── WebcamView.java │ │ │ └── XprvKeystoreImportPane.java │ │ │ ├── event │ │ │ ├── AddressDisplayedEvent.java │ │ │ ├── BitcoinUnitChangedEvent.java │ │ │ ├── BlockSummaryEvent.java │ │ │ ├── BlockTransactionFetchedEvent.java │ │ │ ├── BlockTransactionOutputsFetchedEvent.java │ │ │ ├── BwtBootStatusEvent.java │ │ │ ├── BwtElectrumReadyStatusEvent.java │ │ │ ├── BwtReadyStatusEvent.java │ │ │ ├── BwtScanStatusEvent.java │ │ │ ├── BwtShutdownEvent.java │ │ │ ├── BwtStatusEvent.java │ │ │ ├── BwtSyncStatusEvent.java │ │ │ ├── ChildWalletsAddedEvent.java │ │ │ ├── ConnectionEvent.java │ │ │ ├── ConnectionFailedEvent.java │ │ │ ├── ConnectionStartEvent.java │ │ │ ├── CormorantPruneStatusEvent.java │ │ │ ├── CormorantScanStatusEvent.java │ │ │ ├── CormorantStatusEvent.java │ │ │ ├── CormorantSyncStatusEvent.java │ │ │ ├── DeviceAddressEvent.java │ │ │ ├── DeviceGetPrivateKeyEvent.java │ │ │ ├── DisconnectionEvent.java │ │ │ ├── ExchangeRatesUpdatedEvent.java │ │ │ ├── ExcludeUtxoEvent.java │ │ │ ├── ExistingWalletImportedEvent.java │ │ │ ├── FeeRatesSelectionChangedEvent.java │ │ │ ├── FeeRatesSourceChangedEvent.java │ │ │ ├── FeeRatesUpdatedEvent.java │ │ │ ├── FiatCurrencySelectedEvent.java │ │ │ ├── FinalizeTransactionEvent.java │ │ │ ├── FunctionActionEvent.java │ │ │ ├── HideEmptyUsedAddressesStatusEvent.java │ │ │ ├── IncludeMempoolOutputsChangedEvent.java │ │ │ ├── KeystoreDeviceRegistrationsChangedEvent.java │ │ │ ├── KeystoreEncryptionChangedEvent.java │ │ │ ├── KeystoreExportEvent.java │ │ │ ├── KeystoreImportEvent.java │ │ │ ├── KeystoreLabelsChangedEvent.java │ │ │ ├── KeystoreSignedEvent.java │ │ │ ├── KeystoresDiscoveredEvent.java │ │ │ ├── LoadingLogChangedEvent.java │ │ │ ├── MempoolEntriesInitializedEvent.java │ │ │ ├── MempoolRateSizesUpdatedEvent.java │ │ │ ├── MessageSignedEvent.java │ │ │ ├── MixToConfigChangedEvent.java │ │ │ ├── NewBlockEvent.java │ │ │ ├── NewChildWalletSavedEvent.java │ │ │ ├── NewWalletTransactionsEvent.java │ │ │ ├── OpenWalletsEvent.java │ │ │ ├── OpenWalletsNewWindowsStatusEvent.java │ │ │ ├── PSBTCombinedEvent.java │ │ │ ├── PSBTEvent.java │ │ │ ├── PSBTFinalizedEvent.java │ │ │ ├── PSBTReorderedEvent.java │ │ │ ├── PSBTSignedEvent.java │ │ │ ├── PagedEvent.java │ │ │ ├── PayNymImageLoadedEvent.java │ │ │ ├── ReceiveActionEvent.java │ │ │ ├── ReceiveToEvent.java │ │ │ ├── ReplaceChangeAddressEvent.java │ │ │ ├── RequestConnectEvent.java │ │ │ ├── RequestDisconnectEvent.java │ │ │ ├── RequestOpenWalletsEvent.java │ │ │ ├── RequestQRScanEvent.java │ │ │ ├── RequestTransactionOpenEvent.java │ │ │ ├── RequestVerifyDownloadEvent.java │ │ │ ├── RequestWalletOpenEvent.java │ │ │ ├── SelectEntryEvent.java │ │ │ ├── SendActionEvent.java │ │ │ ├── SendPaymentsEvent.java │ │ │ ├── ServerTypeChangedEvent.java │ │ │ ├── SettingsChangedEvent.java │ │ │ ├── ShowTransactionsCountEvent.java │ │ │ ├── SpendUtxoEvent.java │ │ │ ├── StatusEvent.java │ │ │ ├── StorageEvent.java │ │ │ ├── TabEvent.java │ │ │ ├── TabSelectedEvent.java │ │ │ ├── ThemeChangedEvent.java │ │ │ ├── TimedEvent.java │ │ │ ├── TorBootStatusEvent.java │ │ │ ├── TorExternalStatusEvent.java │ │ │ ├── TorFailedStatusEvent.java │ │ │ ├── TorReadyStatusEvent.java │ │ │ ├── TorStatusEvent.java │ │ │ ├── TransactionChangedEvent.java │ │ │ ├── TransactionExtractedEvent.java │ │ │ ├── TransactionFetchFailedEvent.java │ │ │ ├── TransactionLocktimeChangedEvent.java │ │ │ ├── TransactionReferencesEvent.java │ │ │ ├── TransactionReferencesFailedEvent.java │ │ │ ├── TransactionReferencesFinishedEvent.java │ │ │ ├── TransactionReferencesStartedEvent.java │ │ │ ├── TransactionTabChangedEvent.java │ │ │ ├── TransactionTabSelectedEvent.java │ │ │ ├── TransactionTabsClosedEvent.java │ │ │ ├── UnitFormatChangedEvent.java │ │ │ ├── UsbDeviceEvent.java │ │ │ ├── UtxosChartChangedEvent.java │ │ │ ├── VersionCheckStatusEvent.java │ │ │ ├── VersionUpdatedEvent.java │ │ │ ├── ViewPSBTEvent.java │ │ │ ├── ViewTransactionEvent.java │ │ │ ├── ViewWalletEvent.java │ │ │ ├── WalletAddressesChangedEvent.java │ │ │ ├── WalletAddressesStatusEvent.java │ │ │ ├── WalletBlockHeightChangedEvent.java │ │ │ ├── WalletChangedEvent.java │ │ │ ├── WalletConfigChangedEvent.java │ │ │ ├── WalletDataChangedEvent.java │ │ │ ├── WalletDeletedEvent.java │ │ │ ├── WalletEntryLabelsChangedEvent.java │ │ │ ├── WalletExportEvent.java │ │ │ ├── WalletGapLimitChangedEvent.java │ │ │ ├── WalletHistoryChangedEvent.java │ │ │ ├── WalletHistoryClearedEvent.java │ │ │ ├── WalletHistoryFailedEvent.java │ │ │ ├── WalletHistoryFinishedEvent.java │ │ │ ├── WalletHistoryStartedEvent.java │ │ │ ├── WalletHistoryStatusEvent.java │ │ │ ├── WalletImportEvent.java │ │ │ ├── WalletLabelChangedEvent.java │ │ │ ├── WalletLockEvent.java │ │ │ ├── WalletMasterMixConfigChangedEvent.java │ │ │ ├── WalletMixConfigChangedEvent.java │ │ │ ├── WalletNodeHistoryChangedEvent.java │ │ │ ├── WalletNodesChangedEvent.java │ │ │ ├── WalletOpenedEvent.java │ │ │ ├── WalletOpeningEvent.java │ │ │ ├── WalletPasswordChangedEvent.java │ │ │ ├── WalletSettingsChangedEvent.java │ │ │ ├── WalletTabSelectedEvent.java │ │ │ ├── WalletTableChangedEvent.java │ │ │ ├── WalletTabsClosedEvent.java │ │ │ ├── WalletUnlockEvent.java │ │ │ ├── WalletUtxoMixesChangedEvent.java │ │ │ ├── WalletUtxoStatusChangedEvent.java │ │ │ ├── WalletWatchLastChangedEvent.java │ │ │ ├── WebcamMirroredChangedEvent.java │ │ │ └── WebcamResolutionChangedEvent.java │ │ │ ├── glyphfont │ │ │ ├── FontAwesome5.java │ │ │ ├── FontAwesome5Brands.java │ │ │ └── GlyphUtils.java │ │ │ ├── instance │ │ │ ├── Instance.java │ │ │ ├── InstanceException.java │ │ │ └── InstanceList.java │ │ │ ├── io │ │ │ ├── AirGapVault.java │ │ │ ├── Bip129.java │ │ │ ├── Bip32.java │ │ │ ├── Bip39.java │ │ │ ├── BlueWalletMultisig.java │ │ │ ├── CaravanMultisig.java │ │ │ ├── CardApi.java │ │ │ ├── CardAuthorizationException.java │ │ │ ├── CardImport.java │ │ │ ├── CardSignFailedException.java │ │ │ ├── CardUnluckyNumberException.java │ │ │ ├── CoboVaultMultisig.java │ │ │ ├── CoboVaultSinglesig.java │ │ │ ├── ColdcardMultisig.java │ │ │ ├── ColdcardSinglesig.java │ │ │ ├── Config.java │ │ │ ├── Descriptor.java │ │ │ ├── Device.java │ │ │ ├── DisplayAddressException.java │ │ │ ├── ECIESInputStream.java │ │ │ ├── ECIESOutputStream.java │ │ │ ├── Electrum.java │ │ │ ├── ElectrumPersonalServer.java │ │ │ ├── ExportException.java │ │ │ ├── FileImport.java │ │ │ ├── GordianSeedTool.java │ │ │ ├── Hwi.java │ │ │ ├── ImageUtils.java │ │ │ ├── ImportException.java │ │ │ ├── ImportExport.java │ │ │ ├── Jade.java │ │ │ ├── JadeMultisig.java │ │ │ ├── JsonPersistence.java │ │ │ ├── KeystoneMultisig.java │ │ │ ├── KeystoneSinglesig.java │ │ │ ├── KeystoreCardImport.java │ │ │ ├── KeystoreExport.java │ │ │ ├── KeystoreFileExport.java │ │ │ ├── KeystoreFileImport.java │ │ │ ├── KeystoreImport.java │ │ │ ├── KeystoreMnemonicImport.java │ │ │ ├── KeystoreMnemonicShareImport.java │ │ │ ├── KeystoreXprvImport.java │ │ │ ├── Krux.java │ │ │ ├── PassportMultisig.java │ │ │ ├── PassportSinglesig.java │ │ │ ├── PdfUtils.java │ │ │ ├── Persistence.java │ │ │ ├── PersistenceType.java │ │ │ ├── Samourai.java │ │ │ ├── SeedSigner.java │ │ │ ├── Server.java │ │ │ ├── SignMessageException.java │ │ │ ├── SignTransactionException.java │ │ │ ├── Slip39.java │ │ │ ├── Sparrow.java │ │ │ ├── SpecterDIY.java │ │ │ ├── SpecterDIYMultisig.java │ │ │ ├── SpecterDesktop.java │ │ │ ├── Storage.java │ │ │ ├── StorageException.java │ │ │ ├── WalletAndKey.java │ │ │ ├── WalletExport.java │ │ │ ├── WalletImport.java │ │ │ ├── WalletLabels.java │ │ │ ├── WalletTransactions.java │ │ │ ├── bbqr │ │ │ │ ├── BBQR.java │ │ │ │ ├── BBQRDecoder.java │ │ │ │ ├── BBQREncoder.java │ │ │ │ ├── BBQREncoding.java │ │ │ │ ├── BBQREncodingException.java │ │ │ │ ├── BBQRException.java │ │ │ │ ├── BBQRHeader.java │ │ │ │ └── BBQRType.java │ │ │ ├── ckcard │ │ │ │ ├── CardAuthDump.java │ │ │ │ ├── CardBackup.java │ │ │ │ ├── CardCerts.java │ │ │ │ ├── CardChange.java │ │ │ │ ├── CardDerive.java │ │ │ │ ├── CardDump.java │ │ │ │ ├── CardProtocol.java │ │ │ │ ├── CardRead.java │ │ │ │ ├── CardResponse.java │ │ │ │ ├── CardSetup.java │ │ │ │ ├── CardSign.java │ │ │ │ ├── CardSignature.java │ │ │ │ ├── CardStatus.java │ │ │ │ ├── CardTransport.java │ │ │ │ ├── CardUnseal.java │ │ │ │ ├── CardWait.java │ │ │ │ ├── CardXpub.java │ │ │ │ ├── CkCardApi.java │ │ │ │ ├── Satschip.java │ │ │ │ └── Tapsigner.java │ │ │ ├── db │ │ │ │ ├── BlockTransactionDao.java │ │ │ │ ├── BlockTransactionHashIndexMapper.java │ │ │ │ ├── BlockTransactionMapper.java │ │ │ │ ├── DbPersistence.java │ │ │ │ ├── DetachedLabelDao.java │ │ │ │ ├── DetachedLabelMapper.java │ │ │ │ ├── KeystoreDao.java │ │ │ │ ├── KeystoreMapper.java │ │ │ │ ├── MixConfigDao.java │ │ │ │ ├── MixConfigMapper.java │ │ │ │ ├── PolicyDao.java │ │ │ │ ├── PolicyMapper.java │ │ │ │ ├── UtxoMixDataDao.java │ │ │ │ ├── UtxoMixDataMapper.java │ │ │ │ ├── WalletConfigDao.java │ │ │ │ ├── WalletConfigMapper.java │ │ │ │ ├── WalletDao.java │ │ │ │ ├── WalletMapper.java │ │ │ │ ├── WalletNodeDao.java │ │ │ │ ├── WalletNodeMapper.java │ │ │ │ ├── WalletNodeReducer.java │ │ │ │ ├── WalletTableDao.java │ │ │ │ └── WalletTableMapper.java │ │ │ └── satochip │ │ │ │ ├── APDUCommand.java │ │ │ │ ├── APDUResponse.java │ │ │ │ ├── Constants.java │ │ │ │ ├── KeyPath.java │ │ │ │ ├── SatoCardApi.java │ │ │ │ ├── SatoCardStatus.java │ │ │ │ ├── SatoCardTransport.java │ │ │ │ ├── Satochip.java │ │ │ │ ├── SatochipCommandSet.java │ │ │ │ ├── SatochipParser.java │ │ │ │ └── SecureChannelSession.java │ │ │ ├── keystoreimport │ │ │ ├── HwAirgappedController.java │ │ │ ├── HwUsbDevicesController.java │ │ │ ├── HwUsbScanController.java │ │ │ ├── KeystoreImportController.java │ │ │ ├── KeystoreImportDetailController.java │ │ │ ├── KeystoreImportDialog.java │ │ │ └── SwController.java │ │ │ ├── net │ │ │ ├── AllHistoryChangedException.java │ │ │ ├── Auth47.java │ │ │ ├── BatchedElectrumServerRpc.java │ │ │ ├── BlockExplorer.java │ │ │ ├── BlockHeaderTip.java │ │ │ ├── BlockStats.java │ │ │ ├── BroadcastSource.java │ │ │ ├── Bwt.java │ │ │ ├── CloseableTransport.java │ │ │ ├── ConfigurationException.java │ │ │ ├── CoreAuthType.java │ │ │ ├── ElectrumServer.java │ │ │ ├── ElectrumServerRpc.java │ │ │ ├── ElectrumServerRpcException.java │ │ │ ├── ExchangeSource.java │ │ │ ├── FeeRatesSource.java │ │ │ ├── HttpClientService.java │ │ │ ├── IpAddressMatcher.java │ │ │ ├── LnurlAuth.java │ │ │ ├── MempoolRateSize.java │ │ │ ├── NativeUtils.java │ │ │ ├── PagedBatchRequestBuilder.java │ │ │ ├── Protocol.java │ │ │ ├── ProxyServerException.java │ │ │ ├── ProxySocketFactory.java │ │ │ ├── ProxyTcpOverTlsTransport.java │ │ │ ├── PublicElectrumServer.java │ │ │ ├── RetryLogic.java │ │ │ ├── ScriptHashTx.java │ │ │ ├── ServerCapability.java │ │ │ ├── ServerConfigException.java │ │ │ ├── ServerException.java │ │ │ ├── ServerType.java │ │ │ ├── SimpleElectrumServerRpc.java │ │ │ ├── SubscriptionService.java │ │ │ ├── TcpOverTlsTransport.java │ │ │ ├── TcpTransport.java │ │ │ ├── TimeoutCounter.java │ │ │ ├── TlsServerException.java │ │ │ ├── Tor.java │ │ │ ├── TorHttpProxySupplier.java │ │ │ ├── TorServerException.java │ │ │ ├── TorService.java │ │ │ ├── TorStartupException.java │ │ │ ├── TorTcpOverTlsTransport.java │ │ │ ├── TorTcpTransport.java │ │ │ ├── TorUtils.java │ │ │ ├── UnknownCertificateExpiredException.java │ │ │ ├── VerboseTransaction.java │ │ │ ├── VersionCheckService.java │ │ │ └── cormorant │ │ │ │ ├── Cormorant.java │ │ │ │ ├── bitcoind │ │ │ │ ├── BitcoinRPCException.java │ │ │ │ ├── BitcoindClient.java │ │ │ │ ├── BitcoindClientService.java │ │ │ │ ├── BitcoindTransport.java │ │ │ │ ├── BlockchainInfo.java │ │ │ │ ├── Category.java │ │ │ │ ├── CormorantBitcoindException.java │ │ │ │ ├── CreateLoadWalletResult.java │ │ │ │ ├── FeeInfo.java │ │ │ │ ├── FeesMempoolEntry.java │ │ │ │ ├── ImportDescriptor.java │ │ │ │ ├── ImportDescriptorResult.java │ │ │ │ ├── ImportFailedException.java │ │ │ │ ├── ImportRangedDescriptor.java │ │ │ │ ├── ListDescriptorResult.java │ │ │ │ ├── ListDescriptorsResult.java │ │ │ │ ├── ListSinceBlock.java │ │ │ │ ├── ListTransaction.java │ │ │ │ ├── ListWalletDirResult.java │ │ │ │ ├── MempoolEntry.java │ │ │ │ ├── MempoolInfo.java │ │ │ │ ├── NetworkInfo.java │ │ │ │ ├── ScanDateBeforePruneException.java │ │ │ │ ├── VerboseBlockHeader.java │ │ │ │ ├── VsizeFeerate.java │ │ │ │ ├── WalletDirResult.java │ │ │ │ ├── WalletInfo.java │ │ │ │ └── WalletScanningInfo.java │ │ │ │ ├── electrum │ │ │ │ ├── BitcoindIOException.java │ │ │ │ ├── BlockNotFoundException.java │ │ │ │ ├── BroadcastFailedException.java │ │ │ │ ├── ElectrumBlockHeader.java │ │ │ │ ├── ElectrumNotificationService.java │ │ │ │ ├── ElectrumNotificationTransport.java │ │ │ │ ├── ElectrumServerRunnable.java │ │ │ │ ├── ElectrumServerService.java │ │ │ │ ├── RequestHandler.java │ │ │ │ ├── ScriptHashStatus.java │ │ │ │ ├── TransactionNotFoundException.java │ │ │ │ └── UnsupportedVersionException.java │ │ │ │ └── index │ │ │ │ ├── Store.java │ │ │ │ └── TxEntry.java │ │ │ ├── payjoin │ │ │ ├── Payjoin.java │ │ │ └── PayjoinReceiverException.java │ │ │ ├── paynym │ │ │ ├── PayNym.java │ │ │ ├── PayNymAddressesController.java │ │ │ ├── PayNymAddressesDialog.java │ │ │ ├── PayNymController.java │ │ │ ├── PayNymDialog.java │ │ │ └── PayNymService.java │ │ │ ├── settings │ │ │ ├── GeneralSettingsController.java │ │ │ ├── ServerAliasDialog.java │ │ │ ├── ServerSettingsController.java │ │ │ ├── SettingsController.java │ │ │ ├── SettingsDetailController.java │ │ │ ├── SettingsDialog.java │ │ │ └── SettingsGroup.java │ │ │ ├── terminal │ │ │ ├── BackgroundProgressBarRenderer.java │ │ │ ├── MasterActionListBox.java │ │ │ ├── MasterActionWindow.java │ │ │ ├── ModalDialog.java │ │ │ ├── PassphraseDialog.java │ │ │ ├── ProxyStatusLabel.java │ │ │ ├── SparrowTerminal.java │ │ │ ├── SparrowTextGui.java │ │ │ ├── TerminalInteractionServices.java │ │ │ ├── settings │ │ │ │ ├── BitcoinCoreDialog.java │ │ │ │ ├── GeneralDialog.java │ │ │ │ ├── PrivateElectrumDialog.java │ │ │ │ ├── PublicElectrumDialog.java │ │ │ │ ├── ServerProxyDialog.java │ │ │ │ ├── ServerStatusDialog.java │ │ │ │ ├── ServerTestDialog.java │ │ │ │ ├── ServerTypeDialog.java │ │ │ │ └── ServerUrlDialog.java │ │ │ └── wallet │ │ │ │ ├── AddAccountDialog.java │ │ │ │ ├── AddressesDialog.java │ │ │ │ ├── AdvancedDialog.java │ │ │ │ ├── Bip39Dialog.java │ │ │ │ ├── EmptyBorder.java │ │ │ │ ├── EntryTableCellRenderer.java │ │ │ │ ├── LoadWallet.java │ │ │ │ ├── NewWalletDialog.java │ │ │ │ ├── QRCodeDialog.java │ │ │ │ ├── QRTextImage.java │ │ │ │ ├── ReceiveDialog.java │ │ │ │ ├── SettingsDialog.java │ │ │ │ ├── TransactionsDialog.java │ │ │ │ ├── UtxosDialog.java │ │ │ │ ├── WalletAccountsDialog.java │ │ │ │ ├── WalletActionsDialog.java │ │ │ │ ├── WalletData.java │ │ │ │ ├── WalletDialog.java │ │ │ │ ├── WatchOnlyDialog.java │ │ │ │ └── table │ │ │ │ ├── AddressTableCell.java │ │ │ │ ├── CoinTableCell.java │ │ │ │ ├── DateTableCell.java │ │ │ │ ├── MixTableCell.java │ │ │ │ ├── OutputTableCell.java │ │ │ │ └── TableCell.java │ │ │ ├── transaction │ │ │ ├── HeadersController.java │ │ │ ├── HeadersForm.java │ │ │ ├── IndexedTransactionForm.java │ │ │ ├── InputController.java │ │ │ ├── InputForm.java │ │ │ ├── InputsController.java │ │ │ ├── InputsForm.java │ │ │ ├── OutputController.java │ │ │ ├── OutputForm.java │ │ │ ├── OutputsController.java │ │ │ ├── OutputsForm.java │ │ │ ├── PageForm.java │ │ │ ├── TransactionController.java │ │ │ ├── TransactionData.java │ │ │ ├── TransactionForm.java │ │ │ ├── TransactionFormController.java │ │ │ └── TransactionView.java │ │ │ └── wallet │ │ │ ├── AddressesController.java │ │ │ ├── AdvancedController.java │ │ │ ├── AdvancedDialog.java │ │ │ ├── Entry.java │ │ │ ├── FeeRatesSelection.java │ │ │ ├── Function.java │ │ │ ├── HashIndexEntry.java │ │ │ ├── InvalidTransactionException.java │ │ │ ├── KeystoreController.java │ │ │ ├── MultisigBackupDialog.java │ │ │ ├── NodeEntry.java │ │ │ ├── OptimizationStrategy.java │ │ │ ├── PaymentController.java │ │ │ ├── ReceiveController.java │ │ │ ├── SendController.java │ │ │ ├── SettingsController.java │ │ │ ├── SettingsWalletForm.java │ │ │ ├── TransactionEntry.java │ │ │ ├── TransactionHashIndexEntry.java │ │ │ ├── TransactionsController.java │ │ │ ├── UtxoEntry.java │ │ │ ├── UtxosController.java │ │ │ ├── WalletController.java │ │ │ ├── WalletForm.java │ │ │ ├── WalletFormController.java │ │ │ ├── WalletTransactionsEntry.java │ │ │ └── WalletUtxosEntry.java │ ├── module-info.java │ └── net │ │ └── sourceforge │ │ └── zbar │ │ ├── Config.java │ │ ├── Image.java │ │ ├── ImageScanner.java │ │ ├── Modifier.java │ │ ├── Orientation.java │ │ ├── Symbol.java │ │ ├── SymbolIterator.java │ │ ├── SymbolSet.java │ │ └── ZBar.java └── resources │ ├── com │ └── sparrowwallet │ │ └── sparrow │ │ ├── about.css │ │ ├── about.fxml │ │ ├── app.css │ │ ├── app.fxml │ │ ├── darktheme.css │ │ ├── descriptor.css │ │ ├── dialog.css │ │ ├── general.css │ │ ├── grid.css │ │ ├── keystoreimport │ │ ├── hw_airgapped.fxml │ │ ├── hw_usb-devices.fxml │ │ ├── hw_usb-error.fxml │ │ ├── hw_usb-none.fxml │ │ ├── hw_usb.fxml │ │ ├── keystoreimport.css │ │ ├── keystoreimport.fxml │ │ └── sw.fxml │ │ ├── notificationpopup.css │ │ ├── paynym │ │ ├── paynym.css │ │ ├── paynym.fxml │ │ └── paynymaddresses.fxml │ │ ├── script.css │ │ ├── search.css │ │ ├── settings │ │ ├── general.fxml │ │ ├── server.fxml │ │ ├── settings.css │ │ └── settings.fxml │ │ ├── sql │ │ ├── V1__Initial.sql │ │ ├── V2__Whirlpool.sql │ │ ├── V3__Account.sql │ │ ├── V4__Watch.sql │ │ ├── V5__DetachedLabel.sql │ │ ├── V6__PaymentCode.sql │ │ ├── V7__AddressData.sql │ │ ├── V8__WalletConfig.sql │ │ └── V9__WalletTable.sql │ │ ├── transaction │ │ ├── headers.css │ │ ├── headers.fxml │ │ ├── input.css │ │ ├── input.fxml │ │ ├── inputs.css │ │ ├── inputs.fxml │ │ ├── output.css │ │ ├── output.fxml │ │ ├── outputs.css │ │ ├── outputs.fxml │ │ ├── transaction.css │ │ └── transaction.fxml │ │ ├── wallet │ │ ├── addresses.css │ │ ├── addresses.fxml │ │ ├── advanced.css │ │ ├── advanced.fxml │ │ ├── keystore.css │ │ ├── keystore.fxml │ │ ├── payment.css │ │ ├── payment.fxml │ │ ├── receive.css │ │ ├── receive.fxml │ │ ├── send.css │ │ ├── send.fxml │ │ ├── settings.css │ │ ├── settings.fxml │ │ ├── transactions.css │ │ ├── transactions.fxml │ │ ├── utxos.css │ │ ├── utxos.fxml │ │ ├── wallet.css │ │ └── wallet.fxml │ │ ├── welcome.css │ │ └── welcome.fxml │ ├── font │ ├── LiberationSans-Regular.ttf │ ├── RobotoMono-Italic.ttf │ ├── RobotoMono-Regular.ttf │ ├── fa-brands-400.ttf │ └── fa-solid-900.ttf │ ├── image │ ├── blockexplorer │ │ ├── blockstream.info-icon.svg │ │ └── mempool.space-icon.svg │ ├── dialog │ │ ├── borderwallets-invert.svg │ │ ├── borderwallets.svg │ │ ├── paynym-invert.svg │ │ ├── paynym.svg │ │ ├── seed-invert.svg │ │ ├── seed.svg │ │ ├── sparrow-invert.svg │ │ ├── sparrow.svg │ │ ├── useradd-invert.svg │ │ ├── useradd.svg │ │ ├── whirlpool-invert.svg │ │ └── whirlpool.svg │ ├── exchangesource │ │ ├── coinbase-icon.svg │ │ ├── coingecko-icon.svg │ │ └── mempool.space-icon.svg │ ├── feeratesource │ │ ├── mempool.space-icon.svg │ │ ├── server-icon.svg │ │ └── settings-icon.svg │ ├── sparrow-black-small.png │ ├── sparrow-black-small@2x.png │ ├── sparrow-black-small@3x.png │ ├── sparrow-icon.png │ ├── sparrow-icon@2x.png │ ├── sparrow-white-small.png │ ├── sparrow-white-small@2x.png │ ├── sparrow-white-small@3x.png │ ├── sparrow.png │ ├── sparrow@2x.png │ ├── sparrow@3x.png │ └── walletmodel │ │ ├── airgapvault-icon-invert.svg │ │ ├── airgapvault-icon.svg │ │ ├── airgapvault-invert.svg │ │ ├── airgapvault.svg │ │ ├── bitbox02-icon-invert.svg │ │ ├── bitbox02-icon.svg │ │ ├── bitbox02-invert.svg │ │ ├── bitbox02.svg │ │ ├── bitcoincore-invert.svg │ │ ├── bitcoincore.svg │ │ ├── bluewallet-invert.svg │ │ ├── bluewallet-orig.svg │ │ ├── bluewallet.svg │ │ ├── bsms-invert.svg │ │ ├── bsms.svg │ │ ├── caravan-invert.svg │ │ ├── caravan.svg │ │ ├── cobovault-icon-invert.svg │ │ ├── cobovault-icon.svg │ │ ├── cobovault-invert.svg │ │ ├── cobovault.svg │ │ ├── coldcard-icon-invert.svg │ │ ├── coldcard-icon.svg │ │ ├── coldcard-invert.svg │ │ ├── coldcard.svg │ │ ├── digitalbitbox-icon-invert.svg │ │ ├── digitalbitbox-icon.svg │ │ ├── digitalbitbox-invert.svg │ │ ├── digitalbitbox.svg │ │ ├── electrum-invert.svg │ │ ├── electrum.svg │ │ ├── eps-invert.svg │ │ ├── eps.svg │ │ ├── jade-icon-invert.svg │ │ ├── jade-icon.svg │ │ ├── jade-invert.svg │ │ ├── jade.svg │ │ ├── keepkey-icon-invert.svg │ │ ├── keepkey-icon.svg │ │ ├── keepkey-invert.svg │ │ ├── keepkey.svg │ │ ├── keystone-icon-invert.svg │ │ ├── keystone-icon.svg │ │ ├── keystone-invert.svg │ │ ├── keystone.svg │ │ ├── krux-icon-invert.svg │ │ ├── krux-icon.svg │ │ ├── krux-invert.svg │ │ ├── krux.svg │ │ ├── labels-invert.svg │ │ ├── labels.svg │ │ ├── ledger-icon-invert.svg │ │ ├── ledger-icon.svg │ │ ├── ledger-invert.svg │ │ ├── ledger.svg │ │ ├── onekey-icon-invert.svg │ │ ├── onekey-icon.svg │ │ ├── onekey-invert.svg │ │ ├── onekey.svg │ │ ├── passport-icon-invert.svg │ │ ├── passport-icon.svg │ │ ├── passport-invert.svg │ │ ├── passport.svg │ │ ├── samourai-invert.svg │ │ ├── samourai.svg │ │ ├── satochip-icon-invert.svg │ │ ├── satochip-icon.svg │ │ ├── satochip-invert.svg │ │ ├── satochip.svg │ │ ├── satscard-invert.svg │ │ ├── satscard.svg │ │ ├── satschip-icon-invert.svg │ │ ├── satschip-icon.svg │ │ ├── satschip-invert.svg │ │ ├── satschip.svg │ │ ├── seed-invert.svg │ │ ├── seed.svg │ │ ├── seedsigner-icon-invert.svg │ │ ├── seedsigner-icon.svg │ │ ├── seedsigner-invert.svg │ │ ├── seedsigner.svg │ │ ├── seedtool-icon-invert.svg │ │ ├── seedtool-icon.svg │ │ ├── seedtool-invert.svg │ │ ├── seedtool.svg │ │ ├── sparrow-invert.svg │ │ ├── sparrow.svg │ │ ├── specter-icon-invert.svg │ │ ├── specter-icon.svg │ │ ├── specter-invert.svg │ │ ├── specter.svg │ │ ├── tapsigner-icon-invert.svg │ │ ├── tapsigner-icon.svg │ │ ├── tapsigner-invert.svg │ │ ├── tapsigner.svg │ │ ├── transactions-invert.svg │ │ ├── transactions.svg │ │ ├── trezor-icon-invert.svg │ │ ├── trezor-icon.svg │ │ ├── trezor-invert.svg │ │ └── trezor.svg │ ├── logback.xml │ └── native │ ├── linux │ ├── aarch64 │ │ ├── libbwt_jni.so │ │ └── libzbar.so │ └── x64 │ │ ├── libbwt_jni.so │ │ └── libzbar.so │ ├── osx │ ├── aarch64 │ │ ├── libbwt_jni.dylib │ │ └── libzbar.dylib │ └── x64 │ │ ├── libbwt_jni.dylib │ │ └── libzbar.dylib │ └── windows │ └── x64 │ ├── bwt_jni.dll │ ├── iconv-2.dll │ └── zbar.dll └── test ├── java └── com │ └── sparrowwallet │ └── sparrow │ └── io │ ├── CaravanMultisigTest.java │ ├── CoboVaultSinglesigTest.java │ ├── ColdcardMultisigTest.java │ ├── ColdcardSinglesigTest.java │ ├── ElectrumTest.java │ ├── IoTest.java │ ├── KeystoneSinglesigTest.java │ ├── SpecterDIYTest.java │ ├── SpecterDesktopTest.java │ ├── StorageTest.java │ └── bbqr │ ├── BBQRDecoderTest.java │ ├── BBQREncoderTest.java │ └── BBQREncodingTest.java └── resources └── com └── sparrowwallet └── sparrow └── io ├── caravan-multisig-export-1.json ├── cc-multisig-export-1.txt ├── cc-multisig-export-2.txt ├── cc-multisig-export-multideriv.txt ├── cc-multisig-keystore-1.json ├── cc-multisig-keystore-2.json ├── cc-singlesig-keystore-1.json ├── cobo-singlesig-keystore-1.json ├── electrum-encrypted ├── electrum-multisig-wallet.json ├── electrum-singlesig-seed-wallet.json ├── electrum-singlesig-wallet.json ├── keystone-singlesig-keystore-1.txt ├── sparrow-single-seed-wallet ├── sparrow-single-wallet ├── specter-diy-export.txt ├── specter-diy-keystore.txt ├── specter-multisig-wallet.json └── specter-wallet.json /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | *iml 4 | build 5 | /*.properties 6 | out 7 | *.log 8 | build-*.sh 9 | .DS_Store -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "drongo"] 2 | path = drongo 3 | url = ../../sparrowwallet/drongo.git 4 | [submodule "lark"] 5 | path = lark 6 | url = ../../sparrowwallet/lark.git 7 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Craig Raw Craig Raw 2 | Craig Raw craigraw 3 | -------------------------------------------------------------------------------- /buildSrc/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-gradle-plugin' // so we can assign and ID to our plugin 3 | } 4 | 5 | dependencies { 6 | implementation 'com.google.gradle:osdetector-gradle-plugin:1.7.3' 7 | implementation 'org.javamodularity:moduleplugin:1.8.14' 8 | } 9 | 10 | repositories { 11 | mavenCentral() 12 | maven { 13 | url "https://plugins.gradle.org/m2/" 14 | } 15 | } 16 | 17 | gradlePlugin { 18 | plugins { 19 | register("org-openjfx-javafxplugin") { 20 | id = "org-openjfx-javafxplugin" 21 | implementationClass = "org.openjfx.gradle.JavaFXPlugin" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | ## Sparrow Wallet Repository Docs 2 | 3 | Note that most documentation for the project can be found at https://sparrowwallet.com/docs/. 4 | The documentation here is mainly developer-related resources. 5 | 6 | ### [Reproducible builds](reproducible.md) 7 | 8 | Documentation to create and verify a build of the project against the released binaries. 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparrowwallet/sparrow/364909cfa3164d349799a11cc109b3d9e818dce6/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'sparrow' 2 | include 'drongo' 3 | include 'lark' 4 | 5 | -------------------------------------------------------------------------------- /sparrow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | cd `dirname $0` 4 | args="$*" 5 | args="${args%"${args##*[![:space:]]}"}" 6 | 7 | if [ -n "$args" ] 8 | then 9 | ./gradlew run --args="$args" 10 | else 11 | ./gradlew run 12 | fi 13 | -------------------------------------------------------------------------------- /sparrow.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set ARGS=%* 3 | 4 | if "%ARGS%" == "" ( 5 | gradlew.bat run 6 | ) else ( 7 | gradlew.bat run --args="%ARGS%" 8 | ) 9 | -------------------------------------------------------------------------------- /src/main/deploy/asc.properties: -------------------------------------------------------------------------------- 1 | mime-type=application/pgp-signature 2 | extension=asc 3 | description=ASCII Armored File -------------------------------------------------------------------------------- /src/main/deploy/auth47.properties: -------------------------------------------------------------------------------- 1 | mime-type=x-scheme-handler/auth47 2 | description=Auth47 Authentication URI -------------------------------------------------------------------------------- /src/main/deploy/bitcoin.properties: -------------------------------------------------------------------------------- 1 | mime-type=x-scheme-handler/bitcoin 2 | description=Bitcoin Scheme URI -------------------------------------------------------------------------------- /src/main/deploy/lightning.properties: -------------------------------------------------------------------------------- 1 | mime-type=x-scheme-handler/lightning 2 | description=LNURL URI -------------------------------------------------------------------------------- /src/main/deploy/package/linux-headless/control: -------------------------------------------------------------------------------- 1 | Package: sparrowserver 2 | Version: ${version}-1 3 | Section: utils 4 | Maintainer: Craig Raw 5 | Priority: optional 6 | Architecture: ${arch} 7 | Conflicts: sparrow (<= 2.1.4) 8 | Replaces: sparrow (<= 2.1.4) 9 | Provides: sparrowserver 10 | Description: Sparrow Server 11 | Depends: libc6, zlib1g 12 | Installed-Size: ${size} 13 | -------------------------------------------------------------------------------- /src/main/deploy/package/linux/Sparrow.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Sparrow 3 | Comment=Sparrow 4 | Exec=/opt/sparrowwallet/bin/Sparrow %U 5 | Icon=/opt/sparrowwallet/lib/Sparrow.png 6 | Terminal=false 7 | Type=Application 8 | Categories=Finance;Network; 9 | MimeType=application/psbt;application/bitcoin-transaction;application/pgp-signature;x-scheme-handler/bitcoin;x-scheme-handler/auth47;x-scheme-handler/lightning 10 | StartupWMClass=Sparrow 11 | SingleMainWindow=true 12 | -------------------------------------------------------------------------------- /src/main/deploy/package/linux/Sparrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparrowwallet/sparrow/364909cfa3164d349799a11cc109b3d9e818dce6/src/main/deploy/package/linux/Sparrow.png -------------------------------------------------------------------------------- /src/main/deploy/package/linux/control: -------------------------------------------------------------------------------- 1 | Package: sparrowwallet 2 | Version: ${version}-1 3 | Section: utils 4 | Maintainer: Craig Raw 5 | Priority: optional 6 | Architecture: ${arch} 7 | Provides: sparrowwallet 8 | Conflicts: sparrow (<= 2.1.4) 9 | Replaces: sparrow (<= 2.1.4) 10 | Description: Sparrow Wallet 11 | Depends: libasound2, libbsd0, libc6, libmd0, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxi6, libxrender1, libxtst6, xdg-utils 12 | Installed-Size: ${size} 13 | -------------------------------------------------------------------------------- /src/main/deploy/package/osx/Sparrow.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.cs.allow-jit 6 | 7 | com.apple.security.cs.allow-unsigned-executable-memory 8 | 9 | com.apple.security.cs.disable-executable-page-protection 10 | 11 | com.apple.security.cs.disable-library-validation 12 | 13 | com.apple.security.cs.allow-dyld-environment-variables 14 | 15 | com.apple.security.device.camera 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/deploy/package/osx/installer-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparrowwallet/sparrow/364909cfa3164d349799a11cc109b3d9e818dce6/src/main/deploy/package/osx/installer-background.png -------------------------------------------------------------------------------- /src/main/deploy/package/osx/sparrow.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparrowwallet/sparrow/364909cfa3164d349799a11cc109b3d9e818dce6/src/main/deploy/package/osx/sparrow.icns -------------------------------------------------------------------------------- /src/main/deploy/package/windows/sparrow.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparrowwallet/sparrow/364909cfa3164d349799a11cc109b3d9e818dce6/src/main/deploy/package/windows/sparrow.ico -------------------------------------------------------------------------------- /src/main/deploy/psbt.properties: -------------------------------------------------------------------------------- 1 | mime-type=application/psbt 2 | extension=psbt 3 | description=Partially Signed Bitcoin Transaction -------------------------------------------------------------------------------- /src/main/deploy/txn.properties: -------------------------------------------------------------------------------- 1 | mime-type=application/bitcoin-transaction 2 | extension=txn 3 | description=Bitcoin Transaction -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/AboutController.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow; 2 | 3 | import javafx.event.ActionEvent; 4 | import javafx.fxml.FXML; 5 | import javafx.scene.control.Label; 6 | import javafx.stage.Stage; 7 | 8 | public class AboutController { 9 | private Stage stage; 10 | 11 | @FXML 12 | private Label title; 13 | 14 | public void initializeView() { 15 | title.setText(SparrowWallet.APP_NAME + " " + SparrowWallet.APP_VERSION + SparrowWallet.APP_VERSION_SUFFIX); 16 | } 17 | 18 | public void setStage(Stage stage) { 19 | this.stage = stage; 20 | } 21 | 22 | public void close(ActionEvent event) { 23 | stage.close(); 24 | } 25 | 26 | public void openDonate(ActionEvent event) { 27 | AppServices.get().getApplication().getHostServices().showDocument("https://sparrowwallet.com/donate"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/CurrencyRate.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow; 2 | 3 | import java.util.Currency; 4 | 5 | public class CurrencyRate { 6 | private final Currency currency; 7 | private final Double btcRate; 8 | 9 | public CurrencyRate(Currency currency, Double btcRate) { 10 | this.currency = currency; 11 | this.btcRate = btcRate; 12 | } 13 | 14 | public Currency getCurrency() { 15 | return currency; 16 | } 17 | 18 | public boolean isAvailable() { 19 | return btcRate != null && btcRate > 0.0; 20 | } 21 | 22 | public Double getBtcRate() { 23 | return btcRate; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/EventManager.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow; 2 | 3 | import com.google.common.eventbus.EventBus; 4 | 5 | public class EventManager { 6 | private static EventBus SINGLETON = new EventBus(); 7 | 8 | private EventManager() {} 9 | 10 | public static EventBus get() { 11 | return SINGLETON; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/InteractionServices.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow; 2 | 3 | import com.sparrowwallet.drongo.wallet.Keystore; 4 | import javafx.scene.Node; 5 | import javafx.scene.control.Alert; 6 | import javafx.scene.control.ButtonType; 7 | 8 | import java.util.Optional; 9 | 10 | public interface InteractionServices { 11 | Optional showAlert(String title, String content, Alert.AlertType alertType, Node graphic, ButtonType... buttons); 12 | Optional requestPassphrase(String walletName, Keystore keystore); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/Mode.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow; 2 | 3 | public enum Mode { 4 | OFFLINE, ONLINE 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/SparrowWalletPreloader.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow; 2 | 3 | import javafx.application.Preloader; 4 | import javafx.stage.Stage; 5 | 6 | public class SparrowWalletPreloader extends Preloader { 7 | @Override 8 | public void start(Stage stage) { 9 | com.sun.glass.ui.Application.GetApplication().setName("Sparrow"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/TabData.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow; 2 | 3 | public class TabData { 4 | private final TabType type; 5 | 6 | public TabData(TabType type) { 7 | this.type = type; 8 | } 9 | 10 | public TabType getType() { 11 | return type; 12 | } 13 | 14 | public enum TabType { 15 | WALLET, TRANSACTION 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/Theme.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow; 2 | 3 | public enum Theme { 4 | LIGHT, DARK 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/TransactionParseException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow; 2 | 3 | public class TransactionParseException extends Exception { 4 | public TransactionParseException() { 5 | super(); 6 | } 7 | 8 | public TransactionParseException(String message) { 9 | super(message); 10 | } 11 | 12 | public TransactionParseException(Throwable cause) { 13 | super(cause); 14 | } 15 | 16 | public TransactionParseException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/WalletTabData.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | import com.sparrowwallet.sparrow.io.Storage; 5 | import com.sparrowwallet.sparrow.wallet.WalletForm; 6 | 7 | public class WalletTabData extends TabData { 8 | private final WalletForm walletForm; 9 | 10 | public WalletTabData(TabType type, WalletForm walletForm) { 11 | super(type); 12 | this.walletForm = walletForm; 13 | } 14 | 15 | public WalletForm getWalletForm() { 16 | return walletForm; 17 | } 18 | 19 | public Wallet getWallet() { 20 | return walletForm.getWallet(); 21 | } 22 | 23 | public Storage getStorage() { 24 | return walletForm.getStorage(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/control/ConfirmationsListener.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.control; 2 | 3 | import javafx.beans.property.IntegerProperty; 4 | 5 | public interface ConfirmationsListener { 6 | IntegerProperty getConfirmationsProperty(); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/control/CopyableLabel.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.control; 2 | 3 | import javafx.scene.control.TextField; 4 | 5 | public class CopyableLabel extends TextField { 6 | public CopyableLabel() { 7 | this(""); 8 | } 9 | 10 | public CopyableLabel(String text) { 11 | super(text); 12 | 13 | this.setEditable(false); 14 | this.getStyleClass().add("copyable-label"); 15 | this.setPrefWidth(10); 16 | this.textProperty().addListener((ob, o, n) -> { 17 | // expand the textfield 18 | double width = TextUtils.computeTextWidth(this.getFont(), this.getText(), 0.0D) + 2; 19 | this.setPrefWidth(width); 20 | this.setMaxWidth(width); 21 | }); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/control/DateStringConverter.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.control; 2 | 3 | import javafx.util.StringConverter; 4 | 5 | import java.time.LocalDate; 6 | import java.time.format.DateTimeFormatter; 7 | 8 | public class DateStringConverter extends StringConverter { 9 | public static final String FORMAT_PATTERN = "yyyy/MM/dd"; 10 | public static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern(FORMAT_PATTERN); 11 | 12 | @Override 13 | public String toString(LocalDate date) { 14 | if (date != null) { 15 | return DATE_FORMATTER.format(date); 16 | } else { 17 | return ""; 18 | } 19 | } 20 | 21 | @Override 22 | public LocalDate fromString(String string) { 23 | if (string != null && !string.isEmpty()) { 24 | return LocalDate.parse(string, DATE_FORMATTER); 25 | } else { 26 | return null; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/control/DynamicForm.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.control; 2 | 3 | import tornadofx.control.Form; 4 | 5 | public class DynamicForm extends Form { 6 | private DynamicUpdate dynamicUpdate; 7 | 8 | public DynamicForm() { 9 | super(); 10 | } 11 | 12 | public void setDynamicUpdate(DynamicUpdate dynamicUpdate) { 13 | this.dynamicUpdate = dynamicUpdate; 14 | } 15 | 16 | @Override 17 | protected void layoutChildren() { 18 | if(dynamicUpdate != null) { 19 | dynamicUpdate.update(); 20 | } 21 | 22 | super.layoutChildren(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/control/DynamicUpdate.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.control; 2 | 3 | public interface DynamicUpdate { 4 | void update(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/control/IdLabel.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.control; 2 | 3 | import com.sparrowwallet.sparrow.AppServices; 4 | 5 | public class IdLabel extends CopyableLabel { 6 | public IdLabel() { 7 | this(""); 8 | } 9 | 10 | public IdLabel(String text) { 11 | super(text); 12 | setFont(AppServices.getMonospaceFont()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/control/NumberCell.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.control; 2 | 3 | import com.sparrowwallet.drongo.OsType; 4 | import com.sparrowwallet.sparrow.wallet.Entry; 5 | import javafx.scene.control.TreeTableCell; 6 | 7 | public class NumberCell extends TreeTableCell { 8 | public NumberCell() { 9 | super(); 10 | getStyleClass().add("number-cell"); 11 | if(OsType.getCurrent() == OsType.MACOS) { 12 | getStyleClass().add("number-field"); 13 | } 14 | } 15 | 16 | @Override 17 | protected void updateItem(Number amount, boolean empty) { 18 | super.updateItem(amount, empty); 19 | 20 | if(empty || amount == null) { 21 | setText(null); 22 | setGraphic(null); 23 | } else { 24 | setText(amount.toString()); 25 | setGraphic(null); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/control/PaymentCodeTextField.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.control; 2 | 3 | import com.sparrowwallet.drongo.bip47.PaymentCode; 4 | 5 | public class PaymentCodeTextField extends CopyableTextField { 6 | private String paymentCodeStr; 7 | 8 | public void setPaymentCode(PaymentCode paymentCode) { 9 | this.paymentCodeStr = paymentCode.toString(); 10 | setPaymentCodeString(); 11 | } 12 | 13 | private void setPaymentCodeString() { 14 | String abbrevPcode = paymentCodeStr.substring(0, 12) + "..." + paymentCodeStr.substring(paymentCodeStr.length() - 5); 15 | setText(abbrevPcode); 16 | } 17 | 18 | @Override 19 | protected String getCopyText() { 20 | return paymentCodeStr; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/control/QRDensity.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.control; 2 | 3 | public enum QRDensity { 4 | NORMAL("Normal", 400, 2000), 5 | LOW("Low", 80, 1000); 6 | 7 | private final String name; 8 | private final int maxUrFragmentLength; 9 | private final int maxBbqrFragmentLength; 10 | 11 | QRDensity(String name, int maxUrFragmentLength, int maxBbqrFragmentLength) { 12 | this.name = name; 13 | this.maxUrFragmentLength = maxUrFragmentLength; 14 | this.maxBbqrFragmentLength = maxBbqrFragmentLength; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public int getMaxUrFragmentLength() { 22 | return maxUrFragmentLength; 23 | } 24 | 25 | public int getMaxBbqrFragmentLength() { 26 | return maxBbqrFragmentLength; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/control/UnlabeledToggleSwitch.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.control; 2 | 3 | import impl.org.controlsfx.skin.ToggleSwitchSkin; 4 | import javafx.scene.control.Skin; 5 | import org.controlsfx.control.ToggleSwitch; 6 | 7 | public class UnlabeledToggleSwitch extends ToggleSwitch { 8 | @Override protected Skin createDefaultSkin() { 9 | return new ToggleSwitchSkin(this) { 10 | @Override 11 | protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { 12 | return super.computePrefWidth(height, topInset, rightInset, bottomInset, leftInset) - 20; 13 | } 14 | }; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/control/ViewPasswordField.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.control; 2 | 3 | import javafx.beans.property.ObjectProperty; 4 | import javafx.scene.Node; 5 | import javafx.scene.control.Skin; 6 | import org.controlsfx.control.textfield.CustomPasswordField; 7 | 8 | public class ViewPasswordField extends CustomPasswordField { 9 | public ViewPasswordField() { 10 | super(); 11 | getStyleClass().add("view-password-text-field"); 12 | } 13 | 14 | @Override 15 | protected Skin createDefaultSkin() { 16 | return new ViewPasswordFieldSkin(this) { 17 | @Override 18 | public ObjectProperty leftProperty() { 19 | return ViewPasswordField.this.leftProperty(); 20 | } 21 | 22 | @Override 23 | public ObjectProperty rightProperty() { 24 | return ViewPasswordField.this.rightProperty(); 25 | } 26 | }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/AddressDisplayedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | /** 4 | * This event is used by the DeviceAddressDialog to indicate that a USB device has displayed an address 5 | * 6 | */ 7 | public class AddressDisplayedEvent { 8 | private final String address; 9 | 10 | public AddressDisplayedEvent(String address) { 11 | this.address = address; 12 | } 13 | 14 | public String getAddress() { 15 | return address; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/BitcoinUnitChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.BitcoinUnit; 4 | import com.sparrowwallet.sparrow.UnitFormat; 5 | import com.sparrowwallet.sparrow.io.Config; 6 | 7 | public class BitcoinUnitChangedEvent extends UnitFormatChangedEvent { 8 | private final BitcoinUnit bitcoinUnit; 9 | 10 | public BitcoinUnitChangedEvent(BitcoinUnit bitcoinUnit) { 11 | super(Config.get().getUnitFormat() == null ? UnitFormat.DOT : Config.get().getUnitFormat()); 12 | this.bitcoinUnit = bitcoinUnit; 13 | } 14 | 15 | public BitcoinUnitChangedEvent(UnitFormat unitFormat, BitcoinUnit bitcoinUnit) { 16 | super(unitFormat); 17 | this.bitcoinUnit = bitcoinUnit; 18 | } 19 | 20 | public BitcoinUnit getBitcoinUnit() { 21 | return bitcoinUnit; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/BlockSummaryEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.BlockSummary; 4 | 5 | import java.util.Map; 6 | 7 | public class BlockSummaryEvent { 8 | private final Map blockSummaryMap; 9 | private final Double nextBlockMedianFeeRate; 10 | 11 | public BlockSummaryEvent(Map blockSummaryMap, Double nextBlockMedianFeeRate) { 12 | this.blockSummaryMap = blockSummaryMap; 13 | this.nextBlockMedianFeeRate = nextBlockMedianFeeRate; 14 | } 15 | 16 | public Map getBlockSummaryMap() { 17 | return blockSummaryMap; 18 | } 19 | 20 | public Double getNextBlockMedianFeeRate() { 21 | return nextBlockMedianFeeRate; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/BwtBootStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class BwtBootStatusEvent extends BwtStatusEvent { 4 | public BwtBootStatusEvent(String status) { 5 | super(status); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/BwtElectrumReadyStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class BwtElectrumReadyStatusEvent extends BwtStatusEvent { 4 | private final String electrumAddr; 5 | 6 | public BwtElectrumReadyStatusEvent(String status, String electrumAddr) { 7 | super(status); 8 | this.electrumAddr = electrumAddr; 9 | } 10 | 11 | public String getElectrumAddr() { 12 | return electrumAddr; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/BwtReadyStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class BwtReadyStatusEvent extends BwtStatusEvent { 4 | public BwtReadyStatusEvent(String status) { 5 | super(status); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/BwtShutdownEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | /** 4 | * Empty class used to notify the bwt has shut down. 5 | * Note this extends from DisconnectionEvent, which is the more general event fired on any type of disconnection. 6 | */ 7 | public class BwtShutdownEvent extends DisconnectionEvent { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/BwtStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class BwtStatusEvent { 4 | private final String status; 5 | 6 | public BwtStatusEvent(String status) { 7 | this.status = status; 8 | } 9 | 10 | public String getStatus() { 11 | return status; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/BwtSyncStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import java.text.DateFormat; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | public class BwtSyncStatusEvent extends BwtStatusEvent { 8 | private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd HH:mm"); 9 | 10 | private final int progress; 11 | private final Date tip; 12 | 13 | public BwtSyncStatusEvent(String status, int progress, Date tip) { 14 | super(status); 15 | this.progress = progress; 16 | this.tip = tip; 17 | } 18 | 19 | public int getProgress() { 20 | return progress; 21 | } 22 | 23 | public boolean isCompleted() { 24 | return progress == 100; 25 | } 26 | 27 | public Date getTip() { 28 | return tip; 29 | } 30 | 31 | public String getTipAsString() { 32 | return tip == null ? "" : DATE_FORMAT.format(tip); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/ConnectionStartEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.AppServices; 4 | 5 | public class ConnectionStartEvent { 6 | private final String status; 7 | 8 | public ConnectionStartEvent(String serverAddress) { 9 | this.status = AppServices.isTorRunning() ? "Tor running, connecting to " + serverAddress + "..." : "Connecting to " + serverAddress + "..."; 10 | } 11 | 12 | public String getStatus() { 13 | return status; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/CormorantStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public abstract class CormorantStatusEvent { 6 | private final String status; 7 | 8 | public CormorantStatusEvent(String status) { 9 | this.status = status; 10 | } 11 | 12 | public String getStatus() { 13 | return status; 14 | } 15 | 16 | public abstract boolean isFor(Wallet wallet); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/DeviceAddressEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.address.Address; 4 | 5 | public class DeviceAddressEvent { 6 | private final Address address; 7 | 8 | public DeviceAddressEvent(Address address) { 9 | this.address = address; 10 | } 11 | 12 | public Address getAddress() { 13 | return address; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/DeviceGetPrivateKeyEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.crypto.ECKey; 4 | import com.sparrowwallet.drongo.protocol.ScriptType; 5 | 6 | public class DeviceGetPrivateKeyEvent { 7 | private final ECKey privateKey; 8 | private final ScriptType scriptType; 9 | 10 | public DeviceGetPrivateKeyEvent(ECKey privateKey, ScriptType scriptType) { 11 | this.privateKey = privateKey; 12 | this.scriptType = scriptType; 13 | } 14 | 15 | public ECKey getPrivateKey() { 16 | return privateKey; 17 | } 18 | 19 | public ScriptType getScriptType() { 20 | return scriptType; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/DisconnectionEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | /** 4 | * Empty class used to signal that the server has been disconnected from. 5 | */ 6 | public class DisconnectionEvent { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/ExchangeRatesUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.CurrencyRate; 4 | 5 | import java.util.Currency; 6 | 7 | public class ExchangeRatesUpdatedEvent { 8 | private final Currency currency; 9 | private final Double btcRate; 10 | 11 | public ExchangeRatesUpdatedEvent(Currency currency, Double btcRate) { 12 | this.currency = currency; 13 | this.btcRate = btcRate; 14 | } 15 | 16 | public Currency getCurrency() { 17 | return currency; 18 | } 19 | 20 | public Double getBtcRate() { 21 | return btcRate; 22 | } 23 | 24 | public CurrencyRate getCurrencyRate() { 25 | return new CurrencyRate(currency, btcRate); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/ExcludeUtxoEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.BlockTransactionHashIndex; 4 | import com.sparrowwallet.drongo.wallet.WalletTransaction; 5 | 6 | public class ExcludeUtxoEvent { 7 | private final WalletTransaction walletTransaction; 8 | private final BlockTransactionHashIndex utxo; 9 | 10 | public ExcludeUtxoEvent(WalletTransaction walletTransaction, BlockTransactionHashIndex utxo) { 11 | this.walletTransaction = walletTransaction; 12 | this.utxo = utxo; 13 | } 14 | 15 | public WalletTransaction getWalletTransaction() { 16 | return walletTransaction; 17 | } 18 | 19 | public BlockTransactionHashIndex getUtxo() { 20 | return utxo; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/ExistingWalletImportedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class ExistingWalletImportedEvent { 6 | private final String existingWalletId; 7 | private final Wallet importedWallet; 8 | 9 | public ExistingWalletImportedEvent(String existingWalletId, Wallet importedWallet) { 10 | this.existingWalletId = existingWalletId; 11 | this.importedWallet = importedWallet; 12 | } 13 | 14 | public String getExistingWalletId() { 15 | return existingWalletId; 16 | } 17 | 18 | public Wallet getImportedWallet() { 19 | return importedWallet; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/FeeRatesSelectionChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | import com.sparrowwallet.sparrow.wallet.FeeRatesSelection; 5 | 6 | public class FeeRatesSelectionChangedEvent { 7 | private final Wallet wallet; 8 | private final FeeRatesSelection feeRatesSelection; 9 | 10 | public FeeRatesSelectionChangedEvent(Wallet wallet, FeeRatesSelection feeRatesSelection) { 11 | this.wallet = wallet; 12 | this.feeRatesSelection = feeRatesSelection; 13 | } 14 | 15 | public Wallet getWallet() { 16 | return wallet; 17 | } 18 | 19 | public FeeRatesSelection getFeeRateSelection() { 20 | return feeRatesSelection; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/FeeRatesSourceChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.net.FeeRatesSource; 4 | 5 | public class FeeRatesSourceChangedEvent { 6 | private final FeeRatesSource feeRatesSource; 7 | 8 | public FeeRatesSourceChangedEvent(FeeRatesSource feeRatesSource) { 9 | this.feeRatesSource = feeRatesSource; 10 | } 11 | 12 | public FeeRatesSource getFeeRateSource() { 13 | return feeRatesSource; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/FiatCurrencySelectedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.net.ExchangeSource; 4 | 5 | import java.util.Currency; 6 | 7 | public class FiatCurrencySelectedEvent { 8 | private final ExchangeSource exchangeSource; 9 | private final Currency currency; 10 | 11 | public FiatCurrencySelectedEvent(ExchangeSource exchangeSource, Currency currency) { 12 | this.exchangeSource = exchangeSource; 13 | this.currency = currency; 14 | } 15 | 16 | public ExchangeSource getExchangeSource() { 17 | return exchangeSource; 18 | } 19 | 20 | public Currency getCurrency() { 21 | return currency; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/FinalizeTransactionEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.psbt.PSBT; 4 | import com.sparrowwallet.drongo.wallet.Wallet; 5 | 6 | public class FinalizeTransactionEvent { 7 | private final PSBT psbt; 8 | private final Wallet signingWallet; 9 | 10 | public FinalizeTransactionEvent(PSBT psbt, Wallet signingWallet) { 11 | this.psbt = psbt; 12 | this.signingWallet = signingWallet; 13 | } 14 | 15 | public PSBT getPsbt() { 16 | return psbt; 17 | } 18 | 19 | public Wallet getSigningWallet() { 20 | return signingWallet; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/FunctionActionEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | import com.sparrowwallet.sparrow.wallet.Function; 5 | 6 | public class FunctionActionEvent { 7 | private final Function function; 8 | private final Wallet wallet; 9 | 10 | public FunctionActionEvent(Function function, Wallet wallet) { 11 | this.function = function; 12 | this.wallet = wallet; 13 | } 14 | 15 | public Function getFunction() { 16 | return function; 17 | } 18 | 19 | public Wallet getWallet() { 20 | return wallet; 21 | } 22 | 23 | public boolean selectFunction() { 24 | return true; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/HideEmptyUsedAddressesStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class HideEmptyUsedAddressesStatusEvent { 4 | private final boolean hideEmptyUsedAddresses; 5 | 6 | public HideEmptyUsedAddressesStatusEvent(boolean hideEmptyUsedAddresses) { 7 | this.hideEmptyUsedAddresses = hideEmptyUsedAddresses; 8 | } 9 | 10 | public boolean isHideEmptyUsedAddresses() { 11 | return hideEmptyUsedAddresses; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/IncludeMempoolOutputsChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | /** 4 | * Empty class to indicate the includeMempoolOutputs config setting has changed 5 | */ 6 | public class IncludeMempoolOutputsChangedEvent { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/KeystoreDeviceRegistrationsChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Keystore; 4 | import com.sparrowwallet.drongo.wallet.Wallet; 5 | 6 | import java.util.List; 7 | 8 | public class KeystoreDeviceRegistrationsChangedEvent extends WalletChangedEvent { 9 | private final List changedKeystores; 10 | 11 | public KeystoreDeviceRegistrationsChangedEvent(Wallet wallet, List changedKeystores) { 12 | super(wallet); 13 | this.changedKeystores = changedKeystores; 14 | } 15 | 16 | public List getChangedKeystores() { 17 | return changedKeystores; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/KeystoreEncryptionChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Keystore; 4 | import com.sparrowwallet.drongo.wallet.Wallet; 5 | 6 | import java.util.List; 7 | 8 | public class KeystoreEncryptionChangedEvent extends WalletSettingsChangedEvent { 9 | private List changedKeystores; 10 | 11 | public KeystoreEncryptionChangedEvent(Wallet wallet, Wallet pastWallet, String walletId, List changedKeystores) { 12 | super(wallet, pastWallet, walletId); 13 | this.changedKeystores = changedKeystores; 14 | } 15 | 16 | public List getChangedKeystores() { 17 | return changedKeystores; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/KeystoreExportEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Keystore; 4 | 5 | public class KeystoreExportEvent { 6 | private final Keystore keystore; 7 | 8 | public KeystoreExportEvent(Keystore keystore) { 9 | this.keystore = keystore; 10 | } 11 | 12 | public Keystore getKeystore() { 13 | return keystore; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/KeystoreImportEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Keystore; 4 | 5 | public class KeystoreImportEvent { 6 | private Keystore keystore; 7 | 8 | public KeystoreImportEvent(Keystore keystore) { 9 | this.keystore = keystore; 10 | } 11 | 12 | public Keystore getKeystore() { 13 | return keystore; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/KeystoreLabelsChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Keystore; 4 | import com.sparrowwallet.drongo.wallet.Wallet; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * This event is trigger when one or more keystores on a wallet are updated, and the wallet is saved 10 | */ 11 | public class KeystoreLabelsChangedEvent extends WalletSettingsChangedEvent { 12 | private final List changedKeystores; 13 | 14 | public KeystoreLabelsChangedEvent(Wallet wallet, Wallet pastWallet, String walletId, List changedKeystores) { 15 | super(wallet, pastWallet, walletId); 16 | this.changedKeystores = changedKeystores; 17 | } 18 | 19 | public List getChangedKeystores() { 20 | return changedKeystores; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/KeystoreSignedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Keystore; 4 | 5 | /** 6 | * This event is used to indicate the animation for signing a keystore is complete 7 | */ 8 | public class KeystoreSignedEvent { 9 | private final Keystore keystore; 10 | 11 | public KeystoreSignedEvent(Keystore keystore) { 12 | this.keystore = keystore; 13 | } 14 | 15 | public Keystore getKeystore() { 16 | return keystore; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/KeystoresDiscoveredEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Keystore; 4 | import com.sparrowwallet.drongo.wallet.StandardAccount; 5 | 6 | import java.util.Map; 7 | 8 | public class KeystoresDiscoveredEvent { 9 | private final Map discoveredKeystores; 10 | 11 | public KeystoresDiscoveredEvent(Map discoveredKeystores) { 12 | this.discoveredKeystores = discoveredKeystores; 13 | } 14 | 15 | public Map getDiscoveredKeystores() { 16 | return discoveredKeystores; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/LoadingLogChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class LoadingLogChangedEvent { 4 | private final boolean visible; 5 | 6 | public LoadingLogChangedEvent(boolean visible) { 7 | this.visible = visible; 8 | } 9 | 10 | public boolean isVisible() { 11 | return visible; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/MempoolEntriesInitializedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | /** 4 | * The event is posted when the first set of mempool entries (txid and vsizes) have been retrieved from the node. 5 | * Cormorant only. 6 | */ 7 | public class MempoolEntriesInitializedEvent { 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/MempoolRateSizesUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.net.MempoolRateSize; 4 | 5 | import java.util.Set; 6 | 7 | public class MempoolRateSizesUpdatedEvent { 8 | private final Set mempoolRateSizes; 9 | 10 | public MempoolRateSizesUpdatedEvent(Set mempoolRateSizes) { 11 | this.mempoolRateSizes = mempoolRateSizes; 12 | } 13 | 14 | public Set getMempoolRateSizes() { 15 | return mempoolRateSizes; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/MessageSignedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | /** 6 | * This event is used by the DeviceSignMessageDialog to indicate that a USB device has signed a message 7 | * 8 | */ 9 | public class MessageSignedEvent { 10 | private final Wallet wallet; 11 | private final String signature; 12 | 13 | public MessageSignedEvent(Wallet wallet, String signature) { 14 | this.wallet = wallet; 15 | this.signature = signature; 16 | } 17 | 18 | public Wallet getWallet() { 19 | return wallet; 20 | } 21 | 22 | public String getSignature() { 23 | return signature; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/MixToConfigChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class MixToConfigChangedEvent { 6 | private final Wallet wallet; 7 | 8 | public MixToConfigChangedEvent(Wallet wallet) { 9 | this.wallet = wallet; 10 | } 11 | 12 | public Wallet getWallet() { 13 | return wallet; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/NewBlockEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.protocol.BlockHeader; 4 | 5 | public class NewBlockEvent { 6 | private final int height; 7 | private final BlockHeader blockHeader; 8 | 9 | public NewBlockEvent(int height, BlockHeader blockHeader) { 10 | this.height = height; 11 | this.blockHeader = blockHeader; 12 | } 13 | 14 | public int getHeight() { 15 | return height; 16 | } 17 | 18 | public BlockHeader getBlockHeader() { 19 | return blockHeader; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/NewChildWalletSavedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | import com.sparrowwallet.sparrow.io.Storage; 5 | 6 | public class NewChildWalletSavedEvent { 7 | private final Storage storage; 8 | private final Wallet masterWallet; 9 | private final Wallet childWallet; 10 | 11 | public NewChildWalletSavedEvent(Storage storage, Wallet masterWallet, Wallet childWallet) { 12 | this.storage = storage; 13 | this.masterWallet = masterWallet; 14 | this.childWallet = childWallet; 15 | } 16 | 17 | public String getMasterWalletId() { 18 | return storage.getWalletId(masterWallet); 19 | } 20 | 21 | public Wallet getChildWallet() { 22 | return childWallet; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/OpenWalletsNewWindowsStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class OpenWalletsNewWindowsStatusEvent { 4 | private final boolean openWalletsInNewWindows; 5 | 6 | public OpenWalletsNewWindowsStatusEvent(boolean openWalletsInNewWindows) { 7 | this.openWalletsInNewWindows = openWalletsInNewWindows; 8 | } 9 | 10 | public boolean isOpenWalletsInNewWindows() { 11 | return openWalletsInNewWindows; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/PSBTCombinedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.psbt.PSBT; 4 | 5 | public class PSBTCombinedEvent extends PSBTEvent { 6 | public PSBTCombinedEvent(PSBT psbt) { 7 | super(psbt); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/PSBTEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.psbt.PSBT; 4 | 5 | public class PSBTEvent { 6 | private final PSBT psbt; 7 | 8 | public PSBTEvent(PSBT psbt) { 9 | this.psbt = psbt; 10 | } 11 | 12 | public PSBT getPsbt() { 13 | return psbt; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/PSBTFinalizedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.psbt.PSBT; 4 | 5 | /** 6 | * This event is fired once the signing animation has finished and the PSBT has been finalized 7 | * 8 | */ 9 | public class PSBTFinalizedEvent extends PSBTEvent { 10 | public PSBTFinalizedEvent(PSBT psbt) { 11 | super(psbt); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/PSBTReorderedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.psbt.PSBT; 4 | 5 | public class PSBTReorderedEvent { 6 | private final PSBT psbt; 7 | 8 | public PSBTReorderedEvent(PSBT psbt) { 9 | this.psbt = psbt; 10 | } 11 | 12 | public PSBT getPsbt() { 13 | return psbt; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/PSBTSignedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.psbt.PSBT; 4 | 5 | /** 6 | * This event is used by the DeviceSignDialog to indicate that a USB device has signed a PSBT 7 | * 8 | */ 9 | public class PSBTSignedEvent extends PSBTEvent { 10 | private final PSBT signedPsbt; 11 | 12 | public PSBTSignedEvent(PSBT psbt, PSBT signedPsbt) { 13 | super(psbt); 14 | this.signedPsbt = signedPsbt; 15 | } 16 | 17 | public PSBT getSignedPsbt() { 18 | return signedPsbt; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/PagedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class PagedEvent { 4 | private final int pageStart; 5 | private final int pageEnd; 6 | 7 | public PagedEvent(int pageStart, int pageEnd) { 8 | this.pageStart = pageStart; 9 | this.pageEnd = pageEnd; 10 | } 11 | 12 | public int getPageStart() { 13 | return pageStart; 14 | } 15 | 16 | public int getPageEnd() { 17 | return pageEnd; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/PayNymImageLoadedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.bip47.PaymentCode; 4 | import javafx.scene.image.Image; 5 | 6 | public class PayNymImageLoadedEvent { 7 | private final PaymentCode paymentCode; 8 | private final Image image; 9 | 10 | public PayNymImageLoadedEvent(PaymentCode paymentCode, Image image) { 11 | this.paymentCode = paymentCode; 12 | this.image = image; 13 | } 14 | 15 | public PaymentCode getPaymentCode() { 16 | return paymentCode; 17 | } 18 | 19 | public Image getImage() { 20 | return image; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/ReceiveActionEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | import com.sparrowwallet.sparrow.wallet.Function; 5 | import com.sparrowwallet.sparrow.wallet.NodeEntry; 6 | 7 | public class ReceiveActionEvent extends FunctionActionEvent { 8 | public ReceiveActionEvent(NodeEntry receiveEntry) { 9 | super(Function.RECEIVE, receiveEntry.getWallet()); 10 | } 11 | 12 | public ReceiveActionEvent(Wallet wallet) { 13 | super(Function.RECEIVE, wallet); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/ReceiveToEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.wallet.NodeEntry; 4 | 5 | public class ReceiveToEvent { 6 | private final NodeEntry receiveEntry; 7 | 8 | public ReceiveToEvent(NodeEntry receiveEntry) { 9 | this.receiveEntry = receiveEntry; 10 | } 11 | 12 | public NodeEntry getReceiveEntry() { 13 | return receiveEntry; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/ReplaceChangeAddressEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.WalletTransaction; 4 | 5 | public class ReplaceChangeAddressEvent { 6 | private final WalletTransaction walletTransaction; 7 | 8 | public ReplaceChangeAddressEvent(WalletTransaction walletTx) { 9 | this.walletTransaction = walletTx; 10 | } 11 | 12 | public WalletTransaction getWalletTransaction() { 13 | return walletTransaction; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/RequestConnectEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class RequestConnectEvent { 4 | //Empty event class used to request programmatic connection to the server 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/RequestDisconnectEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class RequestDisconnectEvent { 4 | //Empty event class used to request programmatic disconnection from the server 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/RequestOpenWalletsEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class RequestOpenWalletsEvent { 4 | //Empty event class used to request a List of opened wallets 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/RequestQRScanEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import javafx.stage.Window; 4 | 5 | /** 6 | * Event class used to request the QRScanDialog is opened 7 | */ 8 | public class RequestQRScanEvent { 9 | private final Window window; 10 | 11 | public RequestQRScanEvent(Window window) { 12 | this.window = window; 13 | } 14 | 15 | public Window getWindow() { 16 | return window; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/RequestTransactionOpenEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import javafx.stage.Window; 4 | 5 | import java.io.File; 6 | 7 | /** 8 | * Event class used to request the transaction open file dialog 9 | */ 10 | public class RequestTransactionOpenEvent { 11 | private final Window window; 12 | private final File file; 13 | 14 | public RequestTransactionOpenEvent(Window window) { 15 | this.window = window; 16 | this.file = null; 17 | } 18 | 19 | public RequestTransactionOpenEvent(Window window, File file) { 20 | this.window = window; 21 | this.file = file; 22 | } 23 | 24 | public Window getWindow() { 25 | return window; 26 | } 27 | 28 | public File getFile() { 29 | return file; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/RequestVerifyDownloadEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import javafx.stage.Window; 4 | 5 | import java.io.File; 6 | 7 | public class RequestVerifyDownloadEvent { 8 | private final Window window; 9 | private final File file; 10 | 11 | public RequestVerifyDownloadEvent(Window window) { 12 | this.window = window; 13 | this.file = null; 14 | } 15 | 16 | public RequestVerifyDownloadEvent(Window window, File file) { 17 | this.window = window; 18 | this.file = file; 19 | } 20 | 21 | public Window getWindow() { 22 | return window; 23 | } 24 | 25 | public File getFile() { 26 | return file; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/RequestWalletOpenEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import javafx.stage.Window; 4 | 5 | import java.io.File; 6 | 7 | /** 8 | * Event class used to request the wallet open dialog 9 | */ 10 | public class RequestWalletOpenEvent { 11 | private final Window window; 12 | private final File file; 13 | 14 | public RequestWalletOpenEvent(Window window) { 15 | this.window = window; 16 | this.file = null; 17 | } 18 | 19 | public RequestWalletOpenEvent(Window window, File file) { 20 | this.window = window; 21 | this.file = file; 22 | } 23 | 24 | public Window getWindow() { 25 | return window; 26 | } 27 | 28 | public File getFile() { 29 | return file; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/SelectEntryEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | import com.sparrowwallet.sparrow.wallet.Entry; 5 | 6 | public class SelectEntryEvent { 7 | private final Entry entry; 8 | 9 | public SelectEntryEvent(Entry entry) { 10 | this.entry = entry; 11 | } 12 | 13 | public Entry getEntry() { 14 | return entry; 15 | } 16 | 17 | public Wallet getWallet() { 18 | return entry.getWallet(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/SendPaymentsEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Payment; 4 | import com.sparrowwallet.drongo.wallet.Wallet; 5 | 6 | import java.util.List; 7 | 8 | public class SendPaymentsEvent { 9 | private final Wallet wallet; 10 | private final List payments; 11 | 12 | public SendPaymentsEvent(Wallet wallet, List payments) { 13 | this.wallet = wallet; 14 | this.payments = payments; 15 | } 16 | 17 | public Wallet getWallet() { 18 | return wallet; 19 | } 20 | 21 | public List getPayments() { 22 | return payments; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/ServerTypeChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.net.ServerType; 4 | 5 | public class ServerTypeChangedEvent { 6 | private final ServerType serverType; 7 | 8 | public ServerTypeChangedEvent(ServerType serverType) { 9 | this.serverType = serverType; 10 | } 11 | 12 | public ServerType getServerType() { 13 | return serverType; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/SettingsChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class SettingsChangedEvent { 6 | private final Wallet wallet; 7 | private final Type type; 8 | 9 | public SettingsChangedEvent(Wallet wallet, Type type) { 10 | this.wallet = wallet; 11 | this.type = type; 12 | } 13 | 14 | public Wallet getWallet() { 15 | return wallet; 16 | } 17 | 18 | public Type getType() { 19 | return type; 20 | } 21 | 22 | public enum Type { 23 | POLICY, SCRIPT_TYPE, MUTLISIG_THRESHOLD, MULTISIG_TOTAL, KEYSTORE_LABEL, KEYSTORE_FINGERPRINT, KEYSTORE_DERIVATION, KEYSTORE_XPUB, GAP_LIMIT, BIRTH_DATE, WATCH_LAST; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/ShowTransactionsCountEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class ShowTransactionsCountEvent { 4 | private final boolean showCount; 5 | 6 | public ShowTransactionsCountEvent(boolean showCount) { 7 | this.showCount = showCount; 8 | } 9 | 10 | public boolean isShowCount() { 11 | return showCount; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TabEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.TabData; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.control.Tab; 6 | 7 | public class TabEvent { 8 | private final Tab tab; 9 | 10 | public TabEvent(Tab tab) { 11 | this.tab = tab; 12 | } 13 | 14 | public Tab getTab() { 15 | return tab; 16 | } 17 | 18 | public String getTabName() { 19 | return ((Label)tab.getGraphic()).getText(); 20 | } 21 | 22 | public TabData getTabData() { 23 | return (TabData)tab.getUserData(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TabSelectedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import javafx.scene.control.Tab; 4 | 5 | public class TabSelectedEvent extends TabEvent { 6 | public TabSelectedEvent(Tab tab) { 7 | super(tab); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/ThemeChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.Theme; 4 | 5 | public class ThemeChangedEvent { 6 | private final Theme theme; 7 | 8 | public ThemeChangedEvent(Theme theme) { 9 | this.theme = theme; 10 | } 11 | 12 | public Theme getTheme() { 13 | return theme; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TimedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class TimedEvent { 4 | private final Action action; 5 | private final String status; 6 | protected int timeMills; 7 | 8 | public TimedEvent(Action action, String status) { 9 | this.action = action; 10 | this.status = status; 11 | this.timeMills = 0; 12 | } 13 | 14 | public TimedEvent(Action action, String status, int timeMills) { 15 | this.action = action; 16 | this.status = status; 17 | this.timeMills = timeMills; 18 | } 19 | 20 | public Action getAction() { 21 | return action; 22 | } 23 | 24 | public String getStatus() { 25 | return status; 26 | } 27 | 28 | public int getTimeMills() { 29 | return timeMills; 30 | } 31 | 32 | public enum Action { 33 | START, END; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TorBootStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class TorBootStatusEvent extends TorStatusEvent { 4 | public TorBootStatusEvent() { 5 | super("Starting Tor..."); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TorExternalStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class TorExternalStatusEvent extends TorStatusEvent { 4 | public TorExternalStatusEvent() { 5 | super("Tor is already running, using external instance..."); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TorFailedStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class TorFailedStatusEvent extends TorStatusEvent { 4 | private final Throwable exception; 5 | 6 | public TorFailedStatusEvent(Throwable exception) { 7 | super("Tor failed to start: " + (exception.getCause() != null ? exception.getCause().getMessage() : exception.getMessage())); 8 | this.exception = exception; 9 | } 10 | 11 | public Throwable getException() { 12 | return exception; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TorReadyStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class TorReadyStatusEvent extends TorStatusEvent { 4 | public TorReadyStatusEvent() { 5 | super("Tor started"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TorStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class TorStatusEvent { 4 | private final String status; 5 | 6 | public TorStatusEvent(String status) { 7 | this.status = status; 8 | } 9 | 10 | public String getStatus() { 11 | return status; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TransactionChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.protocol.Transaction; 4 | 5 | public class TransactionChangedEvent { 6 | private Transaction transaction; 7 | 8 | public TransactionChangedEvent(Transaction transaction) { 9 | this.transaction = transaction; 10 | } 11 | 12 | public Transaction getTransaction() { 13 | return transaction; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TransactionExtractedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.protocol.Transaction; 4 | import com.sparrowwallet.drongo.psbt.PSBT; 5 | 6 | /** 7 | * This event is fired when a final transaction has been extracted from a PSBT 8 | */ 9 | public class TransactionExtractedEvent extends PSBTEvent { 10 | private final Transaction finalTransaction; 11 | 12 | public TransactionExtractedEvent(PSBT psbt, Transaction finalTransaction) { 13 | super(psbt); 14 | this.finalTransaction = finalTransaction; 15 | } 16 | 17 | public Transaction getFinalTransaction() { 18 | return finalTransaction; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TransactionFetchFailedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.protocol.Transaction; 4 | 5 | public class TransactionFetchFailedEvent extends TransactionReferencesFailedEvent { 6 | public TransactionFetchFailedEvent(Transaction transaction, Throwable exception) { 7 | super(transaction, exception); 8 | } 9 | 10 | public TransactionFetchFailedEvent(Transaction transaction, Throwable exception, int pageStart, int pageEnd) { 11 | super(transaction, exception, pageStart, pageEnd); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TransactionLocktimeChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.protocol.Transaction; 4 | 5 | public class TransactionLocktimeChangedEvent extends TransactionChangedEvent { 6 | public TransactionLocktimeChangedEvent(Transaction transaction) { 7 | super(transaction); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TransactionReferencesEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.protocol.Transaction; 4 | 5 | public class TransactionReferencesEvent extends PagedEvent { 6 | private final Transaction transaction; 7 | 8 | public TransactionReferencesEvent(Transaction transaction) { 9 | this(transaction, 0, 0); 10 | } 11 | 12 | public TransactionReferencesEvent(Transaction transaction, int pageStart, int pageEnd) { 13 | super(pageStart, pageEnd); 14 | this.transaction = transaction; 15 | } 16 | 17 | public Transaction getTransaction() { 18 | return transaction; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TransactionReferencesFailedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.protocol.Transaction; 4 | 5 | public class TransactionReferencesFailedEvent extends TransactionReferencesEvent { 6 | private final Throwable exception; 7 | 8 | public TransactionReferencesFailedEvent(Transaction transaction, Throwable exception) { 9 | super(transaction); 10 | this.exception = exception; 11 | } 12 | 13 | public TransactionReferencesFailedEvent(Transaction transaction, Throwable exception, int pageStart, int pageEnd) { 14 | super(transaction, pageStart, pageEnd); 15 | this.exception = exception; 16 | } 17 | 18 | public Throwable getException() { 19 | return exception; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TransactionReferencesFinishedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.protocol.Transaction; 4 | import com.sparrowwallet.drongo.wallet.BlockTransaction; 5 | 6 | public class TransactionReferencesFinishedEvent extends TransactionReferencesEvent { 7 | private final BlockTransaction blockTransaction; 8 | 9 | public TransactionReferencesFinishedEvent(Transaction transaction, BlockTransaction blockTransaction) { 10 | super(transaction); 11 | this.blockTransaction = blockTransaction; 12 | } 13 | 14 | public TransactionReferencesFinishedEvent(Transaction transaction, BlockTransaction blockTransaction, int pageStart, int pageEnd) { 15 | super(transaction, pageStart, pageEnd); 16 | this.blockTransaction = blockTransaction; 17 | } 18 | 19 | public BlockTransaction getBlockTransaction() { 20 | return blockTransaction; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TransactionReferencesStartedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.protocol.Transaction; 4 | 5 | public class TransactionReferencesStartedEvent extends TransactionReferencesEvent { 6 | public TransactionReferencesStartedEvent(Transaction transaction) { 7 | super(transaction); 8 | } 9 | 10 | public TransactionReferencesStartedEvent(Transaction transaction, int pageStart, int pageEnd) { 11 | super(transaction, pageStart, pageEnd); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TransactionTabChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import javafx.scene.control.Tab; 4 | 5 | public class TransactionTabChangedEvent extends TabEvent { 6 | private boolean txHexVisible; 7 | 8 | public TransactionTabChangedEvent(Tab tab, boolean txHexVisible) { 9 | super(tab); 10 | this.txHexVisible = txHexVisible; 11 | } 12 | 13 | public boolean isTxHexVisible() { 14 | return txHexVisible; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TransactionTabSelectedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.TransactionTabData; 4 | import javafx.scene.control.Tab; 5 | 6 | public class TransactionTabSelectedEvent extends TabSelectedEvent { 7 | public TransactionTabSelectedEvent(Tab tab) { 8 | super(tab); 9 | } 10 | 11 | public TransactionTabData getTransactionTabData() { 12 | return (TransactionTabData)getTabData(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/TransactionTabsClosedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.TransactionTabData; 4 | 5 | import java.util.List; 6 | 7 | public class TransactionTabsClosedEvent { 8 | private final List closedTransactionTabData; 9 | 10 | public TransactionTabsClosedEvent(List closedTransactionTabData) { 11 | this.closedTransactionTabData = closedTransactionTabData; 12 | } 13 | 14 | public List getClosedTransactionTabData() { 15 | return closedTransactionTabData; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/UnitFormatChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.BitcoinUnit; 4 | import com.sparrowwallet.sparrow.UnitFormat; 5 | import com.sparrowwallet.sparrow.io.Config; 6 | 7 | public class UnitFormatChangedEvent { 8 | private final UnitFormat unitFormat; 9 | 10 | public UnitFormatChangedEvent(UnitFormat unitFormat) { 11 | this.unitFormat = unitFormat; 12 | } 13 | 14 | public UnitFormat getUnitFormat() { 15 | return unitFormat; 16 | } 17 | 18 | public BitcoinUnit getBitcoinUnit() { 19 | return Config.get().getBitcoinUnit(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/UsbDeviceEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.io.Device; 4 | 5 | import java.util.List; 6 | 7 | public class UsbDeviceEvent { 8 | private final List devices; 9 | 10 | public UsbDeviceEvent(List devices) { 11 | this.devices = devices; 12 | } 13 | 14 | public List getDevices() { 15 | return devices; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/UtxosChartChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class UtxosChartChangedEvent { 4 | private final boolean visible; 5 | 6 | public UtxosChartChangedEvent(boolean visible) { 7 | this.visible = visible; 8 | } 9 | 10 | public boolean isVisible() { 11 | return visible; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/VersionCheckStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class VersionCheckStatusEvent { 4 | private final boolean enabled; 5 | 6 | public VersionCheckStatusEvent(boolean enabled) { 7 | this.enabled = enabled; 8 | } 9 | 10 | public boolean isEnabled() { 11 | return enabled; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/VersionUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class VersionUpdatedEvent { 4 | private final String version; 5 | 6 | public VersionUpdatedEvent(String version) { 7 | this.version = version; 8 | } 9 | 10 | public String getVersion() { 11 | return version; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/ViewWalletEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | import com.sparrowwallet.sparrow.io.Storage; 5 | import javafx.stage.Window; 6 | 7 | public class ViewWalletEvent { 8 | private final Window window; 9 | private final Wallet wallet; 10 | private final Storage storage; 11 | 12 | public ViewWalletEvent(Window window, Wallet wallet, Storage storage) { 13 | this.window = window; 14 | this.wallet = wallet; 15 | this.storage = storage; 16 | } 17 | 18 | public Window getWindow() { 19 | return window; 20 | } 21 | 22 | public Wallet getWallet() { 23 | return wallet; 24 | } 25 | 26 | public Storage getStorage() { 27 | return storage; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletAddressesStatusEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | /** 6 | * Used to indicate that the display configuration of wallet addresses has been updated 7 | */ 8 | public class WalletAddressesStatusEvent { 9 | private final Wallet wallet; 10 | 11 | public WalletAddressesStatusEvent(Wallet wallet) { 12 | this.wallet = wallet; 13 | } 14 | 15 | public Wallet getWallet() { 16 | return wallet; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletBlockHeightChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | /** 6 | * This event is posted if the wallet's stored block height has changed. 7 | * 8 | */ 9 | public class WalletBlockHeightChangedEvent extends WalletChangedEvent { 10 | private final Integer blockHeight; 11 | 12 | public WalletBlockHeightChangedEvent(Wallet wallet, Integer blockHeight) { 13 | super(wallet); 14 | this.blockHeight = blockHeight; 15 | } 16 | 17 | public Integer getBlockHeight() { 18 | return blockHeight; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletConfigChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletConfigChangedEvent extends WalletChangedEvent { 6 | public WalletConfigChangedEvent(Wallet wallet) { 7 | super(wallet); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletDataChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | /** 6 | * Indicates that the internal data (non-settings) of the wallet has changed, either from a blockchain update or entry label change etc. 7 | * Used to trigger a background save of the wallet 8 | */ 9 | public class WalletDataChangedEvent extends WalletChangedEvent { 10 | public WalletDataChangedEvent(Wallet wallet) { 11 | super(wallet); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletDeletedEvent extends WalletChangedEvent { 6 | public WalletDeletedEvent(Wallet wallet) { 7 | super(wallet); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletExportEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletExportEvent { 6 | private Wallet wallet; 7 | 8 | public WalletExportEvent(Wallet wallet) { 9 | this.wallet = wallet; 10 | } 11 | 12 | public Wallet getWallet() { 13 | return wallet; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletHistoryClearedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletHistoryClearedEvent extends WalletSettingsChangedEvent { 6 | public WalletHistoryClearedEvent(Wallet wallet, Wallet pastWallet, String walletId) { 7 | super(wallet, pastWallet, walletId); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletHistoryFailedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletHistoryFailedEvent extends WalletHistoryStatusEvent { 6 | private final Throwable exception; 7 | 8 | public WalletHistoryFailedEvent(Wallet wallet, Throwable exception) { 9 | super(wallet, exception.getMessage()); 10 | this.exception = exception; 11 | } 12 | 13 | public Throwable getException() { 14 | return exception; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletHistoryFinishedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletHistoryFinishedEvent extends WalletHistoryStatusEvent { 6 | public WalletHistoryFinishedEvent(Wallet wallet) { 7 | super(wallet, false); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletHistoryStartedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | import com.sparrowwallet.drongo.wallet.WalletNode; 5 | 6 | import java.util.Set; 7 | 8 | public class WalletHistoryStartedEvent extends WalletHistoryStatusEvent { 9 | private final Set walletNodes; 10 | 11 | public WalletHistoryStartedEvent(Wallet wallet, Set walletNodes) { 12 | super(wallet, true); 13 | this.walletNodes = walletNodes; 14 | } 15 | 16 | public Set getWalletNodes() { 17 | return walletNodes; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletImportEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletImportEvent { 6 | private Wallet wallet; 7 | 8 | public WalletImportEvent(Wallet wallet) { 9 | this.wallet = wallet; 10 | } 11 | 12 | public Wallet getWallet() { 13 | return wallet; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletLabelChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletLabelChangedEvent extends WalletChangedEvent { 6 | public WalletLabelChangedEvent(Wallet wallet) { 7 | super(wallet); 8 | } 9 | 10 | public String getLabel() { 11 | return getWallet().getLabel(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletLockEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletLockEvent { 6 | private final Wallet wallet; 7 | 8 | public WalletLockEvent(Wallet wallet) { 9 | this.wallet = wallet; 10 | } 11 | 12 | public Wallet getWallet() { 13 | return wallet; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletMasterMixConfigChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletMasterMixConfigChangedEvent extends WalletMixConfigChangedEvent { 6 | public WalletMasterMixConfigChangedEvent(Wallet wallet) { 7 | super(wallet.isMasterWallet() ? wallet : wallet.getMasterWallet()); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletMixConfigChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletMixConfigChangedEvent extends WalletChangedEvent { 6 | public WalletMixConfigChangedEvent(Wallet wallet) { 7 | super(wallet); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletNodesChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | /** 6 | * This event is posted by WalletForm once it has received a WalletSettingsChangedEvent and cleared it's entry caches 7 | * The controllers in the wallet package listen to this event to update their views should a wallet's settings change 8 | */ 9 | public class WalletNodesChangedEvent extends WalletChangedEvent { 10 | public WalletNodesChangedEvent(Wallet wallet) { 11 | super(wallet); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletOpenedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | import com.sparrowwallet.sparrow.io.Storage; 5 | 6 | public class WalletOpenedEvent { 7 | private final Storage storage; 8 | private final Wallet wallet; 9 | 10 | public WalletOpenedEvent(Storage storage, Wallet wallet) { 11 | this.storage = storage; 12 | this.wallet = wallet; 13 | } 14 | 15 | public Storage getStorage() { 16 | return storage; 17 | } 18 | 19 | public Wallet getWallet() { 20 | return wallet; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletOpeningEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | import com.sparrowwallet.sparrow.io.Storage; 5 | 6 | public class WalletOpeningEvent { 7 | private final Storage storage; 8 | private final Wallet wallet; 9 | 10 | public WalletOpeningEvent(Storage storage, Wallet wallet) { 11 | this.storage = storage; 12 | this.wallet = wallet; 13 | } 14 | 15 | public Storage getStorage() { 16 | return storage; 17 | } 18 | 19 | public Wallet getWallet() { 20 | return wallet; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletPasswordChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletPasswordChangedEvent extends WalletSettingsChangedEvent { 6 | public WalletPasswordChangedEvent(Wallet wallet, Wallet pastWallet, String walletId) { 7 | super(wallet, pastWallet, walletId); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletSettingsChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | import java.io.File; 6 | 7 | /** 8 | * This is the base class for events posted when a wallet's settings are changed 9 | * Do not listen for this event directly - listen for a subclass, for example KeystoreLabelsChangedEvent or WalletAddressesChangedEvent 10 | */ 11 | public class WalletSettingsChangedEvent extends WalletChangedEvent { 12 | private final Wallet pastWallet; 13 | private final String walletId; 14 | 15 | public WalletSettingsChangedEvent(Wallet wallet, Wallet pastWallet, String walletId) { 16 | super(wallet); 17 | this.pastWallet = pastWallet; 18 | this.walletId = walletId; 19 | } 20 | 21 | public Wallet getPastWallet() { 22 | return pastWallet; 23 | } 24 | 25 | public String getWalletId() { 26 | return walletId; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletTabSelectedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.WalletTabData; 4 | import javafx.scene.control.Tab; 5 | import javafx.scene.control.TabPane; 6 | 7 | public class WalletTabSelectedEvent extends TabSelectedEvent { 8 | public WalletTabSelectedEvent(Tab tab) { 9 | super(tab); 10 | } 11 | 12 | public WalletTabData getWalletTabData() { 13 | TabPane subTabs = (TabPane)getTab().getContent(); 14 | Tab subTab = subTabs.getSelectionModel().getSelectedItem(); 15 | return (WalletTabData)subTab.getUserData(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletTableChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.TableType; 4 | import com.sparrowwallet.drongo.wallet.Wallet; 5 | import com.sparrowwallet.drongo.wallet.WalletTable; 6 | 7 | public class WalletTableChangedEvent extends WalletChangedEvent { 8 | private final WalletTable walletTable; 9 | 10 | public WalletTableChangedEvent(Wallet wallet, WalletTable walletTable) { 11 | super(wallet); 12 | this.walletTable = walletTable; 13 | } 14 | 15 | public WalletTable getWalletTable() { 16 | return walletTable; 17 | } 18 | 19 | public TableType getTableType() { 20 | return walletTable == null ? null : walletTable.getTableType(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletTabsClosedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.WalletTabData; 4 | 5 | import java.util.List; 6 | 7 | public class WalletTabsClosedEvent { 8 | private final List closedWalletTabData; 9 | 10 | public WalletTabsClosedEvent(List closedWalletTabData) { 11 | this.closedWalletTabData = closedWalletTabData; 12 | } 13 | 14 | public List getClosedWalletTabData() { 15 | return closedWalletTabData; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletUnlockEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletUnlockEvent { 6 | private final Wallet wallet; 7 | 8 | public WalletUnlockEvent(Wallet wallet) { 9 | this.wallet = wallet; 10 | } 11 | 12 | public Wallet getWallet() { 13 | return wallet; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletUtxoStatusChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.BlockTransactionHashIndex; 4 | import com.sparrowwallet.drongo.wallet.Wallet; 5 | 6 | import java.util.List; 7 | 8 | public class WalletUtxoStatusChangedEvent extends WalletChangedEvent { 9 | private final List utxos; 10 | 11 | public WalletUtxoStatusChangedEvent(Wallet wallet, List utxos) { 12 | super(wallet); 13 | this.utxos = utxos; 14 | } 15 | 16 | public List getUtxos() { 17 | return utxos; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WalletWatchLastChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | public class WalletWatchLastChangedEvent extends WalletSettingsChangedEvent { 6 | private final Integer watchLast; 7 | 8 | public WalletWatchLastChangedEvent(Wallet wallet, Wallet pastWallet, String walletId, Integer watchLast) { 9 | super(wallet, pastWallet, walletId); 10 | this.watchLast = watchLast; 11 | } 12 | 13 | public Integer getWatchLast() { 14 | return watchLast; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WebcamMirroredChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | public class WebcamMirroredChangedEvent { 4 | private final boolean mirrored; 5 | 6 | public WebcamMirroredChangedEvent(boolean mirrored) { 7 | this.mirrored = mirrored; 8 | } 9 | 10 | public boolean isMirrored() { 11 | return mirrored; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/event/WebcamResolutionChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.event; 2 | 3 | import com.sparrowwallet.sparrow.control.WebcamResolution; 4 | 5 | public class WebcamResolutionChangedEvent { 6 | private final WebcamResolution resolution; 7 | 8 | public WebcamResolutionChangedEvent(WebcamResolution resolution) { 9 | this.resolution = resolution; 10 | } 11 | 12 | public WebcamResolution getResolution() { 13 | return resolution; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/AirGapVault.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.wallet.WalletModel; 4 | 5 | public class AirGapVault extends KeystoneSinglesig { 6 | @Override 7 | public String getName() { 8 | return "AirGap Vault"; 9 | } 10 | 11 | @Override 12 | public String getKeystoreImportDescription(int account) { 13 | return "Import QR created on your AirGap Vault, by selecting the Secret > Account > Sparrow Wallet"; 14 | } 15 | 16 | @Override 17 | public WalletModel getWalletModel() { 18 | return WalletModel.AIRGAP_VAULT; 19 | } 20 | 21 | @Override 22 | public boolean isFileFormatAvailable() { 23 | return false; 24 | } 25 | 26 | @Override 27 | public boolean isWalletImportFileFormatAvailable() { 28 | return false; 29 | } 30 | 31 | @Override 32 | public boolean isDeprecated() { 33 | return true; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/CardAuthorizationException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import javax.smartcardio.CardException; 4 | 5 | public class CardAuthorizationException extends CardException { 6 | public CardAuthorizationException(String message) { 7 | super(message); 8 | } 9 | 10 | public CardAuthorizationException(Throwable cause) { 11 | super(cause); 12 | } 13 | 14 | public CardAuthorizationException(String message, Throwable cause) { 15 | super(message, cause); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/CardImport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import javafx.beans.property.StringProperty; 4 | 5 | import javax.smartcardio.CardException; 6 | 7 | public interface CardImport extends ImportExport { 8 | boolean isInitialized() throws CardException; 9 | void initialize(String pin, byte[] entropy, StringProperty messageProperty) throws CardException; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/CardSignFailedException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import javax.smartcardio.CardException; 4 | 5 | public class CardSignFailedException extends CardException { 6 | public CardSignFailedException(String message) { 7 | super(message); 8 | } 9 | 10 | public CardSignFailedException(Throwable cause) { 11 | super(cause); 12 | } 13 | 14 | public CardSignFailedException(String message, Throwable cause) { 15 | super(message, cause); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/CardUnluckyNumberException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import javax.smartcardio.CardException; 4 | 5 | public class CardUnluckyNumberException extends CardException { 6 | public CardUnluckyNumberException(String message) { 7 | super(message); 8 | } 9 | 10 | public CardUnluckyNumberException(Throwable cause) { 11 | super(cause); 12 | } 13 | 14 | public CardUnluckyNumberException(String message, Throwable cause) { 15 | super(message, cause); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/DisplayAddressException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | public class DisplayAddressException extends Exception { 4 | public DisplayAddressException() { 5 | super(); 6 | } 7 | 8 | public DisplayAddressException(String message) { 9 | super(message); 10 | } 11 | 12 | public DisplayAddressException(Throwable cause) { 13 | super(cause); 14 | } 15 | 16 | public DisplayAddressException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ExportException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | public class ExportException extends Exception { 4 | public ExportException() { 5 | super(); 6 | } 7 | 8 | public ExportException(String message) { 9 | super(message); 10 | } 11 | 12 | public ExportException(Throwable cause) { 13 | super(cause); 14 | } 15 | 16 | public ExportException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/FileImport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import java.io.File; 4 | 5 | public interface FileImport extends ImportExport { 6 | boolean isEncrypted(File file); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ImportException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | public class ImportException extends Exception { 4 | public ImportException() { 5 | super(); 6 | } 7 | 8 | public ImportException(String message) { 9 | super(message); 10 | } 11 | 12 | public ImportException(Throwable cause) { 13 | super(cause); 14 | } 15 | 16 | public ImportException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ImportExport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.wallet.WalletModel; 4 | 5 | public interface ImportExport { 6 | String getName(); 7 | WalletModel getWalletModel(); 8 | default boolean isDeprecated() { 9 | return false; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/KeystoreCardImport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.crypto.ChildNumber; 4 | import com.sparrowwallet.drongo.wallet.Keystore; 5 | import javafx.beans.property.StringProperty; 6 | 7 | import java.util.List; 8 | 9 | public interface KeystoreCardImport extends CardImport { 10 | Keystore getKeystore(String pin, List derivation, StringProperty messageProperty) throws ImportException; 11 | String getKeystoreImportDescription(int account); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/KeystoreExport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | public interface KeystoreExport extends ImportExport { 4 | String getKeystoreExportDescription(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/KeystoreFileExport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.wallet.Keystore; 4 | 5 | import java.io.OutputStream; 6 | 7 | public interface KeystoreFileExport extends KeystoreExport { 8 | void exportKeystore(Keystore keystore, OutputStream outputStream) throws ExportException; 9 | boolean requiresSignature(); 10 | void addSignature(Keystore keystore, String signature, OutputStream outputStream) throws ExportException; 11 | String getExportFileExtension(Keystore keystore); 12 | boolean isKeystoreExportScannable(); 13 | default boolean isKeystoreExportFile() { 14 | return true; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/KeystoreFileImport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.protocol.ScriptType; 4 | import com.sparrowwallet.drongo.wallet.Keystore; 5 | 6 | import java.io.InputStream; 7 | 8 | public interface KeystoreFileImport extends KeystoreImport, FileImport { 9 | Keystore getKeystore(ScriptType scriptType, InputStream inputStream, String password) throws ImportException; 10 | String getKeystoreImportDescription(int account); 11 | default String getKeystoreImportDescription() { 12 | return getKeystoreImportDescription(0); 13 | } 14 | boolean isKeystoreImportScannable(); 15 | default boolean isFileFormatAvailable() { 16 | return true; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/KeystoreImport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | public interface KeystoreImport extends ImportExport { 4 | String getKeystoreImportDescription(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/KeystoreMnemonicImport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.crypto.ChildNumber; 4 | import com.sparrowwallet.drongo.wallet.Keystore; 5 | 6 | import java.util.List; 7 | 8 | public interface KeystoreMnemonicImport extends KeystoreImport { 9 | Keystore getKeystore(List derivation, List mnemonicWords, String passphrase) throws ImportException; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/KeystoreMnemonicShareImport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.crypto.ChildNumber; 4 | import com.sparrowwallet.drongo.wallet.Keystore; 5 | 6 | import java.util.List; 7 | 8 | public interface KeystoreMnemonicShareImport extends KeystoreImport { 9 | Keystore getKeystore(List derivation, List> mnemonicShares, String passphrase) throws ImportException; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/KeystoreXprvImport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.ExtendedKey; 4 | import com.sparrowwallet.drongo.crypto.ChildNumber; 5 | import com.sparrowwallet.drongo.wallet.Keystore; 6 | 7 | import java.util.List; 8 | 9 | public interface KeystoreXprvImport extends KeystoreImport { 10 | Keystore getKeystore(List derivation, ExtendedKey xprv) throws ImportException; 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/Krux.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.wallet.WalletModel; 4 | 5 | public class Krux extends SpecterDIY { 6 | @Override 7 | public String getName() { 8 | return "Krux"; 9 | } 10 | 11 | @Override 12 | public String getKeystoreImportDescription(int account) { 13 | return "Import file or QR created on your Krux by selecting Extended Public Key from the main menu once you have loaded your mnemonic."; 14 | } 15 | 16 | @Override 17 | public WalletModel getWalletModel() { 18 | return WalletModel.KRUX; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/SeedSigner.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.wallet.WalletModel; 4 | 5 | public class SeedSigner extends SpecterDIY { 6 | @Override 7 | public String getName() { 8 | return "SeedSigner"; 9 | } 10 | 11 | @Override 12 | public String getKeystoreImportDescription(int account) { 13 | return "Import QR created on your SeedSigner by selecting Export Xpub in the Seeds menu once you have entered your seed."; 14 | } 15 | 16 | @Override 17 | public WalletModel getWalletModel() { 18 | return WalletModel.SEEDSIGNER; 19 | } 20 | 21 | @Override 22 | public boolean isFileFormatAvailable() { 23 | return false; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/SignMessageException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | public class SignMessageException extends Exception { 4 | public SignMessageException() { 5 | super(); 6 | } 7 | 8 | public SignMessageException(String message) { 9 | super(message); 10 | } 11 | 12 | public SignMessageException(Throwable cause) { 13 | super(cause); 14 | } 15 | 16 | public SignMessageException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/SignTransactionException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | public class SignTransactionException extends Exception { 4 | public SignTransactionException() { 5 | super(); 6 | } 7 | 8 | public SignTransactionException(String message) { 9 | super(message); 10 | } 11 | 12 | public SignTransactionException(Throwable cause) { 13 | super(cause); 14 | } 15 | 16 | public SignTransactionException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/SpecterDIYMultisig.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.wallet.WalletModel; 4 | 5 | public class SpecterDIYMultisig extends SpecterDesktop { 6 | @Override 7 | public String getWalletImportDescription() { 8 | return "Import file or QR created by using the Multisig Wallet > Settings > Export Wallet Descriptor feature on your Specter DIY device."; 9 | } 10 | 11 | public String getName() { 12 | return "Specter DIY Multisig"; 13 | } 14 | 15 | @Override 16 | public WalletModel getWalletModel() { 17 | return WalletModel.SPECTER_DIY; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/StorageException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | public class StorageException extends Exception { 4 | public StorageException() { 5 | super(); 6 | } 7 | 8 | public StorageException(String message) { 9 | super(message); 10 | } 11 | 12 | public StorageException(Throwable cause) { 13 | super(cause); 14 | } 15 | 16 | public StorageException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/WalletExport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | import java.io.OutputStream; 6 | 7 | public interface WalletExport extends ImportExport { 8 | void exportWallet(Wallet wallet, OutputStream outputStream, String password) throws ExportException; 9 | String getWalletExportDescription(); 10 | String getExportFileExtension(Wallet wallet); 11 | boolean isWalletExportScannable(); 12 | boolean walletExportRequiresDecryption(); 13 | default boolean isWalletExportFile() { 14 | return true; 15 | } 16 | default boolean exportsAllWallets() { 17 | return false; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/WalletImport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io; 2 | 3 | import com.sparrowwallet.drongo.wallet.Wallet; 4 | 5 | import java.io.InputStream; 6 | 7 | public interface WalletImport extends FileImport { 8 | String getWalletImportDescription(); 9 | Wallet importWallet(InputStream inputStream, String password) throws ImportException; 10 | boolean isWalletImportScannable(); 11 | default boolean isWalletImportFileFormatAvailable() { 12 | return true; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/bbqr/BBQR.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.bbqr; 2 | 3 | public record BBQR(BBQRType type, byte[] data) {} 4 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/bbqr/BBQREncodingException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.bbqr; 2 | 3 | public class BBQREncodingException extends BBQRException { 4 | public BBQREncodingException(String message) { 5 | super(message); 6 | } 7 | 8 | public BBQREncodingException(String message, Throwable cause) { 9 | super(message, cause); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/bbqr/BBQRException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.bbqr; 2 | 3 | public class BBQRException extends RuntimeException { 4 | public BBQRException(String message) { 5 | super(message); 6 | } 7 | 8 | public BBQRException(String message, Throwable cause) { 9 | super(message, cause); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/bbqr/BBQRType.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.bbqr; 2 | 3 | public enum BBQRType { 4 | PSBT("P"), TXN("T"), JSON("J"), CBOR("C"), UNICODE("U"), BINARY("B"), EXECUTABLE("X"); 5 | 6 | private final String code; 7 | 8 | BBQRType(String code) { 9 | this.code = code; 10 | } 11 | 12 | public String getCode() { 13 | return code; 14 | } 15 | 16 | public static BBQRType fromString(String code) { 17 | for(BBQRType type : values()) { 18 | if(type.getCode().equals(code)) { 19 | return type; 20 | } 21 | } 22 | 23 | throw new IllegalArgumentException("Could not find type for code " + code); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardAuthDump.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | public class CardAuthDump extends CardUnseal { 4 | boolean tampered; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardBackup.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | public class CardBackup extends CardResponse { 4 | byte[] data; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardCerts.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | import java.util.List; 4 | 5 | public class CardCerts { 6 | List cert_chain; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardChange.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | public class CardChange extends CardResponse { 4 | boolean success; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardDerive.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | import com.sparrowwallet.drongo.crypto.ECDSASignature; 4 | 5 | import java.math.BigInteger; 6 | import java.util.Arrays; 7 | 8 | public class CardDerive extends CardResponse { 9 | byte[] sig; 10 | byte[] chain_code; 11 | byte[] master_pubkey; 12 | byte[] pubkey; 13 | 14 | public ECDSASignature getSignature() { 15 | BigInteger r = new BigInteger(1, Arrays.copyOfRange(sig, 0, 32)); 16 | BigInteger s = new BigInteger(1, Arrays.copyOfRange(sig, 32, 64)); 17 | return new ECDSASignature(r, s); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardDump.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | import com.sparrowwallet.drongo.address.Address; 4 | import com.sparrowwallet.drongo.address.InvalidAddressException; 5 | 6 | import javax.smartcardio.CardException; 7 | 8 | public class CardDump extends CardResponse { 9 | int slot; 10 | boolean used = true; 11 | boolean sealed; 12 | String address; 13 | byte[] pubkey; 14 | 15 | public Address getAddress() throws CardException { 16 | try { 17 | if(address != null) { 18 | return Address.fromString(address); 19 | } 20 | } catch(InvalidAddressException e) { 21 | throw new CardException("Invalid address provided", e); 22 | } 23 | 24 | return null; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardRead.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | import com.sparrowwallet.drongo.crypto.ECDSASignature; 4 | import com.sparrowwallet.drongo.crypto.ECKey; 5 | 6 | import java.math.BigInteger; 7 | import java.util.Arrays; 8 | 9 | public class CardRead extends CardResponse { 10 | byte[] sig; 11 | byte[] pubkey; 12 | 13 | public ECDSASignature getSignature() { 14 | if(sig != null) { 15 | BigInteger r = new BigInteger(1, Arrays.copyOfRange(sig, 0, 32)); 16 | BigInteger s = new BigInteger(1, Arrays.copyOfRange(sig, 32, 64)); 17 | return new ECDSASignature(r, s); 18 | } 19 | 20 | return null; 21 | } 22 | 23 | public ECKey getPubKey() { 24 | return ECKey.fromPublicOnly(pubkey); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardResponse.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | public class CardResponse { 4 | byte[] card_nonce; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardSetup.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | public class CardSetup extends CardResponse { 4 | int slot; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardSign.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | public class CardSign extends CardRead { 4 | int slot; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardSignature.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | import com.sparrowwallet.drongo.crypto.ECDSASignature; 4 | 5 | import java.math.BigInteger; 6 | import java.util.Arrays; 7 | 8 | public class CardSignature extends CardResponse { 9 | byte[] auth_sig; 10 | 11 | public ECDSASignature getSignature() { 12 | BigInteger r = new BigInteger(1, Arrays.copyOfRange(auth_sig, 0, 32)); 13 | BigInteger s = new BigInteger(1, Arrays.copyOfRange(auth_sig, 32, 64)); 14 | return new ECDSASignature(r, s); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardUnseal.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | import com.sparrowwallet.drongo.crypto.ECKey; 4 | 5 | public class CardUnseal extends CardResponse { 6 | int slot; 7 | byte[] privkey; 8 | byte[] pubkey; 9 | byte[] master_pk; 10 | byte[] chain_code; 11 | 12 | public ECKey getPrivateKey() { 13 | return ECKey.fromPrivate(privkey); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardWait.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | import java.math.BigInteger; 4 | 5 | public class CardWait { 6 | boolean success; 7 | BigInteger auth_delay; 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardXpub.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | public class CardXpub { 4 | byte[] xpub; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/ckcard/Satschip.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.ckcard; 2 | 3 | import com.sparrowwallet.drongo.wallet.WalletModel; 4 | 5 | public class Satschip extends Tapsigner { 6 | @Override 7 | public String getKeystoreImportDescription(int account) { 8 | return "Import the keystore from your Satschip by placing it on the card reader."; 9 | } 10 | 11 | @Override 12 | public String getName() { 13 | return "Satschip"; 14 | } 15 | 16 | @Override 17 | public WalletModel getWalletModel() { 18 | return WalletModel.SATSCHIP; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/db/PolicyDao.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.db; 2 | 3 | import com.sparrowwallet.drongo.policy.Policy; 4 | import org.jdbi.v3.sqlobject.config.RegisterRowMapper; 5 | import org.jdbi.v3.sqlobject.statement.GetGeneratedKeys; 6 | import org.jdbi.v3.sqlobject.statement.SqlQuery; 7 | import org.jdbi.v3.sqlobject.statement.SqlUpdate; 8 | 9 | public interface PolicyDao { 10 | @SqlQuery("select * from policy where id = ?") 11 | @RegisterRowMapper(PolicyMapper.class) 12 | Policy getPolicy(long id); 13 | 14 | @SqlUpdate("insert into policy (name, script) values (?, ?)") 15 | @GetGeneratedKeys("id") 16 | long insert(String name, String script); 17 | 18 | default void addPolicy(Policy policy) { 19 | long id = insert(policy.getName(), policy.getMiniscript().getScript()); 20 | policy.setId(id); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/db/PolicyMapper.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.db; 2 | 3 | import com.sparrowwallet.drongo.policy.Miniscript; 4 | import com.sparrowwallet.drongo.policy.Policy; 5 | import org.jdbi.v3.core.mapper.RowMapper; 6 | import org.jdbi.v3.core.statement.StatementContext; 7 | 8 | import java.sql.ResultSet; 9 | import java.sql.SQLException; 10 | 11 | public class PolicyMapper implements RowMapper { 12 | @Override 13 | public Policy map(ResultSet rs, StatementContext ctx) throws SQLException { 14 | Policy policy = new Policy(rs.getString("name"), new Miniscript(rs.getString("script"))); 15 | policy.setId(rs.getLong("id")); 16 | return policy; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/io/db/WalletConfigMapper.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.io.db; 2 | 3 | import com.sparrowwallet.drongo.wallet.WalletConfig; 4 | import org.jdbi.v3.core.mapper.RowMapper; 5 | import org.jdbi.v3.core.statement.StatementContext; 6 | 7 | import java.sql.ResultSet; 8 | import java.sql.SQLException; 9 | 10 | public class WalletConfigMapper implements RowMapper { 11 | @Override 12 | public WalletConfig map(ResultSet rs, StatementContext ctx) throws SQLException { 13 | byte[] iconData = rs.getBytes("iconData"); 14 | boolean userIcon = rs.getBoolean("userIcon"); 15 | boolean usePayNym = rs.getBoolean("usePayNym"); 16 | 17 | WalletConfig walletConfig = new WalletConfig(iconData, userIcon, usePayNym); 18 | walletConfig.setId(rs.getLong("id")); 19 | return walletConfig; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/keystoreimport/HwUsbDevicesController.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.keystoreimport; 2 | 3 | import com.sparrowwallet.sparrow.control.DevicePane; 4 | import com.sparrowwallet.sparrow.io.Device; 5 | import javafx.fxml.FXML; 6 | import javafx.scene.control.Accordion; 7 | 8 | import java.util.List; 9 | 10 | public class HwUsbDevicesController extends KeystoreImportDetailController { 11 | @FXML 12 | private Accordion deviceAccordion; 13 | 14 | public void initializeView(List devices) { 15 | for(Device device : devices) { 16 | DevicePane devicePane = new DevicePane(getMasterController().getWallet(), device, devices.size() == 1, getMasterController().getRequiredDerivation()); 17 | if(getMasterController().getRequiredModel() == null || getMasterController().getRequiredModel() == device.getModel()) { 18 | deviceAccordion.getPanes().add(devicePane); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/keystoreimport/KeystoreImportDetailController.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.keystoreimport; 2 | 3 | public abstract class KeystoreImportDetailController { 4 | private KeystoreImportController masterController; 5 | 6 | public KeystoreImportController getMasterController() { 7 | return masterController; 8 | } 9 | 10 | void setMasterController(KeystoreImportController masterController) { 11 | this.masterController = masterController; 12 | } 13 | 14 | public void initializeView() { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/AllHistoryChangedException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | public class AllHistoryChangedException extends RuntimeException { 4 | public AllHistoryChangedException() { 5 | } 6 | 7 | public AllHistoryChangedException(String message) { 8 | super(message); 9 | } 10 | 11 | public AllHistoryChangedException(String message, Throwable cause) { 12 | super(message, cause); 13 | } 14 | 15 | public AllHistoryChangedException(Throwable cause) { 16 | super(cause); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/BlockHeaderTip.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | import com.sparrowwallet.drongo.Utils; 4 | import com.sparrowwallet.drongo.protocol.BlockHeader; 5 | import com.sparrowwallet.drongo.protocol.Sha256Hash; 6 | 7 | public class BlockHeaderTip { 8 | public int height; 9 | public String hex; 10 | 11 | public BlockHeader getBlockHeader() { 12 | if(hex == null) { 13 | return new BlockHeader(0, Sha256Hash.ZERO_HASH, Sha256Hash.ZERO_HASH, Sha256Hash.ZERO_HASH, 0, 0, 0); 14 | } 15 | 16 | byte[] blockHeaderBytes = Utils.hexToBytes(hex); 17 | return new BlockHeader(blockHeaderBytes); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/BlockStats.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.sparrowwallet.sparrow.BlockSummary; 5 | 6 | import java.util.Date; 7 | 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public record BlockStats(int height, String blockhash, double[] feerate_percentiles, int total_weight, int txs, long time) { 10 | public BlockSummary toBlockSummary() { 11 | Double medianFee = feerate_percentiles != null && feerate_percentiles.length > 0 ? feerate_percentiles[feerate_percentiles.length / 2] : null; 12 | return new BlockSummary(height, new Date(time * 1000), medianFee, txs, total_weight); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/CloseableTransport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | import com.github.arteam.simplejsonrpc.client.Transport; 4 | 5 | import java.io.Closeable; 6 | 7 | public interface CloseableTransport extends Transport, Closeable { 8 | void connect() throws ServerException; 9 | boolean isConnected(); 10 | boolean isClosed(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/ConfigurationException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | public class ConfigurationException extends RuntimeException { 4 | public ConfigurationException(String message) { 5 | super(message); 6 | } 7 | 8 | public ConfigurationException(String message, Throwable cause) { 9 | super(message, cause); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/CoreAuthType.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | public enum CoreAuthType { 4 | COOKIE, USERPASS; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/ElectrumServerRpcException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | public class ElectrumServerRpcException extends RuntimeException { 4 | public ElectrumServerRpcException() { 5 | super(); 6 | } 7 | 8 | public ElectrumServerRpcException(String message) { 9 | super(message); 10 | } 11 | 12 | public ElectrumServerRpcException(Throwable cause) { 13 | super(cause); 14 | } 15 | 16 | public ElectrumServerRpcException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/ProxyServerException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | public class ProxyServerException extends ServerException { 4 | public ProxyServerException(Throwable cause) { 5 | super(cause); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/ServerConfigException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | public class ServerConfigException extends ServerException { 4 | public ServerConfigException() { 5 | } 6 | 7 | public ServerConfigException(String message) { 8 | super(message); 9 | } 10 | 11 | public ServerConfigException(Throwable cause) { 12 | super(cause); 13 | } 14 | 15 | public ServerConfigException(String message, Throwable cause) { 16 | super(message, cause); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/ServerException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | public class ServerException extends Exception { 4 | public ServerException() { 5 | super(); 6 | } 7 | 8 | public ServerException(String message) { 9 | super(message); 10 | } 11 | 12 | public ServerException(Throwable cause) { 13 | super(cause); 14 | } 15 | 16 | public ServerException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/ServerType.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | public enum ServerType { 4 | BITCOIN_CORE("Bitcoin Core"), ELECTRUM_SERVER("Private Electrum"), PUBLIC_ELECTRUM_SERVER("Public Electrum"); 5 | 6 | private final String name; 7 | 8 | ServerType(String name) { 9 | this.name = name; 10 | } 11 | 12 | public String getName() { 13 | return name; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/TimeoutCounter.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | public interface TimeoutCounter { 4 | int getTimeoutCount(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/TorServerException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | public class TorServerException extends ServerException { 4 | public TorServerException(Throwable cause) { 5 | super(cause); 6 | } 7 | 8 | public TorServerException(String message) { 9 | super(message); 10 | } 11 | 12 | public TorServerException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/TorStartupException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | public class TorStartupException extends TorServerException { 4 | public TorStartupException(Throwable cause) { 5 | super(cause); 6 | } 7 | 8 | public TorStartupException(String message) { 9 | super(message); 10 | } 11 | 12 | public TorStartupException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/TorTcpTransport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | import com.google.common.net.HostAndPort; 4 | import com.sparrowwallet.sparrow.AppServices; 5 | 6 | import java.io.*; 7 | import java.net.InetSocketAddress; 8 | import java.net.Socket; 9 | 10 | public class TorTcpTransport extends TcpTransport { 11 | public TorTcpTransport(HostAndPort server) { 12 | super(server); 13 | } 14 | 15 | public TorTcpTransport(HostAndPort server, HostAndPort proxy) { 16 | super(server, proxy); 17 | } 18 | 19 | @Override 20 | protected void createSocket() throws IOException { 21 | if(!AppServices.isTorRunning()) { 22 | throw new IllegalStateException("Can't create Tor socket, Tor is not running"); 23 | } 24 | 25 | socket = new Socket(Tor.getDefault().getProxy()); 26 | socket.connect(new InetSocketAddress(server.getHost(), server.getPortOrDefault(getDefaultPort()))); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/UnknownCertificateExpiredException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net; 2 | 3 | import java.security.cert.Certificate; 4 | import java.security.cert.CertificateExpiredException; 5 | 6 | public class UnknownCertificateExpiredException extends CertificateExpiredException { 7 | private final Certificate certificate; 8 | 9 | public UnknownCertificateExpiredException(String message, Certificate certificate) { 10 | super(message); 11 | this.certificate = certificate; 12 | } 13 | 14 | public Certificate getCertificate() { 15 | return certificate; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/BitcoinRPCException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | public class BitcoinRPCException extends RuntimeException { 4 | public BitcoinRPCException(String message) { 5 | super(message); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/BlockchainInfo.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.util.Date; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public record BlockchainInfo(int blocks, int headers, String bestblockhash, boolean initialblockdownload, long time, Double verificationprogress, boolean pruned, Integer pruneheight) { 9 | public Date getTip() { 10 | return new Date(time * 1000); 11 | } 12 | 13 | public int getProgressPercent() { 14 | return (int) Math.floor(verificationprogress * 100); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/Category.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import java.util.Locale; 4 | 5 | public enum Category { 6 | send, receive, generate, immature, orphan; 7 | 8 | public String toString() { 9 | return super.toString().toLowerCase(Locale.ROOT); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/CormorantBitcoindException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | public class CormorantBitcoindException extends Exception { 4 | public CormorantBitcoindException(String message) { 5 | super(message); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/CreateLoadWalletResult.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | public record CreateLoadWalletResult(String name, String warning) { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/FeeInfo.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.util.List; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public record FeeInfo(Double feerate, List errors, int blocks) { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/FeesMempoolEntry.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | public record FeesMempoolEntry(double base, double ancestor) { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/ImportDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | public class ImportDescriptor { 4 | private final String desc; 5 | private final Boolean active; 6 | private final Object timestamp; 7 | private final Boolean internal; 8 | 9 | public ImportDescriptor(String desc, Boolean active, Object timestamp, Boolean internal) { 10 | this.desc = desc; 11 | this.active = active; 12 | this.timestamp = timestamp; 13 | this.internal = internal; 14 | } 15 | 16 | public String getDesc() { 17 | return desc; 18 | } 19 | 20 | public Boolean getActive() { 21 | return active; 22 | } 23 | 24 | public Object getTimestamp() { 25 | return timestamp; 26 | } 27 | 28 | public Boolean getInternal() { 29 | return internal; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/ImportDescriptorResult.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.github.arteam.simplejsonrpc.core.domain.ErrorMessage; 5 | 6 | import java.util.List; 7 | 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public record ImportDescriptorResult(boolean success, List warnings, ErrorMessage error) { 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/ImportFailedException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | public class ImportFailedException extends Exception { 4 | public ImportFailedException(String message) { 5 | super(message); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/ImportRangedDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | public class ImportRangedDescriptor extends ImportDescriptor { 4 | private final Integer range; 5 | 6 | public ImportRangedDescriptor(String desc, Boolean active, Integer range, Object timestamp, Boolean internal) { 7 | super(desc, active, timestamp, internal); 8 | this.range = range; 9 | } 10 | 11 | public Integer getRange() { 12 | return range; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/ListDescriptorResult.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.util.Date; 6 | import java.util.List; 7 | 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public record ListDescriptorResult(String desc, long timestamp, boolean active, boolean internal, List range) { 10 | public Date getScanDate() { 11 | return timestamp > 0 ? new Date(timestamp * 1000) : null; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/ListDescriptorsResult.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.util.List; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public record ListDescriptorsResult(String wallet_name, List descriptors) { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/ListSinceBlock.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.util.List; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public record ListSinceBlock(List transactions, List removed, String lastblock) { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/ListTransaction.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.util.List; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public record ListTransaction(String address, List parent_descs, Category category, double amount, int vout, double fee, int confirmations, String blockhash, int blockindex, long blocktime, int blockheight, String txid, long time, long timereceived, List walletconflicts) { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/ListWalletDirResult.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.util.List; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public record ListWalletDirResult(List wallets) { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/MempoolEntry.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.sparrowwallet.sparrow.net.cormorant.index.TxEntry; 5 | 6 | @JsonIgnoreProperties(ignoreUnknown = true) 7 | public record MempoolEntry(int vsize, int ancestorsize, boolean bip125_replaceable, FeesMempoolEntry fees) { 8 | public boolean hasUnconfirmedParents() { 9 | return vsize != ancestorsize; 10 | } 11 | 12 | public TxEntry getTxEntry(String txid) { 13 | return new TxEntry(hasUnconfirmedParents() ? -1 : 0, 0, txid, fees().base()); 14 | } 15 | 16 | public VsizeFeerate getVsizeFeerate() { 17 | return new VsizeFeerate(vsize, fees().base()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/MempoolInfo.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | public record MempoolInfo(double minrelaytxfee) { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/NetworkInfo.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | public record NetworkInfo(int version, String subversion, boolean networkactive) { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/ScanDateBeforePruneException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import java.util.Date; 4 | 5 | public class ScanDateBeforePruneException extends Exception { 6 | private final String descriptor; 7 | private final Date rescanSince; 8 | private final Date prunedDate; 9 | 10 | public ScanDateBeforePruneException(String descriptor, Date rescanSince, Date prunedDate) { 11 | this.descriptor = descriptor; 12 | this.rescanSince = rescanSince; 13 | this.prunedDate = prunedDate; 14 | } 15 | 16 | public String getDescriptor() { 17 | return descriptor; 18 | } 19 | 20 | public Date getRescanSince() { 21 | return rescanSince; 22 | } 23 | 24 | public Date getPrunedDate() { 25 | return prunedDate; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/VsizeFeerate.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.sparrowwallet.drongo.protocol.Transaction; 4 | 5 | public class VsizeFeerate implements Comparable { 6 | private final int vsize; 7 | private final float feerate; 8 | 9 | public VsizeFeerate(int vsize, double fee) { 10 | this.vsize = vsize; 11 | double feeRate = fee / vsize * Transaction.SATOSHIS_PER_BITCOIN; 12 | //Round down to 0.1 sats/vb precision 13 | this.feerate = (float) (Math.floor(10 * feeRate) / 10); 14 | } 15 | 16 | public int getVsize() { 17 | return vsize; 18 | } 19 | 20 | public double getFeerate() { 21 | return feerate; 22 | } 23 | 24 | @Override 25 | public int compareTo(VsizeFeerate o) { 26 | return Float.compare(o.feerate, feerate); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/WalletDirResult.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | public record WalletDirResult(String name) { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/WalletInfo.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.bitcoind; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | public record WalletInfo(String walletname, WalletScanningInfo scanning) { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/electrum/BitcoindIOException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.electrum; 2 | 3 | import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcError; 4 | import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcErrorData; 5 | import com.google.common.base.Throwables; 6 | 7 | @JsonRpcError(code=-32000, message="Could not connect to Bitcoin Core RPC") 8 | public class BitcoindIOException extends Exception { 9 | @JsonRpcErrorData 10 | private final String rootCause; 11 | 12 | public BitcoindIOException(Throwable rootCause) { 13 | super("Could not connect to Bitcoin Core RPC"); 14 | this.rootCause = Throwables.getRootCause(rootCause).getMessage(); 15 | } 16 | 17 | public String getRootCause() { 18 | return rootCause; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/electrum/BlockNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.electrum; 2 | 3 | import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcError; 4 | import com.github.arteam.simplejsonrpc.core.domain.ErrorMessage; 5 | 6 | @JsonRpcError(code=-32002) 7 | public class BlockNotFoundException extends Exception { 8 | private final String message; 9 | 10 | public BlockNotFoundException(ErrorMessage errorMessage) { 11 | this.message = errorMessage == null ? "" : errorMessage.getMessage() + (errorMessage.getData() == null ? "" : " (" + errorMessage.getData() + ")"); 12 | } 13 | 14 | @Override 15 | public String getMessage() { 16 | return message; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/electrum/BroadcastFailedException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.electrum; 2 | 3 | import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcError; 4 | import com.github.arteam.simplejsonrpc.core.domain.ErrorMessage; 5 | 6 | @JsonRpcError(code=-32003) 7 | public class BroadcastFailedException extends Exception { 8 | private final String message; 9 | 10 | public BroadcastFailedException(ErrorMessage errorMessage) { 11 | this.message = errorMessage == null ? "" : errorMessage.getMessage() + (errorMessage.getData() == null ? "" : " (" + errorMessage.getData() + ")"); 12 | } 13 | 14 | public String getMessage() { 15 | return message; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/electrum/ElectrumBlockHeader.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.electrum; 2 | 3 | public record ElectrumBlockHeader(int height, String hex) { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/electrum/ElectrumNotificationService.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.electrum; 2 | 3 | import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcMethod; 4 | import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcOptional; 5 | import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcParam; 6 | import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcService; 7 | 8 | @JsonRpcService 9 | public interface ElectrumNotificationService { 10 | @JsonRpcMethod("blockchain.headers.subscribe") 11 | void notifyHeaders(@JsonRpcParam("header") ElectrumBlockHeader electrumBlockHeader); 12 | 13 | @JsonRpcMethod("blockchain.scripthash.subscribe") 14 | void notifyScriptHash(@JsonRpcParam("scripthash") String scriptHash, @JsonRpcOptional @JsonRpcParam("status") String status); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/electrum/ElectrumNotificationTransport.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.electrum; 2 | 3 | import com.github.arteam.simplejsonrpc.client.Transport; 4 | 5 | import java.io.IOException; 6 | import java.io.OutputStreamWriter; 7 | import java.io.PrintWriter; 8 | import java.net.Socket; 9 | import java.nio.charset.StandardCharsets; 10 | 11 | public class ElectrumNotificationTransport implements Transport { 12 | private final Socket clientSocket; 13 | 14 | public ElectrumNotificationTransport(Socket clientSocket) { 15 | this.clientSocket = clientSocket; 16 | } 17 | 18 | @Override 19 | public String pass(String request) throws IOException { 20 | PrintWriter out = new PrintWriter(new OutputStreamWriter(clientSocket.getOutputStream(), StandardCharsets.UTF_8)); 21 | out.println(request); 22 | out.flush(); 23 | 24 | return "{\"result\":{},\"error\":null,\"id\":1}"; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/electrum/ScriptHashStatus.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.electrum; 2 | 3 | public record ScriptHashStatus(String scriptHash, String status) { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/electrum/TransactionNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.electrum; 2 | 3 | import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcError; 4 | import com.github.arteam.simplejsonrpc.core.domain.ErrorMessage; 5 | 6 | @JsonRpcError(code=-32001) 7 | public class TransactionNotFoundException extends Exception { 8 | private final String message; 9 | 10 | public TransactionNotFoundException(ErrorMessage errorMessage) { 11 | this.message = errorMessage == null ? "" : errorMessage.getMessage() + (errorMessage.getData() == null ? "" : " (" + errorMessage.getData() + ")"); 12 | } 13 | 14 | public String getMessage() { 15 | return message; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/net/cormorant/electrum/UnsupportedVersionException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.net.cormorant.electrum; 2 | 3 | import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcError; 4 | import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcErrorData; 5 | 6 | @JsonRpcError(code=-32003, message="Unsupported version") 7 | public class UnsupportedVersionException extends Exception { 8 | @JsonRpcErrorData 9 | private final String version; 10 | 11 | public UnsupportedVersionException(String version) { 12 | this.version = version; 13 | } 14 | 15 | public String getVersion() { 16 | return version; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/payjoin/PayjoinReceiverException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.payjoin; 2 | 3 | public class PayjoinReceiverException extends Exception { 4 | public PayjoinReceiverException() { 5 | super(); 6 | } 7 | 8 | public PayjoinReceiverException(String msg) { 9 | super(msg); 10 | } 11 | 12 | public PayjoinReceiverException(Throwable cause) { 13 | super(cause); 14 | } 15 | 16 | public PayjoinReceiverException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/settings/SettingsDetailController.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.settings; 2 | 3 | import com.sparrowwallet.sparrow.io.Config; 4 | 5 | public abstract class SettingsDetailController { 6 | private SettingsController masterController; 7 | 8 | public SettingsController getMasterController() { 9 | return masterController; 10 | } 11 | 12 | void setMasterController(SettingsController masterController) { 13 | this.masterController = masterController; 14 | } 15 | 16 | public void initializeView(Config config) { 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/settings/SettingsGroup.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.settings; 2 | 3 | public enum SettingsGroup { 4 | GENERAL, SERVER; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/terminal/MasterActionWindow.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.terminal; 2 | 3 | import com.googlecode.lanterna.gui2.BasicWindow; 4 | import com.googlecode.lanterna.gui2.BorderLayout; 5 | import com.googlecode.lanterna.gui2.Panel; 6 | 7 | import java.util.List; 8 | 9 | public class MasterActionWindow extends BasicWindow { 10 | public MasterActionWindow(SparrowTerminal sparrowTerminal) { 11 | setHints(List.of(Hint.CENTERED)); 12 | 13 | Panel panel = new Panel(new BorderLayout()); 14 | 15 | MasterActionListBox masterActionListBox = new MasterActionListBox(sparrowTerminal); 16 | panel.addComponent(masterActionListBox, BorderLayout.Location.CENTER); 17 | 18 | setComponent(panel); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/terminal/wallet/EntryTableCellRenderer.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.terminal.wallet; 2 | 3 | import com.googlecode.lanterna.gui2.table.DefaultTableCellRenderer; 4 | import com.sparrowwallet.sparrow.terminal.wallet.table.TableCell; 5 | 6 | public class EntryTableCellRenderer extends DefaultTableCellRenderer { 7 | @Override 8 | protected String[] getContent(TableCell cell) { 9 | String[] lines; 10 | if(cell == null) { 11 | lines = new String[] { "" }; 12 | } else { 13 | lines = new String[] { cell.formatCell() }; 14 | } 15 | 16 | return lines; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/terminal/wallet/table/AddressTableCell.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.terminal.wallet.table; 2 | 3 | import com.sparrowwallet.sparrow.wallet.Entry; 4 | import com.sparrowwallet.sparrow.wallet.NodeEntry; 5 | import com.sparrowwallet.sparrow.wallet.UtxoEntry; 6 | 7 | public class AddressTableCell extends TableCell { 8 | public static final int ADDRESS_MIN_WIDTH = 52; 9 | public static final int UTXO_WIDTH = 18; 10 | 11 | public AddressTableCell(Entry entry) { 12 | super(entry); 13 | } 14 | 15 | @Override 16 | public String formatCell() { 17 | if(entry instanceof NodeEntry nodeEntry) { 18 | return nodeEntry.getAddress().toString(); 19 | } else if(entry instanceof UtxoEntry utxoEntry) { 20 | return utxoEntry.getNode().getAddress().toString().substring(0, 10) + ".."; 21 | } 22 | 23 | return ""; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/terminal/wallet/table/MixTableCell.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.terminal.wallet.table; 2 | 3 | import com.google.common.base.Strings; 4 | import com.sparrowwallet.sparrow.wallet.Entry; 5 | import com.sparrowwallet.sparrow.wallet.UtxoEntry; 6 | 7 | public class MixTableCell extends TableCell { 8 | public static final int WIDTH = 18; 9 | 10 | public MixTableCell(Entry entry) { 11 | super(entry); 12 | } 13 | 14 | @Override 15 | public String formatCell() { 16 | if(entry instanceof UtxoEntry utxoEntry) { 17 | return getMixCountOnly(utxoEntry.mixStatusProperty().get()); 18 | } 19 | 20 | return ""; 21 | } 22 | 23 | private String getMixCountOnly(UtxoEntry.MixStatus mixStatus) { 24 | return Strings.padStart(Integer.toString(mixStatus == null ? 0 : mixStatus.getMixesDone()), WIDTH, ' '); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/terminal/wallet/table/OutputTableCell.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.terminal.wallet.table; 2 | 3 | import com.sparrowwallet.sparrow.wallet.Entry; 4 | import com.sparrowwallet.sparrow.wallet.UtxoEntry; 5 | 6 | public class OutputTableCell extends TableCell { 7 | public static final int WIDTH = 16; 8 | 9 | public OutputTableCell(Entry entry) { 10 | super(entry); 11 | } 12 | 13 | @Override 14 | public String formatCell() { 15 | if(entry instanceof UtxoEntry utxoEntry) { 16 | return utxoEntry.getDescription(); 17 | } 18 | 19 | return ""; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/terminal/wallet/table/TableCell.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.terminal.wallet.table; 2 | 3 | import com.sparrowwallet.sparrow.wallet.Entry; 4 | 5 | public abstract class TableCell { 6 | protected final Entry entry; 7 | protected boolean selected; 8 | 9 | public TableCell(Entry entry) { 10 | this.entry = entry; 11 | } 12 | 13 | public Entry getEntry() { 14 | return entry; 15 | } 16 | 17 | public abstract String formatCell(); 18 | 19 | public boolean isSelected() { 20 | return selected; 21 | } 22 | 23 | public void setSelected(boolean selected) { 24 | this.selected = selected; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/transaction/IndexedTransactionForm.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.transaction; 2 | 3 | import com.sparrowwallet.drongo.address.Address; 4 | 5 | public abstract class IndexedTransactionForm extends TransactionForm { 6 | private int index; 7 | 8 | public IndexedTransactionForm(TransactionData txdata, int index) { 9 | super(txdata); 10 | this.index = index; 11 | } 12 | 13 | public int getIndex() { 14 | return index; 15 | } 16 | 17 | public void setIndex(int index) { 18 | this.index = index; 19 | } 20 | 21 | public abstract Address getAddress(); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/transaction/InputsForm.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.transaction; 2 | 3 | import javafx.fxml.FXMLLoader; 4 | import javafx.scene.Node; 5 | 6 | import java.io.IOException; 7 | 8 | public class InputsForm extends TransactionForm { 9 | public InputsForm(TransactionData txdata) { 10 | super(txdata); 11 | } 12 | 13 | @Override 14 | public Node getContents() throws IOException { 15 | FXMLLoader loader = new FXMLLoader(getClass().getResource("inputs.fxml")); 16 | Node node = loader.load(); 17 | node.setUserData(this); 18 | InputsController controller = loader.getController(); 19 | controller.setModel(this); 20 | return node; 21 | } 22 | 23 | @Override 24 | public TransactionView getView() { 25 | return TransactionView.INPUTS; 26 | } 27 | 28 | public String toString() { 29 | return "Inputs"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/transaction/TransactionView.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.transaction; 2 | 3 | public enum TransactionView { 4 | HEADERS, INPUTS, INPUT, OUTPUTS, OUTPUT 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/wallet/FeeRatesSelection.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.wallet; 2 | 3 | public enum FeeRatesSelection { 4 | BLOCK_TARGET("Block Target"), MEMPOOL_SIZE("Mempool Size"), RECENT_BLOCKS("Recent Blocks"); 5 | 6 | private final String name; 7 | 8 | private FeeRatesSelection(String name) { 9 | this.name = name; 10 | } 11 | 12 | public String getName() { 13 | return name; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return name; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/wallet/Function.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.wallet; 2 | 3 | public enum Function { 4 | TRANSACTIONS, SEND, RECEIVE, ADDRESSES, UTXOS, SETTINGS, LOCK; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/wallet/InvalidTransactionException.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.wallet; 2 | 3 | public class InvalidTransactionException extends Exception { 4 | public InvalidTransactionException() { 5 | super(); 6 | } 7 | 8 | public InvalidTransactionException(String msg) { 9 | super(msg); 10 | } 11 | 12 | /** 13 | * Thrown when there are not enough selected inputs to pay the total output value 14 | */ 15 | public static class InsufficientInputsException extends InvalidTransactionException { 16 | public InsufficientInputsException(String msg) { 17 | super(msg); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/sparrowwallet/sparrow/wallet/OptimizationStrategy.java: -------------------------------------------------------------------------------- 1 | package com.sparrowwallet.sparrow.wallet; 2 | 3 | public enum OptimizationStrategy { 4 | EFFICIENCY("Efficiency"), PRIVACY("Privacy"); 5 | 6 | private final String name; 7 | 8 | private OptimizationStrategy(String name) { 9 | this.name = name; 10 | } 11 | 12 | public String getName() { 13 | return name; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return name; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/com/sparrowwallet/sparrow/about.css: -------------------------------------------------------------------------------- 1 | .title-area { 2 | -fx-background-color: -fx-control-inner-background; 3 | -fx-padding: 10 25 10 25; 4 | -fx-border-width: 0px 0px 1px 0px; 5 | -fx-border-color: #e5e5e6; 6 | } 7 | 8 | .title-label { 9 | -fx-font-size: 20px; 10 | } 11 | 12 | .content-area, .button-area { 13 | -fx-padding: 10 25 25 25; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/main/resources/com/sparrowwallet/sparrow/descriptor.css: -------------------------------------------------------------------------------- 1 | .descriptor-text { -fx-fill: derive(-fx-text-inner-color, 40%) } 2 | .descriptor-error { -fx-fill: rgba(202, 18, 67, 0.8) } 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/com/sparrowwallet/sparrow/dialog.css: -------------------------------------------------------------------------------- 1 | .root.dialog-pane .header-panel { 2 | -fx-background-color: -fx-control-inner-background; 3 | -fx-border-width: 0px 0px 1px 0px; 4 | -fx-border-color: #e5e5e6; 5 | } 6 | 7 | .header-panel .label { 8 | -fx-font-size: 24px; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/com/sparrowwallet/sparrow/grid.css: -------------------------------------------------------------------------------- 1 | #grid .spreadsheet-cell:selected, 2 | #grid .spreadsheet-cell:focused:selected, 3 | #grid .spreadsheet-cell:focused:selected:hover { 4 | -fx-background-color: transparent; 5 | } 6 | 7 | #grid .spreadsheet-cell.selection:selected, 8 | #grid .spreadsheet-cell.selection:focused:selected, 9 | #grid .spreadsheet-cell.selection:focused:selected:hover, 10 | #grid .spreadsheet-cell.selection { 11 | -fx-background-color: rgb(238, 210, 2); 12 | -fx-content-display: RIGHT; 13 | } -------------------------------------------------------------------------------- /src/main/resources/com/sparrowwallet/sparrow/keystoreimport/hw_airgapped.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/com/sparrowwallet/sparrow/keystoreimport/hw_usb-devices.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/com/sparrowwallet/sparrow/keystoreimport/hw_usb-error.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |