getExchangeTradePositions static method

Future<List<ExchangeTradePosition>> getExchangeTradePositions(
  1. Wallet wallet
)

Returns the list of all the ExchangeTradePosition that the specified wallet has minted

Implementation

static Future<List<ExchangeTradePosition>> getExchangeTradePositions(
  Wallet wallet,
) async {
  final url = Uri.parse(
    '${wallet.networkInfo.lcdUrl}/commerciomint/etps/${wallet.bech32Address}',
  );
  final response = await Network.queryChain(url) as List;
  return response
      .map((json) => ExchangeTradePosition.fromJson(json))
      .toList();
}