getOrderStatus method
Get the order status by pool id poolId and order id orderId
Implementation
Future<Order?> getOrderStatus({
required String poolId,
required int orderId,
String? accountCap
}) async {
accountCap ??= this.accountCap;
final txb = TransactionBlock();
final cap = _checkAccountCap(accountCap);
final typeArgs = await getPoolTypeArgs(poolId);
txb.moveCall(
"$PACKAGE_ID::$MODULE_CLOB::get_order_status",
typeArguments: typeArgs,
arguments: [txb.object(poolId), txb.pureInt(orderId), txb.object(cap)],
);
final results = (
await suiClient.devInspectTransactionBlock(
currentAddress,
txb,
)
).results;
if (results == null || results.isEmpty) {
return null;
}
final returnValues = results[0].returnValues![0][0] as List;
final order = deepbookBCS.de('Order', Uint8List.fromList(returnValues.cast<int>()));
return Order.fromJson(order);
}