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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as SuwardSDK from "../../../index.mjs";
|
|
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
|
}
|
|
@@ -24,7 +24,7 @@ import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
25
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
26
26
|
import * as errors from "../../../../errors/index.mjs";
|
|
27
|
-
import * as
|
|
27
|
+
import * as SuwardSDK from "../../../index.mjs";
|
|
28
28
|
export class StaticWalletsClient {
|
|
29
29
|
constructor(options) {
|
|
30
30
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
@@ -32,7 +32,7 @@ export class StaticWalletsClient {
|
|
|
32
32
|
/**
|
|
33
33
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
34
|
*
|
|
35
|
-
* @throws {@link
|
|
35
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* await client.staticWallets.listStaticWallets()
|
|
@@ -65,9 +65,9 @@ export class StaticWalletsClient {
|
|
|
65
65
|
if (_response.error.reason === "status-code") {
|
|
66
66
|
switch (_response.error.statusCode) {
|
|
67
67
|
case 401:
|
|
68
|
-
throw new
|
|
68
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
69
69
|
default:
|
|
70
|
-
throw new errors.
|
|
70
|
+
throw new errors.SuwardSDKError({
|
|
71
71
|
statusCode: _response.error.statusCode,
|
|
72
72
|
body: _response.error.body,
|
|
73
73
|
rawResponse: _response.rawResponse,
|
|
@@ -80,11 +80,11 @@ export class StaticWalletsClient {
|
|
|
80
80
|
/**
|
|
81
81
|
* Create a reusable deposit address with an accepted-asset allow-list
|
|
82
82
|
*
|
|
83
|
-
* @param {
|
|
83
|
+
* @param {SuwardSDK.CryptopayCreateStaticWalletRequest} request
|
|
84
84
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
85
85
|
*
|
|
86
|
-
* @throws {@link
|
|
87
|
-
* @throws {@link
|
|
86
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
87
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
88
88
|
*
|
|
89
89
|
* @example
|
|
90
90
|
* await client.staticWallets.createStaticWallet()
|
|
@@ -120,11 +120,11 @@ export class StaticWalletsClient {
|
|
|
120
120
|
if (_response.error.reason === "status-code") {
|
|
121
121
|
switch (_response.error.statusCode) {
|
|
122
122
|
case 400:
|
|
123
|
-
throw new
|
|
123
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
124
124
|
case 401:
|
|
125
|
-
throw new
|
|
125
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
126
126
|
default:
|
|
127
|
-
throw new errors.
|
|
127
|
+
throw new errors.SuwardSDKError({
|
|
128
128
|
statusCode: _response.error.statusCode,
|
|
129
129
|
body: _response.error.body,
|
|
130
130
|
rawResponse: _response.rawResponse,
|
|
@@ -135,10 +135,10 @@ export class StaticWalletsClient {
|
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
|
-
* @param {
|
|
138
|
+
* @param {SuwardSDK.GetV1StaticWalletsStaticWalletIdRequest} request
|
|
139
139
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
140
140
|
*
|
|
141
|
-
* @throws {@link
|
|
141
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
142
142
|
*
|
|
143
143
|
* @example
|
|
144
144
|
* await client.staticWallets.getStaticWallet({
|
|
@@ -174,9 +174,9 @@ export class StaticWalletsClient {
|
|
|
174
174
|
if (_response.error.reason === "status-code") {
|
|
175
175
|
switch (_response.error.statusCode) {
|
|
176
176
|
case 404:
|
|
177
|
-
throw new
|
|
177
|
+
throw new SuwardSDK.NotFoundError(_response.error.body, _response.rawResponse);
|
|
178
178
|
default:
|
|
179
|
-
throw new errors.
|
|
179
|
+
throw new errors.SuwardSDKError({
|
|
180
180
|
statusCode: _response.error.statusCode,
|
|
181
181
|
body: _response.error.body,
|
|
182
182
|
rawResponse: _response.rawResponse,
|
|
@@ -187,10 +187,10 @@ export class StaticWalletsClient {
|
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
190
|
-
* @param {
|
|
190
|
+
* @param {SuwardSDK.DeleteV1StaticWalletsStaticWalletIdRequest} request
|
|
191
191
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
192
192
|
*
|
|
193
|
-
* @throws {@link
|
|
193
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
194
194
|
*
|
|
195
195
|
* @example
|
|
196
196
|
* await client.staticWallets.deleteStaticWallet({
|
|
@@ -223,9 +223,9 @@ export class StaticWalletsClient {
|
|
|
223
223
|
if (_response.error.reason === "status-code") {
|
|
224
224
|
switch (_response.error.statusCode) {
|
|
225
225
|
case 404:
|
|
226
|
-
throw new
|
|
226
|
+
throw new SuwardSDK.NotFoundError(_response.error.body, _response.rawResponse);
|
|
227
227
|
default:
|
|
228
|
-
throw new errors.
|
|
228
|
+
throw new errors.SuwardSDKError({
|
|
229
229
|
statusCode: _response.error.statusCode,
|
|
230
230
|
body: _response.error.body,
|
|
231
231
|
rawResponse: _response.rawResponse,
|
|
@@ -236,10 +236,10 @@ export class StaticWalletsClient {
|
|
|
236
236
|
});
|
|
237
237
|
}
|
|
238
238
|
/**
|
|
239
|
-
* @param {
|
|
239
|
+
* @param {SuwardSDK.CryptopayUpdateStaticWalletRequest} request
|
|
240
240
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
241
241
|
*
|
|
242
|
-
* @throws {@link
|
|
242
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
243
243
|
*
|
|
244
244
|
* @example
|
|
245
245
|
* await client.staticWallets.updateStaticWallet({
|
|
@@ -278,9 +278,9 @@ export class StaticWalletsClient {
|
|
|
278
278
|
if (_response.error.reason === "status-code") {
|
|
279
279
|
switch (_response.error.statusCode) {
|
|
280
280
|
case 400:
|
|
281
|
-
throw new
|
|
281
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
282
282
|
default:
|
|
283
|
-
throw new errors.
|
|
283
|
+
throw new errors.SuwardSDKError({
|
|
284
284
|
statusCode: _response.error.statusCode,
|
|
285
285
|
body: _response.error.body,
|
|
286
286
|
rawResponse: _response.rawResponse,
|
|
@@ -291,10 +291,10 @@ export class StaticWalletsClient {
|
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
293
|
/**
|
|
294
|
-
* @param {
|
|
294
|
+
* @param {SuwardSDK.GetV1StaticWalletsStaticWalletIdDepositsRequest} request
|
|
295
295
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
296
296
|
*
|
|
297
|
-
* @throws {@link
|
|
297
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
298
298
|
*
|
|
299
299
|
* @example
|
|
300
300
|
* await client.staticWallets.listStaticWalletDeposits({
|
|
@@ -330,9 +330,9 @@ export class StaticWalletsClient {
|
|
|
330
330
|
if (_response.error.reason === "status-code") {
|
|
331
331
|
switch (_response.error.statusCode) {
|
|
332
332
|
case 404:
|
|
333
|
-
throw new
|
|
333
|
+
throw new SuwardSDK.NotFoundError(_response.error.body, _response.rawResponse);
|
|
334
334
|
default:
|
|
335
|
-
throw new errors.
|
|
335
|
+
throw new errors.SuwardSDKError({
|
|
336
336
|
statusCode: _response.error.statusCode,
|
|
337
337
|
body: _response.error.body,
|
|
338
338
|
rawResponse: _response.rawResponse,
|
|
@@ -345,11 +345,11 @@ export class StaticWalletsClient {
|
|
|
345
345
|
/**
|
|
346
346
|
* Drive a synthetic deposit through its lifecycle on a test wallet (no on-chain activity, no balance credit). Test wallets only.
|
|
347
347
|
*
|
|
348
|
-
* @param {
|
|
348
|
+
* @param {SuwardSDK.CryptopaySimulateStaticDepositRequest} request
|
|
349
349
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
350
350
|
*
|
|
351
|
-
* @throws {@link
|
|
352
|
-
* @throws {@link
|
|
351
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
352
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
353
353
|
*
|
|
354
354
|
* @example
|
|
355
355
|
* await client.staticWallets.simulateStaticWalletDeposit({
|
|
@@ -388,11 +388,11 @@ export class StaticWalletsClient {
|
|
|
388
388
|
if (_response.error.reason === "status-code") {
|
|
389
389
|
switch (_response.error.statusCode) {
|
|
390
390
|
case 400:
|
|
391
|
-
throw new
|
|
391
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
392
392
|
case 404:
|
|
393
|
-
throw new
|
|
393
|
+
throw new SuwardSDK.NotFoundError(_response.error.body, _response.rawResponse);
|
|
394
394
|
default:
|
|
395
|
-
throw new errors.
|
|
395
|
+
throw new errors.SuwardSDKError({
|
|
396
396
|
statusCode: _response.error.statusCode,
|
|
397
397
|
body: _response.error.body,
|
|
398
398
|
rawResponse: _response.rawResponse,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../index.mjs";
|
|
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.mjs";
|
|
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.mjs";
|
|
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.mjs";
|
|
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.mjs";
|
|
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
|
}
|
|
@@ -23,7 +23,7 @@ export class HeaderAuthProvider {
|
|
|
23
23
|
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
24
24
|
const headerValue = yield core.Supplier.get(this.options[PARAM_KEY]);
|
|
25
25
|
if (headerValue == null) {
|
|
26
|
-
throw new errors.
|
|
26
|
+
throw new errors.SuwardSDKError({
|
|
27
27
|
message: HeaderAuthProvider.AUTH_CONFIG_ERROR_MESSAGE,
|
|
28
28
|
});
|
|
29
29
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import { toJson } from "../core/json.mjs";
|
|
3
|
-
export class
|
|
3
|
+
export class SuwardSDKError extends Error {
|
|
4
4
|
constructor({ message, statusCode, body, rawResponse, cause, }) {
|
|
5
5
|
super(buildMessage({ message, statusCode, body }));
|
|
6
6
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
7
7
|
if (Error.captureStackTrace) {
|
|
8
8
|
Error.captureStackTrace(this, this.constructor);
|
|
9
9
|
}
|
|
10
|
-
this.name = "
|
|
10
|
+
this.name = "SuwardSDKError";
|
|
11
11
|
this.statusCode = statusCode;
|
|
12
12
|
this.body = body;
|
|
13
13
|
this.rawResponse = rawResponse;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export class
|
|
2
|
+
export class SuwardSDKTimeoutError extends Error {
|
|
3
3
|
constructor(message, opts) {
|
|
4
4
|
super(message);
|
|
5
5
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
6
6
|
if (Error.captureStackTrace) {
|
|
7
7
|
Error.captureStackTrace(this, this.constructor);
|
|
8
8
|
}
|
|
9
|
-
this.name = "
|
|
9
|
+
this.name = "SuwardSDKTimeoutError";
|
|
10
10
|
if ((opts === null || opts === void 0 ? void 0 : opts.cause) != null) {
|
|
11
11
|
this.cause = opts.cause;
|
|
12
12
|
}
|
|
@@ -3,28 +3,28 @@ import * as errors from "./index.mjs";
|
|
|
3
3
|
export function handleNonStatusCodeError(error, rawResponse, method, path) {
|
|
4
4
|
switch (error.reason) {
|
|
5
5
|
case "non-json":
|
|
6
|
-
throw new errors.
|
|
6
|
+
throw new errors.SuwardSDKError({
|
|
7
7
|
statusCode: error.statusCode,
|
|
8
8
|
body: error.rawBody,
|
|
9
9
|
rawResponse: rawResponse,
|
|
10
10
|
});
|
|
11
11
|
case "body-is-null":
|
|
12
|
-
throw new errors.
|
|
12
|
+
throw new errors.SuwardSDKError({
|
|
13
13
|
statusCode: error.statusCode,
|
|
14
14
|
rawResponse: rawResponse,
|
|
15
15
|
});
|
|
16
16
|
case "timeout":
|
|
17
|
-
throw new errors.
|
|
17
|
+
throw new errors.SuwardSDKTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, {
|
|
18
18
|
cause: error.cause,
|
|
19
19
|
});
|
|
20
20
|
case "unknown":
|
|
21
|
-
throw new errors.
|
|
21
|
+
throw new errors.SuwardSDKError({
|
|
22
22
|
message: error.errorMessage,
|
|
23
23
|
rawResponse: rawResponse,
|
|
24
24
|
cause: error.cause,
|
|
25
25
|
});
|
|
26
26
|
default:
|
|
27
|
-
throw new errors.
|
|
27
|
+
throw new errors.SuwardSDKError({
|
|
28
28
|
message: "Unknown error",
|
|
29
29
|
rawResponse: rawResponse,
|
|
30
30
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { SuwardSDKError } from "./SuwardSDKError.mjs";
|
|
2
|
+
export { SuwardSDKTimeoutError } from "./SuwardSDKTimeoutError.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { SuwardSDKError } from "./SuwardSDKError.mjs";
|
|
2
|
+
export { SuwardSDKTimeoutError } from "./SuwardSDKTimeoutError.mjs";
|
package/dist/esm/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * as
|
|
1
|
+
export * as SuwardSDK from "./api/index.mjs";
|
|
2
2
|
export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
3
|
+
export { SuwardSDKClient } from "./Client.mjs";
|
|
4
|
+
export { SuwardSDKError, SuwardSDKTimeoutError } from "./errors/index.mjs";
|
|
5
5
|
export * from "./exports.mjs";
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * as
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export * as SuwardSDK from "./api/index.mjs";
|
|
2
|
+
export { SuwardSDKClient } from "./Client.mjs";
|
|
3
|
+
export { SuwardSDKError, SuwardSDKTimeoutError } from "./errors/index.mjs";
|
|
4
4
|
export * from "./exports.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.15";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.15";
|