2023-05-26 21:21:16 +00:00
|
|
|
/*
|
|
|
|
* This file is part of Stack Wallet.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2023 Cypher Stack
|
|
|
|
* All Rights Reserved.
|
|
|
|
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
|
|
|
* Generated by Cypher Stack on 2023-05-26
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2023-01-16 21:07:45 +00:00
|
|
|
import 'package:decimal/decimal.dart';
|
2023-01-14 00:07:27 +00:00
|
|
|
import 'package:stackwallet/models/buy/response_objects/crypto.dart';
|
|
|
|
import 'package:stackwallet/models/buy/response_objects/fiat.dart';
|
2023-01-25 19:44:20 +00:00
|
|
|
import 'package:stackwallet/models/buy/response_objects/order.dart';
|
2023-01-16 21:07:45 +00:00
|
|
|
import 'package:stackwallet/models/buy/response_objects/quote.dart';
|
2023-01-13 02:21:19 +00:00
|
|
|
|
2023-01-16 21:07:45 +00:00
|
|
|
class Simplex {
|
2023-01-14 00:07:27 +00:00
|
|
|
List<Crypto> supportedCryptos = [];
|
|
|
|
List<Fiat> supportedFiats = [];
|
2023-01-16 21:31:53 +00:00
|
|
|
SimplexQuote 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"),
|
2023-01-19 23:47:27 +00:00
|
|
|
id: "someID",
|
2023-01-16 21:31:53 +00:00
|
|
|
receivingAddress: '',
|
2023-01-19 19:36:05 +00:00
|
|
|
buyWithFiat: true,
|
2023-01-16 21:31:53 +00:00
|
|
|
);
|
2023-01-25 19:44:20 +00:00
|
|
|
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');
|
2023-01-13 02:21:19 +00:00
|
|
|
|
2023-01-14 00:07:27 +00:00
|
|
|
void updateSupportedCryptos(List<Crypto> newCryptos) {
|
2023-01-13 02:21:19 +00:00
|
|
|
supportedCryptos = newCryptos;
|
|
|
|
}
|
|
|
|
|
2023-01-14 00:07:27 +00:00
|
|
|
void updateSupportedFiats(List<Fiat> newFiats) {
|
2023-01-13 02:21:19 +00:00
|
|
|
supportedFiats = newFiats;
|
|
|
|
}
|
2023-01-16 21:31:53 +00:00
|
|
|
|
|
|
|
void updateQuote(SimplexQuote newQuote) {
|
|
|
|
quote = newQuote;
|
|
|
|
}
|
2023-01-25 19:44:20 +00:00
|
|
|
|
|
|
|
void updateOrder(SimplexOrder newOrder) {
|
|
|
|
order = newOrder;
|
|
|
|
}
|
2023-01-13 02:21:19 +00:00
|
|
|
}
|