mintExactQuantity function

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

Mint an exact live position quantity against this expiry market.

Requires the running package version to be at or above the protocol version watermark, per-market mint pause to be off, trading globally enabled, valid owner or authorized-app account auth, a market-bound live Pricer, and enough expiry cash to back the post-mint max payout. Mint fees are paid by routing a withdraw through the loaded account. The position's strike range is the tick pair (lower_tick, higher_tick] (lower_tick = 0 is -inf, higher_tick = pos_inf_tick is +inf); the SDK converts raw strikes to ticks. max_cost caps the all-in USDC withdrawal, while max_probability caps the quoted per-contract probability before fees. Callers can pass std::u64::max_value!() for either uncapped guard. Returns the minted order ID for future order-scoped flows.

Implementation

MoveCallBuilder mintExactQuantity(
    {dynamic arguments, String? package, Map<String, dynamic>? config}) {
  final packageAddress = package ??
      (config?['predictPackageId'] as String?) ??
      '@local-pkg/deepbook_predict';
  return (tx) => tx.moveCall(
        '$packageAddress::expiry_market::mint_exact_quantity',
        arguments: normalizeMoveArguments(
            tx,
            withConfigDefaults(
                arguments, config, const {'config': 'protocolConfig'}),
            [
              null,
              null,
              null,
              null,
              null,
              'u64',
              'u64',
              'u64',
              'u64',
              'u64',
              '0x2::accumulator::AccumulatorRoot',
              '0x2::clock::Clock'
            ],
            [
              'market',
              'wrapper',
              'auth',
              'config',
              'pricer',
              'lowerTick',
              'higherTick',
              'quantity',
              'maxCost',
              'maxProbability'
            ]),
      );
}