quoteRedeem method
Exact pre-close quote: dry-runs the caller's own redeem and decodes the receipt — the informed close against the floor-less deployed redeem.
Implementation
Future<RedeemQuote> quoteRedeem(
String owner, MarketDescriptor m, CloseOptions opts) async {
final tx = await _c._buildRedeem(owner, m, opts);
final events = await simulateWithEvents(_c._client, tx, owner);
final r = exactlyOne(
decodeRedeems(
_c.cfg, DecodableTransactionResult.fromProtoEvents(events)),
'order-redeemed');
return RedeemQuote(
proceeds: r.proceeds,
gross: r.gross,
fees: r.fees,
quantityClosed: r.quantityClosed,
remaining: r.remaining,
raw: RedeemQuoteRaw(
proceeds: r.raw.proceeds,
gross: r.raw.gross,
quantityClosed: r.raw.quantityClosed,
),
);
}