LiquidityPoolResponse.fromJson constructor
LiquidityPoolResponse.fromJson(
- Map<String, dynamic> json
)
Implementation
factory LiquidityPoolResponse.fromJson(Map<String, dynamic> json) =>
LiquidityPoolResponse(
poolId: json['id'],
fee: json['fee_bp'] == null
? throw Exception("fee is null in horizon response")
: convertInt(json['fee_bp'])!,
type: json['type'],
totalTrustlines: json['total_trustlines'],
totalShares: json['total_shares'],
reserves: json['reserves'] != null
? List<ReserveResponse>.from(json['reserves'].map((e) => e == null
? throw Exception("reserve null in horizon response")
: ReserveResponse.fromJson(e)))
: throw Exception("reserves are null in horizon response"),
pagingToken: json['paging_token'],
links: json['_links'] == null
? throw Exception("links are null in horizon response")
: LiquidityPoolResponseLinks.fromJson(json['_links']));