import { BigDecimalish } from '@nadohq/utils'; import { Hex } from 'viem'; import { EIP712BurnNlpParams, EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712OrderParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams } from './signatureParamTypes.js'; import '../common/types/subaccountTypes.js'; import '../common/types/bytes.js'; type WithEIP712Sender = Omit & { sender: Hex; }; type EIP712WithdrawCollateralValues = WithEIP712Sender; type EIP712LiquidateSubaccountValues = Omit, 'liquidateeOwner' | 'liquidateeName'> & { liquidatee: string; }; type EIP712OrderValues = Omit, 'price'> & { priceX18: BigDecimalish; }; type EIP712IsolatedOrderValues = EIP712OrderValues & { margin: BigDecimalish; }; type EIP712ListTriggerOrdersValues = WithEIP712Sender; type EIP712OrderCancellationValues = WithEIP712Sender; type EIP712ProductOrdersCancellationValues = WithEIP712Sender; type EIP712LinkSignerValues = WithEIP712Sender; type EIP712TransferQuoteValues = Omit, 'recipientSubaccountName'> & { recipient: string; }; type EIP712LeaderboardAuthenticationValues = WithEIP712Sender; type EIP712MintNlpValues = WithEIP712Sender; type EIP712BurnNlpValues = WithEIP712Sender; /** * All possible requests to be signed, to the EIP712 value interface */ interface SignableRequestTypeToEIP712Values { burn_nlp: EIP712BurnNlpValues; cancel_orders: EIP712OrderCancellationValues; cancel_product_orders: EIP712ProductOrdersCancellationValues; leaderboard_authentication: EIP712LeaderboardAuthenticationValues; link_signer: EIP712LinkSignerValues; liquidate_subaccount: EIP712LiquidateSubaccountValues; list_trigger_orders: EIP712ListTriggerOrdersValues; mint_nlp: EIP712MintNlpValues; place_isolated_order: EIP712IsolatedOrderValues; place_order: EIP712OrderValues; transfer_quote: EIP712TransferQuoteValues; withdraw_collateral: EIP712WithdrawCollateralValues; } export type { EIP712BurnNlpValues, EIP712IsolatedOrderValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values };