@cobo/cobo-waas2 1.4.0 → 1.6.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 (180) hide show
  1. package/README.md +32 -10
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/ServerDemo.js +80 -0
  4. package/dist/api/AddressBooksApi.js +105 -0
  5. package/dist/api/DevelopersApi.js +79 -0
  6. package/dist/api/DevelopersWebhooksApi.js +43 -0
  7. package/dist/api/OAuthApi.js +10 -10
  8. package/dist/api/TransactionsApi.js +12 -12
  9. package/dist/api/WalletsApi.js +60 -59
  10. package/dist/api/WalletsExchangeWalletApi.js +4 -4
  11. package/dist/api/WalletsMPCWalletsApi.js +8 -8
  12. package/dist/api/WalletsSmartContractWalletsApi.js +93 -0
  13. package/dist/index.js +181 -34
  14. package/dist/model/AddressBook.js +25 -10
  15. package/dist/model/AddressTransferDestination.js +2 -2
  16. package/dist/model/AddressTransferDestinationUtxoOutputsInner.js +6 -17
  17. package/dist/model/ApiLogDetails.js +238 -0
  18. package/dist/model/ApiLogSummary.js +161 -0
  19. package/dist/model/BabylonStakeEstimatedFee.js +118 -0
  20. package/dist/model/BabylonValidator.js +5 -0
  21. package/dist/model/CheckAddressChainsValidity200ResponseInner.js +121 -0
  22. package/dist/model/CheckLoopTransfers200ResponseInner.js +1 -1
  23. package/dist/model/CoboSafeDelegate.js +2 -2
  24. package/dist/model/CreateSmartContractWalletParams.js +1 -1
  25. package/dist/model/CreateStakeActivityExtra.js +42 -8
  26. package/dist/model/CreateUnstakeActivity.js +16 -0
  27. package/dist/model/CreateUnstakeActivityExtra.js +159 -0
  28. package/dist/model/CreateUnstakeActivityRequest.js +20 -0
  29. package/dist/model/ErrorResponse.js +2 -2
  30. package/dist/model/EstimateContractCallFeeParams.js +5 -7
  31. package/dist/model/EstimateFeeParams.js +1 -1
  32. package/dist/model/EstimateTransferFeeParams.js +5 -9
  33. package/dist/model/EstimateUnstakeFee.js +20 -0
  34. package/dist/model/EstimatedEvmEip1559FeeSlow.js +3 -5
  35. package/dist/model/EstimatedEvmLegacyFeeSlow.js +3 -5
  36. package/dist/model/EstimatedFee.js +1 -1
  37. package/dist/model/EstimatedFixedFee.js +1 -1
  38. package/dist/model/EthStakeEstimatedFee.js +112 -0
  39. package/dist/model/EthStakeExtra.js +131 -0
  40. package/dist/model/EthStakingExtra.js +131 -0
  41. package/dist/model/EthUnstakeExtra.js +131 -0
  42. package/dist/model/ExchangeId.js +10 -0
  43. package/dist/model/ExtendedTokenInfo.js +17 -4
  44. package/dist/model/FeeGasLimit.js +1 -2
  45. package/dist/model/GetApiKeyInfo200Response.js +251 -0
  46. package/dist/model/GetStakingEstimationFee201Response.js +144 -43
  47. package/dist/model/GetStakingEstimationFeeRequest.js +2 -2
  48. package/dist/model/{GetToken200Response.js → GetToken2XXResponse.js} +21 -21
  49. package/dist/model/GetToken4XXResponse.js +12 -10
  50. package/dist/model/ListAddressBooks200Response.js +123 -0
  51. package/dist/model/MPCDelegate.js +5 -5
  52. package/dist/model/MpcTransferSource.js +2 -2
  53. package/dist/model/{RefreshToken200Response.js → RefreshToken2XXResponse.js} +21 -21
  54. package/dist/model/{WalletBalanceSnapshot.js → RoleScopes.js} +42 -34
  55. package/dist/model/SafeWalletDelegates.js +210 -0
  56. package/dist/model/{BookkeepingSummary.js → SafeWalletDelegatesContractCall.js} +47 -52
  57. package/dist/model/{WalletBalanceSnapshotRecord.js → SafeWalletDelegatesTransfer.js} +47 -63
  58. package/dist/model/Scopes.js +142 -0
  59. package/dist/model/SmartContractWalletInfo.js +1 -1
  60. package/dist/model/StakingPoolType.js +5 -0
  61. package/dist/model/StakingsExtra.js +36 -8
  62. package/dist/model/TokenAssetModelType.js +61 -0
  63. package/dist/model/TokenBalanceBalance.js +6 -6
  64. package/dist/model/TokenInfo.js +11 -2
  65. package/dist/model/Transaction.js +1 -1
  66. package/dist/model/TransactionDestination.js +50 -10
  67. package/dist/model/TransactionDestinationType.js +5 -0
  68. package/dist/model/TransactionDetail.js +2 -2
  69. package/dist/model/TransactionDetails.js +2 -2
  70. package/dist/model/TransactionEvmCalldataInfo.js +177 -0
  71. package/dist/model/TransactionEvmContractDestination.js +16 -0
  72. package/dist/model/TransactionEvmContractMethod.js +136 -0
  73. package/dist/model/TransactionEvmEip1559Fee.js +2 -4
  74. package/dist/model/TransactionEvmLegacyFee.js +2 -4
  75. package/dist/model/TransactionFee.js +1 -2
  76. package/dist/model/TransactionRawMessageSignDestination.js +120 -0
  77. package/dist/model/TransactionRbfSource.js +1 -1
  78. package/dist/model/TransactionRequestEvmEip1559Fee.js +1 -2
  79. package/dist/model/TransactionRequestEvmLegacyFee.js +1 -2
  80. package/dist/model/TransactionRequestFee.js +1 -2
  81. package/dist/model/TransactionSmartContractSafeWalletSource.js +4 -6
  82. package/dist/model/TransactionSource.js +1 -1
  83. package/dist/model/TransactionTokeApproval.js +17 -4
  84. package/dist/model/TransactionTransferToAddressDestination.js +2 -2
  85. package/dist/model/TransactionTransferToAddressDestinationUtxoOutputsInner.js +0 -13
  86. package/dist/model/TransactionWebhookEventData.js +2 -2
  87. package/dist/model/TransferDestination.js +2 -2
  88. package/dist/model/TriggerTestWebhookEvent201Response.js +83 -0
  89. package/dist/model/TriggerTestWebhookEventRequest.js +115 -0
  90. package/dist/model/WebhookEventData.js +1 -1
  91. package/docs/AddressBook.md +8 -7
  92. package/docs/AddressBooksApi.md +71 -0
  93. package/docs/AddressTransferDestination.md +2 -2
  94. package/docs/AddressTransferDestinationUtxoOutputsInner.md +1 -2
  95. package/docs/ApiLogDetails.md +18 -0
  96. package/docs/ApiLogSummary.md +13 -0
  97. package/docs/BabylonStakeEstimatedFee.md +12 -0
  98. package/docs/BabylonValidator.md +2 -0
  99. package/docs/CheckAddressChainsValidity200ResponseInner.md +10 -0
  100. package/docs/CheckLoopTransfers200ResponseInner.md +1 -1
  101. package/docs/CoboSafeDelegate.md +2 -2
  102. package/docs/CreateStakeActivityExtra.md +1 -0
  103. package/docs/CreateUnstakeActivity.md +1 -0
  104. package/docs/CreateUnstakeActivityExtra.md +10 -0
  105. package/docs/CreateUnstakeActivityRequest.md +1 -0
  106. package/docs/DevelopersApi.md +55 -0
  107. package/docs/DevelopersWebhooksApi.md +53 -0
  108. package/docs/ErrorResponse.md +1 -1
  109. package/docs/EstimateContractCallFeeParams.md +1 -1
  110. package/docs/EstimateFeeParams.md +1 -1
  111. package/docs/EstimateTransferFeeParams.md +2 -2
  112. package/docs/EstimateUnstakeFee.md +1 -0
  113. package/docs/EstimatedEvmEip1559FeeSlow.md +1 -1
  114. package/docs/EstimatedEvmLegacyFeeSlow.md +1 -1
  115. package/docs/EstimatedFee.md +1 -1
  116. package/docs/EstimatedFixedFee.md +1 -1
  117. package/docs/EthStakeEstimatedFee.md +11 -0
  118. package/docs/EthStakeExtra.md +10 -0
  119. package/docs/EthStakingExtra.md +10 -0
  120. package/docs/EthUnstakeExtra.md +10 -0
  121. package/docs/ExchangeId.md +4 -0
  122. package/docs/ExtendedTokenInfo.md +3 -2
  123. package/docs/FeeGasLimit.md +1 -1
  124. package/docs/GetApiKeyInfo200Response.md +30 -0
  125. package/docs/GetStakingEstimationFee201Response.md +3 -0
  126. package/docs/GetStakingEstimationFeeRequest.md +1 -1
  127. package/docs/{GetToken200Response.md → GetToken2XXResponse.md} +1 -1
  128. package/docs/GetToken4XXResponse.md +1 -1
  129. package/docs/ListAddressBooks200Response.md +10 -0
  130. package/docs/MPCDelegate.md +2 -2
  131. package/docs/MpcTransferSource.md +1 -1
  132. package/docs/OAuthApi.md +5 -5
  133. package/docs/PoolDetailsAllOfValidatorsInfo.md +2 -0
  134. package/docs/{RefreshToken200Response.md → RefreshToken2XXResponse.md} +1 -1
  135. package/docs/RoleScopes.md +10 -0
  136. package/docs/SafeWalletDelegates.md +14 -0
  137. package/docs/SafeWalletDelegatesContractCall.md +12 -0
  138. package/docs/SafeWalletDelegatesTransfer.md +12 -0
  139. package/docs/Scopes.md +13 -0
  140. package/docs/StakingPoolType.md +2 -0
  141. package/docs/TokenAssetModelType.md +12 -0
  142. package/docs/TokenBalanceBalance.md +4 -4
  143. package/docs/TokenInfo.md +3 -2
  144. package/docs/Transaction.md +1 -1
  145. package/docs/TransactionDestination.md +4 -2
  146. package/docs/TransactionDestinationType.md +2 -0
  147. package/docs/TransactionDetail.md +1 -1
  148. package/docs/TransactionDetails.md +1 -1
  149. package/docs/TransactionEvmCalldataInfo.md +16 -0
  150. package/docs/TransactionEvmContractDestination.md +1 -0
  151. package/docs/TransactionEvmContractMethod.md +13 -0
  152. package/docs/TransactionEvmEip1559Fee.md +1 -1
  153. package/docs/TransactionEvmLegacyFee.md +1 -1
  154. package/docs/TransactionFee.md +1 -1
  155. package/docs/TransactionRawMessageSignDestination.md +10 -0
  156. package/docs/TransactionRbfSource.md +1 -1
  157. package/docs/TransactionRequestEvmEip1559Fee.md +1 -1
  158. package/docs/TransactionRequestEvmLegacyFee.md +1 -1
  159. package/docs/TransactionRequestFee.md +1 -1
  160. package/docs/TransactionSmartContractSafeWalletSource.md +1 -1
  161. package/docs/TransactionSource.md +1 -1
  162. package/docs/TransactionTokeApproval.md +3 -2
  163. package/docs/TransactionTransferToAddressDestination.md +2 -2
  164. package/docs/TransactionTransferToAddressDestinationUtxoOutputsInner.md +0 -1
  165. package/docs/TransactionWebhookEventData.md +1 -1
  166. package/docs/TransactionsApi.md +7 -7
  167. package/docs/TransferDestination.md +2 -2
  168. package/docs/TriggerTestWebhookEvent201Response.md +9 -0
  169. package/docs/TriggerTestWebhookEventRequest.md +10 -0
  170. package/docs/WalletsApi.md +55 -55
  171. package/docs/WalletsExchangeWalletApi.md +2 -2
  172. package/docs/WalletsMPCWalletsApi.md +4 -4
  173. package/docs/WalletsSmartContractWalletsApi.md +63 -0
  174. package/docs/WebhookEventData.md +1 -1
  175. package/package.json +3 -2
  176. package/dist/model/BookkeepingRecord.js +0 -243
  177. package/docs/BookkeepingRecord.md +0 -19
  178. package/docs/BookkeepingSummary.md +0 -12
  179. package/docs/WalletBalanceSnapshot.md +0 -10
  180. package/docs/WalletBalanceSnapshotRecord.md +0 -13
@@ -0,0 +1,251 @@
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 _RoleScopes = _interopRequireDefault(require("./RoleScopes"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19
+ * Cobo Wallet as a Service 2.0
20
+ *
21
+ * Contact: help@cobo.com
22
+ *
23
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24
+ * https://openapi-generator.tech
25
+ * Do not edit the class manually.
26
+ *
27
+ */
28
+ /**
29
+ * The GetApiKeyInfo200Response model module.
30
+ * @module model/GetApiKeyInfo200Response
31
+ */
32
+ var GetApiKeyInfo200Response = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>GetApiKeyInfo200Response</code>.
35
+ * @alias module:model/GetApiKeyInfo200Response
36
+ * @param name {String} The API key name.
37
+ * @param curve_type {module:model/GetApiKeyInfo200Response.CurveTypeEnum} The curve type used for the API key, which determines the cryptographic algorithm for key generation and signing. Possible values include: - `ED25519`: Ed25519 - `SECP256K1`: Secp256k1
38
+ * @param key {String} The API key value.
39
+ * @param created_timestamp {Number} The time when the API key was registered, in Unix timestamp format, measured in milliseconds.
40
+ * @param updated_timestamp {Number} The time when the API key information was last updated, in Unix timestamp format, measured in milliseconds.
41
+ */
42
+ function GetApiKeyInfo200Response(name, curve_type, key, created_timestamp, updated_timestamp) {
43
+ _classCallCheck(this, GetApiKeyInfo200Response);
44
+ GetApiKeyInfo200Response.initialize(this, name, curve_type, key, created_timestamp, updated_timestamp);
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(GetApiKeyInfo200Response, null, [{
53
+ key: "initialize",
54
+ value: function initialize(obj, name, curve_type, key, created_timestamp, updated_timestamp) {
55
+ obj['name'] = name;
56
+ obj['curve_type'] = curve_type;
57
+ obj['key'] = key;
58
+ obj['created_timestamp'] = created_timestamp;
59
+ obj['updated_timestamp'] = updated_timestamp;
60
+ }
61
+
62
+ /**
63
+ * Constructs a <code>GetApiKeyInfo200Response</code> from a plain JavaScript object, optionally creating a new instance.
64
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
65
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
66
+ * @param {module:model/GetApiKeyInfo200Response} obj Optional instance to populate.
67
+ * @return {module:model/GetApiKeyInfo200Response} The populated <code>GetApiKeyInfo200Response</code> instance.
68
+ */
69
+ }, {
70
+ key: "constructFromObject",
71
+ value: function constructFromObject(data, obj) {
72
+ if (data) {
73
+ obj = obj || new GetApiKeyInfo200Response();
74
+ if (data.hasOwnProperty('name')) {
75
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('curve_type')) {
78
+ obj['curve_type'] = _ApiClient["default"].convertToType(data['curve_type'], 'String');
79
+ }
80
+ if (data.hasOwnProperty('key')) {
81
+ obj['key'] = _ApiClient["default"].convertToType(data['key'], 'String');
82
+ }
83
+ if (data.hasOwnProperty('callback_url')) {
84
+ obj['callback_url'] = _ApiClient["default"].convertToType(data['callback_url'], 'String');
85
+ }
86
+ if (data.hasOwnProperty('valid_ips')) {
87
+ obj['valid_ips'] = _ApiClient["default"].convertToType(data['valid_ips'], ['String']);
88
+ }
89
+ if (data.hasOwnProperty('created_timestamp')) {
90
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
91
+ }
92
+ if (data.hasOwnProperty('updated_timestamp')) {
93
+ obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
94
+ }
95
+ if (data.hasOwnProperty('expired_timestamp')) {
96
+ obj['expired_timestamp'] = _ApiClient["default"].convertToType(data['expired_timestamp'], 'Number');
97
+ }
98
+ if (data.hasOwnProperty('role_scopes')) {
99
+ obj['role_scopes'] = _ApiClient["default"].convertToType(data['role_scopes'], [_RoleScopes["default"]]);
100
+ }
101
+ }
102
+ return obj;
103
+ }
104
+
105
+ /**
106
+ * Validates the JSON data with respect to <code>GetApiKeyInfo200Response</code>.
107
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
108
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>GetApiKeyInfo200Response</code>.
109
+ */
110
+ }, {
111
+ key: "validateJSON",
112
+ value: function validateJSON(data) {
113
+ // check to make sure all required properties are present in the JSON string
114
+ var _iterator = _createForOfIteratorHelper(GetApiKeyInfo200Response.RequiredProperties),
115
+ _step;
116
+ try {
117
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
118
+ var property = _step.value;
119
+ if (!data.hasOwnProperty(property)) {
120
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
121
+ }
122
+ }
123
+ // ensure the json data is a string
124
+ } catch (err) {
125
+ _iterator.e(err);
126
+ } finally {
127
+ _iterator.f();
128
+ }
129
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
130
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
131
+ }
132
+ // ensure the json data is a string
133
+ if (data['curve_type'] && !(typeof data['curve_type'] === 'string' || data['curve_type'] instanceof String)) {
134
+ throw new Error("Expected the field `curve_type` to be a primitive type in the JSON string but got " + data['curve_type']);
135
+ }
136
+ // ensure the json data is a string
137
+ if (data['key'] && !(typeof data['key'] === 'string' || data['key'] instanceof String)) {
138
+ throw new Error("Expected the field `key` to be a primitive type in the JSON string but got " + data['key']);
139
+ }
140
+ // ensure the json data is a string
141
+ if (data['callback_url'] && !(typeof data['callback_url'] === 'string' || data['callback_url'] instanceof String)) {
142
+ throw new Error("Expected the field `callback_url` to be a primitive type in the JSON string but got " + data['callback_url']);
143
+ }
144
+ // ensure the json data is an array
145
+ if (!Array.isArray(data['valid_ips'])) {
146
+ throw new Error("Expected the field `valid_ips` to be an array in the JSON data but got " + data['valid_ips']);
147
+ }
148
+ if (data['role_scopes']) {
149
+ // data not null
150
+ // ensure the json data is an array
151
+ if (!Array.isArray(data['role_scopes'])) {
152
+ throw new Error("Expected the field `role_scopes` to be an array in the JSON data but got " + data['role_scopes']);
153
+ }
154
+ // validate the optional field `role_scopes` (array)
155
+ var _iterator2 = _createForOfIteratorHelper(data['role_scopes']),
156
+ _step2;
157
+ try {
158
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
159
+ var item = _step2.value;
160
+ _RoleScopes["default"].validateJSON(item);
161
+ }
162
+ } catch (err) {
163
+ _iterator2.e(err);
164
+ } finally {
165
+ _iterator2.f();
166
+ }
167
+ ;
168
+ }
169
+ return true;
170
+ }
171
+ }]);
172
+ }();
173
+ GetApiKeyInfo200Response.RequiredProperties = ["name", "curve_type", "key", "created_timestamp", "updated_timestamp"];
174
+
175
+ /**
176
+ * The API key name.
177
+ * @member {String} name
178
+ */
179
+ GetApiKeyInfo200Response.prototype['name'] = undefined;
180
+
181
+ /**
182
+ * The curve type used for the API key, which determines the cryptographic algorithm for key generation and signing. Possible values include: - `ED25519`: Ed25519 - `SECP256K1`: Secp256k1
183
+ * @member {module:model/GetApiKeyInfo200Response.CurveTypeEnum} curve_type
184
+ */
185
+ GetApiKeyInfo200Response.prototype['curve_type'] = undefined;
186
+
187
+ /**
188
+ * The API key value.
189
+ * @member {String} key
190
+ */
191
+ GetApiKeyInfo200Response.prototype['key'] = undefined;
192
+
193
+ /**
194
+ * The URL of the callback endpoint that receives callback messages triggered by this API key.
195
+ * @member {String} callback_url
196
+ */
197
+ GetApiKeyInfo200Response.prototype['callback_url'] = undefined;
198
+
199
+ /**
200
+ * (Applicable to permanent API keys only) The list of IP addresses that are allowed to use this API key.
201
+ * @member {Array.<String>} valid_ips
202
+ */
203
+ GetApiKeyInfo200Response.prototype['valid_ips'] = undefined;
204
+
205
+ /**
206
+ * The time when the API key was registered, in Unix timestamp format, measured in milliseconds.
207
+ * @member {Number} created_timestamp
208
+ */
209
+ GetApiKeyInfo200Response.prototype['created_timestamp'] = undefined;
210
+
211
+ /**
212
+ * The time when the API key information was last updated, in Unix timestamp format, measured in milliseconds.
213
+ * @member {Number} updated_timestamp
214
+ */
215
+ GetApiKeyInfo200Response.prototype['updated_timestamp'] = undefined;
216
+
217
+ /**
218
+ * The time when the API key expires, in Unix timestamp format, measured in milliseconds. For permanent API keys, this property value is `null`.
219
+ * @member {Number} expired_timestamp
220
+ */
221
+ GetApiKeyInfo200Response.prototype['expired_timestamp'] = undefined;
222
+
223
+ /**
224
+ * The list of user roles and wallet scopes associated with the API key.
225
+ * @member {Array.<module:model/RoleScopes>} role_scopes
226
+ */
227
+ GetApiKeyInfo200Response.prototype['role_scopes'] = undefined;
228
+
229
+ /**
230
+ * Allowed values for the <code>curve_type</code> property.
231
+ * @enum {String}
232
+ * @readonly
233
+ */
234
+ GetApiKeyInfo200Response['CurveTypeEnum'] = {
235
+ /**
236
+ * value: "ED25519"
237
+ * @const
238
+ */
239
+ "ED25519": "ED25519",
240
+ /**
241
+ * value: "SECP256K1"
242
+ * @const
243
+ */
244
+ "SECP256K1": "SECP256K1",
245
+ /**
246
+ * value: "unknown_default_open_api"
247
+ * @const
248
+ */
249
+ "unknown_default_open_api": "unknown_default_open_api"
250
+ };
251
+ var _default = exports["default"] = GetApiKeyInfo200Response;
@@ -5,12 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _BabylonStakeEstimatedFee = _interopRequireDefault(require("./BabylonStakeEstimatedFee"));
9
+ var _EstimatedFee = _interopRequireDefault(require("./EstimatedFee"));
10
+ var _EthStakeEstimatedFee = _interopRequireDefault(require("./EthStakeEstimatedFee"));
8
11
  var _FeeType = _interopRequireDefault(require("./FeeType"));
12
+ var _StakingPoolType = _interopRequireDefault(require("./StakingPoolType"));
13
+ var _GetStakingEstimationFee201Response;
9
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
15
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
16
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12
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); } }
13
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 _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
20
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
21
  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
22
  * Cobo Wallet as a Service 2.0
@@ -30,66 +36,160 @@ var GetStakingEstimationFee201Response = /*#__PURE__*/function () {
30
36
  /**
31
37
  * Constructs a new <code>GetStakingEstimationFee201Response</code>.
32
38
  * @alias module:model/GetStakingEstimationFee201Response
39
+ * @param {(module:model/BabylonStakeEstimatedFee|module:model/EthStakeEstimatedFee)} instance The actual instance to initialize GetStakingEstimationFee201Response.
33
40
  */
34
41
  function GetStakingEstimationFee201Response() {
42
+ var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
35
43
  _classCallCheck(this, GetStakingEstimationFee201Response);
36
- GetStakingEstimationFee201Response.initialize(this);
44
+ /**
45
+ * Returns the JSON representation of the actual instance.
46
+ * @return {string}
47
+ */
48
+ _defineProperty(this, "toJSON", function () {
49
+ return this.getActualInstance();
50
+ });
51
+ if (instance === null) {
52
+ this.actualInstance = null;
53
+ return;
54
+ }
55
+ var match = 0;
56
+ var errorMessages = [];
57
+ var discriminatorValue = instance["pool_type"];
58
+ if (discriminatorValue) {
59
+ switch (discriminatorValue) {
60
+ case "Babylon":
61
+ this.actualInstance = _BabylonStakeEstimatedFee["default"].constructFromObject(instance);
62
+ match++;
63
+ break;
64
+ case "ETHBeacon":
65
+ this.actualInstance = _EthStakeEstimatedFee["default"].constructFromObject(instance);
66
+ match++;
67
+ break;
68
+ default:
69
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
70
+ break;
71
+ }
72
+ return;
73
+ }
74
+ try {
75
+ if (instance instanceof _EthStakeEstimatedFee["default"]) {
76
+ this.actualInstance = instance;
77
+ } else if (!!_EthStakeEstimatedFee["default"].validateJSON && _EthStakeEstimatedFee["default"].validateJSON(instance)) {
78
+ // plain JS object
79
+ // create EthStakeEstimatedFee from JS object
80
+ this.actualInstance = _EthStakeEstimatedFee["default"].constructFromObject(instance);
81
+ } else {
82
+ if (_EthStakeEstimatedFee["default"].constructFromObject(instance)) {
83
+ if (!!_EthStakeEstimatedFee["default"].constructFromObject(instance).toJSON) {
84
+ if (_EthStakeEstimatedFee["default"].constructFromObject(instance).toJSON()) {
85
+ this.actualInstance = _EthStakeEstimatedFee["default"].constructFromObject(instance);
86
+ }
87
+ } else {
88
+ this.actualInstance = _EthStakeEstimatedFee["default"].constructFromObject(instance);
89
+ }
90
+ }
91
+ }
92
+ match++;
93
+ } catch (err) {
94
+ // json data failed to deserialize into EthStakeEstimatedFee
95
+ errorMessages.push("Failed to construct EthStakeEstimatedFee: " + err);
96
+ }
97
+ try {
98
+ if (instance instanceof _BabylonStakeEstimatedFee["default"]) {
99
+ this.actualInstance = instance;
100
+ } else if (!!_BabylonStakeEstimatedFee["default"].validateJSON && _BabylonStakeEstimatedFee["default"].validateJSON(instance)) {
101
+ // plain JS object
102
+ // create BabylonStakeEstimatedFee from JS object
103
+ this.actualInstance = _BabylonStakeEstimatedFee["default"].constructFromObject(instance);
104
+ } else {
105
+ if (_BabylonStakeEstimatedFee["default"].constructFromObject(instance)) {
106
+ if (!!_BabylonStakeEstimatedFee["default"].constructFromObject(instance).toJSON) {
107
+ if (_BabylonStakeEstimatedFee["default"].constructFromObject(instance).toJSON()) {
108
+ this.actualInstance = _BabylonStakeEstimatedFee["default"].constructFromObject(instance);
109
+ }
110
+ } else {
111
+ this.actualInstance = _BabylonStakeEstimatedFee["default"].constructFromObject(instance);
112
+ }
113
+ }
114
+ }
115
+ match++;
116
+ } catch (err) {
117
+ // json data failed to deserialize into BabylonStakeEstimatedFee
118
+ errorMessages.push("Failed to construct BabylonStakeEstimatedFee: " + err);
119
+ }
120
+
121
+ // if (match > 1) {
122
+ // throw new Error("Multiple matches found constructing `GetStakingEstimationFee201Response` with oneOf schemas BabylonStakeEstimatedFee, EthStakeEstimatedFee. Input: " + JSON.stringify(instance));
123
+ // } else
124
+ if (match === 0) {
125
+ // this.actualInstance = null; // clear the actual instance in case there are multiple matches
126
+ // throw new Error("No match found constructing `GetStakingEstimationFee201Response` with oneOf schemas BabylonStakeEstimatedFee, EthStakeEstimatedFee. Details: " +
127
+ // errorMessages.join(", "));
128
+ return;
129
+ } else {// only 1 match
130
+ // the input is valid
131
+ }
37
132
  }
38
133
 
39
134
  /**
40
- * Initializes the fields of this object.
41
- * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
42
- * Only for internal use.
135
+ * Constructs a <code>GetStakingEstimationFee201Response</code> from a plain JavaScript object, optionally creating a new instance.
136
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
137
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
138
+ * @param {module:model/GetStakingEstimationFee201Response} obj Optional instance to populate.
139
+ * @return {module:model/GetStakingEstimationFee201Response} The populated <code>GetStakingEstimationFee201Response</code> instance.
43
140
  */
44
- return _createClass(GetStakingEstimationFee201Response, null, [{
45
- key: "initialize",
46
- value: function initialize(obj) {}
47
-
141
+ return _createClass(GetStakingEstimationFee201Response, [{
142
+ key: "getActualInstance",
143
+ value:
48
144
  /**
49
- * Constructs a <code>GetStakingEstimationFee201Response</code> from a plain JavaScript object, optionally creating a new instance.
50
- * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
51
- * @param {Object} data The plain JavaScript object bearing properties of interest.
52
- * @param {module:model/GetStakingEstimationFee201Response} obj Optional instance to populate.
53
- * @return {module:model/GetStakingEstimationFee201Response} The populated <code>GetStakingEstimationFee201Response</code> instance.
145
+ * Gets the actual instance, which can be <code>BabylonStakeEstimatedFee</code>, <code>EthStakeEstimatedFee</code>.
146
+ * @return {(module:model/BabylonStakeEstimatedFee|module:model/EthStakeEstimatedFee)} The actual instance.
54
147
  */
55
- }, {
56
- key: "constructFromObject",
57
- value: function constructFromObject(data, obj) {
58
- if (data) {
59
- obj = obj || new GetStakingEstimationFee201Response();
60
- if (data.hasOwnProperty('fee_type')) {
61
- obj['fee_type'] = _FeeType["default"].constructFromObject(data['fee_type']);
62
- }
63
- if (data.hasOwnProperty('fee_amount')) {
64
- obj['fee_amount'] = _ApiClient["default"].convertToType(data['fee_amount'], 'String');
65
- }
66
- if (data.hasOwnProperty('token_id')) {
67
- obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
68
- }
69
- }
70
- return obj;
148
+ function getActualInstance() {
149
+ return this.actualInstance;
71
150
  }
72
151
 
73
152
  /**
74
- * Validates the JSON data with respect to <code>GetStakingEstimationFee201Response</code>.
75
- * @param {Object} data The plain JavaScript object bearing properties of interest.
76
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>GetStakingEstimationFee201Response</code>.
153
+ * Sets the actual instance, which can be <code>BabylonStakeEstimatedFee</code>, <code>EthStakeEstimatedFee</code>.
154
+ * @param {(module:model/BabylonStakeEstimatedFee|module:model/EthStakeEstimatedFee)} obj The actual instance.
77
155
  */
78
156
  }, {
79
- key: "validateJSON",
80
- value: function validateJSON(data) {
81
- // ensure the json data is a string
82
- if (data['fee_amount'] && !(typeof data['fee_amount'] === 'string' || data['fee_amount'] instanceof String)) {
83
- throw new Error("Expected the field `fee_amount` to be a primitive type in the JSON string but got " + data['fee_amount']);
84
- }
85
- // ensure the json data is a string
86
- if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
87
- throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
88
- }
89
- return true;
157
+ key: "setActualInstance",
158
+ value: function setActualInstance(obj) {
159
+ this.actualInstance = GetStakingEstimationFee201Response.constructFromObject(obj).getActualInstance();
160
+ }
161
+ }], [{
162
+ key: "constructFromObject",
163
+ value: function constructFromObject(data, obj) {
164
+ return new GetStakingEstimationFee201Response(data);
90
165
  }
91
166
  }]);
92
167
  }();
168
+ /**
169
+ * @member {module:model/StakingPoolType} pool_type
170
+ */
171
+ _GetStakingEstimationFee201Response = GetStakingEstimationFee201Response;
172
+ /**
173
+ * Create an instance of GetStakingEstimationFee201Response from a JSON string.
174
+ * @param {string} json_string JSON string.
175
+ * @return {module:model/GetStakingEstimationFee201Response} An instance of GetStakingEstimationFee201Response.
176
+ */
177
+ _defineProperty(GetStakingEstimationFee201Response, "fromJSON", function (json_string) {
178
+ return _GetStakingEstimationFee201Response.constructFromObject(JSON.parse(json_string));
179
+ });
180
+ GetStakingEstimationFee201Response.prototype['pool_type'] = undefined;
181
+
182
+ /**
183
+ * @member {module:model/EstimatedFee} fee
184
+ */
185
+ GetStakingEstimationFee201Response.prototype['fee'] = undefined;
186
+
187
+ /**
188
+ * A list of public keys associated with the Ethereum validators for this staking operation.
189
+ * @member {Array.<String>} validator_pubkeys
190
+ */
191
+ GetStakingEstimationFee201Response.prototype['validator_pubkeys'] = undefined;
192
+
93
193
  /**
94
194
  * @member {module:model/FeeType} fee_type
95
195
  */
@@ -106,4 +206,5 @@ GetStakingEstimationFee201Response.prototype['fee_amount'] = undefined;
106
206
  * @member {String} token_id
107
207
  */
108
208
  GetStakingEstimationFee201Response.prototype['token_id'] = undefined;
209
+ GetStakingEstimationFee201Response.OneOf = ["BabylonStakeEstimatedFee", "EthStakeEstimatedFee"];
109
210
  var _default = exports["default"] = GetStakingEstimationFee201Response;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _ActivityType = _interopRequireDefault(require("./ActivityType"));
9
- var _CreateStakeActivityExtra = _interopRequireDefault(require("./CreateStakeActivityExtra"));
9
+ var _CreateUnstakeActivityExtra = _interopRequireDefault(require("./CreateUnstakeActivityExtra"));
10
10
  var _EstimateStakeFee = _interopRequireDefault(require("./EstimateStakeFee"));
11
11
  var _EstimateUnstakeFee = _interopRequireDefault(require("./EstimateUnstakeFee"));
12
12
  var _EstimateWithdrawFee = _interopRequireDefault(require("./EstimateWithdrawFee"));
@@ -237,7 +237,7 @@ GetStakingEstimationFeeRequest.prototype['amount'] = undefined;
237
237
  GetStakingEstimationFeeRequest.prototype['fee'] = undefined;
238
238
 
239
239
  /**
240
- * @member {module:model/CreateStakeActivityExtra} extra
240
+ * @member {module:model/CreateUnstakeActivityExtra} extra
241
241
  */
242
242
  GetStakingEstimationFeeRequest.prototype['extra'] = undefined;
243
243
 
@@ -22,17 +22,17 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
22
22
  *
23
23
  */
24
24
  /**
25
- * The GetToken200Response model module.
26
- * @module model/GetToken200Response
25
+ * The GetToken2XXResponse model module.
26
+ * @module model/GetToken2XXResponse
27
27
  */
28
- var GetToken200Response = /*#__PURE__*/function () {
28
+ var GetToken2XXResponse = /*#__PURE__*/function () {
29
29
  /**
30
- * Constructs a new <code>GetToken200Response</code>.
31
- * @alias module:model/GetToken200Response
30
+ * Constructs a new <code>GetToken2XXResponse</code>.
31
+ * @alias module:model/GetToken2XXResponse
32
32
  */
33
- function GetToken200Response() {
34
- _classCallCheck(this, GetToken200Response);
35
- GetToken200Response.initialize(this);
33
+ function GetToken2XXResponse() {
34
+ _classCallCheck(this, GetToken2XXResponse);
35
+ GetToken2XXResponse.initialize(this);
36
36
  }
37
37
 
38
38
  /**
@@ -40,22 +40,22 @@ var GetToken200Response = /*#__PURE__*/function () {
40
40
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
41
41
  * Only for internal use.
42
42
  */
43
- return _createClass(GetToken200Response, null, [{
43
+ return _createClass(GetToken2XXResponse, null, [{
44
44
  key: "initialize",
45
45
  value: function initialize(obj) {}
46
46
 
47
47
  /**
48
- * Constructs a <code>GetToken200Response</code> from a plain JavaScript object, optionally creating a new instance.
48
+ * Constructs a <code>GetToken2XXResponse</code> from a plain JavaScript object, optionally creating a new instance.
49
49
  * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
50
50
  * @param {Object} data The plain JavaScript object bearing properties of interest.
51
- * @param {module:model/GetToken200Response} obj Optional instance to populate.
52
- * @return {module:model/GetToken200Response} The populated <code>GetToken200Response</code> instance.
51
+ * @param {module:model/GetToken2XXResponse} obj Optional instance to populate.
52
+ * @return {module:model/GetToken2XXResponse} The populated <code>GetToken2XXResponse</code> instance.
53
53
  */
54
54
  }, {
55
55
  key: "constructFromObject",
56
56
  value: function constructFromObject(data, obj) {
57
57
  if (data) {
58
- obj = obj || new GetToken200Response();
58
+ obj = obj || new GetToken2XXResponse();
59
59
  if (data.hasOwnProperty('access_token')) {
60
60
  obj['access_token'] = _ApiClient["default"].convertToType(data['access_token'], 'String');
61
61
  }
@@ -76,9 +76,9 @@ var GetToken200Response = /*#__PURE__*/function () {
76
76
  }
77
77
 
78
78
  /**
79
- * Validates the JSON data with respect to <code>GetToken200Response</code>.
79
+ * Validates the JSON data with respect to <code>GetToken2XXResponse</code>.
80
80
  * @param {Object} data The plain JavaScript object bearing properties of interest.
81
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>GetToken200Response</code>.
81
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>GetToken2XXResponse</code>.
82
82
  */
83
83
  }, {
84
84
  key: "validateJSON",
@@ -107,29 +107,29 @@ var GetToken200Response = /*#__PURE__*/function () {
107
107
  * The Org Access Token.
108
108
  * @member {String} access_token
109
109
  */
110
- GetToken200Response.prototype['access_token'] = undefined;
110
+ GetToken2XXResponse.prototype['access_token'] = undefined;
111
111
 
112
112
  /**
113
113
  * The type of the tokens, which is Bearer.
114
114
  * @member {String} token_type
115
115
  */
116
- GetToken200Response.prototype['token_type'] = undefined;
116
+ GetToken2XXResponse.prototype['token_type'] = undefined;
117
117
 
118
118
  /**
119
119
  * The scope of the Org Access Token to limit the app's access to the organization's resources. **Note**: Currently this property value is empty. The scope of the Org Access Token is based on the permissions granted when the app user installs the app.
120
120
  * @member {String} scope
121
121
  */
122
- GetToken200Response.prototype['scope'] = undefined;
122
+ GetToken2XXResponse.prototype['scope'] = undefined;
123
123
 
124
124
  /**
125
125
  * The time in seconds in which the Org Access Token expires.
126
126
  * @member {Number} expires_in
127
127
  */
128
- GetToken200Response.prototype['expires_in'] = undefined;
128
+ GetToken2XXResponse.prototype['expires_in'] = undefined;
129
129
 
130
130
  /**
131
131
  * The Refresh Token, used to obtain a new Org Access Token when the current Org Access Token expires. The expiration time for Refresh Tokens is currently set to 30 days and is subject to change.
132
132
  * @member {String} refresh_token
133
133
  */
134
- GetToken200Response.prototype['refresh_token'] = undefined;
135
- var _default = exports["default"] = GetToken200Response;
134
+ GetToken2XXResponse.prototype['refresh_token'] = undefined;
135
+ var _default = exports["default"] = GetToken2XXResponse;