UNPKG

@perk.money/perk-swap-core

Version:

This npm package contains core logic of Perk Aggregator build on top of NEAR blockchain

30 lines (29 loc) 1.3 kB
import { Transaction } from '@near-wallet-selector/core'; import { Provider } from 'near-api-js/lib/providers'; import { Amm, CreateSwapRouteInstructionsParams, Quote, QuoteParams, SwapParams } from '../common/types'; import { LoadUserDepositsParams, SpinDeposits, SpinMarketResponse } from './types'; export declare class SpinFinanceMarket implements Amm { readonly rawMarket: SpinMarketResponse; label: string; id: string; reserveTokenMints: string[]; contractId: string; instanceId: number; private orderBook; constructor(rawMarket: SpinMarketResponse); static loadUserDeposits({ user, provider, }: LoadUserDepositsParams): Promise<SpinDeposits>; static createWithdrawFromDepositsTransaction({ user, token, amount, }: { user: string; token: string; amount: string; }): Transaction; createSwapInstructions(swapParams: SwapParams): Promise<Transaction[]>; createSwapRouteInstructions(swapParams: CreateSwapRouteInstructionsParams): Promise<Transaction[]>; getPromiseForUpdate({ provider, }: { provider: Provider; }): Promise<void>; getQuote(quoteParams: QuoteParams): Quote; static loadMarkets(params: { provider: Provider; }): Promise<SpinFinanceMarket[]>; }