getLiquidityValue

function getLiquidityValue(
    address _tokenA,
    address _tokenB,
    uint256 _liquidityAmount
) external view returns (
    uint256 tokenAAmount,
    uint256 tokenBAmount
)

μœ λ™μ„± ν’€ Token을 톡해 각 ν† ν°μ˜ 개수λ₯Ό 얻을 λ•Œ μ‚¬μš©

Parameters

Return Values

Example

// μœ λ™μ„±ν’€μ„ ν†΅ν•œ 토큰 개수 μ–»κΈ°
await ComputeContract.connect(accounts[0]).getLiquidityValue(
    mockToken0Contract.address,
    mockToken1Contract.address,
    1000000
)

// κ²°κ³Ό (토큰A, 토큰B 개수)
[ BigNumber { value: "1414213" }, BigNumber { value: "707106" } ]

2022.12.22

Last updated