diff --git a/CHANGELOG.md b/CHANGELOG.md index e22b8849..394eb287 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [0.29.1] +Strongly typed exceptions + ## [0.29.0] Support Dart 3. Updated Rust and Flutter dependencies. diff --git a/README.md b/README.md index 9f9c86dd..42ae3ae6 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ To use the `bdk_flutter` package in your project, add it as a dependency in your ```dart dependencies: - bdk_flutter: ^0.29.0 + bdk_flutter: ^0.29.1 ``` ### Examples diff --git a/ios/bdk_flutter.podspec b/ios/bdk_flutter.podspec index 4dbcdea8..0b303219 100644 --- a/ios/bdk_flutter.podspec +++ b/ios/bdk_flutter.podspec @@ -4,17 +4,17 @@ # Pod::Spec.new do |s| s.name = 'bdk_flutter' - s.version = '0.29.0' + s.version = '0.29.1' s.summary = 'A Flutter library for the Bitcoin Development Kit (https://bitcoindevkit.org/)' s.description = <<-DESC A new Flutter project. - DESC - s.homepage = 'https://github.com/LtbLightning/bdk-flutter' - s.license = { :file => '../LICENSE' } - s.author = { 'Bitcoin Zavior' => 'BitcoinZavior@GMail.Com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.dependency 'Flutter' +DESC +s.homepage = 'https://github.com/LtbLightning/bdk-flutter' +s.license = { :file => '../LICENSE' } +s.author = { 'Bitcoin Zavior' => 'BitcoinZavior@GMail.Com' } +s.source = { :path => '.' } +s.source_files = 'Classes/**/*' +s.dependency 'Flutter' s.platform = :ios, '12.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } diff --git a/lib/bdk_flutter.dart b/lib/bdk_flutter.dart index 0b1f1361..8c49303e 100644 --- a/lib/bdk_flutter.dart +++ b/lib/bdk_flutter.dart @@ -24,3 +24,4 @@ export './src/generated/bridge_definitions.dart' RbfValue_Value, DatabaseConfig_Sled; export './src/root.dart'; +export 'src/utils/exceptions.dart'; diff --git a/lib/src/root.dart b/lib/src/root.dart index 9024cebe..fe070542 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -20,7 +20,7 @@ class Address { await loaderApi.createAddressStaticMethodApi(address: address); return Address._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -33,7 +33,7 @@ class Address { script: script, network: network); return Address._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -44,7 +44,7 @@ class Address { final res = await loaderApi.payloadStaticMethodApi(address: _address!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -54,7 +54,7 @@ class Address { await loaderApi.addressNetworkStaticMethodApi(address: _address!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -65,7 +65,7 @@ class Address { address: _address.toString()); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -89,7 +89,7 @@ class Blockchain { await loaderApi.createBlockchainStaticMethodApi(config: config); return Blockchain._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -100,7 +100,7 @@ class Blockchain { blockchainHeight: height, blockchainId: _blockchain); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -111,7 +111,7 @@ class Blockchain { await loaderApi.getHeightStaticMethodApi(blockchainId: _blockchain); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -122,7 +122,7 @@ class Blockchain { blockchainId: _blockchain, target: target); return FeeRate._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -135,7 +135,7 @@ class Blockchain { print(txid); } } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } } @@ -193,7 +193,7 @@ class BumpFeeTxBuilder { psbt: PartiallySignedTransaction(psbtBase64: res.field0), txDetails: res.field1); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } } @@ -210,7 +210,7 @@ class DerivationPath { await loaderApi.createDerivationPathStaticMethodApi(path: path); return DerivationPath._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -234,7 +234,7 @@ class Descriptor { descriptor: descriptor, network: network); return Descriptor._(res, network); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -244,7 +244,7 @@ class Descriptor { descriptor: _descriptorInstance, network: _network); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -262,7 +262,7 @@ class Descriptor { keyChainKind: keychain); return Descriptor._(res, network); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -284,7 +284,7 @@ class Descriptor { fingerprint: fingerPrint); return Descriptor._(res, network); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -302,7 +302,7 @@ class Descriptor { keyChainKind: keychain); return Descriptor._(res, network); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -324,7 +324,7 @@ class Descriptor { fingerprint: fingerPrint); return Descriptor._(res, network); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -342,7 +342,7 @@ class Descriptor { keyChainKind: keychain); return Descriptor._(res, network); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -364,7 +364,7 @@ class Descriptor { fingerprint: fingerPrint); return Descriptor._(res, network); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -375,7 +375,7 @@ class Descriptor { descriptor: _descriptorInstance, network: _network); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -386,7 +386,7 @@ class Descriptor { descriptor: _descriptorInstance, network: _network); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } } @@ -411,7 +411,7 @@ class DescriptorPublicKey { derive: true); return DescriptorPublicKey._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -424,7 +424,7 @@ class DescriptorPublicKey { derive: false); return DescriptorPublicKey._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -435,7 +435,7 @@ class DescriptorPublicKey { publicKey: publicKey); return DescriptorPublicKey._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -458,7 +458,7 @@ class DescriptorSecretKey { await loaderApi.asPublicStaticMethodApi(secret: _descriptorSecretKey); return DescriptorPublicKey._(xpub); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -477,7 +477,7 @@ class DescriptorSecretKey { network: network, mnemonic: mnemonic.asString(), password: password); return DescriptorSecretKey._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -488,7 +488,7 @@ class DescriptorSecretKey { secret: _descriptorSecretKey, path: derivationPath._path.toString()); return DescriptorSecretKey._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -499,7 +499,7 @@ class DescriptorSecretKey { secret: _descriptorSecretKey, path: derivationPath._path.toString()); return DescriptorSecretKey._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -510,7 +510,7 @@ class DescriptorSecretKey { secret: secretKey); return DescriptorSecretKey._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -521,7 +521,7 @@ class DescriptorSecretKey { secret: _descriptorSecretKey); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -570,7 +570,7 @@ class Mnemonic { wordCount: wordCount); return Mnemonic._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -589,7 +589,7 @@ class Mnemonic { entropy: entropy); return Mnemonic._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -602,7 +602,7 @@ class Mnemonic { mnemonic: mnemonic); return Mnemonic._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -628,7 +628,7 @@ class PartiallySignedTransaction { psbtStr: psbtBase64, other: other.psbtBase64); return PartiallySignedTransaction(psbtBase64: res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -638,7 +638,7 @@ class PartiallySignedTransaction { final res = await loaderApi.extractTxStaticMethodApi(psbtStr: psbtBase64); return Transaction._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -649,7 +649,7 @@ class PartiallySignedTransaction { await loaderApi.psbtFeeAmountStaticMethodApi(psbtStr: psbtBase64); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -661,7 +661,7 @@ class PartiallySignedTransaction { if (res == null) return null; return FeeRate._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -672,7 +672,7 @@ class PartiallySignedTransaction { await loaderApi.serializePsbtStaticMethodApi(psbtStr: psbtBase64); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -682,7 +682,7 @@ class PartiallySignedTransaction { await loaderApi.jsonSerializeStaticMethodApi(psbtStr: psbtBase64); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -697,7 +697,7 @@ class PartiallySignedTransaction { final res = await loaderApi.psbtTxidStaticMethodApi(psbtStr: psbtBase64); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } } @@ -718,7 +718,7 @@ class Script extends bridge.Script { rawOutputScript: rawOutputScript); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -741,7 +741,7 @@ class Transaction { final res = await loaderApi.createTransactionStaticMethodApi(tx: tx); return Transaction._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -751,7 +751,7 @@ class Transaction { final res = await loaderApi.serializeTxStaticMethodApi(tx: _tx!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -760,7 +760,7 @@ class Transaction { final res = await loaderApi.txTxidStaticMethodApi(tx: _tx!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -769,7 +769,7 @@ class Transaction { final res = await loaderApi.weightStaticMethodApi(tx: _tx!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -778,7 +778,7 @@ class Transaction { final res = await loaderApi.sizeStaticMethodApi(tx: _tx!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -787,7 +787,7 @@ class Transaction { final res = await loaderApi.vsizeStaticMethodApi(tx: _tx!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -796,7 +796,7 @@ class Transaction { final res = await loaderApi.isCoinBaseStaticMethodApi(tx: _tx!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -805,7 +805,7 @@ class Transaction { final res = await loaderApi.isExplicitlyRbfStaticMethodApi(tx: _tx!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -814,7 +814,7 @@ class Transaction { final res = await loaderApi.isLockTimeEnabledStaticMethodApi(tx: _tx!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -823,7 +823,7 @@ class Transaction { final res = await loaderApi.versionStaticMethodApi(tx: _tx!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -832,7 +832,7 @@ class Transaction { final res = await loaderApi.lockTimeStaticMethodApi(tx: _tx!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -841,7 +841,7 @@ class Transaction { final res = await loaderApi.inputStaticMethodApi(tx: _tx!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -850,7 +850,7 @@ class Transaction { final res = await loaderApi.outputStaticMethodApi(tx: _tx!); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -882,7 +882,7 @@ class TxBuilder { ///Add data as an output, using OP_RETURN TxBuilder addData({required List data}) { if (data.isEmpty) { - throw const BdkException.unExpected("List must not be empty"); + throw InvalidByteException(message: "List must not be empty"); } _data = typed_data.Uint8List.fromList(data); return this; @@ -1041,7 +1041,7 @@ class TxBuilder { Future finish(Wallet wallet) async { if (_recipients.isEmpty && _drainTo == null) { - throw const BdkException.unExpected("No Recipients Added"); + throw NoRecipientsException(); } try { final res = await loaderApi.txBuilderFinishStaticMethodApi( @@ -1063,7 +1063,7 @@ class TxBuilder { psbt: PartiallySignedTransaction(psbtBase64: res.field0), txDetails: res.field1); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } } @@ -1109,7 +1109,7 @@ class Wallet { ); return Wallet._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -1122,7 +1122,7 @@ class Wallet { walletId: _wallet, addressIndex: addressIndex); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -1140,7 +1140,7 @@ class Wallet { walletId: _wallet, addressIndex: addressIndex); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -1152,7 +1152,7 @@ class Wallet { var res = await loaderApi.getBalanceStaticMethodApi(walletId: _wallet); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -1163,7 +1163,7 @@ class Wallet { script: script, walletId: _wallet); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -1173,7 +1173,7 @@ class Wallet { var res = await loaderApi.walletNetworkStaticMethodApi(walletId: _wallet); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -1186,7 +1186,7 @@ class Wallet { await loaderApi.listUnspentOutputsStaticMethodApi(walletId: _wallet); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -1197,7 +1197,7 @@ class Wallet { walletId: _wallet, blockchainId: blockchain._blockchain); debugPrint('sync complete'); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -1209,7 +1209,7 @@ class Wallet { walletId: _wallet, includeRaw: includeRaw); return res; } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -1225,11 +1225,11 @@ class Wallet { psbtStr: psbt.psbtBase64, walletId: _wallet); if (sbt == null) { - throw const BdkException.unExpected("Unable to sign transaction"); + throw SignerException(message: "Unable to sign transaction"); } return PartiallySignedTransaction(psbtBase64: sbt); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -1246,7 +1246,7 @@ class Wallet { psbtSighashType: psbtSighashType); return Input._(res); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } @@ -1258,7 +1258,7 @@ class Wallet { walletId: _wallet, keychain: keychainKind); return Descriptor._(res.field0, res.field1); } on FfiException catch (e) { - throw configException(e.message); + throw handleException(e.message); } } } diff --git a/lib/src/utils/exceptions.dart b/lib/src/utils/exceptions.dart new file mode 100644 index 00000000..18824742 --- /dev/null +++ b/lib/src/utils/exceptions.dart @@ -0,0 +1,299 @@ +abstract class BdkFfiException implements Exception { + String? message; + String? type; + BdkFfiException({this.message, this.type}); + @override + String toString() => (type != null && message != null) + ? '$type${message!.split(type!).last}' + : (message != null) + ? message! + : 'Unexpected Error'; +} + +/// Exception thrown when trying to add an invalid byte value, or empty list to txBuilder.addData +class InvalidByteException extends BdkFfiException { + /// Constructs the [InvalidByteException] + InvalidByteException({super.message, super.type}); +} + +/// Exception thrown when output created is under the dust limit, 546 sats +class OutputBelowDustLimitException extends BdkFfiException { + /// Constructs the [OutputBelowDustLimitException] + OutputBelowDustLimitException({super.message, super.type}); +} + +/// Exception thrown when a there is an error in Partially signed bitcoin transaction +class PsbtException extends BdkFfiException { + /// Constructs the [PsbtException] + PsbtException({super.message, super.type}); +} + +class GenericException extends BdkFfiException { + /// Constructs the [GenericException] + GenericException({super.message, super.type}); +} + +class Bip32Exception extends BdkFfiException { + /// Constructs the [Bip32Exception] + Bip32Exception({super.message, super.type}); +} + +/// Exception thrown when a tx is build without recipients +class NoRecipientsException extends BdkFfiException { + /// Constructs the [NoRecipientsException] + NoRecipientsException({super.message, super.type}); +} + +/// Exception thrown when trying to convert Bare and Public key script to address +class ScriptDoesntHaveAddressFormException extends BdkFfiException { + /// Constructs the [ScriptDoesntHaveAddressFormException] + ScriptDoesntHaveAddressFormException({super.message, super.type}); +} + +/// Exception thrown when manuallySelectedOnly() is called but no utxos has been passed +class NoUtxosSelectedException extends BdkFfiException { + /// Constructs the [NoUtxosSelectedException] + NoUtxosSelectedException({super.message, super.type}); +} + +/// Branch and bound coin selection possible attempts with sufficiently big UTXO set could grow exponentially, +/// thus a limit is set, and when hit, this exception is thrown +class BnBTotalTriesExceededException extends BdkFfiException { + /// Constructs the [BnBTotalTriesExceededException] + BnBTotalTriesExceededException({super.message, super.type}); +} + +///Branch and bound coin selection tries to avoid needing a change by finding the right inputs for the desired outputs plus fee, +/// if there is not such combination this exception is thrown +class BnBNoExactMatchException extends BdkFfiException { + /// Constructs the [BnBNoExactMatchException] + BnBNoExactMatchException({super.message, super.type}); +} + +///Exception thrown when trying to replace a tx that has a sequence >= 0xFFFFFFFE +class IrreplaceableTransactionException extends BdkFfiException { + /// Constructs the [IrreplaceableTransactionException] + IrreplaceableTransactionException({super.message, super.type}); +} + +///Exception thrown when the keys are invalid +class KeyException extends BdkFfiException { + /// Constructs the [KeyException] + KeyException({super.message, super.type}); +} + +///Exception thrown when spending policy is not compatible with this KeychainKind +class SpendingPolicyRequiredException extends BdkFfiException { + /// Constructs the [SpendingPolicyRequiredException] + SpendingPolicyRequiredException({super.message, super.type}); +} + +///Transaction verification Exception +class VerificationException extends BdkFfiException { + /// Constructs the [VerificationException] + VerificationException({super.message, super.type}); +} + +///Exception thrown when progress value is not between 0.0 (included) and 100.0 (included) +class InvalidProgressValueException extends BdkFfiException { + /// Constructs the [InvalidProgressValueException] + InvalidProgressValueException({super.message, super.type}); +} + +///Progress update error (maybe the channel has been closed) +class ProgressUpdateException extends BdkFfiException { + /// Constructs the [ProgressUpdateException] + ProgressUpdateException({super.message, super.type}); +} + +///Exception thrown when the requested outpoint doesn’t exist in the tx (vout greater than available outputs) +class InvalidOutpointException extends BdkFfiException { + /// Constructs the [InvalidOutpointException] + InvalidOutpointException({super.message, super.type}); +} + +class EncodeException extends BdkFfiException { + /// Constructs the [EncodeException] + EncodeException({super.message, super.type}); +} + +class MiniscriptPsbtException extends BdkFfiException { + /// Constructs the [MiniscriptPsbtException] + MiniscriptPsbtException({super.message, super.type}); +} + +class SignerException extends BdkFfiException { + /// Constructs the [SignerException] + SignerException({super.message, super.type}); +} + +//Exception thrown when there is an error while extracting and manipulating policies +class InvalidPolicyPathException extends BdkFfiException { + /// Constructs the [InvalidPolicyPathException] + InvalidPolicyPathException({super.message, super.type}); +} + +class MissingKeyOriginException extends BdkFfiException { + /// Constructs the [MissingKeyOriginException] + MissingKeyOriginException({super.message, super.type}); +} + +///Exception thrown when trying to spend an UTXO that is not in the internal database +class UnknownUtxoException extends BdkFfiException { + /// Constructs the [UnknownUtxoException] + UnknownUtxoException({super.message, super.type}); +} + +///Exception thrown when trying to bump a transaction that is already confirmed +class TransactionNotFoundException extends BdkFfiException { + /// Constructs the [TransactionNotFoundException] + TransactionNotFoundException({super.message, super.type}); +} + +///Exception thrown when node doesn’t have data to estimate a fee rate +class FeeRateUnavailableException extends BdkFfiException { + /// Constructs the [FeeRateUnavailableException] + FeeRateUnavailableException({super.message, super.type}); +} + +///Exception thrown when the descriptor checksum mismatch +class ChecksumMismatchException extends BdkFfiException { + /// Constructs the [ChecksumMismatchException] + ChecksumMismatchException({super.message, super.type}); +} + +///Exception thrown when sync attempt failed due to missing scripts in cache which are needed to satisfy stopGap. +class MissingCachedScriptsException extends BdkFfiException { + /// Constructs the [MissingCachedScriptsException] + MissingCachedScriptsException({super.message, super.type}); +} + +///Exception thrown when wallet’s UTXO set is not enough to cover recipient’s requested plus fee +class InsufficientFundsException extends BdkFfiException { + /// Constructs the [InsufficientFundsException] + InsufficientFundsException({super.message, super.type}); +} + +///Exception thrown when bumping a tx, the fee rate requested is lower than required +class FeeRateTooLowException extends BdkFfiException { + /// Constructs the [FeeRateTooLowException] + FeeRateTooLowException({super.message, super.type}); +} + +///Exception thrown when bumping a tx, the absolute fee requested is lower than replaced tx absolute fee +class FeeTooLowException extends BdkFfiException { + /// Constructs the [FeeTooLowException] + FeeTooLowException({super.message, super.type}); +} + +///Sled database error +class SledException extends BdkFfiException { + /// Constructs the [SledException] + SledException({super.message, super.type}); +} + +///Exception thrown when there is an error in parsing and usage of descriptors +class DescriptorException extends BdkFfiException { + /// Constructs the [DescriptorException] + DescriptorException({super.message, super.type}); +} + +///Miniscript exception +class MiniscriptException extends BdkFfiException { + /// Constructs the [MiniscriptException] + MiniscriptException({super.message, super.type}); +} + +///Esplora Client exception +class EsploraException extends BdkFfiException { + /// Constructs the [EsploraException] + EsploraException({super.message, super.type}); +} + +class Secp256k1Exception extends BdkFfiException { + /// Constructs the [ Secp256k1Exception] + Secp256k1Exception({super.message, super.type}); +} + +///Exception thrown when trying to bump a transaction that is already confirmed +class TransactionConfirmedException extends BdkFfiException { + /// Constructs the [TransactionConfirmedException] + TransactionConfirmedException({super.message, super.type}); +} + +class ElectrumException extends BdkFfiException { + /// Constructs the [ElectrumException] + ElectrumException({super.message, super.type}); +} + +class RpcException extends BdkFfiException { + /// Constructs the [RpcException] + RpcException({super.message, super.type}); +} + +class RusqliteException extends BdkFfiException { + /// Constructs the [RusqliteException] + RusqliteException({super.message, super.type}); +} + +handleException(String e) { + if (e.contains("Generic")) { + return GenericException(message: e, type: 'Generic'); + } else if (e.contains('NoRecipients')) { + return NoRecipientsException(message: e, type: 'NoRecipients'); + } else if (e.contains('ScriptDoesntHaveAddressForm')) { + return ScriptDoesntHaveAddressFormException( + message: e, type: 'ScriptDoesntHaveAddressForm'); + } else if (e.contains('NoUtxosSelected')) { + return NoUtxosSelectedException(message: e, type: 'NoUtxosSelected'); + } else if (e.contains('OutputBelowDustLimit')) { + return OutputBelowDustLimitException( + message: e, type: 'OutputBelowDustLimit'); + } else if (e.contains('BnBTotalTriesExceeded')) { + return BnBTotalTriesExceededException( + message: e, type: 'BnBTotalTriesExceeded'); + } else if (e.contains('BnBNoExactMatch')) { + return BnBNoExactMatchException(message: e, type: 'BnBNoExactMatch'); + } else if (e.contains('UnknownUtxo')) { + return UnknownUtxoException(message: e, type: 'UnknownUtxo'); + } else if (e.contains('TransactionNotFound')) { + return TransactionNotFoundException( + message: e, type: 'TransactionNotFound'); + } else if (e.contains('TransactionConfirmed')) { + return TransactionConfirmedException( + message: e, type: 'TransactionConfirmed'); + } else if (e.contains('FeeRateUnavailable')) { + return FeeRateUnavailableException(message: e, type: 'FeeRateUnavailable'); + } else if (e.contains('ChecksumMismatch')) { + return ChecksumMismatchException(message: e, type: 'ChecksumMismatch'); + } else if (e.contains('MissingCachedScripts')) { + return MissingCachedScriptsException( + message: e, type: 'MissingCachedScripts'); + } else if (e.contains('InsufficientFunds')) { + return InsufficientFundsException(message: e, type: 'InsufficientFunds'); + } else if (e.contains('FeeRateTooLow')) { + return FeeRateTooLowException(message: e, type: 'FeeRateTooLow'); + } else if (e.contains('FeeTooLow')) { + return FeeTooLowException(message: e, type: 'FeeTooLow'); + } else if (e.contains('Sled')) { + return SledException(message: e, type: 'Sled'); + } else if (e.contains('Descriptor')) { + return DescriptorException(message: e, type: 'Descriptor'); + } else if (e.contains('Miniscript')) { + return MiniscriptException(message: e, type: 'Miniscript'); + } else if (e.contains('Bip32')) { + return Bip32Exception(message: e, type: 'Bip32'); + } else if (e.contains('Esplora')) { + return EsploraException(message: e, type: 'Esplora'); + } else if (e.contains('Secp256k1')) { + return Secp256k1Exception(message: e, type: 'Secp256k1'); + } else if (e.contains('Electrum')) { + return ElectrumException(message: e, type: 'Electrum'); + } else if (e.contains('Rpc')) { + return RpcException(message: e, type: 'Rpc'); + } else if (e.contains('Rusqlite')) { + return RusqliteException(message: e, type: 'Rusqlite'); + } else { + return Exception("Unexpected exception"); + } +} diff --git a/lib/src/utils/exceptions/bdk_exception.dart b/lib/src/utils/exceptions/bdk_exception.dart deleted file mode 100644 index a9c5a8c6..00000000 --- a/lib/src/utils/exceptions/bdk_exception.dart +++ /dev/null @@ -1,81 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; -part 'bdk_exception.freezed.dart'; - -@freezed -class BdkException with _$BdkException { - ///This error is thrown when trying to convert Bare and Public key script to address - const factory BdkException.scriptDoesntHaveAddressForm() = - ScriptDoesntHaveAddressForm; - - ///Cannot build a tx without recipients - const factory BdkException.noRecipients() = NoRecipients; - - ///Generic error - const factory BdkException.generic(String e) = Generic; - - ///manuallySelectedOnly option is selected but no utxo has been passed - const factory BdkException.noUtxosSelected() = NoUtxosSelected; - - ///Output created is under the dust limit, 546 satoshis - const factory BdkException.outputBelowDustLimit() = OutputBelowDustLimit; - - ///Wallet’s UTXO set is not enough to cover recipient’s requested plus fee - const factory BdkException.insufficientFunds(String e) = InsufficientFunds; - - ///Branch and bound coin selection possible attempts with sufficiently big UTXO set could grow exponentially, thus a limit is set, and when hit, this error is thrown - const factory BdkException.bnBTotalTriesExceeded() = BnBTotalTriesExceeded; - - ///Branch and bound coin selection tries to avoid needing a change by finding the right inputs for the desired outputs plus fee, if there is not such combination this error is thrown - const factory BdkException.bnBNoExactMatch() = BnBNoExactMatch; - - ///Happens when trying to spend an UTXO that is not in the internal database - const factory BdkException.unknownUtxo() = UnknownUtxo; - - ///Thrown when a tx is not found in the internal database - const factory BdkException.transactionNotFound() = TransactionNotFound; - - ///Happens when trying to bump a transaction that is already confirmed - const factory BdkException.transactionConfirmed() = TransactionConfirmed; - - ///When bumping a tx the fee rate requested is lower than required - const factory BdkException.feeRateTooLow(String e) = FeeRateTooLow; - - ///When bumping a tx the absolute fee requested is lower than replaced tx absolute fee - const factory BdkException.feeTooLow(String e) = FeeTooLow; - - ///Node doesn’t have data to estimate a fee rate - const factory BdkException.feeRateUnavailable() = FeeRateUnavailable; - - ///Descriptor checksum mismatch - const factory BdkException.checksumMismatch() = ChecksumMismatch; - - ///Miniscript error - const factory BdkException.miniscript(String e) = Miniscript; - - ///Miniscript error - const factory BdkException.bip32(String e) = Bip32; - - ///An ECDSA error - const factory BdkException.secp256k1(String e) = Secp256k1; - - ///Sync attempt failed due to missing scripts in cache which are needed to satisfy stopGap. - const factory BdkException.missingCachedScripts() = MissingCachedScripts; - - ///Electrum client error - const factory BdkException.electrum(String e) = Electrum; - - ///Esplora client error - const factory BdkException.esplora(String e) = Esplora; - - ///Sled database error - const factory BdkException.sled(String e) = Sled; - - ///Rpc client error - const factory BdkException.rpc(String e) = Rpc; - - ///Rusqlite client error - const factory BdkException.rusqlite(String e) = Rusqlite; - - ///Unknown error - const factory BdkException.unExpected(String e) = UnExpected; -} diff --git a/lib/src/utils/exceptions/bdk_exception.freezed.dart b/lib/src/utils/exceptions/bdk_exception.freezed.dart deleted file mode 100644 index 39188d4f..00000000 --- a/lib/src/utils/exceptions/bdk_exception.freezed.dart +++ /dev/null @@ -1,6707 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'bdk_exception.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -mixin _$BdkException { - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $BdkExceptionCopyWith<$Res> { - factory $BdkExceptionCopyWith( - BdkException value, $Res Function(BdkException) then) = - _$BdkExceptionCopyWithImpl<$Res, BdkException>; -} - -/// @nodoc -class _$BdkExceptionCopyWithImpl<$Res, $Val extends BdkException> - implements $BdkExceptionCopyWith<$Res> { - _$BdkExceptionCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; -} - -/// @nodoc -abstract class _$$ScriptDoesntHaveAddressFormCopyWith<$Res> { - factory _$$ScriptDoesntHaveAddressFormCopyWith( - _$ScriptDoesntHaveAddressForm value, - $Res Function(_$ScriptDoesntHaveAddressForm) then) = - __$$ScriptDoesntHaveAddressFormCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$ScriptDoesntHaveAddressFormCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$ScriptDoesntHaveAddressForm> - implements _$$ScriptDoesntHaveAddressFormCopyWith<$Res> { - __$$ScriptDoesntHaveAddressFormCopyWithImpl( - _$ScriptDoesntHaveAddressForm _value, - $Res Function(_$ScriptDoesntHaveAddressForm) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$ScriptDoesntHaveAddressForm implements ScriptDoesntHaveAddressForm { - const _$ScriptDoesntHaveAddressForm(); - - @override - String toString() { - return 'BdkException.scriptDoesntHaveAddressForm()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ScriptDoesntHaveAddressForm); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return scriptDoesntHaveAddressForm(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return scriptDoesntHaveAddressForm?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (scriptDoesntHaveAddressForm != null) { - return scriptDoesntHaveAddressForm(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return scriptDoesntHaveAddressForm(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return scriptDoesntHaveAddressForm?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (scriptDoesntHaveAddressForm != null) { - return scriptDoesntHaveAddressForm(this); - } - return orElse(); - } -} - -abstract class ScriptDoesntHaveAddressForm implements BdkException { - const factory ScriptDoesntHaveAddressForm() = _$ScriptDoesntHaveAddressForm; -} - -/// @nodoc -abstract class _$$NoRecipientsCopyWith<$Res> { - factory _$$NoRecipientsCopyWith( - _$NoRecipients value, $Res Function(_$NoRecipients) then) = - __$$NoRecipientsCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$NoRecipientsCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$NoRecipients> - implements _$$NoRecipientsCopyWith<$Res> { - __$$NoRecipientsCopyWithImpl( - _$NoRecipients _value, $Res Function(_$NoRecipients) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$NoRecipients implements NoRecipients { - const _$NoRecipients(); - - @override - String toString() { - return 'BdkException.noRecipients()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$NoRecipients); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return noRecipients(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return noRecipients?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (noRecipients != null) { - return noRecipients(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return noRecipients(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return noRecipients?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (noRecipients != null) { - return noRecipients(this); - } - return orElse(); - } -} - -abstract class NoRecipients implements BdkException { - const factory NoRecipients() = _$NoRecipients; -} - -/// @nodoc -abstract class _$$GenericCopyWith<$Res> { - factory _$$GenericCopyWith(_$Generic value, $Res Function(_$Generic) then) = - __$$GenericCopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$GenericCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$Generic> - implements _$$GenericCopyWith<$Res> { - __$$GenericCopyWithImpl(_$Generic _value, $Res Function(_$Generic) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$Generic( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Generic implements Generic { - const _$Generic(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.generic(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Generic && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$GenericCopyWith<_$Generic> get copyWith => - __$$GenericCopyWithImpl<_$Generic>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return generic(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return generic?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (generic != null) { - return generic(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return generic(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return generic?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (generic != null) { - return generic(this); - } - return orElse(); - } -} - -abstract class Generic implements BdkException { - const factory Generic(final String e) = _$Generic; - - String get e; - @JsonKey(ignore: true) - _$$GenericCopyWith<_$Generic> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$NoUtxosSelectedCopyWith<$Res> { - factory _$$NoUtxosSelectedCopyWith( - _$NoUtxosSelected value, $Res Function(_$NoUtxosSelected) then) = - __$$NoUtxosSelectedCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$NoUtxosSelectedCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$NoUtxosSelected> - implements _$$NoUtxosSelectedCopyWith<$Res> { - __$$NoUtxosSelectedCopyWithImpl( - _$NoUtxosSelected _value, $Res Function(_$NoUtxosSelected) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$NoUtxosSelected implements NoUtxosSelected { - const _$NoUtxosSelected(); - - @override - String toString() { - return 'BdkException.noUtxosSelected()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$NoUtxosSelected); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return noUtxosSelected(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return noUtxosSelected?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (noUtxosSelected != null) { - return noUtxosSelected(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return noUtxosSelected(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return noUtxosSelected?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (noUtxosSelected != null) { - return noUtxosSelected(this); - } - return orElse(); - } -} - -abstract class NoUtxosSelected implements BdkException { - const factory NoUtxosSelected() = _$NoUtxosSelected; -} - -/// @nodoc -abstract class _$$OutputBelowDustLimitCopyWith<$Res> { - factory _$$OutputBelowDustLimitCopyWith(_$OutputBelowDustLimit value, - $Res Function(_$OutputBelowDustLimit) then) = - __$$OutputBelowDustLimitCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$OutputBelowDustLimitCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$OutputBelowDustLimit> - implements _$$OutputBelowDustLimitCopyWith<$Res> { - __$$OutputBelowDustLimitCopyWithImpl(_$OutputBelowDustLimit _value, - $Res Function(_$OutputBelowDustLimit) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$OutputBelowDustLimit implements OutputBelowDustLimit { - const _$OutputBelowDustLimit(); - - @override - String toString() { - return 'BdkException.outputBelowDustLimit()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$OutputBelowDustLimit); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return outputBelowDustLimit(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return outputBelowDustLimit?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (outputBelowDustLimit != null) { - return outputBelowDustLimit(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return outputBelowDustLimit(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return outputBelowDustLimit?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (outputBelowDustLimit != null) { - return outputBelowDustLimit(this); - } - return orElse(); - } -} - -abstract class OutputBelowDustLimit implements BdkException { - const factory OutputBelowDustLimit() = _$OutputBelowDustLimit; -} - -/// @nodoc -abstract class _$$InsufficientFundsCopyWith<$Res> { - factory _$$InsufficientFundsCopyWith( - _$InsufficientFunds value, $Res Function(_$InsufficientFunds) then) = - __$$InsufficientFundsCopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$InsufficientFundsCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$InsufficientFunds> - implements _$$InsufficientFundsCopyWith<$Res> { - __$$InsufficientFundsCopyWithImpl( - _$InsufficientFunds _value, $Res Function(_$InsufficientFunds) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$InsufficientFunds( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$InsufficientFunds implements InsufficientFunds { - const _$InsufficientFunds(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.insufficientFunds(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$InsufficientFunds && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$InsufficientFundsCopyWith<_$InsufficientFunds> get copyWith => - __$$InsufficientFundsCopyWithImpl<_$InsufficientFunds>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return insufficientFunds(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return insufficientFunds?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (insufficientFunds != null) { - return insufficientFunds(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return insufficientFunds(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return insufficientFunds?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (insufficientFunds != null) { - return insufficientFunds(this); - } - return orElse(); - } -} - -abstract class InsufficientFunds implements BdkException { - const factory InsufficientFunds(final String e) = _$InsufficientFunds; - - String get e; - @JsonKey(ignore: true) - _$$InsufficientFundsCopyWith<_$InsufficientFunds> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$BnBTotalTriesExceededCopyWith<$Res> { - factory _$$BnBTotalTriesExceededCopyWith(_$BnBTotalTriesExceeded value, - $Res Function(_$BnBTotalTriesExceeded) then) = - __$$BnBTotalTriesExceededCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$BnBTotalTriesExceededCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$BnBTotalTriesExceeded> - implements _$$BnBTotalTriesExceededCopyWith<$Res> { - __$$BnBTotalTriesExceededCopyWithImpl(_$BnBTotalTriesExceeded _value, - $Res Function(_$BnBTotalTriesExceeded) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$BnBTotalTriesExceeded implements BnBTotalTriesExceeded { - const _$BnBTotalTriesExceeded(); - - @override - String toString() { - return 'BdkException.bnBTotalTriesExceeded()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$BnBTotalTriesExceeded); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return bnBTotalTriesExceeded(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return bnBTotalTriesExceeded?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (bnBTotalTriesExceeded != null) { - return bnBTotalTriesExceeded(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return bnBTotalTriesExceeded(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return bnBTotalTriesExceeded?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (bnBTotalTriesExceeded != null) { - return bnBTotalTriesExceeded(this); - } - return orElse(); - } -} - -abstract class BnBTotalTriesExceeded implements BdkException { - const factory BnBTotalTriesExceeded() = _$BnBTotalTriesExceeded; -} - -/// @nodoc -abstract class _$$BnBNoExactMatchCopyWith<$Res> { - factory _$$BnBNoExactMatchCopyWith( - _$BnBNoExactMatch value, $Res Function(_$BnBNoExactMatch) then) = - __$$BnBNoExactMatchCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$BnBNoExactMatchCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$BnBNoExactMatch> - implements _$$BnBNoExactMatchCopyWith<$Res> { - __$$BnBNoExactMatchCopyWithImpl( - _$BnBNoExactMatch _value, $Res Function(_$BnBNoExactMatch) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$BnBNoExactMatch implements BnBNoExactMatch { - const _$BnBNoExactMatch(); - - @override - String toString() { - return 'BdkException.bnBNoExactMatch()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$BnBNoExactMatch); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return bnBNoExactMatch(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return bnBNoExactMatch?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (bnBNoExactMatch != null) { - return bnBNoExactMatch(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return bnBNoExactMatch(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return bnBNoExactMatch?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (bnBNoExactMatch != null) { - return bnBNoExactMatch(this); - } - return orElse(); - } -} - -abstract class BnBNoExactMatch implements BdkException { - const factory BnBNoExactMatch() = _$BnBNoExactMatch; -} - -/// @nodoc -abstract class _$$UnknownUtxoCopyWith<$Res> { - factory _$$UnknownUtxoCopyWith( - _$UnknownUtxo value, $Res Function(_$UnknownUtxo) then) = - __$$UnknownUtxoCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$UnknownUtxoCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$UnknownUtxo> - implements _$$UnknownUtxoCopyWith<$Res> { - __$$UnknownUtxoCopyWithImpl( - _$UnknownUtxo _value, $Res Function(_$UnknownUtxo) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$UnknownUtxo implements UnknownUtxo { - const _$UnknownUtxo(); - - @override - String toString() { - return 'BdkException.unknownUtxo()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$UnknownUtxo); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return unknownUtxo(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return unknownUtxo?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (unknownUtxo != null) { - return unknownUtxo(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return unknownUtxo(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return unknownUtxo?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (unknownUtxo != null) { - return unknownUtxo(this); - } - return orElse(); - } -} - -abstract class UnknownUtxo implements BdkException { - const factory UnknownUtxo() = _$UnknownUtxo; -} - -/// @nodoc -abstract class _$$TransactionNotFoundCopyWith<$Res> { - factory _$$TransactionNotFoundCopyWith(_$TransactionNotFound value, - $Res Function(_$TransactionNotFound) then) = - __$$TransactionNotFoundCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$TransactionNotFoundCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$TransactionNotFound> - implements _$$TransactionNotFoundCopyWith<$Res> { - __$$TransactionNotFoundCopyWithImpl( - _$TransactionNotFound _value, $Res Function(_$TransactionNotFound) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$TransactionNotFound implements TransactionNotFound { - const _$TransactionNotFound(); - - @override - String toString() { - return 'BdkException.transactionNotFound()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$TransactionNotFound); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return transactionNotFound(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return transactionNotFound?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (transactionNotFound != null) { - return transactionNotFound(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return transactionNotFound(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return transactionNotFound?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (transactionNotFound != null) { - return transactionNotFound(this); - } - return orElse(); - } -} - -abstract class TransactionNotFound implements BdkException { - const factory TransactionNotFound() = _$TransactionNotFound; -} - -/// @nodoc -abstract class _$$TransactionConfirmedCopyWith<$Res> { - factory _$$TransactionConfirmedCopyWith(_$TransactionConfirmed value, - $Res Function(_$TransactionConfirmed) then) = - __$$TransactionConfirmedCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$TransactionConfirmedCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$TransactionConfirmed> - implements _$$TransactionConfirmedCopyWith<$Res> { - __$$TransactionConfirmedCopyWithImpl(_$TransactionConfirmed _value, - $Res Function(_$TransactionConfirmed) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$TransactionConfirmed implements TransactionConfirmed { - const _$TransactionConfirmed(); - - @override - String toString() { - return 'BdkException.transactionConfirmed()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$TransactionConfirmed); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return transactionConfirmed(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return transactionConfirmed?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (transactionConfirmed != null) { - return transactionConfirmed(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return transactionConfirmed(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return transactionConfirmed?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (transactionConfirmed != null) { - return transactionConfirmed(this); - } - return orElse(); - } -} - -abstract class TransactionConfirmed implements BdkException { - const factory TransactionConfirmed() = _$TransactionConfirmed; -} - -/// @nodoc -abstract class _$$FeeRateTooLowCopyWith<$Res> { - factory _$$FeeRateTooLowCopyWith( - _$FeeRateTooLow value, $Res Function(_$FeeRateTooLow) then) = - __$$FeeRateTooLowCopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$FeeRateTooLowCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$FeeRateTooLow> - implements _$$FeeRateTooLowCopyWith<$Res> { - __$$FeeRateTooLowCopyWithImpl( - _$FeeRateTooLow _value, $Res Function(_$FeeRateTooLow) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$FeeRateTooLow( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$FeeRateTooLow implements FeeRateTooLow { - const _$FeeRateTooLow(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.feeRateTooLow(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FeeRateTooLow && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$FeeRateTooLowCopyWith<_$FeeRateTooLow> get copyWith => - __$$FeeRateTooLowCopyWithImpl<_$FeeRateTooLow>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return feeRateTooLow(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return feeRateTooLow?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (feeRateTooLow != null) { - return feeRateTooLow(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return feeRateTooLow(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return feeRateTooLow?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (feeRateTooLow != null) { - return feeRateTooLow(this); - } - return orElse(); - } -} - -abstract class FeeRateTooLow implements BdkException { - const factory FeeRateTooLow(final String e) = _$FeeRateTooLow; - - String get e; - @JsonKey(ignore: true) - _$$FeeRateTooLowCopyWith<_$FeeRateTooLow> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$FeeTooLowCopyWith<$Res> { - factory _$$FeeTooLowCopyWith( - _$FeeTooLow value, $Res Function(_$FeeTooLow) then) = - __$$FeeTooLowCopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$FeeTooLowCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$FeeTooLow> - implements _$$FeeTooLowCopyWith<$Res> { - __$$FeeTooLowCopyWithImpl( - _$FeeTooLow _value, $Res Function(_$FeeTooLow) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$FeeTooLow( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$FeeTooLow implements FeeTooLow { - const _$FeeTooLow(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.feeTooLow(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FeeTooLow && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$FeeTooLowCopyWith<_$FeeTooLow> get copyWith => - __$$FeeTooLowCopyWithImpl<_$FeeTooLow>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return feeTooLow(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return feeTooLow?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (feeTooLow != null) { - return feeTooLow(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return feeTooLow(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return feeTooLow?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (feeTooLow != null) { - return feeTooLow(this); - } - return orElse(); - } -} - -abstract class FeeTooLow implements BdkException { - const factory FeeTooLow(final String e) = _$FeeTooLow; - - String get e; - @JsonKey(ignore: true) - _$$FeeTooLowCopyWith<_$FeeTooLow> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$FeeRateUnavailableCopyWith<$Res> { - factory _$$FeeRateUnavailableCopyWith(_$FeeRateUnavailable value, - $Res Function(_$FeeRateUnavailable) then) = - __$$FeeRateUnavailableCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$FeeRateUnavailableCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$FeeRateUnavailable> - implements _$$FeeRateUnavailableCopyWith<$Res> { - __$$FeeRateUnavailableCopyWithImpl( - _$FeeRateUnavailable _value, $Res Function(_$FeeRateUnavailable) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$FeeRateUnavailable implements FeeRateUnavailable { - const _$FeeRateUnavailable(); - - @override - String toString() { - return 'BdkException.feeRateUnavailable()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$FeeRateUnavailable); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return feeRateUnavailable(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return feeRateUnavailable?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (feeRateUnavailable != null) { - return feeRateUnavailable(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return feeRateUnavailable(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return feeRateUnavailable?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (feeRateUnavailable != null) { - return feeRateUnavailable(this); - } - return orElse(); - } -} - -abstract class FeeRateUnavailable implements BdkException { - const factory FeeRateUnavailable() = _$FeeRateUnavailable; -} - -/// @nodoc -abstract class _$$ChecksumMismatchCopyWith<$Res> { - factory _$$ChecksumMismatchCopyWith( - _$ChecksumMismatch value, $Res Function(_$ChecksumMismatch) then) = - __$$ChecksumMismatchCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$ChecksumMismatchCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$ChecksumMismatch> - implements _$$ChecksumMismatchCopyWith<$Res> { - __$$ChecksumMismatchCopyWithImpl( - _$ChecksumMismatch _value, $Res Function(_$ChecksumMismatch) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$ChecksumMismatch implements ChecksumMismatch { - const _$ChecksumMismatch(); - - @override - String toString() { - return 'BdkException.checksumMismatch()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChecksumMismatch); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return checksumMismatch(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return checksumMismatch?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (checksumMismatch != null) { - return checksumMismatch(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return checksumMismatch(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return checksumMismatch?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (checksumMismatch != null) { - return checksumMismatch(this); - } - return orElse(); - } -} - -abstract class ChecksumMismatch implements BdkException { - const factory ChecksumMismatch() = _$ChecksumMismatch; -} - -/// @nodoc -abstract class _$$MiniscriptCopyWith<$Res> { - factory _$$MiniscriptCopyWith( - _$Miniscript value, $Res Function(_$Miniscript) then) = - __$$MiniscriptCopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$MiniscriptCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$Miniscript> - implements _$$MiniscriptCopyWith<$Res> { - __$$MiniscriptCopyWithImpl( - _$Miniscript _value, $Res Function(_$Miniscript) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$Miniscript( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Miniscript implements Miniscript { - const _$Miniscript(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.miniscript(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Miniscript && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$MiniscriptCopyWith<_$Miniscript> get copyWith => - __$$MiniscriptCopyWithImpl<_$Miniscript>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return miniscript(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return miniscript?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (miniscript != null) { - return miniscript(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return miniscript(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return miniscript?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (miniscript != null) { - return miniscript(this); - } - return orElse(); - } -} - -abstract class Miniscript implements BdkException { - const factory Miniscript(final String e) = _$Miniscript; - - String get e; - @JsonKey(ignore: true) - _$$MiniscriptCopyWith<_$Miniscript> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$Bip32CopyWith<$Res> { - factory _$$Bip32CopyWith(_$Bip32 value, $Res Function(_$Bip32) then) = - __$$Bip32CopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$Bip32CopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$Bip32> - implements _$$Bip32CopyWith<$Res> { - __$$Bip32CopyWithImpl(_$Bip32 _value, $Res Function(_$Bip32) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$Bip32( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Bip32 implements Bip32 { - const _$Bip32(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.bip32(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Bip32 && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$Bip32CopyWith<_$Bip32> get copyWith => - __$$Bip32CopyWithImpl<_$Bip32>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return bip32(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return bip32?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (bip32 != null) { - return bip32(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return bip32(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return bip32?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (bip32 != null) { - return bip32(this); - } - return orElse(); - } -} - -abstract class Bip32 implements BdkException { - const factory Bip32(final String e) = _$Bip32; - - String get e; - @JsonKey(ignore: true) - _$$Bip32CopyWith<_$Bip32> get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$Secp256k1CopyWith<$Res> { - factory _$$Secp256k1CopyWith( - _$Secp256k1 value, $Res Function(_$Secp256k1) then) = - __$$Secp256k1CopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$Secp256k1CopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$Secp256k1> - implements _$$Secp256k1CopyWith<$Res> { - __$$Secp256k1CopyWithImpl( - _$Secp256k1 _value, $Res Function(_$Secp256k1) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$Secp256k1( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Secp256k1 implements Secp256k1 { - const _$Secp256k1(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.secp256k1(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Secp256k1 && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$Secp256k1CopyWith<_$Secp256k1> get copyWith => - __$$Secp256k1CopyWithImpl<_$Secp256k1>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return secp256k1(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return secp256k1?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (secp256k1 != null) { - return secp256k1(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return secp256k1(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return secp256k1?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (secp256k1 != null) { - return secp256k1(this); - } - return orElse(); - } -} - -abstract class Secp256k1 implements BdkException { - const factory Secp256k1(final String e) = _$Secp256k1; - - String get e; - @JsonKey(ignore: true) - _$$Secp256k1CopyWith<_$Secp256k1> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$MissingCachedScriptsCopyWith<$Res> { - factory _$$MissingCachedScriptsCopyWith(_$MissingCachedScripts value, - $Res Function(_$MissingCachedScripts) then) = - __$$MissingCachedScriptsCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$MissingCachedScriptsCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$MissingCachedScripts> - implements _$$MissingCachedScriptsCopyWith<$Res> { - __$$MissingCachedScriptsCopyWithImpl(_$MissingCachedScripts _value, - $Res Function(_$MissingCachedScripts) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$MissingCachedScripts implements MissingCachedScripts { - const _$MissingCachedScripts(); - - @override - String toString() { - return 'BdkException.missingCachedScripts()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$MissingCachedScripts); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return missingCachedScripts(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return missingCachedScripts?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (missingCachedScripts != null) { - return missingCachedScripts(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return missingCachedScripts(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return missingCachedScripts?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (missingCachedScripts != null) { - return missingCachedScripts(this); - } - return orElse(); - } -} - -abstract class MissingCachedScripts implements BdkException { - const factory MissingCachedScripts() = _$MissingCachedScripts; -} - -/// @nodoc -abstract class _$$ElectrumCopyWith<$Res> { - factory _$$ElectrumCopyWith( - _$Electrum value, $Res Function(_$Electrum) then) = - __$$ElectrumCopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$ElectrumCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$Electrum> - implements _$$ElectrumCopyWith<$Res> { - __$$ElectrumCopyWithImpl(_$Electrum _value, $Res Function(_$Electrum) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$Electrum( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Electrum implements Electrum { - const _$Electrum(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.electrum(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Electrum && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$ElectrumCopyWith<_$Electrum> get copyWith => - __$$ElectrumCopyWithImpl<_$Electrum>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return electrum(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return electrum?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (electrum != null) { - return electrum(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return electrum(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return electrum?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (electrum != null) { - return electrum(this); - } - return orElse(); - } -} - -abstract class Electrum implements BdkException { - const factory Electrum(final String e) = _$Electrum; - - String get e; - @JsonKey(ignore: true) - _$$ElectrumCopyWith<_$Electrum> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$EsploraCopyWith<$Res> { - factory _$$EsploraCopyWith(_$Esplora value, $Res Function(_$Esplora) then) = - __$$EsploraCopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$EsploraCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$Esplora> - implements _$$EsploraCopyWith<$Res> { - __$$EsploraCopyWithImpl(_$Esplora _value, $Res Function(_$Esplora) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$Esplora( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Esplora implements Esplora { - const _$Esplora(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.esplora(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Esplora && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$EsploraCopyWith<_$Esplora> get copyWith => - __$$EsploraCopyWithImpl<_$Esplora>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return esplora(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return esplora?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (esplora != null) { - return esplora(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return esplora(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return esplora?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (esplora != null) { - return esplora(this); - } - return orElse(); - } -} - -abstract class Esplora implements BdkException { - const factory Esplora(final String e) = _$Esplora; - - String get e; - @JsonKey(ignore: true) - _$$EsploraCopyWith<_$Esplora> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$SledCopyWith<$Res> { - factory _$$SledCopyWith(_$Sled value, $Res Function(_$Sled) then) = - __$$SledCopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$SledCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$Sled> - implements _$$SledCopyWith<$Res> { - __$$SledCopyWithImpl(_$Sled _value, $Res Function(_$Sled) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$Sled( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Sled implements Sled { - const _$Sled(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.sled(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Sled && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$SledCopyWith<_$Sled> get copyWith => - __$$SledCopyWithImpl<_$Sled>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return sled(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return sled?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (sled != null) { - return sled(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return sled(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return sled?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (sled != null) { - return sled(this); - } - return orElse(); - } -} - -abstract class Sled implements BdkException { - const factory Sled(final String e) = _$Sled; - - String get e; - @JsonKey(ignore: true) - _$$SledCopyWith<_$Sled> get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$RpcCopyWith<$Res> { - factory _$$RpcCopyWith(_$Rpc value, $Res Function(_$Rpc) then) = - __$$RpcCopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$RpcCopyWithImpl<$Res> extends _$BdkExceptionCopyWithImpl<$Res, _$Rpc> - implements _$$RpcCopyWith<$Res> { - __$$RpcCopyWithImpl(_$Rpc _value, $Res Function(_$Rpc) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$Rpc( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Rpc implements Rpc { - const _$Rpc(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.rpc(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Rpc && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$RpcCopyWith<_$Rpc> get copyWith => - __$$RpcCopyWithImpl<_$Rpc>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return rpc(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return rpc?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (rpc != null) { - return rpc(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return rpc(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return rpc?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (rpc != null) { - return rpc(this); - } - return orElse(); - } -} - -abstract class Rpc implements BdkException { - const factory Rpc(final String e) = _$Rpc; - - String get e; - @JsonKey(ignore: true) - _$$RpcCopyWith<_$Rpc> get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$RusqliteCopyWith<$Res> { - factory _$$RusqliteCopyWith( - _$Rusqlite value, $Res Function(_$Rusqlite) then) = - __$$RusqliteCopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$RusqliteCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$Rusqlite> - implements _$$RusqliteCopyWith<$Res> { - __$$RusqliteCopyWithImpl(_$Rusqlite _value, $Res Function(_$Rusqlite) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$Rusqlite( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Rusqlite implements Rusqlite { - const _$Rusqlite(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.rusqlite(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Rusqlite && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$RusqliteCopyWith<_$Rusqlite> get copyWith => - __$$RusqliteCopyWithImpl<_$Rusqlite>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return rusqlite(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return rusqlite?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (rusqlite != null) { - return rusqlite(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return rusqlite(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return rusqlite?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (rusqlite != null) { - return rusqlite(this); - } - return orElse(); - } -} - -abstract class Rusqlite implements BdkException { - const factory Rusqlite(final String e) = _$Rusqlite; - - String get e; - @JsonKey(ignore: true) - _$$RusqliteCopyWith<_$Rusqlite> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$UnExpectedCopyWith<$Res> { - factory _$$UnExpectedCopyWith( - _$UnExpected value, $Res Function(_$UnExpected) then) = - __$$UnExpectedCopyWithImpl<$Res>; - @useResult - $Res call({String e}); -} - -/// @nodoc -class __$$UnExpectedCopyWithImpl<$Res> - extends _$BdkExceptionCopyWithImpl<$Res, _$UnExpected> - implements _$$UnExpectedCopyWith<$Res> { - __$$UnExpectedCopyWithImpl( - _$UnExpected _value, $Res Function(_$UnExpected) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? e = null, - }) { - return _then(_$UnExpected( - null == e - ? _value.e - : e // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$UnExpected implements UnExpected { - const _$UnExpected(this.e); - - @override - final String e; - - @override - String toString() { - return 'BdkException.unExpected(e: $e)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$UnExpected && - (identical(other.e, e) || other.e == e)); - } - - @override - int get hashCode => Object.hash(runtimeType, e); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$UnExpectedCopyWith<_$UnExpected> get copyWith => - __$$UnExpectedCopyWithImpl<_$UnExpected>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() scriptDoesntHaveAddressForm, - required TResult Function() noRecipients, - required TResult Function(String e) generic, - required TResult Function() noUtxosSelected, - required TResult Function() outputBelowDustLimit, - required TResult Function(String e) insufficientFunds, - required TResult Function() bnBTotalTriesExceeded, - required TResult Function() bnBNoExactMatch, - required TResult Function() unknownUtxo, - required TResult Function() transactionNotFound, - required TResult Function() transactionConfirmed, - required TResult Function(String e) feeRateTooLow, - required TResult Function(String e) feeTooLow, - required TResult Function() feeRateUnavailable, - required TResult Function() checksumMismatch, - required TResult Function(String e) miniscript, - required TResult Function(String e) bip32, - required TResult Function(String e) secp256k1, - required TResult Function() missingCachedScripts, - required TResult Function(String e) electrum, - required TResult Function(String e) esplora, - required TResult Function(String e) sled, - required TResult Function(String e) rpc, - required TResult Function(String e) rusqlite, - required TResult Function(String e) unExpected, - }) { - return unExpected(e); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? scriptDoesntHaveAddressForm, - TResult? Function()? noRecipients, - TResult? Function(String e)? generic, - TResult? Function()? noUtxosSelected, - TResult? Function()? outputBelowDustLimit, - TResult? Function(String e)? insufficientFunds, - TResult? Function()? bnBTotalTriesExceeded, - TResult? Function()? bnBNoExactMatch, - TResult? Function()? unknownUtxo, - TResult? Function()? transactionNotFound, - TResult? Function()? transactionConfirmed, - TResult? Function(String e)? feeRateTooLow, - TResult? Function(String e)? feeTooLow, - TResult? Function()? feeRateUnavailable, - TResult? Function()? checksumMismatch, - TResult? Function(String e)? miniscript, - TResult? Function(String e)? bip32, - TResult? Function(String e)? secp256k1, - TResult? Function()? missingCachedScripts, - TResult? Function(String e)? electrum, - TResult? Function(String e)? esplora, - TResult? Function(String e)? sled, - TResult? Function(String e)? rpc, - TResult? Function(String e)? rusqlite, - TResult? Function(String e)? unExpected, - }) { - return unExpected?.call(e); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? scriptDoesntHaveAddressForm, - TResult Function()? noRecipients, - TResult Function(String e)? generic, - TResult Function()? noUtxosSelected, - TResult Function()? outputBelowDustLimit, - TResult Function(String e)? insufficientFunds, - TResult Function()? bnBTotalTriesExceeded, - TResult Function()? bnBNoExactMatch, - TResult Function()? unknownUtxo, - TResult Function()? transactionNotFound, - TResult Function()? transactionConfirmed, - TResult Function(String e)? feeRateTooLow, - TResult Function(String e)? feeTooLow, - TResult Function()? feeRateUnavailable, - TResult Function()? checksumMismatch, - TResult Function(String e)? miniscript, - TResult Function(String e)? bip32, - TResult Function(String e)? secp256k1, - TResult Function()? missingCachedScripts, - TResult Function(String e)? electrum, - TResult Function(String e)? esplora, - TResult Function(String e)? sled, - TResult Function(String e)? rpc, - TResult Function(String e)? rusqlite, - TResult Function(String e)? unExpected, - required TResult orElse(), - }) { - if (unExpected != null) { - return unExpected(e); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ScriptDoesntHaveAddressForm value) - scriptDoesntHaveAddressForm, - required TResult Function(NoRecipients value) noRecipients, - required TResult Function(Generic value) generic, - required TResult Function(NoUtxosSelected value) noUtxosSelected, - required TResult Function(OutputBelowDustLimit value) outputBelowDustLimit, - required TResult Function(InsufficientFunds value) insufficientFunds, - required TResult Function(BnBTotalTriesExceeded value) - bnBTotalTriesExceeded, - required TResult Function(BnBNoExactMatch value) bnBNoExactMatch, - required TResult Function(UnknownUtxo value) unknownUtxo, - required TResult Function(TransactionNotFound value) transactionNotFound, - required TResult Function(TransactionConfirmed value) transactionConfirmed, - required TResult Function(FeeRateTooLow value) feeRateTooLow, - required TResult Function(FeeTooLow value) feeTooLow, - required TResult Function(FeeRateUnavailable value) feeRateUnavailable, - required TResult Function(ChecksumMismatch value) checksumMismatch, - required TResult Function(Miniscript value) miniscript, - required TResult Function(Bip32 value) bip32, - required TResult Function(Secp256k1 value) secp256k1, - required TResult Function(MissingCachedScripts value) missingCachedScripts, - required TResult Function(Electrum value) electrum, - required TResult Function(Esplora value) esplora, - required TResult Function(Sled value) sled, - required TResult Function(Rpc value) rpc, - required TResult Function(Rusqlite value) rusqlite, - required TResult Function(UnExpected value) unExpected, - }) { - return unExpected(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult? Function(NoRecipients value)? noRecipients, - TResult? Function(Generic value)? generic, - TResult? Function(NoUtxosSelected value)? noUtxosSelected, - TResult? Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult? Function(InsufficientFunds value)? insufficientFunds, - TResult? Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult? Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult? Function(UnknownUtxo value)? unknownUtxo, - TResult? Function(TransactionNotFound value)? transactionNotFound, - TResult? Function(TransactionConfirmed value)? transactionConfirmed, - TResult? Function(FeeRateTooLow value)? feeRateTooLow, - TResult? Function(FeeTooLow value)? feeTooLow, - TResult? Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult? Function(ChecksumMismatch value)? checksumMismatch, - TResult? Function(Miniscript value)? miniscript, - TResult? Function(Bip32 value)? bip32, - TResult? Function(Secp256k1 value)? secp256k1, - TResult? Function(MissingCachedScripts value)? missingCachedScripts, - TResult? Function(Electrum value)? electrum, - TResult? Function(Esplora value)? esplora, - TResult? Function(Sled value)? sled, - TResult? Function(Rpc value)? rpc, - TResult? Function(Rusqlite value)? rusqlite, - TResult? Function(UnExpected value)? unExpected, - }) { - return unExpected?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ScriptDoesntHaveAddressForm value)? - scriptDoesntHaveAddressForm, - TResult Function(NoRecipients value)? noRecipients, - TResult Function(Generic value)? generic, - TResult Function(NoUtxosSelected value)? noUtxosSelected, - TResult Function(OutputBelowDustLimit value)? outputBelowDustLimit, - TResult Function(InsufficientFunds value)? insufficientFunds, - TResult Function(BnBTotalTriesExceeded value)? bnBTotalTriesExceeded, - TResult Function(BnBNoExactMatch value)? bnBNoExactMatch, - TResult Function(UnknownUtxo value)? unknownUtxo, - TResult Function(TransactionNotFound value)? transactionNotFound, - TResult Function(TransactionConfirmed value)? transactionConfirmed, - TResult Function(FeeRateTooLow value)? feeRateTooLow, - TResult Function(FeeTooLow value)? feeTooLow, - TResult Function(FeeRateUnavailable value)? feeRateUnavailable, - TResult Function(ChecksumMismatch value)? checksumMismatch, - TResult Function(Miniscript value)? miniscript, - TResult Function(Bip32 value)? bip32, - TResult Function(Secp256k1 value)? secp256k1, - TResult Function(MissingCachedScripts value)? missingCachedScripts, - TResult Function(Electrum value)? electrum, - TResult Function(Esplora value)? esplora, - TResult Function(Sled value)? sled, - TResult Function(Rpc value)? rpc, - TResult Function(Rusqlite value)? rusqlite, - TResult Function(UnExpected value)? unExpected, - required TResult orElse(), - }) { - if (unExpected != null) { - return unExpected(this); - } - return orElse(); - } -} - -abstract class UnExpected implements BdkException { - const factory UnExpected(final String e) = _$UnExpected; - - String get e; - @JsonKey(ignore: true) - _$$UnExpectedCopyWith<_$UnExpected> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/lib/src/utils/exceptions/config.dart b/lib/src/utils/exceptions/config.dart deleted file mode 100644 index 9e542fe6..00000000 --- a/lib/src/utils/exceptions/config.dart +++ /dev/null @@ -1,69 +0,0 @@ -import 'package:bdk_flutter/src/utils/exceptions/bdk_exception.dart'; - -BdkException configException(String e) { - if (e.contains("Generic")) { - final message = e.split('Generic'); - return BdkException.generic(message.last); - } else if (e.contains('NoRecipients')) { - return BdkException.noRecipients(); - } else if (e.contains('ScriptDoesntHaveAddressForm')) { - return BdkException.scriptDoesntHaveAddressForm(); - } else if (e.contains('NoUtxosSelected')) { - return BdkException.noUtxosSelected(); - } else if (e.contains('OutputBelowDustLimit')) { - return BdkException.outputBelowDustLimit(); - } else if (e.contains('BnBTotalTriesExceeded')) { - return BdkException.bnBTotalTriesExceeded(); - } else if (e.contains('BnBNoExactMatch')) { - return BdkException.bnBNoExactMatch(); - } else if (e.contains('UnknownUtxo')) { - return BdkException.unknownUtxo(); - } else if (e.contains('TransactionNotFound')) { - return BdkException.transactionNotFound(); - } else if (e.contains('TransactionConfirmed')) { - return BdkException.transactionConfirmed(); - } else if (e.contains('FeeRateUnavailable')) { - return BdkException.feeRateUnavailable(); - } else if (e.contains('ChecksumMismatch')) { - return BdkException.checksumMismatch(); - } else if (e.contains('MissingCachedScripts')) { - return BdkException.missingCachedScripts(); - } else if (e.contains('InsufficientFunds')) { - final msg = e.split("InsufficientFunds"); - return BdkException.insufficientFunds(msg.last); - } else if (e.contains('FeeRateTooLow')) { - final msg = e.split('FeeRateTooLow'); - return BdkException.feeRateTooLow(msg.last); - } else if (e.contains('FeeTooLow')) { - final msg = e.split('FeeTooLow'); - return BdkException.feeTooLow(msg.last); - } else if (e.contains('Sled')) { - final msg = e.split('Sled'); - return BdkException.sled(msg.last); - // } else if( e.contains('Descriptor')){ - // final msg = e.split('Descriptor'); - // return BdkException.descriptor(msg.last); - } else if (e.contains('Miniscript')) { - final msg = e.split('Miniscript'); - return BdkException.miniscript(msg.last); - } else if (e.contains('Bip3')) { - final msg = e.split('Bip3'); - return BdkException.bip32(msg.last); - } else if (e.contains('Esplora')) { - final msg = e.split('Esplora'); - return BdkException.esplora(msg.last); - } else if (e.contains('Secp256k1')) { - final msg = e.split('Secp256k1'); - return BdkException.secp256k1(msg.last); - } else if (e.contains('Electrum')) { - final msg = e.split('Electrum'); - return BdkException.electrum(msg.last); - } else if (e.contains('Rpc')) { - final msg = e.split('Rpc'); - return BdkException.rpc(msg.last); - } else if (e.contains('Rusqlite')) { - final msg = e.split('Rusqlite'); - return BdkException.rusqlite(msg.last); - } - return BdkException.unExpected(e); -} diff --git a/lib/src/utils/utils.dart b/lib/src/utils/utils.dart index 4e851bfa..e5e7166b 100644 --- a/lib/src/utils/utils.dart +++ b/lib/src/utils/utils.dart @@ -1,4 +1,3 @@ export 'custom_objects.dart'; -export 'exceptions/bdk_exception.dart'; -export 'exceptions/config.dart'; +export 'exceptions.dart'; export 'loader.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 9244e8bf..fcc82ec6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: bdk_flutter description: A Flutter library for the Bitcoin Development Kit(bdk) (https://bitcoindevkit.org/) -version: 0.29.0 +version: 0.29.1 homepage: https://github.com/LtbLightning/bdk-flutter environment: diff --git a/rust/Cargo.toml b/rust/Cargo.toml index c201117e..2063017c 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust_bdk_ffi" -version = "0.29.0" +version = "0.29.1" edition = "2021" [lib] diff --git a/test/bdk_flutter_test.dart b/test/bdk_flutter_test.dart index 75fbf187..076b3ef8 100644 --- a/test/bdk_flutter_test.dart +++ b/test/bdk_flutter_test.dart @@ -1,7 +1,6 @@ import 'dart:convert'; import 'package:bdk_flutter/bdk_flutter.dart'; -import 'package:bdk_flutter/src/utils/exceptions/bdk_exception.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; @@ -158,37 +157,30 @@ void main() { test('Should return a TxBuilderException when funds are insufficient', () async { try { - when(mockTxBuilder.finish(mockWallet)).thenThrow( - const BdkException.insufficientFunds( - "{ needed: 751, available: 0 }")); + when(mockTxBuilder.finish(mockWallet)) + .thenThrow(InsufficientFundsException()); await mockTxBuilder.finish(mockWallet); } catch (error) { - expect( - error, - const BdkException.insufficientFunds( - "{ needed: 751, available: 0 }")); - expect(error, isA()); + expect(error, isA()); } }); test('Should return a TxBuilderException when no recipients are added', () async { try { when(mockTxBuilder.finish(mockWallet)) - .thenThrow(const BdkException.noRecipients()); + .thenThrow(NoRecipientsException(message: 'No recipient found')); await mockTxBuilder.finish(mockWallet); } catch (error) { - expect(error, const BdkException.noRecipients()); - expect(error, isA()); + expect(error, isA()); } }); test('Verify addData() Exception', () async { try { when(mockTxBuilder.addData(data: List.empty())) - .thenThrow(const BdkException.unExpected("List must not be empty")); + .thenThrow(InvalidByteException(message: "List must not be empty")); mockTxBuilder.addData(data: []); } catch (error) { - expect(error, const BdkException.unExpected("List must not be empty")); - expect(error, isA()); + expect(error, isA()); } }); test('Verify unSpendable()', () async { @@ -302,11 +294,10 @@ void main() { test('Should return a TxBuilderException when txid is invalid', () async { try { when(mockBumpFeeTxBuilder.finish(mockWallet)) - .thenThrow(const BdkException.transactionNotFound()); + .thenThrow(TransactionNotFoundException()); await mockBumpFeeTxBuilder.finish(mockWallet); } catch (error) { - expect(error, const BdkException.transactionNotFound()); - expect(error, isA()); + expect(error, isA()); } }); }); diff --git a/test/bdk_flutter_test.mocks.dart b/test/bdk_flutter_test.mocks.dart index c5de8240..a97d7a4d 100644 --- a/test/bdk_flutter_test.mocks.dart +++ b/test/bdk_flutter_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.0 from annotations +// Mocks generated by Mockito 5.4.2 from annotations // in bdk_flutter/test/bdk_flutter_test.dart. // Do not manually edit this file.