@xfai-labs/sdk

Enumerations

AddressType

Enumeration Members

MemberValue

Account

"account"

INFT

"inft"

Pool

"pool"

Token

"token"


TradeType

Enumeration Members

MemberValue

EXACT_INPUT

0

EXACT_OUTPUT

1

Classes

Xfai

This class contains all the information needed to interact with the Xfai protocol. The provider parameter is used to interact with the Ethereum network using ethers.js.

Constructors

constructor()

new Xfai( provider, chain, swapFee = 2): Xfai

Parameters

ParameterTypeDefault valueDescription

provider

StaticJsonRpcProvider & {_hasWallet: false;} | Web3Provider

undefined

The provider to use for interacting with the Ethereum network.

chain

Chain< number >

undefined

The chain config to use for interacting with the network.

swapFee

number

2

The swap fee

Returns

Xfai

Source

libs/sdk/src/lib/xfai.ts:76

Properties

PropertyTypeDescription

chain

Chain< number >

The chain config to use for interacting with the network.

readonly coreAddress

string

-

readonly factoryAddress

string

-

readonly hasWallet

boolean

-

readonly inftAddress

string

-

readonly inftPeripheryAddress

string

-

readonly multicallAddress

string

-

readonly nativeToken

TokenInfo

-

readonly peripheryAddress

string

-

readonly poolInitCodeHash

string

-

readonly provider

StaticJsonRpcProvider & {_hasWallet: false;} | Web3Provider

The provider to use for interacting with the Ethereum network.

readonly swapFee

BigNumberish

-

readonly topTokenAddresses

string[]

-

readonly underlyingToken

TokenInfo

-

readonly usdc

undefined | TokenInfo

-

readonly wrappedNativeToken

TokenInfo

-

Type Aliases

AccountAddress

AccountAddress: Address< Account >

Source

libs/sdk/src/lib/xfai.ts:48

libs/sdk/src/lib/xfai.ts:49


Address

Address: <T> object

Type parameters

Parameter

T extends AddressType

Type declaration

MemberType

address

string

type

T

Source

libs/sdk/src/lib/xfai.ts:39

libs/sdk/src/lib/xfai.ts:43


BoostOptions

BoostOptions: Omit< TransactionOptions, "slippage" >

Source

libs/sdk/src/lib/periphery/inft/boost.ts:7


Chain

Chain: <T> object

Type parameters

ParameterDefault

T extends number

number

Type declaration

MemberType

readonly addresses

object

addresses.core

string

addresses.factory

string

addresses.inft

string

addresses.inft_periphery

string

addresses.multicall

string

addresses.periphery

string

addresses.pool_hash

string

addresses.token_usdc?

string

addresses.underlying_token

string

backendApi?

string

blockExplorerUrl?

string

readonly chainId

T

cloudflareApiKey?

string

readonly defaultTokenList

TokenList

readonly development

boolean

etherscanApi?

string

readonly label

string

readonly logoUri

string

readonly nativeToken

Omit< TokenInfo, "chainId" | "address" >

readonly rpcUrl

string

topTokenAddresses?

readonly string[]

readonly wrappedNativeToken

Omit< TokenInfo, "chainId" >

Source

libs/sdk/src/lib/xfai.ts:6


INFT

INFT: object

Type declaration

MemberType

id

number

type

"inft_id"

Source

libs/sdk/src/lib/inft/core.ts:5

libs/sdk/src/lib/inft/core.ts:10


INFTBalance

INFTBalance: object

Type declaration

MemberType

amount

BigNumber

harvestedShares

BigNumber

totalShares

BigNumber

Source

libs/sdk/src/lib/inft/balance.ts:8


INFTState

INFTState: object

Type declaration

MemberType

initialReserve

BigNumber

reserve

BigNumber

shares

BigNumber

Source

libs/sdk/src/lib/inft/core.ts:26


LiquidityInAmount

LiquidityInAmount: <P> object

Type parameters

ParameterDefault

P extends Token

Token

Type declaration

MemberType

amount

BigNumber

token

P

Source

libs/sdk/src/lib/periphery/liquidity/add.ts:7


ParsedEthersError

ParsedEthersError: object

Type declaration

MemberType

context

ReturnValue

error

Error

type

"ParsedEthersError"

Source

libs/sdk/src/lib/xfai-core.ts:4


Pool

Pool: Address< Pool >

Source

libs/sdk/src/lib/pool/core.ts:10

libs/sdk/src/lib/pool/core.ts:11


PoolState

PoolState: object

Type declaration

MemberType

ethReserve

BigNumber

reserve

BigNumber

Source

libs/sdk/src/lib/pool/core.ts:18


Quote

Quote: <T> object

Type parameters

Parameter

T extends QuoteBase

Type declaration

MemberType

amount

BigNumber

token

object

token.state

PoolState

token.token

Token

type

T

Source

libs/sdk/src/lib/pool/quote.ts:20


QuoteBase

QuoteBase: "ETH" | "Token"

Source

libs/sdk/src/lib/pool/quote.ts:6


QuoteResult

QuoteResult: <T> T extends "Token" ? {ethIn: BigNumber; tokenIn: BigNumber | undefined; xfAmount: BigNumber;} : {ethIn: BigNumber | undefined; tokenIn: BigNumber; xfAmount: BigNumber;}

Type parameters

Parameter

T extends QuoteBase

Source

libs/sdk/src/lib/pool/quote.ts:8


StakeOptions

StakeOptions: Omit< TransactionOptions, "slippage" >

Source

libs/sdk/src/lib/periphery/inft/stake.ts:8


SupportedChainIds

SupportedChainIds: keyof typeof Chains

Source

libs/sdk/src/chains/index.ts:11

libs/sdk/src/chains/index.ts:12


SwapAmount

SwapAmount: object

Type declaration

MemberType

amount

BigNumber

priceImpact

number

Source

libs/sdk/src/lib/pool/swap-amounts.ts:14


TargetTokenAmount

TargetTokenAmount: object

Type declaration

MemberType

desiredAmount

BigNumber

token

Token

Source

libs/sdk/src/lib/periphery/liquidity/remove.ts:7


Token

Token: Address< Token > | Pick< TokenInfo, "address" | "decimals" >

Source

libs/sdk/src/lib/xfai-token.ts:9

libs/sdk/src/lib/xfai-token.ts:11


TransactionOptions

TransactionOptions: object

Type declaration

MemberType

deadline

Date

from

Signer

gasLimit?

BigNumber

slippage

BigNumberish

to?

Signer | string

Source

libs/sdk/src/lib/periphery/core.ts:12

Variables

BASISPOINT_MAX

const BASISPOINT_MAX: BigNumber

A utility module for handling basis points and converting them to percentages.

Source

libs/sdk/src/lib/xfai-utils.ts:13


Chains

const Chains: object

Type declaration

MemberType

readonly 5777

Chain< 5777 >

readonly 59140

Chain< 59140 >

readonly 59144

Chain< 59144 >

Source

libs/sdk/src/chains/index.ts:6


Mainnet

const Mainnet: Chain< 59144 > = LINEA_NETWORK

Source

libs/sdk/src/chains/index.ts:5


NATIVE_TOKEN_ADDRESS

const NATIVE_TOKEN_ADDRESS: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'

Source

libs/sdk/src/chains/core.ts:1


PERMILLE_MAX

const PERMILLE_MAX: BigNumber

A utility module for working with permille values, which represent one-tenth of a percentage point.

Source

libs/sdk/src/lib/xfai-utils.ts:41


SupportedChainIds

const SupportedChainIds: (5777 | 59144 | 59140)[]

Source

libs/sdk/src/chains/index.ts:11

libs/sdk/src/chains/index.ts:12

Functions

AccountAddress()

AccountAddress(address): AccountAddress

Parameters

ParameterType

address

string

Returns

AccountAddress

Source

libs/sdk/src/lib/xfai.ts:49


Address()

Address<T>(type, address): Address< T >

Type parameters

Parameter

T extends AddressType

Parameters

ParameterType

type

T

address

string

Returns

Address< T >

Source

libs/sdk/src/lib/xfai.ts:43


INFT()

INFT(id): INFT

Parameters

ParameterType

id

number

Returns

INFT

Source

libs/sdk/src/lib/inft/core.ts:10


Pool()

Pool(address): Pool

Parameters

ParameterType

address

string

Returns

Pool

Source

libs/sdk/src/lib/pool/core.ts:11


Token()

Token(address): Token

Parameters

ParameterType

address

string

Returns

Token

Source

libs/sdk/src/lib/xfai-token.ts:11


addLiquidity()

addLiquidity<P>( xfai, ethAmount, target, options): Promise< PopulatedTransaction >

Add liquidity to a pool, in case you're providing single sided ETH, supplementary should be undefined

Type parameters

ParameterDefault

P extends Token

Token

Parameters

ParameterType

xfai

Xfai

ethAmount

BigNumber

target

LiquidityInAmount< P >

options

TransactionOptions

Returns

Promise< PopulatedTransaction >

Source

libs/sdk/src/lib/periphery/liquidity/add.ts:15


addSwapFee()

addSwapFee(xfai, amount): BigNumber

Parameters

ParameterType

xfai

number | Xfai

amount

BigNumber

Returns

BigNumber

Source

libs/sdk/src/lib/pool/core.ts:94


basisPointToPercent()

basisPointToPercent(value): number

Converts a basis point value to its equivalent percentage value.

Parameters

ParameterTypeDescription

value

BigNumber

The basis point value to be converted, as a BigNumber.

Returns

number

The equivalent percentage value.

Source

libs/sdk/src/lib/xfai-utils.ts:20


boostToken()

boostToken( xfai, inft, amountIn, minShare, options): Promise< PopulatedTransaction >

Parameters

ParameterType

xfai

Xfai

inft

INFT

amountIn

BigNumber

minShare

BigNumber

options

BoostOptions

Returns

Promise< PopulatedTransaction >

Source

libs/sdk/src/lib/periphery/inft/boost.ts:9


calculateDeadline()

calculateDeadline(param0): string

Convert the date object to unix timestamp

Parameters

ParameterTypeDescription

param0

object

param0.deadline

Date

-

Returns

string

unix timestamp

Source

libs/sdk/src/lib/xfai-utils.ts:62


calculatePriceImpact()

calculatePriceImpact(input, output): number

Parameters

ParameterType

input

BigNumber

output

BigNumber

Returns

number

Source

libs/sdk/src/lib/xfai-utils.ts:217


calculateShare()

calculateShare(inftState, input): BigNumber

Parameters

ParameterType

inftState

INFTState

input

BigNumber

Returns

BigNumber

Source

libs/sdk/src/lib/inft/core.ts:60


calculateSwapFee()

calculateSwapFee(xfai, amount): BigNumber

Parameters

ParameterType

xfai

number | Xfai

amount

BigNumber

Returns

BigNumber

Source

libs/sdk/src/lib/pool/core.ts:85


delayMs()

delayMs(ms): Promise< unknown >

Parameters

ParameterType

ms

number

Returns

Promise< unknown >

Source

libs/sdk/src/lib/xfai-utils.ts:166


deriveToAddress()

deriveToAddress(__namedParameters): Promise< string >

Parameters

ParameterType

__namedParameters

Pick< TransactionOptions, "from" | "to" >

Returns

Promise< string >

Source

libs/sdk/src/lib/periphery/core.ts:20


getAdjustedAmountInput()

getAdjustedAmountInput(pool, ethOut): BigNumber

Returns the amount of token that's needed to get the desired eth reserve out

Parameters

ParameterTypeDescription

pool

PoolState

ethOut

BigNumber

Returns

BigNumber

amountIn

Source

libs/sdk/src/lib/xfai-utils.ts:102


getAdjustedAmountOutput()

getAdjustedAmountOutput(pool, ethIn): BigNumber

Parameters

ParameterTypeDescription

pool

PoolState

ethIn

BigNumber

-

Returns

BigNumber

amountOut

Source

libs/sdk/src/lib/xfai-utils.ts:143


getAdjustedEthInput()

getAdjustedEthInput(pool, amountOut): BigNumber

Returns the xf that's needed to get the desired token amount out

Parameters

ParameterTypeDescription

pool

PoolState

amountOut

BigNumber

Returns

BigNumber

xfIn

Source

libs/sdk/src/lib/xfai-utils.ts:118


getAdjustedEthOutput()

getAdjustedEthOutput(pool, amountIn): BigNumber

Returns the eth reserve out for the token amount in

Parameters

ParameterTypeDescription

pool

PoolState

amountIn

BigNumber

Returns

BigNumber

xfOut

Source

libs/sdk/src/lib/xfai-utils.ts:133


getCore()

getCore(xfai): IXfaiV0Core

Parameters

ParameterType

xfai

Xfai

Returns

IXfaiV0Core

Source

libs/sdk/src/lib/xfai-core.ts:10


getFactory()

getFactory(xfai): IXfaiFactory

Parameters

ParameterType

xfai

Xfai

Returns

IXfaiFactory

Source

libs/sdk/src/lib/factory.ts:4


getINFT()

getINFT(xfai, signer = false): IXfaiINFT

Parameters

ParameterTypeDefault value

xfai

Xfai

undefined

signer

boolean

false

Returns

IXfaiINFT

Source

libs/sdk/src/lib/inft/core.ts:32


getINFTBalance()

getINFTBalance(xfai, account): Promise< number >

Parameters

ParameterType

xfai

Xfai

account

AccountAddress

Returns

Promise< number >

Source

libs/sdk/src/lib/inft/balance.ts:14


getINFTOwnership()

getINFTOwnership(xfai, inft): Promise< {owner: string;} >

Parameters

ParameterType

xfai

Xfai

inft

INFT

Returns

Promise< {owner: string;} >

Source

libs/sdk/src/lib/inft/core.ts:39


getINFTPeriphery()

getINFTPeriphery(xfai, signer): IInfinityNFTPeriphery

Parameters

ParameterType

xfai

Xfai

signer

Signer

Returns

IInfinityNFTPeriphery

Source

libs/sdk/src/lib/periphery/core.ts:8


getINFTPeripheryAllowance()

getINFTPeripheryAllowance( xfai, wallet, token): BigNumber | Promise< BigNumber >

Parameters

ParameterType

xfai

Xfai

wallet

Wallet | AccountAddress

token

Token | Pool

Returns

BigNumber | Promise< BigNumber >

Source

libs/sdk/src/lib/xfai-token.ts:94


getINFTState()

getINFTState(xfai, options): Promise< INFTState >

Parameters

ParameterType

xfai

Xfai

options

CallOverrides

Returns

Promise< INFTState >

Source

libs/sdk/src/lib/inft/core.ts:50


getINFTTokenBalance()

getINFTTokenBalance( xfai, inft, token): Promise< INFTBalance >

Parameters

ParameterType

xfai

Xfai

inft

INFT

token

Token

Returns

Promise< INFTBalance >

Source

libs/sdk/src/lib/inft/balance.ts:18


getINFTTokenBalanceMulticall()

getINFTTokenBalanceMulticall<T>( xfai, inft, tokens, allowFailure): Promise< Record< Token["address"], T extends true ? undefined | INFTBalance : INFTBalance > >

Type parameters

Parameter

T extends boolean

Parameters

ParameterType

xfai

Xfai

inft

INFT

tokens

Token[]

allowFailure

T

Returns

Promise< Record< Token["address"], T extends true ? undefined | INFTBalance : INFTBalance > >

Source

libs/sdk/src/lib/inft/balance.ts:31


getINFTsForOwner()

getINFTsForOwner( xfai, owner, balance): Promise< Record< string | number, BigNumber > >

Parameters

ParameterType

xfai

Xfai

owner

AccountAddress

balance

number

Returns

Promise< Record< string | number, BigNumber > >

Source

libs/sdk/src/lib/inft/balance.ts:67


getInftImage()

getInftImage(inft, quality?): string

Parameters

ParameterType

inft

INFT

quality?

"md" | "sm" | "lg"

Returns

string

Source

libs/sdk/src/lib/inft/core.ts:17


getOraclePrice()

getOraclePrice(xfai, token): Promise< BigNumber >

Parameters

ParameterType

xfai

Xfai

token

TokenInfo

Returns

Promise< BigNumber >

Source

libs/sdk/src/lib/xfai-token.ts:150


getPeriphery()

getPeriphery(xfai, signer): IXfaiV0Periphery03

Parameters

ParameterType

xfai

Xfai

signer

Signer

Returns

IXfaiV0Periphery03

Source

libs/sdk/src/lib/periphery/core.ts:4


getPeripheryAllowance()

getPeripheryAllowance( xfai, wallet, token): BigNumber | Promise< BigNumber >

Parameters

ParameterType

xfai

Xfai

wallet

Wallet | AccountAddress

token

Token | Pool

Returns

BigNumber | Promise< BigNumber >

Source

libs/sdk/src/lib/xfai-token.ts:84


getPool()

getPool(xfai, pool): IXfaiPool

Parameters

ParameterType

xfai

Xfai

pool

Pool

Returns

IXfaiPool

Source

libs/sdk/src/lib/pool/core.ts:23


getPoolBalance()

getPoolBalance( xfai, wallet, token): Promise< BigNumber >

Parameters

ParameterType

xfai

Xfai

wallet

Wallet | {address: string;}

token

Token

Returns

Promise< BigNumber >

Source

libs/sdk/src/lib/pool/balance.ts:6


getPoolBalanceMulticall()

getPoolBalanceMulticall( xfai, wallet, tokens): Promise< Record< string, BigNumber | undefined > >

Parameters

ParameterType

xfai

Xfai

wallet

Wallet | {address: string;}

tokens

Token[]

Returns

Promise< Record< string, BigNumber | undefined > >

Source

libs/sdk/src/lib/pool/multicall.ts:8


getPoolFromToken()

getPoolFromToken(xfai, token): Pool

Parameters

ParameterType

xfai

Xfai

token

Token

Returns

Pool

Source

libs/sdk/src/lib/pool/core.ts:35


getPoolFromTokenAddress()

getPoolFromTokenAddress(xfai, token): IXfaiPool

Parameters

ParameterType

xfai

Xfai

token

Token

Returns

IXfaiPool

Source

libs/sdk/src/lib/pool/core.ts:27


getPoolLiquidityMulticall()

getPoolLiquidityMulticall(xfai, tokens): Promise< Record< string | number, undefined | BigNumber > >

Parameters

ParameterType

xfai

Xfai

tokens

Token[]

Returns

Promise< Record< string | number, undefined | BigNumber > >

Source

libs/sdk/src/lib/pool/multicall.ts:42


getPoolNameForTokenAddress()

getPoolNameForTokenAddress(xfai, token): Promise< string >

Parameters

ParameterType

xfai

Xfai

token

Token

Returns

Promise< string >

Source

libs/sdk/src/lib/pool/core.ts:31


getPoolState()

getPoolState( xfai, pool, options = {}): Promise< PoolState >

Parameters

ParameterType

xfai

Xfai

pool

Pool

options

CallOverrides

Returns

Promise< PoolState >

Source

libs/sdk/src/lib/pool/core.ts:45


getPoolStateMulticall()

getPoolStateMulticall(xfai, poolsOrTokens): Promise< {} >

Parameters

ParameterType

xfai

Xfai

poolsOrTokens

Token[] | Pool[]

Returns

Promise< {} >

Source

libs/sdk/src/lib/pool/core.ts:53


getPoolSupply()

getPoolSupply(xfai, token): Promise< BigNumber >

Parameters

ParameterType

xfai

Xfai

token

Token

Returns

Promise< BigNumber >

Source

libs/sdk/src/lib/pool/balance.ts:18


getPoolTokenBalance()

getPoolTokenBalance(xfai, token): Promise< BigNumber >

Parameters

ParameterType

xfai

Xfai

token

Token

Returns

Promise< BigNumber >

Source

libs/sdk/src/lib/pool/balance.ts:14


getPoolTokenBalanceMulticall()

getPoolTokenBalanceMulticall(xfai, tokens): Promise< Record< string | number, undefined | BigNumber > >

Parameters

ParameterType

xfai

Xfai

tokens

Token[]

Returns

Promise< Record< string | number, undefined | BigNumber > >

Source

libs/sdk/src/lib/pool/multicall.ts:27


getSpotAmount()

getSpotAmount(pool, ethIn): BigNumber

Return the amount out for a given xf In

Parameters

ParameterTypeDescription

pool

PoolState

ethIn

BigNumber

Returns

BigNumber

amountIn

Source

libs/sdk/src/lib/xfai-utils.ts:79


getSpotEth()

getSpotEth(pool, amountIn): BigNumber

Return the xf out for a given amount in

Parameters

ParameterTypeDescription

pool

PoolState

amountIn

BigNumber

Returns

BigNumber

xfOut

Source

libs/sdk/src/lib/xfai-utils.ts:92


getSwapAmounts()

getSwapAmounts<T, P>( xfai, tradeType, tokenIn, tokenOut, amount): SwapAmount

Type parameters

ParameterDefault

T extends TradeType

-

P extends undefined | PoolState

undefined | PoolState

Parameters

ParameterType

xfai

Xfai

tradeType

T

tokenIn

object

tokenIn.state

P

tokenIn.token

Token

tokenOut

object

tokenOut.state

P extends undefined ? PoolState : undefined | PoolState

tokenOut.token

Token

amount

BigNumber

Returns

SwapAmount

Source

libs/sdk/src/lib/pool/swap-amounts.ts:126


getSwapInputAmount()

getSwapInputAmount<P>( xfai, tokenIn, tokenOut, outputAmount): SwapAmount

Returns the amount of tokenIn needed for swapping tokenOutAmount of tokenIn

Type parameters

ParameterDefault

P extends undefined | PoolState

undefined | PoolState

Parameters

ParameterType

xfai

Xfai

tokenIn

object

tokenIn.state

P

tokenIn.token

Token

tokenOut

object

tokenOut.state

P extends undefined ? PoolState : undefined | PoolState

tokenOut.token

Token

outputAmount

BigNumber

Returns

SwapAmount

tokenInInput

Source

libs/sdk/src/lib/pool/swap-amounts.ts:79


getSwapOutputAmount()

getSwapOutputAmount<P>( xfai, tokenIn, tokenOut, inputAmount): SwapAmount

Returns the amount of tokenOut after swapping tokenInAmount of tokenIn

Type parameters

ParameterDefault

P extends undefined | PoolState

undefined | PoolState

Parameters

ParameterTypeDescription

xfai

Xfai

-

tokenIn

object

-

tokenIn.state

P

-

tokenIn.token

Token

-

tokenOut

object

-

tokenOut.state

P extends undefined ? PoolState : undefined | PoolState

-

tokenOut.token

Token

-

inputAmount

BigNumber

Returns

SwapAmount

tokenOutAmount

Source

libs/sdk/src/lib/pool/swap-amounts.ts:26


getToken()

getToken(xfai, token): IERC20Metadata

Parameters

ParameterType

xfai

Xfai

token

Token | Pool

Returns

IERC20Metadata

Source

libs/sdk/src/lib/xfai-token.ts:25


getTokenBalance()

getTokenBalance( xfai, wallet, token): Promise< BigNumber >

Parameters

ParameterType

xfai

Xfai

wallet

Wallet | AccountAddress

token

Token

Returns

Promise< BigNumber >

Source

libs/sdk/src/lib/xfai-token.ts:28


getTokenBalanceMulticall()

getTokenBalanceMulticall( xfai, wallet, tokens): Promise< Record< Token["address"], BigNumber | undefined > >

Parameters

ParameterType

xfai

Xfai

wallet

Wallet | {address: string;}

tokens

Token[]

Returns

Promise< Record< Token["address"], BigNumber | undefined > >

Source

libs/sdk/src/lib/xfai-token.ts:39


getTokenDetails()

getTokenDetails(xfai, token): Promise< TokenInfo >

Parameters

ParameterType

xfai

Xfai

token

Token

Returns

Promise< TokenInfo >

Source

libs/sdk/src/lib/xfai-token.ts:105


getTransactionGasCost()

getTransactionGasCost(tx): undefined | BigNumber

Tries to estimate the gas limit for a TransactionReceipt or ContractTransaction

Parameters

ParameterTypeDescription

tx

ContractTransaction | TransactionReceipt

TransactionReceipt | ContractTransaction

Returns

undefined | BigNumber

BigNumber | undefined

Source

libs/sdk/src/lib/xfai-utils.ts:201


handleNativeToken()

handleNativeToken(xfai, token): Token | Pool

Parameters

ParameterType

xfai

Xfai

token

Token | Pool

Returns

Token | Pool

Source

libs/sdk/src/lib/xfai-token.ts:143


harvestINFT()

harvestINFT( xfai, inft, token, amountOut): Promise< PopulatedTransaction >

Parameters

ParameterType

xfai

Xfai

inft

INFT

token

Token

amountOut

BigNumber

Returns

Promise< PopulatedTransaction >

Source

libs/sdk/src/lib/periphery/inft/harvest.ts:6


harvestInftErc20()

harvestInftErc20( xfai, inft, token, amountOut): Promise< PopulatedTransaction >

Parameters

ParameterType

xfai

Xfai

inft

INFT

token

Token

amountOut

BigNumber

Returns

Promise< PopulatedTransaction >

Source

libs/sdk/src/lib/periphery/inft/harvest.ts:23


harvestInftEth()

harvestInftEth( xfai, inft, amountOut): Promise< PopulatedTransaction >

Parameters

ParameterType

xfai

Xfai

inft

INFT

amountOut

BigNumber

Returns

Promise< PopulatedTransaction >

Source

libs/sdk/src/lib/periphery/inft/harvest.ts:18


isNativeToken()

isNativeToken(token): boolean

Parameters

ParameterType

token

undefined | Token | Pool

Returns

boolean

Source

libs/sdk/src/lib/xfai-token.ts:22


isParsedEthersError()

isParsedEthersError(error): error is ParsedEthersError

Parameters

ParameterType

error

unknown

Returns

error is ParsedEthersError

Source

libs/sdk/src/lib/xfai-core.ts:14


isSharedToken()

isSharedToken(xfai, token): boolean

Parameters

ParameterType

xfai

Xfai

token

undefined | Token | Pool

Returns

boolean

Source

libs/sdk/src/lib/xfai-token.ts:19


isUnderlyingToken()

isUnderlyingToken(xfai, token): boolean

Parameters

ParameterType

xfai

Xfai

token

Token

Returns

boolean

Source

libs/sdk/src/lib/xfai-token.ts:13


isWrappedNativeToken()

isWrappedNativeToken(xfai, token): boolean

Parameters

ParameterType

xfai

Xfai

token

undefined | Token | Pool

Returns

boolean

Source

libs/sdk/src/lib/xfai-token.ts:16


max()

max(a, b): BigNumber

Parameters

ParameterType

a

BigNumber

b

BigNumber

Returns

BigNumber

Source

libs/sdk/src/lib/xfai-utils.ts:69


min()

min(a, b): BigNumber

Parameters

ParameterType

a

BigNumber

b

BigNumber

Returns

BigNumber

Source

libs/sdk/src/lib/xfai-utils.ts:65


multicall()

multicall<T, B, F>( xfai, contract, calls, options?): Promise< Record< string | number, B extends true ? undefined | Awaited< ReturnType< ReturnType< T["connect"] >["callStatic"][F] > > : Awaited< ReturnType< ReturnType< T["connect"] >["callStatic"][F] > > > >

Type parameters

Parameter

T extends Factory< BaseContract >

B extends boolean

F extends string

Parameters

ParameterType

xfai

Xfai

contract

T

calls

CallArg< T, F >[]

options?

object

options.allowFailure?

B

options.callOverrides?

Overrides

options.key?

(arg, index) => string | number | Promise< string | number >

Returns

Promise< Record< string | number, B extends true ? undefined | Awaited< ReturnType< ReturnType< T["connect"] >["callStatic"][F] > > : Awaited< ReturnType< ReturnType< T["connect"] >["callStatic"][F] > > > >

Source

libs/sdk/src/lib/multicall.ts:19


negativeSlippage()

negativeSlippage(amount, slippage): BigNumber

Decreases the amount by the provided slippage (100 - 1% slippage) = (99)

Parameters

ParameterTypeDescription

amount

BigNumber

slippage

BigNumberish

Returns

BigNumber

amount with negative slippage

Source

libs/sdk/src/lib/xfai-utils.ts:152


positiveSlippage()

positiveSlippage(amount, slippage): BigNumber

Increases the amount by the provided slippage (100 + 1% slippage) = (101)

Parameters

ParameterTypeDescription

amount

BigNumber

slippage

BigNumberish

Returns

BigNumber

amount with positive slippage

Source

libs/sdk/src/lib/xfai-utils.ts:162


quote()

quote<T>(__namedParameters): QuoteResult< T >

Type parameters

Parameter

T extends QuoteBase

Parameters

ParameterType

__namedParameters

Quote< T >

Returns

QuoteResult< T >

Source

libs/sdk/src/lib/pool/quote.ts:29


removeLiquidity()

removeLiquidity( xfai, lpTokenAmount, target, supplementary,