Function openMarket

  • Build a transaction to open a market.

    Parameters

    • __namedParameters: {
          chainId: CHAIN_IDS;
          userAddress: `0x${string}`;
          inputToken: `0x${string}`;
          outputToken: `0x${string}`;
          options?: DefaultOptions & {
              gasLimit?: bigint;
              gasPriceLimit?: bigint;
          } & {
              useSubgraph?: boolean;
          };
      }
      • chainId: CHAIN_IDS
      • userAddress: `0x${string}`
      • inputToken: `0x${string}`
      • outputToken: `0x${string}`
      • Optional options?: DefaultOptions & {
            gasLimit?: bigint;
            gasPriceLimit?: bigint;
        } & {
            useSubgraph?: boolean;
        }

    Returns Promise<undefined | Transaction>

    A Promise resolving to a transaction object. If the market is already open, returns undefined.

    Example

    import { openMarket } from '@clober/v2-sdk'

    const transaction = await openMarket({
    chainId: 421614,
    userAddress: '0xF8c1869Ecd4df136693C45EcE1b67f85B6bDaE69',
    inputToken: '0x00bfd44e79fb7f6dd5887a9426c8ef85a0cd23e0',
    outputToken: '0x0000000000000000000000000000000000000000'
    })