cake_wallet/lib/bitcoin/bitcoin_address_record.dart

18 lines
446 B
Dart
Raw Normal View History

2020-06-20 07:10:00 +00:00
import 'dart:convert';
class BitcoinAddressRecord {
BitcoinAddressRecord(this.address, {this.label});
factory BitcoinAddressRecord.fromJSON(String jsonSource) {
final decoded = json.decode(jsonSource) as Map;
return BitcoinAddressRecord(decoded['address'] as String,
label: decoded['label'] as String);
}
final String address;
String label;
String toJSON() => json.encode({'label': label, 'address': address});
}