pub fn order_replace_to_derive_payload(
order: &OrderAny,
instrument: &DeriveInstrument,
subaccount_id: u64,
wallet: Address,
signer: &PrivateKeySigner,
nonce: u64,
signature_expiry_sec: i64,
module_address: Address,
domain_separator: B256,
action_typehash: B256,
max_fee: Decimal,
explicit_quantity: Option<Decimal>,
explicit_price: Option<Decimal>,
order_id_to_cancel: &str,
) -> Result<DeriveReplaceParams>Expand description
Builds typed params for a signed private/replace request.
Derive’s replace endpoint atomically cancels a stale order and submits a
new signed order. The new-order half is signed against
TradeModuleData exactly like private/order.
§Errors
Returns an error if the order quantity is quote-denominated, even with explicit_quantity,
the order type or flags are unsupported, the instrument’s base_asset_address cannot be parsed,
decimal scaling fails, a Market order has no explicit_price, or EIP-712 signing fails.