@openfort/openfort-node 0.6.49 → 0.6.51

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 (103) hide show
  1. package/dist/apis/exchangeApiWrapper.d.ts +15 -0
  2. package/dist/apis/exchangeApiWrapper.js +40 -0
  3. package/dist/apis/exchangeApiWrapper.js.map +1 -0
  4. package/dist/apis/payamsterApiWrapper.d.ts +27 -0
  5. package/dist/apis/payamsterApiWrapper.js +55 -0
  6. package/dist/apis/payamsterApiWrapper.js.map +1 -0
  7. package/dist/generated/apis/AccountsApi.d.ts +1 -1
  8. package/dist/generated/apis/AccountsApi.js +1 -1
  9. package/dist/generated/apis/ExchangeApi.d.ts +41 -0
  10. package/dist/generated/apis/ExchangeApi.js +137 -0
  11. package/dist/generated/apis/ExchangeApi.js.map +1 -0
  12. package/dist/generated/apis/PaymasterApi.d.ts +87 -0
  13. package/dist/generated/apis/PaymasterApi.js +318 -0
  14. package/dist/generated/apis/PaymasterApi.js.map +1 -0
  15. package/dist/generated/index.d.ts +1 -1
  16. package/dist/generated/index.js +3 -1
  17. package/dist/generated/index.js.map +1 -1
  18. package/dist/generated/models/Amount.d.ts +33 -0
  19. package/dist/generated/models/Amount.js +41 -0
  20. package/dist/generated/models/Amount.js.map +1 -0
  21. package/dist/generated/models/ApiKeyType.d.ts +1 -1
  22. package/dist/generated/models/CreateExchangeRequest.d.ts +69 -0
  23. package/dist/generated/models/CreateExchangeRequest.js +92 -0
  24. package/dist/generated/models/CreateExchangeRequest.js.map +1 -0
  25. package/dist/generated/models/CreatePaymasterRequest.d.ts +39 -0
  26. package/dist/generated/models/CreatePaymasterRequest.js +44 -0
  27. package/dist/generated/models/CreatePaymasterRequest.js.map +1 -0
  28. package/dist/generated/models/CreatePolicyRequest.d.ts +4 -0
  29. package/dist/generated/models/CreatePolicyRequest.js +6 -0
  30. package/dist/generated/models/CreatePolicyRequest.js.map +1 -1
  31. package/dist/generated/models/EntityTypePAYMASTER.d.ts +12 -0
  32. package/dist/generated/models/EntityTypePAYMASTER.js +14 -0
  33. package/dist/generated/models/EntityTypePAYMASTER.js.map +1 -0
  34. package/dist/generated/models/Fee.d.ts +34 -0
  35. package/dist/generated/models/Fee.js +47 -0
  36. package/dist/generated/models/Fee.js.map +1 -0
  37. package/dist/generated/models/Interaction.d.ts +8 -0
  38. package/dist/generated/models/Interaction.js +12 -0
  39. package/dist/generated/models/Interaction.js.map +1 -1
  40. package/dist/generated/models/ObjectSerializer.d.ts +12 -0
  41. package/dist/generated/models/ObjectSerializer.js +34 -0
  42. package/dist/generated/models/ObjectSerializer.js.map +1 -1
  43. package/dist/generated/models/PagingQueries.d.ts +37 -0
  44. package/dist/generated/models/PagingQueries.js +44 -0
  45. package/dist/generated/models/PagingQueries.js.map +1 -0
  46. package/dist/generated/models/PaymasterDeleteResponse.d.ts +31 -0
  47. package/dist/generated/models/PaymasterDeleteResponse.js +44 -0
  48. package/dist/generated/models/PaymasterDeleteResponse.js.map +1 -0
  49. package/dist/generated/models/PaymasterResponse.d.ts +34 -0
  50. package/dist/generated/models/PaymasterResponse.js +62 -0
  51. package/dist/generated/models/PaymasterResponse.js.map +1 -0
  52. package/dist/generated/models/Policy.d.ts +1 -0
  53. package/dist/generated/models/Policy.js +6 -0
  54. package/dist/generated/models/Policy.js.map +1 -1
  55. package/dist/generated/models/PolicyResponse.d.ts +2 -0
  56. package/dist/generated/models/PolicyResponse.js +6 -0
  57. package/dist/generated/models/PolicyResponse.js.map +1 -1
  58. package/dist/generated/models/ProjectStatsResponse.d.ts +3 -1
  59. package/dist/generated/models/ProjectStatsResponse.js +6 -0
  60. package/dist/generated/models/ProjectStatsResponse.js.map +1 -1
  61. package/dist/generated/models/QuoteExchangeResult.d.ts +36 -0
  62. package/dist/generated/models/QuoteExchangeResult.js +68 -0
  63. package/dist/generated/models/QuoteExchangeResult.js.map +1 -0
  64. package/dist/generated/models/Stat.d.ts +0 -2
  65. package/dist/generated/models/Stat.js +0 -12
  66. package/dist/generated/models/Stat.js.map +1 -1
  67. package/dist/generated/models/Token.d.ts +35 -0
  68. package/dist/generated/models/Token.js +59 -0
  69. package/dist/generated/models/Token.js.map +1 -0
  70. package/dist/generated/models/TradeType.d.ts +12 -0
  71. package/dist/generated/models/TradeType.js +14 -0
  72. package/dist/generated/models/TradeType.js.map +1 -0
  73. package/dist/generated/models/TransactionIntentResponsePolicy.d.ts +1 -0
  74. package/dist/generated/models/TransactionIntentResponsePolicy.js +6 -0
  75. package/dist/generated/models/TransactionIntentResponsePolicy.js.map +1 -1
  76. package/dist/generated/models/TransactionStat.d.ts +31 -0
  77. package/dist/generated/models/TransactionStat.js +50 -0
  78. package/dist/generated/models/TransactionStat.js.map +1 -0
  79. package/dist/generated/models/UpdatePolicyRequest.d.ts +4 -0
  80. package/dist/generated/models/UpdatePolicyRequest.js +6 -0
  81. package/dist/generated/models/UpdatePolicyRequest.js.map +1 -1
  82. package/dist/generated/models/all.d.ts +12 -0
  83. package/dist/generated/models/all.js +12 -0
  84. package/dist/generated/models/all.js.map +1 -1
  85. package/dist/generated/types/ObjectParamAPI.d.ts +132 -1
  86. package/dist/generated/types/ObjectParamAPI.js +93 -23
  87. package/dist/generated/types/ObjectParamAPI.js.map +1 -1
  88. package/dist/generated/types/ObservableAPI.d.ts +65 -1
  89. package/dist/generated/types/ObservableAPI.js +170 -2
  90. package/dist/generated/types/ObservableAPI.js.map +1 -1
  91. package/dist/generated/types/PromiseAPI.d.ts +61 -1
  92. package/dist/generated/types/PromiseAPI.js +103 -23
  93. package/dist/generated/types/PromiseAPI.js.map +1 -1
  94. package/dist/models/getPaymasterRequest.d.ts +3 -0
  95. package/dist/models/getPaymasterRequest.js +3 -0
  96. package/dist/models/getPaymasterRequest.js.map +1 -0
  97. package/dist/models/updatePaymasterRequest.d.ts +4 -0
  98. package/dist/models/updatePaymasterRequest.js +3 -0
  99. package/dist/models/updatePaymasterRequest.js.map +1 -0
  100. package/dist/version.d.ts +1 -1
  101. package/dist/version.js +1 -1
  102. package/package.json +1 -1
  103. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,15 @@
1
+ import { CreateExchangeRequest, ExchangeApi, QuoteExchangeResult, TransactionIntentResponse } from "../generated";
2
+ import { BaseApiWrapper } from "./baseApiWrapper";
3
+ export declare class ExchangeApiWrapper extends BaseApiWrapper<ExchangeApi> {
4
+ constructor(accessToken: string, basePath?: string);
5
+ /**
6
+ * Creates token swap.
7
+ * @param req The account to create
8
+ */
9
+ createSwap(req: CreateExchangeRequest): Promise<TransactionIntentResponse>;
10
+ /**
11
+ * Quote token swap.
12
+ * @param req Criteria to get account.
13
+ */
14
+ quoteSwap(req: CreateExchangeRequest): Promise<QuoteExchangeResult>;
15
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ExchangeApiWrapper = void 0;
13
+ const generated_1 = require("../generated");
14
+ const baseApiWrapper_1 = require("./baseApiWrapper");
15
+ const httpErrorHandler_1 = require("../utilities/httpErrorHandler");
16
+ let ExchangeApiWrapper = class ExchangeApiWrapper extends baseApiWrapper_1.BaseApiWrapper {
17
+ constructor(accessToken, basePath) {
18
+ super(generated_1.ExchangeApi, accessToken, basePath);
19
+ }
20
+ /**
21
+ * Creates token swap.
22
+ * @param req The account to create
23
+ */
24
+ async createSwap(req) {
25
+ return await this.api.createSwap(req);
26
+ }
27
+ /**
28
+ * Quote token swap.
29
+ * @param req Criteria to get account.
30
+ */
31
+ async quoteSwap(req) {
32
+ return await this.api.quoteSwap(req);
33
+ }
34
+ };
35
+ ExchangeApiWrapper = __decorate([
36
+ httpErrorHandler_1.httpErrorHandler,
37
+ __metadata("design:paramtypes", [String, String])
38
+ ], ExchangeApiWrapper);
39
+ exports.ExchangeApiWrapper = ExchangeApiWrapper;
40
+ //# sourceMappingURL=exchangeApiWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchangeApiWrapper.js","sourceRoot":"","sources":["../../src/apis/exchangeApiWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAkH;AAClH,qDAAkD;AAClD,oEAAiE;AAG1D,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,+BAA2B;IAC/D,YAAY,WAAmB,EAAE,QAAiB;QAC9C,KAAK,CAAC,uBAAW,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,UAAU,CAAC,GAA0B;QAC9C,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,SAAS,CAAC,GAA0B;QAC7C,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;CACJ,CAAA;AApBY,kBAAkB;IAD9B,mCAAgB;;GACJ,kBAAkB,CAoB9B;AApBY,gDAAkB"}
@@ -0,0 +1,27 @@
1
+ import { CreatePaymasterRequest, PaymasterApi, PaymasterDeleteResponse, PaymasterResponse } from "../generated";
2
+ import { BaseApiWrapper } from "./baseApiWrapper";
3
+ import { GetPaymasterRequest } from "../models/getPaymasterRequest";
4
+ import { UpdatePaymasterRequest } from "../models/updatePaymasterRequest";
5
+ export declare class PaymasterApiWrapper extends BaseApiWrapper<PaymasterApi> {
6
+ constructor(accessToken: string, basePath?: string);
7
+ /**
8
+ * Create a new paymaster.
9
+ * @param req The paymaster to create
10
+ */
11
+ create(req: CreatePaymasterRequest): Promise<PaymasterResponse>;
12
+ /**
13
+ * Returns the paymaster with the given id.
14
+ * @param req Criteria to get paymaster.
15
+ */
16
+ get(req: GetPaymasterRequest): Promise<PaymasterResponse>;
17
+ /**
18
+ * Updates a paymaster object.
19
+ * @param req Parameters to update paymaster
20
+ */
21
+ update(req: UpdatePaymasterRequest): Promise<PaymasterResponse>;
22
+ /**
23
+ * Deletes a paymaster object.
24
+ * @param id Paymaster id to delete
25
+ */
26
+ delete(id: string): Promise<PaymasterDeleteResponse>;
27
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PaymasterApiWrapper = void 0;
13
+ const generated_1 = require("../generated");
14
+ const baseApiWrapper_1 = require("./baseApiWrapper");
15
+ const httpErrorHandler_1 = require("../utilities/httpErrorHandler");
16
+ let PaymasterApiWrapper = class PaymasterApiWrapper extends baseApiWrapper_1.BaseApiWrapper {
17
+ constructor(accessToken, basePath) {
18
+ super(generated_1.PaymasterApi, accessToken, basePath);
19
+ }
20
+ /**
21
+ * Create a new paymaster.
22
+ * @param req The paymaster to create
23
+ */
24
+ async create(req) {
25
+ return await this.api.createPaymaster(req);
26
+ }
27
+ /**
28
+ * Returns the paymaster with the given id.
29
+ * @param req Criteria to get paymaster.
30
+ */
31
+ async get(req) {
32
+ return await this.api.getPaymaster(req.id);
33
+ }
34
+ /**
35
+ * Updates a paymaster object.
36
+ * @param req Parameters to update paymaster
37
+ */
38
+ async update(req) {
39
+ const { id, ...body } = req;
40
+ return await this.api.updatePaymaster(id, body);
41
+ }
42
+ /**
43
+ * Deletes a paymaster object.
44
+ * @param id Paymaster id to delete
45
+ */
46
+ async delete(id) {
47
+ return await this.api.deletePaymaster(id);
48
+ }
49
+ };
50
+ PaymasterApiWrapper = __decorate([
51
+ httpErrorHandler_1.httpErrorHandler,
52
+ __metadata("design:paramtypes", [String, String])
53
+ ], PaymasterApiWrapper);
54
+ exports.PaymasterApiWrapper = PaymasterApiWrapper;
55
+ //# sourceMappingURL=payamsterApiWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payamsterApiWrapper.js","sourceRoot":"","sources":["../../src/apis/payamsterApiWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAgH;AAChH,qDAAkD;AAClD,oEAAiE;AAK1D,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,+BAA4B;IACjE,YAAY,WAAmB,EAAE,QAAiB;QAC9C,KAAK,CAAC,wBAAY,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,MAAM,CAAC,GAA2B;QAC3C,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,GAAG,CAAC,GAAwB;QACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,MAAM,CAAC,GAA2B;QAC3C,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,GAAG,CAAC;QAC5B,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,MAAM,CAAC,EAAU;QAC1B,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC9C,CAAC;CACJ,CAAA;AArCY,mBAAmB;IAD/B,mCAAgB;;GACJ,mBAAmB,CAqC/B;AArCY,kDAAmB"}
@@ -69,7 +69,7 @@ export declare class AccountsApiRequestFactory extends BaseAPIRequestFactory {
69
69
  */
70
70
  requestTransferOwnership(id: string, transferOwnershipRequest: TransferOwnershipRequest, _options?: Configuration): Promise<RequestContext>;
71
71
  /**
72
- * Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
72
+ * **Custodial Accounts only** - Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
73
73
  * Sign a given payload
74
74
  * @param id Specifies the unique account ID (starts with acc_).
75
75
  * @param signPayloadRequest
@@ -296,7 +296,7 @@ class AccountsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
296
296
  return requestContext;
297
297
  }
298
298
  /**
299
- * Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
299
+ * **Custodial Accounts only** - Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
300
300
  * Sign a given payload
301
301
  * @param id Specifies the unique account ID (starts with acc_).
302
302
  * @param signPayloadRequest
@@ -0,0 +1,41 @@
1
+ import { BaseAPIRequestFactory } from './baseapi';
2
+ import { Configuration } from '../configuration';
3
+ import { RequestContext, ResponseContext } from '../http/http';
4
+ import { CreateExchangeRequest } from '../models/CreateExchangeRequest';
5
+ import { QuoteExchangeResult } from '../models/QuoteExchangeResult';
6
+ import { TransactionIntentResponse } from '../models/TransactionIntentResponse';
7
+ /**
8
+ * no description
9
+ */
10
+ export declare class ExchangeApiRequestFactory extends BaseAPIRequestFactory {
11
+ /**
12
+ * Creates token swap.
13
+ * Create token swap.
14
+ * @param createExchangeRequest
15
+ */
16
+ createSwap(createExchangeRequest: CreateExchangeRequest, _options?: Configuration): Promise<RequestContext>;
17
+ /**
18
+ * Quote token swap.
19
+ * Quote token swap.
20
+ * @param createExchangeRequest
21
+ */
22
+ quoteSwap(createExchangeRequest: CreateExchangeRequest, _options?: Configuration): Promise<RequestContext>;
23
+ }
24
+ export declare class ExchangeApiResponseProcessor {
25
+ /**
26
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
27
+ * to the expected objects
28
+ *
29
+ * @params response Response returned by the server for a request to createSwap
30
+ * @throws ApiException if the response code was not in [200, 299]
31
+ */
32
+ createSwap(response: ResponseContext): Promise<TransactionIntentResponse>;
33
+ /**
34
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
35
+ * to the expected objects
36
+ *
37
+ * @params response Response returned by the server for a request to quoteSwap
38
+ * @throws ApiException if the response code was not in [200, 299]
39
+ */
40
+ quoteSwap(response: ResponseContext): Promise<QuoteExchangeResult>;
41
+ }
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExchangeApiResponseProcessor = exports.ExchangeApiRequestFactory = void 0;
4
+ // TODO: better import syntax?
5
+ const baseapi_1 = require("./baseapi");
6
+ const http_1 = require("../http/http");
7
+ const ObjectSerializer_1 = require("../models/ObjectSerializer");
8
+ const exception_1 = require("./exception");
9
+ const util_1 = require("../util");
10
+ /**
11
+ * no description
12
+ */
13
+ class ExchangeApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
14
+ /**
15
+ * Creates token swap.
16
+ * Create token swap.
17
+ * @param createExchangeRequest
18
+ */
19
+ async createSwap(createExchangeRequest, _options) {
20
+ let _config = _options || this.configuration;
21
+ // verify required parameter 'createExchangeRequest' is not null or undefined
22
+ if (createExchangeRequest === null || createExchangeRequest === undefined) {
23
+ throw new baseapi_1.RequiredError("ExchangeApi", "createSwap", "createExchangeRequest");
24
+ }
25
+ // Path Params
26
+ const localVarPath = '/v1/exchange';
27
+ // Make Request Context
28
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
29
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
30
+ // Body Params
31
+ const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
32
+ "application/json"
33
+ ]);
34
+ requestContext.setHeaderParam("Content-Type", contentType);
35
+ const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(createExchangeRequest, "CreateExchangeRequest", ""), contentType);
36
+ requestContext.setBody(serializedBody);
37
+ let authMethod;
38
+ // Apply auth methods
39
+ authMethod = _config.authMethods["sk"];
40
+ if (authMethod?.applySecurityAuthentication) {
41
+ await authMethod?.applySecurityAuthentication(requestContext);
42
+ }
43
+ const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
44
+ if (defaultAuth?.applySecurityAuthentication) {
45
+ await defaultAuth?.applySecurityAuthentication(requestContext);
46
+ }
47
+ return requestContext;
48
+ }
49
+ /**
50
+ * Quote token swap.
51
+ * Quote token swap.
52
+ * @param createExchangeRequest
53
+ */
54
+ async quoteSwap(createExchangeRequest, _options) {
55
+ let _config = _options || this.configuration;
56
+ // verify required parameter 'createExchangeRequest' is not null or undefined
57
+ if (createExchangeRequest === null || createExchangeRequest === undefined) {
58
+ throw new baseapi_1.RequiredError("ExchangeApi", "quoteSwap", "createExchangeRequest");
59
+ }
60
+ // Path Params
61
+ const localVarPath = '/v1/exchange/quote';
62
+ // Make Request Context
63
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
64
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
65
+ // Body Params
66
+ const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
67
+ "application/json"
68
+ ]);
69
+ requestContext.setHeaderParam("Content-Type", contentType);
70
+ const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(createExchangeRequest, "CreateExchangeRequest", ""), contentType);
71
+ requestContext.setBody(serializedBody);
72
+ let authMethod;
73
+ // Apply auth methods
74
+ authMethod = _config.authMethods["sk"];
75
+ if (authMethod?.applySecurityAuthentication) {
76
+ await authMethod?.applySecurityAuthentication(requestContext);
77
+ }
78
+ const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
79
+ if (defaultAuth?.applySecurityAuthentication) {
80
+ await defaultAuth?.applySecurityAuthentication(requestContext);
81
+ }
82
+ return requestContext;
83
+ }
84
+ }
85
+ exports.ExchangeApiRequestFactory = ExchangeApiRequestFactory;
86
+ class ExchangeApiResponseProcessor {
87
+ /**
88
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
89
+ * to the expected objects
90
+ *
91
+ * @params response Response returned by the server for a request to createSwap
92
+ * @throws ApiException if the response code was not in [200, 299]
93
+ */
94
+ async createSwap(response) {
95
+ const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
96
+ if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
97
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "TransactionIntentResponse", "");
98
+ return body;
99
+ }
100
+ if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
101
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InvalidRequestErrorResponse", "");
102
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request.", body, response.headers);
103
+ }
104
+ // Work around for missing responses in specification, e.g. for petstore.yaml
105
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
106
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "TransactionIntentResponse", "");
107
+ return body;
108
+ }
109
+ throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
110
+ }
111
+ /**
112
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
113
+ * to the expected objects
114
+ *
115
+ * @params response Response returned by the server for a request to quoteSwap
116
+ * @throws ApiException if the response code was not in [200, 299]
117
+ */
118
+ async quoteSwap(response) {
119
+ const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
120
+ if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
121
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "QuoteExchangeResult", "");
122
+ return body;
123
+ }
124
+ if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
125
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InvalidRequestErrorResponse", "");
126
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request.", body, response.headers);
127
+ }
128
+ // Work around for missing responses in specification, e.g. for petstore.yaml
129
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
130
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "QuoteExchangeResult", "");
131
+ return body;
132
+ }
133
+ throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
134
+ }
135
+ }
136
+ exports.ExchangeApiResponseProcessor = ExchangeApiResponseProcessor;
137
+ //# sourceMappingURL=ExchangeApi.js.map
@@ -0,0 +1 @@
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CAAC,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;SACxH;QAED,6EAA6E;QAC7E,IAAI,QAAQ,CAAC,cAAc,IAAI,GAAG,IAAI,QAAQ,CAAC,cAAc,IAAI,GAAG,EAAE;YAClE,MAAM,IAAI,GAAwB,mCAAgB,CAAC,WAAW,CAC1D,mCAAgB,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,EAC/D,qBAAqB,EAAE,EAAE,CACL,CAAC;YACzB,OAAO,IAAI,CAAC;SACf;QAED,MAAM,IAAI,wBAAY,CAA8B,QAAQ,CAAC,cAAc,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC,YAAY,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC9J,CAAC;CAEJ;AA1ED,oEA0EC"}
@@ -0,0 +1,87 @@
1
+ import { BaseAPIRequestFactory } from './baseapi';
2
+ import { Configuration } from '../configuration';
3
+ import { RequestContext, ResponseContext } from '../http/http';
4
+ import { CreatePaymasterRequest } from '../models/CreatePaymasterRequest';
5
+ import { PaymasterDeleteResponse } from '../models/PaymasterDeleteResponse';
6
+ import { PaymasterResponse } from '../models/PaymasterResponse';
7
+ import { SortOrder } from '../models/SortOrder';
8
+ /**
9
+ * no description
10
+ */
11
+ export declare class PaymasterApiRequestFactory extends BaseAPIRequestFactory {
12
+ /**
13
+ * Create a new paymaster. This object represents the paymaster that will be used to pay the gas fees of the transactions.
14
+ * Create a new paymaster.
15
+ * @param createPaymasterRequest
16
+ */
17
+ createPaymaster(createPaymasterRequest: CreatePaymasterRequest, _options?: Configuration): Promise<RequestContext>;
18
+ /**
19
+ * Delete the paymaster with the given id. This object represents the paymaster that will be used to pay the gas fees for the transactions.
20
+ * Delete paymaster by id.
21
+ * @param id
22
+ */
23
+ deletePaymaster(id: string, _options?: Configuration): Promise<RequestContext>;
24
+ /**
25
+ * Returns the paymaster with the given id. This object represents the paymaster that will be used to pay the gas fees for the transactions.
26
+ * Get paymaster by id.
27
+ * @param id
28
+ */
29
+ getPaymaster(id: string, _options?: Configuration): Promise<RequestContext>;
30
+ /**
31
+ * Returns a list of paymasters. This object represents the paymasters that will be used to pay the gas fees for the transactions. By default, a maximum of 10 paymasters are shown per page.
32
+ * List paymasters.
33
+ * @param limit Specifies the maximum number of records to return.
34
+ * @param skip Specifies the offset for the first records to return.
35
+ * @param order Specifies the order in which to sort the results.
36
+ */
37
+ listPaymasters(limit?: number, skip?: number, order?: SortOrder, _options?: Configuration): Promise<RequestContext>;
38
+ /**
39
+ * Update a paymaster. This object represents the paymaster that will be used to pay the gas fees of the transactions.
40
+ * Update a paymaster.
41
+ * @param id
42
+ * @param createPaymasterRequest
43
+ */
44
+ updatePaymaster(id: string, createPaymasterRequest: CreatePaymasterRequest, _options?: Configuration): Promise<RequestContext>;
45
+ }
46
+ export declare class PaymasterApiResponseProcessor {
47
+ /**
48
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
49
+ * to the expected objects
50
+ *
51
+ * @params response Response returned by the server for a request to createPaymaster
52
+ * @throws ApiException if the response code was not in [200, 299]
53
+ */
54
+ createPaymaster(response: ResponseContext): Promise<PaymasterResponse>;
55
+ /**
56
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
57
+ * to the expected objects
58
+ *
59
+ * @params response Response returned by the server for a request to deletePaymaster
60
+ * @throws ApiException if the response code was not in [200, 299]
61
+ */
62
+ deletePaymaster(response: ResponseContext): Promise<PaymasterDeleteResponse>;
63
+ /**
64
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
65
+ * to the expected objects
66
+ *
67
+ * @params response Response returned by the server for a request to getPaymaster
68
+ * @throws ApiException if the response code was not in [200, 299]
69
+ */
70
+ getPaymaster(response: ResponseContext): Promise<PaymasterResponse>;
71
+ /**
72
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
73
+ * to the expected objects
74
+ *
75
+ * @params response Response returned by the server for a request to listPaymasters
76
+ * @throws ApiException if the response code was not in [200, 299]
77
+ */
78
+ listPaymasters(response: ResponseContext): Promise<Array<PaymasterResponse>>;
79
+ /**
80
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
81
+ * to the expected objects
82
+ *
83
+ * @params response Response returned by the server for a request to updatePaymaster
84
+ * @throws ApiException if the response code was not in [200, 299]
85
+ */
86
+ updatePaymaster(response: ResponseContext): Promise<PaymasterResponse>;
87
+ }