@cobo/cobo-waas2 1.17.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 (174) hide show
  1. package/README.md +36 -4
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/api/FeeStationApi.js +2 -2
  4. package/dist/api/OAuthApi.js +12 -12
  5. package/dist/api/OrganizationsApi.js +79 -0
  6. package/dist/api/PaymentApi.js +233 -16
  7. package/dist/api/TransactionsApi.js +2 -2
  8. package/dist/api/WalletsApi.js +5 -2
  9. package/dist/index.js +203 -7
  10. package/dist/model/Account.js +174 -0
  11. package/dist/model/AcquiringType.js +61 -0
  12. package/dist/model/AddressTransferDestination.js +2 -2
  13. package/dist/model/AddressesEventData.js +8 -3
  14. package/dist/model/BalanceUpdateInfo.js +170 -0
  15. package/dist/model/BalanceUpdateInfoEventData.js +297 -0
  16. package/dist/model/BankAccount.js +2 -2
  17. package/dist/model/ChainsEventData.js +8 -3
  18. package/dist/model/CreateMerchantRequest.js +13 -0
  19. package/dist/model/CreatePaymentOrderRequest.js +10 -1
  20. package/dist/model/CreateRefundRequest.js +9 -11
  21. package/dist/model/CreateSettlement.js +8 -27
  22. package/dist/model/CreateSettlementRequestRequest.js +27 -0
  23. package/dist/model/CryptoAddress.js +7 -7
  24. package/dist/model/CustodialTransferDestination.js +1 -1
  25. package/dist/model/EstimateContractCallFeeParams.js +2 -2
  26. package/dist/model/EstimateFeeParams.js +1 -1
  27. package/dist/model/EstimatedFILFee.js +170 -0
  28. package/dist/model/EstimatedFILFeeSlow.js +186 -0
  29. package/dist/model/EstimatedFee.js +68 -12
  30. package/dist/model/EstimatedSOLFee.js +170 -0
  31. package/dist/model/EstimatedSOLFeeSlow.js +184 -0
  32. package/dist/model/ExchangePermissionToken201Response.js +4 -4
  33. package/dist/model/ExchangePermissionTokenRequest.js +2 -2
  34. package/dist/model/FILBase.js +88 -0
  35. package/dist/model/FILPrice.js +114 -0
  36. package/dist/model/FeeType.js +10 -0
  37. package/dist/model/GetExchangeRate200Response.js +2 -2
  38. package/dist/model/GraphQLError.js +135 -0
  39. package/dist/model/GraphQLErrorLocationsInner.js +92 -0
  40. package/dist/model/{TransactionMessageSignBTCEIP191Destination.js → GraphQLRequest.js} +49 -36
  41. package/dist/model/GraphQLResponse.js +119 -0
  42. package/dist/model/ListTopUpPayers200Response.js +123 -0
  43. package/dist/model/ListTopUpPayers200ResponseDataInner.js +189 -0
  44. package/dist/model/MPCVaultEventData.js +8 -3
  45. package/dist/model/Merchant.js +15 -2
  46. package/dist/model/Order.js +12 -3
  47. package/dist/model/PayerAccount.js +189 -0
  48. package/dist/model/PaymentOrderEventData.js +27 -9
  49. package/dist/model/PaymentRefundEventData.js +66 -11
  50. package/dist/model/PaymentSettlementEvent.js +14 -9
  51. package/dist/model/RefreshPermissionTokenRequest.js +2 -2
  52. package/dist/model/Refund.js +39 -4
  53. package/dist/model/RefundStatus.js +5 -0
  54. package/dist/model/SOLBase.js +101 -0
  55. package/dist/model/SOLComputeUnit.js +101 -0
  56. package/dist/model/Settlement.js +3 -3
  57. package/dist/model/SettlementDetail.js +15 -6
  58. package/dist/model/SettlementInfo.js +11 -2
  59. package/dist/model/SwapActivityDetail.js +30 -0
  60. package/dist/model/SwapActivitySigners.js +110 -0
  61. package/dist/model/SwapQuote.js +17 -4
  62. package/dist/model/SwapSingingStatus.js +71 -0
  63. package/dist/model/TSSRequestWebhookEventData.js +8 -3
  64. package/dist/model/TokenListingEventData.js +8 -3
  65. package/dist/model/TokensEventData.js +8 -3
  66. package/dist/model/TopUpAddress.js +230 -0
  67. package/dist/model/TransactionCoboCategory.js +20 -0
  68. package/dist/model/TransactionDestination.js +10 -38
  69. package/dist/model/TransactionEvmCalldataInfo.js +1 -1
  70. package/dist/model/TransactionFILFee.js +229 -0
  71. package/dist/model/TransactionFee.js +107 -9
  72. package/dist/model/TransactionRequestFILFee.js +186 -0
  73. package/dist/model/TransactionRequestFee.js +89 -9
  74. package/dist/model/TransactionRequestSOLFee.js +168 -0
  75. package/dist/model/TransactionSOLFee.js +229 -0
  76. package/dist/model/TransactionTransferToAddressDestination.js +2 -2
  77. package/dist/model/TransactionTransferToWalletDestination.js +1 -1
  78. package/dist/model/TransactionWebhookEventData.js +8 -3
  79. package/dist/model/TransferDestination.js +2 -2
  80. package/dist/model/UpdateMerchantByIdRequest.js +13 -0
  81. package/dist/model/UpdateRefundByIdRequest.js +110 -0
  82. package/dist/model/UpdateTopUpAddress.js +141 -0
  83. package/dist/model/WalletInfoEventData.js +8 -3
  84. package/dist/model/WebhookEvent.js +2 -2
  85. package/dist/model/WebhookEventData.js +83 -13
  86. package/dist/model/WebhookEventDataType.js +7 -2
  87. package/dist/model/WebhookEventLog.js +2 -2
  88. package/dist/model/WebhookEventType.js +15 -0
  89. package/docs/Account.md +14 -0
  90. package/docs/AcquiringType.md +12 -0
  91. package/docs/AddressTransferDestination.md +2 -2
  92. package/docs/AddressesEventData.md +3 -1
  93. package/docs/BalanceUpdateInfo.md +13 -0
  94. package/docs/BalanceUpdateInfoEventData.md +47 -0
  95. package/docs/BankAccount.md +2 -2
  96. package/docs/ChainsEventData.md +3 -1
  97. package/docs/CreateMerchantRequest.md +1 -0
  98. package/docs/CreatePaymentOrderRequest.md +2 -1
  99. package/docs/CreateRefundRequest.md +5 -5
  100. package/docs/CreateSettlement.md +7 -9
  101. package/docs/CreateSettlementRequestRequest.md +3 -0
  102. package/docs/CryptoAddress.md +5 -5
  103. package/docs/EstimateContractCallFeeParams.md +1 -1
  104. package/docs/EstimateFeeParams.md +1 -1
  105. package/docs/EstimatedFILFee.md +13 -0
  106. package/docs/EstimatedFILFeeSlow.md +12 -0
  107. package/docs/EstimatedFee.md +3 -3
  108. package/docs/EstimatedSOLFee.md +13 -0
  109. package/docs/EstimatedSOLFeeSlow.md +12 -0
  110. package/docs/ExchangePermissionToken201Response.md +4 -4
  111. package/docs/ExchangePermissionTokenRequest.md +1 -1
  112. package/docs/FILBase.md +9 -0
  113. package/docs/FILPrice.md +11 -0
  114. package/docs/FeeStationApi.md +1 -1
  115. package/docs/FeeType.md +4 -0
  116. package/docs/GetExchangeRate200Response.md +1 -1
  117. package/docs/GraphQLError.md +11 -0
  118. package/docs/GraphQLErrorLocationsInner.md +10 -0
  119. package/docs/GraphQLRequest.md +11 -0
  120. package/docs/GraphQLResponse.md +10 -0
  121. package/docs/ListTopUpPayers200Response.md +10 -0
  122. package/docs/ListTopUpPayers200ResponseDataInner.md +14 -0
  123. package/docs/MPCVaultEventData.md +3 -1
  124. package/docs/Merchant.md +3 -2
  125. package/docs/OAuthApi.md +8 -8
  126. package/docs/Order.md +4 -3
  127. package/docs/OrganizationsApi.md +55 -0
  128. package/docs/PayerAccount.md +14 -0
  129. package/docs/PaymentApi.md +230 -6
  130. package/docs/PaymentOrderEventData.md +7 -4
  131. package/docs/PaymentRefundEventData.md +10 -5
  132. package/docs/PaymentSettlementEvent.md +6 -4
  133. package/docs/RefreshPermissionTokenRequest.md +1 -1
  134. package/docs/Refund.md +7 -4
  135. package/docs/RefundStatus.md +2 -0
  136. package/docs/SOLBase.md +10 -0
  137. package/docs/SOLComputeUnit.md +10 -0
  138. package/docs/Settlement.md +3 -3
  139. package/docs/SettlementDetail.md +7 -6
  140. package/docs/SettlementInfo.md +3 -2
  141. package/docs/SwapActivityDetail.md +1 -0
  142. package/docs/SwapActivitySigners.md +11 -0
  143. package/docs/SwapQuote.md +3 -2
  144. package/docs/SwapSingingStatus.md +16 -0
  145. package/docs/TSSRequestWebhookEventData.md +3 -1
  146. package/docs/TokenListingEventData.md +3 -1
  147. package/docs/TokensEventData.md +3 -1
  148. package/docs/TopUpAddress.md +18 -0
  149. package/docs/TransactionCoboCategory.md +8 -0
  150. package/docs/TransactionDestination.md +2 -2
  151. package/docs/TransactionEvmCalldataInfo.md +1 -1
  152. package/docs/TransactionFILFee.md +16 -0
  153. package/docs/TransactionFee.md +8 -1
  154. package/docs/TransactionRequestFILFee.md +13 -0
  155. package/docs/TransactionRequestFee.md +5 -1
  156. package/docs/TransactionRequestSOLFee.md +12 -0
  157. package/docs/TransactionSOLFee.md +16 -0
  158. package/docs/TransactionTransferToAddressDestination.md +2 -2
  159. package/docs/TransactionTransferToWalletDestination.md +1 -1
  160. package/docs/TransactionWebhookEventData.md +3 -1
  161. package/docs/TransactionsApi.md +1 -1
  162. package/docs/TransferDestination.md +2 -2
  163. package/docs/UpdateMerchantByIdRequest.md +1 -0
  164. package/docs/UpdateRefundByIdRequest.md +9 -0
  165. package/docs/UpdateTopUpAddress.md +11 -0
  166. package/docs/WalletInfoEventData.md +3 -1
  167. package/docs/WalletsApi.md +3 -1
  168. package/docs/WebhookEvent.md +1 -1
  169. package/docs/WebhookEventData.md +14 -5
  170. package/docs/WebhookEventDataType.md +3 -1
  171. package/docs/WebhookEventLog.md +1 -1
  172. package/docs/WebhookEventType.md +6 -0
  173. package/package.json +1 -1
  174. package/docs/TransactionMessageSignBTCEIP191Destination.md +0 -10
@@ -0,0 +1,168 @@
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 _FeeType = _interopRequireDefault(require("./FeeType"));
9
+ var _SOLComputeUnit = _interopRequireDefault(require("./SOLComputeUnit"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ 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); }
12
+ 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; } } }; }
13
+ 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; } }
14
+ 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; }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ 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); } }
17
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ 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); } /**
20
+ * Cobo Wallet as a Service 2.0
21
+ *
22
+ * Contact: help@cobo.com
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The TransactionRequestSOLFee model module.
31
+ * @module model/TransactionRequestSOLFee
32
+ */
33
+ var TransactionRequestSOLFee = /*#__PURE__*/function () {
34
+ /**
35
+ * Constructs a new <code>TransactionRequestSOLFee</code>.
36
+ * The preset properties to limit transaction fee. In the SOL fee model, the calculation method for the fee is: fee &#x3D; base_fee + compute_unit_price * compute_unit_limit + rent_amount, refer to [Fee models](https://www.cobo.com/developers/v2/guides/transactions/estimate-fees#fee-models). You can specify the compute_unit_price, compute_unit_limit. Switch between the tabs to display the properties for different transaction fee models.
37
+ * @alias module:model/TransactionRequestSOLFee
38
+ * @implements module:model/SOLComputeUnit
39
+ * @param compute_unit_price {String} The cost per compute unit. Transactions consume computational resources measured in compute units, and this price helps determine the cost of executing transactions, especially complex ones involving smart contracts.
40
+ * @param compute_unit_limit {String} The maximum number of compute units allowed for a transaction. This limits the resources any single transaction can consume, preventing excessive resource usage that could impact network performance negatively.
41
+ * @param fee_type {module:model/FeeType}
42
+ * @param token_id {String} The token ID of the transaction fee.
43
+ */
44
+ function TransactionRequestSOLFee(compute_unit_price, compute_unit_limit, fee_type, token_id) {
45
+ _classCallCheck(this, TransactionRequestSOLFee);
46
+ _SOLComputeUnit["default"].initialize(this);
47
+ TransactionRequestSOLFee.initialize(this, compute_unit_price, compute_unit_limit, fee_type, token_id);
48
+ }
49
+
50
+ /**
51
+ * Initializes the fields of this object.
52
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
53
+ * Only for internal use.
54
+ */
55
+ return _createClass(TransactionRequestSOLFee, null, [{
56
+ key: "initialize",
57
+ value: function initialize(obj, compute_unit_price, compute_unit_limit, fee_type, token_id) {
58
+ obj['compute_unit_price'] = compute_unit_price;
59
+ obj['compute_unit_limit'] = compute_unit_limit;
60
+ obj['fee_type'] = fee_type;
61
+ obj['token_id'] = token_id;
62
+ }
63
+
64
+ /**
65
+ * Constructs a <code>TransactionRequestSOLFee</code> from a plain JavaScript object, optionally creating a new instance.
66
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
67
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
68
+ * @param {module:model/TransactionRequestSOLFee} obj Optional instance to populate.
69
+ * @return {module:model/TransactionRequestSOLFee} The populated <code>TransactionRequestSOLFee</code> instance.
70
+ */
71
+ }, {
72
+ key: "constructFromObject",
73
+ value: function constructFromObject(data, obj) {
74
+ if (data) {
75
+ obj = obj || new TransactionRequestSOLFee();
76
+ _SOLComputeUnit["default"].constructFromObject(data, obj);
77
+ if (data.hasOwnProperty('compute_unit_price')) {
78
+ obj['compute_unit_price'] = _ApiClient["default"].convertToType(data['compute_unit_price'], 'String');
79
+ }
80
+ if (data.hasOwnProperty('compute_unit_limit')) {
81
+ obj['compute_unit_limit'] = _ApiClient["default"].convertToType(data['compute_unit_limit'], 'String');
82
+ }
83
+ if (data.hasOwnProperty('fee_type')) {
84
+ obj['fee_type'] = _FeeType["default"].constructFromObject(data['fee_type']);
85
+ }
86
+ if (data.hasOwnProperty('token_id')) {
87
+ obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
88
+ }
89
+ }
90
+ return obj;
91
+ }
92
+
93
+ /**
94
+ * Validates the JSON data with respect to <code>TransactionRequestSOLFee</code>.
95
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
96
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TransactionRequestSOLFee</code>.
97
+ */
98
+ }, {
99
+ key: "validateJSON",
100
+ value: function validateJSON(data) {
101
+ // check to make sure all required properties are present in the JSON string
102
+ var _iterator = _createForOfIteratorHelper(TransactionRequestSOLFee.RequiredProperties),
103
+ _step;
104
+ try {
105
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
106
+ var property = _step.value;
107
+ if (!data.hasOwnProperty(property)) {
108
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
109
+ }
110
+ }
111
+ // ensure the json data is a string
112
+ } catch (err) {
113
+ _iterator.e(err);
114
+ } finally {
115
+ _iterator.f();
116
+ }
117
+ if (data['compute_unit_price'] && !(typeof data['compute_unit_price'] === 'string' || data['compute_unit_price'] instanceof String)) {
118
+ throw new Error("Expected the field `compute_unit_price` to be a primitive type in the JSON string but got " + data['compute_unit_price']);
119
+ }
120
+ // ensure the json data is a string
121
+ if (data['compute_unit_limit'] && !(typeof data['compute_unit_limit'] === 'string' || data['compute_unit_limit'] instanceof String)) {
122
+ throw new Error("Expected the field `compute_unit_limit` to be a primitive type in the JSON string but got " + data['compute_unit_limit']);
123
+ }
124
+ // ensure the json data is a string
125
+ if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
126
+ throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
127
+ }
128
+ return true;
129
+ }
130
+ }]);
131
+ }();
132
+ TransactionRequestSOLFee.RequiredProperties = ["compute_unit_price", "compute_unit_limit", "fee_type", "token_id"];
133
+
134
+ /**
135
+ * The cost per compute unit. Transactions consume computational resources measured in compute units, and this price helps determine the cost of executing transactions, especially complex ones involving smart contracts.
136
+ * @member {String} compute_unit_price
137
+ */
138
+ TransactionRequestSOLFee.prototype['compute_unit_price'] = undefined;
139
+
140
+ /**
141
+ * The maximum number of compute units allowed for a transaction. This limits the resources any single transaction can consume, preventing excessive resource usage that could impact network performance negatively.
142
+ * @member {String} compute_unit_limit
143
+ */
144
+ TransactionRequestSOLFee.prototype['compute_unit_limit'] = undefined;
145
+
146
+ /**
147
+ * @member {module:model/FeeType} fee_type
148
+ */
149
+ TransactionRequestSOLFee.prototype['fee_type'] = undefined;
150
+
151
+ /**
152
+ * The token ID of the transaction fee.
153
+ * @member {String} token_id
154
+ */
155
+ TransactionRequestSOLFee.prototype['token_id'] = undefined;
156
+
157
+ // Implement SOLComputeUnit interface:
158
+ /**
159
+ * The cost per compute unit. Transactions consume computational resources measured in compute units, and this price helps determine the cost of executing transactions, especially complex ones involving smart contracts.
160
+ * @member {String} compute_unit_price
161
+ */
162
+ _SOLComputeUnit["default"].prototype['compute_unit_price'] = undefined;
163
+ /**
164
+ * The maximum number of compute units allowed for a transaction. This limits the resources any single transaction can consume, preventing excessive resource usage that could impact network performance negatively.
165
+ * @member {String} compute_unit_limit
166
+ */
167
+ _SOLComputeUnit["default"].prototype['compute_unit_limit'] = undefined;
168
+ var _default = exports["default"] = TransactionRequestSOLFee;
@@ -0,0 +1,229 @@
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 _FeeType = _interopRequireDefault(require("./FeeType"));
9
+ var _SOLBase = _interopRequireDefault(require("./SOLBase"));
10
+ var _SOLComputeUnit = _interopRequireDefault(require("./SOLComputeUnit"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12
+ 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); }
13
+ 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; } } }; }
14
+ 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; } }
15
+ 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; }
16
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
17
+ 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); } }
18
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
19
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
20
+ 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); } /**
21
+ * Cobo Wallet as a Service 2.0
22
+ *
23
+ * Contact: help@cobo.com
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * The TransactionSOLFee model module.
32
+ * @module model/TransactionSOLFee
33
+ */
34
+ var TransactionSOLFee = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>TransactionSOLFee</code>.
37
+ * The transaction fee actually charged by the chain that uses the SOL fee model. In the SOL fee model, the calculation method for the fee is: fee &#x3D; base_fee + compute_unit_price * compute_unit_limit + rent_amount, refer to [Fee models](https://www.cobo.com/developers/v2/guides/transactions/estimate-fees#fee-models). Switch between the tabs to display the properties for different transaction fee models.
38
+ * @alias module:model/TransactionSOLFee
39
+ * @implements module:model/SOLBase
40
+ * @implements module:model/SOLComputeUnit
41
+ * @param fee_type {module:model/FeeType}
42
+ */
43
+ function TransactionSOLFee(fee_type) {
44
+ _classCallCheck(this, TransactionSOLFee);
45
+ _SOLBase["default"].initialize(this);
46
+ _SOLComputeUnit["default"].initialize(this);
47
+ TransactionSOLFee.initialize(this, fee_type);
48
+ }
49
+
50
+ /**
51
+ * Initializes the fields of this object.
52
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
53
+ * Only for internal use.
54
+ */
55
+ return _createClass(TransactionSOLFee, null, [{
56
+ key: "initialize",
57
+ value: function initialize(obj, fee_type) {
58
+ obj['fee_type'] = fee_type;
59
+ }
60
+
61
+ /**
62
+ * Constructs a <code>TransactionSOLFee</code> from a plain JavaScript object, optionally creating a new instance.
63
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
64
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
65
+ * @param {module:model/TransactionSOLFee} obj Optional instance to populate.
66
+ * @return {module:model/TransactionSOLFee} The populated <code>TransactionSOLFee</code> instance.
67
+ */
68
+ }, {
69
+ key: "constructFromObject",
70
+ value: function constructFromObject(data, obj) {
71
+ if (data) {
72
+ obj = obj || new TransactionSOLFee();
73
+ _SOLBase["default"].constructFromObject(data, obj);
74
+ _SOLComputeUnit["default"].constructFromObject(data, obj);
75
+ if (data.hasOwnProperty('base_fee')) {
76
+ obj['base_fee'] = _ApiClient["default"].convertToType(data['base_fee'], 'String');
77
+ }
78
+ if (data.hasOwnProperty('rent_amount')) {
79
+ obj['rent_amount'] = _ApiClient["default"].convertToType(data['rent_amount'], 'String');
80
+ }
81
+ if (data.hasOwnProperty('compute_unit_price')) {
82
+ obj['compute_unit_price'] = _ApiClient["default"].convertToType(data['compute_unit_price'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('compute_unit_limit')) {
85
+ obj['compute_unit_limit'] = _ApiClient["default"].convertToType(data['compute_unit_limit'], 'String');
86
+ }
87
+ if (data.hasOwnProperty('fee_type')) {
88
+ obj['fee_type'] = _FeeType["default"].constructFromObject(data['fee_type']);
89
+ }
90
+ if (data.hasOwnProperty('token_id')) {
91
+ obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
92
+ }
93
+ if (data.hasOwnProperty('fee_used')) {
94
+ obj['fee_used'] = _ApiClient["default"].convertToType(data['fee_used'], 'String');
95
+ }
96
+ if (data.hasOwnProperty('estimated_fee_used')) {
97
+ obj['estimated_fee_used'] = _ApiClient["default"].convertToType(data['estimated_fee_used'], 'String');
98
+ }
99
+ }
100
+ return obj;
101
+ }
102
+
103
+ /**
104
+ * Validates the JSON data with respect to <code>TransactionSOLFee</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>TransactionSOLFee</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(TransactionSOLFee.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['base_fee'] && !(typeof data['base_fee'] === 'string' || data['base_fee'] instanceof String)) {
128
+ throw new Error("Expected the field `base_fee` to be a primitive type in the JSON string but got " + data['base_fee']);
129
+ }
130
+ // ensure the json data is a string
131
+ if (data['rent_amount'] && !(typeof data['rent_amount'] === 'string' || data['rent_amount'] instanceof String)) {
132
+ throw new Error("Expected the field `rent_amount` to be a primitive type in the JSON string but got " + data['rent_amount']);
133
+ }
134
+ // ensure the json data is a string
135
+ if (data['compute_unit_price'] && !(typeof data['compute_unit_price'] === 'string' || data['compute_unit_price'] instanceof String)) {
136
+ throw new Error("Expected the field `compute_unit_price` to be a primitive type in the JSON string but got " + data['compute_unit_price']);
137
+ }
138
+ // ensure the json data is a string
139
+ if (data['compute_unit_limit'] && !(typeof data['compute_unit_limit'] === 'string' || data['compute_unit_limit'] instanceof String)) {
140
+ throw new Error("Expected the field `compute_unit_limit` to be a primitive type in the JSON string but got " + data['compute_unit_limit']);
141
+ }
142
+ // ensure the json data is a string
143
+ if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
144
+ throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
145
+ }
146
+ // ensure the json data is a string
147
+ if (data['fee_used'] && !(typeof data['fee_used'] === 'string' || data['fee_used'] instanceof String)) {
148
+ throw new Error("Expected the field `fee_used` to be a primitive type in the JSON string but got " + data['fee_used']);
149
+ }
150
+ // ensure the json data is a string
151
+ if (data['estimated_fee_used'] && !(typeof data['estimated_fee_used'] === 'string' || data['estimated_fee_used'] instanceof String)) {
152
+ throw new Error("Expected the field `estimated_fee_used` to be a primitive type in the JSON string but got " + data['estimated_fee_used']);
153
+ }
154
+ return true;
155
+ }
156
+ }]);
157
+ }();
158
+ TransactionSOLFee.RequiredProperties = ["fee_type"];
159
+
160
+ /**
161
+ * The fundamental fee required for each transaction. It is charged to prevent spam transactions and network congestion, ensuring that only meaningful transactions consume network resources.
162
+ * @member {String} base_fee
163
+ */
164
+ TransactionSOLFee.prototype['base_fee'] = undefined;
165
+
166
+ /**
167
+ * The fee charged as rent for maintaining the state of accounts on the blockchain. This rent ensures accounts are stored on-chain over the long term and that there's sufficient balance to sustain the account state.
168
+ * @member {String} rent_amount
169
+ */
170
+ TransactionSOLFee.prototype['rent_amount'] = undefined;
171
+
172
+ /**
173
+ * The cost per compute unit. Transactions consume computational resources measured in compute units, and this price helps determine the cost of executing transactions, especially complex ones involving smart contracts.
174
+ * @member {String} compute_unit_price
175
+ */
176
+ TransactionSOLFee.prototype['compute_unit_price'] = undefined;
177
+
178
+ /**
179
+ * The maximum number of compute units allowed for a transaction. This limits the resources any single transaction can consume, preventing excessive resource usage that could impact network performance negatively.
180
+ * @member {String} compute_unit_limit
181
+ */
182
+ TransactionSOLFee.prototype['compute_unit_limit'] = undefined;
183
+
184
+ /**
185
+ * @member {module:model/FeeType} fee_type
186
+ */
187
+ TransactionSOLFee.prototype['fee_type'] = undefined;
188
+
189
+ /**
190
+ * The token ID of the transaction fee.
191
+ * @member {String} token_id
192
+ */
193
+ TransactionSOLFee.prototype['token_id'] = undefined;
194
+
195
+ /**
196
+ * The transaction fee.
197
+ * @member {String} fee_used
198
+ */
199
+ TransactionSOLFee.prototype['fee_used'] = undefined;
200
+
201
+ /**
202
+ * The estimated transaction fee.
203
+ * @member {String} estimated_fee_used
204
+ */
205
+ TransactionSOLFee.prototype['estimated_fee_used'] = undefined;
206
+
207
+ // Implement SOLBase interface:
208
+ /**
209
+ * The fundamental fee required for each transaction. It is charged to prevent spam transactions and network congestion, ensuring that only meaningful transactions consume network resources.
210
+ * @member {String} base_fee
211
+ */
212
+ _SOLBase["default"].prototype['base_fee'] = undefined;
213
+ /**
214
+ * The fee charged as rent for maintaining the state of accounts on the blockchain. This rent ensures accounts are stored on-chain over the long term and that there's sufficient balance to sustain the account state.
215
+ * @member {String} rent_amount
216
+ */
217
+ _SOLBase["default"].prototype['rent_amount'] = undefined;
218
+ // Implement SOLComputeUnit interface:
219
+ /**
220
+ * The cost per compute unit. Transactions consume computational resources measured in compute units, and this price helps determine the cost of executing transactions, especially complex ones involving smart contracts.
221
+ * @member {String} compute_unit_price
222
+ */
223
+ _SOLComputeUnit["default"].prototype['compute_unit_price'] = undefined;
224
+ /**
225
+ * The maximum number of compute units allowed for a transaction. This limits the resources any single transaction can consume, preventing excessive resource usage that could impact network performance negatively.
226
+ * @member {String} compute_unit_limit
227
+ */
228
+ _SOLComputeUnit["default"].prototype['compute_unit_limit'] = undefined;
229
+ var _default = exports["default"] = TransactionSOLFee;
@@ -171,13 +171,13 @@ TransactionTransferToAddressDestination.prototype['utxo_outputs'] = undefined;
171
171
  TransactionTransferToAddressDestination.prototype['change_address'] = undefined;
172
172
 
173
173
  /**
174
- * 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.
174
+ * 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. If both `force_internal` and `force_external` are set to `false`, the system uses Cobo Loop by default if possible; otherwise, it proceeds with an on-chain transfer.
175
175
  * @member {Boolean} force_internal
176
176
  */
177
177
  TransactionTransferToAddressDestination.prototype['force_internal'] = undefined;
178
178
 
179
179
  /**
180
- * 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.
180
+ * 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. If both `force_internal` and `force_external` are set to `false`, the system uses Cobo Loop by default if possible; otherwise, it proceeds with an on-chain transfer.
181
181
  * @member {Boolean} force_external
182
182
  */
183
183
  TransactionTransferToAddressDestination.prototype['force_external'] = undefined;
@@ -141,7 +141,7 @@ TransactionTransferToWalletDestination.prototype['destination_type'] = undefined
141
141
  TransactionTransferToWalletDestination.prototype['wallet_id'] = undefined;
142
142
 
143
143
  /**
144
- * The trading account type. Only available for `ExchangeWallet`.
144
+ * The trading account type. This field is only applicable when `destination_type` is `ExchangeWallet`.
145
145
  * @member {String} trading_account_type
146
146
  */
147
147
  TransactionTransferToWalletDestination.prototype['trading_account_type'] = undefined;
@@ -48,7 +48,7 @@ var TransactionWebhookEventData = /*#__PURE__*/function () {
48
48
  * @alias module:model/TransactionWebhookEventData
49
49
  * @implements module:model/WebhookEventDataType
50
50
  * @implements module:model/Transaction
51
- * @param data_type {module:model/TransactionWebhookEventData.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.
51
+ * @param data_type {module:model/TransactionWebhookEventData.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.
52
52
  * @param transaction_id {String} The transaction ID.
53
53
  * @param wallet_id {String} For deposit transactions, this property represents the wallet ID of the transaction destination. For transactions of other types, this property represents the wallet ID of the transaction source.
54
54
  * @param status {module:model/TransactionStatus}
@@ -344,7 +344,7 @@ var TransactionWebhookEventData = /*#__PURE__*/function () {
344
344
  TransactionWebhookEventData.RequiredProperties = ["data_type", "transaction_id", "wallet_id", "status", "source", "destination", "initiator_type", "created_timestamp", "updated_timestamp"];
345
345
 
346
346
  /**
347
- * 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.
347
+ * 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.
348
348
  * @member {module:model/TransactionWebhookEventData.DataTypeEnum} data_type
349
349
  */
350
350
  TransactionWebhookEventData.prototype['data_type'] = undefined;
@@ -525,7 +525,7 @@ TransactionWebhookEventData.prototype['updated_timestamp'] = undefined;
525
525
 
526
526
  // Implement WebhookEventDataType interface:
527
527
  /**
528
- * 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.
528
+ * 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.
529
529
  * @member {module:model/WebhookEventDataType.DataTypeEnum} data_type
530
530
  */
531
531
  _WebhookEventDataType["default"].prototype['data_type'] = undefined;
@@ -720,6 +720,11 @@ TransactionWebhookEventData['DataTypeEnum'] = {
720
720
  * @const
721
721
  */
722
722
  "TokenListing": "TokenListing",
723
+ /**
724
+ * value: "BalanceUpdateInfo"
725
+ * @const
726
+ */
727
+ "BalanceUpdateInfo": "BalanceUpdateInfo",
723
728
  /**
724
729
  * value: "PaymentOrder"
725
730
  * @const
@@ -230,13 +230,13 @@ TransferDestination.prototype['change_address'] = undefined;
230
230
  TransferDestination.prototype['change_output_type'] = undefined;
231
231
 
232
232
  /**
233
- * 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`.
233
+ * 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.
234
234
  * @member {Boolean} force_internal
235
235
  */
236
236
  TransferDestination.prototype['force_internal'] = undefined;
237
237
 
238
238
  /**
239
- * 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`.
239
+ * 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.
240
240
  * @member {Boolean} force_external
241
241
  */
242
242
  TransferDestination.prototype['force_external'] = undefined;
@@ -59,6 +59,9 @@ var UpdateMerchantByIdRequest = /*#__PURE__*/function () {
59
59
  if (data.hasOwnProperty('name')) {
60
60
  obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
61
61
  }
62
+ if (data.hasOwnProperty('developer_fee_rate')) {
63
+ obj['developer_fee_rate'] = _ApiClient["default"].convertToType(data['developer_fee_rate'], 'String');
64
+ }
62
65
  }
63
66
  return obj;
64
67
  }
@@ -75,6 +78,10 @@ var UpdateMerchantByIdRequest = /*#__PURE__*/function () {
75
78
  if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
76
79
  throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
77
80
  }
81
+ // ensure the json data is a string
82
+ if (data['developer_fee_rate'] && !(typeof data['developer_fee_rate'] === 'string' || data['developer_fee_rate'] instanceof String)) {
83
+ throw new Error("Expected the field `developer_fee_rate` to be a primitive type in the JSON string but got " + data['developer_fee_rate']);
84
+ }
78
85
  return true;
79
86
  }
80
87
  }]);
@@ -84,4 +91,10 @@ var UpdateMerchantByIdRequest = /*#__PURE__*/function () {
84
91
  * @member {String} name
85
92
  */
86
93
  UpdateMerchantByIdRequest.prototype['name'] = undefined;
94
+
95
+ /**
96
+ * The developer fee rate applied to this merchant. Expressed as a string in decimal format where \"0.1\" represents 10%. This fee is deducted from the payment amount and only applies to top-up transactions.
97
+ * @member {String} developer_fee_rate
98
+ */
99
+ UpdateMerchantByIdRequest.prototype['developer_fee_rate'] = undefined;
87
100
  var _default = exports["default"] = UpdateMerchantByIdRequest;
@@ -0,0 +1,110 @@
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 UpdateRefundByIdRequest model module.
29
+ * @module model/UpdateRefundByIdRequest
30
+ */
31
+ var UpdateRefundByIdRequest = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>UpdateRefundByIdRequest</code>.
34
+ * @alias module:model/UpdateRefundByIdRequest
35
+ * @param to_address {String} The address where the refunded cryptocurrency will be sent.
36
+ */
37
+ function UpdateRefundByIdRequest(to_address) {
38
+ _classCallCheck(this, UpdateRefundByIdRequest);
39
+ UpdateRefundByIdRequest.initialize(this, to_address);
40
+ }
41
+
42
+ /**
43
+ * Initializes the fields of this object.
44
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45
+ * Only for internal use.
46
+ */
47
+ return _createClass(UpdateRefundByIdRequest, null, [{
48
+ key: "initialize",
49
+ value: function initialize(obj, to_address) {
50
+ obj['to_address'] = to_address;
51
+ }
52
+
53
+ /**
54
+ * Constructs a <code>UpdateRefundByIdRequest</code> from a plain JavaScript object, optionally creating a new instance.
55
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
56
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
57
+ * @param {module:model/UpdateRefundByIdRequest} obj Optional instance to populate.
58
+ * @return {module:model/UpdateRefundByIdRequest} The populated <code>UpdateRefundByIdRequest</code> instance.
59
+ */
60
+ }, {
61
+ key: "constructFromObject",
62
+ value: function constructFromObject(data, obj) {
63
+ if (data) {
64
+ obj = obj || new UpdateRefundByIdRequest();
65
+ if (data.hasOwnProperty('to_address')) {
66
+ obj['to_address'] = _ApiClient["default"].convertToType(data['to_address'], 'String');
67
+ }
68
+ }
69
+ return obj;
70
+ }
71
+
72
+ /**
73
+ * Validates the JSON data with respect to <code>UpdateRefundByIdRequest</code>.
74
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
75
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>UpdateRefundByIdRequest</code>.
76
+ */
77
+ }, {
78
+ key: "validateJSON",
79
+ value: function validateJSON(data) {
80
+ // check to make sure all required properties are present in the JSON string
81
+ var _iterator = _createForOfIteratorHelper(UpdateRefundByIdRequest.RequiredProperties),
82
+ _step;
83
+ try {
84
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
85
+ var property = _step.value;
86
+ if (!data.hasOwnProperty(property)) {
87
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
88
+ }
89
+ }
90
+ // ensure the json data is a string
91
+ } catch (err) {
92
+ _iterator.e(err);
93
+ } finally {
94
+ _iterator.f();
95
+ }
96
+ if (data['to_address'] && !(typeof data['to_address'] === 'string' || data['to_address'] instanceof String)) {
97
+ throw new Error("Expected the field `to_address` to be a primitive type in the JSON string but got " + data['to_address']);
98
+ }
99
+ return true;
100
+ }
101
+ }]);
102
+ }();
103
+ UpdateRefundByIdRequest.RequiredProperties = ["to_address"];
104
+
105
+ /**
106
+ * The address where the refunded cryptocurrency will be sent.
107
+ * @member {String} to_address
108
+ */
109
+ UpdateRefundByIdRequest.prototype['to_address'] = undefined;
110
+ var _default = exports["default"] = UpdateRefundByIdRequest;