@cobo/cobo-waas2 1.6.0 → 1.7.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 (97) hide show
  1. package/README.md +17 -2
  2. package/dist/ApiClient.js +56 -6
  3. package/dist/api/DevelopersWebhooksApi.js +2 -2
  4. package/dist/api/StakingsApi.js +91 -7
  5. package/dist/api/TransactionsApi.js +4 -4
  6. package/dist/crypto/Ed25519Signer.js +36 -0
  7. package/dist/crypto/Secp256k1Signer.js +36 -0
  8. package/dist/index.js +70 -7
  9. package/dist/model/Activity.js +4 -8
  10. package/dist/model/ActivityAction.js +20 -0
  11. package/dist/model/ActivityType.js +5 -0
  12. package/dist/model/AutoFuelType.js +61 -0
  13. package/dist/model/BabylonValidator.js +4 -12
  14. package/dist/model/ContractCallParams.js +9 -0
  15. package/dist/model/CoreStakeExtra.js +170 -0
  16. package/dist/model/CoreStakingExtra.js +187 -0
  17. package/dist/model/CreateClaimActivity.js +139 -0
  18. package/dist/model/CreateClaimActivityRequest.js +182 -0
  19. package/dist/model/CreateStakeActivity.js +4 -8
  20. package/dist/model/CreateStakeActivityExtra.js +60 -8
  21. package/dist/model/CreateStakeActivityRequest.js +5 -10
  22. package/dist/model/CreateWithdrawActivity.js +0 -13
  23. package/dist/model/CreateWithdrawActivityRequest.js +0 -18
  24. package/dist/model/EstimateClaimFee.js +145 -0
  25. package/dist/model/EstimateContractCallFeeParams.js +2 -2
  26. package/dist/model/EstimateFeeParams.js +1 -1
  27. package/dist/model/EstimateStakeFee.js +5 -10
  28. package/dist/model/EstimateWithdrawFee.js +0 -18
  29. package/dist/model/EstimatedFee.js +1 -1
  30. package/dist/model/EstimatedFixedFee.js +4 -4
  31. package/dist/model/EstimatedUtxoFeeSlow.js +3 -3
  32. package/dist/model/EthStakingExtra.js +31 -0
  33. package/dist/model/EthStakingExtraAllOfBeaconValidators.js +140 -0
  34. package/dist/model/FeeAmount.js +1 -1
  35. package/dist/model/FeeRate.js +1 -1
  36. package/dist/model/FixedFeeRate.js +2 -2
  37. package/dist/model/GetStakingEstimationFeeRequest.js +39 -17
  38. package/dist/model/MPCProject.js +4 -4
  39. package/dist/model/MpcTransferSource.js +1 -1
  40. package/dist/model/Pagination.js +2 -2
  41. package/dist/model/StakingPoolId.js +81 -0
  42. package/dist/model/StakingPoolType.js +5 -0
  43. package/dist/model/Stakings.js +10 -14
  44. package/dist/model/StakingsExtra.js +67 -8
  45. package/dist/model/TransactionRbf.js +9 -0
  46. package/dist/model/TransactionRbfSource.js +1 -1
  47. package/dist/model/TransactionRequestEvmEip1559Fee.js +1 -1
  48. package/dist/model/TransactionRequestEvmLegacyFee.js +1 -1
  49. package/dist/model/TransactionRequestFixedFee.js +1 -1
  50. package/dist/model/TransactionRequestUtxoFee.js +1 -1
  51. package/dist/model/TransferParams.js +9 -0
  52. package/docs/Activity.md +1 -1
  53. package/docs/ActivityAction.md +8 -0
  54. package/docs/ActivityType.md +2 -0
  55. package/docs/AutoFuelType.md +12 -0
  56. package/docs/BabylonValidator.md +4 -4
  57. package/docs/ContractCallParams.md +1 -0
  58. package/docs/CoreStakeExtra.md +13 -0
  59. package/docs/CoreStakingExtra.md +14 -0
  60. package/docs/CreateClaimActivity.md +11 -0
  61. package/docs/CreateClaimActivityRequest.md +12 -0
  62. package/docs/CreateStakeActivity.md +1 -1
  63. package/docs/CreateStakeActivityExtra.md +4 -0
  64. package/docs/CreateStakeActivityRequest.md +1 -1
  65. package/docs/CreateWithdrawActivity.md +0 -1
  66. package/docs/CreateWithdrawActivityRequest.md +0 -1
  67. package/docs/DevelopersWebhooksApi.md +1 -1
  68. package/docs/EstimateClaimFee.md +11 -0
  69. package/docs/EstimateContractCallFeeParams.md +1 -1
  70. package/docs/EstimateFeeParams.md +1 -1
  71. package/docs/EstimateStakeFee.md +1 -1
  72. package/docs/EstimateWithdrawFee.md +0 -1
  73. package/docs/EstimatedFee.md +1 -1
  74. package/docs/EstimatedFixedFee.md +1 -1
  75. package/docs/EstimatedUtxoFeeSlow.md +1 -1
  76. package/docs/EthStakingExtra.md +1 -0
  77. package/docs/EthStakingExtraAllOfBeaconValidators.md +14 -0
  78. package/docs/FeeAmount.md +1 -1
  79. package/docs/FeeRate.md +1 -1
  80. package/docs/FixedFeeRate.md +1 -1
  81. package/docs/GetStakingEstimationFeeRequest.md +2 -3
  82. package/docs/MPCProject.md +1 -1
  83. package/docs/MpcTransferSource.md +1 -1
  84. package/docs/Pagination.md +1 -1
  85. package/docs/PoolDetailsAllOfValidatorsInfo.md +4 -4
  86. package/docs/StakingPoolId.md +20 -0
  87. package/docs/StakingPoolType.md +2 -0
  88. package/docs/Stakings.md +2 -2
  89. package/docs/StakingsApi.md +108 -2
  90. package/docs/StakingsExtra.md +5 -0
  91. package/docs/TransactionRbf.md +1 -0
  92. package/docs/TransactionRbfSource.md +1 -1
  93. package/docs/TransactionsApi.md +2 -2
  94. package/docs/TransferParams.md +1 -0
  95. package/package.json +3 -2
  96. package/dist/model/StakingsValidatorInfo.js +0 -140
  97. package/docs/StakingsValidatorInfo.md +0 -13
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _BabylonStakeExtra = _interopRequireDefault(require("./BabylonStakeExtra"));
9
+ var _CoreStakeExtra = _interopRequireDefault(require("./CoreStakeExtra"));
9
10
  var _EthStakeExtra = _interopRequireDefault(require("./EthStakeExtra"));
10
11
  var _StakingPoolType = _interopRequireDefault(require("./StakingPoolType"));
11
12
  var _CreateStakeActivityExtra;
@@ -34,7 +35,7 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
34
35
  /**
35
36
  * Constructs a new <code>CreateStakeActivityExtra</code>.
36
37
  * @alias module:model/CreateStakeActivityExtra
37
- * @param {(module:model/BabylonStakeExtra|module:model/EthStakeExtra)} instance The actual instance to initialize CreateStakeActivityExtra.
38
+ * @param {(module:model/BabylonStakeExtra|module:model/CoreStakeExtra|module:model/EthStakeExtra)} instance The actual instance to initialize CreateStakeActivityExtra.
38
39
  */
39
40
  function CreateStakeActivityExtra() {
40
41
  var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
@@ -59,6 +60,10 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
59
60
  this.actualInstance = _BabylonStakeExtra["default"].constructFromObject(instance);
60
61
  match++;
61
62
  break;
63
+ case "CoreBTC":
64
+ this.actualInstance = _CoreStakeExtra["default"].constructFromObject(instance);
65
+ match++;
66
+ break;
62
67
  case "ETHBeacon":
63
68
  this.actualInstance = _EthStakeExtra["default"].constructFromObject(instance);
64
69
  match++;
@@ -115,13 +120,36 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
115
120
  // json data failed to deserialize into EthStakeExtra
116
121
  errorMessages.push("Failed to construct EthStakeExtra: " + err);
117
122
  }
123
+ try {
124
+ if (instance instanceof _CoreStakeExtra["default"]) {
125
+ this.actualInstance = instance;
126
+ } else if (!!_CoreStakeExtra["default"].validateJSON && _CoreStakeExtra["default"].validateJSON(instance)) {
127
+ // plain JS object
128
+ // create CoreStakeExtra from JS object
129
+ this.actualInstance = _CoreStakeExtra["default"].constructFromObject(instance);
130
+ } else {
131
+ if (_CoreStakeExtra["default"].constructFromObject(instance)) {
132
+ if (!!_CoreStakeExtra["default"].constructFromObject(instance).toJSON) {
133
+ if (_CoreStakeExtra["default"].constructFromObject(instance).toJSON()) {
134
+ this.actualInstance = _CoreStakeExtra["default"].constructFromObject(instance);
135
+ }
136
+ } else {
137
+ this.actualInstance = _CoreStakeExtra["default"].constructFromObject(instance);
138
+ }
139
+ }
140
+ }
141
+ match++;
142
+ } catch (err) {
143
+ // json data failed to deserialize into CoreStakeExtra
144
+ errorMessages.push("Failed to construct CoreStakeExtra: " + err);
145
+ }
118
146
 
119
147
  // if (match > 1) {
120
- // throw new Error("Multiple matches found constructing `CreateStakeActivityExtra` with oneOf schemas BabylonStakeExtra, EthStakeExtra. Input: " + JSON.stringify(instance));
148
+ // throw new Error("Multiple matches found constructing `CreateStakeActivityExtra` with oneOf schemas BabylonStakeExtra, CoreStakeExtra, EthStakeExtra. Input: " + JSON.stringify(instance));
121
149
  // } else
122
150
  if (match === 0) {
123
151
  // this.actualInstance = null; // clear the actual instance in case there are multiple matches
124
- // throw new Error("No match found constructing `CreateStakeActivityExtra` with oneOf schemas BabylonStakeExtra, EthStakeExtra. Details: " +
152
+ // throw new Error("No match found constructing `CreateStakeActivityExtra` with oneOf schemas BabylonStakeExtra, CoreStakeExtra, EthStakeExtra. Details: " +
125
153
  // errorMessages.join(", "));
126
154
  return;
127
155
  } else {// only 1 match
@@ -140,16 +168,16 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
140
168
  key: "getActualInstance",
141
169
  value:
142
170
  /**
143
- * Gets the actual instance, which can be <code>BabylonStakeExtra</code>, <code>EthStakeExtra</code>.
144
- * @return {(module:model/BabylonStakeExtra|module:model/EthStakeExtra)} The actual instance.
171
+ * Gets the actual instance, which can be <code>BabylonStakeExtra</code>, <code>CoreStakeExtra</code>, <code>EthStakeExtra</code>.
172
+ * @return {(module:model/BabylonStakeExtra|module:model/CoreStakeExtra|module:model/EthStakeExtra)} The actual instance.
145
173
  */
146
174
  function getActualInstance() {
147
175
  return this.actualInstance;
148
176
  }
149
177
 
150
178
  /**
151
- * Sets the actual instance, which can be <code>BabylonStakeExtra</code>, <code>EthStakeExtra</code>.
152
- * @param {(module:model/BabylonStakeExtra|module:model/EthStakeExtra)} obj The actual instance.
179
+ * Sets the actual instance, which can be <code>BabylonStakeExtra</code>, <code>CoreStakeExtra</code>, <code>EthStakeExtra</code>.
180
+ * @param {(module:model/BabylonStakeExtra|module:model/CoreStakeExtra|module:model/EthStakeExtra)} obj The actual instance.
153
181
  */
154
182
  }, {
155
183
  key: "setActualInstance",
@@ -200,5 +228,29 @@ CreateStakeActivityExtra.prototype['auto_broadcast'] = undefined;
200
228
  * @member {String} provider_name
201
229
  */
202
230
  CreateStakeActivityExtra.prototype['provider_name'] = undefined;
203
- CreateStakeActivityExtra.OneOf = ["BabylonStakeExtra", "EthStakeExtra"];
231
+
232
+ /**
233
+ * The Unix timestamp (in seconds) when the staking position will be unlocked and available for withdrawal.
234
+ * @member {Number} timelock
235
+ */
236
+ CreateStakeActivityExtra.prototype['timelock'] = undefined;
237
+
238
+ /**
239
+ * The change address on the Bitcoin chain. If not provided, the source wallet's address will be used as the change address.
240
+ * @member {String} change_address
241
+ */
242
+ CreateStakeActivityExtra.prototype['change_address'] = undefined;
243
+
244
+ /**
245
+ * The validator's EVM address.
246
+ * @member {String} validator_address
247
+ */
248
+ CreateStakeActivityExtra.prototype['validator_address'] = undefined;
249
+
250
+ /**
251
+ * The EVM address to receive staking rewards.
252
+ * @member {String} reward_address
253
+ */
254
+ CreateStakeActivityExtra.prototype['reward_address'] = undefined;
255
+ CreateStakeActivityExtra.OneOf = ["BabylonStakeExtra", "CoreStakeExtra", "EthStakeExtra"];
204
256
  var _default = exports["default"] = CreateStakeActivityExtra;
@@ -8,6 +8,7 @@ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _ActivityInitiator = _interopRequireDefault(require("./ActivityInitiator"));
9
9
  var _CreateStakeActivity = _interopRequireDefault(require("./CreateStakeActivity"));
10
10
  var _CreateStakeActivityExtra = _interopRequireDefault(require("./CreateStakeActivityExtra"));
11
+ var _StakingPoolId = _interopRequireDefault(require("./StakingPoolId"));
11
12
  var _StakingSource = _interopRequireDefault(require("./StakingSource"));
12
13
  var _TransactionRequestFee = _interopRequireDefault(require("./TransactionRequestFee"));
13
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
@@ -39,7 +40,7 @@ var CreateStakeActivityRequest = /*#__PURE__*/function () {
39
40
  * @alias module:model/CreateStakeActivityRequest
40
41
  * @implements module:model/CreateStakeActivity
41
42
  * @implements module:model/ActivityInitiator
42
- * @param pool_id {String} The ID of the staking pool.
43
+ * @param pool_id {module:model/StakingPoolId}
43
44
  * @param amount {String} The amount to stake.
44
45
  * @param fee {module:model/TransactionRequestFee}
45
46
  * @param extra {module:model/CreateStakeActivityExtra}
@@ -86,7 +87,7 @@ var CreateStakeActivityRequest = /*#__PURE__*/function () {
86
87
  obj['source'] = _StakingSource["default"].constructFromObject(data['source']);
87
88
  }
88
89
  if (data.hasOwnProperty('pool_id')) {
89
- obj['pool_id'] = _ApiClient["default"].convertToType(data['pool_id'], 'String');
90
+ obj['pool_id'] = _StakingPoolId["default"].constructFromObject(data['pool_id']);
90
91
  }
91
92
  if (data.hasOwnProperty('amount')) {
92
93
  obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
@@ -139,10 +140,6 @@ var CreateStakeActivityRequest = /*#__PURE__*/function () {
139
140
  }
140
141
  }
141
142
  // ensure the json data is a string
142
- if (data['pool_id'] && !(typeof data['pool_id'] === 'string' || data['pool_id'] instanceof String)) {
143
- throw new Error("Expected the field `pool_id` to be a primitive type in the JSON string but got " + data['pool_id']);
144
- }
145
- // ensure the json data is a string
146
143
  if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
147
144
  throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
148
145
  }
@@ -182,8 +179,7 @@ CreateStakeActivityRequest.prototype['request_id'] = undefined;
182
179
  CreateStakeActivityRequest.prototype['source'] = undefined;
183
180
 
184
181
  /**
185
- * The ID of the staking pool.
186
- * @member {String} pool_id
182
+ * @member {module:model/StakingPoolId} pool_id
187
183
  */
188
184
  CreateStakeActivityRequest.prototype['pool_id'] = undefined;
189
185
 
@@ -220,8 +216,7 @@ _CreateStakeActivity["default"].prototype['request_id'] = undefined;
220
216
  */
221
217
  _CreateStakeActivity["default"].prototype['source'] = undefined;
222
218
  /**
223
- * The ID of the staking pool.
224
- * @member {String} pool_id
219
+ * @member {module:model/StakingPoolId} pool_id
225
220
  */
226
221
  _CreateStakeActivity["default"].prototype['pool_id'] = undefined;
227
222
  /**
@@ -74,9 +74,6 @@ var CreateWithdrawActivity = /*#__PURE__*/function () {
74
74
  if (data.hasOwnProperty('amount')) {
75
75
  obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
76
76
  }
77
- if (data.hasOwnProperty('address')) {
78
- obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
79
- }
80
77
  if (data.hasOwnProperty('fee')) {
81
78
  obj['fee'] = _TransactionRequestFee["default"].constructFromObject(data['fee']);
82
79
  }
@@ -119,10 +116,6 @@ var CreateWithdrawActivity = /*#__PURE__*/function () {
119
116
  if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
120
117
  throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
121
118
  }
122
- // ensure the json data is a string
123
- if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
124
- throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
125
- }
126
119
  // validate the optional field `fee`
127
120
  if (data['fee']) {
128
121
  // data not null
@@ -154,12 +147,6 @@ CreateWithdrawActivity.prototype['staking_id'] = undefined;
154
147
  */
155
148
  CreateWithdrawActivity.prototype['amount'] = undefined;
156
149
 
157
- /**
158
- * The withdrawal address.
159
- * @member {String} address
160
- */
161
- CreateWithdrawActivity.prototype['address'] = undefined;
162
-
163
150
  /**
164
151
  * @member {module:model/TransactionRequestFee} fee
165
152
  */
@@ -82,9 +82,6 @@ var CreateWithdrawActivityRequest = /*#__PURE__*/function () {
82
82
  if (data.hasOwnProperty('amount')) {
83
83
  obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
84
84
  }
85
- if (data.hasOwnProperty('address')) {
86
- obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
87
- }
88
85
  if (data.hasOwnProperty('fee')) {
89
86
  obj['fee'] = _TransactionRequestFee["default"].constructFromObject(data['fee']);
90
87
  }
@@ -130,10 +127,6 @@ var CreateWithdrawActivityRequest = /*#__PURE__*/function () {
130
127
  if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
131
128
  throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
132
129
  }
133
- // ensure the json data is a string
134
- if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
135
- throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
136
- }
137
130
  // validate the optional field `fee`
138
131
  if (data['fee']) {
139
132
  // data not null
@@ -169,12 +162,6 @@ CreateWithdrawActivityRequest.prototype['staking_id'] = undefined;
169
162
  */
170
163
  CreateWithdrawActivityRequest.prototype['amount'] = undefined;
171
164
 
172
- /**
173
- * The withdrawal address.
174
- * @member {String} address
175
- */
176
- CreateWithdrawActivityRequest.prototype['address'] = undefined;
177
-
178
165
  /**
179
166
  * @member {module:model/TransactionRequestFee} fee
180
167
  */
@@ -202,11 +189,6 @@ _CreateWithdrawActivity["default"].prototype['staking_id'] = undefined;
202
189
  * @member {String} amount
203
190
  */
204
191
  _CreateWithdrawActivity["default"].prototype['amount'] = undefined;
205
- /**
206
- * The withdrawal address.
207
- * @member {String} address
208
- */
209
- _CreateWithdrawActivity["default"].prototype['address'] = undefined;
210
192
  /**
211
193
  * @member {module:model/TransactionRequestFee} fee
212
194
  */
@@ -0,0 +1,145 @@
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 _ActivityType = _interopRequireDefault(require("./ActivityType"));
9
+ var _BaseEstimateStakingFee = _interopRequireDefault(require("./BaseEstimateStakingFee"));
10
+ var _TransactionRequestFee = _interopRequireDefault(require("./TransactionRequestFee"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
13
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
14
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
15
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
16
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
17
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
18
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
19
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
20
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
21
+ * Cobo Wallet as a Service 2.0
22
+ *
23
+ * Contact: help@cobo.com
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * The EstimateClaimFee model module.
32
+ * @module model/EstimateClaimFee
33
+ */
34
+ var EstimateClaimFee = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>EstimateClaimFee</code>.
37
+ * @alias module:model/EstimateClaimFee
38
+ * @implements module:model/BaseEstimateStakingFee
39
+ * @param activity_type {module:model/ActivityType}
40
+ */
41
+ function EstimateClaimFee(activity_type) {
42
+ _classCallCheck(this, EstimateClaimFee);
43
+ _BaseEstimateStakingFee["default"].initialize(this, activity_type);
44
+ EstimateClaimFee.initialize(this, activity_type);
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(EstimateClaimFee, null, [{
53
+ key: "initialize",
54
+ value: function initialize(obj, activity_type) {
55
+ obj['activity_type'] = activity_type;
56
+ }
57
+
58
+ /**
59
+ * Constructs a <code>EstimateClaimFee</code> from a plain JavaScript object, optionally creating a new instance.
60
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
61
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
62
+ * @param {module:model/EstimateClaimFee} obj Optional instance to populate.
63
+ * @return {module:model/EstimateClaimFee} The populated <code>EstimateClaimFee</code> instance.
64
+ */
65
+ }, {
66
+ key: "constructFromObject",
67
+ value: function constructFromObject(data, obj) {
68
+ if (data) {
69
+ obj = obj || new EstimateClaimFee();
70
+ _BaseEstimateStakingFee["default"].constructFromObject(data, obj);
71
+ if (data.hasOwnProperty('activity_type')) {
72
+ obj['activity_type'] = _ActivityType["default"].constructFromObject(data['activity_type']);
73
+ }
74
+ if (data.hasOwnProperty('staking_id')) {
75
+ obj['staking_id'] = _ApiClient["default"].convertToType(data['staking_id'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('fee')) {
78
+ obj['fee'] = _TransactionRequestFee["default"].constructFromObject(data['fee']);
79
+ }
80
+ }
81
+ return obj;
82
+ }
83
+
84
+ /**
85
+ * Validates the JSON data with respect to <code>EstimateClaimFee</code>.
86
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
87
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>EstimateClaimFee</code>.
88
+ */
89
+ }, {
90
+ key: "validateJSON",
91
+ value: function validateJSON(data) {
92
+ // check to make sure all required properties are present in the JSON string
93
+ var _iterator = _createForOfIteratorHelper(EstimateClaimFee.RequiredProperties),
94
+ _step;
95
+ try {
96
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
97
+ var property = _step.value;
98
+ if (!data.hasOwnProperty(property)) {
99
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
100
+ }
101
+ }
102
+ // ensure the json data is a string
103
+ } catch (err) {
104
+ _iterator.e(err);
105
+ } finally {
106
+ _iterator.f();
107
+ }
108
+ if (data['staking_id'] && !(typeof data['staking_id'] === 'string' || data['staking_id'] instanceof String)) {
109
+ throw new Error("Expected the field `staking_id` to be a primitive type in the JSON string but got " + data['staking_id']);
110
+ }
111
+ // validate the optional field `fee`
112
+ if (data['fee']) {
113
+ // data not null
114
+ if (!!_TransactionRequestFee["default"].validateJSON) {
115
+ _TransactionRequestFee["default"].validateJSON(data['fee']);
116
+ }
117
+ }
118
+ return true;
119
+ }
120
+ }]);
121
+ }();
122
+ EstimateClaimFee.RequiredProperties = ["activity_type"];
123
+
124
+ /**
125
+ * @member {module:model/ActivityType} activity_type
126
+ */
127
+ EstimateClaimFee.prototype['activity_type'] = undefined;
128
+
129
+ /**
130
+ * The ID of the staking position. You can retrieve a list of staking positions by calling [List staking positions](/v2/api-references/stakings/list-staking-positions).
131
+ * @member {String} staking_id
132
+ */
133
+ EstimateClaimFee.prototype['staking_id'] = undefined;
134
+
135
+ /**
136
+ * @member {module:model/TransactionRequestFee} fee
137
+ */
138
+ EstimateClaimFee.prototype['fee'] = undefined;
139
+
140
+ // Implement BaseEstimateStakingFee interface:
141
+ /**
142
+ * @member {module:model/ActivityType} activity_type
143
+ */
144
+ _BaseEstimateStakingFee["default"].prototype['activity_type'] = undefined;
145
+ var _default = exports["default"] = EstimateClaimFee;
@@ -38,7 +38,7 @@ var EstimateContractCallFeeParams = /*#__PURE__*/function () {
38
38
  * The information about a transaction that interacts with a smart contract
39
39
  * @alias module:model/EstimateContractCallFeeParams
40
40
  * @param request_type {module:model/EstimateFeeRequestType}
41
- * @param chain_id {String} The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](/v2/api-references/wallets/list-enabled-chains).
41
+ * @param chain_id {String} The chain ID of the chain on which the smart contract is deployed. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](/v2/api-references/wallets/list-enabled-chains).
42
42
  * @param source {module:model/ContractCallSource}
43
43
  * @param destination {module:model/ContractCallDestination}
44
44
  */
@@ -158,7 +158,7 @@ EstimateContractCallFeeParams.prototype['request_id'] = undefined;
158
158
  EstimateContractCallFeeParams.prototype['request_type'] = undefined;
159
159
 
160
160
  /**
161
- * The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](/v2/api-references/wallets/list-enabled-chains).
161
+ * The chain ID of the chain on which the smart contract is deployed. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](/v2/api-references/wallets/list-enabled-chains).
162
162
  * @member {String} chain_id
163
163
  */
164
164
  EstimateContractCallFeeParams.prototype['chain_id'] = undefined;
@@ -208,7 +208,7 @@ EstimateFeeParams.prototype['destination'] = undefined;
208
208
  EstimateFeeParams.prototype['fee_type'] = undefined;
209
209
 
210
210
  /**
211
- * The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](/v2/api-references/wallets/list-enabled-chains).
211
+ * The chain ID of the chain on which the smart contract is deployed. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](/v2/api-references/wallets/list-enabled-chains).
212
212
  * @member {String} chain_id
213
213
  */
214
214
  EstimateFeeParams.prototype['chain_id'] = undefined;
@@ -9,6 +9,7 @@ var _ActivityType = _interopRequireDefault(require("./ActivityType"));
9
9
  var _BaseEstimateStakingFee = _interopRequireDefault(require("./BaseEstimateStakingFee"));
10
10
  var _CreateStakeActivity = _interopRequireDefault(require("./CreateStakeActivity"));
11
11
  var _CreateStakeActivityExtra = _interopRequireDefault(require("./CreateStakeActivityExtra"));
12
+ var _StakingPoolId = _interopRequireDefault(require("./StakingPoolId"));
12
13
  var _StakingSource = _interopRequireDefault(require("./StakingSource"));
13
14
  var _TransactionRequestFee = _interopRequireDefault(require("./TransactionRequestFee"));
14
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
@@ -41,7 +42,7 @@ var EstimateStakeFee = /*#__PURE__*/function () {
41
42
  * @implements module:model/BaseEstimateStakingFee
42
43
  * @implements module:model/CreateStakeActivity
43
44
  * @param activity_type {module:model/ActivityType}
44
- * @param pool_id {String} The ID of the staking pool.
45
+ * @param pool_id {module:model/StakingPoolId}
45
46
  * @param amount {String} The amount to stake.
46
47
  * @param fee {module:model/TransactionRequestFee}
47
48
  * @param extra {module:model/CreateStakeActivityExtra}
@@ -92,7 +93,7 @@ var EstimateStakeFee = /*#__PURE__*/function () {
92
93
  obj['source'] = _StakingSource["default"].constructFromObject(data['source']);
93
94
  }
94
95
  if (data.hasOwnProperty('pool_id')) {
95
- obj['pool_id'] = _ApiClient["default"].convertToType(data['pool_id'], 'String');
96
+ obj['pool_id'] = _StakingPoolId["default"].constructFromObject(data['pool_id']);
96
97
  }
97
98
  if (data.hasOwnProperty('amount')) {
98
99
  obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
@@ -142,10 +143,6 @@ var EstimateStakeFee = /*#__PURE__*/function () {
142
143
  }
143
144
  }
144
145
  // ensure the json data is a string
145
- if (data['pool_id'] && !(typeof data['pool_id'] === 'string' || data['pool_id'] instanceof String)) {
146
- throw new Error("Expected the field `pool_id` to be a primitive type in the JSON string but got " + data['pool_id']);
147
- }
148
- // ensure the json data is a string
149
146
  if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
150
147
  throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
151
148
  }
@@ -186,8 +183,7 @@ EstimateStakeFee.prototype['request_id'] = undefined;
186
183
  EstimateStakeFee.prototype['source'] = undefined;
187
184
 
188
185
  /**
189
- * The ID of the staking pool.
190
- * @member {String} pool_id
186
+ * @member {module:model/StakingPoolId} pool_id
191
187
  */
192
188
  EstimateStakeFee.prototype['pool_id'] = undefined;
193
189
 
@@ -223,8 +219,7 @@ _CreateStakeActivity["default"].prototype['request_id'] = undefined;
223
219
  */
224
220
  _CreateStakeActivity["default"].prototype['source'] = undefined;
225
221
  /**
226
- * The ID of the staking pool.
227
- * @member {String} pool_id
222
+ * @member {module:model/StakingPoolId} pool_id
228
223
  */
229
224
  _CreateStakeActivity["default"].prototype['pool_id'] = undefined;
230
225
  /**
@@ -88,9 +88,6 @@ var EstimateWithdrawFee = /*#__PURE__*/function () {
88
88
  if (data.hasOwnProperty('amount')) {
89
89
  obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
90
90
  }
91
- if (data.hasOwnProperty('address')) {
92
- obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
93
- }
94
91
  if (data.hasOwnProperty('fee')) {
95
92
  obj['fee'] = _TransactionRequestFee["default"].constructFromObject(data['fee']);
96
93
  }
@@ -133,10 +130,6 @@ var EstimateWithdrawFee = /*#__PURE__*/function () {
133
130
  if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
134
131
  throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
135
132
  }
136
- // ensure the json data is a string
137
- if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
138
- throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
139
- }
140
133
  // validate the optional field `fee`
141
134
  if (data['fee']) {
142
135
  // data not null
@@ -173,12 +166,6 @@ EstimateWithdrawFee.prototype['staking_id'] = undefined;
173
166
  */
174
167
  EstimateWithdrawFee.prototype['amount'] = undefined;
175
168
 
176
- /**
177
- * The withdrawal address.
178
- * @member {String} address
179
- */
180
- EstimateWithdrawFee.prototype['address'] = undefined;
181
-
182
169
  /**
183
170
  * @member {module:model/TransactionRequestFee} fee
184
171
  */
@@ -205,11 +192,6 @@ _CreateWithdrawActivity["default"].prototype['staking_id'] = undefined;
205
192
  * @member {String} amount
206
193
  */
207
194
  _CreateWithdrawActivity["default"].prototype['amount'] = undefined;
208
- /**
209
- * The withdrawal address.
210
- * @member {String} address
211
- */
212
- _CreateWithdrawActivity["default"].prototype['address'] = undefined;
213
195
  /**
214
196
  * @member {module:model/TransactionRequestFee} fee
215
197
  */
@@ -247,7 +247,7 @@ EstimatedFee.prototype['token_id'] = undefined;
247
247
  EstimatedFee.prototype['is_loop'] = undefined;
248
248
 
249
249
  /**
250
- * The fee that you need to pay for the transaction.
250
+ * The transaction fee that you need to pay for the transaction.
251
251
  * @member {String} fee_amount
252
252
  */
253
253
  EstimatedFee.prototype['fee_amount'] = undefined;
@@ -33,10 +33,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
33
  var EstimatedFixedFee = /*#__PURE__*/function () {
34
34
  /**
35
35
  * Constructs a new <code>EstimatedFixedFee</code>.
36
- * In the fixed fee model, the transaction fee is a fixed amount within a certain amount of period regardless of the transaction size or network congestion, which can vary between different chains.
36
+ * The estimated transaction fee based on the fixed fee model.
37
37
  * @alias module:model/EstimatedFixedFee
38
38
  * @implements module:model/FeeAmount
39
- * @param fee_amount {String} The fee that you need to pay for the transaction.
39
+ * @param fee_amount {String} The transaction fee that you need to pay for the transaction.
40
40
  * @param fee_type {module:model/FeeType}
41
41
  * @param token_id {String} The token ID of the transaction fee.
42
42
  */
@@ -126,7 +126,7 @@ var EstimatedFixedFee = /*#__PURE__*/function () {
126
126
  EstimatedFixedFee.RequiredProperties = ["fee_amount", "fee_type", "token_id"];
127
127
 
128
128
  /**
129
- * The fee that you need to pay for the transaction.
129
+ * The transaction fee that you need to pay for the transaction.
130
130
  * @member {String} fee_amount
131
131
  */
132
132
  EstimatedFixedFee.prototype['fee_amount'] = undefined;
@@ -150,7 +150,7 @@ EstimatedFixedFee.prototype['is_loop'] = undefined;
150
150
 
151
151
  // Implement FeeAmount interface:
152
152
  /**
153
- * The fee that you need to pay for the transaction.
153
+ * The transaction fee that you need to pay for the transaction.
154
154
  * @member {String} fee_amount
155
155
  */
156
156
  _FeeAmount["default"].prototype['fee_amount'] = undefined;
@@ -37,7 +37,7 @@ var EstimatedUtxoFeeSlow = /*#__PURE__*/function () {
37
37
  * @implements module:model/UtxoFeeBasePrice
38
38
  * @implements module:model/FeeAmount
39
39
  * @param fee_rate {String} The fee rate in sat/vByte. The fee rate represents the satoshis you are willing to pay for each byte of data that your transaction will consume on the blockchain.
40
- * @param fee_amount {String} The fee that you need to pay for the transaction.
40
+ * @param fee_amount {String} The transaction fee that you need to pay for the transaction.
41
41
  */
42
42
  function EstimatedUtxoFeeSlow(fee_rate, fee_amount) {
43
43
  _classCallCheck(this, EstimatedUtxoFeeSlow);
@@ -126,7 +126,7 @@ EstimatedUtxoFeeSlow.RequiredProperties = ["fee_rate", "fee_amount"];
126
126
  EstimatedUtxoFeeSlow.prototype['fee_rate'] = undefined;
127
127
 
128
128
  /**
129
- * The fee that you need to pay for the transaction.
129
+ * The transaction fee that you need to pay for the transaction.
130
130
  * @member {String} fee_amount
131
131
  */
132
132
  EstimatedUtxoFeeSlow.prototype['fee_amount'] = undefined;
@@ -139,7 +139,7 @@ EstimatedUtxoFeeSlow.prototype['fee_amount'] = undefined;
139
139
  _UtxoFeeBasePrice["default"].prototype['fee_rate'] = undefined;
140
140
  // Implement FeeAmount interface:
141
141
  /**
142
- * The fee that you need to pay for the transaction.
142
+ * The transaction fee that you need to pay for the transaction.
143
143
  * @member {String} fee_amount
144
144
  */
145
145
  _FeeAmount["default"].prototype['fee_amount'] = undefined;