-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API updates #49
API updates #49
Conversation
3e0f896
to
65664f0
Compare
7f27037
to
007bfda
Compare
0f9814c
to
d9d015d
Compare
beb6fcd
to
387365a
Compare
387365a
to
eec0b6a
Compare
String toRawJson() => json.encode(jsonMap()); | ||
|
||
factory NetworkBalances.fromJson(Map<String, dynamic> json) => | ||
NetworkBalances( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NetworkBalances( | |
NetworkBalances( | |
balances: List<Balance>.from(json["balances"].map((e) => Balance.fromJson(e))), | |
totalItems: json["total_items"], | |
totalBalancesSum: json["total_balance_sum"], | |
lastUpdated: json["last_updated"], | |
); |
"balances": balances.map((e) => e.jsonMap()), | ||
"total_items": totalItems, | ||
"total_balances_sum": totalBalancesSum, | ||
"lastUpdated": lastUpdated, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"lastUpdated": lastUpdated, | |
"last_updated": lastUpdated, |
Balance({ | ||
required this.address, | ||
required this.balance, | ||
required this.level, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the variable is label, and needs to be updated in the json methods as well
required this.level, | |
required this.label, |
|
||
factory NetworkReputation.fromJson(Map<String, dynamic> json) => | ||
NetworkReputation( | ||
reputations: json["reputation"].map((e) => Reputation.fromJson(e)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reputations: json["reputation"].map((e) => Reputation.fromJson(e)), | |
reputations: List<Reputation>.from(json["reputation"].map((e) => Reputation.fromJson(e))), |
factory Reputation.fromJson(Map<String, dynamic> json) => Reputation( | ||
address: json["address"], | ||
reputation: json["reputation"], | ||
eligibility: json["eligility"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eligibility: json["eligility"], | |
eligibility: json["eligibility"], |
final List<BlockchainInfo> blockchain; | ||
|
||
factory Blockchain.fromJson(Map<String, dynamic> data) { | ||
return Blockchain( | ||
blockchain: List<BlockchainInfo>.from( | ||
data['blockchain'].map((e) => BlockchainInfo.fromList(e)))); | ||
data['blockchain'].map((e) => BlockchainInfo.fromJson(e))), | ||
reverted: data["reverted"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted: data["reverted"], | |
reverted: List<int>.from(data["reverted"]), |
try { | ||
return Status.fromJson(await client.get(api('status'))); | ||
PaginatedRequest<dynamic> result = await client.get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reputation endpoint is not Paginated
https://witscan.xyz/api/documentation#get-/api/network/reputation
close #51