UNPKG

@ajna-finance/sdk

Version:

A typescript SDK that can be used to create Dapps in Ajna ecosystem.

63 lines (62 loc) 3.16 kB
import { BigNumber, Contract, Signer } from 'ethers'; import { CallData, PositionManager, SignerOrProvider, TransactionOverrides, WrappedTransaction } from '../types'; export declare class LPToken { provider: SignerOrProvider; tokenId: BigNumber; contractPositionManager: PositionManager; /** * @param provider JSON-RPC endpoint. * @param tokenId uniquely identifies this LP token */ constructor(provider: SignerOrProvider, tokenId: BigNumber); toString(): string; tokenURI(): Promise<string>; isIndexInPosition(index: number, tokenId?: BigNumber): Promise<boolean>; getPositionIndexesFiltered(): Promise<BigNumber[]>; poolKey(): Promise<string>; /** * Moves LP balance from one or more buckets into this position NFT. * @param signer lender * @param pool pool in which lender added liquidity * @param indexes identifies the buckets which lender wants their LP moved into this position NFT * @returns promise to transaction */ memorializePositions(signer: Signer, pool: Contract, indexes: Array<number>, overrides?: TransactionOverrides): Promise<WrappedTransaction>; /** * Returns an array of bucket indexes in which current token has liquidity. * @param signer consumer initiating transactions * @returns Array of bucket indexes. */ getPositionIndexes(signer: Signer): Promise<Array<number>>; /** * Removes LP balance from position NFT, placing back into pool. * @param signer lender * @param pool pool for which this position NFT is holding LP balance for the lender * @param indexes identifies the buckets in which lender wants LP balance moved out of this position NFT * @returns promise to transaction */ redeemPositions(signer: Signer, pool: Contract, indexes: Array<number>, overrides?: TransactionOverrides): Promise<WrappedTransaction>; /** * Moves memorialized liquidity to a different bucket, allowing LP token holder to adjust position for market price change. * @param signer lender * @param pool pool in which memorialized liquidity should be moved * @param fromIndex existing bucket in which lender's position is memorialized * @param toIndex target bucket into which lender wants their liquidity moved * @param ttlSeconds revert if not processed in this amount of time * @returns promise to transaction */ moveLiquidity(signer: Signer, pool: Contract, fromIndex: number, toIndex: number, ttlSeconds?: number, overrides?: TransactionOverrides): Promise<WrappedTransaction>; /** * Returns an instance to an existing LP token. * @param tokenId identifies the token * @returns LPToken instance */ static fromTokenId(provider: SignerOrProvider, tokenId: BigNumber): LPToken; /** * Enables signer to bundle transactions together atomically in a single request. * @param signer consumer initiating transactions * @param callData array of transactions to sign and submit * @returns transaction */ multicall(signer: Signer, callData: Array<CallData>): Promise<WrappedTransaction>; }