@proofrails/sdk 1.4.0 → 1.5.1

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/dist/react.mjs ADDED
@@ -0,0 +1,661 @@
1
+ import React, { createContext, useState, useEffect, useContext } from 'react';
2
+
3
+ // src/react.ts
4
+
5
+ // src/types/common.ts
6
+ var ProofRailsError = class extends Error {
7
+ constructor(message, code, statusCode, details) {
8
+ super(message);
9
+ this.code = code;
10
+ this.statusCode = statusCode;
11
+ this.details = details;
12
+ this.name = "ProofRailsError";
13
+ }
14
+ };
15
+
16
+ // src/client.ts
17
+ var APIClient = class {
18
+ constructor(config = {}) {
19
+ this.rateLimitInfo = null;
20
+ const envBaseUrl = typeof process !== "undefined" && process.env?.NEXT_PUBLIC_PROOFRAILS_BASE_URL;
21
+ const defaultBaseUrl = "https://proofrails-clone-middleware.onrender.com";
22
+ this.baseUrl = config.baseUrl || envBaseUrl || defaultBaseUrl;
23
+ this.apiKey = config.apiKey;
24
+ this.adminToken = config.adminToken;
25
+ this.timeout = config.timeout || 3e4;
26
+ this.retries = config.retries ?? 3;
27
+ this.retryDelay = config.retryDelay ?? 1e3;
28
+ }
29
+ getRateLimitInfo() {
30
+ return this.rateLimitInfo;
31
+ }
32
+ async get(endpoint, options = {}) {
33
+ return this.request("GET", endpoint, void 0, options);
34
+ }
35
+ async post(endpoint, body, options = {}) {
36
+ return this.request("POST", endpoint, body, options);
37
+ }
38
+ async put(endpoint, body, options = {}) {
39
+ return this.request("PUT", endpoint, body, options);
40
+ }
41
+ async delete(endpoint, options = {}) {
42
+ return this.request("DELETE", endpoint, void 0, options);
43
+ }
44
+ async request(method, endpoint, body, options = {}, attempt = 0) {
45
+ const url = `${this.baseUrl}${endpoint}`;
46
+ const headers = {
47
+ "Content-Type": "application/json",
48
+ ...options.headers || {}
49
+ };
50
+ if (this.apiKey) {
51
+ headers["X-API-Key"] = this.apiKey;
52
+ }
53
+ if (this.adminToken) {
54
+ headers["Authorization"] = `Bearer ${this.adminToken}`;
55
+ }
56
+ const controller = new AbortController();
57
+ const timeoutId = setTimeout(() => controller.abort(), this.timeout);
58
+ try {
59
+ console.log(`[ProofRails SDK] ${method} ${url}${attempt > 0 ? ` (retry ${attempt}/${this.retries})` : ""}`);
60
+ const response = await fetch(url, {
61
+ method,
62
+ headers,
63
+ body: body ? JSON.stringify(body) : void 0,
64
+ signal: controller.signal,
65
+ ...options
66
+ });
67
+ clearTimeout(timeoutId);
68
+ this.extractRateLimitInfo(response);
69
+ if (!response.ok) {
70
+ const errorData = await response.json().catch(() => ({}));
71
+ const error = new ProofRailsError(
72
+ errorData.message || errorData.detail || `HTTP ${response.status}: ${response.statusText}`,
73
+ errorData.code,
74
+ response.status,
75
+ errorData
76
+ );
77
+ if (this.shouldRetry(response.status, attempt)) {
78
+ return this.retryRequest(method, endpoint, body, options, attempt);
79
+ }
80
+ throw error;
81
+ }
82
+ return await response.json();
83
+ } catch (error) {
84
+ clearTimeout(timeoutId);
85
+ if (error instanceof ProofRailsError) {
86
+ if (this.shouldRetry(0, attempt)) {
87
+ return this.retryRequest(method, endpoint, body, options, attempt);
88
+ }
89
+ throw error;
90
+ }
91
+ if (error instanceof Error) {
92
+ if (error.name === "AbortError") {
93
+ throw new ProofRailsError(`Request timeout after ${this.timeout}ms`, "TIMEOUT");
94
+ }
95
+ if (this.shouldRetry(0, attempt)) {
96
+ return this.retryRequest(method, endpoint, body, options, attempt);
97
+ }
98
+ throw new ProofRailsError(error.message, "NETWORK_ERROR");
99
+ }
100
+ throw new ProofRailsError("Unknown error occurred", "UNKNOWN_ERROR");
101
+ }
102
+ }
103
+ shouldRetry(statusCode, attempt) {
104
+ if (attempt >= this.retries) return false;
105
+ if (statusCode === 0) return true;
106
+ if (statusCode >= 500 && statusCode < 600) return true;
107
+ if (statusCode === 429) return true;
108
+ return false;
109
+ }
110
+ async retryRequest(method, endpoint, body, options, attempt) {
111
+ const delay = this.retryDelay * Math.pow(2, attempt);
112
+ console.log(`[ProofRails SDK] Retrying in ${delay}ms...`);
113
+ await new Promise((resolve) => setTimeout(resolve, delay));
114
+ return this.request(method, endpoint, body, options, attempt + 1);
115
+ }
116
+ extractRateLimitInfo(response) {
117
+ const limit = response.headers.get("X-RateLimit-Limit");
118
+ const remaining = response.headers.get("X-RateLimit-Remaining");
119
+ const reset = response.headers.get("X-RateLimit-Reset");
120
+ if (limit && remaining && reset) {
121
+ const resetTimestamp = parseInt(reset, 10);
122
+ this.rateLimitInfo = {
123
+ limit: parseInt(limit, 10),
124
+ remaining: parseInt(remaining, 10),
125
+ reset: resetTimestamp,
126
+ resetDate: new Date(resetTimestamp * 1e3)
127
+ };
128
+ }
129
+ }
130
+ setApiKey(apiKey) {
131
+ this.apiKey = apiKey;
132
+ }
133
+ setAdminToken(adminToken) {
134
+ this.adminToken = adminToken;
135
+ }
136
+ getBaseUrl() {
137
+ return this.baseUrl;
138
+ }
139
+ };
140
+
141
+ // src/modules/projects.ts
142
+ var ProjectsModule = class {
143
+ constructor(client) {
144
+ this.client = client;
145
+ }
146
+ async getInfo() {
147
+ return this.client.get("/v1/whoami");
148
+ }
149
+ async rotateKey() {
150
+ return this.client.post("/v1/api-keys/rotate");
151
+ }
152
+ async create(options = {}) {
153
+ return this.client.post("/v1/public/api-keys", options);
154
+ }
155
+ };
156
+ var AdminModule = class {
157
+ constructor(client) {
158
+ this.client = client;
159
+ }
160
+ async createKey(options) {
161
+ return this.client.post("/v1/admin/api-keys", options);
162
+ }
163
+ async deleteKey(keyId) {
164
+ return this.client.delete(`/v1/admin/api-keys/${keyId}`);
165
+ }
166
+ };
167
+
168
+ // src/modules/receipts.ts
169
+ var ReceiptsModule = class {
170
+ constructor(client) {
171
+ this.client = client;
172
+ }
173
+ async create(options) {
174
+ const payload = {
175
+ tip_tx_hash: options.transactionHash,
176
+ chain: options.chain,
177
+ amount: String(options.amount),
178
+ currency: options.currency,
179
+ sender_wallet: options.sender,
180
+ receiver_wallet: options.receiver,
181
+ reference: options.reference,
182
+ callback_url: options.callbackUrl
183
+ };
184
+ const response = await this.client.post(
185
+ "/v1/iso/record-tip",
186
+ payload
187
+ );
188
+ return {
189
+ id: response.receipt_id,
190
+ status: response.status,
191
+ transactionHash: options.transactionHash,
192
+ chain: options.chain,
193
+ amount: String(options.amount),
194
+ currency: options.currency,
195
+ sender: options.sender,
196
+ receiver: options.receiver,
197
+ reference: options.reference,
198
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
199
+ };
200
+ }
201
+ async get(receiptId) {
202
+ return this.client.get(`/v1/iso/receipts/${receiptId}`);
203
+ }
204
+ async list(options = {}) {
205
+ const params = new URLSearchParams();
206
+ if (options.limit) params.append("limit", String(options.limit));
207
+ if (options.page) params.append("page", String(options.page));
208
+ if (options.status) params.append("status", options.status);
209
+ const query = params.toString();
210
+ const endpoint = `/v1/iso/receipts${query ? `?${query}` : ""}`;
211
+ const response = await this.client.get(endpoint);
212
+ const items = Array.isArray(response) ? response : response.items || [];
213
+ return {
214
+ items,
215
+ total: items.length,
216
+ page: options.page || 1,
217
+ limit: options.limit || 10
218
+ };
219
+ }
220
+ async getArtifacts(receiptId) {
221
+ const messages = await this.client.get(`/v1/iso/messages/${receiptId}`);
222
+ const baseUrl = this.client.getBaseUrl();
223
+ const artifacts = {};
224
+ messages.forEach((msg) => {
225
+ switch (msg.type) {
226
+ case "pain.001":
227
+ artifacts.pain001Url = msg.url;
228
+ break;
229
+ case "pain.002":
230
+ artifacts.pain002Url = msg.url;
231
+ break;
232
+ case "pain.007":
233
+ artifacts.pain007Url = msg.url;
234
+ break;
235
+ case "pain.008":
236
+ artifacts.pain008Url = msg.url;
237
+ break;
238
+ case "camt.054":
239
+ artifacts.camt054Url = msg.url;
240
+ break;
241
+ }
242
+ });
243
+ artifacts.bundleUrl = `${baseUrl}/files/${receiptId}/evidence.zip`;
244
+ artifacts.manifestUrl = `${baseUrl}/files/${receiptId}/manifest.json`;
245
+ return artifacts;
246
+ }
247
+ };
248
+
249
+ // src/modules/verification.ts
250
+ var VerificationModule = class {
251
+ constructor(client) {
252
+ this.client = client;
253
+ }
254
+ async byReceiptId(receiptId) {
255
+ const receipt = await this.client.get(`/v1/iso/receipts/${receiptId}`);
256
+ return {
257
+ valid: receipt.status === "anchored",
258
+ bundleHash: receipt.bundle_hash || receipt.bundleHash || "",
259
+ onChain: !!receipt.anchor_tx || !!receipt.anchorTx,
260
+ anchorTx: receipt.anchor_tx || receipt.anchorTx,
261
+ timestamp: receipt.anchored_at || receipt.anchoredAt
262
+ };
263
+ }
264
+ async byUrl(bundleUrl) {
265
+ return this.client.post("/v1/iso/verify", {
266
+ bundle_url: bundleUrl
267
+ });
268
+ }
269
+ async byHash(bundleHash) {
270
+ return this.client.post("/v1/iso/verify", {
271
+ bundle_hash: bundleHash
272
+ });
273
+ }
274
+ async getProof(receiptId) {
275
+ const receipt = await this.client.get(`/v1/iso/receipts/${receiptId}`);
276
+ return {
277
+ receiptId,
278
+ bundleHash: receipt.bundle_hash || receipt.bundleHash,
279
+ anchorTx: receipt.anchor_tx || receipt.anchorTx,
280
+ blockNumber: receipt.block_number || 0,
281
+ timestamp: receipt.anchored_at || receipt.anchoredAt,
282
+ signature: receipt.signature || "",
283
+ network: receipt.chain,
284
+ contractAddress: receipt.contract_address || ""
285
+ };
286
+ }
287
+ };
288
+
289
+ // src/modules/statements.ts
290
+ var StatementsModule = class {
291
+ constructor(client) {
292
+ this.client = client;
293
+ }
294
+ async intraday(options = {}) {
295
+ const response = await this.client.post("/v1/iso/statement/camt052", {
296
+ date_from: options.dateFrom,
297
+ date_to: options.dateTo,
298
+ account_id: options.accountId
299
+ });
300
+ return {
301
+ type: "camt.052",
302
+ url: response.url,
303
+ downloadUrl: response.download_url || response.url,
304
+ messageId: response.message_id || response.messageId,
305
+ createdAt: response.created_at || (/* @__PURE__ */ new Date()).toISOString()
306
+ };
307
+ }
308
+ async endOfDay(options = {}) {
309
+ const response = await this.client.post("/v1/iso/statement/camt053", {
310
+ date: options.dateTo || options.dateFrom,
311
+ account_id: options.accountId
312
+ });
313
+ return {
314
+ type: "camt.053",
315
+ url: response.url,
316
+ downloadUrl: response.download_url || response.url,
317
+ messageId: response.message_id || response.messageId,
318
+ createdAt: response.created_at || (/* @__PURE__ */ new Date()).toISOString()
319
+ };
320
+ }
321
+ };
322
+
323
+ // src/modules/events.ts
324
+ var EventsModule = class {
325
+ constructor(client) {
326
+ this.client = client;
327
+ }
328
+ listen(receiptId, callback) {
329
+ const baseUrl = this.client.getBaseUrl();
330
+ const url = `${baseUrl}/v1/iso/events/${receiptId}`;
331
+ const eventSource = new EventSource(url);
332
+ eventSource.onmessage = (event) => {
333
+ try {
334
+ const data = JSON.parse(event.data);
335
+ callback({
336
+ id: receiptId,
337
+ status: data.status,
338
+ anchorTx: data.anchor_tx || data.anchorTx,
339
+ bundleHash: data.bundle_hash || data.bundleHash,
340
+ timestamp: data.timestamp || (/* @__PURE__ */ new Date()).toISOString()
341
+ });
342
+ } catch (error) {
343
+ console.error("Failed to parse SSE event:", error);
344
+ }
345
+ };
346
+ eventSource.onerror = (error) => {
347
+ console.error("SSE connection error:", error);
348
+ eventSource.close();
349
+ };
350
+ return {
351
+ stop: () => eventSource.close()
352
+ };
353
+ }
354
+ };
355
+
356
+ // src/modules/embed.ts
357
+ var EmbedModule = class {
358
+ constructor(client) {
359
+ this.client = client;
360
+ }
361
+ widget(receiptId, options = {}) {
362
+ const baseUrl = this.client.getBaseUrl();
363
+ const theme = options.theme || "light";
364
+ const width = options.width || "100%";
365
+ const height = options.height || "400px";
366
+ const embedUrl = `${baseUrl}/embed/receipt?rid=${receiptId}&theme=${theme}`;
367
+ const iframeHtml = `<iframe src="${embedUrl}" width="${width}" height="${height}" frameborder="0" style="border: none;"></iframe>`;
368
+ return {
369
+ iframeHtml,
370
+ embedUrl
371
+ };
372
+ }
373
+ fullPage(receiptId) {
374
+ const baseUrl = this.client.getBaseUrl();
375
+ return `${baseUrl}/receipt/${receiptId}`;
376
+ }
377
+ };
378
+
379
+ // src/templates/payment.ts
380
+ async function createPaymentReceipt(receiptsModule, options) {
381
+ return receiptsModule.create({
382
+ transactionHash: options.transactionHash,
383
+ chain: options.chain || "coston2",
384
+ // Smart default
385
+ amount: options.amount,
386
+ currency: options.currency || "C2FLR",
387
+ // Smart default
388
+ sender: options.senderWallet || options.from,
389
+ receiver: options.receiverWallet || options.to,
390
+ reference: `Payment: ${options.purpose} (Tx: ${options.transactionHash})`
391
+ });
392
+ }
393
+
394
+ // src/templates/donation.ts
395
+ async function createDonationReceipt(receiptsModule, options) {
396
+ return receiptsModule.create({
397
+ transactionHash: options.transactionHash,
398
+ chain: "coston2",
399
+ amount: options.amount,
400
+ currency: "FLR",
401
+ sender: options.donorWallet || options.donor,
402
+ receiver: options.organizationWallet || options.organization,
403
+ reference: `Donation: ${options.campaign} (Donor: ${options.donor}, Organization: ${options.organization})`
404
+ });
405
+ }
406
+
407
+ // src/templates/escrow.ts
408
+ async function createEscrowReceipt(receiptsModule, options) {
409
+ return receiptsModule.create({
410
+ transactionHash: options.transactionHash,
411
+ chain: "coston2",
412
+ amount: options.amount,
413
+ currency: "FLR",
414
+ sender: options.buyerWallet || options.buyer,
415
+ receiver: options.sellerWallet || options.seller,
416
+ reference: `Escrow Release: ${options.escrowId} - ${options.releaseReason} (Buyer: ${options.buyer}, Seller: ${options.seller})`
417
+ });
418
+ }
419
+
420
+ // src/templates/grant.ts
421
+ async function createGrantReceipt(receiptsModule, options) {
422
+ return receiptsModule.create({
423
+ transactionHash: options.transactionHash,
424
+ chain: "coston2",
425
+ amount: options.amount,
426
+ currency: "FLR",
427
+ sender: options.grantorWallet || options.grantor,
428
+ receiver: options.granteeWallet || options.grantee,
429
+ reference: `Grant: ${options.grantId} - ${options.purpose} (Grantor: ${options.grantor}, Grantee: ${options.grantee})`
430
+ });
431
+ }
432
+
433
+ // src/templates/refund.ts
434
+ async function createRefundReceipt(receiptsModule, options) {
435
+ return receiptsModule.create({
436
+ transactionHash: options.transactionHash,
437
+ chain: "coston2",
438
+ amount: options.amount,
439
+ currency: "FLR",
440
+ sender: options.businessWallet || "Business",
441
+ receiver: options.customerWallet || options.customer,
442
+ reference: `Refund: ${options.originalPayment} - ${options.reason} (Customer: ${options.customer})`
443
+ });
444
+ }
445
+
446
+ // src/sdk.ts
447
+ var ProofRails = class _ProofRails {
448
+ constructor(config = {}) {
449
+ this.client = new APIClient(config);
450
+ this.project = new ProjectsModule(this.client);
451
+ this.admin = new AdminModule(this.client);
452
+ this.receipts = new ReceiptsModule(this.client);
453
+ this.verify = new VerificationModule(this.client);
454
+ this.statements = new StatementsModule(this.client);
455
+ this.events = new EventsModule(this.client);
456
+ this.embed = new EmbedModule(this.client);
457
+ this.templates = {
458
+ payment: (options) => createPaymentReceipt(this.receipts, options),
459
+ donation: (options) => createDonationReceipt(this.receipts, options),
460
+ escrow: (options) => createEscrowReceipt(this.receipts, options),
461
+ grant: (options) => createGrantReceipt(this.receipts, options),
462
+ refund: (options) => createRefundReceipt(this.receipts, options)
463
+ };
464
+ }
465
+ /**
466
+ * Create a new project with API key (self-serve)
467
+ * This is a convenience method for beginners
468
+ */
469
+ static async createProject(options = {}) {
470
+ const tempClient = new _ProofRails({ network: options.network, baseUrl: options.baseUrl });
471
+ const result = await tempClient.project.create({ label: options.label });
472
+ const apiKey = result.api_key || result.apiKey;
473
+ const projectId = result.project_id || result.projectId;
474
+ const client = new _ProofRails({
475
+ apiKey,
476
+ network: options.network,
477
+ baseUrl: options.baseUrl
478
+ // Propagate baseUrl
479
+ });
480
+ return {
481
+ client,
482
+ apiKey,
483
+ projectId
484
+ };
485
+ }
486
+ /**
487
+ * Update the API key for this client
488
+ */
489
+ setApiKey(apiKey) {
490
+ this.client.setApiKey(apiKey);
491
+ }
492
+ /**
493
+ * Update the admin token for this client
494
+ */
495
+ setAdminToken(adminToken) {
496
+ this.client.setAdminToken(adminToken);
497
+ }
498
+ };
499
+
500
+ // src/react.ts
501
+ var ProofRailsContext = createContext(null);
502
+ var ProofRailsProvider = ({
503
+ apiKey,
504
+ config = {},
505
+ children
506
+ }) => {
507
+ const [client, setClient] = useState(null);
508
+ useEffect(() => {
509
+ const instance = new ProofRails({
510
+ apiKey,
511
+ ...config
512
+ });
513
+ setClient(instance);
514
+ }, [apiKey]);
515
+ if (!client) return null;
516
+ return React.createElement(
517
+ ProofRailsContext.Provider,
518
+ { value: client },
519
+ children
520
+ );
521
+ };
522
+ var useProofRails = () => {
523
+ const context = useContext(ProofRailsContext);
524
+ if (!context) {
525
+ throw new Error("useProofRails must be used within a ProofRailsProvider");
526
+ }
527
+ return context;
528
+ };
529
+ var useProofRailsPayment = () => {
530
+ const client = useProofRails();
531
+ const [isLoading, setIsLoading] = useState(false);
532
+ const [error, setError] = useState(null);
533
+ const [receipt, setReceipt] = useState(null);
534
+ const createPayment = async (options) => {
535
+ setIsLoading(true);
536
+ setError(null);
537
+ try {
538
+ const result = await client.templates.payment(options);
539
+ setReceipt(result);
540
+ return result;
541
+ } catch (err) {
542
+ const errorObj = err instanceof Error ? err : new Error("Payment creation failed");
543
+ setError(errorObj);
544
+ throw errorObj;
545
+ } finally {
546
+ setIsLoading(false);
547
+ }
548
+ };
549
+ return {
550
+ createPayment,
551
+ send: createPayment,
552
+ // Alias to match docs
553
+ receipt,
554
+ isLoading,
555
+ error
556
+ };
557
+ };
558
+ var useReceiptsList = (sdkOverride) => {
559
+ const contextSdk = useContext(ProofRailsContext);
560
+ const client = sdkOverride || contextSdk;
561
+ const [receipts, setReceipts] = useState([]);
562
+ const [loading, setLoading] = useState(false);
563
+ const [error, setError] = useState(null);
564
+ const fetch2 = async (options) => {
565
+ if (!client) return;
566
+ setLoading(true);
567
+ setError(null);
568
+ try {
569
+ const result = await client.receipts.list(options);
570
+ setReceipts(Array.isArray(result) ? result : result.items || []);
571
+ } catch (err) {
572
+ setError(err instanceof Error ? err : new Error("Unknown error fetching receipts"));
573
+ } finally {
574
+ setLoading(false);
575
+ }
576
+ };
577
+ return { fetch: fetch2, receipts, loading, error };
578
+ };
579
+ var useReceiptDetails = (sdkOverride) => {
580
+ const contextSdk = useContext(ProofRailsContext);
581
+ const client = sdkOverride || contextSdk;
582
+ const [receipt, setReceipt] = useState(null);
583
+ const [loading, setLoading] = useState(false);
584
+ const [error, setError] = useState(null);
585
+ const fetch2 = async (id) => {
586
+ if (!client) return;
587
+ setLoading(true);
588
+ setError(null);
589
+ try {
590
+ const result = await client.receipts.get(id);
591
+ setReceipt(result);
592
+ } catch (err) {
593
+ setError(err instanceof Error ? err : new Error("Error fetching receipt"));
594
+ } finally {
595
+ setLoading(false);
596
+ }
597
+ };
598
+ return { fetch: fetch2, receipt, loading, error };
599
+ };
600
+ var useCreateProject = () => {
601
+ const [loading, setLoading] = useState(false);
602
+ const [error, setError] = useState(null);
603
+ const create = async (label, network) => {
604
+ setLoading(true);
605
+ try {
606
+ const result = await ProofRails.createProject({ label, network });
607
+ return result;
608
+ } catch (err) {
609
+ setError(err instanceof Error ? err : new Error("Failed to create project"));
610
+ throw err;
611
+ } finally {
612
+ setLoading(false);
613
+ }
614
+ };
615
+ return { create, loading, error };
616
+ };
617
+ var useProofRailsForm = () => {
618
+ const [apiKey, setApiKeyState] = useState("");
619
+ const [recipient, setRecipient] = useState("");
620
+ const [amount, setAmount] = useState("");
621
+ const [purpose, setPurpose] = useState("");
622
+ useEffect(() => {
623
+ if (typeof window !== "undefined") {
624
+ const saved = localStorage.getItem("proofrails_api_key");
625
+ if (saved) setApiKeyState(saved);
626
+ }
627
+ }, []);
628
+ const setApiKey = (key) => {
629
+ setApiKeyState(key);
630
+ if (typeof window !== "undefined") {
631
+ localStorage.setItem("proofrails_api_key", key);
632
+ }
633
+ };
634
+ const resetForm = () => {
635
+ setRecipient("");
636
+ setAmount("");
637
+ setPurpose("");
638
+ };
639
+ return {
640
+ apiKey,
641
+ setApiKey,
642
+ recipient,
643
+ setRecipient,
644
+ amount,
645
+ setAmount,
646
+ purpose,
647
+ setPurpose,
648
+ resetForm
649
+ };
650
+ };
651
+ var useRateLimitInfo = (sdkOverride) => {
652
+ return {
653
+ limit: 1e3,
654
+ remaining: 999,
655
+ reset: Date.now() + 36e5
656
+ };
657
+ };
658
+
659
+ export { ProofRailsProvider, useCreateProject, useProofRails, useProofRailsForm, useProofRailsPayment, useRateLimitInfo, useReceiptDetails, useReceiptsList };
660
+ //# sourceMappingURL=react.mjs.map
661
+ //# sourceMappingURL=react.mjs.map