import { type AxiosInstance, type AxiosRequestConfig } from "axios"; import { AgentsAPI } from "./agents-api"; import { IntegrationsAPI } from "./integrations-api"; import { ModelsAPI } from "./models-api"; import { TriggersAPI } from "./triggers-api"; import { TasksAPI } from "./tasks-api"; import { WorkflowsAPI } from "./workflows-api"; import { Web3API } from "./web3-api"; import { PaymentsAPI } from "./payments-api"; import { Erc8004API } from "./erc8004-api"; /** * Client for interacting with the OpenServ Platform API. * * @example * ```typescript * // Using API key authentication * const client = new PlatformClient({ apiKey: 'your-api-key' }); * * // Using environment variable * const client = new PlatformClient(); // Uses OPENSERV_USER_API_KEY * * // Using wallet authentication * const client = new PlatformClient(); * await client.authenticate(process.env.WALLET_PRIVATE_KEY); * ``` */ export declare class PlatformClient { private _apiClient; /** Wallet address, set by authenticate() or manually. Used as a fallback for x402 trigger wallet resolution. */ walletAddress?: string; /** API for managing agents */ readonly agents: AgentsAPI; /** API for managing integration connections */ readonly integrations: IntegrationsAPI; /** API for discovering available LLM models */ readonly models: ModelsAPI; /** API for managing workflow triggers */ readonly triggers: TriggersAPI; /** API for managing workflow tasks */ readonly tasks: TasksAPI; /** API for managing workflows */ readonly workflows: WorkflowsAPI; /** API for Web3 operations (USDC top-up) */ readonly web3: Web3API; /** API for x402 payments to access paid workflows */ readonly payments: PaymentsAPI; /** API for ERC-8004 agent identity (deployment, wallets, IPFS, reputation) */ readonly erc8004: Erc8004API; /** * Get the raw axios client for advanced use cases. * @returns The underlying axios instance */ get rawClient(): AxiosInstance; /** * Make a GET request to the API. * @param path - API endpoint path * @param config - Optional Axios request config * @returns Response data */ get(path: string, config?: AxiosRequestConfig): Promise; /** * Make a POST request to the API. * @param path - API endpoint path * @param data - Request body data * @param config - Optional Axios request config * @returns Response data */ post(path: string, data?: unknown, config?: AxiosRequestConfig): Promise; /** * Make a PUT request to the API. * @param path - API endpoint path * @param data - Request body data * @param config - Optional Axios request config * @returns Response data */ put(path: string, data?: unknown, config?: AxiosRequestConfig): Promise; /** * Make a DELETE request to the API. * @param path - API endpoint path * @param config - Optional Axios request config * @returns Response data */ delete(path: string, config?: AxiosRequestConfig): Promise; /** * Creates a new PlatformClient instance. * * @param options - Configuration options * @param options.apiKey - API key for authentication (defaults to OPENSERV_USER_API_KEY env var) * @param options.baseUrl - Base URL for the API (defaults to https://api.openserv.ai) */ constructor(options?: { apiKey?: string; baseUrl?: string; }); /** * Authenticate using an Ethereum wallet (SIWE - EIP-4361). * * This method performs Sign-In with Ethereum authentication: * 1. Gets a nonce from the platform * 2. Signs the SIWE message with the wallet * 3. Verifies the signature and receives an API key * * @param privateKey - Wallet private key (defaults to WALLET_PRIVATE_KEY env var) * @returns The API key received from authentication * * @example * ```typescript * const client = new PlatformClient(); * const apiKey = await client.authenticate(process.env.WALLET_PRIVATE_KEY); * // Client is now authenticated and ready to use * ``` */ authenticate(privateKey?: string): Promise; /** * Resolve wallet address from stored state or environment. * * Returns `this.walletAddress` (set by `authenticate()`) if available, * otherwise derives the address from `WALLET_PRIVATE_KEY` environment variable. * Per-trigger overrides are handled at the call site, not here. * * @returns The resolved wallet address, or undefined if no wallet is available */ resolveWalletAddress(): string | undefined; } //# sourceMappingURL=client.d.ts.map