Account

In this section, we provide interfaces related to your account.

getNFTIds

Get token IDs held by the owner

Copy

const { balance, tokenIds } = await floorswapSDK.account.getNFTIds(
    signer,
    collection,
    owner,
    amount
);

interface IGetNFTIdsResponse {
    balance: number;
    tokenIds: string[];
}

IGetNFTIdsParams

balanceForFundingPool

View balance of tokens and NFTs in Funding Pool

Copy

const res: IResType<IBalance>= await floorswap.account.balanceForFundingPool()

interface ISwapInfoParams {
  collection: string;
  swapType: number;
  slippage?: number;
  count?: number;
  nftList?: string[];
}

interface IResType<T> {
  code: string;
  message: string;
  success: boolean;
  data: T;
}

interface IBalance {
  token: string;
  nft: string[];
}

IBalance

depositTokenForFundingPool

Deposit funds into Funding Pool

Copy

const txHash: string = await floorswap.swap.depositTokenForFundingPool({
  tokenAmount: '100000000000000000'
}: IDepositTokenParams & { signer: ethers.Signer })

interface IDepositTokenParams {
  tokenAmount: string;
}

IDepositTokenParams

withdrawTokenForFundingPool

Withdraw funds from Funding Pool

Copy

const txHash: string = await floorswap.swap.withdrawTokenForFundingPool({
  tokenAmount: '100000000000000000',
  lastFee: '50000000000000000'
}: IWithdrawTokenParams & { signer: ethers.Signer })

interface IWithdrawTokenParams {
  tokenAmount: string;
  lastFee: string;
}

IWithdrawTokenParams

depositNFTForFundingPool

Deposit NFTs into Funding Pool and cross multiple collections supported.

Copy

const txHash: string = await floorswap.swap.depositNFTForFundingPool({
  collectionAddressList: ['...', '...'],
  tokenIdsList: [['5'], ['10']]
}: IDepositNFTParams & { signer: ethers.Signer })

interface IDepositNFTParams {
  collectionAddressList: string[];
  tokenIdsList: string[][];
}

IDepositNFTParams

withdrawNFTForFundingPool

Withdraw NFTs from Funding Pool and cross multiple collections supported.

Copy

const txHash: string = await floorswap.swap.withdrawNFTForFundingPool({
  collectionAddressList: ['...', '...'],
  tokenIdsList: [['5'], ['10']]
}: IWithdrawNFTParams & { signer: ethers.Signer })

interface IWithdrawNFTParams {
  collectionAddressList: string[];
  tokenIdsList: string[][];
}

IWithdrawNFTParams

Last updated