constructor(tokenAmountA: CurrencyAmount, tokenAmountB: CurrencyAmount)
The Pair entity represents a SwapX pair with a balance of each of its pair tokens.
Example
import { Pair } from "@swapx/sdk-core";
import { ChainId, Token, CurrencyAmount } from "@swapx/v2-sdk";
const HOT = new Token(
ChainId.MAINNET,
"0xc0FFee0000000000000000000000000000000000",
18,
"HOT",
"Caffeine"
);
const NOT = new Token(
ChainId.MAINNET,
"0xDeCAf00000000000000000000000000000000000",
18,
"NOT",
"Caffeine"
);
const pair = new Pair(
CurrencyAmount.fromRawAmount(HOT, "2000000000000000000"),
CurrencyAmount.fromRawAmount(NOT, "1000000000000000000")
);
Static Methods
getAddress
getAddress(tokenA: Token, tokenB: Token): string
Computes the pair address for the passed Tokens. See Pair Addresses.
Properties
liquidityToken
liquidityToken: Token;
A Token representing the liquidity token for the pair. See Pair (ERC-20).