diff --git a/ios/Classes/frb_generated.h b/ios/Classes/frb_generated.h index 360dfb3..7835b31 100644 --- a/ios/Classes/frb_generated.h +++ b/ios/Classes/frb_generated.h @@ -30,7 +30,7 @@ typedef struct wire_cst_pre_image { struct wire_cst_list_prim_u_8_strict *hash160; } wire_cst_pre_image; -typedef struct wire_cst_btc_ln_swap { +typedef struct wire_cst_btc_ln_v_1_swap { struct wire_cst_list_prim_u_8_strict *id; int32_t kind; int32_t network; @@ -42,9 +42,9 @@ typedef struct wire_cst_btc_ln_swap { uint64_t out_amount; struct wire_cst_list_prim_u_8_strict *electrum_url; struct wire_cst_list_prim_u_8_strict *boltz_url; -} wire_cst_btc_ln_swap; +} wire_cst_btc_ln_v_1_swap; -typedef struct wire_cst_lbtc_ln_swap { +typedef struct wire_cst_lbtc_ln_v_1_swap { struct wire_cst_list_prim_u_8_strict *id; int32_t kind; int32_t network; @@ -57,7 +57,7 @@ typedef struct wire_cst_lbtc_ln_swap { struct wire_cst_list_prim_u_8_strict *blinding_key; struct wire_cst_list_prim_u_8_strict *electrum_url; struct wire_cst_list_prim_u_8_strict *boltz_url; -} wire_cst_lbtc_ln_swap; +} wire_cst_lbtc_ln_v_1_swap; typedef struct wire_cst_limits { uint64_t minimal; @@ -102,96 +102,98 @@ typedef struct wire_cst_decoded_invoice { uint64_t cltv_exp_delta; } wire_cst_decoded_invoice; -void frbgen_boltz_dart_wire_BtcLnSwap_btc_ln_submarine_refund(int64_t port_, - struct wire_cst_btc_ln_swap *that, - struct wire_cst_list_prim_u_8_strict *out_address, - uint64_t abs_fee); - -void frbgen_boltz_dart_wire_BtcLnSwap_create_reverse_v1(int64_t port_, - struct wire_cst_list_prim_u_8_strict *mnemonic, - uint64_t index, - uint64_t out_amount, - int32_t network, - struct wire_cst_list_prim_u_8_strict *electrum_url, - struct wire_cst_list_prim_u_8_strict *boltz_url, - struct wire_cst_list_prim_u_8_strict *pair_hash); - -void frbgen_boltz_dart_wire_BtcLnSwap_create_submarine_v1(int64_t port_, - struct wire_cst_list_prim_u_8_strict *mnemonic, - uint64_t index, - struct wire_cst_list_prim_u_8_strict *invoice, - int32_t network, - struct wire_cst_list_prim_u_8_strict *electrum_url, - struct wire_cst_list_prim_u_8_strict *boltz_url, - struct wire_cst_list_prim_u_8_strict *pair_hash); - -void frbgen_boltz_dart_wire_BtcLnSwap_new(int64_t port_, - struct wire_cst_list_prim_u_8_strict *id, - int32_t kind, - int32_t network, - struct wire_cst_key_pair *keys, - struct wire_cst_pre_image *preimage, - struct wire_cst_list_prim_u_8_strict *redeem_script, - struct wire_cst_list_prim_u_8_strict *invoice, - struct wire_cst_list_prim_u_8_strict *script_address, - uint64_t out_amount, - struct wire_cst_list_prim_u_8_strict *electrum_url, - struct wire_cst_list_prim_u_8_strict *boltz_url); - -void frbgen_boltz_dart_wire_BtcLnSwap_reverse_v1_claim(int64_t port_, - struct wire_cst_btc_ln_swap *that, - struct wire_cst_list_prim_u_8_strict *out_address, - uint64_t abs_fee); - -void frbgen_boltz_dart_wire_BtcLnSwap_tx_size(int64_t port_, struct wire_cst_btc_ln_swap *that); +void frbgen_boltz_dart_wire_BtcLnV1Swap_claim(int64_t port_, + struct wire_cst_btc_ln_v_1_swap *that, + struct wire_cst_list_prim_u_8_strict *out_address, + uint64_t abs_fee); + +void frbgen_boltz_dart_wire_BtcLnV1Swap_new(int64_t port_, + struct wire_cst_list_prim_u_8_strict *id, + int32_t kind, + int32_t network, + struct wire_cst_key_pair *keys, + struct wire_cst_pre_image *preimage, + struct wire_cst_list_prim_u_8_strict *redeem_script, + struct wire_cst_list_prim_u_8_strict *invoice, + struct wire_cst_list_prim_u_8_strict *script_address, + uint64_t out_amount, + struct wire_cst_list_prim_u_8_strict *electrum_url, + struct wire_cst_list_prim_u_8_strict *boltz_url); + +void frbgen_boltz_dart_wire_BtcLnV1Swap_new_reverse(int64_t port_, + struct wire_cst_list_prim_u_8_strict *mnemonic, + uint64_t index, + uint64_t out_amount, + int32_t network, + struct wire_cst_list_prim_u_8_strict *electrum_url, + struct wire_cst_list_prim_u_8_strict *boltz_url, + struct wire_cst_list_prim_u_8_strict *pair_hash); + +void frbgen_boltz_dart_wire_BtcLnV1Swap_new_submarine(int64_t port_, + struct wire_cst_list_prim_u_8_strict *mnemonic, + uint64_t index, + struct wire_cst_list_prim_u_8_strict *invoice, + int32_t network, + struct wire_cst_list_prim_u_8_strict *electrum_url, + struct wire_cst_list_prim_u_8_strict *boltz_url, + struct wire_cst_list_prim_u_8_strict *pair_hash); + +void frbgen_boltz_dart_wire_BtcLnV1Swap_refund(int64_t port_, + struct wire_cst_btc_ln_v_1_swap *that, + struct wire_cst_list_prim_u_8_strict *out_address, + uint64_t abs_fee); + +void frbgen_boltz_dart_wire_BtcLnV1Swap_tx_size(int64_t port_, + struct wire_cst_btc_ln_v_1_swap *that); void frbgen_boltz_dart_wire_BoltzError_new(int64_t port_, struct wire_cst_list_prim_u_8_strict *kind, struct wire_cst_list_prim_u_8_strict *message); -void frbgen_boltz_dart_wire_LbtcLnSwap_create_reverse_v1(int64_t port_, - struct wire_cst_list_prim_u_8_strict *mnemonic, - uint64_t index, - uint64_t out_amount, - int32_t network, - struct wire_cst_list_prim_u_8_strict *electrum_url, - struct wire_cst_list_prim_u_8_strict *boltz_url, - struct wire_cst_list_prim_u_8_strict *pair_hash); - -void frbgen_boltz_dart_wire_LbtcLnSwap_create_submarine_v1(int64_t port_, - struct wire_cst_list_prim_u_8_strict *mnemonic, - uint64_t index, - struct wire_cst_list_prim_u_8_strict *invoice, - int32_t network, - struct wire_cst_list_prim_u_8_strict *electrum_url, - struct wire_cst_list_prim_u_8_strict *boltz_url, - struct wire_cst_list_prim_u_8_strict *pair_hash); - -void frbgen_boltz_dart_wire_LbtcLnSwap_new(int64_t port_, - struct wire_cst_list_prim_u_8_strict *id, - int32_t kind, - int32_t network, - struct wire_cst_key_pair *keys, - struct wire_cst_pre_image *preimage, - struct wire_cst_list_prim_u_8_strict *redeem_script, - struct wire_cst_list_prim_u_8_strict *invoice, - uint64_t out_amount, - struct wire_cst_list_prim_u_8_strict *out_address, - struct wire_cst_list_prim_u_8_strict *blinding_key, - struct wire_cst_list_prim_u_8_strict *electrum_url, - struct wire_cst_list_prim_u_8_strict *boltz_url); - -void frbgen_boltz_dart_wire_LbtcLnSwap_reverse_v1_claim(int64_t port_, - struct wire_cst_lbtc_ln_swap *that, - struct wire_cst_list_prim_u_8_strict *out_address, - uint64_t abs_fee); - -void frbgen_boltz_dart_wire_LbtcLnSwap_submarine_v1_refund(int64_t port_, - struct wire_cst_lbtc_ln_swap *that, - struct wire_cst_list_prim_u_8_strict *out_address, - uint64_t abs_fee); - -void frbgen_boltz_dart_wire_LbtcLnSwap_tx_size(int64_t port_, struct wire_cst_lbtc_ln_swap *swap); +void frbgen_boltz_dart_wire_LbtcLnV1Swap_claim(int64_t port_, + struct wire_cst_lbtc_ln_v_1_swap *that, + struct wire_cst_list_prim_u_8_strict *out_address, + uint64_t abs_fee); + +void frbgen_boltz_dart_wire_LbtcLnV1Swap_new(int64_t port_, + struct wire_cst_list_prim_u_8_strict *id, + int32_t kind, + int32_t network, + struct wire_cst_key_pair *keys, + struct wire_cst_pre_image *preimage, + struct wire_cst_list_prim_u_8_strict *redeem_script, + struct wire_cst_list_prim_u_8_strict *invoice, + uint64_t out_amount, + struct wire_cst_list_prim_u_8_strict *out_address, + struct wire_cst_list_prim_u_8_strict *blinding_key, + struct wire_cst_list_prim_u_8_strict *electrum_url, + struct wire_cst_list_prim_u_8_strict *boltz_url); + +void frbgen_boltz_dart_wire_LbtcLnV1Swap_new_reverse(int64_t port_, + struct wire_cst_list_prim_u_8_strict *mnemonic, + uint64_t index, + uint64_t out_amount, + int32_t network, + struct wire_cst_list_prim_u_8_strict *electrum_url, + struct wire_cst_list_prim_u_8_strict *boltz_url, + struct wire_cst_list_prim_u_8_strict *pair_hash); + +void frbgen_boltz_dart_wire_LbtcLnV1Swap_new_submarine(int64_t port_, + struct wire_cst_list_prim_u_8_strict *mnemonic, + uint64_t index, + struct wire_cst_list_prim_u_8_strict *invoice, + int32_t network, + struct wire_cst_list_prim_u_8_strict *electrum_url, + struct wire_cst_list_prim_u_8_strict *boltz_url, + struct wire_cst_list_prim_u_8_strict *pair_hash); + +void frbgen_boltz_dart_wire_LbtcLnV1Swap_refund(int64_t port_, + struct wire_cst_lbtc_ln_v_1_swap *that, + struct wire_cst_list_prim_u_8_strict *out_address, + uint64_t abs_fee); + +void frbgen_boltz_dart_wire_LbtcLnV1Swap_tx_size(int64_t port_, + struct wire_cst_lbtc_ln_v_1_swap *swap); void frbgen_boltz_dart_wire_AllFees_fetch(int64_t port_, struct wire_cst_list_prim_u_8_strict *boltz_url); @@ -206,38 +208,38 @@ WireSyncRust2DartDco frbgen_boltz_dart_wire_KeyPair_new(struct wire_cst_list_pri WireSyncRust2DartDco frbgen_boltz_dart_wire_PreImage_new(void); -struct wire_cst_btc_ln_swap *frbgen_boltz_dart_cst_new_box_autoadd_btc_ln_swap(void); +struct wire_cst_btc_ln_v_1_swap *frbgen_boltz_dart_cst_new_box_autoadd_btc_ln_v_1_swap(void); struct wire_cst_key_pair *frbgen_boltz_dart_cst_new_box_autoadd_key_pair(void); -struct wire_cst_lbtc_ln_swap *frbgen_boltz_dart_cst_new_box_autoadd_lbtc_ln_swap(void); +struct wire_cst_lbtc_ln_v_1_swap *frbgen_boltz_dart_cst_new_box_autoadd_lbtc_ln_v_1_swap(void); struct wire_cst_pre_image *frbgen_boltz_dart_cst_new_box_autoadd_pre_image(void); struct wire_cst_list_prim_u_8_strict *frbgen_boltz_dart_cst_new_list_prim_u_8_strict(int32_t len); static int64_t dummy_method_to_enforce_bundling(void) { int64_t dummy_var = 0; - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_box_autoadd_btc_ln_swap); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_box_autoadd_btc_ln_v_1_swap); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_box_autoadd_key_pair); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_box_autoadd_lbtc_ln_swap); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_box_autoadd_lbtc_ln_v_1_swap); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_box_autoadd_pre_image); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_list_prim_u_8_strict); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_AllFees_fetch); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BoltzError_new); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnSwap_btc_ln_submarine_refund); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnSwap_create_reverse_v1); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnSwap_create_submarine_v1); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnSwap_new); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnSwap_reverse_v1_claim); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnSwap_tx_size); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnV1Swap_claim); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnV1Swap_new); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnV1Swap_new_reverse); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnV1Swap_new_submarine); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnV1Swap_refund); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnV1Swap_tx_size); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_DecodedInvoice_from_string); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_KeyPair_new); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnSwap_create_reverse_v1); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnSwap_create_submarine_v1); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnSwap_new); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnSwap_reverse_v1_claim); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnSwap_submarine_v1_refund); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnSwap_tx_size); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnV1Swap_claim); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnV1Swap_new); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnV1Swap_new_reverse); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnV1Swap_new_submarine); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnV1Swap_refund); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnV1Swap_tx_size); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_PreImage_new); dummy_var ^= ((int64_t) (void*) store_dart_post_cobject); return dummy_var; diff --git a/lib/src/generated/api/btc_ln.dart b/lib/src/generated/api/btc_ln.dart index cd05749..4e767e6 100644 --- a/lib/src/generated/api/btc_ln.dart +++ b/lib/src/generated/api/btc_ln.dart @@ -11,9 +11,9 @@ import 'types.dart'; part 'btc_ln.freezed.dart'; @freezed -class BtcLnSwap with _$BtcLnSwap { - const BtcLnSwap._(); - const factory BtcLnSwap({ +class BtcLnV1Swap with _$BtcLnV1Swap { + const BtcLnV1Swap._(); + const factory BtcLnV1Swap({ required String id, required SwapType kind, required Chain network, @@ -25,16 +25,44 @@ class BtcLnSwap with _$BtcLnSwap { required int outAmount, required String electrumUrl, required String boltzUrl, - }) = _BtcLnSwap; - Future btcLnSubmarineRefund( + }) = _BtcLnV1Swap; + Future claim( {required String outAddress, required int absFee, dynamic hint}) => - BoltzCore.instance.api.btcLnSwapBtcLnSubmarineRefund( + BoltzCore.instance.api.btcLnV1SwapClaim( that: this, outAddress: outAddress, absFee: absFee, ); - static Future createReverseV1( + // HINT: Make it `#[frb(sync)]` to let it become the default constructor of Dart class. + static Future newInstance( + {required String id, + required SwapType kind, + required Chain network, + required KeyPair keys, + required PreImage preimage, + required String redeemScript, + required String invoice, + required String scriptAddress, + required int outAmount, + required String electrumUrl, + required String boltzUrl, + dynamic hint}) => + BoltzCore.instance.api.btcLnV1SwapNew( + id: id, + kind: kind, + network: network, + keys: keys, + preimage: preimage, + redeemScript: redeemScript, + invoice: invoice, + scriptAddress: scriptAddress, + outAmount: outAmount, + electrumUrl: electrumUrl, + boltzUrl: boltzUrl, + hint: hint); + + static Future newReverse( {required String mnemonic, required int index, required int outAmount, @@ -43,7 +71,7 @@ class BtcLnSwap with _$BtcLnSwap { required String boltzUrl, required String pairHash, dynamic hint}) => - BoltzCore.instance.api.btcLnSwapCreateReverseV1( + BoltzCore.instance.api.btcLnV1SwapNewReverse( mnemonic: mnemonic, index: index, outAmount: outAmount, @@ -53,7 +81,7 @@ class BtcLnSwap with _$BtcLnSwap { pairHash: pairHash, hint: hint); - static Future createSubmarineV1( + static Future newSubmarine( {required String mnemonic, required int index, required String invoice, @@ -62,7 +90,7 @@ class BtcLnSwap with _$BtcLnSwap { required String boltzUrl, required String pairHash, dynamic hint}) => - BoltzCore.instance.api.btcLnSwapCreateSubmarineV1( + BoltzCore.instance.api.btcLnV1SwapNewSubmarine( mnemonic: mnemonic, index: index, invoice: invoice, @@ -72,43 +100,16 @@ class BtcLnSwap with _$BtcLnSwap { pairHash: pairHash, hint: hint); - // HINT: Make it `#[frb(sync)]` to let it become the default constructor of Dart class. - static Future newInstance( - {required String id, - required SwapType kind, - required Chain network, - required KeyPair keys, - required PreImage preimage, - required String redeemScript, - required String invoice, - required String scriptAddress, - required int outAmount, - required String electrumUrl, - required String boltzUrl, - dynamic hint}) => - BoltzCore.instance.api.btcLnSwapNew( - id: id, - kind: kind, - network: network, - keys: keys, - preimage: preimage, - redeemScript: redeemScript, - invoice: invoice, - scriptAddress: scriptAddress, - outAmount: outAmount, - electrumUrl: electrumUrl, - boltzUrl: boltzUrl, - hint: hint); - - Future reverseV1Claim( + Future refund( {required String outAddress, required int absFee, dynamic hint}) => - BoltzCore.instance.api.btcLnSwapReverseV1Claim( + BoltzCore.instance.api.btcLnV1SwapRefund( that: this, outAddress: outAddress, absFee: absFee, ); - Future txSize({dynamic hint}) => BoltzCore.instance.api.btcLnSwapTxSize( + Future txSize({dynamic hint}) => + BoltzCore.instance.api.btcLnV1SwapTxSize( that: this, ); } diff --git a/lib/src/generated/api/btc_ln.freezed.dart b/lib/src/generated/api/btc_ln.freezed.dart index 832c0f9..2a03729 100644 --- a/lib/src/generated/api/btc_ln.freezed.dart +++ b/lib/src/generated/api/btc_ln.freezed.dart @@ -15,7 +15,7 @@ final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); /// @nodoc -mixin _$BtcLnSwap { +mixin _$BtcLnV1Swap { String get id => throw _privateConstructorUsedError; SwapType get kind => throw _privateConstructorUsedError; Chain get network => throw _privateConstructorUsedError; @@ -29,14 +29,15 @@ mixin _$BtcLnSwap { String get boltzUrl => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $BtcLnSwapCopyWith get copyWith => + $BtcLnV1SwapCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $BtcLnSwapCopyWith<$Res> { - factory $BtcLnSwapCopyWith(BtcLnSwap value, $Res Function(BtcLnSwap) then) = - _$BtcLnSwapCopyWithImpl<$Res, BtcLnSwap>; +abstract class $BtcLnV1SwapCopyWith<$Res> { + factory $BtcLnV1SwapCopyWith( + BtcLnV1Swap value, $Res Function(BtcLnV1Swap) then) = + _$BtcLnV1SwapCopyWithImpl<$Res, BtcLnV1Swap>; @useResult $Res call( {String id, @@ -56,9 +57,9 @@ abstract class $BtcLnSwapCopyWith<$Res> { } /// @nodoc -class _$BtcLnSwapCopyWithImpl<$Res, $Val extends BtcLnSwap> - implements $BtcLnSwapCopyWith<$Res> { - _$BtcLnSwapCopyWithImpl(this._value, this._then); +class _$BtcLnV1SwapCopyWithImpl<$Res, $Val extends BtcLnV1Swap> + implements $BtcLnV1SwapCopyWith<$Res> { + _$BtcLnV1SwapCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -146,11 +147,11 @@ class _$BtcLnSwapCopyWithImpl<$Res, $Val extends BtcLnSwap> } /// @nodoc -abstract class _$$BtcLnSwapImplCopyWith<$Res> - implements $BtcLnSwapCopyWith<$Res> { - factory _$$BtcLnSwapImplCopyWith( - _$BtcLnSwapImpl value, $Res Function(_$BtcLnSwapImpl) then) = - __$$BtcLnSwapImplCopyWithImpl<$Res>; +abstract class _$$BtcLnV1SwapImplCopyWith<$Res> + implements $BtcLnV1SwapCopyWith<$Res> { + factory _$$BtcLnV1SwapImplCopyWith( + _$BtcLnV1SwapImpl value, $Res Function(_$BtcLnV1SwapImpl) then) = + __$$BtcLnV1SwapImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -173,11 +174,11 @@ abstract class _$$BtcLnSwapImplCopyWith<$Res> } /// @nodoc -class __$$BtcLnSwapImplCopyWithImpl<$Res> - extends _$BtcLnSwapCopyWithImpl<$Res, _$BtcLnSwapImpl> - implements _$$BtcLnSwapImplCopyWith<$Res> { - __$$BtcLnSwapImplCopyWithImpl( - _$BtcLnSwapImpl _value, $Res Function(_$BtcLnSwapImpl) _then) +class __$$BtcLnV1SwapImplCopyWithImpl<$Res> + extends _$BtcLnV1SwapCopyWithImpl<$Res, _$BtcLnV1SwapImpl> + implements _$$BtcLnV1SwapImplCopyWith<$Res> { + __$$BtcLnV1SwapImplCopyWithImpl( + _$BtcLnV1SwapImpl _value, $Res Function(_$BtcLnV1SwapImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -195,7 +196,7 @@ class __$$BtcLnSwapImplCopyWithImpl<$Res> Object? electrumUrl = null, Object? boltzUrl = null, }) { - return _then(_$BtcLnSwapImpl( + return _then(_$BtcLnV1SwapImpl( id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -246,8 +247,8 @@ class __$$BtcLnSwapImplCopyWithImpl<$Res> /// @nodoc -class _$BtcLnSwapImpl extends _BtcLnSwap { - const _$BtcLnSwapImpl( +class _$BtcLnV1SwapImpl extends _BtcLnV1Swap { + const _$BtcLnV1SwapImpl( {required this.id, required this.kind, required this.network, @@ -286,14 +287,14 @@ class _$BtcLnSwapImpl extends _BtcLnSwap { @override String toString() { - return 'BtcLnSwap(id: $id, kind: $kind, network: $network, keys: $keys, preimage: $preimage, redeemScript: $redeemScript, invoice: $invoice, scriptAddress: $scriptAddress, outAmount: $outAmount, electrumUrl: $electrumUrl, boltzUrl: $boltzUrl)'; + return 'BtcLnV1Swap(id: $id, kind: $kind, network: $network, keys: $keys, preimage: $preimage, redeemScript: $redeemScript, invoice: $invoice, scriptAddress: $scriptAddress, outAmount: $outAmount, electrumUrl: $electrumUrl, boltzUrl: $boltzUrl)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$BtcLnSwapImpl && + other is _$BtcLnV1SwapImpl && (identical(other.id, id) || other.id == id) && (identical(other.kind, kind) || other.kind == kind) && (identical(other.network, network) || other.network == network) && @@ -331,12 +332,12 @@ class _$BtcLnSwapImpl extends _BtcLnSwap { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$BtcLnSwapImplCopyWith<_$BtcLnSwapImpl> get copyWith => - __$$BtcLnSwapImplCopyWithImpl<_$BtcLnSwapImpl>(this, _$identity); + _$$BtcLnV1SwapImplCopyWith<_$BtcLnV1SwapImpl> get copyWith => + __$$BtcLnV1SwapImplCopyWithImpl<_$BtcLnV1SwapImpl>(this, _$identity); } -abstract class _BtcLnSwap extends BtcLnSwap { - const factory _BtcLnSwap( +abstract class _BtcLnV1Swap extends BtcLnV1Swap { + const factory _BtcLnV1Swap( {required final String id, required final SwapType kind, required final Chain network, @@ -347,8 +348,8 @@ abstract class _BtcLnSwap extends BtcLnSwap { required final String scriptAddress, required final int outAmount, required final String electrumUrl, - required final String boltzUrl}) = _$BtcLnSwapImpl; - const _BtcLnSwap._() : super._(); + required final String boltzUrl}) = _$BtcLnV1SwapImpl; + const _BtcLnV1Swap._() : super._(); @override String get id; @@ -374,6 +375,6 @@ abstract class _BtcLnSwap extends BtcLnSwap { String get boltzUrl; @override @JsonKey(ignore: true) - _$$BtcLnSwapImplCopyWith<_$BtcLnSwapImpl> get copyWith => + _$$BtcLnV1SwapImplCopyWith<_$BtcLnV1SwapImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/generated/api/lbtc_ln.dart b/lib/src/generated/api/lbtc_ln.dart index 2bb383d..dc8add5 100644 --- a/lib/src/generated/api/lbtc_ln.dart +++ b/lib/src/generated/api/lbtc_ln.dart @@ -11,9 +11,9 @@ import 'types.dart'; part 'lbtc_ln.freezed.dart'; @freezed -class LbtcLnSwap with _$LbtcLnSwap { - const LbtcLnSwap._(); - const factory LbtcLnSwap({ +class LbtcLnV1Swap with _$LbtcLnV1Swap { + const LbtcLnV1Swap._(); + const factory LbtcLnV1Swap({ required String id, required SwapType kind, required Chain network, @@ -26,8 +26,46 @@ class LbtcLnSwap with _$LbtcLnSwap { required String blindingKey, required String electrumUrl, required String boltzUrl, - }) = _LbtcLnSwap; - static Future createReverseV1( + }) = _LbtcLnV1Swap; + Future claim( + {required String outAddress, required int absFee, dynamic hint}) => + BoltzCore.instance.api.lbtcLnV1SwapClaim( + that: this, + outAddress: outAddress, + absFee: absFee, + ); + + // HINT: Make it `#[frb(sync)]` to let it become the default constructor of Dart class. + static Future newInstance( + {required String id, + required SwapType kind, + required Chain network, + required KeyPair keys, + required PreImage preimage, + required String redeemScript, + required String invoice, + required int outAmount, + required String outAddress, + required String blindingKey, + required String electrumUrl, + required String boltzUrl, + dynamic hint}) => + BoltzCore.instance.api.lbtcLnV1SwapNew( + id: id, + kind: kind, + network: network, + keys: keys, + preimage: preimage, + redeemScript: redeemScript, + invoice: invoice, + outAmount: outAmount, + outAddress: outAddress, + blindingKey: blindingKey, + electrumUrl: electrumUrl, + boltzUrl: boltzUrl, + hint: hint); + + static Future newReverse( {required String mnemonic, required int index, required int outAmount, @@ -36,7 +74,7 @@ class LbtcLnSwap with _$LbtcLnSwap { required String boltzUrl, required String pairHash, dynamic hint}) => - BoltzCore.instance.api.lbtcLnSwapCreateReverseV1( + BoltzCore.instance.api.lbtcLnV1SwapNewReverse( mnemonic: mnemonic, index: index, outAmount: outAmount, @@ -46,7 +84,7 @@ class LbtcLnSwap with _$LbtcLnSwap { pairHash: pairHash, hint: hint); - static Future createSubmarineV1( + static Future newSubmarine( {required String mnemonic, required int index, required String invoice, @@ -55,7 +93,7 @@ class LbtcLnSwap with _$LbtcLnSwap { required String boltzUrl, required String pairHash, dynamic hint}) => - BoltzCore.instance.api.lbtcLnSwapCreateSubmarineV1( + BoltzCore.instance.api.lbtcLnV1SwapNewSubmarine( mnemonic: mnemonic, index: index, invoice: invoice, @@ -65,52 +103,14 @@ class LbtcLnSwap with _$LbtcLnSwap { pairHash: pairHash, hint: hint); - // HINT: Make it `#[frb(sync)]` to let it become the default constructor of Dart class. - static Future newInstance( - {required String id, - required SwapType kind, - required Chain network, - required KeyPair keys, - required PreImage preimage, - required String redeemScript, - required String invoice, - required int outAmount, - required String outAddress, - required String blindingKey, - required String electrumUrl, - required String boltzUrl, - dynamic hint}) => - BoltzCore.instance.api.lbtcLnSwapNew( - id: id, - kind: kind, - network: network, - keys: keys, - preimage: preimage, - redeemScript: redeemScript, - invoice: invoice, - outAmount: outAmount, - outAddress: outAddress, - blindingKey: blindingKey, - electrumUrl: electrumUrl, - boltzUrl: boltzUrl, - hint: hint); - - Future reverseV1Claim( - {required String outAddress, required int absFee, dynamic hint}) => - BoltzCore.instance.api.lbtcLnSwapReverseV1Claim( - that: this, - outAddress: outAddress, - absFee: absFee, - ); - - Future submarineV1Refund( + Future refund( {required String outAddress, required int absFee, dynamic hint}) => - BoltzCore.instance.api.lbtcLnSwapSubmarineV1Refund( + BoltzCore.instance.api.lbtcLnV1SwapRefund( that: this, outAddress: outAddress, absFee: absFee, ); - static Future txSize({required LbtcLnSwap swap, dynamic hint}) => - BoltzCore.instance.api.lbtcLnSwapTxSize(swap: swap, hint: hint); + static Future txSize({required LbtcLnV1Swap swap, dynamic hint}) => + BoltzCore.instance.api.lbtcLnV1SwapTxSize(swap: swap, hint: hint); } diff --git a/lib/src/generated/api/lbtc_ln.freezed.dart b/lib/src/generated/api/lbtc_ln.freezed.dart index ca97fbb..628005f 100644 --- a/lib/src/generated/api/lbtc_ln.freezed.dart +++ b/lib/src/generated/api/lbtc_ln.freezed.dart @@ -15,7 +15,7 @@ final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); /// @nodoc -mixin _$LbtcLnSwap { +mixin _$LbtcLnV1Swap { String get id => throw _privateConstructorUsedError; SwapType get kind => throw _privateConstructorUsedError; Chain get network => throw _privateConstructorUsedError; @@ -30,15 +30,15 @@ mixin _$LbtcLnSwap { String get boltzUrl => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $LbtcLnSwapCopyWith get copyWith => + $LbtcLnV1SwapCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $LbtcLnSwapCopyWith<$Res> { - factory $LbtcLnSwapCopyWith( - LbtcLnSwap value, $Res Function(LbtcLnSwap) then) = - _$LbtcLnSwapCopyWithImpl<$Res, LbtcLnSwap>; +abstract class $LbtcLnV1SwapCopyWith<$Res> { + factory $LbtcLnV1SwapCopyWith( + LbtcLnV1Swap value, $Res Function(LbtcLnV1Swap) then) = + _$LbtcLnV1SwapCopyWithImpl<$Res, LbtcLnV1Swap>; @useResult $Res call( {String id, @@ -59,9 +59,9 @@ abstract class $LbtcLnSwapCopyWith<$Res> { } /// @nodoc -class _$LbtcLnSwapCopyWithImpl<$Res, $Val extends LbtcLnSwap> - implements $LbtcLnSwapCopyWith<$Res> { - _$LbtcLnSwapCopyWithImpl(this._value, this._then); +class _$LbtcLnV1SwapCopyWithImpl<$Res, $Val extends LbtcLnV1Swap> + implements $LbtcLnV1SwapCopyWith<$Res> { + _$LbtcLnV1SwapCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -154,11 +154,11 @@ class _$LbtcLnSwapCopyWithImpl<$Res, $Val extends LbtcLnSwap> } /// @nodoc -abstract class _$$LbtcLnSwapImplCopyWith<$Res> - implements $LbtcLnSwapCopyWith<$Res> { - factory _$$LbtcLnSwapImplCopyWith( - _$LbtcLnSwapImpl value, $Res Function(_$LbtcLnSwapImpl) then) = - __$$LbtcLnSwapImplCopyWithImpl<$Res>; +abstract class _$$LbtcLnV1SwapImplCopyWith<$Res> + implements $LbtcLnV1SwapCopyWith<$Res> { + factory _$$LbtcLnV1SwapImplCopyWith( + _$LbtcLnV1SwapImpl value, $Res Function(_$LbtcLnV1SwapImpl) then) = + __$$LbtcLnV1SwapImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -182,11 +182,11 @@ abstract class _$$LbtcLnSwapImplCopyWith<$Res> } /// @nodoc -class __$$LbtcLnSwapImplCopyWithImpl<$Res> - extends _$LbtcLnSwapCopyWithImpl<$Res, _$LbtcLnSwapImpl> - implements _$$LbtcLnSwapImplCopyWith<$Res> { - __$$LbtcLnSwapImplCopyWithImpl( - _$LbtcLnSwapImpl _value, $Res Function(_$LbtcLnSwapImpl) _then) +class __$$LbtcLnV1SwapImplCopyWithImpl<$Res> + extends _$LbtcLnV1SwapCopyWithImpl<$Res, _$LbtcLnV1SwapImpl> + implements _$$LbtcLnV1SwapImplCopyWith<$Res> { + __$$LbtcLnV1SwapImplCopyWithImpl( + _$LbtcLnV1SwapImpl _value, $Res Function(_$LbtcLnV1SwapImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -205,7 +205,7 @@ class __$$LbtcLnSwapImplCopyWithImpl<$Res> Object? electrumUrl = null, Object? boltzUrl = null, }) { - return _then(_$LbtcLnSwapImpl( + return _then(_$LbtcLnV1SwapImpl( id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -260,8 +260,8 @@ class __$$LbtcLnSwapImplCopyWithImpl<$Res> /// @nodoc -class _$LbtcLnSwapImpl extends _LbtcLnSwap { - const _$LbtcLnSwapImpl( +class _$LbtcLnV1SwapImpl extends _LbtcLnV1Swap { + const _$LbtcLnV1SwapImpl( {required this.id, required this.kind, required this.network, @@ -303,14 +303,14 @@ class _$LbtcLnSwapImpl extends _LbtcLnSwap { @override String toString() { - return 'LbtcLnSwap(id: $id, kind: $kind, network: $network, keys: $keys, preimage: $preimage, redeemScript: $redeemScript, invoice: $invoice, outAmount: $outAmount, scriptAddress: $scriptAddress, blindingKey: $blindingKey, electrumUrl: $electrumUrl, boltzUrl: $boltzUrl)'; + return 'LbtcLnV1Swap(id: $id, kind: $kind, network: $network, keys: $keys, preimage: $preimage, redeemScript: $redeemScript, invoice: $invoice, outAmount: $outAmount, scriptAddress: $scriptAddress, blindingKey: $blindingKey, electrumUrl: $electrumUrl, boltzUrl: $boltzUrl)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$LbtcLnSwapImpl && + other is _$LbtcLnV1SwapImpl && (identical(other.id, id) || other.id == id) && (identical(other.kind, kind) || other.kind == kind) && (identical(other.network, network) || other.network == network) && @@ -351,12 +351,12 @@ class _$LbtcLnSwapImpl extends _LbtcLnSwap { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LbtcLnSwapImplCopyWith<_$LbtcLnSwapImpl> get copyWith => - __$$LbtcLnSwapImplCopyWithImpl<_$LbtcLnSwapImpl>(this, _$identity); + _$$LbtcLnV1SwapImplCopyWith<_$LbtcLnV1SwapImpl> get copyWith => + __$$LbtcLnV1SwapImplCopyWithImpl<_$LbtcLnV1SwapImpl>(this, _$identity); } -abstract class _LbtcLnSwap extends LbtcLnSwap { - const factory _LbtcLnSwap( +abstract class _LbtcLnV1Swap extends LbtcLnV1Swap { + const factory _LbtcLnV1Swap( {required final String id, required final SwapType kind, required final Chain network, @@ -368,8 +368,8 @@ abstract class _LbtcLnSwap extends LbtcLnSwap { required final String scriptAddress, required final String blindingKey, required final String electrumUrl, - required final String boltzUrl}) = _$LbtcLnSwapImpl; - const _LbtcLnSwap._() : super._(); + required final String boltzUrl}) = _$LbtcLnV1SwapImpl; + const _LbtcLnV1Swap._() : super._(); @override String get id; @@ -397,6 +397,6 @@ abstract class _LbtcLnSwap extends LbtcLnSwap { String get boltzUrl; @override @JsonKey(ignore: true) - _$$LbtcLnSwapImplCopyWith<_$LbtcLnSwapImpl> get copyWith => + _$$LbtcLnV1SwapImplCopyWith<_$LbtcLnV1SwapImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/generated/frb_generated.dart b/lib/src/generated/frb_generated.dart index 81e16f1..b236ce8 100644 --- a/lib/src/generated/frb_generated.dart +++ b/lib/src/generated/frb_generated.dart @@ -66,13 +66,27 @@ class BoltzCore } abstract class BoltzCoreApi extends BaseApi { - Future btcLnSwapBtcLnSubmarineRefund( - {required BtcLnSwap that, + Future btcLnV1SwapClaim( + {required BtcLnV1Swap that, required String outAddress, required int absFee, dynamic hint}); - Future btcLnSwapCreateReverseV1( + Future btcLnV1SwapNew( + {required String id, + required SwapType kind, + required Chain network, + required KeyPair keys, + required PreImage preimage, + required String redeemScript, + required String invoice, + required String scriptAddress, + required int outAmount, + required String electrumUrl, + required String boltzUrl, + dynamic hint}); + + Future btcLnV1SwapNewReverse( {required String mnemonic, required int index, required int outAmount, @@ -82,7 +96,7 @@ abstract class BoltzCoreApi extends BaseApi { required String pairHash, dynamic hint}); - Future btcLnSwapCreateSubmarineV1( + Future btcLnV1SwapNewSubmarine( {required String mnemonic, required int index, required String invoice, @@ -92,7 +106,24 @@ abstract class BoltzCoreApi extends BaseApi { required String pairHash, dynamic hint}); - Future btcLnSwapNew( + Future btcLnV1SwapRefund( + {required BtcLnV1Swap that, + required String outAddress, + required int absFee, + dynamic hint}); + + Future btcLnV1SwapTxSize({required BtcLnV1Swap that, dynamic hint}); + + Future boltzErrorNew( + {required String kind, required String message, dynamic hint}); + + Future lbtcLnV1SwapClaim( + {required LbtcLnV1Swap that, + required String outAddress, + required int absFee, + dynamic hint}); + + Future lbtcLnV1SwapNew( {required String id, required SwapType kind, required Chain network, @@ -100,24 +131,14 @@ abstract class BoltzCoreApi extends BaseApi { required PreImage preimage, required String redeemScript, required String invoice, - required String scriptAddress, required int outAmount, + required String outAddress, + required String blindingKey, required String electrumUrl, required String boltzUrl, dynamic hint}); - Future btcLnSwapReverseV1Claim( - {required BtcLnSwap that, - required String outAddress, - required int absFee, - dynamic hint}); - - Future btcLnSwapTxSize({required BtcLnSwap that, dynamic hint}); - - Future boltzErrorNew( - {required String kind, required String message, dynamic hint}); - - Future lbtcLnSwapCreateReverseV1( + Future lbtcLnV1SwapNewReverse( {required String mnemonic, required int index, required int outAmount, @@ -127,7 +148,7 @@ abstract class BoltzCoreApi extends BaseApi { required String pairHash, dynamic hint}); - Future lbtcLnSwapCreateSubmarineV1( + Future lbtcLnV1SwapNewSubmarine( {required String mnemonic, required int index, required String invoice, @@ -137,34 +158,13 @@ abstract class BoltzCoreApi extends BaseApi { required String pairHash, dynamic hint}); - Future lbtcLnSwapNew( - {required String id, - required SwapType kind, - required Chain network, - required KeyPair keys, - required PreImage preimage, - required String redeemScript, - required String invoice, - required int outAmount, - required String outAddress, - required String blindingKey, - required String electrumUrl, - required String boltzUrl, - dynamic hint}); - - Future lbtcLnSwapReverseV1Claim( - {required LbtcLnSwap that, - required String outAddress, - required int absFee, - dynamic hint}); - - Future lbtcLnSwapSubmarineV1Refund( - {required LbtcLnSwap that, + Future lbtcLnV1SwapRefund( + {required LbtcLnV1Swap that, required String outAddress, required int absFee, dynamic hint}); - Future lbtcLnSwapTxSize({required LbtcLnSwap swap, dynamic hint}); + Future lbtcLnV1SwapTxSize({required LbtcLnV1Swap swap, dynamic hint}); Future allFeesFetch({required String boltzUrl, dynamic hint}); @@ -191,38 +191,106 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform }); @override - Future btcLnSwapBtcLnSubmarineRefund( - {required BtcLnSwap that, + Future btcLnV1SwapClaim( + {required BtcLnV1Swap that, required String outAddress, required int absFee, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_btc_ln_swap(that); + var arg0 = cst_encode_box_autoadd_btc_ln_v_1_swap(that); var arg1 = cst_encode_String(outAddress); var arg2 = cst_encode_u_64(absFee); - return wire.wire_BtcLnSwap_btc_ln_submarine_refund( - port_, arg0, arg1, arg2); + return wire.wire_BtcLnV1Swap_claim(port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_String, decodeErrorData: dco_decode_boltz_error, ), - constMeta: kBtcLnSwapBtcLnSubmarineRefundConstMeta, + constMeta: kBtcLnV1SwapClaimConstMeta, argValues: [that, outAddress, absFee], apiImpl: this, hint: hint, )); } - TaskConstMeta get kBtcLnSwapBtcLnSubmarineRefundConstMeta => - const TaskConstMeta( - debugName: "BtcLnSwap_btc_ln_submarine_refund", + TaskConstMeta get kBtcLnV1SwapClaimConstMeta => const TaskConstMeta( + debugName: "BtcLnV1Swap_claim", argNames: ["that", "outAddress", "absFee"], ); @override - Future btcLnSwapCreateReverseV1( + Future btcLnV1SwapNew( + {required String id, + required SwapType kind, + required Chain network, + required KeyPair keys, + required PreImage preimage, + required String redeemScript, + required String invoice, + required String scriptAddress, + required int outAmount, + required String electrumUrl, + required String boltzUrl, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_String(id); + var arg1 = cst_encode_swap_type(kind); + var arg2 = cst_encode_chain(network); + var arg3 = cst_encode_box_autoadd_key_pair(keys); + var arg4 = cst_encode_box_autoadd_pre_image(preimage); + var arg5 = cst_encode_String(redeemScript); + var arg6 = cst_encode_String(invoice); + var arg7 = cst_encode_String(scriptAddress); + var arg8 = cst_encode_u_64(outAmount); + var arg9 = cst_encode_String(electrumUrl); + var arg10 = cst_encode_String(boltzUrl); + return wire.wire_BtcLnV1Swap_new(port_, arg0, arg1, arg2, arg3, arg4, + arg5, arg6, arg7, arg8, arg9, arg10); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_btc_ln_v_1_swap, + decodeErrorData: null, + ), + constMeta: kBtcLnV1SwapNewConstMeta, + argValues: [ + id, + kind, + network, + keys, + preimage, + redeemScript, + invoice, + scriptAddress, + outAmount, + electrumUrl, + boltzUrl + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kBtcLnV1SwapNewConstMeta => const TaskConstMeta( + debugName: "BtcLnV1Swap_new", + argNames: [ + "id", + "kind", + "network", + "keys", + "preimage", + "redeemScript", + "invoice", + "scriptAddress", + "outAmount", + "electrumUrl", + "boltzUrl" + ], + ); + + @override + Future btcLnV1SwapNewReverse( {required String mnemonic, required int index, required int outAmount, @@ -240,14 +308,14 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform var arg4 = cst_encode_String(electrumUrl); var arg5 = cst_encode_String(boltzUrl); var arg6 = cst_encode_String(pairHash); - return wire.wire_BtcLnSwap_create_reverse_v1( + return wire.wire_BtcLnV1Swap_new_reverse( port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); }, codec: DcoCodec( - decodeSuccessData: dco_decode_btc_ln_swap, + decodeSuccessData: dco_decode_btc_ln_v_1_swap, decodeErrorData: dco_decode_boltz_error, ), - constMeta: kBtcLnSwapCreateReverseV1ConstMeta, + constMeta: kBtcLnV1SwapNewReverseConstMeta, argValues: [ mnemonic, index, @@ -262,8 +330,8 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform )); } - TaskConstMeta get kBtcLnSwapCreateReverseV1ConstMeta => const TaskConstMeta( - debugName: "BtcLnSwap_create_reverse_v1", + TaskConstMeta get kBtcLnV1SwapNewReverseConstMeta => const TaskConstMeta( + debugName: "BtcLnV1Swap_new_reverse", argNames: [ "mnemonic", "index", @@ -276,7 +344,7 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform ); @override - Future btcLnSwapCreateSubmarineV1( + Future btcLnV1SwapNewSubmarine( {required String mnemonic, required int index, required String invoice, @@ -294,14 +362,14 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform var arg4 = cst_encode_String(electrumUrl); var arg5 = cst_encode_String(boltzUrl); var arg6 = cst_encode_String(pairHash); - return wire.wire_BtcLnSwap_create_submarine_v1( + return wire.wire_BtcLnV1Swap_new_submarine( port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); }, codec: DcoCodec( - decodeSuccessData: dco_decode_btc_ln_swap, + decodeSuccessData: dco_decode_btc_ln_v_1_swap, decodeErrorData: dco_decode_boltz_error, ), - constMeta: kBtcLnSwapCreateSubmarineV1ConstMeta, + constMeta: kBtcLnV1SwapNewSubmarineConstMeta, argValues: [ mnemonic, index, @@ -316,8 +384,8 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform )); } - TaskConstMeta get kBtcLnSwapCreateSubmarineV1ConstMeta => const TaskConstMeta( - debugName: "BtcLnSwap_create_submarine_v1", + TaskConstMeta get kBtcLnV1SwapNewSubmarineConstMeta => const TaskConstMeta( + debugName: "BtcLnV1Swap_new_submarine", argNames: [ "mnemonic", "index", @@ -330,124 +398,54 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform ); @override - Future btcLnSwapNew( - {required String id, - required SwapType kind, - required Chain network, - required KeyPair keys, - required PreImage preimage, - required String redeemScript, - required String invoice, - required String scriptAddress, - required int outAmount, - required String electrumUrl, - required String boltzUrl, - dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - var arg0 = cst_encode_String(id); - var arg1 = cst_encode_swap_type(kind); - var arg2 = cst_encode_chain(network); - var arg3 = cst_encode_box_autoadd_key_pair(keys); - var arg4 = cst_encode_box_autoadd_pre_image(preimage); - var arg5 = cst_encode_String(redeemScript); - var arg6 = cst_encode_String(invoice); - var arg7 = cst_encode_String(scriptAddress); - var arg8 = cst_encode_u_64(outAmount); - var arg9 = cst_encode_String(electrumUrl); - var arg10 = cst_encode_String(boltzUrl); - return wire.wire_BtcLnSwap_new(port_, arg0, arg1, arg2, arg3, arg4, - arg5, arg6, arg7, arg8, arg9, arg10); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_btc_ln_swap, - decodeErrorData: null, - ), - constMeta: kBtcLnSwapNewConstMeta, - argValues: [ - id, - kind, - network, - keys, - preimage, - redeemScript, - invoice, - scriptAddress, - outAmount, - electrumUrl, - boltzUrl - ], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kBtcLnSwapNewConstMeta => const TaskConstMeta( - debugName: "BtcLnSwap_new", - argNames: [ - "id", - "kind", - "network", - "keys", - "preimage", - "redeemScript", - "invoice", - "scriptAddress", - "outAmount", - "electrumUrl", - "boltzUrl" - ], - ); - - @override - Future btcLnSwapReverseV1Claim( - {required BtcLnSwap that, + Future btcLnV1SwapRefund( + {required BtcLnV1Swap that, required String outAddress, required int absFee, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_btc_ln_swap(that); + var arg0 = cst_encode_box_autoadd_btc_ln_v_1_swap(that); var arg1 = cst_encode_String(outAddress); var arg2 = cst_encode_u_64(absFee); - return wire.wire_BtcLnSwap_reverse_v1_claim(port_, arg0, arg1, arg2); + return wire.wire_BtcLnV1Swap_refund(port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_String, decodeErrorData: dco_decode_boltz_error, ), - constMeta: kBtcLnSwapReverseV1ClaimConstMeta, + constMeta: kBtcLnV1SwapRefundConstMeta, argValues: [that, outAddress, absFee], apiImpl: this, hint: hint, )); } - TaskConstMeta get kBtcLnSwapReverseV1ClaimConstMeta => const TaskConstMeta( - debugName: "BtcLnSwap_reverse_v1_claim", + TaskConstMeta get kBtcLnV1SwapRefundConstMeta => const TaskConstMeta( + debugName: "BtcLnV1Swap_refund", argNames: ["that", "outAddress", "absFee"], ); @override - Future btcLnSwapTxSize({required BtcLnSwap that, dynamic hint}) { + Future btcLnV1SwapTxSize({required BtcLnV1Swap that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_btc_ln_swap(that); - return wire.wire_BtcLnSwap_tx_size(port_, arg0); + var arg0 = cst_encode_box_autoadd_btc_ln_v_1_swap(that); + return wire.wire_BtcLnV1Swap_tx_size(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_usize, decodeErrorData: dco_decode_boltz_error, ), - constMeta: kBtcLnSwapTxSizeConstMeta, + constMeta: kBtcLnV1SwapTxSizeConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kBtcLnSwapTxSizeConstMeta => const TaskConstMeta( - debugName: "BtcLnSwap_tx_size", + TaskConstMeta get kBtcLnV1SwapTxSizeConstMeta => const TaskConstMeta( + debugName: "BtcLnV1Swap_tx_size", argNames: ["that"], ); @@ -477,116 +475,36 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform ); @override - Future lbtcLnSwapCreateReverseV1( - {required String mnemonic, - required int index, - required int outAmount, - required Chain network, - required String electrumUrl, - required String boltzUrl, - required String pairHash, - dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - var arg0 = cst_encode_String(mnemonic); - var arg1 = cst_encode_u_64(index); - var arg2 = cst_encode_u_64(outAmount); - var arg3 = cst_encode_chain(network); - var arg4 = cst_encode_String(electrumUrl); - var arg5 = cst_encode_String(boltzUrl); - var arg6 = cst_encode_String(pairHash); - return wire.wire_LbtcLnSwap_create_reverse_v1( - port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_lbtc_ln_swap, - decodeErrorData: dco_decode_boltz_error, - ), - constMeta: kLbtcLnSwapCreateReverseV1ConstMeta, - argValues: [ - mnemonic, - index, - outAmount, - network, - electrumUrl, - boltzUrl, - pairHash - ], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kLbtcLnSwapCreateReverseV1ConstMeta => const TaskConstMeta( - debugName: "LbtcLnSwap_create_reverse_v1", - argNames: [ - "mnemonic", - "index", - "outAmount", - "network", - "electrumUrl", - "boltzUrl", - "pairHash" - ], - ); - - @override - Future lbtcLnSwapCreateSubmarineV1( - {required String mnemonic, - required int index, - required String invoice, - required Chain network, - required String electrumUrl, - required String boltzUrl, - required String pairHash, + Future lbtcLnV1SwapClaim( + {required LbtcLnV1Swap that, + required String outAddress, + required int absFee, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_String(mnemonic); - var arg1 = cst_encode_u_64(index); - var arg2 = cst_encode_String(invoice); - var arg3 = cst_encode_chain(network); - var arg4 = cst_encode_String(electrumUrl); - var arg5 = cst_encode_String(boltzUrl); - var arg6 = cst_encode_String(pairHash); - return wire.wire_LbtcLnSwap_create_submarine_v1( - port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); + var arg0 = cst_encode_box_autoadd_lbtc_ln_v_1_swap(that); + var arg1 = cst_encode_String(outAddress); + var arg2 = cst_encode_u_64(absFee); + return wire.wire_LbtcLnV1Swap_claim(port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_lbtc_ln_swap, + decodeSuccessData: dco_decode_String, decodeErrorData: dco_decode_boltz_error, ), - constMeta: kLbtcLnSwapCreateSubmarineV1ConstMeta, - argValues: [ - mnemonic, - index, - invoice, - network, - electrumUrl, - boltzUrl, - pairHash - ], + constMeta: kLbtcLnV1SwapClaimConstMeta, + argValues: [that, outAddress, absFee], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLbtcLnSwapCreateSubmarineV1ConstMeta => - const TaskConstMeta( - debugName: "LbtcLnSwap_create_submarine_v1", - argNames: [ - "mnemonic", - "index", - "invoice", - "network", - "electrumUrl", - "boltzUrl", - "pairHash" - ], + TaskConstMeta get kLbtcLnV1SwapClaimConstMeta => const TaskConstMeta( + debugName: "LbtcLnV1Swap_claim", + argNames: ["that", "outAddress", "absFee"], ); @override - Future lbtcLnSwapNew( + Future lbtcLnV1SwapNew( {required String id, required SwapType kind, required Chain network, @@ -614,14 +532,14 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform var arg9 = cst_encode_String(blindingKey); var arg10 = cst_encode_String(electrumUrl); var arg11 = cst_encode_String(boltzUrl); - return wire.wire_LbtcLnSwap_new(port_, arg0, arg1, arg2, arg3, arg4, + return wire.wire_LbtcLnV1Swap_new(port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); }, codec: DcoCodec( - decodeSuccessData: dco_decode_lbtc_ln_swap, + decodeSuccessData: dco_decode_lbtc_ln_v_1_swap, decodeErrorData: null, ), - constMeta: kLbtcLnSwapNewConstMeta, + constMeta: kLbtcLnV1SwapNewConstMeta, argValues: [ id, kind, @@ -641,8 +559,8 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform )); } - TaskConstMeta get kLbtcLnSwapNewConstMeta => const TaskConstMeta( - debugName: "LbtcLnSwap_new", + TaskConstMeta get kLbtcLnV1SwapNewConstMeta => const TaskConstMeta( + debugName: "LbtcLnV1Swap_new", argNames: [ "id", "kind", @@ -660,85 +578,162 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform ); @override - Future lbtcLnSwapReverseV1Claim( - {required LbtcLnSwap that, - required String outAddress, - required int absFee, + Future lbtcLnV1SwapNewReverse( + {required String mnemonic, + required int index, + required int outAmount, + required Chain network, + required String electrumUrl, + required String boltzUrl, + required String pairHash, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_lbtc_ln_swap(that); - var arg1 = cst_encode_String(outAddress); - var arg2 = cst_encode_u_64(absFee); - return wire.wire_LbtcLnSwap_reverse_v1_claim(port_, arg0, arg1, arg2); + var arg0 = cst_encode_String(mnemonic); + var arg1 = cst_encode_u_64(index); + var arg2 = cst_encode_u_64(outAmount); + var arg3 = cst_encode_chain(network); + var arg4 = cst_encode_String(electrumUrl); + var arg5 = cst_encode_String(boltzUrl); + var arg6 = cst_encode_String(pairHash); + return wire.wire_LbtcLnV1Swap_new_reverse( + port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); }, codec: DcoCodec( - decodeSuccessData: dco_decode_String, + decodeSuccessData: dco_decode_lbtc_ln_v_1_swap, decodeErrorData: dco_decode_boltz_error, ), - constMeta: kLbtcLnSwapReverseV1ClaimConstMeta, - argValues: [that, outAddress, absFee], + constMeta: kLbtcLnV1SwapNewReverseConstMeta, + argValues: [ + mnemonic, + index, + outAmount, + network, + electrumUrl, + boltzUrl, + pairHash + ], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLbtcLnSwapReverseV1ClaimConstMeta => const TaskConstMeta( - debugName: "LbtcLnSwap_reverse_v1_claim", - argNames: ["that", "outAddress", "absFee"], + TaskConstMeta get kLbtcLnV1SwapNewReverseConstMeta => const TaskConstMeta( + debugName: "LbtcLnV1Swap_new_reverse", + argNames: [ + "mnemonic", + "index", + "outAmount", + "network", + "electrumUrl", + "boltzUrl", + "pairHash" + ], + ); + + @override + Future lbtcLnV1SwapNewSubmarine( + {required String mnemonic, + required int index, + required String invoice, + required Chain network, + required String electrumUrl, + required String boltzUrl, + required String pairHash, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_String(mnemonic); + var arg1 = cst_encode_u_64(index); + var arg2 = cst_encode_String(invoice); + var arg3 = cst_encode_chain(network); + var arg4 = cst_encode_String(electrumUrl); + var arg5 = cst_encode_String(boltzUrl); + var arg6 = cst_encode_String(pairHash); + return wire.wire_LbtcLnV1Swap_new_submarine( + port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_lbtc_ln_v_1_swap, + decodeErrorData: dco_decode_boltz_error, + ), + constMeta: kLbtcLnV1SwapNewSubmarineConstMeta, + argValues: [ + mnemonic, + index, + invoice, + network, + electrumUrl, + boltzUrl, + pairHash + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLbtcLnV1SwapNewSubmarineConstMeta => const TaskConstMeta( + debugName: "LbtcLnV1Swap_new_submarine", + argNames: [ + "mnemonic", + "index", + "invoice", + "network", + "electrumUrl", + "boltzUrl", + "pairHash" + ], ); @override - Future lbtcLnSwapSubmarineV1Refund( - {required LbtcLnSwap that, + Future lbtcLnV1SwapRefund( + {required LbtcLnV1Swap that, required String outAddress, required int absFee, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_lbtc_ln_swap(that); + var arg0 = cst_encode_box_autoadd_lbtc_ln_v_1_swap(that); var arg1 = cst_encode_String(outAddress); var arg2 = cst_encode_u_64(absFee); - return wire.wire_LbtcLnSwap_submarine_v1_refund( - port_, arg0, arg1, arg2); + return wire.wire_LbtcLnV1Swap_refund(port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_String, decodeErrorData: dco_decode_boltz_error, ), - constMeta: kLbtcLnSwapSubmarineV1RefundConstMeta, + constMeta: kLbtcLnV1SwapRefundConstMeta, argValues: [that, outAddress, absFee], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLbtcLnSwapSubmarineV1RefundConstMeta => - const TaskConstMeta( - debugName: "LbtcLnSwap_submarine_v1_refund", + TaskConstMeta get kLbtcLnV1SwapRefundConstMeta => const TaskConstMeta( + debugName: "LbtcLnV1Swap_refund", argNames: ["that", "outAddress", "absFee"], ); @override - Future lbtcLnSwapTxSize({required LbtcLnSwap swap, dynamic hint}) { + Future lbtcLnV1SwapTxSize({required LbtcLnV1Swap swap, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_lbtc_ln_swap(swap); - return wire.wire_LbtcLnSwap_tx_size(port_, arg0); + var arg0 = cst_encode_box_autoadd_lbtc_ln_v_1_swap(swap); + return wire.wire_LbtcLnV1Swap_tx_size(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_usize, decodeErrorData: dco_decode_boltz_error, ), - constMeta: kLbtcLnSwapTxSizeConstMeta, + constMeta: kLbtcLnV1SwapTxSizeConstMeta, argValues: [swap], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLbtcLnSwapTxSizeConstMeta => const TaskConstMeta( - debugName: "LbtcLnSwap_tx_size", + TaskConstMeta get kLbtcLnV1SwapTxSizeConstMeta => const TaskConstMeta( + debugName: "LbtcLnV1Swap_tx_size", argNames: ["swap"], ); @@ -885,9 +880,9 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform } @protected - BtcLnSwap dco_decode_box_autoadd_btc_ln_swap(dynamic raw) { + BtcLnV1Swap dco_decode_box_autoadd_btc_ln_v_1_swap(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_btc_ln_swap(raw); + return dco_decode_btc_ln_v_1_swap(raw); } @protected @@ -897,9 +892,9 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform } @protected - LbtcLnSwap dco_decode_box_autoadd_lbtc_ln_swap(dynamic raw) { + LbtcLnV1Swap dco_decode_box_autoadd_lbtc_ln_v_1_swap(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_lbtc_ln_swap(raw); + return dco_decode_lbtc_ln_v_1_swap(raw); } @protected @@ -909,12 +904,12 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform } @protected - BtcLnSwap dco_decode_btc_ln_swap(dynamic raw) { + BtcLnV1Swap dco_decode_btc_ln_v_1_swap(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; if (arr.length != 11) throw Exception('unexpected arr length: expect 11 but see ${arr.length}'); - return BtcLnSwap( + return BtcLnV1Swap( id: dco_decode_String(arr[0]), kind: dco_decode_swap_type(arr[1]), network: dco_decode_chain(arr[2]), @@ -977,12 +972,12 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform } @protected - LbtcLnSwap dco_decode_lbtc_ln_swap(dynamic raw) { + LbtcLnV1Swap dco_decode_lbtc_ln_v_1_swap(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; if (arr.length != 12) throw Exception('unexpected arr length: expect 12 but see ${arr.length}'); - return LbtcLnSwap( + return LbtcLnV1Swap( id: dco_decode_String(arr[0]), kind: dco_decode_swap_type(arr[1]), network: dco_decode_chain(arr[2]), @@ -1129,9 +1124,10 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform } @protected - BtcLnSwap sse_decode_box_autoadd_btc_ln_swap(SseDeserializer deserializer) { + BtcLnV1Swap sse_decode_box_autoadd_btc_ln_v_1_swap( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_btc_ln_swap(deserializer)); + return (sse_decode_btc_ln_v_1_swap(deserializer)); } @protected @@ -1141,9 +1137,10 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform } @protected - LbtcLnSwap sse_decode_box_autoadd_lbtc_ln_swap(SseDeserializer deserializer) { + LbtcLnV1Swap sse_decode_box_autoadd_lbtc_ln_v_1_swap( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_lbtc_ln_swap(deserializer)); + return (sse_decode_lbtc_ln_v_1_swap(deserializer)); } @protected @@ -1153,7 +1150,7 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform } @protected - BtcLnSwap sse_decode_btc_ln_swap(SseDeserializer deserializer) { + BtcLnV1Swap sse_decode_btc_ln_v_1_swap(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_id = sse_decode_String(deserializer); var var_kind = sse_decode_swap_type(deserializer); @@ -1166,7 +1163,7 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform var var_outAmount = sse_decode_u_64(deserializer); var var_electrumUrl = sse_decode_String(deserializer); var var_boltzUrl = sse_decode_String(deserializer); - return BtcLnSwap( + return BtcLnV1Swap( id: var_id, kind: var_kind, network: var_network, @@ -1228,7 +1225,7 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform } @protected - LbtcLnSwap sse_decode_lbtc_ln_swap(SseDeserializer deserializer) { + LbtcLnV1Swap sse_decode_lbtc_ln_v_1_swap(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_id = sse_decode_String(deserializer); var var_kind = sse_decode_swap_type(deserializer); @@ -1242,7 +1239,7 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform var var_blindingKey = sse_decode_String(deserializer); var var_electrumUrl = sse_decode_String(deserializer); var var_boltzUrl = sse_decode_String(deserializer); - return LbtcLnSwap( + return LbtcLnV1Swap( id: var_id, kind: var_kind, network: var_network, @@ -1418,10 +1415,10 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform } @protected - void sse_encode_box_autoadd_btc_ln_swap( - BtcLnSwap self, SseSerializer serializer) { + void sse_encode_box_autoadd_btc_ln_v_1_swap( + BtcLnV1Swap self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_btc_ln_swap(self, serializer); + sse_encode_btc_ln_v_1_swap(self, serializer); } @protected @@ -1431,10 +1428,10 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform } @protected - void sse_encode_box_autoadd_lbtc_ln_swap( - LbtcLnSwap self, SseSerializer serializer) { + void sse_encode_box_autoadd_lbtc_ln_v_1_swap( + LbtcLnV1Swap self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_lbtc_ln_swap(self, serializer); + sse_encode_lbtc_ln_v_1_swap(self, serializer); } @protected @@ -1445,7 +1442,7 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform } @protected - void sse_encode_btc_ln_swap(BtcLnSwap self, SseSerializer serializer) { + void sse_encode_btc_ln_v_1_swap(BtcLnV1Swap self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_String(self.id, serializer); sse_encode_swap_type(self.kind, serializer); @@ -1499,7 +1496,8 @@ class BoltzCoreApiImpl extends BoltzCoreApiImplPlatform } @protected - void sse_encode_lbtc_ln_swap(LbtcLnSwap self, SseSerializer serializer) { + void sse_encode_lbtc_ln_v_1_swap( + LbtcLnV1Swap self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_String(self.id, serializer); sse_encode_swap_type(self.kind, serializer); diff --git a/lib/src/generated/frb_generated.io.dart b/lib/src/generated/frb_generated.io.dart index c83e819..ef8bc60 100644 --- a/lib/src/generated/frb_generated.io.dart +++ b/lib/src/generated/frb_generated.io.dart @@ -34,19 +34,19 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { bool dco_decode_bool(dynamic raw); @protected - BtcLnSwap dco_decode_box_autoadd_btc_ln_swap(dynamic raw); + BtcLnV1Swap dco_decode_box_autoadd_btc_ln_v_1_swap(dynamic raw); @protected KeyPair dco_decode_box_autoadd_key_pair(dynamic raw); @protected - LbtcLnSwap dco_decode_box_autoadd_lbtc_ln_swap(dynamic raw); + LbtcLnV1Swap dco_decode_box_autoadd_lbtc_ln_v_1_swap(dynamic raw); @protected PreImage dco_decode_box_autoadd_pre_image(dynamic raw); @protected - BtcLnSwap dco_decode_btc_ln_swap(dynamic raw); + BtcLnV1Swap dco_decode_btc_ln_v_1_swap(dynamic raw); @protected Chain dco_decode_chain(dynamic raw); @@ -64,7 +64,7 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { KeyPair dco_decode_key_pair(dynamic raw); @protected - LbtcLnSwap dco_decode_lbtc_ln_swap(dynamic raw); + LbtcLnV1Swap dco_decode_lbtc_ln_v_1_swap(dynamic raw); @protected Limits dco_decode_limits(dynamic raw); @@ -109,19 +109,21 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { bool sse_decode_bool(SseDeserializer deserializer); @protected - BtcLnSwap sse_decode_box_autoadd_btc_ln_swap(SseDeserializer deserializer); + BtcLnV1Swap sse_decode_box_autoadd_btc_ln_v_1_swap( + SseDeserializer deserializer); @protected KeyPair sse_decode_box_autoadd_key_pair(SseDeserializer deserializer); @protected - LbtcLnSwap sse_decode_box_autoadd_lbtc_ln_swap(SseDeserializer deserializer); + LbtcLnV1Swap sse_decode_box_autoadd_lbtc_ln_v_1_swap( + SseDeserializer deserializer); @protected PreImage sse_decode_box_autoadd_pre_image(SseDeserializer deserializer); @protected - BtcLnSwap sse_decode_btc_ln_swap(SseDeserializer deserializer); + BtcLnV1Swap sse_decode_btc_ln_v_1_swap(SseDeserializer deserializer); @protected Chain sse_decode_chain(SseDeserializer deserializer); @@ -139,7 +141,7 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { KeyPair sse_decode_key_pair(SseDeserializer deserializer); @protected - LbtcLnSwap sse_decode_lbtc_ln_swap(SseDeserializer deserializer); + LbtcLnV1Swap sse_decode_lbtc_ln_v_1_swap(SseDeserializer deserializer); @protected Limits sse_decode_limits(SseDeserializer deserializer); @@ -179,11 +181,11 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer cst_encode_box_autoadd_btc_ln_swap( - BtcLnSwap raw) { + ffi.Pointer cst_encode_box_autoadd_btc_ln_v_1_swap( + BtcLnV1Swap raw) { // Codec=Cst (C-struct based), see doc to use other codecs - final ptr = wire.cst_new_box_autoadd_btc_ln_swap(); - cst_api_fill_to_wire_btc_ln_swap(raw, ptr.ref); + final ptr = wire.cst_new_box_autoadd_btc_ln_v_1_swap(); + cst_api_fill_to_wire_btc_ln_v_1_swap(raw, ptr.ref); return ptr; } @@ -196,11 +198,11 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer cst_encode_box_autoadd_lbtc_ln_swap( - LbtcLnSwap raw) { + ffi.Pointer + cst_encode_box_autoadd_lbtc_ln_v_1_swap(LbtcLnV1Swap raw) { // Codec=Cst (C-struct based), see doc to use other codecs - final ptr = wire.cst_new_box_autoadd_lbtc_ln_swap(); - cst_api_fill_to_wire_lbtc_ln_swap(raw, ptr.ref); + final ptr = wire.cst_new_box_autoadd_lbtc_ln_v_1_swap(); + cst_api_fill_to_wire_lbtc_ln_v_1_swap(raw, ptr.ref); return ptr; } @@ -253,9 +255,9 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { } @protected - void cst_api_fill_to_wire_box_autoadd_btc_ln_swap( - BtcLnSwap apiObj, ffi.Pointer wireObj) { - cst_api_fill_to_wire_btc_ln_swap(apiObj, wireObj.ref); + void cst_api_fill_to_wire_box_autoadd_btc_ln_v_1_swap( + BtcLnV1Swap apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_btc_ln_v_1_swap(apiObj, wireObj.ref); } @protected @@ -265,9 +267,9 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { } @protected - void cst_api_fill_to_wire_box_autoadd_lbtc_ln_swap( - LbtcLnSwap apiObj, ffi.Pointer wireObj) { - cst_api_fill_to_wire_lbtc_ln_swap(apiObj, wireObj.ref); + void cst_api_fill_to_wire_box_autoadd_lbtc_ln_v_1_swap( + LbtcLnV1Swap apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_lbtc_ln_v_1_swap(apiObj, wireObj.ref); } @protected @@ -277,8 +279,8 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { } @protected - void cst_api_fill_to_wire_btc_ln_swap( - BtcLnSwap apiObj, wire_cst_btc_ln_swap wireObj) { + void cst_api_fill_to_wire_btc_ln_v_1_swap( + BtcLnV1Swap apiObj, wire_cst_btc_ln_v_1_swap wireObj) { wireObj.id = cst_encode_String(apiObj.id); wireObj.kind = cst_encode_swap_type(apiObj.kind); wireObj.network = cst_encode_chain(apiObj.network); @@ -312,8 +314,8 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { } @protected - void cst_api_fill_to_wire_lbtc_ln_swap( - LbtcLnSwap apiObj, wire_cst_lbtc_ln_swap wireObj) { + void cst_api_fill_to_wire_lbtc_ln_v_1_swap( + LbtcLnV1Swap apiObj, wire_cst_lbtc_ln_v_1_swap wireObj) { wireObj.id = cst_encode_String(apiObj.id); wireObj.kind = cst_encode_swap_type(apiObj.kind); wireObj.network = cst_encode_chain(apiObj.network); @@ -395,22 +397,22 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { void sse_encode_bool(bool self, SseSerializer serializer); @protected - void sse_encode_box_autoadd_btc_ln_swap( - BtcLnSwap self, SseSerializer serializer); + void sse_encode_box_autoadd_btc_ln_v_1_swap( + BtcLnV1Swap self, SseSerializer serializer); @protected void sse_encode_box_autoadd_key_pair(KeyPair self, SseSerializer serializer); @protected - void sse_encode_box_autoadd_lbtc_ln_swap( - LbtcLnSwap self, SseSerializer serializer); + void sse_encode_box_autoadd_lbtc_ln_v_1_swap( + LbtcLnV1Swap self, SseSerializer serializer); @protected void sse_encode_box_autoadd_pre_image( PreImage self, SseSerializer serializer); @protected - void sse_encode_btc_ln_swap(BtcLnSwap self, SseSerializer serializer); + void sse_encode_btc_ln_v_1_swap(BtcLnV1Swap self, SseSerializer serializer); @protected void sse_encode_chain(Chain self, SseSerializer serializer); @@ -429,7 +431,7 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { void sse_encode_key_pair(KeyPair self, SseSerializer serializer); @protected - void sse_encode_lbtc_ln_swap(LbtcLnSwap self, SseSerializer serializer); + void sse_encode_lbtc_ln_v_1_swap(LbtcLnV1Swap self, SseSerializer serializer); @protected void sse_encode_limits(Limits self, SseSerializer serializer); @@ -506,13 +508,13 @@ class BoltzCoreWire implements BaseWire { late final _store_dart_post_cobject = _store_dart_post_cobjectPtr .asFunction(); - void wire_BtcLnSwap_btc_ln_submarine_refund( + void wire_BtcLnV1Swap_claim( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer out_address, int abs_fee, ) { - return _wire_BtcLnSwap_btc_ln_submarine_refund( + return _wire_BtcLnV1Swap_claim( port_, that, out_address, @@ -520,17 +522,79 @@ class BoltzCoreWire implements BaseWire { ); } - late final _wire_BtcLnSwap_btc_ln_submarine_refundPtr = _lookup< + late final _wire_BtcLnV1Swap_claimPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>('frbgen_boltz_dart_wire_BtcLnV1Swap_claim'); + late final _wire_BtcLnV1Swap_claim = _wire_BtcLnV1Swap_claimPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire_BtcLnV1Swap_new( + int port_, + ffi.Pointer id, + int kind, + int network, + ffi.Pointer keys, + ffi.Pointer preimage, + ffi.Pointer redeem_script, + ffi.Pointer invoice, + ffi.Pointer script_address, + int out_amount, + ffi.Pointer electrum_url, + ffi.Pointer boltz_url, + ) { + return _wire_BtcLnV1Swap_new( + port_, + id, + kind, + network, + keys, + preimage, + redeem_script, + invoice, + script_address, + out_amount, + electrum_url, + boltz_url, + ); + } + + late final _wire_BtcLnV1Swap_newPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - 'frbgen_boltz_dart_wire_BtcLnSwap_btc_ln_submarine_refund'); - late final _wire_BtcLnSwap_btc_ln_submarine_refund = - _wire_BtcLnSwap_btc_ln_submarine_refundPtr.asFunction< - void Function(int, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_boltz_dart_wire_BtcLnV1Swap_new'); + late final _wire_BtcLnV1Swap_new = _wire_BtcLnV1Swap_newPtr.asFunction< + void Function( + int, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer)>(); - void wire_BtcLnSwap_create_reverse_v1( + void wire_BtcLnV1Swap_new_reverse( int port_, ffi.Pointer mnemonic, int index, @@ -540,7 +604,7 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer boltz_url, ffi.Pointer pair_hash, ) { - return _wire_BtcLnSwap_create_reverse_v1( + return _wire_BtcLnV1Swap_new_reverse( port_, mnemonic, index, @@ -552,7 +616,7 @@ class BoltzCoreWire implements BaseWire { ); } - late final _wire_BtcLnSwap_create_reverse_v1Ptr = _lookup< + late final _wire_BtcLnV1Swap_new_reversePtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, @@ -563,9 +627,9 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_boltz_dart_wire_BtcLnSwap_create_reverse_v1'); - late final _wire_BtcLnSwap_create_reverse_v1 = - _wire_BtcLnSwap_create_reverse_v1Ptr.asFunction< + 'frbgen_boltz_dart_wire_BtcLnV1Swap_new_reverse'); + late final _wire_BtcLnV1Swap_new_reverse = + _wire_BtcLnV1Swap_new_reversePtr.asFunction< void Function( int, ffi.Pointer, @@ -576,7 +640,7 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer)>(); - void wire_BtcLnSwap_create_submarine_v1( + void wire_BtcLnV1Swap_new_submarine( int port_, ffi.Pointer mnemonic, int index, @@ -586,7 +650,7 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer boltz_url, ffi.Pointer pair_hash, ) { - return _wire_BtcLnSwap_create_submarine_v1( + return _wire_BtcLnV1Swap_new_submarine( port_, mnemonic, index, @@ -598,7 +662,7 @@ class BoltzCoreWire implements BaseWire { ); } - late final _wire_BtcLnSwap_create_submarine_v1Ptr = _lookup< + late final _wire_BtcLnV1Swap_new_submarinePtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, @@ -609,9 +673,9 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_boltz_dart_wire_BtcLnSwap_create_submarine_v1'); - late final _wire_BtcLnSwap_create_submarine_v1 = - _wire_BtcLnSwap_create_submarine_v1Ptr.asFunction< + 'frbgen_boltz_dart_wire_BtcLnV1Swap_new_submarine'); + late final _wire_BtcLnV1Swap_new_submarine = + _wire_BtcLnV1Swap_new_submarinePtr.asFunction< void Function( int, ffi.Pointer, @@ -622,7 +686,98 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer)>(); - void wire_BtcLnSwap_new( + void wire_BtcLnV1Swap_refund( + int port_, + ffi.Pointer that, + ffi.Pointer out_address, + int abs_fee, + ) { + return _wire_BtcLnV1Swap_refund( + port_, + that, + out_address, + abs_fee, + ); + } + + late final _wire_BtcLnV1Swap_refundPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>('frbgen_boltz_dart_wire_BtcLnV1Swap_refund'); + late final _wire_BtcLnV1Swap_refund = _wire_BtcLnV1Swap_refundPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire_BtcLnV1Swap_tx_size( + int port_, + ffi.Pointer that, + ) { + return _wire_BtcLnV1Swap_tx_size( + port_, + that, + ); + } + + late final _wire_BtcLnV1Swap_tx_sizePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer)>>( + 'frbgen_boltz_dart_wire_BtcLnV1Swap_tx_size'); + late final _wire_BtcLnV1Swap_tx_size = _wire_BtcLnV1Swap_tx_sizePtr + .asFunction)>(); + + void wire_BoltzError_new( + int port_, + ffi.Pointer kind, + ffi.Pointer message, + ) { + return _wire_BoltzError_new( + port_, + kind, + message, + ); + } + + late final _wire_BoltzError_newPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_boltz_dart_wire_BoltzError_new'); + late final _wire_BoltzError_new = _wire_BoltzError_newPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire_LbtcLnV1Swap_claim( + int port_, + ffi.Pointer that, + ffi.Pointer out_address, + int abs_fee, + ) { + return _wire_LbtcLnV1Swap_claim( + port_, + that, + out_address, + abs_fee, + ); + } + + late final _wire_LbtcLnV1Swap_claimPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>('frbgen_boltz_dart_wire_LbtcLnV1Swap_claim'); + late final _wire_LbtcLnV1Swap_claim = _wire_LbtcLnV1Swap_claimPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire_LbtcLnV1Swap_new( int port_, ffi.Pointer id, int kind, @@ -631,12 +786,13 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer preimage, ffi.Pointer redeem_script, ffi.Pointer invoice, - ffi.Pointer script_address, int out_amount, + ffi.Pointer out_address, + ffi.Pointer blinding_key, ffi.Pointer electrum_url, ffi.Pointer boltz_url, ) { - return _wire_BtcLnSwap_new( + return _wire_LbtcLnV1Swap_new( port_, id, kind, @@ -645,14 +801,15 @@ class BoltzCoreWire implements BaseWire { preimage, redeem_script, invoice, - script_address, out_amount, + out_address, + blinding_key, electrum_url, boltz_url, ); } - late final _wire_BtcLnSwap_newPtr = _lookup< + late final _wire_LbtcLnV1Swap_newPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, @@ -663,12 +820,13 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Uint64, ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>( - 'frbgen_boltz_dart_wire_BtcLnSwap_new'); - late final _wire_BtcLnSwap_new = _wire_BtcLnSwap_newPtr.asFunction< + 'frbgen_boltz_dart_wire_LbtcLnV1Swap_new'); + late final _wire_LbtcLnV1Swap_new = _wire_LbtcLnV1Swap_newPtr.asFunction< void Function( int, ffi.Pointer, @@ -678,76 +836,13 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - void wire_BtcLnSwap_reverse_v1_claim( - int port_, - ffi.Pointer that, - ffi.Pointer out_address, - int abs_fee, - ) { - return _wire_BtcLnSwap_reverse_v1_claim( - port_, - that, - out_address, - abs_fee, - ); - } - - late final _wire_BtcLnSwap_reverse_v1_claimPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - 'frbgen_boltz_dart_wire_BtcLnSwap_reverse_v1_claim'); - late final _wire_BtcLnSwap_reverse_v1_claim = - _wire_BtcLnSwap_reverse_v1_claimPtr.asFunction< - void Function(int, ffi.Pointer, - ffi.Pointer, int)>(); - - void wire_BtcLnSwap_tx_size( - int port_, - ffi.Pointer that, - ) { - return _wire_BtcLnSwap_tx_size( - port_, - that, - ); - } - - late final _wire_BtcLnSwap_tx_sizePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_boltz_dart_wire_BtcLnSwap_tx_size'); - late final _wire_BtcLnSwap_tx_size = _wire_BtcLnSwap_tx_sizePtr - .asFunction)>(); - - void wire_BoltzError_new( - int port_, - ffi.Pointer kind, - ffi.Pointer message, - ) { - return _wire_BoltzError_new( - port_, - kind, - message, - ); - } - - late final _wire_BoltzError_newPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer)>>( - 'frbgen_boltz_dart_wire_BoltzError_new'); - late final _wire_BoltzError_new = _wire_BoltzError_newPtr.asFunction< - void Function(int, ffi.Pointer, - ffi.Pointer)>(); - - void wire_LbtcLnSwap_create_reverse_v1( + void wire_LbtcLnV1Swap_new_reverse( int port_, ffi.Pointer mnemonic, int index, @@ -757,7 +852,7 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer boltz_url, ffi.Pointer pair_hash, ) { - return _wire_LbtcLnSwap_create_reverse_v1( + return _wire_LbtcLnV1Swap_new_reverse( port_, mnemonic, index, @@ -769,7 +864,7 @@ class BoltzCoreWire implements BaseWire { ); } - late final _wire_LbtcLnSwap_create_reverse_v1Ptr = _lookup< + late final _wire_LbtcLnV1Swap_new_reversePtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, @@ -780,9 +875,9 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_boltz_dart_wire_LbtcLnSwap_create_reverse_v1'); - late final _wire_LbtcLnSwap_create_reverse_v1 = - _wire_LbtcLnSwap_create_reverse_v1Ptr.asFunction< + 'frbgen_boltz_dart_wire_LbtcLnV1Swap_new_reverse'); + late final _wire_LbtcLnV1Swap_new_reverse = + _wire_LbtcLnV1Swap_new_reversePtr.asFunction< void Function( int, ffi.Pointer, @@ -793,7 +888,7 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer)>(); - void wire_LbtcLnSwap_create_submarine_v1( + void wire_LbtcLnV1Swap_new_submarine( int port_, ffi.Pointer mnemonic, int index, @@ -803,7 +898,7 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer boltz_url, ffi.Pointer pair_hash, ) { - return _wire_LbtcLnSwap_create_submarine_v1( + return _wire_LbtcLnV1Swap_new_submarine( port_, mnemonic, index, @@ -815,7 +910,7 @@ class BoltzCoreWire implements BaseWire { ); } - late final _wire_LbtcLnSwap_create_submarine_v1Ptr = _lookup< + late final _wire_LbtcLnV1Swap_new_submarinePtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, @@ -826,9 +921,9 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_boltz_dart_wire_LbtcLnSwap_create_submarine_v1'); - late final _wire_LbtcLnSwap_create_submarine_v1 = - _wire_LbtcLnSwap_create_submarine_v1Ptr.asFunction< + 'frbgen_boltz_dart_wire_LbtcLnV1Swap_new_submarine'); + late final _wire_LbtcLnV1Swap_new_submarine = + _wire_LbtcLnV1Swap_new_submarinePtr.asFunction< void Function( int, ffi.Pointer, @@ -839,102 +934,13 @@ class BoltzCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer)>(); - void wire_LbtcLnSwap_new( - int port_, - ffi.Pointer id, - int kind, - int network, - ffi.Pointer keys, - ffi.Pointer preimage, - ffi.Pointer redeem_script, - ffi.Pointer invoice, - int out_amount, - ffi.Pointer out_address, - ffi.Pointer blinding_key, - ffi.Pointer electrum_url, - ffi.Pointer boltz_url, - ) { - return _wire_LbtcLnSwap_new( - port_, - id, - kind, - network, - keys, - preimage, - redeem_script, - invoice, - out_amount, - out_address, - blinding_key, - electrum_url, - boltz_url, - ); - } - - late final _wire_LbtcLnSwap_newPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Uint64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>( - 'frbgen_boltz_dart_wire_LbtcLnSwap_new'); - late final _wire_LbtcLnSwap_new = _wire_LbtcLnSwap_newPtr.asFunction< - void Function( - int, - ffi.Pointer, - int, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - void wire_LbtcLnSwap_reverse_v1_claim( - int port_, - ffi.Pointer that, - ffi.Pointer out_address, - int abs_fee, - ) { - return _wire_LbtcLnSwap_reverse_v1_claim( - port_, - that, - out_address, - abs_fee, - ); - } - - late final _wire_LbtcLnSwap_reverse_v1_claimPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - 'frbgen_boltz_dart_wire_LbtcLnSwap_reverse_v1_claim'); - late final _wire_LbtcLnSwap_reverse_v1_claim = - _wire_LbtcLnSwap_reverse_v1_claimPtr.asFunction< - void Function(int, ffi.Pointer, - ffi.Pointer, int)>(); - - void wire_LbtcLnSwap_submarine_v1_refund( + void wire_LbtcLnV1Swap_refund( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer out_address, int abs_fee, ) { - return _wire_LbtcLnSwap_submarine_v1_refund( + return _wire_LbtcLnV1Swap_refund( port_, that, out_address, @@ -942,33 +948,35 @@ class BoltzCoreWire implements BaseWire { ); } - late final _wire_LbtcLnSwap_submarine_v1_refundPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - 'frbgen_boltz_dart_wire_LbtcLnSwap_submarine_v1_refund'); - late final _wire_LbtcLnSwap_submarine_v1_refund = - _wire_LbtcLnSwap_submarine_v1_refundPtr.asFunction< - void Function(int, ffi.Pointer, + late final _wire_LbtcLnV1Swap_refundPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>('frbgen_boltz_dart_wire_LbtcLnV1Swap_refund'); + late final _wire_LbtcLnV1Swap_refund = + _wire_LbtcLnV1Swap_refundPtr.asFunction< + void Function(int, ffi.Pointer, ffi.Pointer, int)>(); - void wire_LbtcLnSwap_tx_size( + void wire_LbtcLnV1Swap_tx_size( int port_, - ffi.Pointer swap, + ffi.Pointer swap, ) { - return _wire_LbtcLnSwap_tx_size( + return _wire_LbtcLnV1Swap_tx_size( port_, swap, ); } - late final _wire_LbtcLnSwap_tx_sizePtr = _lookup< + late final _wire_LbtcLnV1Swap_tx_sizePtr = _lookup< ffi.NativeFunction< ffi.Void Function( - ffi.Int64, ffi.Pointer)>>( - 'frbgen_boltz_dart_wire_LbtcLnSwap_tx_size'); - late final _wire_LbtcLnSwap_tx_size = _wire_LbtcLnSwap_tx_sizePtr - .asFunction)>(); + ffi.Int64, ffi.Pointer)>>( + 'frbgen_boltz_dart_wire_LbtcLnV1Swap_tx_size'); + late final _wire_LbtcLnV1Swap_tx_size = _wire_LbtcLnV1Swap_tx_sizePtr + .asFunction)>(); void wire_AllFees_fetch( int port_, @@ -1042,16 +1050,16 @@ class BoltzCoreWire implements BaseWire { late final _wire_PreImage_new = _wire_PreImage_newPtr.asFunction(); - ffi.Pointer cst_new_box_autoadd_btc_ln_swap() { - return _cst_new_box_autoadd_btc_ln_swap(); + ffi.Pointer cst_new_box_autoadd_btc_ln_v_1_swap() { + return _cst_new_box_autoadd_btc_ln_v_1_swap(); } - late final _cst_new_box_autoadd_btc_ln_swapPtr = - _lookup Function()>>( - 'frbgen_boltz_dart_cst_new_box_autoadd_btc_ln_swap'); - late final _cst_new_box_autoadd_btc_ln_swap = - _cst_new_box_autoadd_btc_ln_swapPtr - .asFunction Function()>(); + late final _cst_new_box_autoadd_btc_ln_v_1_swapPtr = _lookup< + ffi.NativeFunction Function()>>( + 'frbgen_boltz_dart_cst_new_box_autoadd_btc_ln_v_1_swap'); + late final _cst_new_box_autoadd_btc_ln_v_1_swap = + _cst_new_box_autoadd_btc_ln_v_1_swapPtr + .asFunction Function()>(); ffi.Pointer cst_new_box_autoadd_key_pair() { return _cst_new_box_autoadd_key_pair(); @@ -1063,16 +1071,18 @@ class BoltzCoreWire implements BaseWire { late final _cst_new_box_autoadd_key_pair = _cst_new_box_autoadd_key_pairPtr .asFunction Function()>(); - ffi.Pointer cst_new_box_autoadd_lbtc_ln_swap() { - return _cst_new_box_autoadd_lbtc_ln_swap(); + ffi.Pointer + cst_new_box_autoadd_lbtc_ln_v_1_swap() { + return _cst_new_box_autoadd_lbtc_ln_v_1_swap(); } - late final _cst_new_box_autoadd_lbtc_ln_swapPtr = _lookup< - ffi.NativeFunction Function()>>( - 'frbgen_boltz_dart_cst_new_box_autoadd_lbtc_ln_swap'); - late final _cst_new_box_autoadd_lbtc_ln_swap = - _cst_new_box_autoadd_lbtc_ln_swapPtr - .asFunction Function()>(); + late final _cst_new_box_autoadd_lbtc_ln_v_1_swapPtr = _lookup< + ffi + .NativeFunction Function()>>( + 'frbgen_boltz_dart_cst_new_box_autoadd_lbtc_ln_v_1_swap'); + late final _cst_new_box_autoadd_lbtc_ln_v_1_swap = + _cst_new_box_autoadd_lbtc_ln_v_1_swapPtr + .asFunction Function()>(); ffi.Pointer cst_new_box_autoadd_pre_image() { return _cst_new_box_autoadd_pre_image(); @@ -1136,7 +1146,7 @@ final class wire_cst_pre_image extends ffi.Struct { external ffi.Pointer hash160; } -final class wire_cst_btc_ln_swap extends ffi.Struct { +final class wire_cst_btc_ln_v_1_swap extends ffi.Struct { external ffi.Pointer id; @ffi.Int32() @@ -1163,7 +1173,7 @@ final class wire_cst_btc_ln_swap extends ffi.Struct { external ffi.Pointer boltz_url; } -final class wire_cst_lbtc_ln_swap extends ffi.Struct { +final class wire_cst_lbtc_ln_v_1_swap extends ffi.Struct { external ffi.Pointer id; @ffi.Int32() diff --git a/lib/src/generated/frb_generated.web.dart b/lib/src/generated/frb_generated.web.dart index 1477dbb..15e4c0b 100644 --- a/lib/src/generated/frb_generated.web.dart +++ b/lib/src/generated/frb_generated.web.dart @@ -33,19 +33,19 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { bool dco_decode_bool(dynamic raw); @protected - BtcLnSwap dco_decode_box_autoadd_btc_ln_swap(dynamic raw); + BtcLnV1Swap dco_decode_box_autoadd_btc_ln_v_1_swap(dynamic raw); @protected KeyPair dco_decode_box_autoadd_key_pair(dynamic raw); @protected - LbtcLnSwap dco_decode_box_autoadd_lbtc_ln_swap(dynamic raw); + LbtcLnV1Swap dco_decode_box_autoadd_lbtc_ln_v_1_swap(dynamic raw); @protected PreImage dco_decode_box_autoadd_pre_image(dynamic raw); @protected - BtcLnSwap dco_decode_btc_ln_swap(dynamic raw); + BtcLnV1Swap dco_decode_btc_ln_v_1_swap(dynamic raw); @protected Chain dco_decode_chain(dynamic raw); @@ -63,7 +63,7 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { KeyPair dco_decode_key_pair(dynamic raw); @protected - LbtcLnSwap dco_decode_lbtc_ln_swap(dynamic raw); + LbtcLnV1Swap dco_decode_lbtc_ln_v_1_swap(dynamic raw); @protected Limits dco_decode_limits(dynamic raw); @@ -108,19 +108,21 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { bool sse_decode_bool(SseDeserializer deserializer); @protected - BtcLnSwap sse_decode_box_autoadd_btc_ln_swap(SseDeserializer deserializer); + BtcLnV1Swap sse_decode_box_autoadd_btc_ln_v_1_swap( + SseDeserializer deserializer); @protected KeyPair sse_decode_box_autoadd_key_pair(SseDeserializer deserializer); @protected - LbtcLnSwap sse_decode_box_autoadd_lbtc_ln_swap(SseDeserializer deserializer); + LbtcLnV1Swap sse_decode_box_autoadd_lbtc_ln_v_1_swap( + SseDeserializer deserializer); @protected PreImage sse_decode_box_autoadd_pre_image(SseDeserializer deserializer); @protected - BtcLnSwap sse_decode_btc_ln_swap(SseDeserializer deserializer); + BtcLnV1Swap sse_decode_btc_ln_v_1_swap(SseDeserializer deserializer); @protected Chain sse_decode_chain(SseDeserializer deserializer); @@ -138,7 +140,7 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { KeyPair sse_decode_key_pair(SseDeserializer deserializer); @protected - LbtcLnSwap sse_decode_lbtc_ln_swap(SseDeserializer deserializer); + LbtcLnV1Swap sse_decode_lbtc_ln_v_1_swap(SseDeserializer deserializer); @protected Limits sse_decode_limits(SseDeserializer deserializer); @@ -199,9 +201,9 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { } @protected - List cst_encode_box_autoadd_btc_ln_swap(BtcLnSwap raw) { + List cst_encode_box_autoadd_btc_ln_v_1_swap(BtcLnV1Swap raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_btc_ln_swap(raw); + return cst_encode_btc_ln_v_1_swap(raw); } @protected @@ -211,9 +213,9 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { } @protected - List cst_encode_box_autoadd_lbtc_ln_swap(LbtcLnSwap raw) { + List cst_encode_box_autoadd_lbtc_ln_v_1_swap(LbtcLnV1Swap raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_lbtc_ln_swap(raw); + return cst_encode_lbtc_ln_v_1_swap(raw); } @protected @@ -223,7 +225,7 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { } @protected - List cst_encode_btc_ln_swap(BtcLnSwap raw) { + List cst_encode_btc_ln_v_1_swap(BtcLnV1Swap raw) { // Codec=Cst (C-struct based), see doc to use other codecs return [ cst_encode_String(raw.id), @@ -261,7 +263,7 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { } @protected - List cst_encode_lbtc_ln_swap(LbtcLnSwap raw) { + List cst_encode_lbtc_ln_v_1_swap(LbtcLnV1Swap raw) { // Codec=Cst (C-struct based), see doc to use other codecs return [ cst_encode_String(raw.id), @@ -364,22 +366,22 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { void sse_encode_bool(bool self, SseSerializer serializer); @protected - void sse_encode_box_autoadd_btc_ln_swap( - BtcLnSwap self, SseSerializer serializer); + void sse_encode_box_autoadd_btc_ln_v_1_swap( + BtcLnV1Swap self, SseSerializer serializer); @protected void sse_encode_box_autoadd_key_pair(KeyPair self, SseSerializer serializer); @protected - void sse_encode_box_autoadd_lbtc_ln_swap( - LbtcLnSwap self, SseSerializer serializer); + void sse_encode_box_autoadd_lbtc_ln_v_1_swap( + LbtcLnV1Swap self, SseSerializer serializer); @protected void sse_encode_box_autoadd_pre_image( PreImage self, SseSerializer serializer); @protected - void sse_encode_btc_ln_swap(BtcLnSwap self, SseSerializer serializer); + void sse_encode_btc_ln_v_1_swap(BtcLnV1Swap self, SseSerializer serializer); @protected void sse_encode_chain(Chain self, SseSerializer serializer); @@ -398,7 +400,7 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { void sse_encode_key_pair(KeyPair self, SseSerializer serializer); @protected - void sse_encode_lbtc_ln_swap(LbtcLnSwap self, SseSerializer serializer); + void sse_encode_lbtc_ln_v_1_swap(LbtcLnV1Swap self, SseSerializer serializer); @protected void sse_encode_limits(Limits self, SseSerializer serializer); @@ -439,36 +441,11 @@ abstract class BoltzCoreApiImplPlatform extends BaseApiImpl { class BoltzCoreWire implements BaseWire { BoltzCoreWire.fromExternalLibrary(ExternalLibrary lib); - void wire_BtcLnSwap_btc_ln_submarine_refund(NativePortType port_, - List that, String out_address, Object abs_fee) => - wasmModule.wire_BtcLnSwap_btc_ln_submarine_refund( - port_, that, out_address, abs_fee); - - void wire_BtcLnSwap_create_reverse_v1( - NativePortType port_, - String mnemonic, - Object index, - Object out_amount, - int network, - String electrum_url, - String boltz_url, - String pair_hash) => - wasmModule.wire_BtcLnSwap_create_reverse_v1(port_, mnemonic, index, - out_amount, network, electrum_url, boltz_url, pair_hash); - - void wire_BtcLnSwap_create_submarine_v1( - NativePortType port_, - String mnemonic, - Object index, - String invoice, - int network, - String electrum_url, - String boltz_url, - String pair_hash) => - wasmModule.wire_BtcLnSwap_create_submarine_v1(port_, mnemonic, index, - invoice, network, electrum_url, boltz_url, pair_hash); + void wire_BtcLnV1Swap_claim(NativePortType port_, List that, + String out_address, Object abs_fee) => + wasmModule.wire_BtcLnV1Swap_claim(port_, that, out_address, abs_fee); - void wire_BtcLnSwap_new( + void wire_BtcLnV1Swap_new( NativePortType port_, String id, int kind, @@ -481,7 +458,7 @@ class BoltzCoreWire implements BaseWire { Object out_amount, String electrum_url, String boltz_url) => - wasmModule.wire_BtcLnSwap_new( + wasmModule.wire_BtcLnV1Swap_new( port_, id, kind, @@ -495,18 +472,7 @@ class BoltzCoreWire implements BaseWire { electrum_url, boltz_url); - void wire_BtcLnSwap_reverse_v1_claim(NativePortType port_, List that, - String out_address, Object abs_fee) => - wasmModule.wire_BtcLnSwap_reverse_v1_claim( - port_, that, out_address, abs_fee); - - void wire_BtcLnSwap_tx_size(NativePortType port_, List that) => - wasmModule.wire_BtcLnSwap_tx_size(port_, that); - - void wire_BoltzError_new(NativePortType port_, String kind, String message) => - wasmModule.wire_BoltzError_new(port_, kind, message); - - void wire_LbtcLnSwap_create_reverse_v1( + void wire_BtcLnV1Swap_new_reverse( NativePortType port_, String mnemonic, Object index, @@ -515,10 +481,10 @@ class BoltzCoreWire implements BaseWire { String electrum_url, String boltz_url, String pair_hash) => - wasmModule.wire_LbtcLnSwap_create_reverse_v1(port_, mnemonic, index, + wasmModule.wire_BtcLnV1Swap_new_reverse(port_, mnemonic, index, out_amount, network, electrum_url, boltz_url, pair_hash); - void wire_LbtcLnSwap_create_submarine_v1( + void wire_BtcLnV1Swap_new_submarine( NativePortType port_, String mnemonic, Object index, @@ -527,10 +493,24 @@ class BoltzCoreWire implements BaseWire { String electrum_url, String boltz_url, String pair_hash) => - wasmModule.wire_LbtcLnSwap_create_submarine_v1(port_, mnemonic, index, - invoice, network, electrum_url, boltz_url, pair_hash); + wasmModule.wire_BtcLnV1Swap_new_submarine(port_, mnemonic, index, invoice, + network, electrum_url, boltz_url, pair_hash); + + void wire_BtcLnV1Swap_refund(NativePortType port_, List that, + String out_address, Object abs_fee) => + wasmModule.wire_BtcLnV1Swap_refund(port_, that, out_address, abs_fee); + + void wire_BtcLnV1Swap_tx_size(NativePortType port_, List that) => + wasmModule.wire_BtcLnV1Swap_tx_size(port_, that); + + void wire_BoltzError_new(NativePortType port_, String kind, String message) => + wasmModule.wire_BoltzError_new(port_, kind, message); + + void wire_LbtcLnV1Swap_claim(NativePortType port_, List that, + String out_address, Object abs_fee) => + wasmModule.wire_LbtcLnV1Swap_claim(port_, that, out_address, abs_fee); - void wire_LbtcLnSwap_new( + void wire_LbtcLnV1Swap_new( NativePortType port_, String id, int kind, @@ -544,7 +524,7 @@ class BoltzCoreWire implements BaseWire { String blinding_key, String electrum_url, String boltz_url) => - wasmModule.wire_LbtcLnSwap_new( + wasmModule.wire_LbtcLnV1Swap_new( port_, id, kind, @@ -559,18 +539,36 @@ class BoltzCoreWire implements BaseWire { electrum_url, boltz_url); - void wire_LbtcLnSwap_reverse_v1_claim(NativePortType port_, - List that, String out_address, Object abs_fee) => - wasmModule.wire_LbtcLnSwap_reverse_v1_claim( - port_, that, out_address, abs_fee); + void wire_LbtcLnV1Swap_new_reverse( + NativePortType port_, + String mnemonic, + Object index, + Object out_amount, + int network, + String electrum_url, + String boltz_url, + String pair_hash) => + wasmModule.wire_LbtcLnV1Swap_new_reverse(port_, mnemonic, index, + out_amount, network, electrum_url, boltz_url, pair_hash); - void wire_LbtcLnSwap_submarine_v1_refund(NativePortType port_, - List that, String out_address, Object abs_fee) => - wasmModule.wire_LbtcLnSwap_submarine_v1_refund( - port_, that, out_address, abs_fee); + void wire_LbtcLnV1Swap_new_submarine( + NativePortType port_, + String mnemonic, + Object index, + String invoice, + int network, + String electrum_url, + String boltz_url, + String pair_hash) => + wasmModule.wire_LbtcLnV1Swap_new_submarine(port_, mnemonic, index, + invoice, network, electrum_url, boltz_url, pair_hash); + + void wire_LbtcLnV1Swap_refund(NativePortType port_, List that, + String out_address, Object abs_fee) => + wasmModule.wire_LbtcLnV1Swap_refund(port_, that, out_address, abs_fee); - void wire_LbtcLnSwap_tx_size(NativePortType port_, List swap) => - wasmModule.wire_LbtcLnSwap_tx_size(port_, swap); + void wire_LbtcLnV1Swap_tx_size(NativePortType port_, List swap) => + wasmModule.wire_LbtcLnV1Swap_tx_size(port_, swap); void wire_AllFees_fetch(NativePortType port_, String boltz_url) => wasmModule.wire_AllFees_fetch(port_, boltz_url); @@ -599,10 +597,24 @@ class BoltzCoreWasmModule implements WasmModule { @override external BoltzCoreWasmModule bind(dynamic thisArg, String moduleName); - external void wire_BtcLnSwap_btc_ln_submarine_refund(NativePortType port_, - List that, String out_address, Object abs_fee); + external void wire_BtcLnV1Swap_claim(NativePortType port_, List that, + String out_address, Object abs_fee); - external void wire_BtcLnSwap_create_reverse_v1( + external void wire_BtcLnV1Swap_new( + NativePortType port_, + String id, + int kind, + int network, + List keys, + List preimage, + String redeem_script, + String invoice, + String script_address, + Object out_amount, + String electrum_url, + String boltz_url); + + external void wire_BtcLnV1Swap_new_reverse( NativePortType port_, String mnemonic, Object index, @@ -612,7 +624,7 @@ class BoltzCoreWasmModule implements WasmModule { String boltz_url, String pair_hash); - external void wire_BtcLnSwap_create_submarine_v1( + external void wire_BtcLnV1Swap_new_submarine( NativePortType port_, String mnemonic, Object index, @@ -622,7 +634,19 @@ class BoltzCoreWasmModule implements WasmModule { String boltz_url, String pair_hash); - external void wire_BtcLnSwap_new( + external void wire_BtcLnV1Swap_refund(NativePortType port_, + List that, String out_address, Object abs_fee); + + external void wire_BtcLnV1Swap_tx_size( + NativePortType port_, List that); + + external void wire_BoltzError_new( + NativePortType port_, String kind, String message); + + external void wire_LbtcLnV1Swap_claim(NativePortType port_, + List that, String out_address, Object abs_fee); + + external void wire_LbtcLnV1Swap_new( NativePortType port_, String id, int kind, @@ -631,21 +655,13 @@ class BoltzCoreWasmModule implements WasmModule { List preimage, String redeem_script, String invoice, - String script_address, Object out_amount, + String out_address, + String blinding_key, String electrum_url, String boltz_url); - external void wire_BtcLnSwap_reverse_v1_claim(NativePortType port_, - List that, String out_address, Object abs_fee); - - external void wire_BtcLnSwap_tx_size( - NativePortType port_, List that); - - external void wire_BoltzError_new( - NativePortType port_, String kind, String message); - - external void wire_LbtcLnSwap_create_reverse_v1( + external void wire_LbtcLnV1Swap_new_reverse( NativePortType port_, String mnemonic, Object index, @@ -655,7 +671,7 @@ class BoltzCoreWasmModule implements WasmModule { String boltz_url, String pair_hash); - external void wire_LbtcLnSwap_create_submarine_v1( + external void wire_LbtcLnV1Swap_new_submarine( NativePortType port_, String mnemonic, Object index, @@ -665,28 +681,10 @@ class BoltzCoreWasmModule implements WasmModule { String boltz_url, String pair_hash); - external void wire_LbtcLnSwap_new( - NativePortType port_, - String id, - int kind, - int network, - List keys, - List preimage, - String redeem_script, - String invoice, - Object out_amount, - String out_address, - String blinding_key, - String electrum_url, - String boltz_url); - - external void wire_LbtcLnSwap_reverse_v1_claim(NativePortType port_, - List that, String out_address, Object abs_fee); - - external void wire_LbtcLnSwap_submarine_v1_refund(NativePortType port_, + external void wire_LbtcLnV1Swap_refund(NativePortType port_, List that, String out_address, Object abs_fee); - external void wire_LbtcLnSwap_tx_size( + external void wire_LbtcLnV1Swap_tx_size( NativePortType port_, List swap); external void wire_AllFees_fetch(NativePortType port_, String boltz_url); diff --git a/macos/Classes/frb_generated.h b/macos/Classes/frb_generated.h index 360dfb3..7835b31 100644 --- a/macos/Classes/frb_generated.h +++ b/macos/Classes/frb_generated.h @@ -30,7 +30,7 @@ typedef struct wire_cst_pre_image { struct wire_cst_list_prim_u_8_strict *hash160; } wire_cst_pre_image; -typedef struct wire_cst_btc_ln_swap { +typedef struct wire_cst_btc_ln_v_1_swap { struct wire_cst_list_prim_u_8_strict *id; int32_t kind; int32_t network; @@ -42,9 +42,9 @@ typedef struct wire_cst_btc_ln_swap { uint64_t out_amount; struct wire_cst_list_prim_u_8_strict *electrum_url; struct wire_cst_list_prim_u_8_strict *boltz_url; -} wire_cst_btc_ln_swap; +} wire_cst_btc_ln_v_1_swap; -typedef struct wire_cst_lbtc_ln_swap { +typedef struct wire_cst_lbtc_ln_v_1_swap { struct wire_cst_list_prim_u_8_strict *id; int32_t kind; int32_t network; @@ -57,7 +57,7 @@ typedef struct wire_cst_lbtc_ln_swap { struct wire_cst_list_prim_u_8_strict *blinding_key; struct wire_cst_list_prim_u_8_strict *electrum_url; struct wire_cst_list_prim_u_8_strict *boltz_url; -} wire_cst_lbtc_ln_swap; +} wire_cst_lbtc_ln_v_1_swap; typedef struct wire_cst_limits { uint64_t minimal; @@ -102,96 +102,98 @@ typedef struct wire_cst_decoded_invoice { uint64_t cltv_exp_delta; } wire_cst_decoded_invoice; -void frbgen_boltz_dart_wire_BtcLnSwap_btc_ln_submarine_refund(int64_t port_, - struct wire_cst_btc_ln_swap *that, - struct wire_cst_list_prim_u_8_strict *out_address, - uint64_t abs_fee); - -void frbgen_boltz_dart_wire_BtcLnSwap_create_reverse_v1(int64_t port_, - struct wire_cst_list_prim_u_8_strict *mnemonic, - uint64_t index, - uint64_t out_amount, - int32_t network, - struct wire_cst_list_prim_u_8_strict *electrum_url, - struct wire_cst_list_prim_u_8_strict *boltz_url, - struct wire_cst_list_prim_u_8_strict *pair_hash); - -void frbgen_boltz_dart_wire_BtcLnSwap_create_submarine_v1(int64_t port_, - struct wire_cst_list_prim_u_8_strict *mnemonic, - uint64_t index, - struct wire_cst_list_prim_u_8_strict *invoice, - int32_t network, - struct wire_cst_list_prim_u_8_strict *electrum_url, - struct wire_cst_list_prim_u_8_strict *boltz_url, - struct wire_cst_list_prim_u_8_strict *pair_hash); - -void frbgen_boltz_dart_wire_BtcLnSwap_new(int64_t port_, - struct wire_cst_list_prim_u_8_strict *id, - int32_t kind, - int32_t network, - struct wire_cst_key_pair *keys, - struct wire_cst_pre_image *preimage, - struct wire_cst_list_prim_u_8_strict *redeem_script, - struct wire_cst_list_prim_u_8_strict *invoice, - struct wire_cst_list_prim_u_8_strict *script_address, - uint64_t out_amount, - struct wire_cst_list_prim_u_8_strict *electrum_url, - struct wire_cst_list_prim_u_8_strict *boltz_url); - -void frbgen_boltz_dart_wire_BtcLnSwap_reverse_v1_claim(int64_t port_, - struct wire_cst_btc_ln_swap *that, - struct wire_cst_list_prim_u_8_strict *out_address, - uint64_t abs_fee); - -void frbgen_boltz_dart_wire_BtcLnSwap_tx_size(int64_t port_, struct wire_cst_btc_ln_swap *that); +void frbgen_boltz_dart_wire_BtcLnV1Swap_claim(int64_t port_, + struct wire_cst_btc_ln_v_1_swap *that, + struct wire_cst_list_prim_u_8_strict *out_address, + uint64_t abs_fee); + +void frbgen_boltz_dart_wire_BtcLnV1Swap_new(int64_t port_, + struct wire_cst_list_prim_u_8_strict *id, + int32_t kind, + int32_t network, + struct wire_cst_key_pair *keys, + struct wire_cst_pre_image *preimage, + struct wire_cst_list_prim_u_8_strict *redeem_script, + struct wire_cst_list_prim_u_8_strict *invoice, + struct wire_cst_list_prim_u_8_strict *script_address, + uint64_t out_amount, + struct wire_cst_list_prim_u_8_strict *electrum_url, + struct wire_cst_list_prim_u_8_strict *boltz_url); + +void frbgen_boltz_dart_wire_BtcLnV1Swap_new_reverse(int64_t port_, + struct wire_cst_list_prim_u_8_strict *mnemonic, + uint64_t index, + uint64_t out_amount, + int32_t network, + struct wire_cst_list_prim_u_8_strict *electrum_url, + struct wire_cst_list_prim_u_8_strict *boltz_url, + struct wire_cst_list_prim_u_8_strict *pair_hash); + +void frbgen_boltz_dart_wire_BtcLnV1Swap_new_submarine(int64_t port_, + struct wire_cst_list_prim_u_8_strict *mnemonic, + uint64_t index, + struct wire_cst_list_prim_u_8_strict *invoice, + int32_t network, + struct wire_cst_list_prim_u_8_strict *electrum_url, + struct wire_cst_list_prim_u_8_strict *boltz_url, + struct wire_cst_list_prim_u_8_strict *pair_hash); + +void frbgen_boltz_dart_wire_BtcLnV1Swap_refund(int64_t port_, + struct wire_cst_btc_ln_v_1_swap *that, + struct wire_cst_list_prim_u_8_strict *out_address, + uint64_t abs_fee); + +void frbgen_boltz_dart_wire_BtcLnV1Swap_tx_size(int64_t port_, + struct wire_cst_btc_ln_v_1_swap *that); void frbgen_boltz_dart_wire_BoltzError_new(int64_t port_, struct wire_cst_list_prim_u_8_strict *kind, struct wire_cst_list_prim_u_8_strict *message); -void frbgen_boltz_dart_wire_LbtcLnSwap_create_reverse_v1(int64_t port_, - struct wire_cst_list_prim_u_8_strict *mnemonic, - uint64_t index, - uint64_t out_amount, - int32_t network, - struct wire_cst_list_prim_u_8_strict *electrum_url, - struct wire_cst_list_prim_u_8_strict *boltz_url, - struct wire_cst_list_prim_u_8_strict *pair_hash); - -void frbgen_boltz_dart_wire_LbtcLnSwap_create_submarine_v1(int64_t port_, - struct wire_cst_list_prim_u_8_strict *mnemonic, - uint64_t index, - struct wire_cst_list_prim_u_8_strict *invoice, - int32_t network, - struct wire_cst_list_prim_u_8_strict *electrum_url, - struct wire_cst_list_prim_u_8_strict *boltz_url, - struct wire_cst_list_prim_u_8_strict *pair_hash); - -void frbgen_boltz_dart_wire_LbtcLnSwap_new(int64_t port_, - struct wire_cst_list_prim_u_8_strict *id, - int32_t kind, - int32_t network, - struct wire_cst_key_pair *keys, - struct wire_cst_pre_image *preimage, - struct wire_cst_list_prim_u_8_strict *redeem_script, - struct wire_cst_list_prim_u_8_strict *invoice, - uint64_t out_amount, - struct wire_cst_list_prim_u_8_strict *out_address, - struct wire_cst_list_prim_u_8_strict *blinding_key, - struct wire_cst_list_prim_u_8_strict *electrum_url, - struct wire_cst_list_prim_u_8_strict *boltz_url); - -void frbgen_boltz_dart_wire_LbtcLnSwap_reverse_v1_claim(int64_t port_, - struct wire_cst_lbtc_ln_swap *that, - struct wire_cst_list_prim_u_8_strict *out_address, - uint64_t abs_fee); - -void frbgen_boltz_dart_wire_LbtcLnSwap_submarine_v1_refund(int64_t port_, - struct wire_cst_lbtc_ln_swap *that, - struct wire_cst_list_prim_u_8_strict *out_address, - uint64_t abs_fee); - -void frbgen_boltz_dart_wire_LbtcLnSwap_tx_size(int64_t port_, struct wire_cst_lbtc_ln_swap *swap); +void frbgen_boltz_dart_wire_LbtcLnV1Swap_claim(int64_t port_, + struct wire_cst_lbtc_ln_v_1_swap *that, + struct wire_cst_list_prim_u_8_strict *out_address, + uint64_t abs_fee); + +void frbgen_boltz_dart_wire_LbtcLnV1Swap_new(int64_t port_, + struct wire_cst_list_prim_u_8_strict *id, + int32_t kind, + int32_t network, + struct wire_cst_key_pair *keys, + struct wire_cst_pre_image *preimage, + struct wire_cst_list_prim_u_8_strict *redeem_script, + struct wire_cst_list_prim_u_8_strict *invoice, + uint64_t out_amount, + struct wire_cst_list_prim_u_8_strict *out_address, + struct wire_cst_list_prim_u_8_strict *blinding_key, + struct wire_cst_list_prim_u_8_strict *electrum_url, + struct wire_cst_list_prim_u_8_strict *boltz_url); + +void frbgen_boltz_dart_wire_LbtcLnV1Swap_new_reverse(int64_t port_, + struct wire_cst_list_prim_u_8_strict *mnemonic, + uint64_t index, + uint64_t out_amount, + int32_t network, + struct wire_cst_list_prim_u_8_strict *electrum_url, + struct wire_cst_list_prim_u_8_strict *boltz_url, + struct wire_cst_list_prim_u_8_strict *pair_hash); + +void frbgen_boltz_dart_wire_LbtcLnV1Swap_new_submarine(int64_t port_, + struct wire_cst_list_prim_u_8_strict *mnemonic, + uint64_t index, + struct wire_cst_list_prim_u_8_strict *invoice, + int32_t network, + struct wire_cst_list_prim_u_8_strict *electrum_url, + struct wire_cst_list_prim_u_8_strict *boltz_url, + struct wire_cst_list_prim_u_8_strict *pair_hash); + +void frbgen_boltz_dart_wire_LbtcLnV1Swap_refund(int64_t port_, + struct wire_cst_lbtc_ln_v_1_swap *that, + struct wire_cst_list_prim_u_8_strict *out_address, + uint64_t abs_fee); + +void frbgen_boltz_dart_wire_LbtcLnV1Swap_tx_size(int64_t port_, + struct wire_cst_lbtc_ln_v_1_swap *swap); void frbgen_boltz_dart_wire_AllFees_fetch(int64_t port_, struct wire_cst_list_prim_u_8_strict *boltz_url); @@ -206,38 +208,38 @@ WireSyncRust2DartDco frbgen_boltz_dart_wire_KeyPair_new(struct wire_cst_list_pri WireSyncRust2DartDco frbgen_boltz_dart_wire_PreImage_new(void); -struct wire_cst_btc_ln_swap *frbgen_boltz_dart_cst_new_box_autoadd_btc_ln_swap(void); +struct wire_cst_btc_ln_v_1_swap *frbgen_boltz_dart_cst_new_box_autoadd_btc_ln_v_1_swap(void); struct wire_cst_key_pair *frbgen_boltz_dart_cst_new_box_autoadd_key_pair(void); -struct wire_cst_lbtc_ln_swap *frbgen_boltz_dart_cst_new_box_autoadd_lbtc_ln_swap(void); +struct wire_cst_lbtc_ln_v_1_swap *frbgen_boltz_dart_cst_new_box_autoadd_lbtc_ln_v_1_swap(void); struct wire_cst_pre_image *frbgen_boltz_dart_cst_new_box_autoadd_pre_image(void); struct wire_cst_list_prim_u_8_strict *frbgen_boltz_dart_cst_new_list_prim_u_8_strict(int32_t len); static int64_t dummy_method_to_enforce_bundling(void) { int64_t dummy_var = 0; - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_box_autoadd_btc_ln_swap); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_box_autoadd_btc_ln_v_1_swap); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_box_autoadd_key_pair); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_box_autoadd_lbtc_ln_swap); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_box_autoadd_lbtc_ln_v_1_swap); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_box_autoadd_pre_image); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_cst_new_list_prim_u_8_strict); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_AllFees_fetch); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BoltzError_new); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnSwap_btc_ln_submarine_refund); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnSwap_create_reverse_v1); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnSwap_create_submarine_v1); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnSwap_new); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnSwap_reverse_v1_claim); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnSwap_tx_size); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnV1Swap_claim); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnV1Swap_new); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnV1Swap_new_reverse); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnV1Swap_new_submarine); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnV1Swap_refund); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_BtcLnV1Swap_tx_size); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_DecodedInvoice_from_string); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_KeyPair_new); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnSwap_create_reverse_v1); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnSwap_create_submarine_v1); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnSwap_new); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnSwap_reverse_v1_claim); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnSwap_submarine_v1_refund); - dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnSwap_tx_size); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnV1Swap_claim); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnV1Swap_new); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnV1Swap_new_reverse); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnV1Swap_new_submarine); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnV1Swap_refund); + dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_LbtcLnV1Swap_tx_size); dummy_var ^= ((int64_t) (void*) frbgen_boltz_dart_wire_PreImage_new); dummy_var ^= ((int64_t) (void*) store_dart_post_cobject); return dummy_var; diff --git a/rust/src/api/btc_ln.rs b/rust/src/api/btc_ln.rs index 2e2f0da..3ae40fc 100644 --- a/rust/src/api/btc_ln.rs +++ b/rust/src/api/btc_ln.rs @@ -8,7 +8,7 @@ use boltz_client::{ use flutter_rust_bridge::frb; #[frb(dart_metadata=("freezed"))] -pub struct BtcLnSwap { +pub struct BtcLnV1Swap { pub id: String, pub kind: SwapType, pub network: Chain, @@ -21,7 +21,7 @@ pub struct BtcLnSwap { pub electrum_url: String, pub boltz_url: String, } -impl BtcLnSwap { +impl BtcLnV1Swap { pub fn new( id: String, kind: SwapType, @@ -34,8 +34,8 @@ impl BtcLnSwap { out_amount: u64, electrum_url: String, boltz_url: String, - ) -> BtcLnSwap { - BtcLnSwap { + ) -> BtcLnV1Swap { + BtcLnV1Swap { id, kind, network, @@ -50,7 +50,7 @@ impl BtcLnSwap { } } - pub fn create_submarine_v1( + pub fn new_submarine( mnemonic: String, index: u64, invoice: String, @@ -58,7 +58,7 @@ impl BtcLnSwap { electrum_url: String, boltz_url: String, pair_hash: String, - ) -> Result { + ) -> Result { let swap_type = SwapType::Submarine; let refund_keypair = match KeyPair::new(mnemonic, network.into(), index, swap_type) { Ok(keypair) => keypair, @@ -101,7 +101,7 @@ impl BtcLnSwap { }; let script_address = swap_script.to_address(network.into())?.to_string(); - Ok(BtcLnSwap::new( + Ok(BtcLnV1Swap::new( response.get_id(), swap_type, network, @@ -116,7 +116,7 @@ impl BtcLnSwap { )) } - pub fn create_reverse_v1( + pub fn new_reverse( mnemonic: String, index: u64, out_amount: u64, @@ -124,7 +124,7 @@ impl BtcLnSwap { electrum_url: String, boltz_url: String, pair_hash: String, - ) -> Result { + ) -> Result { let swap_type = SwapType::Reverse; let claim_keypair = match KeyPair::new(mnemonic, network.into(), index, swap_type) { Ok(keypair) => keypair, @@ -164,7 +164,7 @@ impl BtcLnSwap { }; let script_address = swap_script.to_address(network.into())?.to_string(); - Ok(BtcLnSwap::new( + Ok(BtcLnV1Swap::new( response.get_id(), swap_type, network.into(), @@ -179,7 +179,7 @@ impl BtcLnSwap { )) } - pub fn reverse_v1_claim( + pub fn claim( &self, out_address: String, abs_fee: u64, @@ -222,7 +222,7 @@ impl BtcLnSwap { } } - pub fn btc_ln_submarine_refund( + pub fn refund( &self, out_address: String, abs_fee: u64, diff --git a/rust/src/api/lbtc_ln.rs b/rust/src/api/lbtc_ln.rs index e12638f..cc4e028 100644 --- a/rust/src/api/lbtc_ln.rs +++ b/rust/src/api/lbtc_ln.rs @@ -3,7 +3,7 @@ use boltz_client::{network::electrum::ElectrumConfig, swaps::{boltz::{BoltzApiCl use flutter_rust_bridge::frb; #[frb(dart_metadata=("freezed"))] -pub struct LbtcLnSwap { +pub struct LbtcLnV1Swap { pub id: String, pub kind: SwapType, pub network: Chain, @@ -18,7 +18,7 @@ pub struct LbtcLnSwap { pub boltz_url: String, } -impl LbtcLnSwap { +impl LbtcLnV1Swap { pub fn new( id: String, kind: SwapType, @@ -32,8 +32,8 @@ impl LbtcLnSwap { blinding_key: String, electrum_url: String, boltz_url: String, - ) -> LbtcLnSwap { - LbtcLnSwap { + ) -> LbtcLnV1Swap { + LbtcLnV1Swap { id, kind, network, @@ -48,7 +48,7 @@ impl LbtcLnSwap { script_address: out_address, } } - pub fn create_submarine_v1( + pub fn new_submarine( mnemonic: String, index: u64, invoice: String, @@ -56,7 +56,7 @@ impl LbtcLnSwap { electrum_url: String, boltz_url: String, pair_hash: String, - ) -> Result { + ) -> Result { let swap_type = SwapType::Submarine; let refund_keypair = match KeyPair::new(mnemonic, network.into(), index, swap_type) { Ok(keypair) => keypair, @@ -108,7 +108,7 @@ impl LbtcLnSwap { // return Err(BoltzError{kind: ErrorKind::BoltzApi, "Payment address in response does not match constructed script! Report to support!").into()); // } - Ok(LbtcLnSwap::new( + Ok(LbtcLnV1Swap::new( response.get_id(), swap_type, network, @@ -124,7 +124,7 @@ impl LbtcLnSwap { )) } - pub fn create_reverse_v1( + pub fn new_reverse( mnemonic: String, index: u64, out_amount: u64, @@ -132,7 +132,7 @@ impl LbtcLnSwap { electrum_url: String, boltz_url: String, pair_hash: String, - ) -> Result { + ) -> Result { let swap_type = SwapType::Reverse; let claim_keypair = match KeyPair::new(mnemonic, network.into(), index, swap_type) { Ok(keypair) => keypair, @@ -170,7 +170,7 @@ impl LbtcLnSwap { }; let out_address = script.to_address(network.into()).unwrap().to_string(); - Ok(LbtcLnSwap::new( + Ok(LbtcLnV1Swap::new( response.get_id(), swap_type, network, @@ -186,7 +186,7 @@ impl LbtcLnSwap { )) } - pub fn reverse_v1_claim( + pub fn claim( &self, out_address: String, abs_fee: u64, @@ -225,7 +225,7 @@ impl LbtcLnSwap { Ok(txid) } - pub fn submarine_v1_refund( + pub fn refund( &self, out_address: String, abs_fee: u64, @@ -260,7 +260,7 @@ impl LbtcLnSwap { } - pub fn tx_size(swap: LbtcLnSwap) -> Result { + pub fn tx_size(swap: LbtcLnV1Swap) -> Result { if swap.kind == SwapType::Submarine { return Err(BoltzError{kind: "Input".to_string(), message: "Submarine swaps are not claimable".to_string()}); } else { diff --git a/rust/src/frb_generated.io.rs b/rust/src/frb_generated.io.rs index 10eaa1a..f369f5d 100644 --- a/rust/src/frb_generated.io.rs +++ b/rust/src/frb_generated.io.rs @@ -45,11 +45,11 @@ impl CstDecode for wire_cst_boltz_error { } } } -impl CstDecode for *mut wire_cst_btc_ln_swap { +impl CstDecode for *mut wire_cst_btc_ln_v_1_swap { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::btc_ln::BtcLnSwap { + fn cst_decode(self) -> crate::api::btc_ln::BtcLnV1Swap { let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; - CstDecode::::cst_decode(*wrap).into() + CstDecode::::cst_decode(*wrap).into() } } impl CstDecode for *mut wire_cst_key_pair { @@ -59,11 +59,11 @@ impl CstDecode for *mut wire_cst_key_pair { CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut wire_cst_lbtc_ln_swap { +impl CstDecode for *mut wire_cst_lbtc_ln_v_1_swap { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::lbtc_ln::LbtcLnSwap { + fn cst_decode(self) -> crate::api::lbtc_ln::LbtcLnV1Swap { let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; - CstDecode::::cst_decode(*wrap).into() + CstDecode::::cst_decode(*wrap).into() } } impl CstDecode for *mut wire_cst_pre_image { @@ -73,10 +73,10 @@ impl CstDecode for *mut wire_cst_pre_image { CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for wire_cst_btc_ln_swap { +impl CstDecode for wire_cst_btc_ln_v_1_swap { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::btc_ln::BtcLnSwap { - crate::api::btc_ln::BtcLnSwap { + fn cst_decode(self) -> crate::api::btc_ln::BtcLnV1Swap { + crate::api::btc_ln::BtcLnV1Swap { id: self.id.cst_decode(), kind: self.kind.cst_decode(), network: self.network.cst_decode(), @@ -114,10 +114,10 @@ impl CstDecode for wire_cst_key_pair { } } } -impl CstDecode for wire_cst_lbtc_ln_swap { +impl CstDecode for wire_cst_lbtc_ln_v_1_swap { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::lbtc_ln::LbtcLnSwap { - crate::api::lbtc_ln::LbtcLnSwap { + fn cst_decode(self) -> crate::api::lbtc_ln::LbtcLnV1Swap { + crate::api::lbtc_ln::LbtcLnV1Swap { id: self.id.cst_decode(), kind: self.kind.cst_decode(), network: self.network.cst_decode(), @@ -213,7 +213,7 @@ impl Default for wire_cst_boltz_error { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_btc_ln_swap { +impl NewWithNullPtr for wire_cst_btc_ln_v_1_swap { fn new_with_null_ptr() -> Self { Self { id: core::ptr::null_mut(), @@ -230,7 +230,7 @@ impl NewWithNullPtr for wire_cst_btc_ln_swap { } } } -impl Default for wire_cst_btc_ln_swap { +impl Default for wire_cst_btc_ln_v_1_swap { fn default() -> Self { Self::new_with_null_ptr() } @@ -266,7 +266,7 @@ impl Default for wire_cst_key_pair { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_lbtc_ln_swap { +impl NewWithNullPtr for wire_cst_lbtc_ln_v_1_swap { fn new_with_null_ptr() -> Self { Self { id: core::ptr::null_mut(), @@ -284,7 +284,7 @@ impl NewWithNullPtr for wire_cst_lbtc_ln_swap { } } } -impl Default for wire_cst_lbtc_ln_swap { +impl Default for wire_cst_lbtc_ln_v_1_swap { fn default() -> Self { Self::new_with_null_ptr() } @@ -346,54 +346,62 @@ impl Default for wire_cst_submarine_swap_fees { } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_wire_BtcLnSwap_btc_ln_submarine_refund( +pub extern "C" fn frbgen_boltz_dart_wire_BtcLnV1Swap_claim( port_: i64, - that: *mut wire_cst_btc_ln_swap, + that: *mut wire_cst_btc_ln_v_1_swap, out_address: *mut wire_cst_list_prim_u_8_strict, abs_fee: u64, ) { - wire_BtcLnSwap_btc_ln_submarine_refund_impl(port_, that, out_address, abs_fee) + wire_BtcLnV1Swap_claim_impl(port_, that, out_address, abs_fee) } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_wire_BtcLnSwap_create_reverse_v1( +pub extern "C" fn frbgen_boltz_dart_wire_BtcLnV1Swap_new( port_: i64, - mnemonic: *mut wire_cst_list_prim_u_8_strict, - index: u64, - out_amount: u64, + id: *mut wire_cst_list_prim_u_8_strict, + kind: i32, network: i32, + keys: *mut wire_cst_key_pair, + preimage: *mut wire_cst_pre_image, + redeem_script: *mut wire_cst_list_prim_u_8_strict, + invoice: *mut wire_cst_list_prim_u_8_strict, + script_address: *mut wire_cst_list_prim_u_8_strict, + out_amount: u64, electrum_url: *mut wire_cst_list_prim_u_8_strict, boltz_url: *mut wire_cst_list_prim_u_8_strict, - pair_hash: *mut wire_cst_list_prim_u_8_strict, ) { - wire_BtcLnSwap_create_reverse_v1_impl( + wire_BtcLnV1Swap_new_impl( port_, - mnemonic, - index, - out_amount, + id, + kind, network, + keys, + preimage, + redeem_script, + invoice, + script_address, + out_amount, electrum_url, boltz_url, - pair_hash, ) } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_wire_BtcLnSwap_create_submarine_v1( +pub extern "C" fn frbgen_boltz_dart_wire_BtcLnV1Swap_new_reverse( port_: i64, mnemonic: *mut wire_cst_list_prim_u_8_strict, index: u64, - invoice: *mut wire_cst_list_prim_u_8_strict, + out_amount: u64, network: i32, electrum_url: *mut wire_cst_list_prim_u_8_strict, boltz_url: *mut wire_cst_list_prim_u_8_strict, pair_hash: *mut wire_cst_list_prim_u_8_strict, ) { - wire_BtcLnSwap_create_submarine_v1_impl( + wire_BtcLnV1Swap_new_reverse_impl( port_, mnemonic, index, - invoice, + out_amount, network, electrum_url, boltz_url, @@ -402,52 +410,44 @@ pub extern "C" fn frbgen_boltz_dart_wire_BtcLnSwap_create_submarine_v1( } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_wire_BtcLnSwap_new( +pub extern "C" fn frbgen_boltz_dart_wire_BtcLnV1Swap_new_submarine( port_: i64, - id: *mut wire_cst_list_prim_u_8_strict, - kind: i32, - network: i32, - keys: *mut wire_cst_key_pair, - preimage: *mut wire_cst_pre_image, - redeem_script: *mut wire_cst_list_prim_u_8_strict, + mnemonic: *mut wire_cst_list_prim_u_8_strict, + index: u64, invoice: *mut wire_cst_list_prim_u_8_strict, - script_address: *mut wire_cst_list_prim_u_8_strict, - out_amount: u64, + network: i32, electrum_url: *mut wire_cst_list_prim_u_8_strict, boltz_url: *mut wire_cst_list_prim_u_8_strict, + pair_hash: *mut wire_cst_list_prim_u_8_strict, ) { - wire_BtcLnSwap_new_impl( + wire_BtcLnV1Swap_new_submarine_impl( port_, - id, - kind, - network, - keys, - preimage, - redeem_script, + mnemonic, + index, invoice, - script_address, - out_amount, + network, electrum_url, boltz_url, + pair_hash, ) } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_wire_BtcLnSwap_reverse_v1_claim( +pub extern "C" fn frbgen_boltz_dart_wire_BtcLnV1Swap_refund( port_: i64, - that: *mut wire_cst_btc_ln_swap, + that: *mut wire_cst_btc_ln_v_1_swap, out_address: *mut wire_cst_list_prim_u_8_strict, abs_fee: u64, ) { - wire_BtcLnSwap_reverse_v1_claim_impl(port_, that, out_address, abs_fee) + wire_BtcLnV1Swap_refund_impl(port_, that, out_address, abs_fee) } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_wire_BtcLnSwap_tx_size( +pub extern "C" fn frbgen_boltz_dart_wire_BtcLnV1Swap_tx_size( port_: i64, - that: *mut wire_cst_btc_ln_swap, + that: *mut wire_cst_btc_ln_v_1_swap, ) { - wire_BtcLnSwap_tx_size_impl(port_, that) + wire_BtcLnV1Swap_tx_size_impl(port_, that) } #[no_mangle] @@ -460,44 +460,64 @@ pub extern "C" fn frbgen_boltz_dart_wire_BoltzError_new( } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnSwap_create_reverse_v1( +pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnV1Swap_claim( port_: i64, - mnemonic: *mut wire_cst_list_prim_u_8_strict, - index: u64, - out_amount: u64, + that: *mut wire_cst_lbtc_ln_v_1_swap, + out_address: *mut wire_cst_list_prim_u_8_strict, + abs_fee: u64, +) { + wire_LbtcLnV1Swap_claim_impl(port_, that, out_address, abs_fee) +} + +#[no_mangle] +pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnV1Swap_new( + port_: i64, + id: *mut wire_cst_list_prim_u_8_strict, + kind: i32, network: i32, + keys: *mut wire_cst_key_pair, + preimage: *mut wire_cst_pre_image, + redeem_script: *mut wire_cst_list_prim_u_8_strict, + invoice: *mut wire_cst_list_prim_u_8_strict, + out_amount: u64, + out_address: *mut wire_cst_list_prim_u_8_strict, + blinding_key: *mut wire_cst_list_prim_u_8_strict, electrum_url: *mut wire_cst_list_prim_u_8_strict, boltz_url: *mut wire_cst_list_prim_u_8_strict, - pair_hash: *mut wire_cst_list_prim_u_8_strict, ) { - wire_LbtcLnSwap_create_reverse_v1_impl( + wire_LbtcLnV1Swap_new_impl( port_, - mnemonic, - index, - out_amount, + id, + kind, network, + keys, + preimage, + redeem_script, + invoice, + out_amount, + out_address, + blinding_key, electrum_url, boltz_url, - pair_hash, ) } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnSwap_create_submarine_v1( +pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnV1Swap_new_reverse( port_: i64, mnemonic: *mut wire_cst_list_prim_u_8_strict, index: u64, - invoice: *mut wire_cst_list_prim_u_8_strict, + out_amount: u64, network: i32, electrum_url: *mut wire_cst_list_prim_u_8_strict, boltz_url: *mut wire_cst_list_prim_u_8_strict, pair_hash: *mut wire_cst_list_prim_u_8_strict, ) { - wire_LbtcLnSwap_create_submarine_v1_impl( + wire_LbtcLnV1Swap_new_reverse_impl( port_, mnemonic, index, - invoice, + out_amount, network, electrum_url, boltz_url, @@ -506,64 +526,44 @@ pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnSwap_create_submarine_v1( } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnSwap_new( +pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnV1Swap_new_submarine( port_: i64, - id: *mut wire_cst_list_prim_u_8_strict, - kind: i32, - network: i32, - keys: *mut wire_cst_key_pair, - preimage: *mut wire_cst_pre_image, - redeem_script: *mut wire_cst_list_prim_u_8_strict, + mnemonic: *mut wire_cst_list_prim_u_8_strict, + index: u64, invoice: *mut wire_cst_list_prim_u_8_strict, - out_amount: u64, - out_address: *mut wire_cst_list_prim_u_8_strict, - blinding_key: *mut wire_cst_list_prim_u_8_strict, + network: i32, electrum_url: *mut wire_cst_list_prim_u_8_strict, boltz_url: *mut wire_cst_list_prim_u_8_strict, + pair_hash: *mut wire_cst_list_prim_u_8_strict, ) { - wire_LbtcLnSwap_new_impl( + wire_LbtcLnV1Swap_new_submarine_impl( port_, - id, - kind, - network, - keys, - preimage, - redeem_script, + mnemonic, + index, invoice, - out_amount, - out_address, - blinding_key, + network, electrum_url, boltz_url, + pair_hash, ) } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnSwap_reverse_v1_claim( +pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnV1Swap_refund( port_: i64, - that: *mut wire_cst_lbtc_ln_swap, + that: *mut wire_cst_lbtc_ln_v_1_swap, out_address: *mut wire_cst_list_prim_u_8_strict, abs_fee: u64, ) { - wire_LbtcLnSwap_reverse_v1_claim_impl(port_, that, out_address, abs_fee) + wire_LbtcLnV1Swap_refund_impl(port_, that, out_address, abs_fee) } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnSwap_submarine_v1_refund( +pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnV1Swap_tx_size( port_: i64, - that: *mut wire_cst_lbtc_ln_swap, - out_address: *mut wire_cst_list_prim_u_8_strict, - abs_fee: u64, + swap: *mut wire_cst_lbtc_ln_v_1_swap, ) { - wire_LbtcLnSwap_submarine_v1_refund_impl(port_, that, out_address, abs_fee) -} - -#[no_mangle] -pub extern "C" fn frbgen_boltz_dart_wire_LbtcLnSwap_tx_size( - port_: i64, - swap: *mut wire_cst_lbtc_ln_swap, -) { - wire_LbtcLnSwap_tx_size_impl(port_, swap) + wire_LbtcLnV1Swap_tx_size_impl(port_, swap) } #[no_mangle] @@ -599,8 +599,11 @@ pub extern "C" fn frbgen_boltz_dart_wire_PreImage_new( } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_cst_new_box_autoadd_btc_ln_swap() -> *mut wire_cst_btc_ln_swap { - flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_btc_ln_swap::new_with_null_ptr()) +pub extern "C" fn frbgen_boltz_dart_cst_new_box_autoadd_btc_ln_v_1_swap( +) -> *mut wire_cst_btc_ln_v_1_swap { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_btc_ln_v_1_swap::new_with_null_ptr(), + ) } #[no_mangle] @@ -609,9 +612,11 @@ pub extern "C" fn frbgen_boltz_dart_cst_new_box_autoadd_key_pair() -> *mut wire_ } #[no_mangle] -pub extern "C" fn frbgen_boltz_dart_cst_new_box_autoadd_lbtc_ln_swap() -> *mut wire_cst_lbtc_ln_swap -{ - flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_lbtc_ln_swap::new_with_null_ptr()) +pub extern "C" fn frbgen_boltz_dart_cst_new_box_autoadd_lbtc_ln_v_1_swap( +) -> *mut wire_cst_lbtc_ln_v_1_swap { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_lbtc_ln_v_1_swap::new_with_null_ptr(), + ) } #[no_mangle] @@ -650,7 +655,7 @@ pub struct wire_cst_boltz_error { } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_btc_ln_swap { +pub struct wire_cst_btc_ln_v_1_swap { id: *mut wire_cst_list_prim_u_8_strict, kind: i32, network: i32, @@ -682,7 +687,7 @@ pub struct wire_cst_key_pair { } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_lbtc_ln_swap { +pub struct wire_cst_lbtc_ln_v_1_swap { id: *mut wire_cst_list_prim_u_8_strict, kind: i32, network: i32, diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index 9b6965f..a63c7bc 100644 --- a/rust/src/frb_generated.rs +++ b/rust/src/frb_generated.rs @@ -38,15 +38,15 @@ flutter_rust_bridge::frb_generated_default_handler!(); // Section: wire_funcs -fn wire_BtcLnSwap_btc_ln_submarine_refund_impl( +fn wire_BtcLnV1Swap_claim_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, out_address: impl CstDecode, abs_fee: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "BtcLnSwap_btc_ln_submarine_refund", + debug_name: "BtcLnV1Swap_claim", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -56,61 +56,69 @@ fn wire_BtcLnSwap_btc_ln_submarine_refund_impl( let api_abs_fee = abs_fee.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::btc_ln::BtcLnSwap::btc_ln_submarine_refund( - &api_that, - api_out_address, - api_abs_fee, - ) + crate::api::btc_ln::BtcLnV1Swap::claim(&api_that, api_out_address, api_abs_fee) })()) } }, ) } -fn wire_BtcLnSwap_create_reverse_v1_impl( +fn wire_BtcLnV1Swap_new_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - mnemonic: impl CstDecode, - index: impl CstDecode, - out_amount: impl CstDecode, + id: impl CstDecode, + kind: impl CstDecode, network: impl CstDecode, + keys: impl CstDecode, + preimage: impl CstDecode, + redeem_script: impl CstDecode, + invoice: impl CstDecode, + script_address: impl CstDecode, + out_amount: impl CstDecode, electrum_url: impl CstDecode, boltz_url: impl CstDecode, - pair_hash: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "BtcLnSwap_create_reverse_v1", + debug_name: "BtcLnV1Swap_new", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_mnemonic = mnemonic.cst_decode(); - let api_index = index.cst_decode(); - let api_out_amount = out_amount.cst_decode(); + let api_id = id.cst_decode(); + let api_kind = kind.cst_decode(); let api_network = network.cst_decode(); + let api_keys = keys.cst_decode(); + let api_preimage = preimage.cst_decode(); + let api_redeem_script = redeem_script.cst_decode(); + let api_invoice = invoice.cst_decode(); + let api_script_address = script_address.cst_decode(); + let api_out_amount = out_amount.cst_decode(); let api_electrum_url = electrum_url.cst_decode(); let api_boltz_url = boltz_url.cst_decode(); - let api_pair_hash = pair_hash.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::btc_ln::BtcLnSwap::create_reverse_v1( - api_mnemonic, - api_index, - api_out_amount, + Result::<_, ()>::Ok(crate::api::btc_ln::BtcLnV1Swap::new( + api_id, + api_kind, api_network, + api_keys, + api_preimage, + api_redeem_script, + api_invoice, + api_script_address, + api_out_amount, api_electrum_url, api_boltz_url, - api_pair_hash, - ) + )) })()) } }, ) } -fn wire_BtcLnSwap_create_submarine_v1_impl( +fn wire_BtcLnV1Swap_new_reverse_impl( port_: flutter_rust_bridge::for_generated::MessagePort, mnemonic: impl CstDecode, index: impl CstDecode, - invoice: impl CstDecode, + out_amount: impl CstDecode, network: impl CstDecode, electrum_url: impl CstDecode, boltz_url: impl CstDecode, @@ -118,24 +126,24 @@ fn wire_BtcLnSwap_create_submarine_v1_impl( ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "BtcLnSwap_create_submarine_v1", + debug_name: "BtcLnV1Swap_new_reverse", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_mnemonic = mnemonic.cst_decode(); let api_index = index.cst_decode(); - let api_invoice = invoice.cst_decode(); + let api_out_amount = out_amount.cst_decode(); let api_network = network.cst_decode(); let api_electrum_url = electrum_url.cst_decode(); let api_boltz_url = boltz_url.cst_decode(); let api_pair_hash = pair_hash.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::btc_ln::BtcLnSwap::create_submarine_v1( + crate::api::btc_ln::BtcLnV1Swap::new_reverse( api_mnemonic, api_index, - api_invoice, + api_out_amount, api_network, api_electrum_url, api_boltz_url, @@ -146,67 +154,55 @@ fn wire_BtcLnSwap_create_submarine_v1_impl( }, ) } -fn wire_BtcLnSwap_new_impl( +fn wire_BtcLnV1Swap_new_submarine_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - id: impl CstDecode, - kind: impl CstDecode, - network: impl CstDecode, - keys: impl CstDecode, - preimage: impl CstDecode, - redeem_script: impl CstDecode, + mnemonic: impl CstDecode, + index: impl CstDecode, invoice: impl CstDecode, - script_address: impl CstDecode, - out_amount: impl CstDecode, + network: impl CstDecode, electrum_url: impl CstDecode, boltz_url: impl CstDecode, + pair_hash: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "BtcLnSwap_new", + debug_name: "BtcLnV1Swap_new_submarine", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_id = id.cst_decode(); - let api_kind = kind.cst_decode(); - let api_network = network.cst_decode(); - let api_keys = keys.cst_decode(); - let api_preimage = preimage.cst_decode(); - let api_redeem_script = redeem_script.cst_decode(); + let api_mnemonic = mnemonic.cst_decode(); + let api_index = index.cst_decode(); let api_invoice = invoice.cst_decode(); - let api_script_address = script_address.cst_decode(); - let api_out_amount = out_amount.cst_decode(); + let api_network = network.cst_decode(); let api_electrum_url = electrum_url.cst_decode(); let api_boltz_url = boltz_url.cst_decode(); + let api_pair_hash = pair_hash.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::btc_ln::BtcLnSwap::new( - api_id, - api_kind, - api_network, - api_keys, - api_preimage, - api_redeem_script, + crate::api::btc_ln::BtcLnV1Swap::new_submarine( + api_mnemonic, + api_index, api_invoice, - api_script_address, - api_out_amount, + api_network, api_electrum_url, api_boltz_url, - )) + api_pair_hash, + ) })()) } }, ) } -fn wire_BtcLnSwap_reverse_v1_claim_impl( +fn wire_BtcLnV1Swap_refund_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, out_address: impl CstDecode, abs_fee: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "BtcLnSwap_reverse_v1_claim", + debug_name: "BtcLnV1Swap_refund", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -216,30 +212,28 @@ fn wire_BtcLnSwap_reverse_v1_claim_impl( let api_abs_fee = abs_fee.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::btc_ln::BtcLnSwap::reverse_v1_claim( - &api_that, - api_out_address, - api_abs_fee, - ) + crate::api::btc_ln::BtcLnV1Swap::refund(&api_that, api_out_address, api_abs_fee) })()) } }, ) } -fn wire_BtcLnSwap_tx_size_impl( +fn wire_BtcLnV1Swap_tx_size_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "BtcLnSwap_tx_size", + debug_name: "BtcLnV1Swap_tx_size", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || crate::api::btc_ln::BtcLnSwap::tx_size(&api_that))()) + transform_result_dco((move || { + crate::api::btc_ln::BtcLnV1Swap::tx_size(&api_that) + })()) } }, ) @@ -266,87 +260,35 @@ fn wire_BoltzError_new_impl( }, ) } -fn wire_LbtcLnSwap_create_reverse_v1_impl( +fn wire_LbtcLnV1Swap_claim_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - mnemonic: impl CstDecode, - index: impl CstDecode, - out_amount: impl CstDecode, - network: impl CstDecode, - electrum_url: impl CstDecode, - boltz_url: impl CstDecode, - pair_hash: impl CstDecode, -) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( - flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "LbtcLnSwap_create_reverse_v1", - port: Some(port_), - mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, - }, - move || { - let api_mnemonic = mnemonic.cst_decode(); - let api_index = index.cst_decode(); - let api_out_amount = out_amount.cst_decode(); - let api_network = network.cst_decode(); - let api_electrum_url = electrum_url.cst_decode(); - let api_boltz_url = boltz_url.cst_decode(); - let api_pair_hash = pair_hash.cst_decode(); - move |context| { - transform_result_dco((move || { - crate::api::lbtc_ln::LbtcLnSwap::create_reverse_v1( - api_mnemonic, - api_index, - api_out_amount, - api_network, - api_electrum_url, - api_boltz_url, - api_pair_hash, - ) - })()) - } - }, - ) -} -fn wire_LbtcLnSwap_create_submarine_v1_impl( - port_: flutter_rust_bridge::for_generated::MessagePort, - mnemonic: impl CstDecode, - index: impl CstDecode, - invoice: impl CstDecode, - network: impl CstDecode, - electrum_url: impl CstDecode, - boltz_url: impl CstDecode, - pair_hash: impl CstDecode, + that: impl CstDecode, + out_address: impl CstDecode, + abs_fee: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "LbtcLnSwap_create_submarine_v1", + debug_name: "LbtcLnV1Swap_claim", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_mnemonic = mnemonic.cst_decode(); - let api_index = index.cst_decode(); - let api_invoice = invoice.cst_decode(); - let api_network = network.cst_decode(); - let api_electrum_url = electrum_url.cst_decode(); - let api_boltz_url = boltz_url.cst_decode(); - let api_pair_hash = pair_hash.cst_decode(); + let api_that = that.cst_decode(); + let api_out_address = out_address.cst_decode(); + let api_abs_fee = abs_fee.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::lbtc_ln::LbtcLnSwap::create_submarine_v1( - api_mnemonic, - api_index, - api_invoice, - api_network, - api_electrum_url, - api_boltz_url, - api_pair_hash, + crate::api::lbtc_ln::LbtcLnV1Swap::claim( + &api_that, + api_out_address, + api_abs_fee, ) })()) } }, ) } -fn wire_LbtcLnSwap_new_impl( +fn wire_LbtcLnV1Swap_new_impl( port_: flutter_rust_bridge::for_generated::MessagePort, id: impl CstDecode, kind: impl CstDecode, @@ -363,7 +305,7 @@ fn wire_LbtcLnSwap_new_impl( ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "LbtcLnSwap_new", + debug_name: "LbtcLnV1Swap_new", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -382,7 +324,7 @@ fn wire_LbtcLnSwap_new_impl( let api_boltz_url = boltz_url.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::lbtc_ln::LbtcLnSwap::new( + Result::<_, ()>::Ok(crate::api::lbtc_ln::LbtcLnV1Swap::new( api_id, api_kind, api_network, @@ -401,43 +343,95 @@ fn wire_LbtcLnSwap_new_impl( }, ) } -fn wire_LbtcLnSwap_reverse_v1_claim_impl( +fn wire_LbtcLnV1Swap_new_reverse_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - out_address: impl CstDecode, - abs_fee: impl CstDecode, + mnemonic: impl CstDecode, + index: impl CstDecode, + out_amount: impl CstDecode, + network: impl CstDecode, + electrum_url: impl CstDecode, + boltz_url: impl CstDecode, + pair_hash: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "LbtcLnSwap_reverse_v1_claim", + debug_name: "LbtcLnV1Swap_new_reverse", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_that = that.cst_decode(); - let api_out_address = out_address.cst_decode(); - let api_abs_fee = abs_fee.cst_decode(); + let api_mnemonic = mnemonic.cst_decode(); + let api_index = index.cst_decode(); + let api_out_amount = out_amount.cst_decode(); + let api_network = network.cst_decode(); + let api_electrum_url = electrum_url.cst_decode(); + let api_boltz_url = boltz_url.cst_decode(); + let api_pair_hash = pair_hash.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::lbtc_ln::LbtcLnSwap::reverse_v1_claim( - &api_that, - api_out_address, - api_abs_fee, + crate::api::lbtc_ln::LbtcLnV1Swap::new_reverse( + api_mnemonic, + api_index, + api_out_amount, + api_network, + api_electrum_url, + api_boltz_url, + api_pair_hash, ) })()) } }, ) } -fn wire_LbtcLnSwap_submarine_v1_refund_impl( +fn wire_LbtcLnV1Swap_new_submarine_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + mnemonic: impl CstDecode, + index: impl CstDecode, + invoice: impl CstDecode, + network: impl CstDecode, + electrum_url: impl CstDecode, + boltz_url: impl CstDecode, + pair_hash: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "LbtcLnV1Swap_new_submarine", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_mnemonic = mnemonic.cst_decode(); + let api_index = index.cst_decode(); + let api_invoice = invoice.cst_decode(); + let api_network = network.cst_decode(); + let api_electrum_url = electrum_url.cst_decode(); + let api_boltz_url = boltz_url.cst_decode(); + let api_pair_hash = pair_hash.cst_decode(); + move |context| { + transform_result_dco((move || { + crate::api::lbtc_ln::LbtcLnV1Swap::new_submarine( + api_mnemonic, + api_index, + api_invoice, + api_network, + api_electrum_url, + api_boltz_url, + api_pair_hash, + ) + })()) + } + }, + ) +} +fn wire_LbtcLnV1Swap_refund_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, out_address: impl CstDecode, abs_fee: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "LbtcLnSwap_submarine_v1_refund", + debug_name: "LbtcLnV1Swap_refund", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -447,7 +441,7 @@ fn wire_LbtcLnSwap_submarine_v1_refund_impl( let api_abs_fee = abs_fee.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::lbtc_ln::LbtcLnSwap::submarine_v1_refund( + crate::api::lbtc_ln::LbtcLnV1Swap::refund( &api_that, api_out_address, api_abs_fee, @@ -457,20 +451,22 @@ fn wire_LbtcLnSwap_submarine_v1_refund_impl( }, ) } -fn wire_LbtcLnSwap_tx_size_impl( +fn wire_LbtcLnV1Swap_tx_size_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - swap: impl CstDecode, + swap: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "LbtcLnSwap_tx_size", + debug_name: "LbtcLnV1Swap_tx_size", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_swap = swap.cst_decode(); move |context| { - transform_result_dco((move || crate::api::lbtc_ln::LbtcLnSwap::tx_size(api_swap))()) + transform_result_dco((move || { + crate::api::lbtc_ln::LbtcLnV1Swap::tx_size(api_swap) + })()) } }, ) @@ -663,7 +659,7 @@ impl SseDecode for bool { } } -impl SseDecode for crate::api::btc_ln::BtcLnSwap { +impl SseDecode for crate::api::btc_ln::BtcLnV1Swap { // 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_id = ::sse_decode(deserializer); @@ -677,7 +673,7 @@ impl SseDecode for crate::api::btc_ln::BtcLnSwap { let mut var_outAmount = ::sse_decode(deserializer); let mut var_electrumUrl = ::sse_decode(deserializer); let mut var_boltzUrl = ::sse_decode(deserializer); - return crate::api::btc_ln::BtcLnSwap { + return crate::api::btc_ln::BtcLnV1Swap { id: var_id, kind: var_kind, network: var_network, @@ -755,7 +751,7 @@ impl SseDecode for crate::api::types::KeyPair { } } -impl SseDecode for crate::api::lbtc_ln::LbtcLnSwap { +impl SseDecode for crate::api::lbtc_ln::LbtcLnV1Swap { // 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_id = ::sse_decode(deserializer); @@ -770,7 +766,7 @@ impl SseDecode for crate::api::lbtc_ln::LbtcLnSwap { let mut var_blindingKey = ::sse_decode(deserializer); let mut var_electrumUrl = ::sse_decode(deserializer); let mut var_boltzUrl = ::sse_decode(deserializer); - return crate::api::lbtc_ln::LbtcLnSwap { + return crate::api::lbtc_ln::LbtcLnV1Swap { id: var_id, kind: var_kind, network: var_network, @@ -959,7 +955,7 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::btc_ln::BtcLnSwap { +impl flutter_rust_bridge::IntoDart for crate::api::btc_ln::BtcLnV1Swap { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [ self.id.into_into_dart().into_dart(), @@ -977,11 +973,14 @@ impl flutter_rust_bridge::IntoDart for crate::api::btc_ln::BtcLnSwap { .into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::btc_ln::BtcLnSwap {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::btc_ln::BtcLnSwap +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::btc_ln::BtcLnV1Swap +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::btc_ln::BtcLnV1Swap { - fn into_into_dart(self) -> crate::api::btc_ln::BtcLnSwap { + fn into_into_dart(self) -> crate::api::btc_ln::BtcLnV1Swap { self } } @@ -1045,7 +1044,7 @@ 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::lbtc_ln::LbtcLnSwap { +impl flutter_rust_bridge::IntoDart for crate::api::lbtc_ln::LbtcLnV1Swap { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [ self.id.into_into_dart().into_dart(), @@ -1065,13 +1064,13 @@ impl flutter_rust_bridge::IntoDart for crate::api::lbtc_ln::LbtcLnSwap { } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::lbtc_ln::LbtcLnSwap + for crate::api::lbtc_ln::LbtcLnV1Swap { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::lbtc_ln::LbtcLnSwap +impl flutter_rust_bridge::IntoIntoDart + for crate::api::lbtc_ln::LbtcLnV1Swap { - fn into_into_dart(self) -> crate::api::lbtc_ln::LbtcLnSwap { + fn into_into_dart(self) -> crate::api::lbtc_ln::LbtcLnV1Swap { self } } @@ -1208,7 +1207,7 @@ impl SseEncode for bool { } } -impl SseEncode for crate::api::btc_ln::BtcLnSwap { +impl SseEncode for crate::api::btc_ln::BtcLnV1Swap { // 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.id, serializer); @@ -1278,7 +1277,7 @@ impl SseEncode for crate::api::types::KeyPair { } } -impl SseEncode for crate::api::lbtc_ln::LbtcLnSwap { +impl SseEncode for crate::api::lbtc_ln::LbtcLnV1Swap { // 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.id, serializer); diff --git a/rust/src/frb_generated.web.rs b/rust/src/frb_generated.web.rs index fe6310a..5116298 100644 --- a/rust/src/frb_generated.web.rs +++ b/rust/src/frb_generated.web.rs @@ -68,11 +68,11 @@ impl CstDecode } } } -impl CstDecode +impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::btc_ln::BtcLnSwap { + fn cst_decode(self) -> crate::api::btc_ln::BtcLnV1Swap { let self_ = self .dyn_into::() .unwrap(); @@ -82,7 +82,7 @@ impl CstDecode "Expected 11 elements, got {}", self_.length() ); - crate::api::btc_ln::BtcLnSwap { + crate::api::btc_ln::BtcLnV1Swap { id: self_.get(0).cst_decode(), kind: self_.get(1).cst_decode(), network: self_.get(2).cst_decode(), @@ -142,11 +142,11 @@ impl CstDecode } } } -impl CstDecode +impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::lbtc_ln::LbtcLnSwap { + fn cst_decode(self) -> crate::api::lbtc_ln::LbtcLnV1Swap { let self_ = self .dyn_into::() .unwrap(); @@ -156,7 +156,7 @@ impl CstDecode "Expected 12 elements, got {}", self_.length() ); - crate::api::lbtc_ln::LbtcLnSwap { + crate::api::lbtc_ln::LbtcLnV1Swap { id: self_.get(0).cst_decode(), kind: self_.get(1).cst_decode(), network: self_.get(2).cst_decode(), @@ -333,54 +333,62 @@ impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsVa } #[wasm_bindgen] -pub fn wire_BtcLnSwap_btc_ln_submarine_refund( +pub fn wire_BtcLnV1Swap_claim( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, out_address: String, abs_fee: u64, ) { - wire_BtcLnSwap_btc_ln_submarine_refund_impl(port_, that, out_address, abs_fee) + wire_BtcLnV1Swap_claim_impl(port_, that, out_address, abs_fee) } #[wasm_bindgen] -pub fn wire_BtcLnSwap_create_reverse_v1( +pub fn wire_BtcLnV1Swap_new( port_: flutter_rust_bridge::for_generated::MessagePort, - mnemonic: String, - index: u64, - out_amount: u64, + id: String, + kind: i32, network: i32, + keys: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + preimage: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + redeem_script: String, + invoice: String, + script_address: String, + out_amount: u64, electrum_url: String, boltz_url: String, - pair_hash: String, ) { - wire_BtcLnSwap_create_reverse_v1_impl( + wire_BtcLnV1Swap_new_impl( port_, - mnemonic, - index, - out_amount, + id, + kind, network, + keys, + preimage, + redeem_script, + invoice, + script_address, + out_amount, electrum_url, boltz_url, - pair_hash, ) } #[wasm_bindgen] -pub fn wire_BtcLnSwap_create_submarine_v1( +pub fn wire_BtcLnV1Swap_new_reverse( port_: flutter_rust_bridge::for_generated::MessagePort, mnemonic: String, index: u64, - invoice: String, + out_amount: u64, network: i32, electrum_url: String, boltz_url: String, pair_hash: String, ) { - wire_BtcLnSwap_create_submarine_v1_impl( + wire_BtcLnV1Swap_new_reverse_impl( port_, mnemonic, index, - invoice, + out_amount, network, electrum_url, boltz_url, @@ -389,52 +397,44 @@ pub fn wire_BtcLnSwap_create_submarine_v1( } #[wasm_bindgen] -pub fn wire_BtcLnSwap_new( +pub fn wire_BtcLnV1Swap_new_submarine( port_: flutter_rust_bridge::for_generated::MessagePort, - id: String, - kind: i32, - network: i32, - keys: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - preimage: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - redeem_script: String, + mnemonic: String, + index: u64, invoice: String, - script_address: String, - out_amount: u64, + network: i32, electrum_url: String, boltz_url: String, + pair_hash: String, ) { - wire_BtcLnSwap_new_impl( + wire_BtcLnV1Swap_new_submarine_impl( port_, - id, - kind, - network, - keys, - preimage, - redeem_script, + mnemonic, + index, invoice, - script_address, - out_amount, + network, electrum_url, boltz_url, + pair_hash, ) } #[wasm_bindgen] -pub fn wire_BtcLnSwap_reverse_v1_claim( +pub fn wire_BtcLnV1Swap_refund( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, out_address: String, abs_fee: u64, ) { - wire_BtcLnSwap_reverse_v1_claim_impl(port_, that, out_address, abs_fee) + wire_BtcLnV1Swap_refund_impl(port_, that, out_address, abs_fee) } #[wasm_bindgen] -pub fn wire_BtcLnSwap_tx_size( +pub fn wire_BtcLnV1Swap_tx_size( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_BtcLnSwap_tx_size_impl(port_, that) + wire_BtcLnV1Swap_tx_size_impl(port_, that) } #[wasm_bindgen] @@ -447,44 +447,64 @@ pub fn wire_BoltzError_new( } #[wasm_bindgen] -pub fn wire_LbtcLnSwap_create_reverse_v1( +pub fn wire_LbtcLnV1Swap_claim( port_: flutter_rust_bridge::for_generated::MessagePort, - mnemonic: String, - index: u64, - out_amount: u64, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + out_address: String, + abs_fee: u64, +) { + wire_LbtcLnV1Swap_claim_impl(port_, that, out_address, abs_fee) +} + +#[wasm_bindgen] +pub fn wire_LbtcLnV1Swap_new( + port_: flutter_rust_bridge::for_generated::MessagePort, + id: String, + kind: i32, network: i32, + keys: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + preimage: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + redeem_script: String, + invoice: String, + out_amount: u64, + out_address: String, + blinding_key: String, electrum_url: String, boltz_url: String, - pair_hash: String, ) { - wire_LbtcLnSwap_create_reverse_v1_impl( + wire_LbtcLnV1Swap_new_impl( port_, - mnemonic, - index, - out_amount, + id, + kind, network, + keys, + preimage, + redeem_script, + invoice, + out_amount, + out_address, + blinding_key, electrum_url, boltz_url, - pair_hash, ) } #[wasm_bindgen] -pub fn wire_LbtcLnSwap_create_submarine_v1( +pub fn wire_LbtcLnV1Swap_new_reverse( port_: flutter_rust_bridge::for_generated::MessagePort, mnemonic: String, index: u64, - invoice: String, + out_amount: u64, network: i32, electrum_url: String, boltz_url: String, pair_hash: String, ) { - wire_LbtcLnSwap_create_submarine_v1_impl( + wire_LbtcLnV1Swap_new_reverse_impl( port_, mnemonic, index, - invoice, + out_amount, network, electrum_url, boltz_url, @@ -493,64 +513,44 @@ pub fn wire_LbtcLnSwap_create_submarine_v1( } #[wasm_bindgen] -pub fn wire_LbtcLnSwap_new( +pub fn wire_LbtcLnV1Swap_new_submarine( port_: flutter_rust_bridge::for_generated::MessagePort, - id: String, - kind: i32, - network: i32, - keys: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - preimage: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - redeem_script: String, + mnemonic: String, + index: u64, invoice: String, - out_amount: u64, - out_address: String, - blinding_key: String, + network: i32, electrum_url: String, boltz_url: String, + pair_hash: String, ) { - wire_LbtcLnSwap_new_impl( + wire_LbtcLnV1Swap_new_submarine_impl( port_, - id, - kind, - network, - keys, - preimage, - redeem_script, + mnemonic, + index, invoice, - out_amount, - out_address, - blinding_key, + network, electrum_url, boltz_url, + pair_hash, ) } #[wasm_bindgen] -pub fn wire_LbtcLnSwap_reverse_v1_claim( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - out_address: String, - abs_fee: u64, -) { - wire_LbtcLnSwap_reverse_v1_claim_impl(port_, that, out_address, abs_fee) -} - -#[wasm_bindgen] -pub fn wire_LbtcLnSwap_submarine_v1_refund( +pub fn wire_LbtcLnV1Swap_refund( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, out_address: String, abs_fee: u64, ) { - wire_LbtcLnSwap_submarine_v1_refund_impl(port_, that, out_address, abs_fee) + wire_LbtcLnV1Swap_refund_impl(port_, that, out_address, abs_fee) } #[wasm_bindgen] -pub fn wire_LbtcLnSwap_tx_size( +pub fn wire_LbtcLnV1Swap_tx_size( port_: flutter_rust_bridge::for_generated::MessagePort, swap: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_LbtcLnSwap_tx_size_impl(port_, swap) + wire_LbtcLnV1Swap_tx_size_impl(port_, swap) } #[wasm_bindgen] diff --git a/test/boltz_standalone_test.dart b/test/boltz_standalone_test.dart index 3a6dafa..7eb0152 100644 --- a/test/boltz_standalone_test.dart +++ b/test/boltz_standalone_test.dart @@ -115,7 +115,7 @@ void main() { }); test('Neg: Send less on-chain sats', () async { - BtcLnSwap btcLnSubmarine = await setupSubmarine(workingFreshInvoice1); + BtcLnV1Swap btcLnSubmarine = await setupSubmarine(workingFreshInvoice1); const expectedSecretKey = "9b496356fbb59d95656acc879a5d7a9169eb3d77e5b7c511aeb827925e5b49e9"; @@ -147,7 +147,7 @@ void main() { }, skip: true, timeout: testTimeout); test('Neg: LN Invoice expires', () async { - BtcLnSwap btcLnSubmarine = await setupSubmarine(invoiceWith1minExpiry); + BtcLnV1Swap btcLnSubmarine = await setupSubmarine(invoiceWith1minExpiry); // final paymentDetails = await btcLnSubmarine.paymentDetails(); const expectedSecretKey = "9b496356fbb59d95656acc879a5d7a9169eb3d77e5b7c511aeb827925e5b49e9"; @@ -182,7 +182,7 @@ void main() { }, skip: true, timeout: testTimeout); test('Positive: Send exact amount or more', () async { - BtcLnSwap btcLnSubmarine = await setupSubmarine(workingFreshInvoice2); + BtcLnV1Swap btcLnSubmarine = await setupSubmarine(workingFreshInvoice2); const expectedSecretKey = "9b496356fbb59d95656acc879a5d7a9169eb3d77e5b7c511aeb827925e5b49e9"; @@ -251,21 +251,21 @@ void main() { }, skip: true); test('Positive: ', () async { - BtcLnSwap btcLnSubmarine = await setupReverse(btcLnReverseSwapAmount); + BtcLnV1Swap btcLnReverse = await setupReverse(btcLnReverseSwapAmount); const expectedSecretKey = "a0a62dd7225288f41a741c293a3220035b4c71686dc34c01ec84cbe6ab11b4e1"; - print("SWAP CREATED SUCCESSFULLY: ${btcLnSubmarine.id}"); - expect(btcLnSubmarine.keys.secretKey, expectedSecretKey); + print("SWAP CREATED SUCCESSFULLY: ${btcLnReverse.id}"); + expect(btcLnReverse.keys.secretKey, expectedSecretKey); - print("Pay this invoice: ${btcLnSubmarine.invoice}"); + print("Pay this invoice: ${btcLnReverse.invoice}"); var completer = Completer(); var receivedEvents = []; final api = await BoltzApi.newBoltzApi(); var sub = - api.subscribeSwapStatus([btcLnSubmarine.id]).listen((event) async { + api.subscribeSwapStatus([btcLnReverse.id]).listen((event) async { receivedEvents.add(event); if (event.status == SwapStatus.txnMempool) { await Future.delayed(Duration(seconds: 20)); @@ -273,7 +273,7 @@ void main() { final fees = await AllFees.fetch(boltzUrl: boltzUrl); final claimFeesEstimate = fees.btcReverse.claimFeesEstimate; - String txnId = await btcLnSubmarine.reverseV1Claim( + String txnId = await btcLnReverse.claim( outAddress: btcReceiveAddress, absFee: claimFeesEstimate); print(txnId); } @@ -337,21 +337,21 @@ void main() { const outAddress = 'tlq1qqf9zqefh7jwzvu56gssqh7ayea2cmphhcqmfleg2zg6t5r70zfa2ukmvg5cmp5g33nar2xkx57edghhpc9nj56plk7ch7ppuk'; - final lbtcLnSubmarineSwap = await setupLReverse(outAmount); + final lbtcLnReverseSwap = await setupLReverse(outAmount); const expectedSecretKey = "a0a62dd7225288f41a741c293a3220035b4c71686dc34c01ec84cbe6ab11b4e1"; - print("SWAP CREATED SUCCESSFULLY: ${lbtcLnSubmarineSwap.id}"); + print("SWAP CREATED SUCCESSFULLY: ${lbtcLnReverseSwap.id}"); - expect(lbtcLnSubmarineSwap.keys.secretKey, expectedSecretKey); + expect(lbtcLnReverseSwap.keys.secretKey, expectedSecretKey); - print("Pay this invoice: ${lbtcLnSubmarineSwap.invoice}"); + print("Pay this invoice: ${lbtcLnReverseSwap.invoice}"); var completer = Completer(); var receivedEvents = []; final api = await BoltzApi.newBoltzApi(); - var sub = api - .subscribeSwapStatus([lbtcLnSubmarineSwap.id]).listen((event) async { + var sub = + api.subscribeSwapStatus([lbtcLnReverseSwap.id]).listen((event) async { receivedEvents.add(event); if (event.status == SwapStatus.txnConfirmed) { await Future.delayed(Duration(seconds: 300)); @@ -359,7 +359,7 @@ void main() { final fees = await AllFees.fetch(boltzUrl: boltzUrl); final claimFeesEstimate = fees.lbtcReverse.claimFeesEstimate; - String txnId = await lbtcLnSubmarineSwap.reverseV1Claim( + String txnId = await lbtcLnReverseSwap.claim( outAddress: outAddress, absFee: claimFeesEstimate); print(txnId); } @@ -380,11 +380,11 @@ void main() { }); } -Future setupSubmarine(String invoice) async { +Future setupSubmarine(String invoice) async { final amount = 100000; final fees = await AllFees.fetch(boltzUrl: boltzUrl); - final btcLnSubmarineSwap = await BtcLnSwap.createSubmarineV1( + final btcLnSubmarineSwap = await BtcLnV1Swap.newSubmarine( mnemonic: mnemonic, index: index, invoice: invoice, @@ -397,10 +397,10 @@ Future setupSubmarine(String invoice) async { return btcLnSubmarineSwap; } -Future setupReverse(int outAmount) async { +Future setupReverse(int outAmount) async { final fees = await AllFees.fetch(boltzUrl: boltzUrl); - final btcLnReverseSwap = await BtcLnSwap.createReverseV1( + final btcLnReverseSwap = await BtcLnV1Swap.newReverse( mnemonic: mnemonic, index: index, outAmount: outAmount, @@ -412,11 +412,11 @@ Future setupReverse(int outAmount) async { return btcLnReverseSwap; } -Future setupLSubmarine(String invoice) async { +Future setupLSubmarine(String invoice) async { final amount = 100000; final fees = await AllFees.fetch(boltzUrl: boltzUrl); - final lbtcLnSubmarineSwap = await LbtcLnSwap.createSubmarineV1( + final lbtcLnSubmarineSwap = await LbtcLnV1Swap.newSubmarine( mnemonic: mnemonic, index: index, invoice: invoice, @@ -428,10 +428,10 @@ Future setupLSubmarine(String invoice) async { return lbtcLnSubmarineSwap; } -Future setupLReverse(int amount) async { +Future setupLReverse(int amount) async { final fees = await AllFees.fetch(boltzUrl: boltzUrl); - final lbtcLnSubmarineSwap = await LbtcLnSwap.createReverseV1( + final lbtcLnSubmarineSwap = await LbtcLnV1Swap.newReverse( mnemonic: mnemonic, index: index, outAmount: amount,