@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
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { RequestOptions, PageIterator, WithRaw } from "../client.js";
|
|
2
|
+
import type { KnownListTransfersRequestOrderBy, KnownSecondaryStatusName, KnownSortOrder, KnownTransferStatus, KnownTransferType } from "../enums.js";
|
|
3
|
+
import type { Transfer } from "../models.js";
|
|
4
|
+
export interface ListTransfersParams {
|
|
5
|
+
/** Optionally filter by the target profiles of the transfers. Limit 100.
|
|
6
|
+
Can be combined with created_at.* or updated_at.* filtering options only. */
|
|
7
|
+
profile_ids?: string[];
|
|
8
|
+
/** Optionally filter by the Identities associated with the transfers. Limit 100.
|
|
9
|
+
Can be combined with created_at.* or updated_at.* filtering options only. */
|
|
10
|
+
identity_ids?: string[];
|
|
11
|
+
/** The client-specified IDs provided during transfer creation. Limit 100.
|
|
12
|
+
Can be combined with created_at.* or updated_at.* filtering options only. */
|
|
13
|
+
ref_ids?: string[];
|
|
14
|
+
/** Include timestamps strictly less than lt. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
15
|
+
created_at_lt?: string;
|
|
16
|
+
/** Include timestamps less than or equal to lte. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
17
|
+
created_at_lte?: string;
|
|
18
|
+
/** Include timestamps exactly equal to eq. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
19
|
+
created_at_eq?: string;
|
|
20
|
+
/** Include timestamps greater than or equal to gte. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
21
|
+
created_at_gte?: string;
|
|
22
|
+
/** Include timestamps strictly greater than gt. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
23
|
+
created_at_gt?: string;
|
|
24
|
+
/** Include timestamps strictly less than lt. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
25
|
+
updated_at_lt?: string;
|
|
26
|
+
/** Include timestamps less than or equal to lte. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
27
|
+
updated_at_lte?: string;
|
|
28
|
+
/** Include timestamps exactly equal to eq. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
29
|
+
updated_at_eq?: string;
|
|
30
|
+
/** Include timestamps greater than or equal to gte. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
31
|
+
updated_at_gte?: string;
|
|
32
|
+
/** Include timestamps strictly greater than gt. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
33
|
+
updated_at_gt?: string;
|
|
34
|
+
/** Number of results to return. Defaults to 100 if no limit is provided. Maximum 1000. */
|
|
35
|
+
limit?: number;
|
|
36
|
+
/** Determines whether the items are returned in ascending (ASC), or descending (DESC) order.
|
|
37
|
+
Defaults to ASC if `order_by` is UPDATED_AT. Otherwise defaults to DESC. */
|
|
38
|
+
order?: KnownSortOrder | (string & {});
|
|
39
|
+
/** The specific method by which the returned results will be ordered.
|
|
40
|
+
When specifying both `order_by` and a timestamp filter, `order_by` must equal the timestamp filter type.
|
|
41
|
+
For example:
|
|
42
|
+
|
|
43
|
+
`updated_at.gte = 2022-07-01T03:02:01Z`, `order_by = UPDATED_AT`
|
|
44
|
+
|
|
45
|
+
Using `updated_at.gte = 2022-07-01T03:02:01Z`, `order_by = CREATED_AT` is an invalid pairing. */
|
|
46
|
+
order_by?: KnownListTransfersRequestOrderBy | (string & {});
|
|
47
|
+
/** Optionally filter by the Accounts associated with the transfers. Limit 100.
|
|
48
|
+
Can be combined with created_at.* or updated_at.* filtering options only. */
|
|
49
|
+
account_ids?: string[];
|
|
50
|
+
/** Optionally filter by the transfer ids. Limit 100.
|
|
51
|
+
Can be combined with created_at.* or updated_at.* filtering options only. */
|
|
52
|
+
ids?: string[];
|
|
53
|
+
/** Retrieve all (default) or the specified transfers.
|
|
54
|
+
Optionally filter by transfer `type`.
|
|
55
|
+
To retrieve multiple transfer types, use query parameters: e.g., `type=CRYPTO_DEPOSIT&type=CRYPTO_WITHDRAWAL`.
|
|
56
|
+
Can be combined with `created_at.*` or `updated_at.*` filtering options only. */
|
|
57
|
+
type?: (KnownTransferType | (string & {}))[];
|
|
58
|
+
/** Optionally filter by transfer `group_ids`. Limit 100. */
|
|
59
|
+
group_ids?: string[];
|
|
60
|
+
/** Optionally filter by the on-chain transaction hash for crypto transactions. Limit 100. */
|
|
61
|
+
crypto_tx_hashes?: string[];
|
|
62
|
+
/** Optionally filter by secondary status.
|
|
63
|
+
|
|
64
|
+
- TRAVEL_RULE_INFO_REQUESTED: Travel rule information is required to continue processing the transfer.
|
|
65
|
+
- TRAVEL_RULE_REJECTED: Transfer has been terminally rejected due to failing travel rule checks.
|
|
66
|
+
- CUSTOMER_REJECTED: Transfer was rejected by a customer.
|
|
67
|
+
- PENDING_CUSTOMER_APPROVAL: Transfer is pending customer approval.
|
|
68
|
+
- VASP_RESTRICTED: Transfer rejected because the destination VASP is restricted for the legal entity. */
|
|
69
|
+
secondary_statuses?: (KnownSecondaryStatusName | (string & {}))[];
|
|
70
|
+
/** Optionally filter by status. */
|
|
71
|
+
statuses?: (KnownTransferStatus | (string & {}))[];
|
|
72
|
+
/** Resume from a cursor previously returned as a page's `nextCursor`. */
|
|
73
|
+
page_cursor?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* TransfersService — Each deposit to and withdrawal from a Paxos account is a
|
|
77
|
+
* Transfer. A Transfer is associated with a particular Profile, and increases
|
|
78
|
+
* or decreases the available balance of a single asset in that Profile.
|
|
79
|
+
*
|
|
80
|
+
* Access via `client.transfers`.
|
|
81
|
+
*/
|
|
82
|
+
export declare class TransfersService {
|
|
83
|
+
private readonly client;
|
|
84
|
+
/**
|
|
85
|
+
* List Transfers
|
|
86
|
+
*
|
|
87
|
+
* Requires scope: transfer:read_transfer
|
|
88
|
+
*/
|
|
89
|
+
listTransfers(params?: ListTransfersParams, opts?: RequestOptions): PageIterator<WithRaw<Transfer>>;
|
|
90
|
+
/**
|
|
91
|
+
* Get Transfer
|
|
92
|
+
*
|
|
93
|
+
* Requires scope: transfer:read_transfer
|
|
94
|
+
*/
|
|
95
|
+
getTransfer(id: string, opts?: RequestOptions): Promise<WithRaw<Transfer>>;
|
|
96
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Code generated from the Paxos OpenAPI specification. DO NOT EDIT.
|
|
2
|
+
import { buildPath } from "../client.js";
|
|
3
|
+
/**
|
|
4
|
+
* TransfersService — Each deposit to and withdrawal from a Paxos account is a
|
|
5
|
+
* Transfer. A Transfer is associated with a particular Profile, and increases
|
|
6
|
+
* or decreases the available balance of a single asset in that Profile.
|
|
7
|
+
*
|
|
8
|
+
* Access via `client.transfers`.
|
|
9
|
+
*/
|
|
10
|
+
export class TransfersService {
|
|
11
|
+
client;
|
|
12
|
+
/** @internal */
|
|
13
|
+
constructor(client) {
|
|
14
|
+
this.client = client;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* List Transfers
|
|
18
|
+
*
|
|
19
|
+
* Requires scope: transfer:read_transfer
|
|
20
|
+
*/
|
|
21
|
+
listTransfers(params, opts) {
|
|
22
|
+
return this.client.paginate("/transfer/transfers", "items", params, opts, {
|
|
23
|
+
responseSchema: "ListTransfersResponse",
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get Transfer
|
|
28
|
+
*
|
|
29
|
+
* Requires scope: transfer:read_transfer
|
|
30
|
+
*/
|
|
31
|
+
async getTransfer(id, opts) {
|
|
32
|
+
return this.client.get(buildPath("/transfer/transfers/{id}", { id: id }), undefined, opts, {
|
|
33
|
+
responseSchema: "Transfer",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=transfers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transfers.js","sourceRoot":"","sources":["../../src/services/transfers.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAmFzC;;;;;;GAMG;AACH,MAAM,OAAO,gBAAgB;IAEE;IAD7B,gBAAgB;IAChB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD;;;;OAIG;IACH,aAAa,CAAC,MAA4B,EAAE,IAAqB;QAC/D,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAoB,qBAAqB,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;YAC3F,cAAc,EAAE,uBAAuB;SACxC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW,CAAC,EAAU,EAAE,IAAqB;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAoB,SAAS,CAAC,0BAA0B,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE;YAC5G,cAAc,EAAE,UAAU;SAC3B,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Code generated from the Paxos OpenAPI specification. DO NOT EDIT.\n\nimport { buildPath } from \"../client.js\";\nimport type { HttpClient, RequestOptions, PageIterator, WithRaw } from \"../client.js\";\nimport type {\n KnownListTransfersRequestOrderBy,\n KnownSecondaryStatusName,\n KnownSortOrder,\n KnownTransferStatus,\n KnownTransferType,\n} from \"../enums.js\";\nimport type { Transfer } from \"../models.js\";\n\nexport interface ListTransfersParams {\n /** Optionally filter by the target profiles of the transfers. Limit 100.\nCan be combined with created_at.* or updated_at.* filtering options only. */\n profile_ids?: string[];\n /** Optionally filter by the Identities associated with the transfers. Limit 100.\nCan be combined with created_at.* or updated_at.* filtering options only. */\n identity_ids?: string[];\n /** The client-specified IDs provided during transfer creation. Limit 100.\nCan be combined with created_at.* or updated_at.* filtering options only. */\n ref_ids?: string[];\n /** Include timestamps strictly less than lt. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n created_at_lt?: string;\n /** Include timestamps less than or equal to lte. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n created_at_lte?: string;\n /** Include timestamps exactly equal to eq. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n created_at_eq?: string;\n /** Include timestamps greater than or equal to gte. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n created_at_gte?: string;\n /** Include timestamps strictly greater than gt. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n created_at_gt?: string;\n /** Include timestamps strictly less than lt. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n updated_at_lt?: string;\n /** Include timestamps less than or equal to lte. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n updated_at_lte?: string;\n /** Include timestamps exactly equal to eq. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n updated_at_eq?: string;\n /** Include timestamps greater than or equal to gte. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n updated_at_gte?: string;\n /** Include timestamps strictly greater than gt. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n updated_at_gt?: string;\n /** Number of results to return. Defaults to 100 if no limit is provided. Maximum 1000. */\n limit?: number;\n /** Determines whether the items are returned in ascending (ASC), or descending (DESC) order.\nDefaults to ASC if `order_by` is UPDATED_AT. Otherwise defaults to DESC. */\n order?: KnownSortOrder | (string & {});\n /** The specific method by which the returned results will be ordered.\nWhen specifying both `order_by` and a timestamp filter, `order_by` must equal the timestamp filter type.\nFor example:\n\n`updated_at.gte = 2022-07-01T03:02:01Z`, `order_by = UPDATED_AT`\n\nUsing `updated_at.gte = 2022-07-01T03:02:01Z`, `order_by = CREATED_AT` is an invalid pairing. */\n order_by?: KnownListTransfersRequestOrderBy | (string & {});\n /** Optionally filter by the Accounts associated with the transfers. Limit 100.\nCan be combined with created_at.* or updated_at.* filtering options only. */\n account_ids?: string[];\n /** Optionally filter by the transfer ids. Limit 100.\nCan be combined with created_at.* or updated_at.* filtering options only. */\n ids?: string[];\n /** Retrieve all (default) or the specified transfers.\nOptionally filter by transfer `type`.\nTo retrieve multiple transfer types, use query parameters: e.g., `type=CRYPTO_DEPOSIT&type=CRYPTO_WITHDRAWAL`.\nCan be combined with `created_at.*` or `updated_at.*` filtering options only. */\n type?: (KnownTransferType | (string & {}))[];\n /** Optionally filter by transfer `group_ids`. Limit 100. */\n group_ids?: string[];\n /** Optionally filter by the on-chain transaction hash for crypto transactions. Limit 100. */\n crypto_tx_hashes?: string[];\n /** Optionally filter by secondary status.\n\n - TRAVEL_RULE_INFO_REQUESTED: Travel rule information is required to continue processing the transfer.\n - TRAVEL_RULE_REJECTED: Transfer has been terminally rejected due to failing travel rule checks.\n - CUSTOMER_REJECTED: Transfer was rejected by a customer.\n - PENDING_CUSTOMER_APPROVAL: Transfer is pending customer approval.\n - VASP_RESTRICTED: Transfer rejected because the destination VASP is restricted for the legal entity. */\n secondary_statuses?: (KnownSecondaryStatusName | (string & {}))[];\n /** Optionally filter by status. */\n statuses?: (KnownTransferStatus | (string & {}))[];\n /** Resume from a cursor previously returned as a page's `nextCursor`. */\n page_cursor?: string;\n}\n\n/**\n * TransfersService — Each deposit to and withdrawal from a Paxos account is a\n * Transfer. A Transfer is associated with a particular Profile, and increases\n * or decreases the available balance of a single asset in that Profile.\n *\n * Access via `client.transfers`.\n */\nexport class TransfersService {\n /** @internal */\n constructor(private readonly client: HttpClient) {}\n\n /**\n * List Transfers\n *\n * Requires scope: transfer:read_transfer\n */\n listTransfers(params?: ListTransfersParams, opts?: RequestOptions): PageIterator<WithRaw<Transfer>> {\n return this.client.paginate<WithRaw<Transfer>>(\"/transfer/transfers\", \"items\", params, opts, {\n responseSchema: \"ListTransfersResponse\",\n });\n }\n\n /**\n * Get Transfer\n *\n * Requires scope: transfer:read_transfer\n */\n async getTransfer(id: string, opts?: RequestOptions): Promise<WithRaw<Transfer>> {\n return this.client.get<WithRaw<Transfer>>(buildPath(\"/transfer/transfers/{id}\", { id: id }), undefined, opts, {\n responseSchema: \"Transfer\",\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { RequestOptions, PageIterator, WithRaw } from "../client.js";
|
|
2
|
+
import type { KnownListVaspsRequestOrderBy, KnownSortOrder } from "../enums.js";
|
|
3
|
+
import type { GetVaspResponse, Vasp } from "../models.js";
|
|
4
|
+
export interface ListVaspsParams {
|
|
5
|
+
/** Optionally filter by the vasps' IDs. */
|
|
6
|
+
ids?: string[];
|
|
7
|
+
/** Number of results to return. Defaults to 100 if no limit is provided. */
|
|
8
|
+
limit?: number;
|
|
9
|
+
/** Determines whether the items are returned in ascending (ASC), or descending (DESC) order. */
|
|
10
|
+
order?: KnownSortOrder | (string & {});
|
|
11
|
+
/** The specific method by which the returned results will be ordered. */
|
|
12
|
+
order_by?: KnownListVaspsRequestOrderBy | (string & {});
|
|
13
|
+
/** Optional: case-insensitive prefix match on the VASP name, for type-ahead lookup. */
|
|
14
|
+
search?: string;
|
|
15
|
+
/** Resume from a cursor previously returned as a page's `nextCursor`. */
|
|
16
|
+
page_cursor?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* TravelRuleService provides access to TravelRule API operations.
|
|
20
|
+
* Access via `client.travelRule`.
|
|
21
|
+
*/
|
|
22
|
+
export declare class TravelRuleService {
|
|
23
|
+
private readonly client;
|
|
24
|
+
/**
|
|
25
|
+
* ListVasps
|
|
26
|
+
*/
|
|
27
|
+
listVasps(params?: ListVaspsParams, opts?: RequestOptions): PageIterator<WithRaw<Vasp>>;
|
|
28
|
+
/**
|
|
29
|
+
* GetVasp
|
|
30
|
+
*/
|
|
31
|
+
getVasp(id: string, opts?: RequestOptions): Promise<WithRaw<GetVaspResponse>>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Code generated from the Paxos OpenAPI specification. DO NOT EDIT.
|
|
2
|
+
import { buildPath } from "../client.js";
|
|
3
|
+
/**
|
|
4
|
+
* TravelRuleService provides access to TravelRule API operations.
|
|
5
|
+
* Access via `client.travelRule`.
|
|
6
|
+
*/
|
|
7
|
+
export class TravelRuleService {
|
|
8
|
+
client;
|
|
9
|
+
/** @internal */
|
|
10
|
+
constructor(client) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ListVasps
|
|
15
|
+
*/
|
|
16
|
+
listVasps(params, opts) {
|
|
17
|
+
return this.client.paginate("/travelrule/vasps", "items", params, opts, {
|
|
18
|
+
responseSchema: "ListVaspsResponse",
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* GetVasp
|
|
23
|
+
*/
|
|
24
|
+
async getVasp(id, opts) {
|
|
25
|
+
return this.client.get(buildPath("/travelrule/vasps/{id}", { id: id }), undefined, opts, {
|
|
26
|
+
responseSchema: "GetVaspResponse",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=travel-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"travel-rule.js","sourceRoot":"","sources":["../../src/services/travel-rule.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAoBzC;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAEC;IAD7B,gBAAgB;IAChB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD;;OAEG;IACH,SAAS,CAAC,MAAwB,EAAE,IAAqB;QACvD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAgB,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;YACrF,cAAc,EAAE,mBAAmB;SACpC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,EAAU,EAAE,IAAqB;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA2B,SAAS,CAAC,wBAAwB,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE;YACjH,cAAc,EAAE,iBAAiB;SAClC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Code generated from the Paxos OpenAPI specification. DO NOT EDIT.\n\nimport { buildPath } from \"../client.js\";\nimport type { HttpClient, RequestOptions, PageIterator, WithRaw } from \"../client.js\";\nimport type { KnownListVaspsRequestOrderBy, KnownSortOrder } from \"../enums.js\";\nimport type { GetVaspResponse, Vasp } from \"../models.js\";\n\nexport interface ListVaspsParams {\n /** Optionally filter by the vasps' IDs. */\n ids?: string[];\n /** Number of results to return. Defaults to 100 if no limit is provided. */\n limit?: number;\n /** Determines whether the items are returned in ascending (ASC), or descending (DESC) order. */\n order?: KnownSortOrder | (string & {});\n /** The specific method by which the returned results will be ordered. */\n order_by?: KnownListVaspsRequestOrderBy | (string & {});\n /** Optional: case-insensitive prefix match on the VASP name, for type-ahead lookup. */\n search?: string;\n /** Resume from a cursor previously returned as a page's `nextCursor`. */\n page_cursor?: string;\n}\n\n/**\n * TravelRuleService provides access to TravelRule API operations.\n * Access via `client.travelRule`.\n */\nexport class TravelRuleService {\n /** @internal */\n constructor(private readonly client: HttpClient) {}\n\n /**\n * ListVasps\n */\n listVasps(params?: ListVaspsParams, opts?: RequestOptions): PageIterator<WithRaw<Vasp>> {\n return this.client.paginate<WithRaw<Vasp>>(\"/travelrule/vasps\", \"items\", params, opts, {\n responseSchema: \"ListVaspsResponse\",\n });\n }\n\n /**\n * GetVasp\n */\n async getVasp(id: string, opts?: RequestOptions): Promise<WithRaw<GetVaspResponse>> {\n return this.client.get<WithRaw<GetVaspResponse>>(buildPath(\"/travelrule/vasps/{id}\", { id: id }), undefined, opts, {\n responseSchema: \"GetVaspResponse\",\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { RequestOptions, PageIterator, WithRaw } from "../client.js";
|
|
2
|
+
import type { KnownHttpMethod, KnownSortOrder } from "../enums.js";
|
|
3
|
+
import type { UserAuditLog } from "../models.js";
|
|
4
|
+
export interface ListUserAuditLogsParams {
|
|
5
|
+
/** Maximum number of audit logs to return. Range 1-100. Defaults to 10. */
|
|
6
|
+
limit?: number;
|
|
7
|
+
/** Filter by HTTP methods. Empty list means no filter (any method). */
|
|
8
|
+
methods?: (KnownHttpMethod | (string & {}))[];
|
|
9
|
+
/** Include timestamps strictly less than lt. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
10
|
+
created_at_lt?: string;
|
|
11
|
+
/** Include timestamps less than or equal to lte. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
12
|
+
created_at_lte?: string;
|
|
13
|
+
/** Include timestamps exactly equal to eq. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
14
|
+
created_at_eq?: string;
|
|
15
|
+
/** Include timestamps greater than or equal to gte. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
16
|
+
created_at_gte?: string;
|
|
17
|
+
/** Include timestamps strictly greater than gt. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
18
|
+
created_at_gt?: string;
|
|
19
|
+
/** Filter by HTTP status code ranges. Format: "min-max" where both are inclusive (e.g., "200-299" for all 2xx codes, "404-404" for only 404). Both min and max must be between 200-599, and max >= min. Empty list means no filter (any status code). */
|
|
20
|
+
status_code_ranges?: string[];
|
|
21
|
+
/** Filter by path substrings (case-insensitive, e.g., "webhooks" matches "/api/v2/webhooks"). Empty list means no filter (any path). */
|
|
22
|
+
path_contains?: string[];
|
|
23
|
+
/** Filter by domain substrings (case-insensitive, e.g., "webhook" matches "Webhooks"). Empty list means no filter (any domain). */
|
|
24
|
+
domain_contains?: string[];
|
|
25
|
+
order?: KnownSortOrder | (string & {});
|
|
26
|
+
/** Resume from a cursor previously returned as a page's `nextCursor`. */
|
|
27
|
+
page_cursor?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* UserAuditLogsService — The User Audit Logs API provides a paginated audit
|
|
31
|
+
* trail of actions performed by human users in the Paxos dashboard, with
|
|
32
|
+
* optional filtering by HTTP method, path, domain, time range, and status
|
|
33
|
+
* code.
|
|
34
|
+
*
|
|
35
|
+
* Access via `client.userAuditLogs`.
|
|
36
|
+
*/
|
|
37
|
+
export declare class UserAuditLogsService {
|
|
38
|
+
private readonly client;
|
|
39
|
+
/**
|
|
40
|
+
* List user audit logs
|
|
41
|
+
*
|
|
42
|
+
* Requires scope: user_audit_logs:read_audit_log
|
|
43
|
+
*/
|
|
44
|
+
listUserAuditLogs(params?: ListUserAuditLogsParams, opts?: RequestOptions): PageIterator<WithRaw<UserAuditLog>>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Code generated from the Paxos OpenAPI specification. DO NOT EDIT.
|
|
2
|
+
/**
|
|
3
|
+
* UserAuditLogsService — The User Audit Logs API provides a paginated audit
|
|
4
|
+
* trail of actions performed by human users in the Paxos dashboard, with
|
|
5
|
+
* optional filtering by HTTP method, path, domain, time range, and status
|
|
6
|
+
* code.
|
|
7
|
+
*
|
|
8
|
+
* Access via `client.userAuditLogs`.
|
|
9
|
+
*/
|
|
10
|
+
export class UserAuditLogsService {
|
|
11
|
+
client;
|
|
12
|
+
/** @internal */
|
|
13
|
+
constructor(client) {
|
|
14
|
+
this.client = client;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* List user audit logs
|
|
18
|
+
*
|
|
19
|
+
* Requires scope: user_audit_logs:read_audit_log
|
|
20
|
+
*/
|
|
21
|
+
listUserAuditLogs(params, opts) {
|
|
22
|
+
return this.client.paginate("/user-audit-logs", "items", params, opts, {
|
|
23
|
+
responseSchema: "ListUserAuditLogsResponse",
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=user-audit-logs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-audit-logs.js","sourceRoot":"","sources":["../../src/services/user-audit-logs.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAgCpE;;;;;;;GAOG;AACH,MAAM,OAAO,oBAAoB;IAEF;IAD7B,gBAAgB;IAChB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD;;;;OAIG;IACH,iBAAiB,CAAC,MAAgC,EAAE,IAAqB;QACvE,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAwB,kBAAkB,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;YAC5F,cAAc,EAAE,2BAA2B;SAC5C,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Code generated from the Paxos OpenAPI specification. DO NOT EDIT.\n\nimport type { HttpClient, RequestOptions, PageIterator, WithRaw } from \"../client.js\";\nimport type { KnownHttpMethod, KnownSortOrder } from \"../enums.js\";\nimport type { UserAuditLog } from \"../models.js\";\n\nexport interface ListUserAuditLogsParams {\n /** Maximum number of audit logs to return. Range 1-100. Defaults to 10. */\n limit?: number;\n /** Filter by HTTP methods. Empty list means no filter (any method). */\n methods?: (KnownHttpMethod | (string & {}))[];\n /** Include timestamps strictly less than lt. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n created_at_lt?: string;\n /** Include timestamps less than or equal to lte. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n created_at_lte?: string;\n /** Include timestamps exactly equal to eq. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n created_at_eq?: string;\n /** Include timestamps greater than or equal to gte. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n created_at_gte?: string;\n /** Include timestamps strictly greater than gt. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n created_at_gt?: string;\n /** Filter by HTTP status code ranges. Format: \"min-max\" where both are inclusive (e.g., \"200-299\" for all 2xx codes, \"404-404\" for only 404). Both min and max must be between 200-599, and max >= min. Empty list means no filter (any status code). */\n status_code_ranges?: string[];\n /** Filter by path substrings (case-insensitive, e.g., \"webhooks\" matches \"/api/v2/webhooks\"). Empty list means no filter (any path). */\n path_contains?: string[];\n /** Filter by domain substrings (case-insensitive, e.g., \"webhook\" matches \"Webhooks\"). Empty list means no filter (any domain). */\n domain_contains?: string[];\n order?: KnownSortOrder | (string & {});\n /** Resume from a cursor previously returned as a page's `nextCursor`. */\n page_cursor?: string;\n}\n\n/**\n * UserAuditLogsService — The User Audit Logs API provides a paginated audit\n * trail of actions performed by human users in the Paxos dashboard, with\n * optional filtering by HTTP method, path, domain, time range, and status\n * code.\n *\n * Access via `client.userAuditLogs`.\n */\nexport class UserAuditLogsService {\n /** @internal */\n constructor(private readonly client: HttpClient) {}\n\n /**\n * List user audit logs\n *\n * Requires scope: user_audit_logs:read_audit_log\n */\n listUserAuditLogs(params?: ListUserAuditLogsParams, opts?: RequestOptions): PageIterator<WithRaw<UserAuditLog>> {\n return this.client.paginate<WithRaw<UserAuditLog>>(\"/user-audit-logs\", \"items\", params, opts, {\n responseSchema: \"ListUserAuditLogsResponse\",\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { RequestOptions, PageIterator, WithRaw } from "../client.js";
|
|
2
|
+
import type { KnownDeliveryStatus, KnownWebhookStatus } from "../enums.js";
|
|
3
|
+
import type { DeliveryHistorySummary, Webhook } from "../models.js";
|
|
4
|
+
export interface ListWebhooksParams {
|
|
5
|
+
/** Maximum number of webhooks to return. Range 1-100. Defaults to 10. */
|
|
6
|
+
limit?: number;
|
|
7
|
+
/** Optionally filter by webhook status. */
|
|
8
|
+
statuses?: (KnownWebhookStatus | (string & {}))[];
|
|
9
|
+
/** Optionally filter by webhook IDs. Limit 100. */
|
|
10
|
+
ids?: string[];
|
|
11
|
+
/** Resume from a cursor previously returned as a page's `nextCursor`. */
|
|
12
|
+
page_cursor?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ListDeliveryHistoriesParams {
|
|
15
|
+
/** Maximum number of records to return. Range 1-100. Defaults to 10. */
|
|
16
|
+
limit?: number;
|
|
17
|
+
/** Optionally filter to one or more webhooks. Empty returns all webhooks. Limit 100. */
|
|
18
|
+
webhook_ids?: string[];
|
|
19
|
+
/** Optionally filter by one or more delivery statuses. Empty returns all statuses. */
|
|
20
|
+
statuses?: (KnownDeliveryStatus | (string & {}))[];
|
|
21
|
+
/** Include timestamps strictly less than lt. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
22
|
+
attempt_at_lt?: string;
|
|
23
|
+
/** Include timestamps less than or equal to lte. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
24
|
+
attempt_at_lte?: string;
|
|
25
|
+
/** Include timestamps exactly equal to eq. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
26
|
+
attempt_at_eq?: string;
|
|
27
|
+
/** Include timestamps greater than or equal to gte. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
28
|
+
attempt_at_gte?: string;
|
|
29
|
+
/** Include timestamps strictly greater than gt. RFC3339 format, like `2006-01-02T15:04:05Z`. */
|
|
30
|
+
attempt_at_gt?: string;
|
|
31
|
+
/** Resume from a cursor previously returned as a page's `nextCursor`. */
|
|
32
|
+
page_cursor?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* WebhooksService provides access to Webhooks API operations.
|
|
36
|
+
* Access via `client.webhooks`.
|
|
37
|
+
*/
|
|
38
|
+
export declare class WebhooksService {
|
|
39
|
+
private readonly client;
|
|
40
|
+
/**
|
|
41
|
+
* List webhooks
|
|
42
|
+
*
|
|
43
|
+
* Requires scope: webhooks:read_webhook
|
|
44
|
+
*/
|
|
45
|
+
listWebhooks(params?: ListWebhooksParams, opts?: RequestOptions): PageIterator<WithRaw<Webhook>>;
|
|
46
|
+
/**
|
|
47
|
+
* List delivery history across webhooks
|
|
48
|
+
*
|
|
49
|
+
* Requires scope: webhooks:read_webhook
|
|
50
|
+
*/
|
|
51
|
+
listDeliveryHistories(params?: ListDeliveryHistoriesParams, opts?: RequestOptions): PageIterator<WithRaw<DeliveryHistorySummary>>;
|
|
52
|
+
/**
|
|
53
|
+
* Get webhook by ID
|
|
54
|
+
*
|
|
55
|
+
* Requires scope: webhooks:read_webhook
|
|
56
|
+
*/
|
|
57
|
+
getWebhook(webhookId: string, opts?: RequestOptions): Promise<WithRaw<Webhook>>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Code generated from the Paxos OpenAPI specification. DO NOT EDIT.
|
|
2
|
+
import { buildPath } from "../client.js";
|
|
3
|
+
/**
|
|
4
|
+
* WebhooksService provides access to Webhooks API operations.
|
|
5
|
+
* Access via `client.webhooks`.
|
|
6
|
+
*/
|
|
7
|
+
export class WebhooksService {
|
|
8
|
+
client;
|
|
9
|
+
/** @internal */
|
|
10
|
+
constructor(client) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* List webhooks
|
|
15
|
+
*
|
|
16
|
+
* Requires scope: webhooks:read_webhook
|
|
17
|
+
*/
|
|
18
|
+
listWebhooks(params, opts) {
|
|
19
|
+
return this.client.paginate("/webhooks", "items", params, opts, {
|
|
20
|
+
responseSchema: "ListWebhooksResponse",
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* List delivery history across webhooks
|
|
25
|
+
*
|
|
26
|
+
* Requires scope: webhooks:read_webhook
|
|
27
|
+
*/
|
|
28
|
+
listDeliveryHistories(params, opts) {
|
|
29
|
+
return this.client.paginate("/webhooks/delivery-history", "items", params, opts, {
|
|
30
|
+
responseSchema: "ListDeliveryHistoriesResponse",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get webhook by ID
|
|
35
|
+
*
|
|
36
|
+
* Requires scope: webhooks:read_webhook
|
|
37
|
+
*/
|
|
38
|
+
async getWebhook(webhookId, opts) {
|
|
39
|
+
return this.client.get(buildPath("/webhooks/{webhook_id}", { webhook_id: webhookId }), undefined, opts, { responseSchema: "Webhook" });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=webhooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/services/webhooks.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAqCzC;;;GAGG;AACH,MAAM,OAAO,eAAe;IAEG;IAD7B,gBAAgB;IAChB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD;;;;OAIG;IACH,YAAY,CAAC,MAA2B,EAAE,IAAqB;QAC7D,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAmB,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;YAChF,cAAc,EAAE,sBAAsB;SACvC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,qBAAqB,CACnB,MAAoC,EACpC,IAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAkC,4BAA4B,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;YAChH,cAAc,EAAE,+BAA+B;SAChD,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,UAAU,CAAC,SAAiB,EAAE,IAAqB;QACvD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACpB,SAAS,CAAC,wBAAwB,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,EAC9D,SAAS,EACT,IAAI,EACJ,EAAE,cAAc,EAAE,SAAS,EAAE,CAC9B,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Code generated from the Paxos OpenAPI specification. DO NOT EDIT.\n\nimport { buildPath } from \"../client.js\";\nimport type { HttpClient, RequestOptions, PageIterator, WithRaw } from \"../client.js\";\nimport type { KnownDeliveryStatus, KnownWebhookStatus } from \"../enums.js\";\nimport type { DeliveryHistorySummary, Webhook } from \"../models.js\";\n\nexport interface ListWebhooksParams {\n /** Maximum number of webhooks to return. Range 1-100. Defaults to 10. */\n limit?: number;\n /** Optionally filter by webhook status. */\n statuses?: (KnownWebhookStatus | (string & {}))[];\n /** Optionally filter by webhook IDs. Limit 100. */\n ids?: string[];\n /** Resume from a cursor previously returned as a page's `nextCursor`. */\n page_cursor?: string;\n}\n\nexport interface ListDeliveryHistoriesParams {\n /** Maximum number of records to return. Range 1-100. Defaults to 10. */\n limit?: number;\n /** Optionally filter to one or more webhooks. Empty returns all webhooks. Limit 100. */\n webhook_ids?: string[];\n /** Optionally filter by one or more delivery statuses. Empty returns all statuses. */\n statuses?: (KnownDeliveryStatus | (string & {}))[];\n /** Include timestamps strictly less than lt. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n attempt_at_lt?: string;\n /** Include timestamps less than or equal to lte. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n attempt_at_lte?: string;\n /** Include timestamps exactly equal to eq. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n attempt_at_eq?: string;\n /** Include timestamps greater than or equal to gte. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n attempt_at_gte?: string;\n /** Include timestamps strictly greater than gt. RFC3339 format, like `2006-01-02T15:04:05Z`. */\n attempt_at_gt?: string;\n /** Resume from a cursor previously returned as a page's `nextCursor`. */\n page_cursor?: string;\n}\n\n/**\n * WebhooksService provides access to Webhooks API operations.\n * Access via `client.webhooks`.\n */\nexport class WebhooksService {\n /** @internal */\n constructor(private readonly client: HttpClient) {}\n\n /**\n * List webhooks\n *\n * Requires scope: webhooks:read_webhook\n */\n listWebhooks(params?: ListWebhooksParams, opts?: RequestOptions): PageIterator<WithRaw<Webhook>> {\n return this.client.paginate<WithRaw<Webhook>>(\"/webhooks\", \"items\", params, opts, {\n responseSchema: \"ListWebhooksResponse\",\n });\n }\n\n /**\n * List delivery history across webhooks\n *\n * Requires scope: webhooks:read_webhook\n */\n listDeliveryHistories(\n params?: ListDeliveryHistoriesParams,\n opts?: RequestOptions,\n ): PageIterator<WithRaw<DeliveryHistorySummary>> {\n return this.client.paginate<WithRaw<DeliveryHistorySummary>>(\"/webhooks/delivery-history\", \"items\", params, opts, {\n responseSchema: \"ListDeliveryHistoriesResponse\",\n });\n }\n\n /**\n * Get webhook by ID\n *\n * Requires scope: webhooks:read_webhook\n */\n async getWebhook(webhookId: string, opts?: RequestOptions): Promise<WithRaw<Webhook>> {\n return this.client.get<WithRaw<Webhook>>(\n buildPath(\"/webhooks/{webhook_id}\", { webhook_id: webhookId }),\n undefined,\n opts,\n { responseSchema: \"Webhook\" },\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JWS (JSON Web Signature) request signing for the Paxos API.
|
|
3
|
+
*
|
|
4
|
+
* When configured, the SDK signs every HTTP request with an Ed25519 (EdDSA) or P-256 (ES256) JWS and
|
|
5
|
+
* sends it in the `Paxos-Signature` header. This is opt-in — users must contact
|
|
6
|
+
* Paxos support to enable request signing on their OAuth client, then configure
|
|
7
|
+
* the SDK with their private key and key ID.
|
|
8
|
+
*
|
|
9
|
+
* The {@link signRequest} function can also be used independently for custom
|
|
10
|
+
* integrations or webhook verification.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Create a JWS compact serialization for the given HTTP request parameters.
|
|
14
|
+
*
|
|
15
|
+
* This is a standalone utility function that can be used independently of the
|
|
16
|
+
* PaxosClient, for example in custom integrations or webhook verification.
|
|
17
|
+
*
|
|
18
|
+
* @param signingKeyHex - Ed25519 private key as 128 hex chars (32-byte seed followed by the
|
|
19
|
+
* 32-byte public key), or an unencrypted PKCS#8 PEM ("BEGIN PRIVATE KEY", Ed25519 or P-256)
|
|
20
|
+
* or SEC1 PEM ("BEGIN EC PRIVATE KEY", P-256).
|
|
21
|
+
* @param keyId - UUID of the registered public key.
|
|
22
|
+
* @param method - HTTP method (GET, POST, PUT, PATCH, DELETE).
|
|
23
|
+
* @param path - Full transmitted request path including query string and base URL prefix
|
|
24
|
+
* (e.g., "/v2/transfer/crypto-withdrawals").
|
|
25
|
+
* @param body - Raw HTTP request body bytes. For requests with no body (GET, DELETE),
|
|
26
|
+
* pass an empty Uint8Array.
|
|
27
|
+
* @returns JWS compact serialization: `base64url(header).base64url(payload).base64url(signature)`
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Request signing requires contacting Paxos support to enable on the OAuth
|
|
31
|
+
* client before it can be used.
|
|
32
|
+
*/
|
|
33
|
+
export declare function signRequest(signingKeyHex: string, keyId: string, method: string, path: string, body: Uint8Array): string;
|
package/dist/signing.js
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JWS (JSON Web Signature) request signing for the Paxos API.
|
|
3
|
+
*
|
|
4
|
+
* When configured, the SDK signs every HTTP request with an Ed25519 (EdDSA) or P-256 (ES256) JWS and
|
|
5
|
+
* sends it in the `Paxos-Signature` header. This is opt-in — users must contact
|
|
6
|
+
* Paxos support to enable request signing on their OAuth client, then configure
|
|
7
|
+
* the SDK with their private key and key ID.
|
|
8
|
+
*
|
|
9
|
+
* The {@link signRequest} function can also be used independently for custom
|
|
10
|
+
* integrations or webhook verification.
|
|
11
|
+
*/
|
|
12
|
+
import { createPrivateKey, createPublicKey, sign } from "node:crypto";
|
|
13
|
+
/**
|
|
14
|
+
* PKCS8 DER prefix for Ed25519 private keys (RFC 8410).
|
|
15
|
+
* This wraps a raw 32-byte Ed25519 seed into a valid PKCS8 DER structure.
|
|
16
|
+
*/
|
|
17
|
+
const PKCS8_ED25519_PREFIX = Buffer.from("302e020100300506032b657004220420", "hex");
|
|
18
|
+
/**
|
|
19
|
+
* Create a JWS compact serialization for the given HTTP request parameters.
|
|
20
|
+
*
|
|
21
|
+
* This is a standalone utility function that can be used independently of the
|
|
22
|
+
* PaxosClient, for example in custom integrations or webhook verification.
|
|
23
|
+
*
|
|
24
|
+
* @param signingKeyHex - Ed25519 private key as 128 hex chars (32-byte seed followed by the
|
|
25
|
+
* 32-byte public key), or an unencrypted PKCS#8 PEM ("BEGIN PRIVATE KEY", Ed25519 or P-256)
|
|
26
|
+
* or SEC1 PEM ("BEGIN EC PRIVATE KEY", P-256).
|
|
27
|
+
* @param keyId - UUID of the registered public key.
|
|
28
|
+
* @param method - HTTP method (GET, POST, PUT, PATCH, DELETE).
|
|
29
|
+
* @param path - Full transmitted request path including query string and base URL prefix
|
|
30
|
+
* (e.g., "/v2/transfer/crypto-withdrawals").
|
|
31
|
+
* @param body - Raw HTTP request body bytes. For requests with no body (GET, DELETE),
|
|
32
|
+
* pass an empty Uint8Array.
|
|
33
|
+
* @returns JWS compact serialization: `base64url(header).base64url(payload).base64url(signature)`
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Request signing requires contacting Paxos support to enable on the OAuth
|
|
37
|
+
* client before it can be used.
|
|
38
|
+
*/
|
|
39
|
+
export function signRequest(signingKeyHex, keyId, method, path, body) {
|
|
40
|
+
const privateKey = parseSigningKey(signingKeyHex);
|
|
41
|
+
return signRequestWithKey(privateKey, keyId, method, path, body);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Parse a signing key, given as 128 hex characters (Ed25519) or as an unencrypted
|
|
45
|
+
* PKCS#8 or SEC1 PEM (Ed25519 or P-256), and return the KeyObject.
|
|
46
|
+
* Used internally by the client to parse the key once at construction time.
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export function parseSigningKey(signingKeyHex) {
|
|
50
|
+
if (signingKeyHex.trim().startsWith("-----BEGIN")) {
|
|
51
|
+
return parsePemSigningKey(signingKeyHex.trim());
|
|
52
|
+
}
|
|
53
|
+
if (/[^0-9a-fA-F]/.test(signingKeyHex)) {
|
|
54
|
+
throw new Error("invalid signing key hex: expected ASCII hexadecimal characters");
|
|
55
|
+
}
|
|
56
|
+
if (signingKeyHex.length !== 128) {
|
|
57
|
+
throw new Error("signing key must be 64 bytes (128 hex chars)");
|
|
58
|
+
}
|
|
59
|
+
const keyBytes = Buffer.from(signingKeyHex, "hex");
|
|
60
|
+
const privateKey = createEd25519Key(keyBytes.subarray(0, 32));
|
|
61
|
+
const publicKey = createPublicKey(privateKey).export({ format: "der", type: "spki" }).subarray(-32);
|
|
62
|
+
if (!publicKey.equals(keyBytes.subarray(32))) {
|
|
63
|
+
throw new Error("signing key public half does not match its seed");
|
|
64
|
+
}
|
|
65
|
+
return privateKey;
|
|
66
|
+
}
|
|
67
|
+
function parsePemSigningKey(pem) {
|
|
68
|
+
if (pem.startsWith("-----BEGIN ENCRYPTED PRIVATE KEY-----")) {
|
|
69
|
+
throw new Error("encrypted PEM signing keys are not supported; decrypt the key first");
|
|
70
|
+
}
|
|
71
|
+
if (pem.split("-----BEGIN").length !== 2 || !/-----END [A-Z0-9 ]+-----$/.test(pem)) {
|
|
72
|
+
throw new Error("invalid signing key PEM: expected a single PEM block");
|
|
73
|
+
}
|
|
74
|
+
if (!pem.startsWith("-----BEGIN PRIVATE KEY-----") && !pem.startsWith("-----BEGIN EC PRIVATE KEY-----")) {
|
|
75
|
+
throw new Error("unsupported PEM block type; expected an unencrypted PKCS#8 or SEC1 private key");
|
|
76
|
+
}
|
|
77
|
+
let key;
|
|
78
|
+
try {
|
|
79
|
+
key = createPrivateKey({ key: pem, format: "pem" });
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
throw new Error("invalid signing key PEM: not a valid unencrypted PKCS#8 or SEC1 private key; the SDK supports Ed25519 (EdDSA) and P-256 (ES256) keys only");
|
|
83
|
+
}
|
|
84
|
+
if (!hasExactDerLength(pem)) {
|
|
85
|
+
throw new Error("invalid signing key PEM: not a valid unencrypted PKCS#8 or SEC1 private key; the SDK supports Ed25519 (EdDSA) and P-256 (ES256) keys only");
|
|
86
|
+
}
|
|
87
|
+
if (key.asymmetricKeyType !== "ed25519" && !isP256(key)) {
|
|
88
|
+
throw new Error("unsupported signing key type in PEM; the SDK supports Ed25519 (EdDSA) and P-256 (ES256) keys only");
|
|
89
|
+
}
|
|
90
|
+
if (key.asymmetricKeyType === "ec" && !hasValidP256Scalar(pem)) {
|
|
91
|
+
throw new Error("invalid signing key PEM: not a valid unencrypted PKCS#8 or SEC1 private key; the SDK supports Ed25519 (EdDSA) and P-256 (ES256) keys only");
|
|
92
|
+
}
|
|
93
|
+
return key;
|
|
94
|
+
}
|
|
95
|
+
function readTlv(buf, offset) {
|
|
96
|
+
let length = buf[offset + 1];
|
|
97
|
+
let start = offset + 2;
|
|
98
|
+
if (length & 0x80) {
|
|
99
|
+
const count = length & 0x7f;
|
|
100
|
+
length = 0;
|
|
101
|
+
for (let i = 0; i < count; i++) {
|
|
102
|
+
length = length * 256 + buf[start + i];
|
|
103
|
+
}
|
|
104
|
+
start += count;
|
|
105
|
+
}
|
|
106
|
+
return { start, end: start + length };
|
|
107
|
+
}
|
|
108
|
+
const P256_ORDER = Buffer.from("ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", "hex");
|
|
109
|
+
function pemDer(pem) {
|
|
110
|
+
return Buffer.from(pem
|
|
111
|
+
.split("\n")
|
|
112
|
+
.filter((line) => !line.trim().startsWith("-----"))
|
|
113
|
+
.join(""), "base64");
|
|
114
|
+
}
|
|
115
|
+
function hasExactDerLength(pem) {
|
|
116
|
+
const der = pemDer(pem);
|
|
117
|
+
return der.length > 1 && readTlv(der, 0).end === der.length;
|
|
118
|
+
}
|
|
119
|
+
function hasValidP256Scalar(pem) {
|
|
120
|
+
try {
|
|
121
|
+
const der = pemDer(pem);
|
|
122
|
+
let position = readTlv(der, 0).start;
|
|
123
|
+
if (pem.startsWith("-----BEGIN PRIVATE KEY-----")) {
|
|
124
|
+
position = readTlv(der, readTlv(der, position).end).end;
|
|
125
|
+
position = readTlv(der, readTlv(der, position).start).start;
|
|
126
|
+
}
|
|
127
|
+
const scalar = readTlv(der, readTlv(der, position).end);
|
|
128
|
+
const bytes = der.subarray(scalar.start, scalar.end);
|
|
129
|
+
return bytes.length === 32 && bytes.some((b) => b !== 0) && Buffer.compare(bytes, P256_ORDER) < 0;
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const P256_PKCS8_ALGORITHM = Buffer.from("020100301306072a8648ce3d020106082a8648ce3d030107", "hex");
|
|
136
|
+
function isP256(key) {
|
|
137
|
+
if (key.asymmetricKeyType !== "ec") {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
try {
|
|
141
|
+
const der = key.export({ format: "der", type: "pkcs8" });
|
|
142
|
+
const index = der.indexOf(P256_PKCS8_ALGORITHM);
|
|
143
|
+
return index >= 0 && index <= 4;
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Create a JWS using an already-parsed Ed25519 or P-256 private key.
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
export function signRequestWithKey(privateKey, keyId, method, path, body, timestampOverride) {
|
|
154
|
+
const isEc = privateKey.asymmetricKeyType === "ec";
|
|
155
|
+
const timestamp = timestampOverride !== undefined ? timestampOverride : Math.floor(Date.now() / 1000);
|
|
156
|
+
// Build the protected header.
|
|
157
|
+
const header = {
|
|
158
|
+
alg: isEc ? "ES256" : "EdDSA",
|
|
159
|
+
kid: keyId,
|
|
160
|
+
"paxos.com/request-method": method,
|
|
161
|
+
"paxos.com/request-path": path,
|
|
162
|
+
"paxos.com/timestamp": String(timestamp),
|
|
163
|
+
};
|
|
164
|
+
const headerJson = JSON.stringify(header);
|
|
165
|
+
const encodedHeader = base64urlEncode(Buffer.from(headerJson, "utf-8"));
|
|
166
|
+
const encodedPayload = base64urlEncode(body instanceof Buffer ? body : Buffer.from(body));
|
|
167
|
+
// Sign base64url(header).base64url(payload).
|
|
168
|
+
const signingInput = `${encodedHeader}.${encodedPayload}`;
|
|
169
|
+
const signature = isEc
|
|
170
|
+
? sign("sha256", Buffer.from(signingInput, "ascii"), { key: privateKey, dsaEncoding: "ieee-p1363" })
|
|
171
|
+
: sign(null, Buffer.from(signingInput, "ascii"), privateKey);
|
|
172
|
+
// Base64url encode the signature.
|
|
173
|
+
const encodedSignature = base64urlEncode(signature);
|
|
174
|
+
// Return JWS compact serialization.
|
|
175
|
+
return `${encodedHeader}.${encodedPayload}.${encodedSignature}`;
|
|
176
|
+
}
|
|
177
|
+
/** Create an Ed25519 KeyObject from a 32-byte seed. */
|
|
178
|
+
function createEd25519Key(seed) {
|
|
179
|
+
const pkcs8 = Buffer.concat([PKCS8_ED25519_PREFIX, seed]);
|
|
180
|
+
return createPrivateKey({ key: pkcs8, format: "der", type: "pkcs8" });
|
|
181
|
+
}
|
|
182
|
+
/** Base64url encode without padding. */
|
|
183
|
+
function base64urlEncode(data) {
|
|
184
|
+
return data.toString("base64url");
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=signing.js.map
|