/** Account derived from a local private key (mnemonic or raw key). */ type LocalAccount = { type: "local" address: string /** Compressed public key (hex) */ publicKey: string /** Raw ECDSA sign over a hash */ sign(hash: Uint8Array): Uint8Array /** Sign a raw UTF-8 / byte message (`sha256(bytes)`). Not SIP-018. */ signMessage(message: string | Uint8Array): string }; /** Account with a user-provided signing function (sync or async). */ type CustomAccount = { type: "custom" address: string publicKey: string sign(hash: Uint8Array): Promise | Uint8Array }; /** Browser wallet provider interface (e.g. Leather, Xverse). */ type StacksProvider = { request(method: string, params?: any): Promise }; /** Account backed by a browser wallet {@link StacksProvider}. */ type ProviderAccount = { type: "provider" address: string publicKey: string provider: StacksProvider }; /** Allocates mempool-safe sequential nonces across rapid broadcasts from one account. */ type NonceManager = { consume(params: { client: Client address: string }): Promise reset(params: { client: Client address: string }): void | Promise /** * Give back a nonce from {@link NonceManager.consume} whose transaction * was never accepted by the node. No-op unless it is the latest issued. */ release(params: { client: Client address: string nonce: bigint }): void | Promise /** Next nonce that {@link NonceManager.consume} would return without consuming it, or `undefined` if untracked. */ peek(params: { client: Client address: string }): Promise }; /** Full chain descriptor used by clients and transports for network-aware operations. */ type StacksChain = { /** Chain ID (e.g. 0x00000001 for mainnet) */ id: number /** Human-readable name */ name: string /** Network type */ network: "mainnet" | "testnet" /** Transaction version byte for serialization */ transactionVersion: number /** Peer network ID for P2P broadcasting */ peerNetworkId: number /** Address version bytes */ addressVersion: { singleSig: number multiSig: number } /** Magic bytes for network identification */ magicBytes: string /** Boot address (system contracts deployer) */ bootAddress: string /** Native currency info */ nativeCurrency: { name: string symbol: string decimals: number } /** Default RPC URLs */ rpcUrls: { default: { http: string[] ws?: string[] } } /** Block explorer URLs */ blockExplorers?: { default: { name: string url: string } } }; /** Function that sends an HTTP request to a Stacks node API path. */ type RequestFn = (path: string, options?: RequestOptions) => Promise; /** Options for a transport-level HTTP request. */ type RequestOptions = { method?: "GET" | "POST" | "PUT" | "DELETE" body?: unknown headers?: Record /** * Cancel the request from the caller's side. An aborted signal rejects * with the signal's reason immediately and never retries; it is combined * with the transport's own per-attempt timeout. */ signal?: AbortSignal /** * Override the transport's retry budget for this one request. Broadcasts * pass `0`: re-sending a transaction the node may already hold trades a * transient failure for a confusing nonce conflict. */ retryCount?: number }; /** Shared configuration for all transport types. */ type TransportConfig = { url?: string /** * Per-attempt deadline in ms covering headers AND body. A stalled body * rejects with `TimeoutError` instead of hanging. Default 30_000. */ timeout?: number retryCount?: number retryDelay?: number fetchOptions?: RequestInit /** Sent as `x-api-key`. Held in the request closure and stripped from * `Transport.config` so it never prints with the client. */ apiKey?: string }; /** A resolved transport instance with a bound request function. */ type Transport = { type: string request: RequestFn config: TransportConfig destroy?: () => void }; /** Union of all supported account types (local key, custom signer, or browser provider). */ type Account = LocalAccount | CustomAccount | ProviderAccount; /** * Core client instance that holds chain context, transport, and extensible actions. * Created via {@link createClient}, {@link createPublicClient}, or {@link createWalletClient}. */ type Client = Record> = { chain?: StacksChain account?: Account transport: Transport request: RequestFn /** Optional nonce manager for mempool-safe sequential nonces across rapid broadcasts. */ nonceManager?: NonceManager extend: >(fn: (client: Client) => TNew) => Client & TNew } & TExtended; interface DepositParams { amount: bigint; referrer?: string; pool?: string; } interface InitWithdrawParams { ststxAmount: bigint; } interface WithdrawParams { nftId: bigint; } interface WithdrawIdleParams { ststxAmount: bigint; } interface ExchangeRateInfo { stxPerStstx: bigint; ststxSupply: bigint; totalStx: bigint; } interface WithdrawalInfo { ststxAmount: bigint; stxAmount: bigint; unlockBurnHeight: bigint; } interface FeeInfo { stackFee: bigint; unstackFee: bigint; withdrawIdleFee: bigint; } declare const STACKINGDAO_CONTRACTS: { readonly core: { readonly address: string readonly name: string } readonly ststxToken: { readonly address: string readonly name: string } readonly withdrawNft: { readonly address: string readonly name: string } readonly reserve: { readonly address: string readonly name: string } readonly dataCore: { readonly address: string readonly name: string } readonly dataCoreV1: { readonly address: string readonly name: string } }; /** Trait contracts auto-passed to core functions — users never need these. */ declare const TRAIT_CONTRACTS: { readonly reserve: string readonly commission: string readonly directHelpers: string readonly staking: string }; /** Actions provided by the StackingDAO extension. */ type StackingDaoActions = { stackingDao: { deposit: (params: DepositParams) => Promise initWithdraw: (params: InitWithdrawParams) => Promise withdraw: (params: WithdrawParams) => Promise withdrawIdle: (params: WithdrawIdleParams) => Promise getStSTXBalance: (address: string) => Promise getExchangeRate: () => Promise getTotalSupply: () => Promise getWithdrawalInfo: (nftId: bigint) => Promise getFees: () => Promise getReserveBalance: () => Promise getShutdownDeposits: () => Promise } }; /** * StackingDAO liquid staking extension. * Deposit STX → receive stSTX. Auto-compounding stacking rewards. * * @example * import { createWalletClient, http, mainnet } from "stacks"; * import { stackingDao } from "stacks/stackingdao"; * * const client = createWalletClient({ ... }).extend(stackingDao()); * * // Deposit STX for stSTX * await client.stackingDao.deposit({ amount: 100_000_000_000n }); * * // Check exchange rate * const rate = await client.stackingDao.getExchangeRate(); */ declare function stackingDao(): (client: Client) => StackingDaoActions; export { stackingDao, WithdrawalInfo, WithdrawParams, WithdrawIdleParams, TRAIT_CONTRACTS, StackingDaoActions, STACKINGDAO_CONTRACTS, InitWithdrawParams, FeeInfo, ExchangeRateInfo, DepositParams };