@cobo/cobo-waas2 1.12.0 → 1.13.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 (159) hide show
  1. package/README.md +54 -18
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/api/FeeStationApi.js +18 -18
  4. package/dist/api/TransactionsApi.js +2 -2
  5. package/dist/api/WalletsApi.js +8 -8
  6. package/dist/index.js +260 -43
  7. package/dist/model/ActivityExtra.js +0 -23
  8. package/dist/model/AddressEncoding.js +15 -0
  9. package/dist/model/AddressesEventData.js +8 -3
  10. package/dist/model/BTCBIP137MessageSignDestination.js +122 -0
  11. package/dist/model/BTCBIP322MessageSignDestination.js +122 -0
  12. package/dist/model/BabylonStakingActivityDetailExtra.js +0 -39
  13. package/dist/model/{ListSwapActivities200Response.js → BankAccount.js} +51 -51
  14. package/dist/model/ChainsEventData.js +8 -3
  15. package/dist/model/CosmosAdr36MessageSignDestination.js +122 -0
  16. package/dist/model/CosmosContractCallDestination.js +152 -0
  17. package/dist/model/CosmosContractCallMessage.js +126 -0
  18. package/dist/model/CreateSettlement.js +174 -0
  19. package/dist/model/MPCVaultEventData.js +8 -3
  20. package/dist/model/{CreateSwapActivityRequest.js → Merchant.js} +45 -58
  21. package/dist/model/MessageSignDestination.js +111 -9
  22. package/dist/model/MessageSignDestinationType.js +15 -0
  23. package/dist/model/Order.js +306 -0
  24. package/dist/model/OrderStatus.js +76 -0
  25. package/dist/model/PaymentTransaction.js +201 -0
  26. package/dist/model/RefreshAddressBalancesByTokenRequest.js +2 -3
  27. package/dist/model/Refund.js +237 -0
  28. package/dist/model/RefundStatus.js +76 -0
  29. package/dist/model/RefundType.js +61 -0
  30. package/dist/model/SettleRequestStatus.js +76 -0
  31. package/dist/model/SettleStatus.js +76 -0
  32. package/dist/model/Settlement.js +168 -0
  33. package/dist/model/SettlementDetail.js +184 -0
  34. package/dist/model/SettlementInfo.js +175 -0
  35. package/dist/model/SettlementType.js +61 -0
  36. package/dist/model/SwapActivity.js +36 -5
  37. package/dist/model/SwapActivityStatus.js +66 -0
  38. package/dist/model/SwapActivityType.js +61 -0
  39. package/dist/model/SwapQuote.js +21 -34
  40. package/dist/model/{CreateSwapQuoteRequest.js → SwapToken.js} +73 -60
  41. package/dist/model/TSSRequestWebhookEventData.js +8 -3
  42. package/dist/model/TokenListing.js +230 -0
  43. package/dist/model/TokenListingEventData.js +363 -0
  44. package/dist/model/TokenListingRequestSource.js +61 -0
  45. package/dist/model/TokenListingRequestStatus.js +66 -0
  46. package/dist/model/TokensEventData.js +8 -3
  47. package/dist/model/Transaction.js +22 -5
  48. package/dist/model/TransactionBIP137Destination.js +122 -0
  49. package/dist/model/TransactionBIP322Destination.js +122 -0
  50. package/dist/model/TransactionBabylonBusinessInfo.js +138 -0
  51. package/dist/model/TransactionBabylonTxParameters.js +168 -0
  52. package/dist/model/TransactionCoreStakeInfo.js +168 -0
  53. package/dist/model/TransactionCosmosAdr36Destination.js +122 -0
  54. package/dist/model/TransactionCosmosContractDestination.js +152 -0
  55. package/dist/model/{ListEnableTokenPairs200Response.js → TransactionCosmosMessage.js} +54 -51
  56. package/dist/model/TransactionDestination.js +172 -8
  57. package/dist/model/TransactionDestinationType.js +20 -0
  58. package/dist/model/TransactionDetail.js +29 -7
  59. package/dist/model/TransactionDetails.js +29 -7
  60. package/dist/model/TransactionExtra.js +278 -0
  61. package/dist/model/TransactionExtraType.js +66 -0
  62. package/dist/model/TransactionFuelingInfo.js +3 -3
  63. package/dist/model/TransactionMessageSignBTCEIP191Destination.js +122 -0
  64. package/dist/model/TransactionRbfSource.js +37 -9
  65. package/dist/model/TransactionSelectedUtxo.js +2 -2
  66. package/dist/model/TransactionSubStatus.js +45 -0
  67. package/dist/model/TransactionWebhookEventData.js +37 -10
  68. package/dist/model/UpdateCustodialWalletParams.js +6 -4
  69. package/dist/model/UpdateExchangeWalletParams.js +6 -4
  70. package/dist/model/UpdateMpcWalletParams.js +6 -4
  71. package/dist/model/UpdateSmartContractWalletParams.js +6 -4
  72. package/dist/model/WalletInfoEventData.js +8 -3
  73. package/dist/model/WebhookEventData.js +81 -18
  74. package/dist/model/WebhookEventDataType.js +7 -2
  75. package/dist/model/WebhookEventType.js +10 -0
  76. package/docs/ActivityExtra.md +0 -4
  77. package/docs/AddressEncoding.md +6 -0
  78. package/docs/AddressesEventData.md +3 -1
  79. package/docs/BTCBIP137MessageSignDestination.md +10 -0
  80. package/docs/BTCBIP322MessageSignDestination.md +10 -0
  81. package/docs/BabylonStakingActivityDetailExtra.md +0 -4
  82. package/docs/BankAccount.md +10 -0
  83. package/docs/ChainsEventData.md +3 -1
  84. package/docs/CosmosAdr36MessageSignDestination.md +10 -0
  85. package/docs/CosmosContractCallDestination.md +11 -0
  86. package/docs/CosmosContractCallMessage.md +10 -0
  87. package/docs/CreateSettlement.md +14 -0
  88. package/docs/FeeStationApi.md +13 -13
  89. package/docs/MPCVaultEventData.md +3 -1
  90. package/docs/Merchant.md +11 -0
  91. package/docs/MessageSignDestination.md +3 -0
  92. package/docs/MessageSignDestinationType.md +6 -0
  93. package/docs/Order.md +23 -0
  94. package/docs/OrderStatus.md +18 -0
  95. package/docs/PaymentTransaction.md +16 -0
  96. package/docs/RefreshAddressBalancesByTokenRequest.md +1 -1
  97. package/docs/Refund.md +17 -0
  98. package/docs/RefundStatus.md +18 -0
  99. package/docs/RefundType.md +12 -0
  100. package/docs/SettleRequestStatus.md +18 -0
  101. package/docs/SettleStatus.md +18 -0
  102. package/docs/Settlement.md +12 -0
  103. package/docs/SettlementDetail.md +15 -0
  104. package/docs/SettlementInfo.md +14 -0
  105. package/docs/SettlementType.md +12 -0
  106. package/docs/SwapActivity.md +4 -1
  107. package/docs/SwapActivityStatus.md +14 -0
  108. package/docs/SwapActivityType.md +12 -0
  109. package/docs/SwapQuote.md +3 -4
  110. package/docs/SwapToken.md +14 -0
  111. package/docs/TSSRequestWebhookEventData.md +3 -1
  112. package/docs/TokenListing.md +19 -0
  113. package/docs/TokenListingEventData.md +45 -0
  114. package/docs/TokenListingRequestSource.md +12 -0
  115. package/docs/TokenListingRequestStatus.md +14 -0
  116. package/docs/TokensEventData.md +3 -1
  117. package/docs/Transaction.md +4 -3
  118. package/docs/TransactionBIP137Destination.md +10 -0
  119. package/docs/TransactionBIP322Destination.md +10 -0
  120. package/docs/TransactionBabylonBusinessInfo.md +11 -0
  121. package/docs/TransactionBabylonTxParameters.md +15 -0
  122. package/docs/TransactionCoreStakeInfo.md +14 -0
  123. package/docs/TransactionCosmosAdr36Destination.md +10 -0
  124. package/docs/TransactionCosmosContractDestination.md +11 -0
  125. package/docs/TransactionCosmosMessage.md +10 -0
  126. package/docs/TransactionDestination.md +4 -0
  127. package/docs/TransactionDestinationType.md +8 -0
  128. package/docs/TransactionDetail.md +4 -3
  129. package/docs/TransactionDetails.md +4 -3
  130. package/docs/TransactionExtra.md +21 -0
  131. package/docs/TransactionExtraType.md +14 -0
  132. package/docs/TransactionFuelingInfo.md +2 -2
  133. package/docs/TransactionMessageSignBTCEIP191Destination.md +10 -0
  134. package/docs/TransactionRbfSource.md +1 -1
  135. package/docs/TransactionSelectedUtxo.md +2 -2
  136. package/docs/TransactionSubStatus.md +18 -0
  137. package/docs/TransactionWebhookEventData.md +7 -4
  138. package/docs/TransactionsApi.md +1 -1
  139. package/docs/UpdateCustodialWalletParams.md +1 -1
  140. package/docs/UpdateExchangeWalletParams.md +1 -1
  141. package/docs/UpdateMpcWalletParams.md +1 -1
  142. package/docs/UpdateSmartContractWalletParams.md +1 -1
  143. package/docs/UpdateWalletParams.md +1 -1
  144. package/docs/WalletInfoEventData.md +3 -1
  145. package/docs/WalletsApi.md +5 -5
  146. package/docs/WebhookEventData.md +16 -8
  147. package/docs/WebhookEventDataType.md +3 -1
  148. package/docs/WebhookEventType.md +4 -0
  149. package/package.json +1 -1
  150. package/dist/api/SwapsApi.js +0 -360
  151. package/dist/model/CreateSwapQuote201Response.js +0 -264
  152. package/dist/model/SwapTokenPair.js +0 -100
  153. package/docs/CreateSwapActivityRequest.md +0 -12
  154. package/docs/CreateSwapQuote201Response.md +0 -17
  155. package/docs/CreateSwapQuoteRequest.md +0 -13
  156. package/docs/ListEnableTokenPairs200Response.md +0 -10
  157. package/docs/ListSwapActivities200Response.md +0 -10
  158. package/docs/SwapTokenPair.md +0 -10
  159. package/docs/SwapsApi.md +0 -348
@@ -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 _SettleRequestStatus = _interopRequireDefault(require("./SettleRequestStatus"));
9
+ var _SettlementDetail = _interopRequireDefault(require("./SettlementDetail"));
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 Settlement model module.
31
+ * @module model/Settlement
32
+ */
33
+ var Settlement = /*#__PURE__*/function () {
34
+ /**
35
+ * Constructs a new <code>Settlement</code>.
36
+ * @alias module:model/Settlement
37
+ * @param settlement_request_id {String} Internal system-generated identifier with a human-readable format. Used primarily for internal operations and logging.
38
+ * @param request_id {String} Client-provided external identifier.
39
+ * @param status {module:model/SettleRequestStatus}
40
+ * @param settlements {Array.<module:model/SettlementDetail>}
41
+ */
42
+ function Settlement(settlement_request_id, request_id, status, settlements) {
43
+ _classCallCheck(this, Settlement);
44
+ Settlement.initialize(this, settlement_request_id, request_id, status, settlements);
45
+ }
46
+
47
+ /**
48
+ * Initializes the fields of this object.
49
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
50
+ * Only for internal use.
51
+ */
52
+ return _createClass(Settlement, null, [{
53
+ key: "initialize",
54
+ value: function initialize(obj, settlement_request_id, request_id, status, settlements) {
55
+ obj['settlement_request_id'] = settlement_request_id;
56
+ obj['request_id'] = request_id;
57
+ obj['status'] = status;
58
+ obj['settlements'] = settlements;
59
+ }
60
+
61
+ /**
62
+ * Constructs a <code>Settlement</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/Settlement} obj Optional instance to populate.
66
+ * @return {module:model/Settlement} The populated <code>Settlement</code> instance.
67
+ */
68
+ }, {
69
+ key: "constructFromObject",
70
+ value: function constructFromObject(data, obj) {
71
+ if (data) {
72
+ obj = obj || new Settlement();
73
+ if (data.hasOwnProperty('settlement_request_id')) {
74
+ obj['settlement_request_id'] = _ApiClient["default"].convertToType(data['settlement_request_id'], 'String');
75
+ }
76
+ if (data.hasOwnProperty('request_id')) {
77
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
78
+ }
79
+ if (data.hasOwnProperty('status')) {
80
+ obj['status'] = _SettleRequestStatus["default"].constructFromObject(data['status']);
81
+ }
82
+ if (data.hasOwnProperty('settlements')) {
83
+ obj['settlements'] = _ApiClient["default"].convertToType(data['settlements'], [_SettlementDetail["default"]]);
84
+ }
85
+ }
86
+ return obj;
87
+ }
88
+
89
+ /**
90
+ * Validates the JSON data with respect to <code>Settlement</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>Settlement</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(Settlement.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['settlement_request_id'] && !(typeof data['settlement_request_id'] === 'string' || data['settlement_request_id'] instanceof String)) {
114
+ throw new Error("Expected the field `settlement_request_id` to be a primitive type in the JSON string but got " + data['settlement_request_id']);
115
+ }
116
+ // ensure the json data is a string
117
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
118
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
119
+ }
120
+ if (data['settlements']) {
121
+ // data not null
122
+ // ensure the json data is an array
123
+ if (!Array.isArray(data['settlements'])) {
124
+ throw new Error("Expected the field `settlements` to be an array in the JSON data but got " + data['settlements']);
125
+ }
126
+ // validate the optional field `settlements` (array)
127
+ var _iterator2 = _createForOfIteratorHelper(data['settlements']),
128
+ _step2;
129
+ try {
130
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
131
+ var item = _step2.value;
132
+ _SettlementDetail["default"].validateJSON(item);
133
+ }
134
+ } catch (err) {
135
+ _iterator2.e(err);
136
+ } finally {
137
+ _iterator2.f();
138
+ }
139
+ ;
140
+ }
141
+ return true;
142
+ }
143
+ }]);
144
+ }();
145
+ Settlement.RequiredProperties = ["settlement_request_id", "request_id", "status", "settlements"];
146
+
147
+ /**
148
+ * Internal system-generated identifier with a human-readable format. Used primarily for internal operations and logging.
149
+ * @member {String} settlement_request_id
150
+ */
151
+ Settlement.prototype['settlement_request_id'] = undefined;
152
+
153
+ /**
154
+ * Client-provided external identifier.
155
+ * @member {String} request_id
156
+ */
157
+ Settlement.prototype['request_id'] = undefined;
158
+
159
+ /**
160
+ * @member {module:model/SettleRequestStatus} status
161
+ */
162
+ Settlement.prototype['status'] = undefined;
163
+
164
+ /**
165
+ * @member {Array.<module:model/SettlementDetail>} settlements
166
+ */
167
+ Settlement.prototype['settlements'] = undefined;
168
+ var _default = exports["default"] = Settlement;
@@ -0,0 +1,184 @@
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 _BankAccount = _interopRequireDefault(require("./BankAccount"));
9
+ var _PaymentTransaction = _interopRequireDefault(require("./PaymentTransaction"));
10
+ var _SettleStatus = _interopRequireDefault(require("./SettleStatus"));
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 SettlementDetail model module.
32
+ * @module model/SettlementDetail
33
+ */
34
+ var SettlementDetail = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>SettlementDetail</code>.
37
+ * @alias module:model/SettlementDetail
38
+ */
39
+ function SettlementDetail() {
40
+ _classCallCheck(this, SettlementDetail);
41
+ SettlementDetail.initialize(this);
42
+ }
43
+
44
+ /**
45
+ * Initializes the fields of this object.
46
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
47
+ * Only for internal use.
48
+ */
49
+ return _createClass(SettlementDetail, null, [{
50
+ key: "initialize",
51
+ value: function initialize(obj) {}
52
+
53
+ /**
54
+ * Constructs a <code>SettlementDetail</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/SettlementDetail} obj Optional instance to populate.
58
+ * @return {module:model/SettlementDetail} The populated <code>SettlementDetail</code> instance.
59
+ */
60
+ }, {
61
+ key: "constructFromObject",
62
+ value: function constructFromObject(data, obj) {
63
+ if (data) {
64
+ obj = obj || new SettlementDetail();
65
+ if (data.hasOwnProperty('currency')) {
66
+ obj['currency'] = _ApiClient["default"].convertToType(data['currency'], 'String');
67
+ }
68
+ if (data.hasOwnProperty('token_id')) {
69
+ obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
70
+ }
71
+ if (data.hasOwnProperty('chain_id')) {
72
+ obj['chain_id'] = _ApiClient["default"].convertToType(data['chain_id'], 'String');
73
+ }
74
+ if (data.hasOwnProperty('amount')) {
75
+ obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('status')) {
78
+ obj['status'] = _SettleStatus["default"].constructFromObject(data['status']);
79
+ }
80
+ if (data.hasOwnProperty('bank_account')) {
81
+ obj['bank_account'] = _BankAccount["default"].constructFromObject(data['bank_account']);
82
+ }
83
+ if (data.hasOwnProperty('transactions')) {
84
+ obj['transactions'] = _ApiClient["default"].convertToType(data['transactions'], [_PaymentTransaction["default"]]);
85
+ }
86
+ }
87
+ return obj;
88
+ }
89
+
90
+ /**
91
+ * Validates the JSON data with respect to <code>SettlementDetail</code>.
92
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
93
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>SettlementDetail</code>.
94
+ */
95
+ }, {
96
+ key: "validateJSON",
97
+ value: function validateJSON(data) {
98
+ // ensure the json data is a string
99
+ if (data['currency'] && !(typeof data['currency'] === 'string' || data['currency'] instanceof String)) {
100
+ throw new Error("Expected the field `currency` to be a primitive type in the JSON string but got " + data['currency']);
101
+ }
102
+ // ensure the json data is a string
103
+ if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
104
+ throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
105
+ }
106
+ // ensure the json data is a string
107
+ if (data['chain_id'] && !(typeof data['chain_id'] === 'string' || data['chain_id'] instanceof String)) {
108
+ throw new Error("Expected the field `chain_id` to be a primitive type in the JSON string but got " + data['chain_id']);
109
+ }
110
+ // ensure the json data is a string
111
+ if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
112
+ throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
113
+ }
114
+ // validate the optional field `bank_account`
115
+ if (data['bank_account']) {
116
+ // data not null
117
+ if (!!_BankAccount["default"].validateJSON) {
118
+ _BankAccount["default"].validateJSON(data['bank_account']);
119
+ }
120
+ }
121
+ if (data['transactions']) {
122
+ // data not null
123
+ // ensure the json data is an array
124
+ if (!Array.isArray(data['transactions'])) {
125
+ throw new Error("Expected the field `transactions` to be an array in the JSON data but got " + data['transactions']);
126
+ }
127
+ // validate the optional field `transactions` (array)
128
+ var _iterator = _createForOfIteratorHelper(data['transactions']),
129
+ _step;
130
+ try {
131
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
132
+ var item = _step.value;
133
+ _PaymentTransaction["default"].validateJSON(item);
134
+ }
135
+ } catch (err) {
136
+ _iterator.e(err);
137
+ } finally {
138
+ _iterator.f();
139
+ }
140
+ ;
141
+ }
142
+ return true;
143
+ }
144
+ }]);
145
+ }();
146
+ /**
147
+ * The currency for the settlement.
148
+ * @member {String} currency
149
+ */
150
+ SettlementDetail.prototype['currency'] = undefined;
151
+
152
+ /**
153
+ * The ID of the cryptocurrency token settled.
154
+ * @member {String} token_id
155
+ */
156
+ SettlementDetail.prototype['token_id'] = undefined;
157
+
158
+ /**
159
+ * The ID of the blockchain network on which the settlement occurred.
160
+ * @member {String} chain_id
161
+ */
162
+ SettlementDetail.prototype['chain_id'] = undefined;
163
+
164
+ /**
165
+ * The settled amount. - If `token_id` is specified, this represents the settlement amount in the specified cryptocurrency token. - If `token_id` is not specified, this represents the settlement amount in the specified currency.
166
+ * @member {String} amount
167
+ */
168
+ SettlementDetail.prototype['amount'] = undefined;
169
+
170
+ /**
171
+ * @member {module:model/SettleStatus} status
172
+ */
173
+ SettlementDetail.prototype['status'] = undefined;
174
+
175
+ /**
176
+ * @member {module:model/BankAccount} bank_account
177
+ */
178
+ SettlementDetail.prototype['bank_account'] = undefined;
179
+
180
+ /**
181
+ * @member {Array.<module:model/PaymentTransaction>} transactions
182
+ */
183
+ SettlementDetail.prototype['transactions'] = undefined;
184
+ var _default = exports["default"] = SettlementDetail;
@@ -0,0 +1,175 @@
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 SettlementInfo model module.
29
+ * @module model/SettlementInfo
30
+ */
31
+ var SettlementInfo = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>SettlementInfo</code>.
34
+ * @alias module:model/SettlementInfo
35
+ * @param available_amount {String} The amount available for settlement in the specified cryptocurrency token.
36
+ */
37
+ function SettlementInfo(available_amount) {
38
+ _classCallCheck(this, SettlementInfo);
39
+ SettlementInfo.initialize(this, available_amount);
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(SettlementInfo, null, [{
48
+ key: "initialize",
49
+ value: function initialize(obj, available_amount) {
50
+ obj['available_amount'] = available_amount;
51
+ }
52
+
53
+ /**
54
+ * Constructs a <code>SettlementInfo</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/SettlementInfo} obj Optional instance to populate.
58
+ * @return {module:model/SettlementInfo} The populated <code>SettlementInfo</code> instance.
59
+ */
60
+ }, {
61
+ key: "constructFromObject",
62
+ value: function constructFromObject(data, obj) {
63
+ if (data) {
64
+ obj = obj || new SettlementInfo();
65
+ if (data.hasOwnProperty('merchant_id')) {
66
+ obj['merchant_id'] = _ApiClient["default"].convertToType(data['merchant_id'], 'String');
67
+ }
68
+ if (data.hasOwnProperty('token_id')) {
69
+ obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
70
+ }
71
+ if (data.hasOwnProperty('available_amount')) {
72
+ obj['available_amount'] = _ApiClient["default"].convertToType(data['available_amount'], 'String');
73
+ }
74
+ if (data.hasOwnProperty('available_currency_balance')) {
75
+ obj['available_currency_balance'] = _ApiClient["default"].convertToType(data['available_currency_balance'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('pending_amount')) {
78
+ obj['pending_amount'] = _ApiClient["default"].convertToType(data['pending_amount'], 'String');
79
+ }
80
+ if (data.hasOwnProperty('pending_currency_balance')) {
81
+ obj['pending_currency_balance'] = _ApiClient["default"].convertToType(data['pending_currency_balance'], 'String');
82
+ }
83
+ }
84
+ return obj;
85
+ }
86
+
87
+ /**
88
+ * Validates the JSON data with respect to <code>SettlementInfo</code>.
89
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
90
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>SettlementInfo</code>.
91
+ */
92
+ }, {
93
+ key: "validateJSON",
94
+ value: function validateJSON(data) {
95
+ // check to make sure all required properties are present in the JSON string
96
+ var _iterator = _createForOfIteratorHelper(SettlementInfo.RequiredProperties),
97
+ _step;
98
+ try {
99
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
100
+ var property = _step.value;
101
+ if (!data.hasOwnProperty(property)) {
102
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
103
+ }
104
+ }
105
+ // ensure the json data is a string
106
+ } catch (err) {
107
+ _iterator.e(err);
108
+ } finally {
109
+ _iterator.f();
110
+ }
111
+ if (data['merchant_id'] && !(typeof data['merchant_id'] === 'string' || data['merchant_id'] instanceof String)) {
112
+ throw new Error("Expected the field `merchant_id` to be a primitive type in the JSON string but got " + data['merchant_id']);
113
+ }
114
+ // ensure the json data is a string
115
+ if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
116
+ throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
117
+ }
118
+ // ensure the json data is a string
119
+ if (data['available_amount'] && !(typeof data['available_amount'] === 'string' || data['available_amount'] instanceof String)) {
120
+ throw new Error("Expected the field `available_amount` to be a primitive type in the JSON string but got " + data['available_amount']);
121
+ }
122
+ // ensure the json data is a string
123
+ if (data['available_currency_balance'] && !(typeof data['available_currency_balance'] === 'string' || data['available_currency_balance'] instanceof String)) {
124
+ throw new Error("Expected the field `available_currency_balance` to be a primitive type in the JSON string but got " + data['available_currency_balance']);
125
+ }
126
+ // ensure the json data is a string
127
+ if (data['pending_amount'] && !(typeof data['pending_amount'] === 'string' || data['pending_amount'] instanceof String)) {
128
+ throw new Error("Expected the field `pending_amount` to be a primitive type in the JSON string but got " + data['pending_amount']);
129
+ }
130
+ // ensure the json data is a string
131
+ if (data['pending_currency_balance'] && !(typeof data['pending_currency_balance'] === 'string' || data['pending_currency_balance'] instanceof String)) {
132
+ throw new Error("Expected the field `pending_currency_balance` to be a primitive type in the JSON string but got " + data['pending_currency_balance']);
133
+ }
134
+ return true;
135
+ }
136
+ }]);
137
+ }();
138
+ SettlementInfo.RequiredProperties = ["available_amount"];
139
+
140
+ /**
141
+ * The merchant ID. For payment gateway balance, this field will be empty.
142
+ * @member {String} merchant_id
143
+ */
144
+ SettlementInfo.prototype['merchant_id'] = undefined;
145
+
146
+ /**
147
+ * The ID of the cryptocurrency token.
148
+ * @member {String} token_id
149
+ */
150
+ SettlementInfo.prototype['token_id'] = undefined;
151
+
152
+ /**
153
+ * The amount available for settlement in the specified cryptocurrency token.
154
+ * @member {String} available_amount
155
+ */
156
+ SettlementInfo.prototype['available_amount'] = undefined;
157
+
158
+ /**
159
+ * The available currency balance.
160
+ * @member {String} available_currency_balance
161
+ */
162
+ SettlementInfo.prototype['available_currency_balance'] = undefined;
163
+
164
+ /**
165
+ * The pending amount.
166
+ * @member {String} pending_amount
167
+ */
168
+ SettlementInfo.prototype['pending_amount'] = undefined;
169
+
170
+ /**
171
+ * The pending currency balance.
172
+ * @member {String} pending_currency_balance
173
+ */
174
+ SettlementInfo.prototype['pending_currency_balance'] = undefined;
175
+ var _default = exports["default"] = SettlementInfo;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
16
+ * Cobo Wallet as a Service 2.0
17
+ *
18
+ * Contact: help@cobo.com
19
+ *
20
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
21
+ * https://openapi-generator.tech
22
+ * Do not edit the class manually.
23
+ *
24
+ */
25
+ /**
26
+ * Enum class SettlementType.
27
+ * @enum {}
28
+ * @readonly
29
+ */
30
+ var SettlementType = exports["default"] = /*#__PURE__*/function () {
31
+ function SettlementType() {
32
+ _classCallCheck(this, SettlementType);
33
+ /**
34
+ * value: "Merchant"
35
+ * @const
36
+ */
37
+ _defineProperty(this, "Merchant", "Merchant");
38
+ /**
39
+ * value: "Psp"
40
+ * @const
41
+ */
42
+ _defineProperty(this, "Psp", "Psp");
43
+ /**
44
+ * value: "unknown_default_open_api"
45
+ * @const
46
+ */
47
+ _defineProperty(this, "unknown_default_open_api", "unknown_default_open_api");
48
+ }
49
+ return _createClass(SettlementType, null, [{
50
+ key: "constructFromObject",
51
+ value:
52
+ /**
53
+ * Returns a <code>SettlementType</code> enum value from a Javascript object name.
54
+ * @param {Object} data The plain JavaScript object containing the name of the enum value.
55
+ * @return {module:model/SettlementType} The enum <code>SettlementType</code> value.
56
+ */
57
+ function constructFromObject(object) {
58
+ return object;
59
+ }
60
+ }]);
61
+ }();