Add saved payout destination UX and service contracts (#54)
This commit is contained in:
1 parent
a5689876ff
commit
24af794112
49 files changed
+4687
-62
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import '../destinations/models.dart';
|
||||
|
||||
enum TransferKind { topUp, exchange, payout }
|
||||
|
||||
enum OperationStatus { pending, completed, failed }
|
||||
@@ -12,6 +14,7 @@ enum WalletError {
|
||||
unsupported,
|
||||
notFound,
|
||||
uncertain,
|
||||
destinationChanged,
|
||||
}
|
||||
|
||||
class WalletException implements Exception {
|
||||
@@ -64,12 +67,14 @@ class TransferRequest {
|
||||
required this.amount,
|
||||
this.destination,
|
||||
this.recipient = '',
|
||||
this.payoutDestination,
|
||||
});
|
||||
final TransferKind kind;
|
||||
final String source;
|
||||
final int amount;
|
||||
final String? destination;
|
||||
final String recipient;
|
||||
final DestinationInput? payoutDestination;
|
||||
}
|
||||
|
||||
class Quote {
|
||||
@@ -82,11 +87,15 @@ class Quote {
|
||||
required this.expiresAt,
|
||||
required this.rateNumerator,
|
||||
required this.rateDenominator,
|
||||
this.payoutSnapshot,
|
||||
this.payoutTerms,
|
||||
});
|
||||
final String id;
|
||||
final TransferRequest request;
|
||||
final int fee, debit, credit, rateNumerator, rateDenominator;
|
||||
final DateTime expiresAt;
|
||||
final DestinationDetails? payoutSnapshot;
|
||||
final PayoutTerms? payoutTerms;
|
||||
}
|
||||
|
||||
class WalletOperation {
|
||||
@@ -116,3 +125,14 @@ class AccountProfile {
|
||||
const AccountProfile(this.locale);
|
||||
final String locale;
|
||||
}
|
||||
|
||||
class PayoutTerms {
|
||||
const PayoutTerms(
|
||||
this.amount,
|
||||
this.precision,
|
||||
this.assetLabel,
|
||||
this.expectedSeconds,
|
||||
);
|
||||
final int amount, precision, expectedSeconds;
|
||||
final String assetLabel;
|
||||
}
|
||||
Reference in new issue
Block a user