@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,230 @@
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 _TokenInfo = _interopRequireDefault(require("./TokenInfo"));
9
+ var _TokenListingRequestSource = _interopRequireDefault(require("./TokenListingRequestSource"));
10
+ var _TokenListingRequestStatus = _interopRequireDefault(require("./TokenListingRequestStatus"));
11
+ var _WalletSubtype = _interopRequireDefault(require("./WalletSubtype"));
12
+ var _WalletType = _interopRequireDefault(require("./WalletType"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
14
+ 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); }
15
+ 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; } } }; }
16
+ 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; } }
17
+ 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; }
18
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
19
+ 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); } }
20
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
21
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
22
+ 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); } /**
23
+ * Cobo Wallet as a Service 2.0
24
+ *
25
+ * Contact: help@cobo.com
26
+ *
27
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
28
+ * https://openapi-generator.tech
29
+ * Do not edit the class manually.
30
+ *
31
+ */
32
+ /**
33
+ * The TokenListing model module.
34
+ * @module model/TokenListing
35
+ */
36
+ var TokenListing = /*#__PURE__*/function () {
37
+ /**
38
+ * Constructs a new <code>TokenListing</code>.
39
+ * Detailed information about a token listing request
40
+ * @alias module:model/TokenListing
41
+ * @param request_id {String} Unique identifier of the token listing request
42
+ * @param chain_id {String} chain_id of the blockchain where the token exists
43
+ * @param contract_address {String} Contract address of the token
44
+ * @param wallet_type {module:model/WalletType}
45
+ * @param wallet_subtype {module:model/WalletSubtype}
46
+ * @param status {module:model/TokenListingRequestStatus}
47
+ */
48
+ function TokenListing(request_id, chain_id, contract_address, wallet_type, wallet_subtype, status) {
49
+ _classCallCheck(this, TokenListing);
50
+ TokenListing.initialize(this, request_id, chain_id, contract_address, wallet_type, wallet_subtype, status);
51
+ }
52
+
53
+ /**
54
+ * Initializes the fields of this object.
55
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
56
+ * Only for internal use.
57
+ */
58
+ return _createClass(TokenListing, null, [{
59
+ key: "initialize",
60
+ value: function initialize(obj, request_id, chain_id, contract_address, wallet_type, wallet_subtype, status) {
61
+ obj['request_id'] = request_id;
62
+ obj['chain_id'] = chain_id;
63
+ obj['contract_address'] = contract_address;
64
+ obj['wallet_type'] = wallet_type;
65
+ obj['wallet_subtype'] = wallet_subtype;
66
+ obj['status'] = status;
67
+ }
68
+
69
+ /**
70
+ * Constructs a <code>TokenListing</code> from a plain JavaScript object, optionally creating a new instance.
71
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
72
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
73
+ * @param {module:model/TokenListing} obj Optional instance to populate.
74
+ * @return {module:model/TokenListing} The populated <code>TokenListing</code> instance.
75
+ */
76
+ }, {
77
+ key: "constructFromObject",
78
+ value: function constructFromObject(data, obj) {
79
+ if (data) {
80
+ obj = obj || new TokenListing();
81
+ if (data.hasOwnProperty('request_id')) {
82
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('chain_id')) {
85
+ obj['chain_id'] = _ApiClient["default"].convertToType(data['chain_id'], 'String');
86
+ }
87
+ if (data.hasOwnProperty('contract_address')) {
88
+ obj['contract_address'] = _ApiClient["default"].convertToType(data['contract_address'], 'String');
89
+ }
90
+ if (data.hasOwnProperty('wallet_type')) {
91
+ obj['wallet_type'] = _WalletType["default"].constructFromObject(data['wallet_type']);
92
+ }
93
+ if (data.hasOwnProperty('wallet_subtype')) {
94
+ obj['wallet_subtype'] = _WalletSubtype["default"].constructFromObject(data['wallet_subtype']);
95
+ }
96
+ if (data.hasOwnProperty('token')) {
97
+ obj['token'] = _TokenInfo["default"].constructFromObject(data['token']);
98
+ }
99
+ if (data.hasOwnProperty('status')) {
100
+ obj['status'] = _TokenListingRequestStatus["default"].constructFromObject(data['status']);
101
+ }
102
+ if (data.hasOwnProperty('source')) {
103
+ obj['source'] = _TokenListingRequestSource["default"].constructFromObject(data['source']);
104
+ }
105
+ if (data.hasOwnProperty('feedback')) {
106
+ obj['feedback'] = _ApiClient["default"].convertToType(data['feedback'], 'String');
107
+ }
108
+ if (data.hasOwnProperty('created_timestamp')) {
109
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
110
+ }
111
+ if (data.hasOwnProperty('updated_timestamp')) {
112
+ obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
113
+ }
114
+ }
115
+ return obj;
116
+ }
117
+
118
+ /**
119
+ * Validates the JSON data with respect to <code>TokenListing</code>.
120
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
121
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TokenListing</code>.
122
+ */
123
+ }, {
124
+ key: "validateJSON",
125
+ value: function validateJSON(data) {
126
+ // check to make sure all required properties are present in the JSON string
127
+ var _iterator = _createForOfIteratorHelper(TokenListing.RequiredProperties),
128
+ _step;
129
+ try {
130
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
131
+ var property = _step.value;
132
+ if (!data.hasOwnProperty(property)) {
133
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
134
+ }
135
+ }
136
+ // ensure the json data is a string
137
+ } catch (err) {
138
+ _iterator.e(err);
139
+ } finally {
140
+ _iterator.f();
141
+ }
142
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
143
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
144
+ }
145
+ // ensure the json data is a string
146
+ if (data['chain_id'] && !(typeof data['chain_id'] === 'string' || data['chain_id'] instanceof String)) {
147
+ throw new Error("Expected the field `chain_id` to be a primitive type in the JSON string but got " + data['chain_id']);
148
+ }
149
+ // ensure the json data is a string
150
+ if (data['contract_address'] && !(typeof data['contract_address'] === 'string' || data['contract_address'] instanceof String)) {
151
+ throw new Error("Expected the field `contract_address` to be a primitive type in the JSON string but got " + data['contract_address']);
152
+ }
153
+ // validate the optional field `token`
154
+ if (data['token']) {
155
+ // data not null
156
+ if (!!_TokenInfo["default"].validateJSON) {
157
+ _TokenInfo["default"].validateJSON(data['token']);
158
+ }
159
+ }
160
+ // ensure the json data is a string
161
+ if (data['feedback'] && !(typeof data['feedback'] === 'string' || data['feedback'] instanceof String)) {
162
+ throw new Error("Expected the field `feedback` to be a primitive type in the JSON string but got " + data['feedback']);
163
+ }
164
+ return true;
165
+ }
166
+ }]);
167
+ }();
168
+ TokenListing.RequiredProperties = ["request_id", "chain_id", "contract_address", "wallet_type", "wallet_subtype", "status"];
169
+
170
+ /**
171
+ * Unique identifier of the token listing request
172
+ * @member {String} request_id
173
+ */
174
+ TokenListing.prototype['request_id'] = undefined;
175
+
176
+ /**
177
+ * chain_id of the blockchain where the token exists
178
+ * @member {String} chain_id
179
+ */
180
+ TokenListing.prototype['chain_id'] = undefined;
181
+
182
+ /**
183
+ * Contract address of the token
184
+ * @member {String} contract_address
185
+ */
186
+ TokenListing.prototype['contract_address'] = undefined;
187
+
188
+ /**
189
+ * @member {module:model/WalletType} wallet_type
190
+ */
191
+ TokenListing.prototype['wallet_type'] = undefined;
192
+
193
+ /**
194
+ * @member {module:model/WalletSubtype} wallet_subtype
195
+ */
196
+ TokenListing.prototype['wallet_subtype'] = undefined;
197
+
198
+ /**
199
+ * @member {module:model/TokenInfo} token
200
+ */
201
+ TokenListing.prototype['token'] = undefined;
202
+
203
+ /**
204
+ * @member {module:model/TokenListingRequestStatus} status
205
+ */
206
+ TokenListing.prototype['status'] = undefined;
207
+
208
+ /**
209
+ * @member {module:model/TokenListingRequestSource} source
210
+ */
211
+ TokenListing.prototype['source'] = undefined;
212
+
213
+ /**
214
+ * Feedback provided by the admin for rejected requests
215
+ * @member {String} feedback
216
+ */
217
+ TokenListing.prototype['feedback'] = undefined;
218
+
219
+ /**
220
+ * Timestamp when the request was created (in milliseconds since Unix epoch)
221
+ * @member {Number} created_timestamp
222
+ */
223
+ TokenListing.prototype['created_timestamp'] = undefined;
224
+
225
+ /**
226
+ * Timestamp when the request was last updated (in milliseconds since Unix epoch)
227
+ * @member {Number} updated_timestamp
228
+ */
229
+ TokenListing.prototype['updated_timestamp'] = undefined;
230
+ var _default = exports["default"] = TokenListing;
@@ -0,0 +1,363 @@
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 _TokenInfo = _interopRequireDefault(require("./TokenInfo"));
9
+ var _TokenListing = _interopRequireDefault(require("./TokenListing"));
10
+ var _TokenListingRequestSource = _interopRequireDefault(require("./TokenListingRequestSource"));
11
+ var _TokenListingRequestStatus = _interopRequireDefault(require("./TokenListingRequestStatus"));
12
+ var _WalletSubtype = _interopRequireDefault(require("./WalletSubtype"));
13
+ var _WalletType = _interopRequireDefault(require("./WalletType"));
14
+ var _WebhookEventDataType = _interopRequireDefault(require("./WebhookEventDataType"));
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
16
+ 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); }
17
+ 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; } } }; }
18
+ 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; } }
19
+ 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; }
20
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
21
+ 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); } }
22
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
23
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
24
+ 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); } /**
25
+ * Cobo Wallet as a Service 2.0
26
+ *
27
+ * Contact: help@cobo.com
28
+ *
29
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
30
+ * https://openapi-generator.tech
31
+ * Do not edit the class manually.
32
+ *
33
+ */
34
+ /**
35
+ * The TokenListingEventData model module.
36
+ * @module model/TokenListingEventData
37
+ */
38
+ var TokenListingEventData = /*#__PURE__*/function () {
39
+ /**
40
+ * Constructs a new <code>TokenListingEventData</code>.
41
+ * @alias module:model/TokenListingEventData
42
+ * @implements module:model/WebhookEventDataType
43
+ * @implements module:model/TokenListing
44
+ * @param data_type {module:model/TokenListingEventData.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.
45
+ * @param request_id {String} Unique identifier of the token listing request
46
+ * @param chain_id {String} chain_id of the blockchain where the token exists
47
+ * @param contract_address {String} Contract address of the token
48
+ * @param wallet_type {module:model/WalletType}
49
+ * @param wallet_subtype {module:model/WalletSubtype}
50
+ * @param status {module:model/TokenListingRequestStatus}
51
+ */
52
+ function TokenListingEventData(data_type, request_id, chain_id, contract_address, wallet_type, wallet_subtype, status) {
53
+ _classCallCheck(this, TokenListingEventData);
54
+ _WebhookEventDataType["default"].initialize(this, data_type);
55
+ _TokenListing["default"].initialize(this, request_id, chain_id, contract_address, wallet_type, wallet_subtype, status);
56
+ TokenListingEventData.initialize(this, data_type, request_id, chain_id, contract_address, wallet_type, wallet_subtype, status);
57
+ }
58
+
59
+ /**
60
+ * Initializes the fields of this object.
61
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
62
+ * Only for internal use.
63
+ */
64
+ return _createClass(TokenListingEventData, null, [{
65
+ key: "initialize",
66
+ value: function initialize(obj, data_type, request_id, chain_id, contract_address, wallet_type, wallet_subtype, status) {
67
+ obj['data_type'] = data_type;
68
+ obj['request_id'] = request_id;
69
+ obj['chain_id'] = chain_id;
70
+ obj['contract_address'] = contract_address;
71
+ obj['wallet_type'] = wallet_type;
72
+ obj['wallet_subtype'] = wallet_subtype;
73
+ obj['status'] = status;
74
+ }
75
+
76
+ /**
77
+ * Constructs a <code>TokenListingEventData</code> from a plain JavaScript object, optionally creating a new instance.
78
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
79
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
80
+ * @param {module:model/TokenListingEventData} obj Optional instance to populate.
81
+ * @return {module:model/TokenListingEventData} The populated <code>TokenListingEventData</code> instance.
82
+ */
83
+ }, {
84
+ key: "constructFromObject",
85
+ value: function constructFromObject(data, obj) {
86
+ if (data) {
87
+ obj = obj || new TokenListingEventData();
88
+ _WebhookEventDataType["default"].constructFromObject(data, obj);
89
+ _TokenListing["default"].constructFromObject(data, obj);
90
+ if (data.hasOwnProperty('data_type')) {
91
+ obj['data_type'] = _ApiClient["default"].convertToType(data['data_type'], 'String');
92
+ }
93
+ if (data.hasOwnProperty('request_id')) {
94
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
95
+ }
96
+ if (data.hasOwnProperty('chain_id')) {
97
+ obj['chain_id'] = _ApiClient["default"].convertToType(data['chain_id'], 'String');
98
+ }
99
+ if (data.hasOwnProperty('contract_address')) {
100
+ obj['contract_address'] = _ApiClient["default"].convertToType(data['contract_address'], 'String');
101
+ }
102
+ if (data.hasOwnProperty('wallet_type')) {
103
+ obj['wallet_type'] = _WalletType["default"].constructFromObject(data['wallet_type']);
104
+ }
105
+ if (data.hasOwnProperty('wallet_subtype')) {
106
+ obj['wallet_subtype'] = _WalletSubtype["default"].constructFromObject(data['wallet_subtype']);
107
+ }
108
+ if (data.hasOwnProperty('token')) {
109
+ obj['token'] = _TokenInfo["default"].constructFromObject(data['token']);
110
+ }
111
+ if (data.hasOwnProperty('status')) {
112
+ obj['status'] = _TokenListingRequestStatus["default"].constructFromObject(data['status']);
113
+ }
114
+ if (data.hasOwnProperty('source')) {
115
+ obj['source'] = _TokenListingRequestSource["default"].constructFromObject(data['source']);
116
+ }
117
+ if (data.hasOwnProperty('feedback')) {
118
+ obj['feedback'] = _ApiClient["default"].convertToType(data['feedback'], 'String');
119
+ }
120
+ if (data.hasOwnProperty('created_timestamp')) {
121
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
122
+ }
123
+ if (data.hasOwnProperty('updated_timestamp')) {
124
+ obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
125
+ }
126
+ }
127
+ return obj;
128
+ }
129
+
130
+ /**
131
+ * Validates the JSON data with respect to <code>TokenListingEventData</code>.
132
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
133
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TokenListingEventData</code>.
134
+ */
135
+ }, {
136
+ key: "validateJSON",
137
+ value: function validateJSON(data) {
138
+ // check to make sure all required properties are present in the JSON string
139
+ var _iterator = _createForOfIteratorHelper(TokenListingEventData.RequiredProperties),
140
+ _step;
141
+ try {
142
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
143
+ var property = _step.value;
144
+ if (!data.hasOwnProperty(property)) {
145
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
146
+ }
147
+ }
148
+ // ensure the json data is a string
149
+ } catch (err) {
150
+ _iterator.e(err);
151
+ } finally {
152
+ _iterator.f();
153
+ }
154
+ if (data['data_type'] && !(typeof data['data_type'] === 'string' || data['data_type'] instanceof String)) {
155
+ throw new Error("Expected the field `data_type` to be a primitive type in the JSON string but got " + data['data_type']);
156
+ }
157
+ // ensure the json data is a string
158
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
159
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
160
+ }
161
+ // ensure the json data is a string
162
+ if (data['chain_id'] && !(typeof data['chain_id'] === 'string' || data['chain_id'] instanceof String)) {
163
+ throw new Error("Expected the field `chain_id` to be a primitive type in the JSON string but got " + data['chain_id']);
164
+ }
165
+ // ensure the json data is a string
166
+ if (data['contract_address'] && !(typeof data['contract_address'] === 'string' || data['contract_address'] instanceof String)) {
167
+ throw new Error("Expected the field `contract_address` to be a primitive type in the JSON string but got " + data['contract_address']);
168
+ }
169
+ // validate the optional field `token`
170
+ if (data['token']) {
171
+ // data not null
172
+ if (!!_TokenInfo["default"].validateJSON) {
173
+ _TokenInfo["default"].validateJSON(data['token']);
174
+ }
175
+ }
176
+ // ensure the json data is a string
177
+ if (data['feedback'] && !(typeof data['feedback'] === 'string' || data['feedback'] instanceof String)) {
178
+ throw new Error("Expected the field `feedback` to be a primitive type in the JSON string but got " + data['feedback']);
179
+ }
180
+ return true;
181
+ }
182
+ }]);
183
+ }();
184
+ TokenListingEventData.RequiredProperties = ["data_type", "request_id", "chain_id", "contract_address", "wallet_type", "wallet_subtype", "status"];
185
+
186
+ /**
187
+ * 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.
188
+ * @member {module:model/TokenListingEventData.DataTypeEnum} data_type
189
+ */
190
+ TokenListingEventData.prototype['data_type'] = undefined;
191
+
192
+ /**
193
+ * Unique identifier of the token listing request
194
+ * @member {String} request_id
195
+ */
196
+ TokenListingEventData.prototype['request_id'] = undefined;
197
+
198
+ /**
199
+ * chain_id of the blockchain where the token exists
200
+ * @member {String} chain_id
201
+ */
202
+ TokenListingEventData.prototype['chain_id'] = undefined;
203
+
204
+ /**
205
+ * Contract address of the token
206
+ * @member {String} contract_address
207
+ */
208
+ TokenListingEventData.prototype['contract_address'] = undefined;
209
+
210
+ /**
211
+ * @member {module:model/WalletType} wallet_type
212
+ */
213
+ TokenListingEventData.prototype['wallet_type'] = undefined;
214
+
215
+ /**
216
+ * @member {module:model/WalletSubtype} wallet_subtype
217
+ */
218
+ TokenListingEventData.prototype['wallet_subtype'] = undefined;
219
+
220
+ /**
221
+ * @member {module:model/TokenInfo} token
222
+ */
223
+ TokenListingEventData.prototype['token'] = undefined;
224
+
225
+ /**
226
+ * @member {module:model/TokenListingRequestStatus} status
227
+ */
228
+ TokenListingEventData.prototype['status'] = undefined;
229
+
230
+ /**
231
+ * @member {module:model/TokenListingRequestSource} source
232
+ */
233
+ TokenListingEventData.prototype['source'] = undefined;
234
+
235
+ /**
236
+ * Feedback provided by the admin for rejected requests
237
+ * @member {String} feedback
238
+ */
239
+ TokenListingEventData.prototype['feedback'] = undefined;
240
+
241
+ /**
242
+ * Timestamp when the request was created (in milliseconds since Unix epoch)
243
+ * @member {Number} created_timestamp
244
+ */
245
+ TokenListingEventData.prototype['created_timestamp'] = undefined;
246
+
247
+ /**
248
+ * Timestamp when the request was last updated (in milliseconds since Unix epoch)
249
+ * @member {Number} updated_timestamp
250
+ */
251
+ TokenListingEventData.prototype['updated_timestamp'] = undefined;
252
+
253
+ // Implement WebhookEventDataType interface:
254
+ /**
255
+ * 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.
256
+ * @member {module:model/WebhookEventDataType.DataTypeEnum} data_type
257
+ */
258
+ _WebhookEventDataType["default"].prototype['data_type'] = undefined;
259
+ // Implement TokenListing interface:
260
+ /**
261
+ * Unique identifier of the token listing request
262
+ * @member {String} request_id
263
+ */
264
+ _TokenListing["default"].prototype['request_id'] = undefined;
265
+ /**
266
+ * chain_id of the blockchain where the token exists
267
+ * @member {String} chain_id
268
+ */
269
+ _TokenListing["default"].prototype['chain_id'] = undefined;
270
+ /**
271
+ * Contract address of the token
272
+ * @member {String} contract_address
273
+ */
274
+ _TokenListing["default"].prototype['contract_address'] = undefined;
275
+ /**
276
+ * @member {module:model/WalletType} wallet_type
277
+ */
278
+ _TokenListing["default"].prototype['wallet_type'] = undefined;
279
+ /**
280
+ * @member {module:model/WalletSubtype} wallet_subtype
281
+ */
282
+ _TokenListing["default"].prototype['wallet_subtype'] = undefined;
283
+ /**
284
+ * @member {module:model/TokenInfo} token
285
+ */
286
+ _TokenListing["default"].prototype['token'] = undefined;
287
+ /**
288
+ * @member {module:model/TokenListingRequestStatus} status
289
+ */
290
+ _TokenListing["default"].prototype['status'] = undefined;
291
+ /**
292
+ * @member {module:model/TokenListingRequestSource} source
293
+ */
294
+ _TokenListing["default"].prototype['source'] = undefined;
295
+ /**
296
+ * Feedback provided by the admin for rejected requests
297
+ * @member {String} feedback
298
+ */
299
+ _TokenListing["default"].prototype['feedback'] = undefined;
300
+ /**
301
+ * Timestamp when the request was created (in milliseconds since Unix epoch)
302
+ * @member {Number} created_timestamp
303
+ */
304
+ _TokenListing["default"].prototype['created_timestamp'] = undefined;
305
+ /**
306
+ * Timestamp when the request was last updated (in milliseconds since Unix epoch)
307
+ * @member {Number} updated_timestamp
308
+ */
309
+ _TokenListing["default"].prototype['updated_timestamp'] = undefined;
310
+
311
+ /**
312
+ * Allowed values for the <code>data_type</code> property.
313
+ * @enum {String}
314
+ * @readonly
315
+ */
316
+ TokenListingEventData['DataTypeEnum'] = {
317
+ /**
318
+ * value: "Transaction"
319
+ * @const
320
+ */
321
+ "Transaction": "Transaction",
322
+ /**
323
+ * value: "TSSRequest"
324
+ * @const
325
+ */
326
+ "TSSRequest": "TSSRequest",
327
+ /**
328
+ * value: "Addresses"
329
+ * @const
330
+ */
331
+ "Addresses": "Addresses",
332
+ /**
333
+ * value: "WalletInfo"
334
+ * @const
335
+ */
336
+ "WalletInfo": "WalletInfo",
337
+ /**
338
+ * value: "MPCVault"
339
+ * @const
340
+ */
341
+ "MPCVault": "MPCVault",
342
+ /**
343
+ * value: "Chains"
344
+ * @const
345
+ */
346
+ "Chains": "Chains",
347
+ /**
348
+ * value: "Tokens"
349
+ * @const
350
+ */
351
+ "Tokens": "Tokens",
352
+ /**
353
+ * value: "TokenListing"
354
+ * @const
355
+ */
356
+ "TokenListing": "TokenListing",
357
+ /**
358
+ * value: "unknown_default_open_api"
359
+ * @const
360
+ */
361
+ "unknown_default_open_api": "unknown_default_open_api"
362
+ };
363
+ var _default = exports["default"] = TokenListingEventData;
@@ -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 TokenListingRequestSource.
27
+ * @enum {}
28
+ * @readonly
29
+ */
30
+ var TokenListingRequestSource = exports["default"] = /*#__PURE__*/function () {
31
+ function TokenListingRequestSource() {
32
+ _classCallCheck(this, TokenListingRequestSource);
33
+ /**
34
+ * value: "API"
35
+ * @const
36
+ */
37
+ _defineProperty(this, "API", "API");
38
+ /**
39
+ * value: "Admin"
40
+ * @const
41
+ */
42
+ _defineProperty(this, "Admin", "Admin");
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(TokenListingRequestSource, null, [{
50
+ key: "constructFromObject",
51
+ value:
52
+ /**
53
+ * Returns a <code>TokenListingRequestSource</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/TokenListingRequestSource} The enum <code>TokenListingRequestSource</code> value.
56
+ */
57
+ function constructFromObject(object) {
58
+ return object;
59
+ }
60
+ }]);
61
+ }();