@cobo/cobo-waas2 1.25.0 → 1.26.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 (102) hide show
  1. package/README.md +21 -5
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/api/AutoSweepApi.js +2 -2
  4. package/dist/api/ComplianceApi.js +2 -2
  5. package/dist/api/FeeStationApi.js +6 -6
  6. package/dist/api/PaymentApi.js +48 -6
  7. package/dist/api/TokenizationApi.js +122 -4
  8. package/dist/api/TransactionsApi.js +2 -2
  9. package/dist/index.js +105 -14
  10. package/dist/model/AutoFuelType.js +5 -0
  11. package/dist/model/CreateCryptoAddressRequest.js +1 -1
  12. package/dist/model/CreateMerchantRequest.js +1 -1
  13. package/dist/model/CreatePaymentOrderRequest.js +8 -8
  14. package/dist/model/CreateRefundLinkRequest.js +129 -0
  15. package/dist/model/FeeStationCheckFeeStationUsage.js +28 -10
  16. package/dist/model/FeeStationCheckFeeStationUsageResponse.js +33 -20
  17. package/dist/model/FeeStationSponsorTransactionDescription.js +125 -0
  18. package/dist/model/Link.js +2 -2
  19. package/dist/model/LinkDisplayInfo.js +2 -2
  20. package/dist/model/MerchantBalance.js +1 -1
  21. package/dist/model/Order.js +1 -1
  22. package/dist/model/OrderLinkBusinessInfo.js +11 -11
  23. package/dist/model/OrderLinkBusinessInfoCustomExchangeRatesInner.js +4 -4
  24. package/dist/model/PaymentOrderEventData.js +2 -2
  25. package/dist/model/PspBalance.js +1 -1
  26. package/dist/model/RefundLinkBusinessInfo.js +162 -0
  27. package/dist/model/RefundStatus.js +10 -0
  28. package/dist/model/SubmitKytScreeningsReviewBody.js +1 -1
  29. package/dist/model/SwapQuote.js +18 -18
  30. package/dist/model/TokenizationERC20TokenParams.js +5 -5
  31. package/dist/model/{TokenizationTokenPermissionParams.js → TokenizationERC20TokenPermissionParams.js} +23 -23
  32. package/dist/model/TokenizationERC20WrappedTokenParams.js +177 -0
  33. package/dist/model/TokenizationERC20WrappedTokenPermissionParams.js +166 -0
  34. package/dist/model/TokenizationEstimateFeeRequestOperationParams.js +38 -11
  35. package/dist/model/TokenizationIssueTokenParamsTokenParams.js +72 -10
  36. package/dist/model/TokenizationListPermissionsResponse.js +146 -0
  37. package/dist/model/TokenizationListPermissionsResponseDataInner.js +126 -0
  38. package/dist/model/TokenizationOperationType.js +5 -0
  39. package/dist/model/TokenizationPermissionAction.js +66 -0
  40. package/dist/model/TokenizationSOLWrappedTokenParams.js +177 -0
  41. package/dist/model/TokenizationSolWrappedTokenPermissionParams.js +127 -0
  42. package/dist/model/TokenizationTokenDetailInfo.js +51 -5
  43. package/dist/model/TokenizationTokenInfo.js +26 -4
  44. package/dist/model/TokenizationTokenPermissionType.js +5 -0
  45. package/dist/model/TokenizationTokenStandard.js +10 -0
  46. package/dist/model/{TokenizationTokenPermissionsResponse.js → TokenizationUpdateAddressPermissions.js} +51 -53
  47. package/dist/model/TokenizationUpdatePermissionsEstimateFeeParams.js +198 -0
  48. package/dist/model/TokenizationUpdatePermissionsParams.js +145 -0
  49. package/dist/model/TokenizationUpdatePermissionsRequest.js +213 -0
  50. package/dist/model/TransactionCoboCategory.js +35 -0
  51. package/dist/model/UpdateMerchantByIdRequest.js +1 -1
  52. package/dist/model/WebhookEventData.js +1 -1
  53. package/docs/AutoFuelType.md +2 -0
  54. package/docs/AutoSweepApi.md +2 -2
  55. package/docs/ComplianceApi.md +1 -1
  56. package/docs/CreateCryptoAddressRequest.md +1 -1
  57. package/docs/CreateMerchantRequest.md +1 -1
  58. package/docs/CreatePaymentOrderRequest.md +5 -5
  59. package/docs/CreateRefundLinkRequest.md +10 -0
  60. package/docs/FeeStationApi.md +4 -4
  61. package/docs/FeeStationCheckFeeStationUsage.md +4 -2
  62. package/docs/FeeStationCheckFeeStationUsageResponse.md +4 -3
  63. package/docs/FeeStationSponsorTransactionDescription.md +10 -0
  64. package/docs/Link.md +1 -1
  65. package/docs/LinkDisplayInfo.md +2 -2
  66. package/docs/MerchantBalance.md +1 -1
  67. package/docs/Order.md +1 -1
  68. package/docs/OrderLinkBusinessInfo.md +7 -7
  69. package/docs/OrderLinkBusinessInfoCustomExchangeRatesInner.md +2 -2
  70. package/docs/PaymentApi.md +56 -3
  71. package/docs/PaymentOrderEventData.md +1 -1
  72. package/docs/PspBalance.md +1 -1
  73. package/docs/RefundLinkBusinessInfo.md +13 -0
  74. package/docs/RefundStatus.md +4 -0
  75. package/docs/SwapQuote.md +10 -10
  76. package/docs/TokenizationApi.md +120 -2
  77. package/docs/TokenizationERC20TokenParams.md +1 -1
  78. package/docs/{TokenizationTokenPermissionParams.md → TokenizationERC20TokenPermissionParams.md} +1 -1
  79. package/docs/TokenizationERC20WrappedTokenParams.md +14 -0
  80. package/docs/TokenizationERC20WrappedTokenPermissionParams.md +15 -0
  81. package/docs/TokenizationEstimateFeeRequestOperationParams.md +1 -1
  82. package/docs/TokenizationIssueTokenParamsTokenParams.md +2 -1
  83. package/docs/TokenizationListPermissionsResponse.md +10 -0
  84. package/docs/TokenizationListPermissionsResponseDataInner.md +10 -0
  85. package/docs/TokenizationOperationType.md +2 -0
  86. package/docs/TokenizationPermissionAction.md +14 -0
  87. package/docs/TokenizationSOLWrappedTokenParams.md +14 -0
  88. package/docs/TokenizationSolWrappedTokenPermissionParams.md +12 -0
  89. package/docs/TokenizationTokenDetailInfo.md +3 -0
  90. package/docs/TokenizationTokenInfo.md +2 -0
  91. package/docs/TokenizationTokenPermissionType.md +2 -0
  92. package/docs/TokenizationTokenStandard.md +4 -0
  93. package/docs/TokenizationUpdateAddressPermissions.md +11 -0
  94. package/docs/TokenizationUpdatePermissionsEstimateFeeParams.md +13 -0
  95. package/docs/TokenizationUpdatePermissionsParams.md +10 -0
  96. package/docs/TokenizationUpdatePermissionsRequest.md +13 -0
  97. package/docs/TransactionCoboCategory.md +14 -0
  98. package/docs/TransactionsApi.md +1 -1
  99. package/docs/UpdateMerchantByIdRequest.md +1 -1
  100. package/docs/WebhookEventData.md +1 -1
  101. package/package.json +1 -1
  102. package/docs/TokenizationTokenPermissionsResponse.md +0 -10
@@ -32,20 +32,20 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
32
32
  var FeeStationCheckFeeStationUsageResponse = /*#__PURE__*/function () {
33
33
  /**
34
34
  * Constructs a new <code>FeeStationCheckFeeStationUsageResponse</code>.
35
- * The Fee Station usage evaluation result for the transfer request.
35
+ * The fee station evaluation result for the transfer request.
36
36
  * @alias module:model/FeeStationCheckFeeStationUsageResponse
37
37
  * @param token_id {String} The token used to pay the gas fee for this specific transaction. You can retrieve the IDs of all supported tokens by calling [List enabled tokens](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens).
38
+ * @param balance {String} The current token balance available in Fee Station.
38
39
  * @param gas_station_type {module:model/FeeStationGasStationType}
39
40
  * @param is_fee_station_applicable {Boolean} Indicates whether Fee Station is applied for this transfer request.
40
41
  * @param is_balance_sufficient {Boolean} If Fee Station is used, indicates whether its balance is sufficient to cover the required gas fee.
41
- * @param balance {String} The current token balance available in Fee Station.
42
42
  * @param total_fee_amount {String} The total gas amount required for this transfer request.
43
- * @param is_sponsor_applicable {Boolean} Indicates whether USDT (U) sponsorship is applied when Fee Station balance is insufficient.
44
- * @param sponsored_fee_amount {String} The amount of gas fee sponsored by USDT (U) when applicable.
43
+ * @param is_sponsor_applicable {Boolean} Indicates whether USD stablecoin sponsorship is applied when the Fee Station balance is insufficient.
44
+ * @param sponsored_fee_amount {String} The amount of gas fee sponsored by USD stablecoin when applicable.
45
45
  */
46
- function FeeStationCheckFeeStationUsageResponse(token_id, gas_station_type, is_fee_station_applicable, is_balance_sufficient, balance, total_fee_amount, is_sponsor_applicable, sponsored_fee_amount) {
46
+ function FeeStationCheckFeeStationUsageResponse(token_id, balance, gas_station_type, is_fee_station_applicable, is_balance_sufficient, total_fee_amount, is_sponsor_applicable, sponsored_fee_amount) {
47
47
  _classCallCheck(this, FeeStationCheckFeeStationUsageResponse);
48
- FeeStationCheckFeeStationUsageResponse.initialize(this, token_id, gas_station_type, is_fee_station_applicable, is_balance_sufficient, balance, total_fee_amount, is_sponsor_applicable, sponsored_fee_amount);
48
+ FeeStationCheckFeeStationUsageResponse.initialize(this, token_id, balance, gas_station_type, is_fee_station_applicable, is_balance_sufficient, total_fee_amount, is_sponsor_applicable, sponsored_fee_amount);
49
49
  }
50
50
 
51
51
  /**
@@ -55,12 +55,12 @@ var FeeStationCheckFeeStationUsageResponse = /*#__PURE__*/function () {
55
55
  */
56
56
  return _createClass(FeeStationCheckFeeStationUsageResponse, null, [{
57
57
  key: "initialize",
58
- value: function initialize(obj, token_id, gas_station_type, is_fee_station_applicable, is_balance_sufficient, balance, total_fee_amount, is_sponsor_applicable, sponsored_fee_amount) {
58
+ value: function initialize(obj, token_id, balance, gas_station_type, is_fee_station_applicable, is_balance_sufficient, total_fee_amount, is_sponsor_applicable, sponsored_fee_amount) {
59
59
  obj['token_id'] = token_id;
60
+ obj['balance'] = balance;
60
61
  obj['gas_station_type'] = gas_station_type;
61
62
  obj['is_fee_station_applicable'] = is_fee_station_applicable;
62
63
  obj['is_balance_sufficient'] = is_balance_sufficient;
63
- obj['balance'] = balance;
64
64
  obj['total_fee_amount'] = total_fee_amount;
65
65
  obj['is_sponsor_applicable'] = is_sponsor_applicable;
66
66
  obj['sponsored_fee_amount'] = sponsored_fee_amount;
@@ -81,6 +81,9 @@ var FeeStationCheckFeeStationUsageResponse = /*#__PURE__*/function () {
81
81
  if (data.hasOwnProperty('token_id')) {
82
82
  obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
83
83
  }
84
+ if (data.hasOwnProperty('balance')) {
85
+ obj['balance'] = _ApiClient["default"].convertToType(data['balance'], 'String');
86
+ }
84
87
  if (data.hasOwnProperty('gas_station_type')) {
85
88
  obj['gas_station_type'] = _FeeStationGasStationType["default"].constructFromObject(data['gas_station_type']);
86
89
  }
@@ -90,9 +93,6 @@ var FeeStationCheckFeeStationUsageResponse = /*#__PURE__*/function () {
90
93
  if (data.hasOwnProperty('is_balance_sufficient')) {
91
94
  obj['is_balance_sufficient'] = _ApiClient["default"].convertToType(data['is_balance_sufficient'], 'Boolean');
92
95
  }
93
- if (data.hasOwnProperty('balance')) {
94
- obj['balance'] = _ApiClient["default"].convertToType(data['balance'], 'String');
95
- }
96
96
  if (data.hasOwnProperty('total_fee_amount')) {
97
97
  obj['total_fee_amount'] = _ApiClient["default"].convertToType(data['total_fee_amount'], 'String');
98
98
  }
@@ -102,6 +102,9 @@ var FeeStationCheckFeeStationUsageResponse = /*#__PURE__*/function () {
102
102
  if (data.hasOwnProperty('sponsored_fee_amount')) {
103
103
  obj['sponsored_fee_amount'] = _ApiClient["default"].convertToType(data['sponsored_fee_amount'], 'String');
104
104
  }
105
+ if (data.hasOwnProperty('sponsored_token_id')) {
106
+ obj['sponsored_token_id'] = _ApiClient["default"].convertToType(data['sponsored_token_id'], 'String');
107
+ }
105
108
  }
106
109
  return obj;
107
110
  }
@@ -145,11 +148,15 @@ var FeeStationCheckFeeStationUsageResponse = /*#__PURE__*/function () {
145
148
  if (data['sponsored_fee_amount'] && !(typeof data['sponsored_fee_amount'] === 'string' || data['sponsored_fee_amount'] instanceof String)) {
146
149
  throw new Error("Expected the field `sponsored_fee_amount` to be a primitive type in the JSON string but got " + data['sponsored_fee_amount']);
147
150
  }
151
+ // ensure the json data is a string
152
+ if (data['sponsored_token_id'] && !(typeof data['sponsored_token_id'] === 'string' || data['sponsored_token_id'] instanceof String)) {
153
+ throw new Error("Expected the field `sponsored_token_id` to be a primitive type in the JSON string but got " + data['sponsored_token_id']);
154
+ }
148
155
  return true;
149
156
  }
150
157
  }]);
151
158
  }();
152
- FeeStationCheckFeeStationUsageResponse.RequiredProperties = ["token_id", "gas_station_type", "is_fee_station_applicable", "is_balance_sufficient", "balance", "total_fee_amount", "is_sponsor_applicable", "sponsored_fee_amount"];
159
+ FeeStationCheckFeeStationUsageResponse.RequiredProperties = ["token_id", "balance", "gas_station_type", "is_fee_station_applicable", "is_balance_sufficient", "total_fee_amount", "is_sponsor_applicable", "sponsored_fee_amount"];
153
160
 
154
161
  /**
155
162
  * The token used to pay the gas fee for this specific transaction. You can retrieve the IDs of all supported tokens by calling [List enabled tokens](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens).
@@ -157,6 +164,12 @@ FeeStationCheckFeeStationUsageResponse.RequiredProperties = ["token_id", "gas_st
157
164
  */
158
165
  FeeStationCheckFeeStationUsageResponse.prototype['token_id'] = undefined;
159
166
 
167
+ /**
168
+ * The current token balance available in Fee Station.
169
+ * @member {String} balance
170
+ */
171
+ FeeStationCheckFeeStationUsageResponse.prototype['balance'] = undefined;
172
+
160
173
  /**
161
174
  * @member {module:model/FeeStationGasStationType} gas_station_type
162
175
  */
@@ -174,12 +187,6 @@ FeeStationCheckFeeStationUsageResponse.prototype['is_fee_station_applicable'] =
174
187
  */
175
188
  FeeStationCheckFeeStationUsageResponse.prototype['is_balance_sufficient'] = undefined;
176
189
 
177
- /**
178
- * The current token balance available in Fee Station.
179
- * @member {String} balance
180
- */
181
- FeeStationCheckFeeStationUsageResponse.prototype['balance'] = undefined;
182
-
183
190
  /**
184
191
  * The total gas amount required for this transfer request.
185
192
  * @member {String} total_fee_amount
@@ -187,14 +194,20 @@ FeeStationCheckFeeStationUsageResponse.prototype['balance'] = undefined;
187
194
  FeeStationCheckFeeStationUsageResponse.prototype['total_fee_amount'] = undefined;
188
195
 
189
196
  /**
190
- * Indicates whether USDT (U) sponsorship is applied when Fee Station balance is insufficient.
197
+ * Indicates whether USD stablecoin sponsorship is applied when the Fee Station balance is insufficient.
191
198
  * @member {Boolean} is_sponsor_applicable
192
199
  */
193
200
  FeeStationCheckFeeStationUsageResponse.prototype['is_sponsor_applicable'] = undefined;
194
201
 
195
202
  /**
196
- * The amount of gas fee sponsored by USDT (U) when applicable.
203
+ * The amount of gas fee sponsored by USD stablecoin when applicable.
197
204
  * @member {String} sponsored_fee_amount
198
205
  */
199
206
  FeeStationCheckFeeStationUsageResponse.prototype['sponsored_fee_amount'] = undefined;
207
+
208
+ /**
209
+ * The token ID used to sponsor the gas fee.
210
+ * @member {String} sponsored_token_id
211
+ */
212
+ FeeStationCheckFeeStationUsageResponse.prototype['sponsored_token_id'] = undefined;
200
213
  var _default = exports["default"] = FeeStationCheckFeeStationUsageResponse;
@@ -0,0 +1,125 @@
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 FeeStationSponsorTransactionDescription model module.
29
+ * @module model/FeeStationSponsorTransactionDescription
30
+ */
31
+ var FeeStationSponsorTransactionDescription = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>FeeStationSponsorTransactionDescription</code>.
34
+ * @alias module:model/FeeStationSponsorTransactionDescription
35
+ * @param total_fee_amount {String} The total amount used to sponsor the gas fee required for executing the main transaction on behalf of the user.
36
+ * @param commission_fee {String} The commission fee charged for sponsoring the gas fee.
37
+ */
38
+ function FeeStationSponsorTransactionDescription(total_fee_amount, commission_fee) {
39
+ _classCallCheck(this, FeeStationSponsorTransactionDescription);
40
+ FeeStationSponsorTransactionDescription.initialize(this, total_fee_amount, commission_fee);
41
+ }
42
+
43
+ /**
44
+ * Initializes the fields of this object.
45
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
46
+ * Only for internal use.
47
+ */
48
+ return _createClass(FeeStationSponsorTransactionDescription, null, [{
49
+ key: "initialize",
50
+ value: function initialize(obj, total_fee_amount, commission_fee) {
51
+ obj['total_fee_amount'] = total_fee_amount;
52
+ obj['commission_fee'] = commission_fee;
53
+ }
54
+
55
+ /**
56
+ * Constructs a <code>FeeStationSponsorTransactionDescription</code> from a plain JavaScript object, optionally creating a new instance.
57
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
58
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
59
+ * @param {module:model/FeeStationSponsorTransactionDescription} obj Optional instance to populate.
60
+ * @return {module:model/FeeStationSponsorTransactionDescription} The populated <code>FeeStationSponsorTransactionDescription</code> instance.
61
+ */
62
+ }, {
63
+ key: "constructFromObject",
64
+ value: function constructFromObject(data, obj) {
65
+ if (data) {
66
+ obj = obj || new FeeStationSponsorTransactionDescription();
67
+ if (data.hasOwnProperty('total_fee_amount')) {
68
+ obj['total_fee_amount'] = _ApiClient["default"].convertToType(data['total_fee_amount'], 'String');
69
+ }
70
+ if (data.hasOwnProperty('commission_fee')) {
71
+ obj['commission_fee'] = _ApiClient["default"].convertToType(data['commission_fee'], 'String');
72
+ }
73
+ }
74
+ return obj;
75
+ }
76
+
77
+ /**
78
+ * Validates the JSON data with respect to <code>FeeStationSponsorTransactionDescription</code>.
79
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
80
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>FeeStationSponsorTransactionDescription</code>.
81
+ */
82
+ }, {
83
+ key: "validateJSON",
84
+ value: function validateJSON(data) {
85
+ // check to make sure all required properties are present in the JSON string
86
+ var _iterator = _createForOfIteratorHelper(FeeStationSponsorTransactionDescription.RequiredProperties),
87
+ _step;
88
+ try {
89
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
90
+ var property = _step.value;
91
+ if (!data.hasOwnProperty(property)) {
92
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
93
+ }
94
+ }
95
+ // ensure the json data is a string
96
+ } catch (err) {
97
+ _iterator.e(err);
98
+ } finally {
99
+ _iterator.f();
100
+ }
101
+ if (data['total_fee_amount'] && !(typeof data['total_fee_amount'] === 'string' || data['total_fee_amount'] instanceof String)) {
102
+ throw new Error("Expected the field `total_fee_amount` to be a primitive type in the JSON string but got " + data['total_fee_amount']);
103
+ }
104
+ // ensure the json data is a string
105
+ if (data['commission_fee'] && !(typeof data['commission_fee'] === 'string' || data['commission_fee'] instanceof String)) {
106
+ throw new Error("Expected the field `commission_fee` to be a primitive type in the JSON string but got " + data['commission_fee']);
107
+ }
108
+ return true;
109
+ }
110
+ }]);
111
+ }();
112
+ FeeStationSponsorTransactionDescription.RequiredProperties = ["total_fee_amount", "commission_fee"];
113
+
114
+ /**
115
+ * The total amount used to sponsor the gas fee required for executing the main transaction on behalf of the user.
116
+ * @member {String} total_fee_amount
117
+ */
118
+ FeeStationSponsorTransactionDescription.prototype['total_fee_amount'] = undefined;
119
+
120
+ /**
121
+ * The commission fee charged for sponsoring the gas fee.
122
+ * @member {String} commission_fee
123
+ */
124
+ FeeStationSponsorTransactionDescription.prototype['commission_fee'] = undefined;
125
+ var _default = exports["default"] = FeeStationSponsorTransactionDescription;
@@ -32,7 +32,7 @@ var Link = /*#__PURE__*/function () {
32
32
  /**
33
33
  * Constructs a new <code>Link</code>.
34
34
  * @alias module:model/Link
35
- * @param url {String} The base URL of the payment page. This URL should be combined with the token parameter to form the complete payment link. Example: `https://checkout.cobo.com/payment`
35
+ * @param url {String} The base URL of the payment page. This URL should be combined with the `token` parameter to form the complete payment link.
36
36
  * @param token {String} The unique payment token that should be appended to the URL as a query parameter. This token authenticates and identifies the specific payment session. The complete payment link should be constructed as: `[url]?token=[token]`
37
37
  */
38
38
  function Link(url, token) {
@@ -112,7 +112,7 @@ var Link = /*#__PURE__*/function () {
112
112
  Link.RequiredProperties = ["url", "token"];
113
113
 
114
114
  /**
115
- * The base URL of the payment page. This URL should be combined with the token parameter to form the complete payment link. Example: `https://checkout.cobo.com/payment`
115
+ * The base URL of the payment page. This URL should be combined with the `token` parameter to form the complete payment link.
116
116
  * @member {String} url
117
117
  */
118
118
  Link.prototype['url'] = undefined;
@@ -87,13 +87,13 @@ var LinkDisplayInfo = /*#__PURE__*/function () {
87
87
  }]);
88
88
  }();
89
89
  /**
90
- * Optional display name for the developer/platform. This name may be shown to end users during the payment process.
90
+ * The brand name to display to end users during the payment process.
91
91
  * @member {String} developer_name
92
92
  */
93
93
  LinkDisplayInfo.prototype['developer_name'] = undefined;
94
94
 
95
95
  /**
96
- * Optional URL to the developer's logo image. The logo may be displayed to end users during the payment process. Supported formats: PNG, JPG, SVG. Maximum file size: 2MB.
96
+ * The URL of your logo image to display to end users during the payment process.
97
97
  * @member {String} logo
98
98
  */
99
99
  LinkDisplayInfo.prototype['logo'] = undefined;
@@ -188,7 +188,7 @@ MerchantBalance.prototype['settled_amount'] = undefined;
188
188
  MerchantBalance.prototype['refunded_amount'] = undefined;
189
189
 
190
190
  /**
191
- * The total balance of the token available for payout or refund for the merchant. `total_balance` = `total_received_amount` - `settled_amount` - `refunded_amount` For more information, please refer to [Amounts and Balances](/v2_cn/payments/amounts-and-balances)
191
+ * The total balance of the token available for payout or refund for the merchant. `total_balance` = `total_received_amount` - `settled_amount` - `refunded_amount` For more information, please refer to [Funds allocation and balances](https://www.cobo.com/developers/v2/payments/amounts-and-balances)
192
192
  * @member {String} total_balance
193
193
  */
194
194
  MerchantBalance.prototype['total_balance'] = undefined;
@@ -370,7 +370,7 @@ Order.prototype['transactions'] = undefined;
370
370
  Order.prototype['settlement_status'] = undefined;
371
371
 
372
372
  /**
373
- * Allowed amount deviation.
373
+ * The maximum allowed deviation from the payable amount in the case of underpayment, specified as a positive value with up to one decimal place. If you provide more than one decimal place, an error will occur. When the actual received amount is within this deviation (inclusive) of the payable amount, the order status will be set to `Completed` rather than `Underpaid`.
374
374
  * @member {String} amount_tolerance
375
375
  */
376
376
  Order.prototype['amount_tolerance'] = undefined;
@@ -33,11 +33,11 @@ var OrderLinkBusinessInfo = /*#__PURE__*/function () {
33
33
  /**
34
34
  * Constructs a new <code>OrderLinkBusinessInfo</code>.
35
35
  * @alias module:model/OrderLinkBusinessInfo
36
- * @param token_ids {Array.<String>} List of supported cryptocurrency token IDs for this payment. Each token ID must be from the supported values.
37
- * @param currency {String} The currency for the base order amount and the developer fee. Currently, only `USD`/`USDT`/`USDC` are supported.
38
- * @param fee_amount {String} The developer fee for the order, in the currency specified by `currency`. If `currency` is not specified, the fee is in the cryptocurrency specified by `token_id`. If you are a merchant directly serving payers, set this field to `0`. Developer fees are only relevant for platforms like payment service providers (PSPs) that charge fees to their downstream merchants. The developer fee is added to the base amount (`order_amount`) to determine the final charge. For example: - Base amount (`order_amount`): \"100.00\" - Developer fee (`fee_amount`): \"2.00\" - Total charged to customer: \"102.00\" Values can contain up to two decimal places.
36
+ * @param token_ids {Array.<String>} An array of token IDs representing the cryptocurrencies and chains available for payment. These options will be shown to users on the payment page for them to choose from. Supported token IDs include: - USDC: `ETH_USDC`, `ARBITRUM_USDCOIN`, `SOL_USDC`, `BASE_USDC`, `MATIC_USDC2`, `BSC_USDC` - USDT: `TRON_USDT`, `ETH_USDT`, `ARBITRUM_USDT`, `SOL_USDT`, `BASE_USDT`, `MATIC_USDT`, `BSC_USDT`
37
+ * @param currency {String} The currency in which both the order amount (`order_amount`) and the developer fee (`fee_amount`) are denominated. Only the following values are supported: `USD`, `USDT`, or `USDC`.
38
+ * @param fee_amount {String} The developer fee for the order, denominated in the currency specified by `currency`. If you are a merchant directly serving payers, set this field to `0`. Developer fees are only relevant for platforms like payment service providers (PSPs) that charge fees to their downstream merchants. The developer fee is added to the base amount (`order_amount`) to determine the final charge. For example: - Base amount (`order_amount`): \"100.00\" - Developer fee (`fee_amount`): \"2.00\" - Total charged to customer: \"102.00\" Values can contain up to two decimal places.
39
39
  * @param merchant_id {String} The merchant ID.
40
- * @param order_amount {String} The base amount of the order, excluding the developer fee (specified in `fee_amount`), in the currency specified by `currency`. If `currency` is not specified, the amount is in the cryptocurrency specified by `token_id`. Values must be greater than `0` and contain two decimal places.
40
+ * @param order_amount {String} The base amount of the order, excluding the developer fee (specified in `fee_amount`), denominated in the currency specified by `currency`. Values must be greater than `0` and contain two decimal places.
41
41
  * @param psp_order_code {String} A unique reference code assigned by you as a developer to identify this order in your system. This code must be unique across all orders in your system. The code should have a maximum length of 128 characters.
42
42
  */
43
43
  function OrderLinkBusinessInfo(token_ids, currency, fee_amount, merchant_id, order_amount, psp_order_code) {
@@ -193,25 +193,25 @@ var OrderLinkBusinessInfo = /*#__PURE__*/function () {
193
193
  OrderLinkBusinessInfo.RequiredProperties = ["token_ids", "currency", "fee_amount", "merchant_id", "order_amount", "psp_order_code"];
194
194
 
195
195
  /**
196
- * List of supported cryptocurrency token IDs for this payment. Each token ID must be from the supported values.
196
+ * An array of token IDs representing the cryptocurrencies and chains available for payment. These options will be shown to users on the payment page for them to choose from. Supported token IDs include: - USDC: `ETH_USDC`, `ARBITRUM_USDCOIN`, `SOL_USDC`, `BASE_USDC`, `MATIC_USDC2`, `BSC_USDC` - USDT: `TRON_USDT`, `ETH_USDT`, `ARBITRUM_USDT`, `SOL_USDT`, `BASE_USDT`, `MATIC_USDT`, `BSC_USDT`
197
197
  * @member {Array.<String>} token_ids
198
198
  */
199
199
  OrderLinkBusinessInfo.prototype['token_ids'] = undefined;
200
200
 
201
201
  /**
202
- * Optional list of final exchange rates for different tokens. If provided, these rates will be used instead of real-time market rates.
202
+ * A list of custom exchange rates defining how much one unit of a specific cryptocurrency (`token_id`) is valued in the selected fiat or crypto currency (`currency`). If this field is omitted, the system’s default exchange rates will apply. Each item specifies a `token_id` and its corresponding `exchange_rate`. For example, to treat 1 USDT (on Ethereum) as equivalent to 0.99 USD, provide: ```json { \"custom_exchange_rates\": [ { \"token_id\": \"ETH_USDT\", \"exchange_rate\": \"0.99\" } ], \"currency\": \"USD\" } ```
203
203
  * @member {Array.<module:model/OrderLinkBusinessInfoCustomExchangeRatesInner>} custom_exchange_rates
204
204
  */
205
205
  OrderLinkBusinessInfo.prototype['custom_exchange_rates'] = undefined;
206
206
 
207
207
  /**
208
- * The currency for the base order amount and the developer fee. Currently, only `USD`/`USDT`/`USDC` are supported.
208
+ * The currency in which both the order amount (`order_amount`) and the developer fee (`fee_amount`) are denominated. Only the following values are supported: `USD`, `USDT`, or `USDC`.
209
209
  * @member {String} currency
210
210
  */
211
211
  OrderLinkBusinessInfo.prototype['currency'] = undefined;
212
212
 
213
213
  /**
214
- * The developer fee for the order, in the currency specified by `currency`. If `currency` is not specified, the fee is in the cryptocurrency specified by `token_id`. If you are a merchant directly serving payers, set this field to `0`. Developer fees are only relevant for platforms like payment service providers (PSPs) that charge fees to their downstream merchants. The developer fee is added to the base amount (`order_amount`) to determine the final charge. For example: - Base amount (`order_amount`): \"100.00\" - Developer fee (`fee_amount`): \"2.00\" - Total charged to customer: \"102.00\" Values can contain up to two decimal places.
214
+ * The developer fee for the order, denominated in the currency specified by `currency`. If you are a merchant directly serving payers, set this field to `0`. Developer fees are only relevant for platforms like payment service providers (PSPs) that charge fees to their downstream merchants. The developer fee is added to the base amount (`order_amount`) to determine the final charge. For example: - Base amount (`order_amount`): \"100.00\" - Developer fee (`fee_amount`): \"2.00\" - Total charged to customer: \"102.00\" Values can contain up to two decimal places.
215
215
  * @member {String} fee_amount
216
216
  */
217
217
  OrderLinkBusinessInfo.prototype['fee_amount'] = undefined;
@@ -223,7 +223,7 @@ OrderLinkBusinessInfo.prototype['fee_amount'] = undefined;
223
223
  OrderLinkBusinessInfo.prototype['merchant_id'] = undefined;
224
224
 
225
225
  /**
226
- * The base amount of the order, excluding the developer fee (specified in `fee_amount`), in the currency specified by `currency`. If `currency` is not specified, the amount is in the cryptocurrency specified by `token_id`. Values must be greater than `0` and contain two decimal places.
226
+ * The base amount of the order, excluding the developer fee (specified in `fee_amount`), denominated in the currency specified by `currency`. Values must be greater than `0` and contain two decimal places.
227
227
  * @member {String} order_amount
228
228
  */
229
229
  OrderLinkBusinessInfo.prototype['order_amount'] = undefined;
@@ -248,13 +248,13 @@ OrderLinkBusinessInfo.prototype['psp_order_code'] = undefined;
248
248
  OrderLinkBusinessInfo.prototype['expired_in'] = 1800;
249
249
 
250
250
  /**
251
- * Whether to allocate a dedicated address for this order. - `true`: A dedicated address will be allocated for this order. - `false`: A shared address from the address pool will be used.
251
+ * This field has been deprecated.
252
252
  * @member {Boolean} use_dedicated_address
253
253
  */
254
254
  OrderLinkBusinessInfo.prototype['use_dedicated_address'] = undefined;
255
255
 
256
256
  /**
257
- * Allowed amount deviation, precision to 1 decimal place.
257
+ * The maximum allowed deviation from the payable amount in the case of underpayment, specified as a positive value with up to one decimal place. If you provide more than one decimal place, an error will occur. When the actual received amount is within this deviation (inclusive) of the payable amount, the order status will be set to `Completed` rather than `Underpaid`.
258
258
  * @member {String} amount_tolerance
259
259
  */
260
260
  OrderLinkBusinessInfo.prototype['amount_tolerance'] = undefined;
@@ -32,8 +32,8 @@ var OrderLinkBusinessInfoCustomExchangeRatesInner = /*#__PURE__*/function () {
32
32
  /**
33
33
  * Constructs a new <code>OrderLinkBusinessInfoCustomExchangeRatesInner</code>.
34
34
  * @alias module:model/OrderLinkBusinessInfoCustomExchangeRatesInner
35
- * @param token_id {String} The cryptocurrency token ID
36
- * @param exchange_rate {String} The fixed exchange rate to use for this token
35
+ * @param token_id {String} The token ID.
36
+ * @param exchange_rate {String} The exchange rate to use for this token.
37
37
  */
38
38
  function OrderLinkBusinessInfoCustomExchangeRatesInner(token_id, exchange_rate) {
39
39
  _classCallCheck(this, OrderLinkBusinessInfoCustomExchangeRatesInner);
@@ -112,13 +112,13 @@ var OrderLinkBusinessInfoCustomExchangeRatesInner = /*#__PURE__*/function () {
112
112
  OrderLinkBusinessInfoCustomExchangeRatesInner.RequiredProperties = ["token_id", "exchange_rate"];
113
113
 
114
114
  /**
115
- * The cryptocurrency token ID
115
+ * The token ID.
116
116
  * @member {String} token_id
117
117
  */
118
118
  OrderLinkBusinessInfoCustomExchangeRatesInner.prototype['token_id'] = undefined;
119
119
 
120
120
  /**
121
- * The fixed exchange rate to use for this token
121
+ * The exchange rate to use for this token.
122
122
  * @member {String} exchange_rate
123
123
  */
124
124
  OrderLinkBusinessInfoCustomExchangeRatesInner.prototype['exchange_rate'] = undefined;
@@ -393,7 +393,7 @@ PaymentOrderEventData.prototype['transactions'] = undefined;
393
393
  PaymentOrderEventData.prototype['settlement_status'] = undefined;
394
394
 
395
395
  /**
396
- * Allowed amount deviation.
396
+ * The maximum allowed deviation from the payable amount in the case of underpayment, specified as a positive value with up to one decimal place. If you provide more than one decimal place, an error will occur. When the actual received amount is within this deviation (inclusive) of the payable amount, the order status will be set to `Completed` rather than `Underpaid`.
397
397
  * @member {String} amount_tolerance
398
398
  */
399
399
  PaymentOrderEventData.prototype['amount_tolerance'] = undefined;
@@ -499,7 +499,7 @@ _Order["default"].prototype['transactions'] = undefined;
499
499
  */
500
500
  _Order["default"].prototype['settlement_status'] = undefined;
501
501
  /**
502
- * Allowed amount deviation.
502
+ * The maximum allowed deviation from the payable amount in the case of underpayment, specified as a positive value with up to one decimal place. If you provide more than one decimal place, an error will occur. When the actual received amount is within this deviation (inclusive) of the payable amount, the order status will be set to `Completed` rather than `Underpaid`.
503
503
  * @member {String} amount_tolerance
504
504
  */
505
505
  _Order["default"].prototype['amount_tolerance'] = undefined;
@@ -162,7 +162,7 @@ PspBalance.prototype['settled_amount'] = undefined;
162
162
  PspBalance.prototype['refunded_amount'] = undefined;
163
163
 
164
164
  /**
165
- * The total balance of the token available for payout or refund for the developer. `total_balance` = `developer_fee_amount` - `settled_amount` - `refunded_amount` For more information, please refer to [Amounts and Balances](/v2_cn/payments/amounts-and-balances)
165
+ * The total balance of the token available for payout or refund for the developer. `total_balance` = `developer_fee_amount` - `settled_amount` - `refunded_amount` For more information, please refer to [Funds allocation and balances](https://www.cobo.com/developers/v2/payments/amounts-and-balances)
166
166
  * @member {String} total_balance
167
167
  */
168
168
  PspBalance.prototype['total_balance'] = undefined;
@@ -0,0 +1,162 @@
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 _RefundType = _interopRequireDefault(require("./RefundType"));
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 RefundLinkBusinessInfo model module.
30
+ * @module model/RefundLinkBusinessInfo
31
+ */
32
+ var RefundLinkBusinessInfo = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>RefundLinkBusinessInfo</code>.
35
+ * @alias module:model/RefundLinkBusinessInfo
36
+ * @param transaction_id {String} The transaction ID.
37
+ * @param amount {String} The amount to refund in cryptocurrency.
38
+ * @param refund_source {module:model/RefundType}
39
+ */
40
+ function RefundLinkBusinessInfo(transaction_id, amount, refund_source) {
41
+ _classCallCheck(this, RefundLinkBusinessInfo);
42
+ RefundLinkBusinessInfo.initialize(this, transaction_id, amount, refund_source);
43
+ }
44
+
45
+ /**
46
+ * Initializes the fields of this object.
47
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
48
+ * Only for internal use.
49
+ */
50
+ return _createClass(RefundLinkBusinessInfo, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, transaction_id, amount, refund_source) {
53
+ obj['transaction_id'] = transaction_id;
54
+ obj['amount'] = amount;
55
+ obj['refund_source'] = refund_source;
56
+ }
57
+
58
+ /**
59
+ * Constructs a <code>RefundLinkBusinessInfo</code> from a plain JavaScript object, optionally creating a new instance.
60
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
61
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
62
+ * @param {module:model/RefundLinkBusinessInfo} obj Optional instance to populate.
63
+ * @return {module:model/RefundLinkBusinessInfo} The populated <code>RefundLinkBusinessInfo</code> instance.
64
+ */
65
+ }, {
66
+ key: "constructFromObject",
67
+ value: function constructFromObject(data, obj) {
68
+ if (data) {
69
+ obj = obj || new RefundLinkBusinessInfo();
70
+ if (data.hasOwnProperty('transaction_id')) {
71
+ obj['transaction_id'] = _ApiClient["default"].convertToType(data['transaction_id'], 'String');
72
+ }
73
+ if (data.hasOwnProperty('amount')) {
74
+ obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
75
+ }
76
+ if (data.hasOwnProperty('refund_source')) {
77
+ obj['refund_source'] = _RefundType["default"].constructFromObject(data['refund_source']);
78
+ }
79
+ if (data.hasOwnProperty('merchant_id')) {
80
+ obj['merchant_id'] = _ApiClient["default"].convertToType(data['merchant_id'], 'String');
81
+ }
82
+ if (data.hasOwnProperty('fee_amount')) {
83
+ obj['fee_amount'] = _ApiClient["default"].convertToType(data['fee_amount'], 'String');
84
+ }
85
+ }
86
+ return obj;
87
+ }
88
+
89
+ /**
90
+ * Validates the JSON data with respect to <code>RefundLinkBusinessInfo</code>.
91
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
92
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>RefundLinkBusinessInfo</code>.
93
+ */
94
+ }, {
95
+ key: "validateJSON",
96
+ value: function validateJSON(data) {
97
+ // check to make sure all required properties are present in the JSON string
98
+ var _iterator = _createForOfIteratorHelper(RefundLinkBusinessInfo.RequiredProperties),
99
+ _step;
100
+ try {
101
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
102
+ var property = _step.value;
103
+ if (!data.hasOwnProperty(property)) {
104
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
105
+ }
106
+ }
107
+ // ensure the json data is a string
108
+ } catch (err) {
109
+ _iterator.e(err);
110
+ } finally {
111
+ _iterator.f();
112
+ }
113
+ if (data['transaction_id'] && !(typeof data['transaction_id'] === 'string' || data['transaction_id'] instanceof String)) {
114
+ throw new Error("Expected the field `transaction_id` to be a primitive type in the JSON string but got " + data['transaction_id']);
115
+ }
116
+ // ensure the json data is a string
117
+ if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
118
+ throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
119
+ }
120
+ // ensure the json data is a string
121
+ if (data['merchant_id'] && !(typeof data['merchant_id'] === 'string' || data['merchant_id'] instanceof String)) {
122
+ throw new Error("Expected the field `merchant_id` to be a primitive type in the JSON string but got " + data['merchant_id']);
123
+ }
124
+ // ensure the json data is a string
125
+ if (data['fee_amount'] && !(typeof data['fee_amount'] === 'string' || data['fee_amount'] instanceof String)) {
126
+ throw new Error("Expected the field `fee_amount` to be a primitive type in the JSON string but got " + data['fee_amount']);
127
+ }
128
+ return true;
129
+ }
130
+ }]);
131
+ }();
132
+ RefundLinkBusinessInfo.RequiredProperties = ["transaction_id", "amount", "refund_source"];
133
+
134
+ /**
135
+ * The transaction ID.
136
+ * @member {String} transaction_id
137
+ */
138
+ RefundLinkBusinessInfo.prototype['transaction_id'] = undefined;
139
+
140
+ /**
141
+ * The amount to refund in cryptocurrency.
142
+ * @member {String} amount
143
+ */
144
+ RefundLinkBusinessInfo.prototype['amount'] = undefined;
145
+
146
+ /**
147
+ * @member {module:model/RefundType} refund_source
148
+ */
149
+ RefundLinkBusinessInfo.prototype['refund_source'] = undefined;
150
+
151
+ /**
152
+ * The merchant ID, required if the refund amount source is `Merchant`.
153
+ * @member {String} merchant_id
154
+ */
155
+ RefundLinkBusinessInfo.prototype['merchant_id'] = undefined;
156
+
157
+ /**
158
+ * The amount of the transaction fee that the merchant will bear for the refund.
159
+ * @member {String} fee_amount
160
+ */
161
+ RefundLinkBusinessInfo.prototype['fee_amount'] = undefined;
162
+ var _default = exports["default"] = RefundLinkBusinessInfo;