/** * Onboarding — Safe deployment, approvals, credential creation * * All gasless via Polymarket's relayer + our builder credentials. */ import type { NormalizedSigner } from './signer.js'; import type { ApprovalStatus, BalanceInfo, BuilderCredentials } from './types.js'; import { SignatureType } from './types.js'; import type { ExchangeVersion } from './types.js'; export declare function deriveSafeAddress(eoaAddress: string): Promise; export declare function deriveProxyAddress(eoaAddress: string): Promise; /** Derive the deterministic deposit wallet address for an EOA (Solady ERC-1967 clone). */ export declare function deriveDepositWalletAddress(eoaAddress: string): Promise; /** * Derive the funder address for a given signer and signature type. */ export declare function deriveFunderAddress(eoaAddress: string, signatureType: SignatureType): Promise; /** * Auto-detect which wallet type an EOA uses on Polymarket. * * Derives both the Safe and Proxy addresses for the given EOA, * then checks which (if any) is deployed on-chain. Returns the * detected SignatureType and funder address. * * Detection order: * 1. Safe deployed → POLY_GNOSIS_SAFE (type 2) — current default for browser wallets * 2. Proxy deployed → POLY_PROXY (type 1) — legacy Magic Link / email wallets * 3. Neither → POLY_GNOSIS_SAFE (type 2) — new user, will deploy Safe * * We default to Safe (not EOA) for new users because it enables gasless onboarding. */ export declare function detectWalletType(eoaAddress: string): Promise<{ signatureType: SignatureType; funderAddress: string; }>; export declare function deployDepositWallet(signer: any, cosignerUrl: string, polynodeKey: string, builderCredentials?: any): Promise; export declare function setDepositWalletApprovals(signer: any, walletAddress: string, cosignerUrl: string, polynodeKey: string, builderCredentials: any, exchangeVersion: any): Promise; export declare function isSafeDeployed(safeAddress: string): Promise; /** * Ensure the clobSigner is compatible with RelayClient. * * RelayClient's createAbstractSigner checks: * instanceof ethers.Wallet (v5) → EthersSigner (raw signMessage, correct for Safe) * instanceof JsonRpcSigner (v5) → EthersSigner * else → ViemSigner (does personal_sign prefix, BREAKS Safe tx hash signatures) * * The ethers v5 vs v6 mismatch (Privy uses v6, Polymarket uses v5) means we must * create an actual ethers v5 Wallet that passes instanceof and delegates signing * to the original signer (viem WalletClient / RouterSigner / Privy). */ export declare function ensureRelaySigner(clobSigner: any, rpcUrl?: string): Promise; export declare function deploySafe(signer: NormalizedSigner, builderSignerUrl: string, polynodeKey: string, userBuilderCreds?: BuilderCredentials): Promise; export declare function checkApprovals(funderAddress: string, rpcUrl?: string, exchangeVersion?: ExchangeVersion): Promise; /** * Set approvals by sending transactions directly through the signer's sendTransaction. * Used for Privy wallets where the relayer execute path has signing compatibility issues. * * V1: approves USDC to SPENDERS + CTF to SPENDERS * V2: approves PolyUSD to V2_SPENDERS + CTF to V2_SPENDERS */ export declare function setApprovalsDirect(funderAddress: string, sendTx: (tx: { to: string; data: string; chainId: number; }) => Promise, exchangeVersion?: ExchangeVersion): Promise; export declare function setApprovals(signer: NormalizedSigner, builderSignerUrl: string, polynodeKey: string, userBuilderCreds?: BuilderCredentials, exchangeVersion?: ExchangeVersion): Promise; export declare function checkBalance(funderAddress: string, rpcUrl?: string, exchangeVersion?: ExchangeVersion): Promise; export declare function createClobCredentials(signer: NormalizedSigner, funderAddress?: string): Promise<{ apiKey: string; apiSecret: string; apiPassphrase: string; }>; //# sourceMappingURL=onboarding.d.ts.map