mintExactAmount function

MoveCallBuilder mintExactAmount(
  1. GeneratedConfig config, {
  2. required String expiryMarketId,
  3. required String wrapperId,
  4. required BigInt lowerTick,
  5. required BigInt higherTick,
  6. required BigInt maxPremiumRaw,
  7. required BigInt minQuantityRaw,
  8. BigInt? maxCostRaw,
  9. required MarketFeeds feeds,
})

Mint by spending up to maxPremiumRaw (raw quote units), enforcing a minQuantityRaw floor on the position received and a maxCostRaw all-in ceiling, returning the new order id (u256). Command order is pricer → auth → mint. Deployed sig mint_exact_amount.

Implementation

MoveCallBuilder mintExactAmount(
  GeneratedConfig config, {
  required String expiryMarketId,
  required String wrapperId,
  required BigInt lowerTick,
  required BigInt higherTick,
  required BigInt maxPremiumRaw,
  required BigInt minQuantityRaw,
  BigInt? maxCostRaw,
  required MarketFeeds feeds,
}) {
  return _liveTrade(
      config,
      expiryMarketId,
      feeds,
      (pricer) => withAuth(
          config,
          (auth) => expiry_market.mintExactAmount(
                config: config,
                arguments: {
                  'market': expiryMarketId,
                  'wrapper': wrapperId,
                  'auth': auth,
                  'pricer': pricer,
                  'lowerTick': lowerTick,
                  'higherTick': higherTick,
                  'maxPremium': maxPremiumRaw,
                  'minQuantity': minQuantityRaw,
                  'maxCost': maxCostRaw ?? U64_MAX,
                },
              )));
}