UNPKG

@faktoryfun/styx-sdk

Version:

Bitcoin deposit SDK for Stacks applications, enabling trustless Bitcoin-to-sBTC deposits

45 lines (44 loc) 2.12 kB
import { DepositCreateParams, DepositUpdateParams, PreparedTransactionData, TransactionPrepareParams, FeeEstimates, Deposit, DepositHistoryResponse, DepositStatusUpdateParams, ExecuteTransactionResponse, PoolStatus, PoolConfig, AllowlistedPair, CheckFtPairResponse } from "./types"; export declare class BitcoinDepositAPI { private baseUrl; private apiKey; private headers; constructor(baseUrl: string, apiKey?: string); private fetch; getFeeEstimates(): Promise<FeeEstimates>; createDeposit(data: DepositCreateParams): Promise<string>; updateDeposit(data: DepositUpdateParams): Promise<Deposit>; getDepositHistory(userAddress: string): Promise<Deposit[]>; getAllDepositsHistory(poolId?: string): Promise<DepositHistoryResponse>; prepareTransaction(params: TransactionPrepareParams & { feeRates?: FeeEstimates; poolId?: string; minTokenOut?: number; swapType?: "sbtc" | "usda" | "pepe" | "aibtc"; dexId?: number; aiAccountReceiver?: string; }): Promise<PreparedTransactionData>; updateDepositStatus(params: DepositStatusUpdateParams): Promise<Deposit>; executeTransaction(params: { depositId: string; preparedData: PreparedTransactionData; walletProvider: "leather" | "xverse"; btcAddress: string; }): Promise<ExecuteTransactionResponse>; getPoolStatus(poolId?: string): Promise<PoolStatus>; getBTCPrice(): Promise<number | null>; getDepositStatus(depositId: string): Promise<Deposit>; getDepositStatusByTxId(btcTxId: string): Promise<Deposit>; getAvailablePools(): Promise<PoolConfig[]>; getAllowlistedPairs(poolId?: string): Promise<AllowlistedPair[]>; getSwapStatus(poolId?: string): Promise<{ paused: boolean; poolId: string; network: string; checkedAt: number; error?: string; }>; checkFtPair(ftContract: string, poolId?: string): Promise<CheckFtPairResponse>; isTokenAllowlisted(ftContract: string, poolId?: string): Promise<boolean>; areSwapsPaused(poolId?: string): Promise<boolean>; }