pkg-sdk-test 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.js +1 -0
- package/dist/cjs/api/resources/payments/client/Client.d.ts +15 -0
- package/dist/cjs/api/resources/payments/client/Client.js +55 -2
- package/dist/cjs/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.ts +1 -1
- package/dist/cjs/api/resources/payments/client/requests/GetV1PaymentsRequest.d.ts +3 -2
- package/dist/cjs/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.d.ts +10 -0
- package/dist/cjs/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.js +3 -0
- package/dist/cjs/api/resources/payments/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/payments/types/GetV1PaymentsRequestOrder.d.ts +5 -0
- package/dist/cjs/api/resources/payments/types/GetV1PaymentsRequestOrder.js +8 -0
- package/dist/cjs/api/resources/payments/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/payments/types/index.js +1 -0
- package/dist/cjs/api/resources/staticWallets/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/staticWallets/client/Client.js +27 -7
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopayCreateStaticWalletRequest.d.ts +2 -1
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.d.ts +12 -2
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.js +10 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopayUpdateStaticWalletRequest.d.ts +2 -1
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.d.ts +13 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.js +3 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdDepositsRequest.d.ts +7 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/staticWallets/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/staticWallets/index.d.ts +1 -0
- package/dist/cjs/api/resources/staticWallets/index.js +1 -0
- package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.d.ts +5 -0
- package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.js +8 -0
- package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.d.ts +5 -0
- package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.js +8 -0
- package/dist/cjs/api/resources/staticWallets/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/staticWallets/types/index.js +18 -0
- package/dist/cjs/api/types/CryptopayAssetId.d.ts +32 -0
- package/dist/cjs/api/types/CryptopayAssetId.js +35 -0
- package/dist/cjs/api/types/CryptopayPaymentResponse.d.ts +1 -1
- package/dist/cjs/api/types/CryptopayPublicPaymentResponse.d.ts +1 -1
- package/dist/cjs/api/types/CryptopayRedirectConfigDto.d.ts +11 -1
- package/dist/cjs/api/types/CryptopayRedirectConfigDto.js +11 -0
- package/dist/cjs/api/types/CryptopayStaticDepositResponse.d.ts +13 -2
- package/dist/cjs/api/types/CryptopayStaticDepositResponse.js +11 -0
- package/dist/cjs/api/types/CryptopayStaticWalletResponse.d.ts +2 -1
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/index.mjs +1 -0
- package/dist/esm/api/resources/payments/client/Client.d.mts +15 -0
- package/dist/esm/api/resources/payments/client/Client.mjs +55 -2
- package/dist/esm/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.mts +1 -1
- package/dist/esm/api/resources/payments/client/requests/GetV1PaymentsRequest.d.mts +3 -2
- package/dist/esm/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.d.mts +10 -0
- package/dist/esm/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.mjs +2 -0
- package/dist/esm/api/resources/payments/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/payments/types/GetV1PaymentsRequestOrder.d.mts +5 -0
- package/dist/esm/api/resources/payments/types/GetV1PaymentsRequestOrder.mjs +5 -0
- package/dist/esm/api/resources/payments/types/index.d.mts +1 -0
- package/dist/esm/api/resources/payments/types/index.mjs +1 -0
- package/dist/esm/api/resources/staticWallets/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/staticWallets/client/Client.mjs +27 -7
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopayCreateStaticWalletRequest.d.mts +2 -1
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.d.mts +12 -2
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.mjs +9 -1
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopayUpdateStaticWalletRequest.d.mts +2 -1
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.d.mts +13 -0
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.mjs +2 -0
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdDepositsRequest.d.mts +7 -0
- package/dist/esm/api/resources/staticWallets/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/staticWallets/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/staticWallets/index.d.mts +1 -0
- package/dist/esm/api/resources/staticWallets/index.mjs +1 -0
- package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.d.mts +5 -0
- package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.mjs +5 -0
- package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.d.mts +5 -0
- package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.mjs +5 -0
- package/dist/esm/api/resources/staticWallets/types/index.d.mts +2 -0
- package/dist/esm/api/resources/staticWallets/types/index.mjs +2 -0
- package/dist/esm/api/types/CryptopayAssetId.d.mts +32 -0
- package/dist/esm/api/types/CryptopayAssetId.mjs +32 -0
- package/dist/esm/api/types/CryptopayPaymentResponse.d.mts +1 -1
- package/dist/esm/api/types/CryptopayPublicPaymentResponse.d.mts +1 -1
- package/dist/esm/api/types/CryptopayRedirectConfigDto.d.mts +11 -1
- package/dist/esm/api/types/CryptopayRedirectConfigDto.mjs +10 -1
- package/dist/esm/api/types/CryptopayStaticDepositResponse.d.mts +13 -2
- package/dist/esm/api/types/CryptopayStaticDepositResponse.mjs +10 -1
- package/dist/esm/api/types/CryptopayStaticWalletResponse.d.mts +2 -1
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/auth/HeaderAuthProvider.d.mts +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +74 -1
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CryptopayStaticDepositResponse = void 0;
|
|
5
|
+
var CryptopayStaticDepositResponse;
|
|
6
|
+
(function (CryptopayStaticDepositResponse) {
|
|
7
|
+
CryptopayStaticDepositResponse.Status = {
|
|
8
|
+
Detected: "detected",
|
|
9
|
+
Accepted: "accepted",
|
|
10
|
+
Confirmed: "confirmed",
|
|
11
|
+
Ignored: "ignored",
|
|
12
|
+
Invalidated: "invalidated",
|
|
13
|
+
};
|
|
14
|
+
})(CryptopayStaticDepositResponse || (exports.CryptopayStaticDepositResponse = CryptopayStaticDepositResponse = {}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type * as SuwardSDK from "../index.js";
|
|
1
2
|
export interface CryptopayStaticWalletResponse {
|
|
2
3
|
address?: string | undefined;
|
|
3
|
-
allowedAssets?:
|
|
4
|
+
allowedAssets?: SuwardSDK.CryptopayAssetId[] | undefined;
|
|
4
5
|
createdAt?: number | undefined;
|
|
5
6
|
externalId?: string | undefined;
|
|
6
7
|
id?: string | undefined;
|
|
@@ -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]
|
|
16
|
+
[PARAM_KEY]?: core.Supplier<string>;
|
|
17
17
|
};
|
|
18
18
|
function createInstance(options: Options): core.AuthProvider;
|
|
19
19
|
}
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.16";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -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.
|
|
10
|
-
"User-Agent": "pkg-sdk-test/0.0.
|
|
9
|
+
"X-Fern-SDK-Version": "0.0.16",
|
|
10
|
+
"User-Agent": "pkg-sdk-test/0.0.16",
|
|
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);
|
|
@@ -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
|
*
|
|
@@ -48,9 +48,9 @@ export class PaymentsClient {
|
|
|
48
48
|
__listPayments() {
|
|
49
49
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
50
50
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
51
|
-
const {
|
|
51
|
+
const { order, limit, lastId } = request;
|
|
52
52
|
const _queryParams = {
|
|
53
|
-
|
|
53
|
+
order: order != null ? order : undefined,
|
|
54
54
|
limit,
|
|
55
55
|
lastId,
|
|
56
56
|
};
|
|
@@ -208,6 +208,59 @@ export class PaymentsClient {
|
|
|
208
208
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/payments/{paymentId}");
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Activate a payment (public, customer-facing)
|
|
213
|
+
*
|
|
214
|
+
* @param {SuwardSDK.PostV1PaymentsPaymentIdActivateRequest} request
|
|
215
|
+
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
216
|
+
*
|
|
217
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* await client.payments.activatePayment({
|
|
221
|
+
* paymentId: "paymentId"
|
|
222
|
+
* })
|
|
223
|
+
*/
|
|
224
|
+
activatePayment(request, requestOptions) {
|
|
225
|
+
return core.HttpResponsePromise.fromPromise(this.__activatePayment(request, requestOptions));
|
|
226
|
+
}
|
|
227
|
+
__activatePayment(request, requestOptions) {
|
|
228
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
229
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
230
|
+
const { paymentId } = request;
|
|
231
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
232
|
+
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
|
+
method: "POST",
|
|
235
|
+
headers: _headers,
|
|
236
|
+
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,
|
|
239
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
240
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
241
|
+
logging: this._options.logging,
|
|
242
|
+
});
|
|
243
|
+
if (_response.ok) {
|
|
244
|
+
return {
|
|
245
|
+
data: _response.body,
|
|
246
|
+
rawResponse: _response.rawResponse,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
if (_response.error.reason === "status-code") {
|
|
250
|
+
switch (_response.error.statusCode) {
|
|
251
|
+
case 500:
|
|
252
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
253
|
+
default:
|
|
254
|
+
throw new errors.SuwardSDKError({
|
|
255
|
+
statusCode: _response.error.statusCode,
|
|
256
|
+
body: _response.error.body,
|
|
257
|
+
rawResponse: _response.rawResponse,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/payments/{paymentId}/activate");
|
|
262
|
+
});
|
|
263
|
+
}
|
|
211
264
|
/**
|
|
212
265
|
* Cancel a payment
|
|
213
266
|
*
|
|
@@ -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?:
|
|
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
|
-
|
|
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;
|
|
@@ -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";
|
|
@@ -11,6 +11,7 @@ export declare class StaticWalletsClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<StaticWalletsClient.Options>;
|
|
12
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
|
|
@@ -30,6 +30,7 @@ export class StaticWalletsClient {
|
|
|
30
30
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
+
* @param {SuwardSDK.GetV1StaticWalletsRequest} request
|
|
33
34
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
35
|
*
|
|
35
36
|
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
@@ -37,19 +38,29 @@ export class StaticWalletsClient {
|
|
|
37
38
|
* @example
|
|
38
39
|
* await client.staticWallets.listStaticWallets()
|
|
39
40
|
*/
|
|
40
|
-
listStaticWallets(requestOptions) {
|
|
41
|
-
return core.HttpResponsePromise.fromPromise(this.__listStaticWallets(requestOptions));
|
|
41
|
+
listStaticWallets(request = {}, requestOptions) {
|
|
42
|
+
return core.HttpResponsePromise.fromPromise(this.__listStaticWallets(request, requestOptions));
|
|
42
43
|
}
|
|
43
|
-
__listStaticWallets(
|
|
44
|
-
return __awaiter(this,
|
|
44
|
+
__listStaticWallets() {
|
|
45
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
45
46
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
47
|
+
const { order, limit, lastId } = request;
|
|
48
|
+
const _queryParams = {
|
|
49
|
+
order: order != null ? order : undefined,
|
|
50
|
+
limit,
|
|
51
|
+
lastId,
|
|
52
|
+
};
|
|
46
53
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
47
54
|
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);
|
|
48
55
|
const _response = yield core.fetcher({
|
|
49
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"),
|
|
50
57
|
method: "GET",
|
|
51
58
|
headers: _headers,
|
|
52
|
-
queryString: core.url
|
|
59
|
+
queryString: core.url
|
|
60
|
+
.queryBuilder()
|
|
61
|
+
.addMany(_queryParams)
|
|
62
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
63
|
+
.build(),
|
|
53
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,
|
|
54
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,
|
|
55
66
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -307,14 +318,23 @@ export class StaticWalletsClient {
|
|
|
307
318
|
__listStaticWalletDeposits(request, requestOptions) {
|
|
308
319
|
return __awaiter(this, void 0, void 0, function* () {
|
|
309
320
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
310
|
-
const { staticWalletId } = request;
|
|
321
|
+
const { staticWalletId, order, limit, lastId } = request;
|
|
322
|
+
const _queryParams = {
|
|
323
|
+
order: order != null ? order : undefined,
|
|
324
|
+
limit,
|
|
325
|
+
lastId,
|
|
326
|
+
};
|
|
311
327
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
312
328
|
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);
|
|
313
329
|
const _response = yield core.fetcher({
|
|
314
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`),
|
|
315
331
|
method: "GET",
|
|
316
332
|
headers: _headers,
|
|
317
|
-
queryString: core.url
|
|
333
|
+
queryString: core.url
|
|
334
|
+
.queryBuilder()
|
|
335
|
+
.addMany(_queryParams)
|
|
336
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
337
|
+
.build(),
|
|
318
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,
|
|
319
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,
|
|
320
340
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.mjs";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {}
|
|
4
5
|
*/
|
|
5
6
|
export interface CryptopayCreateStaticWalletRequest {
|
|
6
|
-
allowedAssets?:
|
|
7
|
+
allowedAssets?: SuwardSDK.CryptopayAssetId[];
|
|
7
8
|
externalId?: string;
|
|
8
9
|
isTest?: boolean;
|
|
9
10
|
metadata?: Record<string, unknown>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.mjs";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {
|
|
@@ -8,8 +9,17 @@ export interface CryptopaySimulateStaticDepositRequest {
|
|
|
8
9
|
/** Static wallet ID */
|
|
9
10
|
staticWalletId: string;
|
|
10
11
|
amount?: string;
|
|
11
|
-
asset?:
|
|
12
|
-
status?:
|
|
12
|
+
asset?: SuwardSDK.CryptopayAssetId;
|
|
13
|
+
status?: CryptopaySimulateStaticDepositRequest.Status;
|
|
13
14
|
transferIndex?: string;
|
|
14
15
|
txHash?: string;
|
|
15
16
|
}
|
|
17
|
+
export declare namespace CryptopaySimulateStaticDepositRequest {
|
|
18
|
+
const Status: {
|
|
19
|
+
readonly Detected: "detected";
|
|
20
|
+
readonly Accepted: "accepted";
|
|
21
|
+
readonly Confirmed: "confirmed";
|
|
22
|
+
readonly Invalidated: "invalidated";
|
|
23
|
+
};
|
|
24
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
25
|
+
}
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var CryptopaySimulateStaticDepositRequest;
|
|
3
|
+
(function (CryptopaySimulateStaticDepositRequest) {
|
|
4
|
+
CryptopaySimulateStaticDepositRequest.Status = {
|
|
5
|
+
Detected: "detected",
|
|
6
|
+
Accepted: "accepted",
|
|
7
|
+
Confirmed: "confirmed",
|
|
8
|
+
Invalidated: "invalidated",
|
|
9
|
+
};
|
|
10
|
+
})(CryptopaySimulateStaticDepositRequest || (CryptopaySimulateStaticDepositRequest = {}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.mjs";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {
|
|
@@ -7,7 +8,7 @@
|
|
|
7
8
|
export interface CryptopayUpdateStaticWalletRequest {
|
|
8
9
|
/** Static wallet ID */
|
|
9
10
|
staticWalletId: string;
|
|
10
|
-
allowedAssets?:
|
|
11
|
+
allowedAssets?: SuwardSDK.CryptopayAssetId[];
|
|
11
12
|
metadata?: Record<string, unknown>;
|
|
12
13
|
webhookUrl?: string;
|
|
13
14
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {}
|
|
5
|
+
*/
|
|
6
|
+
export interface GetV1StaticWalletsRequest {
|
|
7
|
+
/** Sort order (asc/desc) */
|
|
8
|
+
order?: SuwardSDK.GetV1StaticWalletsRequestOrder;
|
|
9
|
+
/** Limit (default 20, max 100) */
|
|
10
|
+
limit?: number;
|
|
11
|
+
/** Last ID for pagination */
|
|
12
|
+
lastId?: string;
|
|
13
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.mjs";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {
|
|
@@ -7,4 +8,10 @@
|
|
|
7
8
|
export interface GetV1StaticWalletsStaticWalletIdDepositsRequest {
|
|
8
9
|
/** Static wallet ID */
|
|
9
10
|
staticWalletId: string;
|
|
11
|
+
/** Sort order (asc/desc) */
|
|
12
|
+
order?: SuwardSDK.GetV1StaticWalletsStaticWalletIdDepositsRequestOrder;
|
|
13
|
+
/** Limit (default 20, max 100) */
|
|
14
|
+
limit?: number;
|
|
15
|
+
/** Last ID for pagination */
|
|
16
|
+
lastId?: string;
|
|
10
17
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { CryptopayCreateStaticWalletRequest } from "./CryptopayCreateStaticWalletRequest.mjs";
|
|
2
|
-
export
|
|
2
|
+
export { CryptopaySimulateStaticDepositRequest } from "./CryptopaySimulateStaticDepositRequest.mjs";
|
|
3
3
|
export type { CryptopayUpdateStaticWalletRequest } from "./CryptopayUpdateStaticWalletRequest.mjs";
|
|
4
4
|
export type { DeleteV1StaticWalletsStaticWalletIdRequest } from "./DeleteV1StaticWalletsStaticWalletIdRequest.mjs";
|
|
5
|
+
export type { GetV1StaticWalletsRequest } from "./GetV1StaticWalletsRequest.mjs";
|
|
5
6
|
export type { GetV1StaticWalletsStaticWalletIdDepositsRequest } from "./GetV1StaticWalletsStaticWalletIdDepositsRequest.mjs";
|
|
6
7
|
export type { GetV1StaticWalletsStaticWalletIdRequest } from "./GetV1StaticWalletsStaticWalletIdRequest.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { CryptopaySimulateStaticDepositRequest } from "./CryptopaySimulateStaticDepositRequest.mjs";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const GetV1StaticWalletsStaticWalletIdDepositsRequestOrder: {
|
|
2
|
+
readonly Asc: "asc";
|
|
3
|
+
readonly Desc: "desc";
|
|
4
|
+
};
|
|
5
|
+
export type GetV1StaticWalletsStaticWalletIdDepositsRequestOrder = (typeof GetV1StaticWalletsStaticWalletIdDepositsRequestOrder)[keyof typeof GetV1StaticWalletsStaticWalletIdDepositsRequestOrder];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Asset id-string (see GET /v1/assets), e.g. USDT_ETHEREUM. */
|
|
2
|
+
export declare const CryptopayAssetId: {
|
|
3
|
+
readonly UsdtEthereum: "USDT_ETHEREUM";
|
|
4
|
+
readonly UsdtArbitrum: "USDT_ARBITRUM";
|
|
5
|
+
readonly UsdtOptimism: "USDT_OPTIMISM";
|
|
6
|
+
readonly UsdtBase: "USDT_BASE";
|
|
7
|
+
readonly UsdtBsc: "USDT_BSC";
|
|
8
|
+
readonly UsdtPlasma: "USDT_PLASMA";
|
|
9
|
+
readonly UsdtPolygon: "USDT_POLYGON";
|
|
10
|
+
readonly UsdcEthereum: "USDC_ETHEREUM";
|
|
11
|
+
readonly UsdcArbitrum: "USDC_ARBITRUM";
|
|
12
|
+
readonly UsdCeArbitrum: "USDCE_ARBITRUM";
|
|
13
|
+
readonly UsdcOptimism: "USDC_OPTIMISM";
|
|
14
|
+
readonly UsdcBase: "USDC_BASE";
|
|
15
|
+
readonly UsdcBsc: "USDC_BSC";
|
|
16
|
+
readonly UsdcPlasma: "USDC_PLASMA";
|
|
17
|
+
readonly UsdcPolygon: "USDC_POLYGON";
|
|
18
|
+
readonly EthEthereum: "ETH_ETHEREUM";
|
|
19
|
+
readonly EthArbitrum: "ETH_ARBITRUM";
|
|
20
|
+
readonly EthOptimism: "ETH_OPTIMISM";
|
|
21
|
+
readonly EthBase: "ETH_BASE";
|
|
22
|
+
readonly XplPlasma: "XPL_PLASMA";
|
|
23
|
+
readonly BnbBsc: "BNB_BSC";
|
|
24
|
+
readonly PolPolygon: "POL_POLYGON";
|
|
25
|
+
readonly TestcoinEthereum: "TESTCOIN_ETHEREUM";
|
|
26
|
+
readonly TestcoinOptimism: "TESTCOIN_OPTIMISM";
|
|
27
|
+
readonly TestcoinPlasma: "TESTCOIN_PLASMA";
|
|
28
|
+
readonly TeststablecoinEthereum: "TESTSTABLECOIN_ETHEREUM";
|
|
29
|
+
readonly TeststablecoinOptimism: "TESTSTABLECOIN_OPTIMISM";
|
|
30
|
+
readonly TeststablecoinPlasma: "TESTSTABLECOIN_PLASMA";
|
|
31
|
+
};
|
|
32
|
+
export type CryptopayAssetId = (typeof CryptopayAssetId)[keyof typeof CryptopayAssetId];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** Asset id-string (see GET /v1/assets), e.g. USDT_ETHEREUM. */
|
|
3
|
+
export const CryptopayAssetId = {
|
|
4
|
+
UsdtEthereum: "USDT_ETHEREUM",
|
|
5
|
+
UsdtArbitrum: "USDT_ARBITRUM",
|
|
6
|
+
UsdtOptimism: "USDT_OPTIMISM",
|
|
7
|
+
UsdtBase: "USDT_BASE",
|
|
8
|
+
UsdtBsc: "USDT_BSC",
|
|
9
|
+
UsdtPlasma: "USDT_PLASMA",
|
|
10
|
+
UsdtPolygon: "USDT_POLYGON",
|
|
11
|
+
UsdcEthereum: "USDC_ETHEREUM",
|
|
12
|
+
UsdcArbitrum: "USDC_ARBITRUM",
|
|
13
|
+
UsdCeArbitrum: "USDCE_ARBITRUM",
|
|
14
|
+
UsdcOptimism: "USDC_OPTIMISM",
|
|
15
|
+
UsdcBase: "USDC_BASE",
|
|
16
|
+
UsdcBsc: "USDC_BSC",
|
|
17
|
+
UsdcPlasma: "USDC_PLASMA",
|
|
18
|
+
UsdcPolygon: "USDC_POLYGON",
|
|
19
|
+
EthEthereum: "ETH_ETHEREUM",
|
|
20
|
+
EthArbitrum: "ETH_ARBITRUM",
|
|
21
|
+
EthOptimism: "ETH_OPTIMISM",
|
|
22
|
+
EthBase: "ETH_BASE",
|
|
23
|
+
XplPlasma: "XPL_PLASMA",
|
|
24
|
+
BnbBsc: "BNB_BSC",
|
|
25
|
+
PolPolygon: "POL_POLYGON",
|
|
26
|
+
TestcoinEthereum: "TESTCOIN_ETHEREUM",
|
|
27
|
+
TestcoinOptimism: "TESTCOIN_OPTIMISM",
|
|
28
|
+
TestcoinPlasma: "TESTCOIN_PLASMA",
|
|
29
|
+
TeststablecoinEthereum: "TESTSTABLECOIN_ETHEREUM",
|
|
30
|
+
TeststablecoinOptimism: "TESTSTABLECOIN_OPTIMISM",
|
|
31
|
+
TeststablecoinPlasma: "TESTSTABLECOIN_PLASMA",
|
|
32
|
+
};
|
|
@@ -7,7 +7,7 @@ export interface CryptopayPaymentResponse {
|
|
|
7
7
|
amount?: string | undefined;
|
|
8
8
|
amountConfirmed?: string | undefined;
|
|
9
9
|
amountReceived?: string | undefined;
|
|
10
|
-
asset?:
|
|
10
|
+
asset?: SuwardSDK.CryptopayAssetId | undefined;
|
|
11
11
|
createdAt?: number | undefined;
|
|
12
12
|
expiresAt?: number | undefined;
|
|
13
13
|
externalId?: string | undefined;
|
|
@@ -5,7 +5,7 @@ export interface CryptopayPublicPaymentResponse {
|
|
|
5
5
|
address?: string | undefined;
|
|
6
6
|
amount?: string | undefined;
|
|
7
7
|
amountReceived?: string | undefined;
|
|
8
|
-
asset?:
|
|
8
|
+
asset?: SuwardSDK.CryptopayAssetId | undefined;
|
|
9
9
|
createdAt?: number | undefined;
|
|
10
10
|
expiresAt?: number | undefined;
|
|
11
11
|
id?: string | undefined;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
export interface CryptopayRedirectConfigDto {
|
|
2
2
|
data?: string | undefined;
|
|
3
|
-
params?:
|
|
3
|
+
params?: CryptopayRedirectConfigDto.Params.Item[] | undefined;
|
|
4
4
|
url?: string | undefined;
|
|
5
5
|
}
|
|
6
|
+
export declare namespace CryptopayRedirectConfigDto {
|
|
7
|
+
type Params = Params.Item[];
|
|
8
|
+
namespace Params {
|
|
9
|
+
const Item: {
|
|
10
|
+
readonly Id: "id";
|
|
11
|
+
readonly ExternalId: "externalId";
|
|
12
|
+
};
|
|
13
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var CryptopayRedirectConfigDto;
|
|
3
|
+
(function (CryptopayRedirectConfigDto) {
|
|
4
|
+
let Params;
|
|
5
|
+
(function (Params) {
|
|
6
|
+
Params.Item = {
|
|
7
|
+
Id: "id",
|
|
8
|
+
ExternalId: "externalId",
|
|
9
|
+
};
|
|
10
|
+
})(Params = CryptopayRedirectConfigDto.Params || (CryptopayRedirectConfigDto.Params = {}));
|
|
11
|
+
})(CryptopayRedirectConfigDto || (CryptopayRedirectConfigDto = {}));
|