@epochcore/qaas-sdk 1.0.0 → 1.2.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/README.md +45 -24
- package/dist/index.d.mts +92 -54
- package/dist/index.d.ts +92 -54
- package/dist/index.js +344 -76
- package/dist/index.mjs +348 -75
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/* QUANTUM_WATERMARK
|
|
2
|
+
* RAS=e5586ef939094a8e
|
|
3
|
+
* SIG=0000000067b05a96
|
|
4
|
+
* TIME=2025-12-13T03:52:05.794Z
|
|
5
|
+
* FREQ=7777.77Hz
|
|
6
|
+
* COHERENCE=0.9999988268147311
|
|
7
|
+
* PHI=1.618033988749895
|
|
8
|
+
* EpochCore Quantum Protected
|
|
9
|
+
*/
|
|
10
|
+
|
|
1
11
|
<p align="center">
|
|
2
12
|
<img src="https://img.shields.io/badge/Quantum-Computing-6366f1?style=for-the-badge&logo=atom&logoColor=white" alt="Quantum Computing"/>
|
|
3
13
|
<img src="https://img.shields.io/badge/100+-Algorithms-10b981?style=for-the-badge" alt="100+ Algorithms"/>
|
|
@@ -38,10 +48,18 @@
|
|
|
38
48
|
</p>
|
|
39
49
|
|
|
40
50
|
<p align="center">
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<
|
|
51
|
+
<a href="https://qiskit.org">
|
|
52
|
+
<img src="https://img.shields.io/badge/IBM_Qiskit-6929C4?style=for-the-badge&logo=ibm&logoColor=white" alt="IBM Qiskit"/>
|
|
53
|
+
</a>
|
|
54
|
+
<a href="https://quantumai.google/cirq">
|
|
55
|
+
<img src="https://img.shields.io/badge/Google_Cirq-4285F4?style=for-the-badge&logo=google&logoColor=white" alt="Google Cirq"/>
|
|
56
|
+
</a>
|
|
57
|
+
<a href="https://pennylane.ai">
|
|
58
|
+
<img src="https://img.shields.io/badge/Xanadu_PennyLane-00B4D8?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0id2hpdGUiPjxwYXRoIGQ9Ik0xMiAyQzYuNDggMiAyIDYuNDggMiAxMnM0LjQ4IDEwIDEwIDEwIDEwLTQuNDggMTAtMTBTMTcuNTIgMiAxMiAyem0wIDE4Yy00LjQyIDAtOC0zLjU4LTgtOHMzLjU4LTggOC04IDggMy41OCA4IDgtMy41OCA4LTggOHoiLz48cGF0aCBkPSJNMTIgNmMtMy4zMSAwLTYgMi42OS02IDZzMi42OSA2IDYgNiA2LTIuNjkgNi02LTIuNjktNi02LTZ6bTAgMTBjLTIuMjEgMC00LTEuNzktNC00czEuNzktNCA0LTQgNCAxLjc5IDQgNC0xLjc5IDQtNCA0eiIvPjwvc3ZnPg==&logoColor=white" alt="Xanadu PennyLane"/>
|
|
59
|
+
</a>
|
|
60
|
+
<a href="https://www.typescriptlang.org">
|
|
61
|
+
<img src="https://img.shields.io/badge/TypeScript-3178C6?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript"/>
|
|
62
|
+
</a>
|
|
45
63
|
</p>
|
|
46
64
|
|
|
47
65
|
---
|
|
@@ -216,25 +234,25 @@ ID Name Category Use Case
|
|
|
216
234
|
|
|
217
235
|
## Pricing
|
|
218
236
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
|
222
|
-
|
|
223
|
-
| **
|
|
224
|
-
| **
|
|
237
|
+
### 🎉 100% Free During Beta
|
|
238
|
+
|
|
239
|
+
| Feature | Included |
|
|
240
|
+
|---------|----------|
|
|
241
|
+
| **All 100 Algorithms** | ✅ |
|
|
242
|
+
| **Unlimited API Calls** | ✅ |
|
|
243
|
+
| **Qiskit, Cirq, PennyLane** | ✅ |
|
|
244
|
+
| **Real IBM Quantum Access** | ✅ |
|
|
245
|
+
| **Full TypeScript SDK** | ✅ |
|
|
246
|
+
| **Community Discord** | ✅ |
|
|
225
247
|
|
|
226
248
|
<p align="center">
|
|
227
|
-
<a href="https://
|
|
228
|
-
<img src="https://img.shields.io/badge/
|
|
229
|
-
</a>
|
|
230
|
-
<a href="https://buy.stripe.com/9B628k3m36vy441e875Ne0B">
|
|
231
|
-
<img src="https://img.shields.io/badge/Get_Quant-$99/mo-10b981?style=for-the-badge" alt="Get Quant"/>
|
|
232
|
-
</a>
|
|
233
|
-
<a href="https://buy.stripe.com/4gMfZa5ub07a1VT6FF5Ne0C">
|
|
234
|
-
<img src="https://img.shields.io/badge/Get_Enterprise-$299/mo-f59e0b?style=for-the-badge" alt="Get Enterprise"/>
|
|
249
|
+
<a href="https://qaas.epochcoreqcs.com">
|
|
250
|
+
<img src="https://img.shields.io/badge/Get_Free_API_Key-10b981?style=for-the-badge" alt="Get Free API Key"/>
|
|
235
251
|
</a>
|
|
236
252
|
</p>
|
|
237
253
|
|
|
254
|
+
> 🚀 **Early adopters get lifetime free access.** Premium tiers coming soon.
|
|
255
|
+
|
|
238
256
|
---
|
|
239
257
|
|
|
240
258
|
## API Reference
|
|
@@ -401,13 +419,13 @@ npm run build
|
|
|
401
419
|
|
|
402
420
|
<p align="center">
|
|
403
421
|
<a href="https://qaas.epochcoreqcs.com">
|
|
404
|
-
<img src="https://img.shields.io/badge/Website-
|
|
422
|
+
<img src="https://img.shields.io/badge/Website-6366f1?style=for-the-badge&logo=googlechrome&logoColor=white" alt="Website"/>
|
|
405
423
|
</a>
|
|
406
424
|
<a href="https://qaas.epochcoreqcs.com/docs.html">
|
|
407
|
-
<img src="https://img.shields.io/badge/
|
|
425
|
+
<img src="https://img.shields.io/badge/API_Docs-10b981?style=for-the-badge&logo=readthedocs&logoColor=white" alt="Docs"/>
|
|
408
426
|
</a>
|
|
409
427
|
<a href="https://www.npmjs.com/package/@epochcore/qaas-sdk">
|
|
410
|
-
<img src="https://img.shields.io/badge/npm
|
|
428
|
+
<img src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white" alt="npm"/>
|
|
411
429
|
</a>
|
|
412
430
|
</p>
|
|
413
431
|
|
|
@@ -429,12 +447,15 @@ This SDK is provided for use with valid QaaS API subscriptions only. See [LICENS
|
|
|
429
447
|
|
|
430
448
|
<p align="center">
|
|
431
449
|
<a href="https://github.com/Jvryan92/qaas-sdk">
|
|
432
|
-
<img src="https://img.shields.io/badge/GitHub-
|
|
450
|
+
<img src="https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=github&logoColor=white" alt="GitHub"/>
|
|
451
|
+
</a>
|
|
452
|
+
<a href="https://www.npmjs.com/package/@epochcore/qaas-sdk">
|
|
453
|
+
<img src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white" alt="npm"/>
|
|
433
454
|
</a>
|
|
434
455
|
<a href="https://www.linkedin.com/in/john-ryan-515222377/">
|
|
435
|
-
<img src="https://img.shields.io/badge/LinkedIn-
|
|
456
|
+
<img src="https://img.shields.io/badge/LinkedIn-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white" alt="LinkedIn"/>
|
|
436
457
|
</a>
|
|
437
458
|
<a href="https://youtube.com/@maxmesh-hft">
|
|
438
|
-
<img src="https://img.shields.io/badge/YouTube-
|
|
459
|
+
<img src="https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white" alt="YouTube"/>
|
|
439
460
|
</a>
|
|
440
461
|
</p>
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
1
|
+
/** Max age for signed requests — server should reject older signatures */
|
|
2
|
+
declare const SIGNATURE_MAX_AGE_MS = 300000;
|
|
3
|
+
type ValidBackend = 'simulator' | 'qiskit_aer' | 'cirq' | 'pennylane' | 'ibm_quantum';
|
|
7
4
|
interface QaaSConfig {
|
|
8
5
|
apiKey?: string;
|
|
6
|
+
apiSecret?: string;
|
|
9
7
|
baseUrl?: string;
|
|
10
8
|
timeout?: number;
|
|
9
|
+
maxRetries?: number;
|
|
10
|
+
rateLimit?: number;
|
|
11
|
+
rateBurst?: number;
|
|
12
|
+
enableSigning?: boolean;
|
|
11
13
|
}
|
|
12
14
|
interface Algorithm {
|
|
13
15
|
id: number;
|
|
@@ -41,7 +43,7 @@ interface PricingResponse {
|
|
|
41
43
|
interface RunRequest {
|
|
42
44
|
algorithm_id: string;
|
|
43
45
|
parameters: Record<string, unknown>;
|
|
44
|
-
backend?:
|
|
46
|
+
backend?: ValidBackend;
|
|
45
47
|
shots?: number;
|
|
46
48
|
}
|
|
47
49
|
interface RunResponse {
|
|
@@ -76,15 +78,38 @@ interface HealthResponse {
|
|
|
76
78
|
frameworks: string[];
|
|
77
79
|
timestamp: string;
|
|
78
80
|
}
|
|
81
|
+
interface QRNGResponse {
|
|
82
|
+
bits: number;
|
|
83
|
+
value: string | number[] | string;
|
|
84
|
+
format: 'hex' | 'integer' | 'bytes';
|
|
85
|
+
entropy_source: string;
|
|
86
|
+
frequency?: number;
|
|
87
|
+
timestamp: string;
|
|
88
|
+
}
|
|
89
|
+
interface QRNGKeyResponse {
|
|
90
|
+
key: string;
|
|
91
|
+
bits: number;
|
|
92
|
+
algorithm: string;
|
|
93
|
+
timestamp: string;
|
|
94
|
+
}
|
|
95
|
+
interface QRNGUuidResponse {
|
|
96
|
+
uuid: string;
|
|
97
|
+
version: number;
|
|
98
|
+
algorithm: string;
|
|
99
|
+
timestamp: string;
|
|
100
|
+
}
|
|
79
101
|
type AlgorithmCategory = 'amplitude_estimation' | 'grover_search' | 'qaoa_optimization' | 'qubo' | 'bernstein_vazirani' | 'deutsch_jozsa' | 'simon' | 'phase_estimation' | 'variational' | 'qml_classification' | 'qml_regression' | 'qml_clustering' | 'qml_anomaly';
|
|
80
102
|
/**
|
|
81
|
-
* EpochCore QaaS Client
|
|
103
|
+
* EpochCore QaaS Client — Quantum-Hardened
|
|
82
104
|
*
|
|
83
105
|
* @example
|
|
84
106
|
* ```typescript
|
|
85
107
|
* import { QaaSClient } from '@epochcore/qaas-sdk';
|
|
86
108
|
*
|
|
87
|
-
* const client = new QaaSClient({
|
|
109
|
+
* const client = new QaaSClient({
|
|
110
|
+
* apiKey: 'your-api-key',
|
|
111
|
+
* apiSecret: 'your-signing-key', // enables HMAC request signing
|
|
112
|
+
* });
|
|
88
113
|
*
|
|
89
114
|
* // Get available algorithms
|
|
90
115
|
* const algorithms = await client.getAlgorithms();
|
|
@@ -105,87 +130,100 @@ type AlgorithmCategory = 'amplitude_estimation' | 'grover_search' | 'qaoa_optimi
|
|
|
105
130
|
declare class QaaSClient {
|
|
106
131
|
private readonly baseUrl;
|
|
107
132
|
private readonly apiKey?;
|
|
133
|
+
private readonly apiSecret?;
|
|
108
134
|
private readonly timeout;
|
|
135
|
+
private readonly maxRetries;
|
|
136
|
+
private readonly enableSigning;
|
|
137
|
+
private readonly rateLimiter;
|
|
109
138
|
constructor(config?: QaaSConfig);
|
|
110
139
|
private request;
|
|
111
|
-
/**
|
|
112
|
-
* Check API health and status
|
|
113
|
-
*/
|
|
114
140
|
health(): Promise<HealthResponse>;
|
|
115
|
-
/**
|
|
116
|
-
* Get pricing information for all tiers
|
|
117
|
-
*/
|
|
118
141
|
getPricing(): Promise<PricingResponse>;
|
|
119
|
-
/**
|
|
120
|
-
* Get available algorithms for your tier
|
|
121
|
-
*/
|
|
122
142
|
getAlgorithms(): Promise<AlgorithmsResponse>;
|
|
123
|
-
/**
|
|
124
|
-
* Get algorithms filtered by category
|
|
125
|
-
*/
|
|
126
143
|
getAlgorithmsByCategory(category: AlgorithmCategory): Promise<Algorithm[]>;
|
|
127
|
-
/**
|
|
128
|
-
* Run a quantum algorithm
|
|
129
|
-
*/
|
|
130
144
|
runAlgorithm(request: RunRequest): Promise<RunResponse>;
|
|
131
|
-
/**
|
|
132
|
-
* Get current usage statistics
|
|
133
|
-
*/
|
|
134
145
|
getUsage(): Promise<UsageResponse>;
|
|
135
|
-
/**
|
|
136
|
-
* Run Markowitz portfolio optimization (QAOA)
|
|
137
|
-
*/
|
|
138
146
|
optimizePortfolio(params: {
|
|
139
147
|
assets: string[];
|
|
140
148
|
returns: number[];
|
|
141
149
|
covariance: number[][];
|
|
142
150
|
risk_tolerance?: number;
|
|
143
|
-
backend?:
|
|
151
|
+
backend?: ValidBackend;
|
|
144
152
|
}): Promise<RunResponse>;
|
|
145
|
-
/**
|
|
146
|
-
* Run Value at Risk (VaR) estimation
|
|
147
|
-
*/
|
|
148
153
|
estimateVaR(params: {
|
|
149
154
|
portfolio_value: number;
|
|
150
155
|
returns_history: number[];
|
|
151
156
|
confidence_level?: number;
|
|
152
|
-
backend?:
|
|
157
|
+
backend?: ValidBackend;
|
|
153
158
|
}): Promise<RunResponse>;
|
|
154
|
-
/**
|
|
155
|
-
* Run Grover search for arbitrage opportunities
|
|
156
|
-
*/
|
|
157
159
|
findArbitrage(params: {
|
|
158
160
|
price_matrix: number[][];
|
|
159
161
|
threshold?: number;
|
|
160
|
-
backend?:
|
|
162
|
+
backend?: ValidBackend;
|
|
161
163
|
}): Promise<RunResponse>;
|
|
162
|
-
/**
|
|
163
|
-
* Solve a QUBO problem
|
|
164
|
-
*/
|
|
165
164
|
solveQUBO(params: {
|
|
166
165
|
Q_matrix: number[][];
|
|
167
166
|
num_reads?: number;
|
|
168
|
-
backend?:
|
|
167
|
+
backend?: ValidBackend;
|
|
169
168
|
}): Promise<RunResponse>;
|
|
170
|
-
/**
|
|
171
|
-
* Run Monte Carlo amplitude estimation
|
|
172
|
-
*/
|
|
173
169
|
monteCarloEstimate(params: {
|
|
174
170
|
target_function: string;
|
|
175
171
|
num_samples?: number;
|
|
176
172
|
epsilon?: number;
|
|
177
|
-
backend?:
|
|
173
|
+
backend?: ValidBackend;
|
|
178
174
|
}): Promise<RunResponse>;
|
|
175
|
+
quantumTeleport(params?: {
|
|
176
|
+
qubits?: number;
|
|
177
|
+
state?: string;
|
|
178
|
+
oscillation_cycles?: number;
|
|
179
|
+
source_backend?: string;
|
|
180
|
+
destination_backend?: string;
|
|
181
|
+
}): Promise<Record<string, unknown>>;
|
|
182
|
+
quantumTeleportStatus(): Promise<Record<string, unknown>>;
|
|
183
|
+
quantumTeleportPlan(params?: {
|
|
184
|
+
qubits?: number;
|
|
185
|
+
state?: string;
|
|
186
|
+
strategy?: string;
|
|
187
|
+
}): Promise<Record<string, unknown>>;
|
|
188
|
+
/**
|
|
189
|
+
* Generate quantum random bits.
|
|
190
|
+
*
|
|
191
|
+
* @param params.bits - Number of random bits (1–4096, default 256)
|
|
192
|
+
* @param params.format - Output format: 'hex' | 'int' | 'bytes' (default 'hex')
|
|
193
|
+
*/
|
|
194
|
+
generateQRNG(params?: {
|
|
195
|
+
bits?: number;
|
|
196
|
+
format?: 'hex' | 'int' | 'bytes';
|
|
197
|
+
}): Promise<QRNGResponse>;
|
|
198
|
+
/**
|
|
199
|
+
* Generate a quantum random number in the range [0, 1).
|
|
200
|
+
* Convenience wrapper over generateQRNG for normalized floats.
|
|
201
|
+
*
|
|
202
|
+
* @param count - How many floats to generate (1–1024, default 1)
|
|
203
|
+
* @returns Array of floats in [0, 1), each derived from 32 quantum bits
|
|
204
|
+
*/
|
|
205
|
+
generateQuantumFloats(count?: number): Promise<number[]>;
|
|
206
|
+
/**
|
|
207
|
+
* Generate a quantum-random cryptographic key.
|
|
208
|
+
*
|
|
209
|
+
* @param length - Key length in bytes (1–64, default 32)
|
|
210
|
+
*/
|
|
211
|
+
generateQuantumKey(length?: number): Promise<QRNGKeyResponse>;
|
|
212
|
+
/**
|
|
213
|
+
* Generate a quantum-random UUID v4.
|
|
214
|
+
*/
|
|
215
|
+
generateQuantumUUID(): Promise<QRNGUuidResponse>;
|
|
179
216
|
}
|
|
180
|
-
/**
|
|
181
|
-
* QaaS API Error
|
|
182
|
-
*/
|
|
183
217
|
declare class QaaSError extends Error {
|
|
184
218
|
readonly statusCode: number;
|
|
185
|
-
|
|
186
|
-
|
|
219
|
+
constructor(message: string, statusCode: number);
|
|
220
|
+
}
|
|
221
|
+
declare class QaaSValidationError extends Error {
|
|
222
|
+
constructor(message: string);
|
|
223
|
+
}
|
|
224
|
+
declare class QaaSRateLimitError extends Error {
|
|
225
|
+
constructor(message: string);
|
|
187
226
|
}
|
|
188
|
-
declare const qaas: QaaSClient;
|
|
189
227
|
declare const ALGORITHMS: {
|
|
190
228
|
readonly AMPLITUDE_ESTIMATION: {
|
|
191
229
|
readonly PROB_001: "AE_PROB_001";
|
|
@@ -217,4 +255,4 @@ declare const ALGORITHMS: {
|
|
|
217
255
|
};
|
|
218
256
|
};
|
|
219
257
|
|
|
220
|
-
export { ALGORITHMS, type Algorithm, type AlgorithmCategory, type AlgorithmsResponse, type HealthResponse, type PricingResponse, type PricingTier, QaaSClient, type QaaSConfig, QaaSError, type RunRequest, type RunResponse, type UsageResponse
|
|
258
|
+
export { ALGORITHMS, type Algorithm, type AlgorithmCategory, type AlgorithmsResponse, type HealthResponse, type PricingResponse, type PricingTier, type QRNGKeyResponse, type QRNGResponse, type QRNGUuidResponse, QaaSClient, type QaaSConfig, QaaSError, QaaSRateLimitError, QaaSValidationError, type RunRequest, type RunResponse, SIGNATURE_MAX_AGE_MS, type UsageResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
1
|
+
/** Max age for signed requests — server should reject older signatures */
|
|
2
|
+
declare const SIGNATURE_MAX_AGE_MS = 300000;
|
|
3
|
+
type ValidBackend = 'simulator' | 'qiskit_aer' | 'cirq' | 'pennylane' | 'ibm_quantum';
|
|
7
4
|
interface QaaSConfig {
|
|
8
5
|
apiKey?: string;
|
|
6
|
+
apiSecret?: string;
|
|
9
7
|
baseUrl?: string;
|
|
10
8
|
timeout?: number;
|
|
9
|
+
maxRetries?: number;
|
|
10
|
+
rateLimit?: number;
|
|
11
|
+
rateBurst?: number;
|
|
12
|
+
enableSigning?: boolean;
|
|
11
13
|
}
|
|
12
14
|
interface Algorithm {
|
|
13
15
|
id: number;
|
|
@@ -41,7 +43,7 @@ interface PricingResponse {
|
|
|
41
43
|
interface RunRequest {
|
|
42
44
|
algorithm_id: string;
|
|
43
45
|
parameters: Record<string, unknown>;
|
|
44
|
-
backend?:
|
|
46
|
+
backend?: ValidBackend;
|
|
45
47
|
shots?: number;
|
|
46
48
|
}
|
|
47
49
|
interface RunResponse {
|
|
@@ -76,15 +78,38 @@ interface HealthResponse {
|
|
|
76
78
|
frameworks: string[];
|
|
77
79
|
timestamp: string;
|
|
78
80
|
}
|
|
81
|
+
interface QRNGResponse {
|
|
82
|
+
bits: number;
|
|
83
|
+
value: string | number[] | string;
|
|
84
|
+
format: 'hex' | 'integer' | 'bytes';
|
|
85
|
+
entropy_source: string;
|
|
86
|
+
frequency?: number;
|
|
87
|
+
timestamp: string;
|
|
88
|
+
}
|
|
89
|
+
interface QRNGKeyResponse {
|
|
90
|
+
key: string;
|
|
91
|
+
bits: number;
|
|
92
|
+
algorithm: string;
|
|
93
|
+
timestamp: string;
|
|
94
|
+
}
|
|
95
|
+
interface QRNGUuidResponse {
|
|
96
|
+
uuid: string;
|
|
97
|
+
version: number;
|
|
98
|
+
algorithm: string;
|
|
99
|
+
timestamp: string;
|
|
100
|
+
}
|
|
79
101
|
type AlgorithmCategory = 'amplitude_estimation' | 'grover_search' | 'qaoa_optimization' | 'qubo' | 'bernstein_vazirani' | 'deutsch_jozsa' | 'simon' | 'phase_estimation' | 'variational' | 'qml_classification' | 'qml_regression' | 'qml_clustering' | 'qml_anomaly';
|
|
80
102
|
/**
|
|
81
|
-
* EpochCore QaaS Client
|
|
103
|
+
* EpochCore QaaS Client — Quantum-Hardened
|
|
82
104
|
*
|
|
83
105
|
* @example
|
|
84
106
|
* ```typescript
|
|
85
107
|
* import { QaaSClient } from '@epochcore/qaas-sdk';
|
|
86
108
|
*
|
|
87
|
-
* const client = new QaaSClient({
|
|
109
|
+
* const client = new QaaSClient({
|
|
110
|
+
* apiKey: 'your-api-key',
|
|
111
|
+
* apiSecret: 'your-signing-key', // enables HMAC request signing
|
|
112
|
+
* });
|
|
88
113
|
*
|
|
89
114
|
* // Get available algorithms
|
|
90
115
|
* const algorithms = await client.getAlgorithms();
|
|
@@ -105,87 +130,100 @@ type AlgorithmCategory = 'amplitude_estimation' | 'grover_search' | 'qaoa_optimi
|
|
|
105
130
|
declare class QaaSClient {
|
|
106
131
|
private readonly baseUrl;
|
|
107
132
|
private readonly apiKey?;
|
|
133
|
+
private readonly apiSecret?;
|
|
108
134
|
private readonly timeout;
|
|
135
|
+
private readonly maxRetries;
|
|
136
|
+
private readonly enableSigning;
|
|
137
|
+
private readonly rateLimiter;
|
|
109
138
|
constructor(config?: QaaSConfig);
|
|
110
139
|
private request;
|
|
111
|
-
/**
|
|
112
|
-
* Check API health and status
|
|
113
|
-
*/
|
|
114
140
|
health(): Promise<HealthResponse>;
|
|
115
|
-
/**
|
|
116
|
-
* Get pricing information for all tiers
|
|
117
|
-
*/
|
|
118
141
|
getPricing(): Promise<PricingResponse>;
|
|
119
|
-
/**
|
|
120
|
-
* Get available algorithms for your tier
|
|
121
|
-
*/
|
|
122
142
|
getAlgorithms(): Promise<AlgorithmsResponse>;
|
|
123
|
-
/**
|
|
124
|
-
* Get algorithms filtered by category
|
|
125
|
-
*/
|
|
126
143
|
getAlgorithmsByCategory(category: AlgorithmCategory): Promise<Algorithm[]>;
|
|
127
|
-
/**
|
|
128
|
-
* Run a quantum algorithm
|
|
129
|
-
*/
|
|
130
144
|
runAlgorithm(request: RunRequest): Promise<RunResponse>;
|
|
131
|
-
/**
|
|
132
|
-
* Get current usage statistics
|
|
133
|
-
*/
|
|
134
145
|
getUsage(): Promise<UsageResponse>;
|
|
135
|
-
/**
|
|
136
|
-
* Run Markowitz portfolio optimization (QAOA)
|
|
137
|
-
*/
|
|
138
146
|
optimizePortfolio(params: {
|
|
139
147
|
assets: string[];
|
|
140
148
|
returns: number[];
|
|
141
149
|
covariance: number[][];
|
|
142
150
|
risk_tolerance?: number;
|
|
143
|
-
backend?:
|
|
151
|
+
backend?: ValidBackend;
|
|
144
152
|
}): Promise<RunResponse>;
|
|
145
|
-
/**
|
|
146
|
-
* Run Value at Risk (VaR) estimation
|
|
147
|
-
*/
|
|
148
153
|
estimateVaR(params: {
|
|
149
154
|
portfolio_value: number;
|
|
150
155
|
returns_history: number[];
|
|
151
156
|
confidence_level?: number;
|
|
152
|
-
backend?:
|
|
157
|
+
backend?: ValidBackend;
|
|
153
158
|
}): Promise<RunResponse>;
|
|
154
|
-
/**
|
|
155
|
-
* Run Grover search for arbitrage opportunities
|
|
156
|
-
*/
|
|
157
159
|
findArbitrage(params: {
|
|
158
160
|
price_matrix: number[][];
|
|
159
161
|
threshold?: number;
|
|
160
|
-
backend?:
|
|
162
|
+
backend?: ValidBackend;
|
|
161
163
|
}): Promise<RunResponse>;
|
|
162
|
-
/**
|
|
163
|
-
* Solve a QUBO problem
|
|
164
|
-
*/
|
|
165
164
|
solveQUBO(params: {
|
|
166
165
|
Q_matrix: number[][];
|
|
167
166
|
num_reads?: number;
|
|
168
|
-
backend?:
|
|
167
|
+
backend?: ValidBackend;
|
|
169
168
|
}): Promise<RunResponse>;
|
|
170
|
-
/**
|
|
171
|
-
* Run Monte Carlo amplitude estimation
|
|
172
|
-
*/
|
|
173
169
|
monteCarloEstimate(params: {
|
|
174
170
|
target_function: string;
|
|
175
171
|
num_samples?: number;
|
|
176
172
|
epsilon?: number;
|
|
177
|
-
backend?:
|
|
173
|
+
backend?: ValidBackend;
|
|
178
174
|
}): Promise<RunResponse>;
|
|
175
|
+
quantumTeleport(params?: {
|
|
176
|
+
qubits?: number;
|
|
177
|
+
state?: string;
|
|
178
|
+
oscillation_cycles?: number;
|
|
179
|
+
source_backend?: string;
|
|
180
|
+
destination_backend?: string;
|
|
181
|
+
}): Promise<Record<string, unknown>>;
|
|
182
|
+
quantumTeleportStatus(): Promise<Record<string, unknown>>;
|
|
183
|
+
quantumTeleportPlan(params?: {
|
|
184
|
+
qubits?: number;
|
|
185
|
+
state?: string;
|
|
186
|
+
strategy?: string;
|
|
187
|
+
}): Promise<Record<string, unknown>>;
|
|
188
|
+
/**
|
|
189
|
+
* Generate quantum random bits.
|
|
190
|
+
*
|
|
191
|
+
* @param params.bits - Number of random bits (1–4096, default 256)
|
|
192
|
+
* @param params.format - Output format: 'hex' | 'int' | 'bytes' (default 'hex')
|
|
193
|
+
*/
|
|
194
|
+
generateQRNG(params?: {
|
|
195
|
+
bits?: number;
|
|
196
|
+
format?: 'hex' | 'int' | 'bytes';
|
|
197
|
+
}): Promise<QRNGResponse>;
|
|
198
|
+
/**
|
|
199
|
+
* Generate a quantum random number in the range [0, 1).
|
|
200
|
+
* Convenience wrapper over generateQRNG for normalized floats.
|
|
201
|
+
*
|
|
202
|
+
* @param count - How many floats to generate (1–1024, default 1)
|
|
203
|
+
* @returns Array of floats in [0, 1), each derived from 32 quantum bits
|
|
204
|
+
*/
|
|
205
|
+
generateQuantumFloats(count?: number): Promise<number[]>;
|
|
206
|
+
/**
|
|
207
|
+
* Generate a quantum-random cryptographic key.
|
|
208
|
+
*
|
|
209
|
+
* @param length - Key length in bytes (1–64, default 32)
|
|
210
|
+
*/
|
|
211
|
+
generateQuantumKey(length?: number): Promise<QRNGKeyResponse>;
|
|
212
|
+
/**
|
|
213
|
+
* Generate a quantum-random UUID v4.
|
|
214
|
+
*/
|
|
215
|
+
generateQuantumUUID(): Promise<QRNGUuidResponse>;
|
|
179
216
|
}
|
|
180
|
-
/**
|
|
181
|
-
* QaaS API Error
|
|
182
|
-
*/
|
|
183
217
|
declare class QaaSError extends Error {
|
|
184
218
|
readonly statusCode: number;
|
|
185
|
-
|
|
186
|
-
|
|
219
|
+
constructor(message: string, statusCode: number);
|
|
220
|
+
}
|
|
221
|
+
declare class QaaSValidationError extends Error {
|
|
222
|
+
constructor(message: string);
|
|
223
|
+
}
|
|
224
|
+
declare class QaaSRateLimitError extends Error {
|
|
225
|
+
constructor(message: string);
|
|
187
226
|
}
|
|
188
|
-
declare const qaas: QaaSClient;
|
|
189
227
|
declare const ALGORITHMS: {
|
|
190
228
|
readonly AMPLITUDE_ESTIMATION: {
|
|
191
229
|
readonly PROB_001: "AE_PROB_001";
|
|
@@ -217,4 +255,4 @@ declare const ALGORITHMS: {
|
|
|
217
255
|
};
|
|
218
256
|
};
|
|
219
257
|
|
|
220
|
-
export { ALGORITHMS, type Algorithm, type AlgorithmCategory, type AlgorithmsResponse, type HealthResponse, type PricingResponse, type PricingTier, QaaSClient, type QaaSConfig, QaaSError, type RunRequest, type RunResponse, type UsageResponse
|
|
258
|
+
export { ALGORITHMS, type Algorithm, type AlgorithmCategory, type AlgorithmsResponse, type HealthResponse, type PricingResponse, type PricingTier, type QRNGKeyResponse, type QRNGResponse, type QRNGUuidResponse, QaaSClient, type QaaSConfig, QaaSError, QaaSRateLimitError, QaaSValidationError, type RunRequest, type RunResponse, SIGNATURE_MAX_AGE_MS, type UsageResponse };
|