Function openPool

  • Build a transaction to open a pool,

    Parameters

    • __namedParameters: {
          chainId: CHAIN_IDS;
          userAddress: `0x${string}`;
          tokenA: `0x${string}`;
          tokenB: `0x${string}`;
          salt: `0x${string}`;
          options?: DefaultOptions & {
              gasLimit?: bigint;
              gasPriceLimit?: bigint;
          } & {
              useSubgraph?: boolean;
          };
      }
      • chainId: CHAIN_IDS
      • userAddress: `0x${string}`
      • tokenA: `0x${string}`
      • tokenB: `0x${string}`
      • salt: `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 { openPool } from '@clober/v2-sdk'

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