@pacspace-io/sdk 0.1.0 → 0.2.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/README.md +67 -11
- package/dist/client.d.ts +34 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +296 -21
- package/dist/client.js.map +1 -1
- package/dist/errors/index.d.ts +24 -1
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +44 -4
- package/dist/errors/index.js.map +1 -1
- package/dist/index.d.ts +51 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +107 -8
- package/dist/index.js.map +1 -1
- package/dist/resources/balance.d.ts +221 -15
- package/dist/resources/balance.d.ts.map +1 -1
- package/dist/resources/balance.js +772 -27
- package/dist/resources/balance.js.map +1 -1
- package/dist/resources/submission.d.ts +79 -0
- package/dist/resources/submission.d.ts.map +1 -0
- package/dist/resources/submission.js +398 -0
- package/dist/resources/submission.js.map +1 -0
- package/dist/types/balance.d.ts +493 -28
- package/dist/types/balance.d.ts.map +1 -1
- package/dist/types/common.d.ts +3 -3
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/config.d.ts +53 -3
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/submission.d.ts +125 -0
- package/dist/types/submission.d.ts.map +1 -0
- package/dist/types/submission.js +3 -0
- package/dist/types/submission.js.map +1 -0
- package/dist/utils/polling.d.ts +2 -2
- package/dist/utils/polling.d.ts.map +1 -1
- package/dist/utils/polling.js +2 -6
- package/dist/utils/polling.js.map +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.d.ts.map +1 -1
- package/dist/webhooks/types.d.ts +31 -31
- package/dist/webhooks/types.d.ts.map +1 -1
- package/dist/webhooks/types.js +0 -3
- package/dist/webhooks/types.js.map +1 -1
- package/dist/webhooks/verify.d.ts +5 -0
- package/dist/webhooks/verify.d.ts.map +1 -1
- package/dist/webhooks/verify.js +19 -4
- package/dist/webhooks/verify.js.map +1 -1
- package/package.json +1 -1
package/dist/errors/index.d.ts
CHANGED
|
@@ -43,6 +43,25 @@ export declare class RateLimitError extends PacSpaceError {
|
|
|
43
43
|
readonly retryAfter: number | null;
|
|
44
44
|
constructor(message?: string, retryAfter?: number | null, requestPath?: string);
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Thrown when a customer's submission cadence window has not elapsed (HTTP 429).
|
|
48
|
+
* This error is terminal for the current request and should not be auto-retried.
|
|
49
|
+
*/
|
|
50
|
+
export declare class CadenceLimitError extends PacSpaceError {
|
|
51
|
+
/** Milliseconds remaining before the next allowed submission, if provided. */
|
|
52
|
+
readonly retryAfterMs: number | null;
|
|
53
|
+
/** Customer ID associated with the cadence block, when provided. */
|
|
54
|
+
readonly customerId: string | null;
|
|
55
|
+
constructor(message?: string, retryAfterSeconds?: number | null, customerId?: string | null, requestPath?: string);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Thrown when the API is temporarily unavailable (HTTP 503).
|
|
59
|
+
*/
|
|
60
|
+
export declare class ServiceUnavailableError extends PacSpaceError {
|
|
61
|
+
/** Seconds to wait before retrying, if provided by the API. */
|
|
62
|
+
readonly retryAfter: number | null;
|
|
63
|
+
constructor(message?: string, retryAfter?: number | null, requestPath?: string);
|
|
64
|
+
}
|
|
46
65
|
/**
|
|
47
66
|
* Thrown when the API returns a validation error (HTTP 400).
|
|
48
67
|
*/
|
|
@@ -65,5 +84,9 @@ export declare class WebhookVerificationError extends PacSpaceError {
|
|
|
65
84
|
* Map an HTTP status code + API response to the appropriate typed error.
|
|
66
85
|
* @internal
|
|
67
86
|
*/
|
|
68
|
-
export declare function mapApiError(statusCode: number, message: string, requestPath?: string, headers?: Headers
|
|
87
|
+
export declare function mapApiError(statusCode: number, message: string, requestPath?: string, headers?: Headers, apiError?: {
|
|
88
|
+
code?: string;
|
|
89
|
+
retryAfterSeconds?: number | null;
|
|
90
|
+
customerId?: string | null;
|
|
91
|
+
}): PacSpaceError;
|
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
|
package/dist/errors/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebhookVerificationError = exports.TimeoutError = exports.ValidationError = exports.RateLimitError = exports.ContractNotDeployedError = exports.NotFoundError = exports.InsufficientCreditsError = exports.InvalidApiKeyError = exports.PacSpaceError = void 0;
|
|
3
|
+
exports.WebhookVerificationError = exports.TimeoutError = exports.ValidationError = exports.ServiceUnavailableError = exports.CadenceLimitError = exports.RateLimitError = exports.ContractNotDeployedError = exports.NotFoundError = exports.InsufficientCreditsError = exports.InvalidApiKeyError = exports.PacSpaceError = void 0;
|
|
4
4
|
exports.mapApiError = mapApiError;
|
|
5
5
|
/**
|
|
6
6
|
* Base error class for all PacSpace SDK errors.
|
|
@@ -69,6 +69,33 @@ class RateLimitError extends PacSpaceError {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
exports.RateLimitError = RateLimitError;
|
|
72
|
+
/**
|
|
73
|
+
* Thrown when a customer's submission cadence window has not elapsed (HTTP 429).
|
|
74
|
+
* This error is terminal for the current request and should not be auto-retried.
|
|
75
|
+
*/
|
|
76
|
+
class CadenceLimitError extends PacSpaceError {
|
|
77
|
+
constructor(message = 'Submission cadence limit reached', retryAfterSeconds = null, customerId = null, requestPath) {
|
|
78
|
+
super(message, 429, 'CADENCE_LIMIT', requestPath);
|
|
79
|
+
this.name = 'CadenceLimitError';
|
|
80
|
+
this.retryAfterMs =
|
|
81
|
+
retryAfterSeconds && Number.isFinite(retryAfterSeconds)
|
|
82
|
+
? Math.max(0, Math.floor(retryAfterSeconds * 1000))
|
|
83
|
+
: null;
|
|
84
|
+
this.customerId = customerId;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.CadenceLimitError = CadenceLimitError;
|
|
88
|
+
/**
|
|
89
|
+
* Thrown when the API is temporarily unavailable (HTTP 503).
|
|
90
|
+
*/
|
|
91
|
+
class ServiceUnavailableError extends PacSpaceError {
|
|
92
|
+
constructor(message = 'Service temporarily unavailable', retryAfter = null, requestPath) {
|
|
93
|
+
super(message, 503, 'SERVICE_UNAVAILABLE', requestPath);
|
|
94
|
+
this.name = 'ServiceUnavailableError';
|
|
95
|
+
this.retryAfter = retryAfter;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.ServiceUnavailableError = ServiceUnavailableError;
|
|
72
99
|
/**
|
|
73
100
|
* Thrown when the API returns a validation error (HTTP 400).
|
|
74
101
|
*/
|
|
@@ -103,7 +130,15 @@ exports.WebhookVerificationError = WebhookVerificationError;
|
|
|
103
130
|
* Map an HTTP status code + API response to the appropriate typed error.
|
|
104
131
|
* @internal
|
|
105
132
|
*/
|
|
106
|
-
function mapApiError(statusCode, message, requestPath, headers) {
|
|
133
|
+
function mapApiError(statusCode, message, requestPath, headers, apiError) {
|
|
134
|
+
const headerRetryAfter = headers?.get('retry-after');
|
|
135
|
+
const parsedHeaderRetryAfter = headerRetryAfter
|
|
136
|
+
? Number.parseInt(headerRetryAfter, 10)
|
|
137
|
+
: null;
|
|
138
|
+
const retryAfterSeconds = apiError?.retryAfterSeconds ??
|
|
139
|
+
(Number.isFinite(parsedHeaderRetryAfter)
|
|
140
|
+
? parsedHeaderRetryAfter
|
|
141
|
+
: null);
|
|
107
142
|
switch (statusCode) {
|
|
108
143
|
case 400:
|
|
109
144
|
return new ValidationError(message, requestPath);
|
|
@@ -116,8 +151,13 @@ function mapApiError(statusCode, message, requestPath, headers) {
|
|
|
116
151
|
case 412:
|
|
117
152
|
return new ContractNotDeployedError(message, requestPath);
|
|
118
153
|
case 429: {
|
|
119
|
-
|
|
120
|
-
|
|
154
|
+
if (apiError?.code === 'CADENCE_LIMIT') {
|
|
155
|
+
return new CadenceLimitError(message, retryAfterSeconds, apiError.customerId ?? null, requestPath);
|
|
156
|
+
}
|
|
157
|
+
return new RateLimitError(message, retryAfterSeconds, requestPath);
|
|
158
|
+
}
|
|
159
|
+
case 503: {
|
|
160
|
+
return new ServiceUnavailableError(message, retryAfterSeconds, requestPath);
|
|
121
161
|
}
|
|
122
162
|
default:
|
|
123
163
|
return new PacSpaceError(message, statusCode, 'API_ERROR', requestPath);
|
package/dist/errors/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":";;;AA8KA,kCAyDC;AAvOD;;;GAGG;AACH,MAAa,aAAc,SAAQ,KAAK;IAQtC,YACE,OAAe,EACf,UAAkB,EAClB,IAAY,EACZ,WAAoB;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAE/B,0CAA0C;QAC1C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF;AAvBD,sCAuBC;AAED;;GAEG;AACH,MAAa,kBAAmB,SAAQ,aAAa;IACnD,YAAY,OAAO,GAAG,4BAA4B,EAAE,WAAoB;QACtE,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AALD,gDAKC;AAED;;GAEG;AACH,MAAa,wBAAyB,SAAQ,aAAa;IACzD,YACE,OAAO,GAAG,yCAAyC,EACnD,WAAoB;QAEpB,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,sBAAsB,EAAE,WAAW,CAAC,CAAC;QACzD,IAAI,CAAC,IAAI,GAAG,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a,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BalanceResource } from './resources/balance';
|
|
2
2
|
import { Webhooks } from './webhooks/verify';
|
|
3
3
|
import type { PacSpaceConfig } from './types/config';
|
|
4
|
+
import type { VerifyResponse } from './types/balance';
|
|
4
5
|
/**
|
|
5
6
|
* PacSpace SDK — the official TypeScript client for the PacSpace Balance API.
|
|
6
7
|
*
|
|
@@ -22,15 +23,24 @@ import type { PacSpaceConfig } from './types/config';
|
|
|
22
23
|
* theirs: 98000,
|
|
23
24
|
* });
|
|
24
25
|
*
|
|
25
|
-
* // Period-end
|
|
26
|
-
* const
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* // Period-end receipt (shareable verification proof)
|
|
27
|
+
* const receipt = await pac.balance.receipt('cust_123', { period: '2026-02' });
|
|
28
|
+
*
|
|
29
|
+
* // Verify a proof root (public, no auth)
|
|
30
|
+
* const verification = await pac.verify(receipt.proofRoot);
|
|
29
31
|
* ```
|
|
30
32
|
*/
|
|
31
33
|
export declare class PacSpace {
|
|
34
|
+
/**
|
|
35
|
+
* Preferred SDK initializer for Phase 3 surface.
|
|
36
|
+
*/
|
|
37
|
+
static init(apiKey: string, options?: Omit<PacSpaceConfig, 'apiKey'>): PacSpace;
|
|
32
38
|
/** @internal */
|
|
33
39
|
private readonly client;
|
|
40
|
+
/** Base URL for API (used by verify, which requires no auth). */
|
|
41
|
+
private readonly baseUrl;
|
|
42
|
+
private readonly fetchFn;
|
|
43
|
+
private readonly timeoutMs;
|
|
34
44
|
/**
|
|
35
45
|
* Balance API resource — emit deltas, derive balances, compare, receipt, checkpoint.
|
|
36
46
|
*/
|
|
@@ -44,21 +54,49 @@ export declare class PacSpace {
|
|
|
44
54
|
* Create a new PacSpace SDK instance.
|
|
45
55
|
*
|
|
46
56
|
* @param config - SDK configuration.
|
|
47
|
-
* @param config.apiKey - Your
|
|
48
|
-
* @param config.baseUrl - API base URL (optional,
|
|
57
|
+
* @param config.apiKey - Your Balance API key (required).
|
|
58
|
+
* @param config.baseUrl - API base URL (optional, overrides auto-routing).
|
|
59
|
+
* @param config.sandboxUrl - Custom sandbox URL (optional, used for `pk_test_*` keys).
|
|
60
|
+
* @param config.productionUrl - Custom production URL (optional, used for `pk_live_*` keys).
|
|
49
61
|
* @param config.chainId - Default chain ID (optional, auto-detected from key prefix).
|
|
50
62
|
* @param config.maxRetries - Max retries on transient errors (default: 2).
|
|
51
63
|
* @param config.timeout - Request timeout in ms (default: 30000).
|
|
52
64
|
*/
|
|
53
|
-
constructor(config: PacSpaceConfig
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
constructor(config: PacSpaceConfig);
|
|
66
|
+
/**
|
|
67
|
+
* Close the SDK client and reject buffered write requests.
|
|
68
|
+
*/
|
|
69
|
+
close(reason?: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Graceful shutdown: flush summary queue and close the client.
|
|
72
|
+
*/
|
|
73
|
+
shutdown(reason?: string): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Verify a proof root via the public verification endpoint.
|
|
76
|
+
*
|
|
77
|
+
* No API key required — the proof root itself serves as the access key.
|
|
78
|
+
* Anyone with a proof root can verify it independently.
|
|
79
|
+
*
|
|
80
|
+
* @param proofRoot - The proof root from a receipt (hex string).
|
|
81
|
+
* @returns Verification result with records and metadata.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* const result = await pac.verify('0x7f3a9b2c1d4e5f6a...');
|
|
86
|
+
* if (result.verified) {
|
|
87
|
+
* console.log(result.verification?.verificationExplorerUrl);
|
|
88
|
+
* console.log(result.summary?.recordCount);
|
|
89
|
+
* }
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
verify(proofRoot: string): Promise<VerifyResponse>;
|
|
56
93
|
}
|
|
57
94
|
export type { PacSpaceConfig, RequestOptions } from './types/config';
|
|
58
|
-
export type {
|
|
59
|
-
export type { EmitOptions, EmitAndWaitOptions, EmitResponse, DeriveOptions, DeriveResponse, VerifiedDelta, WindowSummary, CompareOptions, CompareBalances, CompareResponse, DiscrepancyReport, ReceiptResponse, CheckpointOptions, CheckpointResponse, } from './types/balance';
|
|
60
|
-
export {
|
|
95
|
+
export type { RecordStatus, CheckpointType } from './types/common';
|
|
96
|
+
export type { EmitOptions, EmitAndWaitOptions, EmitResponse, DeriveOptions, DeriveResponse, VerifiedDelta, WindowSummary, CompareOptions, CompareBalances, CompareResponse, DiscrepancyReport, ReceiptResponse, CheckpointOptions, CheckpointResponse, DeltaStatusResponse, WaitForVerifiedOptions, UsageResponse, SequenceGapsOptions, SequenceGapRange, SequenceGapsResponse, BulkDelta, BulkEmitOptions, BulkEmitResponse, BulkDeltaResult, ListWebhookDeliveriesOptions, ListWebhookDeliveriesResponse, CustomerRecordSummary, CustomerRecordDetail, CustomerRecordActivity, ListCustomersOptions, ListCustomersResponse, GetCustomerOptions, InvoiceProofOptions, InvoiceProofResponse, InvoiceProofDelta, InvoiceProofWindowSummary, InvoiceProofVerification, VerifyResponse, VerifySummary, VerifyRecord, VerifyVerification, } from './types/balance';
|
|
97
|
+
export type { SubmissionProfile, SubmissionAutomationOptions, CustomerUsageSummary, QueuedUsageSummary, FlushSummariesOptions, SummaryFlushFailure, SummaryFlushResult, SubmissionQueueState, } from './types/submission';
|
|
98
|
+
export { PacSpaceError, InvalidApiKeyError, InsufficientCreditsError, NotFoundError, ContractNotDeployedError, CadenceLimitError, RateLimitError, ServiceUnavailableError, ValidationError, TimeoutError, WebhookVerificationError, } from './errors';
|
|
61
99
|
export { Webhooks } from './webhooks/verify';
|
|
62
100
|
export type { VerifyOptions, } from './webhooks/verify';
|
|
63
|
-
export type { WebhookEventType, WebhookEvent, WebhookEventMap, WebhookHeaders, DeltaVerifiedPayload,
|
|
101
|
+
export type { KnownWebhookEventType, WebhookEventType, WebhookEvent, WebhookEventMap, WebhookHeaders, DeltaVerifiedPayload, DeltaFailedPayload, } from './webhooks/types';
|
|
64
102
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQtD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,QAAQ;IACnB;;OAEG;IACH,MAAM,CAAC,IAAI,CACT,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAM,GAC3C,QAAQ;IAIX,gBAAgB;IAChB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;IACpC,iEAAiE;IACjE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAExC;;;;;;;;;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B,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,wBAAwB,GACzB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,YAAY,EACV,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Webhooks = exports.WebhookVerificationError = exports.TimeoutError = exports.ValidationError = exports.RateLimitError = exports.ContractNotDeployedError = exports.NotFoundError = exports.InsufficientCreditsError = exports.InvalidApiKeyError = exports.PacSpaceError = exports.PacSpace = void 0;
|
|
3
|
+
exports.Webhooks = exports.WebhookVerificationError = exports.TimeoutError = exports.ValidationError = exports.ServiceUnavailableError = exports.RateLimitError = exports.CadenceLimitError = exports.ContractNotDeployedError = exports.NotFoundError = exports.InsufficientCreditsError = exports.InvalidApiKeyError = exports.PacSpaceError = exports.PacSpace = void 0;
|
|
4
4
|
const client_1 = require("./client");
|
|
5
5
|
const balance_1 = require("./resources/balance");
|
|
6
6
|
const verify_1 = require("./webhooks/verify");
|
|
7
|
+
/** Default sandbox API base URL. */
|
|
8
|
+
const DEFAULT_SANDBOX_URL = 'https://api-sandbox-wnizuypena-uw.a.run.app';
|
|
9
|
+
/** Default production API base URL. */
|
|
10
|
+
const DEFAULT_PRODUCTION_URL = 'https://api.pacspace.io';
|
|
7
11
|
/**
|
|
8
12
|
* PacSpace SDK — the official TypeScript client for the PacSpace Balance API.
|
|
9
13
|
*
|
|
@@ -25,30 +29,123 @@ const verify_1 = require("./webhooks/verify");
|
|
|
25
29
|
* theirs: 98000,
|
|
26
30
|
* });
|
|
27
31
|
*
|
|
28
|
-
* // Period-end
|
|
29
|
-
* const
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
+
* // Period-end receipt (shareable verification proof)
|
|
33
|
+
* const receipt = await pac.balance.receipt('cust_123', { period: '2026-02' });
|
|
34
|
+
*
|
|
35
|
+
* // Verify a proof root (public, no auth)
|
|
36
|
+
* const verification = await pac.verify(receipt.proofRoot);
|
|
32
37
|
* ```
|
|
33
38
|
*/
|
|
34
39
|
class PacSpace {
|
|
40
|
+
/**
|
|
41
|
+
* Preferred SDK initializer for Phase 3 surface.
|
|
42
|
+
*/
|
|
43
|
+
static init(apiKey, options = {}) {
|
|
44
|
+
return new PacSpace({ apiKey, ...options });
|
|
45
|
+
}
|
|
35
46
|
/**
|
|
36
47
|
* Create a new PacSpace SDK instance.
|
|
37
48
|
*
|
|
38
49
|
* @param config - SDK configuration.
|
|
39
|
-
* @param config.apiKey - Your
|
|
40
|
-
* @param config.baseUrl - API base URL (optional,
|
|
50
|
+
* @param config.apiKey - Your Balance API key (required).
|
|
51
|
+
* @param config.baseUrl - API base URL (optional, overrides auto-routing).
|
|
52
|
+
* @param config.sandboxUrl - Custom sandbox URL (optional, used for `pk_test_*` keys).
|
|
53
|
+
* @param config.productionUrl - Custom production URL (optional, used for `pk_live_*` keys).
|
|
41
54
|
* @param config.chainId - Default chain ID (optional, auto-detected from key prefix).
|
|
42
55
|
* @param config.maxRetries - Max retries on transient errors (default: 2).
|
|
43
56
|
* @param config.timeout - Request timeout in ms (default: 30000).
|
|
44
57
|
*/
|
|
45
58
|
constructor(config) {
|
|
59
|
+
// HttpClient handles base URL auto-routing internally
|
|
46
60
|
this.client = new client_1.HttpClient(config);
|
|
47
|
-
this.
|
|
61
|
+
this.fetchFn = config.fetch || globalThis.fetch;
|
|
62
|
+
this.timeoutMs = config.timeout ?? 30000;
|
|
63
|
+
// For verify() method, we need to determine base URL ourselves
|
|
64
|
+
// Use explicit baseUrl if provided, otherwise auto-route
|
|
65
|
+
if (config.baseUrl) {
|
|
66
|
+
this.baseUrl = config.baseUrl.replace(/\/+$/, '');
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
const apiKey = config.apiKey;
|
|
70
|
+
if (apiKey.startsWith('pk_test_')) {
|
|
71
|
+
this.baseUrl = (config.sandboxUrl || DEFAULT_SANDBOX_URL).replace(/\/+$/, '');
|
|
72
|
+
}
|
|
73
|
+
else if (apiKey.startsWith('pk_live_')) {
|
|
74
|
+
this.baseUrl = (config.productionUrl || DEFAULT_PRODUCTION_URL).replace(/\/+$/, '');
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// Fallback to production
|
|
78
|
+
this.baseUrl = (config.productionUrl || DEFAULT_PRODUCTION_URL).replace(/\/+$/, '');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
this.balance = new balance_1.BalanceResource(this.client, config.submission);
|
|
48
82
|
if (config.webhookSecret) {
|
|
49
83
|
this.webhooks = new verify_1.Webhooks(config.webhookSecret);
|
|
50
84
|
}
|
|
51
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Close the SDK client and reject buffered write requests.
|
|
88
|
+
*/
|
|
89
|
+
close(reason) {
|
|
90
|
+
this.balance.stopSummaryScheduler();
|
|
91
|
+
this.client.close(reason);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Graceful shutdown: flush summary queue and close the client.
|
|
95
|
+
*/
|
|
96
|
+
async shutdown(reason = 'SDK shutdown') {
|
|
97
|
+
await this.balance.shutdownSummaryScheduler();
|
|
98
|
+
this.client.close(reason);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Verify a proof root via the public verification endpoint.
|
|
102
|
+
*
|
|
103
|
+
* No API key required — the proof root itself serves as the access key.
|
|
104
|
+
* Anyone with a proof root can verify it independently.
|
|
105
|
+
*
|
|
106
|
+
* @param proofRoot - The proof root from a receipt (hex string).
|
|
107
|
+
* @returns Verification result with records and metadata.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const result = await pac.verify('0x7f3a9b2c1d4e5f6a...');
|
|
112
|
+
* if (result.verified) {
|
|
113
|
+
* console.log(result.verification?.verificationExplorerUrl);
|
|
114
|
+
* console.log(result.summary?.recordCount);
|
|
115
|
+
* }
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
async verify(proofRoot) {
|
|
119
|
+
const url = `${this.baseUrl}/api/v1/verify/${encodeURIComponent(proofRoot)}`;
|
|
120
|
+
const controller = new AbortController();
|
|
121
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
122
|
+
let response;
|
|
123
|
+
try {
|
|
124
|
+
response = await this.fetchFn(url, {
|
|
125
|
+
method: 'GET',
|
|
126
|
+
signal: controller.signal,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
131
|
+
throw new Error(`Verification request timed out after ${this.timeoutMs}ms`);
|
|
132
|
+
}
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
clearTimeout(timeoutId);
|
|
137
|
+
}
|
|
138
|
+
if (!response.ok) {
|
|
139
|
+
const body = (await response.json().catch(() => ({})));
|
|
140
|
+
const msg = body.error ?? body.message ?? response.statusText;
|
|
141
|
+
throw new Error(`Verification failed: ${msg}`);
|
|
142
|
+
}
|
|
143
|
+
const raw = (await response.json());
|
|
144
|
+
if (raw.success && raw.data !== undefined) {
|
|
145
|
+
return raw.data;
|
|
146
|
+
}
|
|
147
|
+
throw new Error('Verification failed: unexpected response format');
|
|
148
|
+
}
|
|
52
149
|
}
|
|
53
150
|
exports.PacSpace = PacSpace;
|
|
54
151
|
// Errors
|
|
@@ -58,7 +155,9 @@ Object.defineProperty(exports, "InvalidApiKeyError", { enumerable: true, get: fu
|
|
|
58
155
|
Object.defineProperty(exports, "InsufficientCreditsError", { enumerable: true, get: function () { return errors_1.InsufficientCreditsError; } });
|
|
59
156
|
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return errors_1.NotFoundError; } });
|
|
60
157
|
Object.defineProperty(exports, "ContractNotDeployedError", { enumerable: true, get: function () { return errors_1.ContractNotDeployedError; } });
|
|
158
|
+
Object.defineProperty(exports, "CadenceLimitError", { enumerable: true, get: function () { return errors_1.CadenceLimitError; } });
|
|
61
159
|
Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return errors_1.RateLimitError; } });
|
|
160
|
+
Object.defineProperty(exports, "ServiceUnavailableError", { enumerable: true, get: function () { return errors_1.ServiceUnavailableError; } });
|
|
62
161
|
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return errors_1.ValidationError; } });
|
|
63
162
|
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return errors_1.TimeoutError; } });
|
|
64
163
|
Object.defineProperty(exports, "WebhookVerificationError", { enumerable: true, get: function () { return errors_1.WebhookVerificationError; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAsC;AACtC,iDAAsD;AACtD,8CAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAsC;AACtC,iDAAsD;AACtD,8CAA6C;AAI7C,oCAAoC;AACpC,MAAM,mBAAmB,GAAG,6CAA6C,CAAC;AAE1E,uCAAuC;AACvC,MAAM,sBAAsB,GAAG,yBAAyB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,QAAQ;IACnB;;OAEG;IACH,MAAM,CAAC,IAAI,CACT,MAAc,EACd,UAA0C,EAAE;QAE5C,OAAO,IAAI,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9C,CAAC;IAoBD;;;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