/** * Recursively sort all object keys alphabetically. * Exact port of Python SDK's sort_json_keys(). */ export declare function sortJsonKeys(value: unknown): unknown; /** * Prepare the message string for signing. * Exact port of Python SDK's prepare_message(). * * Header must contain: type, timestamp, expiry_window * Returns compact JSON with sorted keys and payload nested under "data". */ export declare function prepareMessage(header: { type: string; timestamp: number; expiry_window: number; }, payload: object): string; /** * Create a signing header with current timestamp. */ export declare function createHeader(type: string, expiryWindow?: number): { type: string; timestamp: number; expiry_window: number; }; /** * Sign a message using a wallet adapter's signMessage function. * Used in browser context with Phantom/Solflare/etc. * * @param header - Operation header (type, timestamp, expiry_window) * @param payload - Operation payload * @param signMessage - Wallet adapter's signMessage function * @returns [message, base58EncodedSignature] */ export declare function signWithWallet(header: { type: string; timestamp: number; expiry_window: number; }, payload: object, signMessage: (message: Uint8Array) => Promise): Promise<[string, string]>; /** * Build a signed request body for REST API POST. * Flattens payload to top level and adds account, signature, timestamp, expiry_window. */ export declare function buildSignedRequest(operationType: string, payload: object, account: string, signMessage: (message: Uint8Array) => Promise, expiryWindow?: number): Promise>; /** * Build a signed request with agent wallet. * Used when an agent wallet is trading on behalf of a main account. */ export declare function buildAgentSignedRequest(operationType: string, payload: object, mainAccount: string, agentWallet: string, signMessage: (message: Uint8Array) => Promise, expiryWindow?: number): Promise>;