@cobo/cobo-waas2 1.14.0 → 1.16.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 (216) hide show
  1. package/README.md +70 -5
  2. package/dist/ApiClient.js +2 -3
  3. package/dist/PreRequestScript.js +1 -1
  4. package/dist/api/AddressBooksApi.js +4 -4
  5. package/dist/api/AppWorkflowsApi.js +275 -0
  6. package/dist/api/DevelopersApi.js +4 -4
  7. package/dist/api/DevelopersWebhooksApi.js +12 -12
  8. package/dist/api/FeeStationApi.js +26 -26
  9. package/dist/api/PaymentApi.js +16 -16
  10. package/dist/api/StakingsApi.js +28 -28
  11. package/dist/api/TransactionsApi.js +16 -8
  12. package/dist/api/WalletsApi.js +121 -70
  13. package/dist/api/WalletsExchangeWalletApi.js +8 -8
  14. package/dist/api/WalletsMPCWalletsApi.js +20 -20
  15. package/dist/crypto/ApiSigner.js +1 -2
  16. package/dist/index.js +420 -0
  17. package/dist/model/AddressBook.js +18 -0
  18. package/dist/model/AppWorkflow.js +173 -0
  19. package/dist/model/AppWorkflowField.js +137 -0
  20. package/dist/model/AppWorkflowPolicy.js +144 -0
  21. package/dist/model/ApprovalEntry.js +148 -0
  22. package/dist/model/ApprovalRequest.js +178 -0
  23. package/dist/model/ApprovalRequestDetail.js +176 -0
  24. package/dist/model/ApprovalStatus.js +71 -0
  25. package/dist/model/ApprovalUser.js +146 -0
  26. package/dist/model/BabylonStakeExtra.js +16 -0
  27. package/dist/model/BankAccount.js +18 -0
  28. package/dist/model/BatchCheckUtxo201Response.js +107 -0
  29. package/dist/model/BatchCheckUtxoRequest.js +142 -0
  30. package/dist/model/BatchUTXOParam.js +123 -0
  31. package/dist/model/ChainInfo.js +9 -0
  32. package/dist/model/CreateApprovalRequest201Response.js +109 -0
  33. package/dist/model/CreateSettlement.js +4 -29
  34. package/dist/model/CreateStakeActivityExtra.js +6 -0
  35. package/dist/model/CreateTokenListingRequest201Response.js +2 -2
  36. package/dist/model/CreateTokenListingRequestRequest.js +4 -4
  37. package/dist/model/CustodialWeb3TransferSource.js +1 -1
  38. package/dist/model/EstimateContractCallFeeParams.js +13 -0
  39. package/dist/model/EstimateFeeParams.js +6 -0
  40. package/dist/model/EstimateTransferFeeParams.js +13 -0
  41. package/dist/model/FeeStationTransfer.js +1 -1
  42. package/dist/model/ListApprovalRequests200Response.js +123 -0
  43. package/dist/model/Merchant.js +18 -0
  44. package/dist/model/MpcTransferSource.js +1 -1
  45. package/dist/model/Order.js +49 -0
  46. package/dist/model/PaymentOrderEventData.js +64 -0
  47. package/dist/model/PaymentRefundEventData.js +77 -0
  48. package/dist/model/PaymentSettlementEvent.js +46 -0
  49. package/dist/model/PaymentTransaction.js +13 -0
  50. package/dist/model/PolicyAction.js +123 -0
  51. package/dist/model/PolicyActionContent.js +167 -0
  52. package/dist/model/PolicyActionType.js +66 -0
  53. package/dist/model/PolicyCondition.js +148 -0
  54. package/dist/model/PolicyFieldOperator.js +76 -0
  55. package/dist/model/PolicyFieldValueType.js +61 -0
  56. package/dist/model/Refund.js +53 -0
  57. package/dist/model/RequestApproval.js +188 -0
  58. package/dist/model/RevokeApprovalRequest201Response.js +118 -0
  59. package/dist/model/RevokeApprovalRequestRequest.js +110 -0
  60. package/dist/model/Settlement.js +31 -0
  61. package/dist/model/SettlementDetail.js +57 -0
  62. package/dist/model/SettlementInfo.js +31 -0
  63. package/dist/model/SwapActivity.js +3 -3
  64. package/dist/model/SwapActivityApprovers.js +122 -0
  65. package/dist/model/SwapActivityDetail.js +36 -6
  66. package/dist/model/SwapApproversStatus.js +66 -0
  67. package/dist/model/SwapQuote.js +49 -4
  68. package/dist/model/SwapToken.js +2 -2
  69. package/dist/model/TSSBaseRequestEventData.js +163 -0
  70. package/dist/model/TSSCallbackActionType.js +61 -0
  71. package/dist/model/TSSCallbackRequest.js +122 -0
  72. package/dist/model/TSSCallbackRequestType.js +76 -0
  73. package/dist/model/TSSCallbackResponse.js +118 -0
  74. package/dist/model/TSSCurve.js +61 -0
  75. package/dist/model/TSSCurveType.js +61 -0
  76. package/dist/model/TSSEvent.js +158 -0
  77. package/dist/model/TSSEventData.js +278 -0
  78. package/dist/model/TSSEventDataType.js +71 -0
  79. package/dist/model/TSSEventType.js +136 -0
  80. package/dist/model/TSSGroup.js +221 -0
  81. package/dist/model/TSSGroupType.js +61 -0
  82. package/dist/model/TSSGroups.js +1 -1
  83. package/dist/model/TSSKeyGenEventData.js +228 -0
  84. package/dist/model/TSSKeyGenExtra.js +154 -0
  85. package/dist/model/TSSKeyGenRequest.js +130 -0
  86. package/dist/model/TSSKeyReshareEventData.js +228 -0
  87. package/dist/model/TSSKeyReshareExtra.js +169 -0
  88. package/dist/model/TSSKeyReshareRequest.js +177 -0
  89. package/dist/model/TSSKeyShareSignDetail.js +100 -0
  90. package/dist/model/TSSKeyShareSignEventData.js +228 -0
  91. package/dist/model/TSSKeyShareSignExtra.js +171 -0
  92. package/dist/model/TSSKeyShareSignRequest.js +146 -0
  93. package/dist/model/TSSKeyShareSignSignature.js +126 -0
  94. package/dist/model/TSSKeyShareSignSignatures.js +107 -0
  95. package/dist/model/TSSKeySignEventData.js +228 -0
  96. package/dist/model/TSSKeySignExtra.js +203 -0
  97. package/dist/model/TSSKeySignRequest.js +192 -0
  98. package/dist/model/TSSParticipant.js +113 -0
  99. package/dist/model/TSSProtocol.js +66 -0
  100. package/dist/model/TSSRequestTypeEenum.js +71 -0
  101. package/dist/model/TSSSignature.js +139 -0
  102. package/dist/model/TSSSignatureType.js +66 -0
  103. package/dist/model/TSSSignatures.js +125 -0
  104. package/dist/model/TSSStatus.js +96 -0
  105. package/dist/model/TokenListing.js +10 -10
  106. package/dist/model/TokenListingEventData.js +15 -15
  107. package/dist/model/TransactionCoboCategory.js +102 -7
  108. package/dist/model/TransactionRbfSource.js +1 -1
  109. package/dist/model/TransactionSubStatus.js +35 -0
  110. package/dist/model/UTXO.js +9 -0
  111. package/dist/model/WebhookEventData.js +15 -9
  112. package/docs/AddressBook.md +2 -0
  113. package/docs/AddressBooksApi.md +2 -2
  114. package/docs/AppWorkflow.md +12 -0
  115. package/docs/AppWorkflowField.md +11 -0
  116. package/docs/AppWorkflowPolicy.md +10 -0
  117. package/docs/AppWorkflowsApi.md +273 -0
  118. package/docs/ApprovalEntry.md +11 -0
  119. package/docs/ApprovalRequest.md +13 -0
  120. package/docs/ApprovalRequestDetail.md +13 -0
  121. package/docs/ApprovalStatus.md +16 -0
  122. package/docs/ApprovalUser.md +12 -0
  123. package/docs/BabylonStakeExtra.md +1 -0
  124. package/docs/BankAccount.md +2 -0
  125. package/docs/BatchCheckUtxo201Response.md +9 -0
  126. package/docs/BatchCheckUtxoRequest.md +10 -0
  127. package/docs/BatchUTXOParam.md +10 -0
  128. package/docs/ChainInfo.md +1 -0
  129. package/docs/CreateApprovalRequest201Response.md +9 -0
  130. package/docs/CreateSettlement.md +2 -2
  131. package/docs/CreateStakeActivityExtra.md +1 -0
  132. package/docs/CreateTokenListingRequest201Response.md +1 -1
  133. package/docs/CreateTokenListingRequestRequest.md +2 -2
  134. package/docs/CustodialWeb3TransferSource.md +1 -1
  135. package/docs/DevelopersApi.md +2 -2
  136. package/docs/DevelopersWebhooksApi.md +6 -6
  137. package/docs/EstimateContractCallFeeParams.md +1 -0
  138. package/docs/EstimateFeeParams.md +1 -0
  139. package/docs/EstimateTransferFeeParams.md +1 -0
  140. package/docs/FeeStationApi.md +14 -14
  141. package/docs/ListApprovalRequests200Response.md +10 -0
  142. package/docs/Merchant.md +2 -0
  143. package/docs/MpcTransferSource.md +1 -1
  144. package/docs/Order.md +3 -0
  145. package/docs/PaymentApi.md +8 -8
  146. package/docs/PaymentOrderEventData.md +3 -0
  147. package/docs/PaymentRefundEventData.md +5 -0
  148. package/docs/PaymentSettlementEvent.md +3 -0
  149. package/docs/PaymentTransaction.md +1 -0
  150. package/docs/PolicyAction.md +10 -0
  151. package/docs/PolicyActionContent.md +25 -0
  152. package/docs/PolicyActionType.md +14 -0
  153. package/docs/PolicyCondition.md +12 -0
  154. package/docs/PolicyFieldOperator.md +18 -0
  155. package/docs/PolicyFieldValueType.md +12 -0
  156. package/docs/Refund.md +5 -0
  157. package/docs/RequestApproval.md +13 -0
  158. package/docs/RevokeApprovalRequest201Response.md +10 -0
  159. package/docs/RevokeApprovalRequestRequest.md +9 -0
  160. package/docs/Settlement.md +3 -0
  161. package/docs/SettlementDetail.md +5 -0
  162. package/docs/SettlementInfo.md +3 -0
  163. package/docs/StakingsApi.md +14 -14
  164. package/docs/SwapActivity.md +3 -3
  165. package/docs/SwapActivityApprovers.md +10 -0
  166. package/docs/SwapActivityDetail.md +4 -3
  167. package/docs/SwapApproversStatus.md +14 -0
  168. package/docs/SwapQuote.md +3 -0
  169. package/docs/SwapToken.md +2 -2
  170. package/docs/TSSBaseRequestEventData.md +14 -0
  171. package/docs/TSSCallbackActionType.md +12 -0
  172. package/docs/TSSCallbackRequest.md +12 -0
  173. package/docs/TSSCallbackRequestType.md +18 -0
  174. package/docs/TSSCallbackResponse.md +12 -0
  175. package/docs/TSSCurve.md +12 -0
  176. package/docs/TSSCurveType.md +12 -0
  177. package/docs/TSSEvent.md +13 -0
  178. package/docs/TSSEventData.md +16 -0
  179. package/docs/TSSEventDataType.md +16 -0
  180. package/docs/TSSEventType.md +42 -0
  181. package/docs/TSSGroup.md +19 -0
  182. package/docs/TSSGroupType.md +12 -0
  183. package/docs/TSSKeyGenEventData.md +16 -0
  184. package/docs/TSSKeyGenExtra.md +13 -0
  185. package/docs/TSSKeyGenRequest.md +13 -0
  186. package/docs/TSSKeyReshareEventData.md +16 -0
  187. package/docs/TSSKeyReshareExtra.md +14 -0
  188. package/docs/TSSKeyReshareRequest.md +17 -0
  189. package/docs/TSSKeyShareSignDetail.md +10 -0
  190. package/docs/TSSKeyShareSignEventData.md +16 -0
  191. package/docs/TSSKeyShareSignExtra.md +13 -0
  192. package/docs/TSSKeyShareSignRequest.md +12 -0
  193. package/docs/TSSKeyShareSignSignature.md +12 -0
  194. package/docs/TSSKeyShareSignSignatures.md +9 -0
  195. package/docs/TSSKeySignEventData.md +16 -0
  196. package/docs/TSSKeySignExtra.md +15 -0
  197. package/docs/TSSKeySignRequest.md +18 -0
  198. package/docs/TSSParticipant.md +11 -0
  199. package/docs/TSSProtocol.md +14 -0
  200. package/docs/TSSRequestTypeEenum.md +16 -0
  201. package/docs/TSSSignature.md +13 -0
  202. package/docs/TSSSignatureType.md +14 -0
  203. package/docs/TSSSignatures.md +11 -0
  204. package/docs/TSSStatus.md +26 -0
  205. package/docs/TokenListing.md +6 -6
  206. package/docs/TokenListingEventData.md +6 -6
  207. package/docs/TransactionCoboCategory.md +41 -3
  208. package/docs/TransactionRbfSource.md +1 -1
  209. package/docs/TransactionSubStatus.md +14 -0
  210. package/docs/TransactionsApi.md +8 -4
  211. package/docs/UTXO.md +1 -0
  212. package/docs/WalletsApi.md +91 -36
  213. package/docs/WalletsExchangeWalletApi.md +4 -4
  214. package/docs/WalletsMPCWalletsApi.md +10 -10
  215. package/docs/WebhookEventData.md +8 -7
  216. package/package.json +1 -1
@@ -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 TSSCurveType.
27
+ * @enum {}
28
+ * @readonly
29
+ */
30
+ var TSSCurveType = exports["default"] = /*#__PURE__*/function () {
31
+ function TSSCurveType() {
32
+ _classCallCheck(this, TSSCurveType);
33
+ /**
34
+ * value: "secp256k1"
35
+ * @const
36
+ */
37
+ _defineProperty(this, "secp256k1", "secp256k1");
38
+ /**
39
+ * value: "ed25519"
40
+ * @const
41
+ */
42
+ _defineProperty(this, "ed25519", "ed25519");
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(TSSCurveType, null, [{
50
+ key: "constructFromObject",
51
+ value:
52
+ /**
53
+ * Returns a <code>TSSCurveType</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/TSSCurveType} The enum <code>TSSCurveType</code> value.
56
+ */
57
+ function constructFromObject(object) {
58
+ return object;
59
+ }
60
+ }]);
61
+ }();
@@ -0,0 +1,158 @@
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 _TSSEventData = _interopRequireDefault(require("./TSSEventData"));
9
+ var _TSSEventType = _interopRequireDefault(require("./TSSEventType"));
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 TSSEvent model module.
31
+ * @module model/TSSEvent
32
+ */
33
+ var TSSEvent = /*#__PURE__*/function () {
34
+ /**
35
+ * Constructs a new <code>TSSEvent</code>.
36
+ * The TSS Node event payload.
37
+ * @alias module:model/TSSEvent
38
+ * @param event_type {module:model/TSSEventType}
39
+ */
40
+ function TSSEvent(event_type) {
41
+ _classCallCheck(this, TSSEvent);
42
+ TSSEvent.initialize(this, event_type);
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(TSSEvent, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, event_type) {
53
+ obj['event_type'] = event_type;
54
+ }
55
+
56
+ /**
57
+ * Constructs a <code>TSSEvent</code> from a plain JavaScript object, optionally creating a new instance.
58
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
59
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
60
+ * @param {module:model/TSSEvent} obj Optional instance to populate.
61
+ * @return {module:model/TSSEvent} The populated <code>TSSEvent</code> instance.
62
+ */
63
+ }, {
64
+ key: "constructFromObject",
65
+ value: function constructFromObject(data, obj) {
66
+ if (data) {
67
+ obj = obj || new TSSEvent();
68
+ if (data.hasOwnProperty('event_id')) {
69
+ obj['event_id'] = _ApiClient["default"].convertToType(data['event_id'], 'String');
70
+ }
71
+ if (data.hasOwnProperty('created_timestamp')) {
72
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
73
+ }
74
+ if (data.hasOwnProperty('node_id')) {
75
+ obj['node_id'] = _ApiClient["default"].convertToType(data['node_id'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('event_type')) {
78
+ obj['event_type'] = _TSSEventType["default"].constructFromObject(data['event_type']);
79
+ }
80
+ if (data.hasOwnProperty('data')) {
81
+ obj['data'] = _TSSEventData["default"].constructFromObject(data['data']);
82
+ }
83
+ }
84
+ return obj;
85
+ }
86
+
87
+ /**
88
+ * Validates the JSON data with respect to <code>TSSEvent</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>TSSEvent</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(TSSEvent.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['event_id'] && !(typeof data['event_id'] === 'string' || data['event_id'] instanceof String)) {
112
+ throw new Error("Expected the field `event_id` to be a primitive type in the JSON string but got " + data['event_id']);
113
+ }
114
+ // ensure the json data is a string
115
+ if (data['node_id'] && !(typeof data['node_id'] === 'string' || data['node_id'] instanceof String)) {
116
+ throw new Error("Expected the field `node_id` to be a primitive type in the JSON string but got " + data['node_id']);
117
+ }
118
+ // validate the optional field `data`
119
+ if (data['data']) {
120
+ // data not null
121
+ if (!!_TSSEventData["default"].validateJSON) {
122
+ _TSSEventData["default"].validateJSON(data['data']);
123
+ }
124
+ }
125
+ return true;
126
+ }
127
+ }]);
128
+ }();
129
+ TSSEvent.RequiredProperties = ["event_type"];
130
+
131
+ /**
132
+ * The event ID.
133
+ * @member {String} event_id
134
+ */
135
+ TSSEvent.prototype['event_id'] = undefined;
136
+
137
+ /**
138
+ * The time when the event occurred, in Unix timestamp format, measured in milliseconds.
139
+ * @member {Number} created_timestamp
140
+ */
141
+ TSSEvent.prototype['created_timestamp'] = undefined;
142
+
143
+ /**
144
+ * The event publisher's TSS Node ID.
145
+ * @member {String} node_id
146
+ */
147
+ TSSEvent.prototype['node_id'] = undefined;
148
+
149
+ /**
150
+ * @member {module:model/TSSEventType} event_type
151
+ */
152
+ TSSEvent.prototype['event_type'] = undefined;
153
+
154
+ /**
155
+ * @member {module:model/TSSEventData} data
156
+ */
157
+ TSSEvent.prototype['data'] = undefined;
158
+ var _default = exports["default"] = TSSEvent;
@@ -0,0 +1,278 @@
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 _TSSEventDataType = _interopRequireDefault(require("./TSSEventDataType"));
9
+ var _TSSKeyGenEventData = _interopRequireDefault(require("./TSSKeyGenEventData"));
10
+ var _TSSKeyReshareEventData = _interopRequireDefault(require("./TSSKeyReshareEventData"));
11
+ var _TSSKeyShareSignEventData = _interopRequireDefault(require("./TSSKeyShareSignEventData"));
12
+ var _TSSKeyShareSignRequest = _interopRequireDefault(require("./TSSKeyShareSignRequest"));
13
+ var _TSSKeyShareSignSignatures = _interopRequireDefault(require("./TSSKeyShareSignSignatures"));
14
+ var _TSSKeySignEventData = _interopRequireDefault(require("./TSSKeySignEventData"));
15
+ var _TSSRequestTypeEenum = _interopRequireDefault(require("./TSSRequestTypeEenum"));
16
+ var _TSSStatus = _interopRequireDefault(require("./TSSStatus"));
17
+ var _TSSEventData;
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
19
+ 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); }
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 _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; }
24
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
25
+ 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); } /**
26
+ * Cobo Wallet as a Service 2.0
27
+ *
28
+ * Contact: help@cobo.com
29
+ *
30
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
31
+ * https://openapi-generator.tech
32
+ * Do not edit the class manually.
33
+ *
34
+ */
35
+ /**
36
+ * The TSSEventData model module.
37
+ * @module model/TSSEventData
38
+ */
39
+ var TSSEventData = /*#__PURE__*/function () {
40
+ /**
41
+ * Constructs a new <code>TSSEventData</code>.
42
+ * @alias module:model/TSSEventData
43
+ * @param {(module:model/TSSKeyGenEventData|module:model/TSSKeyReshareEventData|module:model/TSSKeyShareSignEventData|module:model/TSSKeySignEventData)} instance The actual instance to initialize TSSEventData.
44
+ */
45
+ function TSSEventData() {
46
+ var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
47
+ _classCallCheck(this, TSSEventData);
48
+ /**
49
+ * Returns the JSON representation of the actual instance.
50
+ * @return {string}
51
+ */
52
+ _defineProperty(this, "toJSON", function () {
53
+ return this.getActualInstance();
54
+ });
55
+ if (instance === null) {
56
+ this.actualInstance = null;
57
+ return;
58
+ }
59
+ var match = 0;
60
+ var errorMessages = [];
61
+ var discriminatorValue = instance["data_type"];
62
+ if (discriminatorValue) {
63
+ switch (discriminatorValue) {
64
+ case "KeyGen":
65
+ this.actualInstance = _TSSKeyGenEventData["default"].constructFromObject(instance);
66
+ match++;
67
+ break;
68
+ case "KeyReshare":
69
+ this.actualInstance = _TSSKeyReshareEventData["default"].constructFromObject(instance);
70
+ match++;
71
+ break;
72
+ case "KeyShareSign":
73
+ this.actualInstance = _TSSKeyShareSignEventData["default"].constructFromObject(instance);
74
+ match++;
75
+ break;
76
+ case "KeySign":
77
+ this.actualInstance = _TSSKeySignEventData["default"].constructFromObject(instance);
78
+ match++;
79
+ break;
80
+ default:
81
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
82
+ break;
83
+ }
84
+ return;
85
+ }
86
+ try {
87
+ if (instance instanceof _TSSKeyGenEventData["default"]) {
88
+ this.actualInstance = instance;
89
+ } else if (!!_TSSKeyGenEventData["default"].validateJSON && _TSSKeyGenEventData["default"].validateJSON(instance)) {
90
+ // plain JS object
91
+ // create TSSKeyGenEventData from JS object
92
+ this.actualInstance = _TSSKeyGenEventData["default"].constructFromObject(instance);
93
+ } else {
94
+ if (_TSSKeyGenEventData["default"].constructFromObject(instance)) {
95
+ if (!!_TSSKeyGenEventData["default"].constructFromObject(instance).toJSON) {
96
+ if (_TSSKeyGenEventData["default"].constructFromObject(instance).toJSON()) {
97
+ this.actualInstance = _TSSKeyGenEventData["default"].constructFromObject(instance);
98
+ }
99
+ } else {
100
+ this.actualInstance = _TSSKeyGenEventData["default"].constructFromObject(instance);
101
+ }
102
+ }
103
+ }
104
+ match++;
105
+ } catch (err) {
106
+ // json data failed to deserialize into TSSKeyGenEventData
107
+ errorMessages.push("Failed to construct TSSKeyGenEventData: " + err);
108
+ }
109
+ try {
110
+ if (instance instanceof _TSSKeyReshareEventData["default"]) {
111
+ this.actualInstance = instance;
112
+ } else if (!!_TSSKeyReshareEventData["default"].validateJSON && _TSSKeyReshareEventData["default"].validateJSON(instance)) {
113
+ // plain JS object
114
+ // create TSSKeyReshareEventData from JS object
115
+ this.actualInstance = _TSSKeyReshareEventData["default"].constructFromObject(instance);
116
+ } else {
117
+ if (_TSSKeyReshareEventData["default"].constructFromObject(instance)) {
118
+ if (!!_TSSKeyReshareEventData["default"].constructFromObject(instance).toJSON) {
119
+ if (_TSSKeyReshareEventData["default"].constructFromObject(instance).toJSON()) {
120
+ this.actualInstance = _TSSKeyReshareEventData["default"].constructFromObject(instance);
121
+ }
122
+ } else {
123
+ this.actualInstance = _TSSKeyReshareEventData["default"].constructFromObject(instance);
124
+ }
125
+ }
126
+ }
127
+ match++;
128
+ } catch (err) {
129
+ // json data failed to deserialize into TSSKeyReshareEventData
130
+ errorMessages.push("Failed to construct TSSKeyReshareEventData: " + err);
131
+ }
132
+ try {
133
+ if (instance instanceof _TSSKeySignEventData["default"]) {
134
+ this.actualInstance = instance;
135
+ } else if (!!_TSSKeySignEventData["default"].validateJSON && _TSSKeySignEventData["default"].validateJSON(instance)) {
136
+ // plain JS object
137
+ // create TSSKeySignEventData from JS object
138
+ this.actualInstance = _TSSKeySignEventData["default"].constructFromObject(instance);
139
+ } else {
140
+ if (_TSSKeySignEventData["default"].constructFromObject(instance)) {
141
+ if (!!_TSSKeySignEventData["default"].constructFromObject(instance).toJSON) {
142
+ if (_TSSKeySignEventData["default"].constructFromObject(instance).toJSON()) {
143
+ this.actualInstance = _TSSKeySignEventData["default"].constructFromObject(instance);
144
+ }
145
+ } else {
146
+ this.actualInstance = _TSSKeySignEventData["default"].constructFromObject(instance);
147
+ }
148
+ }
149
+ }
150
+ match++;
151
+ } catch (err) {
152
+ // json data failed to deserialize into TSSKeySignEventData
153
+ errorMessages.push("Failed to construct TSSKeySignEventData: " + err);
154
+ }
155
+ try {
156
+ if (instance instanceof _TSSKeyShareSignEventData["default"]) {
157
+ this.actualInstance = instance;
158
+ } else if (!!_TSSKeyShareSignEventData["default"].validateJSON && _TSSKeyShareSignEventData["default"].validateJSON(instance)) {
159
+ // plain JS object
160
+ // create TSSKeyShareSignEventData from JS object
161
+ this.actualInstance = _TSSKeyShareSignEventData["default"].constructFromObject(instance);
162
+ } else {
163
+ if (_TSSKeyShareSignEventData["default"].constructFromObject(instance)) {
164
+ if (!!_TSSKeyShareSignEventData["default"].constructFromObject(instance).toJSON) {
165
+ if (_TSSKeyShareSignEventData["default"].constructFromObject(instance).toJSON()) {
166
+ this.actualInstance = _TSSKeyShareSignEventData["default"].constructFromObject(instance);
167
+ }
168
+ } else {
169
+ this.actualInstance = _TSSKeyShareSignEventData["default"].constructFromObject(instance);
170
+ }
171
+ }
172
+ }
173
+ match++;
174
+ } catch (err) {
175
+ // json data failed to deserialize into TSSKeyShareSignEventData
176
+ errorMessages.push("Failed to construct TSSKeyShareSignEventData: " + err);
177
+ }
178
+
179
+ // if (match > 1) {
180
+ // throw new Error("Multiple matches found constructing `TSSEventData` with oneOf schemas TSSKeyGenEventData, TSSKeyReshareEventData, TSSKeyShareSignEventData, TSSKeySignEventData. Input: " + JSON.stringify(instance));
181
+ // } else
182
+ if (match === 0) {
183
+ // this.actualInstance = null; // clear the actual instance in case there are multiple matches
184
+ // throw new Error("No match found constructing `TSSEventData` with oneOf schemas TSSKeyGenEventData, TSSKeyReshareEventData, TSSKeyShareSignEventData, TSSKeySignEventData. Details: " +
185
+ // errorMessages.join(", "));
186
+ return;
187
+ } else {// only 1 match
188
+ // the input is valid
189
+ }
190
+ }
191
+
192
+ /**
193
+ * Constructs a <code>TSSEventData</code> from a plain JavaScript object, optionally creating a new instance.
194
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
195
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
196
+ * @param {module:model/TSSEventData} obj Optional instance to populate.
197
+ * @return {module:model/TSSEventData} The populated <code>TSSEventData</code> instance.
198
+ */
199
+ return _createClass(TSSEventData, [{
200
+ key: "getActualInstance",
201
+ value:
202
+ /**
203
+ * Gets the actual instance, which can be <code>TSSKeyGenEventData</code>, <code>TSSKeyReshareEventData</code>, <code>TSSKeyShareSignEventData</code>, <code>TSSKeySignEventData</code>.
204
+ * @return {(module:model/TSSKeyGenEventData|module:model/TSSKeyReshareEventData|module:model/TSSKeyShareSignEventData|module:model/TSSKeySignEventData)} The actual instance.
205
+ */
206
+ function getActualInstance() {
207
+ return this.actualInstance;
208
+ }
209
+
210
+ /**
211
+ * Sets the actual instance, which can be <code>TSSKeyGenEventData</code>, <code>TSSKeyReshareEventData</code>, <code>TSSKeyShareSignEventData</code>, <code>TSSKeySignEventData</code>.
212
+ * @param {(module:model/TSSKeyGenEventData|module:model/TSSKeyReshareEventData|module:model/TSSKeyShareSignEventData|module:model/TSSKeySignEventData)} obj The actual instance.
213
+ */
214
+ }, {
215
+ key: "setActualInstance",
216
+ value: function setActualInstance(obj) {
217
+ this.actualInstance = TSSEventData.constructFromObject(obj).getActualInstance();
218
+ }
219
+ }], [{
220
+ key: "constructFromObject",
221
+ value: function constructFromObject(data, obj) {
222
+ return new TSSEventData(data);
223
+ }
224
+ }]);
225
+ }();
226
+ /**
227
+ * @member {module:model/TSSEventDataType} data_type
228
+ */
229
+ _TSSEventData = TSSEventData;
230
+ /**
231
+ * Create an instance of TSSEventData from a JSON string.
232
+ * @param {string} json_string JSON string.
233
+ * @return {module:model/TSSEventData} An instance of TSSEventData.
234
+ */
235
+ _defineProperty(TSSEventData, "fromJSON", function (json_string) {
236
+ return _TSSEventData.constructFromObject(JSON.parse(json_string));
237
+ });
238
+ TSSEventData.prototype['data_type'] = undefined;
239
+
240
+ /**
241
+ * The request ID.
242
+ * @member {String} request_id
243
+ */
244
+ TSSEventData.prototype['request_id'] = undefined;
245
+
246
+ /**
247
+ * @member {module:model/TSSRequestTypeEenum} request_type
248
+ */
249
+ TSSEventData.prototype['request_type'] = undefined;
250
+
251
+ /**
252
+ * @member {module:model/TSSStatus} request_status
253
+ */
254
+ TSSEventData.prototype['request_status'] = undefined;
255
+
256
+ /**
257
+ * The extra info.
258
+ * @member {String} extra_info
259
+ */
260
+ TSSEventData.prototype['extra_info'] = undefined;
261
+
262
+ /**
263
+ * The failed reason.
264
+ * @member {String} failed_reason
265
+ */
266
+ TSSEventData.prototype['failed_reason'] = undefined;
267
+
268
+ /**
269
+ * @member {module:model/TSSKeyShareSignRequest} request_detail
270
+ */
271
+ TSSEventData.prototype['request_detail'] = undefined;
272
+
273
+ /**
274
+ * @member {module:model/TSSKeyShareSignSignatures} result
275
+ */
276
+ TSSEventData.prototype['result'] = undefined;
277
+ TSSEventData.OneOf = ["TSSKeyGenEventData", "TSSKeyReshareEventData", "TSSKeyShareSignEventData", "TSSKeySignEventData"];
278
+ var _default = exports["default"] = TSSEventData;
@@ -0,0 +1,71 @@
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 TSSEventDataType.
27
+ * @enum {}
28
+ * @readonly
29
+ */
30
+ var TSSEventDataType = exports["default"] = /*#__PURE__*/function () {
31
+ function TSSEventDataType() {
32
+ _classCallCheck(this, TSSEventDataType);
33
+ /**
34
+ * value: "KeyGen"
35
+ * @const
36
+ */
37
+ _defineProperty(this, "KeyGen", "KeyGen");
38
+ /**
39
+ * value: "KeyReshare"
40
+ * @const
41
+ */
42
+ _defineProperty(this, "KeyReshare", "KeyReshare");
43
+ /**
44
+ * value: "KeySign"
45
+ * @const
46
+ */
47
+ _defineProperty(this, "KeySign", "KeySign");
48
+ /**
49
+ * value: "KeyShareSign"
50
+ * @const
51
+ */
52
+ _defineProperty(this, "KeyShareSign", "KeyShareSign");
53
+ /**
54
+ * value: "unknown_default_open_api"
55
+ * @const
56
+ */
57
+ _defineProperty(this, "unknown_default_open_api", "unknown_default_open_api");
58
+ }
59
+ return _createClass(TSSEventDataType, null, [{
60
+ key: "constructFromObject",
61
+ value:
62
+ /**
63
+ * Returns a <code>TSSEventDataType</code> enum value from a Javascript object name.
64
+ * @param {Object} data The plain JavaScript object containing the name of the enum value.
65
+ * @return {module:model/TSSEventDataType} The enum <code>TSSEventDataType</code> value.
66
+ */
67
+ function constructFromObject(object) {
68
+ return object;
69
+ }
70
+ }]);
71
+ }();