pkg-sdk-test 0.0.15 → 0.0.17

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 (111) 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/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/index.js +1 -0
  8. package/dist/cjs/api/resources/payments/client/Client.d.ts +16 -1
  9. package/dist/cjs/api/resources/payments/client/Client.js +82 -28
  10. package/dist/cjs/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.ts +1 -1
  11. package/dist/cjs/api/resources/payments/client/requests/GetV1PaymentsRequest.d.ts +3 -2
  12. package/dist/cjs/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.d.ts +10 -0
  13. package/dist/cjs/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.js +3 -0
  14. package/dist/cjs/api/resources/payments/client/requests/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/payments/types/GetV1PaymentsRequestOrder.d.ts +5 -0
  16. package/dist/cjs/api/resources/payments/types/GetV1PaymentsRequestOrder.js +8 -0
  17. package/dist/cjs/api/resources/payments/types/index.d.ts +1 -0
  18. package/dist/cjs/api/resources/payments/types/index.js +1 -0
  19. package/dist/cjs/api/resources/staticWallets/client/Client.d.ts +3 -2
  20. package/dist/cjs/api/resources/staticWallets/client/Client.js +64 -43
  21. package/dist/cjs/api/resources/staticWallets/client/requests/CryptopayCreateStaticWalletRequest.d.ts +2 -1
  22. package/dist/cjs/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.d.ts +12 -2
  23. package/dist/cjs/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.js +10 -0
  24. package/dist/cjs/api/resources/staticWallets/client/requests/CryptopayUpdateStaticWalletRequest.d.ts +2 -1
  25. package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.d.ts +13 -0
  26. package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.js +3 -0
  27. package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdDepositsRequest.d.ts +7 -0
  28. package/dist/cjs/api/resources/staticWallets/client/requests/index.d.ts +2 -1
  29. package/dist/cjs/api/resources/staticWallets/client/requests/index.js +3 -0
  30. package/dist/cjs/api/resources/staticWallets/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/staticWallets/index.js +1 -0
  32. package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.d.ts +5 -0
  33. package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.js +8 -0
  34. package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.d.ts +5 -0
  35. package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.js +8 -0
  36. package/dist/cjs/api/resources/staticWallets/types/index.d.ts +2 -0
  37. package/dist/cjs/api/resources/staticWallets/types/index.js +18 -0
  38. package/dist/cjs/api/types/CryptopayAssetId.d.ts +32 -0
  39. package/dist/cjs/api/types/CryptopayAssetId.js +35 -0
  40. package/dist/cjs/api/types/CryptopayPaymentResponse.d.ts +1 -1
  41. package/dist/cjs/api/types/CryptopayPublicPaymentResponse.d.ts +1 -1
  42. package/dist/cjs/api/types/CryptopayRedirectConfigDto.d.ts +11 -1
  43. package/dist/cjs/api/types/CryptopayRedirectConfigDto.js +11 -0
  44. package/dist/cjs/api/types/CryptopayStaticDepositResponse.d.ts +13 -2
  45. package/dist/cjs/api/types/CryptopayStaticDepositResponse.js +11 -0
  46. package/dist/cjs/api/types/CryptopayStaticWalletResponse.d.ts +2 -1
  47. package/dist/cjs/api/types/index.d.ts +1 -0
  48. package/dist/cjs/api/types/index.js +1 -0
  49. package/dist/cjs/auth/HeaderAuthProvider.d.ts +1 -1
  50. package/dist/cjs/environments.d.ts +4 -0
  51. package/dist/cjs/environments.js +7 -0
  52. package/dist/cjs/index.d.ts +1 -0
  53. package/dist/cjs/index.js +3 -1
  54. package/dist/cjs/version.d.ts +1 -1
  55. package/dist/cjs/version.js +1 -1
  56. package/dist/esm/BaseClient.d.mts +2 -1
  57. package/dist/esm/BaseClient.mjs +2 -2
  58. package/dist/esm/Client.d.mts +1 -1
  59. package/dist/esm/Client.mjs +1 -1
  60. package/dist/esm/api/resources/index.d.mts +1 -0
  61. package/dist/esm/api/resources/index.mjs +1 -0
  62. package/dist/esm/api/resources/payments/client/Client.d.mts +16 -1
  63. package/dist/esm/api/resources/payments/client/Client.mjs +82 -28
  64. package/dist/esm/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.mts +1 -1
  65. package/dist/esm/api/resources/payments/client/requests/GetV1PaymentsRequest.d.mts +3 -2
  66. package/dist/esm/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.d.mts +10 -0
  67. package/dist/esm/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.mjs +2 -0
  68. package/dist/esm/api/resources/payments/client/requests/index.d.mts +1 -0
  69. package/dist/esm/api/resources/payments/types/GetV1PaymentsRequestOrder.d.mts +5 -0
  70. package/dist/esm/api/resources/payments/types/GetV1PaymentsRequestOrder.mjs +5 -0
  71. package/dist/esm/api/resources/payments/types/index.d.mts +1 -0
  72. package/dist/esm/api/resources/payments/types/index.mjs +1 -0
  73. package/dist/esm/api/resources/staticWallets/client/Client.d.mts +3 -2
  74. package/dist/esm/api/resources/staticWallets/client/Client.mjs +64 -43
  75. package/dist/esm/api/resources/staticWallets/client/requests/CryptopayCreateStaticWalletRequest.d.mts +2 -1
  76. package/dist/esm/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.d.mts +12 -2
  77. package/dist/esm/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.mjs +9 -1
  78. package/dist/esm/api/resources/staticWallets/client/requests/CryptopayUpdateStaticWalletRequest.d.mts +2 -1
  79. package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.d.mts +13 -0
  80. package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.mjs +2 -0
  81. package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdDepositsRequest.d.mts +7 -0
  82. package/dist/esm/api/resources/staticWallets/client/requests/index.d.mts +2 -1
  83. package/dist/esm/api/resources/staticWallets/client/requests/index.mjs +1 -1
  84. package/dist/esm/api/resources/staticWallets/index.d.mts +1 -0
  85. package/dist/esm/api/resources/staticWallets/index.mjs +1 -0
  86. package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.d.mts +5 -0
  87. package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.mjs +5 -0
  88. package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.d.mts +5 -0
  89. package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.mjs +5 -0
  90. package/dist/esm/api/resources/staticWallets/types/index.d.mts +2 -0
  91. package/dist/esm/api/resources/staticWallets/types/index.mjs +2 -0
  92. package/dist/esm/api/types/CryptopayAssetId.d.mts +32 -0
  93. package/dist/esm/api/types/CryptopayAssetId.mjs +32 -0
  94. package/dist/esm/api/types/CryptopayPaymentResponse.d.mts +1 -1
  95. package/dist/esm/api/types/CryptopayPublicPaymentResponse.d.mts +1 -1
  96. package/dist/esm/api/types/CryptopayRedirectConfigDto.d.mts +11 -1
  97. package/dist/esm/api/types/CryptopayRedirectConfigDto.mjs +10 -1
  98. package/dist/esm/api/types/CryptopayStaticDepositResponse.d.mts +13 -2
  99. package/dist/esm/api/types/CryptopayStaticDepositResponse.mjs +10 -1
  100. package/dist/esm/api/types/CryptopayStaticWalletResponse.d.mts +2 -1
  101. package/dist/esm/api/types/index.d.mts +1 -0
  102. package/dist/esm/api/types/index.mjs +1 -0
  103. package/dist/esm/auth/HeaderAuthProvider.d.mts +1 -1
  104. package/dist/esm/environments.d.mts +4 -0
  105. package/dist/esm/environments.mjs +4 -0
  106. package/dist/esm/index.d.mts +1 -0
  107. package/dist/esm/index.mjs +1 -0
  108. package/dist/esm/version.d.mts +1 -1
  109. package/dist/esm/version.mjs +1 -1
  110. package/package.json +1 -1
  111. package/reference.md +74 -1
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ControllerErrorResponse.js"), exports);
18
+ __exportStar(require("./CryptopayAssetId.js"), exports);
18
19
  __exportStar(require("./CryptopayListPaymentsResponse.js"), exports);
19
20
  __exportStar(require("./CryptopayListStaticDepositsResponse.js"), exports);
20
21
  __exportStar(require("./CryptopayListStaticWalletsResponse.js"), exports);
@@ -13,7 +13,7 @@ export declare namespace HeaderAuthProvider {
13
13
  const AUTH_CONFIG_ERROR_MESSAGE: string;
14
14
  type Options = AuthOptions;
15
15
  type AuthOptions = {
16
- [PARAM_KEY]: core.Supplier<string>;
16
+ [PARAM_KEY]?: core.Supplier<string>;
17
17
  };
18
18
  function createInstance(options: Options): core.AuthProvider;
19
19
  }
@@ -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.15";
1
+ export declare const SDK_VERSION = "0.0.17";
@@ -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.15";
4
+ exports.SDK_VERSION = "0.0.17";
@@ -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.15",
10
- "User-Agent": "pkg-sdk-test/0.0.15",
9
+ "X-Fern-SDK-Version": "0.0.17",
10
+ "User-Agent": "pkg-sdk-test/0.0.17",
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() {
@@ -3,3 +3,4 @@ export * as payments from "./payments/index.mjs";
3
3
  export * from "./payments/types/index.mjs";
4
4
  export * from "./staticWallets/client/requests/index.mjs";
5
5
  export * as staticWallets from "./staticWallets/index.mjs";
6
+ export * from "./staticWallets/types/index.mjs";
@@ -3,3 +3,4 @@ export * as payments from "./payments/index.mjs";
3
3
  export * from "./payments/types/index.mjs";
4
4
  export * from "./staticWallets/client/requests/index.mjs";
5
5
  export * as staticWallets from "./staticWallets/index.mjs";
6
+ export * from "./staticWallets/types/index.mjs";
@@ -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
  *
@@ -56,6 +56,21 @@ export declare class PaymentsClient {
56
56
  */
57
57
  getPayment(request: SuwardSDK.GetV1PaymentsPaymentIdRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.GetV1PaymentsPaymentIdResponse>;
58
58
  private __getPayment;
59
+ /**
60
+ * Activate a payment (public, customer-facing)
61
+ *
62
+ * @param {SuwardSDK.PostV1PaymentsPaymentIdActivateRequest} request
63
+ * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
64
+ *
65
+ * @throws {@link SuwardSDK.InternalServerError}
66
+ *
67
+ * @example
68
+ * await client.payments.activatePayment({
69
+ * paymentId: "paymentId"
70
+ * })
71
+ */
72
+ activatePayment(request: SuwardSDK.PostV1PaymentsPaymentIdActivateRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayPublicPaymentResponse>;
73
+ private __activatePayment;
59
74
  /**
60
75
  * Cancel a payment
61
76
  *
@@ -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,17 +48,17 @@ 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
- const { ordeddddr, limit, lastId } = request;
51
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
52
+ const { order, limit, lastId } = request;
52
53
  const _queryParams = {
53
- ordeddddr,
54
+ order: order != null ? order : undefined,
54
55
  limit,
55
56
  lastId,
56
57
  };
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) {
@@ -208,6 +209,59 @@ export class PaymentsClient {
208
209
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/payments/{paymentId}");
209
210
  });
210
211
  }
212
+ /**
213
+ * Activate a payment (public, customer-facing)
214
+ *
215
+ * @param {SuwardSDK.PostV1PaymentsPaymentIdActivateRequest} request
216
+ * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
217
+ *
218
+ * @throws {@link SuwardSDK.InternalServerError}
219
+ *
220
+ * @example
221
+ * await client.payments.activatePayment({
222
+ * paymentId: "paymentId"
223
+ * })
224
+ */
225
+ activatePayment(request, requestOptions) {
226
+ return core.HttpResponsePromise.fromPromise(this.__activatePayment(request, requestOptions));
227
+ }
228
+ __activatePayment(request, requestOptions) {
229
+ return __awaiter(this, void 0, void 0, function* () {
230
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
231
+ const { paymentId } = request;
232
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
233
+ const _response = yield core.fetcher({
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`),
235
+ method: "POST",
236
+ headers: _headers,
237
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
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,
240
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
241
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
242
+ logging: this._options.logging,
243
+ });
244
+ if (_response.ok) {
245
+ return {
246
+ data: _response.body,
247
+ rawResponse: _response.rawResponse,
248
+ };
249
+ }
250
+ if (_response.error.reason === "status-code") {
251
+ switch (_response.error.statusCode) {
252
+ case 500:
253
+ throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
254
+ default:
255
+ throw new errors.SuwardSDKError({
256
+ statusCode: _response.error.statusCode,
257
+ body: _response.error.body,
258
+ rawResponse: _response.rawResponse,
259
+ });
260
+ }
261
+ }
262
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/payments/{paymentId}/activate");
263
+ });
264
+ }
211
265
  /**
212
266
  * Cancel a payment
213
267
  *
@@ -227,19 +281,19 @@ export class PaymentsClient {
227
281
  }
228
282
  __cancelPayment(request, requestOptions) {
229
283
  return __awaiter(this, void 0, void 0, function* () {
230
- var _a, _b, _c, _d, _e, _f, _g, _h;
284
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
231
285
  const { paymentId } = request;
232
286
  const _authRequest = yield this._options.authProvider.getAuthRequest();
233
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);
234
288
  const _response = yield core.fetcher({
235
- 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`),
236
290
  method: "POST",
237
291
  headers: _headers,
238
292
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
239
- 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,
240
- 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,
241
295
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
242
- 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,
243
297
  logging: this._options.logging,
244
298
  });
245
299
  if (_response.ok) {
@@ -282,22 +336,22 @@ export class PaymentsClient {
282
336
  }
283
337
  __simulatePayment(request, requestOptions) {
284
338
  return __awaiter(this, void 0, void 0, function* () {
285
- var _a, _b, _c, _d, _e, _f, _g, _h;
339
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
286
340
  const { paymentId } = request, _body = __rest(request, ["paymentId"]);
287
341
  const _authRequest = yield this._options.authProvider.getAuthRequest();
288
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);
289
343
  const _response = yield core.fetcher({
290
- 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`),
291
345
  method: "POST",
292
346
  headers: _headers,
293
347
  contentType: "application/json",
294
348
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
295
349
  requestType: "json",
296
350
  body: _body,
297
- 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,
298
- 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,
299
353
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
300
- 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,
301
355
  logging: this._options.logging,
302
356
  });
303
357
  if (_response.ok) {
@@ -6,7 +6,7 @@ import type * as SuwardSDK from "../../../../index.mjs";
6
6
  export interface CryptopayCreatePaymentRequest {
7
7
  activationFlowSeconds?: number;
8
8
  amount?: string;
9
- asset?: string;
9
+ asset?: SuwardSDK.CryptopayAssetId;
10
10
  externalId?: string;
11
11
  isTest?: boolean;
12
12
  metadata?: Record<string, unknown>;
@@ -1,11 +1,12 @@
1
+ import type * as SuwardSDK from "../../../../index.mjs";
1
2
  /**
2
3
  * @example
3
4
  * {}
4
5
  */
5
6
  export interface GetV1PaymentsRequest {
6
7
  /** Sort order (asc/desc) */
7
- ordeddddr?: string;
8
- /** Limit (default 100) */
8
+ order?: SuwardSDK.GetV1PaymentsRequestOrder;
9
+ /** Limit (default 20, max 100) */
9
10
  limit?: number;
10
11
  /** Last ID for pagination */
11
12
  lastId?: string;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * paymentId: "paymentId"
5
+ * }
6
+ */
7
+ export interface PostV1PaymentsPaymentIdActivateRequest {
8
+ /** Payment ID */
9
+ paymentId: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -2,4 +2,5 @@ export type { CryptopayCreatePaymentRequest } from "./CryptopayCreatePaymentRequ
2
2
  export type { CryptopaySimulatePaymentRequest } from "./CryptopaySimulatePaymentRequest.mjs";
3
3
  export type { GetV1PaymentsPaymentIdRequest } from "./GetV1PaymentsPaymentIdRequest.mjs";
4
4
  export type { GetV1PaymentsRequest } from "./GetV1PaymentsRequest.mjs";
5
+ export type { PostV1PaymentsPaymentIdActivateRequest } from "./PostV1PaymentsPaymentIdActivateRequest.mjs";
5
6
  export type { PostV1PaymentsPaymentIdCancelRequest } from "./PostV1PaymentsPaymentIdCancelRequest.mjs";
@@ -0,0 +1,5 @@
1
+ export declare const GetV1PaymentsRequestOrder: {
2
+ readonly Asc: "asc";
3
+ readonly Desc: "desc";
4
+ };
5
+ export type GetV1PaymentsRequestOrder = (typeof GetV1PaymentsRequestOrder)[keyof typeof GetV1PaymentsRequestOrder];
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export const GetV1PaymentsRequestOrder = {
3
+ Asc: "asc",
4
+ Desc: "desc",
5
+ };
@@ -1 +1,2 @@
1
1
  export * from "./GetV1PaymentsPaymentIdResponse.mjs";
2
+ export * from "./GetV1PaymentsRequestOrder.mjs";
@@ -1 +1,2 @@
1
1
  export * from "./GetV1PaymentsPaymentIdResponse.mjs";
2
+ export * from "./GetV1PaymentsRequestOrder.mjs";
@@ -9,8 +9,9 @@ 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
+ * @param {SuwardSDK.GetV1StaticWalletsRequest} request
14
15
  * @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
15
16
  *
16
17
  * @throws {@link SuwardSDK.UnauthorizedError}
@@ -18,7 +19,7 @@ export declare class StaticWalletsClient {
18
19
  * @example
19
20
  * await client.staticWallets.listStaticWallets()
20
21
  */
21
- listStaticWallets(requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayListStaticWalletsResponse>;
22
+ listStaticWallets(request?: SuwardSDK.GetV1StaticWalletsRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayListStaticWalletsResponse>;
22
23
  private __listStaticWallets;
23
24
  /**
24
25
  * Create a reusable deposit address with an accepted-asset allow-list