@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.
- package/README.md +17 -2
- package/dist/ApiClient.js +56 -6
- package/dist/api/DevelopersWebhooksApi.js +2 -2
- package/dist/api/StakingsApi.js +91 -7
- package/dist/api/TransactionsApi.js +4 -4
- package/dist/crypto/Ed25519Signer.js +36 -0
- package/dist/crypto/Secp256k1Signer.js +36 -0
- package/dist/index.js +70 -7
- package/dist/model/Activity.js +4 -8
- package/dist/model/ActivityAction.js +20 -0
- package/dist/model/ActivityType.js +5 -0
- package/dist/model/AutoFuelType.js +61 -0
- package/dist/model/BabylonValidator.js +4 -12
- package/dist/model/ContractCallParams.js +9 -0
- package/dist/model/CoreStakeExtra.js +170 -0
- package/dist/model/CoreStakingExtra.js +187 -0
- package/dist/model/CreateClaimActivity.js +139 -0
- package/dist/model/CreateClaimActivityRequest.js +182 -0
- package/dist/model/CreateStakeActivity.js +4 -8
- package/dist/model/CreateStakeActivityExtra.js +60 -8
- package/dist/model/CreateStakeActivityRequest.js +5 -10
- package/dist/model/CreateWithdrawActivity.js +0 -13
- package/dist/model/CreateWithdrawActivityRequest.js +0 -18
- package/dist/model/EstimateClaimFee.js +145 -0
- package/dist/model/EstimateContractCallFeeParams.js +2 -2
- package/dist/model/EstimateFeeParams.js +1 -1
- package/dist/model/EstimateStakeFee.js +5 -10
- package/dist/model/EstimateWithdrawFee.js +0 -18
- package/dist/model/EstimatedFee.js +1 -1
- package/dist/model/EstimatedFixedFee.js +4 -4
- package/dist/model/EstimatedUtxoFeeSlow.js +3 -3
- package/dist/model/EthStakingExtra.js +31 -0
- package/dist/model/EthStakingExtraAllOfBeaconValidators.js +140 -0
- package/dist/model/FeeAmount.js +1 -1
- package/dist/model/FeeRate.js +1 -1
- package/dist/model/FixedFeeRate.js +2 -2
- package/dist/model/GetStakingEstimationFeeRequest.js +39 -17
- package/dist/model/MPCProject.js +4 -4
- package/dist/model/MpcTransferSource.js +1 -1
- package/dist/model/Pagination.js +2 -2
- package/dist/model/StakingPoolId.js +81 -0
- package/dist/model/StakingPoolType.js +5 -0
- package/dist/model/Stakings.js +10 -14
- package/dist/model/StakingsExtra.js +67 -8
- package/dist/model/TransactionRbf.js +9 -0
- package/dist/model/TransactionRbfSource.js +1 -1
- package/dist/model/TransactionRequestEvmEip1559Fee.js +1 -1
- package/dist/model/TransactionRequestEvmLegacyFee.js +1 -1
- package/dist/model/TransactionRequestFixedFee.js +1 -1
- package/dist/model/TransactionRequestUtxoFee.js +1 -1
- package/dist/model/TransferParams.js +9 -0
- package/docs/Activity.md +1 -1
- package/docs/ActivityAction.md +8 -0
- package/docs/ActivityType.md +2 -0
- package/docs/AutoFuelType.md +12 -0
- package/docs/BabylonValidator.md +4 -4
- package/docs/ContractCallParams.md +1 -0
- package/docs/CoreStakeExtra.md +13 -0
- package/docs/CoreStakingExtra.md +14 -0
- package/docs/CreateClaimActivity.md +11 -0
- package/docs/CreateClaimActivityRequest.md +12 -0
- package/docs/CreateStakeActivity.md +1 -1
- package/docs/CreateStakeActivityExtra.md +4 -0
- package/docs/CreateStakeActivityRequest.md +1 -1
- package/docs/CreateWithdrawActivity.md +0 -1
- package/docs/CreateWithdrawActivityRequest.md +0 -1
- package/docs/DevelopersWebhooksApi.md +1 -1
- package/docs/EstimateClaimFee.md +11 -0
- package/docs/EstimateContractCallFeeParams.md +1 -1
- package/docs/EstimateFeeParams.md +1 -1
- package/docs/EstimateStakeFee.md +1 -1
- package/docs/EstimateWithdrawFee.md +0 -1
- package/docs/EstimatedFee.md +1 -1
- package/docs/EstimatedFixedFee.md +1 -1
- package/docs/EstimatedUtxoFeeSlow.md +1 -1
- package/docs/EthStakingExtra.md +1 -0
- package/docs/EthStakingExtraAllOfBeaconValidators.md +14 -0
- package/docs/FeeAmount.md +1 -1
- package/docs/FeeRate.md +1 -1
- package/docs/FixedFeeRate.md +1 -1
- package/docs/GetStakingEstimationFeeRequest.md +2 -3
- package/docs/MPCProject.md +1 -1
- package/docs/MpcTransferSource.md +1 -1
- package/docs/Pagination.md +1 -1
- package/docs/PoolDetailsAllOfValidatorsInfo.md +4 -4
- package/docs/StakingPoolId.md +20 -0
- package/docs/StakingPoolType.md +2 -0
- package/docs/Stakings.md +2 -2
- package/docs/StakingsApi.md +108 -2
- package/docs/StakingsExtra.md +5 -0
- package/docs/TransactionRbf.md +1 -0
- package/docs/TransactionRbfSource.md +1 -1
- package/docs/TransactionsApi.md +2 -2
- package/docs/TransferParams.md +1 -0
- package/package.json +3 -2
- package/dist/model/StakingsValidatorInfo.js +0 -140
- package/docs/StakingsValidatorInfo.md +0 -13
|
@@ -0,0 +1,187 @@
|
|
|
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 _BaseStakeExtra = _interopRequireDefault(require("./BaseStakeExtra"));
|
|
9
|
+
var _StakingPoolType = _interopRequireDefault(require("./StakingPoolType"));
|
|
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 CoreStakingExtra model module.
|
|
31
|
+
* @module model/CoreStakingExtra
|
|
32
|
+
*/
|
|
33
|
+
var CoreStakingExtra = /*#__PURE__*/function () {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new <code>CoreStakingExtra</code>.
|
|
36
|
+
* @alias module:model/CoreStakingExtra
|
|
37
|
+
* @implements module:model/BaseStakeExtra
|
|
38
|
+
* @param pool_type {module:model/StakingPoolType}
|
|
39
|
+
* @param pos_chain {String} The Proof-of-Stake (PoS) chain.
|
|
40
|
+
* @param staker_address {String} The staker's Bitcoin address.
|
|
41
|
+
* @param validator_address {String} The validator's EVM address.
|
|
42
|
+
* @param reward_address {String} The EVM address to receive staking rewards.
|
|
43
|
+
* @param timelock {Number} The Unix timestamp (in seconds) when the staking position will be unlocked and available for withdrawal.
|
|
44
|
+
*/
|
|
45
|
+
function CoreStakingExtra(pool_type, pos_chain, staker_address, validator_address, reward_address, timelock) {
|
|
46
|
+
_classCallCheck(this, CoreStakingExtra);
|
|
47
|
+
_BaseStakeExtra["default"].initialize(this, pool_type);
|
|
48
|
+
CoreStakingExtra.initialize(this, pool_type, pos_chain, staker_address, validator_address, reward_address, timelock);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Initializes the fields of this object.
|
|
53
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
54
|
+
* Only for internal use.
|
|
55
|
+
*/
|
|
56
|
+
return _createClass(CoreStakingExtra, null, [{
|
|
57
|
+
key: "initialize",
|
|
58
|
+
value: function initialize(obj, pool_type, pos_chain, staker_address, validator_address, reward_address, timelock) {
|
|
59
|
+
obj['pool_type'] = pool_type;
|
|
60
|
+
obj['pos_chain'] = pos_chain;
|
|
61
|
+
obj['staker_address'] = staker_address;
|
|
62
|
+
obj['validator_address'] = validator_address;
|
|
63
|
+
obj['reward_address'] = reward_address;
|
|
64
|
+
obj['timelock'] = timelock;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Constructs a <code>CoreStakingExtra</code> from a plain JavaScript object, optionally creating a new instance.
|
|
69
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
70
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
71
|
+
* @param {module:model/CoreStakingExtra} obj Optional instance to populate.
|
|
72
|
+
* @return {module:model/CoreStakingExtra} The populated <code>CoreStakingExtra</code> instance.
|
|
73
|
+
*/
|
|
74
|
+
}, {
|
|
75
|
+
key: "constructFromObject",
|
|
76
|
+
value: function constructFromObject(data, obj) {
|
|
77
|
+
if (data) {
|
|
78
|
+
obj = obj || new CoreStakingExtra();
|
|
79
|
+
_BaseStakeExtra["default"].constructFromObject(data, obj);
|
|
80
|
+
if (data.hasOwnProperty('pool_type')) {
|
|
81
|
+
obj['pool_type'] = _StakingPoolType["default"].constructFromObject(data['pool_type']);
|
|
82
|
+
}
|
|
83
|
+
if (data.hasOwnProperty('pos_chain')) {
|
|
84
|
+
obj['pos_chain'] = _ApiClient["default"].convertToType(data['pos_chain'], 'String');
|
|
85
|
+
}
|
|
86
|
+
if (data.hasOwnProperty('staker_address')) {
|
|
87
|
+
obj['staker_address'] = _ApiClient["default"].convertToType(data['staker_address'], 'String');
|
|
88
|
+
}
|
|
89
|
+
if (data.hasOwnProperty('validator_address')) {
|
|
90
|
+
obj['validator_address'] = _ApiClient["default"].convertToType(data['validator_address'], 'String');
|
|
91
|
+
}
|
|
92
|
+
if (data.hasOwnProperty('reward_address')) {
|
|
93
|
+
obj['reward_address'] = _ApiClient["default"].convertToType(data['reward_address'], 'String');
|
|
94
|
+
}
|
|
95
|
+
if (data.hasOwnProperty('timelock')) {
|
|
96
|
+
obj['timelock'] = _ApiClient["default"].convertToType(data['timelock'], 'Number');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return obj;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Validates the JSON data with respect to <code>CoreStakingExtra</code>.
|
|
104
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
105
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CoreStakingExtra</code>.
|
|
106
|
+
*/
|
|
107
|
+
}, {
|
|
108
|
+
key: "validateJSON",
|
|
109
|
+
value: function validateJSON(data) {
|
|
110
|
+
// check to make sure all required properties are present in the JSON string
|
|
111
|
+
var _iterator = _createForOfIteratorHelper(CoreStakingExtra.RequiredProperties),
|
|
112
|
+
_step;
|
|
113
|
+
try {
|
|
114
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
115
|
+
var property = _step.value;
|
|
116
|
+
if (!data.hasOwnProperty(property)) {
|
|
117
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// ensure the json data is a string
|
|
121
|
+
} catch (err) {
|
|
122
|
+
_iterator.e(err);
|
|
123
|
+
} finally {
|
|
124
|
+
_iterator.f();
|
|
125
|
+
}
|
|
126
|
+
if (data['pos_chain'] && !(typeof data['pos_chain'] === 'string' || data['pos_chain'] instanceof String)) {
|
|
127
|
+
throw new Error("Expected the field `pos_chain` to be a primitive type in the JSON string but got " + data['pos_chain']);
|
|
128
|
+
}
|
|
129
|
+
// ensure the json data is a string
|
|
130
|
+
if (data['staker_address'] && !(typeof data['staker_address'] === 'string' || data['staker_address'] instanceof String)) {
|
|
131
|
+
throw new Error("Expected the field `staker_address` to be a primitive type in the JSON string but got " + data['staker_address']);
|
|
132
|
+
}
|
|
133
|
+
// ensure the json data is a string
|
|
134
|
+
if (data['validator_address'] && !(typeof data['validator_address'] === 'string' || data['validator_address'] instanceof String)) {
|
|
135
|
+
throw new Error("Expected the field `validator_address` to be a primitive type in the JSON string but got " + data['validator_address']);
|
|
136
|
+
}
|
|
137
|
+
// ensure the json data is a string
|
|
138
|
+
if (data['reward_address'] && !(typeof data['reward_address'] === 'string' || data['reward_address'] instanceof String)) {
|
|
139
|
+
throw new Error("Expected the field `reward_address` to be a primitive type in the JSON string but got " + data['reward_address']);
|
|
140
|
+
}
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
}]);
|
|
144
|
+
}();
|
|
145
|
+
CoreStakingExtra.RequiredProperties = ["pool_type", "pos_chain", "staker_address", "validator_address", "reward_address", "timelock"];
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @member {module:model/StakingPoolType} pool_type
|
|
149
|
+
*/
|
|
150
|
+
CoreStakingExtra.prototype['pool_type'] = undefined;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The Proof-of-Stake (PoS) chain.
|
|
154
|
+
* @member {String} pos_chain
|
|
155
|
+
*/
|
|
156
|
+
CoreStakingExtra.prototype['pos_chain'] = undefined;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* The staker's Bitcoin address.
|
|
160
|
+
* @member {String} staker_address
|
|
161
|
+
*/
|
|
162
|
+
CoreStakingExtra.prototype['staker_address'] = undefined;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The validator's EVM address.
|
|
166
|
+
* @member {String} validator_address
|
|
167
|
+
*/
|
|
168
|
+
CoreStakingExtra.prototype['validator_address'] = undefined;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The EVM address to receive staking rewards.
|
|
172
|
+
* @member {String} reward_address
|
|
173
|
+
*/
|
|
174
|
+
CoreStakingExtra.prototype['reward_address'] = undefined;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The Unix timestamp (in seconds) when the staking position will be unlocked and available for withdrawal.
|
|
178
|
+
* @member {Number} timelock
|
|
179
|
+
*/
|
|
180
|
+
CoreStakingExtra.prototype['timelock'] = undefined;
|
|
181
|
+
|
|
182
|
+
// Implement BaseStakeExtra interface:
|
|
183
|
+
/**
|
|
184
|
+
* @member {module:model/StakingPoolType} pool_type
|
|
185
|
+
*/
|
|
186
|
+
_BaseStakeExtra["default"].prototype['pool_type'] = undefined;
|
|
187
|
+
var _default = exports["default"] = CoreStakingExtra;
|
|
@@ -0,0 +1,139 @@
|
|
|
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 _TransactionRequestFee = _interopRequireDefault(require("./TransactionRequestFee"));
|
|
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 CreateClaimActivity model module.
|
|
30
|
+
* @module model/CreateClaimActivity
|
|
31
|
+
*/
|
|
32
|
+
var CreateClaimActivity = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>CreateClaimActivity</code>.
|
|
35
|
+
* @alias module:model/CreateClaimActivity
|
|
36
|
+
* @param staking_id {String} 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).
|
|
37
|
+
*/
|
|
38
|
+
function CreateClaimActivity(staking_id) {
|
|
39
|
+
_classCallCheck(this, CreateClaimActivity);
|
|
40
|
+
CreateClaimActivity.initialize(this, staking_id);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Initializes the fields of this object.
|
|
45
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
46
|
+
* Only for internal use.
|
|
47
|
+
*/
|
|
48
|
+
return _createClass(CreateClaimActivity, null, [{
|
|
49
|
+
key: "initialize",
|
|
50
|
+
value: function initialize(obj, staking_id) {
|
|
51
|
+
obj['staking_id'] = staking_id;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Constructs a <code>CreateClaimActivity</code> from a plain JavaScript object, optionally creating a new instance.
|
|
56
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
57
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
58
|
+
* @param {module:model/CreateClaimActivity} obj Optional instance to populate.
|
|
59
|
+
* @return {module:model/CreateClaimActivity} The populated <code>CreateClaimActivity</code> instance.
|
|
60
|
+
*/
|
|
61
|
+
}, {
|
|
62
|
+
key: "constructFromObject",
|
|
63
|
+
value: function constructFromObject(data, obj) {
|
|
64
|
+
if (data) {
|
|
65
|
+
obj = obj || new CreateClaimActivity();
|
|
66
|
+
if (data.hasOwnProperty('request_id')) {
|
|
67
|
+
obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
|
|
68
|
+
}
|
|
69
|
+
if (data.hasOwnProperty('staking_id')) {
|
|
70
|
+
obj['staking_id'] = _ApiClient["default"].convertToType(data['staking_id'], 'String');
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('fee')) {
|
|
73
|
+
obj['fee'] = _TransactionRequestFee["default"].constructFromObject(data['fee']);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return obj;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Validates the JSON data with respect to <code>CreateClaimActivity</code>.
|
|
81
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
82
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateClaimActivity</code>.
|
|
83
|
+
*/
|
|
84
|
+
}, {
|
|
85
|
+
key: "validateJSON",
|
|
86
|
+
value: function validateJSON(data) {
|
|
87
|
+
// check to make sure all required properties are present in the JSON string
|
|
88
|
+
var _iterator = _createForOfIteratorHelper(CreateClaimActivity.RequiredProperties),
|
|
89
|
+
_step;
|
|
90
|
+
try {
|
|
91
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
92
|
+
var property = _step.value;
|
|
93
|
+
if (!data.hasOwnProperty(property)) {
|
|
94
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// ensure the json data is a string
|
|
98
|
+
} catch (err) {
|
|
99
|
+
_iterator.e(err);
|
|
100
|
+
} finally {
|
|
101
|
+
_iterator.f();
|
|
102
|
+
}
|
|
103
|
+
if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
|
|
104
|
+
throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
|
|
105
|
+
}
|
|
106
|
+
// ensure the json data is a string
|
|
107
|
+
if (data['staking_id'] && !(typeof data['staking_id'] === 'string' || data['staking_id'] instanceof String)) {
|
|
108
|
+
throw new Error("Expected the field `staking_id` to be a primitive type in the JSON string but got " + data['staking_id']);
|
|
109
|
+
}
|
|
110
|
+
// validate the optional field `fee`
|
|
111
|
+
if (data['fee']) {
|
|
112
|
+
// data not null
|
|
113
|
+
if (!!_TransactionRequestFee["default"].validateJSON) {
|
|
114
|
+
_TransactionRequestFee["default"].validateJSON(data['fee']);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
}]);
|
|
120
|
+
}();
|
|
121
|
+
CreateClaimActivity.RequiredProperties = ["staking_id"];
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
|
|
125
|
+
* @member {String} request_id
|
|
126
|
+
*/
|
|
127
|
+
CreateClaimActivity.prototype['request_id'] = 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
|
+
CreateClaimActivity.prototype['staking_id'] = undefined;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @member {module:model/TransactionRequestFee} fee
|
|
137
|
+
*/
|
|
138
|
+
CreateClaimActivity.prototype['fee'] = undefined;
|
|
139
|
+
var _default = exports["default"] = CreateClaimActivity;
|
|
@@ -0,0 +1,182 @@
|
|
|
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 _ActivityInitiator = _interopRequireDefault(require("./ActivityInitiator"));
|
|
9
|
+
var _CreateClaimActivity = _interopRequireDefault(require("./CreateClaimActivity"));
|
|
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 CreateClaimActivityRequest model module.
|
|
32
|
+
* @module model/CreateClaimActivityRequest
|
|
33
|
+
*/
|
|
34
|
+
var CreateClaimActivityRequest = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* Constructs a new <code>CreateClaimActivityRequest</code>.
|
|
37
|
+
* @alias module:model/CreateClaimActivityRequest
|
|
38
|
+
* @implements module:model/CreateClaimActivity
|
|
39
|
+
* @implements module:model/ActivityInitiator
|
|
40
|
+
* @param staking_id {String} 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).
|
|
41
|
+
*/
|
|
42
|
+
function CreateClaimActivityRequest(staking_id) {
|
|
43
|
+
_classCallCheck(this, CreateClaimActivityRequest);
|
|
44
|
+
_CreateClaimActivity["default"].initialize(this, staking_id);
|
|
45
|
+
_ActivityInitiator["default"].initialize(this);
|
|
46
|
+
CreateClaimActivityRequest.initialize(this, staking_id);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Initializes the fields of this object.
|
|
51
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
52
|
+
* Only for internal use.
|
|
53
|
+
*/
|
|
54
|
+
return _createClass(CreateClaimActivityRequest, null, [{
|
|
55
|
+
key: "initialize",
|
|
56
|
+
value: function initialize(obj, staking_id) {
|
|
57
|
+
obj['staking_id'] = staking_id;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Constructs a <code>CreateClaimActivityRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
62
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
63
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
64
|
+
* @param {module:model/CreateClaimActivityRequest} obj Optional instance to populate.
|
|
65
|
+
* @return {module:model/CreateClaimActivityRequest} The populated <code>CreateClaimActivityRequest</code> instance.
|
|
66
|
+
*/
|
|
67
|
+
}, {
|
|
68
|
+
key: "constructFromObject",
|
|
69
|
+
value: function constructFromObject(data, obj) {
|
|
70
|
+
if (data) {
|
|
71
|
+
obj = obj || new CreateClaimActivityRequest();
|
|
72
|
+
_CreateClaimActivity["default"].constructFromObject(data, obj);
|
|
73
|
+
_ActivityInitiator["default"].constructFromObject(data, obj);
|
|
74
|
+
if (data.hasOwnProperty('request_id')) {
|
|
75
|
+
obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('staking_id')) {
|
|
78
|
+
obj['staking_id'] = _ApiClient["default"].convertToType(data['staking_id'], 'String');
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('fee')) {
|
|
81
|
+
obj['fee'] = _TransactionRequestFee["default"].constructFromObject(data['fee']);
|
|
82
|
+
}
|
|
83
|
+
if (data.hasOwnProperty('app_initiator')) {
|
|
84
|
+
obj['app_initiator'] = _ApiClient["default"].convertToType(data['app_initiator'], 'String');
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return obj;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Validates the JSON data with respect to <code>CreateClaimActivityRequest</code>.
|
|
92
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
93
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateClaimActivityRequest</code>.
|
|
94
|
+
*/
|
|
95
|
+
}, {
|
|
96
|
+
key: "validateJSON",
|
|
97
|
+
value: function validateJSON(data) {
|
|
98
|
+
// check to make sure all required properties are present in the JSON string
|
|
99
|
+
var _iterator = _createForOfIteratorHelper(CreateClaimActivityRequest.RequiredProperties),
|
|
100
|
+
_step;
|
|
101
|
+
try {
|
|
102
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
103
|
+
var property = _step.value;
|
|
104
|
+
if (!data.hasOwnProperty(property)) {
|
|
105
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// ensure the json data is a string
|
|
109
|
+
} catch (err) {
|
|
110
|
+
_iterator.e(err);
|
|
111
|
+
} finally {
|
|
112
|
+
_iterator.f();
|
|
113
|
+
}
|
|
114
|
+
if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
|
|
115
|
+
throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
|
|
116
|
+
}
|
|
117
|
+
// ensure the json data is a string
|
|
118
|
+
if (data['staking_id'] && !(typeof data['staking_id'] === 'string' || data['staking_id'] instanceof String)) {
|
|
119
|
+
throw new Error("Expected the field `staking_id` to be a primitive type in the JSON string but got " + data['staking_id']);
|
|
120
|
+
}
|
|
121
|
+
// validate the optional field `fee`
|
|
122
|
+
if (data['fee']) {
|
|
123
|
+
// data not null
|
|
124
|
+
if (!!_TransactionRequestFee["default"].validateJSON) {
|
|
125
|
+
_TransactionRequestFee["default"].validateJSON(data['fee']);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// ensure the json data is a string
|
|
129
|
+
if (data['app_initiator'] && !(typeof data['app_initiator'] === 'string' || data['app_initiator'] instanceof String)) {
|
|
130
|
+
throw new Error("Expected the field `app_initiator` to be a primitive type in the JSON string but got " + data['app_initiator']);
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
}]);
|
|
135
|
+
}();
|
|
136
|
+
CreateClaimActivityRequest.RequiredProperties = ["staking_id"];
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
|
|
140
|
+
* @member {String} request_id
|
|
141
|
+
*/
|
|
142
|
+
CreateClaimActivityRequest.prototype['request_id'] = undefined;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* 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).
|
|
146
|
+
* @member {String} staking_id
|
|
147
|
+
*/
|
|
148
|
+
CreateClaimActivityRequest.prototype['staking_id'] = undefined;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @member {module:model/TransactionRequestFee} fee
|
|
152
|
+
*/
|
|
153
|
+
CreateClaimActivityRequest.prototype['fee'] = undefined;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* The initiator of the staking activity. If you do not specify this property, the WaaS service will automatically designate the API key as the initiator.
|
|
157
|
+
* @member {String} app_initiator
|
|
158
|
+
*/
|
|
159
|
+
CreateClaimActivityRequest.prototype['app_initiator'] = undefined;
|
|
160
|
+
|
|
161
|
+
// Implement CreateClaimActivity interface:
|
|
162
|
+
/**
|
|
163
|
+
* The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
|
|
164
|
+
* @member {String} request_id
|
|
165
|
+
*/
|
|
166
|
+
_CreateClaimActivity["default"].prototype['request_id'] = undefined;
|
|
167
|
+
/**
|
|
168
|
+
* 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).
|
|
169
|
+
* @member {String} staking_id
|
|
170
|
+
*/
|
|
171
|
+
_CreateClaimActivity["default"].prototype['staking_id'] = undefined;
|
|
172
|
+
/**
|
|
173
|
+
* @member {module:model/TransactionRequestFee} fee
|
|
174
|
+
*/
|
|
175
|
+
_CreateClaimActivity["default"].prototype['fee'] = undefined;
|
|
176
|
+
// Implement ActivityInitiator interface:
|
|
177
|
+
/**
|
|
178
|
+
* The initiator of the staking activity. If you do not specify this property, the WaaS service will automatically designate the API key as the initiator.
|
|
179
|
+
* @member {String} app_initiator
|
|
180
|
+
*/
|
|
181
|
+
_ActivityInitiator["default"].prototype['app_initiator'] = undefined;
|
|
182
|
+
var _default = exports["default"] = CreateClaimActivityRequest;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
8
|
var _CreateStakeActivityExtra = _interopRequireDefault(require("./CreateStakeActivityExtra"));
|
|
9
|
+
var _StakingPoolId = _interopRequireDefault(require("./StakingPoolId"));
|
|
9
10
|
var _StakingSource = _interopRequireDefault(require("./StakingSource"));
|
|
10
11
|
var _TransactionRequestFee = _interopRequireDefault(require("./TransactionRequestFee"));
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -35,7 +36,7 @@ var CreateStakeActivity = /*#__PURE__*/function () {
|
|
|
35
36
|
/**
|
|
36
37
|
* Constructs a new <code>CreateStakeActivity</code>.
|
|
37
38
|
* @alias module:model/CreateStakeActivity
|
|
38
|
-
* @param pool_id {
|
|
39
|
+
* @param pool_id {module:model/StakingPoolId}
|
|
39
40
|
* @param amount {String} The amount to stake.
|
|
40
41
|
* @param fee {module:model/TransactionRequestFee}
|
|
41
42
|
* @param extra {module:model/CreateStakeActivityExtra}
|
|
@@ -78,7 +79,7 @@ var CreateStakeActivity = /*#__PURE__*/function () {
|
|
|
78
79
|
obj['source'] = _StakingSource["default"].constructFromObject(data['source']);
|
|
79
80
|
}
|
|
80
81
|
if (data.hasOwnProperty('pool_id')) {
|
|
81
|
-
obj['pool_id'] =
|
|
82
|
+
obj['pool_id'] = _StakingPoolId["default"].constructFromObject(data['pool_id']);
|
|
82
83
|
}
|
|
83
84
|
if (data.hasOwnProperty('amount')) {
|
|
84
85
|
obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
|
|
@@ -128,10 +129,6 @@ var CreateStakeActivity = /*#__PURE__*/function () {
|
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
// ensure the json data is a string
|
|
131
|
-
if (data['pool_id'] && !(typeof data['pool_id'] === 'string' || data['pool_id'] instanceof String)) {
|
|
132
|
-
throw new Error("Expected the field `pool_id` to be a primitive type in the JSON string but got " + data['pool_id']);
|
|
133
|
-
}
|
|
134
|
-
// ensure the json data is a string
|
|
135
132
|
if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
|
|
136
133
|
throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
|
|
137
134
|
}
|
|
@@ -167,8 +164,7 @@ CreateStakeActivity.prototype['request_id'] = undefined;
|
|
|
167
164
|
CreateStakeActivity.prototype['source'] = undefined;
|
|
168
165
|
|
|
169
166
|
/**
|
|
170
|
-
*
|
|
171
|
-
* @member {String} pool_id
|
|
167
|
+
* @member {module:model/StakingPoolId} pool_id
|
|
172
168
|
*/
|
|
173
169
|
CreateStakeActivity.prototype['pool_id'] = undefined;
|
|
174
170
|
|