import { PublicKey, Transaction, type TransactionInstruction } from "@solana/web3.js"; import type { ClientContext } from "../../context"; import type { Position as ProgramPosition, RedeemWinningsParams, WithdrawFromPositionParams, InitPositionTokensParams, ExtendPositionTokensParams, DepositToGlobalParams, DepositToGlobalAltContext, GlobalToMarketDepositParams, WithdrawFromGlobalParams, ClosePositionAltParams, ClosePositionTokenAccountsParams } from "../../program/types"; import type { PubkeyStr } from "../../shared"; import type { DepositTokenBalance } from "./index"; import type { MarketPositionsResponse, PositionsResponse } from "./wire"; import { DepositBuilder, MergeBuilder, WithdrawBuilder, RedeemWinningsBuilder, WithdrawFromPositionBuilder, InitPositionTokensBuilder, ExtendPositionTokensBuilder, DepositToGlobalBuilder, WithdrawFromGlobalBuilder, GlobalToMarketDepositBuilder } from "./builders"; export declare class Positions { private readonly client; constructor(client: ClientContext); pda(owner: PublicKey, market: PublicKey): PublicKey; get(userPubkey: string): Promise; getForMarket(userPubkey: string, marketPubkey: string): Promise; /** * Get all conditional-token positions for the authenticated user across * every market. The wallet is resolved server-side from the auth cookie, * so no parameter is required. Same response shape as `get()`. * * `GET /api/users/positions` */ positions(): Promise; /** * Same as {@link positions}, but uses the supplied `cookieHeader` for this * call instead of the SDK's process-wide cookie store. * * Intended for server-side cookie forwarding (SSR / server functions) * where the per-request browser cookie can't propagate to the shared * client. In a browser context this is equivalent to {@link positions} * because the runtime is already attaching the cookie via * `credentials: "include"`. */ positionsWithCookies(cookieHeader: string): Promise; /** * Get the authenticated user's positions in a specific market. The wallet * is resolved server-side from the auth cookie. * * `GET /api/users/markets/{market_pubkey}/positions` */ positionsForMarket(marketPubkey: string): Promise; /** * Same as {@link positionsForMarket}, but uses the supplied `cookieHeader` * for this call instead of the SDK's process-wide cookie store. For * server-side cookie forwarding (SSR / server functions). */ positionsForMarketWithCookies(marketPubkey: string, cookieHeader: string): Promise; /** * Get SPL deposit-token balances for the authenticated user. * * The wallet is resolved server-side from the auth cookie, so no * parameter is required. Returns balances keyed by mint pubkey for every * deposit token registered in the backend's `deposit_token_metadata`. * An empty object means the user has none of the tracked balances — this * is not an error. */ depositTokenBalances(): Promise>; /** * Same as {@link depositTokenBalances}, but uses the supplied `cookieHeader` * for this call instead of the SDK's process-wide cookie store. * * Intended for server-side cookie forwarding (SSR / server functions) * where the per-request browser cookie can't propagate to the shared * client. In a browser context this is equivalent to * {@link depositTokenBalances} because the runtime is already attaching * the cookie via `credentials: "include"`. */ depositTokenBalancesWithCookies(cookieHeader: string): Promise>; redeemWinningsIx(params: RedeemWinningsParams, outcomeIndex: number): TransactionInstruction; withdrawFromPositionIx(params: WithdrawFromPositionParams): TransactionInstruction; initPositionTokensIx(params: InitPositionTokensParams, numOutcomes: number): TransactionInstruction; extendPositionTokensIx(params: ExtendPositionTokensParams, numOutcomes: number): TransactionInstruction; depositToGlobalIx(params: DepositToGlobalParams): TransactionInstruction; depositToGlobalIxWithAlt(params: DepositToGlobalParams, altContext: DepositToGlobalAltContext): TransactionInstruction; globalToMarketDepositIx(params: GlobalToMarketDepositParams, numOutcomes: number): TransactionInstruction; withdrawFromGlobalIx(params: WithdrawFromGlobalParams): TransactionInstruction; closePositionAltIx(params: ClosePositionAltParams): TransactionInstruction; closePositionTokenAccountsIx(params: ClosePositionTokenAccountsParams, numOutcomes: number): TransactionInstruction; redeemWinningsTx(params: RedeemWinningsParams, outcomeIndex: number): Transaction; withdrawFromPositionTx(params: WithdrawFromPositionParams): Transaction; initPositionTokensTx(params: InitPositionTokensParams, numOutcomes: number): Transaction; extendPositionTokensTx(params: ExtendPositionTokensParams, numOutcomes: number): Transaction; depositToGlobalTx(params: DepositToGlobalParams): Transaction; depositToGlobalTxWithAlt(params: DepositToGlobalParams, altContext: DepositToGlobalAltContext): Transaction; globalToMarketDepositTx(params: GlobalToMarketDepositParams, numOutcomes: number): Transaction; withdrawFromGlobalTx(params: WithdrawFromGlobalParams): Transaction; closePositionAltTx(params: ClosePositionAltParams): Transaction; closePositionTokenAccountsTx(params: ClosePositionTokenAccountsParams, numOutcomes: number): Transaction; deposit(): DepositBuilder; merge(): MergeBuilder; withdraw(): WithdrawBuilder; redeemWinnings(): RedeemWinningsBuilder; withdrawFromPosition(): WithdrawFromPositionBuilder; initPositionTokens(): InitPositionTokensBuilder; extendPositionTokens(): ExtendPositionTokensBuilder; depositToGlobal(): DepositToGlobalBuilder; withdrawFromGlobal(): WithdrawFromGlobalBuilder; globalToMarketDeposit(): GlobalToMarketDepositBuilder; getOnchain(owner: PublicKey, market: PublicKey): Promise; } //# sourceMappingURL=client.d.ts.map