@cobo/cobo-waas2 1.9.0 → 1.11.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 +47 -4
- package/dist/ApiClient.js +1 -1
- package/dist/api/AddressBooksApi.js +1 -1
- package/dist/api/DevelopersApi.js +7 -7
- package/dist/api/DevelopersWebhooksApi.js +8 -8
- package/dist/api/StakingsApi.js +412 -18
- package/dist/api/SwapsApi.js +360 -0
- package/dist/api/TransactionsApi.js +18 -18
- package/dist/api/TravelRuleApi.js +4 -4
- package/dist/api/WalletsApi.js +19 -19
- package/dist/api/WalletsExchangeWalletApi.js +1 -1
- package/dist/api/WalletsMPCWalletsApi.js +19 -19
- package/dist/api/WalletsSmartContractWalletsApi.js +1 -1
- package/dist/index.js +213 -3
- package/dist/model/AddressesEventData.js +4 -4
- package/dist/model/AddressesEventDataAllOfAddresses.js +295 -0
- package/dist/model/BTCEIP191MessageSignDestination.js +1 -1
- package/dist/model/BabylonAirdropPop.js +186 -0
- package/dist/model/BabylonAirdropRegistration.js +172 -0
- package/dist/model/BabylonEligibleAirdrop.js +157 -0
- package/dist/model/BabylonRegistrationRequestStatus.js +66 -0
- package/dist/model/BabylonRegistrationStatus.js +66 -0
- package/dist/model/BabylonStakingRegistration.js +185 -0
- package/dist/model/ChainInfo.js +2 -2
- package/dist/model/ContractCallDestination.js +42 -8
- package/dist/model/ContractCallDestinationType.js +5 -0
- package/dist/model/ContractCallSource.js +6 -0
- package/dist/model/CreateBabylonAirdropRegistration201Response.js +87 -0
- package/dist/model/CreateBabylonAirdropRegistrationRequest.js +105 -0
- package/dist/model/CreateBabylonStakingRegistration201Response.js +87 -0
- package/dist/model/CreateBabylonStakingRegistrationRequest.js +103 -0
- package/dist/model/CreateSwapActivityRequest.js +153 -0
- package/dist/model/CreateSwapQuote201Response.js +264 -0
- package/dist/model/CreateSwapQuoteRequest.js +166 -0
- package/dist/model/EstimatedEvmEip1559FeeSlow.js +23 -0
- package/dist/model/EstimatedEvmLegacyFeeSlow.js +23 -0
- package/dist/model/ExtendedTokenInfo.js +3 -3
- package/dist/model/FeeReserved.js +87 -0
- package/dist/model/ListBabylonAirdropRegistrations200Response.js +123 -0
- package/dist/model/ListBabylonEligibleAirdrops200Response.js +123 -0
- package/dist/model/ListBabylonEligibleStakings200Response.js +123 -0
- package/dist/model/ListBabylonEligibleStakings200ResponseDataInner.js +141 -0
- package/dist/model/ListBabylonStakingRegistrations200Response.js +123 -0
- package/dist/model/{SwapSummary.js → ListEnableTokenPairs200Response.js} +51 -49
- package/dist/model/ListSwapActivities200Response.js +123 -0
- package/dist/model/MaxFeeAmount.js +1 -1
- package/dist/model/MessageSignSource.js +6 -0
- package/dist/model/MpcContractCallSource.js +16 -0
- package/dist/model/MpcMessageSignSource.js +16 -0
- package/dist/model/MpcSigningGroup.js +27 -4
- package/dist/model/MpcTransferSource.js +16 -0
- package/dist/model/QueryGuardPubkey200ResponseAddressesInner.js +2 -2
- package/dist/model/SolContractCallAccount.js +133 -0
- package/dist/model/SolContractCallDestination.js +139 -0
- package/dist/model/SolContractCallInstruction.js +158 -0
- package/dist/model/StakingPoolId.js +30 -0
- package/dist/model/StakingPoolType.js +15 -0
- package/dist/model/SwapQuote.js +203 -0
- package/dist/model/TokenInfo.js +2 -2
- package/dist/model/TransactionDestination.js +45 -11
- package/dist/model/TransactionDestinationType.js +5 -0
- package/dist/model/TransactionFee.js +1 -1
- package/dist/model/TransactionFixedFee.js +2 -2
- package/dist/model/TransactionRawTxInfo.js +16 -0
- package/dist/model/TransactionRbfSource.js +6 -0
- package/dist/model/TransactionRequestFee.js +1 -1
- package/dist/model/TransactionRequestFixedFee.js +2 -2
- package/dist/model/TransactionRequestUtxoFee.js +1 -1
- package/dist/model/TransactionSolContractAccount.js +106 -0
- package/dist/model/TransactionSolContractDestination.js +137 -0
- package/dist/model/TransactionSolContractInstruction.js +134 -0
- package/dist/model/TransactionTokeApproval.js +3 -3
- package/dist/model/TransactionUtxoChange.js +101 -0
- package/dist/model/TransferSource.js +6 -0
- package/dist/model/WebhookEventData.js +2 -2
- package/docs/AddressBooksApi.md +1 -1
- package/docs/AddressesEventData.md +1 -1
- package/docs/AddressesEventDataAllOfAddresses.md +19 -0
- package/docs/BabylonAirdropPop.md +14 -0
- package/docs/BabylonAirdropRegistration.md +16 -0
- package/docs/BabylonEligibleAirdrop.md +14 -0
- package/docs/BabylonRegistrationRequestStatus.md +14 -0
- package/docs/BabylonRegistrationStatus.md +14 -0
- package/docs/BabylonStakingRegistration.md +17 -0
- package/docs/ChainInfo.md +1 -1
- package/docs/ContractCallDestination.md +1 -0
- package/docs/ContractCallDestinationType.md +2 -0
- package/docs/ContractCallSource.md +1 -0
- package/docs/CreateBabylonAirdropRegistration201Response.md +9 -0
- package/docs/CreateBabylonAirdropRegistrationRequest.md +10 -0
- package/docs/CreateBabylonStakingRegistration201Response.md +9 -0
- package/docs/CreateBabylonStakingRegistrationRequest.md +10 -0
- package/docs/CreateSwapActivityRequest.md +12 -0
- package/docs/CreateSwapQuote201Response.md +17 -0
- package/docs/CreateSwapQuoteRequest.md +13 -0
- package/docs/DevelopersApi.md +5 -5
- package/docs/DevelopersWebhooksApi.md +8 -8
- package/docs/EstimatedEvmEip1559FeeSlow.md +1 -0
- package/docs/EstimatedEvmLegacyFeeSlow.md +1 -0
- package/docs/ExtendedTokenInfo.md +1 -1
- package/docs/FeeReserved.md +9 -0
- package/docs/ListBabylonAirdropRegistrations200Response.md +10 -0
- package/docs/ListBabylonEligibleAirdrops200Response.md +10 -0
- package/docs/ListBabylonEligibleStakings200Response.md +10 -0
- package/docs/ListBabylonEligibleStakings200ResponseDataInner.md +13 -0
- package/docs/ListBabylonStakingRegistrations200Response.md +10 -0
- package/docs/ListEnableTokenPairs200Response.md +10 -0
- package/docs/ListSwapActivities200Response.md +10 -0
- package/docs/MaxFeeAmount.md +1 -1
- package/docs/MessageSignSource.md +1 -0
- package/docs/MpcContractCallSource.md +1 -0
- package/docs/MpcMessageSignSource.md +1 -0
- package/docs/MpcSigningGroup.md +1 -1
- package/docs/MpcTransferSource.md +1 -0
- package/docs/QueryGuardPubkey200ResponseAddressesInner.md +1 -1
- package/docs/SolContractCallAccount.md +11 -0
- package/docs/SolContractCallDestination.md +10 -0
- package/docs/SolContractCallInstruction.md +11 -0
- package/docs/StakingPoolId.md +12 -0
- package/docs/StakingPoolType.md +6 -0
- package/docs/StakingsApi.md +461 -13
- package/docs/SwapQuote.md +16 -0
- package/docs/SwapsApi.md +348 -0
- package/docs/TokenInfo.md +1 -1
- package/docs/TransactionDestination.md +1 -0
- package/docs/TransactionDestinationType.md +2 -0
- package/docs/TransactionFee.md +1 -1
- package/docs/TransactionFixedFee.md +1 -1
- package/docs/TransactionRawTxInfo.md +1 -0
- package/docs/TransactionRbfSource.md +1 -0
- package/docs/TransactionRequestFee.md +1 -1
- package/docs/TransactionRequestFixedFee.md +1 -1
- package/docs/TransactionRequestUtxoFee.md +1 -1
- package/docs/TransactionSolContractAccount.md +11 -0
- package/docs/TransactionSolContractDestination.md +10 -0
- package/docs/TransactionSolContractInstruction.md +11 -0
- package/docs/TransactionTokeApproval.md +1 -1
- package/docs/TransactionUtxoChange.md +10 -0
- package/docs/TransactionsApi.md +16 -16
- package/docs/TransferSource.md +1 -0
- package/docs/TravelRuleApi.md +4 -4
- package/docs/WalletsApi.md +16 -16
- package/docs/WalletsExchangeWalletApi.md +1 -1
- package/docs/WalletsMPCWalletsApi.md +19 -19
- package/docs/WalletsSmartContractWalletsApi.md +1 -1
- package/docs/WebhookEventData.md +1 -1
- package/package.json +2 -2
- package/docs/SwapSummary.md +0 -10
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
8
|
var _MessageSignSourceType = _interopRequireDefault(require("./MessageSignSourceType"));
|
|
9
|
+
var _MpcSigningGroup = _interopRequireDefault(require("./MpcSigningGroup"));
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
11
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
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; } } }; }
|
|
@@ -76,6 +77,9 @@ var MpcMessageSignSource = /*#__PURE__*/function () {
|
|
|
76
77
|
if (data.hasOwnProperty('address')) {
|
|
77
78
|
obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
|
|
78
79
|
}
|
|
80
|
+
if (data.hasOwnProperty('mpc_used_key_share_holder_group')) {
|
|
81
|
+
obj['mpc_used_key_share_holder_group'] = _MpcSigningGroup["default"].constructFromObject(data['mpc_used_key_share_holder_group']);
|
|
82
|
+
}
|
|
79
83
|
}
|
|
80
84
|
return obj;
|
|
81
85
|
}
|
|
@@ -111,6 +115,13 @@ var MpcMessageSignSource = /*#__PURE__*/function () {
|
|
|
111
115
|
if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
|
|
112
116
|
throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
|
|
113
117
|
}
|
|
118
|
+
// validate the optional field `mpc_used_key_share_holder_group`
|
|
119
|
+
if (data['mpc_used_key_share_holder_group']) {
|
|
120
|
+
// data not null
|
|
121
|
+
if (!!_MpcSigningGroup["default"].validateJSON) {
|
|
122
|
+
_MpcSigningGroup["default"].validateJSON(data['mpc_used_key_share_holder_group']);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
114
125
|
return true;
|
|
115
126
|
}
|
|
116
127
|
}]);
|
|
@@ -133,4 +144,9 @@ MpcMessageSignSource.prototype['wallet_id'] = undefined;
|
|
|
133
144
|
* @member {String} address
|
|
134
145
|
*/
|
|
135
146
|
MpcMessageSignSource.prototype['address'] = undefined;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @member {module:model/MpcSigningGroup} mpc_used_key_share_holder_group
|
|
150
|
+
*/
|
|
151
|
+
MpcMessageSignSource.prototype['mpc_used_key_share_holder_group'] = undefined;
|
|
136
152
|
var _default = exports["default"] = MpcMessageSignSource;
|
|
@@ -7,6 +7,9 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
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; }
|
|
10
13
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
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); } }
|
|
12
15
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -30,10 +33,11 @@ var MpcSigningGroup = /*#__PURE__*/function () {
|
|
|
30
33
|
* Constructs a new <code>MpcSigningGroup</code>.
|
|
31
34
|
* The information about the Signing Group of an MPC Wallet.
|
|
32
35
|
* @alias module:model/MpcSigningGroup
|
|
36
|
+
* @param used_key_share_holder_group_id {String} The ID of the Signing Group.
|
|
33
37
|
*/
|
|
34
|
-
function MpcSigningGroup() {
|
|
38
|
+
function MpcSigningGroup(used_key_share_holder_group_id) {
|
|
35
39
|
_classCallCheck(this, MpcSigningGroup);
|
|
36
|
-
MpcSigningGroup.initialize(this);
|
|
40
|
+
MpcSigningGroup.initialize(this, used_key_share_holder_group_id);
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
/**
|
|
@@ -43,7 +47,9 @@ var MpcSigningGroup = /*#__PURE__*/function () {
|
|
|
43
47
|
*/
|
|
44
48
|
return _createClass(MpcSigningGroup, null, [{
|
|
45
49
|
key: "initialize",
|
|
46
|
-
value: function initialize(obj) {
|
|
50
|
+
value: function initialize(obj, used_key_share_holder_group_id) {
|
|
51
|
+
obj['used_key_share_holder_group_id'] = used_key_share_holder_group_id;
|
|
52
|
+
}
|
|
47
53
|
|
|
48
54
|
/**
|
|
49
55
|
* Constructs a <code>MpcSigningGroup</code> from a plain JavaScript object, optionally creating a new instance.
|
|
@@ -75,7 +81,22 @@ var MpcSigningGroup = /*#__PURE__*/function () {
|
|
|
75
81
|
}, {
|
|
76
82
|
key: "validateJSON",
|
|
77
83
|
value: function validateJSON(data) {
|
|
78
|
-
//
|
|
84
|
+
// check to make sure all required properties are present in the JSON string
|
|
85
|
+
var _iterator = _createForOfIteratorHelper(MpcSigningGroup.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
|
+
}
|
|
79
100
|
if (data['used_key_share_holder_group_id'] && !(typeof data['used_key_share_holder_group_id'] === 'string' || data['used_key_share_holder_group_id'] instanceof String)) {
|
|
80
101
|
throw new Error("Expected the field `used_key_share_holder_group_id` to be a primitive type in the JSON string but got " + data['used_key_share_holder_group_id']);
|
|
81
102
|
}
|
|
@@ -87,6 +108,8 @@ var MpcSigningGroup = /*#__PURE__*/function () {
|
|
|
87
108
|
}
|
|
88
109
|
}]);
|
|
89
110
|
}();
|
|
111
|
+
MpcSigningGroup.RequiredProperties = ["used_key_share_holder_group_id"];
|
|
112
|
+
|
|
90
113
|
/**
|
|
91
114
|
* The ID of the Signing Group.
|
|
92
115
|
* @member {String} used_key_share_holder_group_id
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _MpcSigningGroup = _interopRequireDefault(require("./MpcSigningGroup"));
|
|
8
9
|
var _TransactionUtxo = _interopRequireDefault(require("./TransactionUtxo"));
|
|
9
10
|
var _WalletSubtype = _interopRequireDefault(require("./WalletSubtype"));
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -82,6 +83,9 @@ var MpcTransferSource = /*#__PURE__*/function () {
|
|
|
82
83
|
if (data.hasOwnProperty('excluded_utxos')) {
|
|
83
84
|
obj['excluded_utxos'] = _ApiClient["default"].convertToType(data['excluded_utxos'], [_TransactionUtxo["default"]]);
|
|
84
85
|
}
|
|
86
|
+
if (data.hasOwnProperty('mpc_used_key_share_holder_group')) {
|
|
87
|
+
obj['mpc_used_key_share_holder_group'] = _MpcSigningGroup["default"].constructFromObject(data['mpc_used_key_share_holder_group']);
|
|
88
|
+
}
|
|
85
89
|
}
|
|
86
90
|
return obj;
|
|
87
91
|
}
|
|
@@ -159,6 +163,13 @@ var MpcTransferSource = /*#__PURE__*/function () {
|
|
|
159
163
|
}
|
|
160
164
|
;
|
|
161
165
|
}
|
|
166
|
+
// validate the optional field `mpc_used_key_share_holder_group`
|
|
167
|
+
if (data['mpc_used_key_share_holder_group']) {
|
|
168
|
+
// data not null
|
|
169
|
+
if (!!_MpcSigningGroup["default"].validateJSON) {
|
|
170
|
+
_MpcSigningGroup["default"].validateJSON(data['mpc_used_key_share_holder_group']);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
162
173
|
return true;
|
|
163
174
|
}
|
|
164
175
|
}]);
|
|
@@ -191,4 +202,9 @@ MpcTransferSource.prototype['included_utxos'] = undefined;
|
|
|
191
202
|
* @member {Array.<module:model/TransactionUtxo>} excluded_utxos
|
|
192
203
|
*/
|
|
193
204
|
MpcTransferSource.prototype['excluded_utxos'] = undefined;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @member {module:model/MpcSigningGroup} mpc_used_key_share_holder_group
|
|
208
|
+
*/
|
|
209
|
+
MpcTransferSource.prototype['mpc_used_key_share_holder_group'] = undefined;
|
|
194
210
|
var _default = exports["default"] = MpcTransferSource;
|
|
@@ -33,7 +33,7 @@ var QueryGuardPubkey200ResponseAddressesInner = /*#__PURE__*/function () {
|
|
|
33
33
|
* Constructs a new <code>QueryGuardPubkey200ResponseAddressesInner</code>.
|
|
34
34
|
* @alias module:model/QueryGuardPubkey200ResponseAddressesInner
|
|
35
35
|
* @param address {String} The wallet address.
|
|
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](/v2/api-references/wallets/list-enabled-chains).
|
|
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
37
|
*/
|
|
38
38
|
function QueryGuardPubkey200ResponseAddressesInner(address, chain_id) {
|
|
39
39
|
_classCallCheck(this, QueryGuardPubkey200ResponseAddressesInner);
|
|
@@ -118,7 +118,7 @@ QueryGuardPubkey200ResponseAddressesInner.RequiredProperties = ["address", "chai
|
|
|
118
118
|
QueryGuardPubkey200ResponseAddressesInner.prototype['address'] = undefined;
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
|
-
* The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](/v2/api-references/wallets/list-enabled-chains).
|
|
121
|
+
* 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).
|
|
122
122
|
* @member {String} chain_id
|
|
123
123
|
*/
|
|
124
124
|
QueryGuardPubkey200ResponseAddressesInner.prototype['chain_id'] = undefined;
|
|
@@ -0,0 +1,133 @@
|
|
|
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 SolContractCallAccount model module.
|
|
29
|
+
* @module model/SolContractCallAccount
|
|
30
|
+
*/
|
|
31
|
+
var SolContractCallAccount = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>SolContractCallAccount</code>.
|
|
34
|
+
* The information about the account involved in a Solana instruction.
|
|
35
|
+
* @alias module:model/SolContractCallAccount
|
|
36
|
+
* @param pubkey {String} The public key of the account. If the account is a signer of this transaction, this property must be the same as the value of the `source.address` property.
|
|
37
|
+
* @param is_signer {Boolean} Whether the account is the signer of this transaction: - `true`: The account is a signer. - `false`: The account is not a signer.
|
|
38
|
+
* @param is_writable {Boolean} Whether the account can be modified by the instruction: - `true`: The account can be modified by the instruction. - `false`: The account cannot be modified by the instruction.
|
|
39
|
+
*/
|
|
40
|
+
function SolContractCallAccount(pubkey, is_signer, is_writable) {
|
|
41
|
+
_classCallCheck(this, SolContractCallAccount);
|
|
42
|
+
SolContractCallAccount.initialize(this, pubkey, is_signer, is_writable);
|
|
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(SolContractCallAccount, null, [{
|
|
51
|
+
key: "initialize",
|
|
52
|
+
value: function initialize(obj, pubkey, is_signer, is_writable) {
|
|
53
|
+
obj['pubkey'] = pubkey;
|
|
54
|
+
obj['is_signer'] = is_signer;
|
|
55
|
+
obj['is_writable'] = is_writable;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Constructs a <code>SolContractCallAccount</code> from a plain JavaScript object, optionally creating a new instance.
|
|
60
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
61
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
62
|
+
* @param {module:model/SolContractCallAccount} obj Optional instance to populate.
|
|
63
|
+
* @return {module:model/SolContractCallAccount} The populated <code>SolContractCallAccount</code> instance.
|
|
64
|
+
*/
|
|
65
|
+
}, {
|
|
66
|
+
key: "constructFromObject",
|
|
67
|
+
value: function constructFromObject(data, obj) {
|
|
68
|
+
if (data) {
|
|
69
|
+
obj = obj || new SolContractCallAccount();
|
|
70
|
+
if (data.hasOwnProperty('pubkey')) {
|
|
71
|
+
obj['pubkey'] = _ApiClient["default"].convertToType(data['pubkey'], 'String');
|
|
72
|
+
}
|
|
73
|
+
if (data.hasOwnProperty('is_signer')) {
|
|
74
|
+
obj['is_signer'] = _ApiClient["default"].convertToType(data['is_signer'], 'Boolean');
|
|
75
|
+
}
|
|
76
|
+
if (data.hasOwnProperty('is_writable')) {
|
|
77
|
+
obj['is_writable'] = _ApiClient["default"].convertToType(data['is_writable'], 'Boolean');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return obj;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Validates the JSON data with respect to <code>SolContractCallAccount</code>.
|
|
85
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
86
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>SolContractCallAccount</code>.
|
|
87
|
+
*/
|
|
88
|
+
}, {
|
|
89
|
+
key: "validateJSON",
|
|
90
|
+
value: function validateJSON(data) {
|
|
91
|
+
// check to make sure all required properties are present in the JSON string
|
|
92
|
+
var _iterator = _createForOfIteratorHelper(SolContractCallAccount.RequiredProperties),
|
|
93
|
+
_step;
|
|
94
|
+
try {
|
|
95
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
96
|
+
var property = _step.value;
|
|
97
|
+
if (!data.hasOwnProperty(property)) {
|
|
98
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// ensure the json data is a string
|
|
102
|
+
} catch (err) {
|
|
103
|
+
_iterator.e(err);
|
|
104
|
+
} finally {
|
|
105
|
+
_iterator.f();
|
|
106
|
+
}
|
|
107
|
+
if (data['pubkey'] && !(typeof data['pubkey'] === 'string' || data['pubkey'] instanceof String)) {
|
|
108
|
+
throw new Error("Expected the field `pubkey` to be a primitive type in the JSON string but got " + data['pubkey']);
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
}]);
|
|
113
|
+
}();
|
|
114
|
+
SolContractCallAccount.RequiredProperties = ["pubkey", "is_signer", "is_writable"];
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The public key of the account. If the account is a signer of this transaction, this property must be the same as the value of the `source.address` property.
|
|
118
|
+
* @member {String} pubkey
|
|
119
|
+
*/
|
|
120
|
+
SolContractCallAccount.prototype['pubkey'] = undefined;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Whether the account is the signer of this transaction: - `true`: The account is a signer. - `false`: The account is not a signer.
|
|
124
|
+
* @member {Boolean} is_signer
|
|
125
|
+
*/
|
|
126
|
+
SolContractCallAccount.prototype['is_signer'] = undefined;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Whether the account can be modified by the instruction: - `true`: The account can be modified by the instruction. - `false`: The account cannot be modified by the instruction.
|
|
130
|
+
* @member {Boolean} is_writable
|
|
131
|
+
*/
|
|
132
|
+
SolContractCallAccount.prototype['is_writable'] = undefined;
|
|
133
|
+
var _default = exports["default"] = SolContractCallAccount;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _ContractCallDestinationType = _interopRequireDefault(require("./ContractCallDestinationType"));
|
|
9
|
+
var _SolContractCallInstruction = _interopRequireDefault(require("./SolContractCallInstruction"));
|
|
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 SolContractCallDestination model module.
|
|
31
|
+
* @module model/SolContractCallDestination
|
|
32
|
+
*/
|
|
33
|
+
var SolContractCallDestination = /*#__PURE__*/function () {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new <code>SolContractCallDestination</code>.
|
|
36
|
+
* The information about the transaction destination. Refer to [Transaction sources and destinations](https://www.cobo.com/developers/v2/guides/transactions/sources-and-destinations) for a detailed introduction about the supported sources and destinations for each transaction type.
|
|
37
|
+
* @alias module:model/SolContractCallDestination
|
|
38
|
+
* @param destination_type {module:model/ContractCallDestinationType}
|
|
39
|
+
* @param instructions {Array.<module:model/SolContractCallInstruction>}
|
|
40
|
+
*/
|
|
41
|
+
function SolContractCallDestination(destination_type, instructions) {
|
|
42
|
+
_classCallCheck(this, SolContractCallDestination);
|
|
43
|
+
SolContractCallDestination.initialize(this, destination_type, instructions);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Initializes the fields of this object.
|
|
48
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
49
|
+
* Only for internal use.
|
|
50
|
+
*/
|
|
51
|
+
return _createClass(SolContractCallDestination, null, [{
|
|
52
|
+
key: "initialize",
|
|
53
|
+
value: function initialize(obj, destination_type, instructions) {
|
|
54
|
+
obj['destination_type'] = destination_type;
|
|
55
|
+
obj['instructions'] = instructions;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Constructs a <code>SolContractCallDestination</code> from a plain JavaScript object, optionally creating a new instance.
|
|
60
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
61
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
62
|
+
* @param {module:model/SolContractCallDestination} obj Optional instance to populate.
|
|
63
|
+
* @return {module:model/SolContractCallDestination} The populated <code>SolContractCallDestination</code> instance.
|
|
64
|
+
*/
|
|
65
|
+
}, {
|
|
66
|
+
key: "constructFromObject",
|
|
67
|
+
value: function constructFromObject(data, obj) {
|
|
68
|
+
if (data) {
|
|
69
|
+
obj = obj || new SolContractCallDestination();
|
|
70
|
+
if (data.hasOwnProperty('destination_type')) {
|
|
71
|
+
obj['destination_type'] = _ContractCallDestinationType["default"].constructFromObject(data['destination_type']);
|
|
72
|
+
}
|
|
73
|
+
if (data.hasOwnProperty('instructions')) {
|
|
74
|
+
obj['instructions'] = _ApiClient["default"].convertToType(data['instructions'], [_SolContractCallInstruction["default"]]);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return obj;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Validates the JSON data with respect to <code>SolContractCallDestination</code>.
|
|
82
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
83
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>SolContractCallDestination</code>.
|
|
84
|
+
*/
|
|
85
|
+
}, {
|
|
86
|
+
key: "validateJSON",
|
|
87
|
+
value: function validateJSON(data) {
|
|
88
|
+
// check to make sure all required properties are present in the JSON string
|
|
89
|
+
var _iterator = _createForOfIteratorHelper(SolContractCallDestination.RequiredProperties),
|
|
90
|
+
_step;
|
|
91
|
+
try {
|
|
92
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
93
|
+
var property = _step.value;
|
|
94
|
+
if (!data.hasOwnProperty(property)) {
|
|
95
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
} catch (err) {
|
|
99
|
+
_iterator.e(err);
|
|
100
|
+
} finally {
|
|
101
|
+
_iterator.f();
|
|
102
|
+
}
|
|
103
|
+
if (data['instructions']) {
|
|
104
|
+
// data not null
|
|
105
|
+
// ensure the json data is an array
|
|
106
|
+
if (!Array.isArray(data['instructions'])) {
|
|
107
|
+
throw new Error("Expected the field `instructions` to be an array in the JSON data but got " + data['instructions']);
|
|
108
|
+
}
|
|
109
|
+
// validate the optional field `instructions` (array)
|
|
110
|
+
var _iterator2 = _createForOfIteratorHelper(data['instructions']),
|
|
111
|
+
_step2;
|
|
112
|
+
try {
|
|
113
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
114
|
+
var item = _step2.value;
|
|
115
|
+
_SolContractCallInstruction["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
|
+
SolContractCallDestination.RequiredProperties = ["destination_type", "instructions"];
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @member {module:model/ContractCallDestinationType} destination_type
|
|
132
|
+
*/
|
|
133
|
+
SolContractCallDestination.prototype['destination_type'] = undefined;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @member {Array.<module:model/SolContractCallInstruction>} instructions
|
|
137
|
+
*/
|
|
138
|
+
SolContractCallDestination.prototype['instructions'] = undefined;
|
|
139
|
+
var _default = exports["default"] = SolContractCallDestination;
|
|
@@ -0,0 +1,158 @@
|
|
|
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 _SolContractCallAccount = _interopRequireDefault(require("./SolContractCallAccount"));
|
|
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 SolContractCallInstruction model module.
|
|
30
|
+
* @module model/SolContractCallInstruction
|
|
31
|
+
*/
|
|
32
|
+
var SolContractCallInstruction = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>SolContractCallInstruction</code>.
|
|
35
|
+
* The information about the Solana instruction.
|
|
36
|
+
* @alias module:model/SolContractCallInstruction
|
|
37
|
+
* @param accounts {Array.<module:model/SolContractCallAccount>}
|
|
38
|
+
* @param data {String} The Base64-encoded instruction data used for interacting with a Solana program.
|
|
39
|
+
* @param program_id {String} The address of the Solana program (smart contract).
|
|
40
|
+
*/
|
|
41
|
+
function SolContractCallInstruction(accounts, data, program_id) {
|
|
42
|
+
_classCallCheck(this, SolContractCallInstruction);
|
|
43
|
+
SolContractCallInstruction.initialize(this, accounts, data, program_id);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Initializes the fields of this object.
|
|
48
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
49
|
+
* Only for internal use.
|
|
50
|
+
*/
|
|
51
|
+
return _createClass(SolContractCallInstruction, null, [{
|
|
52
|
+
key: "initialize",
|
|
53
|
+
value: function initialize(obj, accounts, data, program_id) {
|
|
54
|
+
obj['accounts'] = accounts;
|
|
55
|
+
obj['data'] = data;
|
|
56
|
+
obj['program_id'] = program_id;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constructs a <code>SolContractCallInstruction</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/SolContractCallInstruction} obj Optional instance to populate.
|
|
64
|
+
* @return {module:model/SolContractCallInstruction} The populated <code>SolContractCallInstruction</code> instance.
|
|
65
|
+
*/
|
|
66
|
+
}, {
|
|
67
|
+
key: "constructFromObject",
|
|
68
|
+
value: function constructFromObject(data, obj) {
|
|
69
|
+
if (data) {
|
|
70
|
+
obj = obj || new SolContractCallInstruction();
|
|
71
|
+
if (data.hasOwnProperty('accounts')) {
|
|
72
|
+
obj['accounts'] = _ApiClient["default"].convertToType(data['accounts'], [_SolContractCallAccount["default"]]);
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty('data')) {
|
|
75
|
+
obj['data'] = _ApiClient["default"].convertToType(data['data'], 'String');
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('program_id')) {
|
|
78
|
+
obj['program_id'] = _ApiClient["default"].convertToType(data['program_id'], 'String');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return obj;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Validates the JSON data with respect to <code>SolContractCallInstruction</code>.
|
|
86
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
87
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>SolContractCallInstruction</code>.
|
|
88
|
+
*/
|
|
89
|
+
}, {
|
|
90
|
+
key: "validateJSON",
|
|
91
|
+
value: function validateJSON(data) {
|
|
92
|
+
// check to make sure all required properties are present in the JSON string
|
|
93
|
+
var _iterator = _createForOfIteratorHelper(SolContractCallInstruction.RequiredProperties),
|
|
94
|
+
_step;
|
|
95
|
+
try {
|
|
96
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
97
|
+
var property = _step.value;
|
|
98
|
+
if (!data.hasOwnProperty(property)) {
|
|
99
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
} catch (err) {
|
|
103
|
+
_iterator.e(err);
|
|
104
|
+
} finally {
|
|
105
|
+
_iterator.f();
|
|
106
|
+
}
|
|
107
|
+
if (data['accounts']) {
|
|
108
|
+
// data not null
|
|
109
|
+
// ensure the json data is an array
|
|
110
|
+
if (!Array.isArray(data['accounts'])) {
|
|
111
|
+
throw new Error("Expected the field `accounts` to be an array in the JSON data but got " + data['accounts']);
|
|
112
|
+
}
|
|
113
|
+
// validate the optional field `accounts` (array)
|
|
114
|
+
var _iterator2 = _createForOfIteratorHelper(data['accounts']),
|
|
115
|
+
_step2;
|
|
116
|
+
try {
|
|
117
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
118
|
+
var item = _step2.value;
|
|
119
|
+
_SolContractCallAccount["default"].validateJSON(item);
|
|
120
|
+
}
|
|
121
|
+
} catch (err) {
|
|
122
|
+
_iterator2.e(err);
|
|
123
|
+
} finally {
|
|
124
|
+
_iterator2.f();
|
|
125
|
+
}
|
|
126
|
+
;
|
|
127
|
+
}
|
|
128
|
+
// ensure the json data is a string
|
|
129
|
+
if (data['data'] && !(typeof data['data'] === 'string' || data['data'] instanceof String)) {
|
|
130
|
+
throw new Error("Expected the field `data` to be a primitive type in the JSON string but got " + data['data']);
|
|
131
|
+
}
|
|
132
|
+
// ensure the json data is a string
|
|
133
|
+
if (data['program_id'] && !(typeof data['program_id'] === 'string' || data['program_id'] instanceof String)) {
|
|
134
|
+
throw new Error("Expected the field `program_id` to be a primitive type in the JSON string but got " + data['program_id']);
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
}]);
|
|
139
|
+
}();
|
|
140
|
+
SolContractCallInstruction.RequiredProperties = ["accounts", "data", "program_id"];
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @member {Array.<module:model/SolContractCallAccount>} accounts
|
|
144
|
+
*/
|
|
145
|
+
SolContractCallInstruction.prototype['accounts'] = undefined;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The Base64-encoded instruction data used for interacting with a Solana program.
|
|
149
|
+
* @member {String} data
|
|
150
|
+
*/
|
|
151
|
+
SolContractCallInstruction.prototype['data'] = undefined;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The address of the Solana program (smart contract).
|
|
155
|
+
* @member {String} program_id
|
|
156
|
+
*/
|
|
157
|
+
SolContractCallInstruction.prototype['program_id'] = undefined;
|
|
158
|
+
var _default = exports["default"] = SolContractCallInstruction;
|
|
@@ -65,6 +65,36 @@ var StakingPoolId = exports["default"] = /*#__PURE__*/function () {
|
|
|
65
65
|
* @const
|
|
66
66
|
*/
|
|
67
67
|
_defineProperty(this, "sky_farm_eth_usdc", "sky_farm_eth_usdc");
|
|
68
|
+
/**
|
|
69
|
+
* value: "bithive_signet"
|
|
70
|
+
* @const
|
|
71
|
+
*/
|
|
72
|
+
_defineProperty(this, "bithive_signet", "bithive_signet");
|
|
73
|
+
/**
|
|
74
|
+
* value: "bithive"
|
|
75
|
+
* @const
|
|
76
|
+
*/
|
|
77
|
+
_defineProperty(this, "bithive", "bithive");
|
|
78
|
+
/**
|
|
79
|
+
* value: "beacon_bera"
|
|
80
|
+
* @const
|
|
81
|
+
*/
|
|
82
|
+
_defineProperty(this, "beacon_bera", "beacon_bera");
|
|
83
|
+
/**
|
|
84
|
+
* value: "beacon_bera_testnet"
|
|
85
|
+
* @const
|
|
86
|
+
*/
|
|
87
|
+
_defineProperty(this, "beacon_bera_testnet", "beacon_bera_testnet");
|
|
88
|
+
/**
|
|
89
|
+
* value: "berachain_bgt"
|
|
90
|
+
* @const
|
|
91
|
+
*/
|
|
92
|
+
_defineProperty(this, "berachain_bgt", "berachain_bgt");
|
|
93
|
+
/**
|
|
94
|
+
* value: "berachain_bgt_testnet"
|
|
95
|
+
* @const
|
|
96
|
+
*/
|
|
97
|
+
_defineProperty(this, "berachain_bgt_testnet", "berachain_bgt_testnet");
|
|
68
98
|
/**
|
|
69
99
|
* value: "unknown_default_open_api"
|
|
70
100
|
* @const
|