@cobo/cobo-waas2 1.5.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.
- package/README.md +15 -4
- package/dist/ApiClient.js +1 -1
- package/dist/ServerDemo.js +80 -0
- package/dist/api/DevelopersApi.js +79 -0
- package/dist/api/OAuthApi.js +8 -8
- package/dist/api/WalletsApi.js +58 -57
- package/dist/index.js +83 -6
- package/dist/model/AddressTransferDestination.js +2 -2
- package/dist/model/AddressTransferDestinationUtxoOutputsInner.js +6 -17
- package/dist/model/BabylonStakeEstimatedFee.js +118 -0
- package/dist/model/BabylonValidator.js +5 -0
- package/dist/model/CheckAddressChainsValidity200ResponseInner.js +121 -0
- package/dist/model/CreateSmartContractWalletParams.js +1 -1
- package/dist/model/CreateStakeActivityExtra.js +42 -8
- package/dist/model/CreateUnstakeActivity.js +16 -0
- package/dist/model/CreateUnstakeActivityExtra.js +159 -0
- package/dist/model/CreateUnstakeActivityRequest.js +20 -0
- package/dist/model/EstimateContractCallFeeParams.js +4 -6
- package/dist/model/EstimateTransferFeeParams.js +4 -8
- package/dist/model/EstimateUnstakeFee.js +20 -0
- package/dist/model/EstimatedEvmEip1559FeeSlow.js +3 -5
- package/dist/model/EstimatedEvmLegacyFeeSlow.js +3 -5
- package/dist/model/EthStakeEstimatedFee.js +112 -0
- package/dist/model/EthStakeExtra.js +131 -0
- package/dist/model/EthStakingExtra.js +131 -0
- package/dist/model/EthUnstakeExtra.js +131 -0
- package/dist/model/FeeGasLimit.js +1 -2
- package/dist/model/GetApiKeyInfo200Response.js +251 -0
- package/dist/model/GetStakingEstimationFee201Response.js +144 -43
- package/dist/model/GetStakingEstimationFeeRequest.js +2 -2
- package/dist/model/{GetToken200Response.js → GetToken2XXResponse.js} +21 -21
- package/dist/model/GetToken4XXResponse.js +12 -10
- package/dist/model/MPCDelegate.js +1 -1
- package/dist/model/MpcTransferSource.js +2 -2
- package/dist/model/{RefreshToken201Response.js → RefreshToken2XXResponse.js} +21 -21
- package/dist/model/RoleScopes.js +128 -0
- package/dist/model/Scopes.js +142 -0
- package/dist/model/SmartContractWalletInfo.js +1 -1
- package/dist/model/StakingPoolType.js +5 -0
- package/dist/model/StakingsExtra.js +36 -8
- package/dist/model/TransactionEvmEip1559Fee.js +2 -4
- package/dist/model/TransactionEvmLegacyFee.js +2 -4
- package/dist/model/TransactionFee.js +1 -2
- package/dist/model/TransactionRbfSource.js +1 -1
- package/dist/model/TransactionRequestEvmEip1559Fee.js +1 -2
- package/dist/model/TransactionRequestEvmLegacyFee.js +1 -2
- package/dist/model/TransactionRequestFee.js +1 -2
- package/dist/model/TransactionSource.js +1 -1
- package/dist/model/TransactionTransferToAddressDestinationUtxoOutputsInner.js +0 -13
- package/dist/model/TransferDestination.js +2 -2
- package/docs/AddressTransferDestination.md +2 -2
- package/docs/AddressTransferDestinationUtxoOutputsInner.md +1 -2
- package/docs/BabylonStakeEstimatedFee.md +12 -0
- package/docs/BabylonValidator.md +2 -0
- package/docs/CheckAddressChainsValidity200ResponseInner.md +10 -0
- package/docs/CreateStakeActivityExtra.md +1 -0
- package/docs/CreateUnstakeActivity.md +1 -0
- package/docs/CreateUnstakeActivityExtra.md +10 -0
- package/docs/CreateUnstakeActivityRequest.md +1 -0
- package/docs/DevelopersApi.md +55 -0
- package/docs/EstimateContractCallFeeParams.md +1 -1
- package/docs/EstimateFeeParams.md +1 -1
- package/docs/EstimateTransferFeeParams.md +2 -2
- package/docs/EstimateUnstakeFee.md +1 -0
- package/docs/EstimatedEvmEip1559FeeSlow.md +1 -1
- package/docs/EstimatedEvmLegacyFeeSlow.md +1 -1
- package/docs/EthStakeEstimatedFee.md +11 -0
- package/docs/EthStakeExtra.md +10 -0
- package/docs/EthStakingExtra.md +10 -0
- package/docs/EthUnstakeExtra.md +10 -0
- package/docs/FeeGasLimit.md +1 -1
- package/docs/GetApiKeyInfo200Response.md +30 -0
- package/docs/GetStakingEstimationFee201Response.md +3 -0
- package/docs/GetStakingEstimationFeeRequest.md +1 -1
- package/docs/{GetToken200Response.md → GetToken2XXResponse.md} +1 -1
- package/docs/GetToken4XXResponse.md +1 -1
- package/docs/MpcTransferSource.md +1 -1
- package/docs/OAuthApi.md +4 -4
- package/docs/PoolDetailsAllOfValidatorsInfo.md +2 -0
- package/docs/{RefreshToken201Response.md → RefreshToken2XXResponse.md} +1 -1
- package/docs/RoleScopes.md +10 -0
- package/docs/Scopes.md +13 -0
- package/docs/StakingPoolType.md +2 -0
- package/docs/TransactionEvmEip1559Fee.md +1 -1
- package/docs/TransactionEvmLegacyFee.md +1 -1
- package/docs/TransactionFee.md +1 -1
- package/docs/TransactionRbfSource.md +1 -1
- package/docs/TransactionRequestEvmEip1559Fee.md +1 -1
- package/docs/TransactionRequestEvmLegacyFee.md +1 -1
- package/docs/TransactionRequestFee.md +1 -1
- package/docs/TransactionTransferToAddressDestinationUtxoOutputsInner.md +0 -1
- package/docs/TransferDestination.md +2 -2
- package/docs/WalletsApi.md +54 -54
- package/package.json +2 -1
|
@@ -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 _EthStakeExtra = _interopRequireDefault(require("./EthStakeExtra"));
|
|
9
10
|
var _StakingPoolType = _interopRequireDefault(require("./StakingPoolType"));
|
|
10
11
|
var _CreateStakeActivityExtra;
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -33,7 +34,7 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
|
|
|
33
34
|
/**
|
|
34
35
|
* Constructs a new <code>CreateStakeActivityExtra</code>.
|
|
35
36
|
* @alias module:model/CreateStakeActivityExtra
|
|
36
|
-
* @param {(module:model/BabylonStakeExtra)} instance The actual instance to initialize CreateStakeActivityExtra.
|
|
37
|
+
* @param {(module:model/BabylonStakeExtra|module:model/EthStakeExtra)} instance The actual instance to initialize CreateStakeActivityExtra.
|
|
37
38
|
*/
|
|
38
39
|
function CreateStakeActivityExtra() {
|
|
39
40
|
var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
@@ -58,6 +59,10 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
|
|
|
58
59
|
this.actualInstance = _BabylonStakeExtra["default"].constructFromObject(instance);
|
|
59
60
|
match++;
|
|
60
61
|
break;
|
|
62
|
+
case "ETHBeacon":
|
|
63
|
+
this.actualInstance = _EthStakeExtra["default"].constructFromObject(instance);
|
|
64
|
+
match++;
|
|
65
|
+
break;
|
|
61
66
|
default:
|
|
62
67
|
errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
|
|
63
68
|
break;
|
|
@@ -87,13 +92,36 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
|
|
|
87
92
|
// json data failed to deserialize into BabylonStakeExtra
|
|
88
93
|
errorMessages.push("Failed to construct BabylonStakeExtra: " + err);
|
|
89
94
|
}
|
|
95
|
+
try {
|
|
96
|
+
if (instance instanceof _EthStakeExtra["default"]) {
|
|
97
|
+
this.actualInstance = instance;
|
|
98
|
+
} else if (!!_EthStakeExtra["default"].validateJSON && _EthStakeExtra["default"].validateJSON(instance)) {
|
|
99
|
+
// plain JS object
|
|
100
|
+
// create EthStakeExtra from JS object
|
|
101
|
+
this.actualInstance = _EthStakeExtra["default"].constructFromObject(instance);
|
|
102
|
+
} else {
|
|
103
|
+
if (_EthStakeExtra["default"].constructFromObject(instance)) {
|
|
104
|
+
if (!!_EthStakeExtra["default"].constructFromObject(instance).toJSON) {
|
|
105
|
+
if (_EthStakeExtra["default"].constructFromObject(instance).toJSON()) {
|
|
106
|
+
this.actualInstance = _EthStakeExtra["default"].constructFromObject(instance);
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
this.actualInstance = _EthStakeExtra["default"].constructFromObject(instance);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
match++;
|
|
114
|
+
} catch (err) {
|
|
115
|
+
// json data failed to deserialize into EthStakeExtra
|
|
116
|
+
errorMessages.push("Failed to construct EthStakeExtra: " + err);
|
|
117
|
+
}
|
|
90
118
|
|
|
91
119
|
// if (match > 1) {
|
|
92
|
-
// throw new Error("Multiple matches found constructing `CreateStakeActivityExtra` with oneOf schemas BabylonStakeExtra. Input: " + JSON.stringify(instance));
|
|
120
|
+
// throw new Error("Multiple matches found constructing `CreateStakeActivityExtra` with oneOf schemas BabylonStakeExtra, EthStakeExtra. Input: " + JSON.stringify(instance));
|
|
93
121
|
// } else
|
|
94
122
|
if (match === 0) {
|
|
95
123
|
// this.actualInstance = null; // clear the actual instance in case there are multiple matches
|
|
96
|
-
// throw new Error("No match found constructing `CreateStakeActivityExtra` with oneOf schemas BabylonStakeExtra. Details: " +
|
|
124
|
+
// throw new Error("No match found constructing `CreateStakeActivityExtra` with oneOf schemas BabylonStakeExtra, EthStakeExtra. Details: " +
|
|
97
125
|
// errorMessages.join(", "));
|
|
98
126
|
return;
|
|
99
127
|
} else {// only 1 match
|
|
@@ -112,16 +140,16 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
|
|
|
112
140
|
key: "getActualInstance",
|
|
113
141
|
value:
|
|
114
142
|
/**
|
|
115
|
-
* Gets the actual instance, which can be <code>BabylonStakeExtra</code>.
|
|
116
|
-
* @return {(module:model/BabylonStakeExtra)} The actual instance.
|
|
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.
|
|
117
145
|
*/
|
|
118
146
|
function getActualInstance() {
|
|
119
147
|
return this.actualInstance;
|
|
120
148
|
}
|
|
121
149
|
|
|
122
150
|
/**
|
|
123
|
-
* Sets the actual instance, which can be <code>BabylonStakeExtra</code>.
|
|
124
|
-
* @param {(module:model/BabylonStakeExtra)} obj The actual instance.
|
|
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.
|
|
125
153
|
*/
|
|
126
154
|
}, {
|
|
127
155
|
key: "setActualInstance",
|
|
@@ -166,5 +194,11 @@ CreateStakeActivityExtra.prototype['stake_block_time'] = undefined;
|
|
|
166
194
|
* @member {Boolean} auto_broadcast
|
|
167
195
|
*/
|
|
168
196
|
CreateStakeActivityExtra.prototype['auto_broadcast'] = undefined;
|
|
169
|
-
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* The name of the provider.
|
|
200
|
+
* @member {String} provider_name
|
|
201
|
+
*/
|
|
202
|
+
CreateStakeActivityExtra.prototype['provider_name'] = undefined;
|
|
203
|
+
CreateStakeActivityExtra.OneOf = ["BabylonStakeExtra", "EthStakeExtra"];
|
|
170
204
|
var _default = exports["default"] = CreateStakeActivityExtra;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _CreateUnstakeActivityExtra = _interopRequireDefault(require("./CreateUnstakeActivityExtra"));
|
|
8
9
|
var _TransactionRequestFee = _interopRequireDefault(require("./TransactionRequestFee"));
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
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); }
|
|
@@ -75,6 +76,9 @@ var CreateUnstakeActivity = /*#__PURE__*/function () {
|
|
|
75
76
|
if (data.hasOwnProperty('fee')) {
|
|
76
77
|
obj['fee'] = _TransactionRequestFee["default"].constructFromObject(data['fee']);
|
|
77
78
|
}
|
|
79
|
+
if (data.hasOwnProperty('extra')) {
|
|
80
|
+
obj['extra'] = _CreateUnstakeActivityExtra["default"].constructFromObject(data['extra']);
|
|
81
|
+
}
|
|
78
82
|
}
|
|
79
83
|
return obj;
|
|
80
84
|
}
|
|
@@ -121,6 +125,13 @@ var CreateUnstakeActivity = /*#__PURE__*/function () {
|
|
|
121
125
|
_TransactionRequestFee["default"].validateJSON(data['fee']);
|
|
122
126
|
}
|
|
123
127
|
}
|
|
128
|
+
// validate the optional field `extra`
|
|
129
|
+
if (data['extra']) {
|
|
130
|
+
// data not null
|
|
131
|
+
if (!!_CreateUnstakeActivityExtra["default"].validateJSON) {
|
|
132
|
+
_CreateUnstakeActivityExtra["default"].validateJSON(data['extra']);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
124
135
|
return true;
|
|
125
136
|
}
|
|
126
137
|
}]);
|
|
@@ -149,4 +160,9 @@ CreateUnstakeActivity.prototype['amount'] = undefined;
|
|
|
149
160
|
* @member {module:model/TransactionRequestFee} fee
|
|
150
161
|
*/
|
|
151
162
|
CreateUnstakeActivity.prototype['fee'] = undefined;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @member {module:model/CreateUnstakeActivityExtra} extra
|
|
166
|
+
*/
|
|
167
|
+
CreateUnstakeActivity.prototype['extra'] = undefined;
|
|
152
168
|
var _default = exports["default"] = CreateUnstakeActivity;
|
|
@@ -0,0 +1,159 @@
|
|
|
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 _EthUnstakeExtra = _interopRequireDefault(require("./EthUnstakeExtra"));
|
|
9
|
+
var _StakingPoolType = _interopRequireDefault(require("./StakingPoolType"));
|
|
10
|
+
var _CreateUnstakeActivityExtra;
|
|
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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
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); } }
|
|
15
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
+
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; }
|
|
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 CreateUnstakeActivityExtra model module.
|
|
30
|
+
* @module model/CreateUnstakeActivityExtra
|
|
31
|
+
*/
|
|
32
|
+
var CreateUnstakeActivityExtra = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>CreateUnstakeActivityExtra</code>.
|
|
35
|
+
* Additional protocol-specific information required for the unstaking operation. The required fields vary depending on the staking protocol.
|
|
36
|
+
* @alias module:model/CreateUnstakeActivityExtra
|
|
37
|
+
* @param {(module:model/EthUnstakeExtra)} instance The actual instance to initialize CreateUnstakeActivityExtra.
|
|
38
|
+
*/
|
|
39
|
+
function CreateUnstakeActivityExtra() {
|
|
40
|
+
var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
41
|
+
_classCallCheck(this, CreateUnstakeActivityExtra);
|
|
42
|
+
/**
|
|
43
|
+
* Returns the JSON representation of the actual instance.
|
|
44
|
+
* @return {string}
|
|
45
|
+
*/
|
|
46
|
+
_defineProperty(this, "toJSON", function () {
|
|
47
|
+
return this.getActualInstance();
|
|
48
|
+
});
|
|
49
|
+
if (instance === null) {
|
|
50
|
+
this.actualInstance = null;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
var match = 0;
|
|
54
|
+
var errorMessages = [];
|
|
55
|
+
var discriminatorValue = instance["pool_type"];
|
|
56
|
+
if (discriminatorValue) {
|
|
57
|
+
switch (discriminatorValue) {
|
|
58
|
+
case "ETHBeacon":
|
|
59
|
+
this.actualInstance = _EthUnstakeExtra["default"].constructFromObject(instance);
|
|
60
|
+
match++;
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
if (instance instanceof _EthUnstakeExtra["default"]) {
|
|
70
|
+
this.actualInstance = instance;
|
|
71
|
+
} else if (!!_EthUnstakeExtra["default"].validateJSON && _EthUnstakeExtra["default"].validateJSON(instance)) {
|
|
72
|
+
// plain JS object
|
|
73
|
+
// create EthUnstakeExtra from JS object
|
|
74
|
+
this.actualInstance = _EthUnstakeExtra["default"].constructFromObject(instance);
|
|
75
|
+
} else {
|
|
76
|
+
if (_EthUnstakeExtra["default"].constructFromObject(instance)) {
|
|
77
|
+
if (!!_EthUnstakeExtra["default"].constructFromObject(instance).toJSON) {
|
|
78
|
+
if (_EthUnstakeExtra["default"].constructFromObject(instance).toJSON()) {
|
|
79
|
+
this.actualInstance = _EthUnstakeExtra["default"].constructFromObject(instance);
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
this.actualInstance = _EthUnstakeExtra["default"].constructFromObject(instance);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
match++;
|
|
87
|
+
} catch (err) {
|
|
88
|
+
// json data failed to deserialize into EthUnstakeExtra
|
|
89
|
+
errorMessages.push("Failed to construct EthUnstakeExtra: " + err);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// if (match > 1) {
|
|
93
|
+
// throw new Error("Multiple matches found constructing `CreateUnstakeActivityExtra` with oneOf schemas EthUnstakeExtra. Input: " + JSON.stringify(instance));
|
|
94
|
+
// } else
|
|
95
|
+
if (match === 0) {
|
|
96
|
+
// this.actualInstance = null; // clear the actual instance in case there are multiple matches
|
|
97
|
+
// throw new Error("No match found constructing `CreateUnstakeActivityExtra` with oneOf schemas EthUnstakeExtra. Details: " +
|
|
98
|
+
// errorMessages.join(", "));
|
|
99
|
+
return;
|
|
100
|
+
} else {// only 1 match
|
|
101
|
+
// the input is valid
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Constructs a <code>CreateUnstakeActivityExtra</code> from a plain JavaScript object, optionally creating a new instance.
|
|
107
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
108
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
109
|
+
* @param {module:model/CreateUnstakeActivityExtra} obj Optional instance to populate.
|
|
110
|
+
* @return {module:model/CreateUnstakeActivityExtra} The populated <code>CreateUnstakeActivityExtra</code> instance.
|
|
111
|
+
*/
|
|
112
|
+
return _createClass(CreateUnstakeActivityExtra, [{
|
|
113
|
+
key: "getActualInstance",
|
|
114
|
+
value:
|
|
115
|
+
/**
|
|
116
|
+
* Gets the actual instance, which can be <code>EthUnstakeExtra</code>.
|
|
117
|
+
* @return {(module:model/EthUnstakeExtra)} The actual instance.
|
|
118
|
+
*/
|
|
119
|
+
function getActualInstance() {
|
|
120
|
+
return this.actualInstance;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Sets the actual instance, which can be <code>EthUnstakeExtra</code>.
|
|
125
|
+
* @param {(module:model/EthUnstakeExtra)} obj The actual instance.
|
|
126
|
+
*/
|
|
127
|
+
}, {
|
|
128
|
+
key: "setActualInstance",
|
|
129
|
+
value: function setActualInstance(obj) {
|
|
130
|
+
this.actualInstance = CreateUnstakeActivityExtra.constructFromObject(obj).getActualInstance();
|
|
131
|
+
}
|
|
132
|
+
}], [{
|
|
133
|
+
key: "constructFromObject",
|
|
134
|
+
value: function constructFromObject(data, obj) {
|
|
135
|
+
return new CreateUnstakeActivityExtra(data);
|
|
136
|
+
}
|
|
137
|
+
}]);
|
|
138
|
+
}();
|
|
139
|
+
/**
|
|
140
|
+
* @member {module:model/StakingPoolType} pool_type
|
|
141
|
+
*/
|
|
142
|
+
_CreateUnstakeActivityExtra = CreateUnstakeActivityExtra;
|
|
143
|
+
/**
|
|
144
|
+
* Create an instance of CreateUnstakeActivityExtra from a JSON string.
|
|
145
|
+
* @param {string} json_string JSON string.
|
|
146
|
+
* @return {module:model/CreateUnstakeActivityExtra} An instance of CreateUnstakeActivityExtra.
|
|
147
|
+
*/
|
|
148
|
+
_defineProperty(CreateUnstakeActivityExtra, "fromJSON", function (json_string) {
|
|
149
|
+
return _CreateUnstakeActivityExtra.constructFromObject(JSON.parse(json_string));
|
|
150
|
+
});
|
|
151
|
+
CreateUnstakeActivityExtra.prototype['pool_type'] = undefined;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* A list of public keys identifying the validators to unstake from the Ethereum Beacon Chain.
|
|
155
|
+
* @member {Array.<String>} validator_pubkeys
|
|
156
|
+
*/
|
|
157
|
+
CreateUnstakeActivityExtra.prototype['validator_pubkeys'] = undefined;
|
|
158
|
+
CreateUnstakeActivityExtra.OneOf = ["EthUnstakeExtra"];
|
|
159
|
+
var _default = exports["default"] = CreateUnstakeActivityExtra;
|
|
@@ -7,6 +7,7 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
8
|
var _ActivityInitiator = _interopRequireDefault(require("./ActivityInitiator"));
|
|
9
9
|
var _CreateUnstakeActivity = _interopRequireDefault(require("./CreateUnstakeActivity"));
|
|
10
|
+
var _CreateUnstakeActivityExtra = _interopRequireDefault(require("./CreateUnstakeActivityExtra"));
|
|
10
11
|
var _TransactionRequestFee = _interopRequireDefault(require("./TransactionRequestFee"));
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
13
|
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); }
|
|
@@ -83,6 +84,9 @@ var CreateUnstakeActivityRequest = /*#__PURE__*/function () {
|
|
|
83
84
|
if (data.hasOwnProperty('fee')) {
|
|
84
85
|
obj['fee'] = _TransactionRequestFee["default"].constructFromObject(data['fee']);
|
|
85
86
|
}
|
|
87
|
+
if (data.hasOwnProperty('extra')) {
|
|
88
|
+
obj['extra'] = _CreateUnstakeActivityExtra["default"].constructFromObject(data['extra']);
|
|
89
|
+
}
|
|
86
90
|
if (data.hasOwnProperty('app_initiator')) {
|
|
87
91
|
obj['app_initiator'] = _ApiClient["default"].convertToType(data['app_initiator'], 'String');
|
|
88
92
|
}
|
|
@@ -132,6 +136,13 @@ var CreateUnstakeActivityRequest = /*#__PURE__*/function () {
|
|
|
132
136
|
_TransactionRequestFee["default"].validateJSON(data['fee']);
|
|
133
137
|
}
|
|
134
138
|
}
|
|
139
|
+
// validate the optional field `extra`
|
|
140
|
+
if (data['extra']) {
|
|
141
|
+
// data not null
|
|
142
|
+
if (!!_CreateUnstakeActivityExtra["default"].validateJSON) {
|
|
143
|
+
_CreateUnstakeActivityExtra["default"].validateJSON(data['extra']);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
135
146
|
// ensure the json data is a string
|
|
136
147
|
if (data['app_initiator'] && !(typeof data['app_initiator'] === 'string' || data['app_initiator'] instanceof String)) {
|
|
137
148
|
throw new Error("Expected the field `app_initiator` to be a primitive type in the JSON string but got " + data['app_initiator']);
|
|
@@ -165,6 +176,11 @@ CreateUnstakeActivityRequest.prototype['amount'] = undefined;
|
|
|
165
176
|
*/
|
|
166
177
|
CreateUnstakeActivityRequest.prototype['fee'] = undefined;
|
|
167
178
|
|
|
179
|
+
/**
|
|
180
|
+
* @member {module:model/CreateUnstakeActivityExtra} extra
|
|
181
|
+
*/
|
|
182
|
+
CreateUnstakeActivityRequest.prototype['extra'] = undefined;
|
|
183
|
+
|
|
168
184
|
/**
|
|
169
185
|
* 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.
|
|
170
186
|
* @member {String} app_initiator
|
|
@@ -191,6 +207,10 @@ _CreateUnstakeActivity["default"].prototype['amount'] = undefined;
|
|
|
191
207
|
* @member {module:model/TransactionRequestFee} fee
|
|
192
208
|
*/
|
|
193
209
|
_CreateUnstakeActivity["default"].prototype['fee'] = undefined;
|
|
210
|
+
/**
|
|
211
|
+
* @member {module:model/CreateUnstakeActivityExtra} extra
|
|
212
|
+
*/
|
|
213
|
+
_CreateUnstakeActivity["default"].prototype['extra'] = undefined;
|
|
194
214
|
// Implement ActivityInitiator interface:
|
|
195
215
|
/**
|
|
196
216
|
* 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.
|
|
@@ -37,15 +37,14 @@ var EstimateContractCallFeeParams = /*#__PURE__*/function () {
|
|
|
37
37
|
* Constructs a new <code>EstimateContractCallFeeParams</code>.
|
|
38
38
|
* The information about a transaction that interacts with a smart contract
|
|
39
39
|
* @alias module:model/EstimateContractCallFeeParams
|
|
40
|
-
* @param request_id {String} The request ID that is used to track a transaction request. The request ID is provided by you and must be unique within your organization. It is recommended to use the same request ID as the transaction for which you want to estimate the transaction fee.
|
|
41
40
|
* @param request_type {module:model/EstimateFeeRequestType}
|
|
42
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).
|
|
43
42
|
* @param source {module:model/ContractCallSource}
|
|
44
43
|
* @param destination {module:model/ContractCallDestination}
|
|
45
44
|
*/
|
|
46
|
-
function EstimateContractCallFeeParams(
|
|
45
|
+
function EstimateContractCallFeeParams(request_type, chain_id, source, destination) {
|
|
47
46
|
_classCallCheck(this, EstimateContractCallFeeParams);
|
|
48
|
-
EstimateContractCallFeeParams.initialize(this,
|
|
47
|
+
EstimateContractCallFeeParams.initialize(this, request_type, chain_id, source, destination);
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
/**
|
|
@@ -55,8 +54,7 @@ var EstimateContractCallFeeParams = /*#__PURE__*/function () {
|
|
|
55
54
|
*/
|
|
56
55
|
return _createClass(EstimateContractCallFeeParams, null, [{
|
|
57
56
|
key: "initialize",
|
|
58
|
-
value: function initialize(obj,
|
|
59
|
-
obj['request_id'] = request_id;
|
|
57
|
+
value: function initialize(obj, request_type, chain_id, source, destination) {
|
|
60
58
|
obj['request_type'] = request_type;
|
|
61
59
|
obj['chain_id'] = chain_id;
|
|
62
60
|
obj['source'] = source;
|
|
@@ -146,7 +144,7 @@ var EstimateContractCallFeeParams = /*#__PURE__*/function () {
|
|
|
146
144
|
}
|
|
147
145
|
}]);
|
|
148
146
|
}();
|
|
149
|
-
EstimateContractCallFeeParams.RequiredProperties = ["
|
|
147
|
+
EstimateContractCallFeeParams.RequiredProperties = ["request_type", "chain_id", "source", "destination"];
|
|
150
148
|
|
|
151
149
|
/**
|
|
152
150
|
* The request ID that is used to track a transaction request. The request ID is provided by you and must be unique within your organization. It is recommended to use the same request ID as the transaction for which you want to estimate the transaction fee.
|
|
@@ -37,15 +37,13 @@ var EstimateTransferFeeParams = /*#__PURE__*/function () {
|
|
|
37
37
|
* Constructs a new <code>EstimateTransferFeeParams</code>.
|
|
38
38
|
* The information about a token transfer.
|
|
39
39
|
* @alias module:model/EstimateTransferFeeParams
|
|
40
|
-
* @param request_id {String} The request ID that is used to track a transaction request. The request ID is provided by you and must be unique within your organization. It is recommended to use the same request ID as the transaction for which you want to estimate the transaction fee.
|
|
41
40
|
* @param request_type {module:model/EstimateFeeRequestType}
|
|
42
41
|
* @param source {module:model/TransferSource}
|
|
43
42
|
* @param token_id {String} The token ID of the transferred token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens).
|
|
44
|
-
* @param destination {module:model/TransferDestination}
|
|
45
43
|
*/
|
|
46
|
-
function EstimateTransferFeeParams(
|
|
44
|
+
function EstimateTransferFeeParams(request_type, source, token_id) {
|
|
47
45
|
_classCallCheck(this, EstimateTransferFeeParams);
|
|
48
|
-
EstimateTransferFeeParams.initialize(this,
|
|
46
|
+
EstimateTransferFeeParams.initialize(this, request_type, source, token_id);
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
/**
|
|
@@ -55,12 +53,10 @@ var EstimateTransferFeeParams = /*#__PURE__*/function () {
|
|
|
55
53
|
*/
|
|
56
54
|
return _createClass(EstimateTransferFeeParams, null, [{
|
|
57
55
|
key: "initialize",
|
|
58
|
-
value: function initialize(obj,
|
|
59
|
-
obj['request_id'] = request_id;
|
|
56
|
+
value: function initialize(obj, request_type, source, token_id) {
|
|
60
57
|
obj['request_type'] = request_type;
|
|
61
58
|
obj['source'] = source;
|
|
62
59
|
obj['token_id'] = token_id;
|
|
63
|
-
obj['destination'] = destination;
|
|
64
60
|
}
|
|
65
61
|
|
|
66
62
|
/**
|
|
@@ -146,7 +142,7 @@ var EstimateTransferFeeParams = /*#__PURE__*/function () {
|
|
|
146
142
|
}
|
|
147
143
|
}]);
|
|
148
144
|
}();
|
|
149
|
-
EstimateTransferFeeParams.RequiredProperties = ["
|
|
145
|
+
EstimateTransferFeeParams.RequiredProperties = ["request_type", "source", "token_id"];
|
|
150
146
|
|
|
151
147
|
/**
|
|
152
148
|
* The request ID that is used to track a transaction request. The request ID is provided by you and must be unique within your organization. It is recommended to use the same request ID as the transaction for which you want to estimate the transaction fee.
|
|
@@ -8,6 +8,7 @@ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
|
8
8
|
var _ActivityType = _interopRequireDefault(require("./ActivityType"));
|
|
9
9
|
var _BaseEstimateStakingFee = _interopRequireDefault(require("./BaseEstimateStakingFee"));
|
|
10
10
|
var _CreateUnstakeActivity = _interopRequireDefault(require("./CreateUnstakeActivity"));
|
|
11
|
+
var _CreateUnstakeActivityExtra = _interopRequireDefault(require("./CreateUnstakeActivityExtra"));
|
|
11
12
|
var _TransactionRequestFee = _interopRequireDefault(require("./TransactionRequestFee"));
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
14
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
@@ -89,6 +90,9 @@ var EstimateUnstakeFee = /*#__PURE__*/function () {
|
|
|
89
90
|
if (data.hasOwnProperty('fee')) {
|
|
90
91
|
obj['fee'] = _TransactionRequestFee["default"].constructFromObject(data['fee']);
|
|
91
92
|
}
|
|
93
|
+
if (data.hasOwnProperty('extra')) {
|
|
94
|
+
obj['extra'] = _CreateUnstakeActivityExtra["default"].constructFromObject(data['extra']);
|
|
95
|
+
}
|
|
92
96
|
}
|
|
93
97
|
return obj;
|
|
94
98
|
}
|
|
@@ -135,6 +139,13 @@ var EstimateUnstakeFee = /*#__PURE__*/function () {
|
|
|
135
139
|
_TransactionRequestFee["default"].validateJSON(data['fee']);
|
|
136
140
|
}
|
|
137
141
|
}
|
|
142
|
+
// validate the optional field `extra`
|
|
143
|
+
if (data['extra']) {
|
|
144
|
+
// data not null
|
|
145
|
+
if (!!_CreateUnstakeActivityExtra["default"].validateJSON) {
|
|
146
|
+
_CreateUnstakeActivityExtra["default"].validateJSON(data['extra']);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
138
149
|
return true;
|
|
139
150
|
}
|
|
140
151
|
}]);
|
|
@@ -169,6 +180,11 @@ EstimateUnstakeFee.prototype['amount'] = undefined;
|
|
|
169
180
|
*/
|
|
170
181
|
EstimateUnstakeFee.prototype['fee'] = undefined;
|
|
171
182
|
|
|
183
|
+
/**
|
|
184
|
+
* @member {module:model/CreateUnstakeActivityExtra} extra
|
|
185
|
+
*/
|
|
186
|
+
EstimateUnstakeFee.prototype['extra'] = undefined;
|
|
187
|
+
|
|
172
188
|
// Implement BaseEstimateStakingFee interface:
|
|
173
189
|
/**
|
|
174
190
|
* @member {module:model/ActivityType} activity_type
|
|
@@ -194,4 +210,8 @@ _CreateUnstakeActivity["default"].prototype['amount'] = undefined;
|
|
|
194
210
|
* @member {module:model/TransactionRequestFee} fee
|
|
195
211
|
*/
|
|
196
212
|
_CreateUnstakeActivity["default"].prototype['fee'] = undefined;
|
|
213
|
+
/**
|
|
214
|
+
* @member {module:model/CreateUnstakeActivityExtra} extra
|
|
215
|
+
*/
|
|
216
|
+
_CreateUnstakeActivity["default"].prototype['extra'] = undefined;
|
|
197
217
|
var _default = exports["default"] = EstimateUnstakeFee;
|
|
@@ -57,7 +57,7 @@ var EstimatedEvmEip1559FeeSlow = /*#__PURE__*/function () {
|
|
|
57
57
|
value: function initialize(obj, max_fee_per_gas, max_priority_fee_per_gas, gas_limit) {
|
|
58
58
|
obj['max_fee_per_gas'] = max_fee_per_gas;
|
|
59
59
|
obj['max_priority_fee_per_gas'] = max_priority_fee_per_gas;
|
|
60
|
-
obj['gas_limit'] = gas_limit
|
|
60
|
+
obj['gas_limit'] = gas_limit;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
@@ -143,9 +143,8 @@ EstimatedEvmEip1559FeeSlow.prototype['max_priority_fee_per_gas'] = undefined;
|
|
|
143
143
|
/**
|
|
144
144
|
* The gas limit. It represents the maximum number of gas units that you are willing to pay for the execution of a transaction or Ethereum Virtual Machine (EVM) operation. The gas unit cost of each operation varies.
|
|
145
145
|
* @member {String} gas_limit
|
|
146
|
-
* @default '21000'
|
|
147
146
|
*/
|
|
148
|
-
EstimatedEvmEip1559FeeSlow.prototype['gas_limit'] =
|
|
147
|
+
EstimatedEvmEip1559FeeSlow.prototype['gas_limit'] = undefined;
|
|
149
148
|
|
|
150
149
|
// Implement EvmEip1559FeeBasePrice interface:
|
|
151
150
|
/**
|
|
@@ -162,7 +161,6 @@ _EvmEip1559FeeBasePrice["default"].prototype['max_priority_fee_per_gas'] = undef
|
|
|
162
161
|
/**
|
|
163
162
|
* The gas limit. It represents the maximum number of gas units that you are willing to pay for the execution of a transaction or Ethereum Virtual Machine (EVM) operation. The gas unit cost of each operation varies.
|
|
164
163
|
* @member {String} gas_limit
|
|
165
|
-
* @default '21000'
|
|
166
164
|
*/
|
|
167
|
-
_FeeGasLimit["default"].prototype['gas_limit'] =
|
|
165
|
+
_FeeGasLimit["default"].prototype['gas_limit'] = undefined;
|
|
168
166
|
var _default = exports["default"] = EstimatedEvmEip1559FeeSlow;
|
|
@@ -55,7 +55,7 @@ var EstimatedEvmLegacyFeeSlow = /*#__PURE__*/function () {
|
|
|
55
55
|
key: "initialize",
|
|
56
56
|
value: function initialize(obj, gas_price, gas_limit) {
|
|
57
57
|
obj['gas_price'] = gas_price;
|
|
58
|
-
obj['gas_limit'] = gas_limit
|
|
58
|
+
obj['gas_limit'] = gas_limit;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
@@ -128,9 +128,8 @@ EstimatedEvmLegacyFeeSlow.prototype['gas_price'] = undefined;
|
|
|
128
128
|
/**
|
|
129
129
|
* The gas limit. It represents the maximum number of gas units that you are willing to pay for the execution of a transaction or Ethereum Virtual Machine (EVM) operation. The gas unit cost of each operation varies.
|
|
130
130
|
* @member {String} gas_limit
|
|
131
|
-
* @default '21000'
|
|
132
131
|
*/
|
|
133
|
-
EstimatedEvmLegacyFeeSlow.prototype['gas_limit'] =
|
|
132
|
+
EstimatedEvmLegacyFeeSlow.prototype['gas_limit'] = undefined;
|
|
134
133
|
|
|
135
134
|
// Implement EvmLegacyFeeBasePrice interface:
|
|
136
135
|
/**
|
|
@@ -142,7 +141,6 @@ _EvmLegacyFeeBasePrice["default"].prototype['gas_price'] = undefined;
|
|
|
142
141
|
/**
|
|
143
142
|
* The gas limit. It represents the maximum number of gas units that you are willing to pay for the execution of a transaction or Ethereum Virtual Machine (EVM) operation. The gas unit cost of each operation varies.
|
|
144
143
|
* @member {String} gas_limit
|
|
145
|
-
* @default '21000'
|
|
146
144
|
*/
|
|
147
|
-
_FeeGasLimit["default"].prototype['gas_limit'] =
|
|
145
|
+
_FeeGasLimit["default"].prototype['gas_limit'] = undefined;
|
|
148
146
|
var _default = exports["default"] = EstimatedEvmLegacyFeeSlow;
|
|
@@ -0,0 +1,112 @@
|
|
|
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 _EstimatedFee = _interopRequireDefault(require("./EstimatedFee"));
|
|
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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
|
+
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); } }
|
|
14
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
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); } /**
|
|
17
|
+
* Cobo Wallet as a Service 2.0
|
|
18
|
+
*
|
|
19
|
+
* Contact: help@cobo.com
|
|
20
|
+
*
|
|
21
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
22
|
+
* https://openapi-generator.tech
|
|
23
|
+
* Do not edit the class manually.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The EthStakeEstimatedFee model module.
|
|
28
|
+
* @module model/EthStakeEstimatedFee
|
|
29
|
+
*/
|
|
30
|
+
var EthStakeEstimatedFee = /*#__PURE__*/function () {
|
|
31
|
+
/**
|
|
32
|
+
* Constructs a new <code>EthStakeEstimatedFee</code>.
|
|
33
|
+
* @alias module:model/EthStakeEstimatedFee
|
|
34
|
+
*/
|
|
35
|
+
function EthStakeEstimatedFee() {
|
|
36
|
+
_classCallCheck(this, EthStakeEstimatedFee);
|
|
37
|
+
EthStakeEstimatedFee.initialize(this);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Initializes the fields of this object.
|
|
42
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
43
|
+
* Only for internal use.
|
|
44
|
+
*/
|
|
45
|
+
return _createClass(EthStakeEstimatedFee, null, [{
|
|
46
|
+
key: "initialize",
|
|
47
|
+
value: function initialize(obj) {}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Constructs a <code>EthStakeEstimatedFee</code> from a plain JavaScript object, optionally creating a new instance.
|
|
51
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
52
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
53
|
+
* @param {module:model/EthStakeEstimatedFee} obj Optional instance to populate.
|
|
54
|
+
* @return {module:model/EthStakeEstimatedFee} The populated <code>EthStakeEstimatedFee</code> instance.
|
|
55
|
+
*/
|
|
56
|
+
}, {
|
|
57
|
+
key: "constructFromObject",
|
|
58
|
+
value: function constructFromObject(data, obj) {
|
|
59
|
+
if (data) {
|
|
60
|
+
obj = obj || new EthStakeEstimatedFee();
|
|
61
|
+
if (data.hasOwnProperty('pool_type')) {
|
|
62
|
+
obj['pool_type'] = _StakingPoolType["default"].constructFromObject(data['pool_type']);
|
|
63
|
+
}
|
|
64
|
+
if (data.hasOwnProperty('fee')) {
|
|
65
|
+
obj['fee'] = _EstimatedFee["default"].constructFromObject(data['fee']);
|
|
66
|
+
}
|
|
67
|
+
if (data.hasOwnProperty('validator_pubkeys')) {
|
|
68
|
+
obj['validator_pubkeys'] = _ApiClient["default"].convertToType(data['validator_pubkeys'], ['String']);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return obj;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Validates the JSON data with respect to <code>EthStakeEstimatedFee</code>.
|
|
76
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
77
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>EthStakeEstimatedFee</code>.
|
|
78
|
+
*/
|
|
79
|
+
}, {
|
|
80
|
+
key: "validateJSON",
|
|
81
|
+
value: function validateJSON(data) {
|
|
82
|
+
// validate the optional field `fee`
|
|
83
|
+
if (data['fee']) {
|
|
84
|
+
// data not null
|
|
85
|
+
if (!!_EstimatedFee["default"].validateJSON) {
|
|
86
|
+
_EstimatedFee["default"].validateJSON(data['fee']);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// ensure the json data is an array
|
|
90
|
+
if (!Array.isArray(data['validator_pubkeys'])) {
|
|
91
|
+
throw new Error("Expected the field `validator_pubkeys` to be an array in the JSON data but got " + data['validator_pubkeys']);
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
}]);
|
|
96
|
+
}();
|
|
97
|
+
/**
|
|
98
|
+
* @member {module:model/StakingPoolType} pool_type
|
|
99
|
+
*/
|
|
100
|
+
EthStakeEstimatedFee.prototype['pool_type'] = undefined;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @member {module:model/EstimatedFee} fee
|
|
104
|
+
*/
|
|
105
|
+
EthStakeEstimatedFee.prototype['fee'] = undefined;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* A list of public keys associated with the Ethereum validators for this staking operation.
|
|
109
|
+
* @member {Array.<String>} validator_pubkeys
|
|
110
|
+
*/
|
|
111
|
+
EthStakeEstimatedFee.prototype['validator_pubkeys'] = undefined;
|
|
112
|
+
var _default = exports["default"] = EthStakeEstimatedFee;
|