@paxosglobal/sdk 0.0.0-stage → 0.1.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/AGENTS.md +268 -0
- package/CHANGELOG.md +35 -0
- package/LICENSE +191 -0
- package/README.md +445 -2
- package/dist/auth.d.ts +60 -0
- package/dist/auth.js +248 -0
- package/dist/auth.js.map +1 -0
- package/dist/client.d.ts +353 -0
- package/dist/client.js +967 -0
- package/dist/client.js.map +1 -0
- package/dist/constants.d.ts +16 -0
- package/dist/constants.js +17 -0
- package/dist/constants.js.map +1 -0
- package/dist/decimal-fields.d.ts +16 -0
- package/dist/decimal-fields.js +570 -0
- package/dist/decimal-fields.js.map +1 -0
- package/dist/decimal.d.ts +25 -0
- package/dist/decimal.js +93 -0
- package/dist/decimal.js.map +1 -0
- package/dist/decode.d.ts +34 -0
- package/dist/decode.js +118 -0
- package/dist/decode.js.map +1 -0
- package/dist/enums.d.ts +1080 -0
- package/dist/enums.js +1031 -0
- package/dist/enums.js.map +1 -0
- package/dist/errors.d.ts +142 -0
- package/dist/errors.js +261 -0
- package/dist/errors.js.map +1 -0
- package/dist/generated-types.d.ts +13629 -0
- package/dist/generated-types.js +3 -0
- package/dist/generated-types.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/models.d.ts +299 -0
- package/dist/models.js +3 -0
- package/dist/models.js.map +1 -0
- package/dist/paxos-client.d.ts +107 -0
- package/dist/paxos-client.js +157 -0
- package/dist/paxos-client.js.map +1 -0
- package/dist/query-keys.d.ts +1 -0
- package/dist/query-keys.js +31 -0
- package/dist/query-keys.js.map +1 -0
- package/dist/response-defaults.d.ts +2 -0
- package/dist/response-defaults.js +109 -0
- package/dist/response-defaults.js.map +1 -0
- package/dist/services/account-members.d.ts +32 -0
- package/dist/services/account-members.js +46 -0
- package/dist/services/account-members.js.map +1 -0
- package/dist/services/accounts.d.ts +74 -0
- package/dist/services/accounts.js +71 -0
- package/dist/services/accounts.js.map +1 -0
- package/dist/services/address-verification.d.ts +72 -0
- package/dist/services/address-verification.js +64 -0
- package/dist/services/address-verification.js.map +1 -0
- package/dist/services/api-credentials.d.ts +44 -0
- package/dist/services/api-credentials.js +42 -0
- package/dist/services/api-credentials.js.map +1 -0
- package/dist/services/claims.d.ts +68 -0
- package/dist/services/claims.js +67 -0
- package/dist/services/claims.js.map +1 -0
- package/dist/services/cross-chain-transfer.d.ts +71 -0
- package/dist/services/cross-chain-transfer.js +68 -0
- package/dist/services/cross-chain-transfer.js.map +1 -0
- package/dist/services/crypto-deposits.d.ts +30 -0
- package/dist/services/crypto-deposits.js +39 -0
- package/dist/services/crypto-deposits.js.map +1 -0
- package/dist/services/crypto-withdrawals.d.ts +60 -0
- package/dist/services/crypto-withdrawals.js +42 -0
- package/dist/services/crypto-withdrawals.js.map +1 -0
- package/dist/services/deposit-addresses.d.ts +54 -0
- package/dist/services/deposit-addresses.js +36 -0
- package/dist/services/deposit-addresses.js.map +1 -0
- package/dist/services/events.d.ts +53 -0
- package/dist/services/events.js +39 -0
- package/dist/services/events.js.map +1 -0
- package/dist/services/exchange.d.ts +52 -0
- package/dist/services/exchange.js +30 -0
- package/dist/services/exchange.js.map +1 -0
- package/dist/services/fees.d.ts +15 -0
- package/dist/services/fees.js +24 -0
- package/dist/services/fees.js.map +1 -0
- package/dist/services/fiat-transfers.d.ts +133 -0
- package/dist/services/fiat-transfers.js +127 -0
- package/dist/services/fiat-transfers.js.map +1 -0
- package/dist/services/identity-controls.d.ts +43 -0
- package/dist/services/identity-controls.js +42 -0
- package/dist/services/identity-controls.js.map +1 -0
- package/dist/services/identity-documents.d.ts +45 -0
- package/dist/services/identity-documents.js +50 -0
- package/dist/services/identity-documents.js.map +1 -0
- package/dist/services/identity.d.ts +122 -0
- package/dist/services/identity.js +66 -0
- package/dist/services/identity.js.map +1 -0
- package/dist/services/index.d.ts +89 -0
- package/dist/services/index.js +55 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/institution-members.d.ts +30 -0
- package/dist/services/institution-members.js +44 -0
- package/dist/services/institution-members.js.map +1 -0
- package/dist/services/internal-transfers.d.ts +15 -0
- package/dist/services/internal-transfers.js +26 -0
- package/dist/services/internal-transfers.js.map +1 -0
- package/dist/services/issuer-quotes.d.ts +72 -0
- package/dist/services/issuer-quotes.js +66 -0
- package/dist/services/issuer-quotes.js.map +1 -0
- package/dist/services/limits.d.ts +20 -0
- package/dist/services/limits.js +23 -0
- package/dist/services/limits.js.map +1 -0
- package/dist/services/market-data.d.ts +15 -0
- package/dist/services/market-data.js +23 -0
- package/dist/services/market-data.js.map +1 -0
- package/dist/services/monitoring-addresses.d.ts +64 -0
- package/dist/services/monitoring-addresses.js +68 -0
- package/dist/services/monitoring-addresses.js.map +1 -0
- package/dist/services/orchestration-rules.d.ts +53 -0
- package/dist/services/orchestration-rules.js +47 -0
- package/dist/services/orchestration-rules.js.map +1 -0
- package/dist/services/orchestrations.d.ts +70 -0
- package/dist/services/orchestrations.js +45 -0
- package/dist/services/orchestrations.js.map +1 -0
- package/dist/services/orders.d.ts +86 -0
- package/dist/services/orders.js +67 -0
- package/dist/services/orders.js.map +1 -0
- package/dist/services/paxos-transfers.d.ts +24 -0
- package/dist/services/paxos-transfers.js +35 -0
- package/dist/services/paxos-transfers.js.map +1 -0
- package/dist/services/payments.d.ts +46 -0
- package/dist/services/payments.js +35 -0
- package/dist/services/payments.js.map +1 -0
- package/dist/services/payout-groups.d.ts +59 -0
- package/dist/services/payout-groups.js +59 -0
- package/dist/services/payout-groups.js.map +1 -0
- package/dist/services/pricing.d.ts +67 -0
- package/dist/services/pricing.js +42 -0
- package/dist/services/pricing.js.map +1 -0
- package/dist/services/profiles.d.ts +106 -0
- package/dist/services/profiles.js +84 -0
- package/dist/services/profiles.js.map +1 -0
- package/dist/services/quote-executions.d.ts +51 -0
- package/dist/services/quote-executions.js +41 -0
- package/dist/services/quote-executions.js.map +1 -0
- package/dist/services/quotes.d.ts +44 -0
- package/dist/services/quotes.js +48 -0
- package/dist/services/quotes.js.map +1 -0
- package/dist/services/reward-addresses.d.ts +80 -0
- package/dist/services/reward-addresses.js +79 -0
- package/dist/services/reward-addresses.js.map +1 -0
- package/dist/services/rewards-statements.d.ts +35 -0
- package/dist/services/rewards-statements.js +32 -0
- package/dist/services/rewards-statements.js.map +1 -0
- package/dist/services/rewards.d.ts +34 -0
- package/dist/services/rewards.js +37 -0
- package/dist/services/rewards.js.map +1 -0
- package/dist/services/sandbox-deposits.d.ts +15 -0
- package/dist/services/sandbox-deposits.js +22 -0
- package/dist/services/sandbox-deposits.js.map +1 -0
- package/dist/services/sandbox-fiat-transfers.d.ts +15 -0
- package/dist/services/sandbox-fiat-transfers.js +24 -0
- package/dist/services/sandbox-fiat-transfers.js.map +1 -0
- package/dist/services/sandbox-identity.d.ts +39 -0
- package/dist/services/sandbox-identity.js +60 -0
- package/dist/services/sandbox-identity.js.map +1 -0
- package/dist/services/settlement.d.ts +76 -0
- package/dist/services/settlement.js +79 -0
- package/dist/services/settlement.js.map +1 -0
- package/dist/services/stablecoin-conversion.d.ts +70 -0
- package/dist/services/stablecoin-conversion.js +65 -0
- package/dist/services/stablecoin-conversion.js.map +1 -0
- package/dist/services/statements.d.ts +44 -0
- package/dist/services/statements.js +35 -0
- package/dist/services/statements.js.map +1 -0
- package/dist/services/tax-documentation.d.ts +21 -0
- package/dist/services/tax-documentation.js +33 -0
- package/dist/services/tax-documentation.js.map +1 -0
- package/dist/services/tax-forms.d.ts +45 -0
- package/dist/services/tax-forms.js +38 -0
- package/dist/services/tax-forms.js.map +1 -0
- package/dist/services/transfers.d.ts +96 -0
- package/dist/services/transfers.js +37 -0
- package/dist/services/transfers.js.map +1 -0
- package/dist/services/travel-rule.d.ts +32 -0
- package/dist/services/travel-rule.js +30 -0
- package/dist/services/travel-rule.js.map +1 -0
- package/dist/services/user-audit-logs.d.ts +45 -0
- package/dist/services/user-audit-logs.js +27 -0
- package/dist/services/user-audit-logs.js.map +1 -0
- package/dist/services/webhooks.d.ts +58 -0
- package/dist/services/webhooks.js +42 -0
- package/dist/services/webhooks.js.map +1 -0
- package/dist/signing.d.ts +33 -0
- package/dist/signing.js +186 -0
- package/dist/signing.js.map +1 -0
- package/dist/testing/fixtures.d.ts +40 -0
- package/dist/testing/fixtures.js +131 -0
- package/dist/testing/fixtures.js.map +1 -0
- package/dist/testing/index.d.ts +28 -0
- package/dist/testing/index.js +28 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/mock-server.d.ts +121 -0
- package/dist/testing/mock-server.js +276 -0
- package/dist/testing/mock-server.js.map +1 -0
- package/dist/timeouts.d.ts +13 -0
- package/dist/timeouts.js +71 -0
- package/dist/timeouts.js.map +1 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/package.json +67 -4
package/AGENTS.md
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# Paxos TypeScript SDK
|
|
2
|
+
|
|
3
|
+
Guidance for coding agents integrating the Paxos TypeScript SDK. Docs: https://docs.paxos.com/sdks (SDK guides) and https://docs.paxos.com (API reference).
|
|
4
|
+
|
|
5
|
+
## Install and import
|
|
6
|
+
|
|
7
|
+
Requires Node 22.12+. The package is ESM-only (`"type": "module"`); use `import`, not `require`.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @paxosglobal/sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { PaxosClient, Scope } from "@paxosglobal/sdk";
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
const client = new PaxosClient({
|
|
21
|
+
clientId: process.env.PAXOS_CLIENT_ID!,
|
|
22
|
+
clientSecret: process.env.PAXOS_CLIENT_SECRET!,
|
|
23
|
+
scopes: [Scope.TRANSFER_READ_TRANSFER],
|
|
24
|
+
sandbox: true,
|
|
25
|
+
});
|
|
26
|
+
const transfer = await client.transfers.getTransfer("txn_123");
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Client construction, scopes, sandbox vs production, environment variables
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
const client = new PaxosClient({
|
|
33
|
+
clientId: "...",
|
|
34
|
+
clientSecret: "...",
|
|
35
|
+
scopes: [Scope.TRANSFER_READ_TRANSFER], // required
|
|
36
|
+
sandbox: true, // sandbox environment (omit for production)
|
|
37
|
+
logger: (level, msg, data) => console.log(msg), // debug logging
|
|
38
|
+
signingKey: "<private-key-pem-or-hex>", // JWS request signing
|
|
39
|
+
keyId: "<registered-key-uuid>", // signing key ID
|
|
40
|
+
beforeRequest: (req) => {}, // hook before each API attempt
|
|
41
|
+
afterResponse: (req, res) => {}, // hook after each response
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- At least one scope is required: the constructor throws an `Error` otherwise. `scopes` is typed `KnownScope[]`, so use the generated `Scope` constants (arbitrary strings do not type-check). Methods state the scope they need in their doc comment; a few public endpoints need none, but the client still requires one.
|
|
46
|
+
- Credentials do not select the environment: pass `sandbox: true` explicitly. Sandbox and production credentials differ. `sandbox` cannot be combined with `baseUrl` or `tokenUrl` (set both URLs, without sandbox, for a local or test server; the constructor throws if only one is set, and an empty string counts as unset). `fetch` accepts a custom `fetch` for proxies or custom TLS.
|
|
47
|
+
- Create one client per application component and share it across concurrent promises; this reuses OAuth tokens and connections. Auth (token acquisition, caching, refresh) is automatic. The client has no `close()`; cancel work with a per-call `AbortSignal`.
|
|
48
|
+
- The SDK does not read credentials itself; pass them in. The conventional variable names are:
|
|
49
|
+
|
|
50
|
+
| Variable | Read by | Description |
|
|
51
|
+
| --------------------- | --------- | ------------------------------- |
|
|
52
|
+
| `PAXOS_CLIENT_ID` | your code | OAuth2 client ID |
|
|
53
|
+
| `PAXOS_CLIENT_SECRET` | your code | OAuth2 client secret |
|
|
54
|
+
| `PAXOS_LOG_LEVEL` | SDK | `debug` to enable debug logging |
|
|
55
|
+
|
|
56
|
+
## Calling services
|
|
57
|
+
|
|
58
|
+
Services are readonly properties on the client: `client.<service>.<method>(...)`. Request bodies use the API's snake_case field names; query parameters take the API's wire names (dotted filters such as `created_at.gt` become `created_at_gt`). Empty lists and empty map fields are omitted from request bodies; empty objects for nested model fields are sent as given. A query parameter set to `""` is sent as `key=`; leave it `undefined` to omit it (an empty `page_cursor` is the exception and is not sent).
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
const transfer = await client.transfers.getTransfer("txn_123"); // Promise<Transfer>
|
|
62
|
+
await client.cryptoWithdrawals.createCryptoWithdrawal({/* typed request body */});
|
|
63
|
+
for await (const t of client.transfers.listTransfers({ limit: 50 })) {
|
|
64
|
+
console.log(t.id);
|
|
65
|
+
} // PageIterator<Transfer>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Response enum fields (for example `transfer.status`) are plain strings that keep values added by the API after this SDK version. Compare against constants such as `TransferStatus.COMPLETED` and always handle an unrecognized value; never treat an unknown status as success or failure. A non-string JSON value in a response enum field, enum list element or enum map value is rejected at decode time as a malformed-response `PaxosApiError`; `null` and absent values are left as they are.
|
|
69
|
+
|
|
70
|
+
The API omits zero values from responses, so the spec's required fields can be absent on the wire. The SDK fills a required decimal, string, number, boolean or list field the API omitted with its zero value (`Decimal(0)`, `""`, `0`, `false`, `[]`), recursively through nested objects and list items, so the runtime value matches the declared type. Lists and maps, required or optional, decode as `[]` and `{}`. Optional scalar fields, nested objects, timestamps, enum fields and fields marked nullable stay `undefined` when absent (an explicit JSON `null` on a required field gives `null`). A zero decimal or timestamp may also arrive as `"0"` or the epoch; check the field's meaning before treating a zero as missing.
|
|
71
|
+
|
|
72
|
+
## Pagination
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
for await (const transfer of client.transfers.listTransfers({ limit: 100, profile_ids: ["p_123"] })) {
|
|
76
|
+
console.log(transfer.id);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
List methods return `PageIterator<T>`, an `AsyncGenerator<T>` with a `pages()` method. Cursor management is automatic and iteration always terminates, even if the server returns a non-advancing cursor or an empty page alongside one.
|
|
81
|
+
|
|
82
|
+
`pages()` yields `Page<T>` = `{ items, nextCursor, metadata }`, where `nextCursor` is the cursor to resume from (pass it as `page_cursor`) and `metadata` is that page's own response metadata. Mixing item iteration and `pages()` on a live iterator throws `RangeError`. A fetch error finishes the iterator; `return()` or disposal stops fetching.
|
|
83
|
+
|
|
84
|
+
`limit` is a page-size hint, not a total cap, and is passed unchanged on every page. Bound the whole iteration with `maxItems` and/or `maxDuration` (milliseconds) in the second argument:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
for await (const transfer of client.transfers.listTransfers(
|
|
88
|
+
{ limit: 100, profile_ids: ["p_123"] },
|
|
89
|
+
{ maxItems: 250, maxDuration: 10_000 }, // stop after 250 items total or 10s, whichever first
|
|
90
|
+
)) {
|
|
91
|
+
console.log(transfer.id);
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Exceeding `maxDuration` throws `PaxosTimeoutError`, not a silent truncation; catch it if partial results are acceptable. The duration starts on first consumption and counts pauses between items.
|
|
96
|
+
|
|
97
|
+
## Errors
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
import { isNotFoundError, isApiError } from "@paxosglobal/sdk";
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
await client.transfers.getTransfer("txn_123");
|
|
104
|
+
} catch (err) {
|
|
105
|
+
if (isNotFoundError(err)) console.log(err.detail, err.requestId);
|
|
106
|
+
else if (isApiError(err)) console.log(err.status, err.requestId, err.detail);
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
- Type guards: `isPaxosError` (any SDK error), `isApiError`, `isNotFoundError`, `isRateLimitError`, `isUnauthorizedError`, `isForbiddenError`, `isValidationError`, `isConflictError`, `isUnprocessableError`, `isServerError`, `isAuthenticationError`, `isNetworkError`, `isTimeoutError`. `requestId`, `detail` and `title` are on every `PaxosError` (`undefined` when absent).
|
|
111
|
+
- HTTP status selects the error class, even when the error body is malformed. The request ID comes from a valid body `request_id`, else the `Paxos-Request-Id` response header, else the outgoing request's ID.
|
|
112
|
+
- Transport failures (DNS, connection refused, TLS, reset) throw `PaxosNetworkError` (no status, `cause` preserved), never `PaxosServerError`. Timeouts throw `PaxosTimeoutError`. Neither is a `PaxosApiError`, so guard `err.status` with `isApiError`. Both expose `requestId` of the most recent attempt built (`undefined` if none); the request may still have reached Paxos, so quote the ID to support.
|
|
113
|
+
- A 2xx body that cannot be decoded (including a bad item during pagination) throws `PaxosApiError` with the real status and request ID and a sanitized cause that contains no body text. It is not retried.
|
|
114
|
+
- OAuth HTTP failures and malformed token replies throw `PaxosAuthenticationError` (`isAuthenticationError`) with `status`, `requestId` and an allowlisted `code`; raw token replies are never included. This is distinct from an endpoint `PaxosUnauthorizedError`.
|
|
115
|
+
- Errors on a later pagination page reach the caller with their type, status and request ID; they never look like normal completion.
|
|
116
|
+
|
|
117
|
+
## Money and decimals
|
|
118
|
+
|
|
119
|
+
Use `Decimal` (from `decimal.js`, re-exported by the SDK). Never use `number` for financial arithmetic. Pass decimals directly in typed requests; the SDK writes the API's string format, so do not pre-convert to strings.
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
import { Decimal } from "@paxosglobal/sdk";
|
|
123
|
+
const amount = new Decimal("1.23"); // construct from strings, never floats
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Timestamps
|
|
127
|
+
|
|
128
|
+
Timestamps in models and query params are RFC 3339 `string` values (for example `created_at_lt: "2026-01-02T15:04:05Z"`); the SDK does not convert them to `Date`. The API can return microsecond precision (varies by resource), so parse with care (`new Date(...)` truncates to milliseconds) and prefer UTC values for filters.
|
|
129
|
+
|
|
130
|
+
## Per-request options
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
const transfer = await client.transfers.getTransfer("txn_123", {
|
|
134
|
+
callTimeout: 60_000, // milliseconds
|
|
135
|
+
extraHeaders: { "X-Trace-Id": "abc" },
|
|
136
|
+
signal: controller.signal, // AbortSignal for cancellation
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Cancellation: call `controller.abort()`; the call rejects with an abort error and starts no further attempts. The signal is combined with the SDK's own timeouts.
|
|
141
|
+
|
|
142
|
+
## Retries, timeouts and ref_id/idempotency
|
|
143
|
+
|
|
144
|
+
- Default policy: up to 3 retries with backoff for HTTP 429, 500, 502, 503 and 504. Set `maxRetries` on the client or per request (integers 0 to 2147483646; 0 disables ordinary retries). One 401 token refresh is separate and does not count as a retry.
|
|
145
|
+
- HTTP 500, 502, 503 and 504 responses are retried for GET, HEAD, OPTIONS and DELETE, and for POST, PUT and PATCH requests on operations whose ref_id the SDK manages (create operations with a ref_id). Other POST, PUT and PATCH requests, including UpdateIdentity and UpdateAccount, are returned to the caller without a retry because the request may already have taken effect; check the resource's state before retrying such a call yourself.
|
|
146
|
+
- Network failures retry only for GET/HEAD/OPTIONS. An ambiguous network failure on a mutation is surfaced, never replayed. OAuth failures are surfaced without an extra retry loop. Once a rate-limit or server error reaches your code the SDK call is finished.
|
|
147
|
+
- The Paxos API does not send `Retry-After` (or rate-limit headers), so the SDK does not read them; 429 retries use the SDK's own backoff. Do not build retry logic that waits for or parses `Retry-After`.
|
|
148
|
+
- Budgets: `callTimeout` (default 30000 ms) is one budget for OAuth, token waits, retries, backoff and reading the full response body. Optional `callAttemptTimeout` caps each HTTP attempt (default: no cap). Request options override client options; `undefined` inherits and `null` disables that one budget. Values must be positive.
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
const client = new PaxosClient({ /* ... */ callTimeout: 30_000, callAttemptTimeout: 10_000 });
|
|
152
|
+
await client.transfers.getTransfer("txn_123", { callTimeout: 60_000, callAttemptTimeout: null });
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
- `ref_id`: for operations that accept one, the SDK fills an omitted or empty `ref_id` once per method call without mutating your request object and reuses it across internal retries. A second call without an ID gets a new one, so this does not give application-level deduplication.
|
|
156
|
+
- For jobs that may restart or be retried by a queue: generate an ID (a UUID is fine) when the job is created and persist it with the payload before the first API call; send it as `ref_id`; after a timeout, transport error or exhausted retries keep the same ID and payload and reconcile via the operation's lookup or list API (for example `listTransfers` with `ref_ids`) before resubmitting; treat a conflict as a reason to reconcile, not to mint a new ID; use a new ID only for a genuinely new operation. A timeout or cancellation does not prove the server rejected a mutation.
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
import { Decimal } from "@paxosglobal/sdk";
|
|
160
|
+
|
|
161
|
+
const transfer = await client.cryptoWithdrawals.createCryptoWithdrawal({
|
|
162
|
+
profile_id: "p_123",
|
|
163
|
+
asset: "BTC",
|
|
164
|
+
crypto_network: "BITCOIN",
|
|
165
|
+
destination_address: "bc1q...",
|
|
166
|
+
amount: new Decimal("0.001"),
|
|
167
|
+
ref_id: "saved-withdrawal-001", // loaded with this payload from durable storage
|
|
168
|
+
});
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Hooks and authentication errors
|
|
172
|
+
|
|
173
|
+
- `beforeRequest(req)` runs on every API attempt (including retries and the 401 refresh retry), before signing, and not for OAuth token requests. `req` has `method`, `url`, `headers` and `body`. It may add headers and override `Paxos-Request-Id`; changing the method, URL or body, changing or removing an SDK-owned header (`Authorization`, `Content-Type`, `Accept`, `Paxos-SDK-Language`, `Paxos-SDK-Version`), or adding `Paxos-Signature` fails the call before anything is sent.
|
|
174
|
+
- `afterResponse(req, res)` runs for every attempt that received a response (`res` has `status`, `headers` and the buffered `body`), before status handling. It does not run on network failures.
|
|
175
|
+
- Throwing (or rejecting) from either hook stops retry and token refresh and preserves the exception; an after-hook failure takes precedence over the HTTP error. One hook of each kind per client.
|
|
176
|
+
|
|
177
|
+
## Request signing
|
|
178
|
+
|
|
179
|
+
Request signing is configured per OAuth client. Setup follows the guide (https://docs.paxos.com/guides/developer/request-signing), which says request signing "must be activated by Paxos" and to contact Support (https://support.paxos.com). Credentials with the crypto-withdrawal scope also need Paxos Support to register the public key before signing works.
|
|
180
|
+
|
|
181
|
+
1. Generate a private key with OpenSSL 3 or later (check with `openssl version`; the macOS system `openssl` is LibreSSL and does not support Ed25519). For Ed25519 (EdDSA): `openssl genpkey -algorithm ed25519 -out private.pem`. For P-256 (ES256): `openssl ecparam -name prime256v1 -genkey -noout -out private.pem`
|
|
182
|
+
2. Derive the public key. For Ed25519: `openssl pkey -in private.pem -pubout -out public.pem`. For P-256: `openssl ec -in private.pem -pubout -out public.pem`
|
|
183
|
+
3. In the Dashboard, go to Developer > API, open the credential and choose Edit. Click "Add Public Key", enter a nickname, select the algorithm that matches your key (EdDSA or ES256), paste the contents of `public.pem`, click "Save Key", then save the credential with "Save API Credential".
|
|
184
|
+
4. Copy the Key ID (a UUID) shown on the saved public key.
|
|
185
|
+
5. Activate signing. For credentials without the crypto-withdrawal scope, turn on "Enable Request Signing" (available once the credential has a public key), save the credential, then contact Support to complete activation. For credentials with the crypto-withdrawal scope, contact Support to register the key with the signing stack, and turn on "Enable Request Signing" only after they confirm.
|
|
186
|
+
6. Configure the SDK with the private key and the Key ID:
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
import { readFileSync } from "node:fs";
|
|
190
|
+
|
|
191
|
+
const client = new PaxosClient({
|
|
192
|
+
clientId: process.env.PAXOS_CLIENT_ID!,
|
|
193
|
+
clientSecret: process.env.PAXOS_CLIENT_SECRET!,
|
|
194
|
+
scopes: [Scope.TRANSFER_READ_TRANSFER],
|
|
195
|
+
signingKey: readFileSync("private.pem", "utf8"),
|
|
196
|
+
keyId: process.env.PAXOS_KEY_ID!,
|
|
197
|
+
});
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
The options are `signingKey` and `keyId`; pass both together. The private key can be the PEM file contents as written by step 1 (an unencrypted PKCS#8 `-----BEGIN PRIVATE KEY-----` block for either key type, or an unencrypted SEC1 `-----BEGIN EC PRIVATE KEY-----` block for P-256) or, for Ed25519 only, 128 hex characters (the 32-byte seed followed by the matching 32-byte public key). Pass the PEM exactly as openssl writes it (multi-line, with the BEGIN and END lines); reformatted PEM, such as a single line with spaces, may be rejected. Load it from a file or a secret store (keep its newlines if it comes from an environment variable); do not put key literals in source. Encrypted PEM is rejected: decrypt it first. Whatever the format, an invalid key makes the constructor throw.
|
|
201
|
+
|
|
202
|
+
The SDK supports Ed25519 (EdDSA) and P-256 (ES256) keys and picks the algorithm from the key; other key types and curves are rejected.
|
|
203
|
+
|
|
204
|
+
Only API requests are signed; OAuth token requests are not. Each signed request carries a JWS in the `Paxos-Signature` header covering the method, the full transmitted path (including the `/v2` prefix), the exact serialized query string and the body bytes. Signing runs after `beforeRequest`, so it covers the final request.
|
|
205
|
+
|
|
206
|
+
Once signing is enforced for the credential, unsigned or mis-signed requests are rejected with HTTP 401, surfaced as `PaxosUnauthorizedError` (`isUnauthorizedError(err)`) with `requestId`. Quote the request ID when contacting Support.
|
|
207
|
+
|
|
208
|
+
## Raw JSON and response metadata
|
|
209
|
+
|
|
210
|
+
Each decoded top-level response object (list item or non-list call result) has a non-enumerable, lazily parsed `rawJson` property (`WithRaw<T>`): its JSON as sent, with original decimal strings, unknown fields kept and missing arrays and maps not filled. It is not carried by spread, `Object.assign` or `JSON.stringify` and is absent on nested and caller-built objects. It is a mutable cached object, and each item pins its page body in memory.
|
|
211
|
+
|
|
212
|
+
Capture the request ID, status and unmodified body of the terminal response (including API errors) with `onResponseMetadata`:
|
|
213
|
+
|
|
214
|
+
```typescript
|
|
215
|
+
await client.transfers.getTransfer("txn_123", {
|
|
216
|
+
onResponseMetadata: ({ requestId, statusCode, rawBody }) => {
|
|
217
|
+
console.log({ requestId, statusCode }); // rawBody is the unmodified response text
|
|
218
|
+
},
|
|
219
|
+
});
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
It is called once per pagination page and is not called when no response headers arrived (timeout, network failure). If reading the body then fails or times out, it can still run with `requestId` and `statusCode` set and `rawBody` empty, so populated metadata does not mean a complete response. Callbacks must not throw: an exception terminates the call. Keep the request ID for support; avoid logging identity or financial payloads.
|
|
223
|
+
|
|
224
|
+
## Logging
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
PAXOS_LOG_LEVEL=debug node app.js
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Programmatic (takes precedence over the env var):
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
logger: (level, message, data) => console.log(`[${level}] ${message}`, data);
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Testing and mocking
|
|
237
|
+
|
|
238
|
+
The `@paxosglobal/sdk/testing` entry point ships a local HTTP mock server and fixtures. It also serves `POST /oauth2/token` (recorded separately in `tokenCalls()`, not in `calls()`); `clientOptions()` points both the base URL and the token URL at it.
|
|
239
|
+
|
|
240
|
+
```typescript
|
|
241
|
+
import { PaxosClient, Scope } from "@paxosglobal/sdk";
|
|
242
|
+
import { MockServer, transferFixture } from "@paxosglobal/sdk/testing";
|
|
243
|
+
|
|
244
|
+
const server = new MockServer();
|
|
245
|
+
await server.start();
|
|
246
|
+
server.on("GET", "/transfer/transfers/txn_123").respond(200, transferFixture("txn_123"));
|
|
247
|
+
|
|
248
|
+
const client = new PaxosClient({
|
|
249
|
+
clientId: "id",
|
|
250
|
+
clientSecret: "secret",
|
|
251
|
+
scopes: [Scope.TRANSFER_READ_TRANSFER],
|
|
252
|
+
...server.clientOptions(),
|
|
253
|
+
});
|
|
254
|
+
const transfer = await client.transfers.getTransfer("txn_123");
|
|
255
|
+
await server.shutdown();
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Other helpers: `returnNotFound`, `returnRateLimit`, `returnServerError`, `returnValidationError`, `respondWithHeaders`, `calls()`, `tokenCalls()` and `reset()`. Each recorded request has `method`, `path` (pathname only), `query` (parsed, values as arrays), `url` (the relative request target including the query string, unlike the absolute `MockServer.url`), `headers`, `body` and `header(name)`.
|
|
259
|
+
|
|
260
|
+
## Language-specific notes
|
|
261
|
+
|
|
262
|
+
- Everything is async: methods return `Promise<T>` or `PageIterator<T>`.
|
|
263
|
+
- Request bodies are snake_case objects (`profile_id`, `ref_id`); query params use the API's wire names (dotted filters become `created_at_gt`); SDK options are camelCase.
|
|
264
|
+
- `rawJson` and decimals: copy `rawJson` explicitly if it must travel with a copied object.
|
|
265
|
+
|
|
266
|
+
## Examples and docs
|
|
267
|
+
|
|
268
|
+
SDK guides: https://docs.paxos.com/sdks. API reference: https://docs.paxos.com. The snippets above are complete enough to adapt; for other endpoints follow the same `client.<service>.<method>(...)` pattern.
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the Paxos TypeScript SDK are documented here.
|
|
4
|
+
|
|
5
|
+
## 0.1.0
|
|
6
|
+
|
|
7
|
+
Initial beta release of the Paxos TypeScript SDK.
|
|
8
|
+
|
|
9
|
+
Beta: we aim to avoid breaking changes, but they may occur before 1.0.
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- OAuth2 client-credentials authentication with automatic token caching and refresh; at least one typed scope is required
|
|
14
|
+
- Automatic retries with exponential backoff and jitter on 429 and 500, 502, 503 and 504 responses (default 3 retries, configurable), plus one token-refresh retry on 401; network failures are retried only for GET, HEAD and OPTIONS
|
|
15
|
+
- Typed models, enums, request parameters and service clients for every covered endpoint, accessed from one `PaxosClient`
|
|
16
|
+
- Empty, blank or null path parameters are rejected before any request is sent
|
|
17
|
+
- Auto-paginating async iterators for list methods (`for await`), with per-page access via `pages()` and `maxItems` and `maxDuration` limits
|
|
18
|
+
- `Decimal` (decimal.js) values for monetary amounts
|
|
19
|
+
- Timestamps as RFC 3339 `string` values, unchanged from the wire
|
|
20
|
+
- Idempotent mutations: an omitted `ref_id` is filled with a UUID once per call and reused across retries
|
|
21
|
+
- Access to the raw JSON of every top-level response object
|
|
22
|
+
- Typed errors for API, network, timeout and authentication failures, each carrying the Paxos request ID
|
|
23
|
+
- Per-client and per-request timeouts, including an overall call budget and an optional per-attempt cap
|
|
24
|
+
- Request and response hooks
|
|
25
|
+
- Optional JWS request signing with Ed25519 (EdDSA) or P-256 (ES256) keys
|
|
26
|
+
- Debug logging, enabled with `PAXOS_LOG_LEVEL` or a custom logger; logs paths without query strings and never includes request or response bodies
|
|
27
|
+
- Response metadata (request ID, status code, raw body) available alongside typed results
|
|
28
|
+
- Custom `fetch` support for proxies and other HTTP stacks
|
|
29
|
+
- Testing helpers in the `@paxosglobal/sdk/testing` entry point: a local mock server that records requests and OAuth token requests (`tokenCalls()`), plus typed response fixtures
|
|
30
|
+
- Sandbox and production environments, plus a custom base URL and token URL (set together) for local or test servers
|
|
31
|
+
- Coverage of every endpoint in the Paxos API v2 OpenAPI specification (see the [API Reference](https://docs.paxos.com/api-reference/introduction))
|
|
32
|
+
- Requirements: Node.js 22.12 or later
|
|
33
|
+
- Runtime dependencies: `decimal.js`
|
|
34
|
+
- Free-form JSON object fields such as `UserAuditLog.request_payload`, `Event.object` and `Problem.meta` are typed `Record<string, unknown>`
|
|
35
|
+
- Service classes are exported as types only, since they cannot be constructed directly
|
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding any notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2024 Paxos Global, Inc.
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|