setNoTradeWindowMs function

MoveCallBuilder setNoTradeWindowMs({
  1. dynamic arguments,
  2. String? package,
  3. Map<String, dynamic>? config,
})

Set the window before expiry in which live quotes, mints, and live redeems abort. 0 disables the block. Read live at trade time, so a change applies to markets already trading and stays available as an incident control.

Deliberately not gated on assert_not_valuation_in_progress, matching set_trading_paused: a stalled flush must not be able to trap a safety control. Nothing in the flush reads this value, so a mid-valuation change cannot skew a frozen mark.

Implementation

MoveCallBuilder setNoTradeWindowMs(
    {dynamic arguments, String? package, Map<String, dynamic>? config}) {
  final packageAddress = package ??
      (config?['predictPackageId'] as String?) ??
      '@local-pkg/deepbook_predict';
  return (tx) => tx.moveCall(
        '$packageAddress::protocol_config::set_no_trade_window_ms',
        arguments: normalizeMoveArguments(
            tx,
            withConfigDefaults(
                arguments, config, const {'config': 'protocolConfig'}),
            [null, null, 'u64', '0x2::clock::Clock'],
            ['config', 'AdminCap', 'value']),
      );
}