Function limitOrder

  • Places a limit order on the specified chain for trading tokens.

    Parameters

    • __namedParameters: {
          chainId: CHAIN_IDS;
          userAddress: `0x${string}`;
          inputToken: `0x${string}`;
          outputToken: `0x${string}`;
          amount: string;
          price: string;
          options?: {
              erc20PermitParam?: ERC20PermitParam;
              postOnly?: boolean;
              makeTick?: bigint;
              takeLimitTick?: bigint;
              roundingUpMakeBid?: boolean;
              roundingDownMakeAsk?: boolean;
              roundingDownTakenBid?: boolean;
              roundingUpTakenAsk?: boolean;
              useSubgraph?: boolean;
          } & DefaultOptions & {
              gasLimit?: bigint;
              gasPriceLimit?: bigint;
          };
      }
      • chainId: CHAIN_IDS
      • userAddress: `0x${string}`
      • inputToken: `0x${string}`
      • outputToken: `0x${string}`
      • amount: string
      • price: string
      • Optional options?: {
            erc20PermitParam?: ERC20PermitParam;
            postOnly?: boolean;
            makeTick?: bigint;
            takeLimitTick?: bigint;
            roundingUpMakeBid?: boolean;
            roundingDownMakeAsk?: boolean;
            roundingDownTakenBid?: boolean;
            roundingUpTakenAsk?: boolean;
            useSubgraph?: boolean;
        } & DefaultOptions & {
            gasLimit?: bigint;
            gasPriceLimit?: bigint;
        }

    Returns Promise<{
        transaction: Transaction;
        result: {
            make: CurrencyFlow & {
                price: string;
            };
            taken: CurrencyFlow & {
                events: {
                    price: string;
                    amount: string;
                }[];
            };
            spent: CurrencyFlow & {
                events: {
                    price: string;
                    amount: string;
                }[];
            };
        };
    }>