Fix missing dart bindings

This commit is contained in:
Daniel Granhão
2025-01-07 15:45:29 +00:00
parent 1695c88d9c
commit ad71cde463
8 changed files with 958 additions and 2 deletions

View File

@@ -9,6 +9,25 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
part 'model.freezed.dart';
/// An argument when calling [crate::sdk::LiquidSdk::accept_payment_proposed_fees].
class AcceptPaymentProposedFeesRequest {
final FetchPaymentProposedFeesResponse response;
const AcceptPaymentProposedFeesRequest({
required this.response,
});
@override
int get hashCode => response.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is AcceptPaymentProposedFeesRequest &&
runtimeType == other.runtimeType &&
response == other.response;
}
/// An argument when calling [crate::sdk::LiquidSdk::backup].
class BackupRequest {
/// Path to the backup.
@@ -239,6 +258,56 @@ class ConnectRequest {
mnemonic == other.mnemonic;
}
/// An argument when calling [crate::sdk::LiquidSdk::fetch_payment_proposed_fees].
class FetchPaymentProposedFeesRequest {
final String swapId;
const FetchPaymentProposedFeesRequest({
required this.swapId,
});
@override
int get hashCode => swapId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is FetchPaymentProposedFeesRequest && runtimeType == other.runtimeType && swapId == other.swapId;
}
/// Returned when calling [crate::sdk::LiquidSdk::fetch_payment_proposed_fees].
class FetchPaymentProposedFeesResponse {
final String swapId;
final BigInt feesSat;
/// Amount sent by the swap payer
final BigInt payerAmountSat;
/// Amount that will be received if these fees are accepted
final BigInt receiverAmountSat;
const FetchPaymentProposedFeesResponse({
required this.swapId,
required this.feesSat,
required this.payerAmountSat,
required this.receiverAmountSat,
});
@override
int get hashCode =>
swapId.hashCode ^ feesSat.hashCode ^ payerAmountSat.hashCode ^ receiverAmountSat.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is FetchPaymentProposedFeesResponse &&
runtimeType == other.runtimeType &&
swapId == other.swapId &&
feesSat == other.feesSat &&
payerAmountSat == other.payerAmountSat &&
receiverAmountSat == other.receiverAmountSat;
}
/// Returned when calling [crate::sdk::LiquidSdk::get_info].
class GetInfoResponse {
/// Usable balance. This is the confirmed onchain balance minus `pending_send_sat`.