-
Notifications
You must be signed in to change notification settings - Fork 1
/
send_crypto_payload.dart
50 lines (45 loc) · 1.14 KB
/
send_crypto_payload.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
class SendCryptoPayload {
String? address;
String? amount;
SendCryptoAssetInfo? assetInfo;
static SendCryptoPayload fromArguments(dynamic arguments) {
SendCryptoPayload payload = SendCryptoPayload();
payload.address = arguments["address"];
payload.amount = arguments["amount"];
payload.assetInfo =
SendCryptoAssetInfo.fromArguments(arguments["assetInfo"]);
return payload;
}
dynamic toMap() {
return {
'address': address,
'amount': amount,
'assetInfo': assetInfo,
};
}
}
class SendCryptoAssetInfo {
String? chain;
int? decimals;
String? name;
String? symbol;
String? type;
static SendCryptoAssetInfo fromArguments(dynamic arguments) {
SendCryptoAssetInfo payload = SendCryptoAssetInfo();
payload.chain = arguments["chain"];
payload.decimals = arguments["decimals"];
payload.name = arguments["name"];
payload.symbol = arguments["symbol"];
payload.type = arguments["type"];
return payload;
}
dynamic toMap() {
return {
'chain': chain,
'decimals': decimals,
'name': name,
'symbol': symbol,
'type': type,
};
}
}