diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c19c3e1..54038dc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,16 @@ Updated `flutter_rust_bridge` to `2.0.0`. #### APIs added - Exposed `createTestnet` & `createMutinynet` to `Blockchain`. +- Exposed `policies` in `Wallet`. +- Exposed `policyPath` in `TxBuilder`. +- Exposed `id`, `requiresPath`, `item`, `satisfaction`, `contribution` in `Policy` class. - Overrode `toString()` for `Address`, `DerivationPath`, `Descriptor`, `DescriptorPublicKey` , `DescriptorSecretKey`, `Mnemonic`, -- `PartiallySignedTransaction`, `ScriptBuf` & `Transaction`. +- `PartiallySignedTransaction`, `ScriptBuf` & `Transaction`. #### Changed - `partiallySignedTransaction.serialize()` serialize the data as raw binary. #### Fixed - Thread `frb_workerpool` panicked on Sql database access. - ## [0.31.2-dev.2] #### Fixed - Thread `frb_workerpool` panicked on invalid `Fingerprint`. diff --git a/android/build.gradle b/android/build.gradle index af4681e5..6cc0c534 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -27,7 +27,6 @@ apply plugin: 'kotlin-android' android { compileSdkVersion 31 namespace "io.bdk.f.bdk_flutter" - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index e59e280d..0bfa73ba 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1 +1 @@ - + diff --git a/example/integration_test /full_cycle_test.dart b/example/integration_test /full_cycle_test.dart new file mode 100644 index 00000000..867af912 --- /dev/null +++ b/example/integration_test /full_cycle_test.dart @@ -0,0 +1,63 @@ +import 'dart:typed_data'; + +import 'package:bdk_flutter/bdk_flutter.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + group('Descriptor & Wallet', () { + setUp(() async {}); + testWidgets('generating psbt using a muti-sig wallet', (_) async { + final externalDescriptor = await Descriptor.create( + descriptor: + "wsh(thresh(2,pk(tpubD6NzVbkrYhZ4XJBfEJ6gt9DiVdfWJijsQTCE3jtXByW3Tk6AVGQ3vL1NNxg3SjB7QkJAuutACCQjrXD8zdZSM1ZmBENszCqy49ECEHmD6rf/0/*),sj:and_v(v:pk(tpubD6NzVbkrYhZ4YfAr3jCBRk4SpqB9L1Hh442y83njwfMaker7EqZd7fHMqyTWrfRYJ1e5t2ue6BYjW5i5yQnmwqbzY1a3kfqNxog1AFcD1aE/0/*),n:older(6)),snj:and_v(v:pk(tprv8ZgxMBicQKsPeitVUz3s6cfyCECovNP7t82FaKPa4UKqV1kssWcXgLkMDjzDbgG9GWoza4pL7z727QitfzkiwX99E1Has3T3a1MKHvYWmQZ/0/*),after(630000))))", + network: Network.signet); + final internalDescriptor = await Descriptor.create( + descriptor: + "wsh(thresh(2,pk(tpubD6NzVbkrYhZ4XJBfEJ6gt9DiVdfWJijsQTCE3jtXByW3Tk6AVGQ3vL1NNxg3SjB7QkJAuutACCQjrXD8zdZSM1ZmBENszCqy49ECEHmD6rf/1/*),sj:and_v(v:pk(tpubD6NzVbkrYhZ4YfAr3jCBRk4SpqB9L1Hh442y83njwfMaker7EqZd7fHMqyTWrfRYJ1e5t2ue6BYjW5i5yQnmwqbzY1a3kfqNxog1AFcD1aE/1/*),n:older(6)),snj:and_v(v:pk(tprv8ZgxMBicQKsPeitVUz3s6cfyCECovNP7t82FaKPa4UKqV1kssWcXgLkMDjzDbgG9GWoza4pL7z727QitfzkiwX99E1Has3T3a1MKHvYWmQZ/1/*),after(630000))))", + network: Network.signet); + + final wallet = await Wallet.create( + descriptor: externalDescriptor, + changeDescriptor: internalDescriptor, + network: Network.signet, + databaseConfig: const DatabaseConfig.memory()); + final blockchain = await Blockchain.createMutinynet(); + wallet.sync(blockchain: blockchain); + debugPrint("Wallet balance: ${wallet.getBalance().total}"); + final toAddress = wallet + .getAddress(addressIndex: const AddressIndex.increase()) + .address; + debugPrint("Wallet address: ${toAddress.toString()}"); + final externalWalletPolicy = wallet.policies(KeychainKind.externalChain); + final ineternalWalletPolicy = wallet.policies(KeychainKind.internalChain); + if (externalWalletPolicy != null && ineternalWalletPolicy != null) { + // Construct external and internal policy paths + final extPath = { + ineternalWalletPolicy.id(): Uint32List.fromList([0, 1]) + }; + debugPrint("External Policy path: $extPath\n"); + + final intPath = { + ineternalWalletPolicy.id(): Uint32List.fromList([0, 1]) + }; + debugPrint("Internal Policy Path: $intPath\n"); + + // Build the transaction + final txBuilder = TxBuilder() + .addRecipient( + toAddress.scriptPubkey(), + BigInt.from(1000), + ) + .doNotSpendChange() + .policyPath(KeychainKind.internalChain, intPath) + .policyPath(KeychainKind.externalChain, extPath); + + final (psbt, _) = await txBuilder.finish(wallet); + debugPrint("Transaction serialized: ${psbt.toString()}\n"); + } + }); + }); +} diff --git a/example/pubspec.lock b/example/pubspec.lock index 64ae97c4..2735c848 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -181,6 +181,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_driver: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" flutter_lints: dependency: "direct dev" description: @@ -210,6 +215,11 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.2" + fuchsia_remote_debug_protocol: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" glob: dependency: transitive description: @@ -218,6 +228,11 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + integration_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" json_annotation: dependency: transitive description: @@ -314,6 +329,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" + platform: + dependency: transitive + description: + name: platform + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + url: "https://pub.dev" + source: hosted + version: "3.1.5" + process: + dependency: transitive + description: + name: process + sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" + url: "https://pub.dev" + source: hosted + version: "5.0.2" pub_semver: dependency: transitive description: @@ -375,6 +406,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + sync_http: + dependency: transitive + description: + name: sync_http + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" + source: hosted + version: "0.3.1" term_glyph: dependency: transitive description: @@ -439,6 +478,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" + webdriver: + dependency: transitive + description: + name: webdriver + sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" + url: "https://pub.dev" + source: hosted + version: "3.0.3" yaml: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 06bbff6a..549e6f2f 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -32,7 +32,10 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - + integration_test: + sdk: flutter + flutter_driver: + sdk: flutter # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is # activated in the `analysis_options.yaml` file located at the root of your diff --git a/ios/Classes/frb_generated.h b/ios/Classes/frb_generated.h index 45bed664..5c3e0c91 100644 --- a/ios/Classes/frb_generated.h +++ b/ios/Classes/frb_generated.h @@ -139,6 +139,10 @@ typedef struct wire_cst_bdk_script_buf { struct wire_cst_list_prim_u_8_strict *bytes; } wire_cst_bdk_script_buf; +typedef struct wire_cst_bdk_policy { + uintptr_t ptr; +} wire_cst_bdk_policy; + typedef struct wire_cst_LockTime_Blocks { uint32_t field0; } wire_cst_LockTime_Blocks; @@ -297,6 +301,21 @@ typedef struct wire_cst_rbf_value { union RbfValueKind kind; } wire_cst_rbf_value; +typedef struct wire_cst_list_prim_u_32_strict { + uint32_t *ptr; + int32_t len; +} wire_cst_list_prim_u_32_strict; + +typedef struct wire_cst_record_string_list_prim_u_32_strict { + struct wire_cst_list_prim_u_8_strict *field0; + struct wire_cst_list_prim_u_32_strict *field1; +} wire_cst_record_string_list_prim_u_32_strict; + +typedef struct wire_cst_list_record_string_list_prim_u_32_strict { + struct wire_cst_record_string_list_prim_u_32_strict *ptr; + int32_t len; +} wire_cst_list_record_string_list_prim_u_32_strict; + typedef struct wire_cst_AddressError_Base58 { struct wire_cst_list_prim_u_8_strict *field0; } wire_cst_AddressError_Base58; @@ -358,6 +377,11 @@ typedef struct wire_cst_block_time { uint64_t timestamp; } wire_cst_block_time; +typedef struct wire_cst_condition { + uint32_t *csv; + struct wire_cst_lock_time *timelock; +} wire_cst_condition; + typedef struct wire_cst_ConsensusError_Io { struct wire_cst_list_prim_u_8_strict *field0; } wire_cst_ConsensusError_Io; @@ -469,11 +493,74 @@ typedef struct wire_cst_hex_error { union HexErrorKind kind; } wire_cst_hex_error; +typedef struct wire_cst_PkOrF_Pubkey { + struct wire_cst_list_prim_u_8_strict *value; +} wire_cst_PkOrF_Pubkey; + +typedef struct wire_cst_PkOrF_XOnlyPubkey { + struct wire_cst_list_prim_u_8_strict *value; +} wire_cst_PkOrF_XOnlyPubkey; + +typedef struct wire_cst_PkOrF_Fingerprint { + struct wire_cst_list_prim_u_8_strict *value; +} wire_cst_PkOrF_Fingerprint; + +typedef union PkOrFKind { + struct wire_cst_PkOrF_Pubkey Pubkey; + struct wire_cst_PkOrF_XOnlyPubkey XOnlyPubkey; + struct wire_cst_PkOrF_Fingerprint Fingerprint; +} PkOrFKind; + +typedef struct wire_cst_pk_or_f { + int32_t tag; + union PkOrFKind kind; +} wire_cst_pk_or_f; + +typedef struct wire_cst_list_bdk_policy { + struct wire_cst_bdk_policy *ptr; + int32_t len; +} wire_cst_list_bdk_policy; + +typedef struct wire_cst_list_condition { + struct wire_cst_condition *ptr; + int32_t len; +} wire_cst_list_condition; + typedef struct wire_cst_list_local_utxo { struct wire_cst_local_utxo *ptr; int32_t len; } wire_cst_list_local_utxo; +typedef struct wire_cst_list_pk_or_f { + struct wire_cst_pk_or_f *ptr; + int32_t len; +} wire_cst_list_pk_or_f; + +typedef struct wire_cst_list_prim_u_64_strict { + uint64_t *ptr; + int32_t len; +} wire_cst_list_prim_u_64_strict; + +typedef struct wire_cst_record_list_prim_u_32_strict_list_condition { + struct wire_cst_list_prim_u_32_strict *field0; + struct wire_cst_list_condition *field1; +} wire_cst_record_list_prim_u_32_strict_list_condition; + +typedef struct wire_cst_list_record_list_prim_u_32_strict_list_condition { + struct wire_cst_record_list_prim_u_32_strict_list_condition *ptr; + int32_t len; +} wire_cst_list_record_list_prim_u_32_strict_list_condition; + +typedef struct wire_cst_record_u_32_list_condition { + uint32_t field0; + struct wire_cst_list_condition *field1; +} wire_cst_record_u_32_list_condition; + +typedef struct wire_cst_list_record_u_32_list_condition { + struct wire_cst_record_u_32_list_condition *ptr; + int32_t len; +} wire_cst_list_record_u_32_list_condition; + typedef struct wire_cst_transaction_details { struct wire_cst_bdk_transaction *transaction; struct wire_cst_list_prim_u_8_strict *txid; @@ -722,6 +809,102 @@ typedef struct wire_cst_record_bdk_psbt_transaction_details { struct wire_cst_transaction_details field1; } wire_cst_record_bdk_psbt_transaction_details; +typedef struct wire_cst_Satisfaction_Partial { + uint64_t n; + uint64_t m; + struct wire_cst_list_prim_u_64_strict *items; + bool *sorted; + struct wire_cst_list_record_u_32_list_condition *conditions; +} wire_cst_Satisfaction_Partial; + +typedef struct wire_cst_Satisfaction_PartialComplete { + uint64_t n; + uint64_t m; + struct wire_cst_list_prim_u_64_strict *items; + bool *sorted; + struct wire_cst_list_record_list_prim_u_32_strict_list_condition *conditions; +} wire_cst_Satisfaction_PartialComplete; + +typedef struct wire_cst_Satisfaction_Complete { + struct wire_cst_condition *condition; +} wire_cst_Satisfaction_Complete; + +typedef struct wire_cst_Satisfaction_None { + struct wire_cst_list_prim_u_8_strict *msg; +} wire_cst_Satisfaction_None; + +typedef union SatisfactionKind { + struct wire_cst_Satisfaction_Partial Partial; + struct wire_cst_Satisfaction_PartialComplete PartialComplete; + struct wire_cst_Satisfaction_Complete Complete; + struct wire_cst_Satisfaction_None None; +} SatisfactionKind; + +typedef struct wire_cst_satisfaction { + int32_t tag; + union SatisfactionKind kind; +} wire_cst_satisfaction; + +typedef struct wire_cst_SatisfiableItem_EcdsaSignature { + struct wire_cst_pk_or_f *key; +} wire_cst_SatisfiableItem_EcdsaSignature; + +typedef struct wire_cst_SatisfiableItem_SchnorrSignature { + struct wire_cst_pk_or_f *key; +} wire_cst_SatisfiableItem_SchnorrSignature; + +typedef struct wire_cst_SatisfiableItem_Sha256Preimage { + struct wire_cst_list_prim_u_8_strict *hash; +} wire_cst_SatisfiableItem_Sha256Preimage; + +typedef struct wire_cst_SatisfiableItem_Hash256Preimage { + struct wire_cst_list_prim_u_8_strict *hash; +} wire_cst_SatisfiableItem_Hash256Preimage; + +typedef struct wire_cst_SatisfiableItem_Ripemd160Preimage { + struct wire_cst_list_prim_u_8_strict *hash; +} wire_cst_SatisfiableItem_Ripemd160Preimage; + +typedef struct wire_cst_SatisfiableItem_Hash160Preimage { + struct wire_cst_list_prim_u_8_strict *hash; +} wire_cst_SatisfiableItem_Hash160Preimage; + +typedef struct wire_cst_SatisfiableItem_AbsoluteTimelock { + struct wire_cst_lock_time *value; +} wire_cst_SatisfiableItem_AbsoluteTimelock; + +typedef struct wire_cst_SatisfiableItem_RelativeTimelock { + uint32_t value; +} wire_cst_SatisfiableItem_RelativeTimelock; + +typedef struct wire_cst_SatisfiableItem_Multisig { + struct wire_cst_list_pk_or_f *keys; + uint64_t threshold; +} wire_cst_SatisfiableItem_Multisig; + +typedef struct wire_cst_SatisfiableItem_Thresh { + struct wire_cst_list_bdk_policy *items; + uint64_t threshold; +} wire_cst_SatisfiableItem_Thresh; + +typedef union SatisfiableItemKind { + struct wire_cst_SatisfiableItem_EcdsaSignature EcdsaSignature; + struct wire_cst_SatisfiableItem_SchnorrSignature SchnorrSignature; + struct wire_cst_SatisfiableItem_Sha256Preimage Sha256Preimage; + struct wire_cst_SatisfiableItem_Hash256Preimage Hash256Preimage; + struct wire_cst_SatisfiableItem_Ripemd160Preimage Ripemd160Preimage; + struct wire_cst_SatisfiableItem_Hash160Preimage Hash160Preimage; + struct wire_cst_SatisfiableItem_AbsoluteTimelock AbsoluteTimelock; + struct wire_cst_SatisfiableItem_RelativeTimelock RelativeTimelock; + struct wire_cst_SatisfiableItem_Multisig Multisig; + struct wire_cst_SatisfiableItem_Thresh Thresh; +} SatisfiableItemKind; + +typedef struct wire_cst_satisfiable_item { + int32_t tag; + union SatisfiableItemKind kind; +} wire_cst_satisfiable_item; + void frbgen_bdk_flutter_wire__crate__api__blockchain__bdk_blockchain_broadcast(int64_t port_, struct wire_cst_bdk_blockchain *that, struct wire_cst_bdk_transaction *transaction); @@ -886,6 +1069,18 @@ WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_address_scr WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_address_to_qr_uri(struct wire_cst_bdk_address *that); +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_as_string(struct wire_cst_bdk_policy *that); + +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_contribution(struct wire_cst_bdk_policy *that); + +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_id(struct wire_cst_bdk_policy *that); + +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_item(struct wire_cst_bdk_policy *that); + +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_requires_path(struct wire_cst_bdk_policy *that); + +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_satisfaction(struct wire_cst_bdk_policy *that); + WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_script_buf_as_string(struct wire_cst_bdk_script_buf *that); WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_script_buf_empty(void); @@ -974,6 +1169,9 @@ void frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_new(int64_t port_, int32_t network, struct wire_cst_database_config *database_config); +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_policies(struct wire_cst_bdk_wallet *ptr, + int32_t keychain); + void frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_sign(int64_t port_, struct wire_cst_bdk_wallet *ptr, struct wire_cst_bdk_psbt *psbt, @@ -1004,6 +1202,8 @@ void frbgen_bdk_flutter_wire__crate__api__wallet__tx_builder_finish(int64_t port bool drain_wallet, struct wire_cst_bdk_script_buf *drain_to, struct wire_cst_rbf_value *rbf, + struct wire_cst_list_record_string_list_prim_u_32_strict *internal_policy_path, + struct wire_cst_list_record_string_list_prim_u_32_strict *external_policy_path, struct wire_cst_list_prim_u_8_loose *data); void frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkbitcoinAddress(const void *ptr); @@ -1022,6 +1222,10 @@ void frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkdescriptor void frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorExtendedDescriptor(const void *ptr); +void frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkdescriptorPolicy(const void *ptr); + +void frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicy(const void *ptr); + void frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkkeysDescriptorPublicKey(const void *ptr); void frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkkeysDescriptorPublicKey(const void *ptr); @@ -1064,6 +1268,8 @@ struct wire_cst_bdk_descriptor_secret_key *frbgen_bdk_flutter_cst_new_box_autoad struct wire_cst_bdk_mnemonic *frbgen_bdk_flutter_cst_new_box_autoadd_bdk_mnemonic(void); +struct wire_cst_bdk_policy *frbgen_bdk_flutter_cst_new_box_autoadd_bdk_policy(void); + struct wire_cst_bdk_psbt *frbgen_bdk_flutter_cst_new_box_autoadd_bdk_psbt(void); struct wire_cst_bdk_script_buf *frbgen_bdk_flutter_cst_new_box_autoadd_bdk_script_buf(void); @@ -1076,6 +1282,10 @@ struct wire_cst_block_time *frbgen_bdk_flutter_cst_new_box_autoadd_block_time(vo struct wire_cst_blockchain_config *frbgen_bdk_flutter_cst_new_box_autoadd_blockchain_config(void); +bool *frbgen_bdk_flutter_cst_new_box_autoadd_bool(bool value); + +struct wire_cst_condition *frbgen_bdk_flutter_cst_new_box_autoadd_condition(void); + struct wire_cst_consensus_error *frbgen_bdk_flutter_cst_new_box_autoadd_consensus_error(void); struct wire_cst_database_config *frbgen_bdk_flutter_cst_new_box_autoadd_database_config(void); @@ -1098,6 +1308,8 @@ struct wire_cst_lock_time *frbgen_bdk_flutter_cst_new_box_autoadd_lock_time(void struct wire_cst_out_point *frbgen_bdk_flutter_cst_new_box_autoadd_out_point(void); +struct wire_cst_pk_or_f *frbgen_bdk_flutter_cst_new_box_autoadd_pk_or_f(void); + struct wire_cst_psbt_sig_hash_type *frbgen_bdk_flutter_cst_new_box_autoadd_psbt_sig_hash_type(void); struct wire_cst_rbf_value *frbgen_bdk_flutter_cst_new_box_autoadd_rbf_value(void); @@ -1120,16 +1332,32 @@ uint64_t *frbgen_bdk_flutter_cst_new_box_autoadd_u_64(uint64_t value); uint8_t *frbgen_bdk_flutter_cst_new_box_autoadd_u_8(uint8_t value); +struct wire_cst_list_bdk_policy *frbgen_bdk_flutter_cst_new_list_bdk_policy(int32_t len); + +struct wire_cst_list_condition *frbgen_bdk_flutter_cst_new_list_condition(int32_t len); + struct wire_cst_list_list_prim_u_8_strict *frbgen_bdk_flutter_cst_new_list_list_prim_u_8_strict(int32_t len); struct wire_cst_list_local_utxo *frbgen_bdk_flutter_cst_new_list_local_utxo(int32_t len); struct wire_cst_list_out_point *frbgen_bdk_flutter_cst_new_list_out_point(int32_t len); +struct wire_cst_list_pk_or_f *frbgen_bdk_flutter_cst_new_list_pk_or_f(int32_t len); + +struct wire_cst_list_prim_u_32_strict *frbgen_bdk_flutter_cst_new_list_prim_u_32_strict(int32_t len); + +struct wire_cst_list_prim_u_64_strict *frbgen_bdk_flutter_cst_new_list_prim_u_64_strict(int32_t len); + struct wire_cst_list_prim_u_8_loose *frbgen_bdk_flutter_cst_new_list_prim_u_8_loose(int32_t len); struct wire_cst_list_prim_u_8_strict *frbgen_bdk_flutter_cst_new_list_prim_u_8_strict(int32_t len); +struct wire_cst_list_record_list_prim_u_32_strict_list_condition *frbgen_bdk_flutter_cst_new_list_record_list_prim_u_32_strict_list_condition(int32_t len); + +struct wire_cst_list_record_string_list_prim_u_32_strict *frbgen_bdk_flutter_cst_new_list_record_string_list_prim_u_32_strict(int32_t len); + +struct wire_cst_list_record_u_32_list_condition *frbgen_bdk_flutter_cst_new_list_record_u_32_list_condition(int32_t len); + struct wire_cst_list_script_amount *frbgen_bdk_flutter_cst_new_list_script_amount(int32_t len); struct wire_cst_list_transaction_details *frbgen_bdk_flutter_cst_new_list_transaction_details(int32_t len); @@ -1148,12 +1376,15 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_descriptor_public_key); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_descriptor_secret_key); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_mnemonic); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_policy); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_psbt); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_script_buf); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_transaction); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_wallet); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_block_time); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_blockchain_config); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bool); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_condition); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_consensus_error); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_database_config); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_descriptor_error); @@ -1165,6 +1396,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_local_utxo); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_lock_time); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_out_point); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_pk_or_f); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_psbt_sig_hash_type); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_rbf_value); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_record_out_point_input_usize); @@ -1176,11 +1408,19 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_u_32); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_u_64); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_u_8); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_bdk_policy); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_condition); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_list_prim_u_8_strict); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_local_utxo); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_out_point); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_pk_or_f); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_prim_u_32_strict); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_prim_u_64_strict); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_prim_u_8_loose); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_prim_u_8_strict); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_record_list_prim_u_32_strict_list_condition); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_record_string_list_prim_u_32_strict); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_record_u_32_list_condition); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_script_amount); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_transaction_details); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_tx_in); @@ -1189,6 +1429,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkbitcoinbip32DerivationPath); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkblockchainAnyBlockchain); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorExtendedDescriptor); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicy); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkkeysDescriptorPublicKey); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkkeysDescriptorSecretKey); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkkeysKeyMap); @@ -1199,6 +1440,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkbitcoinbip32DerivationPath); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkblockchainAnyBlockchain); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkdescriptorExtendedDescriptor); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkdescriptorPolicy); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkkeysDescriptorPublicKey); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkkeysDescriptorSecretKey); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkkeysKeyMap); @@ -1256,6 +1498,12 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_address_payload); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_address_script); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_address_to_qr_uri); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_as_string); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_contribution); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_id); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_item); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_requires_path); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_satisfaction); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_script_buf_as_string); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_script_buf_empty); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_script_buf_from_hex); @@ -1284,6 +1532,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_list_unspent); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_network); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_new); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_policies); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_sign); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_sync); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__finish_bump_fee_tx_builder); diff --git a/lib/bdk_flutter.dart b/lib/bdk_flutter.dart index 04948352..48f3898f 100644 --- a/lib/bdk_flutter.dart +++ b/lib/bdk_flutter.dart @@ -40,11 +40,4 @@ export './src/generated/api/types.dart' export './src/generated/api/wallet.dart' hide BdkWallet, finishBumpFeeTxBuilder, txBuilderFinish; export './src/root.dart'; -export 'src/utils/exceptions.dart' - hide - mapBdkError, - mapAddressError, - mapConsensusError, - mapDescriptorError, - mapHexError, - BdkFfiException; +export 'src/utils/exceptions.dart' hide mapBdkError, BdkFfiException; diff --git a/lib/src/generated/api/types.dart b/lib/src/generated/api/types.dart index bbeb65ad..1b642cb0 100644 --- a/lib/src/generated/api/types.dart +++ b/lib/src/generated/api/types.dart @@ -10,7 +10,7 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'package:freezed_annotation/freezed_annotation.dart' hide protected; part 'types.freezed.dart'; -// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `default`, `default`, `eq`, `eq`, `eq`, `eq`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `hash`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from` +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `default`, `default`, `eq`, `eq`, `eq`, `eq`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `hash`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from` @freezed sealed class AddressIndex with _$AddressIndex { @@ -143,6 +143,50 @@ class BdkAddress { ptr == other.ptr; } +class BdkPolicy { + final Policy ptr; + + const BdkPolicy({ + required this.ptr, + }); + + String asString() => core.instance.api.crateApiTypesBdkPolicyAsString( + that: this, + ); + + Satisfaction contribution() => + core.instance.api.crateApiTypesBdkPolicyContribution( + that: this, + ); + + String id() => core.instance.api.crateApiTypesBdkPolicyId( + that: this, + ); + + SatisfiableItem item() => core.instance.api.crateApiTypesBdkPolicyItem( + that: this, + ); + + bool requiresPath() => core.instance.api.crateApiTypesBdkPolicyRequiresPath( + that: this, + ); + + Satisfaction satisfaction() => + core.instance.api.crateApiTypesBdkPolicySatisfaction( + that: this, + ); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BdkPolicy && + runtimeType == other.runtimeType && + ptr == other.ptr; +} + class BdkScriptBuf { final Uint8List bytes; @@ -312,6 +356,27 @@ enum ChangeSpendPolicy { ; } +class Condition { + final int? csv; + final LockTime? timelock; + + const Condition({ + this.csv, + this.timelock, + }); + + @override + int get hashCode => csv.hashCode ^ timelock.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Condition && + runtimeType == other.runtimeType && + csv == other.csv && + timelock == other.timelock; +} + @freezed sealed class DatabaseConfig with _$DatabaseConfig { const DatabaseConfig._(); @@ -479,6 +544,21 @@ sealed class Payload with _$Payload { }) = Payload_WitnessProgram; } +@freezed +sealed class PkOrF with _$PkOrF { + const PkOrF._(); + + const factory PkOrF.pubkey({ + required String value, + }) = PkOrF_Pubkey; + const factory PkOrF.xOnlyPubkey({ + required String value, + }) = PkOrF_XOnlyPubkey; + const factory PkOrF.fingerprint({ + required String value, + }) = PkOrF_Fingerprint; +} + class PsbtSigHashType { final int inner; @@ -507,6 +587,70 @@ sealed class RbfValue with _$RbfValue { ) = RbfValue_Value; } +@freezed +sealed class Satisfaction with _$Satisfaction { + const Satisfaction._(); + + const factory Satisfaction.partial({ + required BigInt n, + required BigInt m, + required Uint64List items, + bool? sorted, + required Map> conditions, + }) = Satisfaction_Partial; + const factory Satisfaction.partialComplete({ + required BigInt n, + required BigInt m, + required Uint64List items, + bool? sorted, + required Map> conditions, + }) = Satisfaction_PartialComplete; + const factory Satisfaction.complete({ + required Condition condition, + }) = Satisfaction_Complete; + const factory Satisfaction.none({ + required String msg, + }) = Satisfaction_None; +} + +@freezed +sealed class SatisfiableItem with _$SatisfiableItem { + const SatisfiableItem._(); + + const factory SatisfiableItem.ecdsaSignature({ + required PkOrF key, + }) = SatisfiableItem_EcdsaSignature; + const factory SatisfiableItem.schnorrSignature({ + required PkOrF key, + }) = SatisfiableItem_SchnorrSignature; + const factory SatisfiableItem.sha256Preimage({ + required String hash, + }) = SatisfiableItem_Sha256Preimage; + const factory SatisfiableItem.hash256Preimage({ + required String hash, + }) = SatisfiableItem_Hash256Preimage; + const factory SatisfiableItem.ripemd160Preimage({ + required String hash, + }) = SatisfiableItem_Ripemd160Preimage; + const factory SatisfiableItem.hash160Preimage({ + required String hash, + }) = SatisfiableItem_Hash160Preimage; + const factory SatisfiableItem.absoluteTimelock({ + required LockTime value, + }) = SatisfiableItem_AbsoluteTimelock; + const factory SatisfiableItem.relativeTimelock({ + required int value, + }) = SatisfiableItem_RelativeTimelock; + const factory SatisfiableItem.multisig({ + required List keys, + required BigInt threshold, + }) = SatisfiableItem_Multisig; + const factory SatisfiableItem.thresh({ + required List items, + required BigInt threshold, + }) = SatisfiableItem_Thresh; +} + /// A output script and an amount of satoshis. class ScriptAmount { final BdkScriptBuf script; diff --git a/lib/src/generated/api/types.freezed.dart b/lib/src/generated/api/types.freezed.dart index dc17fb9f..fee5cdaf 100644 --- a/lib/src/generated/api/types.freezed.dart +++ b/lib/src/generated/api/types.freezed.dart @@ -1960,127 +1960,182 @@ abstract class Payload_WitnessProgram extends Payload { } /// @nodoc -mixin _$RbfValue { +mixin _$PkOrF { + String get value => throw _privateConstructorUsedError; @optionalTypeArgs TResult when({ - required TResult Function() rbfDefault, - required TResult Function(int field0) value, + required TResult Function(String value) pubkey, + required TResult Function(String value) xOnlyPubkey, + required TResult Function(String value) fingerprint, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - TResult? Function()? rbfDefault, - TResult? Function(int field0)? value, + TResult? Function(String value)? pubkey, + TResult? Function(String value)? xOnlyPubkey, + TResult? Function(String value)? fingerprint, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - TResult Function()? rbfDefault, - TResult Function(int field0)? value, + TResult Function(String value)? pubkey, + TResult Function(String value)? xOnlyPubkey, + TResult Function(String value)? fingerprint, required TResult orElse(), }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult map({ - required TResult Function(RbfValue_RbfDefault value) rbfDefault, - required TResult Function(RbfValue_Value value) value, + required TResult Function(PkOrF_Pubkey value) pubkey, + required TResult Function(PkOrF_XOnlyPubkey value) xOnlyPubkey, + required TResult Function(PkOrF_Fingerprint value) fingerprint, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(RbfValue_RbfDefault value)? rbfDefault, - TResult? Function(RbfValue_Value value)? value, + TResult? Function(PkOrF_Pubkey value)? pubkey, + TResult? Function(PkOrF_XOnlyPubkey value)? xOnlyPubkey, + TResult? Function(PkOrF_Fingerprint value)? fingerprint, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeMap({ - TResult Function(RbfValue_RbfDefault value)? rbfDefault, - TResult Function(RbfValue_Value value)? value, + TResult Function(PkOrF_Pubkey value)? pubkey, + TResult Function(PkOrF_XOnlyPubkey value)? xOnlyPubkey, + TResult Function(PkOrF_Fingerprint value)? fingerprint, required TResult orElse(), }) => throw _privateConstructorUsedError; + + @JsonKey(ignore: true) + $PkOrFCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $RbfValueCopyWith<$Res> { - factory $RbfValueCopyWith(RbfValue value, $Res Function(RbfValue) then) = - _$RbfValueCopyWithImpl<$Res, RbfValue>; +abstract class $PkOrFCopyWith<$Res> { + factory $PkOrFCopyWith(PkOrF value, $Res Function(PkOrF) then) = + _$PkOrFCopyWithImpl<$Res, PkOrF>; + @useResult + $Res call({String value}); } /// @nodoc -class _$RbfValueCopyWithImpl<$Res, $Val extends RbfValue> - implements $RbfValueCopyWith<$Res> { - _$RbfValueCopyWithImpl(this._value, this._then); +class _$PkOrFCopyWithImpl<$Res, $Val extends PkOrF> + implements $PkOrFCopyWith<$Res> { + _$PkOrFCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? value = null, + }) { + return _then(_value.copyWith( + value: null == value + ? _value.value + : value // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } } /// @nodoc -abstract class _$$RbfValue_RbfDefaultImplCopyWith<$Res> { - factory _$$RbfValue_RbfDefaultImplCopyWith(_$RbfValue_RbfDefaultImpl value, - $Res Function(_$RbfValue_RbfDefaultImpl) then) = - __$$RbfValue_RbfDefaultImplCopyWithImpl<$Res>; +abstract class _$$PkOrF_PubkeyImplCopyWith<$Res> + implements $PkOrFCopyWith<$Res> { + factory _$$PkOrF_PubkeyImplCopyWith( + _$PkOrF_PubkeyImpl value, $Res Function(_$PkOrF_PubkeyImpl) then) = + __$$PkOrF_PubkeyImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({String value}); } /// @nodoc -class __$$RbfValue_RbfDefaultImplCopyWithImpl<$Res> - extends _$RbfValueCopyWithImpl<$Res, _$RbfValue_RbfDefaultImpl> - implements _$$RbfValue_RbfDefaultImplCopyWith<$Res> { - __$$RbfValue_RbfDefaultImplCopyWithImpl(_$RbfValue_RbfDefaultImpl _value, - $Res Function(_$RbfValue_RbfDefaultImpl) _then) +class __$$PkOrF_PubkeyImplCopyWithImpl<$Res> + extends _$PkOrFCopyWithImpl<$Res, _$PkOrF_PubkeyImpl> + implements _$$PkOrF_PubkeyImplCopyWith<$Res> { + __$$PkOrF_PubkeyImplCopyWithImpl( + _$PkOrF_PubkeyImpl _value, $Res Function(_$PkOrF_PubkeyImpl) _then) : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? value = null, + }) { + return _then(_$PkOrF_PubkeyImpl( + value: null == value + ? _value.value + : value // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc -class _$RbfValue_RbfDefaultImpl extends RbfValue_RbfDefault { - const _$RbfValue_RbfDefaultImpl() : super._(); +class _$PkOrF_PubkeyImpl extends PkOrF_Pubkey { + const _$PkOrF_PubkeyImpl({required this.value}) : super._(); + + @override + final String value; @override String toString() { - return 'RbfValue.rbfDefault()'; + return 'PkOrF.pubkey(value: $value)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RbfValue_RbfDefaultImpl); + other is _$PkOrF_PubkeyImpl && + (identical(other.value, value) || other.value == value)); } @override - int get hashCode => runtimeType.hashCode; + int get hashCode => Object.hash(runtimeType, value); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$PkOrF_PubkeyImplCopyWith<_$PkOrF_PubkeyImpl> get copyWith => + __$$PkOrF_PubkeyImplCopyWithImpl<_$PkOrF_PubkeyImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function() rbfDefault, - required TResult Function(int field0) value, + required TResult Function(String value) pubkey, + required TResult Function(String value) xOnlyPubkey, + required TResult Function(String value) fingerprint, }) { - return rbfDefault(); + return pubkey(value); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function()? rbfDefault, - TResult? Function(int field0)? value, + TResult? Function(String value)? pubkey, + TResult? Function(String value)? xOnlyPubkey, + TResult? Function(String value)? fingerprint, }) { - return rbfDefault?.call(); + return pubkey?.call(value); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function()? rbfDefault, - TResult Function(int field0)? value, + TResult Function(String value)? pubkey, + TResult Function(String value)? xOnlyPubkey, + TResult Function(String value)? fingerprint, required TResult orElse(), }) { - if (rbfDefault != null) { - return rbfDefault(); + if (pubkey != null) { + return pubkey(value); } return orElse(); } @@ -2088,129 +2143,145 @@ class _$RbfValue_RbfDefaultImpl extends RbfValue_RbfDefault { @override @optionalTypeArgs TResult map({ - required TResult Function(RbfValue_RbfDefault value) rbfDefault, - required TResult Function(RbfValue_Value value) value, + required TResult Function(PkOrF_Pubkey value) pubkey, + required TResult Function(PkOrF_XOnlyPubkey value) xOnlyPubkey, + required TResult Function(PkOrF_Fingerprint value) fingerprint, }) { - return rbfDefault(this); + return pubkey(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(RbfValue_RbfDefault value)? rbfDefault, - TResult? Function(RbfValue_Value value)? value, + TResult? Function(PkOrF_Pubkey value)? pubkey, + TResult? Function(PkOrF_XOnlyPubkey value)? xOnlyPubkey, + TResult? Function(PkOrF_Fingerprint value)? fingerprint, }) { - return rbfDefault?.call(this); + return pubkey?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(RbfValue_RbfDefault value)? rbfDefault, - TResult Function(RbfValue_Value value)? value, + TResult Function(PkOrF_Pubkey value)? pubkey, + TResult Function(PkOrF_XOnlyPubkey value)? xOnlyPubkey, + TResult Function(PkOrF_Fingerprint value)? fingerprint, required TResult orElse(), }) { - if (rbfDefault != null) { - return rbfDefault(this); + if (pubkey != null) { + return pubkey(this); } return orElse(); } } -abstract class RbfValue_RbfDefault extends RbfValue { - const factory RbfValue_RbfDefault() = _$RbfValue_RbfDefaultImpl; - const RbfValue_RbfDefault._() : super._(); +abstract class PkOrF_Pubkey extends PkOrF { + const factory PkOrF_Pubkey({required final String value}) = + _$PkOrF_PubkeyImpl; + const PkOrF_Pubkey._() : super._(); + + @override + String get value; + @override + @JsonKey(ignore: true) + _$$PkOrF_PubkeyImplCopyWith<_$PkOrF_PubkeyImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RbfValue_ValueImplCopyWith<$Res> { - factory _$$RbfValue_ValueImplCopyWith(_$RbfValue_ValueImpl value, - $Res Function(_$RbfValue_ValueImpl) then) = - __$$RbfValue_ValueImplCopyWithImpl<$Res>; +abstract class _$$PkOrF_XOnlyPubkeyImplCopyWith<$Res> + implements $PkOrFCopyWith<$Res> { + factory _$$PkOrF_XOnlyPubkeyImplCopyWith(_$PkOrF_XOnlyPubkeyImpl value, + $Res Function(_$PkOrF_XOnlyPubkeyImpl) then) = + __$$PkOrF_XOnlyPubkeyImplCopyWithImpl<$Res>; + @override @useResult - $Res call({int field0}); + $Res call({String value}); } /// @nodoc -class __$$RbfValue_ValueImplCopyWithImpl<$Res> - extends _$RbfValueCopyWithImpl<$Res, _$RbfValue_ValueImpl> - implements _$$RbfValue_ValueImplCopyWith<$Res> { - __$$RbfValue_ValueImplCopyWithImpl( - _$RbfValue_ValueImpl _value, $Res Function(_$RbfValue_ValueImpl) _then) +class __$$PkOrF_XOnlyPubkeyImplCopyWithImpl<$Res> + extends _$PkOrFCopyWithImpl<$Res, _$PkOrF_XOnlyPubkeyImpl> + implements _$$PkOrF_XOnlyPubkeyImplCopyWith<$Res> { + __$$PkOrF_XOnlyPubkeyImplCopyWithImpl(_$PkOrF_XOnlyPubkeyImpl _value, + $Res Function(_$PkOrF_XOnlyPubkeyImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? field0 = null, + Object? value = null, }) { - return _then(_$RbfValue_ValueImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable - as int, + return _then(_$PkOrF_XOnlyPubkeyImpl( + value: null == value + ? _value.value + : value // ignore: cast_nullable_to_non_nullable + as String, )); } } /// @nodoc -class _$RbfValue_ValueImpl extends RbfValue_Value { - const _$RbfValue_ValueImpl(this.field0) : super._(); +class _$PkOrF_XOnlyPubkeyImpl extends PkOrF_XOnlyPubkey { + const _$PkOrF_XOnlyPubkeyImpl({required this.value}) : super._(); @override - final int field0; + final String value; @override String toString() { - return 'RbfValue.value(field0: $field0)'; + return 'PkOrF.xOnlyPubkey(value: $value)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RbfValue_ValueImpl && - (identical(other.field0, field0) || other.field0 == field0)); + other is _$PkOrF_XOnlyPubkeyImpl && + (identical(other.value, value) || other.value == value)); } @override - int get hashCode => Object.hash(runtimeType, field0); + int get hashCode => Object.hash(runtimeType, value); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RbfValue_ValueImplCopyWith<_$RbfValue_ValueImpl> get copyWith => - __$$RbfValue_ValueImplCopyWithImpl<_$RbfValue_ValueImpl>( + _$$PkOrF_XOnlyPubkeyImplCopyWith<_$PkOrF_XOnlyPubkeyImpl> get copyWith => + __$$PkOrF_XOnlyPubkeyImplCopyWithImpl<_$PkOrF_XOnlyPubkeyImpl>( this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function() rbfDefault, - required TResult Function(int field0) value, + required TResult Function(String value) pubkey, + required TResult Function(String value) xOnlyPubkey, + required TResult Function(String value) fingerprint, }) { - return value(field0); + return xOnlyPubkey(value); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function()? rbfDefault, - TResult? Function(int field0)? value, + TResult? Function(String value)? pubkey, + TResult? Function(String value)? xOnlyPubkey, + TResult? Function(String value)? fingerprint, }) { - return value?.call(field0); + return xOnlyPubkey?.call(value); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function()? rbfDefault, - TResult Function(int field0)? value, + TResult Function(String value)? pubkey, + TResult Function(String value)? xOnlyPubkey, + TResult Function(String value)? fingerprint, required TResult orElse(), }) { - if (value != null) { - return value(field0); + if (xOnlyPubkey != null) { + return xOnlyPubkey(value); } return orElse(); } @@ -2218,41 +2289,3542 @@ class _$RbfValue_ValueImpl extends RbfValue_Value { @override @optionalTypeArgs TResult map({ - required TResult Function(RbfValue_RbfDefault value) rbfDefault, - required TResult Function(RbfValue_Value value) value, + required TResult Function(PkOrF_Pubkey value) pubkey, + required TResult Function(PkOrF_XOnlyPubkey value) xOnlyPubkey, + required TResult Function(PkOrF_Fingerprint value) fingerprint, }) { - return value(this); + return xOnlyPubkey(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(RbfValue_RbfDefault value)? rbfDefault, - TResult? Function(RbfValue_Value value)? value, + TResult? Function(PkOrF_Pubkey value)? pubkey, + TResult? Function(PkOrF_XOnlyPubkey value)? xOnlyPubkey, + TResult? Function(PkOrF_Fingerprint value)? fingerprint, }) { - return value?.call(this); + return xOnlyPubkey?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(RbfValue_RbfDefault value)? rbfDefault, - TResult Function(RbfValue_Value value)? value, + TResult Function(PkOrF_Pubkey value)? pubkey, + TResult Function(PkOrF_XOnlyPubkey value)? xOnlyPubkey, + TResult Function(PkOrF_Fingerprint value)? fingerprint, required TResult orElse(), }) { - if (value != null) { - return value(this); + if (xOnlyPubkey != null) { + return xOnlyPubkey(this); } return orElse(); } } -abstract class RbfValue_Value extends RbfValue { - const factory RbfValue_Value(final int field0) = _$RbfValue_ValueImpl; - const RbfValue_Value._() : super._(); +abstract class PkOrF_XOnlyPubkey extends PkOrF { + const factory PkOrF_XOnlyPubkey({required final String value}) = + _$PkOrF_XOnlyPubkeyImpl; + const PkOrF_XOnlyPubkey._() : super._(); - int get field0; + @override + String get value; + @override @JsonKey(ignore: true) - _$$RbfValue_ValueImplCopyWith<_$RbfValue_ValueImpl> get copyWith => + _$$PkOrF_XOnlyPubkeyImplCopyWith<_$PkOrF_XOnlyPubkeyImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$PkOrF_FingerprintImplCopyWith<$Res> + implements $PkOrFCopyWith<$Res> { + factory _$$PkOrF_FingerprintImplCopyWith(_$PkOrF_FingerprintImpl value, + $Res Function(_$PkOrF_FingerprintImpl) then) = + __$$PkOrF_FingerprintImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({String value}); +} + +/// @nodoc +class __$$PkOrF_FingerprintImplCopyWithImpl<$Res> + extends _$PkOrFCopyWithImpl<$Res, _$PkOrF_FingerprintImpl> + implements _$$PkOrF_FingerprintImplCopyWith<$Res> { + __$$PkOrF_FingerprintImplCopyWithImpl(_$PkOrF_FingerprintImpl _value, + $Res Function(_$PkOrF_FingerprintImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? value = null, + }) { + return _then(_$PkOrF_FingerprintImpl( + value: null == value + ? _value.value + : value // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$PkOrF_FingerprintImpl extends PkOrF_Fingerprint { + const _$PkOrF_FingerprintImpl({required this.value}) : super._(); + + @override + final String value; + + @override + String toString() { + return 'PkOrF.fingerprint(value: $value)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$PkOrF_FingerprintImpl && + (identical(other.value, value) || other.value == value)); + } + + @override + int get hashCode => Object.hash(runtimeType, value); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$PkOrF_FingerprintImplCopyWith<_$PkOrF_FingerprintImpl> get copyWith => + __$$PkOrF_FingerprintImplCopyWithImpl<_$PkOrF_FingerprintImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(String value) pubkey, + required TResult Function(String value) xOnlyPubkey, + required TResult Function(String value) fingerprint, + }) { + return fingerprint(value); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String value)? pubkey, + TResult? Function(String value)? xOnlyPubkey, + TResult? Function(String value)? fingerprint, + }) { + return fingerprint?.call(value); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String value)? pubkey, + TResult Function(String value)? xOnlyPubkey, + TResult Function(String value)? fingerprint, + required TResult orElse(), + }) { + if (fingerprint != null) { + return fingerprint(value); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(PkOrF_Pubkey value) pubkey, + required TResult Function(PkOrF_XOnlyPubkey value) xOnlyPubkey, + required TResult Function(PkOrF_Fingerprint value) fingerprint, + }) { + return fingerprint(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(PkOrF_Pubkey value)? pubkey, + TResult? Function(PkOrF_XOnlyPubkey value)? xOnlyPubkey, + TResult? Function(PkOrF_Fingerprint value)? fingerprint, + }) { + return fingerprint?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(PkOrF_Pubkey value)? pubkey, + TResult Function(PkOrF_XOnlyPubkey value)? xOnlyPubkey, + TResult Function(PkOrF_Fingerprint value)? fingerprint, + required TResult orElse(), + }) { + if (fingerprint != null) { + return fingerprint(this); + } + return orElse(); + } +} + +abstract class PkOrF_Fingerprint extends PkOrF { + const factory PkOrF_Fingerprint({required final String value}) = + _$PkOrF_FingerprintImpl; + const PkOrF_Fingerprint._() : super._(); + + @override + String get value; + @override + @JsonKey(ignore: true) + _$$PkOrF_FingerprintImplCopyWith<_$PkOrF_FingerprintImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$RbfValue { + @optionalTypeArgs + TResult when({ + required TResult Function() rbfDefault, + required TResult Function(int field0) value, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? rbfDefault, + TResult? Function(int field0)? value, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? rbfDefault, + TResult Function(int field0)? value, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(RbfValue_RbfDefault value) rbfDefault, + required TResult Function(RbfValue_Value value) value, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(RbfValue_RbfDefault value)? rbfDefault, + TResult? Function(RbfValue_Value value)? value, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(RbfValue_RbfDefault value)? rbfDefault, + TResult Function(RbfValue_Value value)? value, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $RbfValueCopyWith<$Res> { + factory $RbfValueCopyWith(RbfValue value, $Res Function(RbfValue) then) = + _$RbfValueCopyWithImpl<$Res, RbfValue>; +} + +/// @nodoc +class _$RbfValueCopyWithImpl<$Res, $Val extends RbfValue> + implements $RbfValueCopyWith<$Res> { + _$RbfValueCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$RbfValue_RbfDefaultImplCopyWith<$Res> { + factory _$$RbfValue_RbfDefaultImplCopyWith(_$RbfValue_RbfDefaultImpl value, + $Res Function(_$RbfValue_RbfDefaultImpl) then) = + __$$RbfValue_RbfDefaultImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$RbfValue_RbfDefaultImplCopyWithImpl<$Res> + extends _$RbfValueCopyWithImpl<$Res, _$RbfValue_RbfDefaultImpl> + implements _$$RbfValue_RbfDefaultImplCopyWith<$Res> { + __$$RbfValue_RbfDefaultImplCopyWithImpl(_$RbfValue_RbfDefaultImpl _value, + $Res Function(_$RbfValue_RbfDefaultImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$RbfValue_RbfDefaultImpl extends RbfValue_RbfDefault { + const _$RbfValue_RbfDefaultImpl() : super._(); + + @override + String toString() { + return 'RbfValue.rbfDefault()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$RbfValue_RbfDefaultImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() rbfDefault, + required TResult Function(int field0) value, + }) { + return rbfDefault(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? rbfDefault, + TResult? Function(int field0)? value, + }) { + return rbfDefault?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? rbfDefault, + TResult Function(int field0)? value, + required TResult orElse(), + }) { + if (rbfDefault != null) { + return rbfDefault(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(RbfValue_RbfDefault value) rbfDefault, + required TResult Function(RbfValue_Value value) value, + }) { + return rbfDefault(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(RbfValue_RbfDefault value)? rbfDefault, + TResult? Function(RbfValue_Value value)? value, + }) { + return rbfDefault?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(RbfValue_RbfDefault value)? rbfDefault, + TResult Function(RbfValue_Value value)? value, + required TResult orElse(), + }) { + if (rbfDefault != null) { + return rbfDefault(this); + } + return orElse(); + } +} + +abstract class RbfValue_RbfDefault extends RbfValue { + const factory RbfValue_RbfDefault() = _$RbfValue_RbfDefaultImpl; + const RbfValue_RbfDefault._() : super._(); +} + +/// @nodoc +abstract class _$$RbfValue_ValueImplCopyWith<$Res> { + factory _$$RbfValue_ValueImplCopyWith(_$RbfValue_ValueImpl value, + $Res Function(_$RbfValue_ValueImpl) then) = + __$$RbfValue_ValueImplCopyWithImpl<$Res>; + @useResult + $Res call({int field0}); +} + +/// @nodoc +class __$$RbfValue_ValueImplCopyWithImpl<$Res> + extends _$RbfValueCopyWithImpl<$Res, _$RbfValue_ValueImpl> + implements _$$RbfValue_ValueImplCopyWith<$Res> { + __$$RbfValue_ValueImplCopyWithImpl( + _$RbfValue_ValueImpl _value, $Res Function(_$RbfValue_ValueImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$RbfValue_ValueImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc + +class _$RbfValue_ValueImpl extends RbfValue_Value { + const _$RbfValue_ValueImpl(this.field0) : super._(); + + @override + final int field0; + + @override + String toString() { + return 'RbfValue.value(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$RbfValue_ValueImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$RbfValue_ValueImplCopyWith<_$RbfValue_ValueImpl> get copyWith => + __$$RbfValue_ValueImplCopyWithImpl<_$RbfValue_ValueImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() rbfDefault, + required TResult Function(int field0) value, + }) { + return value(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? rbfDefault, + TResult? Function(int field0)? value, + }) { + return value?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? rbfDefault, + TResult Function(int field0)? value, + required TResult orElse(), + }) { + if (value != null) { + return value(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(RbfValue_RbfDefault value) rbfDefault, + required TResult Function(RbfValue_Value value) value, + }) { + return value(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(RbfValue_RbfDefault value)? rbfDefault, + TResult? Function(RbfValue_Value value)? value, + }) { + return value?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(RbfValue_RbfDefault value)? rbfDefault, + TResult Function(RbfValue_Value value)? value, + required TResult orElse(), + }) { + if (value != null) { + return value(this); + } + return orElse(); + } +} + +abstract class RbfValue_Value extends RbfValue { + const factory RbfValue_Value(final int field0) = _$RbfValue_ValueImpl; + const RbfValue_Value._() : super._(); + + int get field0; + @JsonKey(ignore: true) + _$$RbfValue_ValueImplCopyWith<_$RbfValue_ValueImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$Satisfaction { + @optionalTypeArgs + TResult when({ + required TResult Function(BigInt n, BigInt m, Uint64List items, + bool? sorted, Map> conditions) + partial, + required TResult Function(BigInt n, BigInt m, Uint64List items, + bool? sorted, Map> conditions) + partialComplete, + required TResult Function(Condition condition) complete, + required TResult Function(String msg) none, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partial, + TResult? Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partialComplete, + TResult? Function(Condition condition)? complete, + TResult? Function(String msg)? none, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partial, + TResult Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partialComplete, + TResult Function(Condition condition)? complete, + TResult Function(String msg)? none, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(Satisfaction_Partial value) partial, + required TResult Function(Satisfaction_PartialComplete value) + partialComplete, + required TResult Function(Satisfaction_Complete value) complete, + required TResult Function(Satisfaction_None value) none, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Satisfaction_Partial value)? partial, + TResult? Function(Satisfaction_PartialComplete value)? partialComplete, + TResult? Function(Satisfaction_Complete value)? complete, + TResult? Function(Satisfaction_None value)? none, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Satisfaction_Partial value)? partial, + TResult Function(Satisfaction_PartialComplete value)? partialComplete, + TResult Function(Satisfaction_Complete value)? complete, + TResult Function(Satisfaction_None value)? none, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $SatisfactionCopyWith<$Res> { + factory $SatisfactionCopyWith( + Satisfaction value, $Res Function(Satisfaction) then) = + _$SatisfactionCopyWithImpl<$Res, Satisfaction>; +} + +/// @nodoc +class _$SatisfactionCopyWithImpl<$Res, $Val extends Satisfaction> + implements $SatisfactionCopyWith<$Res> { + _$SatisfactionCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$Satisfaction_PartialImplCopyWith<$Res> { + factory _$$Satisfaction_PartialImplCopyWith(_$Satisfaction_PartialImpl value, + $Res Function(_$Satisfaction_PartialImpl) then) = + __$$Satisfaction_PartialImplCopyWithImpl<$Res>; + @useResult + $Res call( + {BigInt n, + BigInt m, + Uint64List items, + bool? sorted, + Map> conditions}); +} + +/// @nodoc +class __$$Satisfaction_PartialImplCopyWithImpl<$Res> + extends _$SatisfactionCopyWithImpl<$Res, _$Satisfaction_PartialImpl> + implements _$$Satisfaction_PartialImplCopyWith<$Res> { + __$$Satisfaction_PartialImplCopyWithImpl(_$Satisfaction_PartialImpl _value, + $Res Function(_$Satisfaction_PartialImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? n = null, + Object? m = null, + Object? items = null, + Object? sorted = freezed, + Object? conditions = null, + }) { + return _then(_$Satisfaction_PartialImpl( + n: null == n + ? _value.n + : n // ignore: cast_nullable_to_non_nullable + as BigInt, + m: null == m + ? _value.m + : m // ignore: cast_nullable_to_non_nullable + as BigInt, + items: null == items + ? _value.items + : items // ignore: cast_nullable_to_non_nullable + as Uint64List, + sorted: freezed == sorted + ? _value.sorted + : sorted // ignore: cast_nullable_to_non_nullable + as bool?, + conditions: null == conditions + ? _value._conditions + : conditions // ignore: cast_nullable_to_non_nullable + as Map>, + )); + } +} + +/// @nodoc + +class _$Satisfaction_PartialImpl extends Satisfaction_Partial { + const _$Satisfaction_PartialImpl( + {required this.n, + required this.m, + required this.items, + this.sorted, + required final Map> conditions}) + : _conditions = conditions, + super._(); + + @override + final BigInt n; + @override + final BigInt m; + @override + final Uint64List items; + @override + final bool? sorted; + final Map> _conditions; + @override + Map> get conditions { + if (_conditions is EqualUnmodifiableMapView) return _conditions; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_conditions); + } + + @override + String toString() { + return 'Satisfaction.partial(n: $n, m: $m, items: $items, sorted: $sorted, conditions: $conditions)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Satisfaction_PartialImpl && + (identical(other.n, n) || other.n == n) && + (identical(other.m, m) || other.m == m) && + const DeepCollectionEquality().equals(other.items, items) && + (identical(other.sorted, sorted) || other.sorted == sorted) && + const DeepCollectionEquality() + .equals(other._conditions, _conditions)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + n, + m, + const DeepCollectionEquality().hash(items), + sorted, + const DeepCollectionEquality().hash(_conditions)); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Satisfaction_PartialImplCopyWith<_$Satisfaction_PartialImpl> + get copyWith => + __$$Satisfaction_PartialImplCopyWithImpl<_$Satisfaction_PartialImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(BigInt n, BigInt m, Uint64List items, + bool? sorted, Map> conditions) + partial, + required TResult Function(BigInt n, BigInt m, Uint64List items, + bool? sorted, Map> conditions) + partialComplete, + required TResult Function(Condition condition) complete, + required TResult Function(String msg) none, + }) { + return partial(n, m, items, sorted, conditions); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partial, + TResult? Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partialComplete, + TResult? Function(Condition condition)? complete, + TResult? Function(String msg)? none, + }) { + return partial?.call(n, m, items, sorted, conditions); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partial, + TResult Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partialComplete, + TResult Function(Condition condition)? complete, + TResult Function(String msg)? none, + required TResult orElse(), + }) { + if (partial != null) { + return partial(n, m, items, sorted, conditions); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Satisfaction_Partial value) partial, + required TResult Function(Satisfaction_PartialComplete value) + partialComplete, + required TResult Function(Satisfaction_Complete value) complete, + required TResult Function(Satisfaction_None value) none, + }) { + return partial(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Satisfaction_Partial value)? partial, + TResult? Function(Satisfaction_PartialComplete value)? partialComplete, + TResult? Function(Satisfaction_Complete value)? complete, + TResult? Function(Satisfaction_None value)? none, + }) { + return partial?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Satisfaction_Partial value)? partial, + TResult Function(Satisfaction_PartialComplete value)? partialComplete, + TResult Function(Satisfaction_Complete value)? complete, + TResult Function(Satisfaction_None value)? none, + required TResult orElse(), + }) { + if (partial != null) { + return partial(this); + } + return orElse(); + } +} + +abstract class Satisfaction_Partial extends Satisfaction { + const factory Satisfaction_Partial( + {required final BigInt n, + required final BigInt m, + required final Uint64List items, + final bool? sorted, + required final Map> conditions}) = + _$Satisfaction_PartialImpl; + const Satisfaction_Partial._() : super._(); + + BigInt get n; + BigInt get m; + Uint64List get items; + bool? get sorted; + Map> get conditions; + @JsonKey(ignore: true) + _$$Satisfaction_PartialImplCopyWith<_$Satisfaction_PartialImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Satisfaction_PartialCompleteImplCopyWith<$Res> { + factory _$$Satisfaction_PartialCompleteImplCopyWith( + _$Satisfaction_PartialCompleteImpl value, + $Res Function(_$Satisfaction_PartialCompleteImpl) then) = + __$$Satisfaction_PartialCompleteImplCopyWithImpl<$Res>; + @useResult + $Res call( + {BigInt n, + BigInt m, + Uint64List items, + bool? sorted, + Map> conditions}); +} + +/// @nodoc +class __$$Satisfaction_PartialCompleteImplCopyWithImpl<$Res> + extends _$SatisfactionCopyWithImpl<$Res, _$Satisfaction_PartialCompleteImpl> + implements _$$Satisfaction_PartialCompleteImplCopyWith<$Res> { + __$$Satisfaction_PartialCompleteImplCopyWithImpl( + _$Satisfaction_PartialCompleteImpl _value, + $Res Function(_$Satisfaction_PartialCompleteImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? n = null, + Object? m = null, + Object? items = null, + Object? sorted = freezed, + Object? conditions = null, + }) { + return _then(_$Satisfaction_PartialCompleteImpl( + n: null == n + ? _value.n + : n // ignore: cast_nullable_to_non_nullable + as BigInt, + m: null == m + ? _value.m + : m // ignore: cast_nullable_to_non_nullable + as BigInt, + items: null == items + ? _value.items + : items // ignore: cast_nullable_to_non_nullable + as Uint64List, + sorted: freezed == sorted + ? _value.sorted + : sorted // ignore: cast_nullable_to_non_nullable + as bool?, + conditions: null == conditions + ? _value._conditions + : conditions // ignore: cast_nullable_to_non_nullable + as Map>, + )); + } +} + +/// @nodoc + +class _$Satisfaction_PartialCompleteImpl extends Satisfaction_PartialComplete { + const _$Satisfaction_PartialCompleteImpl( + {required this.n, + required this.m, + required this.items, + this.sorted, + required final Map> conditions}) + : _conditions = conditions, + super._(); + + @override + final BigInt n; + @override + final BigInt m; + @override + final Uint64List items; + @override + final bool? sorted; + final Map> _conditions; + @override + Map> get conditions { + if (_conditions is EqualUnmodifiableMapView) return _conditions; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_conditions); + } + + @override + String toString() { + return 'Satisfaction.partialComplete(n: $n, m: $m, items: $items, sorted: $sorted, conditions: $conditions)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Satisfaction_PartialCompleteImpl && + (identical(other.n, n) || other.n == n) && + (identical(other.m, m) || other.m == m) && + const DeepCollectionEquality().equals(other.items, items) && + (identical(other.sorted, sorted) || other.sorted == sorted) && + const DeepCollectionEquality() + .equals(other._conditions, _conditions)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + n, + m, + const DeepCollectionEquality().hash(items), + sorted, + const DeepCollectionEquality().hash(_conditions)); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Satisfaction_PartialCompleteImplCopyWith< + _$Satisfaction_PartialCompleteImpl> + get copyWith => __$$Satisfaction_PartialCompleteImplCopyWithImpl< + _$Satisfaction_PartialCompleteImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(BigInt n, BigInt m, Uint64List items, + bool? sorted, Map> conditions) + partial, + required TResult Function(BigInt n, BigInt m, Uint64List items, + bool? sorted, Map> conditions) + partialComplete, + required TResult Function(Condition condition) complete, + required TResult Function(String msg) none, + }) { + return partialComplete(n, m, items, sorted, conditions); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partial, + TResult? Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partialComplete, + TResult? Function(Condition condition)? complete, + TResult? Function(String msg)? none, + }) { + return partialComplete?.call(n, m, items, sorted, conditions); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partial, + TResult Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partialComplete, + TResult Function(Condition condition)? complete, + TResult Function(String msg)? none, + required TResult orElse(), + }) { + if (partialComplete != null) { + return partialComplete(n, m, items, sorted, conditions); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Satisfaction_Partial value) partial, + required TResult Function(Satisfaction_PartialComplete value) + partialComplete, + required TResult Function(Satisfaction_Complete value) complete, + required TResult Function(Satisfaction_None value) none, + }) { + return partialComplete(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Satisfaction_Partial value)? partial, + TResult? Function(Satisfaction_PartialComplete value)? partialComplete, + TResult? Function(Satisfaction_Complete value)? complete, + TResult? Function(Satisfaction_None value)? none, + }) { + return partialComplete?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Satisfaction_Partial value)? partial, + TResult Function(Satisfaction_PartialComplete value)? partialComplete, + TResult Function(Satisfaction_Complete value)? complete, + TResult Function(Satisfaction_None value)? none, + required TResult orElse(), + }) { + if (partialComplete != null) { + return partialComplete(this); + } + return orElse(); + } +} + +abstract class Satisfaction_PartialComplete extends Satisfaction { + const factory Satisfaction_PartialComplete( + {required final BigInt n, + required final BigInt m, + required final Uint64List items, + final bool? sorted, + required final Map> conditions}) = + _$Satisfaction_PartialCompleteImpl; + const Satisfaction_PartialComplete._() : super._(); + + BigInt get n; + BigInt get m; + Uint64List get items; + bool? get sorted; + Map> get conditions; + @JsonKey(ignore: true) + _$$Satisfaction_PartialCompleteImplCopyWith< + _$Satisfaction_PartialCompleteImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Satisfaction_CompleteImplCopyWith<$Res> { + factory _$$Satisfaction_CompleteImplCopyWith( + _$Satisfaction_CompleteImpl value, + $Res Function(_$Satisfaction_CompleteImpl) then) = + __$$Satisfaction_CompleteImplCopyWithImpl<$Res>; + @useResult + $Res call({Condition condition}); +} + +/// @nodoc +class __$$Satisfaction_CompleteImplCopyWithImpl<$Res> + extends _$SatisfactionCopyWithImpl<$Res, _$Satisfaction_CompleteImpl> + implements _$$Satisfaction_CompleteImplCopyWith<$Res> { + __$$Satisfaction_CompleteImplCopyWithImpl(_$Satisfaction_CompleteImpl _value, + $Res Function(_$Satisfaction_CompleteImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? condition = null, + }) { + return _then(_$Satisfaction_CompleteImpl( + condition: null == condition + ? _value.condition + : condition // ignore: cast_nullable_to_non_nullable + as Condition, + )); + } +} + +/// @nodoc + +class _$Satisfaction_CompleteImpl extends Satisfaction_Complete { + const _$Satisfaction_CompleteImpl({required this.condition}) : super._(); + + @override + final Condition condition; + + @override + String toString() { + return 'Satisfaction.complete(condition: $condition)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Satisfaction_CompleteImpl && + (identical(other.condition, condition) || + other.condition == condition)); + } + + @override + int get hashCode => Object.hash(runtimeType, condition); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Satisfaction_CompleteImplCopyWith<_$Satisfaction_CompleteImpl> + get copyWith => __$$Satisfaction_CompleteImplCopyWithImpl< + _$Satisfaction_CompleteImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(BigInt n, BigInt m, Uint64List items, + bool? sorted, Map> conditions) + partial, + required TResult Function(BigInt n, BigInt m, Uint64List items, + bool? sorted, Map> conditions) + partialComplete, + required TResult Function(Condition condition) complete, + required TResult Function(String msg) none, + }) { + return complete(condition); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partial, + TResult? Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partialComplete, + TResult? Function(Condition condition)? complete, + TResult? Function(String msg)? none, + }) { + return complete?.call(condition); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partial, + TResult Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partialComplete, + TResult Function(Condition condition)? complete, + TResult Function(String msg)? none, + required TResult orElse(), + }) { + if (complete != null) { + return complete(condition); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Satisfaction_Partial value) partial, + required TResult Function(Satisfaction_PartialComplete value) + partialComplete, + required TResult Function(Satisfaction_Complete value) complete, + required TResult Function(Satisfaction_None value) none, + }) { + return complete(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Satisfaction_Partial value)? partial, + TResult? Function(Satisfaction_PartialComplete value)? partialComplete, + TResult? Function(Satisfaction_Complete value)? complete, + TResult? Function(Satisfaction_None value)? none, + }) { + return complete?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Satisfaction_Partial value)? partial, + TResult Function(Satisfaction_PartialComplete value)? partialComplete, + TResult Function(Satisfaction_Complete value)? complete, + TResult Function(Satisfaction_None value)? none, + required TResult orElse(), + }) { + if (complete != null) { + return complete(this); + } + return orElse(); + } +} + +abstract class Satisfaction_Complete extends Satisfaction { + const factory Satisfaction_Complete({required final Condition condition}) = + _$Satisfaction_CompleteImpl; + const Satisfaction_Complete._() : super._(); + + Condition get condition; + @JsonKey(ignore: true) + _$$Satisfaction_CompleteImplCopyWith<_$Satisfaction_CompleteImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Satisfaction_NoneImplCopyWith<$Res> { + factory _$$Satisfaction_NoneImplCopyWith(_$Satisfaction_NoneImpl value, + $Res Function(_$Satisfaction_NoneImpl) then) = + __$$Satisfaction_NoneImplCopyWithImpl<$Res>; + @useResult + $Res call({String msg}); +} + +/// @nodoc +class __$$Satisfaction_NoneImplCopyWithImpl<$Res> + extends _$SatisfactionCopyWithImpl<$Res, _$Satisfaction_NoneImpl> + implements _$$Satisfaction_NoneImplCopyWith<$Res> { + __$$Satisfaction_NoneImplCopyWithImpl(_$Satisfaction_NoneImpl _value, + $Res Function(_$Satisfaction_NoneImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? msg = null, + }) { + return _then(_$Satisfaction_NoneImpl( + msg: null == msg + ? _value.msg + : msg // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$Satisfaction_NoneImpl extends Satisfaction_None { + const _$Satisfaction_NoneImpl({required this.msg}) : super._(); + + @override + final String msg; + + @override + String toString() { + return 'Satisfaction.none(msg: $msg)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Satisfaction_NoneImpl && + (identical(other.msg, msg) || other.msg == msg)); + } + + @override + int get hashCode => Object.hash(runtimeType, msg); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Satisfaction_NoneImplCopyWith<_$Satisfaction_NoneImpl> get copyWith => + __$$Satisfaction_NoneImplCopyWithImpl<_$Satisfaction_NoneImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(BigInt n, BigInt m, Uint64List items, + bool? sorted, Map> conditions) + partial, + required TResult Function(BigInt n, BigInt m, Uint64List items, + bool? sorted, Map> conditions) + partialComplete, + required TResult Function(Condition condition) complete, + required TResult Function(String msg) none, + }) { + return none(msg); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partial, + TResult? Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partialComplete, + TResult? Function(Condition condition)? complete, + TResult? Function(String msg)? none, + }) { + return none?.call(msg); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partial, + TResult Function(BigInt n, BigInt m, Uint64List items, bool? sorted, + Map> conditions)? + partialComplete, + TResult Function(Condition condition)? complete, + TResult Function(String msg)? none, + required TResult orElse(), + }) { + if (none != null) { + return none(msg); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Satisfaction_Partial value) partial, + required TResult Function(Satisfaction_PartialComplete value) + partialComplete, + required TResult Function(Satisfaction_Complete value) complete, + required TResult Function(Satisfaction_None value) none, + }) { + return none(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Satisfaction_Partial value)? partial, + TResult? Function(Satisfaction_PartialComplete value)? partialComplete, + TResult? Function(Satisfaction_Complete value)? complete, + TResult? Function(Satisfaction_None value)? none, + }) { + return none?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Satisfaction_Partial value)? partial, + TResult Function(Satisfaction_PartialComplete value)? partialComplete, + TResult Function(Satisfaction_Complete value)? complete, + TResult Function(Satisfaction_None value)? none, + required TResult orElse(), + }) { + if (none != null) { + return none(this); + } + return orElse(); + } +} + +abstract class Satisfaction_None extends Satisfaction { + const factory Satisfaction_None({required final String msg}) = + _$Satisfaction_NoneImpl; + const Satisfaction_None._() : super._(); + + String get msg; + @JsonKey(ignore: true) + _$$Satisfaction_NoneImplCopyWith<_$Satisfaction_NoneImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$SatisfiableItem { + @optionalTypeArgs + TResult when({ + required TResult Function(PkOrF key) ecdsaSignature, + required TResult Function(PkOrF key) schnorrSignature, + required TResult Function(String hash) sha256Preimage, + required TResult Function(String hash) hash256Preimage, + required TResult Function(String hash) ripemd160Preimage, + required TResult Function(String hash) hash160Preimage, + required TResult Function(LockTime value) absoluteTimelock, + required TResult Function(int value) relativeTimelock, + required TResult Function(List keys, BigInt threshold) multisig, + required TResult Function(List items, BigInt threshold) thresh, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PkOrF key)? ecdsaSignature, + TResult? Function(PkOrF key)? schnorrSignature, + TResult? Function(String hash)? sha256Preimage, + TResult? Function(String hash)? hash256Preimage, + TResult? Function(String hash)? ripemd160Preimage, + TResult? Function(String hash)? hash160Preimage, + TResult? Function(LockTime value)? absoluteTimelock, + TResult? Function(int value)? relativeTimelock, + TResult? Function(List keys, BigInt threshold)? multisig, + TResult? Function(List items, BigInt threshold)? thresh, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PkOrF key)? ecdsaSignature, + TResult Function(PkOrF key)? schnorrSignature, + TResult Function(String hash)? sha256Preimage, + TResult Function(String hash)? hash256Preimage, + TResult Function(String hash)? ripemd160Preimage, + TResult Function(String hash)? hash160Preimage, + TResult Function(LockTime value)? absoluteTimelock, + TResult Function(int value)? relativeTimelock, + TResult Function(List keys, BigInt threshold)? multisig, + TResult Function(List items, BigInt threshold)? thresh, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(SatisfiableItem_EcdsaSignature value) + ecdsaSignature, + required TResult Function(SatisfiableItem_SchnorrSignature value) + schnorrSignature, + required TResult Function(SatisfiableItem_Sha256Preimage value) + sha256Preimage, + required TResult Function(SatisfiableItem_Hash256Preimage value) + hash256Preimage, + required TResult Function(SatisfiableItem_Ripemd160Preimage value) + ripemd160Preimage, + required TResult Function(SatisfiableItem_Hash160Preimage value) + hash160Preimage, + required TResult Function(SatisfiableItem_AbsoluteTimelock value) + absoluteTimelock, + required TResult Function(SatisfiableItem_RelativeTimelock value) + relativeTimelock, + required TResult Function(SatisfiableItem_Multisig value) multisig, + required TResult Function(SatisfiableItem_Thresh value) thresh, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult? Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult? Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult? Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult? Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult? Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult? Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult? Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult? Function(SatisfiableItem_Multisig value)? multisig, + TResult? Function(SatisfiableItem_Thresh value)? thresh, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult Function(SatisfiableItem_Multisig value)? multisig, + TResult Function(SatisfiableItem_Thresh value)? thresh, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $SatisfiableItemCopyWith<$Res> { + factory $SatisfiableItemCopyWith( + SatisfiableItem value, $Res Function(SatisfiableItem) then) = + _$SatisfiableItemCopyWithImpl<$Res, SatisfiableItem>; +} + +/// @nodoc +class _$SatisfiableItemCopyWithImpl<$Res, $Val extends SatisfiableItem> + implements $SatisfiableItemCopyWith<$Res> { + _$SatisfiableItemCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$SatisfiableItem_EcdsaSignatureImplCopyWith<$Res> { + factory _$$SatisfiableItem_EcdsaSignatureImplCopyWith( + _$SatisfiableItem_EcdsaSignatureImpl value, + $Res Function(_$SatisfiableItem_EcdsaSignatureImpl) then) = + __$$SatisfiableItem_EcdsaSignatureImplCopyWithImpl<$Res>; + @useResult + $Res call({PkOrF key}); + + $PkOrFCopyWith<$Res> get key; +} + +/// @nodoc +class __$$SatisfiableItem_EcdsaSignatureImplCopyWithImpl<$Res> + extends _$SatisfiableItemCopyWithImpl<$Res, + _$SatisfiableItem_EcdsaSignatureImpl> + implements _$$SatisfiableItem_EcdsaSignatureImplCopyWith<$Res> { + __$$SatisfiableItem_EcdsaSignatureImplCopyWithImpl( + _$SatisfiableItem_EcdsaSignatureImpl _value, + $Res Function(_$SatisfiableItem_EcdsaSignatureImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? key = null, + }) { + return _then(_$SatisfiableItem_EcdsaSignatureImpl( + key: null == key + ? _value.key + : key // ignore: cast_nullable_to_non_nullable + as PkOrF, + )); + } + + @override + @pragma('vm:prefer-inline') + $PkOrFCopyWith<$Res> get key { + return $PkOrFCopyWith<$Res>(_value.key, (value) { + return _then(_value.copyWith(key: value)); + }); + } +} + +/// @nodoc + +class _$SatisfiableItem_EcdsaSignatureImpl + extends SatisfiableItem_EcdsaSignature { + const _$SatisfiableItem_EcdsaSignatureImpl({required this.key}) : super._(); + + @override + final PkOrF key; + + @override + String toString() { + return 'SatisfiableItem.ecdsaSignature(key: $key)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SatisfiableItem_EcdsaSignatureImpl && + (identical(other.key, key) || other.key == key)); + } + + @override + int get hashCode => Object.hash(runtimeType, key); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SatisfiableItem_EcdsaSignatureImplCopyWith< + _$SatisfiableItem_EcdsaSignatureImpl> + get copyWith => __$$SatisfiableItem_EcdsaSignatureImplCopyWithImpl< + _$SatisfiableItem_EcdsaSignatureImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PkOrF key) ecdsaSignature, + required TResult Function(PkOrF key) schnorrSignature, + required TResult Function(String hash) sha256Preimage, + required TResult Function(String hash) hash256Preimage, + required TResult Function(String hash) ripemd160Preimage, + required TResult Function(String hash) hash160Preimage, + required TResult Function(LockTime value) absoluteTimelock, + required TResult Function(int value) relativeTimelock, + required TResult Function(List keys, BigInt threshold) multisig, + required TResult Function(List items, BigInt threshold) thresh, + }) { + return ecdsaSignature(key); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PkOrF key)? ecdsaSignature, + TResult? Function(PkOrF key)? schnorrSignature, + TResult? Function(String hash)? sha256Preimage, + TResult? Function(String hash)? hash256Preimage, + TResult? Function(String hash)? ripemd160Preimage, + TResult? Function(String hash)? hash160Preimage, + TResult? Function(LockTime value)? absoluteTimelock, + TResult? Function(int value)? relativeTimelock, + TResult? Function(List keys, BigInt threshold)? multisig, + TResult? Function(List items, BigInt threshold)? thresh, + }) { + return ecdsaSignature?.call(key); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PkOrF key)? ecdsaSignature, + TResult Function(PkOrF key)? schnorrSignature, + TResult Function(String hash)? sha256Preimage, + TResult Function(String hash)? hash256Preimage, + TResult Function(String hash)? ripemd160Preimage, + TResult Function(String hash)? hash160Preimage, + TResult Function(LockTime value)? absoluteTimelock, + TResult Function(int value)? relativeTimelock, + TResult Function(List keys, BigInt threshold)? multisig, + TResult Function(List items, BigInt threshold)? thresh, + required TResult orElse(), + }) { + if (ecdsaSignature != null) { + return ecdsaSignature(key); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SatisfiableItem_EcdsaSignature value) + ecdsaSignature, + required TResult Function(SatisfiableItem_SchnorrSignature value) + schnorrSignature, + required TResult Function(SatisfiableItem_Sha256Preimage value) + sha256Preimage, + required TResult Function(SatisfiableItem_Hash256Preimage value) + hash256Preimage, + required TResult Function(SatisfiableItem_Ripemd160Preimage value) + ripemd160Preimage, + required TResult Function(SatisfiableItem_Hash160Preimage value) + hash160Preimage, + required TResult Function(SatisfiableItem_AbsoluteTimelock value) + absoluteTimelock, + required TResult Function(SatisfiableItem_RelativeTimelock value) + relativeTimelock, + required TResult Function(SatisfiableItem_Multisig value) multisig, + required TResult Function(SatisfiableItem_Thresh value) thresh, + }) { + return ecdsaSignature(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult? Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult? Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult? Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult? Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult? Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult? Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult? Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult? Function(SatisfiableItem_Multisig value)? multisig, + TResult? Function(SatisfiableItem_Thresh value)? thresh, + }) { + return ecdsaSignature?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult Function(SatisfiableItem_Multisig value)? multisig, + TResult Function(SatisfiableItem_Thresh value)? thresh, + required TResult orElse(), + }) { + if (ecdsaSignature != null) { + return ecdsaSignature(this); + } + return orElse(); + } +} + +abstract class SatisfiableItem_EcdsaSignature extends SatisfiableItem { + const factory SatisfiableItem_EcdsaSignature({required final PkOrF key}) = + _$SatisfiableItem_EcdsaSignatureImpl; + const SatisfiableItem_EcdsaSignature._() : super._(); + + PkOrF get key; + @JsonKey(ignore: true) + _$$SatisfiableItem_EcdsaSignatureImplCopyWith< + _$SatisfiableItem_EcdsaSignatureImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SatisfiableItem_SchnorrSignatureImplCopyWith<$Res> { + factory _$$SatisfiableItem_SchnorrSignatureImplCopyWith( + _$SatisfiableItem_SchnorrSignatureImpl value, + $Res Function(_$SatisfiableItem_SchnorrSignatureImpl) then) = + __$$SatisfiableItem_SchnorrSignatureImplCopyWithImpl<$Res>; + @useResult + $Res call({PkOrF key}); + + $PkOrFCopyWith<$Res> get key; +} + +/// @nodoc +class __$$SatisfiableItem_SchnorrSignatureImplCopyWithImpl<$Res> + extends _$SatisfiableItemCopyWithImpl<$Res, + _$SatisfiableItem_SchnorrSignatureImpl> + implements _$$SatisfiableItem_SchnorrSignatureImplCopyWith<$Res> { + __$$SatisfiableItem_SchnorrSignatureImplCopyWithImpl( + _$SatisfiableItem_SchnorrSignatureImpl _value, + $Res Function(_$SatisfiableItem_SchnorrSignatureImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? key = null, + }) { + return _then(_$SatisfiableItem_SchnorrSignatureImpl( + key: null == key + ? _value.key + : key // ignore: cast_nullable_to_non_nullable + as PkOrF, + )); + } + + @override + @pragma('vm:prefer-inline') + $PkOrFCopyWith<$Res> get key { + return $PkOrFCopyWith<$Res>(_value.key, (value) { + return _then(_value.copyWith(key: value)); + }); + } +} + +/// @nodoc + +class _$SatisfiableItem_SchnorrSignatureImpl + extends SatisfiableItem_SchnorrSignature { + const _$SatisfiableItem_SchnorrSignatureImpl({required this.key}) : super._(); + + @override + final PkOrF key; + + @override + String toString() { + return 'SatisfiableItem.schnorrSignature(key: $key)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SatisfiableItem_SchnorrSignatureImpl && + (identical(other.key, key) || other.key == key)); + } + + @override + int get hashCode => Object.hash(runtimeType, key); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SatisfiableItem_SchnorrSignatureImplCopyWith< + _$SatisfiableItem_SchnorrSignatureImpl> + get copyWith => __$$SatisfiableItem_SchnorrSignatureImplCopyWithImpl< + _$SatisfiableItem_SchnorrSignatureImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PkOrF key) ecdsaSignature, + required TResult Function(PkOrF key) schnorrSignature, + required TResult Function(String hash) sha256Preimage, + required TResult Function(String hash) hash256Preimage, + required TResult Function(String hash) ripemd160Preimage, + required TResult Function(String hash) hash160Preimage, + required TResult Function(LockTime value) absoluteTimelock, + required TResult Function(int value) relativeTimelock, + required TResult Function(List keys, BigInt threshold) multisig, + required TResult Function(List items, BigInt threshold) thresh, + }) { + return schnorrSignature(key); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PkOrF key)? ecdsaSignature, + TResult? Function(PkOrF key)? schnorrSignature, + TResult? Function(String hash)? sha256Preimage, + TResult? Function(String hash)? hash256Preimage, + TResult? Function(String hash)? ripemd160Preimage, + TResult? Function(String hash)? hash160Preimage, + TResult? Function(LockTime value)? absoluteTimelock, + TResult? Function(int value)? relativeTimelock, + TResult? Function(List keys, BigInt threshold)? multisig, + TResult? Function(List items, BigInt threshold)? thresh, + }) { + return schnorrSignature?.call(key); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PkOrF key)? ecdsaSignature, + TResult Function(PkOrF key)? schnorrSignature, + TResult Function(String hash)? sha256Preimage, + TResult Function(String hash)? hash256Preimage, + TResult Function(String hash)? ripemd160Preimage, + TResult Function(String hash)? hash160Preimage, + TResult Function(LockTime value)? absoluteTimelock, + TResult Function(int value)? relativeTimelock, + TResult Function(List keys, BigInt threshold)? multisig, + TResult Function(List items, BigInt threshold)? thresh, + required TResult orElse(), + }) { + if (schnorrSignature != null) { + return schnorrSignature(key); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SatisfiableItem_EcdsaSignature value) + ecdsaSignature, + required TResult Function(SatisfiableItem_SchnorrSignature value) + schnorrSignature, + required TResult Function(SatisfiableItem_Sha256Preimage value) + sha256Preimage, + required TResult Function(SatisfiableItem_Hash256Preimage value) + hash256Preimage, + required TResult Function(SatisfiableItem_Ripemd160Preimage value) + ripemd160Preimage, + required TResult Function(SatisfiableItem_Hash160Preimage value) + hash160Preimage, + required TResult Function(SatisfiableItem_AbsoluteTimelock value) + absoluteTimelock, + required TResult Function(SatisfiableItem_RelativeTimelock value) + relativeTimelock, + required TResult Function(SatisfiableItem_Multisig value) multisig, + required TResult Function(SatisfiableItem_Thresh value) thresh, + }) { + return schnorrSignature(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult? Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult? Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult? Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult? Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult? Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult? Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult? Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult? Function(SatisfiableItem_Multisig value)? multisig, + TResult? Function(SatisfiableItem_Thresh value)? thresh, + }) { + return schnorrSignature?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult Function(SatisfiableItem_Multisig value)? multisig, + TResult Function(SatisfiableItem_Thresh value)? thresh, + required TResult orElse(), + }) { + if (schnorrSignature != null) { + return schnorrSignature(this); + } + return orElse(); + } +} + +abstract class SatisfiableItem_SchnorrSignature extends SatisfiableItem { + const factory SatisfiableItem_SchnorrSignature({required final PkOrF key}) = + _$SatisfiableItem_SchnorrSignatureImpl; + const SatisfiableItem_SchnorrSignature._() : super._(); + + PkOrF get key; + @JsonKey(ignore: true) + _$$SatisfiableItem_SchnorrSignatureImplCopyWith< + _$SatisfiableItem_SchnorrSignatureImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SatisfiableItem_Sha256PreimageImplCopyWith<$Res> { + factory _$$SatisfiableItem_Sha256PreimageImplCopyWith( + _$SatisfiableItem_Sha256PreimageImpl value, + $Res Function(_$SatisfiableItem_Sha256PreimageImpl) then) = + __$$SatisfiableItem_Sha256PreimageImplCopyWithImpl<$Res>; + @useResult + $Res call({String hash}); +} + +/// @nodoc +class __$$SatisfiableItem_Sha256PreimageImplCopyWithImpl<$Res> + extends _$SatisfiableItemCopyWithImpl<$Res, + _$SatisfiableItem_Sha256PreimageImpl> + implements _$$SatisfiableItem_Sha256PreimageImplCopyWith<$Res> { + __$$SatisfiableItem_Sha256PreimageImplCopyWithImpl( + _$SatisfiableItem_Sha256PreimageImpl _value, + $Res Function(_$SatisfiableItem_Sha256PreimageImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? hash = null, + }) { + return _then(_$SatisfiableItem_Sha256PreimageImpl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$SatisfiableItem_Sha256PreimageImpl + extends SatisfiableItem_Sha256Preimage { + const _$SatisfiableItem_Sha256PreimageImpl({required this.hash}) : super._(); + + @override + final String hash; + + @override + String toString() { + return 'SatisfiableItem.sha256Preimage(hash: $hash)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SatisfiableItem_Sha256PreimageImpl && + (identical(other.hash, hash) || other.hash == hash)); + } + + @override + int get hashCode => Object.hash(runtimeType, hash); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SatisfiableItem_Sha256PreimageImplCopyWith< + _$SatisfiableItem_Sha256PreimageImpl> + get copyWith => __$$SatisfiableItem_Sha256PreimageImplCopyWithImpl< + _$SatisfiableItem_Sha256PreimageImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PkOrF key) ecdsaSignature, + required TResult Function(PkOrF key) schnorrSignature, + required TResult Function(String hash) sha256Preimage, + required TResult Function(String hash) hash256Preimage, + required TResult Function(String hash) ripemd160Preimage, + required TResult Function(String hash) hash160Preimage, + required TResult Function(LockTime value) absoluteTimelock, + required TResult Function(int value) relativeTimelock, + required TResult Function(List keys, BigInt threshold) multisig, + required TResult Function(List items, BigInt threshold) thresh, + }) { + return sha256Preimage(hash); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PkOrF key)? ecdsaSignature, + TResult? Function(PkOrF key)? schnorrSignature, + TResult? Function(String hash)? sha256Preimage, + TResult? Function(String hash)? hash256Preimage, + TResult? Function(String hash)? ripemd160Preimage, + TResult? Function(String hash)? hash160Preimage, + TResult? Function(LockTime value)? absoluteTimelock, + TResult? Function(int value)? relativeTimelock, + TResult? Function(List keys, BigInt threshold)? multisig, + TResult? Function(List items, BigInt threshold)? thresh, + }) { + return sha256Preimage?.call(hash); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PkOrF key)? ecdsaSignature, + TResult Function(PkOrF key)? schnorrSignature, + TResult Function(String hash)? sha256Preimage, + TResult Function(String hash)? hash256Preimage, + TResult Function(String hash)? ripemd160Preimage, + TResult Function(String hash)? hash160Preimage, + TResult Function(LockTime value)? absoluteTimelock, + TResult Function(int value)? relativeTimelock, + TResult Function(List keys, BigInt threshold)? multisig, + TResult Function(List items, BigInt threshold)? thresh, + required TResult orElse(), + }) { + if (sha256Preimage != null) { + return sha256Preimage(hash); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SatisfiableItem_EcdsaSignature value) + ecdsaSignature, + required TResult Function(SatisfiableItem_SchnorrSignature value) + schnorrSignature, + required TResult Function(SatisfiableItem_Sha256Preimage value) + sha256Preimage, + required TResult Function(SatisfiableItem_Hash256Preimage value) + hash256Preimage, + required TResult Function(SatisfiableItem_Ripemd160Preimage value) + ripemd160Preimage, + required TResult Function(SatisfiableItem_Hash160Preimage value) + hash160Preimage, + required TResult Function(SatisfiableItem_AbsoluteTimelock value) + absoluteTimelock, + required TResult Function(SatisfiableItem_RelativeTimelock value) + relativeTimelock, + required TResult Function(SatisfiableItem_Multisig value) multisig, + required TResult Function(SatisfiableItem_Thresh value) thresh, + }) { + return sha256Preimage(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult? Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult? Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult? Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult? Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult? Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult? Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult? Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult? Function(SatisfiableItem_Multisig value)? multisig, + TResult? Function(SatisfiableItem_Thresh value)? thresh, + }) { + return sha256Preimage?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult Function(SatisfiableItem_Multisig value)? multisig, + TResult Function(SatisfiableItem_Thresh value)? thresh, + required TResult orElse(), + }) { + if (sha256Preimage != null) { + return sha256Preimage(this); + } + return orElse(); + } +} + +abstract class SatisfiableItem_Sha256Preimage extends SatisfiableItem { + const factory SatisfiableItem_Sha256Preimage({required final String hash}) = + _$SatisfiableItem_Sha256PreimageImpl; + const SatisfiableItem_Sha256Preimage._() : super._(); + + String get hash; + @JsonKey(ignore: true) + _$$SatisfiableItem_Sha256PreimageImplCopyWith< + _$SatisfiableItem_Sha256PreimageImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SatisfiableItem_Hash256PreimageImplCopyWith<$Res> { + factory _$$SatisfiableItem_Hash256PreimageImplCopyWith( + _$SatisfiableItem_Hash256PreimageImpl value, + $Res Function(_$SatisfiableItem_Hash256PreimageImpl) then) = + __$$SatisfiableItem_Hash256PreimageImplCopyWithImpl<$Res>; + @useResult + $Res call({String hash}); +} + +/// @nodoc +class __$$SatisfiableItem_Hash256PreimageImplCopyWithImpl<$Res> + extends _$SatisfiableItemCopyWithImpl<$Res, + _$SatisfiableItem_Hash256PreimageImpl> + implements _$$SatisfiableItem_Hash256PreimageImplCopyWith<$Res> { + __$$SatisfiableItem_Hash256PreimageImplCopyWithImpl( + _$SatisfiableItem_Hash256PreimageImpl _value, + $Res Function(_$SatisfiableItem_Hash256PreimageImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? hash = null, + }) { + return _then(_$SatisfiableItem_Hash256PreimageImpl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$SatisfiableItem_Hash256PreimageImpl + extends SatisfiableItem_Hash256Preimage { + const _$SatisfiableItem_Hash256PreimageImpl({required this.hash}) : super._(); + + @override + final String hash; + + @override + String toString() { + return 'SatisfiableItem.hash256Preimage(hash: $hash)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SatisfiableItem_Hash256PreimageImpl && + (identical(other.hash, hash) || other.hash == hash)); + } + + @override + int get hashCode => Object.hash(runtimeType, hash); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SatisfiableItem_Hash256PreimageImplCopyWith< + _$SatisfiableItem_Hash256PreimageImpl> + get copyWith => __$$SatisfiableItem_Hash256PreimageImplCopyWithImpl< + _$SatisfiableItem_Hash256PreimageImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PkOrF key) ecdsaSignature, + required TResult Function(PkOrF key) schnorrSignature, + required TResult Function(String hash) sha256Preimage, + required TResult Function(String hash) hash256Preimage, + required TResult Function(String hash) ripemd160Preimage, + required TResult Function(String hash) hash160Preimage, + required TResult Function(LockTime value) absoluteTimelock, + required TResult Function(int value) relativeTimelock, + required TResult Function(List keys, BigInt threshold) multisig, + required TResult Function(List items, BigInt threshold) thresh, + }) { + return hash256Preimage(hash); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PkOrF key)? ecdsaSignature, + TResult? Function(PkOrF key)? schnorrSignature, + TResult? Function(String hash)? sha256Preimage, + TResult? Function(String hash)? hash256Preimage, + TResult? Function(String hash)? ripemd160Preimage, + TResult? Function(String hash)? hash160Preimage, + TResult? Function(LockTime value)? absoluteTimelock, + TResult? Function(int value)? relativeTimelock, + TResult? Function(List keys, BigInt threshold)? multisig, + TResult? Function(List items, BigInt threshold)? thresh, + }) { + return hash256Preimage?.call(hash); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PkOrF key)? ecdsaSignature, + TResult Function(PkOrF key)? schnorrSignature, + TResult Function(String hash)? sha256Preimage, + TResult Function(String hash)? hash256Preimage, + TResult Function(String hash)? ripemd160Preimage, + TResult Function(String hash)? hash160Preimage, + TResult Function(LockTime value)? absoluteTimelock, + TResult Function(int value)? relativeTimelock, + TResult Function(List keys, BigInt threshold)? multisig, + TResult Function(List items, BigInt threshold)? thresh, + required TResult orElse(), + }) { + if (hash256Preimage != null) { + return hash256Preimage(hash); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SatisfiableItem_EcdsaSignature value) + ecdsaSignature, + required TResult Function(SatisfiableItem_SchnorrSignature value) + schnorrSignature, + required TResult Function(SatisfiableItem_Sha256Preimage value) + sha256Preimage, + required TResult Function(SatisfiableItem_Hash256Preimage value) + hash256Preimage, + required TResult Function(SatisfiableItem_Ripemd160Preimage value) + ripemd160Preimage, + required TResult Function(SatisfiableItem_Hash160Preimage value) + hash160Preimage, + required TResult Function(SatisfiableItem_AbsoluteTimelock value) + absoluteTimelock, + required TResult Function(SatisfiableItem_RelativeTimelock value) + relativeTimelock, + required TResult Function(SatisfiableItem_Multisig value) multisig, + required TResult Function(SatisfiableItem_Thresh value) thresh, + }) { + return hash256Preimage(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult? Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult? Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult? Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult? Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult? Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult? Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult? Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult? Function(SatisfiableItem_Multisig value)? multisig, + TResult? Function(SatisfiableItem_Thresh value)? thresh, + }) { + return hash256Preimage?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult Function(SatisfiableItem_Multisig value)? multisig, + TResult Function(SatisfiableItem_Thresh value)? thresh, + required TResult orElse(), + }) { + if (hash256Preimage != null) { + return hash256Preimage(this); + } + return orElse(); + } +} + +abstract class SatisfiableItem_Hash256Preimage extends SatisfiableItem { + const factory SatisfiableItem_Hash256Preimage({required final String hash}) = + _$SatisfiableItem_Hash256PreimageImpl; + const SatisfiableItem_Hash256Preimage._() : super._(); + + String get hash; + @JsonKey(ignore: true) + _$$SatisfiableItem_Hash256PreimageImplCopyWith< + _$SatisfiableItem_Hash256PreimageImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SatisfiableItem_Ripemd160PreimageImplCopyWith<$Res> { + factory _$$SatisfiableItem_Ripemd160PreimageImplCopyWith( + _$SatisfiableItem_Ripemd160PreimageImpl value, + $Res Function(_$SatisfiableItem_Ripemd160PreimageImpl) then) = + __$$SatisfiableItem_Ripemd160PreimageImplCopyWithImpl<$Res>; + @useResult + $Res call({String hash}); +} + +/// @nodoc +class __$$SatisfiableItem_Ripemd160PreimageImplCopyWithImpl<$Res> + extends _$SatisfiableItemCopyWithImpl<$Res, + _$SatisfiableItem_Ripemd160PreimageImpl> + implements _$$SatisfiableItem_Ripemd160PreimageImplCopyWith<$Res> { + __$$SatisfiableItem_Ripemd160PreimageImplCopyWithImpl( + _$SatisfiableItem_Ripemd160PreimageImpl _value, + $Res Function(_$SatisfiableItem_Ripemd160PreimageImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? hash = null, + }) { + return _then(_$SatisfiableItem_Ripemd160PreimageImpl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$SatisfiableItem_Ripemd160PreimageImpl + extends SatisfiableItem_Ripemd160Preimage { + const _$SatisfiableItem_Ripemd160PreimageImpl({required this.hash}) + : super._(); + + @override + final String hash; + + @override + String toString() { + return 'SatisfiableItem.ripemd160Preimage(hash: $hash)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SatisfiableItem_Ripemd160PreimageImpl && + (identical(other.hash, hash) || other.hash == hash)); + } + + @override + int get hashCode => Object.hash(runtimeType, hash); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SatisfiableItem_Ripemd160PreimageImplCopyWith< + _$SatisfiableItem_Ripemd160PreimageImpl> + get copyWith => __$$SatisfiableItem_Ripemd160PreimageImplCopyWithImpl< + _$SatisfiableItem_Ripemd160PreimageImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PkOrF key) ecdsaSignature, + required TResult Function(PkOrF key) schnorrSignature, + required TResult Function(String hash) sha256Preimage, + required TResult Function(String hash) hash256Preimage, + required TResult Function(String hash) ripemd160Preimage, + required TResult Function(String hash) hash160Preimage, + required TResult Function(LockTime value) absoluteTimelock, + required TResult Function(int value) relativeTimelock, + required TResult Function(List keys, BigInt threshold) multisig, + required TResult Function(List items, BigInt threshold) thresh, + }) { + return ripemd160Preimage(hash); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PkOrF key)? ecdsaSignature, + TResult? Function(PkOrF key)? schnorrSignature, + TResult? Function(String hash)? sha256Preimage, + TResult? Function(String hash)? hash256Preimage, + TResult? Function(String hash)? ripemd160Preimage, + TResult? Function(String hash)? hash160Preimage, + TResult? Function(LockTime value)? absoluteTimelock, + TResult? Function(int value)? relativeTimelock, + TResult? Function(List keys, BigInt threshold)? multisig, + TResult? Function(List items, BigInt threshold)? thresh, + }) { + return ripemd160Preimage?.call(hash); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PkOrF key)? ecdsaSignature, + TResult Function(PkOrF key)? schnorrSignature, + TResult Function(String hash)? sha256Preimage, + TResult Function(String hash)? hash256Preimage, + TResult Function(String hash)? ripemd160Preimage, + TResult Function(String hash)? hash160Preimage, + TResult Function(LockTime value)? absoluteTimelock, + TResult Function(int value)? relativeTimelock, + TResult Function(List keys, BigInt threshold)? multisig, + TResult Function(List items, BigInt threshold)? thresh, + required TResult orElse(), + }) { + if (ripemd160Preimage != null) { + return ripemd160Preimage(hash); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SatisfiableItem_EcdsaSignature value) + ecdsaSignature, + required TResult Function(SatisfiableItem_SchnorrSignature value) + schnorrSignature, + required TResult Function(SatisfiableItem_Sha256Preimage value) + sha256Preimage, + required TResult Function(SatisfiableItem_Hash256Preimage value) + hash256Preimage, + required TResult Function(SatisfiableItem_Ripemd160Preimage value) + ripemd160Preimage, + required TResult Function(SatisfiableItem_Hash160Preimage value) + hash160Preimage, + required TResult Function(SatisfiableItem_AbsoluteTimelock value) + absoluteTimelock, + required TResult Function(SatisfiableItem_RelativeTimelock value) + relativeTimelock, + required TResult Function(SatisfiableItem_Multisig value) multisig, + required TResult Function(SatisfiableItem_Thresh value) thresh, + }) { + return ripemd160Preimage(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult? Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult? Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult? Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult? Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult? Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult? Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult? Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult? Function(SatisfiableItem_Multisig value)? multisig, + TResult? Function(SatisfiableItem_Thresh value)? thresh, + }) { + return ripemd160Preimage?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult Function(SatisfiableItem_Multisig value)? multisig, + TResult Function(SatisfiableItem_Thresh value)? thresh, + required TResult orElse(), + }) { + if (ripemd160Preimage != null) { + return ripemd160Preimage(this); + } + return orElse(); + } +} + +abstract class SatisfiableItem_Ripemd160Preimage extends SatisfiableItem { + const factory SatisfiableItem_Ripemd160Preimage( + {required final String hash}) = _$SatisfiableItem_Ripemd160PreimageImpl; + const SatisfiableItem_Ripemd160Preimage._() : super._(); + + String get hash; + @JsonKey(ignore: true) + _$$SatisfiableItem_Ripemd160PreimageImplCopyWith< + _$SatisfiableItem_Ripemd160PreimageImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SatisfiableItem_Hash160PreimageImplCopyWith<$Res> { + factory _$$SatisfiableItem_Hash160PreimageImplCopyWith( + _$SatisfiableItem_Hash160PreimageImpl value, + $Res Function(_$SatisfiableItem_Hash160PreimageImpl) then) = + __$$SatisfiableItem_Hash160PreimageImplCopyWithImpl<$Res>; + @useResult + $Res call({String hash}); +} + +/// @nodoc +class __$$SatisfiableItem_Hash160PreimageImplCopyWithImpl<$Res> + extends _$SatisfiableItemCopyWithImpl<$Res, + _$SatisfiableItem_Hash160PreimageImpl> + implements _$$SatisfiableItem_Hash160PreimageImplCopyWith<$Res> { + __$$SatisfiableItem_Hash160PreimageImplCopyWithImpl( + _$SatisfiableItem_Hash160PreimageImpl _value, + $Res Function(_$SatisfiableItem_Hash160PreimageImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? hash = null, + }) { + return _then(_$SatisfiableItem_Hash160PreimageImpl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$SatisfiableItem_Hash160PreimageImpl + extends SatisfiableItem_Hash160Preimage { + const _$SatisfiableItem_Hash160PreimageImpl({required this.hash}) : super._(); + + @override + final String hash; + + @override + String toString() { + return 'SatisfiableItem.hash160Preimage(hash: $hash)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SatisfiableItem_Hash160PreimageImpl && + (identical(other.hash, hash) || other.hash == hash)); + } + + @override + int get hashCode => Object.hash(runtimeType, hash); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SatisfiableItem_Hash160PreimageImplCopyWith< + _$SatisfiableItem_Hash160PreimageImpl> + get copyWith => __$$SatisfiableItem_Hash160PreimageImplCopyWithImpl< + _$SatisfiableItem_Hash160PreimageImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PkOrF key) ecdsaSignature, + required TResult Function(PkOrF key) schnorrSignature, + required TResult Function(String hash) sha256Preimage, + required TResult Function(String hash) hash256Preimage, + required TResult Function(String hash) ripemd160Preimage, + required TResult Function(String hash) hash160Preimage, + required TResult Function(LockTime value) absoluteTimelock, + required TResult Function(int value) relativeTimelock, + required TResult Function(List keys, BigInt threshold) multisig, + required TResult Function(List items, BigInt threshold) thresh, + }) { + return hash160Preimage(hash); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PkOrF key)? ecdsaSignature, + TResult? Function(PkOrF key)? schnorrSignature, + TResult? Function(String hash)? sha256Preimage, + TResult? Function(String hash)? hash256Preimage, + TResult? Function(String hash)? ripemd160Preimage, + TResult? Function(String hash)? hash160Preimage, + TResult? Function(LockTime value)? absoluteTimelock, + TResult? Function(int value)? relativeTimelock, + TResult? Function(List keys, BigInt threshold)? multisig, + TResult? Function(List items, BigInt threshold)? thresh, + }) { + return hash160Preimage?.call(hash); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PkOrF key)? ecdsaSignature, + TResult Function(PkOrF key)? schnorrSignature, + TResult Function(String hash)? sha256Preimage, + TResult Function(String hash)? hash256Preimage, + TResult Function(String hash)? ripemd160Preimage, + TResult Function(String hash)? hash160Preimage, + TResult Function(LockTime value)? absoluteTimelock, + TResult Function(int value)? relativeTimelock, + TResult Function(List keys, BigInt threshold)? multisig, + TResult Function(List items, BigInt threshold)? thresh, + required TResult orElse(), + }) { + if (hash160Preimage != null) { + return hash160Preimage(hash); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SatisfiableItem_EcdsaSignature value) + ecdsaSignature, + required TResult Function(SatisfiableItem_SchnorrSignature value) + schnorrSignature, + required TResult Function(SatisfiableItem_Sha256Preimage value) + sha256Preimage, + required TResult Function(SatisfiableItem_Hash256Preimage value) + hash256Preimage, + required TResult Function(SatisfiableItem_Ripemd160Preimage value) + ripemd160Preimage, + required TResult Function(SatisfiableItem_Hash160Preimage value) + hash160Preimage, + required TResult Function(SatisfiableItem_AbsoluteTimelock value) + absoluteTimelock, + required TResult Function(SatisfiableItem_RelativeTimelock value) + relativeTimelock, + required TResult Function(SatisfiableItem_Multisig value) multisig, + required TResult Function(SatisfiableItem_Thresh value) thresh, + }) { + return hash160Preimage(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult? Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult? Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult? Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult? Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult? Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult? Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult? Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult? Function(SatisfiableItem_Multisig value)? multisig, + TResult? Function(SatisfiableItem_Thresh value)? thresh, + }) { + return hash160Preimage?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult Function(SatisfiableItem_Multisig value)? multisig, + TResult Function(SatisfiableItem_Thresh value)? thresh, + required TResult orElse(), + }) { + if (hash160Preimage != null) { + return hash160Preimage(this); + } + return orElse(); + } +} + +abstract class SatisfiableItem_Hash160Preimage extends SatisfiableItem { + const factory SatisfiableItem_Hash160Preimage({required final String hash}) = + _$SatisfiableItem_Hash160PreimageImpl; + const SatisfiableItem_Hash160Preimage._() : super._(); + + String get hash; + @JsonKey(ignore: true) + _$$SatisfiableItem_Hash160PreimageImplCopyWith< + _$SatisfiableItem_Hash160PreimageImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SatisfiableItem_AbsoluteTimelockImplCopyWith<$Res> { + factory _$$SatisfiableItem_AbsoluteTimelockImplCopyWith( + _$SatisfiableItem_AbsoluteTimelockImpl value, + $Res Function(_$SatisfiableItem_AbsoluteTimelockImpl) then) = + __$$SatisfiableItem_AbsoluteTimelockImplCopyWithImpl<$Res>; + @useResult + $Res call({LockTime value}); + + $LockTimeCopyWith<$Res> get value; +} + +/// @nodoc +class __$$SatisfiableItem_AbsoluteTimelockImplCopyWithImpl<$Res> + extends _$SatisfiableItemCopyWithImpl<$Res, + _$SatisfiableItem_AbsoluteTimelockImpl> + implements _$$SatisfiableItem_AbsoluteTimelockImplCopyWith<$Res> { + __$$SatisfiableItem_AbsoluteTimelockImplCopyWithImpl( + _$SatisfiableItem_AbsoluteTimelockImpl _value, + $Res Function(_$SatisfiableItem_AbsoluteTimelockImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? value = null, + }) { + return _then(_$SatisfiableItem_AbsoluteTimelockImpl( + value: null == value + ? _value.value + : value // ignore: cast_nullable_to_non_nullable + as LockTime, + )); + } + + @override + @pragma('vm:prefer-inline') + $LockTimeCopyWith<$Res> get value { + return $LockTimeCopyWith<$Res>(_value.value, (value) { + return _then(_value.copyWith(value: value)); + }); + } +} + +/// @nodoc + +class _$SatisfiableItem_AbsoluteTimelockImpl + extends SatisfiableItem_AbsoluteTimelock { + const _$SatisfiableItem_AbsoluteTimelockImpl({required this.value}) + : super._(); + + @override + final LockTime value; + + @override + String toString() { + return 'SatisfiableItem.absoluteTimelock(value: $value)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SatisfiableItem_AbsoluteTimelockImpl && + (identical(other.value, value) || other.value == value)); + } + + @override + int get hashCode => Object.hash(runtimeType, value); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SatisfiableItem_AbsoluteTimelockImplCopyWith< + _$SatisfiableItem_AbsoluteTimelockImpl> + get copyWith => __$$SatisfiableItem_AbsoluteTimelockImplCopyWithImpl< + _$SatisfiableItem_AbsoluteTimelockImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PkOrF key) ecdsaSignature, + required TResult Function(PkOrF key) schnorrSignature, + required TResult Function(String hash) sha256Preimage, + required TResult Function(String hash) hash256Preimage, + required TResult Function(String hash) ripemd160Preimage, + required TResult Function(String hash) hash160Preimage, + required TResult Function(LockTime value) absoluteTimelock, + required TResult Function(int value) relativeTimelock, + required TResult Function(List keys, BigInt threshold) multisig, + required TResult Function(List items, BigInt threshold) thresh, + }) { + return absoluteTimelock(value); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PkOrF key)? ecdsaSignature, + TResult? Function(PkOrF key)? schnorrSignature, + TResult? Function(String hash)? sha256Preimage, + TResult? Function(String hash)? hash256Preimage, + TResult? Function(String hash)? ripemd160Preimage, + TResult? Function(String hash)? hash160Preimage, + TResult? Function(LockTime value)? absoluteTimelock, + TResult? Function(int value)? relativeTimelock, + TResult? Function(List keys, BigInt threshold)? multisig, + TResult? Function(List items, BigInt threshold)? thresh, + }) { + return absoluteTimelock?.call(value); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PkOrF key)? ecdsaSignature, + TResult Function(PkOrF key)? schnorrSignature, + TResult Function(String hash)? sha256Preimage, + TResult Function(String hash)? hash256Preimage, + TResult Function(String hash)? ripemd160Preimage, + TResult Function(String hash)? hash160Preimage, + TResult Function(LockTime value)? absoluteTimelock, + TResult Function(int value)? relativeTimelock, + TResult Function(List keys, BigInt threshold)? multisig, + TResult Function(List items, BigInt threshold)? thresh, + required TResult orElse(), + }) { + if (absoluteTimelock != null) { + return absoluteTimelock(value); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SatisfiableItem_EcdsaSignature value) + ecdsaSignature, + required TResult Function(SatisfiableItem_SchnorrSignature value) + schnorrSignature, + required TResult Function(SatisfiableItem_Sha256Preimage value) + sha256Preimage, + required TResult Function(SatisfiableItem_Hash256Preimage value) + hash256Preimage, + required TResult Function(SatisfiableItem_Ripemd160Preimage value) + ripemd160Preimage, + required TResult Function(SatisfiableItem_Hash160Preimage value) + hash160Preimage, + required TResult Function(SatisfiableItem_AbsoluteTimelock value) + absoluteTimelock, + required TResult Function(SatisfiableItem_RelativeTimelock value) + relativeTimelock, + required TResult Function(SatisfiableItem_Multisig value) multisig, + required TResult Function(SatisfiableItem_Thresh value) thresh, + }) { + return absoluteTimelock(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult? Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult? Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult? Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult? Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult? Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult? Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult? Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult? Function(SatisfiableItem_Multisig value)? multisig, + TResult? Function(SatisfiableItem_Thresh value)? thresh, + }) { + return absoluteTimelock?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult Function(SatisfiableItem_Multisig value)? multisig, + TResult Function(SatisfiableItem_Thresh value)? thresh, + required TResult orElse(), + }) { + if (absoluteTimelock != null) { + return absoluteTimelock(this); + } + return orElse(); + } +} + +abstract class SatisfiableItem_AbsoluteTimelock extends SatisfiableItem { + const factory SatisfiableItem_AbsoluteTimelock( + {required final LockTime value}) = _$SatisfiableItem_AbsoluteTimelockImpl; + const SatisfiableItem_AbsoluteTimelock._() : super._(); + + LockTime get value; + @JsonKey(ignore: true) + _$$SatisfiableItem_AbsoluteTimelockImplCopyWith< + _$SatisfiableItem_AbsoluteTimelockImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SatisfiableItem_RelativeTimelockImplCopyWith<$Res> { + factory _$$SatisfiableItem_RelativeTimelockImplCopyWith( + _$SatisfiableItem_RelativeTimelockImpl value, + $Res Function(_$SatisfiableItem_RelativeTimelockImpl) then) = + __$$SatisfiableItem_RelativeTimelockImplCopyWithImpl<$Res>; + @useResult + $Res call({int value}); +} + +/// @nodoc +class __$$SatisfiableItem_RelativeTimelockImplCopyWithImpl<$Res> + extends _$SatisfiableItemCopyWithImpl<$Res, + _$SatisfiableItem_RelativeTimelockImpl> + implements _$$SatisfiableItem_RelativeTimelockImplCopyWith<$Res> { + __$$SatisfiableItem_RelativeTimelockImplCopyWithImpl( + _$SatisfiableItem_RelativeTimelockImpl _value, + $Res Function(_$SatisfiableItem_RelativeTimelockImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? value = null, + }) { + return _then(_$SatisfiableItem_RelativeTimelockImpl( + value: null == value + ? _value.value + : value // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc + +class _$SatisfiableItem_RelativeTimelockImpl + extends SatisfiableItem_RelativeTimelock { + const _$SatisfiableItem_RelativeTimelockImpl({required this.value}) + : super._(); + + @override + final int value; + + @override + String toString() { + return 'SatisfiableItem.relativeTimelock(value: $value)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SatisfiableItem_RelativeTimelockImpl && + (identical(other.value, value) || other.value == value)); + } + + @override + int get hashCode => Object.hash(runtimeType, value); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SatisfiableItem_RelativeTimelockImplCopyWith< + _$SatisfiableItem_RelativeTimelockImpl> + get copyWith => __$$SatisfiableItem_RelativeTimelockImplCopyWithImpl< + _$SatisfiableItem_RelativeTimelockImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PkOrF key) ecdsaSignature, + required TResult Function(PkOrF key) schnorrSignature, + required TResult Function(String hash) sha256Preimage, + required TResult Function(String hash) hash256Preimage, + required TResult Function(String hash) ripemd160Preimage, + required TResult Function(String hash) hash160Preimage, + required TResult Function(LockTime value) absoluteTimelock, + required TResult Function(int value) relativeTimelock, + required TResult Function(List keys, BigInt threshold) multisig, + required TResult Function(List items, BigInt threshold) thresh, + }) { + return relativeTimelock(value); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PkOrF key)? ecdsaSignature, + TResult? Function(PkOrF key)? schnorrSignature, + TResult? Function(String hash)? sha256Preimage, + TResult? Function(String hash)? hash256Preimage, + TResult? Function(String hash)? ripemd160Preimage, + TResult? Function(String hash)? hash160Preimage, + TResult? Function(LockTime value)? absoluteTimelock, + TResult? Function(int value)? relativeTimelock, + TResult? Function(List keys, BigInt threshold)? multisig, + TResult? Function(List items, BigInt threshold)? thresh, + }) { + return relativeTimelock?.call(value); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PkOrF key)? ecdsaSignature, + TResult Function(PkOrF key)? schnorrSignature, + TResult Function(String hash)? sha256Preimage, + TResult Function(String hash)? hash256Preimage, + TResult Function(String hash)? ripemd160Preimage, + TResult Function(String hash)? hash160Preimage, + TResult Function(LockTime value)? absoluteTimelock, + TResult Function(int value)? relativeTimelock, + TResult Function(List keys, BigInt threshold)? multisig, + TResult Function(List items, BigInt threshold)? thresh, + required TResult orElse(), + }) { + if (relativeTimelock != null) { + return relativeTimelock(value); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SatisfiableItem_EcdsaSignature value) + ecdsaSignature, + required TResult Function(SatisfiableItem_SchnorrSignature value) + schnorrSignature, + required TResult Function(SatisfiableItem_Sha256Preimage value) + sha256Preimage, + required TResult Function(SatisfiableItem_Hash256Preimage value) + hash256Preimage, + required TResult Function(SatisfiableItem_Ripemd160Preimage value) + ripemd160Preimage, + required TResult Function(SatisfiableItem_Hash160Preimage value) + hash160Preimage, + required TResult Function(SatisfiableItem_AbsoluteTimelock value) + absoluteTimelock, + required TResult Function(SatisfiableItem_RelativeTimelock value) + relativeTimelock, + required TResult Function(SatisfiableItem_Multisig value) multisig, + required TResult Function(SatisfiableItem_Thresh value) thresh, + }) { + return relativeTimelock(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult? Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult? Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult? Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult? Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult? Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult? Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult? Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult? Function(SatisfiableItem_Multisig value)? multisig, + TResult? Function(SatisfiableItem_Thresh value)? thresh, + }) { + return relativeTimelock?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult Function(SatisfiableItem_Multisig value)? multisig, + TResult Function(SatisfiableItem_Thresh value)? thresh, + required TResult orElse(), + }) { + if (relativeTimelock != null) { + return relativeTimelock(this); + } + return orElse(); + } +} + +abstract class SatisfiableItem_RelativeTimelock extends SatisfiableItem { + const factory SatisfiableItem_RelativeTimelock({required final int value}) = + _$SatisfiableItem_RelativeTimelockImpl; + const SatisfiableItem_RelativeTimelock._() : super._(); + + int get value; + @JsonKey(ignore: true) + _$$SatisfiableItem_RelativeTimelockImplCopyWith< + _$SatisfiableItem_RelativeTimelockImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SatisfiableItem_MultisigImplCopyWith<$Res> { + factory _$$SatisfiableItem_MultisigImplCopyWith( + _$SatisfiableItem_MultisigImpl value, + $Res Function(_$SatisfiableItem_MultisigImpl) then) = + __$$SatisfiableItem_MultisigImplCopyWithImpl<$Res>; + @useResult + $Res call({List keys, BigInt threshold}); +} + +/// @nodoc +class __$$SatisfiableItem_MultisigImplCopyWithImpl<$Res> + extends _$SatisfiableItemCopyWithImpl<$Res, _$SatisfiableItem_MultisigImpl> + implements _$$SatisfiableItem_MultisigImplCopyWith<$Res> { + __$$SatisfiableItem_MultisigImplCopyWithImpl( + _$SatisfiableItem_MultisigImpl _value, + $Res Function(_$SatisfiableItem_MultisigImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? keys = null, + Object? threshold = null, + }) { + return _then(_$SatisfiableItem_MultisigImpl( + keys: null == keys + ? _value._keys + : keys // ignore: cast_nullable_to_non_nullable + as List, + threshold: null == threshold + ? _value.threshold + : threshold // ignore: cast_nullable_to_non_nullable + as BigInt, + )); + } +} + +/// @nodoc + +class _$SatisfiableItem_MultisigImpl extends SatisfiableItem_Multisig { + const _$SatisfiableItem_MultisigImpl( + {required final List keys, required this.threshold}) + : _keys = keys, + super._(); + + final List _keys; + @override + List get keys { + if (_keys is EqualUnmodifiableListView) return _keys; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_keys); + } + + @override + final BigInt threshold; + + @override + String toString() { + return 'SatisfiableItem.multisig(keys: $keys, threshold: $threshold)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SatisfiableItem_MultisigImpl && + const DeepCollectionEquality().equals(other._keys, _keys) && + (identical(other.threshold, threshold) || + other.threshold == threshold)); + } + + @override + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_keys), threshold); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SatisfiableItem_MultisigImplCopyWith<_$SatisfiableItem_MultisigImpl> + get copyWith => __$$SatisfiableItem_MultisigImplCopyWithImpl< + _$SatisfiableItem_MultisigImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PkOrF key) ecdsaSignature, + required TResult Function(PkOrF key) schnorrSignature, + required TResult Function(String hash) sha256Preimage, + required TResult Function(String hash) hash256Preimage, + required TResult Function(String hash) ripemd160Preimage, + required TResult Function(String hash) hash160Preimage, + required TResult Function(LockTime value) absoluteTimelock, + required TResult Function(int value) relativeTimelock, + required TResult Function(List keys, BigInt threshold) multisig, + required TResult Function(List items, BigInt threshold) thresh, + }) { + return multisig(keys, threshold); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PkOrF key)? ecdsaSignature, + TResult? Function(PkOrF key)? schnorrSignature, + TResult? Function(String hash)? sha256Preimage, + TResult? Function(String hash)? hash256Preimage, + TResult? Function(String hash)? ripemd160Preimage, + TResult? Function(String hash)? hash160Preimage, + TResult? Function(LockTime value)? absoluteTimelock, + TResult? Function(int value)? relativeTimelock, + TResult? Function(List keys, BigInt threshold)? multisig, + TResult? Function(List items, BigInt threshold)? thresh, + }) { + return multisig?.call(keys, threshold); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PkOrF key)? ecdsaSignature, + TResult Function(PkOrF key)? schnorrSignature, + TResult Function(String hash)? sha256Preimage, + TResult Function(String hash)? hash256Preimage, + TResult Function(String hash)? ripemd160Preimage, + TResult Function(String hash)? hash160Preimage, + TResult Function(LockTime value)? absoluteTimelock, + TResult Function(int value)? relativeTimelock, + TResult Function(List keys, BigInt threshold)? multisig, + TResult Function(List items, BigInt threshold)? thresh, + required TResult orElse(), + }) { + if (multisig != null) { + return multisig(keys, threshold); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SatisfiableItem_EcdsaSignature value) + ecdsaSignature, + required TResult Function(SatisfiableItem_SchnorrSignature value) + schnorrSignature, + required TResult Function(SatisfiableItem_Sha256Preimage value) + sha256Preimage, + required TResult Function(SatisfiableItem_Hash256Preimage value) + hash256Preimage, + required TResult Function(SatisfiableItem_Ripemd160Preimage value) + ripemd160Preimage, + required TResult Function(SatisfiableItem_Hash160Preimage value) + hash160Preimage, + required TResult Function(SatisfiableItem_AbsoluteTimelock value) + absoluteTimelock, + required TResult Function(SatisfiableItem_RelativeTimelock value) + relativeTimelock, + required TResult Function(SatisfiableItem_Multisig value) multisig, + required TResult Function(SatisfiableItem_Thresh value) thresh, + }) { + return multisig(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult? Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult? Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult? Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult? Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult? Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult? Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult? Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult? Function(SatisfiableItem_Multisig value)? multisig, + TResult? Function(SatisfiableItem_Thresh value)? thresh, + }) { + return multisig?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult Function(SatisfiableItem_Multisig value)? multisig, + TResult Function(SatisfiableItem_Thresh value)? thresh, + required TResult orElse(), + }) { + if (multisig != null) { + return multisig(this); + } + return orElse(); + } +} + +abstract class SatisfiableItem_Multisig extends SatisfiableItem { + const factory SatisfiableItem_Multisig( + {required final List keys, + required final BigInt threshold}) = _$SatisfiableItem_MultisigImpl; + const SatisfiableItem_Multisig._() : super._(); + + List get keys; + BigInt get threshold; + @JsonKey(ignore: true) + _$$SatisfiableItem_MultisigImplCopyWith<_$SatisfiableItem_MultisigImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SatisfiableItem_ThreshImplCopyWith<$Res> { + factory _$$SatisfiableItem_ThreshImplCopyWith( + _$SatisfiableItem_ThreshImpl value, + $Res Function(_$SatisfiableItem_ThreshImpl) then) = + __$$SatisfiableItem_ThreshImplCopyWithImpl<$Res>; + @useResult + $Res call({List items, BigInt threshold}); +} + +/// @nodoc +class __$$SatisfiableItem_ThreshImplCopyWithImpl<$Res> + extends _$SatisfiableItemCopyWithImpl<$Res, _$SatisfiableItem_ThreshImpl> + implements _$$SatisfiableItem_ThreshImplCopyWith<$Res> { + __$$SatisfiableItem_ThreshImplCopyWithImpl( + _$SatisfiableItem_ThreshImpl _value, + $Res Function(_$SatisfiableItem_ThreshImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? items = null, + Object? threshold = null, + }) { + return _then(_$SatisfiableItem_ThreshImpl( + items: null == items + ? _value._items + : items // ignore: cast_nullable_to_non_nullable + as List, + threshold: null == threshold + ? _value.threshold + : threshold // ignore: cast_nullable_to_non_nullable + as BigInt, + )); + } +} + +/// @nodoc + +class _$SatisfiableItem_ThreshImpl extends SatisfiableItem_Thresh { + const _$SatisfiableItem_ThreshImpl( + {required final List items, required this.threshold}) + : _items = items, + super._(); + + final List _items; + @override + List get items { + if (_items is EqualUnmodifiableListView) return _items; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_items); + } + + @override + final BigInt threshold; + + @override + String toString() { + return 'SatisfiableItem.thresh(items: $items, threshold: $threshold)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SatisfiableItem_ThreshImpl && + const DeepCollectionEquality().equals(other._items, _items) && + (identical(other.threshold, threshold) || + other.threshold == threshold)); + } + + @override + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_items), threshold); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SatisfiableItem_ThreshImplCopyWith<_$SatisfiableItem_ThreshImpl> + get copyWith => __$$SatisfiableItem_ThreshImplCopyWithImpl< + _$SatisfiableItem_ThreshImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PkOrF key) ecdsaSignature, + required TResult Function(PkOrF key) schnorrSignature, + required TResult Function(String hash) sha256Preimage, + required TResult Function(String hash) hash256Preimage, + required TResult Function(String hash) ripemd160Preimage, + required TResult Function(String hash) hash160Preimage, + required TResult Function(LockTime value) absoluteTimelock, + required TResult Function(int value) relativeTimelock, + required TResult Function(List keys, BigInt threshold) multisig, + required TResult Function(List items, BigInt threshold) thresh, + }) { + return thresh(items, threshold); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PkOrF key)? ecdsaSignature, + TResult? Function(PkOrF key)? schnorrSignature, + TResult? Function(String hash)? sha256Preimage, + TResult? Function(String hash)? hash256Preimage, + TResult? Function(String hash)? ripemd160Preimage, + TResult? Function(String hash)? hash160Preimage, + TResult? Function(LockTime value)? absoluteTimelock, + TResult? Function(int value)? relativeTimelock, + TResult? Function(List keys, BigInt threshold)? multisig, + TResult? Function(List items, BigInt threshold)? thresh, + }) { + return thresh?.call(items, threshold); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PkOrF key)? ecdsaSignature, + TResult Function(PkOrF key)? schnorrSignature, + TResult Function(String hash)? sha256Preimage, + TResult Function(String hash)? hash256Preimage, + TResult Function(String hash)? ripemd160Preimage, + TResult Function(String hash)? hash160Preimage, + TResult Function(LockTime value)? absoluteTimelock, + TResult Function(int value)? relativeTimelock, + TResult Function(List keys, BigInt threshold)? multisig, + TResult Function(List items, BigInt threshold)? thresh, + required TResult orElse(), + }) { + if (thresh != null) { + return thresh(items, threshold); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SatisfiableItem_EcdsaSignature value) + ecdsaSignature, + required TResult Function(SatisfiableItem_SchnorrSignature value) + schnorrSignature, + required TResult Function(SatisfiableItem_Sha256Preimage value) + sha256Preimage, + required TResult Function(SatisfiableItem_Hash256Preimage value) + hash256Preimage, + required TResult Function(SatisfiableItem_Ripemd160Preimage value) + ripemd160Preimage, + required TResult Function(SatisfiableItem_Hash160Preimage value) + hash160Preimage, + required TResult Function(SatisfiableItem_AbsoluteTimelock value) + absoluteTimelock, + required TResult Function(SatisfiableItem_RelativeTimelock value) + relativeTimelock, + required TResult Function(SatisfiableItem_Multisig value) multisig, + required TResult Function(SatisfiableItem_Thresh value) thresh, + }) { + return thresh(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult? Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult? Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult? Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult? Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult? Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult? Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult? Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult? Function(SatisfiableItem_Multisig value)? multisig, + TResult? Function(SatisfiableItem_Thresh value)? thresh, + }) { + return thresh?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SatisfiableItem_EcdsaSignature value)? ecdsaSignature, + TResult Function(SatisfiableItem_SchnorrSignature value)? schnorrSignature, + TResult Function(SatisfiableItem_Sha256Preimage value)? sha256Preimage, + TResult Function(SatisfiableItem_Hash256Preimage value)? hash256Preimage, + TResult Function(SatisfiableItem_Ripemd160Preimage value)? + ripemd160Preimage, + TResult Function(SatisfiableItem_Hash160Preimage value)? hash160Preimage, + TResult Function(SatisfiableItem_AbsoluteTimelock value)? absoluteTimelock, + TResult Function(SatisfiableItem_RelativeTimelock value)? relativeTimelock, + TResult Function(SatisfiableItem_Multisig value)? multisig, + TResult Function(SatisfiableItem_Thresh value)? thresh, + required TResult orElse(), + }) { + if (thresh != null) { + return thresh(this); + } + return orElse(); + } +} + +abstract class SatisfiableItem_Thresh extends SatisfiableItem { + const factory SatisfiableItem_Thresh( + {required final List items, + required final BigInt threshold}) = _$SatisfiableItem_ThreshImpl; + const SatisfiableItem_Thresh._() : super._(); + + List get items; + BigInt get threshold; + @JsonKey(ignore: true) + _$$SatisfiableItem_ThreshImplCopyWith<_$SatisfiableItem_ThreshImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/generated/api/wallet.dart b/lib/src/generated/api/wallet.dart index b518c8b8..f5e19dd4 100644 --- a/lib/src/generated/api/wallet.dart +++ b/lib/src/generated/api/wallet.dart @@ -42,6 +42,8 @@ Future<(BdkPsbt, TransactionDetails)> txBuilderFinish( required bool drainWallet, BdkScriptBuf? drainTo, RbfValue? rbf, + Map? internalPolicyPath, + Map? externalPolicyPath, required List data}) => core.instance.api.crateApiWalletTxBuilderFinish( wallet: wallet, @@ -56,6 +58,8 @@ Future<(BdkPsbt, TransactionDetails)> txBuilderFinish( drainWallet: drainWallet, drainTo: drainTo, rbf: rbf, + internalPolicyPath: internalPolicyPath, + externalPolicyPath: externalPolicyPath, data: data); class BdkWallet { @@ -140,6 +144,11 @@ class BdkWallet { network: network, databaseConfig: databaseConfig); + static BdkPolicy? policies( + {required BdkWallet ptr, required KeychainKind keychain}) => + core.instance.api + .crateApiWalletBdkWalletPolicies(ptr: ptr, keychain: keychain); + /// Sign a transaction with all the wallet's signers. This function returns an encapsulated bool that /// has the value true if the PSBT was finalized, or false otherwise. /// diff --git a/lib/src/generated/frb_generated.dart b/lib/src/generated/frb_generated.dart index cd85e554..0c5ea9d6 100644 --- a/lib/src/generated/frb_generated.dart +++ b/lib/src/generated/frb_generated.dart @@ -62,7 +62,7 @@ class core extends BaseEntrypoint { String get codegenVersion => '2.0.0'; @override - int get rustContentHash => 1897842111; + int get rustContentHash => -321771070; static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig( @@ -232,6 +232,18 @@ abstract class coreApi extends BaseApi { String crateApiTypesBdkAddressToQrUri({required BdkAddress that}); + String crateApiTypesBdkPolicyAsString({required BdkPolicy that}); + + Satisfaction crateApiTypesBdkPolicyContribution({required BdkPolicy that}); + + String crateApiTypesBdkPolicyId({required BdkPolicy that}); + + SatisfiableItem crateApiTypesBdkPolicyItem({required BdkPolicy that}); + + bool crateApiTypesBdkPolicyRequiresPath({required BdkPolicy that}); + + Satisfaction crateApiTypesBdkPolicySatisfaction({required BdkPolicy that}); + String crateApiTypesBdkScriptBufAsString({required BdkScriptBuf that}); BdkScriptBuf crateApiTypesBdkScriptBufEmpty(); @@ -319,6 +331,9 @@ abstract class coreApi extends BaseApi { required Network network, required DatabaseConfig databaseConfig}); + BdkPolicy? crateApiWalletBdkWalletPolicies( + {required BdkWallet ptr, required KeychainKind keychain}); + Future crateApiWalletBdkWalletSign( {required BdkWallet ptr, required BdkPsbt psbt, @@ -348,6 +363,8 @@ abstract class coreApi extends BaseApi { required bool drainWallet, BdkScriptBuf? drainTo, RbfValue? rbf, + Map? internalPolicyPath, + Map? externalPolicyPath, required List data}); RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Address; @@ -383,6 +400,12 @@ abstract class coreApi extends BaseApi { CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ExtendedDescriptorPtr; + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Policy; + + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Policy; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_PolicyPtr; + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_DescriptorPublicKey; @@ -1747,6 +1770,142 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { argNames: ["that"], ); + @override + String crateApiTypesBdkPolicyAsString({required BdkPolicy that}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_box_autoadd_bdk_policy(that); + return wire.wire__crate__api__types__bdk_policy_as_string(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_bdk_error, + ), + constMeta: kCrateApiTypesBdkPolicyAsStringConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiTypesBdkPolicyAsStringConstMeta => + const TaskConstMeta( + debugName: "bdk_policy_as_string", + argNames: ["that"], + ); + + @override + Satisfaction crateApiTypesBdkPolicyContribution({required BdkPolicy that}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_box_autoadd_bdk_policy(that); + return wire.wire__crate__api__types__bdk_policy_contribution(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_satisfaction, + decodeErrorData: null, + ), + constMeta: kCrateApiTypesBdkPolicyContributionConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiTypesBdkPolicyContributionConstMeta => + const TaskConstMeta( + debugName: "bdk_policy_contribution", + argNames: ["that"], + ); + + @override + String crateApiTypesBdkPolicyId({required BdkPolicy that}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_box_autoadd_bdk_policy(that); + return wire.wire__crate__api__types__bdk_policy_id(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: null, + ), + constMeta: kCrateApiTypesBdkPolicyIdConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiTypesBdkPolicyIdConstMeta => const TaskConstMeta( + debugName: "bdk_policy_id", + argNames: ["that"], + ); + + @override + SatisfiableItem crateApiTypesBdkPolicyItem({required BdkPolicy that}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_box_autoadd_bdk_policy(that); + return wire.wire__crate__api__types__bdk_policy_item(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_satisfiable_item, + decodeErrorData: null, + ), + constMeta: kCrateApiTypesBdkPolicyItemConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiTypesBdkPolicyItemConstMeta => const TaskConstMeta( + debugName: "bdk_policy_item", + argNames: ["that"], + ); + + @override + bool crateApiTypesBdkPolicyRequiresPath({required BdkPolicy that}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_box_autoadd_bdk_policy(that); + return wire.wire__crate__api__types__bdk_policy_requires_path(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_bool, + decodeErrorData: null, + ), + constMeta: kCrateApiTypesBdkPolicyRequiresPathConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiTypesBdkPolicyRequiresPathConstMeta => + const TaskConstMeta( + debugName: "bdk_policy_requires_path", + argNames: ["that"], + ); + + @override + Satisfaction crateApiTypesBdkPolicySatisfaction({required BdkPolicy that}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_box_autoadd_bdk_policy(that); + return wire.wire__crate__api__types__bdk_policy_satisfaction(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_satisfaction, + decodeErrorData: null, + ), + constMeta: kCrateApiTypesBdkPolicySatisfactionConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiTypesBdkPolicySatisfactionConstMeta => + const TaskConstMeta( + debugName: "bdk_policy_satisfaction", + argNames: ["that"], + ); + @override String crateApiTypesBdkScriptBufAsString({required BdkScriptBuf that}) { return handler.executeSync(SyncTask( @@ -2460,6 +2619,31 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { ], ); + @override + BdkPolicy? crateApiWalletBdkWalletPolicies( + {required BdkWallet ptr, required KeychainKind keychain}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_box_autoadd_bdk_wallet(ptr); + var arg1 = cst_encode_keychain_kind(keychain); + return wire.wire__crate__api__wallet__bdk_wallet_policies(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_opt_box_autoadd_bdk_policy, + decodeErrorData: dco_decode_bdk_error, + ), + constMeta: kCrateApiWalletBdkWalletPoliciesConstMeta, + argValues: [ptr, keychain], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiWalletBdkWalletPoliciesConstMeta => + const TaskConstMeta( + debugName: "bdk_wallet_policies", + argNames: ["ptr", "keychain"], + ); + @override Future crateApiWalletBdkWalletSign( {required BdkWallet ptr, @@ -2571,6 +2755,8 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { required bool drainWallet, BdkScriptBuf? drainTo, RbfValue? rbf, + Map? internalPolicyPath, + Map? externalPolicyPath, required List data}) { return handler.executeNormal(NormalTask( callFfi: (port_) { @@ -2587,7 +2773,11 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { var arg9 = cst_encode_bool(drainWallet); var arg10 = cst_encode_opt_box_autoadd_bdk_script_buf(drainTo); var arg11 = cst_encode_opt_box_autoadd_rbf_value(rbf); - var arg12 = cst_encode_list_prim_u_8_loose(data); + var arg12 = + cst_encode_opt_Map_String_list_prim_u_32_strict(internalPolicyPath); + var arg13 = + cst_encode_opt_Map_String_list_prim_u_32_strict(externalPolicyPath); + var arg14 = cst_encode_list_prim_u_8_loose(data); return wire.wire__crate__api__wallet__tx_builder_finish( port_, arg0, @@ -2602,7 +2792,9 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { arg9, arg10, arg11, - arg12); + arg12, + arg13, + arg14); }, codec: DcoCodec( decodeSuccessData: dco_decode_record_bdk_psbt_transaction_details, @@ -2622,6 +2814,8 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { drainWallet, drainTo, rbf, + internalPolicyPath, + externalPolicyPath, data ], apiImpl: this, @@ -2644,6 +2838,8 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { "drainWallet", "drainTo", "rbf", + "internalPolicyPath", + "externalPolicyPath", "data" ], ); @@ -2680,6 +2876,14 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { get rust_arc_decrement_strong_count_ExtendedDescriptor => wire .rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorExtendedDescriptor; + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Policy => + wire.rust_arc_increment_strong_count_RustOpaque_bdkdescriptorPolicy; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Policy => + wire.rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicy; + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_DescriptorPublicKey => wire .rust_arc_increment_strong_count_RustOpaque_bdkkeysDescriptorPublicKey; @@ -2728,6 +2932,31 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { get rust_arc_decrement_strong_count_MutexPartiallySignedTransaction => wire .rust_arc_decrement_strong_count_RustOpaque_stdsyncMutexbdkbitcoinpsbtPartiallySignedTransaction; + @protected + Map dco_decode_Map_String_list_prim_u_32_strict( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Map.fromEntries( + dco_decode_list_record_string_list_prim_u_32_strict(raw) + .map((e) => MapEntry(e.$1, e.$2))); + } + + @protected + Map> + dco_decode_Map_list_prim_u_32_strict_list_condition(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Map.fromEntries( + dco_decode_list_record_list_prim_u_32_strict_list_condition(raw) + .map((e) => MapEntry(e.$1, e.$2))); + } + + @protected + Map> dco_decode_Map_u_32_list_condition(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Map.fromEntries(dco_decode_list_record_u_32_list_condition(raw) + .map((e) => MapEntry(e.$1, e.$2))); + } + @protected Address dco_decode_RustOpaque_bdkbitcoinAddress(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2754,6 +2983,12 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return ExtendedDescriptorImpl.frbInternalDcoDecode(raw as List); } + @protected + Policy dco_decode_RustOpaque_bdkdescriptorPolicy(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return PolicyImpl.frbInternalDcoDecode(raw as List); + } + @protected DescriptorPublicKey dco_decode_RustOpaque_bdkkeysDescriptorPublicKey( dynamic raw) { @@ -3176,6 +3411,17 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { ); } + @protected + BdkPolicy dco_decode_bdk_policy(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 1) + throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); + return BdkPolicy( + ptr: dco_decode_RustOpaque_bdkdescriptorPolicy(arr[0]), + ); + } + @protected BdkPsbt dco_decode_bdk_psbt(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3318,6 +3564,12 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return dco_decode_bdk_mnemonic(raw); } + @protected + BdkPolicy dco_decode_box_autoadd_bdk_policy(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_bdk_policy(raw); + } + @protected BdkPsbt dco_decode_box_autoadd_bdk_psbt(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3354,6 +3606,18 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return dco_decode_blockchain_config(raw); } + @protected + bool dco_decode_box_autoadd_bool(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as bool; + } + + @protected + Condition dco_decode_box_autoadd_condition(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_condition(raw); + } + @protected ConsensusError dco_decode_box_autoadd_consensus_error(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3420,6 +3684,12 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return dco_decode_out_point(raw); } + @protected + PkOrF dco_decode_box_autoadd_pk_or_f(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_pk_or_f(raw); + } + @protected PsbtSigHashType dco_decode_box_autoadd_psbt_sig_hash_type(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3495,6 +3765,18 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return ChangeSpendPolicy.values[raw as int]; } + @protected + Condition dco_decode_condition(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 2) + throw Exception('unexpected arr length: expect 2 but see ${arr.length}'); + return Condition( + csv: dco_decode_opt_box_autoadd_u_32(arr[0]), + timelock: dco_decode_opt_box_autoadd_lock_time(arr[1]), + ); + } + @protected ConsensusError dco_decode_consensus_error(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3689,6 +3971,18 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return KeychainKind.values[raw as int]; } + @protected + List dco_decode_list_bdk_policy(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List).map(dco_decode_bdk_policy).toList(); + } + + @protected + List dco_decode_list_condition(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List).map(dco_decode_condition).toList(); + } + @protected List dco_decode_list_list_prim_u_8_strict(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3707,6 +4001,24 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return (raw as List).map(dco_decode_out_point).toList(); } + @protected + List dco_decode_list_pk_or_f(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List).map(dco_decode_pk_or_f).toList(); + } + + @protected + Uint32List dco_decode_list_prim_u_32_strict(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as Uint32List; + } + + @protected + Uint64List dco_decode_list_prim_u_64_strict(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dcoDecodeUint64List(raw); + } + @protected List dco_decode_list_prim_u_8_loose(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3719,6 +4031,33 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return raw as Uint8List; } + @protected + List<(Uint32List, List)> + dco_decode_list_record_list_prim_u_32_strict_list_condition(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List) + .map(dco_decode_record_list_prim_u_32_strict_list_condition) + .toList(); + } + + @protected + List<(String, Uint32List)> + dco_decode_list_record_string_list_prim_u_32_strict(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List) + .map(dco_decode_record_string_list_prim_u_32_strict) + .toList(); + } + + @protected + List<(int, List)> dco_decode_list_record_u_32_list_condition( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List) + .map(dco_decode_record_u_32_list_condition) + .toList(); + } + @protected List dco_decode_list_script_amount(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3780,6 +4119,15 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return Network.values[raw as int]; } + @protected + Map? dco_decode_opt_Map_String_list_prim_u_32_strict( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null + ? null + : dco_decode_Map_String_list_prim_u_32_strict(raw); + } + @protected String? dco_decode_opt_String(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3798,6 +4146,12 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return raw == null ? null : dco_decode_box_autoadd_bdk_descriptor(raw); } + @protected + BdkPolicy? dco_decode_opt_box_autoadd_bdk_policy(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_bdk_policy(raw); + } + @protected BdkScriptBuf? dco_decode_opt_box_autoadd_bdk_script_buf(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3816,6 +4170,12 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return raw == null ? null : dco_decode_box_autoadd_block_time(raw); } + @protected + bool? dco_decode_opt_box_autoadd_bool(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_bool(raw); + } + @protected double? dco_decode_opt_box_autoadd_f_32(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3828,6 +4188,12 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return raw == null ? null : dco_decode_box_autoadd_fee_rate(raw); } + @protected + LockTime? dco_decode_opt_box_autoadd_lock_time(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_lock_time(raw); + } + @protected PsbtSigHashType? dco_decode_opt_box_autoadd_psbt_sig_hash_type(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3913,6 +4279,27 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } } + @protected + PkOrF dco_decode_pk_or_f(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return PkOrF_Pubkey( + value: dco_decode_String(raw[1]), + ); + case 1: + return PkOrF_XOnlyPubkey( + value: dco_decode_String(raw[1]), + ); + case 2: + return PkOrF_Fingerprint( + value: dco_decode_String(raw[1]), + ); + default: + throw Exception("unreachable"); + } + } + @protected PsbtSigHashType dco_decode_psbt_sig_hash_type(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3967,17 +4354,58 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } @protected - (OutPoint, Input, BigInt) dco_decode_record_out_point_input_usize( - dynamic raw) { + (Uint32List, List) + dco_decode_record_list_prim_u_32_strict_list_condition(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; - if (arr.length != 3) { - throw Exception('Expected 3 elements, got ${arr.length}'); + if (arr.length != 2) { + throw Exception('Expected 2 elements, got ${arr.length}'); } return ( - dco_decode_out_point(arr[0]), - dco_decode_input(arr[1]), - dco_decode_usize(arr[2]), + dco_decode_list_prim_u_32_strict(arr[0]), + dco_decode_list_condition(arr[1]), + ); + } + + @protected + (OutPoint, Input, BigInt) dco_decode_record_out_point_input_usize( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 3) { + throw Exception('Expected 3 elements, got ${arr.length}'); + } + return ( + dco_decode_out_point(arr[0]), + dco_decode_input(arr[1]), + dco_decode_usize(arr[2]), + ); + } + + @protected + (String, Uint32List) dco_decode_record_string_list_prim_u_32_strict( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 2) { + throw Exception('Expected 2 elements, got ${arr.length}'); + } + return ( + dco_decode_String(arr[0]), + dco_decode_list_prim_u_32_strict(arr[1]), + ); + } + + @protected + (int, List) dco_decode_record_u_32_list_condition(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 2) { + throw Exception('Expected 2 elements, got ${arr.length}'); + } + return ( + dco_decode_u_32(arr[0]), + dco_decode_list_condition(arr[1]), ); } @@ -4010,6 +4438,91 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { ); } + @protected + Satisfaction dco_decode_satisfaction(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return Satisfaction_Partial( + n: dco_decode_u_64(raw[1]), + m: dco_decode_u_64(raw[2]), + items: dco_decode_list_prim_u_64_strict(raw[3]), + sorted: dco_decode_opt_box_autoadd_bool(raw[4]), + conditions: dco_decode_Map_u_32_list_condition(raw[5]), + ); + case 1: + return Satisfaction_PartialComplete( + n: dco_decode_u_64(raw[1]), + m: dco_decode_u_64(raw[2]), + items: dco_decode_list_prim_u_64_strict(raw[3]), + sorted: dco_decode_opt_box_autoadd_bool(raw[4]), + conditions: + dco_decode_Map_list_prim_u_32_strict_list_condition(raw[5]), + ); + case 2: + return Satisfaction_Complete( + condition: dco_decode_box_autoadd_condition(raw[1]), + ); + case 3: + return Satisfaction_None( + msg: dco_decode_String(raw[1]), + ); + default: + throw Exception("unreachable"); + } + } + + @protected + SatisfiableItem dco_decode_satisfiable_item(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return SatisfiableItem_EcdsaSignature( + key: dco_decode_box_autoadd_pk_or_f(raw[1]), + ); + case 1: + return SatisfiableItem_SchnorrSignature( + key: dco_decode_box_autoadd_pk_or_f(raw[1]), + ); + case 2: + return SatisfiableItem_Sha256Preimage( + hash: dco_decode_String(raw[1]), + ); + case 3: + return SatisfiableItem_Hash256Preimage( + hash: dco_decode_String(raw[1]), + ); + case 4: + return SatisfiableItem_Ripemd160Preimage( + hash: dco_decode_String(raw[1]), + ); + case 5: + return SatisfiableItem_Hash160Preimage( + hash: dco_decode_String(raw[1]), + ); + case 6: + return SatisfiableItem_AbsoluteTimelock( + value: dco_decode_box_autoadd_lock_time(raw[1]), + ); + case 7: + return SatisfiableItem_RelativeTimelock( + value: dco_decode_u_32(raw[1]), + ); + case 8: + return SatisfiableItem_Multisig( + keys: dco_decode_list_pk_or_f(raw[1]), + threshold: dco_decode_u_64(raw[2]), + ); + case 9: + return SatisfiableItem_Thresh( + items: dco_decode_list_bdk_policy(raw[1]), + threshold: dco_decode_u_64(raw[2]), + ); + default: + throw Exception("unreachable"); + } + } + @protected ScriptAmount dco_decode_script_amount(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -4158,6 +4671,33 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return WordCount.values[raw as int]; } + @protected + Map sse_decode_Map_String_list_prim_u_32_strict( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = + sse_decode_list_record_string_list_prim_u_32_strict(deserializer); + return Map.fromEntries(inner.map((e) => MapEntry(e.$1, e.$2))); + } + + @protected + Map> + sse_decode_Map_list_prim_u_32_strict_list_condition( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_list_record_list_prim_u_32_strict_list_condition( + deserializer); + return Map.fromEntries(inner.map((e) => MapEntry(e.$1, e.$2))); + } + + @protected + Map> sse_decode_Map_u_32_list_condition( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_list_record_u_32_list_condition(deserializer); + return Map.fromEntries(inner.map((e) => MapEntry(e.$1, e.$2))); + } + @protected Address sse_decode_RustOpaque_bdkbitcoinAddress( SseDeserializer deserializer) { @@ -4190,6 +4730,14 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } + @protected + Policy sse_decode_RustOpaque_bdkdescriptorPolicy( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return PolicyImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + @protected DescriptorPublicKey sse_decode_RustOpaque_bdkkeysDescriptorPublicKey( SseDeserializer deserializer) { @@ -4565,6 +5113,13 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return BdkMnemonic(ptr: var_ptr); } + @protected + BdkPolicy sse_decode_bdk_policy(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = sse_decode_RustOpaque_bdkdescriptorPolicy(deserializer); + return BdkPolicy(ptr: var_ptr); + } + @protected BdkPsbt sse_decode_bdk_psbt(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4693,6 +5248,12 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return (sse_decode_bdk_mnemonic(deserializer)); } + @protected + BdkPolicy sse_decode_box_autoadd_bdk_policy(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_bdk_policy(deserializer)); + } + @protected BdkPsbt sse_decode_box_autoadd_bdk_psbt(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4732,6 +5293,18 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return (sse_decode_blockchain_config(deserializer)); } + @protected + bool sse_decode_box_autoadd_bool(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_bool(deserializer)); + } + + @protected + Condition sse_decode_box_autoadd_condition(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_condition(deserializer)); + } + @protected ConsensusError sse_decode_box_autoadd_consensus_error( SseDeserializer deserializer) { @@ -4803,6 +5376,12 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return (sse_decode_out_point(deserializer)); } + @protected + PkOrF sse_decode_box_autoadd_pk_or_f(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_pk_or_f(deserializer)); + } + @protected PsbtSigHashType sse_decode_box_autoadd_psbt_sig_hash_type( SseDeserializer deserializer) { @@ -4883,6 +5462,14 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return ChangeSpendPolicy.values[inner]; } + @protected + Condition sse_decode_condition(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_csv = sse_decode_opt_box_autoadd_u_32(deserializer); + var var_timelock = sse_decode_opt_box_autoadd_lock_time(deserializer); + return Condition(csv: var_csv, timelock: var_timelock); + } + @protected ConsensusError sse_decode_consensus_error(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5067,6 +5654,30 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return KeychainKind.values[inner]; } + @protected + List sse_decode_list_bdk_policy(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = []; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add(sse_decode_bdk_policy(deserializer)); + } + return ans_; + } + + @protected + List sse_decode_list_condition(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = []; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add(sse_decode_condition(deserializer)); + } + return ans_; + } + @protected List sse_decode_list_list_prim_u_8_strict( SseDeserializer deserializer) { @@ -5104,6 +5715,32 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return ans_; } + @protected + List sse_decode_list_pk_or_f(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = []; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add(sse_decode_pk_or_f(deserializer)); + } + return ans_; + } + + @protected + Uint32List sse_decode_list_prim_u_32_strict(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var len_ = sse_decode_i_32(deserializer); + return deserializer.buffer.getUint32List(len_); + } + + @protected + Uint64List sse_decode_list_prim_u_64_strict(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var len_ = sse_decode_i_32(deserializer); + return deserializer.buffer.getUint64List(len_); + } + @protected List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5118,6 +5755,48 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return deserializer.buffer.getUint8List(len_); } + @protected + List<(Uint32List, List)> + sse_decode_list_record_list_prim_u_32_strict_list_condition( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = <(Uint32List, List)>[]; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add( + sse_decode_record_list_prim_u_32_strict_list_condition(deserializer)); + } + return ans_; + } + + @protected + List<(String, Uint32List)> + sse_decode_list_record_string_list_prim_u_32_strict( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = <(String, Uint32List)>[]; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add(sse_decode_record_string_list_prim_u_32_strict(deserializer)); + } + return ans_; + } + + @protected + List<(int, List)> sse_decode_list_record_u_32_list_condition( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = <(int, List)>[]; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add(sse_decode_record_u_32_list_condition(deserializer)); + } + return ans_; + } + @protected List sse_decode_list_script_amount( SseDeserializer deserializer) { @@ -5206,6 +5885,18 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return Network.values[inner]; } + @protected + Map? sse_decode_opt_Map_String_list_prim_u_32_strict( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_Map_String_list_prim_u_32_strict(deserializer)); + } else { + return null; + } + } + @protected String? sse_decode_opt_String(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5241,6 +5932,18 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } } + @protected + BdkPolicy? sse_decode_opt_box_autoadd_bdk_policy( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_bdk_policy(deserializer)); + } else { + return null; + } + } + @protected BdkScriptBuf? sse_decode_opt_box_autoadd_bdk_script_buf( SseDeserializer deserializer) { @@ -5277,6 +5980,17 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } } + @protected + bool? sse_decode_opt_box_autoadd_bool(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_bool(deserializer)); + } else { + return null; + } + } + @protected double? sse_decode_opt_box_autoadd_f_32(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5299,6 +6013,17 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } } + @protected + LockTime? sse_decode_opt_box_autoadd_lock_time(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_lock_time(deserializer)); + } else { + return null; + } + } + @protected PsbtSigHashType? sse_decode_opt_box_autoadd_psbt_sig_hash_type( SseDeserializer deserializer) { @@ -5423,6 +6148,26 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } } + @protected + PkOrF sse_decode_pk_or_f(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + var var_value = sse_decode_String(deserializer); + return PkOrF_Pubkey(value: var_value); + case 1: + var var_value = sse_decode_String(deserializer); + return PkOrF_XOnlyPubkey(value: var_value); + case 2: + var var_value = sse_decode_String(deserializer); + return PkOrF_Fingerprint(value: var_value); + default: + throw UnimplementedError(''); + } + } + @protected PsbtSigHashType sse_decode_psbt_sig_hash_type(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5464,6 +6209,16 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return (var_field0, var_field1); } + @protected + (Uint32List, List) + sse_decode_record_list_prim_u_32_strict_list_condition( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_field0 = sse_decode_list_prim_u_32_strict(deserializer); + var var_field1 = sse_decode_list_condition(deserializer); + return (var_field0, var_field1); + } + @protected (OutPoint, Input, BigInt) sse_decode_record_out_point_input_usize( SseDeserializer deserializer) { @@ -5474,6 +6229,24 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return (var_field0, var_field1, var_field2); } + @protected + (String, Uint32List) sse_decode_record_string_list_prim_u_32_strict( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_field0 = sse_decode_String(deserializer); + var var_field1 = sse_decode_list_prim_u_32_strict(deserializer); + return (var_field0, var_field1); + } + + @protected + (int, List) sse_decode_record_u_32_list_condition( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_field0 = sse_decode_u_32(deserializer); + var var_field1 = sse_decode_list_condition(deserializer); + return (var_field0, var_field1); + } + @protected RpcConfig sse_decode_rpc_config(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5505,6 +6278,93 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { pollRateSec: var_pollRateSec); } + @protected + Satisfaction sse_decode_satisfaction(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + var var_n = sse_decode_u_64(deserializer); + var var_m = sse_decode_u_64(deserializer); + var var_items = sse_decode_list_prim_u_64_strict(deserializer); + var var_sorted = sse_decode_opt_box_autoadd_bool(deserializer); + var var_conditions = sse_decode_Map_u_32_list_condition(deserializer); + return Satisfaction_Partial( + n: var_n, + m: var_m, + items: var_items, + sorted: var_sorted, + conditions: var_conditions); + case 1: + var var_n = sse_decode_u_64(deserializer); + var var_m = sse_decode_u_64(deserializer); + var var_items = sse_decode_list_prim_u_64_strict(deserializer); + var var_sorted = sse_decode_opt_box_autoadd_bool(deserializer); + var var_conditions = + sse_decode_Map_list_prim_u_32_strict_list_condition(deserializer); + return Satisfaction_PartialComplete( + n: var_n, + m: var_m, + items: var_items, + sorted: var_sorted, + conditions: var_conditions); + case 2: + var var_condition = sse_decode_box_autoadd_condition(deserializer); + return Satisfaction_Complete(condition: var_condition); + case 3: + var var_msg = sse_decode_String(deserializer); + return Satisfaction_None(msg: var_msg); + default: + throw UnimplementedError(''); + } + } + + @protected + SatisfiableItem sse_decode_satisfiable_item(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + var var_key = sse_decode_box_autoadd_pk_or_f(deserializer); + return SatisfiableItem_EcdsaSignature(key: var_key); + case 1: + var var_key = sse_decode_box_autoadd_pk_or_f(deserializer); + return SatisfiableItem_SchnorrSignature(key: var_key); + case 2: + var var_hash = sse_decode_String(deserializer); + return SatisfiableItem_Sha256Preimage(hash: var_hash); + case 3: + var var_hash = sse_decode_String(deserializer); + return SatisfiableItem_Hash256Preimage(hash: var_hash); + case 4: + var var_hash = sse_decode_String(deserializer); + return SatisfiableItem_Ripemd160Preimage(hash: var_hash); + case 5: + var var_hash = sse_decode_String(deserializer); + return SatisfiableItem_Hash160Preimage(hash: var_hash); + case 6: + var var_value = sse_decode_box_autoadd_lock_time(deserializer); + return SatisfiableItem_AbsoluteTimelock(value: var_value); + case 7: + var var_value = sse_decode_u_32(deserializer); + return SatisfiableItem_RelativeTimelock(value: var_value); + case 8: + var var_keys = sse_decode_list_pk_or_f(deserializer); + var var_threshold = sse_decode_u_64(deserializer); + return SatisfiableItem_Multisig( + keys: var_keys, threshold: var_threshold); + case 9: + var var_items = sse_decode_list_bdk_policy(deserializer); + var var_threshold = sse_decode_u_64(deserializer); + return SatisfiableItem_Thresh( + items: var_items, threshold: var_threshold); + default: + throw UnimplementedError(''); + } + } + @protected ScriptAmount sse_decode_script_amount(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5679,6 +6539,13 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return (raw as ExtendedDescriptorImpl).frbInternalCstEncode(); } + @protected + int cst_encode_RustOpaque_bdkdescriptorPolicy(Policy raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as PolicyImpl).frbInternalCstEncode(); + } + @protected int cst_encode_RustOpaque_bdkkeysDescriptorPublicKey( DescriptorPublicKey raw) { @@ -5797,6 +6664,30 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return cst_encode_i_32(raw.index); } + @protected + void sse_encode_Map_String_list_prim_u_32_strict( + Map self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_record_string_list_prim_u_32_strict( + self.entries.map((e) => (e.key, e.value)).toList(), serializer); + } + + @protected + void sse_encode_Map_list_prim_u_32_strict_list_condition( + Map> self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_record_list_prim_u_32_strict_list_condition( + self.entries.map((e) => (e.key, e.value)).toList(), serializer); + } + + @protected + void sse_encode_Map_u_32_list_condition( + Map> self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_record_u_32_list_condition( + self.entries.map((e) => (e.key, e.value)).toList(), serializer); + } + @protected void sse_encode_RustOpaque_bdkbitcoinAddress( Address self, SseSerializer serializer) { @@ -5832,6 +6723,14 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { serializer); } + @protected + void sse_encode_RustOpaque_bdkdescriptorPolicy( + Policy self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as PolicyImpl).frbInternalSseEncode(move: null), serializer); + } + @protected void sse_encode_RustOpaque_bdkkeysDescriptorPublicKey( DescriptorPublicKey self, SseSerializer serializer) { @@ -6194,6 +7093,12 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_RustOpaque_bdkkeysbip39Mnemonic(self.ptr, serializer); } + @protected + void sse_encode_bdk_policy(BdkPolicy self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_bdkdescriptorPolicy(self.ptr, serializer); + } + @protected void sse_encode_bdk_psbt(BdkPsbt self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -6316,6 +7221,13 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_bdk_mnemonic(self, serializer); } + @protected + void sse_encode_box_autoadd_bdk_policy( + BdkPolicy self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_bdk_policy(self, serializer); + } + @protected void sse_encode_box_autoadd_bdk_psbt(BdkPsbt self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -6357,6 +7269,19 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_blockchain_config(self, serializer); } + @protected + void sse_encode_box_autoadd_bool(bool self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_bool(self, serializer); + } + + @protected + void sse_encode_box_autoadd_condition( + Condition self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_condition(self, serializer); + } + @protected void sse_encode_box_autoadd_consensus_error( ConsensusError self, SseSerializer serializer) { @@ -6432,6 +7357,12 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_out_point(self, serializer); } + @protected + void sse_encode_box_autoadd_pk_or_f(PkOrF self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_pk_or_f(self, serializer); + } + @protected void sse_encode_box_autoadd_psbt_sig_hash_type( PsbtSigHashType self, SseSerializer serializer) { @@ -6513,6 +7444,13 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_i_32(self.index, serializer); } + @protected + void sse_encode_condition(Condition self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_opt_box_autoadd_u_32(self.csv, serializer); + sse_encode_opt_box_autoadd_lock_time(self.timelock, serializer); + } + @protected void sse_encode_consensus_error( ConsensusError self, SseSerializer serializer) { @@ -6679,6 +7617,26 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_i_32(self.index, serializer); } + @protected + void sse_encode_list_bdk_policy( + List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_bdk_policy(item, serializer); + } + } + + @protected + void sse_encode_list_condition( + List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_condition(item, serializer); + } + } + @protected void sse_encode_list_list_prim_u_8_strict( List self, SseSerializer serializer) { @@ -6709,6 +7667,31 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } } + @protected + void sse_encode_list_pk_or_f(List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_pk_or_f(item, serializer); + } + } + + @protected + void sse_encode_list_prim_u_32_strict( + Uint32List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + serializer.buffer.putUint32List(self); + } + + @protected + void sse_encode_list_prim_u_64_strict( + Uint64List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + serializer.buffer.putUint64List(self); + } + @protected void sse_encode_list_prim_u_8_loose( List self, SseSerializer serializer) { @@ -6726,6 +7709,36 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { serializer.buffer.putUint8List(self); } + @protected + void sse_encode_list_record_list_prim_u_32_strict_list_condition( + List<(Uint32List, List)> self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_record_list_prim_u_32_strict_list_condition(item, serializer); + } + } + + @protected + void sse_encode_list_record_string_list_prim_u_32_strict( + List<(String, Uint32List)> self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_record_string_list_prim_u_32_strict(item, serializer); + } + } + + @protected + void sse_encode_list_record_u_32_list_condition( + List<(int, List)> self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_record_u_32_list_condition(item, serializer); + } + } + @protected void sse_encode_list_script_amount( List self, SseSerializer serializer) { @@ -6794,6 +7807,17 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_i_32(self.index, serializer); } + @protected + void sse_encode_opt_Map_String_list_prim_u_32_strict( + Map? self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + sse_encode_bool(self != null, serializer); + if (self != null) { + sse_encode_Map_String_list_prim_u_32_strict(self, serializer); + } + } + @protected void sse_encode_opt_String(String? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -6826,6 +7850,17 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } } + @protected + void sse_encode_opt_box_autoadd_bdk_policy( + BdkPolicy? self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + sse_encode_bool(self != null, serializer); + if (self != null) { + sse_encode_box_autoadd_bdk_policy(self, serializer); + } + } + @protected void sse_encode_opt_box_autoadd_bdk_script_buf( BdkScriptBuf? self, SseSerializer serializer) { @@ -6859,6 +7894,16 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } } + @protected + void sse_encode_opt_box_autoadd_bool(bool? self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + sse_encode_bool(self != null, serializer); + if (self != null) { + sse_encode_box_autoadd_bool(self, serializer); + } + } + @protected void sse_encode_opt_box_autoadd_f_32(double? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -6880,6 +7925,17 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } } + @protected + void sse_encode_opt_box_autoadd_lock_time( + LockTime? self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + sse_encode_bool(self != null, serializer); + if (self != null) { + sse_encode_box_autoadd_lock_time(self, serializer); + } + } + @protected void sse_encode_opt_box_autoadd_psbt_sig_hash_type( PsbtSigHashType? self, SseSerializer serializer) { @@ -6994,6 +8050,24 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } } + @protected + void sse_encode_pk_or_f(PkOrF self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case PkOrF_Pubkey(value: final value): + sse_encode_i_32(0, serializer); + sse_encode_String(value, serializer); + case PkOrF_XOnlyPubkey(value: final value): + sse_encode_i_32(1, serializer); + sse_encode_String(value, serializer); + case PkOrF_Fingerprint(value: final value): + sse_encode_i_32(2, serializer); + sse_encode_String(value, serializer); + default: + throw UnimplementedError(''); + } + } + @protected void sse_encode_psbt_sig_hash_type( PsbtSigHashType self, SseSerializer serializer) { @@ -7031,6 +8105,14 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_transaction_details(self.$2, serializer); } + @protected + void sse_encode_record_list_prim_u_32_strict_list_condition( + (Uint32List, List) self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_32_strict(self.$1, serializer); + sse_encode_list_condition(self.$2, serializer); + } + @protected void sse_encode_record_out_point_input_usize( (OutPoint, Input, BigInt) self, SseSerializer serializer) { @@ -7040,6 +8122,22 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_usize(self.$3, serializer); } + @protected + void sse_encode_record_string_list_prim_u_32_strict( + (String, Uint32List) self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.$1, serializer); + sse_encode_list_prim_u_32_strict(self.$2, serializer); + } + + @protected + void sse_encode_record_u_32_list_condition( + (int, List) self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_32(self.$1, serializer); + sse_encode_list_condition(self.$2, serializer); + } + @protected void sse_encode_rpc_config(RpcConfig self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -7060,6 +8158,96 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_u_64(self.pollRateSec, serializer); } + @protected + void sse_encode_satisfaction(Satisfaction self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case Satisfaction_Partial( + n: final n, + m: final m, + items: final items, + sorted: final sorted, + conditions: final conditions + ): + sse_encode_i_32(0, serializer); + sse_encode_u_64(n, serializer); + sse_encode_u_64(m, serializer); + sse_encode_list_prim_u_64_strict(items, serializer); + sse_encode_opt_box_autoadd_bool(sorted, serializer); + sse_encode_Map_u_32_list_condition(conditions, serializer); + case Satisfaction_PartialComplete( + n: final n, + m: final m, + items: final items, + sorted: final sorted, + conditions: final conditions + ): + sse_encode_i_32(1, serializer); + sse_encode_u_64(n, serializer); + sse_encode_u_64(m, serializer); + sse_encode_list_prim_u_64_strict(items, serializer); + sse_encode_opt_box_autoadd_bool(sorted, serializer); + sse_encode_Map_list_prim_u_32_strict_list_condition( + conditions, serializer); + case Satisfaction_Complete(condition: final condition): + sse_encode_i_32(2, serializer); + sse_encode_box_autoadd_condition(condition, serializer); + case Satisfaction_None(msg: final msg): + sse_encode_i_32(3, serializer); + sse_encode_String(msg, serializer); + default: + throw UnimplementedError(''); + } + } + + @protected + void sse_encode_satisfiable_item( + SatisfiableItem self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case SatisfiableItem_EcdsaSignature(key: final key): + sse_encode_i_32(0, serializer); + sse_encode_box_autoadd_pk_or_f(key, serializer); + case SatisfiableItem_SchnorrSignature(key: final key): + sse_encode_i_32(1, serializer); + sse_encode_box_autoadd_pk_or_f(key, serializer); + case SatisfiableItem_Sha256Preimage(hash: final hash): + sse_encode_i_32(2, serializer); + sse_encode_String(hash, serializer); + case SatisfiableItem_Hash256Preimage(hash: final hash): + sse_encode_i_32(3, serializer); + sse_encode_String(hash, serializer); + case SatisfiableItem_Ripemd160Preimage(hash: final hash): + sse_encode_i_32(4, serializer); + sse_encode_String(hash, serializer); + case SatisfiableItem_Hash160Preimage(hash: final hash): + sse_encode_i_32(5, serializer); + sse_encode_String(hash, serializer); + case SatisfiableItem_AbsoluteTimelock(value: final value): + sse_encode_i_32(6, serializer); + sse_encode_box_autoadd_lock_time(value, serializer); + case SatisfiableItem_RelativeTimelock(value: final value): + sse_encode_i_32(7, serializer); + sse_encode_u_32(value, serializer); + case SatisfiableItem_Multisig( + keys: final keys, + threshold: final threshold + ): + sse_encode_i_32(8, serializer); + sse_encode_list_pk_or_f(keys, serializer); + sse_encode_u_64(threshold, serializer); + case SatisfiableItem_Thresh( + items: final items, + threshold: final threshold + ): + sse_encode_i_32(9, serializer); + sse_encode_list_bdk_policy(items, serializer); + sse_encode_u_64(threshold, serializer); + default: + throw UnimplementedError(''); + } + } + @protected void sse_encode_script_amount(ScriptAmount self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -7385,3 +8573,23 @@ class MutexWalletAnyDatabaseImpl extends RustOpaque .instance.api.rust_arc_decrement_strong_count_MutexWalletAnyDatabasePtr, ); } + +@sealed +class PolicyImpl extends RustOpaque implements Policy { + // Not to be used by end users + PolicyImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + PolicyImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_Policy, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_Policy, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_PolicyPtr, + ); +} diff --git a/lib/src/generated/frb_generated.io.dart b/lib/src/generated/frb_generated.io.dart index 5ca00930..1fe9f306 100644 --- a/lib/src/generated/frb_generated.io.dart +++ b/lib/src/generated/frb_generated.io.dart @@ -40,6 +40,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { get rust_arc_decrement_strong_count_ExtendedDescriptorPtr => wire ._rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorExtendedDescriptorPtr; + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_PolicyPtr => + wire._rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicyPtr; + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_DescriptorPublicKeyPtr => wire ._rust_arc_decrement_strong_count_RustOpaque_bdkkeysDescriptorPublicKeyPtr; @@ -62,6 +65,17 @@ abstract class coreApiImplPlatform extends BaseApiImpl { get rust_arc_decrement_strong_count_MutexPartiallySignedTransactionPtr => wire._rust_arc_decrement_strong_count_RustOpaque_stdsyncMutexbdkbitcoinpsbtPartiallySignedTransactionPtr; + @protected + Map dco_decode_Map_String_list_prim_u_32_strict( + dynamic raw); + + @protected + Map> + dco_decode_Map_list_prim_u_32_strict_list_condition(dynamic raw); + + @protected + Map> dco_decode_Map_u_32_list_condition(dynamic raw); + @protected Address dco_decode_RustOpaque_bdkbitcoinAddress(dynamic raw); @@ -76,6 +90,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { ExtendedDescriptor dco_decode_RustOpaque_bdkdescriptorExtendedDescriptor( dynamic raw); + @protected + Policy dco_decode_RustOpaque_bdkdescriptorPolicy(dynamic raw); + @protected DescriptorPublicKey dco_decode_RustOpaque_bdkkeysDescriptorPublicKey( dynamic raw); @@ -139,6 +156,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected BdkMnemonic dco_decode_bdk_mnemonic(dynamic raw); + @protected + BdkPolicy dco_decode_bdk_policy(dynamic raw); + @protected BdkPsbt dco_decode_bdk_psbt(dynamic raw); @@ -189,6 +209,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected BdkMnemonic dco_decode_box_autoadd_bdk_mnemonic(dynamic raw); + @protected + BdkPolicy dco_decode_box_autoadd_bdk_policy(dynamic raw); + @protected BdkPsbt dco_decode_box_autoadd_bdk_psbt(dynamic raw); @@ -207,6 +230,12 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected BlockchainConfig dco_decode_box_autoadd_blockchain_config(dynamic raw); + @protected + bool dco_decode_box_autoadd_bool(dynamic raw); + + @protected + Condition dco_decode_box_autoadd_condition(dynamic raw); + @protected ConsensusError dco_decode_box_autoadd_consensus_error(dynamic raw); @@ -240,6 +269,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected OutPoint dco_decode_box_autoadd_out_point(dynamic raw); + @protected + PkOrF dco_decode_box_autoadd_pk_or_f(dynamic raw); + @protected PsbtSigHashType dco_decode_box_autoadd_psbt_sig_hash_type(dynamic raw); @@ -278,6 +310,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected ChangeSpendPolicy dco_decode_change_spend_policy(dynamic raw); + @protected + Condition dco_decode_condition(dynamic raw); + @protected ConsensusError dco_decode_consensus_error(dynamic raw); @@ -311,6 +346,12 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected KeychainKind dco_decode_keychain_kind(dynamic raw); + @protected + List dco_decode_list_bdk_policy(dynamic raw); + + @protected + List dco_decode_list_condition(dynamic raw); + @protected List dco_decode_list_list_prim_u_8_strict(dynamic raw); @@ -320,12 +361,33 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected List dco_decode_list_out_point(dynamic raw); + @protected + List dco_decode_list_pk_or_f(dynamic raw); + + @protected + Uint32List dco_decode_list_prim_u_32_strict(dynamic raw); + + @protected + Uint64List dco_decode_list_prim_u_64_strict(dynamic raw); + @protected List dco_decode_list_prim_u_8_loose(dynamic raw); @protected Uint8List dco_decode_list_prim_u_8_strict(dynamic raw); + @protected + List<(Uint32List, List)> + dco_decode_list_record_list_prim_u_32_strict_list_condition(dynamic raw); + + @protected + List<(String, Uint32List)> + dco_decode_list_record_string_list_prim_u_32_strict(dynamic raw); + + @protected + List<(int, List)> dco_decode_list_record_u_32_list_condition( + dynamic raw); + @protected List dco_decode_list_script_amount(dynamic raw); @@ -347,6 +409,10 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected Network dco_decode_network(dynamic raw); + @protected + Map? dco_decode_opt_Map_String_list_prim_u_32_strict( + dynamic raw); + @protected String? dco_decode_opt_String(dynamic raw); @@ -356,6 +422,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected BdkDescriptor? dco_decode_opt_box_autoadd_bdk_descriptor(dynamic raw); + @protected + BdkPolicy? dco_decode_opt_box_autoadd_bdk_policy(dynamic raw); + @protected BdkScriptBuf? dco_decode_opt_box_autoadd_bdk_script_buf(dynamic raw); @@ -365,12 +434,18 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected BlockTime? dco_decode_opt_box_autoadd_block_time(dynamic raw); + @protected + bool? dco_decode_opt_box_autoadd_bool(dynamic raw); + @protected double? dco_decode_opt_box_autoadd_f_32(dynamic raw); @protected FeeRate? dco_decode_opt_box_autoadd_fee_rate(dynamic raw); + @protected + LockTime? dco_decode_opt_box_autoadd_lock_time(dynamic raw); + @protected PsbtSigHashType? dco_decode_opt_box_autoadd_psbt_sig_hash_type(dynamic raw); @@ -402,6 +477,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected Payload dco_decode_payload(dynamic raw); + @protected + PkOrF dco_decode_pk_or_f(dynamic raw); + @protected PsbtSigHashType dco_decode_psbt_sig_hash_type(dynamic raw); @@ -415,16 +493,33 @@ abstract class coreApiImplPlatform extends BaseApiImpl { (BdkPsbt, TransactionDetails) dco_decode_record_bdk_psbt_transaction_details( dynamic raw); + @protected + (Uint32List, List) + dco_decode_record_list_prim_u_32_strict_list_condition(dynamic raw); + @protected (OutPoint, Input, BigInt) dco_decode_record_out_point_input_usize( dynamic raw); + @protected + (String, Uint32List) dco_decode_record_string_list_prim_u_32_strict( + dynamic raw); + + @protected + (int, List) dco_decode_record_u_32_list_condition(dynamic raw); + @protected RpcConfig dco_decode_rpc_config(dynamic raw); @protected RpcSyncParams dco_decode_rpc_sync_params(dynamic raw); + @protected + Satisfaction dco_decode_satisfaction(dynamic raw); + + @protected + SatisfiableItem dco_decode_satisfiable_item(dynamic raw); + @protected ScriptAmount dco_decode_script_amount(dynamic raw); @@ -473,6 +568,19 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected WordCount dco_decode_word_count(dynamic raw); + @protected + Map sse_decode_Map_String_list_prim_u_32_strict( + SseDeserializer deserializer); + + @protected + Map> + sse_decode_Map_list_prim_u_32_strict_list_condition( + SseDeserializer deserializer); + + @protected + Map> sse_decode_Map_u_32_list_condition( + SseDeserializer deserializer); + @protected Address sse_decode_RustOpaque_bdkbitcoinAddress(SseDeserializer deserializer); @@ -488,6 +596,10 @@ abstract class coreApiImplPlatform extends BaseApiImpl { ExtendedDescriptor sse_decode_RustOpaque_bdkdescriptorExtendedDescriptor( SseDeserializer deserializer); + @protected + Policy sse_decode_RustOpaque_bdkdescriptorPolicy( + SseDeserializer deserializer); + @protected DescriptorPublicKey sse_decode_RustOpaque_bdkkeysDescriptorPublicKey( SseDeserializer deserializer); @@ -555,6 +667,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected BdkMnemonic sse_decode_bdk_mnemonic(SseDeserializer deserializer); + @protected + BdkPolicy sse_decode_bdk_policy(SseDeserializer deserializer); + @protected BdkPsbt sse_decode_bdk_psbt(SseDeserializer deserializer); @@ -610,6 +725,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected BdkMnemonic sse_decode_box_autoadd_bdk_mnemonic(SseDeserializer deserializer); + @protected + BdkPolicy sse_decode_box_autoadd_bdk_policy(SseDeserializer deserializer); + @protected BdkPsbt sse_decode_box_autoadd_bdk_psbt(SseDeserializer deserializer); @@ -631,6 +749,12 @@ abstract class coreApiImplPlatform extends BaseApiImpl { BlockchainConfig sse_decode_box_autoadd_blockchain_config( SseDeserializer deserializer); + @protected + bool sse_decode_box_autoadd_bool(SseDeserializer deserializer); + + @protected + Condition sse_decode_box_autoadd_condition(SseDeserializer deserializer); + @protected ConsensusError sse_decode_box_autoadd_consensus_error( SseDeserializer deserializer); @@ -669,6 +793,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); + @protected + PkOrF sse_decode_box_autoadd_pk_or_f(SseDeserializer deserializer); + @protected PsbtSigHashType sse_decode_box_autoadd_psbt_sig_hash_type( SseDeserializer deserializer); @@ -711,6 +838,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { ChangeSpendPolicy sse_decode_change_spend_policy( SseDeserializer deserializer); + @protected + Condition sse_decode_condition(SseDeserializer deserializer); + @protected ConsensusError sse_decode_consensus_error(SseDeserializer deserializer); @@ -744,6 +874,12 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected KeychainKind sse_decode_keychain_kind(SseDeserializer deserializer); + @protected + List sse_decode_list_bdk_policy(SseDeserializer deserializer); + + @protected + List sse_decode_list_condition(SseDeserializer deserializer); + @protected List sse_decode_list_list_prim_u_8_strict( SseDeserializer deserializer); @@ -754,12 +890,35 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected List sse_decode_list_out_point(SseDeserializer deserializer); + @protected + List sse_decode_list_pk_or_f(SseDeserializer deserializer); + + @protected + Uint32List sse_decode_list_prim_u_32_strict(SseDeserializer deserializer); + + @protected + Uint64List sse_decode_list_prim_u_64_strict(SseDeserializer deserializer); + @protected List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer); @protected Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer); + @protected + List<(Uint32List, List)> + sse_decode_list_record_list_prim_u_32_strict_list_condition( + SseDeserializer deserializer); + + @protected + List<(String, Uint32List)> + sse_decode_list_record_string_list_prim_u_32_strict( + SseDeserializer deserializer); + + @protected + List<(int, List)> sse_decode_list_record_u_32_list_condition( + SseDeserializer deserializer); + @protected List sse_decode_list_script_amount( SseDeserializer deserializer); @@ -783,6 +942,10 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected Network sse_decode_network(SseDeserializer deserializer); + @protected + Map? sse_decode_opt_Map_String_list_prim_u_32_strict( + SseDeserializer deserializer); + @protected String? sse_decode_opt_String(SseDeserializer deserializer); @@ -794,6 +957,10 @@ abstract class coreApiImplPlatform extends BaseApiImpl { BdkDescriptor? sse_decode_opt_box_autoadd_bdk_descriptor( SseDeserializer deserializer); + @protected + BdkPolicy? sse_decode_opt_box_autoadd_bdk_policy( + SseDeserializer deserializer); + @protected BdkScriptBuf? sse_decode_opt_box_autoadd_bdk_script_buf( SseDeserializer deserializer); @@ -806,12 +973,18 @@ abstract class coreApiImplPlatform extends BaseApiImpl { BlockTime? sse_decode_opt_box_autoadd_block_time( SseDeserializer deserializer); + @protected + bool? sse_decode_opt_box_autoadd_bool(SseDeserializer deserializer); + @protected double? sse_decode_opt_box_autoadd_f_32(SseDeserializer deserializer); @protected FeeRate? sse_decode_opt_box_autoadd_fee_rate(SseDeserializer deserializer); + @protected + LockTime? sse_decode_opt_box_autoadd_lock_time(SseDeserializer deserializer); + @protected PsbtSigHashType? sse_decode_opt_box_autoadd_psbt_sig_hash_type( SseDeserializer deserializer); @@ -847,6 +1020,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected Payload sse_decode_payload(SseDeserializer deserializer); + @protected + PkOrF sse_decode_pk_or_f(SseDeserializer deserializer); + @protected PsbtSigHashType sse_decode_psbt_sig_hash_type(SseDeserializer deserializer); @@ -861,16 +1037,35 @@ abstract class coreApiImplPlatform extends BaseApiImpl { (BdkPsbt, TransactionDetails) sse_decode_record_bdk_psbt_transaction_details( SseDeserializer deserializer); + @protected + (Uint32List, List) + sse_decode_record_list_prim_u_32_strict_list_condition( + SseDeserializer deserializer); + @protected (OutPoint, Input, BigInt) sse_decode_record_out_point_input_usize( SseDeserializer deserializer); + @protected + (String, Uint32List) sse_decode_record_string_list_prim_u_32_strict( + SseDeserializer deserializer); + + @protected + (int, List) sse_decode_record_u_32_list_condition( + SseDeserializer deserializer); + @protected RpcConfig sse_decode_rpc_config(SseDeserializer deserializer); @protected RpcSyncParams sse_decode_rpc_sync_params(SseDeserializer deserializer); + @protected + Satisfaction sse_decode_satisfaction(SseDeserializer deserializer); + + @protected + SatisfiableItem sse_decode_satisfiable_item(SseDeserializer deserializer); + @protected ScriptAmount sse_decode_script_amount(SseDeserializer deserializer); @@ -922,6 +1117,31 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected WordCount sse_decode_word_count(SseDeserializer deserializer); + @protected + ffi.Pointer + cst_encode_Map_String_list_prim_u_32_strict(Map raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_list_record_string_list_prim_u_32_strict( + raw.entries.map((e) => (e.key, e.value)).toList()); + } + + @protected + ffi.Pointer + cst_encode_Map_list_prim_u_32_strict_list_condition( + Map> raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_list_record_list_prim_u_32_strict_list_condition( + raw.entries.map((e) => (e.key, e.value)).toList()); + } + + @protected + ffi.Pointer + cst_encode_Map_u_32_list_condition(Map> raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_list_record_u_32_list_condition( + raw.entries.map((e) => (e.key, e.value)).toList()); + } + @protected ffi.Pointer cst_encode_String(String raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1011,6 +1231,15 @@ abstract class coreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_bdk_policy( + BdkPolicy raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_bdk_policy(); + cst_api_fill_to_wire_bdk_policy(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_bdk_psbt(BdkPsbt raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1064,6 +1293,21 @@ abstract class coreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_bool(bool raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return wire.cst_new_box_autoadd_bool(cst_encode_bool(raw)); + } + + @protected + ffi.Pointer cst_encode_box_autoadd_condition( + Condition raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_condition(); + cst_api_fill_to_wire_condition(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_consensus_error( ConsensusError raw) { @@ -1159,6 +1403,14 @@ abstract class coreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_pk_or_f(PkOrF raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_pk_or_f(); + cst_api_fill_to_wire_pk_or_f(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_psbt_sig_hash_type(PsbtSigHashType raw) { @@ -1251,6 +1503,28 @@ abstract class coreApiImplPlatform extends BaseApiImpl { return wire.cst_new_box_autoadd_u_8(cst_encode_u_8(raw)); } + @protected + ffi.Pointer cst_encode_list_bdk_policy( + List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_bdk_policy(raw.length); + for (var i = 0; i < raw.length; ++i) { + cst_api_fill_to_wire_bdk_policy(raw[i], ans.ref.ptr[i]); + } + return ans; + } + + @protected + ffi.Pointer cst_encode_list_condition( + List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_condition(raw.length); + for (var i = 0; i < raw.length; ++i) { + cst_api_fill_to_wire_condition(raw[i], ans.ref.ptr[i]); + } + return ans; + } + @protected ffi.Pointer cst_encode_list_list_prim_u_8_strict(List raw) { @@ -1284,6 +1558,34 @@ abstract class coreApiImplPlatform extends BaseApiImpl { return ans; } + @protected + ffi.Pointer cst_encode_list_pk_or_f(List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_pk_or_f(raw.length); + for (var i = 0; i < raw.length; ++i) { + cst_api_fill_to_wire_pk_or_f(raw[i], ans.ref.ptr[i]); + } + return ans; + } + + @protected + ffi.Pointer cst_encode_list_prim_u_32_strict( + Uint32List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_prim_u_32_strict(raw.length); + ans.ref.ptr.asTypedList(raw.length).setAll(0, raw); + return ans; + } + + @protected + ffi.Pointer cst_encode_list_prim_u_64_strict( + Uint64List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_prim_u_64_strict(raw.length); + ans.ref.ptr.asTypedList(raw.length).setAll(0, raw.inner); + return ans; + } + @protected ffi.Pointer cst_encode_list_prim_u_8_loose( List raw) { @@ -1302,6 +1604,46 @@ abstract class coreApiImplPlatform extends BaseApiImpl { return ans; } + @protected + ffi.Pointer + cst_encode_list_record_list_prim_u_32_strict_list_condition( + List<(Uint32List, List)> raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire + .cst_new_list_record_list_prim_u_32_strict_list_condition(raw.length); + for (var i = 0; i < raw.length; ++i) { + cst_api_fill_to_wire_record_list_prim_u_32_strict_list_condition( + raw[i], ans.ref.ptr[i]); + } + return ans; + } + + @protected + ffi.Pointer + cst_encode_list_record_string_list_prim_u_32_strict( + List<(String, Uint32List)> raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = + wire.cst_new_list_record_string_list_prim_u_32_strict(raw.length); + for (var i = 0; i < raw.length; ++i) { + cst_api_fill_to_wire_record_string_list_prim_u_32_strict( + raw[i], ans.ref.ptr[i]); + } + return ans; + } + + @protected + ffi.Pointer + cst_encode_list_record_u_32_list_condition( + List<(int, List)> raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_record_u_32_list_condition(raw.length); + for (var i = 0; i < raw.length; ++i) { + cst_api_fill_to_wire_record_u_32_list_condition(raw[i], ans.ref.ptr[i]); + } + return ans; + } + @protected ffi.Pointer cst_encode_list_script_amount( List raw) { @@ -1344,6 +1686,16 @@ abstract class coreApiImplPlatform extends BaseApiImpl { return ans; } + @protected + ffi.Pointer + cst_encode_opt_Map_String_list_prim_u_32_strict( + Map? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null + ? ffi.nullptr + : cst_encode_Map_String_list_prim_u_32_strict(raw); + } + @protected ffi.Pointer cst_encode_opt_String( String? raw) { @@ -1367,6 +1719,13 @@ abstract class coreApiImplPlatform extends BaseApiImpl { : cst_encode_box_autoadd_bdk_descriptor(raw); } + @protected + ffi.Pointer cst_encode_opt_box_autoadd_bdk_policy( + BdkPolicy? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_bdk_policy(raw); + } + @protected ffi.Pointer cst_encode_opt_box_autoadd_bdk_script_buf(BdkScriptBuf? raw) { @@ -1392,6 +1751,12 @@ abstract class coreApiImplPlatform extends BaseApiImpl { return raw == null ? ffi.nullptr : cst_encode_box_autoadd_block_time(raw); } + @protected + ffi.Pointer cst_encode_opt_box_autoadd_bool(bool? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_bool(raw); + } + @protected ffi.Pointer cst_encode_opt_box_autoadd_f_32(double? raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1405,6 +1770,13 @@ abstract class coreApiImplPlatform extends BaseApiImpl { return raw == null ? ffi.nullptr : cst_encode_box_autoadd_fee_rate(raw); } + @protected + ffi.Pointer cst_encode_opt_box_autoadd_lock_time( + LockTime? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_lock_time(raw); + } + @protected ffi.Pointer cst_encode_opt_box_autoadd_psbt_sig_hash_type(PsbtSigHashType? raw) { @@ -1947,6 +2319,12 @@ abstract class coreApiImplPlatform extends BaseApiImpl { wireObj.ptr = cst_encode_RustOpaque_bdkkeysbip39Mnemonic(apiObj.ptr); } + @protected + void cst_api_fill_to_wire_bdk_policy( + BdkPolicy apiObj, wire_cst_bdk_policy wireObj) { + wireObj.ptr = cst_encode_RustOpaque_bdkdescriptorPolicy(apiObj.ptr); + } + @protected void cst_api_fill_to_wire_bdk_psbt( BdkPsbt apiObj, wire_cst_bdk_psbt wireObj) { @@ -2062,6 +2440,12 @@ abstract class coreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_bdk_mnemonic(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_bdk_policy( + BdkPolicy apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_bdk_policy(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_bdk_psbt( BdkPsbt apiObj, ffi.Pointer wireObj) { @@ -2099,6 +2483,12 @@ abstract class coreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_blockchain_config(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_condition( + Condition apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_condition(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_consensus_error( ConsensusError apiObj, ffi.Pointer wireObj) { @@ -2159,6 +2549,12 @@ abstract class coreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_out_point(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_pk_or_f( + PkOrF apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_pk_or_f(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_psbt_sig_hash_type( PsbtSigHashType apiObj, @@ -2211,6 +2607,13 @@ abstract class coreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_sqlite_db_configuration(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_condition( + Condition apiObj, wire_cst_condition wireObj) { + wireObj.csv = cst_encode_opt_box_autoadd_u_32(apiObj.csv); + wireObj.timelock = cst_encode_opt_box_autoadd_lock_time(apiObj.timelock); + } + @protected void cst_api_fill_to_wire_consensus_error( ConsensusError apiObj, wire_cst_consensus_error wireObj) { @@ -2461,19 +2864,41 @@ abstract class coreApiImplPlatform extends BaseApiImpl { } @protected - void cst_api_fill_to_wire_psbt_sig_hash_type( - PsbtSigHashType apiObj, wire_cst_psbt_sig_hash_type wireObj) { - wireObj.inner = cst_encode_u_32(apiObj.inner); - } - - @protected - void cst_api_fill_to_wire_rbf_value( - RbfValue apiObj, wire_cst_rbf_value wireObj) { - if (apiObj is RbfValue_RbfDefault) { + void cst_api_fill_to_wire_pk_or_f(PkOrF apiObj, wire_cst_pk_or_f wireObj) { + if (apiObj is PkOrF_Pubkey) { + var pre_value = cst_encode_String(apiObj.value); wireObj.tag = 0; + wireObj.kind.Pubkey.value = pre_value; return; } - if (apiObj is RbfValue_Value) { + if (apiObj is PkOrF_XOnlyPubkey) { + var pre_value = cst_encode_String(apiObj.value); + wireObj.tag = 1; + wireObj.kind.XOnlyPubkey.value = pre_value; + return; + } + if (apiObj is PkOrF_Fingerprint) { + var pre_value = cst_encode_String(apiObj.value); + wireObj.tag = 2; + wireObj.kind.Fingerprint.value = pre_value; + return; + } + } + + @protected + void cst_api_fill_to_wire_psbt_sig_hash_type( + PsbtSigHashType apiObj, wire_cst_psbt_sig_hash_type wireObj) { + wireObj.inner = cst_encode_u_32(apiObj.inner); + } + + @protected + void cst_api_fill_to_wire_rbf_value( + RbfValue apiObj, wire_cst_rbf_value wireObj) { + if (apiObj is RbfValue_RbfDefault) { + wireObj.tag = 0; + return; + } + if (apiObj is RbfValue_Value) { var pre_field0 = cst_encode_u_32(apiObj.field0); wireObj.tag = 1; wireObj.kind.Value.field0 = pre_field0; @@ -2496,6 +2921,14 @@ abstract class coreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_transaction_details(apiObj.$2, wireObj.field1); } + @protected + void cst_api_fill_to_wire_record_list_prim_u_32_strict_list_condition( + (Uint32List, List) apiObj, + wire_cst_record_list_prim_u_32_strict_list_condition wireObj) { + wireObj.field0 = cst_encode_list_prim_u_32_strict(apiObj.$1); + wireObj.field1 = cst_encode_list_condition(apiObj.$2); + } + @protected void cst_api_fill_to_wire_record_out_point_input_usize( (OutPoint, Input, BigInt) apiObj, @@ -2505,6 +2938,22 @@ abstract class coreApiImplPlatform extends BaseApiImpl { wireObj.field2 = cst_encode_usize(apiObj.$3); } + @protected + void cst_api_fill_to_wire_record_string_list_prim_u_32_strict( + (String, Uint32List) apiObj, + wire_cst_record_string_list_prim_u_32_strict wireObj) { + wireObj.field0 = cst_encode_String(apiObj.$1); + wireObj.field1 = cst_encode_list_prim_u_32_strict(apiObj.$2); + } + + @protected + void cst_api_fill_to_wire_record_u_32_list_condition( + (int, List) apiObj, + wire_cst_record_u_32_list_condition wireObj) { + wireObj.field0 = cst_encode_u_32(apiObj.$1); + wireObj.field1 = cst_encode_list_condition(apiObj.$2); + } + @protected void cst_api_fill_to_wire_rpc_config( RpcConfig apiObj, wire_cst_rpc_config wireObj) { @@ -2525,6 +2974,122 @@ abstract class coreApiImplPlatform extends BaseApiImpl { wireObj.poll_rate_sec = cst_encode_u_64(apiObj.pollRateSec); } + @protected + void cst_api_fill_to_wire_satisfaction( + Satisfaction apiObj, wire_cst_satisfaction wireObj) { + if (apiObj is Satisfaction_Partial) { + var pre_n = cst_encode_u_64(apiObj.n); + var pre_m = cst_encode_u_64(apiObj.m); + var pre_items = cst_encode_list_prim_u_64_strict(apiObj.items); + var pre_sorted = cst_encode_opt_box_autoadd_bool(apiObj.sorted); + var pre_conditions = + cst_encode_Map_u_32_list_condition(apiObj.conditions); + wireObj.tag = 0; + wireObj.kind.Partial.n = pre_n; + wireObj.kind.Partial.m = pre_m; + wireObj.kind.Partial.items = pre_items; + wireObj.kind.Partial.sorted = pre_sorted; + wireObj.kind.Partial.conditions = pre_conditions; + return; + } + if (apiObj is Satisfaction_PartialComplete) { + var pre_n = cst_encode_u_64(apiObj.n); + var pre_m = cst_encode_u_64(apiObj.m); + var pre_items = cst_encode_list_prim_u_64_strict(apiObj.items); + var pre_sorted = cst_encode_opt_box_autoadd_bool(apiObj.sorted); + var pre_conditions = cst_encode_Map_list_prim_u_32_strict_list_condition( + apiObj.conditions); + wireObj.tag = 1; + wireObj.kind.PartialComplete.n = pre_n; + wireObj.kind.PartialComplete.m = pre_m; + wireObj.kind.PartialComplete.items = pre_items; + wireObj.kind.PartialComplete.sorted = pre_sorted; + wireObj.kind.PartialComplete.conditions = pre_conditions; + return; + } + if (apiObj is Satisfaction_Complete) { + var pre_condition = cst_encode_box_autoadd_condition(apiObj.condition); + wireObj.tag = 2; + wireObj.kind.Complete.condition = pre_condition; + return; + } + if (apiObj is Satisfaction_None) { + var pre_msg = cst_encode_String(apiObj.msg); + wireObj.tag = 3; + wireObj.kind.None.msg = pre_msg; + return; + } + } + + @protected + void cst_api_fill_to_wire_satisfiable_item( + SatisfiableItem apiObj, wire_cst_satisfiable_item wireObj) { + if (apiObj is SatisfiableItem_EcdsaSignature) { + var pre_key = cst_encode_box_autoadd_pk_or_f(apiObj.key); + wireObj.tag = 0; + wireObj.kind.EcdsaSignature.key = pre_key; + return; + } + if (apiObj is SatisfiableItem_SchnorrSignature) { + var pre_key = cst_encode_box_autoadd_pk_or_f(apiObj.key); + wireObj.tag = 1; + wireObj.kind.SchnorrSignature.key = pre_key; + return; + } + if (apiObj is SatisfiableItem_Sha256Preimage) { + var pre_hash = cst_encode_String(apiObj.hash); + wireObj.tag = 2; + wireObj.kind.Sha256Preimage.hash = pre_hash; + return; + } + if (apiObj is SatisfiableItem_Hash256Preimage) { + var pre_hash = cst_encode_String(apiObj.hash); + wireObj.tag = 3; + wireObj.kind.Hash256Preimage.hash = pre_hash; + return; + } + if (apiObj is SatisfiableItem_Ripemd160Preimage) { + var pre_hash = cst_encode_String(apiObj.hash); + wireObj.tag = 4; + wireObj.kind.Ripemd160Preimage.hash = pre_hash; + return; + } + if (apiObj is SatisfiableItem_Hash160Preimage) { + var pre_hash = cst_encode_String(apiObj.hash); + wireObj.tag = 5; + wireObj.kind.Hash160Preimage.hash = pre_hash; + return; + } + if (apiObj is SatisfiableItem_AbsoluteTimelock) { + var pre_value = cst_encode_box_autoadd_lock_time(apiObj.value); + wireObj.tag = 6; + wireObj.kind.AbsoluteTimelock.value = pre_value; + return; + } + if (apiObj is SatisfiableItem_RelativeTimelock) { + var pre_value = cst_encode_u_32(apiObj.value); + wireObj.tag = 7; + wireObj.kind.RelativeTimelock.value = pre_value; + return; + } + if (apiObj is SatisfiableItem_Multisig) { + var pre_keys = cst_encode_list_pk_or_f(apiObj.keys); + var pre_threshold = cst_encode_u_64(apiObj.threshold); + wireObj.tag = 8; + wireObj.kind.Multisig.keys = pre_keys; + wireObj.kind.Multisig.threshold = pre_threshold; + return; + } + if (apiObj is SatisfiableItem_Thresh) { + var pre_items = cst_encode_list_bdk_policy(apiObj.items); + var pre_threshold = cst_encode_u_64(apiObj.threshold); + wireObj.tag = 9; + wireObj.kind.Thresh.items = pre_items; + wireObj.kind.Thresh.threshold = pre_threshold; + return; + } + } + @protected void cst_api_fill_to_wire_script_amount( ScriptAmount apiObj, wire_cst_script_amount wireObj) { @@ -2601,6 +3166,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { int cst_encode_RustOpaque_bdkdescriptorExtendedDescriptor( ExtendedDescriptor raw); + @protected + int cst_encode_RustOpaque_bdkdescriptorPolicy(Policy raw); + @protected int cst_encode_RustOpaque_bdkkeysDescriptorPublicKey(DescriptorPublicKey raw); @@ -2657,6 +3225,18 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected int cst_encode_word_count(WordCount raw); + @protected + void sse_encode_Map_String_list_prim_u_32_strict( + Map self, SseSerializer serializer); + + @protected + void sse_encode_Map_list_prim_u_32_strict_list_condition( + Map> self, SseSerializer serializer); + + @protected + void sse_encode_Map_u_32_list_condition( + Map> self, SseSerializer serializer); + @protected void sse_encode_RustOpaque_bdkbitcoinAddress( Address self, SseSerializer serializer); @@ -2673,6 +3253,10 @@ abstract class coreApiImplPlatform extends BaseApiImpl { void sse_encode_RustOpaque_bdkdescriptorExtendedDescriptor( ExtendedDescriptor self, SseSerializer serializer); + @protected + void sse_encode_RustOpaque_bdkdescriptorPolicy( + Policy self, SseSerializer serializer); + @protected void sse_encode_RustOpaque_bdkkeysDescriptorPublicKey( DescriptorPublicKey self, SseSerializer serializer); @@ -2740,6 +3324,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_bdk_mnemonic(BdkMnemonic self, SseSerializer serializer); + @protected + void sse_encode_bdk_policy(BdkPolicy self, SseSerializer serializer); + @protected void sse_encode_bdk_psbt(BdkPsbt self, SseSerializer serializer); @@ -2799,6 +3386,10 @@ abstract class coreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_bdk_mnemonic( BdkMnemonic self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_bdk_policy( + BdkPolicy self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_bdk_psbt(BdkPsbt self, SseSerializer serializer); @@ -2822,6 +3413,13 @@ abstract class coreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_blockchain_config( BlockchainConfig self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_bool(bool self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_condition( + Condition self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_consensus_error( ConsensusError self, SseSerializer serializer); @@ -2864,6 +3462,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_out_point( OutPoint self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_pk_or_f(PkOrF self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_psbt_sig_hash_type( PsbtSigHashType self, SseSerializer serializer); @@ -2909,6 +3510,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { void sse_encode_change_spend_policy( ChangeSpendPolicy self, SseSerializer serializer); + @protected + void sse_encode_condition(Condition self, SseSerializer serializer); + @protected void sse_encode_consensus_error( ConsensusError self, SseSerializer serializer); @@ -2946,6 +3550,14 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_keychain_kind(KeychainKind self, SseSerializer serializer); + @protected + void sse_encode_list_bdk_policy( + List self, SseSerializer serializer); + + @protected + void sse_encode_list_condition( + List self, SseSerializer serializer); + @protected void sse_encode_list_list_prim_u_8_strict( List self, SseSerializer serializer); @@ -2957,6 +3569,17 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_list_out_point(List self, SseSerializer serializer); + @protected + void sse_encode_list_pk_or_f(List self, SseSerializer serializer); + + @protected + void sse_encode_list_prim_u_32_strict( + Uint32List self, SseSerializer serializer); + + @protected + void sse_encode_list_prim_u_64_strict( + Uint64List self, SseSerializer serializer); + @protected void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); @@ -2964,6 +3587,18 @@ abstract class coreApiImplPlatform extends BaseApiImpl { void sse_encode_list_prim_u_8_strict( Uint8List self, SseSerializer serializer); + @protected + void sse_encode_list_record_list_prim_u_32_strict_list_condition( + List<(Uint32List, List)> self, SseSerializer serializer); + + @protected + void sse_encode_list_record_string_list_prim_u_32_strict( + List<(String, Uint32List)> self, SseSerializer serializer); + + @protected + void sse_encode_list_record_u_32_list_condition( + List<(int, List)> self, SseSerializer serializer); + @protected void sse_encode_list_script_amount( List self, SseSerializer serializer); @@ -2987,6 +3622,10 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_network(Network self, SseSerializer serializer); + @protected + void sse_encode_opt_Map_String_list_prim_u_32_strict( + Map? self, SseSerializer serializer); + @protected void sse_encode_opt_String(String? self, SseSerializer serializer); @@ -2998,6 +3637,10 @@ abstract class coreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_bdk_descriptor( BdkDescriptor? self, SseSerializer serializer); + @protected + void sse_encode_opt_box_autoadd_bdk_policy( + BdkPolicy? self, SseSerializer serializer); + @protected void sse_encode_opt_box_autoadd_bdk_script_buf( BdkScriptBuf? self, SseSerializer serializer); @@ -3010,6 +3653,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_block_time( BlockTime? self, SseSerializer serializer); + @protected + void sse_encode_opt_box_autoadd_bool(bool? self, SseSerializer serializer); + @protected void sse_encode_opt_box_autoadd_f_32(double? self, SseSerializer serializer); @@ -3017,6 +3663,10 @@ abstract class coreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_fee_rate( FeeRate? self, SseSerializer serializer); + @protected + void sse_encode_opt_box_autoadd_lock_time( + LockTime? self, SseSerializer serializer); + @protected void sse_encode_opt_box_autoadd_psbt_sig_hash_type( PsbtSigHashType? self, SseSerializer serializer); @@ -3052,6 +3702,9 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_payload(Payload self, SseSerializer serializer); + @protected + void sse_encode_pk_or_f(PkOrF self, SseSerializer serializer); + @protected void sse_encode_psbt_sig_hash_type( PsbtSigHashType self, SseSerializer serializer); @@ -3067,16 +3720,35 @@ abstract class coreApiImplPlatform extends BaseApiImpl { void sse_encode_record_bdk_psbt_transaction_details( (BdkPsbt, TransactionDetails) self, SseSerializer serializer); + @protected + void sse_encode_record_list_prim_u_32_strict_list_condition( + (Uint32List, List) self, SseSerializer serializer); + @protected void sse_encode_record_out_point_input_usize( (OutPoint, Input, BigInt) self, SseSerializer serializer); + @protected + void sse_encode_record_string_list_prim_u_32_strict( + (String, Uint32List) self, SseSerializer serializer); + + @protected + void sse_encode_record_u_32_list_condition( + (int, List) self, SseSerializer serializer); + @protected void sse_encode_rpc_config(RpcConfig self, SseSerializer serializer); @protected void sse_encode_rpc_sync_params(RpcSyncParams self, SseSerializer serializer); + @protected + void sse_encode_satisfaction(Satisfaction self, SseSerializer serializer); + + @protected + void sse_encode_satisfiable_item( + SatisfiableItem self, SseSerializer serializer); + @protected void sse_encode_script_amount(ScriptAmount self, SseSerializer serializer); @@ -4267,6 +4939,102 @@ class coreWire implements BaseWire { _wire__crate__api__types__bdk_address_to_qr_uriPtr.asFunction< WireSyncRust2DartDco Function(ffi.Pointer)>(); + WireSyncRust2DartDco wire__crate__api__types__bdk_policy_as_string( + ffi.Pointer that, + ) { + return _wire__crate__api__types__bdk_policy_as_string( + that, + ); + } + + late final _wire__crate__api__types__bdk_policy_as_stringPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>>( + 'frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_as_string'); + late final _wire__crate__api__types__bdk_policy_as_string = + _wire__crate__api__types__bdk_policy_as_stringPtr.asFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>(); + + WireSyncRust2DartDco wire__crate__api__types__bdk_policy_contribution( + ffi.Pointer that, + ) { + return _wire__crate__api__types__bdk_policy_contribution( + that, + ); + } + + late final _wire__crate__api__types__bdk_policy_contributionPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>>( + 'frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_contribution'); + late final _wire__crate__api__types__bdk_policy_contribution = + _wire__crate__api__types__bdk_policy_contributionPtr.asFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>(); + + WireSyncRust2DartDco wire__crate__api__types__bdk_policy_id( + ffi.Pointer that, + ) { + return _wire__crate__api__types__bdk_policy_id( + that, + ); + } + + late final _wire__crate__api__types__bdk_policy_idPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>>( + 'frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_id'); + late final _wire__crate__api__types__bdk_policy_id = + _wire__crate__api__types__bdk_policy_idPtr.asFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>(); + + WireSyncRust2DartDco wire__crate__api__types__bdk_policy_item( + ffi.Pointer that, + ) { + return _wire__crate__api__types__bdk_policy_item( + that, + ); + } + + late final _wire__crate__api__types__bdk_policy_itemPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>>( + 'frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_item'); + late final _wire__crate__api__types__bdk_policy_item = + _wire__crate__api__types__bdk_policy_itemPtr.asFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>(); + + WireSyncRust2DartDco wire__crate__api__types__bdk_policy_requires_path( + ffi.Pointer that, + ) { + return _wire__crate__api__types__bdk_policy_requires_path( + that, + ); + } + + late final _wire__crate__api__types__bdk_policy_requires_pathPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>>( + 'frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_requires_path'); + late final _wire__crate__api__types__bdk_policy_requires_path = + _wire__crate__api__types__bdk_policy_requires_pathPtr.asFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>(); + + WireSyncRust2DartDco wire__crate__api__types__bdk_policy_satisfaction( + ffi.Pointer that, + ) { + return _wire__crate__api__types__bdk_policy_satisfaction( + that, + ); + } + + late final _wire__crate__api__types__bdk_policy_satisfactionPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>>( + 'frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_satisfaction'); + late final _wire__crate__api__types__bdk_policy_satisfaction = + _wire__crate__api__types__bdk_policy_satisfactionPtr.asFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>(); + WireSyncRust2DartDco wire__crate__api__types__bdk_script_buf_as_string( ffi.Pointer that, ) { @@ -4838,6 +5606,26 @@ class coreWire implements BaseWire { int, ffi.Pointer)>(); + WireSyncRust2DartDco wire__crate__api__wallet__bdk_wallet_policies( + ffi.Pointer ptr, + int keychain, + ) { + return _wire__crate__api__wallet__bdk_wallet_policies( + ptr, + keychain, + ); + } + + late final _wire__crate__api__wallet__bdk_wallet_policiesPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Pointer, ffi.Int32)>>( + 'frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_policies'); + late final _wire__crate__api__wallet__bdk_wallet_policies = + _wire__crate__api__wallet__bdk_wallet_policiesPtr.asFunction< + WireSyncRust2DartDco Function( + ffi.Pointer, int)>(); + void wire__crate__api__wallet__bdk_wallet_sign( int port_, ffi.Pointer ptr, @@ -4946,6 +5734,10 @@ class coreWire implements BaseWire { bool drain_wallet, ffi.Pointer drain_to, ffi.Pointer rbf, + ffi.Pointer + internal_policy_path, + ffi.Pointer + external_policy_path, ffi.Pointer data, ) { return _wire__crate__api__wallet__tx_builder_finish( @@ -4962,28 +5754,35 @@ class coreWire implements BaseWire { drain_wallet, drain_to, rbf, + internal_policy_path, + external_policy_path, data, ); } - late final _wire__crate__api__wallet__tx_builder_finishPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Bool, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>( - 'frbgen_bdk_flutter_wire__crate__api__wallet__tx_builder_finish'); + late final _wire__crate__api__wallet__tx_builder_finishPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Bool, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + wire_cst_list_record_string_list_prim_u_32_strict>, + ffi.Pointer< + wire_cst_list_record_string_list_prim_u_32_strict>, + ffi.Pointer)>>( + 'frbgen_bdk_flutter_wire__crate__api__wallet__tx_builder_finish'); late final _wire__crate__api__wallet__tx_builder_finish = _wire__crate__api__wallet__tx_builder_finishPtr.asFunction< void Function( @@ -5000,6 +5799,8 @@ class coreWire implements BaseWire { bool, ffi.Pointer, ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); void rust_arc_increment_strong_count_RustOpaque_bdkbitcoinAddress( @@ -5124,6 +5925,36 @@ class coreWire implements BaseWire { _rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorExtendedDescriptorPtr .asFunction)>(); + void rust_arc_increment_strong_count_RustOpaque_bdkdescriptorPolicy( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_bdkdescriptorPolicy( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_bdkdescriptorPolicyPtr = + _lookup)>>( + 'frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkdescriptorPolicy'); + late final _rust_arc_increment_strong_count_RustOpaque_bdkdescriptorPolicy = + _rust_arc_increment_strong_count_RustOpaque_bdkdescriptorPolicyPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicy( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicy( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicyPtr = + _lookup)>>( + 'frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicy'); + late final _rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicy = + _rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicyPtr + .asFunction)>(); + void rust_arc_increment_strong_count_RustOpaque_bdkkeysDescriptorPublicKey( ffi.Pointer ptr, ) { @@ -5413,6 +6244,17 @@ class coreWire implements BaseWire { _cst_new_box_autoadd_bdk_mnemonicPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_bdk_policy() { + return _cst_new_box_autoadd_bdk_policy(); + } + + late final _cst_new_box_autoadd_bdk_policyPtr = + _lookup Function()>>( + 'frbgen_bdk_flutter_cst_new_box_autoadd_bdk_policy'); + late final _cst_new_box_autoadd_bdk_policy = + _cst_new_box_autoadd_bdk_policyPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_bdk_psbt() { return _cst_new_box_autoadd_bdk_psbt(); } @@ -5480,6 +6322,30 @@ class coreWire implements BaseWire { _cst_new_box_autoadd_blockchain_configPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_bool( + bool value, + ) { + return _cst_new_box_autoadd_bool( + value, + ); + } + + late final _cst_new_box_autoadd_boolPtr = + _lookup Function(ffi.Bool)>>( + 'frbgen_bdk_flutter_cst_new_box_autoadd_bool'); + late final _cst_new_box_autoadd_bool = _cst_new_box_autoadd_boolPtr + .asFunction Function(bool)>(); + + ffi.Pointer cst_new_box_autoadd_condition() { + return _cst_new_box_autoadd_condition(); + } + + late final _cst_new_box_autoadd_conditionPtr = + _lookup Function()>>( + 'frbgen_bdk_flutter_cst_new_box_autoadd_condition'); + late final _cst_new_box_autoadd_condition = _cst_new_box_autoadd_conditionPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_consensus_error() { return _cst_new_box_autoadd_consensus_error(); } @@ -5602,6 +6468,16 @@ class coreWire implements BaseWire { late final _cst_new_box_autoadd_out_point = _cst_new_box_autoadd_out_pointPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_pk_or_f() { + return _cst_new_box_autoadd_pk_or_f(); + } + + late final _cst_new_box_autoadd_pk_or_fPtr = + _lookup Function()>>( + 'frbgen_bdk_flutter_cst_new_box_autoadd_pk_or_f'); + late final _cst_new_box_autoadd_pk_or_f = _cst_new_box_autoadd_pk_or_fPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_psbt_sig_hash_type() { return _cst_new_box_autoadd_psbt_sig_hash_type(); @@ -5739,6 +6615,36 @@ class coreWire implements BaseWire { late final _cst_new_box_autoadd_u_8 = _cst_new_box_autoadd_u_8Ptr .asFunction Function(int)>(); + ffi.Pointer cst_new_list_bdk_policy( + int len, + ) { + return _cst_new_list_bdk_policy( + len, + ); + } + + late final _cst_new_list_bdk_policyPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_bdk_flutter_cst_new_list_bdk_policy'); + late final _cst_new_list_bdk_policy = _cst_new_list_bdk_policyPtr + .asFunction Function(int)>(); + + ffi.Pointer cst_new_list_condition( + int len, + ) { + return _cst_new_list_condition( + len, + ); + } + + late final _cst_new_list_conditionPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_bdk_flutter_cst_new_list_condition'); + late final _cst_new_list_condition = _cst_new_list_conditionPtr + .asFunction Function(int)>(); + ffi.Pointer cst_new_list_list_prim_u_8_strict( int len, @@ -5787,6 +6693,51 @@ class coreWire implements BaseWire { late final _cst_new_list_out_point = _cst_new_list_out_pointPtr .asFunction Function(int)>(); + ffi.Pointer cst_new_list_pk_or_f( + int len, + ) { + return _cst_new_list_pk_or_f( + len, + ); + } + + late final _cst_new_list_pk_or_fPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_bdk_flutter_cst_new_list_pk_or_f'); + late final _cst_new_list_pk_or_f = _cst_new_list_pk_or_fPtr + .asFunction Function(int)>(); + + ffi.Pointer cst_new_list_prim_u_32_strict( + int len, + ) { + return _cst_new_list_prim_u_32_strict( + len, + ); + } + + late final _cst_new_list_prim_u_32_strictPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_bdk_flutter_cst_new_list_prim_u_32_strict'); + late final _cst_new_list_prim_u_32_strict = _cst_new_list_prim_u_32_strictPtr + .asFunction Function(int)>(); + + ffi.Pointer cst_new_list_prim_u_64_strict( + int len, + ) { + return _cst_new_list_prim_u_64_strict( + len, + ); + } + + late final _cst_new_list_prim_u_64_strictPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_bdk_flutter_cst_new_list_prim_u_64_strict'); + late final _cst_new_list_prim_u_64_strict = _cst_new_list_prim_u_64_strictPtr + .asFunction Function(int)>(); + ffi.Pointer cst_new_list_prim_u_8_loose( int len, ) { @@ -5817,6 +6768,64 @@ class coreWire implements BaseWire { late final _cst_new_list_prim_u_8_strict = _cst_new_list_prim_u_8_strictPtr .asFunction Function(int)>(); + ffi.Pointer + cst_new_list_record_list_prim_u_32_strict_list_condition( + int len, + ) { + return _cst_new_list_record_list_prim_u_32_strict_list_condition( + len, + ); + } + + late final _cst_new_list_record_list_prim_u_32_strict_list_conditionPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + wire_cst_list_record_list_prim_u_32_strict_list_condition> + Function(ffi.Int32)>>( + 'frbgen_bdk_flutter_cst_new_list_record_list_prim_u_32_strict_list_condition'); + late final _cst_new_list_record_list_prim_u_32_strict_list_condition = + _cst_new_list_record_list_prim_u_32_strict_list_conditionPtr.asFunction< + ffi.Pointer + Function(int)>(); + + ffi.Pointer + cst_new_list_record_string_list_prim_u_32_strict( + int len, + ) { + return _cst_new_list_record_string_list_prim_u_32_strict( + len, + ); + } + + late final _cst_new_list_record_string_list_prim_u_32_strictPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer + Function(ffi.Int32)>>( + 'frbgen_bdk_flutter_cst_new_list_record_string_list_prim_u_32_strict'); + late final _cst_new_list_record_string_list_prim_u_32_strict = + _cst_new_list_record_string_list_prim_u_32_strictPtr.asFunction< + ffi.Pointer + Function(int)>(); + + ffi.Pointer + cst_new_list_record_u_32_list_condition( + int len, + ) { + return _cst_new_list_record_u_32_list_condition( + len, + ); + } + + late final _cst_new_list_record_u_32_list_conditionPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>( + 'frbgen_bdk_flutter_cst_new_list_record_u_32_list_condition'); + late final _cst_new_list_record_u_32_list_condition = + _cst_new_list_record_u_32_list_conditionPtr.asFunction< + ffi.Pointer Function( + int)>(); + ffi.Pointer cst_new_list_script_amount( int len, ) { @@ -6072,6 +7081,11 @@ final class wire_cst_bdk_script_buf extends ffi.Struct { external ffi.Pointer bytes; } +final class wire_cst_bdk_policy extends ffi.Struct { + @ffi.UintPtr() + external int ptr; +} + final class wire_cst_LockTime_Blocks extends ffi.Struct { @ffi.Uint32() external int field0; @@ -6289,6 +7303,27 @@ final class wire_cst_rbf_value extends ffi.Struct { external RbfValueKind kind; } +final class wire_cst_list_prim_u_32_strict extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_record_string_list_prim_u_32_strict extends ffi.Struct { + external ffi.Pointer field0; + + external ffi.Pointer field1; +} + +final class wire_cst_list_record_string_list_prim_u_32_strict + extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + final class wire_cst_AddressError_Base58 extends ffi.Struct { external ffi.Pointer field0; } @@ -6378,6 +7413,12 @@ final class wire_cst_block_time extends ffi.Struct { external int timestamp; } +final class wire_cst_condition extends ffi.Struct { + external ffi.Pointer csv; + + external ffi.Pointer timelock; +} + final class wire_cst_ConsensusError_Io extends ffi.Struct { external ffi.Pointer field0; } @@ -6524,6 +7565,47 @@ final class wire_cst_hex_error extends ffi.Struct { external HexErrorKind kind; } +final class wire_cst_PkOrF_Pubkey extends ffi.Struct { + external ffi.Pointer value; +} + +final class wire_cst_PkOrF_XOnlyPubkey extends ffi.Struct { + external ffi.Pointer value; +} + +final class wire_cst_PkOrF_Fingerprint extends ffi.Struct { + external ffi.Pointer value; +} + +final class PkOrFKind extends ffi.Union { + external wire_cst_PkOrF_Pubkey Pubkey; + + external wire_cst_PkOrF_XOnlyPubkey XOnlyPubkey; + + external wire_cst_PkOrF_Fingerprint Fingerprint; +} + +final class wire_cst_pk_or_f extends ffi.Struct { + @ffi.Int32() + external int tag; + + external PkOrFKind kind; +} + +final class wire_cst_list_bdk_policy extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_list_condition extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + final class wire_cst_list_local_utxo extends ffi.Struct { external ffi.Pointer ptr; @@ -6531,6 +7613,50 @@ final class wire_cst_list_local_utxo extends ffi.Struct { external int len; } +final class wire_cst_list_pk_or_f extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_list_prim_u_64_strict extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_record_list_prim_u_32_strict_list_condition + extends ffi.Struct { + external ffi.Pointer field0; + + external ffi.Pointer field1; +} + +final class wire_cst_list_record_list_prim_u_32_strict_list_condition + extends ffi.Struct { + external ffi.Pointer + ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_record_u_32_list_condition extends ffi.Struct { + @ffi.Uint32() + external int field0; + + external ffi.Pointer field1; +} + +final class wire_cst_list_record_u_32_list_condition extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + final class wire_cst_transaction_details extends ffi.Struct { external ffi.Pointer transaction; @@ -6857,3 +7983,134 @@ final class wire_cst_record_bdk_psbt_transaction_details extends ffi.Struct { external wire_cst_transaction_details field1; } + +final class wire_cst_Satisfaction_Partial extends ffi.Struct { + @ffi.Uint64() + external int n; + + @ffi.Uint64() + external int m; + + external ffi.Pointer items; + + external ffi.Pointer sorted; + + external ffi.Pointer conditions; +} + +final class wire_cst_Satisfaction_PartialComplete extends ffi.Struct { + @ffi.Uint64() + external int n; + + @ffi.Uint64() + external int m; + + external ffi.Pointer items; + + external ffi.Pointer sorted; + + external ffi + .Pointer + conditions; +} + +final class wire_cst_Satisfaction_Complete extends ffi.Struct { + external ffi.Pointer condition; +} + +final class wire_cst_Satisfaction_None extends ffi.Struct { + external ffi.Pointer msg; +} + +final class SatisfactionKind extends ffi.Union { + external wire_cst_Satisfaction_Partial Partial; + + external wire_cst_Satisfaction_PartialComplete PartialComplete; + + external wire_cst_Satisfaction_Complete Complete; + + external wire_cst_Satisfaction_None None; +} + +final class wire_cst_satisfaction extends ffi.Struct { + @ffi.Int32() + external int tag; + + external SatisfactionKind kind; +} + +final class wire_cst_SatisfiableItem_EcdsaSignature extends ffi.Struct { + external ffi.Pointer key; +} + +final class wire_cst_SatisfiableItem_SchnorrSignature extends ffi.Struct { + external ffi.Pointer key; +} + +final class wire_cst_SatisfiableItem_Sha256Preimage extends ffi.Struct { + external ffi.Pointer hash; +} + +final class wire_cst_SatisfiableItem_Hash256Preimage extends ffi.Struct { + external ffi.Pointer hash; +} + +final class wire_cst_SatisfiableItem_Ripemd160Preimage extends ffi.Struct { + external ffi.Pointer hash; +} + +final class wire_cst_SatisfiableItem_Hash160Preimage extends ffi.Struct { + external ffi.Pointer hash; +} + +final class wire_cst_SatisfiableItem_AbsoluteTimelock extends ffi.Struct { + external ffi.Pointer value; +} + +final class wire_cst_SatisfiableItem_RelativeTimelock extends ffi.Struct { + @ffi.Uint32() + external int value; +} + +final class wire_cst_SatisfiableItem_Multisig extends ffi.Struct { + external ffi.Pointer keys; + + @ffi.Uint64() + external int threshold; +} + +final class wire_cst_SatisfiableItem_Thresh extends ffi.Struct { + external ffi.Pointer items; + + @ffi.Uint64() + external int threshold; +} + +final class SatisfiableItemKind extends ffi.Union { + external wire_cst_SatisfiableItem_EcdsaSignature EcdsaSignature; + + external wire_cst_SatisfiableItem_SchnorrSignature SchnorrSignature; + + external wire_cst_SatisfiableItem_Sha256Preimage Sha256Preimage; + + external wire_cst_SatisfiableItem_Hash256Preimage Hash256Preimage; + + external wire_cst_SatisfiableItem_Ripemd160Preimage Ripemd160Preimage; + + external wire_cst_SatisfiableItem_Hash160Preimage Hash160Preimage; + + external wire_cst_SatisfiableItem_AbsoluteTimelock AbsoluteTimelock; + + external wire_cst_SatisfiableItem_RelativeTimelock RelativeTimelock; + + external wire_cst_SatisfiableItem_Multisig Multisig; + + external wire_cst_SatisfiableItem_Thresh Thresh; +} + +final class wire_cst_satisfiable_item extends ffi.Struct { + @ffi.Int32() + external int tag; + + external SatisfiableItemKind kind; +} diff --git a/lib/src/generated/lib.dart b/lib/src/generated/lib.dart index c4436031..5e7aab92 100644 --- a/lib/src/generated/lib.dart +++ b/lib/src/generated/lib.dart @@ -19,6 +19,9 @@ abstract class AnyBlockchain implements RustOpaqueInterface {} // Rust type: RustOpaqueNom abstract class ExtendedDescriptor implements RustOpaqueInterface {} +// Rust type: RustOpaqueNom +abstract class Policy implements RustOpaqueInterface {} + // Rust type: RustOpaqueNom abstract class DescriptorPublicKey implements RustOpaqueInterface {} diff --git a/lib/src/root.dart b/lib/src/root.dart index d39ff998..e9a856bb 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -742,6 +742,63 @@ class PartiallySignedTransaction extends BdkPsbt { } } +class Policy extends BdkPolicy { + Policy._({required super.ptr}); + + ///Identifier for this policy node + @override + String id() { + return super.id(); + } + + @override + String toString() { + try { + return super.asString(); + } on BdkError catch (e) { + throw mapBdkError(e); + } + } + + ///Return whether or not a specific path in the policy tree is required to unambiguously create a transaction + + ///What this means is that for some spending policies the user should select which paths in the tree it intends to satisfy while signing, because the transaction must be created differently based on that. + @override + bool requiresPath() { + return super.requiresPath(); + } + + ///Type of this policy node + @override + SatisfiableItem item() { + return super.item().when( + ecdsaSignature: (e) => SatisfiableItem.ecdsaSignature(key: e), + schnorrSignature: (e) => SatisfiableItem.ecdsaSignature(key: e), + sha256Preimage: (e) => SatisfiableItem.sha256Preimage(hash: e), + hash256Preimage: (e) => SatisfiableItem.hash256Preimage(hash: e), + ripemd160Preimage: (e) => SatisfiableItem.ripemd160Preimage(hash: e), + hash160Preimage: (e) => SatisfiableItem.hash160Preimage(hash: e), + absoluteTimelock: (e) => SatisfiableItem.absoluteTimelock(value: e), + relativeTimelock: (e) => SatisfiableItem.relativeTimelock(value: e), + multisig: (e, f) => SatisfiableItem.multisig(keys: e, threshold: f), + thresh: (e, f) => SatisfiableItem.thresh( + items: e.map((e) => Policy._(ptr: e.ptr)).toList(), threshold: f), + ); + } + + ///How much a given PSBT already satisfies this policy node in terms of signatures + @override + Satisfaction satisfaction() { + return super.satisfaction(); + } + + ///How the wallet's descriptor can satisfy this policy node + @override + Satisfaction contribution() { + return super.contribution(); + } +} + ///Bitcoin script. class ScriptBuf extends BdkScriptBuf { /// [ScriptBuf] constructor @@ -828,6 +885,8 @@ class TxBuilder { ScriptBuf? _drainTo; RbfValue? _rbfValue; List _data = []; + Map? _internalPolicyPath; + Map? _externalPolicyPath; ///Add data as an output, using OP_RETURN TxBuilder addData({required List data}) { @@ -974,6 +1033,20 @@ class TxBuilder { return this; } + ///Set the policy path to use while creating the transaction for a given keychain. + ///This method accepts a map where the key is the policy node id (see policy.id()) and the value is the list of the indexes of the items that are intended to be satisfied from the policy node (see SatisfiableItem.Thresh.items). + TxBuilder policyPath(KeychainKind keychain, Map path) { + switch (keychain) { + case KeychainKind.externalChain: + _externalPolicyPath = path; + break; + case KeychainKind.internalChain: + _internalPolicyPath = path; + break; + } + return this; + } + ///Only spend change outputs /// /// This effectively adds all the non-change outputs to the “unspendable” list. @@ -1000,6 +1073,8 @@ class TxBuilder { unSpendable: _unSpendable, manuallySelectedOnly: _manuallySelectedOnly, drainWallet: _drainWallet, + externalPolicyPath: _externalPolicyPath, + internalPolicyPath: _internalPolicyPath, rbf: _rbfValue, drainTo: _drainTo, feeAbsolute: _feeAbsolute, @@ -1190,6 +1265,17 @@ class Wallet extends BdkWallet { } } + ///Return the spending policies for the wallet's descriptor + Policy? policies(KeychainKind keychain) { + try { + final res = BdkWallet.policies(ptr: this, keychain: keychain); + if (res == null) return null; + return Policy._(ptr: res.ptr); + } on BdkError catch (e) { + throw mapBdkError(e); + } + } + /// Verify a transaction against the consensus rules /// /// This function uses `bitcoinconsensus` to verify transactions by fetching the required data diff --git a/macos/Classes/frb_generated.h b/macos/Classes/frb_generated.h index 45bed664..5c3e0c91 100644 --- a/macos/Classes/frb_generated.h +++ b/macos/Classes/frb_generated.h @@ -139,6 +139,10 @@ typedef struct wire_cst_bdk_script_buf { struct wire_cst_list_prim_u_8_strict *bytes; } wire_cst_bdk_script_buf; +typedef struct wire_cst_bdk_policy { + uintptr_t ptr; +} wire_cst_bdk_policy; + typedef struct wire_cst_LockTime_Blocks { uint32_t field0; } wire_cst_LockTime_Blocks; @@ -297,6 +301,21 @@ typedef struct wire_cst_rbf_value { union RbfValueKind kind; } wire_cst_rbf_value; +typedef struct wire_cst_list_prim_u_32_strict { + uint32_t *ptr; + int32_t len; +} wire_cst_list_prim_u_32_strict; + +typedef struct wire_cst_record_string_list_prim_u_32_strict { + struct wire_cst_list_prim_u_8_strict *field0; + struct wire_cst_list_prim_u_32_strict *field1; +} wire_cst_record_string_list_prim_u_32_strict; + +typedef struct wire_cst_list_record_string_list_prim_u_32_strict { + struct wire_cst_record_string_list_prim_u_32_strict *ptr; + int32_t len; +} wire_cst_list_record_string_list_prim_u_32_strict; + typedef struct wire_cst_AddressError_Base58 { struct wire_cst_list_prim_u_8_strict *field0; } wire_cst_AddressError_Base58; @@ -358,6 +377,11 @@ typedef struct wire_cst_block_time { uint64_t timestamp; } wire_cst_block_time; +typedef struct wire_cst_condition { + uint32_t *csv; + struct wire_cst_lock_time *timelock; +} wire_cst_condition; + typedef struct wire_cst_ConsensusError_Io { struct wire_cst_list_prim_u_8_strict *field0; } wire_cst_ConsensusError_Io; @@ -469,11 +493,74 @@ typedef struct wire_cst_hex_error { union HexErrorKind kind; } wire_cst_hex_error; +typedef struct wire_cst_PkOrF_Pubkey { + struct wire_cst_list_prim_u_8_strict *value; +} wire_cst_PkOrF_Pubkey; + +typedef struct wire_cst_PkOrF_XOnlyPubkey { + struct wire_cst_list_prim_u_8_strict *value; +} wire_cst_PkOrF_XOnlyPubkey; + +typedef struct wire_cst_PkOrF_Fingerprint { + struct wire_cst_list_prim_u_8_strict *value; +} wire_cst_PkOrF_Fingerprint; + +typedef union PkOrFKind { + struct wire_cst_PkOrF_Pubkey Pubkey; + struct wire_cst_PkOrF_XOnlyPubkey XOnlyPubkey; + struct wire_cst_PkOrF_Fingerprint Fingerprint; +} PkOrFKind; + +typedef struct wire_cst_pk_or_f { + int32_t tag; + union PkOrFKind kind; +} wire_cst_pk_or_f; + +typedef struct wire_cst_list_bdk_policy { + struct wire_cst_bdk_policy *ptr; + int32_t len; +} wire_cst_list_bdk_policy; + +typedef struct wire_cst_list_condition { + struct wire_cst_condition *ptr; + int32_t len; +} wire_cst_list_condition; + typedef struct wire_cst_list_local_utxo { struct wire_cst_local_utxo *ptr; int32_t len; } wire_cst_list_local_utxo; +typedef struct wire_cst_list_pk_or_f { + struct wire_cst_pk_or_f *ptr; + int32_t len; +} wire_cst_list_pk_or_f; + +typedef struct wire_cst_list_prim_u_64_strict { + uint64_t *ptr; + int32_t len; +} wire_cst_list_prim_u_64_strict; + +typedef struct wire_cst_record_list_prim_u_32_strict_list_condition { + struct wire_cst_list_prim_u_32_strict *field0; + struct wire_cst_list_condition *field1; +} wire_cst_record_list_prim_u_32_strict_list_condition; + +typedef struct wire_cst_list_record_list_prim_u_32_strict_list_condition { + struct wire_cst_record_list_prim_u_32_strict_list_condition *ptr; + int32_t len; +} wire_cst_list_record_list_prim_u_32_strict_list_condition; + +typedef struct wire_cst_record_u_32_list_condition { + uint32_t field0; + struct wire_cst_list_condition *field1; +} wire_cst_record_u_32_list_condition; + +typedef struct wire_cst_list_record_u_32_list_condition { + struct wire_cst_record_u_32_list_condition *ptr; + int32_t len; +} wire_cst_list_record_u_32_list_condition; + typedef struct wire_cst_transaction_details { struct wire_cst_bdk_transaction *transaction; struct wire_cst_list_prim_u_8_strict *txid; @@ -722,6 +809,102 @@ typedef struct wire_cst_record_bdk_psbt_transaction_details { struct wire_cst_transaction_details field1; } wire_cst_record_bdk_psbt_transaction_details; +typedef struct wire_cst_Satisfaction_Partial { + uint64_t n; + uint64_t m; + struct wire_cst_list_prim_u_64_strict *items; + bool *sorted; + struct wire_cst_list_record_u_32_list_condition *conditions; +} wire_cst_Satisfaction_Partial; + +typedef struct wire_cst_Satisfaction_PartialComplete { + uint64_t n; + uint64_t m; + struct wire_cst_list_prim_u_64_strict *items; + bool *sorted; + struct wire_cst_list_record_list_prim_u_32_strict_list_condition *conditions; +} wire_cst_Satisfaction_PartialComplete; + +typedef struct wire_cst_Satisfaction_Complete { + struct wire_cst_condition *condition; +} wire_cst_Satisfaction_Complete; + +typedef struct wire_cst_Satisfaction_None { + struct wire_cst_list_prim_u_8_strict *msg; +} wire_cst_Satisfaction_None; + +typedef union SatisfactionKind { + struct wire_cst_Satisfaction_Partial Partial; + struct wire_cst_Satisfaction_PartialComplete PartialComplete; + struct wire_cst_Satisfaction_Complete Complete; + struct wire_cst_Satisfaction_None None; +} SatisfactionKind; + +typedef struct wire_cst_satisfaction { + int32_t tag; + union SatisfactionKind kind; +} wire_cst_satisfaction; + +typedef struct wire_cst_SatisfiableItem_EcdsaSignature { + struct wire_cst_pk_or_f *key; +} wire_cst_SatisfiableItem_EcdsaSignature; + +typedef struct wire_cst_SatisfiableItem_SchnorrSignature { + struct wire_cst_pk_or_f *key; +} wire_cst_SatisfiableItem_SchnorrSignature; + +typedef struct wire_cst_SatisfiableItem_Sha256Preimage { + struct wire_cst_list_prim_u_8_strict *hash; +} wire_cst_SatisfiableItem_Sha256Preimage; + +typedef struct wire_cst_SatisfiableItem_Hash256Preimage { + struct wire_cst_list_prim_u_8_strict *hash; +} wire_cst_SatisfiableItem_Hash256Preimage; + +typedef struct wire_cst_SatisfiableItem_Ripemd160Preimage { + struct wire_cst_list_prim_u_8_strict *hash; +} wire_cst_SatisfiableItem_Ripemd160Preimage; + +typedef struct wire_cst_SatisfiableItem_Hash160Preimage { + struct wire_cst_list_prim_u_8_strict *hash; +} wire_cst_SatisfiableItem_Hash160Preimage; + +typedef struct wire_cst_SatisfiableItem_AbsoluteTimelock { + struct wire_cst_lock_time *value; +} wire_cst_SatisfiableItem_AbsoluteTimelock; + +typedef struct wire_cst_SatisfiableItem_RelativeTimelock { + uint32_t value; +} wire_cst_SatisfiableItem_RelativeTimelock; + +typedef struct wire_cst_SatisfiableItem_Multisig { + struct wire_cst_list_pk_or_f *keys; + uint64_t threshold; +} wire_cst_SatisfiableItem_Multisig; + +typedef struct wire_cst_SatisfiableItem_Thresh { + struct wire_cst_list_bdk_policy *items; + uint64_t threshold; +} wire_cst_SatisfiableItem_Thresh; + +typedef union SatisfiableItemKind { + struct wire_cst_SatisfiableItem_EcdsaSignature EcdsaSignature; + struct wire_cst_SatisfiableItem_SchnorrSignature SchnorrSignature; + struct wire_cst_SatisfiableItem_Sha256Preimage Sha256Preimage; + struct wire_cst_SatisfiableItem_Hash256Preimage Hash256Preimage; + struct wire_cst_SatisfiableItem_Ripemd160Preimage Ripemd160Preimage; + struct wire_cst_SatisfiableItem_Hash160Preimage Hash160Preimage; + struct wire_cst_SatisfiableItem_AbsoluteTimelock AbsoluteTimelock; + struct wire_cst_SatisfiableItem_RelativeTimelock RelativeTimelock; + struct wire_cst_SatisfiableItem_Multisig Multisig; + struct wire_cst_SatisfiableItem_Thresh Thresh; +} SatisfiableItemKind; + +typedef struct wire_cst_satisfiable_item { + int32_t tag; + union SatisfiableItemKind kind; +} wire_cst_satisfiable_item; + void frbgen_bdk_flutter_wire__crate__api__blockchain__bdk_blockchain_broadcast(int64_t port_, struct wire_cst_bdk_blockchain *that, struct wire_cst_bdk_transaction *transaction); @@ -886,6 +1069,18 @@ WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_address_scr WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_address_to_qr_uri(struct wire_cst_bdk_address *that); +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_as_string(struct wire_cst_bdk_policy *that); + +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_contribution(struct wire_cst_bdk_policy *that); + +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_id(struct wire_cst_bdk_policy *that); + +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_item(struct wire_cst_bdk_policy *that); + +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_requires_path(struct wire_cst_bdk_policy *that); + +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_satisfaction(struct wire_cst_bdk_policy *that); + WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_script_buf_as_string(struct wire_cst_bdk_script_buf *that); WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__types__bdk_script_buf_empty(void); @@ -974,6 +1169,9 @@ void frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_new(int64_t port_, int32_t network, struct wire_cst_database_config *database_config); +WireSyncRust2DartDco frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_policies(struct wire_cst_bdk_wallet *ptr, + int32_t keychain); + void frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_sign(int64_t port_, struct wire_cst_bdk_wallet *ptr, struct wire_cst_bdk_psbt *psbt, @@ -1004,6 +1202,8 @@ void frbgen_bdk_flutter_wire__crate__api__wallet__tx_builder_finish(int64_t port bool drain_wallet, struct wire_cst_bdk_script_buf *drain_to, struct wire_cst_rbf_value *rbf, + struct wire_cst_list_record_string_list_prim_u_32_strict *internal_policy_path, + struct wire_cst_list_record_string_list_prim_u_32_strict *external_policy_path, struct wire_cst_list_prim_u_8_loose *data); void frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkbitcoinAddress(const void *ptr); @@ -1022,6 +1222,10 @@ void frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkdescriptor void frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorExtendedDescriptor(const void *ptr); +void frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkdescriptorPolicy(const void *ptr); + +void frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicy(const void *ptr); + void frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkkeysDescriptorPublicKey(const void *ptr); void frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkkeysDescriptorPublicKey(const void *ptr); @@ -1064,6 +1268,8 @@ struct wire_cst_bdk_descriptor_secret_key *frbgen_bdk_flutter_cst_new_box_autoad struct wire_cst_bdk_mnemonic *frbgen_bdk_flutter_cst_new_box_autoadd_bdk_mnemonic(void); +struct wire_cst_bdk_policy *frbgen_bdk_flutter_cst_new_box_autoadd_bdk_policy(void); + struct wire_cst_bdk_psbt *frbgen_bdk_flutter_cst_new_box_autoadd_bdk_psbt(void); struct wire_cst_bdk_script_buf *frbgen_bdk_flutter_cst_new_box_autoadd_bdk_script_buf(void); @@ -1076,6 +1282,10 @@ struct wire_cst_block_time *frbgen_bdk_flutter_cst_new_box_autoadd_block_time(vo struct wire_cst_blockchain_config *frbgen_bdk_flutter_cst_new_box_autoadd_blockchain_config(void); +bool *frbgen_bdk_flutter_cst_new_box_autoadd_bool(bool value); + +struct wire_cst_condition *frbgen_bdk_flutter_cst_new_box_autoadd_condition(void); + struct wire_cst_consensus_error *frbgen_bdk_flutter_cst_new_box_autoadd_consensus_error(void); struct wire_cst_database_config *frbgen_bdk_flutter_cst_new_box_autoadd_database_config(void); @@ -1098,6 +1308,8 @@ struct wire_cst_lock_time *frbgen_bdk_flutter_cst_new_box_autoadd_lock_time(void struct wire_cst_out_point *frbgen_bdk_flutter_cst_new_box_autoadd_out_point(void); +struct wire_cst_pk_or_f *frbgen_bdk_flutter_cst_new_box_autoadd_pk_or_f(void); + struct wire_cst_psbt_sig_hash_type *frbgen_bdk_flutter_cst_new_box_autoadd_psbt_sig_hash_type(void); struct wire_cst_rbf_value *frbgen_bdk_flutter_cst_new_box_autoadd_rbf_value(void); @@ -1120,16 +1332,32 @@ uint64_t *frbgen_bdk_flutter_cst_new_box_autoadd_u_64(uint64_t value); uint8_t *frbgen_bdk_flutter_cst_new_box_autoadd_u_8(uint8_t value); +struct wire_cst_list_bdk_policy *frbgen_bdk_flutter_cst_new_list_bdk_policy(int32_t len); + +struct wire_cst_list_condition *frbgen_bdk_flutter_cst_new_list_condition(int32_t len); + struct wire_cst_list_list_prim_u_8_strict *frbgen_bdk_flutter_cst_new_list_list_prim_u_8_strict(int32_t len); struct wire_cst_list_local_utxo *frbgen_bdk_flutter_cst_new_list_local_utxo(int32_t len); struct wire_cst_list_out_point *frbgen_bdk_flutter_cst_new_list_out_point(int32_t len); +struct wire_cst_list_pk_or_f *frbgen_bdk_flutter_cst_new_list_pk_or_f(int32_t len); + +struct wire_cst_list_prim_u_32_strict *frbgen_bdk_flutter_cst_new_list_prim_u_32_strict(int32_t len); + +struct wire_cst_list_prim_u_64_strict *frbgen_bdk_flutter_cst_new_list_prim_u_64_strict(int32_t len); + struct wire_cst_list_prim_u_8_loose *frbgen_bdk_flutter_cst_new_list_prim_u_8_loose(int32_t len); struct wire_cst_list_prim_u_8_strict *frbgen_bdk_flutter_cst_new_list_prim_u_8_strict(int32_t len); +struct wire_cst_list_record_list_prim_u_32_strict_list_condition *frbgen_bdk_flutter_cst_new_list_record_list_prim_u_32_strict_list_condition(int32_t len); + +struct wire_cst_list_record_string_list_prim_u_32_strict *frbgen_bdk_flutter_cst_new_list_record_string_list_prim_u_32_strict(int32_t len); + +struct wire_cst_list_record_u_32_list_condition *frbgen_bdk_flutter_cst_new_list_record_u_32_list_condition(int32_t len); + struct wire_cst_list_script_amount *frbgen_bdk_flutter_cst_new_list_script_amount(int32_t len); struct wire_cst_list_transaction_details *frbgen_bdk_flutter_cst_new_list_transaction_details(int32_t len); @@ -1148,12 +1376,15 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_descriptor_public_key); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_descriptor_secret_key); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_mnemonic); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_policy); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_psbt); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_script_buf); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_transaction); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bdk_wallet); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_block_time); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_blockchain_config); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_bool); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_condition); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_consensus_error); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_database_config); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_descriptor_error); @@ -1165,6 +1396,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_local_utxo); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_lock_time); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_out_point); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_pk_or_f); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_psbt_sig_hash_type); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_rbf_value); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_record_out_point_input_usize); @@ -1176,11 +1408,19 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_u_32); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_u_64); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_box_autoadd_u_8); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_bdk_policy); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_condition); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_list_prim_u_8_strict); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_local_utxo); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_out_point); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_pk_or_f); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_prim_u_32_strict); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_prim_u_64_strict); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_prim_u_8_loose); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_prim_u_8_strict); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_record_list_prim_u_32_strict_list_condition); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_record_string_list_prim_u_32_strict); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_record_u_32_list_condition); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_script_amount); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_transaction_details); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_cst_new_list_tx_in); @@ -1189,6 +1429,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkbitcoinbip32DerivationPath); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkblockchainAnyBlockchain); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorExtendedDescriptor); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicy); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkkeysDescriptorPublicKey); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkkeysDescriptorSecretKey); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkkeysKeyMap); @@ -1199,6 +1440,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkbitcoinbip32DerivationPath); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkblockchainAnyBlockchain); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkdescriptorExtendedDescriptor); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkdescriptorPolicy); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkkeysDescriptorPublicKey); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkkeysDescriptorSecretKey); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkkeysKeyMap); @@ -1256,6 +1498,12 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_address_payload); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_address_script); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_address_to_qr_uri); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_as_string); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_contribution); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_id); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_item); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_requires_path); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_satisfaction); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_script_buf_as_string); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_script_buf_empty); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__types__bdk_script_buf_from_hex); @@ -1284,6 +1532,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_list_unspent); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_network); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_new); + dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_policies); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_sign); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_sync); dummy_var ^= ((int64_t) (void*) frbgen_bdk_flutter_wire__crate__api__wallet__finish_bump_fee_tx_builder); diff --git a/rust/src/api/mod.rs b/rust/src/api/mod.rs index 03f77c7d..acf4d1d3 100644 --- a/rust/src/api/mod.rs +++ b/rust/src/api/mod.rs @@ -10,16 +10,15 @@ pub mod psbt; pub mod types; pub mod wallet; -pub(crate) fn handle_mutex(lock: &Mutex, operation: F) -> Result +pub(crate) fn execute_with_lock(lock: &Mutex, operation: F) -> Result where T: Debug, F: FnOnce(&mut T) -> R, { - match lock.lock() { - Ok(mut mutex_guard) => Ok(operation(&mut *mutex_guard)), - Err(poisoned) => { + lock.lock() + .map_err(|poisoned| { drop(poisoned.into_inner()); - Err(BdkError::Generic("Poison Error!".to_string())) - } - } + BdkError::Generic("Poison Error!".to_string()) + }) + .map(|mut guard| operation(&mut *guard)) } diff --git a/rust/src/api/psbt.rs b/rust/src/api/psbt.rs index 780fae47..c31e9520 100644 --- a/rust/src/api/psbt.rs +++ b/rust/src/api/psbt.rs @@ -8,7 +8,7 @@ use std::str::FromStr; use flutter_rust_bridge::frb; -use super::handle_mutex; +use super::execute_with_lock; #[derive(Debug)] pub struct BdkPsbt { @@ -31,7 +31,7 @@ impl BdkPsbt { #[frb(sync)] pub fn as_string(&self) -> Result { - handle_mutex(&self.ptr, |psbt| psbt.to_string()) + execute_with_lock(&self.ptr, |psbt| psbt.to_string()) } ///Computes the `Txid`. @@ -39,7 +39,7 @@ impl BdkPsbt { /// For non-segwit transactions which do not have any segwit data, this will be equal to transaction.wtxid(). #[frb(sync)] pub fn txid(&self) -> Result { - handle_mutex(&self.ptr, |psbt| { + execute_with_lock(&self.ptr, |psbt| { psbt.to_owned().extract_tx().txid().to_string() }) } @@ -47,7 +47,7 @@ impl BdkPsbt { /// Return the transaction. #[frb(sync)] pub fn extract_tx(ptr: BdkPsbt) -> Result { - handle_mutex(&ptr.ptr, |psbt| { + execute_with_lock(&ptr.ptr, |psbt| { let tx = psbt.to_owned().extract_tx(); tx.try_into() })? @@ -74,7 +74,7 @@ impl BdkPsbt { /// If the PSBT is missing a TxOut for an input returns None. #[frb(sync)] pub fn fee_amount(&self) -> Result, BdkError> { - handle_mutex(&self.ptr, |psbt| psbt.fee_amount()) + execute_with_lock(&self.ptr, |psbt| psbt.fee_amount()) } /// The transaction's fee rate. This value will only be accurate if calculated AFTER the @@ -83,18 +83,18 @@ impl BdkPsbt { /// If the PSBT is missing a TxOut for an input returns None. #[frb(sync)] pub fn fee_rate(&self) -> Result, BdkError> { - handle_mutex(&self.ptr, |psbt| psbt.fee_rate().map(|e| e.into())) + execute_with_lock(&self.ptr, |psbt| psbt.fee_rate().map(|e| e.into())) } ///Serialize as raw binary data #[frb(sync)] pub fn serialize(&self) -> Result, BdkError> { - handle_mutex(&self.ptr, |psbt| psbt.serialize()) + execute_with_lock(&self.ptr, |psbt| psbt.serialize()) } /// Serialize the PSBT data structure as a String of JSON. #[frb(sync)] pub fn json_serialize(&self) -> Result { - handle_mutex(&self.ptr, |psbt| { + execute_with_lock(&self.ptr, |psbt| { serde_json::to_string(psbt.deref()).map_err(|e| BdkError::Generic(e.to_string())) })? } diff --git a/rust/src/api/types.rs b/rust/src/api/types.rs index 09685f48..a721c5cb 100644 --- a/rust/src/api/types.rs +++ b/rust/src/api/types.rs @@ -5,6 +5,7 @@ use bdk::bitcoin::hashes::hex::Error; use bdk::database::AnyDatabaseConfig; use flutter_rust_bridge::frb; use serde::{Deserialize, Serialize}; +use std::collections::HashMap; use std::io::Cursor; use std::str::FromStr; @@ -543,6 +544,7 @@ impl From for Variant { } } } +#[derive(Debug, Clone)] pub enum LockTime { Blocks(u32), Seconds(u32), @@ -912,3 +914,255 @@ impl TryFrom for Input { }) } } +#[derive(Debug, Clone)] +pub struct BdkPolicy { + pub ptr: RustOpaque, +} +impl BdkPolicy { + #[frb(sync)] + pub fn id(&self) -> String { + self.ptr.id.clone() + } + #[frb(sync)] + pub fn as_string(&self) -> Result { + serde_json::to_string(&*self.ptr).map_err(|e| BdkError::Generic(e.to_string())) + } + #[frb(sync)] + pub fn requires_path(&self) -> bool { + self.ptr.requires_path() + } + #[frb(sync)] + pub fn item(&self) -> SatisfiableItem { + self.ptr.item.clone().into() + } + #[frb(sync)] + pub fn satisfaction(&self) -> Satisfaction { + self.ptr.satisfaction.clone().into() + } + #[frb(sync)] + pub fn contribution(&self) -> Satisfaction { + self.ptr.contribution.clone().into() + } +} +impl From for BdkPolicy { + fn from(value: bdk::descriptor::Policy) -> Self { + BdkPolicy { + ptr: RustOpaque::new(value), + } + } +} + +#[derive(Debug, Clone)] +pub enum SatisfiableItem { + EcdsaSignature { + key: PkOrF, + }, + SchnorrSignature { + key: PkOrF, + }, + Sha256Preimage { + hash: String, + }, + Hash256Preimage { + hash: String, + }, + Ripemd160Preimage { + hash: String, + }, + Hash160Preimage { + hash: String, + }, + AbsoluteTimelock { + value: LockTime, + }, + RelativeTimelock { + value: u32, + }, + + Multisig { + keys: Vec, + + threshold: u64, + }, + + Thresh { + items: Vec, + + threshold: u64, + }, +} +impl From for SatisfiableItem { + fn from(value: bdk::descriptor::policy::SatisfiableItem) -> Self { + match value { + bdk::descriptor::policy::SatisfiableItem::EcdsaSignature(pk_or_f) => { + SatisfiableItem::EcdsaSignature { + key: pk_or_f.into(), + } + } + bdk::descriptor::policy::SatisfiableItem::SchnorrSignature(pk_or_f) => { + SatisfiableItem::SchnorrSignature { + key: pk_or_f.into(), + } + } + bdk::descriptor::policy::SatisfiableItem::Sha256Preimage { hash } => { + SatisfiableItem::Sha256Preimage { + hash: hash.to_string(), + } + } + bdk::descriptor::policy::SatisfiableItem::Hash256Preimage { hash } => { + SatisfiableItem::Hash256Preimage { + hash: hash.to_string(), + } + } + bdk::descriptor::policy::SatisfiableItem::Ripemd160Preimage { hash } => { + SatisfiableItem::Ripemd160Preimage { + hash: hash.to_string(), + } + } + bdk::descriptor::policy::SatisfiableItem::Hash160Preimage { hash } => { + SatisfiableItem::Hash160Preimage { + hash: hash.to_string(), + } + } + bdk::descriptor::policy::SatisfiableItem::AbsoluteTimelock { value } => { + SatisfiableItem::AbsoluteTimelock { + value: value.into(), + } + } + bdk::descriptor::policy::SatisfiableItem::RelativeTimelock { value } => { + SatisfiableItem::RelativeTimelock { + value: value.to_consensus_u32(), + } + } + bdk::descriptor::policy::SatisfiableItem::Multisig { keys, threshold } => { + SatisfiableItem::Multisig { + keys: keys.iter().map(|e| e.to_owned().into()).collect(), + threshold: threshold as u64, + } + } + bdk::descriptor::policy::SatisfiableItem::Thresh { items, threshold } => { + SatisfiableItem::Thresh { + items: items.iter().map(|e| e.to_owned().into()).collect(), + threshold: threshold as u64, + } + } + } + } +} + +#[derive(Debug, Clone)] +pub enum PkOrF { + Pubkey { value: String }, + XOnlyPubkey { value: String }, + Fingerprint { value: String }, +} +impl From for PkOrF { + fn from(value: bdk::descriptor::policy::PkOrF) -> Self { + match value { + bdk::descriptor::policy::PkOrF::Pubkey(public_key) => PkOrF::Pubkey { + value: public_key.to_string(), + }, + bdk::descriptor::policy::PkOrF::XOnlyPubkey(xonly_public_key) => PkOrF::XOnlyPubkey { + value: xonly_public_key.to_string(), + }, + bdk::descriptor::policy::PkOrF::Fingerprint(fingerprint) => PkOrF::Fingerprint { + value: fingerprint.to_string(), + }, + } + } +} + +#[derive(Debug, Clone)] +pub enum Satisfaction { + Partial { + n: u64, + m: u64, + items: Vec, + sorted: Option, + conditions: HashMap>, + }, + PartialComplete { + n: u64, + m: u64, + items: Vec, + sorted: Option, + conditions: HashMap, Vec>, + }, + Complete { + condition: Condition, + }, + + None { + msg: String, + }, +} +impl From for Satisfaction { + fn from(value: bdk::descriptor::policy::Satisfaction) -> Self { + match value { + bdk::descriptor::policy::Satisfaction::Partial { + n, + m, + items, + sorted, + conditions, + } => Satisfaction::Partial { + n: n as u64, + m: m as u64, + items: items.iter().map(|e| e.to_owned() as u64).collect(), + sorted, + conditions: conditions + .into_iter() + .map(|(index, conditions)| { + ( + index as u32, + conditions.into_iter().map(|e| e.into()).collect(), + ) + }) + .collect(), + }, + bdk::descriptor::policy::Satisfaction::PartialComplete { + n, + m, + items, + sorted, + conditions, + } => Satisfaction::PartialComplete { + n: n as u64, + m: m as u64, + items: items.iter().map(|e| e.to_owned() as u64).collect(), + sorted, + conditions: conditions + .into_iter() + .map(|(index, conditions)| { + ( + index.iter().map(|e| e.to_owned() as u32).collect(), + conditions.into_iter().map(|e| e.into()).collect(), // Convert each `Condition` to `YourType` + ) + }) + .collect(), + }, + bdk::descriptor::policy::Satisfaction::Complete { condition } => { + Satisfaction::Complete { + condition: condition.into(), + } + } + bdk::descriptor::policy::Satisfaction::None => Satisfaction::None { + msg: "Cannot satisfy or contribute to the policy item".to_string(), + }, + } + } +} + +#[derive(Debug, Clone)] +pub struct Condition { + pub csv: Option, + pub timelock: Option, +} +impl From for Condition { + fn from(value: bdk::descriptor::policy::Condition) -> Self { + Condition { + csv: value.csv.map(|e| e.to_consensus_u32()), + timelock: value.timelock.map(|e| e.into()), + } + } +} diff --git a/rust/src/api/wallet.rs b/rust/src/api/wallet.rs index ec593ada..46e37649 100644 --- a/rust/src/api/wallet.rs +++ b/rust/src/api/wallet.rs @@ -1,22 +1,10 @@ use crate::api::descriptor::BdkDescriptor; use crate::api::types::{ - AddressIndex, - Balance, - BdkAddress, - BdkScriptBuf, - ChangeSpendPolicy, - DatabaseConfig, - Input, - KeychainKind, - LocalUtxo, - Network, - OutPoint, - PsbtSigHashType, - RbfValue, - ScriptAmount, - SignOptions, - TransactionDetails, + AddressIndex, Balance, BdkAddress, BdkScriptBuf, ChangeSpendPolicy, DatabaseConfig, Input, + KeychainKind, LocalUtxo, Network, OutPoint, PsbtSigHashType, RbfValue, ScriptAmount, + SignOptions, TransactionDetails, }; +use std::collections::{BTreeMap, HashMap}; use std::ops::Deref; use std::str::FromStr; @@ -25,13 +13,14 @@ use crate::api::error::BdkError; use crate::api::psbt::BdkPsbt; use crate::frb_generated::RustOpaque; use bdk::bitcoin::script::PushBytesBuf; -use bdk::bitcoin::{ Sequence, Txid }; +use bdk::bitcoin::{Sequence, Txid}; pub use bdk::blockchain::GetTx; use bdk::database::ConfigurableDatabase; use flutter_rust_bridge::frb; -use super::handle_mutex; +use super::execute_with_lock; +use super::types::BdkPolicy; #[derive(Debug)] pub struct BdkWallet { @@ -42,7 +31,7 @@ impl BdkWallet { descriptor: BdkDescriptor, change_descriptor: Option, network: Network, - database_config: DatabaseConfig + database_config: DatabaseConfig, ) -> Result { let database = bdk::database::AnyDatabase::from_config(&database_config.into())?; let descriptor: String = descriptor.to_string_private(); @@ -52,7 +41,7 @@ impl BdkWallet { &descriptor, change_descriptor.as_ref(), network.into(), - database + database, )?; Ok(BdkWallet { ptr: RustOpaque::new(std::sync::Mutex::new(wallet)), @@ -62,14 +51,13 @@ impl BdkWallet { /// Get the Bitcoin network the wallet is using. #[frb(sync)] pub fn network(&self) -> Result { - handle_mutex(&self.ptr, |w| w.network().into()) + execute_with_lock(&self.ptr, |w| w.network().into()) } #[frb(sync)] pub fn is_mine(&self, script: BdkScriptBuf) -> Result { - handle_mutex(&self.ptr, |w| { - w.is_mine( - >::into(script).as_script() - ).map_err(|e| e.into()) + execute_with_lock(&self.ptr, |w| { + w.is_mine(>::into(script).as_script()) + .map_err(|e| e.into()) })? } /// Return a derived address using the external descriptor, see AddressIndex for available address index selection @@ -78,9 +66,9 @@ impl BdkWallet { #[frb(sync)] pub fn get_address( ptr: BdkWallet, - address_index: AddressIndex + address_index: AddressIndex, ) -> Result<(BdkAddress, u32), BdkError> { - handle_mutex(&ptr.ptr, |w| { + execute_with_lock(&ptr.ptr, |w| { w.get_address(address_index.into()) .map(|e| (e.address.into(), e.index)) .map_err(|e| e.into()) @@ -97,9 +85,9 @@ impl BdkWallet { #[frb(sync)] pub fn get_internal_address( ptr: BdkWallet, - address_index: AddressIndex + address_index: AddressIndex, ) -> Result<(BdkAddress, u32), BdkError> { - handle_mutex(&ptr.ptr, |w| { + execute_with_lock(&ptr.ptr, |w| { w.get_internal_address(address_index.into()) .map(|e| (e.address.into(), e.index)) .map_err(|e| e.into()) @@ -110,19 +98,17 @@ impl BdkWallet { /// on the internal database, which first needs to be Wallet.sync manually. #[frb(sync)] pub fn get_balance(&self) -> Result { - handle_mutex(&self.ptr, |w| { - w.get_balance() - .map(|b| b.into()) - .map_err(|e| e.into()) + execute_with_lock(&self.ptr, |w| { + w.get_balance().map(|b| b.into()).map_err(|e| e.into()) })? } /// Return the list of transactions made and received by the wallet. Note that this method only operate on the internal database, which first needs to be [Wallet.sync] manually. #[frb(sync)] pub fn list_transactions( &self, - include_raw: bool + include_raw: bool, ) -> Result, BdkError> { - handle_mutex(&self.ptr, |wallet| { + execute_with_lock(&self.ptr, |wallet| { let mut transaction_details = vec![]; // List transactions and convert them using try_into @@ -138,7 +124,7 @@ impl BdkWallet { /// which first needs to be Wallet.sync manually. #[frb(sync)] pub fn list_unspent(&self) -> Result, BdkError> { - handle_mutex(&self.ptr, |w| { + execute_with_lock(&self.ptr, |w| { let unspent: Vec = w.list_unspent()?; Ok(unspent.into_iter().map(LocalUtxo::from).collect()) })? @@ -154,19 +140,25 @@ impl BdkWallet { pub fn sign( ptr: BdkWallet, psbt: BdkPsbt, - sign_options: Option + sign_options: Option, ) -> Result { - let mut psbt = psbt.ptr.lock().map_err(|_| BdkError::Generic("Poison Error!".to_string()))?; - handle_mutex(&ptr.ptr, |w| { - w.sign(&mut psbt, sign_options.map(SignOptions::into).unwrap_or_default()).map_err(|e| - e.into() + let mut psbt = psbt + .ptr + .lock() + .map_err(|_| BdkError::Generic("Poison Error!".to_string()))?; + execute_with_lock(&ptr.ptr, |w| { + w.sign( + &mut psbt, + sign_options.map(SignOptions::into).unwrap_or_default(), ) + .map_err(|e| e.into()) })? } /// Sync the internal database with the blockchain. pub fn sync(ptr: BdkWallet, blockchain: &BdkBlockchain) -> Result<(), BdkError> { - handle_mutex(&ptr.ptr, |w| { - w.sync(blockchain.ptr.deref(), bdk::SyncOptions::default()).map_err(|e| e.into()) + execute_with_lock(&ptr.ptr, |w| { + w.sync(blockchain.ptr.deref(), bdk::SyncOptions::default()) + .map_err(|e| e.into()) })? } @@ -175,13 +167,13 @@ impl BdkWallet { &self, utxo: LocalUtxo, only_witness_utxo: bool, - sighash_type: Option + sighash_type: Option, ) -> anyhow::Result { - handle_mutex(&self.ptr, |w| { + execute_with_lock(&self.ptr, |w| { let input = w.get_psbt_input( utxo.try_into()?, sighash_type.map(|e| e.into()), - only_witness_utxo + only_witness_utxo, )?; input.try_into() })? @@ -190,13 +182,21 @@ impl BdkWallet { #[frb(sync)] pub fn get_descriptor_for_keychain( ptr: BdkWallet, - keychain: KeychainKind + keychain: KeychainKind, ) -> anyhow::Result { - handle_mutex(&ptr.ptr, |w| { + execute_with_lock(&ptr.ptr, |w| { let extended_descriptor = w.get_descriptor_for_keychain(keychain.into()); BdkDescriptor::new(extended_descriptor.to_string(), w.network().into()) })? } + #[frb(sync)] + pub fn policies(ptr: BdkWallet, keychain: KeychainKind) -> Result, BdkError> { + execute_with_lock(&ptr.ptr, |w| { + w.policies(keychain.into()) + .map_err(|e| e.into()) + .map(|e| e.map(|f| f.into())) + })? + } } pub fn finish_bump_fee_tx_builder( @@ -205,10 +205,10 @@ pub fn finish_bump_fee_tx_builder( allow_shrinking: Option, wallet: BdkWallet, enable_rbf: bool, - n_sequence: Option + n_sequence: Option, ) -> anyhow::Result<(BdkPsbt, TransactionDetails), BdkError> { let txid = Txid::from_str(txid.as_str()).map_err(|e| BdkError::PsbtParse(e.to_string()))?; - handle_mutex(&wallet.ptr, |w| { + execute_with_lock(&wallet.ptr, |w| { let mut tx_builder = w.build_fee_bump(txid)?; tx_builder.fee_rate(bdk::FeeRate::from_sat_per_vb(fee_rate)); if let Some(allow_shrinking) = &allow_shrinking { @@ -242,11 +242,28 @@ pub fn tx_builder_finish( drain_wallet: bool, drain_to: Option, rbf: Option, - data: Vec + internal_policy_path: Option>>, + external_policy_path: Option>>, + data: Vec, ) -> anyhow::Result<(BdkPsbt, TransactionDetails), BdkError> { - handle_mutex(&wallet.ptr, |w| { + execute_with_lock(&wallet.ptr, |w| { let mut tx_builder = w.build_tx(); - + if let Some(path) = internal_policy_path { + tx_builder.policy_path( + path.into_iter() + .map(|(key, value)| (key, value.into_iter().map(|x| x as usize).collect())) + .collect::>>(), + bdk::KeychainKind::Internal, + ); + } + if let Some(path) = external_policy_path { + tx_builder.policy_path( + path.into_iter() + .map(|(key, value)| (key, value.into_iter().map(|x| x as usize).collect())) + .collect::>>(), + bdk::KeychainKind::External, + ); + } for e in recipients { tx_builder.add_recipient(e.script.into(), e.amount); } diff --git a/rust/src/frb_generated.io.rs b/rust/src/frb_generated.io.rs index dc01ea4b..7224d72f 100644 --- a/rust/src/frb_generated.io.rs +++ b/rust/src/frb_generated.io.rs @@ -15,6 +15,33 @@ flutter_rust_bridge::frb_generated_boilerplate_io!(); // Section: dart2rust +impl CstDecode>> + for *mut wire_cst_list_record_string_list_prim_u_32_strict +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> std::collections::HashMap> { + let vec: Vec<(String, Vec)> = self.cst_decode(); + vec.into_iter().collect() + } +} +impl CstDecode, Vec>> + for *mut wire_cst_list_record_list_prim_u_32_strict_list_condition +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> std::collections::HashMap, Vec> { + let vec: Vec<(Vec, Vec)> = self.cst_decode(); + vec.into_iter().collect() + } +} +impl CstDecode>> + for *mut wire_cst_list_record_u_32_list_condition +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> std::collections::HashMap> { + let vec: Vec<(u32, Vec)> = self.cst_decode(); + vec.into_iter().collect() + } +} impl CstDecode> for usize { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> RustOpaqueNom { @@ -39,6 +66,12 @@ impl CstDecode> for usize { unsafe { decode_rust_opaque_nom(self as _) } } } +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} impl CstDecode> for usize { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> RustOpaqueNom { @@ -438,6 +471,14 @@ impl CstDecode for wire_cst_bdk_mnemonic { } } } +impl CstDecode for wire_cst_bdk_policy { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::BdkPolicy { + crate::api::types::BdkPolicy { + ptr: self.ptr.cst_decode(), + } + } +} impl CstDecode for wire_cst_bdk_psbt { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::psbt::BdkPsbt { @@ -572,6 +613,13 @@ impl CstDecode for *mut wire_cst_bdk_mnemonic { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_bdk_policy { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::BdkPolicy { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_bdk_psbt { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::psbt::BdkPsbt { @@ -614,6 +662,19 @@ impl CstDecode for *mut wire_cst_block CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut bool { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> bool { + unsafe { *flutter_rust_bridge::for_generated::box_from_leak_ptr(self) } + } +} +impl CstDecode for *mut wire_cst_condition { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::Condition { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_consensus_error { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::error::ConsensusError { @@ -690,6 +751,13 @@ impl CstDecode for *mut wire_cst_out_point { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_pk_or_f { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PkOrF { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_psbt_sig_hash_type { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PsbtSigHashType { @@ -769,6 +837,15 @@ impl CstDecode for *mut u8 { unsafe { *flutter_rust_bridge::for_generated::box_from_leak_ptr(self) } } } +impl CstDecode for wire_cst_condition { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::Condition { + crate::api::types::Condition { + csv: self.csv.cst_decode(), + timelock: self.timelock.cst_decode(), + } + } +} impl CstDecode for wire_cst_consensus_error { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::error::ConsensusError { @@ -935,6 +1012,26 @@ impl CstDecode for wire_cst_input { } } } +impl CstDecode> for *mut wire_cst_list_bdk_policy { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + let vec = unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(CstDecode::cst_decode).collect() + } +} +impl CstDecode> for *mut wire_cst_list_condition { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + let vec = unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(CstDecode::cst_decode).collect() + } +} impl CstDecode>> for *mut wire_cst_list_list_prim_u_8_strict { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> Vec> { @@ -965,6 +1062,34 @@ impl CstDecode> for *mut wire_cst_list_out_poin vec.into_iter().map(CstDecode::cst_decode).collect() } } +impl CstDecode> for *mut wire_cst_list_pk_or_f { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + let vec = unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(CstDecode::cst_decode).collect() + } +} +impl CstDecode> for *mut wire_cst_list_prim_u_32_strict { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + } + } +} +impl CstDecode> for *mut wire_cst_list_prim_u_64_strict { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + } + } +} impl CstDecode> for *mut wire_cst_list_prim_u_8_loose { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> Vec { @@ -983,6 +1108,40 @@ impl CstDecode> for *mut wire_cst_list_prim_u_8_strict { } } } +impl CstDecode, Vec)>> + for *mut wire_cst_list_record_list_prim_u_32_strict_list_condition +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec<(Vec, Vec)> { + let vec = unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(CstDecode::cst_decode).collect() + } +} +impl CstDecode)>> for *mut wire_cst_list_record_string_list_prim_u_32_strict { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec<(String, Vec)> { + let vec = unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(CstDecode::cst_decode).collect() + } +} +impl CstDecode)>> + for *mut wire_cst_list_record_u_32_list_condition +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec<(u32, Vec)> { + let vec = unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(CstDecode::cst_decode).collect() + } +} impl CstDecode> for *mut wire_cst_list_script_amount { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> Vec { @@ -1088,6 +1247,32 @@ impl CstDecode for wire_cst_payload { } } } +impl CstDecode for wire_cst_pk_or_f { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PkOrF { + match self.tag { + 0 => { + let ans = unsafe { self.kind.Pubkey }; + crate::api::types::PkOrF::Pubkey { + value: ans.value.cst_decode(), + } + } + 1 => { + let ans = unsafe { self.kind.XOnlyPubkey }; + crate::api::types::PkOrF::XOnlyPubkey { + value: ans.value.cst_decode(), + } + } + 2 => { + let ans = unsafe { self.kind.Fingerprint }; + crate::api::types::PkOrF::Fingerprint { + value: ans.value.cst_decode(), + } + } + _ => unreachable!(), + } + } +} impl CstDecode for wire_cst_psbt_sig_hash_type { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PsbtSigHashType { @@ -1131,6 +1316,14 @@ impl (self.field0.cst_decode(), self.field1.cst_decode()) } } +impl CstDecode<(Vec, Vec)> + for wire_cst_record_list_prim_u_32_strict_list_condition +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> (Vec, Vec) { + (self.field0.cst_decode(), self.field1.cst_decode()) + } +} impl CstDecode<(crate::api::types::OutPoint, crate::api::types::Input, usize)> for wire_cst_record_out_point_input_usize { @@ -1143,6 +1336,18 @@ impl CstDecode<(crate::api::types::OutPoint, crate::api::types::Input, usize)> ) } } +impl CstDecode<(String, Vec)> for wire_cst_record_string_list_prim_u_32_strict { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> (String, Vec) { + (self.field0.cst_decode(), self.field1.cst_decode()) + } +} +impl CstDecode<(u32, Vec)> for wire_cst_record_u_32_list_condition { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> (u32, Vec) { + (self.field0.cst_decode(), self.field1.cst_decode()) + } +} impl CstDecode for wire_cst_rpc_config { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::blockchain::RpcConfig { @@ -1166,6 +1371,116 @@ impl CstDecode for wire_cst_rpc_sync_para } } } +impl CstDecode for wire_cst_satisfaction { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::Satisfaction { + match self.tag { + 0 => { + let ans = unsafe { self.kind.Partial }; + crate::api::types::Satisfaction::Partial { + n: ans.n.cst_decode(), + m: ans.m.cst_decode(), + items: ans.items.cst_decode(), + sorted: ans.sorted.cst_decode(), + conditions: ans.conditions.cst_decode(), + } + } + 1 => { + let ans = unsafe { self.kind.PartialComplete }; + crate::api::types::Satisfaction::PartialComplete { + n: ans.n.cst_decode(), + m: ans.m.cst_decode(), + items: ans.items.cst_decode(), + sorted: ans.sorted.cst_decode(), + conditions: ans.conditions.cst_decode(), + } + } + 2 => { + let ans = unsafe { self.kind.Complete }; + crate::api::types::Satisfaction::Complete { + condition: ans.condition.cst_decode(), + } + } + 3 => { + let ans = unsafe { self.kind.None }; + crate::api::types::Satisfaction::None { + msg: ans.msg.cst_decode(), + } + } + _ => unreachable!(), + } + } +} +impl CstDecode for wire_cst_satisfiable_item { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::SatisfiableItem { + match self.tag { + 0 => { + let ans = unsafe { self.kind.EcdsaSignature }; + crate::api::types::SatisfiableItem::EcdsaSignature { + key: ans.key.cst_decode(), + } + } + 1 => { + let ans = unsafe { self.kind.SchnorrSignature }; + crate::api::types::SatisfiableItem::SchnorrSignature { + key: ans.key.cst_decode(), + } + } + 2 => { + let ans = unsafe { self.kind.Sha256Preimage }; + crate::api::types::SatisfiableItem::Sha256Preimage { + hash: ans.hash.cst_decode(), + } + } + 3 => { + let ans = unsafe { self.kind.Hash256Preimage }; + crate::api::types::SatisfiableItem::Hash256Preimage { + hash: ans.hash.cst_decode(), + } + } + 4 => { + let ans = unsafe { self.kind.Ripemd160Preimage }; + crate::api::types::SatisfiableItem::Ripemd160Preimage { + hash: ans.hash.cst_decode(), + } + } + 5 => { + let ans = unsafe { self.kind.Hash160Preimage }; + crate::api::types::SatisfiableItem::Hash160Preimage { + hash: ans.hash.cst_decode(), + } + } + 6 => { + let ans = unsafe { self.kind.AbsoluteTimelock }; + crate::api::types::SatisfiableItem::AbsoluteTimelock { + value: ans.value.cst_decode(), + } + } + 7 => { + let ans = unsafe { self.kind.RelativeTimelock }; + crate::api::types::SatisfiableItem::RelativeTimelock { + value: ans.value.cst_decode(), + } + } + 8 => { + let ans = unsafe { self.kind.Multisig }; + crate::api::types::SatisfiableItem::Multisig { + keys: ans.keys.cst_decode(), + threshold: ans.threshold.cst_decode(), + } + } + 9 => { + let ans = unsafe { self.kind.Thresh }; + crate::api::types::SatisfiableItem::Thresh { + items: ans.items.cst_decode(), + threshold: ans.threshold.cst_decode(), + } + } + _ => unreachable!(), + } + } +} impl CstDecode for wire_cst_script_amount { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::ScriptAmount { @@ -1400,6 +1715,18 @@ impl Default for wire_cst_bdk_mnemonic { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_bdk_policy { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_bdk_policy { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_bdk_psbt { fn new_with_null_ptr() -> Self { Self { @@ -1474,6 +1801,19 @@ impl Default for wire_cst_blockchain_config { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_condition { + fn new_with_null_ptr() -> Self { + Self { + csv: core::ptr::null_mut(), + timelock: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_condition { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_consensus_error { fn new_with_null_ptr() -> Self { Self { @@ -1637,6 +1977,19 @@ impl Default for wire_cst_payload { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_pk_or_f { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: PkOrFKind { nil__: () }, + } + } +} +impl Default for wire_cst_pk_or_f { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_psbt_sig_hash_type { fn new_with_null_ptr() -> Self { Self { @@ -1688,6 +2041,19 @@ impl Default for wire_cst_record_bdk_psbt_transaction_details { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_record_list_prim_u_32_strict_list_condition { + fn new_with_null_ptr() -> Self { + Self { + field0: core::ptr::null_mut(), + field1: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_record_list_prim_u_32_strict_list_condition { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_record_out_point_input_usize { fn new_with_null_ptr() -> Self { Self { @@ -1702,6 +2068,32 @@ impl Default for wire_cst_record_out_point_input_usize { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_record_string_list_prim_u_32_strict { + fn new_with_null_ptr() -> Self { + Self { + field0: core::ptr::null_mut(), + field1: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_record_string_list_prim_u_32_strict { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_record_u_32_list_condition { + fn new_with_null_ptr() -> Self { + Self { + field0: Default::default(), + field1: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_record_u_32_list_condition { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_rpc_config { fn new_with_null_ptr() -> Self { Self { @@ -1733,28 +2125,54 @@ impl Default for wire_cst_rpc_sync_params { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_script_amount { +impl NewWithNullPtr for wire_cst_satisfaction { fn new_with_null_ptr() -> Self { Self { - script: Default::default(), - amount: Default::default(), + tag: -1, + kind: SatisfactionKind { nil__: () }, } } } -impl Default for wire_cst_script_amount { +impl Default for wire_cst_satisfaction { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_sign_options { +impl NewWithNullPtr for wire_cst_satisfiable_item { fn new_with_null_ptr() -> Self { Self { - trust_witness_utxo: Default::default(), - assume_height: core::ptr::null_mut(), - allow_all_sighashes: Default::default(), - remove_partial_sigs: Default::default(), - try_finalize: Default::default(), - sign_with_tap_internal_key: Default::default(), + tag: -1, + kind: SatisfiableItemKind { nil__: () }, + } + } +} +impl Default for wire_cst_satisfiable_item { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_script_amount { + fn new_with_null_ptr() -> Self { + Self { + script: Default::default(), + amount: Default::default(), + } + } +} +impl Default for wire_cst_script_amount { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_sign_options { + fn new_with_null_ptr() -> Self { + Self { + trust_witness_utxo: Default::default(), + assume_height: core::ptr::null_mut(), + allow_all_sighashes: Default::default(), + remove_partial_sigs: Default::default(), + try_finalize: Default::default(), + sign_with_tap_internal_key: Default::default(), allow_grinding: Default::default(), } } @@ -2299,6 +2717,48 @@ pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__types__bdk_address_to_qr_ wire__crate__api__types__bdk_address_to_qr_uri_impl(that) } +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_as_string( + that: *mut wire_cst_bdk_policy, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__types__bdk_policy_as_string_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_contribution( + that: *mut wire_cst_bdk_policy, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__types__bdk_policy_contribution_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_id( + that: *mut wire_cst_bdk_policy, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__types__bdk_policy_id_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_item( + that: *mut wire_cst_bdk_policy, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__types__bdk_policy_item_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_requires_path( + that: *mut wire_cst_bdk_policy, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__types__bdk_policy_requires_path_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__types__bdk_policy_satisfaction( + that: *mut wire_cst_bdk_policy, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__types__bdk_policy_satisfaction_impl(that) +} + #[no_mangle] pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__types__bdk_script_buf_as_string( that: *mut wire_cst_bdk_script_buf, @@ -2538,6 +2998,14 @@ pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_new( ) } +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_policies( + ptr: *mut wire_cst_bdk_wallet, + keychain: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__wallet__bdk_wallet_policies_impl(ptr, keychain) +} + #[no_mangle] pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__wallet__bdk_wallet_sign( port_: i64, @@ -2593,6 +3061,8 @@ pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__wallet__tx_builder_finish drain_wallet: bool, drain_to: *mut wire_cst_bdk_script_buf, rbf: *mut wire_cst_rbf_value, + internal_policy_path: *mut wire_cst_list_record_string_list_prim_u_32_strict, + external_policy_path: *mut wire_cst_list_record_string_list_prim_u_32_strict, data: *mut wire_cst_list_prim_u_8_loose, ) { wire__crate__api__wallet__tx_builder_finish_impl( @@ -2609,6 +3079,8 @@ pub extern "C" fn frbgen_bdk_flutter_wire__crate__api__wallet__tx_builder_finish drain_wallet, drain_to, rbf, + internal_policy_path, + external_policy_path, data, ) } @@ -2685,6 +3157,24 @@ pub extern "C" fn frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_ } } +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkdescriptorPolicy( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_rust_arc_decrement_strong_count_RustOpaque_bdkdescriptorPolicy( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + #[no_mangle] pub extern "C" fn frbgen_bdk_flutter_rust_arc_increment_strong_count_RustOpaque_bdkkeysDescriptorPublicKey( ptr: *const std::ffi::c_void, @@ -2861,6 +3351,11 @@ pub extern "C" fn frbgen_bdk_flutter_cst_new_box_autoadd_bdk_mnemonic() -> *mut flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_bdk_mnemonic::new_with_null_ptr()) } +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_cst_new_box_autoadd_bdk_policy() -> *mut wire_cst_bdk_policy { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_bdk_policy::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_bdk_flutter_cst_new_box_autoadd_bdk_psbt() -> *mut wire_cst_bdk_psbt { flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_bdk_psbt::new_with_null_ptr()) @@ -2900,6 +3395,16 @@ pub extern "C" fn frbgen_bdk_flutter_cst_new_box_autoadd_blockchain_config( ) } +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_cst_new_box_autoadd_bool(value: bool) -> *mut bool { + flutter_rust_bridge::for_generated::new_leak_box_ptr(value) +} + +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_cst_new_box_autoadd_condition() -> *mut wire_cst_condition { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_condition::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_bdk_flutter_cst_new_box_autoadd_consensus_error( ) -> *mut wire_cst_consensus_error { @@ -2970,6 +3475,11 @@ pub extern "C" fn frbgen_bdk_flutter_cst_new_box_autoadd_out_point() -> *mut wir flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_out_point::new_with_null_ptr()) } +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_cst_new_box_autoadd_pk_or_f() -> *mut wire_cst_pk_or_f { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_pk_or_f::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_bdk_flutter_cst_new_box_autoadd_psbt_sig_hash_type( ) -> *mut wire_cst_psbt_sig_hash_type { @@ -3041,6 +3551,34 @@ pub extern "C" fn frbgen_bdk_flutter_cst_new_box_autoadd_u_8(value: u8) -> *mut flutter_rust_bridge::for_generated::new_leak_box_ptr(value) } +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_cst_new_list_bdk_policy( + len: i32, +) -> *mut wire_cst_list_bdk_policy { + let wrap = wire_cst_list_bdk_policy { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr( + ::new_with_null_ptr(), + len, + ), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) +} + +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_cst_new_list_condition( + len: i32, +) -> *mut wire_cst_list_condition { + let wrap = wire_cst_list_condition { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr( + ::new_with_null_ptr(), + len, + ), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) +} + #[no_mangle] pub extern "C" fn frbgen_bdk_flutter_cst_new_list_list_prim_u_8_strict( len: i32, @@ -3083,6 +3621,40 @@ pub extern "C" fn frbgen_bdk_flutter_cst_new_list_out_point( flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) } +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_cst_new_list_pk_or_f(len: i32) -> *mut wire_cst_list_pk_or_f { + let wrap = wire_cst_list_pk_or_f { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr( + ::new_with_null_ptr(), + len, + ), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) +} + +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_cst_new_list_prim_u_32_strict( + len: i32, +) -> *mut wire_cst_list_prim_u_32_strict { + let ans = wire_cst_list_prim_u_32_strict { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(ans) +} + +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_cst_new_list_prim_u_64_strict( + len: i32, +) -> *mut wire_cst_list_prim_u_64_strict { + let ans = wire_cst_list_prim_u_64_strict { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(ans) +} + #[no_mangle] pub extern "C" fn frbgen_bdk_flutter_cst_new_list_prim_u_8_loose( len: i32, @@ -3105,6 +3677,48 @@ pub extern "C" fn frbgen_bdk_flutter_cst_new_list_prim_u_8_strict( flutter_rust_bridge::for_generated::new_leak_box_ptr(ans) } +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_cst_new_list_record_list_prim_u_32_strict_list_condition( + len: i32, +) -> *mut wire_cst_list_record_list_prim_u_32_strict_list_condition { + let wrap = wire_cst_list_record_list_prim_u_32_strict_list_condition { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr( + ::new_with_null_ptr(), + len, + ), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) +} + +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_cst_new_list_record_string_list_prim_u_32_strict( + len: i32, +) -> *mut wire_cst_list_record_string_list_prim_u_32_strict { + let wrap = wire_cst_list_record_string_list_prim_u_32_strict { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr( + ::new_with_null_ptr(), + len, + ), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) +} + +#[no_mangle] +pub extern "C" fn frbgen_bdk_flutter_cst_new_list_record_u_32_list_condition( + len: i32, +) -> *mut wire_cst_list_record_u_32_list_condition { + let wrap = wire_cst_list_record_u_32_list_condition { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr( + ::new_with_null_ptr(), + len, + ), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) +} + #[no_mangle] pub extern "C" fn frbgen_bdk_flutter_cst_new_list_script_amount( len: i32, @@ -3550,6 +4164,11 @@ pub struct wire_cst_bdk_mnemonic { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_bdk_policy { + ptr: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_bdk_psbt { ptr: usize, } @@ -3605,6 +4224,12 @@ pub struct wire_cst_BlockchainConfig_Rpc { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_condition { + csv: *mut u32, + timelock: *mut wire_cst_lock_time, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_consensus_error { tag: i32, kind: ConsensusErrorKind, @@ -3789,6 +4414,18 @@ pub struct wire_cst_input { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_list_bdk_policy { + ptr: *mut wire_cst_bdk_policy, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_condition { + ptr: *mut wire_cst_condition, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_list_prim_u_8_strict { ptr: *mut *mut wire_cst_list_prim_u_8_strict, len: i32, @@ -3807,6 +4444,24 @@ pub struct wire_cst_list_out_point { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_list_pk_or_f { + ptr: *mut wire_cst_pk_or_f, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_prim_u_32_strict { + ptr: *mut u32, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_prim_u_64_strict { + ptr: *mut u64, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_prim_u_8_loose { ptr: *mut u8, len: i32, @@ -3819,6 +4474,24 @@ pub struct wire_cst_list_prim_u_8_strict { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_list_record_list_prim_u_32_strict_list_condition { + ptr: *mut wire_cst_record_list_prim_u_32_strict_list_condition, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_record_string_list_prim_u_32_strict { + ptr: *mut wire_cst_record_string_list_prim_u_32_strict, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_record_u_32_list_condition { + ptr: *mut wire_cst_record_u_32_list_condition, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_script_amount { ptr: *mut wire_cst_script_amount, len: i32, @@ -3910,6 +4583,35 @@ pub struct wire_cst_Payload_WitnessProgram { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_pk_or_f { + tag: i32, + kind: PkOrFKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union PkOrFKind { + Pubkey: wire_cst_PkOrF_Pubkey, + XOnlyPubkey: wire_cst_PkOrF_XOnlyPubkey, + Fingerprint: wire_cst_PkOrF_Fingerprint, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PkOrF_Pubkey { + value: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PkOrF_XOnlyPubkey { + value: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PkOrF_Fingerprint { + value: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_psbt_sig_hash_type { inner: u32, } @@ -3944,6 +4646,12 @@ pub struct wire_cst_record_bdk_psbt_transaction_details { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_record_list_prim_u_32_strict_list_condition { + field0: *mut wire_cst_list_prim_u_32_strict, + field1: *mut wire_cst_list_condition, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_record_out_point_input_usize { field0: wire_cst_out_point, field1: wire_cst_input, @@ -3951,6 +4659,18 @@ pub struct wire_cst_record_out_point_input_usize { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_record_string_list_prim_u_32_strict { + field0: *mut wire_cst_list_prim_u_8_strict, + field1: *mut wire_cst_list_prim_u_32_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_record_u_32_list_condition { + field0: u32, + field1: *mut wire_cst_list_condition, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_rpc_config { url: *mut wire_cst_list_prim_u_8_strict, auth: wire_cst_auth, @@ -3968,6 +4688,122 @@ pub struct wire_cst_rpc_sync_params { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_satisfaction { + tag: i32, + kind: SatisfactionKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union SatisfactionKind { + Partial: wire_cst_Satisfaction_Partial, + PartialComplete: wire_cst_Satisfaction_PartialComplete, + Complete: wire_cst_Satisfaction_Complete, + None: wire_cst_Satisfaction_None, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Satisfaction_Partial { + n: u64, + m: u64, + items: *mut wire_cst_list_prim_u_64_strict, + sorted: *mut bool, + conditions: *mut wire_cst_list_record_u_32_list_condition, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Satisfaction_PartialComplete { + n: u64, + m: u64, + items: *mut wire_cst_list_prim_u_64_strict, + sorted: *mut bool, + conditions: *mut wire_cst_list_record_list_prim_u_32_strict_list_condition, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Satisfaction_Complete { + condition: *mut wire_cst_condition, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Satisfaction_None { + msg: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_satisfiable_item { + tag: i32, + kind: SatisfiableItemKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union SatisfiableItemKind { + EcdsaSignature: wire_cst_SatisfiableItem_EcdsaSignature, + SchnorrSignature: wire_cst_SatisfiableItem_SchnorrSignature, + Sha256Preimage: wire_cst_SatisfiableItem_Sha256Preimage, + Hash256Preimage: wire_cst_SatisfiableItem_Hash256Preimage, + Ripemd160Preimage: wire_cst_SatisfiableItem_Ripemd160Preimage, + Hash160Preimage: wire_cst_SatisfiableItem_Hash160Preimage, + AbsoluteTimelock: wire_cst_SatisfiableItem_AbsoluteTimelock, + RelativeTimelock: wire_cst_SatisfiableItem_RelativeTimelock, + Multisig: wire_cst_SatisfiableItem_Multisig, + Thresh: wire_cst_SatisfiableItem_Thresh, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_SatisfiableItem_EcdsaSignature { + key: *mut wire_cst_pk_or_f, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_SatisfiableItem_SchnorrSignature { + key: *mut wire_cst_pk_or_f, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_SatisfiableItem_Sha256Preimage { + hash: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_SatisfiableItem_Hash256Preimage { + hash: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_SatisfiableItem_Ripemd160Preimage { + hash: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_SatisfiableItem_Hash160Preimage { + hash: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_SatisfiableItem_AbsoluteTimelock { + value: *mut wire_cst_lock_time, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_SatisfiableItem_RelativeTimelock { + value: u32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_SatisfiableItem_Multisig { + keys: *mut wire_cst_list_pk_or_f, + threshold: u64, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_SatisfiableItem_Thresh { + items: *mut wire_cst_list_bdk_policy, + threshold: u64, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_script_amount { script: wire_cst_bdk_script_buf, amount: u64, diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index 0cabd3ad..65c12a4d 100644 --- a/rust/src/frb_generated.rs +++ b/rust/src/frb_generated.rs @@ -38,7 +38,7 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_auto_opaque = RustAutoOpaqueNom, ); pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0"; -pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1897842111; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -321771070; // Section: executor @@ -1193,6 +1193,117 @@ fn wire__crate__api__types__bdk_address_to_qr_uri_impl( }, ) } +fn wire__crate__api__types__bdk_policy_as_string_impl( + that: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "bdk_policy_as_string", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco::<_, _, crate::api::error::BdkError>((move || { + let output_ok = crate::api::types::BdkPolicy::as_string(&api_that)?; + Ok(output_ok) + })()) + }, + ) +} +fn wire__crate__api__types__bdk_policy_contribution_impl( + that: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "bdk_policy_contribution", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::types::BdkPolicy::contribution(&api_that))?; + Ok(output_ok) + })()) + }, + ) +} +fn wire__crate__api__types__bdk_policy_id_impl( + that: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "bdk_policy_id", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok(crate::api::types::BdkPolicy::id(&api_that))?; + Ok(output_ok) + })()) + }, + ) +} +fn wire__crate__api__types__bdk_policy_item_impl( + that: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "bdk_policy_item", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok(crate::api::types::BdkPolicy::item(&api_that))?; + Ok(output_ok) + })()) + }, + ) +} +fn wire__crate__api__types__bdk_policy_requires_path_impl( + that: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "bdk_policy_requires_path", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::types::BdkPolicy::requires_path(&api_that))?; + Ok(output_ok) + })()) + }, + ) +} +fn wire__crate__api__types__bdk_policy_satisfaction_impl( + that: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "bdk_policy_satisfaction", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::types::BdkPolicy::satisfaction(&api_that))?; + Ok(output_ok) + })()) + }, + ) +} fn wire__crate__api__types__bdk_script_buf_as_string_impl( that: impl CstDecode, ) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { @@ -1806,6 +1917,26 @@ fn wire__crate__api__wallet__bdk_wallet_new_impl( }, ) } +fn wire__crate__api__wallet__bdk_wallet_policies_impl( + ptr: impl CstDecode, + keychain: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "bdk_wallet_policies", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_ptr = ptr.cst_decode(); + let api_keychain = keychain.cst_decode(); + transform_result_dco::<_, _, crate::api::error::BdkError>((move || { + let output_ok = crate::api::wallet::BdkWallet::policies(api_ptr, api_keychain)?; + Ok(output_ok) + })()) + }, + ) +} fn wire__crate__api__wallet__bdk_wallet_sign_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr: impl CstDecode, @@ -1907,6 +2038,8 @@ fn wire__crate__api__wallet__tx_builder_finish_impl( drain_wallet: impl CstDecode, drain_to: impl CstDecode>, rbf: impl CstDecode>, + internal_policy_path: impl CstDecode>>>, + external_policy_path: impl CstDecode>>>, data: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( @@ -1928,6 +2061,8 @@ fn wire__crate__api__wallet__tx_builder_finish_impl( let api_drain_wallet = drain_wallet.cst_decode(); let api_drain_to = drain_to.cst_decode(); let api_rbf = rbf.cst_decode(); + let api_internal_policy_path = internal_policy_path.cst_decode(); + let api_external_policy_path = external_policy_path.cst_decode(); let api_data = data.cst_decode(); move |context| { transform_result_dco::<_, _, crate::api::error::BdkError>((move || { @@ -1944,6 +2079,8 @@ fn wire__crate__api__wallet__tx_builder_finish_impl( api_drain_wallet, api_drain_to, api_rbf, + api_internal_policy_path, + api_external_policy_path, api_data, )?; Ok(output_ok) @@ -2076,6 +2213,31 @@ impl CstDecode for i32 { } } } +impl SseDecode for std::collections::HashMap> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = )>>::sse_decode(deserializer); + return inner.into_iter().collect(); + } +} + +impl SseDecode for std::collections::HashMap, Vec> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = + , Vec)>>::sse_decode(deserializer); + return inner.into_iter().collect(); + } +} + +impl SseDecode for std::collections::HashMap> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = )>>::sse_decode(deserializer); + return inner.into_iter().collect(); + } +} + impl SseDecode for RustOpaqueNom { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2108,6 +2270,14 @@ impl SseDecode for RustOpaqueNom { } } +impl SseDecode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + impl SseDecode for RustOpaqueNom { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2571,6 +2741,14 @@ impl SseDecode for crate::api::key::BdkMnemonic { } } +impl SseDecode for crate::api::types::BdkPolicy { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut var_ptr = >::sse_decode(deserializer); + return crate::api::types::BdkPolicy { ptr: var_ptr }; + } +} + impl SseDecode for crate::api::psbt::BdkPsbt { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2666,6 +2844,18 @@ impl SseDecode for crate::api::types::ChangeSpendPolicy { } } +impl SseDecode for crate::api::types::Condition { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut var_csv = >::sse_decode(deserializer); + let mut var_timelock = >::sse_decode(deserializer); + return crate::api::types::Condition { + csv: var_csv, + timelock: var_timelock, + }; + } +} + impl SseDecode for crate::api::error::ConsensusError { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2897,6 +3087,30 @@ impl SseDecode for crate::api::types::KeychainKind { } } +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + impl SseDecode for Vec> { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2933,6 +3147,42 @@ impl SseDecode for Vec { } } +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + impl SseDecode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2945,6 +3195,46 @@ impl SseDecode for Vec { } } +impl SseDecode for Vec<(Vec, Vec)> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(<(Vec, Vec)>::sse_decode( + deserializer, + )); + } + return ans_; + } +} + +impl SseDecode for Vec<(String, Vec)> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(<(String, Vec)>::sse_decode(deserializer)); + } + return ans_; + } +} + +impl SseDecode for Vec<(u32, Vec)> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(<(u32, Vec)>::sse_decode( + deserializer, + )); + } + return ans_; + } +} + impl SseDecode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -3045,6 +3335,19 @@ impl SseDecode for crate::api::types::Network { } } +impl SseDecode for Option>> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + if (::sse_decode(deserializer)) { + return Some(>>::sse_decode( + deserializer, + )); + } else { + return None; + } + } +} + impl SseDecode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -3080,6 +3383,17 @@ impl SseDecode for Option { } } +impl SseDecode for Option { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + if (::sse_decode(deserializer)) { + return Some(::sse_decode(deserializer)); + } else { + return None; + } + } +} + impl SseDecode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -3115,53 +3429,75 @@ impl SseDecode for Option { } } -impl SseDecode for Option { +impl SseDecode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { if (::sse_decode(deserializer)) { - return Some(::sse_decode(deserializer)); + return Some(::sse_decode(deserializer)); } else { return None; } } } -impl SseDecode for Option { +impl SseDecode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { if (::sse_decode(deserializer)) { - return Some(::sse_decode(deserializer)); + return Some(::sse_decode(deserializer)); } else { return None; } } } -impl SseDecode for Option { +impl SseDecode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { if (::sse_decode(deserializer)) { - return Some(::sse_decode( - deserializer, - )); + return Some(::sse_decode(deserializer)); } else { return None; } } } -impl SseDecode for Option { +impl SseDecode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { if (::sse_decode(deserializer)) { - return Some(::sse_decode(deserializer)); + return Some(::sse_decode(deserializer)); } else { return None; } } } -impl SseDecode for Option<(crate::api::types::OutPoint, crate::api::types::Input, usize)> { +impl SseDecode for Option { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + if (::sse_decode(deserializer)) { + return Some(::sse_decode( + deserializer, + )); + } else { + return None; + } + } +} + +impl SseDecode for Option { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + if (::sse_decode(deserializer)) { + return Some(::sse_decode(deserializer)); + } else { + return None; + } + } +} + +impl SseDecode for Option<(crate::api::types::OutPoint, crate::api::types::Input, usize)> { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { if (::sse_decode(deserializer)) { @@ -3277,6 +3613,30 @@ impl SseDecode for crate::api::types::Payload { } } +impl SseDecode for crate::api::types::PkOrF { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut tag_ = ::sse_decode(deserializer); + match tag_ { + 0 => { + let mut var_value = ::sse_decode(deserializer); + return crate::api::types::PkOrF::Pubkey { value: var_value }; + } + 1 => { + let mut var_value = ::sse_decode(deserializer); + return crate::api::types::PkOrF::XOnlyPubkey { value: var_value }; + } + 2 => { + let mut var_value = ::sse_decode(deserializer); + return crate::api::types::PkOrF::Fingerprint { value: var_value }; + } + _ => { + unimplemented!(""); + } + } + } +} + impl SseDecode for crate::api::types::PsbtSigHashType { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -3327,6 +3687,15 @@ impl SseDecode } } +impl SseDecode for (Vec, Vec) { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut var_field0 = >::sse_decode(deserializer); + let mut var_field1 = >::sse_decode(deserializer); + return (var_field0, var_field1); + } +} + impl SseDecode for (crate::api::types::OutPoint, crate::api::types::Input, usize) { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -3337,6 +3706,24 @@ impl SseDecode for (crate::api::types::OutPoint, crate::api::types::Input, usize } } +impl SseDecode for (String, Vec) { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut var_field0 = ::sse_decode(deserializer); + let mut var_field1 = >::sse_decode(deserializer); + return (var_field0, var_field1); + } +} + +impl SseDecode for (u32, Vec) { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut var_field0 = ::sse_decode(deserializer); + let mut var_field1 = >::sse_decode(deserializer); + return (var_field0, var_field1); + } +} + impl SseDecode for crate::api::blockchain::RpcConfig { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -3372,6 +3759,122 @@ impl SseDecode for crate::api::blockchain::RpcSyncParams { } } +impl SseDecode for crate::api::types::Satisfaction { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut tag_ = ::sse_decode(deserializer); + match tag_ { + 0 => { + let mut var_n = ::sse_decode(deserializer); + let mut var_m = ::sse_decode(deserializer); + let mut var_items = >::sse_decode(deserializer); + let mut var_sorted = >::sse_decode(deserializer); + let mut var_conditions = , + >>::sse_decode(deserializer); + return crate::api::types::Satisfaction::Partial { + n: var_n, + m: var_m, + items: var_items, + sorted: var_sorted, + conditions: var_conditions, + }; + } + 1 => { + let mut var_n = ::sse_decode(deserializer); + let mut var_m = ::sse_decode(deserializer); + let mut var_items = >::sse_decode(deserializer); + let mut var_sorted = >::sse_decode(deserializer); + let mut var_conditions = , + Vec, + >>::sse_decode(deserializer); + return crate::api::types::Satisfaction::PartialComplete { + n: var_n, + m: var_m, + items: var_items, + sorted: var_sorted, + conditions: var_conditions, + }; + } + 2 => { + let mut var_condition = ::sse_decode(deserializer); + return crate::api::types::Satisfaction::Complete { + condition: var_condition, + }; + } + 3 => { + let mut var_msg = ::sse_decode(deserializer); + return crate::api::types::Satisfaction::None { msg: var_msg }; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::SatisfiableItem { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut tag_ = ::sse_decode(deserializer); + match tag_ { + 0 => { + let mut var_key = ::sse_decode(deserializer); + return crate::api::types::SatisfiableItem::EcdsaSignature { key: var_key }; + } + 1 => { + let mut var_key = ::sse_decode(deserializer); + return crate::api::types::SatisfiableItem::SchnorrSignature { key: var_key }; + } + 2 => { + let mut var_hash = ::sse_decode(deserializer); + return crate::api::types::SatisfiableItem::Sha256Preimage { hash: var_hash }; + } + 3 => { + let mut var_hash = ::sse_decode(deserializer); + return crate::api::types::SatisfiableItem::Hash256Preimage { hash: var_hash }; + } + 4 => { + let mut var_hash = ::sse_decode(deserializer); + return crate::api::types::SatisfiableItem::Ripemd160Preimage { hash: var_hash }; + } + 5 => { + let mut var_hash = ::sse_decode(deserializer); + return crate::api::types::SatisfiableItem::Hash160Preimage { hash: var_hash }; + } + 6 => { + let mut var_value = ::sse_decode(deserializer); + return crate::api::types::SatisfiableItem::AbsoluteTimelock { value: var_value }; + } + 7 => { + let mut var_value = ::sse_decode(deserializer); + return crate::api::types::SatisfiableItem::RelativeTimelock { value: var_value }; + } + 8 => { + let mut var_keys = >::sse_decode(deserializer); + let mut var_threshold = ::sse_decode(deserializer); + return crate::api::types::SatisfiableItem::Multisig { + keys: var_keys, + threshold: var_threshold, + }; + } + 9 => { + let mut var_items = >::sse_decode(deserializer); + let mut var_threshold = ::sse_decode(deserializer); + return crate::api::types::SatisfiableItem::Thresh { + items: var_items, + threshold: var_threshold, + }; + } + _ => { + unimplemented!(""); + } + } + } +} + impl SseDecode for crate::api::types::ScriptAmount { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -4001,6 +4504,20 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::BdkPolicy { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::BdkPolicy {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::BdkPolicy +{ + fn into_into_dart(self) -> crate::api::types::BdkPolicy { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::psbt::BdkPsbt { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [self.ptr.into_into_dart().into_dart()].into_dart() @@ -4131,6 +4648,24 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::Condition { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.csv.into_into_dart().into_dart(), + self.timelock.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Condition {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::Condition +{ + fn into_into_dart(self) -> crate::api::types::Condition { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::error::ConsensusError { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { @@ -4487,6 +5022,31 @@ impl flutter_rust_bridge::IntoIntoDart for crate::ap } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::PkOrF { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::PkOrF::Pubkey { value } => { + [0.into_dart(), value.into_into_dart().into_dart()].into_dart() + } + crate::api::types::PkOrF::XOnlyPubkey { value } => { + [1.into_dart(), value.into_into_dart().into_dart()].into_dart() + } + crate::api::types::PkOrF::Fingerprint { value } => { + [2.into_dart(), value.into_into_dart().into_dart()].into_dart() + } + _ => { + unimplemented!(""); + } + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::PkOrF {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::PkOrF { + fn into_into_dart(self) -> crate::api::types::PkOrF { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::PsbtSigHashType { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [self.inner.into_into_dart().into_dart()].into_dart() @@ -4573,6 +5133,120 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::Satisfaction { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::Satisfaction::Partial { + n, + m, + items, + sorted, + conditions, + } => [ + 0.into_dart(), + n.into_into_dart().into_dart(), + m.into_into_dart().into_dart(), + items.into_into_dart().into_dart(), + sorted.into_into_dart().into_dart(), + conditions.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::Satisfaction::PartialComplete { + n, + m, + items, + sorted, + conditions, + } => [ + 1.into_dart(), + n.into_into_dart().into_dart(), + m.into_into_dart().into_dart(), + items.into_into_dart().into_dart(), + sorted.into_into_dart().into_dart(), + conditions.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::Satisfaction::Complete { condition } => { + [2.into_dart(), condition.into_into_dart().into_dart()].into_dart() + } + crate::api::types::Satisfaction::None { msg } => { + [3.into_dart(), msg.into_into_dart().into_dart()].into_dart() + } + _ => { + unimplemented!(""); + } + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::Satisfaction +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::Satisfaction +{ + fn into_into_dart(self) -> crate::api::types::Satisfaction { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::SatisfiableItem { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::SatisfiableItem::EcdsaSignature { key } => { + [0.into_dart(), key.into_into_dart().into_dart()].into_dart() + } + crate::api::types::SatisfiableItem::SchnorrSignature { key } => { + [1.into_dart(), key.into_into_dart().into_dart()].into_dart() + } + crate::api::types::SatisfiableItem::Sha256Preimage { hash } => { + [2.into_dart(), hash.into_into_dart().into_dart()].into_dart() + } + crate::api::types::SatisfiableItem::Hash256Preimage { hash } => { + [3.into_dart(), hash.into_into_dart().into_dart()].into_dart() + } + crate::api::types::SatisfiableItem::Ripemd160Preimage { hash } => { + [4.into_dart(), hash.into_into_dart().into_dart()].into_dart() + } + crate::api::types::SatisfiableItem::Hash160Preimage { hash } => { + [5.into_dart(), hash.into_into_dart().into_dart()].into_dart() + } + crate::api::types::SatisfiableItem::AbsoluteTimelock { value } => { + [6.into_dart(), value.into_into_dart().into_dart()].into_dart() + } + crate::api::types::SatisfiableItem::RelativeTimelock { value } => { + [7.into_dart(), value.into_into_dart().into_dart()].into_dart() + } + crate::api::types::SatisfiableItem::Multisig { keys, threshold } => [ + 8.into_dart(), + keys.into_into_dart().into_dart(), + threshold.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::SatisfiableItem::Thresh { items, threshold } => [ + 9.into_dart(), + items.into_into_dart().into_dart(), + threshold.into_into_dart().into_dart(), + ] + .into_dart(), + _ => { + unimplemented!(""); + } + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::SatisfiableItem +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::SatisfiableItem +{ + fn into_into_dart(self) -> crate::api::types::SatisfiableItem { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::ScriptAmount { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [ @@ -4788,6 +5462,33 @@ impl flutter_rust_bridge::IntoIntoDart } } +impl SseEncode for std::collections::HashMap> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + )>>::sse_encode(self.into_iter().collect(), serializer); + } +} + +impl SseEncode for std::collections::HashMap, Vec> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + , Vec)>>::sse_encode( + self.into_iter().collect(), + serializer, + ); + } +} + +impl SseEncode for std::collections::HashMap> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + )>>::sse_encode( + self.into_iter().collect(), + serializer, + ); + } +} + impl SseEncode for RustOpaqueNom { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4824,6 +5525,15 @@ impl SseEncode for RustOpaqueNom { } } +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + impl SseEncode for RustOpaqueNom { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5258,6 +5968,13 @@ impl SseEncode for crate::api::key::BdkMnemonic { } } +impl SseEncode for crate::api::types::BdkPolicy { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >::sse_encode(self.ptr, serializer); + } +} + impl SseEncode for crate::api::psbt::BdkPsbt { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5343,6 +6060,14 @@ impl SseEncode for crate::api::types::ChangeSpendPolicy { } } +impl SseEncode for crate::api::types::Condition { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >::sse_encode(self.csv, serializer); + >::sse_encode(self.timelock, serializer); + } +} + impl SseEncode for crate::api::error::ConsensusError { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5547,6 +6272,26 @@ impl SseEncode for crate::api::types::KeychainKind { } } +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + impl SseEncode for Vec> { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5577,6 +6322,36 @@ impl SseEncode for Vec { } } +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + impl SseEncode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5587,6 +6362,36 @@ impl SseEncode for Vec { } } +impl SseEncode for Vec<(Vec, Vec)> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + <(Vec, Vec)>::sse_encode(item, serializer); + } + } +} + +impl SseEncode for Vec<(String, Vec)> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + <(String, Vec)>::sse_encode(item, serializer); + } + } +} + +impl SseEncode for Vec<(u32, Vec)> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + <(u32, Vec)>::sse_encode(item, serializer); + } + } +} + impl SseEncode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5674,6 +6479,16 @@ impl SseEncode for crate::api::types::Network { } } +impl SseEncode for Option>> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.is_some(), serializer); + if let Some(value) = self { + >>::sse_encode(value, serializer); + } + } +} + impl SseEncode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5704,6 +6519,16 @@ impl SseEncode for Option { } } +impl SseEncode for Option { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.is_some(), serializer); + if let Some(value) = self { + ::sse_encode(value, serializer); + } + } +} + impl SseEncode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5734,6 +6559,16 @@ impl SseEncode for Option { } } +impl SseEncode for Option { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.is_some(), serializer); + if let Some(value) = self { + ::sse_encode(value, serializer); + } + } +} + impl SseEncode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5754,6 +6589,16 @@ impl SseEncode for Option { } } +impl SseEncode for Option { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.is_some(), serializer); + if let Some(value) = self { + ::sse_encode(value, serializer); + } + } +} + impl SseEncode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5868,6 +6713,29 @@ impl SseEncode for crate::api::types::Payload { } } +impl SseEncode for crate::api::types::PkOrF { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + match self { + crate::api::types::PkOrF::Pubkey { value } => { + ::sse_encode(0, serializer); + ::sse_encode(value, serializer); + } + crate::api::types::PkOrF::XOnlyPubkey { value } => { + ::sse_encode(1, serializer); + ::sse_encode(value, serializer); + } + crate::api::types::PkOrF::Fingerprint { value } => { + ::sse_encode(2, serializer); + ::sse_encode(value, serializer); + } + _ => { + unimplemented!(""); + } + } + } +} + impl SseEncode for crate::api::types::PsbtSigHashType { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5914,6 +6782,14 @@ impl SseEncode } } +impl SseEncode for (Vec, Vec) { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >::sse_encode(self.0, serializer); + >::sse_encode(self.1, serializer); + } +} + impl SseEncode for (crate::api::types::OutPoint, crate::api::types::Input, usize) { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5923,6 +6799,22 @@ impl SseEncode for (crate::api::types::OutPoint, crate::api::types::Input, usize } } +impl SseEncode for (String, Vec) { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.0, serializer); + >::sse_encode(self.1, serializer); + } +} + +impl SseEncode for (u32, Vec) { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.0, serializer); + >::sse_encode(self.1, serializer); + } +} + impl SseEncode for crate::api::blockchain::RpcConfig { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5944,6 +6836,108 @@ impl SseEncode for crate::api::blockchain::RpcSyncParams { } } +impl SseEncode for crate::api::types::Satisfaction { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + match self { + crate::api::types::Satisfaction::Partial { + n, + m, + items, + sorted, + conditions, + } => { + ::sse_encode(0, serializer); + ::sse_encode(n, serializer); + ::sse_encode(m, serializer); + >::sse_encode(items, serializer); + >::sse_encode(sorted, serializer); + >>::sse_encode( + conditions, serializer, + ); + } + crate::api::types::Satisfaction::PartialComplete { + n, + m, + items, + sorted, + conditions, + } => { + ::sse_encode(1, serializer); + ::sse_encode(n, serializer); + ::sse_encode(m, serializer); + >::sse_encode(items, serializer); + >::sse_encode(sorted, serializer); + , Vec>>::sse_encode(conditions, serializer); + } + crate::api::types::Satisfaction::Complete { condition } => { + ::sse_encode(2, serializer); + ::sse_encode(condition, serializer); + } + crate::api::types::Satisfaction::None { msg } => { + ::sse_encode(3, serializer); + ::sse_encode(msg, serializer); + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseEncode for crate::api::types::SatisfiableItem { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + match self { + crate::api::types::SatisfiableItem::EcdsaSignature { key } => { + ::sse_encode(0, serializer); + ::sse_encode(key, serializer); + } + crate::api::types::SatisfiableItem::SchnorrSignature { key } => { + ::sse_encode(1, serializer); + ::sse_encode(key, serializer); + } + crate::api::types::SatisfiableItem::Sha256Preimage { hash } => { + ::sse_encode(2, serializer); + ::sse_encode(hash, serializer); + } + crate::api::types::SatisfiableItem::Hash256Preimage { hash } => { + ::sse_encode(3, serializer); + ::sse_encode(hash, serializer); + } + crate::api::types::SatisfiableItem::Ripemd160Preimage { hash } => { + ::sse_encode(4, serializer); + ::sse_encode(hash, serializer); + } + crate::api::types::SatisfiableItem::Hash160Preimage { hash } => { + ::sse_encode(5, serializer); + ::sse_encode(hash, serializer); + } + crate::api::types::SatisfiableItem::AbsoluteTimelock { value } => { + ::sse_encode(6, serializer); + ::sse_encode(value, serializer); + } + crate::api::types::SatisfiableItem::RelativeTimelock { value } => { + ::sse_encode(7, serializer); + ::sse_encode(value, serializer); + } + crate::api::types::SatisfiableItem::Multisig { keys, threshold } => { + ::sse_encode(8, serializer); + >::sse_encode(keys, serializer); + ::sse_encode(threshold, serializer); + } + crate::api::types::SatisfiableItem::Thresh { items, threshold } => { + ::sse_encode(9, serializer); + >::sse_encode(items, serializer); + ::sse_encode(threshold, serializer); + } + _ => { + unimplemented!(""); + } + } + } +} + impl SseEncode for crate::api::types::ScriptAmount { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { diff --git a/test/bdk_flutter_test.mocks.dart b/test/bdk_flutter_test.mocks.dart index 191bee69..3b01c830 100644 --- a/test/bdk_flutter_test.mocks.dart +++ b/test/bdk_flutter_test.mocks.dart @@ -553,6 +553,15 @@ class MockWallet extends _i1.Mock implements _i3.Wallet { returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); + + @override + _i3.Policy? policies(_i3.KeychainKind? keychain) => (super.noSuchMethod( + Invocation.method( + #policies, + [keychain], + ), + returnValueForMissingStub: null, + ) as _i3.Policy?); } /// A class which mocks [Transaction]. @@ -1695,6 +1704,41 @@ class MockTxBuilder extends _i1.Mock implements _i3.TxBuilder { ), ) as _i3.TxBuilder); + @override + _i3.TxBuilder policyPath( + _i3.KeychainKind? keychain, + Map? path, + ) => + (super.noSuchMethod( + Invocation.method( + #policyPath, + [ + keychain, + path, + ], + ), + returnValue: _FakeTxBuilder_14( + this, + Invocation.method( + #policyPath, + [ + keychain, + path, + ], + ), + ), + returnValueForMissingStub: _FakeTxBuilder_14( + this, + Invocation.method( + #policyPath, + [ + keychain, + path, + ], + ), + ), + ) as _i3.TxBuilder); + @override _i3.TxBuilder onlySpendChange() => (super.noSuchMethod( Invocation.method(