withdrawPlp method

Transaction withdrawPlp(
  1. String owner,
  2. BigInt shares, [
  3. PlpWithdrawOptions options = const PlpWithdrawOptions()
])

Queue a withdraw request pulling shares (raw PLP u64) from account custody into queue escrow — the Move parameter is named amount, but on request_withdraw it counts PLP SHARES, not USDC. Auto-settles flush-delivered PLP first; the USDC fill lands on the account at the next flush (no withdraw_settled entrypoint). Command order is auth → request. The minUsdcOut slot is the per-request floor on USDC paid at flush — PlpWithdrawOptions.minUsdcOut when given, otherwise 0 (no floor). At the shipped attempt count of one, the first flush whose mark quotes less cancels and refunds the request; three is the configurable maximum, not the default.

Implementation

Transaction withdrawPlp(String owner, BigInt shares,
    [PlpWithdrawOptions options = const PlpWithdrawOptions()]) {
  final minUsdcOut = options.minUsdcOut;
  return _txOf(authed.requestWithdraw(
    config: _c._config,
    wrapper: _c.wrapperIdFor(owner),
    amount: shares,
    minUsdcOut: minUsdcOut == null ? BigInt.zero : usdcToRaw(minUsdcOut),
  ));
}