@daydreamsai/ai-sdk-provider
Version:
Dreams Router AI SDK provider (forked from OpenRouter)
812 lines (782 loc) • 28 kB
text/typescript
import { LanguageModelV2, LanguageModelV2CallOptions, LanguageModelV2Content, LanguageModelV2FinishReason, LanguageModelV2Usage, LanguageModelV2CallWarning, LanguageModelV2ResponseMetadata, SharedV2Headers, LanguageModelV2StreamPart } from '@ai-sdk/provider';
export { LanguageModelV2, LanguageModelV2Prompt } from '@ai-sdk/provider';
import { Account } from 'viem';
type OpenRouterChatModelId = string;
type OpenRouterChatSettings = {
/**
Modify the likelihood of specified tokens appearing in the completion.
Accepts a JSON object that maps tokens (specified by their token ID in
the GPT tokenizer) to an associated bias value from -100 to 100. You
can use this tokenizer tool to convert text to token IDs. Mathematically,
the bias is added to the logits generated by the model prior to sampling.
The exact effect will vary per model, but values between -1 and 1 should
decrease or increase likelihood of selection; values like -100 or 100
should result in a ban or exclusive selection of the relevant token.
As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
token from being generated.
*/
logitBias?: Record<number, number>;
/**
Return the log probabilities of the tokens. Including logprobs will increase
the response size and can slow down response times. However, it can
be useful to understand better how the model is behaving.
Setting to true will return the log probabilities of the tokens that
were generated.
Setting to a number will return the log probabilities of the top n
tokens that were generated.
*/
logprobs?: boolean | number;
/**
Whether to enable parallel function calling during tool use. Default to true.
*/
parallelToolCalls?: boolean;
/**
A unique identifier representing your end-user, which can help OpenRouter to
monitor and detect abuse. Learn more.
*/
user?: string;
} & OpenRouterSharedSettings;
/**
* Dreams Router payment configuration types
*/
/**
* Simplified payment configuration - amounts and addresses auto-fetched from router
*/
interface DreamsRouterPaymentConfig {
/**
* Preferred network for payments. If not specified, router will choose based on signer availability.
* The router will return requirements for the appropriate network.
*/
network?: 'base-sepolia' | 'base' | 'avalanche-fuji' | 'avalanche' | 'iotex' | 'solana' | 'solana-devnet';
/**
* Payment validity duration in seconds. Defaults to 600 (10 minutes)
*/
validityDuration?: number;
/**
* Autopay mode. When 'lazy' (default), the SDK performs a 402 handshake,
* generates a payment for the required amount, and retries once automatically.
* When 'eager', the SDK will attempt to pre-attach a payment on first attempt
* if a fresh cached requirement is available.
*/
mode?: 'lazy' | 'eager';
/**
* Optional RPC endpoint override for SOL networks.
*/
rpcUrl?: string;
/** @deprecated Use network preference instead. Amount is determined by router. */
amount?: string;
}
/**
* Dreams Router authentication method types
*/
type DreamsRouterAuthMethod = 'api-key' | 'session-token';
interface DreamsRouterAuthConfig {
method: DreamsRouterAuthMethod;
apiKey?: string;
sessionToken?: string;
}
type SolanaSigner = NodeSolanaSigner;
interface NodeSolanaSigner {
type: 'node';
/** Base58-encoded 64-byte secret key */
secretKeyBase58: string;
/** Optional RPC endpoint override */
rpcUrl?: string;
}
type DreamsRouterProviderOptions = {
models?: string[];
/**
* https://openrouter.ai/docs/use-cases/reasoning-tokens
* One of `max_tokens` or `effort` is required.
* If `exclude` is true, reasoning will be removed from the response. Default is false.
*/
reasoning?: {
enabled?: boolean;
exclude?: boolean;
} & ({
max_tokens: number;
} | {
effort: 'high' | 'medium' | 'low';
});
/**
* A unique identifier representing your end-user, which can
* help OpenRouter to monitor and detect abuse.
*/
user?: string;
};
type OpenRouterSharedSettings = DreamsRouterProviderOptions & {
/**
* @deprecated use `reasoning` instead
*/
includeReasoning?: boolean;
extraBody?: Record<string, unknown>;
/**
* Enable usage accounting to get detailed token usage information.
* https://openrouter.ai/docs/use-cases/usage-accounting
*/
usage?: {
/**
* When true, includes token usage information in the response.
*/
include: boolean;
};
};
/**
* Usage accounting response
* @see https://openrouter.ai/docs/use-cases/usage-accounting
*/
type OpenRouterUsageAccounting = {
promptTokens: number;
completionTokens: number;
totalTokens: number;
cost?: number;
};
type OpenRouterCompletionModelId = string;
type OpenRouterCompletionSettings = {
/**
Modify the likelihood of specified tokens appearing in the completion.
Accepts a JSON object that maps tokens (specified by their token ID in
the GPT tokenizer) to an associated bias value from -100 to 100. You
can use this tokenizer tool to convert text to token IDs. Mathematically,
the bias is added to the logits generated by the model prior to sampling.
The exact effect will vary per model, but values between -1 and 1 should
decrease or increase likelihood of selection; values like -100 or 100
should result in a ban or exclusive selection of the relevant token.
As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
token from being generated.
*/
logitBias?: Record<number, number>;
/**
Return the log probabilities of the tokens. Including logprobs will increase
the response size and can slow down response times. However, it can
be useful to better understand how the model is behaving.
Setting to true will return the log probabilities of the tokens that
were generated.
Setting to a number will return the log probabilities of the top n
tokens that were generated.
*/
logprobs?: boolean | number;
/**
The suffix that comes after a completion of inserted text.
*/
suffix?: string;
} & OpenRouterSharedSettings;
type OpenRouterChatConfig = {
provider: string;
compatibility: 'strict' | 'compatible';
headers: () => Record<string, string | undefined>;
url: (options: {
modelId: string;
path: string;
}) => string;
fetch?: typeof fetch;
extraBody?: Record<string, unknown>;
};
declare class OpenRouterChatLanguageModel implements LanguageModelV2 {
readonly specificationVersion: "v2";
readonly provider = "dreamsrouter";
readonly defaultObjectGenerationMode: "tool";
readonly modelId: OpenRouterChatModelId;
readonly supportedUrls: Record<string, RegExp[]>;
readonly settings: OpenRouterChatSettings;
private readonly config;
constructor(modelId: OpenRouterChatModelId, settings: OpenRouterChatSettings, config: OpenRouterChatConfig);
private getArgs;
doGenerate(options: LanguageModelV2CallOptions): Promise<{
content: Array<LanguageModelV2Content>;
finishReason: LanguageModelV2FinishReason;
usage: LanguageModelV2Usage;
warnings: Array<LanguageModelV2CallWarning>;
providerMetadata?: {
openrouter: {
provider: string;
usage: OpenRouterUsageAccounting;
};
};
request?: {
body?: unknown;
};
response?: LanguageModelV2ResponseMetadata & {
headers?: SharedV2Headers;
body?: unknown;
};
}>;
doStream(options: LanguageModelV2CallOptions): Promise<{
stream: ReadableStream<LanguageModelV2StreamPart>;
warnings: Array<LanguageModelV2CallWarning>;
request?: {
body?: unknown;
};
response?: LanguageModelV2ResponseMetadata & {
headers?: SharedV2Headers;
body?: unknown;
};
}>;
}
type OpenRouterCompletionConfig = {
provider: string;
compatibility: 'strict' | 'compatible';
headers: () => Record<string, string | undefined>;
url: (options: {
modelId: string;
path: string;
}) => string;
fetch?: typeof fetch;
extraBody?: Record<string, unknown>;
};
declare class OpenRouterCompletionLanguageModel implements LanguageModelV2 {
readonly specificationVersion: "v2";
readonly provider = "openrouter";
readonly modelId: OpenRouterCompletionModelId;
readonly supportedUrls: Record<string, RegExp[]>;
readonly defaultObjectGenerationMode: undefined;
readonly settings: OpenRouterCompletionSettings;
private readonly config;
constructor(modelId: OpenRouterCompletionModelId, settings: OpenRouterCompletionSettings, config: OpenRouterCompletionConfig);
private getArgs;
doGenerate(options: LanguageModelV2CallOptions): Promise<Awaited<ReturnType<LanguageModelV2['doGenerate']>>>;
doStream(options: LanguageModelV2CallOptions): Promise<Awaited<ReturnType<LanguageModelV2['doStream']>>>;
}
interface DreamsRouterProvider {
(modelId: OpenRouterChatModelId, settings?: OpenRouterCompletionSettings): OpenRouterCompletionLanguageModel;
(modelId: OpenRouterChatModelId, settings?: OpenRouterChatSettings): OpenRouterChatLanguageModel;
languageModel(modelId: OpenRouterChatModelId, settings?: OpenRouterCompletionSettings): OpenRouterCompletionLanguageModel;
languageModel(modelId: OpenRouterChatModelId, settings?: OpenRouterChatSettings): OpenRouterChatLanguageModel;
/**
Creates an OpenRouter chat model for text generation.
*/
chat(modelId: OpenRouterChatModelId, settings?: OpenRouterChatSettings): OpenRouterChatLanguageModel;
/**
Creates an OpenRouter completion model for text generation.
*/
completion(modelId: OpenRouterCompletionModelId, settings?: OpenRouterCompletionSettings): OpenRouterCompletionLanguageModel;
}
interface DreamsRouterProviderSettings {
/**
Base URL for the OpenRouter API calls.
*/
baseURL?: string;
/**
@deprecated Use `baseURL` instead.
*/
baseUrl?: string;
/**
API key for authenticating requests. JWT or API key.
*/
apiKey?: string;
/**
Custom headers to include in the requests.
*/
headers?: Record<string, string>;
/**
OpenRouter compatibility mode. Should be set to `strict` when using the OpenRouter API,
and `compatible` when using 3rd party providers. In `compatible` mode, newer
information such as streamOptions are not being sent. Defaults to 'compatible'.
*/
compatibility?: 'strict' | 'compatible';
/**
Custom fetch implementation. You can use it as a middleware to intercept requests,
or to provide a custom fetch implementation for e.g. testing.
*/
fetch?: typeof fetch;
/**
A JSON object to send as the request body to access OpenRouter features & upstream provider features.
*/
extraBody?: Record<string, unknown>;
/**
* Payment configuration for x402 payments. When provided, the SDK will automatically
* generate x402 payment signatures for each request.
* Note: This is used internally by wallet auth utils. Use createDreamsRouterAuth() for easier setup.
*/
payment?: DreamsRouterPaymentConfig;
/**
* Account for generating x402 payments. Used internally by wallet auth utils.
*/
signer?: Account;
/**
* Solana signer for SOL x402 payments (Node environments only, for now).
*/
solanaSigner?: SolanaSigner;
}
interface CreateDreamsRouterNamespace {
(): DreamsRouterProvider;
(options: DreamsRouterProviderSettings): DreamsRouterProvider;
evm(signer: Account, options?: Omit<DreamsRouterProviderSettings, 'signer' | 'apiKey'> & {
network?: 'base' | 'base-sepolia';
validityDuration?: number;
}): DreamsRouterProvider;
solana(solanaSigner: SolanaSigner, options?: Omit<DreamsRouterProviderSettings, 'solanaSigner' | 'apiKey'> & {
network?: 'solana' | 'solana-devnet';
validityDuration?: number;
}): DreamsRouterProvider;
}
declare const createDreamsRouterWithNamespace: CreateDreamsRouterNamespace;
/**
Default Dreams router provider instance. It uses 'strict' compatibility mode.
*/
declare const dreamsrouter: DreamsRouterProvider;
type X402Network = 'base' | 'base-sepolia' | 'avalanche' | 'avalanche-fuji' | 'iotex' | 'solana' | 'solana-devnet';
interface X402PaymentRequirements {
scheme: string;
network: X402Network | string;
maxAmountRequired: string;
asset: string;
payTo: string;
resource?: string;
description?: string;
mimeType?: string;
maxTimeoutSeconds?: number;
extra?: {
feePayer?: string;
[key: string]: unknown;
};
}
/**
* x402 Payment utilities for Dreams Router
*/
/**
* Creates EIP-712 typed data for X402 payment (no signing)
*/
declare function createX402PaymentData(address: string, config?: DreamsRouterPaymentConfig): {
readonly eip712Data: {
types: {
EIP712Domain: {
name: string;
type: string;
}[];
TransferWithAuthorization: {
name: string;
type: string;
}[];
};
domain: {
name: string;
version: string;
chainId: number;
verifyingContract: `0x${string}`;
};
primaryType: "TransferWithAuthorization";
message: {
from: `0x${string}`;
to: `0x${string}`;
value: bigint;
validAfter: bigint;
validBefore: bigint;
nonce: string;
};
};
readonly authorization: {
from: `0x${string}`;
to: `0x${string}`;
value: bigint;
validAfter: bigint;
validBefore: bigint;
nonce: string;
};
readonly network: "base-sepolia" | "base";
};
/**
* Generates X402 payment for browser/wagmi environments
*/
declare function generateX402PaymentBrowser(address: string, signTypedDataAsync: (data: any) => Promise<string>, config?: DreamsRouterPaymentConfig): Promise<string | null>;
declare function generateX402Payment(account: Account, config: DreamsRouterPaymentConfig): Promise<string | null>;
/**
* Generate an EVM x402 payment header directly from server-provided requirements.
*/
declare function generateX402PaymentFromRequirement(account: Account, requirement: X402PaymentRequirements, config?: Pick<DreamsRouterPaymentConfig, 'validityDuration'>): Promise<string | null>;
/**
* Auto x402 provider - handles the complete flow automatically
* 1. Makes initial request
* 2. If 402 received, extracts payment requirements
* 3. Creates x402 payment with provided account
* 4. Retries request with x402 payment
*/
declare function autoX402Provider(account: Account, url: string, requestInit: RequestInit, config?: Pick<DreamsRouterPaymentConfig, 'validityDuration'>): Promise<Response>;
/**
* Simple wrapper for chat completions with auto x402
*/
declare function chatCompletionsWithX402(account: Account, baseUrl: string, body: any, config?: Pick<DreamsRouterPaymentConfig, 'validityDuration'> & {
preferredNetwork?: 'base' | 'base-sepolia';
}): Promise<Response>;
/**
* Unified account types for Dreams Router
* Supports both EVM (viem Account) and Solana signers
*/
interface SolanaAccount {
/** Account type identifier */
type: 'solana';
/** Solana public key (base58) */
publicKey: string;
/** Sign a message */
signMessage?: (message: {
message: string;
}) => Promise<string>;
/** Sign a transaction */
signTransaction?: (transaction: any) => Promise<any>;
/** Optional RPC URL for Solana */
rpcUrl?: string;
}
interface EVMAccount {
type: 'evm';
address: `0x${string}`;
signMessage?: (message: {
message: string;
}) => Promise<`0x${string}`>;
signTransaction?: (transaction: any) => Promise<any>;
signTypedData?: (typedData: any) => Promise<`0x${string}`>;
[key: string]: any;
}
type UnifiedAccount = EVMAccount | SolanaAccount;
/**
* Type guard to check if account is EVM
*/
declare function isEVMAccount(account: UnifiedAccount): account is EVMAccount;
/**
* Type guard to check if account is Solana
*/
declare function isSolanaAccount(account: UnifiedAccount): account is SolanaAccount;
/**
* Create an EVM account wrapper
*/
declare function createEVMAccount(account: Account): EVMAccount;
/**
* Create a Solana account for browser environments
*/
declare function createSolanaAccount(publicKey: string, signMessage?: (message: {
message: string;
}) => Promise<string>): SolanaAccount;
/**
* Auto-detect account type and wrap if needed
*/
declare function wrapAccount(account: Account | SolanaAccount | UnifiedAccount): UnifiedAccount;
/**
* Get account identifier (address for EVM, publicKey for Solana)
*/
declare function getAccountIdentifier(account: UnifiedAccount): string;
/**
* Get preferred network based on account type
*/
declare function getPreferredNetwork(account: UnifiedAccount): string;
/**
* Dreams Router API Client
* Provides access to Dreams Router API endpoints with authentication support
*/
interface ApiResponse<T = any> {
success: boolean;
data?: T;
user?: User;
apiKey?: string;
sessionToken?: string;
usageHistory?: UsageLog[];
statistics?: UsageStats;
summary?: UsageSummary;
models?: ModelConfig[];
stats?: ModelStats;
providers?: ModelProvider[];
categories?: ModelCategory[];
recommendations?: ModelRecommendationResponse;
error?: string;
amountCredited?: number;
newBalance?: number;
balance?: number;
userId?: string;
walletAddress?: string;
exists?: boolean;
lastSeen?: number;
message?: string;
instructions?: any;
}
interface User {
id: string;
walletAddress?: string;
balance: number;
authMethod: 'api-key' | 'wallet' | 'password' | 'github';
createdAt: number;
updatedAt: number;
name?: string;
email?: string;
emailVerified?: boolean;
githubId?: string;
githubUsername?: string;
githubLinkedAt?: number | null;
lastSeen?: number;
}
interface UsageLog {
id: string;
userId: string;
model: string;
promptTokens: number;
completionTokens: number;
totalTokens: number;
costUsd: number;
timestamp: number;
paymentMethod?: string;
provider?: string;
}
interface UsageStats {
totalRequests: number;
totalTokens: number;
totalCost: number;
avgTokensPerRequest: number;
mostUsedModel: string | null;
requestCount: number;
timeRange: {
start: number;
end: number;
};
}
interface UsageSummary {
totalRequests: number;
totalCost: number;
totalTokens: number;
modelsUsed: string[];
paymentMethods: Record<string, {
requests: number;
cost: number;
}>;
costByModel: Record<string, number>;
tokensByModel: Record<string, number>;
}
interface ModelConfig {
id: string;
name: string;
description: string;
context_length: number;
pricing: {
prompt: number;
completion: number;
};
capabilities: string[];
}
interface ModelStats {
total_models: number;
active_models: number;
most_popular: string;
}
interface ModelProvider {
id: string;
name: string;
models: string[];
}
interface ModelCategory {
id: string;
name: string;
description: string;
models: string[];
}
interface ModelRecommendationResponse {
recommended_models: ModelConfig[];
reasoning: string;
}
interface DreamsRouterApiClientOptions {
baseURL?: string;
apiKey?: string;
defaultHeaders?: Record<string, string>;
}
declare class DreamsRouterApiClient {
private baseURL;
private defaultHeaders;
private onTokenExpired?;
constructor(options?: DreamsRouterApiClientOptions);
setApiKey(apiKey: string): void;
removeApiKey(): void;
removeSessionToken(): void;
setTokenExpiredCallback(callback: () => Promise<string | null>): void;
private request;
private isJWTTokenExpired;
getProfile(): Promise<ApiResponse<{
user: User;
}>>;
walletLogin(walletAddress: string, signature: string, message: string): Promise<ApiResponse<{
user: User;
sessionToken: string;
}>>;
getWalletBalance(address: string): Promise<ApiResponse<{
balance: number;
userId?: string;
walletAddress?: string;
exists?: boolean;
lastSeen?: number;
}>>;
processPayment(x402Payment: string): Promise<ApiResponse<{
amountCredited: number;
newBalance: number;
}>>;
getDetailedModels(): Promise<ApiResponse<{
models: ModelConfig[];
}>>;
getModelStats(): Promise<ApiResponse<{
stats: ModelStats;
}>>;
getProviders(): Promise<ApiResponse<{
providers: ModelProvider[];
}>>;
getModelCategories(): Promise<ApiResponse<{
categories: ModelCategory[];
}>>;
searchModels(query: string): Promise<ApiResponse>;
getModelRecommendations(requirements: {
budget?: number;
needsVision?: boolean;
needsFunctions?: boolean;
needsStreaming?: boolean;
minTokens?: number;
}): Promise<ApiResponse<{
recommendations: ModelRecommendationResponse;
}>>;
}
interface UnifiedAuthManager {
apiClient: DreamsRouterApiClient;
currentSessionToken: string | null;
currentUser: User | null;
currentAccount: UnifiedAccount | null;
/**
* Sign message and get JWT session token using any supported account type
*/
login(account: Account | SolanaAccount): Promise<{
sessionToken: string;
user: User;
}>;
/**
* Create Dreams Router provider with current authentication and payments
*/
createDreamsRouter(options?: {
payments?: DreamsRouterPaymentConfig;
baseURL?: string;
}): ReturnType<typeof createDreamsRouterWithNamespace>;
/**
* Get current user profile
*/
getProfile(): Promise<User>;
/**
* Get wallet balance
*/
getBalance(identifier?: string): Promise<number>;
/**
* Logout and clear tokens
*/
logout(): void;
}
interface UnifiedAuthOptions {
baseURL?: string;
onTokenExpired?: () => Promise<string | null>;
}
declare function createUnifiedAuthManager(options?: UnifiedAuthOptions): UnifiedAuthManager;
/**
* Unified Dreams Router authentication - works with any account type
*/
declare function createUnifiedAuth(account: Account | SolanaAccount, options?: UnifiedAuthOptions & {
payments?: DreamsRouterPaymentConfig;
}): Promise<{
sessionToken: string;
user: User;
dreamsRouter: DreamsRouterProvider;
authManager: UnifiedAuthManager;
}>;
declare const createDreamsRouterAuth: typeof createUnifiedAuth;
/**
* Helper functions for creating accounts easily
*/
/**
* Create an EVM account from private key
* @param privateKey - 0x prefixed hex private key
* @returns EVMAccount ready for Dreams Router auth
*/
declare function createEVMAccountFromPrivateKey(privateKey: `0x${string}`): EVMAccount;
/**
* Create a Solana account from public key
* @param publicKey - Base58 encoded public key
* @param signMessage - Optional signing function
* @returns SolanaAccount ready for Dreams Router auth
*/
declare function createSolanaAccountFromPublicKey(publicKey: string, signMessage?: (message: {
message: string;
}) => Promise<string>): SolanaAccount;
/**
* Auto-detect and create account from private key (EVM only now)
* @param privateKey - Hex (0x...) private key
* @returns EVM account type
*/
declare function createAccountFromPrivateKey(privateKey: string): EVMAccount;
/**
* Separated authentication functions for Dreams Router
* Clean separation of concerns: createEVMAuth() and createSolanaAuth()
* Internal plumbing remains generic
*/
interface AuthResult {
sessionToken: string;
user: User;
dreamsRouter: ReturnType<typeof createDreamsRouterWithNamespace>;
authManager: ReturnType<typeof createUnifiedAuthManager>;
}
interface EVMAuthOptions extends UnifiedAuthOptions {
payments?: DreamsRouterPaymentConfig & {
network?: 'base-sepolia' | 'base' | 'avalanche-fuji' | 'avalanche' | 'iotex';
};
}
interface SolanaAuthOptions extends UnifiedAuthOptions {
payments?: DreamsRouterPaymentConfig & {
network?: 'solana' | 'solana-devnet';
rpcUrl?: string;
};
}
/**
* Create Dreams Router authentication for EVM accounts
* Works with any EVM-compatible chain (Ethereum, Base, etc.)
*/
declare function createEVMAuth(account: Account, options?: EVMAuthOptions): Promise<AuthResult>;
/**
* Create Dreams Router authentication for Solana accounts
* Works with mainnet and devnet
*/
declare function createSolanaAuth(publicKey: string, signMessage: (message: {
message: string;
}) => Promise<string>, options?: SolanaAuthOptions): Promise<AuthResult>;
/**
* Helper: Create EVM auth from private key string
*/
declare function createEVMAuthFromPrivateKey(privateKey: `0x${string}`, options?: EVMAuthOptions): Promise<AuthResult>;
/**
* Helper: Create Solana auth from public key
*/
declare function createSolanaAuthFromPublicKey(publicKey: string, signMessage: (message: {
message: string;
}) => Promise<string>, options?: SolanaAuthOptions): Promise<AuthResult>;
interface WalletAuthManager {
apiClient: DreamsRouterApiClient;
currentSessionToken: string | null;
currentUser: User | null;
currentAccount: Account | null;
/**
* Sign message and get JWT session token using an account
*/
walletLogin(account: Account): Promise<{
sessionToken: string;
user: User;
}>;
/**
* Create Dreams Router provider with current authentication and optional payments
*/
createDreamsRouter(options?: {
payments?: DreamsRouterPaymentConfig;
solanaSigner?: SolanaSigner;
}): ReturnType<typeof createDreamsRouterWithNamespace>;
/**
* Get current user profile
*/
getProfile(): Promise<User>;
/**
* Get wallet balance
*/
getBalance(address: string): Promise<number>;
/**
* Logout and clear tokens
*/
logout(): void;
}
interface WalletAuthManagerOptions {
baseURL?: string;
onTokenExpired?: () => Promise<string | null>;
}
declare function createWalletAuthManager(options?: WalletAuthManagerOptions): WalletAuthManager;
export { type AuthResult, type DreamsRouterAuthConfig, type DreamsRouterAuthMethod, type DreamsRouterPaymentConfig, type DreamsRouterProvider, type DreamsRouterProviderOptions, type DreamsRouterProviderSettings, type EVMAccount, type EVMAuthOptions, type NodeSolanaSigner, type OpenRouterCompletionSettings, type OpenRouterSharedSettings, type OpenRouterUsageAccounting, type SolanaAccount, type SolanaAuthOptions, type SolanaSigner, type UnifiedAccount, type UnifiedAuthManager, type UnifiedAuthOptions, type WalletAuthManager, type WalletAuthManagerOptions, autoX402Provider, chatCompletionsWithX402, createAccountFromPrivateKey, createDreamsRouterWithNamespace as createDreamsRouter, createDreamsRouterAuth, createEVMAccount, createEVMAccountFromPrivateKey, createEVMAuth, createEVMAuthFromPrivateKey, createSolanaAccount, createSolanaAccountFromPublicKey, createSolanaAuth, createSolanaAuthFromPublicKey, createUnifiedAuth, createUnifiedAuthManager, createWalletAuthManager, createX402PaymentData, dreamsrouter, generateX402Payment, generateX402PaymentBrowser, generateX402PaymentFromRequirement, getAccountIdentifier, getPreferredNetwork, isEVMAccount, isSolanaAccount, wrapAccount };