/** * Privy server-side wallet integration. * * Creates signers from Privy's server-auth SDK for headless order signing. * This is the same approach Dome uses for server-side trading. * * Requires: npm install @privy-io/server-auth */ import type { RouterSigner } from './types.js'; export interface PrivyConfig { appId: string; appSecret: string; authorizationKey: string; } /** * Create a RouterSigner from Privy server-auth credentials. * * This signer calls Privy's walletApi.ethereum.signTypedData() for * EIP-712 order signing — no browser, no user interaction. * * @example * ```typescript * import { PolyNodeTrader, createPrivySigner, createPrivyClient } from 'polynode-sdk'; * * const privy = createPrivyClient({ * appId: process.env.PRIVY_APP_ID, * appSecret: process.env.PRIVY_APP_SECRET, * authorizationKey: process.env.PRIVY_AUTHORIZATION_KEY, * }); * * const signer = createPrivySigner(privy, 'wallet-id', '0xAddress'); * * const trader = new PolyNodeTrader({ polynodeKey: 'pn_live_...' }); * await trader.ensureReady(signer); * await trader.order({ tokenId: '...', side: 'BUY', price: 0.5, size: 100 }); * ``` */ export declare function createPrivySigner(privyClient: any, // PrivyClient from @privy-io/server-auth walletId: string, walletAddress: string): RouterSigner; /** * Create a PrivyClient instance. Thin wrapper around @privy-io/server-auth. * * @example * ```typescript * const privy = createPrivyClient({ * appId: process.env.PRIVY_APP_ID, * appSecret: process.env.PRIVY_APP_SECRET, * authorizationKey: process.env.PRIVY_AUTHORIZATION_KEY, * }); * ``` */ export declare function createPrivyClient(config: PrivyConfig): Promise; /** * Create a Privy signer from environment variables. * * Reads PRIVY_APP_ID, PRIVY_APP_SECRET, PRIVY_AUTHORIZATION_KEY from env. */ export declare function createPrivySignerFromEnv(walletId: string, walletAddress: string): Promise; /** * Set all required Polymarket token approvals using Privy's sendTransaction API. * * This sends approval transactions server-side through Privy, optionally * with gas sponsorship (Privy pays gas). * * @param privyClient - PrivyClient instance from createPrivyClient() * @param walletId - Privy wallet ID * @param opts.sponsor - If true, use Privy gas sponsorship (default: false) * @param opts.onProgress - Callback for progress updates */ export declare function setPrivyWalletApprovals(privyClient: any, walletId: string, opts?: { sponsor?: boolean; onProgress?: (step: string, current: number, total: number) => void; }): Promise<{ txHashes: string[]; }>; //# sourceMappingURL=privy.d.ts.map