@cobo/cobo-waas2 1.14.0 → 1.16.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 (216) hide show
  1. package/README.md +70 -5
  2. package/dist/ApiClient.js +2 -3
  3. package/dist/PreRequestScript.js +1 -1
  4. package/dist/api/AddressBooksApi.js +4 -4
  5. package/dist/api/AppWorkflowsApi.js +275 -0
  6. package/dist/api/DevelopersApi.js +4 -4
  7. package/dist/api/DevelopersWebhooksApi.js +12 -12
  8. package/dist/api/FeeStationApi.js +26 -26
  9. package/dist/api/PaymentApi.js +16 -16
  10. package/dist/api/StakingsApi.js +28 -28
  11. package/dist/api/TransactionsApi.js +16 -8
  12. package/dist/api/WalletsApi.js +121 -70
  13. package/dist/api/WalletsExchangeWalletApi.js +8 -8
  14. package/dist/api/WalletsMPCWalletsApi.js +20 -20
  15. package/dist/crypto/ApiSigner.js +1 -2
  16. package/dist/index.js +420 -0
  17. package/dist/model/AddressBook.js +18 -0
  18. package/dist/model/AppWorkflow.js +173 -0
  19. package/dist/model/AppWorkflowField.js +137 -0
  20. package/dist/model/AppWorkflowPolicy.js +144 -0
  21. package/dist/model/ApprovalEntry.js +148 -0
  22. package/dist/model/ApprovalRequest.js +178 -0
  23. package/dist/model/ApprovalRequestDetail.js +176 -0
  24. package/dist/model/ApprovalStatus.js +71 -0
  25. package/dist/model/ApprovalUser.js +146 -0
  26. package/dist/model/BabylonStakeExtra.js +16 -0
  27. package/dist/model/BankAccount.js +18 -0
  28. package/dist/model/BatchCheckUtxo201Response.js +107 -0
  29. package/dist/model/BatchCheckUtxoRequest.js +142 -0
  30. package/dist/model/BatchUTXOParam.js +123 -0
  31. package/dist/model/ChainInfo.js +9 -0
  32. package/dist/model/CreateApprovalRequest201Response.js +109 -0
  33. package/dist/model/CreateSettlement.js +4 -29
  34. package/dist/model/CreateStakeActivityExtra.js +6 -0
  35. package/dist/model/CreateTokenListingRequest201Response.js +2 -2
  36. package/dist/model/CreateTokenListingRequestRequest.js +4 -4
  37. package/dist/model/CustodialWeb3TransferSource.js +1 -1
  38. package/dist/model/EstimateContractCallFeeParams.js +13 -0
  39. package/dist/model/EstimateFeeParams.js +6 -0
  40. package/dist/model/EstimateTransferFeeParams.js +13 -0
  41. package/dist/model/FeeStationTransfer.js +1 -1
  42. package/dist/model/ListApprovalRequests200Response.js +123 -0
  43. package/dist/model/Merchant.js +18 -0
  44. package/dist/model/MpcTransferSource.js +1 -1
  45. package/dist/model/Order.js +49 -0
  46. package/dist/model/PaymentOrderEventData.js +64 -0
  47. package/dist/model/PaymentRefundEventData.js +77 -0
  48. package/dist/model/PaymentSettlementEvent.js +46 -0
  49. package/dist/model/PaymentTransaction.js +13 -0
  50. package/dist/model/PolicyAction.js +123 -0
  51. package/dist/model/PolicyActionContent.js +167 -0
  52. package/dist/model/PolicyActionType.js +66 -0
  53. package/dist/model/PolicyCondition.js +148 -0
  54. package/dist/model/PolicyFieldOperator.js +76 -0
  55. package/dist/model/PolicyFieldValueType.js +61 -0
  56. package/dist/model/Refund.js +53 -0
  57. package/dist/model/RequestApproval.js +188 -0
  58. package/dist/model/RevokeApprovalRequest201Response.js +118 -0
  59. package/dist/model/RevokeApprovalRequestRequest.js +110 -0
  60. package/dist/model/Settlement.js +31 -0
  61. package/dist/model/SettlementDetail.js +57 -0
  62. package/dist/model/SettlementInfo.js +31 -0
  63. package/dist/model/SwapActivity.js +3 -3
  64. package/dist/model/SwapActivityApprovers.js +122 -0
  65. package/dist/model/SwapActivityDetail.js +36 -6
  66. package/dist/model/SwapApproversStatus.js +66 -0
  67. package/dist/model/SwapQuote.js +49 -4
  68. package/dist/model/SwapToken.js +2 -2
  69. package/dist/model/TSSBaseRequestEventData.js +163 -0
  70. package/dist/model/TSSCallbackActionType.js +61 -0
  71. package/dist/model/TSSCallbackRequest.js +122 -0
  72. package/dist/model/TSSCallbackRequestType.js +76 -0
  73. package/dist/model/TSSCallbackResponse.js +118 -0
  74. package/dist/model/TSSCurve.js +61 -0
  75. package/dist/model/TSSCurveType.js +61 -0
  76. package/dist/model/TSSEvent.js +158 -0
  77. package/dist/model/TSSEventData.js +278 -0
  78. package/dist/model/TSSEventDataType.js +71 -0
  79. package/dist/model/TSSEventType.js +136 -0
  80. package/dist/model/TSSGroup.js +221 -0
  81. package/dist/model/TSSGroupType.js +61 -0
  82. package/dist/model/TSSGroups.js +1 -1
  83. package/dist/model/TSSKeyGenEventData.js +228 -0
  84. package/dist/model/TSSKeyGenExtra.js +154 -0
  85. package/dist/model/TSSKeyGenRequest.js +130 -0
  86. package/dist/model/TSSKeyReshareEventData.js +228 -0
  87. package/dist/model/TSSKeyReshareExtra.js +169 -0
  88. package/dist/model/TSSKeyReshareRequest.js +177 -0
  89. package/dist/model/TSSKeyShareSignDetail.js +100 -0
  90. package/dist/model/TSSKeyShareSignEventData.js +228 -0
  91. package/dist/model/TSSKeyShareSignExtra.js +171 -0
  92. package/dist/model/TSSKeyShareSignRequest.js +146 -0
  93. package/dist/model/TSSKeyShareSignSignature.js +126 -0
  94. package/dist/model/TSSKeyShareSignSignatures.js +107 -0
  95. package/dist/model/TSSKeySignEventData.js +228 -0
  96. package/dist/model/TSSKeySignExtra.js +203 -0
  97. package/dist/model/TSSKeySignRequest.js +192 -0
  98. package/dist/model/TSSParticipant.js +113 -0
  99. package/dist/model/TSSProtocol.js +66 -0
  100. package/dist/model/TSSRequestTypeEenum.js +71 -0
  101. package/dist/model/TSSSignature.js +139 -0
  102. package/dist/model/TSSSignatureType.js +66 -0
  103. package/dist/model/TSSSignatures.js +125 -0
  104. package/dist/model/TSSStatus.js +96 -0
  105. package/dist/model/TokenListing.js +10 -10
  106. package/dist/model/TokenListingEventData.js +15 -15
  107. package/dist/model/TransactionCoboCategory.js +102 -7
  108. package/dist/model/TransactionRbfSource.js +1 -1
  109. package/dist/model/TransactionSubStatus.js +35 -0
  110. package/dist/model/UTXO.js +9 -0
  111. package/dist/model/WebhookEventData.js +15 -9
  112. package/docs/AddressBook.md +2 -0
  113. package/docs/AddressBooksApi.md +2 -2
  114. package/docs/AppWorkflow.md +12 -0
  115. package/docs/AppWorkflowField.md +11 -0
  116. package/docs/AppWorkflowPolicy.md +10 -0
  117. package/docs/AppWorkflowsApi.md +273 -0
  118. package/docs/ApprovalEntry.md +11 -0
  119. package/docs/ApprovalRequest.md +13 -0
  120. package/docs/ApprovalRequestDetail.md +13 -0
  121. package/docs/ApprovalStatus.md +16 -0
  122. package/docs/ApprovalUser.md +12 -0
  123. package/docs/BabylonStakeExtra.md +1 -0
  124. package/docs/BankAccount.md +2 -0
  125. package/docs/BatchCheckUtxo201Response.md +9 -0
  126. package/docs/BatchCheckUtxoRequest.md +10 -0
  127. package/docs/BatchUTXOParam.md +10 -0
  128. package/docs/ChainInfo.md +1 -0
  129. package/docs/CreateApprovalRequest201Response.md +9 -0
  130. package/docs/CreateSettlement.md +2 -2
  131. package/docs/CreateStakeActivityExtra.md +1 -0
  132. package/docs/CreateTokenListingRequest201Response.md +1 -1
  133. package/docs/CreateTokenListingRequestRequest.md +2 -2
  134. package/docs/CustodialWeb3TransferSource.md +1 -1
  135. package/docs/DevelopersApi.md +2 -2
  136. package/docs/DevelopersWebhooksApi.md +6 -6
  137. package/docs/EstimateContractCallFeeParams.md +1 -0
  138. package/docs/EstimateFeeParams.md +1 -0
  139. package/docs/EstimateTransferFeeParams.md +1 -0
  140. package/docs/FeeStationApi.md +14 -14
  141. package/docs/ListApprovalRequests200Response.md +10 -0
  142. package/docs/Merchant.md +2 -0
  143. package/docs/MpcTransferSource.md +1 -1
  144. package/docs/Order.md +3 -0
  145. package/docs/PaymentApi.md +8 -8
  146. package/docs/PaymentOrderEventData.md +3 -0
  147. package/docs/PaymentRefundEventData.md +5 -0
  148. package/docs/PaymentSettlementEvent.md +3 -0
  149. package/docs/PaymentTransaction.md +1 -0
  150. package/docs/PolicyAction.md +10 -0
  151. package/docs/PolicyActionContent.md +25 -0
  152. package/docs/PolicyActionType.md +14 -0
  153. package/docs/PolicyCondition.md +12 -0
  154. package/docs/PolicyFieldOperator.md +18 -0
  155. package/docs/PolicyFieldValueType.md +12 -0
  156. package/docs/Refund.md +5 -0
  157. package/docs/RequestApproval.md +13 -0
  158. package/docs/RevokeApprovalRequest201Response.md +10 -0
  159. package/docs/RevokeApprovalRequestRequest.md +9 -0
  160. package/docs/Settlement.md +3 -0
  161. package/docs/SettlementDetail.md +5 -0
  162. package/docs/SettlementInfo.md +3 -0
  163. package/docs/StakingsApi.md +14 -14
  164. package/docs/SwapActivity.md +3 -3
  165. package/docs/SwapActivityApprovers.md +10 -0
  166. package/docs/SwapActivityDetail.md +4 -3
  167. package/docs/SwapApproversStatus.md +14 -0
  168. package/docs/SwapQuote.md +3 -0
  169. package/docs/SwapToken.md +2 -2
  170. package/docs/TSSBaseRequestEventData.md +14 -0
  171. package/docs/TSSCallbackActionType.md +12 -0
  172. package/docs/TSSCallbackRequest.md +12 -0
  173. package/docs/TSSCallbackRequestType.md +18 -0
  174. package/docs/TSSCallbackResponse.md +12 -0
  175. package/docs/TSSCurve.md +12 -0
  176. package/docs/TSSCurveType.md +12 -0
  177. package/docs/TSSEvent.md +13 -0
  178. package/docs/TSSEventData.md +16 -0
  179. package/docs/TSSEventDataType.md +16 -0
  180. package/docs/TSSEventType.md +42 -0
  181. package/docs/TSSGroup.md +19 -0
  182. package/docs/TSSGroupType.md +12 -0
  183. package/docs/TSSKeyGenEventData.md +16 -0
  184. package/docs/TSSKeyGenExtra.md +13 -0
  185. package/docs/TSSKeyGenRequest.md +13 -0
  186. package/docs/TSSKeyReshareEventData.md +16 -0
  187. package/docs/TSSKeyReshareExtra.md +14 -0
  188. package/docs/TSSKeyReshareRequest.md +17 -0
  189. package/docs/TSSKeyShareSignDetail.md +10 -0
  190. package/docs/TSSKeyShareSignEventData.md +16 -0
  191. package/docs/TSSKeyShareSignExtra.md +13 -0
  192. package/docs/TSSKeyShareSignRequest.md +12 -0
  193. package/docs/TSSKeyShareSignSignature.md +12 -0
  194. package/docs/TSSKeyShareSignSignatures.md +9 -0
  195. package/docs/TSSKeySignEventData.md +16 -0
  196. package/docs/TSSKeySignExtra.md +15 -0
  197. package/docs/TSSKeySignRequest.md +18 -0
  198. package/docs/TSSParticipant.md +11 -0
  199. package/docs/TSSProtocol.md +14 -0
  200. package/docs/TSSRequestTypeEenum.md +16 -0
  201. package/docs/TSSSignature.md +13 -0
  202. package/docs/TSSSignatureType.md +14 -0
  203. package/docs/TSSSignatures.md +11 -0
  204. package/docs/TSSStatus.md +26 -0
  205. package/docs/TokenListing.md +6 -6
  206. package/docs/TokenListingEventData.md +6 -6
  207. package/docs/TransactionCoboCategory.md +41 -3
  208. package/docs/TransactionRbfSource.md +1 -1
  209. package/docs/TransactionSubStatus.md +14 -0
  210. package/docs/TransactionsApi.md +8 -4
  211. package/docs/UTXO.md +1 -0
  212. package/docs/WalletsApi.md +91 -36
  213. package/docs/WalletsExchangeWalletApi.md +4 -4
  214. package/docs/WalletsMPCWalletsApi.md +10 -10
  215. package/docs/WebhookEventData.md +8 -7
  216. package/package.json +1 -1
@@ -71,9 +71,15 @@ var SettlementDetail = /*#__PURE__*/function () {
71
71
  if (data.hasOwnProperty('chain_id')) {
72
72
  obj['chain_id'] = _ApiClient["default"].convertToType(data['chain_id'], 'String');
73
73
  }
74
+ if (data.hasOwnProperty('merchant_id')) {
75
+ obj['merchant_id'] = _ApiClient["default"].convertToType(data['merchant_id'], 'String');
76
+ }
74
77
  if (data.hasOwnProperty('amount')) {
75
78
  obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
76
79
  }
80
+ if (data.hasOwnProperty('settled_amount')) {
81
+ obj['settled_amount'] = _ApiClient["default"].convertToType(data['settled_amount'], 'String');
82
+ }
77
83
  if (data.hasOwnProperty('status')) {
78
84
  obj['status'] = _SettleStatus["default"].constructFromObject(data['status']);
79
85
  }
@@ -83,6 +89,15 @@ var SettlementDetail = /*#__PURE__*/function () {
83
89
  if (data.hasOwnProperty('transactions')) {
84
90
  obj['transactions'] = _ApiClient["default"].convertToType(data['transactions'], [_PaymentTransaction["default"]]);
85
91
  }
92
+ if (data.hasOwnProperty('created_timestamp')) {
93
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
94
+ }
95
+ if (data.hasOwnProperty('updated_timestamp')) {
96
+ obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
97
+ }
98
+ if (data.hasOwnProperty('crypto_address_id')) {
99
+ obj['crypto_address_id'] = _ApiClient["default"].convertToType(data['crypto_address_id'], 'String');
100
+ }
86
101
  }
87
102
  return obj;
88
103
  }
@@ -108,9 +123,17 @@ var SettlementDetail = /*#__PURE__*/function () {
108
123
  throw new Error("Expected the field `chain_id` to be a primitive type in the JSON string but got " + data['chain_id']);
109
124
  }
110
125
  // ensure the json data is a string
126
+ if (data['merchant_id'] && !(typeof data['merchant_id'] === 'string' || data['merchant_id'] instanceof String)) {
127
+ throw new Error("Expected the field `merchant_id` to be a primitive type in the JSON string but got " + data['merchant_id']);
128
+ }
129
+ // ensure the json data is a string
111
130
  if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
112
131
  throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
113
132
  }
133
+ // ensure the json data is a string
134
+ if (data['settled_amount'] && !(typeof data['settled_amount'] === 'string' || data['settled_amount'] instanceof String)) {
135
+ throw new Error("Expected the field `settled_amount` to be a primitive type in the JSON string but got " + data['settled_amount']);
136
+ }
114
137
  // validate the optional field `bank_account`
115
138
  if (data['bank_account']) {
116
139
  // data not null
@@ -139,6 +162,10 @@ var SettlementDetail = /*#__PURE__*/function () {
139
162
  }
140
163
  ;
141
164
  }
165
+ // ensure the json data is a string
166
+ if (data['crypto_address_id'] && !(typeof data['crypto_address_id'] === 'string' || data['crypto_address_id'] instanceof String)) {
167
+ throw new Error("Expected the field `crypto_address_id` to be a primitive type in the JSON string but got " + data['crypto_address_id']);
168
+ }
142
169
  return true;
143
170
  }
144
171
  }]);
@@ -161,12 +188,24 @@ SettlementDetail.prototype['token_id'] = undefined;
161
188
  */
162
189
  SettlementDetail.prototype['chain_id'] = undefined;
163
190
 
191
+ /**
192
+ * The Merchant ID associated with this settlement.
193
+ * @member {String} merchant_id
194
+ */
195
+ SettlementDetail.prototype['merchant_id'] = undefined;
196
+
164
197
  /**
165
198
  * The settlement amount. - If `token_id` is specified, this represents the settlement amount in the specified cryptocurrency. - If `token_id` is not specified, this represents the settlement amount in the specified fiat currency.
166
199
  * @member {String} amount
167
200
  */
168
201
  SettlementDetail.prototype['amount'] = undefined;
169
202
 
203
+ /**
204
+ * The settled amount of this settlement detail. - If `token_id` is specified, this represents the actual settled amount in the specified cryptocurrency. - If `token_id` is not specified, this represents the actual settled amount in the specified fiat currency.
205
+ * @member {String} settled_amount
206
+ */
207
+ SettlementDetail.prototype['settled_amount'] = undefined;
208
+
170
209
  /**
171
210
  * @member {module:model/SettleStatus} status
172
211
  */
@@ -182,4 +221,22 @@ SettlementDetail.prototype['bank_account'] = undefined;
182
221
  * @member {Array.<module:model/PaymentTransaction>} transactions
183
222
  */
184
223
  SettlementDetail.prototype['transactions'] = undefined;
224
+
225
+ /**
226
+ * The created time of the settlement, represented as a UNIX timestamp in seconds.
227
+ * @member {Number} created_timestamp
228
+ */
229
+ SettlementDetail.prototype['created_timestamp'] = undefined;
230
+
231
+ /**
232
+ * The updated time of the settlement, represented as a UNIX timestamp in seconds.
233
+ * @member {Number} updated_timestamp
234
+ */
235
+ SettlementDetail.prototype['updated_timestamp'] = undefined;
236
+
237
+ /**
238
+ * Unique identifier for the pre-approved crypto address, used to reference the address securely in requests.
239
+ * @member {String} crypto_address_id
240
+ */
241
+ SettlementDetail.prototype['crypto_address_id'] = undefined;
185
242
  var _default = exports["default"] = SettlementDetail;
@@ -80,6 +80,15 @@ var SettlementInfo = /*#__PURE__*/function () {
80
80
  if (data.hasOwnProperty('pending_currency_balance')) {
81
81
  obj['pending_currency_balance'] = _ApiClient["default"].convertToType(data['pending_currency_balance'], 'String');
82
82
  }
83
+ if (data.hasOwnProperty('settled_amount')) {
84
+ obj['settled_amount'] = _ApiClient["default"].convertToType(data['settled_amount'], 'String');
85
+ }
86
+ if (data.hasOwnProperty('created_timestamp')) {
87
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
88
+ }
89
+ if (data.hasOwnProperty('updated_timestamp')) {
90
+ obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
91
+ }
83
92
  }
84
93
  return obj;
85
94
  }
@@ -131,6 +140,10 @@ var SettlementInfo = /*#__PURE__*/function () {
131
140
  if (data['pending_currency_balance'] && !(typeof data['pending_currency_balance'] === 'string' || data['pending_currency_balance'] instanceof String)) {
132
141
  throw new Error("Expected the field `pending_currency_balance` to be a primitive type in the JSON string but got " + data['pending_currency_balance']);
133
142
  }
143
+ // ensure the json data is a string
144
+ if (data['settled_amount'] && !(typeof data['settled_amount'] === 'string' || data['settled_amount'] instanceof String)) {
145
+ throw new Error("Expected the field `settled_amount` to be a primitive type in the JSON string but got " + data['settled_amount']);
146
+ }
134
147
  return true;
135
148
  }
136
149
  }]);
@@ -172,4 +185,22 @@ SettlementInfo.prototype['pending_amount'] = undefined;
172
185
  * @member {String} pending_currency_balance
173
186
  */
174
187
  SettlementInfo.prototype['pending_currency_balance'] = undefined;
188
+
189
+ /**
190
+ * The amount already settled, in the specified cryptocurrency.
191
+ * @member {String} settled_amount
192
+ */
193
+ SettlementInfo.prototype['settled_amount'] = undefined;
194
+
195
+ /**
196
+ * The created time of the settlement, represented as a UNIX timestamp in seconds.
197
+ * @member {Number} created_timestamp
198
+ */
199
+ SettlementInfo.prototype['created_timestamp'] = undefined;
200
+
201
+ /**
202
+ * The updated time of the settlement, represented as a UNIX timestamp in seconds.
203
+ * @member {Number} updated_timestamp
204
+ */
205
+ SettlementInfo.prototype['updated_timestamp'] = undefined;
175
206
  var _default = exports["default"] = SettlementInfo;
@@ -196,13 +196,13 @@ SwapActivity.prototype['request_id'] = undefined;
196
196
  SwapActivity.prototype['wallet_id'] = undefined;
197
197
 
198
198
  /**
199
- * The token symbol to swap from.
199
+ * The token ID to pay.
200
200
  * @member {String} pay_token_id
201
201
  */
202
202
  SwapActivity.prototype['pay_token_id'] = undefined;
203
203
 
204
204
  /**
205
- * The token symbol to swap to.
205
+ * The token ID to receive.
206
206
  * @member {String} receive_token_id
207
207
  */
208
208
  SwapActivity.prototype['receive_token_id'] = undefined;
@@ -220,7 +220,7 @@ SwapActivity.prototype['pay_amount'] = undefined;
220
220
  SwapActivity.prototype['receive_amount'] = undefined;
221
221
 
222
222
  /**
223
- * The fee token symbol.
223
+ * The fee token ID.
224
224
  * @member {String} fee_token_id
225
225
  */
226
226
  SwapActivity.prototype['fee_token_id'] = undefined;
@@ -0,0 +1,122 @@
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 _SwapApproversStatus = _interopRequireDefault(require("./SwapApproversStatus"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ 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); }
11
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ 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); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ 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); } /**
19
+ * Cobo Wallet as a Service 2.0
20
+ *
21
+ * Contact: help@cobo.com
22
+ *
23
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24
+ * https://openapi-generator.tech
25
+ * Do not edit the class manually.
26
+ *
27
+ */
28
+ /**
29
+ * The SwapActivityApprovers model module.
30
+ * @module model/SwapActivityApprovers
31
+ */
32
+ var SwapActivityApprovers = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>SwapActivityApprovers</code>.
35
+ * The approvers data for swap activity.
36
+ * @alias module:model/SwapActivityApprovers
37
+ * @param name {String} The approver name of the swap activity.
38
+ * @param status {module:model/SwapApproversStatus}
39
+ */
40
+ function SwapActivityApprovers(name, status) {
41
+ _classCallCheck(this, SwapActivityApprovers);
42
+ SwapActivityApprovers.initialize(this, name, status);
43
+ }
44
+
45
+ /**
46
+ * Initializes the fields of this object.
47
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
48
+ * Only for internal use.
49
+ */
50
+ return _createClass(SwapActivityApprovers, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, name, status) {
53
+ obj['name'] = name;
54
+ obj['status'] = status;
55
+ }
56
+
57
+ /**
58
+ * Constructs a <code>SwapActivityApprovers</code> from a plain JavaScript object, optionally creating a new instance.
59
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
60
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
61
+ * @param {module:model/SwapActivityApprovers} obj Optional instance to populate.
62
+ * @return {module:model/SwapActivityApprovers} The populated <code>SwapActivityApprovers</code> instance.
63
+ */
64
+ }, {
65
+ key: "constructFromObject",
66
+ value: function constructFromObject(data, obj) {
67
+ if (data) {
68
+ obj = obj || new SwapActivityApprovers();
69
+ if (data.hasOwnProperty('name')) {
70
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
71
+ }
72
+ if (data.hasOwnProperty('status')) {
73
+ obj['status'] = _SwapApproversStatus["default"].constructFromObject(data['status']);
74
+ }
75
+ }
76
+ return obj;
77
+ }
78
+
79
+ /**
80
+ * Validates the JSON data with respect to <code>SwapActivityApprovers</code>.
81
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
82
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>SwapActivityApprovers</code>.
83
+ */
84
+ }, {
85
+ key: "validateJSON",
86
+ value: function validateJSON(data) {
87
+ // check to make sure all required properties are present in the JSON string
88
+ var _iterator = _createForOfIteratorHelper(SwapActivityApprovers.RequiredProperties),
89
+ _step;
90
+ try {
91
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
92
+ var property = _step.value;
93
+ if (!data.hasOwnProperty(property)) {
94
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
95
+ }
96
+ }
97
+ // ensure the json data is a string
98
+ } catch (err) {
99
+ _iterator.e(err);
100
+ } finally {
101
+ _iterator.f();
102
+ }
103
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
104
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
105
+ }
106
+ return true;
107
+ }
108
+ }]);
109
+ }();
110
+ SwapActivityApprovers.RequiredProperties = ["name", "status"];
111
+
112
+ /**
113
+ * The approver name of the swap activity.
114
+ * @member {String} name
115
+ */
116
+ SwapActivityApprovers.prototype['name'] = undefined;
117
+
118
+ /**
119
+ * @member {module:model/SwapApproversStatus} status
120
+ */
121
+ SwapActivityApprovers.prototype['status'] = undefined;
122
+ var _default = exports["default"] = SwapActivityApprovers;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _SwapActivity = _interopRequireDefault(require("./SwapActivity"));
9
+ var _SwapActivityApprovers = _interopRequireDefault(require("./SwapActivityApprovers"));
9
10
  var _SwapActivityStatus = _interopRequireDefault(require("./SwapActivityStatus"));
10
11
  var _SwapActivityTimeline = _interopRequireDefault(require("./SwapActivityTimeline"));
11
12
  var _SwapType = _interopRequireDefault(require("./SwapType"));
@@ -118,6 +119,9 @@ var SwapActivityDetail = /*#__PURE__*/function () {
118
119
  if (data.hasOwnProperty('timeline')) {
119
120
  obj['timeline'] = _ApiClient["default"].convertToType(data['timeline'], [_SwapActivityTimeline["default"]]);
120
121
  }
122
+ if (data.hasOwnProperty('approvers')) {
123
+ obj['approvers'] = _ApiClient["default"].convertToType(data['approvers'], [_SwapActivityApprovers["default"]]);
124
+ }
121
125
  }
122
126
  return obj;
123
127
  }
@@ -195,6 +199,27 @@ var SwapActivityDetail = /*#__PURE__*/function () {
195
199
  }
196
200
  ;
197
201
  }
202
+ if (data['approvers']) {
203
+ // data not null
204
+ // ensure the json data is an array
205
+ if (!Array.isArray(data['approvers'])) {
206
+ throw new Error("Expected the field `approvers` to be an array in the JSON data but got " + data['approvers']);
207
+ }
208
+ // validate the optional field `approvers` (array)
209
+ var _iterator2 = _createForOfIteratorHelper(data['approvers']),
210
+ _step2;
211
+ try {
212
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
213
+ var _item = _step2.value;
214
+ _SwapActivityApprovers["default"].validateJSON(_item);
215
+ }
216
+ } catch (err) {
217
+ _iterator2.e(err);
218
+ } finally {
219
+ _iterator2.f();
220
+ }
221
+ ;
222
+ }
198
223
  return true;
199
224
  }
200
225
  }]);
@@ -228,13 +253,13 @@ SwapActivityDetail.prototype['request_id'] = undefined;
228
253
  SwapActivityDetail.prototype['wallet_id'] = undefined;
229
254
 
230
255
  /**
231
- * The token symbol to swap from.
256
+ * The token ID to pay.
232
257
  * @member {String} pay_token_id
233
258
  */
234
259
  SwapActivityDetail.prototype['pay_token_id'] = undefined;
235
260
 
236
261
  /**
237
- * The token symbol to swap to.
262
+ * The token ID to receive.
238
263
  * @member {String} receive_token_id
239
264
  */
240
265
  SwapActivityDetail.prototype['receive_token_id'] = undefined;
@@ -252,7 +277,7 @@ SwapActivityDetail.prototype['pay_amount'] = undefined;
252
277
  SwapActivityDetail.prototype['receive_amount'] = undefined;
253
278
 
254
279
  /**
255
- * The fee token symbol.
280
+ * The fee token ID.
256
281
  * @member {String} fee_token_id
257
282
  */
258
283
  SwapActivityDetail.prototype['fee_token_id'] = undefined;
@@ -297,6 +322,11 @@ SwapActivityDetail.prototype['updated_timestamp'] = undefined;
297
322
  */
298
323
  SwapActivityDetail.prototype['timeline'] = undefined;
299
324
 
325
+ /**
326
+ * @member {Array.<module:model/SwapActivityApprovers>} approvers
327
+ */
328
+ SwapActivityDetail.prototype['approvers'] = undefined;
329
+
300
330
  // Implement SwapActivity interface:
301
331
  /**
302
332
  * The unique identifier of the swap activity.
@@ -322,12 +352,12 @@ _SwapActivity["default"].prototype['request_id'] = undefined;
322
352
  */
323
353
  _SwapActivity["default"].prototype['wallet_id'] = undefined;
324
354
  /**
325
- * The token symbol to swap from.
355
+ * The token ID to pay.
326
356
  * @member {String} pay_token_id
327
357
  */
328
358
  _SwapActivity["default"].prototype['pay_token_id'] = undefined;
329
359
  /**
330
- * The token symbol to swap to.
360
+ * The token ID to receive.
331
361
  * @member {String} receive_token_id
332
362
  */
333
363
  _SwapActivity["default"].prototype['receive_token_id'] = undefined;
@@ -342,7 +372,7 @@ _SwapActivity["default"].prototype['pay_amount'] = undefined;
342
372
  */
343
373
  _SwapActivity["default"].prototype['receive_amount'] = undefined;
344
374
  /**
345
- * The fee token symbol.
375
+ * The fee token ID.
346
376
  * @member {String} fee_token_id
347
377
  */
348
378
  _SwapActivity["default"].prototype['fee_token_id'] = undefined;
@@ -0,0 +1,66 @@
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
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ 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); }
10
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ 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); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ 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); } /**
16
+ * Cobo Wallet as a Service 2.0
17
+ *
18
+ * Contact: help@cobo.com
19
+ *
20
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
21
+ * https://openapi-generator.tech
22
+ * Do not edit the class manually.
23
+ *
24
+ */
25
+ /**
26
+ * Enum class SwapApproversStatus.
27
+ * @enum {}
28
+ * @readonly
29
+ */
30
+ var SwapApproversStatus = exports["default"] = /*#__PURE__*/function () {
31
+ function SwapApproversStatus() {
32
+ _classCallCheck(this, SwapApproversStatus);
33
+ /**
34
+ * value: "Pending"
35
+ * @const
36
+ */
37
+ _defineProperty(this, "Pending", "Pending");
38
+ /**
39
+ * value: "Approved"
40
+ * @const
41
+ */
42
+ _defineProperty(this, "Approved", "Approved");
43
+ /**
44
+ * value: "Rejected"
45
+ * @const
46
+ */
47
+ _defineProperty(this, "Rejected", "Rejected");
48
+ /**
49
+ * value: "unknown_default_open_api"
50
+ * @const
51
+ */
52
+ _defineProperty(this, "unknown_default_open_api", "unknown_default_open_api");
53
+ }
54
+ return _createClass(SwapApproversStatus, null, [{
55
+ key: "constructFromObject",
56
+ value:
57
+ /**
58
+ * Returns a <code>SwapApproversStatus</code> enum value from a Javascript object name.
59
+ * @param {Object} data The plain JavaScript object containing the name of the enum value.
60
+ * @return {module:model/SwapApproversStatus} The enum <code>SwapApproversStatus</code> value.
61
+ */
62
+ function constructFromObject(object) {
63
+ return object;
64
+ }
65
+ }]);
66
+ }();
@@ -33,14 +33,17 @@ var SwapQuote = /*#__PURE__*/function () {
33
33
  * Constructs a new <code>SwapQuote</code>.
34
34
  * @alias module:model/SwapQuote
35
35
  * @param quote_id {String} The unique id of quote.
36
+ * @param pay_token_id {String} The token ID to pay.
36
37
  * @param pay_amount {String} The amount of tokens to pay.
38
+ * @param receive_token_id {String} The token ID to receive.
37
39
  * @param receive_amount {String} The amount of tokens to receive.
40
+ * @param fee_token_id {String} The fee token ID.
38
41
  * @param fee_amount {String} The amount of tokens to pay for fee.
39
42
  * @param quote_expired_timestamp {Number} The time when the quote will expire, in Unix timestamp format, measured in milliseconds.
40
43
  */
41
- function SwapQuote(quote_id, pay_amount, receive_amount, fee_amount, quote_expired_timestamp) {
44
+ function SwapQuote(quote_id, pay_token_id, pay_amount, receive_token_id, receive_amount, fee_token_id, fee_amount, quote_expired_timestamp) {
42
45
  _classCallCheck(this, SwapQuote);
43
- SwapQuote.initialize(this, quote_id, pay_amount, receive_amount, fee_amount, quote_expired_timestamp);
46
+ SwapQuote.initialize(this, quote_id, pay_token_id, pay_amount, receive_token_id, receive_amount, fee_token_id, fee_amount, quote_expired_timestamp);
44
47
  }
45
48
 
46
49
  /**
@@ -50,10 +53,13 @@ var SwapQuote = /*#__PURE__*/function () {
50
53
  */
51
54
  return _createClass(SwapQuote, null, [{
52
55
  key: "initialize",
53
- value: function initialize(obj, quote_id, pay_amount, receive_amount, fee_amount, quote_expired_timestamp) {
56
+ value: function initialize(obj, quote_id, pay_token_id, pay_amount, receive_token_id, receive_amount, fee_token_id, fee_amount, quote_expired_timestamp) {
54
57
  obj['quote_id'] = quote_id;
58
+ obj['pay_token_id'] = pay_token_id;
55
59
  obj['pay_amount'] = pay_amount;
60
+ obj['receive_token_id'] = receive_token_id;
56
61
  obj['receive_amount'] = receive_amount;
62
+ obj['fee_token_id'] = fee_token_id;
57
63
  obj['fee_amount'] = fee_amount;
58
64
  obj['quote_expired_timestamp'] = quote_expired_timestamp;
59
65
  }
@@ -73,12 +79,21 @@ var SwapQuote = /*#__PURE__*/function () {
73
79
  if (data.hasOwnProperty('quote_id')) {
74
80
  obj['quote_id'] = _ApiClient["default"].convertToType(data['quote_id'], 'String');
75
81
  }
82
+ if (data.hasOwnProperty('pay_token_id')) {
83
+ obj['pay_token_id'] = _ApiClient["default"].convertToType(data['pay_token_id'], 'String');
84
+ }
76
85
  if (data.hasOwnProperty('pay_amount')) {
77
86
  obj['pay_amount'] = _ApiClient["default"].convertToType(data['pay_amount'], 'String');
78
87
  }
88
+ if (data.hasOwnProperty('receive_token_id')) {
89
+ obj['receive_token_id'] = _ApiClient["default"].convertToType(data['receive_token_id'], 'String');
90
+ }
79
91
  if (data.hasOwnProperty('receive_amount')) {
80
92
  obj['receive_amount'] = _ApiClient["default"].convertToType(data['receive_amount'], 'String');
81
93
  }
94
+ if (data.hasOwnProperty('fee_token_id')) {
95
+ obj['fee_token_id'] = _ApiClient["default"].convertToType(data['fee_token_id'], 'String');
96
+ }
82
97
  if (data.hasOwnProperty('fee_amount')) {
83
98
  obj['fee_amount'] = _ApiClient["default"].convertToType(data['fee_amount'], 'String');
84
99
  }
@@ -123,14 +138,26 @@ var SwapQuote = /*#__PURE__*/function () {
123
138
  throw new Error("Expected the field `quote_id` to be a primitive type in the JSON string but got " + data['quote_id']);
124
139
  }
125
140
  // ensure the json data is a string
141
+ if (data['pay_token_id'] && !(typeof data['pay_token_id'] === 'string' || data['pay_token_id'] instanceof String)) {
142
+ throw new Error("Expected the field `pay_token_id` to be a primitive type in the JSON string but got " + data['pay_token_id']);
143
+ }
144
+ // ensure the json data is a string
126
145
  if (data['pay_amount'] && !(typeof data['pay_amount'] === 'string' || data['pay_amount'] instanceof String)) {
127
146
  throw new Error("Expected the field `pay_amount` to be a primitive type in the JSON string but got " + data['pay_amount']);
128
147
  }
129
148
  // ensure the json data is a string
149
+ if (data['receive_token_id'] && !(typeof data['receive_token_id'] === 'string' || data['receive_token_id'] instanceof String)) {
150
+ throw new Error("Expected the field `receive_token_id` to be a primitive type in the JSON string but got " + data['receive_token_id']);
151
+ }
152
+ // ensure the json data is a string
130
153
  if (data['receive_amount'] && !(typeof data['receive_amount'] === 'string' || data['receive_amount'] instanceof String)) {
131
154
  throw new Error("Expected the field `receive_amount` to be a primitive type in the JSON string but got " + data['receive_amount']);
132
155
  }
133
156
  // ensure the json data is a string
157
+ if (data['fee_token_id'] && !(typeof data['fee_token_id'] === 'string' || data['fee_token_id'] instanceof String)) {
158
+ throw new Error("Expected the field `fee_token_id` to be a primitive type in the JSON string but got " + data['fee_token_id']);
159
+ }
160
+ // ensure the json data is a string
134
161
  if (data['fee_amount'] && !(typeof data['fee_amount'] === 'string' || data['fee_amount'] instanceof String)) {
135
162
  throw new Error("Expected the field `fee_amount` to be a primitive type in the JSON string but got " + data['fee_amount']);
136
163
  }
@@ -146,7 +173,7 @@ var SwapQuote = /*#__PURE__*/function () {
146
173
  }
147
174
  }]);
148
175
  }();
149
- SwapQuote.RequiredProperties = ["quote_id", "pay_amount", "receive_amount", "fee_amount", "quote_expired_timestamp"];
176
+ SwapQuote.RequiredProperties = ["quote_id", "pay_token_id", "pay_amount", "receive_token_id", "receive_amount", "fee_token_id", "fee_amount", "quote_expired_timestamp"];
150
177
 
151
178
  /**
152
179
  * The unique id of quote.
@@ -154,18 +181,36 @@ SwapQuote.RequiredProperties = ["quote_id", "pay_amount", "receive_amount", "fee
154
181
  */
155
182
  SwapQuote.prototype['quote_id'] = undefined;
156
183
 
184
+ /**
185
+ * The token ID to pay.
186
+ * @member {String} pay_token_id
187
+ */
188
+ SwapQuote.prototype['pay_token_id'] = undefined;
189
+
157
190
  /**
158
191
  * The amount of tokens to pay.
159
192
  * @member {String} pay_amount
160
193
  */
161
194
  SwapQuote.prototype['pay_amount'] = undefined;
162
195
 
196
+ /**
197
+ * The token ID to receive.
198
+ * @member {String} receive_token_id
199
+ */
200
+ SwapQuote.prototype['receive_token_id'] = undefined;
201
+
163
202
  /**
164
203
  * The amount of tokens to receive.
165
204
  * @member {String} receive_amount
166
205
  */
167
206
  SwapQuote.prototype['receive_amount'] = undefined;
168
207
 
208
+ /**
209
+ * The fee token ID.
210
+ * @member {String} fee_token_id
211
+ */
212
+ SwapQuote.prototype['fee_token_id'] = undefined;
213
+
169
214
  /**
170
215
  * The amount of tokens to pay for fee.
171
216
  * @member {String} fee_amount
@@ -166,13 +166,13 @@ SwapToken.prototype['asset_id'] = undefined;
166
166
  SwapToken.prototype['token_address'] = undefined;
167
167
 
168
168
  /**
169
- * The minimum amount to swap.
169
+ * The minimum amount.
170
170
  * @member {String} min_amount
171
171
  */
172
172
  SwapToken.prototype['min_amount'] = undefined;
173
173
 
174
174
  /**
175
- * The maximum amount to swap.
175
+ * The maximum amount.
176
176
  * @member {String} max_amount
177
177
  */
178
178
  SwapToken.prototype['max_amount'] = undefined;