hadeswap-sdk-public
Version:
HadeSwap SDK for interacting with protocol
42 lines (41 loc) • 1.45 kB
TypeScript
import { BondingCurveType, OrderType } from '../types';
export declare const addToCart: (order_type: OrderType, nft: string, targetPair: Pair, state: CartState) => void;
export declare const removeFromCart: (orderNftMint: string, state: CartState) => void;
export declare const getCart: (state: CartState) => OrderInCart[];
export declare const getPairsInAction: (state: CartState) => PairInAction[];
export declare const getRelevantPairFiltered: (state: CartState) => void;
export declare const pairsInActionMapState: Dictionary<PairInAction>;
export declare const ordersInCartByPairMapState: Dictionary<OrderInCart[]>;
export declare const nftToOrderMapState: Dictionary<OrderInCart>;
export interface PairInAction extends Pair {
takenMints: string[];
}
export interface OrderInCart {
type: OrderType;
nftMint: string;
targetPairPukey: string;
price: number;
}
export interface CartState {
pairsInActionMapState: Dictionary<PairInAction>;
ordersInCartByPairMapState: Dictionary<OrderInCart[]>;
nftToOrderMapState: Dictionary<OrderInCart>;
}
export interface Pair {
hadoMarket: string;
pairType: string;
bondingCurve: {
delta: number;
bondingType: BondingCurveType;
};
spotPrice: number;
fee: number;
fundsSolOrTokenBalance: number;
buyOrdersQuantity: number;
nftsCount: number;
publicKey: string;
}
interface Dictionary<T> {
[index: string]: T;
}
export {};