mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 09:47:35 +00:00
19 lines
525 B
Dart
19 lines
525 B
Dart
import 'dart:convert';
|
|
|
|
class BitcoinAddressRecord {
|
|
BitcoinAddressRecord(this.address, {this.label, this.index});
|
|
|
|
factory BitcoinAddressRecord.fromJSON(String jsonSource) {
|
|
final decoded = json.decode(jsonSource) as Map;
|
|
|
|
return BitcoinAddressRecord(decoded['address'] as String,
|
|
label: decoded['label'] as String, index: decoded['index'] as int);
|
|
}
|
|
|
|
final String address;
|
|
int index;
|
|
String label;
|
|
|
|
String toJSON() =>
|
|
json.encode({'label': label, 'address': address, 'index': index});
|
|
}
|