UNPKG

stxcity-sdk

Version:

SDK for interacting with Stxcity

96 lines (95 loc) 2.37 kB
import { StacksProvider } from "@stacks/connect"; import { StacksNetwork } from "@stacks/network"; export interface StxcityContext { network: StacksNetwork; } export type TokenBondingProgress = { dexStxBalance: number; dexStxBalanceWithDecimals: number; dexTokenBalance: number; dexTokenBalanceWithDecimal: number; }; export interface BondingTokenItem { id: number; token_contract: string; dex_contract: string; progress: number; name: string; tx_id: string; symbol: string; decimals: number; supply: number; logo_url: string; holders: number; deployed_at: Date; stx_paid: number; description: string; xlink: string; homepage: string; telegram: string; discord: string; status: string; target_AMM: string; chat_count: number; txs_count: number; trading_volume: number; target_stx: number; price?: number; price_24h_changes?: number; token_to_dex?: number; token_to_deployer?: number; stx_to_dex?: number; stx_buy_first_fee?: number; } export interface NormalTokenItem { contract_id: string; name: string; logo_url: string; symbol: string; homepage: string; supply: number; decimals: number; holders: number; tx_id: string; deployed_at: Date; } export interface BondingTokenData { trending: BondingTokenItem[]; new: BondingTokenItem[]; completed: BondingTokenItem[]; all: BondingTokenItem[]; total: number; page: number; limit: number; } export interface BuyBondingTokenParams { stxAmount: number; dexContractId: string; tokenContractId: string; tokenSymbol: string; senderAddress: string; slippage: number; stacksProvider?: StacksProvider; onFinish?: (data: any) => void; onCancel?: () => void; } export interface SellBondingTokenParams { tokenAmount: number; dexContractId: string; tokenContractId: string; tokenSymbol: string; senderAddress: string; slippage: number; stacksProvider?: StacksProvider; onFinish?: (data: any) => void; onCancel?: () => void; } export interface SearchTokenType { ads_tokens: BondingTokenItem[]; bonding_curve: BondingTokenItem[]; normal: NormalTokenItem[]; } export type SearchTokenParams = { keyword?: string; tokenContract?: string; };