import type { OAuthAgentClient } from './oauth-agent.js'; export type PrepaidCustodyMode = 'sandbox_ledger' | 'external'; export type PrepaidWalletStatus = 'active' | 'blocked' | 'closed'; export type WalletAssignmentStatus = 'active' | 'blocked' | 'revoked'; export type WalletSpendPolicyScope = 'assignment' | 'wallet' | 'agent' | 'group' | 'principal' | 'developer'; export type WalletSpendPolicyEffect = 'limit' | 'deny' | 'require_approval'; export type WalletSpendPolicyWindow = 'per_authorization' | 'rolling' | 'calendar_day' | 'calendar_week' | 'calendar_month' | 'lifetime'; export type WalletSpendPolicyStatus = 'active' | 'disabled' | 'revoked'; export interface PrepaidWallet { walletId: string; principalId: string; name: string; custodyMode: PrepaidCustodyMode; provider: string | null; providerWalletId: string | null; walletAddress: string | null; network: string; asset: string; decimals: number; availableAmount: string; reservedAmount: string; lowBalanceThreshold: string; maxBalance: string | null; maxReloadAmount: string | null; reloadCumulativeLimit: string | null; reloadPeriodSeconds: number | null; reloadCountLimit: number | null; status: PrepaidWalletStatus; blockedAt: string | null; blockedReason: string | null; metadata: Record; createdAt: string; updatedAt: string; } /** Agent-visible wallet projection. Custody provider identifiers and metadata are never exposed. */ export interface AssignedPrepaidWallet { walletId: string; name: string; network: string; asset: string; decimals: number; availableAmount: string; reservedAmount: string; lowBalanceThreshold: string; status: PrepaidWalletStatus; blockedAt: string | null; blockedReason: string | null; assignmentId: string; assignmentStatus: WalletAssignmentStatus; perTransactionLimit: string; cumulativeLimit: string; cumulativePeriodSeconds: number; allowedRecipients: string[]; allowedScopes: string[]; allowedResourceOrigins: string[]; allowAnyRecipient: boolean; allowAnyScope: boolean; allowAnyResource: boolean; budgetGroup: string | null; validFrom: string; validUntil: string | null; allWalletsBlocked: boolean; createdAt: string; updatedAt: string; } export interface WalletAssignment { assignmentId: string; walletId: string; agentId: string; principalId: string; status: WalletAssignmentStatus; perTransactionLimit: string; cumulativeLimit: string; cumulativePeriodSeconds: number; allowedRecipients: string[]; allowedScopes: string[]; allowedResourceOrigins: string[]; allowAnyRecipient: boolean; allowAnyScope: boolean; allowAnyResource: boolean; budgetGroup: string | null; validFrom: string; validUntil: string | null; blockedAt: string | null; blockedReason: string | null; createdAt: string; updatedAt: string; } export interface CreatePrepaidWalletParams { name: string; custodyMode: PrepaidCustodyMode; provider?: string; providerWalletId?: string; walletAddress?: string; network: string; asset: string; decimals?: number; lowBalanceThreshold?: string; maxBalance?: string; maxReloadAmount?: string; reloadCumulativeLimit?: string; reloadPeriodSeconds?: number; reloadCountLimit?: number; metadata?: Record; } export interface AssignPrepaidWalletParams { agentId: string; perTransactionLimit: string; cumulativeLimit: string; cumulativePeriodSeconds: number; allowedRecipients?: string[]; allowedScopes?: string[]; allowedResourceOrigins?: string[]; allowAnyRecipient?: boolean; allowAnyScope?: boolean; allowAnyResource?: boolean; budgetGroup?: string; validUntil?: string; } export interface PrepaidAuthorizationRequest { walletId?: string; amount: string; asset: string; network: string; recipient: string; resource: string; scope: string; maxTimeoutSeconds: number; idempotencyKey: string; approvalRequestId?: string; merchantId?: string; purpose?: string; projectId?: string; costCenter?: string; } export interface PrepaidAuthorization { evmPayment?: { signature: string; authorization: { from: string; to: string; value: string; validAfter: string; validBefore: string; nonce: string; }; }; authorization: string; reservationId: string; walletId: string; assignmentId: string; amount: string; asset: string; network: string; recipient: string; expiresAt: string; remainingAvailable: string; remainingCumulative: string; policyDecisionId: string | null; } export interface PrepaidApprovalRequired { status: 'approval_required'; approvalRequestId: string; walletId: string; assignmentId: string; policyIds: string[]; expiresAt: string; } export type PrepaidAuthorizationResponse = PrepaidAuthorization | PrepaidApprovalRequired; export interface WalletSpendPolicyInput { name: string; description?: string; scopeType: WalletSpendPolicyScope; scopeId?: string; effect: WalletSpendPolicyEffect; onExceed?: 'deny' | 'require_approval'; maxAmount?: string; maxCount?: number; windowType?: WalletSpendPolicyWindow; windowSeconds?: number; recipients?: string[]; resourceOrigins?: string[]; actionScopes?: string[]; assets?: string[]; networks?: string[]; merchantIds?: string[]; purposes?: string[]; projectIds?: string[]; costCenters?: string[]; requireVerifiedMerchant?: boolean; priority?: number; validFrom?: string; validUntil?: string; } export interface WalletSpendPolicy { policyId: string; developerId: string; principalId: string | null; name: string; description: string | null; scopeType: WalletSpendPolicyScope; scopeId: string | null; effect: WalletSpendPolicyEffect; onExceed: 'deny' | 'require_approval'; maxAmount: string | null; maxCount: number | null; windowType: WalletSpendPolicyWindow; windowSeconds: number | null; recipients: string[]; resourceOrigins: string[]; actionScopes: string[]; assets: string[]; networks: string[]; merchantIds: string[]; purposes: string[]; projectIds: string[]; costCenters: string[]; requireVerifiedMerchant: boolean; priority: number; status: WalletSpendPolicyStatus; version: number; validFrom: string; validUntil: string | null; createdAt: string; updatedAt: string; } export interface WalletPaymentApproval { approvalRequestId: string; walletId: string; assignmentId: string; agentId: string; amount: string; asset: string; network: string; recipient: string; resource: string; scope: string; merchantId: string | null; purpose: string | null; projectId: string | null; costCenter: string | null; policyIds: string[]; status: 'pending' | 'approved' | 'rejected' | 'consumed' | 'expired'; reason: string | null; expiresAt: string; decidedAt: string | null; consumedAt: string | null; reservationId: string | null; createdAt: string; updatedAt: string; } export interface WalletReloadRequest { reloadRequestId: string; walletId: string; assignmentId: string | null; agentId: string | null; amount: string; reason: string | null; status: 'pending' | 'approved' | 'rejected' | 'cancelled' | 'funded'; requestedBy: 'agent' | 'principal'; externalReference: string | null; createdAt: string; decidedAt: string | null; fundedAt: string | null; } export interface PrepaidWalletActivity { assignments: WalletAssignment[]; reservations: Array>; reloadRequests: WalletReloadRequest[]; ledger: Array>; policyDecisions: Array>; paymentApprovals: WalletPaymentApproval[]; } interface DpopResourceClient { fetch(input: string | URL, accessToken: string, init?: RequestInit): Promise; } export declare class PrepaidWalletAgentClient { #private; constructor(options: { oauthClient: OAuthAgentClient | DpopResourceClient; accessToken: string; resourceUrl?: string; }); setAccessToken(accessToken: string): void; list(): Promise; authorizePayment(params: PrepaidAuthorizationRequest): Promise; reconcileReservation(reservationId: string): Promise<{ reservationId: string; status: string; transaction: string | null; }>; requestReload(walletId: string, amount: string, idempotencyKey: string, reason?: string): Promise; /** Callback passed directly to @grantex/x402 createX402Agent(). */ readonly x402Authorizer: (params: PrepaidAuthorizationRequest) => Promise; } export declare class PrincipalPrepaidWalletClient { #private; constructor(options: { baseUrl: string; sessionToken: string; }); setSessionToken(sessionToken: string): void; create(params: CreatePrepaidWalletParams): Promise; list(): Promise; activity(walletId: string): Promise; assign(walletId: string, params: AssignPrepaidWalletParams): Promise; setAssignmentStatus(assignmentId: string, status: WalletAssignmentStatus, reason?: string): Promise; setWalletStatus(walletId: string, status: PrepaidWalletStatus, reason?: string): Promise; setAgentBlocked(agentId: string, blocked: boolean, reason?: string): Promise<{ agentId: string; allWalletsBlocked: boolean; reason: string | null; }>; reload(walletId: string, amount: string, idempotencyKey: string, externalReference?: string): Promise; decideReload(requestId: string, decision: 'approved' | 'rejected'): Promise; fundReload(requestId: string, externalReference?: string): Promise; releaseReservation(reservationId: string, reason: string): Promise<{ reservationId: string; status: 'released'; }>; reconcileReservation(reservationId: string): Promise<{ reservationId: string; status: string; transaction: string | null; }>; createSpendPolicy(params: WalletSpendPolicyInput): Promise; listSpendPolicies(): Promise; setSpendPolicyStatus(policyId: string, status: WalletSpendPolicyStatus): Promise; listPaymentApprovals(): Promise; decidePaymentApproval(approvalRequestId: string, decision: 'approved' | 'rejected', reason?: string): Promise; } /** Developer API-key client for organization-wide and cross-principal wallet policy. */ export declare class DeveloperPrepaidWalletPolicyClient { #private; constructor(options: { baseUrl: string; apiKey: string; }); setApiKey(apiKey: string): void; create(params: WalletSpendPolicyInput): Promise; list(): Promise; setStatus(policyId: string, status: WalletSpendPolicyStatus): Promise; } export {}; //# sourceMappingURL=prepaid-wallets.d.ts.map