pkg-sdk-test 0.0.16 → 0.0.18

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.
Files changed (34) hide show
  1. package/README.md +14 -1
  2. package/dist/cjs/BaseClient.d.ts +2 -1
  3. package/dist/cjs/BaseClient.js +2 -2
  4. package/dist/cjs/Client.d.ts +1 -1
  5. package/dist/cjs/Client.js +1 -1
  6. package/dist/cjs/api/resources/payments/client/Client.d.ts +1 -1
  7. package/dist/cjs/api/resources/payments/client/Client.js +32 -31
  8. package/dist/cjs/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.ts +1 -1
  9. package/dist/cjs/api/resources/staticWallets/client/Client.d.ts +1 -1
  10. package/dist/cjs/api/resources/staticWallets/client/Client.js +37 -36
  11. package/dist/cjs/api/types/CryptopayPaymentResponse.d.ts +1 -1
  12. package/dist/cjs/environments.d.ts +4 -0
  13. package/dist/cjs/environments.js +7 -0
  14. package/dist/cjs/index.d.ts +1 -0
  15. package/dist/cjs/index.js +3 -1
  16. package/dist/cjs/version.d.ts +1 -1
  17. package/dist/cjs/version.js +1 -1
  18. package/dist/esm/BaseClient.d.mts +2 -1
  19. package/dist/esm/BaseClient.mjs +2 -2
  20. package/dist/esm/Client.d.mts +1 -1
  21. package/dist/esm/Client.mjs +1 -1
  22. package/dist/esm/api/resources/payments/client/Client.d.mts +1 -1
  23. package/dist/esm/api/resources/payments/client/Client.mjs +32 -31
  24. package/dist/esm/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.mts +1 -1
  25. package/dist/esm/api/resources/staticWallets/client/Client.d.mts +1 -1
  26. package/dist/esm/api/resources/staticWallets/client/Client.mjs +37 -36
  27. package/dist/esm/api/types/CryptopayPaymentResponse.d.mts +1 -1
  28. package/dist/esm/environments.d.mts +4 -0
  29. package/dist/esm/environments.mjs +4 -0
  30. package/dist/esm/index.d.mts +1 -0
  31. package/dist/esm/index.mjs +1 -0
  32. package/dist/esm/version.d.mts +1 -1
  33. package/dist/esm/version.mjs +1 -1
  34. package/package.json +1 -1
package/README.md CHANGED
@@ -10,6 +10,7 @@ The Suward TypeScript library provides convenient access to the Suward APIs from
10
10
  - [Installation](#installation)
11
11
  - [Reference](#reference)
12
12
  - [Usage](#usage)
13
+ - [Environments](#environments)
13
14
  - [Request and Response Types](#request-and-response-types)
14
15
  - [Exception Handling](#exception-handling)
15
16
  - [Advanced](#advanced)
@@ -42,10 +43,22 @@ Instantiate and use the client with the following:
42
43
  ```typescript
43
44
  import { SuwardSDKClient } from "pkg-sdk-test";
44
45
 
45
- const client = new SuwardSDKClient({ environment: "YOUR_BASE_URL", apiKey: "YOUR_API_KEY" });
46
+ const client = new SuwardSDKClient({ apiKey: "YOUR_API_KEY" });
46
47
  await client.payments.createPayment();
47
48
  ```
48
49
 
50
+ ## Environments
51
+
52
+ This SDK allows you to configure different environments for API requests.
53
+
54
+ ```typescript
55
+ import { SuwardSDKClient, SuwardSDKEnvironment } from "pkg-sdk-test";
56
+
57
+ const client = new SuwardSDKClient({
58
+ environment: SuwardSDKEnvironment.Default,
59
+ });
60
+ ```
61
+
49
62
  ## Request and Response Types
50
63
 
51
64
  The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
@@ -1,8 +1,9 @@
1
1
  import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.js";
2
2
  import * as core from "./core/index.js";
3
+ import type * as environments from "./environments.js";
3
4
  export type AuthOption = false | core.AuthProvider["getAuthRequest"] | core.AuthProvider | HeaderAuthProvider.AuthOptions;
4
5
  export type BaseClientOptions = {
5
- environment: core.Supplier<string>;
6
+ environment?: core.Supplier<environments.SuwardSDKEnvironment | string>;
6
7
  /** Specify a custom URL to connect the client to. */
7
8
  baseUrl?: core.Supplier<string>;
8
9
  /** Additional headers to include in requests. */
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "pkg-sdk-test",
46
- "X-Fern-SDK-Version": "0.0.16",
47
- "User-Agent": "pkg-sdk-test/0.0.16",
46
+ "X-Fern-SDK-Version": "0.0.18",
47
+ "User-Agent": "pkg-sdk-test/0.0.18",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -12,7 +12,7 @@ export declare class SuwardSDKClient {
12
12
  protected readonly _options: NormalizedClientOptionsWithAuth<SuwardSDKClient.Options>;
13
13
  protected _payments: PaymentsClient | undefined;
14
14
  protected _staticWallets: StaticWalletsClient | undefined;
15
- constructor(options: SuwardSDKClient.Options);
15
+ constructor(options?: SuwardSDKClient.Options);
16
16
  get payments(): PaymentsClient;
17
17
  get staticWallets(): StaticWalletsClient;
18
18
  /**
@@ -49,7 +49,7 @@ const Client_js_2 = require("./api/resources/staticWallets/client/Client.js");
49
49
  const BaseClient_js_1 = require("./BaseClient.js");
50
50
  const core = __importStar(require("./core/index.js"));
51
51
  class SuwardSDKClient {
52
- constructor(options) {
52
+ constructor(options = {}) {
53
53
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
54
54
  }
55
55
  get payments() {
@@ -9,7 +9,7 @@ export declare namespace PaymentsClient {
9
9
  }
10
10
  export declare class PaymentsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<PaymentsClient.Options>;
12
- constructor(options: PaymentsClient.Options);
12
+ constructor(options?: PaymentsClient.Options);
13
13
  /**
14
14
  * List payments for a project
15
15
  *
@@ -58,11 +58,12 @@ exports.PaymentsClient = void 0;
58
58
  const BaseClient_js_1 = require("../../../../BaseClient.js");
59
59
  const headers_js_1 = require("../../../../core/headers.js");
60
60
  const core = __importStar(require("../../../../core/index.js"));
61
+ const environments = __importStar(require("../../../../environments.js"));
61
62
  const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
62
63
  const errors = __importStar(require("../../../../errors/index.js"));
63
64
  const SuwardSDK = __importStar(require("../../../index.js"));
64
65
  class PaymentsClient {
65
- constructor(options) {
66
+ constructor(options = {}) {
66
67
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
67
68
  }
68
69
  /**
@@ -83,7 +84,7 @@ class PaymentsClient {
83
84
  }
84
85
  __listPayments() {
85
86
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
86
- var _a, _b, _c, _d, _e, _f, _g, _h;
87
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
87
88
  const { order, limit, lastId } = request;
88
89
  const _queryParams = {
89
90
  order: order != null ? order : undefined,
@@ -93,7 +94,7 @@ class PaymentsClient {
93
94
  const _authRequest = yield this._options.authProvider.getAuthRequest();
94
95
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
95
96
  const _response = yield core.fetcher({
96
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "v1/payments"),
97
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, "v1/payments"),
97
98
  method: "GET",
98
99
  headers: _headers,
99
100
  queryString: core.url
@@ -101,10 +102,10 @@ class PaymentsClient {
101
102
  .addMany(_queryParams)
102
103
  .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
103
104
  .build(),
104
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
105
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
105
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
106
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
106
107
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
107
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
108
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
108
109
  logging: this._options.logging,
109
110
  });
110
111
  if (_response.ok) {
@@ -150,21 +151,21 @@ class PaymentsClient {
150
151
  }
151
152
  __createPayment() {
152
153
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
153
- var _a, _b, _c, _d, _e, _f, _g, _h;
154
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
154
155
  const _authRequest = yield this._options.authProvider.getAuthRequest();
155
156
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
156
157
  const _response = yield core.fetcher({
157
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "v1/payments"),
158
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, "v1/payments"),
158
159
  method: "POST",
159
160
  headers: _headers,
160
161
  contentType: "application/json",
161
162
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
162
163
  requestType: "json",
163
164
  body: request,
164
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
165
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
165
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
166
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
166
167
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
167
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
168
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
168
169
  logging: this._options.logging,
169
170
  });
170
171
  if (_response.ok) {
@@ -208,19 +209,19 @@ class PaymentsClient {
208
209
  }
209
210
  __getPayment(request, requestOptions) {
210
211
  return __awaiter(this, void 0, void 0, function* () {
211
- var _a, _b, _c, _d, _e, _f, _g, _h;
212
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
212
213
  const { paymentId } = request;
213
214
  const _authRequest = yield this._options.authProvider.getAuthRequest();
214
215
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
215
216
  const _response = yield core.fetcher({
216
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/payments/${core.url.encodePathParam(paymentId)}`),
217
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/payments/${core.url.encodePathParam(paymentId)}`),
217
218
  method: "GET",
218
219
  headers: _headers,
219
220
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
220
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
221
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
221
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
222
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
222
223
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
223
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
224
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
224
225
  logging: this._options.logging,
225
226
  });
226
227
  if (_response.ok) {
@@ -262,18 +263,18 @@ class PaymentsClient {
262
263
  }
263
264
  __activatePayment(request, requestOptions) {
264
265
  return __awaiter(this, void 0, void 0, function* () {
265
- var _a, _b, _c, _d, _e, _f, _g, _h;
266
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
266
267
  const { paymentId } = request;
267
268
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
268
269
  const _response = yield core.fetcher({
269
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/payments/${core.url.encodePathParam(paymentId)}/activate`),
270
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/payments/${core.url.encodePathParam(paymentId)}/activate`),
270
271
  method: "POST",
271
272
  headers: _headers,
272
273
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
273
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
274
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
274
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
275
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
275
276
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
276
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
277
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
277
278
  logging: this._options.logging,
278
279
  });
279
280
  if (_response.ok) {
@@ -316,19 +317,19 @@ class PaymentsClient {
316
317
  }
317
318
  __cancelPayment(request, requestOptions) {
318
319
  return __awaiter(this, void 0, void 0, function* () {
319
- var _a, _b, _c, _d, _e, _f, _g, _h;
320
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
320
321
  const { paymentId } = request;
321
322
  const _authRequest = yield this._options.authProvider.getAuthRequest();
322
323
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
323
324
  const _response = yield core.fetcher({
324
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/payments/${core.url.encodePathParam(paymentId)}/cancel`),
325
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/payments/${core.url.encodePathParam(paymentId)}/cancel`),
325
326
  method: "POST",
326
327
  headers: _headers,
327
328
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
328
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
329
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
329
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
330
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
330
331
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
331
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
332
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
332
333
  logging: this._options.logging,
333
334
  });
334
335
  if (_response.ok) {
@@ -371,22 +372,22 @@ class PaymentsClient {
371
372
  }
372
373
  __simulatePayment(request, requestOptions) {
373
374
  return __awaiter(this, void 0, void 0, function* () {
374
- var _a, _b, _c, _d, _e, _f, _g, _h;
375
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
375
376
  const { paymentId } = request, _body = __rest(request, ["paymentId"]);
376
377
  const _authRequest = yield this._options.authProvider.getAuthRequest();
377
378
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
378
379
  const _response = yield core.fetcher({
379
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/payments/${core.url.encodePathParam(paymentId)}/simulate`),
380
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/payments/${core.url.encodePathParam(paymentId)}/simulate`),
380
381
  method: "POST",
381
382
  headers: _headers,
382
383
  contentType: "application/json",
383
384
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
384
385
  requestType: "json",
385
386
  body: _body,
386
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
387
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
387
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
388
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
388
389
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
389
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
390
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
390
391
  logging: this._options.logging,
391
392
  });
392
393
  if (_response.ok) {
@@ -11,7 +11,7 @@ export interface CryptopayCreatePaymentRequest {
11
11
  isTest?: boolean;
12
12
  metadata?: Record<string, unknown>;
13
13
  paymentWindowSeconds?: number;
14
- redirect?: SuwardSDK.CryptopayRedirectConfigDto;
14
+ redirectConfig?: SuwardSDK.CryptopayRedirectConfigDto;
15
15
  underpaymentTolerance?: string;
16
16
  webhookUrl?: string;
17
17
  }
@@ -9,7 +9,7 @@ export declare namespace StaticWalletsClient {
9
9
  }
10
10
  export declare class StaticWalletsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<StaticWalletsClient.Options>;
12
- constructor(options: StaticWalletsClient.Options);
12
+ constructor(options?: StaticWalletsClient.Options);
13
13
  /**
14
14
  * @param {SuwardSDK.GetV1StaticWalletsRequest} request
15
15
  * @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -58,11 +58,12 @@ exports.StaticWalletsClient = void 0;
58
58
  const BaseClient_js_1 = require("../../../../BaseClient.js");
59
59
  const headers_js_1 = require("../../../../core/headers.js");
60
60
  const core = __importStar(require("../../../../core/index.js"));
61
+ const environments = __importStar(require("../../../../environments.js"));
61
62
  const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
62
63
  const errors = __importStar(require("../../../../errors/index.js"));
63
64
  const SuwardSDK = __importStar(require("../../../index.js"));
64
65
  class StaticWalletsClient {
65
- constructor(options) {
66
+ constructor(options = {}) {
66
67
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
67
68
  }
68
69
  /**
@@ -79,7 +80,7 @@ class StaticWalletsClient {
79
80
  }
80
81
  __listStaticWallets() {
81
82
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
82
- var _a, _b, _c, _d, _e, _f, _g, _h;
83
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
83
84
  const { order, limit, lastId } = request;
84
85
  const _queryParams = {
85
86
  order: order != null ? order : undefined,
@@ -89,7 +90,7 @@ class StaticWalletsClient {
89
90
  const _authRequest = yield this._options.authProvider.getAuthRequest();
90
91
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
91
92
  const _response = yield core.fetcher({
92
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "v1/static-wallets"),
93
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, "v1/static-wallets"),
93
94
  method: "GET",
94
95
  headers: _headers,
95
96
  queryString: core.url
@@ -97,10 +98,10 @@ class StaticWalletsClient {
97
98
  .addMany(_queryParams)
98
99
  .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
99
100
  .build(),
100
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
101
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
101
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
102
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
102
103
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
103
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
104
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
104
105
  logging: this._options.logging,
105
106
  });
106
107
  if (_response.ok) {
@@ -141,21 +142,21 @@ class StaticWalletsClient {
141
142
  }
142
143
  __createStaticWallet() {
143
144
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
144
- var _a, _b, _c, _d, _e, _f, _g, _h;
145
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
145
146
  const _authRequest = yield this._options.authProvider.getAuthRequest();
146
147
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
147
148
  const _response = yield core.fetcher({
148
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "v1/static-wallets"),
149
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, "v1/static-wallets"),
149
150
  method: "POST",
150
151
  headers: _headers,
151
152
  contentType: "application/json",
152
153
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
153
154
  requestType: "json",
154
155
  body: request,
155
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
156
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
156
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
157
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
157
158
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
158
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
159
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
159
160
  logging: this._options.logging,
160
161
  });
161
162
  if (_response.ok) {
@@ -197,19 +198,19 @@ class StaticWalletsClient {
197
198
  }
198
199
  __getStaticWallet(request, requestOptions) {
199
200
  return __awaiter(this, void 0, void 0, function* () {
200
- var _a, _b, _c, _d, _e, _f, _g, _h;
201
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
201
202
  const { staticWalletId } = request;
202
203
  const _authRequest = yield this._options.authProvider.getAuthRequest();
203
204
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
204
205
  const _response = yield core.fetcher({
205
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}`),
206
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}`),
206
207
  method: "GET",
207
208
  headers: _headers,
208
209
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
209
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
210
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
210
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
211
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
211
212
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
212
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
213
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
213
214
  logging: this._options.logging,
214
215
  });
215
216
  if (_response.ok) {
@@ -249,19 +250,19 @@ class StaticWalletsClient {
249
250
  }
250
251
  __deleteStaticWallet(request, requestOptions) {
251
252
  return __awaiter(this, void 0, void 0, function* () {
252
- var _a, _b, _c, _d, _e, _f, _g, _h;
253
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
253
254
  const { staticWalletId } = request;
254
255
  const _authRequest = yield this._options.authProvider.getAuthRequest();
255
256
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
256
257
  const _response = yield core.fetcher({
257
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}`),
258
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}`),
258
259
  method: "DELETE",
259
260
  headers: _headers,
260
261
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
261
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
262
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
262
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
263
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
263
264
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
264
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
265
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
265
266
  logging: this._options.logging,
266
267
  });
267
268
  if (_response.ok) {
@@ -298,22 +299,22 @@ class StaticWalletsClient {
298
299
  }
299
300
  __updateStaticWallet(request, requestOptions) {
300
301
  return __awaiter(this, void 0, void 0, function* () {
301
- var _a, _b, _c, _d, _e, _f, _g, _h;
302
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
302
303
  const { staticWalletId } = request, _body = __rest(request, ["staticWalletId"]);
303
304
  const _authRequest = yield this._options.authProvider.getAuthRequest();
304
305
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
305
306
  const _response = yield core.fetcher({
306
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}`),
307
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}`),
307
308
  method: "PATCH",
308
309
  headers: _headers,
309
310
  contentType: "application/json",
310
311
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
311
312
  requestType: "json",
312
313
  body: _body,
313
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
314
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
314
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
315
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
315
316
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
316
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
317
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
317
318
  logging: this._options.logging,
318
319
  });
319
320
  if (_response.ok) {
@@ -353,7 +354,7 @@ class StaticWalletsClient {
353
354
  }
354
355
  __listStaticWalletDeposits(request, requestOptions) {
355
356
  return __awaiter(this, void 0, void 0, function* () {
356
- var _a, _b, _c, _d, _e, _f, _g, _h;
357
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
357
358
  const { staticWalletId, order, limit, lastId } = request;
358
359
  const _queryParams = {
359
360
  order: order != null ? order : undefined,
@@ -363,7 +364,7 @@ class StaticWalletsClient {
363
364
  const _authRequest = yield this._options.authProvider.getAuthRequest();
364
365
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
365
366
  const _response = yield core.fetcher({
366
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}/deposits`),
367
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}/deposits`),
367
368
  method: "GET",
368
369
  headers: _headers,
369
370
  queryString: core.url
@@ -371,10 +372,10 @@ class StaticWalletsClient {
371
372
  .addMany(_queryParams)
372
373
  .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
373
374
  .build(),
374
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
375
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
375
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
376
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
376
377
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
377
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
378
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
378
379
  logging: this._options.logging,
379
380
  });
380
381
  if (_response.ok) {
@@ -417,22 +418,22 @@ class StaticWalletsClient {
417
418
  }
418
419
  __simulateStaticWalletDeposit(request, requestOptions) {
419
420
  return __awaiter(this, void 0, void 0, function* () {
420
- var _a, _b, _c, _d, _e, _f, _g, _h;
421
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
421
422
  const { staticWalletId } = request, _body = __rest(request, ["staticWalletId"]);
422
423
  const _authRequest = yield this._options.authProvider.getAuthRequest();
423
424
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
424
425
  const _response = yield core.fetcher({
425
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}/simulate`),
426
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}/simulate`),
426
427
  method: "POST",
427
428
  headers: _headers,
428
429
  contentType: "application/json",
429
430
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
430
431
  requestType: "json",
431
432
  body: _body,
432
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
433
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
433
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
434
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
434
435
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
435
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
436
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
436
437
  logging: this._options.logging,
437
438
  });
438
439
  if (_response.ok) {
@@ -18,7 +18,7 @@ export interface CryptopayPaymentResponse {
18
18
  networkFee?: string | undefined;
19
19
  paymentWindowSeconds?: number | undefined;
20
20
  projectId?: string | undefined;
21
- redirect?: SuwardSDK.CryptopayRedirectConfigDto | undefined;
21
+ redirectConfig?: SuwardSDK.CryptopayRedirectConfigDto | undefined;
22
22
  status?: SuwardSDK.CryptopayPaymentStatusEnum | undefined;
23
23
  subStatus?: SuwardSDK.CryptopayPaymentSubStatusEnum | undefined;
24
24
  transactions?: SuwardSDK.CryptopayTransactionResponse[] | undefined;
@@ -0,0 +1,4 @@
1
+ export declare const SuwardSDKEnvironment: {
2
+ readonly Default: "https://api.suward.com";
3
+ };
4
+ export type SuwardSDKEnvironment = typeof SuwardSDKEnvironment.Default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SuwardSDKEnvironment = void 0;
5
+ exports.SuwardSDKEnvironment = {
6
+ Default: "https://api.suward.com",
7
+ };
@@ -1,5 +1,6 @@
1
1
  export * as SuwardSDK from "./api/index.js";
2
2
  export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
3
3
  export { SuwardSDKClient } from "./Client.js";
4
+ export { SuwardSDKEnvironment } from "./environments.js";
4
5
  export { SuwardSDKError, SuwardSDKTimeoutError } from "./errors/index.js";
5
6
  export * from "./exports.js";
package/dist/cjs/index.js CHANGED
@@ -36,10 +36,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.SuwardSDKTimeoutError = exports.SuwardSDKError = exports.SuwardSDKClient = exports.SuwardSDK = void 0;
39
+ exports.SuwardSDKTimeoutError = exports.SuwardSDKError = exports.SuwardSDKEnvironment = exports.SuwardSDKClient = exports.SuwardSDK = void 0;
40
40
  exports.SuwardSDK = __importStar(require("./api/index.js"));
41
41
  var Client_js_1 = require("./Client.js");
42
42
  Object.defineProperty(exports, "SuwardSDKClient", { enumerable: true, get: function () { return Client_js_1.SuwardSDKClient; } });
43
+ var environments_js_1 = require("./environments.js");
44
+ Object.defineProperty(exports, "SuwardSDKEnvironment", { enumerable: true, get: function () { return environments_js_1.SuwardSDKEnvironment; } });
43
45
  var index_js_1 = require("./errors/index.js");
44
46
  Object.defineProperty(exports, "SuwardSDKError", { enumerable: true, get: function () { return index_js_1.SuwardSDKError; } });
45
47
  Object.defineProperty(exports, "SuwardSDKTimeoutError", { enumerable: true, get: function () { return index_js_1.SuwardSDKTimeoutError; } });
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.16";
1
+ export declare const SDK_VERSION = "0.0.18";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.16";
4
+ exports.SDK_VERSION = "0.0.18";
@@ -1,8 +1,9 @@
1
1
  import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.mjs";
2
2
  import * as core from "./core/index.mjs";
3
+ import type * as environments from "./environments.mjs";
3
4
  export type AuthOption = false | core.AuthProvider["getAuthRequest"] | core.AuthProvider | HeaderAuthProvider.AuthOptions;
4
5
  export type BaseClientOptions = {
5
- environment: core.Supplier<string>;
6
+ environment?: core.Supplier<environments.SuwardSDKEnvironment | string>;
6
7
  /** Specify a custom URL to connect the client to. */
7
8
  baseUrl?: core.Supplier<string>;
8
9
  /** Additional headers to include in requests. */
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "pkg-sdk-test",
9
- "X-Fern-SDK-Version": "0.0.16",
10
- "User-Agent": "pkg-sdk-test/0.0.16",
9
+ "X-Fern-SDK-Version": "0.0.18",
10
+ "User-Agent": "pkg-sdk-test/0.0.18",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -12,7 +12,7 @@ export declare class SuwardSDKClient {
12
12
  protected readonly _options: NormalizedClientOptionsWithAuth<SuwardSDKClient.Options>;
13
13
  protected _payments: PaymentsClient | undefined;
14
14
  protected _staticWallets: StaticWalletsClient | undefined;
15
- constructor(options: SuwardSDKClient.Options);
15
+ constructor(options?: SuwardSDKClient.Options);
16
16
  get payments(): PaymentsClient;
17
17
  get staticWallets(): StaticWalletsClient;
18
18
  /**
@@ -13,7 +13,7 @@ import { StaticWalletsClient } from "./api/resources/staticWallets/client/Client
13
13
  import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
14
14
  import * as core from "./core/index.mjs";
15
15
  export class SuwardSDKClient {
16
- constructor(options) {
16
+ constructor(options = {}) {
17
17
  this._options = normalizeClientOptionsWithAuth(options);
18
18
  }
19
19
  get payments() {
@@ -9,7 +9,7 @@ export declare namespace PaymentsClient {
9
9
  }
10
10
  export declare class PaymentsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<PaymentsClient.Options>;
12
- constructor(options: PaymentsClient.Options);
12
+ constructor(options?: PaymentsClient.Options);
13
13
  /**
14
14
  * List payments for a project
15
15
  *
@@ -22,11 +22,12 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
23
23
  import { mergeHeaders } from "../../../../core/headers.mjs";
24
24
  import * as core from "../../../../core/index.mjs";
25
+ import * as environments from "../../../../environments.mjs";
25
26
  import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
26
27
  import * as errors from "../../../../errors/index.mjs";
27
28
  import * as SuwardSDK from "../../../index.mjs";
28
29
  export class PaymentsClient {
29
- constructor(options) {
30
+ constructor(options = {}) {
30
31
  this._options = normalizeClientOptionsWithAuth(options);
31
32
  }
32
33
  /**
@@ -47,7 +48,7 @@ export class PaymentsClient {
47
48
  }
48
49
  __listPayments() {
49
50
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
50
- var _a, _b, _c, _d, _e, _f, _g, _h;
51
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
51
52
  const { order, limit, lastId } = request;
52
53
  const _queryParams = {
53
54
  order: order != null ? order : undefined,
@@ -57,7 +58,7 @@ export class PaymentsClient {
57
58
  const _authRequest = yield this._options.authProvider.getAuthRequest();
58
59
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
59
60
  const _response = yield core.fetcher({
60
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "v1/payments"),
61
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, "v1/payments"),
61
62
  method: "GET",
62
63
  headers: _headers,
63
64
  queryString: core.url
@@ -65,10 +66,10 @@ export class PaymentsClient {
65
66
  .addMany(_queryParams)
66
67
  .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
67
68
  .build(),
68
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
69
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
69
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
70
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
70
71
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
71
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
72
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
72
73
  logging: this._options.logging,
73
74
  });
74
75
  if (_response.ok) {
@@ -114,21 +115,21 @@ export class PaymentsClient {
114
115
  }
115
116
  __createPayment() {
116
117
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
117
- var _a, _b, _c, _d, _e, _f, _g, _h;
118
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
118
119
  const _authRequest = yield this._options.authProvider.getAuthRequest();
119
120
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
120
121
  const _response = yield core.fetcher({
121
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "v1/payments"),
122
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, "v1/payments"),
122
123
  method: "POST",
123
124
  headers: _headers,
124
125
  contentType: "application/json",
125
126
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
126
127
  requestType: "json",
127
128
  body: request,
128
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
129
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
129
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
130
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
130
131
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
131
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
132
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
132
133
  logging: this._options.logging,
133
134
  });
134
135
  if (_response.ok) {
@@ -172,19 +173,19 @@ export class PaymentsClient {
172
173
  }
173
174
  __getPayment(request, requestOptions) {
174
175
  return __awaiter(this, void 0, void 0, function* () {
175
- var _a, _b, _c, _d, _e, _f, _g, _h;
176
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
176
177
  const { paymentId } = request;
177
178
  const _authRequest = yield this._options.authProvider.getAuthRequest();
178
179
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
179
180
  const _response = yield core.fetcher({
180
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/payments/${core.url.encodePathParam(paymentId)}`),
181
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/payments/${core.url.encodePathParam(paymentId)}`),
181
182
  method: "GET",
182
183
  headers: _headers,
183
184
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
184
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
185
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
185
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
186
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
186
187
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
187
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
188
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
188
189
  logging: this._options.logging,
189
190
  });
190
191
  if (_response.ok) {
@@ -226,18 +227,18 @@ export class PaymentsClient {
226
227
  }
227
228
  __activatePayment(request, requestOptions) {
228
229
  return __awaiter(this, void 0, void 0, function* () {
229
- var _a, _b, _c, _d, _e, _f, _g, _h;
230
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
230
231
  const { paymentId } = request;
231
232
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
232
233
  const _response = yield core.fetcher({
233
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/payments/${core.url.encodePathParam(paymentId)}/activate`),
234
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/payments/${core.url.encodePathParam(paymentId)}/activate`),
234
235
  method: "POST",
235
236
  headers: _headers,
236
237
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
237
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
238
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
238
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
239
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
239
240
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
240
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
241
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
241
242
  logging: this._options.logging,
242
243
  });
243
244
  if (_response.ok) {
@@ -280,19 +281,19 @@ export class PaymentsClient {
280
281
  }
281
282
  __cancelPayment(request, requestOptions) {
282
283
  return __awaiter(this, void 0, void 0, function* () {
283
- var _a, _b, _c, _d, _e, _f, _g, _h;
284
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
284
285
  const { paymentId } = request;
285
286
  const _authRequest = yield this._options.authProvider.getAuthRequest();
286
287
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
287
288
  const _response = yield core.fetcher({
288
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/payments/${core.url.encodePathParam(paymentId)}/cancel`),
289
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/payments/${core.url.encodePathParam(paymentId)}/cancel`),
289
290
  method: "POST",
290
291
  headers: _headers,
291
292
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
292
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
293
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
293
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
294
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
294
295
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
295
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
296
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
296
297
  logging: this._options.logging,
297
298
  });
298
299
  if (_response.ok) {
@@ -335,22 +336,22 @@ export class PaymentsClient {
335
336
  }
336
337
  __simulatePayment(request, requestOptions) {
337
338
  return __awaiter(this, void 0, void 0, function* () {
338
- var _a, _b, _c, _d, _e, _f, _g, _h;
339
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
339
340
  const { paymentId } = request, _body = __rest(request, ["paymentId"]);
340
341
  const _authRequest = yield this._options.authProvider.getAuthRequest();
341
342
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
342
343
  const _response = yield core.fetcher({
343
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/payments/${core.url.encodePathParam(paymentId)}/simulate`),
344
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/payments/${core.url.encodePathParam(paymentId)}/simulate`),
344
345
  method: "POST",
345
346
  headers: _headers,
346
347
  contentType: "application/json",
347
348
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
348
349
  requestType: "json",
349
350
  body: _body,
350
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
351
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
351
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
352
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
352
353
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
353
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
354
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
354
355
  logging: this._options.logging,
355
356
  });
356
357
  if (_response.ok) {
@@ -11,7 +11,7 @@ export interface CryptopayCreatePaymentRequest {
11
11
  isTest?: boolean;
12
12
  metadata?: Record<string, unknown>;
13
13
  paymentWindowSeconds?: number;
14
- redirect?: SuwardSDK.CryptopayRedirectConfigDto;
14
+ redirectConfig?: SuwardSDK.CryptopayRedirectConfigDto;
15
15
  underpaymentTolerance?: string;
16
16
  webhookUrl?: string;
17
17
  }
@@ -9,7 +9,7 @@ export declare namespace StaticWalletsClient {
9
9
  }
10
10
  export declare class StaticWalletsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<StaticWalletsClient.Options>;
12
- constructor(options: StaticWalletsClient.Options);
12
+ constructor(options?: StaticWalletsClient.Options);
13
13
  /**
14
14
  * @param {SuwardSDK.GetV1StaticWalletsRequest} request
15
15
  * @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -22,11 +22,12 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
23
23
  import { mergeHeaders } from "../../../../core/headers.mjs";
24
24
  import * as core from "../../../../core/index.mjs";
25
+ import * as environments from "../../../../environments.mjs";
25
26
  import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
26
27
  import * as errors from "../../../../errors/index.mjs";
27
28
  import * as SuwardSDK from "../../../index.mjs";
28
29
  export class StaticWalletsClient {
29
- constructor(options) {
30
+ constructor(options = {}) {
30
31
  this._options = normalizeClientOptionsWithAuth(options);
31
32
  }
32
33
  /**
@@ -43,7 +44,7 @@ export class StaticWalletsClient {
43
44
  }
44
45
  __listStaticWallets() {
45
46
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
46
- var _a, _b, _c, _d, _e, _f, _g, _h;
47
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
47
48
  const { order, limit, lastId } = request;
48
49
  const _queryParams = {
49
50
  order: order != null ? order : undefined,
@@ -53,7 +54,7 @@ export class StaticWalletsClient {
53
54
  const _authRequest = yield this._options.authProvider.getAuthRequest();
54
55
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
55
56
  const _response = yield core.fetcher({
56
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "v1/static-wallets"),
57
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, "v1/static-wallets"),
57
58
  method: "GET",
58
59
  headers: _headers,
59
60
  queryString: core.url
@@ -61,10 +62,10 @@ export class StaticWalletsClient {
61
62
  .addMany(_queryParams)
62
63
  .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
63
64
  .build(),
64
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
65
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
65
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
66
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
66
67
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
67
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
68
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
68
69
  logging: this._options.logging,
69
70
  });
70
71
  if (_response.ok) {
@@ -105,21 +106,21 @@ export class StaticWalletsClient {
105
106
  }
106
107
  __createStaticWallet() {
107
108
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
108
- var _a, _b, _c, _d, _e, _f, _g, _h;
109
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
109
110
  const _authRequest = yield this._options.authProvider.getAuthRequest();
110
111
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
111
112
  const _response = yield core.fetcher({
112
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "v1/static-wallets"),
113
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, "v1/static-wallets"),
113
114
  method: "POST",
114
115
  headers: _headers,
115
116
  contentType: "application/json",
116
117
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
117
118
  requestType: "json",
118
119
  body: request,
119
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
120
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
120
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
121
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
121
122
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
122
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
123
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
123
124
  logging: this._options.logging,
124
125
  });
125
126
  if (_response.ok) {
@@ -161,19 +162,19 @@ export class StaticWalletsClient {
161
162
  }
162
163
  __getStaticWallet(request, requestOptions) {
163
164
  return __awaiter(this, void 0, void 0, function* () {
164
- var _a, _b, _c, _d, _e, _f, _g, _h;
165
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
165
166
  const { staticWalletId } = request;
166
167
  const _authRequest = yield this._options.authProvider.getAuthRequest();
167
168
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
168
169
  const _response = yield core.fetcher({
169
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}`),
170
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}`),
170
171
  method: "GET",
171
172
  headers: _headers,
172
173
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
173
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
174
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
174
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
175
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
175
176
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
176
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
177
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
177
178
  logging: this._options.logging,
178
179
  });
179
180
  if (_response.ok) {
@@ -213,19 +214,19 @@ export class StaticWalletsClient {
213
214
  }
214
215
  __deleteStaticWallet(request, requestOptions) {
215
216
  return __awaiter(this, void 0, void 0, function* () {
216
- var _a, _b, _c, _d, _e, _f, _g, _h;
217
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
217
218
  const { staticWalletId } = request;
218
219
  const _authRequest = yield this._options.authProvider.getAuthRequest();
219
220
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
220
221
  const _response = yield core.fetcher({
221
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}`),
222
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}`),
222
223
  method: "DELETE",
223
224
  headers: _headers,
224
225
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
225
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
226
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
226
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
227
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
227
228
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
228
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
229
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
229
230
  logging: this._options.logging,
230
231
  });
231
232
  if (_response.ok) {
@@ -262,22 +263,22 @@ export class StaticWalletsClient {
262
263
  }
263
264
  __updateStaticWallet(request, requestOptions) {
264
265
  return __awaiter(this, void 0, void 0, function* () {
265
- var _a, _b, _c, _d, _e, _f, _g, _h;
266
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
266
267
  const { staticWalletId } = request, _body = __rest(request, ["staticWalletId"]);
267
268
  const _authRequest = yield this._options.authProvider.getAuthRequest();
268
269
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
269
270
  const _response = yield core.fetcher({
270
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}`),
271
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}`),
271
272
  method: "PATCH",
272
273
  headers: _headers,
273
274
  contentType: "application/json",
274
275
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
275
276
  requestType: "json",
276
277
  body: _body,
277
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
278
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
278
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
279
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
279
280
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
280
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
281
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
281
282
  logging: this._options.logging,
282
283
  });
283
284
  if (_response.ok) {
@@ -317,7 +318,7 @@ export class StaticWalletsClient {
317
318
  }
318
319
  __listStaticWalletDeposits(request, requestOptions) {
319
320
  return __awaiter(this, void 0, void 0, function* () {
320
- var _a, _b, _c, _d, _e, _f, _g, _h;
321
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
321
322
  const { staticWalletId, order, limit, lastId } = request;
322
323
  const _queryParams = {
323
324
  order: order != null ? order : undefined,
@@ -327,7 +328,7 @@ export class StaticWalletsClient {
327
328
  const _authRequest = yield this._options.authProvider.getAuthRequest();
328
329
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
329
330
  const _response = yield core.fetcher({
330
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}/deposits`),
331
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}/deposits`),
331
332
  method: "GET",
332
333
  headers: _headers,
333
334
  queryString: core.url
@@ -335,10 +336,10 @@ export class StaticWalletsClient {
335
336
  .addMany(_queryParams)
336
337
  .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
337
338
  .build(),
338
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
339
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
339
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
340
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
340
341
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
341
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
342
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
342
343
  logging: this._options.logging,
343
344
  });
344
345
  if (_response.ok) {
@@ -381,22 +382,22 @@ export class StaticWalletsClient {
381
382
  }
382
383
  __simulateStaticWalletDeposit(request, requestOptions) {
383
384
  return __awaiter(this, void 0, void 0, function* () {
384
- var _a, _b, _c, _d, _e, _f, _g, _h;
385
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
385
386
  const { staticWalletId } = request, _body = __rest(request, ["staticWalletId"]);
386
387
  const _authRequest = yield this._options.authProvider.getAuthRequest();
387
388
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
388
389
  const _response = yield core.fetcher({
389
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}/simulate`),
390
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SuwardSDKEnvironment.Default, `v1/static-wallets/${core.url.encodePathParam(staticWalletId)}/simulate`),
390
391
  method: "POST",
391
392
  headers: _headers,
392
393
  contentType: "application/json",
393
394
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
394
395
  requestType: "json",
395
396
  body: _body,
396
- timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
397
- maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
397
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
398
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
398
399
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
399
- fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
400
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
400
401
  logging: this._options.logging,
401
402
  });
402
403
  if (_response.ok) {
@@ -18,7 +18,7 @@ export interface CryptopayPaymentResponse {
18
18
  networkFee?: string | undefined;
19
19
  paymentWindowSeconds?: number | undefined;
20
20
  projectId?: string | undefined;
21
- redirect?: SuwardSDK.CryptopayRedirectConfigDto | undefined;
21
+ redirectConfig?: SuwardSDK.CryptopayRedirectConfigDto | undefined;
22
22
  status?: SuwardSDK.CryptopayPaymentStatusEnum | undefined;
23
23
  subStatus?: SuwardSDK.CryptopayPaymentSubStatusEnum | undefined;
24
24
  transactions?: SuwardSDK.CryptopayTransactionResponse[] | undefined;
@@ -0,0 +1,4 @@
1
+ export declare const SuwardSDKEnvironment: {
2
+ readonly Default: "https://api.suward.com";
3
+ };
4
+ export type SuwardSDKEnvironment = typeof SuwardSDKEnvironment.Default;
@@ -0,0 +1,4 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export const SuwardSDKEnvironment = {
3
+ Default: "https://api.suward.com",
4
+ };
@@ -1,5 +1,6 @@
1
1
  export * as SuwardSDK from "./api/index.mjs";
2
2
  export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
3
3
  export { SuwardSDKClient } from "./Client.mjs";
4
+ export { SuwardSDKEnvironment } from "./environments.mjs";
4
5
  export { SuwardSDKError, SuwardSDKTimeoutError } from "./errors/index.mjs";
5
6
  export * from "./exports.mjs";
@@ -1,4 +1,5 @@
1
1
  export * as SuwardSDK from "./api/index.mjs";
2
2
  export { SuwardSDKClient } from "./Client.mjs";
3
+ export { SuwardSDKEnvironment } from "./environments.mjs";
3
4
  export { SuwardSDKError, SuwardSDKTimeoutError } from "./errors/index.mjs";
4
5
  export * from "./exports.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.16";
1
+ export declare const SDK_VERSION = "0.0.18";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.16";
1
+ export const SDK_VERSION = "0.0.18";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pkg-sdk-test",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",