mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-24 12:29:37 +00:00
add order to simplex model
This commit is contained in:
parent
4ae7876322
commit
64da385d29
1 changed files with 20 additions and 1 deletions
|
@ -1,8 +1,8 @@
|
||||||
import 'package:decimal/decimal.dart';
|
import 'package:decimal/decimal.dart';
|
||||||
import 'package:stackwallet/models/buy/response_objects/crypto.dart';
|
import 'package:stackwallet/models/buy/response_objects/crypto.dart';
|
||||||
import 'package:stackwallet/models/buy/response_objects/fiat.dart';
|
import 'package:stackwallet/models/buy/response_objects/fiat.dart';
|
||||||
|
import 'package:stackwallet/models/buy/response_objects/order.dart';
|
||||||
import 'package:stackwallet/models/buy/response_objects/quote.dart';
|
import 'package:stackwallet/models/buy/response_objects/quote.dart';
|
||||||
// import 'package:stackwallet/models/buy/response_objects/pair.dart';
|
|
||||||
|
|
||||||
class Simplex {
|
class Simplex {
|
||||||
List<Crypto> supportedCryptos = [];
|
List<Crypto> supportedCryptos = [];
|
||||||
|
@ -17,6 +17,21 @@ class Simplex {
|
||||||
receivingAddress: '',
|
receivingAddress: '',
|
||||||
buyWithFiat: true,
|
buyWithFiat: true,
|
||||||
);
|
);
|
||||||
|
SimplexOrder order = SimplexOrder(
|
||||||
|
quote: SimplexQuote(
|
||||||
|
crypto:
|
||||||
|
Crypto.fromJson({'ticker': 'BTC', 'name': 'Bitcoin', 'image': ''}),
|
||||||
|
fiat: Fiat.fromJson(
|
||||||
|
{'ticker': 'USD', 'name': 'United States Dollar', 'image': ''}),
|
||||||
|
youPayFiatPrice: Decimal.parse("100"),
|
||||||
|
youReceiveCryptoAmount: Decimal.parse("1.0238917"),
|
||||||
|
id: "someID",
|
||||||
|
receivingAddress: '',
|
||||||
|
buyWithFiat: true,
|
||||||
|
),
|
||||||
|
orderId: 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
|
||||||
|
paymentId: 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
|
||||||
|
userId: 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee');
|
||||||
|
|
||||||
void updateSupportedCryptos(List<Crypto> newCryptos) {
|
void updateSupportedCryptos(List<Crypto> newCryptos) {
|
||||||
supportedCryptos = newCryptos;
|
supportedCryptos = newCryptos;
|
||||||
|
@ -29,4 +44,8 @@ class Simplex {
|
||||||
void updateQuote(SimplexQuote newQuote) {
|
void updateQuote(SimplexQuote newQuote) {
|
||||||
quote = newQuote;
|
quote = newQuote;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updateOrder(SimplexOrder newOrder) {
|
||||||
|
order = newOrder;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue