@cobo/cobo-waas2 1.12.0 → 1.13.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 +54 -18
- package/dist/ApiClient.js +1 -1
- package/dist/api/FeeStationApi.js +18 -18
- package/dist/api/TransactionsApi.js +2 -2
- package/dist/api/WalletsApi.js +8 -8
- package/dist/index.js +260 -43
- package/dist/model/ActivityExtra.js +0 -23
- package/dist/model/AddressEncoding.js +15 -0
- package/dist/model/AddressesEventData.js +8 -3
- package/dist/model/BTCBIP137MessageSignDestination.js +122 -0
- package/dist/model/BTCBIP322MessageSignDestination.js +122 -0
- package/dist/model/BabylonStakingActivityDetailExtra.js +0 -39
- package/dist/model/{ListSwapActivities200Response.js → BankAccount.js} +51 -51
- package/dist/model/ChainsEventData.js +8 -3
- package/dist/model/CosmosAdr36MessageSignDestination.js +122 -0
- package/dist/model/CosmosContractCallDestination.js +152 -0
- package/dist/model/CosmosContractCallMessage.js +126 -0
- package/dist/model/CreateSettlement.js +174 -0
- package/dist/model/MPCVaultEventData.js +8 -3
- package/dist/model/{CreateSwapActivityRequest.js → Merchant.js} +45 -58
- package/dist/model/MessageSignDestination.js +111 -9
- package/dist/model/MessageSignDestinationType.js +15 -0
- package/dist/model/Order.js +306 -0
- package/dist/model/OrderStatus.js +76 -0
- package/dist/model/PaymentTransaction.js +201 -0
- package/dist/model/RefreshAddressBalancesByTokenRequest.js +2 -3
- package/dist/model/Refund.js +237 -0
- package/dist/model/RefundStatus.js +76 -0
- package/dist/model/RefundType.js +61 -0
- package/dist/model/SettleRequestStatus.js +76 -0
- package/dist/model/SettleStatus.js +76 -0
- package/dist/model/Settlement.js +168 -0
- package/dist/model/SettlementDetail.js +184 -0
- package/dist/model/SettlementInfo.js +175 -0
- package/dist/model/SettlementType.js +61 -0
- package/dist/model/SwapActivity.js +36 -5
- package/dist/model/SwapActivityStatus.js +66 -0
- package/dist/model/SwapActivityType.js +61 -0
- package/dist/model/SwapQuote.js +21 -34
- package/dist/model/{CreateSwapQuoteRequest.js → SwapToken.js} +73 -60
- package/dist/model/TSSRequestWebhookEventData.js +8 -3
- package/dist/model/TokenListing.js +230 -0
- package/dist/model/TokenListingEventData.js +363 -0
- package/dist/model/TokenListingRequestSource.js +61 -0
- package/dist/model/TokenListingRequestStatus.js +66 -0
- package/dist/model/TokensEventData.js +8 -3
- package/dist/model/Transaction.js +22 -5
- package/dist/model/TransactionBIP137Destination.js +122 -0
- package/dist/model/TransactionBIP322Destination.js +122 -0
- package/dist/model/TransactionBabylonBusinessInfo.js +138 -0
- package/dist/model/TransactionBabylonTxParameters.js +168 -0
- package/dist/model/TransactionCoreStakeInfo.js +168 -0
- package/dist/model/TransactionCosmosAdr36Destination.js +122 -0
- package/dist/model/TransactionCosmosContractDestination.js +152 -0
- package/dist/model/{ListEnableTokenPairs200Response.js → TransactionCosmosMessage.js} +54 -51
- package/dist/model/TransactionDestination.js +172 -8
- package/dist/model/TransactionDestinationType.js +20 -0
- package/dist/model/TransactionDetail.js +29 -7
- package/dist/model/TransactionDetails.js +29 -7
- package/dist/model/TransactionExtra.js +278 -0
- package/dist/model/TransactionExtraType.js +66 -0
- package/dist/model/TransactionFuelingInfo.js +3 -3
- package/dist/model/TransactionMessageSignBTCEIP191Destination.js +122 -0
- package/dist/model/TransactionRbfSource.js +37 -9
- package/dist/model/TransactionSelectedUtxo.js +2 -2
- package/dist/model/TransactionSubStatus.js +45 -0
- package/dist/model/TransactionWebhookEventData.js +37 -10
- package/dist/model/UpdateCustodialWalletParams.js +6 -4
- package/dist/model/UpdateExchangeWalletParams.js +6 -4
- package/dist/model/UpdateMpcWalletParams.js +6 -4
- package/dist/model/UpdateSmartContractWalletParams.js +6 -4
- package/dist/model/WalletInfoEventData.js +8 -3
- package/dist/model/WebhookEventData.js +81 -18
- package/dist/model/WebhookEventDataType.js +7 -2
- package/dist/model/WebhookEventType.js +10 -0
- package/docs/ActivityExtra.md +0 -4
- package/docs/AddressEncoding.md +6 -0
- package/docs/AddressesEventData.md +3 -1
- package/docs/BTCBIP137MessageSignDestination.md +10 -0
- package/docs/BTCBIP322MessageSignDestination.md +10 -0
- package/docs/BabylonStakingActivityDetailExtra.md +0 -4
- package/docs/BankAccount.md +10 -0
- package/docs/ChainsEventData.md +3 -1
- package/docs/CosmosAdr36MessageSignDestination.md +10 -0
- package/docs/CosmosContractCallDestination.md +11 -0
- package/docs/CosmosContractCallMessage.md +10 -0
- package/docs/CreateSettlement.md +14 -0
- package/docs/FeeStationApi.md +13 -13
- package/docs/MPCVaultEventData.md +3 -1
- package/docs/Merchant.md +11 -0
- package/docs/MessageSignDestination.md +3 -0
- package/docs/MessageSignDestinationType.md +6 -0
- package/docs/Order.md +23 -0
- package/docs/OrderStatus.md +18 -0
- package/docs/PaymentTransaction.md +16 -0
- package/docs/RefreshAddressBalancesByTokenRequest.md +1 -1
- package/docs/Refund.md +17 -0
- package/docs/RefundStatus.md +18 -0
- package/docs/RefundType.md +12 -0
- package/docs/SettleRequestStatus.md +18 -0
- package/docs/SettleStatus.md +18 -0
- package/docs/Settlement.md +12 -0
- package/docs/SettlementDetail.md +15 -0
- package/docs/SettlementInfo.md +14 -0
- package/docs/SettlementType.md +12 -0
- package/docs/SwapActivity.md +4 -1
- package/docs/SwapActivityStatus.md +14 -0
- package/docs/SwapActivityType.md +12 -0
- package/docs/SwapQuote.md +3 -4
- package/docs/SwapToken.md +14 -0
- package/docs/TSSRequestWebhookEventData.md +3 -1
- package/docs/TokenListing.md +19 -0
- package/docs/TokenListingEventData.md +45 -0
- package/docs/TokenListingRequestSource.md +12 -0
- package/docs/TokenListingRequestStatus.md +14 -0
- package/docs/TokensEventData.md +3 -1
- package/docs/Transaction.md +4 -3
- package/docs/TransactionBIP137Destination.md +10 -0
- package/docs/TransactionBIP322Destination.md +10 -0
- package/docs/TransactionBabylonBusinessInfo.md +11 -0
- package/docs/TransactionBabylonTxParameters.md +15 -0
- package/docs/TransactionCoreStakeInfo.md +14 -0
- package/docs/TransactionCosmosAdr36Destination.md +10 -0
- package/docs/TransactionCosmosContractDestination.md +11 -0
- package/docs/TransactionCosmosMessage.md +10 -0
- package/docs/TransactionDestination.md +4 -0
- package/docs/TransactionDestinationType.md +8 -0
- package/docs/TransactionDetail.md +4 -3
- package/docs/TransactionDetails.md +4 -3
- package/docs/TransactionExtra.md +21 -0
- package/docs/TransactionExtraType.md +14 -0
- package/docs/TransactionFuelingInfo.md +2 -2
- package/docs/TransactionMessageSignBTCEIP191Destination.md +10 -0
- package/docs/TransactionRbfSource.md +1 -1
- package/docs/TransactionSelectedUtxo.md +2 -2
- package/docs/TransactionSubStatus.md +18 -0
- package/docs/TransactionWebhookEventData.md +7 -4
- package/docs/TransactionsApi.md +1 -1
- package/docs/UpdateCustodialWalletParams.md +1 -1
- package/docs/UpdateExchangeWalletParams.md +1 -1
- package/docs/UpdateMpcWalletParams.md +1 -1
- package/docs/UpdateSmartContractWalletParams.md +1 -1
- package/docs/UpdateWalletParams.md +1 -1
- package/docs/WalletInfoEventData.md +3 -1
- package/docs/WalletsApi.md +5 -5
- package/docs/WebhookEventData.md +16 -8
- package/docs/WebhookEventDataType.md +3 -1
- package/docs/WebhookEventType.md +4 -0
- package/package.json +1 -1
- package/dist/api/SwapsApi.js +0 -360
- package/dist/model/CreateSwapQuote201Response.js +0 -264
- package/dist/model/SwapTokenPair.js +0 -100
- package/docs/CreateSwapActivityRequest.md +0 -12
- package/docs/CreateSwapQuote201Response.md +0 -17
- package/docs/CreateSwapQuoteRequest.md +0 -13
- package/docs/ListEnableTokenPairs200Response.md +0 -10
- package/docs/ListSwapActivities200Response.md +0 -10
- package/docs/SwapTokenPair.md +0 -10
- package/docs/SwapsApi.md +0 -348
|
@@ -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 BTCBIP137MessageSignDestination model module.
|
|
30
|
+
* @module model/BTCBIP137MessageSignDestination
|
|
31
|
+
*/
|
|
32
|
+
var BTCBIP137MessageSignDestination = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>BTCBIP137MessageSignDestination</code>.
|
|
35
|
+
* The information about the destination `BTC_BIP_137`. 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.
|
|
36
|
+
* @alias module:model/BTCBIP137MessageSignDestination
|
|
37
|
+
* @param destination_type {module:model/MessageSignDestinationType}
|
|
38
|
+
* @param message_bip137 {String} Message to be signed, in hexadecimal format.
|
|
39
|
+
*/
|
|
40
|
+
function BTCBIP137MessageSignDestination(destination_type, message_bip137) {
|
|
41
|
+
_classCallCheck(this, BTCBIP137MessageSignDestination);
|
|
42
|
+
BTCBIP137MessageSignDestination.initialize(this, destination_type, message_bip137);
|
|
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(BTCBIP137MessageSignDestination, null, [{
|
|
51
|
+
key: "initialize",
|
|
52
|
+
value: function initialize(obj, destination_type, message_bip137) {
|
|
53
|
+
obj['destination_type'] = destination_type;
|
|
54
|
+
obj['message_bip137'] = message_bip137;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Constructs a <code>BTCBIP137MessageSignDestination</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/BTCBIP137MessageSignDestination} obj Optional instance to populate.
|
|
62
|
+
* @return {module:model/BTCBIP137MessageSignDestination} The populated <code>BTCBIP137MessageSignDestination</code> instance.
|
|
63
|
+
*/
|
|
64
|
+
}, {
|
|
65
|
+
key: "constructFromObject",
|
|
66
|
+
value: function constructFromObject(data, obj) {
|
|
67
|
+
if (data) {
|
|
68
|
+
obj = obj || new BTCBIP137MessageSignDestination();
|
|
69
|
+
if (data.hasOwnProperty('destination_type')) {
|
|
70
|
+
obj['destination_type'] = _MessageSignDestinationType["default"].constructFromObject(data['destination_type']);
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('message_bip137')) {
|
|
73
|
+
obj['message_bip137'] = _ApiClient["default"].convertToType(data['message_bip137'], 'String');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return obj;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Validates the JSON data with respect to <code>BTCBIP137MessageSignDestination</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>BTCBIP137MessageSignDestination</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(BTCBIP137MessageSignDestination.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_bip137'] && !(typeof data['message_bip137'] === 'string' || data['message_bip137'] instanceof String)) {
|
|
104
|
+
throw new Error("Expected the field `message_bip137` to be a primitive type in the JSON string but got " + data['message_bip137']);
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
}]);
|
|
109
|
+
}();
|
|
110
|
+
BTCBIP137MessageSignDestination.RequiredProperties = ["destination_type", "message_bip137"];
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @member {module:model/MessageSignDestinationType} destination_type
|
|
114
|
+
*/
|
|
115
|
+
BTCBIP137MessageSignDestination.prototype['destination_type'] = undefined;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Message to be signed, in hexadecimal format.
|
|
119
|
+
* @member {String} message_bip137
|
|
120
|
+
*/
|
|
121
|
+
BTCBIP137MessageSignDestination.prototype['message_bip137'] = undefined;
|
|
122
|
+
var _default = exports["default"] = BTCBIP137MessageSignDestination;
|
|
@@ -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 BTCBIP322MessageSignDestination model module.
|
|
30
|
+
* @module model/BTCBIP322MessageSignDestination
|
|
31
|
+
*/
|
|
32
|
+
var BTCBIP322MessageSignDestination = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>BTCBIP322MessageSignDestination</code>.
|
|
35
|
+
* The information about the destination `BTC_BIP_322`. 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.
|
|
36
|
+
* @alias module:model/BTCBIP322MessageSignDestination
|
|
37
|
+
* @param destination_type {module:model/MessageSignDestinationType}
|
|
38
|
+
* @param message_bip322 {String} Message to be signed, in hexadecimal format.
|
|
39
|
+
*/
|
|
40
|
+
function BTCBIP322MessageSignDestination(destination_type, message_bip322) {
|
|
41
|
+
_classCallCheck(this, BTCBIP322MessageSignDestination);
|
|
42
|
+
BTCBIP322MessageSignDestination.initialize(this, destination_type, message_bip322);
|
|
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(BTCBIP322MessageSignDestination, null, [{
|
|
51
|
+
key: "initialize",
|
|
52
|
+
value: function initialize(obj, destination_type, message_bip322) {
|
|
53
|
+
obj['destination_type'] = destination_type;
|
|
54
|
+
obj['message_bip322'] = message_bip322;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Constructs a <code>BTCBIP322MessageSignDestination</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/BTCBIP322MessageSignDestination} obj Optional instance to populate.
|
|
62
|
+
* @return {module:model/BTCBIP322MessageSignDestination} The populated <code>BTCBIP322MessageSignDestination</code> instance.
|
|
63
|
+
*/
|
|
64
|
+
}, {
|
|
65
|
+
key: "constructFromObject",
|
|
66
|
+
value: function constructFromObject(data, obj) {
|
|
67
|
+
if (data) {
|
|
68
|
+
obj = obj || new BTCBIP322MessageSignDestination();
|
|
69
|
+
if (data.hasOwnProperty('destination_type')) {
|
|
70
|
+
obj['destination_type'] = _MessageSignDestinationType["default"].constructFromObject(data['destination_type']);
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('message_bip322')) {
|
|
73
|
+
obj['message_bip322'] = _ApiClient["default"].convertToType(data['message_bip322'], 'String');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return obj;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Validates the JSON data with respect to <code>BTCBIP322MessageSignDestination</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>BTCBIP322MessageSignDestination</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(BTCBIP322MessageSignDestination.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_bip322'] && !(typeof data['message_bip322'] === 'string' || data['message_bip322'] instanceof String)) {
|
|
104
|
+
throw new Error("Expected the field `message_bip322` to be a primitive type in the JSON string but got " + data['message_bip322']);
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
}]);
|
|
109
|
+
}();
|
|
110
|
+
BTCBIP322MessageSignDestination.RequiredProperties = ["destination_type", "message_bip322"];
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @member {module:model/MessageSignDestinationType} destination_type
|
|
114
|
+
*/
|
|
115
|
+
BTCBIP322MessageSignDestination.prototype['destination_type'] = undefined;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Message to be signed, in hexadecimal format.
|
|
119
|
+
* @member {String} message_bip322
|
|
120
|
+
*/
|
|
121
|
+
BTCBIP322MessageSignDestination.prototype['message_bip322'] = undefined;
|
|
122
|
+
var _default = exports["default"] = BTCBIP322MessageSignDestination;
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
-
var _ActivityType = _interopRequireDefault(require("./ActivityType"));
|
|
9
8
|
var _BaseStakeExtra = _interopRequireDefault(require("./BaseStakeExtra"));
|
|
10
9
|
var _StakingPoolType = _interopRequireDefault(require("./StakingPoolType"));
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -80,18 +79,6 @@ var BabylonStakingActivityDetailExtra = /*#__PURE__*/function () {
|
|
|
80
79
|
if (data.hasOwnProperty('auto_broadcast')) {
|
|
81
80
|
obj['auto_broadcast'] = _ApiClient["default"].convertToType(data['auto_broadcast'], 'Boolean');
|
|
82
81
|
}
|
|
83
|
-
if (data.hasOwnProperty('param_version')) {
|
|
84
|
-
obj['param_version'] = _ApiClient["default"].convertToType(data['param_version'], 'Number');
|
|
85
|
-
}
|
|
86
|
-
if (data.hasOwnProperty('withdraw_from_type')) {
|
|
87
|
-
obj['withdraw_from_type'] = _ActivityType["default"].constructFromObject(data['withdraw_from_type']);
|
|
88
|
-
}
|
|
89
|
-
if (data.hasOwnProperty('slash_from_type')) {
|
|
90
|
-
obj['slash_from_type'] = _ActivityType["default"].constructFromObject(data['slash_from_type']);
|
|
91
|
-
}
|
|
92
|
-
if (data.hasOwnProperty('stake_amount')) {
|
|
93
|
-
obj['stake_amount'] = _ApiClient["default"].convertToType(data['stake_amount'], 'String');
|
|
94
|
-
}
|
|
95
82
|
}
|
|
96
83
|
return obj;
|
|
97
84
|
}
|
|
@@ -123,10 +110,6 @@ var BabylonStakingActivityDetailExtra = /*#__PURE__*/function () {
|
|
|
123
110
|
if (data['finality_provider_public_key'] && !(typeof data['finality_provider_public_key'] === 'string' || data['finality_provider_public_key'] instanceof String)) {
|
|
124
111
|
throw new Error("Expected the field `finality_provider_public_key` to be a primitive type in the JSON string but got " + data['finality_provider_public_key']);
|
|
125
112
|
}
|
|
126
|
-
// ensure the json data is a string
|
|
127
|
-
if (data['stake_amount'] && !(typeof data['stake_amount'] === 'string' || data['stake_amount'] instanceof String)) {
|
|
128
|
-
throw new Error("Expected the field `stake_amount` to be a primitive type in the JSON string but got " + data['stake_amount']);
|
|
129
|
-
}
|
|
130
113
|
return true;
|
|
131
114
|
}
|
|
132
115
|
}]);
|
|
@@ -156,28 +139,6 @@ BabylonStakingActivityDetailExtra.prototype['stake_block_time'] = undefined;
|
|
|
156
139
|
*/
|
|
157
140
|
BabylonStakingActivityDetailExtra.prototype['auto_broadcast'] = undefined;
|
|
158
141
|
|
|
159
|
-
/**
|
|
160
|
-
* The version of babylon global parameters.
|
|
161
|
-
* @member {Number} param_version
|
|
162
|
-
*/
|
|
163
|
-
BabylonStakingActivityDetailExtra.prototype['param_version'] = undefined;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* @member {module:model/ActivityType} withdraw_from_type
|
|
167
|
-
*/
|
|
168
|
-
BabylonStakingActivityDetailExtra.prototype['withdraw_from_type'] = undefined;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* @member {module:model/ActivityType} slash_from_type
|
|
172
|
-
*/
|
|
173
|
-
BabylonStakingActivityDetailExtra.prototype['slash_from_type'] = undefined;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* The origin staking amount.
|
|
177
|
-
* @member {String} stake_amount
|
|
178
|
-
*/
|
|
179
|
-
BabylonStakingActivityDetailExtra.prototype['stake_amount'] = undefined;
|
|
180
|
-
|
|
181
142
|
// Implement BaseStakeExtra interface:
|
|
182
143
|
/**
|
|
183
144
|
* @member {module:model/StakingPoolType} pool_type
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
-
var _Pagination = _interopRequireDefault(require("./Pagination"));
|
|
9
|
-
var _SwapActivity = _interopRequireDefault(require("./SwapActivity"));
|
|
10
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
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); }
|
|
12
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; } } }; }
|
|
@@ -27,17 +25,19 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
27
25
|
*
|
|
28
26
|
*/
|
|
29
27
|
/**
|
|
30
|
-
* The
|
|
31
|
-
* @module model/
|
|
28
|
+
* The BankAccount model module.
|
|
29
|
+
* @module model/BankAccount
|
|
32
30
|
*/
|
|
33
|
-
var
|
|
31
|
+
var BankAccount = /*#__PURE__*/function () {
|
|
34
32
|
/**
|
|
35
|
-
* Constructs a new <code>
|
|
36
|
-
* @alias module:model/
|
|
33
|
+
* Constructs a new <code>BankAccount</code>.
|
|
34
|
+
* @alias module:model/BankAccount
|
|
35
|
+
* @param bank_account_id {String} The bank account ID.
|
|
36
|
+
* @param info {Object.<String, Object>} JSON-formatted bank account details.
|
|
37
37
|
*/
|
|
38
|
-
function
|
|
39
|
-
_classCallCheck(this,
|
|
40
|
-
|
|
38
|
+
function BankAccount(bank_account_id, info) {
|
|
39
|
+
_classCallCheck(this, BankAccount);
|
|
40
|
+
BankAccount.initialize(this, bank_account_id, info);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/**
|
|
@@ -45,79 +45,79 @@ var ListSwapActivities200Response = /*#__PURE__*/function () {
|
|
|
45
45
|
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
46
46
|
* Only for internal use.
|
|
47
47
|
*/
|
|
48
|
-
return _createClass(
|
|
48
|
+
return _createClass(BankAccount, null, [{
|
|
49
49
|
key: "initialize",
|
|
50
|
-
value: function initialize(obj) {
|
|
50
|
+
value: function initialize(obj, bank_account_id, info) {
|
|
51
|
+
obj['bank_account_id'] = bank_account_id;
|
|
52
|
+
obj['info'] = info;
|
|
53
|
+
}
|
|
51
54
|
|
|
52
55
|
/**
|
|
53
|
-
* Constructs a <code>
|
|
56
|
+
* Constructs a <code>BankAccount</code> from a plain JavaScript object, optionally creating a new instance.
|
|
54
57
|
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
55
58
|
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
56
|
-
* @param {module:model/
|
|
57
|
-
* @return {module:model/
|
|
59
|
+
* @param {module:model/BankAccount} obj Optional instance to populate.
|
|
60
|
+
* @return {module:model/BankAccount} The populated <code>BankAccount</code> instance.
|
|
58
61
|
*/
|
|
59
62
|
}, {
|
|
60
63
|
key: "constructFromObject",
|
|
61
64
|
value: function constructFromObject(data, obj) {
|
|
62
65
|
if (data) {
|
|
63
|
-
obj = obj || new
|
|
64
|
-
if (data.hasOwnProperty('
|
|
65
|
-
obj['
|
|
66
|
+
obj = obj || new BankAccount();
|
|
67
|
+
if (data.hasOwnProperty('bank_account_id')) {
|
|
68
|
+
obj['bank_account_id'] = _ApiClient["default"].convertToType(data['bank_account_id'], 'String');
|
|
66
69
|
}
|
|
67
|
-
if (data.hasOwnProperty('
|
|
68
|
-
obj['
|
|
70
|
+
if (data.hasOwnProperty('info')) {
|
|
71
|
+
obj['info'] = _ApiClient["default"].convertToType(data['info'], {
|
|
72
|
+
'String': Object
|
|
73
|
+
});
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
76
|
return obj;
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
/**
|
|
75
|
-
* Validates the JSON data with respect to <code>
|
|
80
|
+
* Validates the JSON data with respect to <code>BankAccount</code>.
|
|
76
81
|
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
77
|
-
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>
|
|
82
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>BankAccount</code>.
|
|
78
83
|
*/
|
|
79
84
|
}, {
|
|
80
85
|
key: "validateJSON",
|
|
81
86
|
value: function validateJSON(data) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
_step;
|
|
91
|
-
try {
|
|
92
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
93
|
-
var item = _step.value;
|
|
94
|
-
_SwapActivity["default"].validateJSON(item);
|
|
87
|
+
// check to make sure all required properties are present in the JSON string
|
|
88
|
+
var _iterator = _createForOfIteratorHelper(BankAccount.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
95
|
}
|
|
96
|
-
} catch (err) {
|
|
97
|
-
_iterator.e(err);
|
|
98
|
-
} finally {
|
|
99
|
-
_iterator.f();
|
|
100
96
|
}
|
|
101
|
-
|
|
97
|
+
// ensure the json data is a string
|
|
98
|
+
} catch (err) {
|
|
99
|
+
_iterator.e(err);
|
|
100
|
+
} finally {
|
|
101
|
+
_iterator.f();
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
// data not null
|
|
106
|
-
if (!!_Pagination["default"].validateJSON) {
|
|
107
|
-
_Pagination["default"].validateJSON(data['pagination']);
|
|
108
|
-
}
|
|
103
|
+
if (data['bank_account_id'] && !(typeof data['bank_account_id'] === 'string' || data['bank_account_id'] instanceof String)) {
|
|
104
|
+
throw new Error("Expected the field `bank_account_id` to be a primitive type in the JSON string but got " + data['bank_account_id']);
|
|
109
105
|
}
|
|
110
106
|
return true;
|
|
111
107
|
}
|
|
112
108
|
}]);
|
|
113
109
|
}();
|
|
110
|
+
BankAccount.RequiredProperties = ["bank_account_id", "info"];
|
|
111
|
+
|
|
114
112
|
/**
|
|
115
|
-
*
|
|
113
|
+
* The bank account ID.
|
|
114
|
+
* @member {String} bank_account_id
|
|
116
115
|
*/
|
|
117
|
-
|
|
116
|
+
BankAccount.prototype['bank_account_id'] = undefined;
|
|
118
117
|
|
|
119
118
|
/**
|
|
120
|
-
*
|
|
119
|
+
* JSON-formatted bank account details.
|
|
120
|
+
* @member {Object.<String, Object>} info
|
|
121
121
|
*/
|
|
122
|
-
|
|
123
|
-
var _default = exports["default"] =
|
|
122
|
+
BankAccount.prototype['info'] = undefined;
|
|
123
|
+
var _default = exports["default"] = BankAccount;
|
|
@@ -35,7 +35,7 @@ var ChainsEventData = /*#__PURE__*/function () {
|
|
|
35
35
|
* Constructs a new <code>ChainsEventData</code>.
|
|
36
36
|
* @alias module:model/ChainsEventData
|
|
37
37
|
* @implements module:model/WebhookEventDataType
|
|
38
|
-
* @param data_type {module:model/ChainsEventData.DataTypeEnum} The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data.
|
|
38
|
+
* @param data_type {module:model/ChainsEventData.DataTypeEnum} The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data.
|
|
39
39
|
* @param chains {Array.<module:model/ChainInfo>} The enabled chains.
|
|
40
40
|
*/
|
|
41
41
|
function ChainsEventData(data_type, chains) {
|
|
@@ -134,7 +134,7 @@ var ChainsEventData = /*#__PURE__*/function () {
|
|
|
134
134
|
ChainsEventData.RequiredProperties = ["data_type", "chains"];
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
|
-
* The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data.
|
|
137
|
+
* The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data.
|
|
138
138
|
* @member {module:model/ChainsEventData.DataTypeEnum} data_type
|
|
139
139
|
*/
|
|
140
140
|
ChainsEventData.prototype['data_type'] = undefined;
|
|
@@ -147,7 +147,7 @@ ChainsEventData.prototype['chains'] = undefined;
|
|
|
147
147
|
|
|
148
148
|
// Implement WebhookEventDataType interface:
|
|
149
149
|
/**
|
|
150
|
-
* The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data.
|
|
150
|
+
* The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data.
|
|
151
151
|
* @member {module:model/WebhookEventDataType.DataTypeEnum} data_type
|
|
152
152
|
*/
|
|
153
153
|
_WebhookEventDataType["default"].prototype['data_type'] = undefined;
|
|
@@ -193,6 +193,11 @@ ChainsEventData['DataTypeEnum'] = {
|
|
|
193
193
|
* @const
|
|
194
194
|
*/
|
|
195
195
|
"Tokens": "Tokens",
|
|
196
|
+
/**
|
|
197
|
+
* value: "TokenListing"
|
|
198
|
+
* @const
|
|
199
|
+
*/
|
|
200
|
+
"TokenListing": "TokenListing",
|
|
196
201
|
/**
|
|
197
202
|
* value: "unknown_default_open_api"
|
|
198
203
|
* @const
|
|
@@ -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 CosmosAdr36MessageSignDestination model module.
|
|
30
|
+
* @module model/CosmosAdr36MessageSignDestination
|
|
31
|
+
*/
|
|
32
|
+
var CosmosAdr36MessageSignDestination = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>CosmosAdr36MessageSignDestination</code>.
|
|
35
|
+
* The information about the destination `COSMOS_ADR_36`. 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.
|
|
36
|
+
* @alias module:model/CosmosAdr36MessageSignDestination
|
|
37
|
+
* @param destination_type {module:model/MessageSignDestinationType}
|
|
38
|
+
* @param message_cosmos_adr36 {String} Message to be signed, in hexadecimal format.
|
|
39
|
+
*/
|
|
40
|
+
function CosmosAdr36MessageSignDestination(destination_type, message_cosmos_adr36) {
|
|
41
|
+
_classCallCheck(this, CosmosAdr36MessageSignDestination);
|
|
42
|
+
CosmosAdr36MessageSignDestination.initialize(this, destination_type, message_cosmos_adr36);
|
|
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(CosmosAdr36MessageSignDestination, null, [{
|
|
51
|
+
key: "initialize",
|
|
52
|
+
value: function initialize(obj, destination_type, message_cosmos_adr36) {
|
|
53
|
+
obj['destination_type'] = destination_type;
|
|
54
|
+
obj['message_cosmos_adr36'] = message_cosmos_adr36;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Constructs a <code>CosmosAdr36MessageSignDestination</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/CosmosAdr36MessageSignDestination} obj Optional instance to populate.
|
|
62
|
+
* @return {module:model/CosmosAdr36MessageSignDestination} The populated <code>CosmosAdr36MessageSignDestination</code> instance.
|
|
63
|
+
*/
|
|
64
|
+
}, {
|
|
65
|
+
key: "constructFromObject",
|
|
66
|
+
value: function constructFromObject(data, obj) {
|
|
67
|
+
if (data) {
|
|
68
|
+
obj = obj || new CosmosAdr36MessageSignDestination();
|
|
69
|
+
if (data.hasOwnProperty('destination_type')) {
|
|
70
|
+
obj['destination_type'] = _MessageSignDestinationType["default"].constructFromObject(data['destination_type']);
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('message_cosmos_adr36')) {
|
|
73
|
+
obj['message_cosmos_adr36'] = _ApiClient["default"].convertToType(data['message_cosmos_adr36'], 'String');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return obj;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Validates the JSON data with respect to <code>CosmosAdr36MessageSignDestination</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>CosmosAdr36MessageSignDestination</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(CosmosAdr36MessageSignDestination.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_cosmos_adr36'] && !(typeof data['message_cosmos_adr36'] === 'string' || data['message_cosmos_adr36'] instanceof String)) {
|
|
104
|
+
throw new Error("Expected the field `message_cosmos_adr36` to be a primitive type in the JSON string but got " + data['message_cosmos_adr36']);
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
}]);
|
|
109
|
+
}();
|
|
110
|
+
CosmosAdr36MessageSignDestination.RequiredProperties = ["destination_type", "message_cosmos_adr36"];
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @member {module:model/MessageSignDestinationType} destination_type
|
|
114
|
+
*/
|
|
115
|
+
CosmosAdr36MessageSignDestination.prototype['destination_type'] = undefined;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Message to be signed, in hexadecimal format.
|
|
119
|
+
* @member {String} message_cosmos_adr36
|
|
120
|
+
*/
|
|
121
|
+
CosmosAdr36MessageSignDestination.prototype['message_cosmos_adr36'] = undefined;
|
|
122
|
+
var _default = exports["default"] = CosmosAdr36MessageSignDestination;
|