-
Notifications
You must be signed in to change notification settings - Fork 1
/
onramp_purchase.dart
61 lines (58 loc) · 1.98 KB
/
onramp_purchase.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
class OnrampPurchase {
String? id;
String? endTime;
PurchaseAssetInfo? asset;
String? receiverAddress;
String? cryptoAmount;
String? fiatCurrency;
int? fiatValue;
double? assetExchangeRate;
double? baseRampFee;
double? networkFee;
double? appliedFee;
String? paymentMethodType;
String? finalTxHash;
String? createdAt;
String? updatedAt;
String? status;
String? escrowAddress;
String? escrowDetailsHash;
static OnrampPurchase fromArguments(dynamic arguments) {
OnrampPurchase purchase = OnrampPurchase();
purchase.id = arguments["id"];
purchase.endTime = arguments["endTime"];
purchase.asset = PurchaseAssetInfo.fromArguments(arguments["asset"]);
purchase.receiverAddress = arguments["receiverAddress"];
purchase.cryptoAmount = arguments["cryptoAmount"];
purchase.fiatCurrency = arguments["fiatCurrency"];
purchase.fiatValue = arguments["fiatValue"];
purchase.assetExchangeRate = arguments["assetExchangeRate"];
purchase.baseRampFee = arguments["baseRampFee"];
purchase.networkFee = arguments["networkFee"];
purchase.appliedFee = arguments["appliedFee"];
purchase.paymentMethodType = arguments["paymentMethodType"];
purchase.finalTxHash = arguments["finalTxHash"];
purchase.createdAt = arguments["createdAt"];
purchase.updatedAt = arguments["updatedAt"];
purchase.status = arguments["status"];
purchase.escrowAddress = arguments["escrowAddress"];
purchase.escrowDetailsHash = arguments["escrowDetailsHash"];
return purchase;
}
}
class PurchaseAssetInfo {
String? address;
int? decimals;
String? name;
String? symbol;
String? type;
static PurchaseAssetInfo fromArguments(dynamic arguments) {
PurchaseAssetInfo assetInfo = PurchaseAssetInfo();
assetInfo.address = arguments["address"];
assetInfo.decimals = arguments["decimals"];
assetInfo.name = arguments["name"];
assetInfo.symbol = arguments["symbol"];
assetInfo.type = arguments["type"];
return assetInfo;
}
}