@cobo/cobo-waas2 1.16.0 → 1.18.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 (214) hide show
  1. package/README.md +46 -6
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/PreRequestScript.js +27 -33
  4. package/dist/api/AppWorkflowsApi.js +22 -22
  5. package/dist/api/FeeStationApi.js +2 -2
  6. package/dist/api/OAuthApi.js +93 -6
  7. package/dist/api/OrganizationsApi.js +79 -0
  8. package/dist/api/PaymentApi.js +265 -55
  9. package/dist/api/TransactionsApi.js +2 -2
  10. package/dist/api/WalletsApi.js +11 -8
  11. package/dist/index.js +252 -14
  12. package/dist/model/Account.js +174 -0
  13. package/dist/model/AcquiringType.js +61 -0
  14. package/dist/model/AddressTransferDestination.js +2 -2
  15. package/dist/model/AddressesEventData.js +8 -3
  16. package/dist/model/AppWorkflow.js +7 -7
  17. package/dist/model/AppWorkflowField.js +5 -5
  18. package/dist/model/AppWorkflowPolicy.js +1 -1
  19. package/dist/model/ApprovalEntry.js +1 -1
  20. package/dist/model/ApprovalRequest.js +5 -3
  21. package/dist/model/ApprovalRequestDetail.js +2 -1
  22. package/dist/model/ApprovalUser.js +4 -4
  23. package/dist/model/BalanceUpdateInfo.js +170 -0
  24. package/dist/model/BalanceUpdateInfoEventData.js +297 -0
  25. package/dist/model/BankAccount.js +2 -2
  26. package/dist/model/ChainInfo.js +1 -1
  27. package/dist/model/ChainsEventData.js +8 -3
  28. package/dist/model/CreateApprovalRequest201Response.js +2 -1
  29. package/dist/model/CreateMerchantRequest.js +13 -0
  30. package/dist/model/CreatePaymentOrderRequest.js +14 -5
  31. package/dist/model/CreateRefundRequest.js +41 -8
  32. package/dist/model/CreateSettlement.js +28 -12
  33. package/dist/model/CreateSettlementRequestRequest.js +27 -0
  34. package/dist/model/CryptoAddress.js +171 -0
  35. package/dist/model/CustodialTransferDestination.js +137 -0
  36. package/dist/model/EstimateContractCallFeeParams.js +2 -2
  37. package/dist/model/EstimateFeeParams.js +1 -1
  38. package/dist/model/EstimatedFILFee.js +170 -0
  39. package/dist/model/EstimatedFILFeeSlow.js +186 -0
  40. package/dist/model/EstimatedFee.js +68 -12
  41. package/dist/model/EstimatedSOLFee.js +170 -0
  42. package/dist/model/EstimatedSOLFeeSlow.js +184 -0
  43. package/dist/model/ExchangePermissionToken201Response.js +122 -0
  44. package/dist/model/{CreateBankAccountRequest.js → ExchangePermissionTokenRequest.js} +30 -28
  45. package/dist/model/FILBase.js +88 -0
  46. package/dist/model/FILPrice.js +114 -0
  47. package/dist/model/FeeType.js +10 -0
  48. package/dist/model/GetExchangeRate200Response.js +2 -2
  49. package/dist/model/GraphQLError.js +135 -0
  50. package/dist/model/GraphQLErrorLocationsInner.js +92 -0
  51. package/dist/model/{TransactionMessageSignBTCEIP191Destination.js → GraphQLRequest.js} +49 -36
  52. package/dist/model/GraphQLResponse.js +119 -0
  53. package/dist/model/ListTopUpPayers200Response.js +123 -0
  54. package/dist/model/ListTopUpPayers200ResponseDataInner.js +189 -0
  55. package/dist/model/MPCVaultEventData.js +8 -3
  56. package/dist/model/Merchant.js +15 -2
  57. package/dist/model/Order.js +16 -7
  58. package/dist/model/PayerAccount.js +189 -0
  59. package/dist/model/PaymentOrderEventData.js +33 -15
  60. package/dist/model/PaymentRefundEventData.js +66 -11
  61. package/dist/model/PaymentSettlementEvent.js +14 -9
  62. package/dist/model/PayoutChannel.js +61 -0
  63. package/dist/model/PolicyAction.js +1 -1
  64. package/dist/model/PolicyActionContent.js +6 -4
  65. package/dist/model/PolicyCondition.js +5 -5
  66. package/dist/model/RefreshPermissionTokenRequest.js +110 -0
  67. package/dist/model/Refund.js +39 -4
  68. package/dist/model/RefundStatus.js +5 -0
  69. package/dist/model/RequestApproval.js +9 -9
  70. package/dist/model/RevokeApprovalRequest201Response.js +2 -1
  71. package/dist/model/RevokeApprovalRequestRequest.js +2 -2
  72. package/dist/model/SOLBase.js +101 -0
  73. package/dist/model/SOLComputeUnit.js +101 -0
  74. package/dist/model/Settlement.js +3 -3
  75. package/dist/model/SettlementDetail.js +24 -6
  76. package/dist/model/SettlementInfo.js +11 -2
  77. package/dist/model/SupportedToken.js +222 -0
  78. package/dist/model/SwapActivityDetail.js +30 -0
  79. package/dist/model/SwapActivitySigners.js +110 -0
  80. package/dist/model/SwapQuote.js +17 -4
  81. package/dist/model/SwapSingingStatus.js +71 -0
  82. package/dist/model/TSSRequestWebhookEventData.js +8 -3
  83. package/dist/model/TokenListingEventData.js +8 -3
  84. package/dist/model/TokensEventData.js +8 -3
  85. package/dist/model/TopUpAddress.js +230 -0
  86. package/dist/model/TransactionCoboCategory.js +20 -0
  87. package/dist/model/TransactionDestination.js +14 -38
  88. package/dist/model/TransactionDestinationType.js +5 -0
  89. package/dist/model/TransactionEvmCalldataInfo.js +1 -1
  90. package/dist/model/TransactionFILFee.js +229 -0
  91. package/dist/model/TransactionFee.js +107 -9
  92. package/dist/model/TransactionRequestFILFee.js +186 -0
  93. package/dist/model/TransactionRequestFee.js +89 -9
  94. package/dist/model/TransactionRequestSOLFee.js +168 -0
  95. package/dist/model/TransactionSOLFee.js +229 -0
  96. package/dist/model/TransactionTransferToAddressDestination.js +2 -2
  97. package/dist/model/TransactionTransferToWalletDestination.js +2 -2
  98. package/dist/model/TransactionWebhookEventData.js +8 -3
  99. package/dist/model/TransferDestination.js +44 -16
  100. package/dist/model/TransferDestinationType.js +5 -0
  101. package/dist/model/UpdateMerchantByIdRequest.js +13 -0
  102. package/dist/model/UpdateRefundByIdRequest.js +110 -0
  103. package/dist/model/UpdateTopUpAddress.js +141 -0
  104. package/dist/model/WalletInfoEventData.js +8 -3
  105. package/dist/model/WebhookEvent.js +2 -2
  106. package/dist/model/WebhookEventData.js +83 -13
  107. package/dist/model/WebhookEventDataType.js +7 -2
  108. package/dist/model/WebhookEventLog.js +2 -2
  109. package/dist/model/WebhookEventType.js +15 -0
  110. package/docs/Account.md +14 -0
  111. package/docs/AcquiringType.md +12 -0
  112. package/docs/AddressTransferDestination.md +2 -2
  113. package/docs/AddressesEventData.md +3 -1
  114. package/docs/AppWorkflow.md +3 -3
  115. package/docs/AppWorkflowField.md +2 -2
  116. package/docs/AppWorkflowsApi.md +12 -12
  117. package/docs/ApprovalRequest.md +2 -2
  118. package/docs/ApprovalRequestDetail.md +1 -1
  119. package/docs/ApprovalUser.md +2 -2
  120. package/docs/BalanceUpdateInfo.md +13 -0
  121. package/docs/BalanceUpdateInfoEventData.md +47 -0
  122. package/docs/BankAccount.md +2 -2
  123. package/docs/ChainInfo.md +1 -1
  124. package/docs/ChainsEventData.md +3 -1
  125. package/docs/CreateApprovalRequest201Response.md +1 -1
  126. package/docs/CreateMerchantRequest.md +1 -0
  127. package/docs/CreatePaymentOrderRequest.md +2 -1
  128. package/docs/CreateRefundRequest.md +5 -2
  129. package/docs/CreateSettlement.md +7 -6
  130. package/docs/CreateSettlementRequestRequest.md +3 -0
  131. package/docs/CryptoAddress.md +14 -0
  132. package/docs/CustodialTransferDestination.md +11 -0
  133. package/docs/EstimateContractCallFeeParams.md +1 -1
  134. package/docs/EstimateFeeParams.md +1 -1
  135. package/docs/EstimatedFILFee.md +13 -0
  136. package/docs/EstimatedFILFeeSlow.md +12 -0
  137. package/docs/EstimatedFee.md +3 -3
  138. package/docs/EstimatedSOLFee.md +13 -0
  139. package/docs/EstimatedSOLFeeSlow.md +12 -0
  140. package/docs/ExchangePermissionToken201Response.md +12 -0
  141. package/docs/ExchangePermissionTokenRequest.md +9 -0
  142. package/docs/FILBase.md +9 -0
  143. package/docs/FILPrice.md +11 -0
  144. package/docs/FeeStationApi.md +1 -1
  145. package/docs/FeeType.md +4 -0
  146. package/docs/GetExchangeRate200Response.md +1 -1
  147. package/docs/GraphQLError.md +11 -0
  148. package/docs/GraphQLErrorLocationsInner.md +10 -0
  149. package/docs/GraphQLRequest.md +11 -0
  150. package/docs/GraphQLResponse.md +10 -0
  151. package/docs/ListTopUpPayers200Response.md +10 -0
  152. package/docs/ListTopUpPayers200ResponseDataInner.md +14 -0
  153. package/docs/MPCVaultEventData.md +3 -1
  154. package/docs/Merchant.md +3 -2
  155. package/docs/OAuthApi.md +102 -0
  156. package/docs/Order.md +6 -5
  157. package/docs/OrganizationsApi.md +55 -0
  158. package/docs/PayerAccount.md +14 -0
  159. package/docs/PaymentApi.md +247 -29
  160. package/docs/PaymentOrderEventData.md +9 -6
  161. package/docs/PaymentRefundEventData.md +10 -5
  162. package/docs/PaymentSettlementEvent.md +6 -4
  163. package/docs/PayoutChannel.md +12 -0
  164. package/docs/PolicyActionContent.md +4 -4
  165. package/docs/PolicyCondition.md +2 -2
  166. package/docs/RefreshPermissionTokenRequest.md +9 -0
  167. package/docs/Refund.md +7 -4
  168. package/docs/RefundStatus.md +2 -0
  169. package/docs/RequestApproval.md +4 -4
  170. package/docs/RevokeApprovalRequest201Response.md +1 -1
  171. package/docs/RevokeApprovalRequestRequest.md +1 -1
  172. package/docs/SOLBase.md +10 -0
  173. package/docs/SOLComputeUnit.md +10 -0
  174. package/docs/Settlement.md +3 -3
  175. package/docs/SettlementDetail.md +8 -6
  176. package/docs/SettlementInfo.md +3 -2
  177. package/docs/SupportedToken.md +17 -0
  178. package/docs/SwapActivityDetail.md +1 -0
  179. package/docs/SwapActivitySigners.md +11 -0
  180. package/docs/SwapQuote.md +3 -2
  181. package/docs/SwapSingingStatus.md +16 -0
  182. package/docs/TSSRequestWebhookEventData.md +3 -1
  183. package/docs/TokenListingEventData.md +3 -1
  184. package/docs/TokensEventData.md +3 -1
  185. package/docs/TopUpAddress.md +18 -0
  186. package/docs/TransactionCoboCategory.md +8 -0
  187. package/docs/TransactionDestination.md +2 -2
  188. package/docs/TransactionDestinationType.md +2 -0
  189. package/docs/TransactionEvmCalldataInfo.md +1 -1
  190. package/docs/TransactionFILFee.md +16 -0
  191. package/docs/TransactionFee.md +8 -1
  192. package/docs/TransactionRequestFILFee.md +13 -0
  193. package/docs/TransactionRequestFee.md +5 -1
  194. package/docs/TransactionRequestSOLFee.md +12 -0
  195. package/docs/TransactionSOLFee.md +16 -0
  196. package/docs/TransactionTransferToAddressDestination.md +2 -2
  197. package/docs/TransactionTransferToWalletDestination.md +1 -1
  198. package/docs/TransactionWebhookEventData.md +3 -1
  199. package/docs/TransactionsApi.md +1 -1
  200. package/docs/TransferDestination.md +3 -3
  201. package/docs/TransferDestinationType.md +2 -0
  202. package/docs/UpdateMerchantByIdRequest.md +1 -0
  203. package/docs/UpdateRefundByIdRequest.md +9 -0
  204. package/docs/UpdateTopUpAddress.md +11 -0
  205. package/docs/WalletInfoEventData.md +3 -1
  206. package/docs/WalletsApi.md +6 -4
  207. package/docs/WebhookEvent.md +1 -1
  208. package/docs/WebhookEventData.md +14 -5
  209. package/docs/WebhookEventDataType.md +3 -1
  210. package/docs/WebhookEventLog.md +1 -1
  211. package/docs/WebhookEventType.md +6 -0
  212. package/package.json +1 -1
  213. package/docs/CreateBankAccountRequest.md +0 -9
  214. package/docs/TransactionMessageSignBTCEIP191Destination.md +0 -10
@@ -0,0 +1,174 @@
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 Account model module.
29
+ * @module model/Account
30
+ */
31
+ var Account = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>Account</code>.
34
+ * Details of a payment account used for top-up operations, including address and balance metadata.
35
+ * @alias module:model/Account
36
+ * @param token_id {String} The ID of the cryptocurrency that this account is configured to handle.
37
+ * @param address {String} The top-up address corresponding to the account.
38
+ * @param merchant_balance {String} The amount of merchant funds under this account.
39
+ * @param psp_balance {String} The amount of developer funds under this account.
40
+ */
41
+ function Account(token_id, address, merchant_balance, psp_balance) {
42
+ _classCallCheck(this, Account);
43
+ Account.initialize(this, token_id, address, merchant_balance, psp_balance);
44
+ }
45
+
46
+ /**
47
+ * Initializes the fields of this object.
48
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49
+ * Only for internal use.
50
+ */
51
+ return _createClass(Account, null, [{
52
+ key: "initialize",
53
+ value: function initialize(obj, token_id, address, merchant_balance, psp_balance) {
54
+ obj['token_id'] = token_id;
55
+ obj['address'] = address;
56
+ obj['merchant_balance'] = merchant_balance;
57
+ obj['psp_balance'] = psp_balance;
58
+ }
59
+
60
+ /**
61
+ * Constructs a <code>Account</code> from a plain JavaScript object, optionally creating a new instance.
62
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
63
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
64
+ * @param {module:model/Account} obj Optional instance to populate.
65
+ * @return {module:model/Account} The populated <code>Account</code> instance.
66
+ */
67
+ }, {
68
+ key: "constructFromObject",
69
+ value: function constructFromObject(data, obj) {
70
+ if (data) {
71
+ obj = obj || new Account();
72
+ if (data.hasOwnProperty('token_id')) {
73
+ obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
74
+ }
75
+ if (data.hasOwnProperty('address')) {
76
+ obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
77
+ }
78
+ if (data.hasOwnProperty('merchant_balance')) {
79
+ obj['merchant_balance'] = _ApiClient["default"].convertToType(data['merchant_balance'], 'String');
80
+ }
81
+ if (data.hasOwnProperty('psp_balance')) {
82
+ obj['psp_balance'] = _ApiClient["default"].convertToType(data['psp_balance'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('created_timestamp')) {
85
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
86
+ }
87
+ if (data.hasOwnProperty('updated_timestamp')) {
88
+ obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
89
+ }
90
+ }
91
+ return obj;
92
+ }
93
+
94
+ /**
95
+ * Validates the JSON data with respect to <code>Account</code>.
96
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
97
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Account</code>.
98
+ */
99
+ }, {
100
+ key: "validateJSON",
101
+ value: function validateJSON(data) {
102
+ // check to make sure all required properties are present in the JSON string
103
+ var _iterator = _createForOfIteratorHelper(Account.RequiredProperties),
104
+ _step;
105
+ try {
106
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
107
+ var property = _step.value;
108
+ if (!data.hasOwnProperty(property)) {
109
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
110
+ }
111
+ }
112
+ // ensure the json data is a string
113
+ } catch (err) {
114
+ _iterator.e(err);
115
+ } finally {
116
+ _iterator.f();
117
+ }
118
+ if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
119
+ throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
120
+ }
121
+ // ensure the json data is a string
122
+ if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
123
+ throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
124
+ }
125
+ // ensure the json data is a string
126
+ if (data['merchant_balance'] && !(typeof data['merchant_balance'] === 'string' || data['merchant_balance'] instanceof String)) {
127
+ throw new Error("Expected the field `merchant_balance` to be a primitive type in the JSON string but got " + data['merchant_balance']);
128
+ }
129
+ // ensure the json data is a string
130
+ if (data['psp_balance'] && !(typeof data['psp_balance'] === 'string' || data['psp_balance'] instanceof String)) {
131
+ throw new Error("Expected the field `psp_balance` to be a primitive type in the JSON string but got " + data['psp_balance']);
132
+ }
133
+ return true;
134
+ }
135
+ }]);
136
+ }();
137
+ Account.RequiredProperties = ["token_id", "address", "merchant_balance", "psp_balance"];
138
+
139
+ /**
140
+ * The ID of the cryptocurrency that this account is configured to handle.
141
+ * @member {String} token_id
142
+ */
143
+ Account.prototype['token_id'] = undefined;
144
+
145
+ /**
146
+ * The top-up address corresponding to the account.
147
+ * @member {String} address
148
+ */
149
+ Account.prototype['address'] = undefined;
150
+
151
+ /**
152
+ * The amount of merchant funds under this account.
153
+ * @member {String} merchant_balance
154
+ */
155
+ Account.prototype['merchant_balance'] = undefined;
156
+
157
+ /**
158
+ * The amount of developer funds under this account.
159
+ * @member {String} psp_balance
160
+ */
161
+ Account.prototype['psp_balance'] = undefined;
162
+
163
+ /**
164
+ * The creation time of the account, in Unix timestamp format, measured in milliseconds.
165
+ * @member {Number} created_timestamp
166
+ */
167
+ Account.prototype['created_timestamp'] = undefined;
168
+
169
+ /**
170
+ * The last update time of the account, in Unix timestamp format, measured in milliseconds.
171
+ * @member {Number} updated_timestamp
172
+ */
173
+ Account.prototype['updated_timestamp'] = undefined;
174
+ var _default = exports["default"] = Account;
@@ -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 AcquiringType.
27
+ * @enum {}
28
+ * @readonly
29
+ */
30
+ var AcquiringType = exports["default"] = /*#__PURE__*/function () {
31
+ function AcquiringType() {
32
+ _classCallCheck(this, AcquiringType);
33
+ /**
34
+ * value: "Order"
35
+ * @const
36
+ */
37
+ _defineProperty(this, "Order", "Order");
38
+ /**
39
+ * value: "TopUp"
40
+ * @const
41
+ */
42
+ _defineProperty(this, "TopUp", "TopUp");
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(AcquiringType, null, [{
50
+ key: "constructFromObject",
51
+ value:
52
+ /**
53
+ * Returns a <code>AcquiringType</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/AcquiringType} The enum <code>AcquiringType</code> value.
56
+ */
57
+ function constructFromObject(object) {
58
+ return object;
59
+ }
60
+ }]);
61
+ }();
@@ -184,13 +184,13 @@ AddressTransferDestination.prototype['change_address'] = undefined;
184
184
  AddressTransferDestination.prototype['change_output_type'] = undefined;
185
185
 
186
186
  /**
187
- * Whether the transaction request must be executed as a [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfer. - `true`: The transaction request must be executed as a Cobo Loop transfer. - `false`: The transaction request may not be executed as a Cobo Loop transfer. Please do not set both `force_internal` and `force_external` as `true`.
187
+ * Whether the transaction request must be executed as a [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfer. - `true`: The transaction request must be executed as a Cobo Loop transfer. - `false`: The transaction request may not be executed as a Cobo Loop transfer. Please do not set both `force_internal` and `force_external` as `true`. If both are set to `false`, the system uses Cobo Loop by default if possible; otherwise, it proceeds with an on-chain transfer.
188
188
  * @member {Boolean} force_internal
189
189
  */
190
190
  AddressTransferDestination.prototype['force_internal'] = undefined;
191
191
 
192
192
  /**
193
- * Whether the transaction request must not be executed as a [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfer. - `true`: The transaction request must not be executed as a Cobo Loop transfer. - `false`: The transaction request can be executed as a Cobo Loop transfer. Please do not set both `force_internal` and `force_external` as `true`.
193
+ * Whether the transaction request must not be executed as a [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfer. - `true`: The transaction request must not be executed as a Cobo Loop transfer. - `false`: The transaction request can be executed as a Cobo Loop transfer. Please do not set both `force_internal` and `force_external` as `true`. If both are set to `false`, the system uses Cobo Loop by default if possible; otherwise, it proceeds with an on-chain transfer.
194
194
  * @member {Boolean} force_external
195
195
  */
196
196
  AddressTransferDestination.prototype['force_external'] = undefined;
@@ -35,7 +35,7 @@ var AddressesEventData = /*#__PURE__*/function () {
35
35
  * Constructs a new <code>AddressesEventData</code>.
36
36
  * @alias module:model/AddressesEventData
37
37
  * @implements module:model/WebhookEventDataType
38
- * @param data_type {module:model/AddressesEventData.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.
38
+ * @param data_type {module:model/AddressesEventData.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. - `BalanceUpdateInfo`: The balance update event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data.
39
39
  */
40
40
  function AddressesEventData(data_type) {
41
41
  _classCallCheck(this, AddressesEventData);
@@ -132,7 +132,7 @@ var AddressesEventData = /*#__PURE__*/function () {
132
132
  AddressesEventData.RequiredProperties = ["data_type"];
133
133
 
134
134
  /**
135
- * 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.
135
+ * 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. - `BalanceUpdateInfo`: The balance update event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data.
136
136
  * @member {module:model/AddressesEventData.DataTypeEnum} data_type
137
137
  */
138
138
  AddressesEventData.prototype['data_type'] = undefined;
@@ -145,7 +145,7 @@ AddressesEventData.prototype['addresses'] = undefined;
145
145
 
146
146
  // Implement WebhookEventDataType interface:
147
147
  /**
148
- * 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.
148
+ * 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. - `BalanceUpdateInfo`: The balance update event data. - `PaymentRefund`: The payment refund event data. - `PaymentSettlement`: The payment settlement event data.
149
149
  * @member {module:model/WebhookEventDataType.DataTypeEnum} data_type
150
150
  */
151
151
  _WebhookEventDataType["default"].prototype['data_type'] = undefined;
@@ -196,6 +196,11 @@ AddressesEventData['DataTypeEnum'] = {
196
196
  * @const
197
197
  */
198
198
  "TokenListing": "TokenListing",
199
+ /**
200
+ * value: "BalanceUpdateInfo"
201
+ * @const
202
+ */
203
+ "BalanceUpdateInfo": "BalanceUpdateInfo",
199
204
  /**
200
205
  * value: "PaymentOrder"
201
206
  * @const
@@ -32,11 +32,11 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
32
32
  var AppWorkflow = /*#__PURE__*/function () {
33
33
  /**
34
34
  * Constructs a new <code>AppWorkflow</code>.
35
- * The information of an app workflow approval user entry.
35
+ * The information of an approval workflow
36
36
  * @alias module:model/AppWorkflow
37
- * @param workflow_id {String} The workflow id.
38
- * @param operation_id {String} The workflow operation id.
39
- * @param operation_name {String} The workflow operation name.
37
+ * @param workflow_id {String} The unique ID distinguishing the approval workflow instance among organizations.
38
+ * @param operation_id {String} The unique ID of the approval workflow.
39
+ * @param operation_name {String} The name of the approval workflow.
40
40
  * @param current_policies {Array.<module:model/AppWorkflowPolicy>}
41
41
  */
42
42
  function AppWorkflow(workflow_id, operation_id, operation_name, current_policies) {
@@ -149,19 +149,19 @@ var AppWorkflow = /*#__PURE__*/function () {
149
149
  AppWorkflow.RequiredProperties = ["workflow_id", "operation_id", "operation_name", "current_policies"];
150
150
 
151
151
  /**
152
- * The workflow id.
152
+ * The unique ID distinguishing the approval workflow instance among organizations.
153
153
  * @member {String} workflow_id
154
154
  */
155
155
  AppWorkflow.prototype['workflow_id'] = undefined;
156
156
 
157
157
  /**
158
- * The workflow operation id.
158
+ * The unique ID of the approval workflow.
159
159
  * @member {String} operation_id
160
160
  */
161
161
  AppWorkflow.prototype['operation_id'] = undefined;
162
162
 
163
163
  /**
164
- * The workflow operation name.
164
+ * The name of the approval workflow.
165
165
  * @member {String} operation_name
166
166
  */
167
167
  AppWorkflow.prototype['operation_name'] = undefined;
@@ -32,11 +32,11 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
32
32
  var AppWorkflowField = /*#__PURE__*/function () {
33
33
  /**
34
34
  * Constructs a new <code>AppWorkflowField</code>.
35
- * The information of an app workflow field.
35
+ * The information of a workflow field.
36
36
  * @alias module:model/AppWorkflowField
37
- * @param field {String} The app workflow field name.
37
+ * @param field {String} The workflow field name.
38
38
  * @param value_type {module:model/PolicyFieldValueType}
39
- * @param value {String} The app workflow field value.
39
+ * @param value {String} The workflow field value.
40
40
  */
41
41
  function AppWorkflowField(field, value_type, value) {
42
42
  _classCallCheck(this, AppWorkflowField);
@@ -119,7 +119,7 @@ var AppWorkflowField = /*#__PURE__*/function () {
119
119
  AppWorkflowField.RequiredProperties = ["field", "value_type", "value"];
120
120
 
121
121
  /**
122
- * The app workflow field name.
122
+ * The workflow field name.
123
123
  * @member {String} field
124
124
  */
125
125
  AppWorkflowField.prototype['field'] = undefined;
@@ -130,7 +130,7 @@ AppWorkflowField.prototype['field'] = undefined;
130
130
  AppWorkflowField.prototype['value_type'] = undefined;
131
131
 
132
132
  /**
133
- * The app workflow field value.
133
+ * The workflow field value.
134
134
  * @member {String} value
135
135
  */
136
136
  AppWorkflowField.prototype['value'] = undefined;
@@ -33,7 +33,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
33
  var AppWorkflowPolicy = /*#__PURE__*/function () {
34
34
  /**
35
35
  * Constructs a new <code>AppWorkflowPolicy</code>.
36
- * The information of an app workflow policy entry.
36
+ * The current approval workflow policy, consisting of one or more conditions and an associated action. When the conditions are met, the action is triggered.
37
37
  * @alias module:model/AppWorkflowPolicy
38
38
  * @param action {module:model/PolicyAction}
39
39
  */
@@ -33,7 +33,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
33
  var ApprovalEntry = /*#__PURE__*/function () {
34
34
  /**
35
35
  * Constructs a new <code>ApprovalEntry</code>.
36
- * The information of an app workflow approval entry.
36
+ * The information of an approval request.
37
37
  * @alias module:model/ApprovalEntry
38
38
  * @param status {module:model/ApprovalStatus}
39
39
  * @param created_timestamp {Number} The time when the approval was created, in Unix timestamp format, measured in milliseconds.
@@ -33,10 +33,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
33
  var ApprovalRequest = /*#__PURE__*/function () {
34
34
  /**
35
35
  * Constructs a new <code>ApprovalRequest</code>.
36
- * The information of an app workflow approval.
36
+ * The information of an approval request.
37
37
  * @alias module:model/ApprovalRequest
38
- * @param approval_id {String}
39
- * @param request_id {String}
38
+ * @param approval_id {String} The system-generated unique ID of the approval request.
39
+ * @param request_id {String} An identifier provided by you when requesting the approval.
40
40
  * @param fields {Array.<module:model/AppWorkflowField>}
41
41
  * @param status {module:model/ApprovalStatus}
42
42
  * @param initiated_timestamp {Number} The time when the approval was initiated, in Unix timestamp format, measured in milliseconds.
@@ -151,11 +151,13 @@ var ApprovalRequest = /*#__PURE__*/function () {
151
151
  ApprovalRequest.RequiredProperties = ["approval_id", "request_id", "fields", "status", "initiated_timestamp"];
152
152
 
153
153
  /**
154
+ * The system-generated unique ID of the approval request.
154
155
  * @member {String} approval_id
155
156
  */
156
157
  ApprovalRequest.prototype['approval_id'] = undefined;
157
158
 
158
159
  /**
160
+ * An identifier provided by you when requesting the approval.
159
161
  * @member {String} request_id
160
162
  */
161
163
  ApprovalRequest.prototype['request_id'] = undefined;
@@ -34,7 +34,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
34
34
  var ApprovalRequestDetail = /*#__PURE__*/function () {
35
35
  /**
36
36
  * Constructs a new <code>ApprovalRequestDetail</code>.
37
- * The information of an app workflow approval detail.
37
+ * The information of an approval request detail.
38
38
  * @alias module:model/ApprovalRequestDetail
39
39
  * @param initiator {module:model/ApprovalUser}
40
40
  * @param status {module:model/ApprovalStatus}
@@ -149,6 +149,7 @@ var ApprovalRequestDetail = /*#__PURE__*/function () {
149
149
  ApprovalRequestDetail.RequiredProperties = ["initiator", "status"];
150
150
 
151
151
  /**
152
+ * The system-generated unique ID of the approval request.
152
153
  * @member {String} approval_id
153
154
  */
154
155
  ApprovalRequestDetail.prototype['approval_id'] = undefined;
@@ -32,9 +32,9 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
32
32
  var ApprovalUser = /*#__PURE__*/function () {
33
33
  /**
34
34
  * Constructs a new <code>ApprovalUser</code>.
35
- * The information of an app workflow approval user entry.
35
+ * The information of the user.
36
36
  * @alias module:model/ApprovalUser
37
- * @param email {String} The approval user email.
37
+ * @param email {String} The user email.
38
38
  * @param status {module:model/ApprovalStatus}
39
39
  * @param created_timestamp {Number} The time when the approval was created, in Unix timestamp format, measured in milliseconds.
40
40
  */
@@ -122,13 +122,13 @@ var ApprovalUser = /*#__PURE__*/function () {
122
122
  ApprovalUser.RequiredProperties = ["email", "status", "created_timestamp"];
123
123
 
124
124
  /**
125
- * The approval user email.
125
+ * The user email.
126
126
  * @member {String} email
127
127
  */
128
128
  ApprovalUser.prototype['email'] = undefined;
129
129
 
130
130
  /**
131
- * The approval user name.
131
+ * The user name.
132
132
  * @member {String} name
133
133
  */
134
134
  ApprovalUser.prototype['name'] = undefined;
@@ -0,0 +1,170 @@
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 _Balance = _interopRequireDefault(require("./Balance"));
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 BalanceUpdateInfo model module.
30
+ * @module model/BalanceUpdateInfo
31
+ */
32
+ var BalanceUpdateInfo = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>BalanceUpdateInfo</code>.
35
+ * The balance information.
36
+ * @alias module:model/BalanceUpdateInfo
37
+ * @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).
38
+ * @param address {String} The wallet address.
39
+ * @param wallet_uuid {String} The wallet ID.
40
+ * @param updated_timestamp {Number} The time when the balance updated, in Unix timestamp format, measured in milliseconds.
41
+ * @param balance {module:model/Balance}
42
+ */
43
+ function BalanceUpdateInfo(token_id, address, wallet_uuid, updated_timestamp, balance) {
44
+ _classCallCheck(this, BalanceUpdateInfo);
45
+ BalanceUpdateInfo.initialize(this, token_id, address, wallet_uuid, updated_timestamp, balance);
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(BalanceUpdateInfo, null, [{
54
+ key: "initialize",
55
+ value: function initialize(obj, token_id, address, wallet_uuid, updated_timestamp, balance) {
56
+ obj['token_id'] = token_id;
57
+ obj['address'] = address;
58
+ obj['wallet_uuid'] = wallet_uuid;
59
+ obj['updated_timestamp'] = updated_timestamp;
60
+ obj['balance'] = balance;
61
+ }
62
+
63
+ /**
64
+ * Constructs a <code>BalanceUpdateInfo</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/BalanceUpdateInfo} obj Optional instance to populate.
68
+ * @return {module:model/BalanceUpdateInfo} The populated <code>BalanceUpdateInfo</code> instance.
69
+ */
70
+ }, {
71
+ key: "constructFromObject",
72
+ value: function constructFromObject(data, obj) {
73
+ if (data) {
74
+ obj = obj || new BalanceUpdateInfo();
75
+ if (data.hasOwnProperty('token_id')) {
76
+ obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
77
+ }
78
+ if (data.hasOwnProperty('address')) {
79
+ obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
80
+ }
81
+ if (data.hasOwnProperty('wallet_uuid')) {
82
+ obj['wallet_uuid'] = _ApiClient["default"].convertToType(data['wallet_uuid'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('updated_timestamp')) {
85
+ obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
86
+ }
87
+ if (data.hasOwnProperty('balance')) {
88
+ obj['balance'] = _Balance["default"].constructFromObject(data['balance']);
89
+ }
90
+ }
91
+ return obj;
92
+ }
93
+
94
+ /**
95
+ * Validates the JSON data with respect to <code>BalanceUpdateInfo</code>.
96
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
97
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>BalanceUpdateInfo</code>.
98
+ */
99
+ }, {
100
+ key: "validateJSON",
101
+ value: function validateJSON(data) {
102
+ // check to make sure all required properties are present in the JSON string
103
+ var _iterator = _createForOfIteratorHelper(BalanceUpdateInfo.RequiredProperties),
104
+ _step;
105
+ try {
106
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
107
+ var property = _step.value;
108
+ if (!data.hasOwnProperty(property)) {
109
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
110
+ }
111
+ }
112
+ // ensure the json data is a string
113
+ } catch (err) {
114
+ _iterator.e(err);
115
+ } finally {
116
+ _iterator.f();
117
+ }
118
+ if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
119
+ throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
120
+ }
121
+ // ensure the json data is a string
122
+ if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
123
+ throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
124
+ }
125
+ // ensure the json data is a string
126
+ if (data['wallet_uuid'] && !(typeof data['wallet_uuid'] === 'string' || data['wallet_uuid'] instanceof String)) {
127
+ throw new Error("Expected the field `wallet_uuid` to be a primitive type in the JSON string but got " + data['wallet_uuid']);
128
+ }
129
+ // validate the optional field `balance`
130
+ if (data['balance']) {
131
+ // data not null
132
+ if (!!_Balance["default"].validateJSON) {
133
+ _Balance["default"].validateJSON(data['balance']);
134
+ }
135
+ }
136
+ return true;
137
+ }
138
+ }]);
139
+ }();
140
+ BalanceUpdateInfo.RequiredProperties = ["token_id", "address", "wallet_uuid", "updated_timestamp", "balance"];
141
+
142
+ /**
143
+ * 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).
144
+ * @member {String} token_id
145
+ */
146
+ BalanceUpdateInfo.prototype['token_id'] = undefined;
147
+
148
+ /**
149
+ * The wallet address.
150
+ * @member {String} address
151
+ */
152
+ BalanceUpdateInfo.prototype['address'] = undefined;
153
+
154
+ /**
155
+ * The wallet ID.
156
+ * @member {String} wallet_uuid
157
+ */
158
+ BalanceUpdateInfo.prototype['wallet_uuid'] = undefined;
159
+
160
+ /**
161
+ * The time when the balance updated, in Unix timestamp format, measured in milliseconds.
162
+ * @member {Number} updated_timestamp
163
+ */
164
+ BalanceUpdateInfo.prototype['updated_timestamp'] = undefined;
165
+
166
+ /**
167
+ * @member {module:model/Balance} balance
168
+ */
169
+ BalanceUpdateInfo.prototype['balance'] = undefined;
170
+ var _default = exports["default"] = BalanceUpdateInfo;