Function unwrapFromERC20

  • Build a transaction to unwrap a pool from ERC20,

    Parameters

    • __namedParameters: {
          chainId: CHAIN_IDS;
          userAddress: `0x${string}`;
          token0: `0x${string}`;
          token1: `0x${string}`;
          salt: `0x${string}`;
          amount: string;
          options?: DefaultOptions & {
              gasLimit?: bigint;
              gasPriceLimit?: bigint;
          } & {
              useSubgraph?: boolean;
              pool?: Pool;
          };
      }
      • chainId: CHAIN_IDS
      • userAddress: `0x${string}`
      • token0: `0x${string}`
      • token1: `0x${string}`
      • salt: `0x${string}`
      • amount: string
      • Optional options?: DefaultOptions & {
            gasLimit?: bigint;
            gasPriceLimit?: bigint;
        } & {
            useSubgraph?: boolean;
            pool?: Pool;
        }

    Returns Promise<{
        transaction: undefined | Transaction;
        result: undefined | CurrencyFlow;
    }>

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

    Example

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

    const transaction = await unwrapFromERC20({
    chainId: 421614,
    userAddress: '0xF8c1869Ecd4df136693C45EcE1b67f85B6bDaE69',
    token0: '0x00bfd44e79fb7f6dd5887a9426c8ef85a0cd23e0',
    token1: '0x0000000000000000000000000000000000000000',
    salt: '0x0000000000000000000000000000000000000000000000000000000000000000',
    amount: '1.1',
    })