Skip to content

Commit

Permalink
Update Dart package to version v0.7.2-dev1
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Feb 24, 2025
1 parent 57570f9 commit 515e063
Show file tree
Hide file tree
Showing 12 changed files with 4,506 additions and 4,288 deletions.
8 changes: 5 additions & 3 deletions lib/breez_liquid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ class UnsupportedPlatform implements Exception {
Future<void> initialize({ExternalLibrary? dylib}) async {
try {
dylib ??= await _loadPlatformSpecificLibrary();
_log.info(dylib != null
? 'Initializing RustLib with the provided library'
: 'Initializing RustLib with the default ExternalLibrary');
_log.info(
dylib != null
? 'Initializing RustLib with the provided library'
: 'Initializing RustLib with the default ExternalLibrary',
);
await RustLib.init(externalLibrary: dylib);
} catch (e, stacktrace) {
_log.severe('Initialization failed: $e', e, stacktrace);
Expand Down
190 changes: 49 additions & 141 deletions lib/src/bindings.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.7.0.
// @generated by `flutter_rust_bridge`@ 2.8.0.

// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import

Expand All @@ -12,7 +12,7 @@ import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
part 'bindings.freezed.dart';

// These functions are ignored because they are not marked as `pub`: `init`
// These types are ignored because they are not used by any `pub` functions: `DartBindingLogger`
// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `DartBindingLogger`
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `enabled`, `flush`, `log`

Future<BindingLiquidSdk> connect({required ConnectRequest req}) =>
Expand Down Expand Up @@ -49,8 +49,9 @@ abstract class BindingLiquidSdk implements RustOpaqueInterface {

Future<OnchainPaymentLimitsResponse> fetchOnchainLimits();

Future<FetchPaymentProposedFeesResponse> fetchPaymentProposedFees(
{required FetchPaymentProposedFeesRequest req});
Future<FetchPaymentProposedFeesResponse> fetchPaymentProposedFees({
required FetchPaymentProposedFeesRequest req,
});

Future<GetInfoResponse> getInfo();

Expand Down Expand Up @@ -110,11 +111,7 @@ class AesSuccessActionData {
final String ciphertext;
final String iv;

const AesSuccessActionData({
required this.description,
required this.ciphertext,
required this.iv,
});
const AesSuccessActionData({required this.description, required this.ciphertext, required this.iv});

@override
int get hashCode => description.hashCode ^ ciphertext.hashCode ^ iv.hashCode;
Expand All @@ -133,10 +130,7 @@ class AesSuccessActionDataDecrypted {
final String description;
final String plaintext;

const AesSuccessActionDataDecrypted({
required this.description,
required this.plaintext,
});
const AesSuccessActionDataDecrypted({required this.description, required this.plaintext});

@override
int get hashCode => description.hashCode ^ plaintext.hashCode;
Expand All @@ -154,33 +148,25 @@ class AesSuccessActionDataDecrypted {
sealed class AesSuccessActionDataResult with _$AesSuccessActionDataResult {
const AesSuccessActionDataResult._();

const factory AesSuccessActionDataResult.decrypted({
required AesSuccessActionDataDecrypted data,
}) = AesSuccessActionDataResult_Decrypted;
const factory AesSuccessActionDataResult.errorStatus({
required String reason,
}) = AesSuccessActionDataResult_ErrorStatus;
const factory AesSuccessActionDataResult.decrypted({required AesSuccessActionDataDecrypted data}) =
AesSuccessActionDataResult_Decrypted;
const factory AesSuccessActionDataResult.errorStatus({required String reason}) =
AesSuccessActionDataResult_ErrorStatus;
}

@freezed
sealed class Amount with _$Amount {
const Amount._();

const factory Amount.bitcoin({
required BigInt amountMsat,
}) = Amount_Bitcoin;
const factory Amount.currency({
required String iso4217Code,
required BigInt fractionalAmount,
}) = Amount_Currency;
const factory Amount.bitcoin({required BigInt amountMsat}) = Amount_Bitcoin;
const factory Amount.currency({required String iso4217Code, required BigInt fractionalAmount}) =
Amount_Currency;
}

class BindingEventListener {
final RustStreamSink<SdkEvent> stream;

const BindingEventListener({
required this.stream,
});
const BindingEventListener({required this.stream});

Future<void> onEvent({required SdkEvent e}) =>
RustLib.instance.api.crateBindingsBindingEventListenerOnEvent(that: this, e: e);
Expand Down Expand Up @@ -273,11 +259,7 @@ class ExternalInputParser {
final String inputRegex;
final String parserUrl;

const ExternalInputParser({
required this.providerId,
required this.inputRegex,
required this.parserUrl,
});
const ExternalInputParser({required this.providerId, required this.inputRegex, required this.parserUrl});

@override
int get hashCode => providerId.hashCode ^ inputRegex.hashCode ^ parserUrl.hashCode;
Expand All @@ -296,10 +278,7 @@ class FiatCurrency {
final String id;
final CurrencyInfo info;

const FiatCurrency({
required this.id,
required this.info,
});
const FiatCurrency({required this.id, required this.info});

@override
int get hashCode => id.hashCode ^ info.hashCode;
Expand All @@ -314,38 +293,18 @@ class FiatCurrency {
sealed class InputType with _$InputType {
const InputType._();

const factory InputType.bitcoinAddress({
required BitcoinAddressData address,
}) = InputType_BitcoinAddress;
const factory InputType.liquidAddress({
required LiquidAddressData address,
}) = InputType_LiquidAddress;
const factory InputType.bolt11({
required LNInvoice invoice,
}) = InputType_Bolt11;
const factory InputType.bolt12Offer({
required LNOffer offer,
String? bip353Address,
}) = InputType_Bolt12Offer;
const factory InputType.nodeId({
required String nodeId,
}) = InputType_NodeId;
const factory InputType.url({
required String url,
}) = InputType_Url;
const factory InputType.lnUrlPay({
required LnUrlPayRequestData data,
String? bip353Address,
}) = InputType_LnUrlPay;
const factory InputType.lnUrlWithdraw({
required LnUrlWithdrawRequestData data,
}) = InputType_LnUrlWithdraw;
const factory InputType.lnUrlAuth({
required LnUrlAuthRequestData data,
}) = InputType_LnUrlAuth;
const factory InputType.lnUrlError({
required LnUrlErrorData data,
}) = InputType_LnUrlError;
const factory InputType.bitcoinAddress({required BitcoinAddressData address}) = InputType_BitcoinAddress;
const factory InputType.liquidAddress({required LiquidAddressData address}) = InputType_LiquidAddress;
const factory InputType.bolt11({required LNInvoice invoice}) = InputType_Bolt11;
const factory InputType.bolt12Offer({required LNOffer offer, String? bip353Address}) =
InputType_Bolt12Offer;
const factory InputType.nodeId({required String nodeId}) = InputType_NodeId;
const factory InputType.url({required String url}) = InputType_Url;
const factory InputType.lnUrlPay({required LnUrlPayRequestData data, String? bip353Address}) =
InputType_LnUrlPay;
const factory InputType.lnUrlWithdraw({required LnUrlWithdrawRequestData data}) = InputType_LnUrlWithdraw;
const factory InputType.lnUrlAuth({required LnUrlAuthRequestData data}) = InputType_LnUrlAuth;
const factory InputType.lnUrlError({required LnUrlErrorData data}) = InputType_LnUrlError;
}

class LiquidAddressData {
Expand Down Expand Up @@ -504,9 +463,7 @@ class LNOffer {
class LnOfferBlindedPath {
final List<String> blindedHops;

const LnOfferBlindedPath({
required this.blindedHops,
});
const LnOfferBlindedPath({required this.blindedHops});

@override
int get hashCode => blindedHops.hashCode;
Expand All @@ -523,12 +480,7 @@ class LnUrlAuthRequestData {
final String domain;
final String url;

const LnUrlAuthRequestData({
required this.k1,
this.action,
required this.domain,
required this.url,
});
const LnUrlAuthRequestData({required this.k1, this.action, required this.domain, required this.url});

@override
int get hashCode => k1.hashCode ^ action.hashCode ^ domain.hashCode ^ url.hashCode;
Expand All @@ -547,9 +499,7 @@ class LnUrlAuthRequestData {
class LnUrlErrorData {
final String reason;

const LnUrlErrorData({
required this.reason,
});
const LnUrlErrorData({required this.reason});

@override
int get hashCode => reason.hashCode;
Expand All @@ -564,10 +514,7 @@ class LnUrlPayErrorData {
final String paymentHash;
final String reason;

const LnUrlPayErrorData({
required this.paymentHash,
required this.reason,
});
const LnUrlPayErrorData({required this.paymentHash, required this.reason});

@override
int get hashCode => paymentHash.hashCode ^ reason.hashCode;
Expand Down Expand Up @@ -637,11 +584,7 @@ class LnUrlWithdrawRequest {
final BigInt amountMsat;
final String? description;

const LnUrlWithdrawRequest({
required this.data,
required this.amountMsat,
this.description,
});
const LnUrlWithdrawRequest({required this.data, required this.amountMsat, this.description});

@override
int get hashCode => data.hashCode ^ amountMsat.hashCode ^ description.hashCode;
Expand Down Expand Up @@ -696,11 +639,7 @@ class LocaleOverrides {
final int? spacing;
final Symbol symbol;

const LocaleOverrides({
required this.locale,
this.spacing,
required this.symbol,
});
const LocaleOverrides({required this.locale, this.spacing, required this.symbol});

@override
int get hashCode => locale.hashCode ^ spacing.hashCode ^ symbol.hashCode;
Expand All @@ -719,10 +658,7 @@ class LocalizedName {
final String locale;
final String name;

const LocalizedName({
required this.locale,
required this.name,
});
const LocalizedName({required this.locale, required this.name});

@override
int get hashCode => locale.hashCode ^ name.hashCode;
Expand All @@ -739,9 +675,7 @@ class LocalizedName {
class MessageSuccessActionData {
final String message;

const MessageSuccessActionData({
required this.message,
});
const MessageSuccessActionData({required this.message});

@override
int get hashCode => message.hashCode;
Expand All @@ -752,22 +686,13 @@ class MessageSuccessActionData {
other is MessageSuccessActionData && runtimeType == other.runtimeType && message == other.message;
}

enum Network {
bitcoin,
testnet,
signet,
regtest,
;
}
enum Network { bitcoin, testnet, signet, regtest }

class Rate {
final String coin;
final double value;

const Rate({
required this.coin,
required this.value,
});
const Rate({required this.coin, required this.value});

@override
int get hashCode => coin.hashCode ^ value.hashCode;
Expand All @@ -781,9 +706,7 @@ class Rate {
class RouteHint {
final List<RouteHintHop> hops;

const RouteHint({
required this.hops,
});
const RouteHint({required this.hops});

@override
int get hashCode => hops.hashCode;
Expand Down Expand Up @@ -840,30 +763,20 @@ class RouteHintHop {
sealed class SuccessAction with _$SuccessAction {
const SuccessAction._();

const factory SuccessAction.aes({
required AesSuccessActionData data,
}) = SuccessAction_Aes;
const factory SuccessAction.message({
required MessageSuccessActionData data,
}) = SuccessAction_Message;
const factory SuccessAction.url({
required UrlSuccessActionData data,
}) = SuccessAction_Url;
const factory SuccessAction.aes({required AesSuccessActionData data}) = SuccessAction_Aes;
const factory SuccessAction.message({required MessageSuccessActionData data}) = SuccessAction_Message;
const factory SuccessAction.url({required UrlSuccessActionData data}) = SuccessAction_Url;
}

@freezed
sealed class SuccessActionProcessed with _$SuccessActionProcessed {
const SuccessActionProcessed._();

const factory SuccessActionProcessed.aes({
required AesSuccessActionDataResult result,
}) = SuccessActionProcessed_Aes;
const factory SuccessActionProcessed.message({
required MessageSuccessActionData data,
}) = SuccessActionProcessed_Message;
const factory SuccessActionProcessed.url({
required UrlSuccessActionData data,
}) = SuccessActionProcessed_Url;
const factory SuccessActionProcessed.aes({required AesSuccessActionDataResult result}) =
SuccessActionProcessed_Aes;
const factory SuccessActionProcessed.message({required MessageSuccessActionData data}) =
SuccessActionProcessed_Message;
const factory SuccessActionProcessed.url({required UrlSuccessActionData data}) = SuccessActionProcessed_Url;
}

class Symbol {
Expand All @@ -872,12 +785,7 @@ class Symbol {
final bool? rtl;
final int? position;

const Symbol({
this.grapheme,
this.template,
this.rtl,
this.position,
});
const Symbol({this.grapheme, this.template, this.rtl, this.position});

@override
int get hashCode => grapheme.hashCode ^ template.hashCode ^ rtl.hashCode ^ position.hashCode;
Expand Down
Loading

0 comments on commit 515e063

Please sign in to comment.