@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
|
@@ -0,0 +1,131 @@
|
|
|
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 EthStakeExtra model module.
|
|
31
|
+
* @module model/EthStakeExtra
|
|
32
|
+
*/
|
|
33
|
+
var EthStakeExtra = /*#__PURE__*/function () {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new <code>EthStakeExtra</code>.
|
|
36
|
+
* @alias module:model/EthStakeExtra
|
|
37
|
+
* @implements module:model/BaseStakeExtra
|
|
38
|
+
* @param pool_type {module:model/StakingPoolType}
|
|
39
|
+
* @param provider_name {String} The name of the provider.
|
|
40
|
+
*/
|
|
41
|
+
function EthStakeExtra(pool_type, provider_name) {
|
|
42
|
+
_classCallCheck(this, EthStakeExtra);
|
|
43
|
+
_BaseStakeExtra["default"].initialize(this, pool_type);
|
|
44
|
+
EthStakeExtra.initialize(this, pool_type, provider_name);
|
|
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(EthStakeExtra, null, [{
|
|
53
|
+
key: "initialize",
|
|
54
|
+
value: function initialize(obj, pool_type, provider_name) {
|
|
55
|
+
obj['pool_type'] = pool_type;
|
|
56
|
+
obj['provider_name'] = provider_name;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constructs a <code>EthStakeExtra</code> from a plain JavaScript object, optionally creating a new instance.
|
|
61
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
62
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
63
|
+
* @param {module:model/EthStakeExtra} obj Optional instance to populate.
|
|
64
|
+
* @return {module:model/EthStakeExtra} The populated <code>EthStakeExtra</code> instance.
|
|
65
|
+
*/
|
|
66
|
+
}, {
|
|
67
|
+
key: "constructFromObject",
|
|
68
|
+
value: function constructFromObject(data, obj) {
|
|
69
|
+
if (data) {
|
|
70
|
+
obj = obj || new EthStakeExtra();
|
|
71
|
+
_BaseStakeExtra["default"].constructFromObject(data, obj);
|
|
72
|
+
if (data.hasOwnProperty('pool_type')) {
|
|
73
|
+
obj['pool_type'] = _StakingPoolType["default"].constructFromObject(data['pool_type']);
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('provider_name')) {
|
|
76
|
+
obj['provider_name'] = _ApiClient["default"].convertToType(data['provider_name'], 'String');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return obj;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Validates the JSON data with respect to <code>EthStakeExtra</code>.
|
|
84
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
85
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>EthStakeExtra</code>.
|
|
86
|
+
*/
|
|
87
|
+
}, {
|
|
88
|
+
key: "validateJSON",
|
|
89
|
+
value: function validateJSON(data) {
|
|
90
|
+
// check to make sure all required properties are present in the JSON string
|
|
91
|
+
var _iterator = _createForOfIteratorHelper(EthStakeExtra.RequiredProperties),
|
|
92
|
+
_step;
|
|
93
|
+
try {
|
|
94
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
95
|
+
var property = _step.value;
|
|
96
|
+
if (!data.hasOwnProperty(property)) {
|
|
97
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// ensure the json data is a string
|
|
101
|
+
} catch (err) {
|
|
102
|
+
_iterator.e(err);
|
|
103
|
+
} finally {
|
|
104
|
+
_iterator.f();
|
|
105
|
+
}
|
|
106
|
+
if (data['provider_name'] && !(typeof data['provider_name'] === 'string' || data['provider_name'] instanceof String)) {
|
|
107
|
+
throw new Error("Expected the field `provider_name` to be a primitive type in the JSON string but got " + data['provider_name']);
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
}]);
|
|
112
|
+
}();
|
|
113
|
+
EthStakeExtra.RequiredProperties = ["pool_type", "provider_name"];
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @member {module:model/StakingPoolType} pool_type
|
|
117
|
+
*/
|
|
118
|
+
EthStakeExtra.prototype['pool_type'] = undefined;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The name of the provider.
|
|
122
|
+
* @member {String} provider_name
|
|
123
|
+
*/
|
|
124
|
+
EthStakeExtra.prototype['provider_name'] = undefined;
|
|
125
|
+
|
|
126
|
+
// Implement BaseStakeExtra interface:
|
|
127
|
+
/**
|
|
128
|
+
* @member {module:model/StakingPoolType} pool_type
|
|
129
|
+
*/
|
|
130
|
+
_BaseStakeExtra["default"].prototype['pool_type'] = undefined;
|
|
131
|
+
var _default = exports["default"] = EthStakeExtra;
|
|
@@ -0,0 +1,131 @@
|
|
|
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 EthStakingExtra model module.
|
|
31
|
+
* @module model/EthStakingExtra
|
|
32
|
+
*/
|
|
33
|
+
var EthStakingExtra = /*#__PURE__*/function () {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new <code>EthStakingExtra</code>.
|
|
36
|
+
* @alias module:model/EthStakingExtra
|
|
37
|
+
* @implements module:model/BaseStakeExtra
|
|
38
|
+
* @param pool_type {module:model/StakingPoolType}
|
|
39
|
+
* @param pos_chain {String} The Proof-of-Stake (PoS) chain.
|
|
40
|
+
*/
|
|
41
|
+
function EthStakingExtra(pool_type, pos_chain) {
|
|
42
|
+
_classCallCheck(this, EthStakingExtra);
|
|
43
|
+
_BaseStakeExtra["default"].initialize(this, pool_type);
|
|
44
|
+
EthStakingExtra.initialize(this, pool_type, pos_chain);
|
|
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(EthStakingExtra, null, [{
|
|
53
|
+
key: "initialize",
|
|
54
|
+
value: function initialize(obj, pool_type, pos_chain) {
|
|
55
|
+
obj['pool_type'] = pool_type;
|
|
56
|
+
obj['pos_chain'] = pos_chain;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constructs a <code>EthStakingExtra</code> from a plain JavaScript object, optionally creating a new instance.
|
|
61
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
62
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
63
|
+
* @param {module:model/EthStakingExtra} obj Optional instance to populate.
|
|
64
|
+
* @return {module:model/EthStakingExtra} The populated <code>EthStakingExtra</code> instance.
|
|
65
|
+
*/
|
|
66
|
+
}, {
|
|
67
|
+
key: "constructFromObject",
|
|
68
|
+
value: function constructFromObject(data, obj) {
|
|
69
|
+
if (data) {
|
|
70
|
+
obj = obj || new EthStakingExtra();
|
|
71
|
+
_BaseStakeExtra["default"].constructFromObject(data, obj);
|
|
72
|
+
if (data.hasOwnProperty('pool_type')) {
|
|
73
|
+
obj['pool_type'] = _StakingPoolType["default"].constructFromObject(data['pool_type']);
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('pos_chain')) {
|
|
76
|
+
obj['pos_chain'] = _ApiClient["default"].convertToType(data['pos_chain'], 'String');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return obj;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Validates the JSON data with respect to <code>EthStakingExtra</code>.
|
|
84
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
85
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>EthStakingExtra</code>.
|
|
86
|
+
*/
|
|
87
|
+
}, {
|
|
88
|
+
key: "validateJSON",
|
|
89
|
+
value: function validateJSON(data) {
|
|
90
|
+
// check to make sure all required properties are present in the JSON string
|
|
91
|
+
var _iterator = _createForOfIteratorHelper(EthStakingExtra.RequiredProperties),
|
|
92
|
+
_step;
|
|
93
|
+
try {
|
|
94
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
95
|
+
var property = _step.value;
|
|
96
|
+
if (!data.hasOwnProperty(property)) {
|
|
97
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// ensure the json data is a string
|
|
101
|
+
} catch (err) {
|
|
102
|
+
_iterator.e(err);
|
|
103
|
+
} finally {
|
|
104
|
+
_iterator.f();
|
|
105
|
+
}
|
|
106
|
+
if (data['pos_chain'] && !(typeof data['pos_chain'] === 'string' || data['pos_chain'] instanceof String)) {
|
|
107
|
+
throw new Error("Expected the field `pos_chain` to be a primitive type in the JSON string but got " + data['pos_chain']);
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
}]);
|
|
112
|
+
}();
|
|
113
|
+
EthStakingExtra.RequiredProperties = ["pool_type", "pos_chain"];
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @member {module:model/StakingPoolType} pool_type
|
|
117
|
+
*/
|
|
118
|
+
EthStakingExtra.prototype['pool_type'] = undefined;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The Proof-of-Stake (PoS) chain.
|
|
122
|
+
* @member {String} pos_chain
|
|
123
|
+
*/
|
|
124
|
+
EthStakingExtra.prototype['pos_chain'] = undefined;
|
|
125
|
+
|
|
126
|
+
// Implement BaseStakeExtra interface:
|
|
127
|
+
/**
|
|
128
|
+
* @member {module:model/StakingPoolType} pool_type
|
|
129
|
+
*/
|
|
130
|
+
_BaseStakeExtra["default"].prototype['pool_type'] = undefined;
|
|
131
|
+
var _default = exports["default"] = EthStakingExtra;
|
|
@@ -0,0 +1,131 @@
|
|
|
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 EthUnstakeExtra model module.
|
|
31
|
+
* @module model/EthUnstakeExtra
|
|
32
|
+
*/
|
|
33
|
+
var EthUnstakeExtra = /*#__PURE__*/function () {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new <code>EthUnstakeExtra</code>.
|
|
36
|
+
* @alias module:model/EthUnstakeExtra
|
|
37
|
+
* @implements module:model/BaseStakeExtra
|
|
38
|
+
* @param pool_type {module:model/StakingPoolType}
|
|
39
|
+
* @param validator_pubkeys {Array.<String>} A list of public keys identifying the validators to unstake from the Ethereum Beacon Chain.
|
|
40
|
+
*/
|
|
41
|
+
function EthUnstakeExtra(pool_type, validator_pubkeys) {
|
|
42
|
+
_classCallCheck(this, EthUnstakeExtra);
|
|
43
|
+
_BaseStakeExtra["default"].initialize(this, pool_type);
|
|
44
|
+
EthUnstakeExtra.initialize(this, pool_type, validator_pubkeys);
|
|
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(EthUnstakeExtra, null, [{
|
|
53
|
+
key: "initialize",
|
|
54
|
+
value: function initialize(obj, pool_type, validator_pubkeys) {
|
|
55
|
+
obj['pool_type'] = pool_type;
|
|
56
|
+
obj['validator_pubkeys'] = validator_pubkeys;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constructs a <code>EthUnstakeExtra</code> from a plain JavaScript object, optionally creating a new instance.
|
|
61
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
62
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
63
|
+
* @param {module:model/EthUnstakeExtra} obj Optional instance to populate.
|
|
64
|
+
* @return {module:model/EthUnstakeExtra} The populated <code>EthUnstakeExtra</code> instance.
|
|
65
|
+
*/
|
|
66
|
+
}, {
|
|
67
|
+
key: "constructFromObject",
|
|
68
|
+
value: function constructFromObject(data, obj) {
|
|
69
|
+
if (data) {
|
|
70
|
+
obj = obj || new EthUnstakeExtra();
|
|
71
|
+
_BaseStakeExtra["default"].constructFromObject(data, obj);
|
|
72
|
+
if (data.hasOwnProperty('pool_type')) {
|
|
73
|
+
obj['pool_type'] = _StakingPoolType["default"].constructFromObject(data['pool_type']);
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('validator_pubkeys')) {
|
|
76
|
+
obj['validator_pubkeys'] = _ApiClient["default"].convertToType(data['validator_pubkeys'], ['String']);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return obj;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Validates the JSON data with respect to <code>EthUnstakeExtra</code>.
|
|
84
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
85
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>EthUnstakeExtra</code>.
|
|
86
|
+
*/
|
|
87
|
+
}, {
|
|
88
|
+
key: "validateJSON",
|
|
89
|
+
value: function validateJSON(data) {
|
|
90
|
+
// check to make sure all required properties are present in the JSON string
|
|
91
|
+
var _iterator = _createForOfIteratorHelper(EthUnstakeExtra.RequiredProperties),
|
|
92
|
+
_step;
|
|
93
|
+
try {
|
|
94
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
95
|
+
var property = _step.value;
|
|
96
|
+
if (!data.hasOwnProperty(property)) {
|
|
97
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// ensure the json data is an array
|
|
101
|
+
} catch (err) {
|
|
102
|
+
_iterator.e(err);
|
|
103
|
+
} finally {
|
|
104
|
+
_iterator.f();
|
|
105
|
+
}
|
|
106
|
+
if (!Array.isArray(data['validator_pubkeys'])) {
|
|
107
|
+
throw new Error("Expected the field `validator_pubkeys` to be an array in the JSON data but got " + data['validator_pubkeys']);
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
}]);
|
|
112
|
+
}();
|
|
113
|
+
EthUnstakeExtra.RequiredProperties = ["pool_type", "validator_pubkeys"];
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @member {module:model/StakingPoolType} pool_type
|
|
117
|
+
*/
|
|
118
|
+
EthUnstakeExtra.prototype['pool_type'] = undefined;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* A list of public keys identifying the validators to unstake from the Ethereum Beacon Chain.
|
|
122
|
+
* @member {Array.<String>} validator_pubkeys
|
|
123
|
+
*/
|
|
124
|
+
EthUnstakeExtra.prototype['validator_pubkeys'] = undefined;
|
|
125
|
+
|
|
126
|
+
// Implement BaseStakeExtra interface:
|
|
127
|
+
/**
|
|
128
|
+
* @member {module:model/StakingPoolType} pool_type
|
|
129
|
+
*/
|
|
130
|
+
_BaseStakeExtra["default"].prototype['pool_type'] = undefined;
|
|
131
|
+
var _default = exports["default"] = EthUnstakeExtra;
|
|
@@ -82,7 +82,6 @@ var FeeGasLimit = /*#__PURE__*/function () {
|
|
|
82
82
|
/**
|
|
83
83
|
* 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.
|
|
84
84
|
* @member {String} gas_limit
|
|
85
|
-
* @default '21000'
|
|
86
85
|
*/
|
|
87
|
-
FeeGasLimit.prototype['gas_limit'] =
|
|
86
|
+
FeeGasLimit.prototype['gas_limit'] = undefined;
|
|
88
87
|
var _default = exports["default"] = FeeGasLimit;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _RoleScopes = _interopRequireDefault(require("./RoleScopes"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
15
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
16
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
19
|
+
* Cobo Wallet as a Service 2.0
|
|
20
|
+
*
|
|
21
|
+
* Contact: help@cobo.com
|
|
22
|
+
*
|
|
23
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
24
|
+
* https://openapi-generator.tech
|
|
25
|
+
* Do not edit the class manually.
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* The GetApiKeyInfo200Response model module.
|
|
30
|
+
* @module model/GetApiKeyInfo200Response
|
|
31
|
+
*/
|
|
32
|
+
var GetApiKeyInfo200Response = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>GetApiKeyInfo200Response</code>.
|
|
35
|
+
* @alias module:model/GetApiKeyInfo200Response
|
|
36
|
+
* @param name {String} The API key name.
|
|
37
|
+
* @param curve_type {module:model/GetApiKeyInfo200Response.CurveTypeEnum} The curve type used for the API key, which determines the cryptographic algorithm for key generation and signing. Possible values include: - `ED25519`: Ed25519 - `SECP256K1`: Secp256k1
|
|
38
|
+
* @param key {String} The API key value.
|
|
39
|
+
* @param created_timestamp {Number} The time when the API key was registered, in Unix timestamp format, measured in milliseconds.
|
|
40
|
+
* @param updated_timestamp {Number} The time when the API key information was last updated, in Unix timestamp format, measured in milliseconds.
|
|
41
|
+
*/
|
|
42
|
+
function GetApiKeyInfo200Response(name, curve_type, key, created_timestamp, updated_timestamp) {
|
|
43
|
+
_classCallCheck(this, GetApiKeyInfo200Response);
|
|
44
|
+
GetApiKeyInfo200Response.initialize(this, name, curve_type, key, created_timestamp, updated_timestamp);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Initializes the fields of this object.
|
|
49
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
50
|
+
* Only for internal use.
|
|
51
|
+
*/
|
|
52
|
+
return _createClass(GetApiKeyInfo200Response, null, [{
|
|
53
|
+
key: "initialize",
|
|
54
|
+
value: function initialize(obj, name, curve_type, key, created_timestamp, updated_timestamp) {
|
|
55
|
+
obj['name'] = name;
|
|
56
|
+
obj['curve_type'] = curve_type;
|
|
57
|
+
obj['key'] = key;
|
|
58
|
+
obj['created_timestamp'] = created_timestamp;
|
|
59
|
+
obj['updated_timestamp'] = updated_timestamp;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Constructs a <code>GetApiKeyInfo200Response</code> from a plain JavaScript object, optionally creating a new instance.
|
|
64
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
65
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
66
|
+
* @param {module:model/GetApiKeyInfo200Response} obj Optional instance to populate.
|
|
67
|
+
* @return {module:model/GetApiKeyInfo200Response} The populated <code>GetApiKeyInfo200Response</code> instance.
|
|
68
|
+
*/
|
|
69
|
+
}, {
|
|
70
|
+
key: "constructFromObject",
|
|
71
|
+
value: function constructFromObject(data, obj) {
|
|
72
|
+
if (data) {
|
|
73
|
+
obj = obj || new GetApiKeyInfo200Response();
|
|
74
|
+
if (data.hasOwnProperty('name')) {
|
|
75
|
+
obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('curve_type')) {
|
|
78
|
+
obj['curve_type'] = _ApiClient["default"].convertToType(data['curve_type'], 'String');
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('key')) {
|
|
81
|
+
obj['key'] = _ApiClient["default"].convertToType(data['key'], 'String');
|
|
82
|
+
}
|
|
83
|
+
if (data.hasOwnProperty('callback_url')) {
|
|
84
|
+
obj['callback_url'] = _ApiClient["default"].convertToType(data['callback_url'], 'String');
|
|
85
|
+
}
|
|
86
|
+
if (data.hasOwnProperty('valid_ips')) {
|
|
87
|
+
obj['valid_ips'] = _ApiClient["default"].convertToType(data['valid_ips'], ['String']);
|
|
88
|
+
}
|
|
89
|
+
if (data.hasOwnProperty('created_timestamp')) {
|
|
90
|
+
obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
|
|
91
|
+
}
|
|
92
|
+
if (data.hasOwnProperty('updated_timestamp')) {
|
|
93
|
+
obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
|
|
94
|
+
}
|
|
95
|
+
if (data.hasOwnProperty('expired_timestamp')) {
|
|
96
|
+
obj['expired_timestamp'] = _ApiClient["default"].convertToType(data['expired_timestamp'], 'Number');
|
|
97
|
+
}
|
|
98
|
+
if (data.hasOwnProperty('role_scopes')) {
|
|
99
|
+
obj['role_scopes'] = _ApiClient["default"].convertToType(data['role_scopes'], [_RoleScopes["default"]]);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return obj;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Validates the JSON data with respect to <code>GetApiKeyInfo200Response</code>.
|
|
107
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
108
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>GetApiKeyInfo200Response</code>.
|
|
109
|
+
*/
|
|
110
|
+
}, {
|
|
111
|
+
key: "validateJSON",
|
|
112
|
+
value: function validateJSON(data) {
|
|
113
|
+
// check to make sure all required properties are present in the JSON string
|
|
114
|
+
var _iterator = _createForOfIteratorHelper(GetApiKeyInfo200Response.RequiredProperties),
|
|
115
|
+
_step;
|
|
116
|
+
try {
|
|
117
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
118
|
+
var property = _step.value;
|
|
119
|
+
if (!data.hasOwnProperty(property)) {
|
|
120
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// ensure the json data is a string
|
|
124
|
+
} catch (err) {
|
|
125
|
+
_iterator.e(err);
|
|
126
|
+
} finally {
|
|
127
|
+
_iterator.f();
|
|
128
|
+
}
|
|
129
|
+
if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
|
|
130
|
+
throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
|
|
131
|
+
}
|
|
132
|
+
// ensure the json data is a string
|
|
133
|
+
if (data['curve_type'] && !(typeof data['curve_type'] === 'string' || data['curve_type'] instanceof String)) {
|
|
134
|
+
throw new Error("Expected the field `curve_type` to be a primitive type in the JSON string but got " + data['curve_type']);
|
|
135
|
+
}
|
|
136
|
+
// ensure the json data is a string
|
|
137
|
+
if (data['key'] && !(typeof data['key'] === 'string' || data['key'] instanceof String)) {
|
|
138
|
+
throw new Error("Expected the field `key` to be a primitive type in the JSON string but got " + data['key']);
|
|
139
|
+
}
|
|
140
|
+
// ensure the json data is a string
|
|
141
|
+
if (data['callback_url'] && !(typeof data['callback_url'] === 'string' || data['callback_url'] instanceof String)) {
|
|
142
|
+
throw new Error("Expected the field `callback_url` to be a primitive type in the JSON string but got " + data['callback_url']);
|
|
143
|
+
}
|
|
144
|
+
// ensure the json data is an array
|
|
145
|
+
if (!Array.isArray(data['valid_ips'])) {
|
|
146
|
+
throw new Error("Expected the field `valid_ips` to be an array in the JSON data but got " + data['valid_ips']);
|
|
147
|
+
}
|
|
148
|
+
if (data['role_scopes']) {
|
|
149
|
+
// data not null
|
|
150
|
+
// ensure the json data is an array
|
|
151
|
+
if (!Array.isArray(data['role_scopes'])) {
|
|
152
|
+
throw new Error("Expected the field `role_scopes` to be an array in the JSON data but got " + data['role_scopes']);
|
|
153
|
+
}
|
|
154
|
+
// validate the optional field `role_scopes` (array)
|
|
155
|
+
var _iterator2 = _createForOfIteratorHelper(data['role_scopes']),
|
|
156
|
+
_step2;
|
|
157
|
+
try {
|
|
158
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
159
|
+
var item = _step2.value;
|
|
160
|
+
_RoleScopes["default"].validateJSON(item);
|
|
161
|
+
}
|
|
162
|
+
} catch (err) {
|
|
163
|
+
_iterator2.e(err);
|
|
164
|
+
} finally {
|
|
165
|
+
_iterator2.f();
|
|
166
|
+
}
|
|
167
|
+
;
|
|
168
|
+
}
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
}]);
|
|
172
|
+
}();
|
|
173
|
+
GetApiKeyInfo200Response.RequiredProperties = ["name", "curve_type", "key", "created_timestamp", "updated_timestamp"];
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The API key name.
|
|
177
|
+
* @member {String} name
|
|
178
|
+
*/
|
|
179
|
+
GetApiKeyInfo200Response.prototype['name'] = undefined;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* The curve type used for the API key, which determines the cryptographic algorithm for key generation and signing. Possible values include: - `ED25519`: Ed25519 - `SECP256K1`: Secp256k1
|
|
183
|
+
* @member {module:model/GetApiKeyInfo200Response.CurveTypeEnum} curve_type
|
|
184
|
+
*/
|
|
185
|
+
GetApiKeyInfo200Response.prototype['curve_type'] = undefined;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* The API key value.
|
|
189
|
+
* @member {String} key
|
|
190
|
+
*/
|
|
191
|
+
GetApiKeyInfo200Response.prototype['key'] = undefined;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The URL of the callback endpoint that receives callback messages triggered by this API key.
|
|
195
|
+
* @member {String} callback_url
|
|
196
|
+
*/
|
|
197
|
+
GetApiKeyInfo200Response.prototype['callback_url'] = undefined;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* (Applicable to permanent API keys only) The list of IP addresses that are allowed to use this API key.
|
|
201
|
+
* @member {Array.<String>} valid_ips
|
|
202
|
+
*/
|
|
203
|
+
GetApiKeyInfo200Response.prototype['valid_ips'] = undefined;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The time when the API key was registered, in Unix timestamp format, measured in milliseconds.
|
|
207
|
+
* @member {Number} created_timestamp
|
|
208
|
+
*/
|
|
209
|
+
GetApiKeyInfo200Response.prototype['created_timestamp'] = undefined;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The time when the API key information was last updated, in Unix timestamp format, measured in milliseconds.
|
|
213
|
+
* @member {Number} updated_timestamp
|
|
214
|
+
*/
|
|
215
|
+
GetApiKeyInfo200Response.prototype['updated_timestamp'] = undefined;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* The time when the API key expires, in Unix timestamp format, measured in milliseconds. For permanent API keys, this property value is `null`.
|
|
219
|
+
* @member {Number} expired_timestamp
|
|
220
|
+
*/
|
|
221
|
+
GetApiKeyInfo200Response.prototype['expired_timestamp'] = undefined;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The list of user roles and wallet scopes associated with the API key.
|
|
225
|
+
* @member {Array.<module:model/RoleScopes>} role_scopes
|
|
226
|
+
*/
|
|
227
|
+
GetApiKeyInfo200Response.prototype['role_scopes'] = undefined;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Allowed values for the <code>curve_type</code> property.
|
|
231
|
+
* @enum {String}
|
|
232
|
+
* @readonly
|
|
233
|
+
*/
|
|
234
|
+
GetApiKeyInfo200Response['CurveTypeEnum'] = {
|
|
235
|
+
/**
|
|
236
|
+
* value: "ED25519"
|
|
237
|
+
* @const
|
|
238
|
+
*/
|
|
239
|
+
"ED25519": "ED25519",
|
|
240
|
+
/**
|
|
241
|
+
* value: "SECP256K1"
|
|
242
|
+
* @const
|
|
243
|
+
*/
|
|
244
|
+
"SECP256K1": "SECP256K1",
|
|
245
|
+
/**
|
|
246
|
+
* value: "unknown_default_open_api"
|
|
247
|
+
* @const
|
|
248
|
+
*/
|
|
249
|
+
"unknown_default_open_api": "unknown_default_open_api"
|
|
250
|
+
};
|
|
251
|
+
var _default = exports["default"] = GetApiKeyInfo200Response;
|