/** * Open Payments Arazzo SDK — Auto-generated workflow functions * * Generated from Arazzo 1.0.1 workflow specifications. * Do not edit manually — regenerate with: arazzo-sdk generate * * @generated */ import type { WorkflowResult, AuthProvider, GnapAuthConfig, ExecutionHooks, InteractionHandler } from '../runtime/types.js'; /** Open Payments amount object */ export interface Amount { /** Amount in minor units (e.g., "2500" for $25.00) */ value: string; /** Currency code (e.g., "USD") */ assetCode: string; /** Asset scale (e.g., 2 for cents) */ assetScale: number; } export interface ListIncomingPaymentsInputs { /** The wallet address to list incoming payments for */ walletAddressUrl: string; /** The client's wallet address for GNAP identification */ clientWalletAddress: string; /** Number of results to return (forward pagination) */ first?: number; /** Pagination cursor from a previous response */ cursor?: string; } export interface ListIncomingPaymentsOutputs { /** Resolved from: $steps.listIncomingPayments.outputs.incomingPayments */ incomingPayments: unknown; /** Resolved from: $steps.listIncomingPayments.outputs.paginationEndCursor */ nextCursor: unknown; /** Resolved from: $steps.listIncomingPayments.outputs.hasNextPage */ hasNextPage: boolean; } export interface ListOutgoingPaymentsInputs { /** The wallet address to list outgoing payments for */ walletAddressUrl: string; /** The client's wallet address for GNAP identification */ clientWalletAddress: string; /** Number of results to return */ first?: number; /** Pagination cursor */ cursor?: string; } export interface ListOutgoingPaymentsOutputs { /** Resolved from: $steps.listOutgoingPayments.outputs.outgoingPayments */ outgoingPayments: unknown; /** Resolved from: $steps.listOutgoingPayments.outputs.paginationEndCursor */ nextCursor: unknown; /** Resolved from: $steps.listOutgoingPayments.outputs.hasNextPage */ hasNextPage: boolean; } export interface GetPaymentDetailsInputs { /** Wallet address URL */ walletAddressUrl: string; /** Client's wallet address */ clientWalletAddress: string; /** ID of the incoming payment to retrieve */ incomingPaymentId?: string; /** ID of the outgoing payment to retrieve */ outgoingPaymentId?: string; } export interface GetPaymentDetailsOutputs { /** Resolved from: $steps.getIncomingPayment.outputs.incomingPayment */ incomingPayment: unknown; /** Resolved from: $steps.getOutgoingPayment.outputs.outgoingPayment */ outgoingPayment: unknown; } export interface RotateAccessTokenInputs { /** The `manage` URL of the access token to rotate. This was provided in the original grant response as `access_token.manage`. */ tokenManageUrl: string; } export interface RotateAccessTokenOutputs { /** Resolved from: $steps.rotateToken.outputs.newAccessTokenValue */ accessToken: string; /** Resolved from: $steps.rotateToken.outputs.newManageUrl */ manageUrl: string; /** Resolved from: $steps.rotateToken.outputs.expiresIn */ expiresIn: string; } export interface RevokeAccessTokenInputs { /** The `manage` URL of the access token to revoke. */ tokenManageUrl: string; } export interface CancelGrantInputs { /** The continuation URI from the original grant response (`continue.uri`). */ continueUri: string; } export interface SetupRecurringPaymentInputs { /** Recipient's wallet address URL */ recipientWalletAddressUrl: string; /** Sender's wallet address URL */ senderWalletAddressUrl: string; /** Maximum debit amount per interval (minor units) */ debitAmountPerInterval: string; /** Currency code (e.g. USD) */ debitAssetCode: string; /** Asset scale (e.g. 2) */ debitAssetScale: number; /** ISO 8601 repeating interval (e.g. 'R12/2024-01-01T00:00:00Z/P1M' for 12 monthly periods starting Jan 1 2024) */ interval: string; /** Client's wallet address */ clientWalletAddress: string; /** Redirect URI after interaction */ finishUri?: string; /** Unique nonce for the finish step */ finishNonce?: string; } export interface SetupRecurringPaymentOutputs { /** Resolved from: $steps.continueRecurringGrant.outputs.outgoingPaymentAccessToken */ outgoingPaymentAccessToken: string; /** Resolved from: $steps.continueRecurringGrant.outputs.outgoingPaymentManageUrl */ outgoingPaymentManageUrl: string; /** Resolved from: $steps.createOutgoingPayment.outputs.outgoingPaymentId */ firstPaymentId: string; /** Resolved from: $steps.createIncomingPayment.outputs.incomingPaymentUrl */ incomingPaymentUrl: string; } export interface OneTimePaymentFixedSendInputs { /** The recipient's wallet address URL */ recipientWalletAddressUrl: string; /** The sender's wallet address URL */ senderWalletAddressUrl: string; /** Amount to debit in minor units (e.g. '2500' for $25.00 with scale 2) */ debitAmount: string; /** Currency code of the sender's asset (e.g. USD) */ debitAssetCode: string; /** Asset scale (e.g. 2 for USD cents) */ debitAssetScale: number; /** The client's wallet address for GNAP identification */ clientWalletAddress: string; /** URI to redirect the user to after interaction */ finishUri?: string; /** Unique nonce for the interaction finish */ finishNonce?: string; } export interface OneTimePaymentFixedSendOutputs { /** Resolved from: $steps.createIncomingPayment.outputs.incomingPaymentUrl */ incomingPaymentUrl: string; /** Resolved from: $steps.createQuote.outputs.quoteId */ quoteId: string; /** Resolved from: $steps.createOutgoingPayment.outputs.outgoingPaymentId */ outgoingPaymentId: string; /** Resolved from: $steps.createQuote.outputs.debitAmount */ debitAmount: Amount; /** Resolved from: $steps.createQuote.outputs.receiveAmount */ receiveAmount: Amount; } export interface OneTimePaymentFixedReceiveInputs { /** The recipient's wallet address URL (e.g. https://wallet.example.com/alice) */ recipientWalletAddressUrl: string; /** The sender's wallet address URL (e.g. https://wallet.example.com/bob) */ senderWalletAddressUrl: string; /** Amount to receive in minor units (e.g. '2500' for $25.00 with scale 2) */ amount: string; /** Currency code (e.g. USD) */ assetCode: string; /** Asset scale (e.g. 2 for USD cents) */ assetScale: number; /** The client's wallet address for GNAP identification */ clientWalletAddress: string; /** URI to redirect the user to after interaction (optional, defaults to client callback) */ finishUri?: string; /** Unique nonce for the interaction finish (optional) */ finishNonce?: string; } export interface OneTimePaymentFixedReceiveOutputs { /** Resolved from: $steps.createIncomingPayment.outputs.incomingPaymentUrl */ incomingPaymentUrl: string; /** Resolved from: $steps.createQuote.outputs.quoteId */ quoteId: string; /** Resolved from: $steps.createOutgoingPayment.outputs.outgoingPaymentId */ outgoingPaymentId: string; /** Resolved from: $steps.createQuote.outputs.debitAmount */ debitAmount: Amount; /** Resolved from: $steps.createQuote.outputs.receiveAmount */ receiveAmount: Amount; } /** * OpenPaymentsClient — typed workflow executor for Open Payments API. * * Usage: * ```typescript * const client = new OpenPaymentsClient({ * clientWalletAddress: 'https://wallet.example.com/me', * serverUrls: { * walletAddressServer: 'https://wallet.example.com', * resourceServer: 'https://wallet.example.com', * authServer: 'https://auth.wallet.example.com', * }, * }); * * const result = await client.oneTimePaymentFixedReceive({ ... }); * ``` */ export declare class OpenPaymentsClient { private serverUrls; private authProvider?; private hooks?; private interactionHandler?; constructor(options: { /** Base URLs for each source description */ serverUrls: Record; /** GNAP auth configuration */ gnapConfig?: GnapAuthConfig; /** Custom auth provider (overrides gnapConfig) */ authProvider?: AuthProvider; /** Execution hooks for monitoring */ hooks?: ExecutionHooks; /** * Handler for interactive GNAP grants requiring user consent. * Called when a workflow step returns an interact.redirect URL. * Must return the interact_ref from the redirect callback. */ interactionHandler?: InteractionHandler; }); /** * Set the GNAP access token for a source. * Call this after obtaining tokens from grant requests. */ setToken(sourceName: string, token: string): void; /** * List all incoming payments on a wallet address */ listIncomingPayments(inputs: ListIncomingPaymentsInputs): Promise; /** * List all outgoing payments on a wallet address */ listOutgoingPayments(inputs: ListOutgoingPaymentsInputs): Promise; /** * Get details of a specific incoming or outgoing payment */ getPaymentDetails(inputs: GetPaymentDetailsInputs): Promise; /** * Rotate an existing GNAP access token */ rotateAccessToken(inputs: RotateAccessTokenInputs): Promise; /** * Revoke an active GNAP access token */ revokeAccessToken(inputs: RevokeAccessTokenInputs): Promise & { _raw: WorkflowResult; }>; /** * Cancel an active GNAP grant */ cancelGrant(inputs: CancelGrantInputs): Promise & { _raw: WorkflowResult; }>; /** * Set up a recurring payment grant with interval limits */ setupRecurringPayment(inputs: SetupRecurringPaymentInputs): Promise; /** * One-time payment with a fixed send (debit) amount */ oneTimePaymentFixedSend(inputs: OneTimePaymentFixedSendInputs): Promise; /** * One-time payment with a fixed receive amount */ oneTimePaymentFixedReceive(inputs: OneTimePaymentFixedReceiveInputs): Promise; } //# sourceMappingURL=open-payments-client.d.ts.map