@cobo/cobo-waas2 1.20.0 → 1.22.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 (224) hide show
  1. package/README.md +60 -4
  2. package/dist/ApiClient.js +11 -2
  3. package/dist/PreRequestScript.js +2 -4
  4. package/dist/api/AutoSweepApi.js +289 -0
  5. package/dist/api/PaymentApi.js +386 -24
  6. package/dist/api/TokenizationApi.js +1024 -0
  7. package/dist/api/TransactionsApi.js +103 -2
  8. package/dist/api/WalletsApi.js +2 -2
  9. package/dist/crypto/ApiSigner.js +5 -1
  10. package/dist/index.js +175 -0
  11. package/dist/model/AddressesEventData.js +3 -3
  12. package/dist/model/ApprovalDetail.js +7 -7
  13. package/dist/model/AutoSweepTask.js +198 -0
  14. package/dist/model/AutoSweepTaskStatus.js +61 -0
  15. package/dist/model/BalanceUpdateInfoEventData.js +3 -3
  16. package/dist/model/ChainsEventData.js +3 -3
  17. package/dist/model/CreateAutoSweepTask.js +126 -0
  18. package/dist/model/CreateCryptoAddressRequest.js +138 -0
  19. package/dist/model/CreateCustodialWalletParams.js +9 -0
  20. package/dist/model/CreateExchangeWalletParams.js +14 -0
  21. package/dist/model/CreateMpcWalletParams.js +14 -0
  22. package/dist/model/CreatePaymentOrderRequest.js +5 -5
  23. package/dist/model/CreateSafeWalletParams.js +9 -0
  24. package/dist/model/CreateSettlement.js +27 -4
  25. package/dist/model/CreateSmartContractWalletParams.js +6 -0
  26. package/dist/model/CreateSweepToAddress.js +126 -0
  27. package/dist/model/CreateWalletParams.js +6 -0
  28. package/dist/model/CreatedWalletInfo.js +6 -0
  29. package/dist/model/CryptoAddress.js +12 -12
  30. package/dist/model/CustodialWalletInfo.js +9 -0
  31. package/dist/model/DeleteCryptoAddress201Response.js +110 -0
  32. package/dist/model/ExchangeWalletInfo.js +14 -0
  33. package/dist/model/ForcedSweep.js +9 -9
  34. package/dist/model/ForcedSweepRequest.js +8 -9
  35. package/dist/model/GetTokenizationAllowlistActivation200Response.js +107 -0
  36. package/dist/model/ListAutoSweepTask200Response.js +123 -0
  37. package/dist/model/ListMerchantBalances200Response.js +107 -0
  38. package/dist/model/ListPaymentWalletBalances200Response.js +107 -0
  39. package/dist/model/ListSettlementDetails200Response.js +123 -0
  40. package/dist/model/ListTokenizationBlocklistAddresses200Response.js +145 -0
  41. package/dist/model/ListWalletSweepToAddresses200Response.js +107 -0
  42. package/dist/model/MPCVaultEventData.js +3 -3
  43. package/dist/model/MPCWalletInfo.js +14 -0
  44. package/dist/model/MerchantBalance.js +201 -0
  45. package/dist/model/PaymentAddressUpdateEventData.js +13 -13
  46. package/dist/model/PaymentOrderEventData.js +3 -3
  47. package/dist/model/PaymentRefundEventData.js +3 -3
  48. package/dist/model/PaymentSettlementEvent.js +42 -3
  49. package/dist/model/PaymentTransactionEventData.js +6 -6
  50. package/dist/model/PaymentWalletBalance.js +177 -0
  51. package/dist/model/PspBalance.js +175 -0
  52. package/dist/model/ReceivedAmountPerAddress.js +126 -0
  53. package/dist/model/SafeWallet.js +9 -0
  54. package/dist/model/Settlement.js +27 -0
  55. package/dist/model/SettlementDetail.js +26 -0
  56. package/dist/model/SettlementInfo.js +7 -7
  57. package/dist/model/SmartContractWalletInfo.js +6 -0
  58. package/dist/model/SuspendedTokenEventData.js +3 -3
  59. package/dist/model/SweepToAddress.js +135 -0
  60. package/dist/model/SweepToAddressStatus.js +61 -0
  61. package/dist/model/TSSRequestWebhookEventData.js +3 -3
  62. package/dist/model/TokenListingEventData.js +3 -3
  63. package/dist/model/TokenizationActivityInfo.js +8 -4
  64. package/dist/model/TokenizationAllowlistActivationRequest.js +13 -0
  65. package/dist/model/TokenizationAllowlistAddressNote.js +4 -4
  66. package/dist/model/TokenizationAllowlistAddressesResponse.js +145 -0
  67. package/dist/model/TokenizationBlocklistAddressNote.js +4 -4
  68. package/dist/model/TokenizationBurnEstimateFeeParams.js +13 -0
  69. package/dist/model/TokenizationBurnTokenParamsBurnsInner.js +4 -4
  70. package/dist/model/TokenizationBurnTokenRequest.js +13 -0
  71. package/dist/model/TokenizationContractCallEstimateFeeParams.js +13 -0
  72. package/dist/model/TokenizationContractCallParamsData.js +43 -9
  73. package/dist/model/TokenizationContractCallRequest.js +13 -0
  74. package/dist/model/TokenizationContractCallType.js +5 -0
  75. package/dist/model/TokenizationERC20TokenParams.js +4 -4
  76. package/dist/model/TokenizationEstimateFeeRequestOperationParams.js +6 -0
  77. package/dist/model/TokenizationEvmContractCallParams.js +2 -2
  78. package/dist/model/TokenizationIssueEstimateFeeParams.js +13 -0
  79. package/dist/model/TokenizationIssueTokenParamsTokenParams.js +40 -12
  80. package/dist/model/TokenizationIssuedTokenRequest.js +14 -1
  81. package/dist/model/TokenizationMintEstimateFeeParams.js +13 -0
  82. package/dist/model/TokenizationMintTokenRequest.js +13 -0
  83. package/dist/model/TokenizationMpcOperationSource.js +2 -2
  84. package/dist/model/TokenizationPauseEstimateFeeParams.js +13 -0
  85. package/dist/model/TokenizationPauseTokenRequest.js +13 -0
  86. package/dist/model/TokenizationSOLTokenParams.js +173 -0
  87. package/dist/model/TokenizationSolContractCallParams.js +137 -0
  88. package/dist/model/TokenizationSolTokenPermissionParams.js +140 -0
  89. package/dist/model/TokenizationToggleAllowlistEstimateFeeParams.js +13 -0
  90. package/dist/model/TokenizationTokenDetailInfo.js +6 -6
  91. package/dist/model/TokenizationTokenInfo.js +4 -4
  92. package/dist/model/TokenizationTokenOperationSource.js +1 -1
  93. package/dist/model/TokenizationTokenPermissionParams.js +1 -1
  94. package/dist/model/TokenizationTokenPermissionType.js +15 -0
  95. package/dist/model/TokenizationTokenStandard.js +5 -0
  96. package/dist/model/TokenizationUnpauseEstimateFeeParams.js +13 -0
  97. package/dist/model/TokenizationUnpauseTokenRequest.js +13 -0
  98. package/dist/model/TokenizationUpdateAllowlistAddressesEstimateFeeParams.js +13 -0
  99. package/dist/model/TokenizationUpdateAllowlistAddressesParamsAddressesInner.js +1 -1
  100. package/dist/model/TokenizationUpdateAllowlistAddressesRequest.js +13 -0
  101. package/dist/model/TokenizationUpdateBlocklistAddressesEstimateFeeParams.js +13 -0
  102. package/dist/model/TokenizationUpdateBlocklistAddressesParamsAddressesInner.js +1 -1
  103. package/dist/model/TokenizationUpdateBlocklistAddressesRequest.js +13 -0
  104. package/dist/model/TokenizationWeb3OperationSource.js +2 -2
  105. package/dist/model/TokensEventData.js +3 -3
  106. package/dist/model/TopUpAddress.js +0 -1
  107. package/dist/model/TransactionWebhookEventData.js +3 -3
  108. package/dist/model/UpdateCustodialWalletParams.js +13 -6
  109. package/dist/model/UpdateMpcWalletParams.js +13 -6
  110. package/dist/model/UpdateTopUpAddress.js +3 -3
  111. package/dist/model/UpdateWalletParams.js +6 -0
  112. package/dist/model/WalletInfo.js +6 -0
  113. package/dist/model/WalletInfoEventData.js +3 -3
  114. package/dist/model/WebhookEventData.js +19 -7
  115. package/dist/model/WebhookEventDataType.js +2 -2
  116. package/docs/AddressesEventData.md +1 -1
  117. package/docs/ApprovalDetail.md +1 -1
  118. package/docs/AutoSweepApi.md +285 -0
  119. package/docs/AutoSweepTask.md +16 -0
  120. package/docs/AutoSweepTaskStatus.md +12 -0
  121. package/docs/BalanceUpdateInfoEventData.md +1 -1
  122. package/docs/ChainsEventData.md +1 -1
  123. package/docs/CreateAutoSweepTask.md +10 -0
  124. package/docs/CreateCryptoAddressRequest.md +11 -0
  125. package/docs/CreateCustodialWalletParams.md +1 -0
  126. package/docs/CreateExchangeWalletParams.md +1 -0
  127. package/docs/CreateMpcWalletParams.md +1 -0
  128. package/docs/CreatePaymentOrderRequest.md +3 -3
  129. package/docs/CreateSafeWalletParams.md +1 -0
  130. package/docs/CreateSettlement.md +1 -1
  131. package/docs/CreateSmartContractWalletParams.md +1 -0
  132. package/docs/CreateSweepToAddress.md +10 -0
  133. package/docs/CreateWalletParams.md +1 -0
  134. package/docs/CreatedWalletInfo.md +1 -0
  135. package/docs/CryptoAddress.md +1 -1
  136. package/docs/CustodialWalletInfo.md +1 -0
  137. package/docs/DeleteCryptoAddress201Response.md +9 -0
  138. package/docs/ExchangeWalletInfo.md +1 -0
  139. package/docs/ForcedSweep.md +7 -7
  140. package/docs/ForcedSweepRequest.md +4 -4
  141. package/docs/GetTokenizationAllowlistActivation200Response.md +9 -0
  142. package/docs/ListAutoSweepTask200Response.md +10 -0
  143. package/docs/ListMerchantBalances200Response.md +9 -0
  144. package/docs/ListPaymentWalletBalances200Response.md +9 -0
  145. package/docs/ListSettlementDetails200Response.md +10 -0
  146. package/docs/ListTokenizationBlocklistAddresses200Response.md +10 -0
  147. package/docs/ListWalletSweepToAddresses200Response.md +9 -0
  148. package/docs/MPCVaultEventData.md +1 -1
  149. package/docs/MPCWalletInfo.md +1 -0
  150. package/docs/MerchantBalance.md +16 -0
  151. package/docs/PaymentAddressUpdateEventData.md +6 -6
  152. package/docs/PaymentApi.md +403 -16
  153. package/docs/PaymentOrderEventData.md +1 -1
  154. package/docs/PaymentRefundEventData.md +1 -1
  155. package/docs/PaymentSettlementEvent.md +4 -1
  156. package/docs/PaymentTransactionEventData.md +4 -4
  157. package/docs/PaymentWalletBalance.md +14 -0
  158. package/docs/PspBalance.md +14 -0
  159. package/docs/ReceivedAmountPerAddress.md +10 -0
  160. package/docs/SafeWallet.md +1 -0
  161. package/docs/Settlement.md +3 -0
  162. package/docs/SettlementDetail.md +2 -0
  163. package/docs/SettlementInfo.md +6 -6
  164. package/docs/SmartContractWalletInfo.md +1 -0
  165. package/docs/SuspendedTokenEventData.md +1 -1
  166. package/docs/SweepToAddress.md +11 -0
  167. package/docs/SweepToAddressStatus.md +12 -0
  168. package/docs/TSSRequestWebhookEventData.md +1 -1
  169. package/docs/TokenListingEventData.md +1 -1
  170. package/docs/TokenizationActivityInfo.md +2 -2
  171. package/docs/TokenizationAllowlistActivationRequest.md +1 -0
  172. package/docs/TokenizationAllowlistAddressNote.md +3 -3
  173. package/docs/TokenizationAllowlistAddressesResponse.md +10 -0
  174. package/docs/TokenizationApi.md +1069 -0
  175. package/docs/TokenizationBlocklistAddressNote.md +3 -3
  176. package/docs/TokenizationBurnEstimateFeeParams.md +1 -0
  177. package/docs/TokenizationBurnTokenParamsBurnsInner.md +2 -2
  178. package/docs/TokenizationBurnTokenRequest.md +1 -0
  179. package/docs/TokenizationContractCallEstimateFeeParams.md +1 -0
  180. package/docs/TokenizationContractCallParamsData.md +2 -1
  181. package/docs/TokenizationContractCallRequest.md +1 -0
  182. package/docs/TokenizationContractCallType.md +2 -0
  183. package/docs/TokenizationERC20TokenParams.md +1 -1
  184. package/docs/TokenizationEstimateFeeRequestOperationParams.md +1 -0
  185. package/docs/TokenizationEvmContractCallParams.md +1 -1
  186. package/docs/TokenizationIssueEstimateFeeParams.md +1 -0
  187. package/docs/TokenizationIssueTokenParamsTokenParams.md +2 -2
  188. package/docs/TokenizationIssuedTokenRequest.md +2 -1
  189. package/docs/TokenizationMintEstimateFeeParams.md +1 -0
  190. package/docs/TokenizationMintTokenRequest.md +1 -0
  191. package/docs/TokenizationMpcOperationSource.md +1 -1
  192. package/docs/TokenizationPauseEstimateFeeParams.md +1 -0
  193. package/docs/TokenizationPauseTokenRequest.md +1 -0
  194. package/docs/TokenizationSOLTokenParams.md +14 -0
  195. package/docs/TokenizationSolContractCallParams.md +10 -0
  196. package/docs/TokenizationSolTokenPermissionParams.md +13 -0
  197. package/docs/TokenizationToggleAllowlistEstimateFeeParams.md +1 -0
  198. package/docs/TokenizationTokenDetailInfo.md +1 -1
  199. package/docs/TokenizationTokenInfo.md +1 -1
  200. package/docs/TokenizationTokenOperationSource.md +1 -1
  201. package/docs/TokenizationTokenPermissionType.md +6 -0
  202. package/docs/TokenizationTokenStandard.md +2 -0
  203. package/docs/TokenizationUnpauseEstimateFeeParams.md +1 -0
  204. package/docs/TokenizationUnpauseTokenRequest.md +1 -0
  205. package/docs/TokenizationUpdateAllowlistAddressesEstimateFeeParams.md +1 -0
  206. package/docs/TokenizationUpdateAllowlistAddressesParamsAddressesInner.md +1 -1
  207. package/docs/TokenizationUpdateAllowlistAddressesRequest.md +1 -0
  208. package/docs/TokenizationUpdateBlocklistAddressesEstimateFeeParams.md +1 -0
  209. package/docs/TokenizationUpdateBlocklistAddressesParamsAddressesInner.md +1 -1
  210. package/docs/TokenizationUpdateBlocklistAddressesRequest.md +1 -0
  211. package/docs/TokenizationWeb3OperationSource.md +1 -1
  212. package/docs/TokensEventData.md +1 -1
  213. package/docs/TransactionWebhookEventData.md +1 -1
  214. package/docs/TransactionsApi.md +113 -1
  215. package/docs/UpdateCustodialWalletParams.md +2 -1
  216. package/docs/UpdateMpcWalletParams.md +2 -1
  217. package/docs/UpdateTopUpAddress.md +1 -1
  218. package/docs/UpdateWalletParams.md +1 -0
  219. package/docs/WalletInfo.md +1 -0
  220. package/docs/WalletInfoEventData.md +1 -1
  221. package/docs/WalletsApi.md +1 -1
  222. package/docs/WebhookEventData.md +9 -7
  223. package/docs/WebhookEventDataType.md +1 -1
  224. package/package.json +1 -1
@@ -67,8 +67,8 @@ var ApprovalDetail = /*#__PURE__*/function () {
67
67
  if (data.hasOwnProperty('request_id')) {
68
68
  obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
69
69
  }
70
- if (data.hasOwnProperty('broker_user')) {
71
- obj['broker_user'] = _RoleDetail["default"].constructFromObject(data['broker_user']);
70
+ if (data.hasOwnProperty('address_owner')) {
71
+ obj['address_owner'] = _RoleDetail["default"].constructFromObject(data['address_owner']);
72
72
  }
73
73
  if (data.hasOwnProperty('spender')) {
74
74
  obj['spender'] = _RoleDetail["default"].constructFromObject(data['spender']);
@@ -100,11 +100,11 @@ var ApprovalDetail = /*#__PURE__*/function () {
100
100
  if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
101
101
  throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
102
102
  }
103
- // validate the optional field `broker_user`
104
- if (data['broker_user']) {
103
+ // validate the optional field `address_owner`
104
+ if (data['address_owner']) {
105
105
  // data not null
106
106
  if (!!_RoleDetail["default"].validateJSON) {
107
- _RoleDetail["default"].validateJSON(data['broker_user']);
107
+ _RoleDetail["default"].validateJSON(data['address_owner']);
108
108
  }
109
109
  }
110
110
  // validate the optional field `spender`
@@ -144,9 +144,9 @@ ApprovalDetail.prototype['cobo_id'] = undefined;
144
144
  ApprovalDetail.prototype['request_id'] = undefined;
145
145
 
146
146
  /**
147
- * @member {module:model/RoleDetail} broker_user
147
+ * @member {module:model/RoleDetail} address_owner
148
148
  */
149
- ApprovalDetail.prototype['broker_user'] = undefined;
149
+ ApprovalDetail.prototype['address_owner'] = undefined;
150
150
 
151
151
  /**
152
152
  * @member {module:model/RoleDetail} spender
@@ -0,0 +1,198 @@
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 _AutoSweepTaskStatus = _interopRequireDefault(require("./AutoSweepTaskStatus"));
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 AutoSweepTask model module.
30
+ * @module model/AutoSweepTask
31
+ */
32
+ var AutoSweepTask = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>AutoSweepTask</code>.
35
+ * The auto sweep task information.
36
+ * @alias module:model/AutoSweepTask
37
+ * @param task_id {String} The auto sweep task ID.
38
+ * @param wallet_id {String} The wallet ID.
39
+ * @param token_id {String} The token ID of the swept token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens).
40
+ * @param status {module:model/AutoSweepTaskStatus}
41
+ * @param created_timestamp {Number} The time when the task was created, in Unix timestamp format, measured in milliseconds.
42
+ */
43
+ function AutoSweepTask(task_id, wallet_id, token_id, status, created_timestamp) {
44
+ _classCallCheck(this, AutoSweepTask);
45
+ AutoSweepTask.initialize(this, task_id, wallet_id, token_id, status, created_timestamp);
46
+ }
47
+
48
+ /**
49
+ * Initializes the fields of this object.
50
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
51
+ * Only for internal use.
52
+ */
53
+ return _createClass(AutoSweepTask, null, [{
54
+ key: "initialize",
55
+ value: function initialize(obj, task_id, wallet_id, token_id, status, created_timestamp) {
56
+ obj['task_id'] = task_id;
57
+ obj['wallet_id'] = wallet_id;
58
+ obj['token_id'] = token_id;
59
+ obj['status'] = status;
60
+ obj['created_timestamp'] = created_timestamp;
61
+ }
62
+
63
+ /**
64
+ * Constructs a <code>AutoSweepTask</code> from a plain JavaScript object, optionally creating a new instance.
65
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
66
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
67
+ * @param {module:model/AutoSweepTask} obj Optional instance to populate.
68
+ * @return {module:model/AutoSweepTask} The populated <code>AutoSweepTask</code> instance.
69
+ */
70
+ }, {
71
+ key: "constructFromObject",
72
+ value: function constructFromObject(data, obj) {
73
+ if (data) {
74
+ obj = obj || new AutoSweepTask();
75
+ if (data.hasOwnProperty('task_id')) {
76
+ obj['task_id'] = _ApiClient["default"].convertToType(data['task_id'], 'String');
77
+ }
78
+ if (data.hasOwnProperty('wallet_id')) {
79
+ obj['wallet_id'] = _ApiClient["default"].convertToType(data['wallet_id'], 'String');
80
+ }
81
+ if (data.hasOwnProperty('token_id')) {
82
+ obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('status')) {
85
+ obj['status'] = _AutoSweepTaskStatus["default"].constructFromObject(data['status']);
86
+ }
87
+ if (data.hasOwnProperty('transaction_ids')) {
88
+ obj['transaction_ids'] = _ApiClient["default"].convertToType(data['transaction_ids'], ['String']);
89
+ }
90
+ if (data.hasOwnProperty('failed_reasons')) {
91
+ obj['failed_reasons'] = _ApiClient["default"].convertToType(data['failed_reasons'], ['String']);
92
+ }
93
+ if (data.hasOwnProperty('created_timestamp')) {
94
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
95
+ }
96
+ if (data.hasOwnProperty('updated_timestamp')) {
97
+ obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
98
+ }
99
+ }
100
+ return obj;
101
+ }
102
+
103
+ /**
104
+ * Validates the JSON data with respect to <code>AutoSweepTask</code>.
105
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
106
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>AutoSweepTask</code>.
107
+ */
108
+ }, {
109
+ key: "validateJSON",
110
+ value: function validateJSON(data) {
111
+ // check to make sure all required properties are present in the JSON string
112
+ var _iterator = _createForOfIteratorHelper(AutoSweepTask.RequiredProperties),
113
+ _step;
114
+ try {
115
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
116
+ var property = _step.value;
117
+ if (!data.hasOwnProperty(property)) {
118
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
119
+ }
120
+ }
121
+ // ensure the json data is a string
122
+ } catch (err) {
123
+ _iterator.e(err);
124
+ } finally {
125
+ _iterator.f();
126
+ }
127
+ if (data['task_id'] && !(typeof data['task_id'] === 'string' || data['task_id'] instanceof String)) {
128
+ throw new Error("Expected the field `task_id` to be a primitive type in the JSON string but got " + data['task_id']);
129
+ }
130
+ // ensure the json data is a string
131
+ if (data['wallet_id'] && !(typeof data['wallet_id'] === 'string' || data['wallet_id'] instanceof String)) {
132
+ throw new Error("Expected the field `wallet_id` to be a primitive type in the JSON string but got " + data['wallet_id']);
133
+ }
134
+ // ensure the json data is a string
135
+ if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
136
+ throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
137
+ }
138
+ // ensure the json data is an array
139
+ if (!Array.isArray(data['transaction_ids'])) {
140
+ throw new Error("Expected the field `transaction_ids` to be an array in the JSON data but got " + data['transaction_ids']);
141
+ }
142
+ // ensure the json data is an array
143
+ if (!Array.isArray(data['failed_reasons'])) {
144
+ throw new Error("Expected the field `failed_reasons` to be an array in the JSON data but got " + data['failed_reasons']);
145
+ }
146
+ return true;
147
+ }
148
+ }]);
149
+ }();
150
+ AutoSweepTask.RequiredProperties = ["task_id", "wallet_id", "token_id", "status", "created_timestamp"];
151
+
152
+ /**
153
+ * The auto sweep task ID.
154
+ * @member {String} task_id
155
+ */
156
+ AutoSweepTask.prototype['task_id'] = undefined;
157
+
158
+ /**
159
+ * The wallet ID.
160
+ * @member {String} wallet_id
161
+ */
162
+ AutoSweepTask.prototype['wallet_id'] = undefined;
163
+
164
+ /**
165
+ * The token ID of the swept token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens).
166
+ * @member {String} token_id
167
+ */
168
+ AutoSweepTask.prototype['token_id'] = undefined;
169
+
170
+ /**
171
+ * @member {module:model/AutoSweepTaskStatus} status
172
+ */
173
+ AutoSweepTask.prototype['status'] = undefined;
174
+
175
+ /**
176
+ * The IDs of the corresponding transactions of the auto sweep task.
177
+ * @member {Array.<String>} transaction_ids
178
+ */
179
+ AutoSweepTask.prototype['transaction_ids'] = undefined;
180
+
181
+ /**
182
+ * Failed reason of create auto sweep transaction.
183
+ * @member {Array.<String>} failed_reasons
184
+ */
185
+ AutoSweepTask.prototype['failed_reasons'] = undefined;
186
+
187
+ /**
188
+ * The time when the task was created, in Unix timestamp format, measured in milliseconds.
189
+ * @member {Number} created_timestamp
190
+ */
191
+ AutoSweepTask.prototype['created_timestamp'] = undefined;
192
+
193
+ /**
194
+ * The time when the task was updated, in Unix timestamp format, measured in milliseconds.
195
+ * @member {Number} updated_timestamp
196
+ */
197
+ AutoSweepTask.prototype['updated_timestamp'] = undefined;
198
+ var _default = exports["default"] = AutoSweepTask;
@@ -0,0 +1,61 @@
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 AutoSweepTaskStatus.
27
+ * @enum {}
28
+ * @readonly
29
+ */
30
+ var AutoSweepTaskStatus = exports["default"] = /*#__PURE__*/function () {
31
+ function AutoSweepTaskStatus() {
32
+ _classCallCheck(this, AutoSweepTaskStatus);
33
+ /**
34
+ * value: "Submitted"
35
+ * @const
36
+ */
37
+ _defineProperty(this, "Submitted", "Submitted");
38
+ /**
39
+ * value: "TransactionCreated"
40
+ * @const
41
+ */
42
+ _defineProperty(this, "TransactionCreated", "TransactionCreated");
43
+ /**
44
+ * value: "unknown_default_open_api"
45
+ * @const
46
+ */
47
+ _defineProperty(this, "unknown_default_open_api", "unknown_default_open_api");
48
+ }
49
+ return _createClass(AutoSweepTaskStatus, null, [{
50
+ key: "constructFromObject",
51
+ value:
52
+ /**
53
+ * Returns a <code>AutoSweepTaskStatus</code> enum value from a Javascript object name.
54
+ * @param {Object} data The plain JavaScript object containing the name of the enum value.
55
+ * @return {module:model/AutoSweepTaskStatus} The enum <code>AutoSweepTaskStatus</code> value.
56
+ */
57
+ function constructFromObject(object) {
58
+ return object;
59
+ }
60
+ }]);
61
+ }();
@@ -37,7 +37,7 @@ var BalanceUpdateInfoEventData = /*#__PURE__*/function () {
37
37
  * @alias module:model/BalanceUpdateInfoEventData
38
38
  * @implements module:model/WebhookEventDataType
39
39
  * @implements module:model/BalanceUpdateInfo
40
- * @param data_type {module:model/BalanceUpdateInfoEventData.DataTypeEnum} The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data. - `PaymentOrder`: The payment order event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data. - `PaymentTransaction`: The payment transaction event data. - `PaymentAddressUpdate`: The payment address update event data. - `BalanceUpdateInfo`: The balance update event data. - `SuspendedToken`: The token suspension event data.
40
+ * @param data_type {module:model/BalanceUpdateInfoEventData.DataTypeEnum} The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data. - `PaymentOrder`: The payment order event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data. - `PaymentTransaction`: The payment transaction event data. - `PaymentAddressUpdate`: The top-up address update event data. - `BalanceUpdateInfo`: The balance update event data. - `SuspendedToken`: The token suspension event data.
41
41
  * @param token_id {String} The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens).
42
42
  * @param address {String} The wallet address.
43
43
  * @param wallet_uuid {String} The wallet ID.
@@ -156,7 +156,7 @@ var BalanceUpdateInfoEventData = /*#__PURE__*/function () {
156
156
  BalanceUpdateInfoEventData.RequiredProperties = ["data_type", "token_id", "address", "wallet_uuid", "updated_timestamp", "balance"];
157
157
 
158
158
  /**
159
- * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data. - `PaymentOrder`: The payment order event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data. - `PaymentTransaction`: The payment transaction event data. - `PaymentAddressUpdate`: The payment address update event data. - `BalanceUpdateInfo`: The balance update event data. - `SuspendedToken`: The token suspension event data.
159
+ * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data. - `PaymentOrder`: The payment order event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data. - `PaymentTransaction`: The payment transaction event data. - `PaymentAddressUpdate`: The top-up address update event data. - `BalanceUpdateInfo`: The balance update event data. - `SuspendedToken`: The token suspension event data.
160
160
  * @member {module:model/BalanceUpdateInfoEventData.DataTypeEnum} data_type
161
161
  */
162
162
  BalanceUpdateInfoEventData.prototype['data_type'] = undefined;
@@ -192,7 +192,7 @@ BalanceUpdateInfoEventData.prototype['balance'] = undefined;
192
192
 
193
193
  // Implement WebhookEventDataType interface:
194
194
  /**
195
- * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data. - `PaymentOrder`: The payment order event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data. - `PaymentTransaction`: The payment transaction event data. - `PaymentAddressUpdate`: The payment address update event data. - `BalanceUpdateInfo`: The balance update event data. - `SuspendedToken`: The token suspension event data.
195
+ * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data. - `PaymentOrder`: The payment order event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data. - `PaymentTransaction`: The payment transaction event data. - `PaymentAddressUpdate`: The top-up address update event data. - `BalanceUpdateInfo`: The balance update event data. - `SuspendedToken`: The token suspension event data.
196
196
  * @member {module:model/WebhookEventDataType.DataTypeEnum} data_type
197
197
  */
198
198
  _WebhookEventDataType["default"].prototype['data_type'] = undefined;
@@ -37,7 +37,7 @@ var ChainsEventData = /*#__PURE__*/function () {
37
37
  * Constructs a new <code>ChainsEventData</code>.
38
38
  * @alias module:model/ChainsEventData
39
39
  * @implements module:model/WebhookEventDataType
40
- * @param data_type {module:model/ChainsEventData.DataTypeEnum} The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data. - `PaymentOrder`: The payment order event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data. - `PaymentTransaction`: The payment transaction event data. - `PaymentAddressUpdate`: The payment address update event data. - `BalanceUpdateInfo`: The balance update event data. - `SuspendedToken`: The token suspension event data.
40
+ * @param data_type {module:model/ChainsEventData.DataTypeEnum} The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data. - `PaymentOrder`: The payment order event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data. - `PaymentTransaction`: The payment transaction event data. - `PaymentAddressUpdate`: The top-up address update event data. - `BalanceUpdateInfo`: The balance update event data. - `SuspendedToken`: The token suspension event data.
41
41
  * @param chains {Array.<module:model/ChainInfo>} The enabled chains.
42
42
  */
43
43
  function ChainsEventData(data_type, chains) {
@@ -146,7 +146,7 @@ var ChainsEventData = /*#__PURE__*/function () {
146
146
  ChainsEventData.RequiredProperties = ["data_type", "chains"];
147
147
 
148
148
  /**
149
- * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data. - `PaymentOrder`: The payment order event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data. - `PaymentTransaction`: The payment transaction event data. - `PaymentAddressUpdate`: The payment address update event data. - `BalanceUpdateInfo`: The balance update event data. - `SuspendedToken`: The token suspension event data.
149
+ * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data. - `PaymentOrder`: The payment order event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data. - `PaymentTransaction`: The payment transaction event data. - `PaymentAddressUpdate`: The top-up address update event data. - `BalanceUpdateInfo`: The balance update event data. - `SuspendedToken`: The token suspension event data.
150
150
  * @member {module:model/ChainsEventData.DataTypeEnum} data_type
151
151
  */
152
152
  ChainsEventData.prototype['data_type'] = undefined;
@@ -169,7 +169,7 @@ ChainsEventData.prototype['wallet_subtypes'] = undefined;
169
169
 
170
170
  // Implement WebhookEventDataType interface:
171
171
  /**
172
- * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data. - `PaymentOrder`: The payment order event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data. - `PaymentTransaction`: The payment transaction event data. - `PaymentAddressUpdate`: The payment address update event data. - `BalanceUpdateInfo`: The balance update event data. - `SuspendedToken`: The token suspension event data.
172
+ * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data. - `PaymentOrder`: The payment order event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data. - `PaymentTransaction`: The payment transaction event data. - `PaymentAddressUpdate`: The top-up address update event data. - `BalanceUpdateInfo`: The balance update event data. - `SuspendedToken`: The token suspension event data.
173
173
  * @member {module:model/WebhookEventDataType.DataTypeEnum} data_type
174
174
  */
175
175
  _WebhookEventDataType["default"].prototype['data_type'] = undefined;
@@ -0,0 +1,126 @@
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 _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; } } }; }
11
+ 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; } }
12
+ 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; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ 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); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ 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); } /**
18
+ * Cobo Wallet as a Service 2.0
19
+ *
20
+ * Contact: help@cobo.com
21
+ *
22
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
+ * https://openapi-generator.tech
24
+ * Do not edit the class manually.
25
+ *
26
+ */
27
+ /**
28
+ * The CreateAutoSweepTask model module.
29
+ * @module model/CreateAutoSweepTask
30
+ */
31
+ var CreateAutoSweepTask = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>CreateAutoSweepTask</code>.
34
+ * The sweep to address information.
35
+ * @alias module:model/CreateAutoSweepTask
36
+ * @param wallet_id {String} The wallet ID.
37
+ * @param token_id {String} The token ID of the swept token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens).
38
+ */
39
+ function CreateAutoSweepTask(wallet_id, token_id) {
40
+ _classCallCheck(this, CreateAutoSweepTask);
41
+ CreateAutoSweepTask.initialize(this, wallet_id, token_id);
42
+ }
43
+
44
+ /**
45
+ * Initializes the fields of this object.
46
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
47
+ * Only for internal use.
48
+ */
49
+ return _createClass(CreateAutoSweepTask, null, [{
50
+ key: "initialize",
51
+ value: function initialize(obj, wallet_id, token_id) {
52
+ obj['wallet_id'] = wallet_id;
53
+ obj['token_id'] = token_id;
54
+ }
55
+
56
+ /**
57
+ * Constructs a <code>CreateAutoSweepTask</code> from a plain JavaScript object, optionally creating a new instance.
58
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
59
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
60
+ * @param {module:model/CreateAutoSweepTask} obj Optional instance to populate.
61
+ * @return {module:model/CreateAutoSweepTask} The populated <code>CreateAutoSweepTask</code> instance.
62
+ */
63
+ }, {
64
+ key: "constructFromObject",
65
+ value: function constructFromObject(data, obj) {
66
+ if (data) {
67
+ obj = obj || new CreateAutoSweepTask();
68
+ if (data.hasOwnProperty('wallet_id')) {
69
+ obj['wallet_id'] = _ApiClient["default"].convertToType(data['wallet_id'], 'String');
70
+ }
71
+ if (data.hasOwnProperty('token_id')) {
72
+ obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
73
+ }
74
+ }
75
+ return obj;
76
+ }
77
+
78
+ /**
79
+ * Validates the JSON data with respect to <code>CreateAutoSweepTask</code>.
80
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
81
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateAutoSweepTask</code>.
82
+ */
83
+ }, {
84
+ key: "validateJSON",
85
+ value: function validateJSON(data) {
86
+ // check to make sure all required properties are present in the JSON string
87
+ var _iterator = _createForOfIteratorHelper(CreateAutoSweepTask.RequiredProperties),
88
+ _step;
89
+ try {
90
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
91
+ var property = _step.value;
92
+ if (!data.hasOwnProperty(property)) {
93
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
94
+ }
95
+ }
96
+ // ensure the json data is a string
97
+ } catch (err) {
98
+ _iterator.e(err);
99
+ } finally {
100
+ _iterator.f();
101
+ }
102
+ if (data['wallet_id'] && !(typeof data['wallet_id'] === 'string' || data['wallet_id'] instanceof String)) {
103
+ throw new Error("Expected the field `wallet_id` to be a primitive type in the JSON string but got " + data['wallet_id']);
104
+ }
105
+ // ensure the json data is a string
106
+ if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
107
+ throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
108
+ }
109
+ return true;
110
+ }
111
+ }]);
112
+ }();
113
+ CreateAutoSweepTask.RequiredProperties = ["wallet_id", "token_id"];
114
+
115
+ /**
116
+ * The wallet ID.
117
+ * @member {String} wallet_id
118
+ */
119
+ CreateAutoSweepTask.prototype['wallet_id'] = undefined;
120
+
121
+ /**
122
+ * The token ID of the swept token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens).
123
+ * @member {String} token_id
124
+ */
125
+ CreateAutoSweepTask.prototype['token_id'] = undefined;
126
+ var _default = exports["default"] = CreateAutoSweepTask;
@@ -0,0 +1,138 @@
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 _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; } } }; }
11
+ 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; } }
12
+ 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; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ 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); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ 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); } /**
18
+ * Cobo Wallet as a Service 2.0
19
+ *
20
+ * Contact: help@cobo.com
21
+ *
22
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
+ * https://openapi-generator.tech
24
+ * Do not edit the class manually.
25
+ *
26
+ */
27
+ /**
28
+ * The CreateCryptoAddressRequest model module.
29
+ * @module model/CreateCryptoAddressRequest
30
+ */
31
+ var CreateCryptoAddressRequest = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>CreateCryptoAddressRequest</code>.
34
+ * @alias module:model/CreateCryptoAddressRequest
35
+ * @param token_id {String} The token ID, which is a unique identifier that specifies both the blockchain network and cryptocurrency token in the format `{CHAIN}_{TOKEN}`. Supported values include: - USDC: `ETH_USDC`, `ARBITRUM_USDCOIN`, `SOL_USDC`, `BASE_USDC`, `MATIC_USDC2`, `BSC_USDC` - USDT: `TRON_USDT`, `ETH_USDT`, `ARBITRUM_USDT`, `SOL_USDT`, `BASE_USDT`, `MATIC_USDT`, `BSC_USDT`
36
+ * @param address {String} The blockchain address in its native format. This is the actual destination address where funds will be sent. The address must match the format required by the specified blockchain. For example: - For `SOL_USDC`: Provide a Solana address - For `ETH_USDT`: Provide an Ethereum address
37
+ */
38
+ function CreateCryptoAddressRequest(token_id, address) {
39
+ _classCallCheck(this, CreateCryptoAddressRequest);
40
+ CreateCryptoAddressRequest.initialize(this, token_id, address);
41
+ }
42
+
43
+ /**
44
+ * Initializes the fields of this object.
45
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
46
+ * Only for internal use.
47
+ */
48
+ return _createClass(CreateCryptoAddressRequest, null, [{
49
+ key: "initialize",
50
+ value: function initialize(obj, token_id, address) {
51
+ obj['token_id'] = token_id;
52
+ obj['address'] = address;
53
+ }
54
+
55
+ /**
56
+ * Constructs a <code>CreateCryptoAddressRequest</code> from a plain JavaScript object, optionally creating a new instance.
57
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
58
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
59
+ * @param {module:model/CreateCryptoAddressRequest} obj Optional instance to populate.
60
+ * @return {module:model/CreateCryptoAddressRequest} The populated <code>CreateCryptoAddressRequest</code> instance.
61
+ */
62
+ }, {
63
+ key: "constructFromObject",
64
+ value: function constructFromObject(data, obj) {
65
+ if (data) {
66
+ obj = obj || new CreateCryptoAddressRequest();
67
+ if (data.hasOwnProperty('token_id')) {
68
+ obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
69
+ }
70
+ if (data.hasOwnProperty('address')) {
71
+ obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
72
+ }
73
+ if (data.hasOwnProperty('label')) {
74
+ obj['label'] = _ApiClient["default"].convertToType(data['label'], 'String');
75
+ }
76
+ }
77
+ return obj;
78
+ }
79
+
80
+ /**
81
+ * Validates the JSON data with respect to <code>CreateCryptoAddressRequest</code>.
82
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
83
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateCryptoAddressRequest</code>.
84
+ */
85
+ }, {
86
+ key: "validateJSON",
87
+ value: function validateJSON(data) {
88
+ // check to make sure all required properties are present in the JSON string
89
+ var _iterator = _createForOfIteratorHelper(CreateCryptoAddressRequest.RequiredProperties),
90
+ _step;
91
+ try {
92
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
93
+ var property = _step.value;
94
+ if (!data.hasOwnProperty(property)) {
95
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
96
+ }
97
+ }
98
+ // ensure the json data is a string
99
+ } catch (err) {
100
+ _iterator.e(err);
101
+ } finally {
102
+ _iterator.f();
103
+ }
104
+ if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
105
+ throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
106
+ }
107
+ // ensure the json data is a string
108
+ if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
109
+ throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
110
+ }
111
+ // ensure the json data is a string
112
+ if (data['label'] && !(typeof data['label'] === 'string' || data['label'] instanceof String)) {
113
+ throw new Error("Expected the field `label` to be a primitive type in the JSON string but got " + data['label']);
114
+ }
115
+ return true;
116
+ }
117
+ }]);
118
+ }();
119
+ CreateCryptoAddressRequest.RequiredProperties = ["token_id", "address"];
120
+
121
+ /**
122
+ * The token ID, which is a unique identifier that specifies both the blockchain network and cryptocurrency token in the format `{CHAIN}_{TOKEN}`. Supported values include: - USDC: `ETH_USDC`, `ARBITRUM_USDCOIN`, `SOL_USDC`, `BASE_USDC`, `MATIC_USDC2`, `BSC_USDC` - USDT: `TRON_USDT`, `ETH_USDT`, `ARBITRUM_USDT`, `SOL_USDT`, `BASE_USDT`, `MATIC_USDT`, `BSC_USDT`
123
+ * @member {String} token_id
124
+ */
125
+ CreateCryptoAddressRequest.prototype['token_id'] = undefined;
126
+
127
+ /**
128
+ * The blockchain address in its native format. This is the actual destination address where funds will be sent. The address must match the format required by the specified blockchain. For example: - For `SOL_USDC`: Provide a Solana address - For `ETH_USDT`: Provide an Ethereum address
129
+ * @member {String} address
130
+ */
131
+ CreateCryptoAddressRequest.prototype['address'] = undefined;
132
+
133
+ /**
134
+ * A label to help identify the address's purpose.
135
+ * @member {String} label
136
+ */
137
+ CreateCryptoAddressRequest.prototype['label'] = undefined;
138
+ var _default = exports["default"] = CreateCryptoAddressRequest;