@cobo/cobo-waas2 1.13.0 → 1.15.0

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 (222) hide show
  1. package/README.md +89 -5
  2. package/dist/ApiClient.js +2 -3
  3. package/dist/PreRequestScript.js +1 -1
  4. package/dist/api/FeeStationApi.js +58 -15
  5. package/dist/api/PaymentApi.js +938 -0
  6. package/dist/api/TransactionsApi.js +18 -10
  7. package/dist/api/WalletsApi.js +145 -2
  8. package/dist/crypto/ApiSigner.js +1 -2
  9. package/dist/index.js +437 -3
  10. package/dist/model/AddressBook.js +18 -0
  11. package/dist/model/AddressesEventData.js +18 -3
  12. package/dist/model/BTCBIP137MessageSignDestination.js +1 -1
  13. package/dist/model/BTCBIP322MessageSignDestination.js +1 -1
  14. package/dist/model/BankAccount.js +18 -0
  15. package/dist/model/ChainsEventData.js +40 -3
  16. package/dist/model/CosmosAdr36MessageSignDestination.js +1 -1
  17. package/dist/model/CreateBankAccountRequest.js +108 -0
  18. package/dist/model/CreateMerchantRequest.js +125 -0
  19. package/dist/model/CreatePaymentOrderRequest.js +206 -0
  20. package/dist/model/CreateRefundRequest.js +192 -0
  21. package/dist/model/CreateSettlement.js +4 -4
  22. package/dist/model/CreateSettlementRequestRequest.js +142 -0
  23. package/dist/model/CreateTokenListingRequest201Response.js +110 -0
  24. package/dist/model/CreateTokenListingRequestRequest.js +147 -0
  25. package/dist/model/FeeStationDestination.js +136 -0
  26. package/dist/model/FeeStationTransfer.js +127 -0
  27. package/dist/model/GetExchangeRate200Response.js +140 -0
  28. package/dist/model/GetRefunds200Response.js +123 -0
  29. package/dist/model/GetSettlementInfoByIds200Response.js +136 -0
  30. package/dist/model/ListMerchants200Response.js +123 -0
  31. package/dist/model/ListPaymentOrders200Response.js +123 -0
  32. package/dist/model/ListSettlementRequests200Response.js +123 -0
  33. package/dist/model/ListTokenBalancesForFeeStation200Response.js +123 -0
  34. package/dist/model/ListTokenBalancesForFeeStation200ResponseDataInner.js +142 -0
  35. package/dist/model/ListTokenListingRequests200Response.js +123 -0
  36. package/dist/model/MPCVaultEventData.js +18 -3
  37. package/dist/model/Merchant.js +20 -2
  38. package/dist/model/Order.js +64 -15
  39. package/dist/model/OrderAddressInfo.js +147 -0
  40. package/dist/model/PaymentOrderEventData.js +543 -0
  41. package/dist/model/PaymentRefundEventData.js +458 -0
  42. package/dist/model/PaymentSettlementEvent.js +331 -0
  43. package/dist/model/PaymentTransaction.js +20 -7
  44. package/dist/model/Refund.js +57 -3
  45. package/dist/model/Settlement.js +35 -4
  46. package/dist/model/SettlementDetail.js +48 -3
  47. package/dist/model/SettlementInfo.js +38 -7
  48. package/dist/model/SwapActivity.js +20 -7
  49. package/dist/model/SwapActivityDetail.js +378 -0
  50. package/dist/model/SwapActivityTimeline.js +135 -0
  51. package/dist/model/SwapQuote.js +51 -4
  52. package/dist/model/SwapToken.js +2 -2
  53. package/dist/model/{SwapActivityType.js → SwapType.js} +7 -7
  54. package/dist/model/TSSBaseRequestEventData.js +163 -0
  55. package/dist/model/TSSCallbackActionType.js +61 -0
  56. package/dist/model/TSSCallbackRequest.js +122 -0
  57. package/dist/model/TSSCallbackRequestType.js +76 -0
  58. package/dist/model/TSSCallbackResponse.js +118 -0
  59. package/dist/model/TSSCurve.js +61 -0
  60. package/dist/model/TSSCurveType.js +61 -0
  61. package/dist/model/TSSEvent.js +158 -0
  62. package/dist/model/TSSEventData.js +278 -0
  63. package/dist/model/TSSEventDataType.js +71 -0
  64. package/dist/model/TSSEventType.js +136 -0
  65. package/dist/model/TSSGroup.js +221 -0
  66. package/dist/model/TSSGroupType.js +61 -0
  67. package/dist/model/TSSGroups.js +1 -1
  68. package/dist/model/TSSKeyGenEventData.js +228 -0
  69. package/dist/model/TSSKeyGenExtra.js +154 -0
  70. package/dist/model/TSSKeyGenRequest.js +130 -0
  71. package/dist/model/TSSKeyReshareEventData.js +228 -0
  72. package/dist/model/TSSKeyReshareExtra.js +169 -0
  73. package/dist/model/TSSKeyReshareRequest.js +177 -0
  74. package/dist/model/TSSKeyShareSignDetail.js +100 -0
  75. package/dist/model/TSSKeyShareSignEventData.js +228 -0
  76. package/dist/model/TSSKeyShareSignExtra.js +171 -0
  77. package/dist/model/TSSKeyShareSignRequest.js +146 -0
  78. package/dist/model/TSSKeyShareSignSignature.js +126 -0
  79. package/dist/model/TSSKeyShareSignSignatures.js +107 -0
  80. package/dist/model/TSSKeySignEventData.js +228 -0
  81. package/dist/model/TSSKeySignExtra.js +203 -0
  82. package/dist/model/TSSKeySignRequest.js +192 -0
  83. package/dist/model/TSSParticipant.js +113 -0
  84. package/dist/model/TSSProtocol.js +66 -0
  85. package/dist/model/TSSRequestTypeEenum.js +71 -0
  86. package/dist/model/TSSRequestWebhookEventData.js +18 -3
  87. package/dist/model/TSSSignature.js +139 -0
  88. package/dist/model/TSSSignatureType.js +66 -0
  89. package/dist/model/TSSSignatures.js +125 -0
  90. package/dist/model/TSSStatus.js +96 -0
  91. package/dist/model/TokenListing.js +10 -10
  92. package/dist/model/TokenListingEventData.js +33 -18
  93. package/dist/model/TokensEventData.js +40 -3
  94. package/dist/model/Transaction.js +1 -1
  95. package/dist/model/TransactionBIP137Destination.js +1 -1
  96. package/dist/model/TransactionBIP322Destination.js +1 -1
  97. package/dist/model/TransactionBabylonBusinessInfo.js +1 -1
  98. package/dist/model/TransactionBabylonTxParameters.js +3 -3
  99. package/dist/model/TransactionCoreStakeInfo.js +3 -3
  100. package/dist/model/TransactionCosmosAdr36Destination.js +1 -1
  101. package/dist/model/TransactionDetail.js +2 -2
  102. package/dist/model/TransactionDetails.js +2 -2
  103. package/dist/model/TransactionEvmEip1559Fee.js +13 -0
  104. package/dist/model/TransactionEvmLegacyFee.js +13 -0
  105. package/dist/model/TransactionExtra.js +3 -3
  106. package/dist/model/TransactionFee.js +6 -0
  107. package/dist/model/TransactionFixedFee.js +13 -0
  108. package/dist/model/TransactionMessageSignBTCEIP191Destination.js +1 -1
  109. package/dist/model/TransactionSolContractDestination.js +1 -1
  110. package/dist/model/TransactionSubStatus.js +25 -0
  111. package/dist/model/TransactionUtxoFee.js +13 -0
  112. package/dist/model/TransactionWebhookEventData.js +20 -5
  113. package/dist/model/UpdateMerchantByIdRequest.js +87 -0
  114. package/dist/model/UpdatePaymentOrderRequest.js +106 -0
  115. package/dist/model/WalletInfoEventData.js +18 -3
  116. package/dist/model/WebhookEventData.js +229 -25
  117. package/dist/model/WebhookEventDataType.js +17 -2
  118. package/dist/model/WebhookEventType.js +30 -0
  119. package/docs/AddressBook.md +2 -0
  120. package/docs/AddressesEventData.md +7 -1
  121. package/docs/BankAccount.md +2 -0
  122. package/docs/ChainsEventData.md +9 -1
  123. package/docs/CreateBankAccountRequest.md +9 -0
  124. package/docs/CreateMerchantRequest.md +10 -0
  125. package/docs/CreatePaymentOrderRequest.md +16 -0
  126. package/docs/CreateRefundRequest.md +15 -0
  127. package/docs/CreateSettlement.md +3 -3
  128. package/docs/CreateSettlementRequestRequest.md +10 -0
  129. package/docs/CreateTokenListingRequest201Response.md +9 -0
  130. package/docs/CreateTokenListingRequestRequest.md +12 -0
  131. package/docs/FeeStationApi.md +59 -6
  132. package/docs/FeeStationDestination.md +11 -0
  133. package/docs/FeeStationTransfer.md +10 -0
  134. package/docs/GetExchangeRate200Response.md +11 -0
  135. package/docs/GetRefunds200Response.md +10 -0
  136. package/docs/GetSettlementInfoByIds200Response.md +10 -0
  137. package/docs/ListMerchants200Response.md +10 -0
  138. package/docs/ListPaymentOrders200Response.md +10 -0
  139. package/docs/ListSettlementRequests200Response.md +10 -0
  140. package/docs/ListTokenBalancesForFeeStation200Response.md +10 -0
  141. package/docs/ListTokenBalancesForFeeStation200ResponseDataInner.md +11 -0
  142. package/docs/ListTokenListingRequests200Response.md +10 -0
  143. package/docs/MPCVaultEventData.md +7 -1
  144. package/docs/Merchant.md +3 -1
  145. package/docs/Order.md +11 -8
  146. package/docs/OrderAddressInfo.md +12 -0
  147. package/docs/PaymentApi.md +1041 -0
  148. package/docs/PaymentOrderEventData.md +58 -0
  149. package/docs/PaymentRefundEventData.md +54 -0
  150. package/docs/PaymentSettlementEvent.md +47 -0
  151. package/docs/PaymentTransaction.md +5 -4
  152. package/docs/Refund.md +8 -3
  153. package/docs/Settlement.md +5 -2
  154. package/docs/SettlementDetail.md +8 -4
  155. package/docs/SettlementInfo.md +9 -6
  156. package/docs/SwapActivity.md +4 -3
  157. package/docs/SwapActivityDetail.md +25 -0
  158. package/docs/SwapActivityTimeline.md +11 -0
  159. package/docs/SwapQuote.md +4 -1
  160. package/docs/SwapToken.md +2 -2
  161. package/docs/{SwapActivityType.md → SwapType.md} +1 -1
  162. package/docs/TSSBaseRequestEventData.md +14 -0
  163. package/docs/TSSCallbackActionType.md +12 -0
  164. package/docs/TSSCallbackRequest.md +12 -0
  165. package/docs/TSSCallbackRequestType.md +18 -0
  166. package/docs/TSSCallbackResponse.md +12 -0
  167. package/docs/TSSCurve.md +12 -0
  168. package/docs/TSSCurveType.md +12 -0
  169. package/docs/TSSEvent.md +13 -0
  170. package/docs/TSSEventData.md +16 -0
  171. package/docs/TSSEventDataType.md +16 -0
  172. package/docs/TSSEventType.md +42 -0
  173. package/docs/TSSGroup.md +19 -0
  174. package/docs/TSSGroupType.md +12 -0
  175. package/docs/TSSKeyGenEventData.md +16 -0
  176. package/docs/TSSKeyGenExtra.md +13 -0
  177. package/docs/TSSKeyGenRequest.md +13 -0
  178. package/docs/TSSKeyReshareEventData.md +16 -0
  179. package/docs/TSSKeyReshareExtra.md +14 -0
  180. package/docs/TSSKeyReshareRequest.md +17 -0
  181. package/docs/TSSKeyShareSignDetail.md +10 -0
  182. package/docs/TSSKeyShareSignEventData.md +16 -0
  183. package/docs/TSSKeyShareSignExtra.md +13 -0
  184. package/docs/TSSKeyShareSignRequest.md +12 -0
  185. package/docs/TSSKeyShareSignSignature.md +12 -0
  186. package/docs/TSSKeyShareSignSignatures.md +9 -0
  187. package/docs/TSSKeySignEventData.md +16 -0
  188. package/docs/TSSKeySignExtra.md +15 -0
  189. package/docs/TSSKeySignRequest.md +18 -0
  190. package/docs/TSSParticipant.md +11 -0
  191. package/docs/TSSProtocol.md +14 -0
  192. package/docs/TSSRequestTypeEenum.md +16 -0
  193. package/docs/TSSRequestWebhookEventData.md +7 -1
  194. package/docs/TSSSignature.md +13 -0
  195. package/docs/TSSSignatureType.md +14 -0
  196. package/docs/TSSSignatures.md +11 -0
  197. package/docs/TSSStatus.md +26 -0
  198. package/docs/TokenListing.md +6 -6
  199. package/docs/TokenListingEventData.md +13 -7
  200. package/docs/TokensEventData.md +9 -1
  201. package/docs/Transaction.md +1 -1
  202. package/docs/TransactionBabylonTxParameters.md +2 -2
  203. package/docs/TransactionCoreStakeInfo.md +2 -2
  204. package/docs/TransactionDetail.md +1 -1
  205. package/docs/TransactionDetails.md +1 -1
  206. package/docs/TransactionEvmEip1559Fee.md +1 -0
  207. package/docs/TransactionEvmLegacyFee.md +1 -0
  208. package/docs/TransactionExtra.md +3 -3
  209. package/docs/TransactionFee.md +1 -0
  210. package/docs/TransactionFixedFee.md +1 -0
  211. package/docs/TransactionSubStatus.md +10 -0
  212. package/docs/TransactionUtxoFee.md +1 -0
  213. package/docs/TransactionWebhookEventData.md +8 -2
  214. package/docs/TransactionsApi.md +9 -5
  215. package/docs/UpdateMerchantByIdRequest.md +9 -0
  216. package/docs/UpdatePaymentOrderRequest.md +9 -0
  217. package/docs/WalletInfoEventData.md +7 -1
  218. package/docs/WalletsApi.md +162 -1
  219. package/docs/WebhookEventData.md +38 -12
  220. package/docs/WebhookEventDataType.md +7 -1
  221. package/docs/WebhookEventType.md +12 -0
  222. package/package.json +1 -1
@@ -0,0 +1,938 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _BankAccount = _interopRequireDefault(require("../model/BankAccount"));
9
+ var _CreateBankAccountRequest = _interopRequireDefault(require("../model/CreateBankAccountRequest"));
10
+ var _CreateMerchantRequest = _interopRequireDefault(require("../model/CreateMerchantRequest"));
11
+ var _CreatePaymentOrderRequest = _interopRequireDefault(require("../model/CreatePaymentOrderRequest"));
12
+ var _CreateRefundRequest = _interopRequireDefault(require("../model/CreateRefundRequest"));
13
+ var _CreateSettlementRequestRequest = _interopRequireDefault(require("../model/CreateSettlementRequestRequest"));
14
+ var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
15
+ var _GetExchangeRate200Response = _interopRequireDefault(require("../model/GetExchangeRate200Response"));
16
+ var _GetRefunds200Response = _interopRequireDefault(require("../model/GetRefunds200Response"));
17
+ var _GetSettlementInfoByIds200Response = _interopRequireDefault(require("../model/GetSettlementInfoByIds200Response"));
18
+ var _ListMerchants200Response = _interopRequireDefault(require("../model/ListMerchants200Response"));
19
+ var _ListPaymentOrders200Response = _interopRequireDefault(require("../model/ListPaymentOrders200Response"));
20
+ var _ListSettlementRequests200Response = _interopRequireDefault(require("../model/ListSettlementRequests200Response"));
21
+ var _Merchant = _interopRequireDefault(require("../model/Merchant"));
22
+ var _Order = _interopRequireDefault(require("../model/Order"));
23
+ var _OrderAddressInfo = _interopRequireDefault(require("../model/OrderAddressInfo"));
24
+ var _Refund = _interopRequireDefault(require("../model/Refund"));
25
+ var _Settlement = _interopRequireDefault(require("../model/Settlement"));
26
+ var _UpdateMerchantByIdRequest = _interopRequireDefault(require("../model/UpdateMerchantByIdRequest"));
27
+ var _UpdatePaymentOrderRequest = _interopRequireDefault(require("../model/UpdatePaymentOrderRequest"));
28
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
29
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
30
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
31
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
32
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
33
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
34
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
35
+ * Cobo Wallet as a Service 2.0
36
+ *
37
+ * Contact: help@cobo.com
38
+ *
39
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
40
+ * https://openapi-generator.tech
41
+ * Do not edit the class manually.
42
+ *
43
+ */
44
+ /**
45
+ * Payment service.
46
+ * @module api/PaymentApi
47
+ */
48
+ var PaymentApi = exports["default"] = /*#__PURE__*/function () {
49
+ /**
50
+ * Constructs a new PaymentApi.
51
+ * @alias module:api/PaymentApi
52
+ * @class
53
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
54
+ * default to {@link module:ApiClient#instance} if unspecified.
55
+ */
56
+ function PaymentApi(apiClient) {
57
+ _classCallCheck(this, PaymentApi);
58
+ this.apiClient = apiClient || _ApiClient["default"].instance;
59
+ }
60
+
61
+ /**
62
+ * Create bank account
63
+ * This operation registers a bank account for payment settlement. Upon successful registration, the bank account details can be retrieved using the assigned bank account ID.
64
+ * @param {Object} opts Optional parameters
65
+ * @param {module:model/CreateBankAccountRequest} [CreateBankAccountRequest] The request body to register a bank account.
66
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BankAccount} and HTTP response
67
+ */
68
+ return _createClass(PaymentApi, [{
69
+ key: "createBankAccountWithHttpInfo",
70
+ value: function createBankAccountWithHttpInfo(opts) {
71
+ opts = opts || {};
72
+ var postBody = opts['CreateBankAccountRequest'];
73
+ if (postBody && postBody.toJSON) {
74
+ postBody = postBody.toJSON();
75
+ }
76
+ var pathParams = {};
77
+ var queryParams = {};
78
+ var headerParams = {};
79
+ var formParams = {};
80
+ var authNames = ['OAuth2', 'CoboAuth'];
81
+ var contentTypes = ['application/json'];
82
+ var accepts = ['application/json'];
83
+ var returnType = _BankAccount["default"];
84
+ return this.apiClient.callApi('/payments/bank_accounts', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
85
+ }
86
+
87
+ /**
88
+ * Create bank account
89
+ * This operation registers a bank account for payment settlement. Upon successful registration, the bank account details can be retrieved using the assigned bank account ID.
90
+ * @param {Object} opts Optional parameters
91
+ * @param {module:model/CreateBankAccountRequest} opts.CreateBankAccountRequest The request body to register a bank account.
92
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BankAccount}
93
+ */
94
+ }, {
95
+ key: "createBankAccount",
96
+ value: function createBankAccount(opts) {
97
+ return this.createBankAccountWithHttpInfo(opts).then(function (response_and_data) {
98
+ return response_and_data.data;
99
+ });
100
+ }
101
+
102
+ /**
103
+ * Create merchant
104
+ * This operation creates a merchant and links it to a specified wallet. Payments to the merchant will be deposited into the linked wallet. Upon successful creation, a merchant ID is generated and returned along with the merchant's information.
105
+ * @param {Object} opts Optional parameters
106
+ * @param {module:model/CreateMerchantRequest} [CreateMerchantRequest] The request body to create a merchant.
107
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Merchant} and HTTP response
108
+ */
109
+ }, {
110
+ key: "createMerchantWithHttpInfo",
111
+ value: function createMerchantWithHttpInfo(opts) {
112
+ opts = opts || {};
113
+ var postBody = opts['CreateMerchantRequest'];
114
+ if (postBody && postBody.toJSON) {
115
+ postBody = postBody.toJSON();
116
+ }
117
+ var pathParams = {};
118
+ var queryParams = {};
119
+ var headerParams = {};
120
+ var formParams = {};
121
+ var authNames = ['OAuth2', 'CoboAuth'];
122
+ var contentTypes = ['application/json'];
123
+ var accepts = ['application/json'];
124
+ var returnType = _Merchant["default"];
125
+ return this.apiClient.callApi('/payments/merchants', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
126
+ }
127
+
128
+ /**
129
+ * Create merchant
130
+ * This operation creates a merchant and links it to a specified wallet. Payments to the merchant will be deposited into the linked wallet. Upon successful creation, a merchant ID is generated and returned along with the merchant's information.
131
+ * @param {Object} opts Optional parameters
132
+ * @param {module:model/CreateMerchantRequest} opts.CreateMerchantRequest The request body to create a merchant.
133
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Merchant}
134
+ */
135
+ }, {
136
+ key: "createMerchant",
137
+ value: function createMerchant(opts) {
138
+ return this.createMerchantWithHttpInfo(opts).then(function (response_and_data) {
139
+ return response_and_data.data;
140
+ });
141
+ }
142
+
143
+ /**
144
+ * Create pay-in order
145
+ * This operation creates a pay-in order.
146
+ * @param {Object} opts Optional parameters
147
+ * @param {module:model/CreatePaymentOrderRequest} [CreatePaymentOrderRequest] The request body to create a pay-in order.
148
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response
149
+ */
150
+ }, {
151
+ key: "createPaymentOrderWithHttpInfo",
152
+ value: function createPaymentOrderWithHttpInfo(opts) {
153
+ opts = opts || {};
154
+ var postBody = opts['CreatePaymentOrderRequest'];
155
+ if (postBody && postBody.toJSON) {
156
+ postBody = postBody.toJSON();
157
+ }
158
+ var pathParams = {};
159
+ var queryParams = {};
160
+ var headerParams = {};
161
+ var formParams = {};
162
+ var authNames = ['OAuth2', 'CoboAuth'];
163
+ var contentTypes = ['application/json'];
164
+ var accepts = ['application/json'];
165
+ var returnType = _Order["default"];
166
+ return this.apiClient.callApi('/payments/orders', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
167
+ }
168
+
169
+ /**
170
+ * Create pay-in order
171
+ * This operation creates a pay-in order.
172
+ * @param {Object} opts Optional parameters
173
+ * @param {module:model/CreatePaymentOrderRequest} opts.CreatePaymentOrderRequest The request body to create a pay-in order.
174
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order}
175
+ */
176
+ }, {
177
+ key: "createPaymentOrder",
178
+ value: function createPaymentOrder(opts) {
179
+ return this.createPaymentOrderWithHttpInfo(opts).then(function (response_and_data) {
180
+ return response_and_data.data;
181
+ });
182
+ }
183
+
184
+ /**
185
+ * Create refund order
186
+ * This operation creates a refund order to return cryptocurrency to a specified address. When creating a refund order, you can optionally link it to an existing pay-in order for tracking and reconciliation purposes.
187
+ * @param {Object} opts Optional parameters
188
+ * @param {module:model/CreateRefundRequest} [CreateRefundRequest] The request body to create a refund order.
189
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Refund} and HTTP response
190
+ */
191
+ }, {
192
+ key: "createRefundWithHttpInfo",
193
+ value: function createRefundWithHttpInfo(opts) {
194
+ opts = opts || {};
195
+ var postBody = opts['CreateRefundRequest'];
196
+ if (postBody && postBody.toJSON) {
197
+ postBody = postBody.toJSON();
198
+ }
199
+ var pathParams = {};
200
+ var queryParams = {};
201
+ var headerParams = {};
202
+ var formParams = {};
203
+ var authNames = ['OAuth2', 'CoboAuth'];
204
+ var contentTypes = ['application/json'];
205
+ var accepts = ['application/json'];
206
+ var returnType = _Refund["default"];
207
+ return this.apiClient.callApi('/payments/refunds', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
208
+ }
209
+
210
+ /**
211
+ * Create refund order
212
+ * This operation creates a refund order to return cryptocurrency to a specified address. When creating a refund order, you can optionally link it to an existing pay-in order for tracking and reconciliation purposes.
213
+ * @param {Object} opts Optional parameters
214
+ * @param {module:model/CreateRefundRequest} opts.CreateRefundRequest The request body to create a refund order.
215
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Refund}
216
+ */
217
+ }, {
218
+ key: "createRefund",
219
+ value: function createRefund(opts) {
220
+ return this.createRefundWithHttpInfo(opts).then(function (response_and_data) {
221
+ return response_and_data.data;
222
+ });
223
+ }
224
+
225
+ /**
226
+ * Create settlement request
227
+ * This operation creates a settlement request to withdraw available balances. You can include multiple merchants and cryptocurrencies in a single settlement request.
228
+ * @param {Object} opts Optional parameters
229
+ * @param {module:model/CreateSettlementRequestRequest} [CreateSettlementRequestRequest] The request body to create a settlement request.
230
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Settlement} and HTTP response
231
+ */
232
+ }, {
233
+ key: "createSettlementRequestWithHttpInfo",
234
+ value: function createSettlementRequestWithHttpInfo(opts) {
235
+ opts = opts || {};
236
+ var postBody = opts['CreateSettlementRequestRequest'];
237
+ if (postBody && postBody.toJSON) {
238
+ postBody = postBody.toJSON();
239
+ }
240
+ var pathParams = {};
241
+ var queryParams = {};
242
+ var headerParams = {};
243
+ var formParams = {};
244
+ var authNames = ['OAuth2', 'CoboAuth'];
245
+ var contentTypes = ['application/json'];
246
+ var accepts = ['application/json'];
247
+ var returnType = _Settlement["default"];
248
+ return this.apiClient.callApi('/payments/settlement_requests', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
249
+ }
250
+
251
+ /**
252
+ * Create settlement request
253
+ * This operation creates a settlement request to withdraw available balances. You can include multiple merchants and cryptocurrencies in a single settlement request.
254
+ * @param {Object} opts Optional parameters
255
+ * @param {module:model/CreateSettlementRequestRequest} opts.CreateSettlementRequestRequest The request body to create a settlement request.
256
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Settlement}
257
+ */
258
+ }, {
259
+ key: "createSettlementRequest",
260
+ value: function createSettlementRequest(opts) {
261
+ return this.createSettlementRequestWithHttpInfo(opts).then(function (response_and_data) {
262
+ return response_and_data.data;
263
+ });
264
+ }
265
+
266
+ /**
267
+ * Get exchange rate
268
+ * This operation retrieves the current exchange rate between a specified currency pair.
269
+ * @param {String} token_id The token ID, which identifies the cryptocurrency. Supported values: - USDC: `ETH_USDC`, `ARBITRUM_USDC`, `SOL_USDC`, `BASE_USDC`, `MATIC_USDC`, `BSC_USDC` - USDT: `TRON_USDT`, `ETH_USDT`, `ARBITRUM_USDT`, `SOL_USDT`, `BASE_USDT`, `MATIC_USDT`, `BSC_USDT`
270
+ * @param {String} currency The fiat currency. Currently, only `USD` is supported.
271
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetExchangeRate200Response} and HTTP response
272
+ */
273
+ }, {
274
+ key: "getExchangeRateWithHttpInfo",
275
+ value: function getExchangeRateWithHttpInfo(token_id, currency) {
276
+ var postBody = null;
277
+ if (postBody && postBody.toJSON) {
278
+ postBody = postBody.toJSON();
279
+ }
280
+ // verify the required parameter 'token_id' is set
281
+ if (token_id === undefined || token_id === null) {
282
+ throw new Error("Missing the required parameter 'token_id' when calling getExchangeRate");
283
+ }
284
+ // verify the required parameter 'currency' is set
285
+ if (currency === undefined || currency === null) {
286
+ throw new Error("Missing the required parameter 'currency' when calling getExchangeRate");
287
+ }
288
+ var pathParams = {
289
+ 'token_id': token_id,
290
+ 'currency': currency
291
+ };
292
+ var queryParams = {};
293
+ var headerParams = {};
294
+ var formParams = {};
295
+ var authNames = ['CoboAuth'];
296
+ var contentTypes = [];
297
+ var accepts = ['application/json'];
298
+ var returnType = _GetExchangeRate200Response["default"];
299
+ return this.apiClient.callApi('/payments/exchange_rates/{token_id}/{currency}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
300
+ }
301
+
302
+ /**
303
+ * Get exchange rate
304
+ * This operation retrieves the current exchange rate between a specified currency pair.
305
+ * @param {String} token_id The token ID, which identifies the cryptocurrency. Supported values: - USDC: `ETH_USDC`, `ARBITRUM_USDC`, `SOL_USDC`, `BASE_USDC`, `MATIC_USDC`, `BSC_USDC` - USDT: `TRON_USDT`, `ETH_USDT`, `ARBITRUM_USDT`, `SOL_USDT`, `BASE_USDT`, `MATIC_USDT`, `BSC_USDT`
306
+ * @param {String} currency The fiat currency. Currently, only `USD` is supported.
307
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetExchangeRate200Response}
308
+ */
309
+ }, {
310
+ key: "getExchangeRate",
311
+ value: function getExchangeRate(token_id, currency) {
312
+ return this.getExchangeRateWithHttpInfo(token_id, currency).then(function (response_and_data) {
313
+ return response_and_data.data;
314
+ });
315
+ }
316
+
317
+ /**
318
+ * Get pay-in order's receiving address info
319
+ * This operation retrieves the detailed information about a specific pay-in address.
320
+ * @param {Object} opts Optional parameters
321
+ * @param {String} [token_id] The token ID, which identifies the cryptocurrency. Supported values: - USDC: `ETH_USDC`, `ARBITRUM_USDC`, `SOL_USDC`, `BASE_USDC`, `MATIC_USDC`, `BSC_USDC` - USDT: `TRON_USDT`, `ETH_USDT`, `ARBITRUM_USDT`, `SOL_USDT`, `BASE_USDT`, `MATIC_USDT`, `BSC_USDT`
322
+ * @param {String} [address] The receiving address.
323
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OrderAddressInfo} and HTTP response
324
+ */
325
+ }, {
326
+ key: "getPaymentOrderAddressInfoWithHttpInfo",
327
+ value: function getPaymentOrderAddressInfoWithHttpInfo(opts) {
328
+ opts = opts || {};
329
+ var postBody = null;
330
+ if (postBody && postBody.toJSON) {
331
+ postBody = postBody.toJSON();
332
+ }
333
+ var pathParams = {};
334
+ var queryParams = {
335
+ 'token_id': opts['token_id'],
336
+ 'address': opts['address']
337
+ };
338
+ var headerParams = {};
339
+ var formParams = {};
340
+ var authNames = ['OAuth2', 'CoboAuth'];
341
+ var contentTypes = [];
342
+ var accepts = ['application/json'];
343
+ var returnType = _OrderAddressInfo["default"];
344
+ return this.apiClient.callApi('/payments/orders/address_info', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
345
+ }
346
+
347
+ /**
348
+ * Get pay-in order's receiving address info
349
+ * This operation retrieves the detailed information about a specific pay-in address.
350
+ * @param {Object} opts Optional parameters
351
+ * @param {String} opts.token_id The token ID, which identifies the cryptocurrency. Supported values: - USDC: `ETH_USDC`, `ARBITRUM_USDC`, `SOL_USDC`, `BASE_USDC`, `MATIC_USDC`, `BSC_USDC` - USDT: `TRON_USDT`, `ETH_USDT`, `ARBITRUM_USDT`, `SOL_USDT`, `BASE_USDT`, `MATIC_USDT`, `BSC_USDT`
352
+ * @param {String} opts.address The receiving address.
353
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OrderAddressInfo}
354
+ */
355
+ }, {
356
+ key: "getPaymentOrderAddressInfo",
357
+ value: function getPaymentOrderAddressInfo(opts) {
358
+ return this.getPaymentOrderAddressInfoWithHttpInfo(opts).then(function (response_and_data) {
359
+ return response_and_data.data;
360
+ });
361
+ }
362
+
363
+ /**
364
+ * Get pay-in order information
365
+ * This operation retrieves details of a specific pay-in order.
366
+ * @param {String} order_id The pay-in order ID.
367
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response
368
+ */
369
+ }, {
370
+ key: "getPaymentOrderDetailByIdWithHttpInfo",
371
+ value: function getPaymentOrderDetailByIdWithHttpInfo(order_id) {
372
+ var postBody = null;
373
+ if (postBody && postBody.toJSON) {
374
+ postBody = postBody.toJSON();
375
+ }
376
+ // verify the required parameter 'order_id' is set
377
+ if (order_id === undefined || order_id === null) {
378
+ throw new Error("Missing the required parameter 'order_id' when calling getPaymentOrderDetailById");
379
+ }
380
+ var pathParams = {
381
+ 'order_id': order_id
382
+ };
383
+ var queryParams = {};
384
+ var headerParams = {};
385
+ var formParams = {};
386
+ var authNames = ['OAuth2', 'CoboAuth'];
387
+ var contentTypes = [];
388
+ var accepts = ['application/json'];
389
+ var returnType = _Order["default"];
390
+ return this.apiClient.callApi('/payments/orders/{order_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
391
+ }
392
+
393
+ /**
394
+ * Get pay-in order information
395
+ * This operation retrieves details of a specific pay-in order.
396
+ * @param {String} order_id The pay-in order ID.
397
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order}
398
+ */
399
+ }, {
400
+ key: "getPaymentOrderDetailById",
401
+ value: function getPaymentOrderDetailById(order_id) {
402
+ return this.getPaymentOrderDetailByIdWithHttpInfo(order_id).then(function (response_and_data) {
403
+ return response_and_data.data;
404
+ });
405
+ }
406
+
407
+ /**
408
+ * Get refund order information
409
+ * This operation retrieves the detailed information about a specified refund order.
410
+ * @param {String} refund_id The refund order ID.
411
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Refund} and HTTP response
412
+ */
413
+ }, {
414
+ key: "getRefundDetailByIdWithHttpInfo",
415
+ value: function getRefundDetailByIdWithHttpInfo(refund_id) {
416
+ var postBody = null;
417
+ if (postBody && postBody.toJSON) {
418
+ postBody = postBody.toJSON();
419
+ }
420
+ // verify the required parameter 'refund_id' is set
421
+ if (refund_id === undefined || refund_id === null) {
422
+ throw new Error("Missing the required parameter 'refund_id' when calling getRefundDetailById");
423
+ }
424
+ var pathParams = {
425
+ 'refund_id': refund_id
426
+ };
427
+ var queryParams = {};
428
+ var headerParams = {};
429
+ var formParams = {};
430
+ var authNames = ['OAuth2', 'CoboAuth'];
431
+ var contentTypes = [];
432
+ var accepts = ['application/json'];
433
+ var returnType = _Refund["default"];
434
+ return this.apiClient.callApi('/payments/refunds/{refund_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
435
+ }
436
+
437
+ /**
438
+ * Get refund order information
439
+ * This operation retrieves the detailed information about a specified refund order.
440
+ * @param {String} refund_id The refund order ID.
441
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Refund}
442
+ */
443
+ }, {
444
+ key: "getRefundDetailById",
445
+ value: function getRefundDetailById(refund_id) {
446
+ return this.getRefundDetailByIdWithHttpInfo(refund_id).then(function (response_and_data) {
447
+ return response_and_data.data;
448
+ });
449
+ }
450
+
451
+ /**
452
+ * List all refund orders
453
+ * This operation retrieves the information of all refund orders.
454
+ * @param {Object} opts Optional parameters
455
+ * @param {Number} [limit = 10)] The maximum number of objects to return. For most operations, the value range is [1, 50].
456
+ * @param {String} [before] This parameter specifies an object ID as a starting point for pagination, retrieving data before the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `before` to the ID of Object C (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object A. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set it to `infinity`, the last page of data is returned.
457
+ * @param {String} [after] This parameter specifies an object ID as a starting point for pagination, retrieving data after the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `after` to the ID of Object A (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object C. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
458
+ * @param {String} [merchant_id] The merchant ID.
459
+ * @param {String} [request_id] The request ID.
460
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetRefunds200Response} and HTTP response
461
+ */
462
+ }, {
463
+ key: "getRefundsWithHttpInfo",
464
+ value: function getRefundsWithHttpInfo(opts) {
465
+ opts = opts || {};
466
+ var postBody = null;
467
+ if (postBody && postBody.toJSON) {
468
+ postBody = postBody.toJSON();
469
+ }
470
+ var pathParams = {};
471
+ var queryParams = {
472
+ 'limit': opts['limit'],
473
+ 'before': opts['before'],
474
+ 'after': opts['after'],
475
+ 'merchant_id': opts['merchant_id'],
476
+ 'request_id': opts['request_id']
477
+ };
478
+ var headerParams = {};
479
+ var formParams = {};
480
+ var authNames = ['OAuth2', 'CoboAuth'];
481
+ var contentTypes = [];
482
+ var accepts = ['application/json'];
483
+ var returnType = _GetRefunds200Response["default"];
484
+ return this.apiClient.callApi('/payments/refunds', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
485
+ }
486
+
487
+ /**
488
+ * List all refund orders
489
+ * This operation retrieves the information of all refund orders.
490
+ * @param {Object} opts Optional parameters
491
+ * @param {Number} opts.limit The maximum number of objects to return. For most operations, the value range is [1, 50]. (default to 10)
492
+ * @param {String} opts.before This parameter specifies an object ID as a starting point for pagination, retrieving data before the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `before` to the ID of Object C (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object A. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set it to `infinity`, the last page of data is returned.
493
+ * @param {String} opts.after This parameter specifies an object ID as a starting point for pagination, retrieving data after the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `after` to the ID of Object A (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object C. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
494
+ * @param {String} opts.merchant_id The merchant ID.
495
+ * @param {String} opts.request_id The request ID.
496
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetRefunds200Response}
497
+ */
498
+ }, {
499
+ key: "getRefunds",
500
+ value: function getRefunds(opts) {
501
+ return this.getRefundsWithHttpInfo(opts).then(function (response_and_data) {
502
+ return response_and_data.data;
503
+ });
504
+ }
505
+
506
+ /**
507
+ * Get settlement request information
508
+ * This operation retrieves the information of a specific settlement request.
509
+ * @param {String} settlement_request_id The settlement request ID.
510
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Settlement} and HTTP response
511
+ */
512
+ }, {
513
+ key: "getSettlementByIdWithHttpInfo",
514
+ value: function getSettlementByIdWithHttpInfo(settlement_request_id) {
515
+ var postBody = null;
516
+ if (postBody && postBody.toJSON) {
517
+ postBody = postBody.toJSON();
518
+ }
519
+ // verify the required parameter 'settlement_request_id' is set
520
+ if (settlement_request_id === undefined || settlement_request_id === null) {
521
+ throw new Error("Missing the required parameter 'settlement_request_id' when calling getSettlementById");
522
+ }
523
+ var pathParams = {
524
+ 'settlement_request_id': settlement_request_id
525
+ };
526
+ var queryParams = {};
527
+ var headerParams = {};
528
+ var formParams = {};
529
+ var authNames = ['OAuth2', 'CoboAuth'];
530
+ var contentTypes = [];
531
+ var accepts = ['application/json'];
532
+ var returnType = _Settlement["default"];
533
+ return this.apiClient.callApi('/payments/settlement_requests/{settlement_request_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
534
+ }
535
+
536
+ /**
537
+ * Get settlement request information
538
+ * This operation retrieves the information of a specific settlement request.
539
+ * @param {String} settlement_request_id The settlement request ID.
540
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Settlement}
541
+ */
542
+ }, {
543
+ key: "getSettlementById",
544
+ value: function getSettlementById(settlement_request_id) {
545
+ return this.getSettlementByIdWithHttpInfo(settlement_request_id).then(function (response_and_data) {
546
+ return response_and_data.data;
547
+ });
548
+ }
549
+
550
+ /**
551
+ * Get withdrawable balances
552
+ * This operation retrieves the current withdrawable balances of specified merchants or the developer.
553
+ * @param {Object} opts Optional parameters
554
+ * @param {String} [merchant_ids] A list of merchant IDs to query.
555
+ * @param {String} [currency = 'USD')] The currency for the operation. Currently, only `USD` is supported.
556
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetSettlementInfoByIds200Response} and HTTP response
557
+ */
558
+ }, {
559
+ key: "getSettlementInfoByIdsWithHttpInfo",
560
+ value: function getSettlementInfoByIdsWithHttpInfo(opts) {
561
+ opts = opts || {};
562
+ var postBody = null;
563
+ if (postBody && postBody.toJSON) {
564
+ postBody = postBody.toJSON();
565
+ }
566
+ var pathParams = {};
567
+ var queryParams = {
568
+ 'merchant_ids': opts['merchant_ids'],
569
+ 'currency': opts['currency']
570
+ };
571
+ var headerParams = {};
572
+ var formParams = {};
573
+ var authNames = ['OAuth2', 'CoboAuth'];
574
+ var contentTypes = [];
575
+ var accepts = ['application/json'];
576
+ var returnType = _GetSettlementInfoByIds200Response["default"];
577
+ return this.apiClient.callApi('/payments/settlement_info', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
578
+ }
579
+
580
+ /**
581
+ * Get withdrawable balances
582
+ * This operation retrieves the current withdrawable balances of specified merchants or the developer.
583
+ * @param {Object} opts Optional parameters
584
+ * @param {String} opts.merchant_ids A list of merchant IDs to query.
585
+ * @param {String} opts.currency The currency for the operation. Currently, only `USD` is supported. (default to 'USD')
586
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetSettlementInfoByIds200Response}
587
+ */
588
+ }, {
589
+ key: "getSettlementInfoByIds",
590
+ value: function getSettlementInfoByIds(opts) {
591
+ return this.getSettlementInfoByIdsWithHttpInfo(opts).then(function (response_and_data) {
592
+ return response_and_data.data;
593
+ });
594
+ }
595
+
596
+ /**
597
+ * List all bank accounts
598
+ * This operation retrieves the information of all bank accounts registered.
599
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/BankAccount>} and HTTP response
600
+ */
601
+ }, {
602
+ key: "listBankAccountsWithHttpInfo",
603
+ value: function listBankAccountsWithHttpInfo() {
604
+ var postBody = null;
605
+ if (postBody && postBody.toJSON) {
606
+ postBody = postBody.toJSON();
607
+ }
608
+ var pathParams = {};
609
+ var queryParams = {};
610
+ var headerParams = {};
611
+ var formParams = {};
612
+ var authNames = ['OAuth2', 'CoboAuth'];
613
+ var contentTypes = [];
614
+ var accepts = ['application/json'];
615
+ var returnType = [_BankAccount["default"]];
616
+ return this.apiClient.callApi('/payments/bank_accounts', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
617
+ }
618
+
619
+ /**
620
+ * List all bank accounts
621
+ * This operation retrieves the information of all bank accounts registered.
622
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/BankAccount>}
623
+ */
624
+ }, {
625
+ key: "listBankAccounts",
626
+ value: function listBankAccounts() {
627
+ return this.listBankAccountsWithHttpInfo().then(function (response_and_data) {
628
+ return response_and_data.data;
629
+ });
630
+ }
631
+
632
+ /**
633
+ * List all merchants
634
+ * This operation retrieves the information of all merchants. You can filter the results by using a keyword for fuzzy search on merchant names or by specifying a wallet ID.
635
+ * @param {Object} opts Optional parameters
636
+ * @param {Number} [limit = 10)] The maximum number of objects to return. For most operations, the value range is [1, 50].
637
+ * @param {String} [before] This parameter specifies an object ID as a starting point for pagination, retrieving data before the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `before` to the ID of Object C (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object A. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set it to `infinity`, the last page of data is returned.
638
+ * @param {String} [after] This parameter specifies an object ID as a starting point for pagination, retrieving data after the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `after` to the ID of Object A (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object C. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
639
+ * @param {String} [keyword] A search term used for fuzzy matching of merchant names.
640
+ * @param {String} [wallet_id] The wallet ID.
641
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListMerchants200Response} and HTTP response
642
+ */
643
+ }, {
644
+ key: "listMerchantsWithHttpInfo",
645
+ value: function listMerchantsWithHttpInfo(opts) {
646
+ opts = opts || {};
647
+ var postBody = null;
648
+ if (postBody && postBody.toJSON) {
649
+ postBody = postBody.toJSON();
650
+ }
651
+ var pathParams = {};
652
+ var queryParams = {
653
+ 'limit': opts['limit'],
654
+ 'before': opts['before'],
655
+ 'after': opts['after'],
656
+ 'keyword': opts['keyword'],
657
+ 'wallet_id': opts['wallet_id']
658
+ };
659
+ var headerParams = {};
660
+ var formParams = {};
661
+ var authNames = ['OAuth2', 'CoboAuth'];
662
+ var contentTypes = [];
663
+ var accepts = ['application/json'];
664
+ var returnType = _ListMerchants200Response["default"];
665
+ return this.apiClient.callApi('/payments/merchants', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
666
+ }
667
+
668
+ /**
669
+ * List all merchants
670
+ * This operation retrieves the information of all merchants. You can filter the results by using a keyword for fuzzy search on merchant names or by specifying a wallet ID.
671
+ * @param {Object} opts Optional parameters
672
+ * @param {Number} opts.limit The maximum number of objects to return. For most operations, the value range is [1, 50]. (default to 10)
673
+ * @param {String} opts.before This parameter specifies an object ID as a starting point for pagination, retrieving data before the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `before` to the ID of Object C (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object A. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set it to `infinity`, the last page of data is returned.
674
+ * @param {String} opts.after This parameter specifies an object ID as a starting point for pagination, retrieving data after the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `after` to the ID of Object A (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object C. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
675
+ * @param {String} opts.keyword A search term used for fuzzy matching of merchant names.
676
+ * @param {String} opts.wallet_id The wallet ID.
677
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListMerchants200Response}
678
+ */
679
+ }, {
680
+ key: "listMerchants",
681
+ value: function listMerchants(opts) {
682
+ return this.listMerchantsWithHttpInfo(opts).then(function (response_and_data) {
683
+ return response_and_data.data;
684
+ });
685
+ }
686
+
687
+ /**
688
+ * List all pay-in orders
689
+ * This operation retrieves the information of all pay-in orders. You can filter the result by merchant ID.
690
+ * @param {Object} opts Optional parameters
691
+ * @param {Number} [limit = 10)] The maximum number of objects to return. For most operations, the value range is [1, 50].
692
+ * @param {String} [before] This parameter specifies an object ID as a starting point for pagination, retrieving data before the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `before` to the ID of Object C (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object A. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set it to `infinity`, the last page of data is returned.
693
+ * @param {String} [after] This parameter specifies an object ID as a starting point for pagination, retrieving data after the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `after` to the ID of Object A (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object C. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
694
+ * @param {String} [merchant_id] The merchant ID.
695
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListPaymentOrders200Response} and HTTP response
696
+ */
697
+ }, {
698
+ key: "listPaymentOrdersWithHttpInfo",
699
+ value: function listPaymentOrdersWithHttpInfo(opts) {
700
+ opts = opts || {};
701
+ var postBody = null;
702
+ if (postBody && postBody.toJSON) {
703
+ postBody = postBody.toJSON();
704
+ }
705
+ var pathParams = {};
706
+ var queryParams = {
707
+ 'limit': opts['limit'],
708
+ 'before': opts['before'],
709
+ 'after': opts['after'],
710
+ 'merchant_id': opts['merchant_id']
711
+ };
712
+ var headerParams = {};
713
+ var formParams = {};
714
+ var authNames = ['OAuth2', 'CoboAuth'];
715
+ var contentTypes = [];
716
+ var accepts = ['application/json'];
717
+ var returnType = _ListPaymentOrders200Response["default"];
718
+ return this.apiClient.callApi('/payments/orders', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
719
+ }
720
+
721
+ /**
722
+ * List all pay-in orders
723
+ * This operation retrieves the information of all pay-in orders. You can filter the result by merchant ID.
724
+ * @param {Object} opts Optional parameters
725
+ * @param {Number} opts.limit The maximum number of objects to return. For most operations, the value range is [1, 50]. (default to 10)
726
+ * @param {String} opts.before This parameter specifies an object ID as a starting point for pagination, retrieving data before the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `before` to the ID of Object C (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object A. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set it to `infinity`, the last page of data is returned.
727
+ * @param {String} opts.after This parameter specifies an object ID as a starting point for pagination, retrieving data after the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `after` to the ID of Object A (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object C. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
728
+ * @param {String} opts.merchant_id The merchant ID.
729
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListPaymentOrders200Response}
730
+ */
731
+ }, {
732
+ key: "listPaymentOrders",
733
+ value: function listPaymentOrders(opts) {
734
+ return this.listPaymentOrdersWithHttpInfo(opts).then(function (response_and_data) {
735
+ return response_and_data.data;
736
+ });
737
+ }
738
+
739
+ /**
740
+ * List all settlement requests
741
+ * This operation retrieves the information of all settlement requests.
742
+ * @param {Object} opts Optional parameters
743
+ * @param {Number} [limit = 10)] The maximum number of objects to return. For most operations, the value range is [1, 50].
744
+ * @param {String} [before] This parameter specifies an object ID as a starting point for pagination, retrieving data before the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `before` to the ID of Object C (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object A. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set it to `infinity`, the last page of data is returned.
745
+ * @param {String} [after] This parameter specifies an object ID as a starting point for pagination, retrieving data after the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `after` to the ID of Object A (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object C. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
746
+ * @param {String} [request_id] The request ID.
747
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListSettlementRequests200Response} and HTTP response
748
+ */
749
+ }, {
750
+ key: "listSettlementRequestsWithHttpInfo",
751
+ value: function listSettlementRequestsWithHttpInfo(opts) {
752
+ opts = opts || {};
753
+ var postBody = null;
754
+ if (postBody && postBody.toJSON) {
755
+ postBody = postBody.toJSON();
756
+ }
757
+ var pathParams = {};
758
+ var queryParams = {
759
+ 'limit': opts['limit'],
760
+ 'before': opts['before'],
761
+ 'after': opts['after'],
762
+ 'request_id': opts['request_id']
763
+ };
764
+ var headerParams = {};
765
+ var formParams = {};
766
+ var authNames = ['OAuth2', 'CoboAuth'];
767
+ var contentTypes = [];
768
+ var accepts = ['application/json'];
769
+ var returnType = _ListSettlementRequests200Response["default"];
770
+ return this.apiClient.callApi('/payments/settlement_requests', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
771
+ }
772
+
773
+ /**
774
+ * List all settlement requests
775
+ * This operation retrieves the information of all settlement requests.
776
+ * @param {Object} opts Optional parameters
777
+ * @param {Number} opts.limit The maximum number of objects to return. For most operations, the value range is [1, 50]. (default to 10)
778
+ * @param {String} opts.before This parameter specifies an object ID as a starting point for pagination, retrieving data before the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `before` to the ID of Object C (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object A. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set it to `infinity`, the last page of data is returned.
779
+ * @param {String} opts.after This parameter specifies an object ID as a starting point for pagination, retrieving data after the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `after` to the ID of Object A (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object C. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
780
+ * @param {String} opts.request_id The request ID.
781
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListSettlementRequests200Response}
782
+ */
783
+ }, {
784
+ key: "listSettlementRequests",
785
+ value: function listSettlementRequests(opts) {
786
+ return this.listSettlementRequestsWithHttpInfo(opts).then(function (response_and_data) {
787
+ return response_and_data.data;
788
+ });
789
+ }
790
+
791
+ /**
792
+ * Update bank account
793
+ * This operation updates the information of an existing bank account.
794
+ * @param {String} bank_account_id The bank account ID.
795
+ * @param {Object} opts Optional parameters
796
+ * @param {module:model/CreateBankAccountRequest} [CreateBankAccountRequest] The request body for updating an existing bank account.
797
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BankAccount} and HTTP response
798
+ */
799
+ }, {
800
+ key: "updateBankAccountByIdWithHttpInfo",
801
+ value: function updateBankAccountByIdWithHttpInfo(bank_account_id, opts) {
802
+ opts = opts || {};
803
+ var postBody = opts['CreateBankAccountRequest'];
804
+ if (postBody && postBody.toJSON) {
805
+ postBody = postBody.toJSON();
806
+ }
807
+ // verify the required parameter 'bank_account_id' is set
808
+ if (bank_account_id === undefined || bank_account_id === null) {
809
+ throw new Error("Missing the required parameter 'bank_account_id' when calling updateBankAccountById");
810
+ }
811
+ var pathParams = {
812
+ 'bank_account_id': bank_account_id
813
+ };
814
+ var queryParams = {};
815
+ var headerParams = {};
816
+ var formParams = {};
817
+ var authNames = ['OAuth2', 'CoboAuth'];
818
+ var contentTypes = ['application/json'];
819
+ var accepts = ['application/json'];
820
+ var returnType = _BankAccount["default"];
821
+ return this.apiClient.callApi('/payments/bank_accounts/{bank_account_id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
822
+ }
823
+
824
+ /**
825
+ * Update bank account
826
+ * This operation updates the information of an existing bank account.
827
+ * @param {String} bank_account_id The bank account ID.
828
+ * @param {Object} opts Optional parameters
829
+ * @param {module:model/CreateBankAccountRequest} opts.CreateBankAccountRequest The request body for updating an existing bank account.
830
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BankAccount}
831
+ */
832
+ }, {
833
+ key: "updateBankAccountById",
834
+ value: function updateBankAccountById(bank_account_id, opts) {
835
+ return this.updateBankAccountByIdWithHttpInfo(bank_account_id, opts).then(function (response_and_data) {
836
+ return response_and_data.data;
837
+ });
838
+ }
839
+
840
+ /**
841
+ * Update merchant
842
+ * This operation updates the information of an existing merchant.
843
+ * @param {String} merchant_id The merchant ID.
844
+ * @param {Object} opts Optional parameters
845
+ * @param {module:model/UpdateMerchantByIdRequest} [UpdateMerchantByIdRequest] The request body to update a merchant.
846
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Merchant} and HTTP response
847
+ */
848
+ }, {
849
+ key: "updateMerchantByIdWithHttpInfo",
850
+ value: function updateMerchantByIdWithHttpInfo(merchant_id, opts) {
851
+ opts = opts || {};
852
+ var postBody = opts['UpdateMerchantByIdRequest'];
853
+ if (postBody && postBody.toJSON) {
854
+ postBody = postBody.toJSON();
855
+ }
856
+ // verify the required parameter 'merchant_id' is set
857
+ if (merchant_id === undefined || merchant_id === null) {
858
+ throw new Error("Missing the required parameter 'merchant_id' when calling updateMerchantById");
859
+ }
860
+ var pathParams = {
861
+ 'merchant_id': merchant_id
862
+ };
863
+ var queryParams = {};
864
+ var headerParams = {};
865
+ var formParams = {};
866
+ var authNames = ['OAuth2', 'CoboAuth'];
867
+ var contentTypes = ['application/json'];
868
+ var accepts = ['application/json'];
869
+ var returnType = _Merchant["default"];
870
+ return this.apiClient.callApi('/payments/merchants/{merchant_id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
871
+ }
872
+
873
+ /**
874
+ * Update merchant
875
+ * This operation updates the information of an existing merchant.
876
+ * @param {String} merchant_id The merchant ID.
877
+ * @param {Object} opts Optional parameters
878
+ * @param {module:model/UpdateMerchantByIdRequest} opts.UpdateMerchantByIdRequest The request body to update a merchant.
879
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Merchant}
880
+ */
881
+ }, {
882
+ key: "updateMerchantById",
883
+ value: function updateMerchantById(merchant_id, opts) {
884
+ return this.updateMerchantByIdWithHttpInfo(merchant_id, opts).then(function (response_and_data) {
885
+ return response_and_data.data;
886
+ });
887
+ }
888
+
889
+ /**
890
+ * Update pay-in order
891
+ * This operation updates a pay-in order. Use this operation to expire a pay-in order that is no longer needed.
892
+ * @param {String} order_id The pay-in order ID.
893
+ * @param {Object} opts Optional parameters
894
+ * @param {module:model/UpdatePaymentOrderRequest} [UpdatePaymentOrderRequest] The request body to update a pay-in order.
895
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response
896
+ */
897
+ }, {
898
+ key: "updatePaymentOrderWithHttpInfo",
899
+ value: function updatePaymentOrderWithHttpInfo(order_id, opts) {
900
+ opts = opts || {};
901
+ var postBody = opts['UpdatePaymentOrderRequest'];
902
+ if (postBody && postBody.toJSON) {
903
+ postBody = postBody.toJSON();
904
+ }
905
+ // verify the required parameter 'order_id' is set
906
+ if (order_id === undefined || order_id === null) {
907
+ throw new Error("Missing the required parameter 'order_id' when calling updatePaymentOrder");
908
+ }
909
+ var pathParams = {
910
+ 'order_id': order_id
911
+ };
912
+ var queryParams = {};
913
+ var headerParams = {};
914
+ var formParams = {};
915
+ var authNames = ['OAuth2', 'CoboAuth'];
916
+ var contentTypes = ['application/json'];
917
+ var accepts = ['application/json'];
918
+ var returnType = _Order["default"];
919
+ return this.apiClient.callApi('/payments/orders/{order_id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
920
+ }
921
+
922
+ /**
923
+ * Update pay-in order
924
+ * This operation updates a pay-in order. Use this operation to expire a pay-in order that is no longer needed.
925
+ * @param {String} order_id The pay-in order ID.
926
+ * @param {Object} opts Optional parameters
927
+ * @param {module:model/UpdatePaymentOrderRequest} opts.UpdatePaymentOrderRequest The request body to update a pay-in order.
928
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order}
929
+ */
930
+ }, {
931
+ key: "updatePaymentOrder",
932
+ value: function updatePaymentOrder(order_id, opts) {
933
+ return this.updatePaymentOrderWithHttpInfo(order_id, opts).then(function (response_and_data) {
934
+ return response_and_data.data;
935
+ });
936
+ }
937
+ }]);
938
+ }();