pkg-sdk-test 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +295 -0
- package/dist/cjs/BaseClient.js +3 -3
- package/dist/cjs/Client.d.ts +4 -4
- package/dist/cjs/Client.js +3 -3
- package/dist/cjs/api/errors/BadRequestError.d.ts +3 -3
- package/dist/cjs/api/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/errors/InternalServerError.d.ts +3 -3
- package/dist/cjs/api/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/errors/NotFoundError.d.ts +3 -3
- package/dist/cjs/api/errors/NotFoundError.js +1 -1
- package/dist/cjs/api/errors/UnauthorizedError.d.ts +3 -3
- package/dist/cjs/api/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/payments/client/Client.d.ts +23 -23
- package/dist/cjs/api/resources/payments/client/Client.js +37 -37
- package/dist/cjs/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.ts +2 -2
- package/dist/cjs/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.ts +2 -2
- package/dist/cjs/api/resources/payments/client/requests/GetV1PaymentsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/payments/types/GetV1PaymentsPaymentIdResponse.d.ts +2 -2
- package/dist/cjs/api/resources/staticWallets/client/Client.d.ts +23 -23
- package/dist/cjs/api/resources/staticWallets/client/Client.js +32 -32
- package/dist/cjs/api/types/CryptopayListPaymentsResponse.d.ts +2 -2
- package/dist/cjs/api/types/CryptopayListStaticDepositsResponse.d.ts +2 -2
- package/dist/cjs/api/types/CryptopayListStaticWalletsResponse.d.ts +2 -2
- package/dist/cjs/api/types/CryptopayPaymentResponse.d.ts +5 -5
- package/dist/cjs/api/types/CryptopayPublicPaymentResponse.d.ts +4 -4
- package/dist/cjs/auth/HeaderAuthProvider.js +1 -1
- package/dist/cjs/errors/{SuwardApiError.d.ts → SuwardSDKError.d.ts} +1 -1
- package/dist/cjs/errors/{SuwardApiError.js → SuwardSDKError.js} +4 -4
- package/dist/{esm/errors/SuwardApiTimeoutError.d.mts → cjs/errors/SuwardSDKTimeoutError.d.ts} +1 -1
- package/dist/cjs/errors/{SuwardApiTimeoutError.js → SuwardSDKTimeoutError.js} +4 -4
- package/dist/cjs/errors/handleNonStatusCodeError.js +5 -5
- package/dist/cjs/errors/index.d.ts +2 -2
- package/dist/cjs/errors/index.js +5 -5
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +3 -3
- package/dist/esm/Client.d.mts +4 -4
- package/dist/esm/Client.mjs +1 -1
- package/dist/esm/api/errors/BadRequestError.d.mts +3 -3
- package/dist/esm/api/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/errors/InternalServerError.d.mts +3 -3
- package/dist/esm/api/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/errors/NotFoundError.d.mts +3 -3
- package/dist/esm/api/errors/NotFoundError.mjs +1 -1
- package/dist/esm/api/errors/UnauthorizedError.d.mts +3 -3
- package/dist/esm/api/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/payments/client/Client.d.mts +23 -23
- package/dist/esm/api/resources/payments/client/Client.mjs +37 -37
- package/dist/esm/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.mts +2 -2
- package/dist/esm/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.mts +2 -2
- package/dist/esm/api/resources/payments/client/requests/GetV1PaymentsRequest.d.mts +1 -1
- package/dist/esm/api/resources/payments/types/GetV1PaymentsPaymentIdResponse.d.mts +2 -2
- package/dist/esm/api/resources/staticWallets/client/Client.d.mts +23 -23
- package/dist/esm/api/resources/staticWallets/client/Client.mjs +32 -32
- package/dist/esm/api/types/CryptopayListPaymentsResponse.d.mts +2 -2
- package/dist/esm/api/types/CryptopayListStaticDepositsResponse.d.mts +2 -2
- package/dist/esm/api/types/CryptopayListStaticWalletsResponse.d.mts +2 -2
- package/dist/esm/api/types/CryptopayPaymentResponse.d.mts +5 -5
- package/dist/esm/api/types/CryptopayPublicPaymentResponse.d.mts +4 -4
- package/dist/esm/auth/HeaderAuthProvider.mjs +1 -1
- package/dist/esm/errors/{SuwardApiError.d.mts → SuwardSDKError.d.mts} +1 -1
- package/dist/esm/errors/{SuwardApiError.mjs → SuwardSDKError.mjs} +2 -2
- package/dist/{cjs/errors/SuwardApiTimeoutError.d.ts → esm/errors/SuwardSDKTimeoutError.d.mts} +1 -1
- package/dist/esm/errors/{SuwardApiTimeoutError.mjs → SuwardSDKTimeoutError.mjs} +2 -2
- package/dist/esm/errors/handleNonStatusCodeError.mjs +5 -5
- package/dist/esm/errors/index.d.mts +2 -2
- package/dist/esm/errors/index.mjs +2 -2
- package/dist/esm/index.d.mts +3 -3
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +86 -82
- package/reference.md +698 -0
|
@@ -60,7 +60,7 @@ const headers_js_1 = require("../../../../core/headers.js");
|
|
|
60
60
|
const core = __importStar(require("../../../../core/index.js"));
|
|
61
61
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
62
62
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
63
|
-
const
|
|
63
|
+
const SuwardSDK = __importStar(require("../../../index.js"));
|
|
64
64
|
class PaymentsClient {
|
|
65
65
|
constructor(options) {
|
|
66
66
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
@@ -68,12 +68,12 @@ class PaymentsClient {
|
|
|
68
68
|
/**
|
|
69
69
|
* List payments for a project
|
|
70
70
|
*
|
|
71
|
-
* @param {
|
|
71
|
+
* @param {SuwardSDK.GetV1PaymentsRequest} request
|
|
72
72
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
73
|
*
|
|
74
|
-
* @throws {@link
|
|
75
|
-
* @throws {@link
|
|
76
|
-
* @throws {@link
|
|
74
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
75
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
76
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
77
77
|
*
|
|
78
78
|
* @example
|
|
79
79
|
* await client.payments.listPayments()
|
|
@@ -84,9 +84,9 @@ class PaymentsClient {
|
|
|
84
84
|
__listPayments() {
|
|
85
85
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
86
86
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
87
|
-
const {
|
|
87
|
+
const { ordeddddr, limit, lastId } = request;
|
|
88
88
|
const _queryParams = {
|
|
89
|
-
|
|
89
|
+
ordeddddr,
|
|
90
90
|
limit,
|
|
91
91
|
lastId,
|
|
92
92
|
};
|
|
@@ -116,13 +116,13 @@ class PaymentsClient {
|
|
|
116
116
|
if (_response.error.reason === "status-code") {
|
|
117
117
|
switch (_response.error.statusCode) {
|
|
118
118
|
case 400:
|
|
119
|
-
throw new
|
|
119
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
120
120
|
case 401:
|
|
121
|
-
throw new
|
|
121
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
122
122
|
case 500:
|
|
123
|
-
throw new
|
|
123
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
124
124
|
default:
|
|
125
|
-
throw new errors.
|
|
125
|
+
throw new errors.SuwardSDKError({
|
|
126
126
|
statusCode: _response.error.statusCode,
|
|
127
127
|
body: _response.error.body,
|
|
128
128
|
rawResponse: _response.rawResponse,
|
|
@@ -135,12 +135,12 @@ class PaymentsClient {
|
|
|
135
135
|
/**
|
|
136
136
|
* Create a new payment
|
|
137
137
|
*
|
|
138
|
-
* @param {
|
|
138
|
+
* @param {SuwardSDK.CryptopayCreatePaymentRequest} request
|
|
139
139
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
140
140
|
*
|
|
141
|
-
* @throws {@link
|
|
142
|
-
* @throws {@link
|
|
143
|
-
* @throws {@link
|
|
141
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
142
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
143
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
144
144
|
*
|
|
145
145
|
* @example
|
|
146
146
|
* await client.payments.createPayment()
|
|
@@ -173,13 +173,13 @@ class PaymentsClient {
|
|
|
173
173
|
if (_response.error.reason === "status-code") {
|
|
174
174
|
switch (_response.error.statusCode) {
|
|
175
175
|
case 400:
|
|
176
|
-
throw new
|
|
176
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
177
177
|
case 401:
|
|
178
|
-
throw new
|
|
178
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
179
179
|
case 500:
|
|
180
|
-
throw new
|
|
180
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
181
181
|
default:
|
|
182
|
-
throw new errors.
|
|
182
|
+
throw new errors.SuwardSDKError({
|
|
183
183
|
statusCode: _response.error.statusCode,
|
|
184
184
|
body: _response.error.body,
|
|
185
185
|
rawResponse: _response.rawResponse,
|
|
@@ -193,10 +193,10 @@ class PaymentsClient {
|
|
|
193
193
|
* Returns full payment details when called with an API key (merchant view).
|
|
194
194
|
* Returns limited payment details when called without an API key (customer view).
|
|
195
195
|
*
|
|
196
|
-
* @param {
|
|
196
|
+
* @param {SuwardSDK.GetV1PaymentsPaymentIdRequest} request
|
|
197
197
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
198
198
|
*
|
|
199
|
-
* @throws {@link
|
|
199
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
200
200
|
*
|
|
201
201
|
* @example
|
|
202
202
|
* await client.payments.getPayment({
|
|
@@ -232,9 +232,9 @@ class PaymentsClient {
|
|
|
232
232
|
if (_response.error.reason === "status-code") {
|
|
233
233
|
switch (_response.error.statusCode) {
|
|
234
234
|
case 500:
|
|
235
|
-
throw new
|
|
235
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
236
236
|
default:
|
|
237
|
-
throw new errors.
|
|
237
|
+
throw new errors.SuwardSDKError({
|
|
238
238
|
statusCode: _response.error.statusCode,
|
|
239
239
|
body: _response.error.body,
|
|
240
240
|
rawResponse: _response.rawResponse,
|
|
@@ -247,11 +247,11 @@ class PaymentsClient {
|
|
|
247
247
|
/**
|
|
248
248
|
* Cancel a payment
|
|
249
249
|
*
|
|
250
|
-
* @param {
|
|
250
|
+
* @param {SuwardSDK.PostV1PaymentsPaymentIdCancelRequest} request
|
|
251
251
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
252
252
|
*
|
|
253
|
-
* @throws {@link
|
|
254
|
-
* @throws {@link
|
|
253
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
254
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
255
255
|
*
|
|
256
256
|
* @example
|
|
257
257
|
* await client.payments.cancelPayment({
|
|
@@ -284,11 +284,11 @@ class PaymentsClient {
|
|
|
284
284
|
if (_response.error.reason === "status-code") {
|
|
285
285
|
switch (_response.error.statusCode) {
|
|
286
286
|
case 401:
|
|
287
|
-
throw new
|
|
287
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
288
288
|
case 500:
|
|
289
|
-
throw new
|
|
289
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
290
290
|
default:
|
|
291
|
-
throw new errors.
|
|
291
|
+
throw new errors.SuwardSDKError({
|
|
292
292
|
statusCode: _response.error.statusCode,
|
|
293
293
|
body: _response.error.body,
|
|
294
294
|
rawResponse: _response.rawResponse,
|
|
@@ -301,12 +301,12 @@ class PaymentsClient {
|
|
|
301
301
|
/**
|
|
302
302
|
* Simulate payment status change (test mode only)
|
|
303
303
|
*
|
|
304
|
-
* @param {
|
|
304
|
+
* @param {SuwardSDK.CryptopaySimulatePaymentRequest} request
|
|
305
305
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
306
306
|
*
|
|
307
|
-
* @throws {@link
|
|
308
|
-
* @throws {@link
|
|
309
|
-
* @throws {@link
|
|
307
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
308
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
309
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
310
310
|
*
|
|
311
311
|
* @example
|
|
312
312
|
* await client.payments.simulatePayment({
|
|
@@ -342,13 +342,13 @@ class PaymentsClient {
|
|
|
342
342
|
if (_response.error.reason === "status-code") {
|
|
343
343
|
switch (_response.error.statusCode) {
|
|
344
344
|
case 400:
|
|
345
|
-
throw new
|
|
345
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
346
346
|
case 401:
|
|
347
|
-
throw new
|
|
347
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
348
348
|
case 500:
|
|
349
|
-
throw new
|
|
349
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
350
350
|
default:
|
|
351
|
-
throw new errors.
|
|
351
|
+
throw new errors.SuwardSDKError({
|
|
352
352
|
statusCode: _response.error.statusCode,
|
|
353
353
|
body: _response.error.body,
|
|
354
354
|
rawResponse: _response.rawResponse,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.js";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {}
|
|
@@ -11,7 +11,7 @@ export interface CryptopayCreatePaymentRequest {
|
|
|
11
11
|
isTest?: boolean;
|
|
12
12
|
metadata?: Record<string, unknown>;
|
|
13
13
|
paymentWindowSeconds?: number;
|
|
14
|
-
redirect?:
|
|
14
|
+
redirect?: SuwardSDK.CryptopayRedirectConfigDto;
|
|
15
15
|
underpaymentTolerance?: string;
|
|
16
16
|
webhookUrl?: string;
|
|
17
17
|
}
|
package/dist/cjs/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.js";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
@@ -9,5 +9,5 @@ export interface CryptopaySimulatePaymentRequest {
|
|
|
9
9
|
/** Payment ID */
|
|
10
10
|
paymentId: string;
|
|
11
11
|
amount?: string;
|
|
12
|
-
subStatus?:
|
|
12
|
+
subStatus?: SuwardSDK.CryptopayPaymentSubStatusEnum;
|
|
13
13
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
export type GetV1PaymentsPaymentIdResponse =
|
|
1
|
+
import type * as SuwardSDK from "../../../index.js";
|
|
2
|
+
export type GetV1PaymentsPaymentIdResponse = SuwardSDK.CryptopayPaymentResponse | SuwardSDK.CryptopayPublicPaymentResponse;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
3
|
import * as core from "../../../../core/index.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as SuwardSDK from "../../../index.js";
|
|
5
5
|
export declare namespace StaticWalletsClient {
|
|
6
6
|
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
@@ -13,93 +13,93 @@ export declare class StaticWalletsClient {
|
|
|
13
13
|
/**
|
|
14
14
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
15
15
|
*
|
|
16
|
-
* @throws {@link
|
|
16
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* await client.staticWallets.listStaticWallets()
|
|
20
20
|
*/
|
|
21
|
-
listStaticWallets(requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<
|
|
21
|
+
listStaticWallets(requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayListStaticWalletsResponse>;
|
|
22
22
|
private __listStaticWallets;
|
|
23
23
|
/**
|
|
24
24
|
* Create a reusable deposit address with an accepted-asset allow-list
|
|
25
25
|
*
|
|
26
|
-
* @param {
|
|
26
|
+
* @param {SuwardSDK.CryptopayCreateStaticWalletRequest} request
|
|
27
27
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
28
|
*
|
|
29
|
-
* @throws {@link
|
|
30
|
-
* @throws {@link
|
|
29
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
30
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* await client.staticWallets.createStaticWallet()
|
|
34
34
|
*/
|
|
35
|
-
createStaticWallet(request?:
|
|
35
|
+
createStaticWallet(request?: SuwardSDK.CryptopayCreateStaticWalletRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayStaticWalletResponse>;
|
|
36
36
|
private __createStaticWallet;
|
|
37
37
|
/**
|
|
38
|
-
* @param {
|
|
38
|
+
* @param {SuwardSDK.GetV1StaticWalletsStaticWalletIdRequest} request
|
|
39
39
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
40
|
*
|
|
41
|
-
* @throws {@link
|
|
41
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
44
|
* await client.staticWallets.getStaticWallet({
|
|
45
45
|
* staticWalletId: "staticWalletId"
|
|
46
46
|
* })
|
|
47
47
|
*/
|
|
48
|
-
getStaticWallet(request:
|
|
48
|
+
getStaticWallet(request: SuwardSDK.GetV1StaticWalletsStaticWalletIdRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayStaticWalletResponse>;
|
|
49
49
|
private __getStaticWallet;
|
|
50
50
|
/**
|
|
51
|
-
* @param {
|
|
51
|
+
* @param {SuwardSDK.DeleteV1StaticWalletsStaticWalletIdRequest} request
|
|
52
52
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
53
|
*
|
|
54
|
-
* @throws {@link
|
|
54
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
55
55
|
*
|
|
56
56
|
* @example
|
|
57
57
|
* await client.staticWallets.deleteStaticWallet({
|
|
58
58
|
* staticWalletId: "staticWalletId"
|
|
59
59
|
* })
|
|
60
60
|
*/
|
|
61
|
-
deleteStaticWallet(request:
|
|
61
|
+
deleteStaticWallet(request: SuwardSDK.DeleteV1StaticWalletsStaticWalletIdRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<Record<string, boolean>>;
|
|
62
62
|
private __deleteStaticWallet;
|
|
63
63
|
/**
|
|
64
|
-
* @param {
|
|
64
|
+
* @param {SuwardSDK.CryptopayUpdateStaticWalletRequest} request
|
|
65
65
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
66
|
*
|
|
67
|
-
* @throws {@link
|
|
67
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
68
68
|
*
|
|
69
69
|
* @example
|
|
70
70
|
* await client.staticWallets.updateStaticWallet({
|
|
71
71
|
* staticWalletId: "staticWalletId"
|
|
72
72
|
* })
|
|
73
73
|
*/
|
|
74
|
-
updateStaticWallet(request:
|
|
74
|
+
updateStaticWallet(request: SuwardSDK.CryptopayUpdateStaticWalletRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayStaticWalletResponse>;
|
|
75
75
|
private __updateStaticWallet;
|
|
76
76
|
/**
|
|
77
|
-
* @param {
|
|
77
|
+
* @param {SuwardSDK.GetV1StaticWalletsStaticWalletIdDepositsRequest} request
|
|
78
78
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
79
79
|
*
|
|
80
|
-
* @throws {@link
|
|
80
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
81
81
|
*
|
|
82
82
|
* @example
|
|
83
83
|
* await client.staticWallets.listStaticWalletDeposits({
|
|
84
84
|
* staticWalletId: "staticWalletId"
|
|
85
85
|
* })
|
|
86
86
|
*/
|
|
87
|
-
listStaticWalletDeposits(request:
|
|
87
|
+
listStaticWalletDeposits(request: SuwardSDK.GetV1StaticWalletsStaticWalletIdDepositsRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayListStaticDepositsResponse>;
|
|
88
88
|
private __listStaticWalletDeposits;
|
|
89
89
|
/**
|
|
90
90
|
* Drive a synthetic deposit through its lifecycle on a test wallet (no on-chain activity, no balance credit). Test wallets only.
|
|
91
91
|
*
|
|
92
|
-
* @param {
|
|
92
|
+
* @param {SuwardSDK.CryptopaySimulateStaticDepositRequest} request
|
|
93
93
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
94
94
|
*
|
|
95
|
-
* @throws {@link
|
|
96
|
-
* @throws {@link
|
|
95
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
96
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
97
97
|
*
|
|
98
98
|
* @example
|
|
99
99
|
* await client.staticWallets.simulateStaticWalletDeposit({
|
|
100
100
|
* staticWalletId: "staticWalletId"
|
|
101
101
|
* })
|
|
102
102
|
*/
|
|
103
|
-
simulateStaticWalletDeposit(request:
|
|
103
|
+
simulateStaticWalletDeposit(request: SuwardSDK.CryptopaySimulateStaticDepositRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayStaticDepositResponse>;
|
|
104
104
|
private __simulateStaticWalletDeposit;
|
|
105
105
|
}
|
|
@@ -60,7 +60,7 @@ const headers_js_1 = require("../../../../core/headers.js");
|
|
|
60
60
|
const core = __importStar(require("../../../../core/index.js"));
|
|
61
61
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
62
62
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
63
|
-
const
|
|
63
|
+
const SuwardSDK = __importStar(require("../../../index.js"));
|
|
64
64
|
class StaticWalletsClient {
|
|
65
65
|
constructor(options) {
|
|
66
66
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
@@ -68,7 +68,7 @@ class StaticWalletsClient {
|
|
|
68
68
|
/**
|
|
69
69
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
70
70
|
*
|
|
71
|
-
* @throws {@link
|
|
71
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
74
|
* await client.staticWallets.listStaticWallets()
|
|
@@ -101,9 +101,9 @@ class StaticWalletsClient {
|
|
|
101
101
|
if (_response.error.reason === "status-code") {
|
|
102
102
|
switch (_response.error.statusCode) {
|
|
103
103
|
case 401:
|
|
104
|
-
throw new
|
|
104
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
105
105
|
default:
|
|
106
|
-
throw new errors.
|
|
106
|
+
throw new errors.SuwardSDKError({
|
|
107
107
|
statusCode: _response.error.statusCode,
|
|
108
108
|
body: _response.error.body,
|
|
109
109
|
rawResponse: _response.rawResponse,
|
|
@@ -116,11 +116,11 @@ class StaticWalletsClient {
|
|
|
116
116
|
/**
|
|
117
117
|
* Create a reusable deposit address with an accepted-asset allow-list
|
|
118
118
|
*
|
|
119
|
-
* @param {
|
|
119
|
+
* @param {SuwardSDK.CryptopayCreateStaticWalletRequest} request
|
|
120
120
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
121
121
|
*
|
|
122
|
-
* @throws {@link
|
|
123
|
-
* @throws {@link
|
|
122
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
123
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
124
124
|
*
|
|
125
125
|
* @example
|
|
126
126
|
* await client.staticWallets.createStaticWallet()
|
|
@@ -156,11 +156,11 @@ class StaticWalletsClient {
|
|
|
156
156
|
if (_response.error.reason === "status-code") {
|
|
157
157
|
switch (_response.error.statusCode) {
|
|
158
158
|
case 400:
|
|
159
|
-
throw new
|
|
159
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
160
160
|
case 401:
|
|
161
|
-
throw new
|
|
161
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
162
162
|
default:
|
|
163
|
-
throw new errors.
|
|
163
|
+
throw new errors.SuwardSDKError({
|
|
164
164
|
statusCode: _response.error.statusCode,
|
|
165
165
|
body: _response.error.body,
|
|
166
166
|
rawResponse: _response.rawResponse,
|
|
@@ -171,10 +171,10 @@ class StaticWalletsClient {
|
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
174
|
-
* @param {
|
|
174
|
+
* @param {SuwardSDK.GetV1StaticWalletsStaticWalletIdRequest} request
|
|
175
175
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
176
176
|
*
|
|
177
|
-
* @throws {@link
|
|
177
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
178
178
|
*
|
|
179
179
|
* @example
|
|
180
180
|
* await client.staticWallets.getStaticWallet({
|
|
@@ -210,9 +210,9 @@ class StaticWalletsClient {
|
|
|
210
210
|
if (_response.error.reason === "status-code") {
|
|
211
211
|
switch (_response.error.statusCode) {
|
|
212
212
|
case 404:
|
|
213
|
-
throw new
|
|
213
|
+
throw new SuwardSDK.NotFoundError(_response.error.body, _response.rawResponse);
|
|
214
214
|
default:
|
|
215
|
-
throw new errors.
|
|
215
|
+
throw new errors.SuwardSDKError({
|
|
216
216
|
statusCode: _response.error.statusCode,
|
|
217
217
|
body: _response.error.body,
|
|
218
218
|
rawResponse: _response.rawResponse,
|
|
@@ -223,10 +223,10 @@ class StaticWalletsClient {
|
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
/**
|
|
226
|
-
* @param {
|
|
226
|
+
* @param {SuwardSDK.DeleteV1StaticWalletsStaticWalletIdRequest} request
|
|
227
227
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
228
228
|
*
|
|
229
|
-
* @throws {@link
|
|
229
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
230
230
|
*
|
|
231
231
|
* @example
|
|
232
232
|
* await client.staticWallets.deleteStaticWallet({
|
|
@@ -259,9 +259,9 @@ class StaticWalletsClient {
|
|
|
259
259
|
if (_response.error.reason === "status-code") {
|
|
260
260
|
switch (_response.error.statusCode) {
|
|
261
261
|
case 404:
|
|
262
|
-
throw new
|
|
262
|
+
throw new SuwardSDK.NotFoundError(_response.error.body, _response.rawResponse);
|
|
263
263
|
default:
|
|
264
|
-
throw new errors.
|
|
264
|
+
throw new errors.SuwardSDKError({
|
|
265
265
|
statusCode: _response.error.statusCode,
|
|
266
266
|
body: _response.error.body,
|
|
267
267
|
rawResponse: _response.rawResponse,
|
|
@@ -272,10 +272,10 @@ class StaticWalletsClient {
|
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
274
|
/**
|
|
275
|
-
* @param {
|
|
275
|
+
* @param {SuwardSDK.CryptopayUpdateStaticWalletRequest} request
|
|
276
276
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
277
277
|
*
|
|
278
|
-
* @throws {@link
|
|
278
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
279
279
|
*
|
|
280
280
|
* @example
|
|
281
281
|
* await client.staticWallets.updateStaticWallet({
|
|
@@ -314,9 +314,9 @@ class StaticWalletsClient {
|
|
|
314
314
|
if (_response.error.reason === "status-code") {
|
|
315
315
|
switch (_response.error.statusCode) {
|
|
316
316
|
case 400:
|
|
317
|
-
throw new
|
|
317
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
318
318
|
default:
|
|
319
|
-
throw new errors.
|
|
319
|
+
throw new errors.SuwardSDKError({
|
|
320
320
|
statusCode: _response.error.statusCode,
|
|
321
321
|
body: _response.error.body,
|
|
322
322
|
rawResponse: _response.rawResponse,
|
|
@@ -327,10 +327,10 @@ class StaticWalletsClient {
|
|
|
327
327
|
});
|
|
328
328
|
}
|
|
329
329
|
/**
|
|
330
|
-
* @param {
|
|
330
|
+
* @param {SuwardSDK.GetV1StaticWalletsStaticWalletIdDepositsRequest} request
|
|
331
331
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
332
332
|
*
|
|
333
|
-
* @throws {@link
|
|
333
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
334
334
|
*
|
|
335
335
|
* @example
|
|
336
336
|
* await client.staticWallets.listStaticWalletDeposits({
|
|
@@ -366,9 +366,9 @@ class StaticWalletsClient {
|
|
|
366
366
|
if (_response.error.reason === "status-code") {
|
|
367
367
|
switch (_response.error.statusCode) {
|
|
368
368
|
case 404:
|
|
369
|
-
throw new
|
|
369
|
+
throw new SuwardSDK.NotFoundError(_response.error.body, _response.rawResponse);
|
|
370
370
|
default:
|
|
371
|
-
throw new errors.
|
|
371
|
+
throw new errors.SuwardSDKError({
|
|
372
372
|
statusCode: _response.error.statusCode,
|
|
373
373
|
body: _response.error.body,
|
|
374
374
|
rawResponse: _response.rawResponse,
|
|
@@ -381,11 +381,11 @@ class StaticWalletsClient {
|
|
|
381
381
|
/**
|
|
382
382
|
* Drive a synthetic deposit through its lifecycle on a test wallet (no on-chain activity, no balance credit). Test wallets only.
|
|
383
383
|
*
|
|
384
|
-
* @param {
|
|
384
|
+
* @param {SuwardSDK.CryptopaySimulateStaticDepositRequest} request
|
|
385
385
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
386
386
|
*
|
|
387
|
-
* @throws {@link
|
|
388
|
-
* @throws {@link
|
|
387
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
388
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
389
389
|
*
|
|
390
390
|
* @example
|
|
391
391
|
* await client.staticWallets.simulateStaticWalletDeposit({
|
|
@@ -424,11 +424,11 @@ class StaticWalletsClient {
|
|
|
424
424
|
if (_response.error.reason === "status-code") {
|
|
425
425
|
switch (_response.error.statusCode) {
|
|
426
426
|
case 400:
|
|
427
|
-
throw new
|
|
427
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
428
428
|
case 404:
|
|
429
|
-
throw new
|
|
429
|
+
throw new SuwardSDK.NotFoundError(_response.error.body, _response.rawResponse);
|
|
430
430
|
default:
|
|
431
|
-
throw new errors.
|
|
431
|
+
throw new errors.SuwardSDKError({
|
|
432
432
|
statusCode: _response.error.statusCode,
|
|
433
433
|
body: _response.error.body,
|
|
434
434
|
rawResponse: _response.rawResponse,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../index.js";
|
|
2
2
|
export interface CryptopayListPaymentsResponse {
|
|
3
3
|
hasMore?: boolean | undefined;
|
|
4
|
-
items?:
|
|
4
|
+
items?: SuwardSDK.CryptopayPaymentResponse[] | undefined;
|
|
5
5
|
lastId?: string | undefined;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../index.js";
|
|
2
2
|
export interface CryptopayListStaticDepositsResponse {
|
|
3
3
|
hasMore?: boolean | undefined;
|
|
4
|
-
items?:
|
|
4
|
+
items?: SuwardSDK.CryptopayStaticDepositResponse[] | undefined;
|
|
5
5
|
lastId?: string | undefined;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../index.js";
|
|
2
2
|
export interface CryptopayListStaticWalletsResponse {
|
|
3
3
|
hasMore?: boolean | undefined;
|
|
4
|
-
items?:
|
|
4
|
+
items?: SuwardSDK.CryptopayStaticWalletResponse[] | undefined;
|
|
5
5
|
lastId?: string | undefined;
|
|
6
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../index.js";
|
|
2
2
|
export interface CryptopayPaymentResponse {
|
|
3
3
|
acceptedAt?: number | undefined;
|
|
4
4
|
activatedAt?: number | undefined;
|
|
@@ -18,10 +18,10 @@ export interface CryptopayPaymentResponse {
|
|
|
18
18
|
networkFee?: string | undefined;
|
|
19
19
|
paymentWindowSeconds?: number | undefined;
|
|
20
20
|
projectId?: string | undefined;
|
|
21
|
-
redirect?:
|
|
22
|
-
status?:
|
|
23
|
-
subStatus?:
|
|
24
|
-
transactions?:
|
|
21
|
+
redirect?: SuwardSDK.CryptopayRedirectConfigDto | undefined;
|
|
22
|
+
status?: SuwardSDK.CryptopayPaymentStatusEnum | undefined;
|
|
23
|
+
subStatus?: SuwardSDK.CryptopayPaymentSubStatusEnum | undefined;
|
|
24
|
+
transactions?: SuwardSDK.CryptopayTransactionResponse[] | undefined;
|
|
25
25
|
underpaymentTolerance?: string | undefined;
|
|
26
26
|
updatedAt?: number | undefined;
|
|
27
27
|
webhookUrl?: string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../index.js";
|
|
2
2
|
export interface CryptopayPublicPaymentResponse {
|
|
3
3
|
activatedAt?: number | undefined;
|
|
4
4
|
activationFlowSeconds?: number | undefined;
|
|
@@ -10,9 +10,9 @@ export interface CryptopayPublicPaymentResponse {
|
|
|
10
10
|
expiresAt?: number | undefined;
|
|
11
11
|
id?: string | undefined;
|
|
12
12
|
paymentWindowSeconds?: number | undefined;
|
|
13
|
-
redirect?:
|
|
14
|
-
status?:
|
|
15
|
-
subStatus?:
|
|
13
|
+
redirect?: SuwardSDK.CryptopayPublicRedirect | undefined;
|
|
14
|
+
status?: SuwardSDK.CryptopayPaymentStatusEnum | undefined;
|
|
15
|
+
subStatus?: SuwardSDK.CryptopayPaymentSubStatusEnum | undefined;
|
|
16
16
|
underpaymentTolerance?: string | undefined;
|
|
17
17
|
updatedAt?: number | undefined;
|
|
18
18
|
}
|
|
@@ -59,7 +59,7 @@ class HeaderAuthProvider {
|
|
|
59
59
|
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
60
60
|
const headerValue = yield core.Supplier.get(this.options[PARAM_KEY]);
|
|
61
61
|
if (headerValue == null) {
|
|
62
|
-
throw new errors.
|
|
62
|
+
throw new errors.SuwardSDKError({
|
|
63
63
|
message: HeaderAuthProvider.AUTH_CONFIG_ERROR_MESSAGE,
|
|
64
64
|
});
|
|
65
65
|
}
|