stables-mcp-server 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Stables
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,277 @@
1
+ # Stables MCP Server
2
+
3
+ An MCP (Model Context Protocol) server that exposes the Stables fiat-to-crypto API to AI agents. This allows AI assistants like Claude, ChatGPT, and others to manage customers, create quotes, execute transfers, and handle virtual accounts programmatically.
4
+
5
+ ## What is MCP?
6
+
7
+ MCP (Model Context Protocol) is an open standard that provides a standardized way to connect AI applications to external tools and data sources. Think of it like a "USB-C port for AI" - any AI that supports MCP can use any MCP server.
8
+
9
+ ## Features
10
+
11
+ This MCP server provides the following tools:
12
+
13
+ ### Customer Management
14
+ - `create_customer` - Create individual or business customers
15
+ - `get_customer` - Get customer details and verification status
16
+ - `list_customers` - List all customers with pagination
17
+ - `get_verification_link` - Generate KYC verification links
18
+
19
+ ### Quotes
20
+ - `create_quote` - Get exchange rate quotes for currency conversion
21
+ - `get_quote` - Check quote status and details
22
+
23
+ ### Transfers
24
+ - `create_transfer` - Execute a transfer using an active quote
25
+ - `get_transfer` - Check transfer status
26
+ - `list_transfers` - List transfers with filters
27
+
28
+ ### Virtual Accounts
29
+ - `create_virtual_account` - Create virtual bank accounts for fiat deposits
30
+ - `list_virtual_accounts` - List virtual accounts for a customer
31
+
32
+ ## Installation
33
+
34
+ ```bash
35
+ # Clone or download the repository
36
+ cd stables-mcp-server
37
+
38
+ # Install dependencies
39
+ npm install
40
+
41
+ # Build the TypeScript
42
+ npm run build
43
+ ```
44
+
45
+ ## Configuration
46
+
47
+ The server requires the following environment variables:
48
+
49
+ | Variable | Required | Description |
50
+ |----------|----------|-------------|
51
+ | `STABLES_API_KEY` | Yes | Your Stables API key |
52
+ | `STABLES_API_URL` | No | API base URL (default: `https://sandbox.stables-api.com`) |
53
+
54
+ ## Usage
55
+
56
+ ### With Claude Desktop
57
+
58
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
59
+
60
+ ```json
61
+ {
62
+ "mcpServers": {
63
+ "stables": {
64
+ "command": "node",
65
+ "args": ["/path/to/stables-mcp-server/build/index.js"],
66
+ "env": {
67
+ "STABLES_API_KEY": "your-api-key",
68
+ "STABLES_API_URL": "https://sandbox.stables-api.com"
69
+ }
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ Then restart Claude Desktop.
76
+
77
+ ### With MCP Inspector (for testing)
78
+
79
+ ```bash
80
+ # Set environment variables
81
+ export STABLES_API_KEY=your-api-key
82
+ export STABLES_API_URL=https://sandbox.stables-api.com
83
+
84
+ # Run the inspector
85
+ npm run inspect
86
+ ```
87
+
88
+ ### Direct Execution
89
+
90
+ ```bash
91
+ STABLES_API_KEY=your-api-key node build/index.js
92
+ ```
93
+
94
+ ## Example Conversations
95
+
96
+ ### Creating a customer and getting a quote
97
+
98
+ **User:** "Create a customer for john@example.com and get a quote for $1000 USD to USDC"
99
+
100
+ **AI (using MCP tools):**
101
+ 1. Calls `create_customer` with email and type
102
+ 2. Calls `create_quote` with customer ID, USD amount, and USDC destination
103
+ 3. Returns customer details and quote information
104
+
105
+ ### Checking transfer status
106
+
107
+ **User:** "What's the status of all my pending transfers?"
108
+
109
+ **AI (using MCP tools):**
110
+ 1. Calls `list_transfers` with `status=PENDING`
111
+ 2. Returns formatted list of pending transfers
112
+
113
+ ### Setting up auto-payout
114
+
115
+ **User:** "Create a virtual USD account for customer abc123 that auto-pays to my Polygon USDC wallet 0x..."
116
+
117
+ **AI (using MCP tools):**
118
+ 1. Calls `create_virtual_account` with customer ID, USD currency, and Polygon destination
119
+ 2. Returns virtual account details with deposit instructions
120
+
121
+ ## Development
122
+
123
+ ```bash
124
+ # Watch mode for development
125
+ npm run dev
126
+
127
+ # Build for production
128
+ npm run build
129
+
130
+ # Test with MCP Inspector
131
+ npm run inspect
132
+ ```
133
+
134
+ ## Project Structure
135
+
136
+ ```
137
+ stables-mcp-server/
138
+ ├── src/
139
+ │ ├── index.ts # Main entry point
140
+ │ ├── lib/
141
+ │ │ └── stables-client.ts # Stables API client
142
+ │ └── tools/
143
+ │ ├── customers.ts # Customer management tools
144
+ │ ├── quotes.ts # Quote tools
145
+ │ ├── transfers.ts # Transfer tools
146
+ │ └── virtual-accounts.ts # Virtual account tools
147
+ ├── package.json
148
+ ├── tsconfig.json
149
+ └── README.md
150
+ ```
151
+
152
+ ## API Reference
153
+
154
+ ### Customer Tools
155
+
156
+ #### create_customer
157
+ Create a new customer for KYC and transfers.
158
+
159
+ | Parameter | Type | Required | Description |
160
+ |-----------|------|----------|-------------|
161
+ | email | string | Yes | Customer's email |
162
+ | customerType | "individual" \| "business" | Yes | Type of customer |
163
+ | firstName | string | No | First name (for individuals) |
164
+ | lastName | string | No | Last name (for individuals) |
165
+ | businessName | string | No | Business name (for businesses) |
166
+
167
+ #### get_customer
168
+ Get customer details.
169
+
170
+ | Parameter | Type | Required | Description |
171
+ |-----------|------|----------|-------------|
172
+ | customerId | string | Yes | Customer ID |
173
+
174
+ #### list_customers
175
+ List all customers.
176
+
177
+ | Parameter | Type | Required | Description |
178
+ |-----------|------|----------|-------------|
179
+ | pageSize | number | No | Results per page |
180
+ | pageToken | string | No | Pagination token |
181
+
182
+ #### get_verification_link
183
+ Generate a KYC verification link.
184
+
185
+ | Parameter | Type | Required | Description |
186
+ |-----------|------|----------|-------------|
187
+ | customerId | string | Yes | Customer ID |
188
+ | verificationType | "KYC" \| "KYB" | No | Verification type |
189
+
190
+ ### Quote Tools
191
+
192
+ #### create_quote
193
+ Get a quote for currency exchange.
194
+
195
+ | Parameter | Type | Required | Description |
196
+ |-----------|------|----------|-------------|
197
+ | customerId | string | Yes | Customer ID |
198
+ | fromCurrency | string | Yes | Source currency (e.g., "USD") |
199
+ | fromAmount | string | Yes | Amount to convert |
200
+ | toCurrency | string | Yes | Destination currency (e.g., "USDC") |
201
+ | toCountry | string | No | Country for fiat payouts |
202
+ | fromNetwork | string | No | Blockchain network |
203
+
204
+ #### get_quote
205
+ Get quote details.
206
+
207
+ | Parameter | Type | Required | Description |
208
+ |-----------|------|----------|-------------|
209
+ | quoteId | string | Yes | Quote ID |
210
+
211
+ ### Transfer Tools
212
+
213
+ #### create_transfer
214
+ Execute a transfer from a quote.
215
+
216
+ | Parameter | Type | Required | Description |
217
+ |-----------|------|----------|-------------|
218
+ | customerId | string | Yes | Customer ID |
219
+ | quoteId | string | Yes | Quote ID to execute |
220
+ | metadata | object | No | Optional metadata |
221
+
222
+ #### get_transfer
223
+ Get transfer status.
224
+
225
+ | Parameter | Type | Required | Description |
226
+ |-----------|------|----------|-------------|
227
+ | transferId | string | Yes | Transfer ID |
228
+
229
+ #### list_transfers
230
+ List transfers with filters.
231
+
232
+ | Parameter | Type | Required | Description |
233
+ |-----------|------|----------|-------------|
234
+ | status | string | No | Filter by status |
235
+ | type | string | No | Filter by type |
236
+ | customerId | string | No | Filter by customer |
237
+ | pageSize | number | No | Results per page |
238
+ | pageToken | string | No | Pagination token |
239
+
240
+ ### Virtual Account Tools
241
+
242
+ #### create_virtual_account
243
+ Create a virtual bank account.
244
+
245
+ | Parameter | Type | Required | Description |
246
+ |-----------|------|----------|-------------|
247
+ | customerId | string | Yes | Customer ID |
248
+ | sourceCurrency | string | Yes | Currency (e.g., "USD") |
249
+ | depositHandlingMode | string | No | "auto_payout", "hold", or "manual" |
250
+ | destinationAddress | string | No | Crypto wallet address |
251
+ | destinationNetwork | string | No | Blockchain network |
252
+ | destinationCurrency | string | No | Stablecoin (default: "usdc") |
253
+
254
+ #### list_virtual_accounts
255
+ List virtual accounts for a customer.
256
+
257
+ | Parameter | Type | Required | Description |
258
+ |-----------|------|----------|-------------|
259
+ | customerId | string | Yes | Customer ID |
260
+ | status | string | No | Filter by status |
261
+ | limit | number | No | Max results |
262
+
263
+ ## Security
264
+
265
+ - API keys are only read from environment variables
266
+ - Never log sensitive data (breaks STDIO transport)
267
+ - All inputs are validated with Zod schemas
268
+
269
+ ## License
270
+
271
+ MIT
272
+
273
+ ## Links
274
+
275
+ - [Stables API Documentation](https://docs.stables.money)
276
+ - [Model Context Protocol](https://modelcontextprotocol.io)
277
+ - [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Stables MCP Server
4
+ *
5
+ * This server exposes the Stables fiat-to-crypto API to AI agents via the
6
+ * Model Context Protocol (MCP). It enables AI assistants to manage customers,
7
+ * create quotes, execute transfers, and handle virtual accounts.
8
+ *
9
+ * Usage:
10
+ * STABLES_API_KEY=your-key node build/index.js
11
+ *
12
+ * For Claude Desktop, add to ~/Library/Application Support/Claude/claude_desktop_config.json:
13
+ * {
14
+ * "mcpServers": {
15
+ * "stables": {
16
+ * "command": "node",
17
+ * "args": ["/path/to/stables-mcp-server/build/index.js"],
18
+ * "env": {
19
+ * "STABLES_API_KEY": "your-api-key",
20
+ * "STABLES_API_URL": "https://api.sandbox.stables.money"
21
+ * }
22
+ * }
23
+ * }
24
+ * }
25
+ */
26
+ export {};
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG"}
package/build/index.js ADDED
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Stables MCP Server
4
+ *
5
+ * This server exposes the Stables fiat-to-crypto API to AI agents via the
6
+ * Model Context Protocol (MCP). It enables AI assistants to manage customers,
7
+ * create quotes, execute transfers, and handle virtual accounts.
8
+ *
9
+ * Usage:
10
+ * STABLES_API_KEY=your-key node build/index.js
11
+ *
12
+ * For Claude Desktop, add to ~/Library/Application Support/Claude/claude_desktop_config.json:
13
+ * {
14
+ * "mcpServers": {
15
+ * "stables": {
16
+ * "command": "node",
17
+ * "args": ["/path/to/stables-mcp-server/build/index.js"],
18
+ * "env": {
19
+ * "STABLES_API_KEY": "your-api-key",
20
+ * "STABLES_API_URL": "https://api.sandbox.stables.money"
21
+ * }
22
+ * }
23
+ * }
24
+ * }
25
+ */
26
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
27
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
28
+ import { createStablesClient } from "./lib/stables-client.js";
29
+ import { registerCustomerTools } from "./tools/customers.js";
30
+ import { registerQuoteTools } from "./tools/quotes.js";
31
+ import { registerTransferTools } from "./tools/transfers.js";
32
+ import { registerVirtualAccountTools } from "./tools/virtual-accounts.js";
33
+ import { registerApiKeyTools } from "./tools/api-keys.js";
34
+ import { registerWebhookTools } from "./tools/webhooks.js";
35
+ // Validate environment
36
+ const apiKey = process.env.STABLES_API_KEY;
37
+ if (!apiKey) {
38
+ console.error("Error: STABLES_API_KEY environment variable is required");
39
+ process.exit(1);
40
+ }
41
+ // Create the MCP server
42
+ const server = new McpServer({
43
+ name: "stables-mcp-server",
44
+ version: "1.0.0",
45
+ description: "Stables fiat-to-crypto API for AI agents - manage customers, quotes, transfers, and virtual accounts",
46
+ });
47
+ // Create the Stables API client
48
+ const stablesClient = createStablesClient();
49
+ // Register all tools
50
+ registerCustomerTools(server, stablesClient);
51
+ registerQuoteTools(server, stablesClient);
52
+ registerTransferTools(server, stablesClient);
53
+ registerVirtualAccountTools(server, stablesClient);
54
+ registerApiKeyTools(server, stablesClient);
55
+ registerWebhookTools(server, stablesClient);
56
+ // Start the server with STDIO transport
57
+ async function main() {
58
+ const transport = new StdioServerTransport();
59
+ await server.connect(transport);
60
+ }
61
+ main().catch((error) => {
62
+ console.error("Failed to start server:", error);
63
+ process.exit(1);
64
+ });
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,uBAAuB;AACvB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AAC3C,IAAI,CAAC,MAAM,EAAE,CAAC;IACZ,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;IACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,wBAAwB;AACxB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,sGAAsG;CACpH,CAAC,CAAC;AAEH,gCAAgC;AAChC,MAAM,aAAa,GAAG,mBAAmB,EAAE,CAAC;AAE5C,qBAAqB;AACrB,qBAAqB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAC7C,kBAAkB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAC1C,qBAAqB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAC7C,2BAA2B,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AACnD,mBAAmB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAC3C,oBAAoB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAE5C,wCAAwC;AACxC,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,295 @@
1
+ /**
2
+ * Stables API Client for MCP Server
3
+ * Updated to match official Stables API documentation
4
+ * Docs: https://docs.stables.money
5
+ */
6
+ export type CustomerType = "CUSTOMER_TYPE_INDIVIDUAL" | "CUSTOMER_TYPE_BUSINESS" | "CUSTOMER_TYPE_TRUST" | "CUSTOMER_TYPE_NONPROFIT" | "CUSTOMER_TYPE_DAO";
7
+ export type VerificationStatus = "VERIFICATION_PENDING" | "VERIFICATION_IN_PROGRESS" | "VERIFICATION_IN_REVIEW" | "VERIFICATION_APPROVED" | "VERIFICATION_REJECTED" | "VERIFICATION_NEEDS_INFO";
8
+ export interface VerificationLevel {
9
+ id: string;
10
+ customerId: string;
11
+ kycLevel: string;
12
+ status: VerificationStatus;
13
+ createdAt: string;
14
+ updatedAt: string;
15
+ }
16
+ export interface CustomerAddress {
17
+ line1: string;
18
+ line2?: string;
19
+ city: string;
20
+ state?: string;
21
+ postalCode?: string;
22
+ country: string;
23
+ }
24
+ export interface Customer {
25
+ customerId: string;
26
+ externalCustomerId?: string;
27
+ customerType: CustomerType;
28
+ email?: string;
29
+ phone?: string;
30
+ firstName?: string;
31
+ lastName?: string;
32
+ middleName?: string;
33
+ businessName?: string;
34
+ dob?: string;
35
+ nationality?: string;
36
+ address?: CustomerAddress;
37
+ createdAt: string;
38
+ updatedAt: string;
39
+ verificationLevels: VerificationLevel[];
40
+ metadata?: Record<string, string>;
41
+ }
42
+ export interface CreateCustomerRequest {
43
+ externalCustomerId?: string;
44
+ customerType: CustomerType;
45
+ email: string;
46
+ firstName?: string;
47
+ lastName?: string;
48
+ middleName?: string;
49
+ businessName?: string;
50
+ phone?: string;
51
+ dob?: string;
52
+ nationality?: string;
53
+ address?: CustomerAddress;
54
+ entitlements?: string[];
55
+ metadata?: Record<string, string>;
56
+ }
57
+ export interface ListCustomersResponse {
58
+ customers: Customer[];
59
+ page: {
60
+ nextPageToken: string;
61
+ total: number;
62
+ };
63
+ }
64
+ export type TransferType = "TRANSFER_TYPE_OFFRAMP" | "TRANSFER_TYPE_ONRAMP";
65
+ export type TransferStatus = "PENDING" | "IN_PROGRESS" | "COMPLETED" | "FAILED" | "CANCELLED" | "EXPIRED";
66
+ export interface BankTransferDetails {
67
+ accountHolderName: string;
68
+ iban?: string;
69
+ bankName?: string;
70
+ bankCountry?: string;
71
+ currency?: string;
72
+ bankCodes?: {
73
+ swiftCode?: string;
74
+ routingNumber?: string;
75
+ sortCode?: string;
76
+ };
77
+ accountNumber?: string;
78
+ }
79
+ export interface PaymentMethod {
80
+ bankTransfer: BankTransferDetails;
81
+ }
82
+ export interface CollectionInstructions {
83
+ walletAddress: string;
84
+ currency: string;
85
+ network: string;
86
+ amount: string;
87
+ }
88
+ export interface Transfer {
89
+ id: string;
90
+ tenantId: string;
91
+ customerId: string;
92
+ quoteId: string;
93
+ type: TransferType;
94
+ status: TransferStatus;
95
+ createdAt: string;
96
+ updatedAt: string;
97
+ collectionInstructions?: CollectionInstructions;
98
+ metadata?: Record<string, string>;
99
+ }
100
+ export interface CreateTransferRequest {
101
+ customerId: string;
102
+ quoteId: string;
103
+ paymentMethod?: PaymentMethod;
104
+ metadata?: Record<string, string>;
105
+ }
106
+ export interface ListTransfersResponse {
107
+ transfers: Transfer[];
108
+ page: {
109
+ nextPageToken: string;
110
+ total: number;
111
+ };
112
+ }
113
+ export type VirtualAccountStatus = "activated" | "deactivated" | "pending" | "closed";
114
+ export type Network = "arbitrum" | "avalanche_c_chain" | "base" | "ethereum" | "optimism" | "polygon" | "solana" | "stellar" | "tron";
115
+ export type Stablecoin = "usdc" | "usdt" | "dai" | "pyusd" | "eurc";
116
+ export type DepositHandlingMode = "auto_payout" | "hold" | "manual";
117
+ export interface VirtualAccount {
118
+ id: string;
119
+ status: VirtualAccountStatus;
120
+ customer_id: string;
121
+ created_at: string;
122
+ source_deposit_instructions: {
123
+ currency: string;
124
+ payment_rails: string[];
125
+ bank_name?: string;
126
+ bank_account_number?: string;
127
+ bank_routing_number?: string;
128
+ };
129
+ deposit_handling_mode: DepositHandlingMode;
130
+ active_destination: {
131
+ id: string;
132
+ currency: string;
133
+ network: string;
134
+ address: string;
135
+ } | null;
136
+ }
137
+ export interface CreateVirtualAccountRequest {
138
+ source: {
139
+ currency: string;
140
+ };
141
+ deposit_handling_mode?: DepositHandlingMode;
142
+ initial_destination?: {
143
+ label?: string;
144
+ currency: Stablecoin;
145
+ network: Network;
146
+ address: string;
147
+ };
148
+ }
149
+ export interface ListVirtualAccountsResponse {
150
+ count: number;
151
+ data: VirtualAccount[];
152
+ }
153
+ export type QuoteStatus = "QUOTE_STATUS_ACTIVE" | "QUOTE_STATUS_EXPIRED" | "QUOTE_STATUS_USED";
154
+ export type PaymentMethodType = "SWIFT" | "LOCAL";
155
+ export interface Quote {
156
+ quoteId: string;
157
+ from: {
158
+ currency: string;
159
+ amount: string;
160
+ network?: string;
161
+ };
162
+ to: {
163
+ currency: string;
164
+ amount: string;
165
+ paymentMethodType?: PaymentMethodType;
166
+ };
167
+ fees: {
168
+ totalFee: {
169
+ currency: string;
170
+ amount: string;
171
+ };
172
+ };
173
+ exchangeRate: number;
174
+ expiresAt: string;
175
+ createdAt: string;
176
+ status: QuoteStatus;
177
+ }
178
+ export interface CreateQuoteRequest {
179
+ customerId: string;
180
+ from: {
181
+ currency: string;
182
+ amount: string;
183
+ network?: string;
184
+ };
185
+ to: {
186
+ currency: string;
187
+ country?: string;
188
+ paymentMethodType?: PaymentMethodType;
189
+ };
190
+ }
191
+ export interface CreateQuoteResponse {
192
+ quote: Quote;
193
+ }
194
+ export interface ApiKey {
195
+ id: string;
196
+ apiKeyId?: string;
197
+ name: string;
198
+ prefix: string;
199
+ active?: boolean;
200
+ createdAt: string;
201
+ updatedAt?: string;
202
+ lastUsedAt?: string;
203
+ metadata?: Record<string, string>;
204
+ }
205
+ export interface CreateApiKeyRequest {
206
+ name: string;
207
+ metadata?: Record<string, string>;
208
+ }
209
+ export interface CreateApiKeyResponse {
210
+ apiKey: {
211
+ apiKeyId: string;
212
+ tenantId: string;
213
+ name: string;
214
+ prefix: string;
215
+ active: boolean;
216
+ createdAt: string;
217
+ updatedAt: string;
218
+ };
219
+ plaintextKey: string;
220
+ }
221
+ export interface WebhookSubscription {
222
+ subscriptionId: string;
223
+ name: string;
224
+ url: string;
225
+ eventTypes: string[];
226
+ active: boolean;
227
+ createdAt: string;
228
+ updatedAt?: string;
229
+ }
230
+ export interface CreateWebhookRequest {
231
+ name: string;
232
+ url: string;
233
+ eventTypes: string[];
234
+ secret?: string;
235
+ }
236
+ export declare class StablesApiClient {
237
+ private apiKey;
238
+ private baseUrl;
239
+ constructor(apiKey: string, baseUrl: string);
240
+ private request;
241
+ private generateIdempotencyKey;
242
+ listCustomers(params?: {
243
+ pageSize?: number;
244
+ pageToken?: string;
245
+ }): Promise<ListCustomersResponse>;
246
+ getCustomer(customerId: string): Promise<Customer>;
247
+ createCustomer(data: CreateCustomerRequest): Promise<Customer>;
248
+ generateVerificationLink(customerId: string, options?: {
249
+ verificationType?: "KYC" | "KYB";
250
+ kycLevel?: string;
251
+ }): Promise<{
252
+ customerId: string;
253
+ kycLink: string;
254
+ }>;
255
+ listVirtualAccounts(customerId: string, params?: {
256
+ status?: string;
257
+ limit?: number;
258
+ }): Promise<ListVirtualAccountsResponse>;
259
+ createVirtualAccount(customerId: string, data: CreateVirtualAccountRequest): Promise<VirtualAccount>;
260
+ listTransfers(params?: {
261
+ status?: string;
262
+ type?: string;
263
+ customerId?: string;
264
+ pageSize?: number;
265
+ pageToken?: string;
266
+ }): Promise<ListTransfersResponse>;
267
+ getTransfer(transferId: string): Promise<Transfer>;
268
+ createTransfer(data: CreateTransferRequest): Promise<Transfer>;
269
+ createQuote(data: CreateQuoteRequest): Promise<CreateQuoteResponse>;
270
+ getQuote(quoteId: string): Promise<{
271
+ quote: Quote;
272
+ }>;
273
+ listApiKeys(params?: {
274
+ pageSize?: number;
275
+ pageToken?: string;
276
+ }): Promise<{
277
+ apiKeys: ApiKey[];
278
+ }>;
279
+ createApiKey(data: CreateApiKeyRequest): Promise<CreateApiKeyResponse>;
280
+ getApiKey(apiKeyId: string): Promise<ApiKey>;
281
+ revokeApiKey(apiKeyId: string): Promise<{
282
+ success: boolean;
283
+ }>;
284
+ listWebhooks(): Promise<{
285
+ subscriptions: WebhookSubscription[];
286
+ }>;
287
+ createWebhook(data: CreateWebhookRequest): Promise<{
288
+ subscription: WebhookSubscription;
289
+ }>;
290
+ deleteWebhook(subscriptionId: string): Promise<{
291
+ success: boolean;
292
+ }>;
293
+ }
294
+ export declare function createStablesClient(): StablesApiClient;
295
+ //# sourceMappingURL=stables-client.d.ts.map