@cobo/cobo-waas2 1.8.0 → 1.9.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 +78 -30
- package/dist/ApiClient.js +11 -1
- package/dist/api/AddressBooksApi.js +1 -1
- package/dist/api/DevelopersApi.js +3 -3
- package/dist/api/DevelopersWebhooksApi.js +8 -8
- package/dist/api/PrimeBrokerApi.js +317 -0
- package/dist/api/StakingsApi.js +12 -12
- package/dist/api/TransactionsApi.js +60 -16
- package/dist/api/TravelRuleApi.js +18 -18
- package/dist/api/WalletsApi.js +84 -13
- package/dist/api/WalletsExchangeWalletApi.js +1 -1
- package/dist/api/WalletsMPCWalletsApi.js +151 -39
- package/dist/api/WalletsSmartContractWalletsApi.js +1 -1
- package/dist/index.js +112 -7
- package/dist/model/ActivityExtra.js +5 -5
- package/dist/model/AddressBalance.js +129 -0
- package/dist/model/AddressTransferDestination.js +36 -0
- package/dist/model/ApprovalStatementStatus.js +81 -0
- package/dist/model/AssetBalance.js +6 -6
- package/dist/model/BTCEIP191MessageSignDestination.js +122 -0
- package/dist/model/BabylonStakingActivityDetailExtra.js +1 -1
- package/dist/model/{TokenBalanceBalance.js → Balance.js} +22 -22
- package/dist/model/ChangeGuardPubkey200Response.js +110 -0
- package/dist/model/ContractCallParams.js +36 -0
- package/dist/model/CoreStakingActivityDetailExtra.js +3 -3
- package/dist/model/CreateAddressRequest.js +28 -2
- package/dist/model/CreatePrimeBrokerAddress201Response.js +140 -0
- package/dist/model/CreatePrimeBrokerAddressRequest.js +107 -0
- package/dist/model/DeleteGuardPubkey201Response.js +110 -0
- package/dist/model/EthStakeEstimatedFee.js +1 -1
- package/dist/model/EthStakingActivityDetailExtra.js +1 -1
- package/dist/model/GetStakingEstimationFee201Response.js +1 -1
- package/dist/model/GetTransactionLimitation200Response.js +4 -4
- package/dist/model/GuardPubkeyStatus.js +91 -0
- package/dist/model/ListAddressBalancesByToken200Response.js +123 -0
- package/dist/model/ListKeyShareHolders200Response.js +123 -0
- package/dist/model/MessageSignDestination.js +70 -8
- package/dist/model/MessageSignDestinationType.js +12 -2
- package/dist/model/OrgInfo.js +3 -3
- package/dist/model/QueryApprovalStatement200Response.js +122 -0
- package/dist/model/QueryGuardPubkey200Response.js +129 -0
- package/dist/model/QueryGuardPubkey200ResponseAddressesInner.js +125 -0
- package/dist/model/RootPubkey.js +1 -1
- package/dist/model/SelfCustodyWallet.js +7 -7
- package/dist/model/SubWalletAssetBalance.js +6 -6
- package/dist/model/SubmitDepositTravelRuleInfo201Response.js +1 -1
- package/dist/model/TSSGroups.js +1 -1
- package/dist/model/TokenBalance.js +6 -6
- package/dist/model/TransactionDepositToAddressDestination.js +16 -0
- package/dist/model/TransactionDepositToAddressDestinationTxInfo.js +83 -0
- package/dist/model/TransactionDestination.js +6 -0
- package/dist/model/TransactionRawTxInfo.js +13 -0
- package/dist/model/TransactionSubStatus.js +5 -0
- package/dist/model/TransactionUserApprovalDetail.js +3 -3
- package/dist/model/TransferDestination.js +6 -0
- package/dist/model/TransferParams.js +36 -0
- package/dist/model/TravelRuleDepositExchangesOrVASP.js +4 -4
- package/dist/model/TravelRuleDepositExchangesOrVASPEntityInfo.js +7 -7
- package/dist/model/TravelRuleDepositLegalEntity.js +5 -5
- package/dist/model/TravelRuleDepositNaturalEntity.js +9 -9
- package/dist/model/TravelRuleDepositRequestTravelRuleInfo.js +5 -5
- package/dist/model/TravelRuleWithdrawExchangesOrVASP.js +3 -3
- package/dist/model/TravelRuleWithdrawExchangesOrVASPEntityInfo.js +5 -5
- package/dist/model/TravelRuleWithdrawLegalEntity.js +2 -2
- package/dist/model/TravelRuleWithdrawNaturalEntity.js +7 -7
- package/dist/model/TravelRuleWithdrawRequestTravelRuleInfo.js +4 -4
- package/dist/model/Vasp.js +7 -7
- package/docs/ActivityExtra.md +5 -5
- package/docs/AddressBalance.md +10 -0
- package/docs/AddressBooksApi.md +1 -1
- package/docs/AddressTransferDestination.md +14 -0
- package/docs/ApprovalStatementStatus.md +20 -0
- package/docs/AssetBalance.md +1 -1
- package/docs/BTCEIP191MessageSignDestination.md +10 -0
- package/docs/BabylonStakingActivityDetailExtra.md +1 -1
- package/docs/{TokenBalanceBalance.md → Balance.md} +1 -1
- package/docs/ChangeGuardPubkey200Response.md +9 -0
- package/docs/ContractCallParams.md +14 -0
- package/docs/CoreStakingActivityDetailExtra.md +3 -3
- package/docs/CreateAddressRequest.md +3 -1
- package/docs/CreatePrimeBrokerAddress201Response.md +10 -0
- package/docs/CreatePrimeBrokerAddressRequest.md +9 -0
- package/docs/DeleteGuardPubkey201Response.md +9 -0
- package/docs/DevelopersApi.md +3 -3
- package/docs/DevelopersWebhooksApi.md +8 -8
- package/docs/EthStakeEstimatedFee.md +1 -1
- package/docs/EthStakingActivityDetailExtra.md +1 -1
- package/docs/GetStakingEstimationFee201Response.md +1 -1
- package/docs/GetTransactionLimitation200Response.md +4 -4
- package/docs/GuardPubkeyStatus.md +24 -0
- package/docs/ListAddressBalancesByToken200Response.md +10 -0
- package/docs/ListKeyShareHolders200Response.md +10 -0
- package/docs/MessageSignDestination.md +1 -0
- package/docs/MessageSignDestinationType.md +6 -2
- package/docs/OrgInfo.md +1 -1
- package/docs/PrimeBrokerApi.md +318 -0
- package/docs/QueryApprovalStatement200Response.md +12 -0
- package/docs/QueryGuardPubkey200Response.md +11 -0
- package/docs/QueryGuardPubkey200ResponseAddressesInner.md +10 -0
- package/docs/RootPubkey.md +1 -1
- package/docs/SelfCustodyWallet.md +3 -3
- package/docs/StakingsApi.md +12 -12
- package/docs/SubWalletAssetBalance.md +1 -1
- package/docs/SubmitDepositTravelRuleInfo201Response.md +1 -1
- package/docs/TSSGroups.md +1 -1
- package/docs/TokenBalance.md +1 -1
- package/docs/TransactionDepositToAddressDestination.md +1 -0
- package/docs/TransactionDepositToAddressDestinationTxInfo.md +9 -0
- package/docs/TransactionDestination.md +1 -0
- package/docs/TransactionRawTxInfo.md +1 -0
- package/docs/TransactionSubStatus.md +2 -0
- package/docs/TransactionUserApprovalDetail.md +3 -3
- package/docs/TransactionsApi.md +66 -15
- package/docs/TransferDestination.md +14 -0
- package/docs/TransferParams.md +14 -0
- package/docs/TravelRuleApi.md +13 -13
- package/docs/TravelRuleDepositExchangesOrVASP.md +2 -2
- package/docs/TravelRuleDepositExchangesOrVASPEntityInfo.md +7 -7
- package/docs/TravelRuleDepositLegalEntity.md +3 -3
- package/docs/TravelRuleDepositNaturalEntity.md +5 -5
- package/docs/TravelRuleDepositRequestTravelRuleInfo.md +5 -5
- package/docs/TravelRuleWithdrawExchangesOrVASP.md +1 -1
- package/docs/TravelRuleWithdrawExchangesOrVASPEntityInfo.md +5 -5
- package/docs/TravelRuleWithdrawLegalEntity.md +1 -1
- package/docs/TravelRuleWithdrawNaturalEntity.md +4 -4
- package/docs/TravelRuleWithdrawRequestTravelRuleInfo.md +4 -4
- package/docs/Vasp.md +3 -3
- package/docs/WalletsApi.md +78 -13
- package/docs/WalletsExchangeWalletApi.md +1 -1
- package/docs/WalletsMPCWalletsApi.md +141 -27
- package/docs/WalletsSmartContractWalletsApi.md +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,122 @@
|
|
|
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 _MessageSignDestinationType = _interopRequireDefault(require("./MessageSignDestinationType"));
|
|
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 BTCEIP191MessageSignDestination model module.
|
|
30
|
+
* @module model/BTCEIP191MessageSignDestination
|
|
31
|
+
*/
|
|
32
|
+
var BTCEIP191MessageSignDestination = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>BTCEIP191MessageSignDestination</code>.
|
|
35
|
+
* The information about the destination `BTC_EIP_191_Signature`. Refer to [Transaction sources and destinations](/v2/guides/transactions/sources-and-destinations) for a detailed introduction about the supported sources and destinations for each transaction type.
|
|
36
|
+
* @alias module:model/BTCEIP191MessageSignDestination
|
|
37
|
+
* @param destination_type {module:model/MessageSignDestinationType}
|
|
38
|
+
* @param message {String} The raw data of the message to be signed, encoded in Base64 format.
|
|
39
|
+
*/
|
|
40
|
+
function BTCEIP191MessageSignDestination(destination_type, message) {
|
|
41
|
+
_classCallCheck(this, BTCEIP191MessageSignDestination);
|
|
42
|
+
BTCEIP191MessageSignDestination.initialize(this, destination_type, message);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Initializes the fields of this object.
|
|
47
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
48
|
+
* Only for internal use.
|
|
49
|
+
*/
|
|
50
|
+
return _createClass(BTCEIP191MessageSignDestination, null, [{
|
|
51
|
+
key: "initialize",
|
|
52
|
+
value: function initialize(obj, destination_type, message) {
|
|
53
|
+
obj['destination_type'] = destination_type;
|
|
54
|
+
obj['message'] = message;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Constructs a <code>BTCEIP191MessageSignDestination</code> from a plain JavaScript object, optionally creating a new instance.
|
|
59
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
60
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
61
|
+
* @param {module:model/BTCEIP191MessageSignDestination} obj Optional instance to populate.
|
|
62
|
+
* @return {module:model/BTCEIP191MessageSignDestination} The populated <code>BTCEIP191MessageSignDestination</code> instance.
|
|
63
|
+
*/
|
|
64
|
+
}, {
|
|
65
|
+
key: "constructFromObject",
|
|
66
|
+
value: function constructFromObject(data, obj) {
|
|
67
|
+
if (data) {
|
|
68
|
+
obj = obj || new BTCEIP191MessageSignDestination();
|
|
69
|
+
if (data.hasOwnProperty('destination_type')) {
|
|
70
|
+
obj['destination_type'] = _MessageSignDestinationType["default"].constructFromObject(data['destination_type']);
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('message')) {
|
|
73
|
+
obj['message'] = _ApiClient["default"].convertToType(data['message'], 'String');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return obj;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Validates the JSON data with respect to <code>BTCEIP191MessageSignDestination</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>BTCEIP191MessageSignDestination</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(BTCEIP191MessageSignDestination.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['message'] && !(typeof data['message'] === 'string' || data['message'] instanceof String)) {
|
|
104
|
+
throw new Error("Expected the field `message` to be a primitive type in the JSON string but got " + data['message']);
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
}]);
|
|
109
|
+
}();
|
|
110
|
+
BTCEIP191MessageSignDestination.RequiredProperties = ["destination_type", "message"];
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @member {module:model/MessageSignDestinationType} destination_type
|
|
114
|
+
*/
|
|
115
|
+
BTCEIP191MessageSignDestination.prototype['destination_type'] = undefined;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The raw data of the message to be signed, encoded in Base64 format.
|
|
119
|
+
* @member {String} message
|
|
120
|
+
*/
|
|
121
|
+
BTCEIP191MessageSignDestination.prototype['message'] = undefined;
|
|
122
|
+
var _default = exports["default"] = BTCEIP191MessageSignDestination;
|
|
@@ -141,7 +141,7 @@ BabylonStakingActivityDetailExtra.prototype['finality_provider_public_key'] = un
|
|
|
141
141
|
BabylonStakingActivityDetailExtra.prototype['stake_block_time'] = undefined;
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* Whether to automatically broadcast the transaction. - `true`: Automatically broadcast the transaction. - `false`: The transaction will not be submitted to the blockchain automatically. You can call [Broadcast signed transactions](/v2/api-references/transactions/broadcast-signed-transactions) to broadcast the transaction to the blockchain, or retrieve the signed raw transaction data `raw_tx` by calling [Get transaction information](/v2/api-references/transactions/get-transaction-information) and broadcast it yourself.
|
|
144
|
+
* Whether to automatically broadcast the transaction. - `true`: Automatically broadcast the transaction. - `false`: The transaction will not be submitted to the blockchain automatically. You can call [Broadcast signed transactions](https://www.cobo.com/developers/v2/api-references/transactions/broadcast-signed-transactions) to broadcast the transaction to the blockchain, or retrieve the signed raw transaction data `raw_tx` by calling [Get transaction information](https://www.cobo.com/developers/v2/api-references/transactions/get-transaction-information) and broadcast it yourself.
|
|
145
145
|
* @member {Boolean} auto_broadcast
|
|
146
146
|
*/
|
|
147
147
|
BabylonStakingActivityDetailExtra.prototype['auto_broadcast'] = undefined;
|
|
@@ -25,20 +25,20 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
25
25
|
*
|
|
26
26
|
*/
|
|
27
27
|
/**
|
|
28
|
-
* The
|
|
29
|
-
* @module model/
|
|
28
|
+
* The Balance model module.
|
|
29
|
+
* @module model/Balance
|
|
30
30
|
*/
|
|
31
|
-
var
|
|
31
|
+
var Balance = /*#__PURE__*/function () {
|
|
32
32
|
/**
|
|
33
|
-
* Constructs a new <code>
|
|
33
|
+
* Constructs a new <code>Balance</code>.
|
|
34
34
|
* The balance details.
|
|
35
|
-
* @alias module:model/
|
|
35
|
+
* @alias module:model/Balance
|
|
36
36
|
* @param total {String} The current amount of tokens in an address, which is retrieved directly from the network. To learn more, see [Balances and transaction amounts for MPC Wallets](https://www.cobo.com/developers/v2/guides/mpc-wallets/balance-amounts) for more details.
|
|
37
37
|
* @param available {String} The amount of tokens ready to be spent. To learn more, see [Balances and transaction amounts for MPC Wallets](https://www.cobo.com/developers/v2/guides/mpc-wallets/balance-amounts) for more details.
|
|
38
38
|
*/
|
|
39
|
-
function
|
|
40
|
-
_classCallCheck(this,
|
|
41
|
-
|
|
39
|
+
function Balance(total, available) {
|
|
40
|
+
_classCallCheck(this, Balance);
|
|
41
|
+
Balance.initialize(this, total, available);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
@@ -46,7 +46,7 @@ var TokenBalanceBalance = /*#__PURE__*/function () {
|
|
|
46
46
|
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
47
47
|
* Only for internal use.
|
|
48
48
|
*/
|
|
49
|
-
return _createClass(
|
|
49
|
+
return _createClass(Balance, null, [{
|
|
50
50
|
key: "initialize",
|
|
51
51
|
value: function initialize(obj, total, available) {
|
|
52
52
|
obj['total'] = total;
|
|
@@ -54,17 +54,17 @@ var TokenBalanceBalance = /*#__PURE__*/function () {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
* Constructs a <code>
|
|
57
|
+
* Constructs a <code>Balance</code> from a plain JavaScript object, optionally creating a new instance.
|
|
58
58
|
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
59
59
|
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
60
|
-
* @param {module:model/
|
|
61
|
-
* @return {module:model/
|
|
60
|
+
* @param {module:model/Balance} obj Optional instance to populate.
|
|
61
|
+
* @return {module:model/Balance} The populated <code>Balance</code> instance.
|
|
62
62
|
*/
|
|
63
63
|
}, {
|
|
64
64
|
key: "constructFromObject",
|
|
65
65
|
value: function constructFromObject(data, obj) {
|
|
66
66
|
if (data) {
|
|
67
|
-
obj = obj || new
|
|
67
|
+
obj = obj || new Balance();
|
|
68
68
|
if (data.hasOwnProperty('total')) {
|
|
69
69
|
obj['total'] = _ApiClient["default"].convertToType(data['total'], 'String');
|
|
70
70
|
}
|
|
@@ -82,15 +82,15 @@ var TokenBalanceBalance = /*#__PURE__*/function () {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
* Validates the JSON data with respect to <code>
|
|
85
|
+
* Validates the JSON data with respect to <code>Balance</code>.
|
|
86
86
|
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
87
|
-
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>
|
|
87
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>Balance</code>.
|
|
88
88
|
*/
|
|
89
89
|
}, {
|
|
90
90
|
key: "validateJSON",
|
|
91
91
|
value: function validateJSON(data) {
|
|
92
92
|
// check to make sure all required properties are present in the JSON string
|
|
93
|
-
var _iterator = _createForOfIteratorHelper(
|
|
93
|
+
var _iterator = _createForOfIteratorHelper(Balance.RequiredProperties),
|
|
94
94
|
_step;
|
|
95
95
|
try {
|
|
96
96
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -124,31 +124,31 @@ var TokenBalanceBalance = /*#__PURE__*/function () {
|
|
|
124
124
|
}
|
|
125
125
|
}]);
|
|
126
126
|
}();
|
|
127
|
-
|
|
127
|
+
Balance.RequiredProperties = ["total", "available"];
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
130
|
* The current amount of tokens in an address, which is retrieved directly from the network. To learn more, see [Balances and transaction amounts for MPC Wallets](https://www.cobo.com/developers/v2/guides/mpc-wallets/balance-amounts) for more details.
|
|
131
131
|
* @member {String} total
|
|
132
132
|
*/
|
|
133
|
-
|
|
133
|
+
Balance.prototype['total'] = undefined;
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
136
|
* The amount of tokens ready to be spent. To learn more, see [Balances and transaction amounts for MPC Wallets](https://www.cobo.com/developers/v2/guides/mpc-wallets/balance-amounts) for more details.
|
|
137
137
|
* @member {String} available
|
|
138
138
|
*/
|
|
139
|
-
|
|
139
|
+
Balance.prototype['available'] = undefined;
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
142
|
* The total amount being sent in a transaction, which is calculated as the withdrawal amount plus the transaction fee. To learn more, see [Balances and transaction amounts for MPC Wallets](https://www.cobo.com/developers/v2/guides/mpc-wallets/balance-amounts) for more details.
|
|
143
143
|
* @member {String} pending
|
|
144
144
|
* @default '0'
|
|
145
145
|
*/
|
|
146
|
-
|
|
146
|
+
Balance.prototype['pending'] = '0';
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
* For UTXO chains, this is the combined value of the selected UTXOs for the transaction. For other chains, it is equal to the Pending amount. To learn more, see [Balances and transaction amounts for MPC Wallets](https://www.cobo.com/developers/v2/guides/mpc-wallets/balance-amounts) for more details.
|
|
150
150
|
* @member {String} locked
|
|
151
151
|
* @default '0'
|
|
152
152
|
*/
|
|
153
|
-
|
|
154
|
-
var _default = exports["default"] =
|
|
153
|
+
Balance.prototype['locked'] = '0';
|
|
154
|
+
var _default = exports["default"] = Balance;
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
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); }
|
|
10
|
+
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; } } }; }
|
|
11
|
+
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; } }
|
|
12
|
+
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; }
|
|
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 _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
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); } /**
|
|
18
|
+
* Cobo Wallet as a Service 2.0
|
|
19
|
+
*
|
|
20
|
+
* Contact: help@cobo.com
|
|
21
|
+
*
|
|
22
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
23
|
+
* https://openapi-generator.tech
|
|
24
|
+
* Do not edit the class manually.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The ChangeGuardPubkey200Response model module.
|
|
29
|
+
* @module model/ChangeGuardPubkey200Response
|
|
30
|
+
*/
|
|
31
|
+
var ChangeGuardPubkey200Response = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>ChangeGuardPubkey200Response</code>.
|
|
34
|
+
* @alias module:model/ChangeGuardPubkey200Response
|
|
35
|
+
* @param binder_id {String} The binding ID.
|
|
36
|
+
*/
|
|
37
|
+
function ChangeGuardPubkey200Response(binder_id) {
|
|
38
|
+
_classCallCheck(this, ChangeGuardPubkey200Response);
|
|
39
|
+
ChangeGuardPubkey200Response.initialize(this, binder_id);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Initializes the fields of this object.
|
|
44
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
45
|
+
* Only for internal use.
|
|
46
|
+
*/
|
|
47
|
+
return _createClass(ChangeGuardPubkey200Response, null, [{
|
|
48
|
+
key: "initialize",
|
|
49
|
+
value: function initialize(obj, binder_id) {
|
|
50
|
+
obj['binder_id'] = binder_id;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Constructs a <code>ChangeGuardPubkey200Response</code> from a plain JavaScript object, optionally creating a new instance.
|
|
55
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
56
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
57
|
+
* @param {module:model/ChangeGuardPubkey200Response} obj Optional instance to populate.
|
|
58
|
+
* @return {module:model/ChangeGuardPubkey200Response} The populated <code>ChangeGuardPubkey200Response</code> instance.
|
|
59
|
+
*/
|
|
60
|
+
}, {
|
|
61
|
+
key: "constructFromObject",
|
|
62
|
+
value: function constructFromObject(data, obj) {
|
|
63
|
+
if (data) {
|
|
64
|
+
obj = obj || new ChangeGuardPubkey200Response();
|
|
65
|
+
if (data.hasOwnProperty('binder_id')) {
|
|
66
|
+
obj['binder_id'] = _ApiClient["default"].convertToType(data['binder_id'], 'String');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return obj;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Validates the JSON data with respect to <code>ChangeGuardPubkey200Response</code>.
|
|
74
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
75
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>ChangeGuardPubkey200Response</code>.
|
|
76
|
+
*/
|
|
77
|
+
}, {
|
|
78
|
+
key: "validateJSON",
|
|
79
|
+
value: function validateJSON(data) {
|
|
80
|
+
// check to make sure all required properties are present in the JSON string
|
|
81
|
+
var _iterator = _createForOfIteratorHelper(ChangeGuardPubkey200Response.RequiredProperties),
|
|
82
|
+
_step;
|
|
83
|
+
try {
|
|
84
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
85
|
+
var property = _step.value;
|
|
86
|
+
if (!data.hasOwnProperty(property)) {
|
|
87
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// ensure the json data is a string
|
|
91
|
+
} catch (err) {
|
|
92
|
+
_iterator.e(err);
|
|
93
|
+
} finally {
|
|
94
|
+
_iterator.f();
|
|
95
|
+
}
|
|
96
|
+
if (data['binder_id'] && !(typeof data['binder_id'] === 'string' || data['binder_id'] instanceof String)) {
|
|
97
|
+
throw new Error("Expected the field `binder_id` to be a primitive type in the JSON string but got " + data['binder_id']);
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}]);
|
|
102
|
+
}();
|
|
103
|
+
ChangeGuardPubkey200Response.RequiredProperties = ["binder_id"];
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The binding ID.
|
|
107
|
+
* @member {String} binder_id
|
|
108
|
+
*/
|
|
109
|
+
ChangeGuardPubkey200Response.prototype['binder_id'] = undefined;
|
|
110
|
+
var _default = exports["default"] = ChangeGuardPubkey200Response;
|
|
@@ -94,6 +94,9 @@ var ContractCallParams = /*#__PURE__*/function () {
|
|
|
94
94
|
if (data.hasOwnProperty('fee')) {
|
|
95
95
|
obj['fee'] = _TransactionRequestFee["default"].constructFromObject(data['fee']);
|
|
96
96
|
}
|
|
97
|
+
if (data.hasOwnProperty('transaction_process_type')) {
|
|
98
|
+
obj['transaction_process_type'] = _ApiClient["default"].convertToType(data['transaction_process_type'], 'String');
|
|
99
|
+
}
|
|
97
100
|
if (data.hasOwnProperty('auto_fuel')) {
|
|
98
101
|
obj['auto_fuel'] = _AutoFuelType["default"].constructFromObject(data['auto_fuel']);
|
|
99
102
|
}
|
|
@@ -161,6 +164,10 @@ var ContractCallParams = /*#__PURE__*/function () {
|
|
|
161
164
|
_TransactionRequestFee["default"].validateJSON(data['fee']);
|
|
162
165
|
}
|
|
163
166
|
}
|
|
167
|
+
// ensure the json data is a string
|
|
168
|
+
if (data['transaction_process_type'] && !(typeof data['transaction_process_type'] === 'string' || data['transaction_process_type'] instanceof String)) {
|
|
169
|
+
throw new Error("Expected the field `transaction_process_type` to be a primitive type in the JSON string but got " + data['transaction_process_type']);
|
|
170
|
+
}
|
|
164
171
|
return true;
|
|
165
172
|
}
|
|
166
173
|
}]);
|
|
@@ -206,8 +213,37 @@ ContractCallParams.prototype['category_names'] = undefined;
|
|
|
206
213
|
*/
|
|
207
214
|
ContractCallParams.prototype['fee'] = undefined;
|
|
208
215
|
|
|
216
|
+
/**
|
|
217
|
+
* Transaction processing type. Possible values are: - `AutoProcess` (default): After the transaction is constructed, it will be automatically signed and broadcast. - `BuildOnly`: Set to this value if you want to build the transaction first without automatically signing and broadcasting it. You can manually call the [Sign and broadcast transaction](https://www.cobo.com/developers/v2/api-references/transactions/sign-and-broadcast-transaction) operation to complete the signing and broadcasting process.
|
|
218
|
+
* @member {module:model/ContractCallParams.TransactionProcessTypeEnum} transaction_process_type
|
|
219
|
+
*/
|
|
220
|
+
ContractCallParams.prototype['transaction_process_type'] = undefined;
|
|
221
|
+
|
|
209
222
|
/**
|
|
210
223
|
* @member {module:model/AutoFuelType} auto_fuel
|
|
211
224
|
*/
|
|
212
225
|
ContractCallParams.prototype['auto_fuel'] = undefined;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Allowed values for the <code>transaction_process_type</code> property.
|
|
229
|
+
* @enum {String}
|
|
230
|
+
* @readonly
|
|
231
|
+
*/
|
|
232
|
+
ContractCallParams['TransactionProcessTypeEnum'] = {
|
|
233
|
+
/**
|
|
234
|
+
* value: "AutoProcess"
|
|
235
|
+
* @const
|
|
236
|
+
*/
|
|
237
|
+
"AutoProcess": "AutoProcess",
|
|
238
|
+
/**
|
|
239
|
+
* value: "BuildOnly"
|
|
240
|
+
* @const
|
|
241
|
+
*/
|
|
242
|
+
"BuildOnly": "BuildOnly",
|
|
243
|
+
/**
|
|
244
|
+
* value: "unknown_default_open_api"
|
|
245
|
+
* @const
|
|
246
|
+
*/
|
|
247
|
+
"unknown_default_open_api": "unknown_default_open_api"
|
|
248
|
+
};
|
|
213
249
|
var _default = exports["default"] = ContractCallParams;
|
|
@@ -139,19 +139,19 @@ CoreStakingActivityDetailExtra.prototype['pool_type'] = undefined;
|
|
|
139
139
|
CoreStakingActivityDetailExtra.prototype['timelock'] = undefined;
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
|
-
* The change
|
|
142
|
+
* The change address on the Bitcoin chain. If not provided, the source wallet's address will be used as the change address.
|
|
143
143
|
* @member {String} change_address
|
|
144
144
|
*/
|
|
145
145
|
CoreStakingActivityDetailExtra.prototype['change_address'] = undefined;
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
|
-
* The validator
|
|
148
|
+
* The validator's EVM address.
|
|
149
149
|
* @member {String} validator_address
|
|
150
150
|
*/
|
|
151
151
|
CoreStakingActivityDetailExtra.prototype['validator_address'] = undefined;
|
|
152
152
|
|
|
153
153
|
/**
|
|
154
|
-
* The
|
|
154
|
+
* The EVM address to receive staking rewards.
|
|
155
155
|
* @member {String} reward_address
|
|
156
156
|
*/
|
|
157
157
|
CoreStakingActivityDetailExtra.prototype['reward_address'] = undefined;
|
|
@@ -34,7 +34,7 @@ var CreateAddressRequest = /*#__PURE__*/function () {
|
|
|
34
34
|
* Constructs a new <code>CreateAddressRequest</code>.
|
|
35
35
|
* @alias module:model/CreateAddressRequest
|
|
36
36
|
* @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](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-chains).
|
|
37
|
-
* @param count {Number} The number of addresses to create.
|
|
37
|
+
* @param count {Number} The number of addresses to create. This property will be ignored if you are generating tweaked Taproot addresses.
|
|
38
38
|
*/
|
|
39
39
|
function CreateAddressRequest(chain_id, count) {
|
|
40
40
|
_classCallCheck(this, CreateAddressRequest);
|
|
@@ -71,6 +71,12 @@ var CreateAddressRequest = /*#__PURE__*/function () {
|
|
|
71
71
|
if (data.hasOwnProperty('count')) {
|
|
72
72
|
obj['count'] = _ApiClient["default"].convertToType(data['count'], 'Number');
|
|
73
73
|
}
|
|
74
|
+
if (data.hasOwnProperty('taproot_script_tree_hashes')) {
|
|
75
|
+
obj['taproot_script_tree_hashes'] = _ApiClient["default"].convertToType(data['taproot_script_tree_hashes'], ['String']);
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('taproot_internal_address')) {
|
|
78
|
+
obj['taproot_internal_address'] = _ApiClient["default"].convertToType(data['taproot_internal_address'], 'String');
|
|
79
|
+
}
|
|
74
80
|
if (data.hasOwnProperty('encoding')) {
|
|
75
81
|
obj['encoding'] = _AddressEncoding["default"].constructFromObject(data['encoding']);
|
|
76
82
|
}
|
|
@@ -105,6 +111,14 @@ var CreateAddressRequest = /*#__PURE__*/function () {
|
|
|
105
111
|
if (data['chain_id'] && !(typeof data['chain_id'] === 'string' || data['chain_id'] instanceof String)) {
|
|
106
112
|
throw new Error("Expected the field `chain_id` to be a primitive type in the JSON string but got " + data['chain_id']);
|
|
107
113
|
}
|
|
114
|
+
// ensure the json data is an array
|
|
115
|
+
if (!Array.isArray(data['taproot_script_tree_hashes'])) {
|
|
116
|
+
throw new Error("Expected the field `taproot_script_tree_hashes` to be an array in the JSON data but got " + data['taproot_script_tree_hashes']);
|
|
117
|
+
}
|
|
118
|
+
// ensure the json data is a string
|
|
119
|
+
if (data['taproot_internal_address'] && !(typeof data['taproot_internal_address'] === 'string' || data['taproot_internal_address'] instanceof String)) {
|
|
120
|
+
throw new Error("Expected the field `taproot_internal_address` to be a primitive type in the JSON string but got " + data['taproot_internal_address']);
|
|
121
|
+
}
|
|
108
122
|
return true;
|
|
109
123
|
}
|
|
110
124
|
}]);
|
|
@@ -118,12 +132,24 @@ CreateAddressRequest.RequiredProperties = ["chain_id", "count"];
|
|
|
118
132
|
CreateAddressRequest.prototype['chain_id'] = undefined;
|
|
119
133
|
|
|
120
134
|
/**
|
|
121
|
-
* The number of addresses to create.
|
|
135
|
+
* The number of addresses to create. This property will be ignored if you are generating tweaked Taproot addresses.
|
|
122
136
|
* @member {Number} count
|
|
123
137
|
* @default 1
|
|
124
138
|
*/
|
|
125
139
|
CreateAddressRequest.prototype['count'] = 1;
|
|
126
140
|
|
|
141
|
+
/**
|
|
142
|
+
* A list of script tree hashes used to generate a tweaked Taproot address. This property is required only if you want to generate tweaked Taproot addresses.
|
|
143
|
+
* @member {Array.<String>} taproot_script_tree_hashes
|
|
144
|
+
*/
|
|
145
|
+
CreateAddressRequest.prototype['taproot_script_tree_hashes'] = undefined;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The original Taproot address to be tweaked. This property is required only if you want to generate tweaked Taproot addresses.
|
|
149
|
+
* @member {String} taproot_internal_address
|
|
150
|
+
*/
|
|
151
|
+
CreateAddressRequest.prototype['taproot_internal_address'] = undefined;
|
|
152
|
+
|
|
127
153
|
/**
|
|
128
154
|
* @member {module:model/AddressEncoding} encoding
|
|
129
155
|
*/
|
|
@@ -0,0 +1,140 @@
|
|
|
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 _QueryGuardPubkey200ResponseAddressesInner = _interopRequireDefault(require("./QueryGuardPubkey200ResponseAddressesInner"));
|
|
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 CreatePrimeBrokerAddress201Response model module.
|
|
30
|
+
* @module model/CreatePrimeBrokerAddress201Response
|
|
31
|
+
*/
|
|
32
|
+
var CreatePrimeBrokerAddress201Response = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>CreatePrimeBrokerAddress201Response</code>.
|
|
35
|
+
* @alias module:model/CreatePrimeBrokerAddress201Response
|
|
36
|
+
* @param pubkey {String} The Cobo Guard's public key.
|
|
37
|
+
*/
|
|
38
|
+
function CreatePrimeBrokerAddress201Response(pubkey) {
|
|
39
|
+
_classCallCheck(this, CreatePrimeBrokerAddress201Response);
|
|
40
|
+
CreatePrimeBrokerAddress201Response.initialize(this, pubkey);
|
|
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(CreatePrimeBrokerAddress201Response, null, [{
|
|
49
|
+
key: "initialize",
|
|
50
|
+
value: function initialize(obj, pubkey) {
|
|
51
|
+
obj['pubkey'] = pubkey;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Constructs a <code>CreatePrimeBrokerAddress201Response</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/CreatePrimeBrokerAddress201Response} obj Optional instance to populate.
|
|
59
|
+
* @return {module:model/CreatePrimeBrokerAddress201Response} The populated <code>CreatePrimeBrokerAddress201Response</code> instance.
|
|
60
|
+
*/
|
|
61
|
+
}, {
|
|
62
|
+
key: "constructFromObject",
|
|
63
|
+
value: function constructFromObject(data, obj) {
|
|
64
|
+
if (data) {
|
|
65
|
+
obj = obj || new CreatePrimeBrokerAddress201Response();
|
|
66
|
+
if (data.hasOwnProperty('pubkey')) {
|
|
67
|
+
obj['pubkey'] = _ApiClient["default"].convertToType(data['pubkey'], 'String');
|
|
68
|
+
}
|
|
69
|
+
if (data.hasOwnProperty('addresses')) {
|
|
70
|
+
obj['addresses'] = _ApiClient["default"].convertToType(data['addresses'], [_QueryGuardPubkey200ResponseAddressesInner["default"]]);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return obj;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Validates the JSON data with respect to <code>CreatePrimeBrokerAddress201Response</code>.
|
|
78
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
79
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreatePrimeBrokerAddress201Response</code>.
|
|
80
|
+
*/
|
|
81
|
+
}, {
|
|
82
|
+
key: "validateJSON",
|
|
83
|
+
value: function validateJSON(data) {
|
|
84
|
+
// check to make sure all required properties are present in the JSON string
|
|
85
|
+
var _iterator = _createForOfIteratorHelper(CreatePrimeBrokerAddress201Response.RequiredProperties),
|
|
86
|
+
_step;
|
|
87
|
+
try {
|
|
88
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
89
|
+
var property = _step.value;
|
|
90
|
+
if (!data.hasOwnProperty(property)) {
|
|
91
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// ensure the json data is a string
|
|
95
|
+
} catch (err) {
|
|
96
|
+
_iterator.e(err);
|
|
97
|
+
} finally {
|
|
98
|
+
_iterator.f();
|
|
99
|
+
}
|
|
100
|
+
if (data['pubkey'] && !(typeof data['pubkey'] === 'string' || data['pubkey'] instanceof String)) {
|
|
101
|
+
throw new Error("Expected the field `pubkey` to be a primitive type in the JSON string but got " + data['pubkey']);
|
|
102
|
+
}
|
|
103
|
+
if (data['addresses']) {
|
|
104
|
+
// data not null
|
|
105
|
+
// ensure the json data is an array
|
|
106
|
+
if (!Array.isArray(data['addresses'])) {
|
|
107
|
+
throw new Error("Expected the field `addresses` to be an array in the JSON data but got " + data['addresses']);
|
|
108
|
+
}
|
|
109
|
+
// validate the optional field `addresses` (array)
|
|
110
|
+
var _iterator2 = _createForOfIteratorHelper(data['addresses']),
|
|
111
|
+
_step2;
|
|
112
|
+
try {
|
|
113
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
114
|
+
var item = _step2.value;
|
|
115
|
+
_QueryGuardPubkey200ResponseAddressesInner["default"].validateJSON(item);
|
|
116
|
+
}
|
|
117
|
+
} catch (err) {
|
|
118
|
+
_iterator2.e(err);
|
|
119
|
+
} finally {
|
|
120
|
+
_iterator2.f();
|
|
121
|
+
}
|
|
122
|
+
;
|
|
123
|
+
}
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
}]);
|
|
127
|
+
}();
|
|
128
|
+
CreatePrimeBrokerAddress201Response.RequiredProperties = ["pubkey"];
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The Cobo Guard's public key.
|
|
132
|
+
* @member {String} pubkey
|
|
133
|
+
*/
|
|
134
|
+
CreatePrimeBrokerAddress201Response.prototype['pubkey'] = undefined;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @member {Array.<module:model/QueryGuardPubkey200ResponseAddressesInner>} addresses
|
|
138
|
+
*/
|
|
139
|
+
CreatePrimeBrokerAddress201Response.prototype['addresses'] = undefined;
|
|
140
|
+
var _default = exports["default"] = CreatePrimeBrokerAddress201Response;
|