@cobo/cobo-waas2 1.14.0 → 1.16.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 +70 -5
- package/dist/ApiClient.js +2 -3
- package/dist/PreRequestScript.js +1 -1
- package/dist/api/AddressBooksApi.js +4 -4
- package/dist/api/AppWorkflowsApi.js +275 -0
- package/dist/api/DevelopersApi.js +4 -4
- package/dist/api/DevelopersWebhooksApi.js +12 -12
- package/dist/api/FeeStationApi.js +26 -26
- package/dist/api/PaymentApi.js +16 -16
- package/dist/api/StakingsApi.js +28 -28
- package/dist/api/TransactionsApi.js +16 -8
- package/dist/api/WalletsApi.js +121 -70
- package/dist/api/WalletsExchangeWalletApi.js +8 -8
- package/dist/api/WalletsMPCWalletsApi.js +20 -20
- package/dist/crypto/ApiSigner.js +1 -2
- package/dist/index.js +420 -0
- package/dist/model/AddressBook.js +18 -0
- package/dist/model/AppWorkflow.js +173 -0
- package/dist/model/AppWorkflowField.js +137 -0
- package/dist/model/AppWorkflowPolicy.js +144 -0
- package/dist/model/ApprovalEntry.js +148 -0
- package/dist/model/ApprovalRequest.js +178 -0
- package/dist/model/ApprovalRequestDetail.js +176 -0
- package/dist/model/ApprovalStatus.js +71 -0
- package/dist/model/ApprovalUser.js +146 -0
- package/dist/model/BabylonStakeExtra.js +16 -0
- package/dist/model/BankAccount.js +18 -0
- package/dist/model/BatchCheckUtxo201Response.js +107 -0
- package/dist/model/BatchCheckUtxoRequest.js +142 -0
- package/dist/model/BatchUTXOParam.js +123 -0
- package/dist/model/ChainInfo.js +9 -0
- package/dist/model/CreateApprovalRequest201Response.js +109 -0
- package/dist/model/CreateSettlement.js +4 -29
- package/dist/model/CreateStakeActivityExtra.js +6 -0
- package/dist/model/CreateTokenListingRequest201Response.js +2 -2
- package/dist/model/CreateTokenListingRequestRequest.js +4 -4
- package/dist/model/CustodialWeb3TransferSource.js +1 -1
- package/dist/model/EstimateContractCallFeeParams.js +13 -0
- package/dist/model/EstimateFeeParams.js +6 -0
- package/dist/model/EstimateTransferFeeParams.js +13 -0
- package/dist/model/FeeStationTransfer.js +1 -1
- package/dist/model/ListApprovalRequests200Response.js +123 -0
- package/dist/model/Merchant.js +18 -0
- package/dist/model/MpcTransferSource.js +1 -1
- package/dist/model/Order.js +49 -0
- package/dist/model/PaymentOrderEventData.js +64 -0
- package/dist/model/PaymentRefundEventData.js +77 -0
- package/dist/model/PaymentSettlementEvent.js +46 -0
- package/dist/model/PaymentTransaction.js +13 -0
- package/dist/model/PolicyAction.js +123 -0
- package/dist/model/PolicyActionContent.js +167 -0
- package/dist/model/PolicyActionType.js +66 -0
- package/dist/model/PolicyCondition.js +148 -0
- package/dist/model/PolicyFieldOperator.js +76 -0
- package/dist/model/PolicyFieldValueType.js +61 -0
- package/dist/model/Refund.js +53 -0
- package/dist/model/RequestApproval.js +188 -0
- package/dist/model/RevokeApprovalRequest201Response.js +118 -0
- package/dist/model/RevokeApprovalRequestRequest.js +110 -0
- package/dist/model/Settlement.js +31 -0
- package/dist/model/SettlementDetail.js +57 -0
- package/dist/model/SettlementInfo.js +31 -0
- package/dist/model/SwapActivity.js +3 -3
- package/dist/model/SwapActivityApprovers.js +122 -0
- package/dist/model/SwapActivityDetail.js +36 -6
- package/dist/model/SwapApproversStatus.js +66 -0
- package/dist/model/SwapQuote.js +49 -4
- package/dist/model/SwapToken.js +2 -2
- package/dist/model/TSSBaseRequestEventData.js +163 -0
- package/dist/model/TSSCallbackActionType.js +61 -0
- package/dist/model/TSSCallbackRequest.js +122 -0
- package/dist/model/TSSCallbackRequestType.js +76 -0
- package/dist/model/TSSCallbackResponse.js +118 -0
- package/dist/model/TSSCurve.js +61 -0
- package/dist/model/TSSCurveType.js +61 -0
- package/dist/model/TSSEvent.js +158 -0
- package/dist/model/TSSEventData.js +278 -0
- package/dist/model/TSSEventDataType.js +71 -0
- package/dist/model/TSSEventType.js +136 -0
- package/dist/model/TSSGroup.js +221 -0
- package/dist/model/TSSGroupType.js +61 -0
- package/dist/model/TSSGroups.js +1 -1
- package/dist/model/TSSKeyGenEventData.js +228 -0
- package/dist/model/TSSKeyGenExtra.js +154 -0
- package/dist/model/TSSKeyGenRequest.js +130 -0
- package/dist/model/TSSKeyReshareEventData.js +228 -0
- package/dist/model/TSSKeyReshareExtra.js +169 -0
- package/dist/model/TSSKeyReshareRequest.js +177 -0
- package/dist/model/TSSKeyShareSignDetail.js +100 -0
- package/dist/model/TSSKeyShareSignEventData.js +228 -0
- package/dist/model/TSSKeyShareSignExtra.js +171 -0
- package/dist/model/TSSKeyShareSignRequest.js +146 -0
- package/dist/model/TSSKeyShareSignSignature.js +126 -0
- package/dist/model/TSSKeyShareSignSignatures.js +107 -0
- package/dist/model/TSSKeySignEventData.js +228 -0
- package/dist/model/TSSKeySignExtra.js +203 -0
- package/dist/model/TSSKeySignRequest.js +192 -0
- package/dist/model/TSSParticipant.js +113 -0
- package/dist/model/TSSProtocol.js +66 -0
- package/dist/model/TSSRequestTypeEenum.js +71 -0
- package/dist/model/TSSSignature.js +139 -0
- package/dist/model/TSSSignatureType.js +66 -0
- package/dist/model/TSSSignatures.js +125 -0
- package/dist/model/TSSStatus.js +96 -0
- package/dist/model/TokenListing.js +10 -10
- package/dist/model/TokenListingEventData.js +15 -15
- package/dist/model/TransactionCoboCategory.js +102 -7
- package/dist/model/TransactionRbfSource.js +1 -1
- package/dist/model/TransactionSubStatus.js +35 -0
- package/dist/model/UTXO.js +9 -0
- package/dist/model/WebhookEventData.js +15 -9
- package/docs/AddressBook.md +2 -0
- package/docs/AddressBooksApi.md +2 -2
- package/docs/AppWorkflow.md +12 -0
- package/docs/AppWorkflowField.md +11 -0
- package/docs/AppWorkflowPolicy.md +10 -0
- package/docs/AppWorkflowsApi.md +273 -0
- package/docs/ApprovalEntry.md +11 -0
- package/docs/ApprovalRequest.md +13 -0
- package/docs/ApprovalRequestDetail.md +13 -0
- package/docs/ApprovalStatus.md +16 -0
- package/docs/ApprovalUser.md +12 -0
- package/docs/BabylonStakeExtra.md +1 -0
- package/docs/BankAccount.md +2 -0
- package/docs/BatchCheckUtxo201Response.md +9 -0
- package/docs/BatchCheckUtxoRequest.md +10 -0
- package/docs/BatchUTXOParam.md +10 -0
- package/docs/ChainInfo.md +1 -0
- package/docs/CreateApprovalRequest201Response.md +9 -0
- package/docs/CreateSettlement.md +2 -2
- package/docs/CreateStakeActivityExtra.md +1 -0
- package/docs/CreateTokenListingRequest201Response.md +1 -1
- package/docs/CreateTokenListingRequestRequest.md +2 -2
- package/docs/CustodialWeb3TransferSource.md +1 -1
- package/docs/DevelopersApi.md +2 -2
- package/docs/DevelopersWebhooksApi.md +6 -6
- package/docs/EstimateContractCallFeeParams.md +1 -0
- package/docs/EstimateFeeParams.md +1 -0
- package/docs/EstimateTransferFeeParams.md +1 -0
- package/docs/FeeStationApi.md +14 -14
- package/docs/ListApprovalRequests200Response.md +10 -0
- package/docs/Merchant.md +2 -0
- package/docs/MpcTransferSource.md +1 -1
- package/docs/Order.md +3 -0
- package/docs/PaymentApi.md +8 -8
- package/docs/PaymentOrderEventData.md +3 -0
- package/docs/PaymentRefundEventData.md +5 -0
- package/docs/PaymentSettlementEvent.md +3 -0
- package/docs/PaymentTransaction.md +1 -0
- package/docs/PolicyAction.md +10 -0
- package/docs/PolicyActionContent.md +25 -0
- package/docs/PolicyActionType.md +14 -0
- package/docs/PolicyCondition.md +12 -0
- package/docs/PolicyFieldOperator.md +18 -0
- package/docs/PolicyFieldValueType.md +12 -0
- package/docs/Refund.md +5 -0
- package/docs/RequestApproval.md +13 -0
- package/docs/RevokeApprovalRequest201Response.md +10 -0
- package/docs/RevokeApprovalRequestRequest.md +9 -0
- package/docs/Settlement.md +3 -0
- package/docs/SettlementDetail.md +5 -0
- package/docs/SettlementInfo.md +3 -0
- package/docs/StakingsApi.md +14 -14
- package/docs/SwapActivity.md +3 -3
- package/docs/SwapActivityApprovers.md +10 -0
- package/docs/SwapActivityDetail.md +4 -3
- package/docs/SwapApproversStatus.md +14 -0
- package/docs/SwapQuote.md +3 -0
- package/docs/SwapToken.md +2 -2
- package/docs/TSSBaseRequestEventData.md +14 -0
- package/docs/TSSCallbackActionType.md +12 -0
- package/docs/TSSCallbackRequest.md +12 -0
- package/docs/TSSCallbackRequestType.md +18 -0
- package/docs/TSSCallbackResponse.md +12 -0
- package/docs/TSSCurve.md +12 -0
- package/docs/TSSCurveType.md +12 -0
- package/docs/TSSEvent.md +13 -0
- package/docs/TSSEventData.md +16 -0
- package/docs/TSSEventDataType.md +16 -0
- package/docs/TSSEventType.md +42 -0
- package/docs/TSSGroup.md +19 -0
- package/docs/TSSGroupType.md +12 -0
- package/docs/TSSKeyGenEventData.md +16 -0
- package/docs/TSSKeyGenExtra.md +13 -0
- package/docs/TSSKeyGenRequest.md +13 -0
- package/docs/TSSKeyReshareEventData.md +16 -0
- package/docs/TSSKeyReshareExtra.md +14 -0
- package/docs/TSSKeyReshareRequest.md +17 -0
- package/docs/TSSKeyShareSignDetail.md +10 -0
- package/docs/TSSKeyShareSignEventData.md +16 -0
- package/docs/TSSKeyShareSignExtra.md +13 -0
- package/docs/TSSKeyShareSignRequest.md +12 -0
- package/docs/TSSKeyShareSignSignature.md +12 -0
- package/docs/TSSKeyShareSignSignatures.md +9 -0
- package/docs/TSSKeySignEventData.md +16 -0
- package/docs/TSSKeySignExtra.md +15 -0
- package/docs/TSSKeySignRequest.md +18 -0
- package/docs/TSSParticipant.md +11 -0
- package/docs/TSSProtocol.md +14 -0
- package/docs/TSSRequestTypeEenum.md +16 -0
- package/docs/TSSSignature.md +13 -0
- package/docs/TSSSignatureType.md +14 -0
- package/docs/TSSSignatures.md +11 -0
- package/docs/TSSStatus.md +26 -0
- package/docs/TokenListing.md +6 -6
- package/docs/TokenListingEventData.md +6 -6
- package/docs/TransactionCoboCategory.md +41 -3
- package/docs/TransactionRbfSource.md +1 -1
- package/docs/TransactionSubStatus.md +14 -0
- package/docs/TransactionsApi.md +8 -4
- package/docs/UTXO.md +1 -0
- package/docs/WalletsApi.md +91 -36
- package/docs/WalletsExchangeWalletApi.md +4 -4
- package/docs/WalletsMPCWalletsApi.md +10 -10
- package/docs/WebhookEventData.md +8 -7
- package/package.json +1 -1
|
@@ -0,0 +1,228 @@
|
|
|
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 _TSSBaseRequestEventData = _interopRequireDefault(require("./TSSBaseRequestEventData"));
|
|
9
|
+
var _TSSEventDataType = _interopRequireDefault(require("./TSSEventDataType"));
|
|
10
|
+
var _TSSKeySignRequest = _interopRequireDefault(require("./TSSKeySignRequest"));
|
|
11
|
+
var _TSSRequestTypeEenum = _interopRequireDefault(require("./TSSRequestTypeEenum"));
|
|
12
|
+
var _TSSSignatures = _interopRequireDefault(require("./TSSSignatures"));
|
|
13
|
+
var _TSSStatus = _interopRequireDefault(require("./TSSStatus"));
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
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); }
|
|
16
|
+
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; } } }; }
|
|
17
|
+
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; } }
|
|
18
|
+
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; }
|
|
19
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
20
|
+
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); } }
|
|
21
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
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); } /**
|
|
24
|
+
* Cobo Wallet as a Service 2.0
|
|
25
|
+
*
|
|
26
|
+
* Contact: help@cobo.com
|
|
27
|
+
*
|
|
28
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
29
|
+
* https://openapi-generator.tech
|
|
30
|
+
* Do not edit the class manually.
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* The TSSKeySignEventData model module.
|
|
35
|
+
* @module model/TSSKeySignEventData
|
|
36
|
+
*/
|
|
37
|
+
var TSSKeySignEventData = /*#__PURE__*/function () {
|
|
38
|
+
/**
|
|
39
|
+
* Constructs a new <code>TSSKeySignEventData</code>.
|
|
40
|
+
* @alias module:model/TSSKeySignEventData
|
|
41
|
+
* @implements module:model/TSSBaseRequestEventData
|
|
42
|
+
* @param data_type {module:model/TSSEventDataType}
|
|
43
|
+
*/
|
|
44
|
+
function TSSKeySignEventData(data_type) {
|
|
45
|
+
_classCallCheck(this, TSSKeySignEventData);
|
|
46
|
+
_TSSBaseRequestEventData["default"].initialize(this, data_type);
|
|
47
|
+
TSSKeySignEventData.initialize(this, data_type);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Initializes the fields of this object.
|
|
52
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
53
|
+
* Only for internal use.
|
|
54
|
+
*/
|
|
55
|
+
return _createClass(TSSKeySignEventData, null, [{
|
|
56
|
+
key: "initialize",
|
|
57
|
+
value: function initialize(obj, data_type) {
|
|
58
|
+
obj['data_type'] = data_type;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Constructs a <code>TSSKeySignEventData</code> from a plain JavaScript object, optionally creating a new instance.
|
|
63
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
64
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
65
|
+
* @param {module:model/TSSKeySignEventData} obj Optional instance to populate.
|
|
66
|
+
* @return {module:model/TSSKeySignEventData} The populated <code>TSSKeySignEventData</code> instance.
|
|
67
|
+
*/
|
|
68
|
+
}, {
|
|
69
|
+
key: "constructFromObject",
|
|
70
|
+
value: function constructFromObject(data, obj) {
|
|
71
|
+
if (data) {
|
|
72
|
+
obj = obj || new TSSKeySignEventData();
|
|
73
|
+
_TSSBaseRequestEventData["default"].constructFromObject(data, obj);
|
|
74
|
+
if (data.hasOwnProperty('data_type')) {
|
|
75
|
+
obj['data_type'] = _TSSEventDataType["default"].constructFromObject(data['data_type']);
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('request_id')) {
|
|
78
|
+
obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('request_type')) {
|
|
81
|
+
obj['request_type'] = _TSSRequestTypeEenum["default"].constructFromObject(data['request_type']);
|
|
82
|
+
}
|
|
83
|
+
if (data.hasOwnProperty('request_status')) {
|
|
84
|
+
obj['request_status'] = _TSSStatus["default"].constructFromObject(data['request_status']);
|
|
85
|
+
}
|
|
86
|
+
if (data.hasOwnProperty('extra_info')) {
|
|
87
|
+
obj['extra_info'] = _ApiClient["default"].convertToType(data['extra_info'], 'String');
|
|
88
|
+
}
|
|
89
|
+
if (data.hasOwnProperty('failed_reason')) {
|
|
90
|
+
obj['failed_reason'] = _ApiClient["default"].convertToType(data['failed_reason'], 'String');
|
|
91
|
+
}
|
|
92
|
+
if (data.hasOwnProperty('request_detail')) {
|
|
93
|
+
obj['request_detail'] = _TSSKeySignRequest["default"].constructFromObject(data['request_detail']);
|
|
94
|
+
}
|
|
95
|
+
if (data.hasOwnProperty('result')) {
|
|
96
|
+
obj['result'] = _TSSSignatures["default"].constructFromObject(data['result']);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return obj;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Validates the JSON data with respect to <code>TSSKeySignEventData</code>.
|
|
104
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
105
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TSSKeySignEventData</code>.
|
|
106
|
+
*/
|
|
107
|
+
}, {
|
|
108
|
+
key: "validateJSON",
|
|
109
|
+
value: function validateJSON(data) {
|
|
110
|
+
// check to make sure all required properties are present in the JSON string
|
|
111
|
+
var _iterator = _createForOfIteratorHelper(TSSKeySignEventData.RequiredProperties),
|
|
112
|
+
_step;
|
|
113
|
+
try {
|
|
114
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
115
|
+
var property = _step.value;
|
|
116
|
+
if (!data.hasOwnProperty(property)) {
|
|
117
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// ensure the json data is a string
|
|
121
|
+
} catch (err) {
|
|
122
|
+
_iterator.e(err);
|
|
123
|
+
} finally {
|
|
124
|
+
_iterator.f();
|
|
125
|
+
}
|
|
126
|
+
if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
|
|
127
|
+
throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
|
|
128
|
+
}
|
|
129
|
+
// ensure the json data is a string
|
|
130
|
+
if (data['extra_info'] && !(typeof data['extra_info'] === 'string' || data['extra_info'] instanceof String)) {
|
|
131
|
+
throw new Error("Expected the field `extra_info` to be a primitive type in the JSON string but got " + data['extra_info']);
|
|
132
|
+
}
|
|
133
|
+
// ensure the json data is a string
|
|
134
|
+
if (data['failed_reason'] && !(typeof data['failed_reason'] === 'string' || data['failed_reason'] instanceof String)) {
|
|
135
|
+
throw new Error("Expected the field `failed_reason` to be a primitive type in the JSON string but got " + data['failed_reason']);
|
|
136
|
+
}
|
|
137
|
+
// validate the optional field `request_detail`
|
|
138
|
+
if (data['request_detail']) {
|
|
139
|
+
// data not null
|
|
140
|
+
if (!!_TSSKeySignRequest["default"].validateJSON) {
|
|
141
|
+
_TSSKeySignRequest["default"].validateJSON(data['request_detail']);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// validate the optional field `result`
|
|
145
|
+
if (data['result']) {
|
|
146
|
+
// data not null
|
|
147
|
+
if (!!_TSSSignatures["default"].validateJSON) {
|
|
148
|
+
_TSSSignatures["default"].validateJSON(data['result']);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
}]);
|
|
154
|
+
}();
|
|
155
|
+
TSSKeySignEventData.RequiredProperties = ["data_type"];
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @member {module:model/TSSEventDataType} data_type
|
|
159
|
+
*/
|
|
160
|
+
TSSKeySignEventData.prototype['data_type'] = undefined;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The request ID.
|
|
164
|
+
* @member {String} request_id
|
|
165
|
+
*/
|
|
166
|
+
TSSKeySignEventData.prototype['request_id'] = undefined;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @member {module:model/TSSRequestTypeEenum} request_type
|
|
170
|
+
*/
|
|
171
|
+
TSSKeySignEventData.prototype['request_type'] = undefined;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @member {module:model/TSSStatus} request_status
|
|
175
|
+
*/
|
|
176
|
+
TSSKeySignEventData.prototype['request_status'] = undefined;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The extra info.
|
|
180
|
+
* @member {String} extra_info
|
|
181
|
+
*/
|
|
182
|
+
TSSKeySignEventData.prototype['extra_info'] = undefined;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The failed reason.
|
|
186
|
+
* @member {String} failed_reason
|
|
187
|
+
*/
|
|
188
|
+
TSSKeySignEventData.prototype['failed_reason'] = undefined;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @member {module:model/TSSKeySignRequest} request_detail
|
|
192
|
+
*/
|
|
193
|
+
TSSKeySignEventData.prototype['request_detail'] = undefined;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @member {module:model/TSSSignatures} result
|
|
197
|
+
*/
|
|
198
|
+
TSSKeySignEventData.prototype['result'] = undefined;
|
|
199
|
+
|
|
200
|
+
// Implement TSSBaseRequestEventData interface:
|
|
201
|
+
/**
|
|
202
|
+
* @member {module:model/TSSEventDataType} data_type
|
|
203
|
+
*/
|
|
204
|
+
_TSSBaseRequestEventData["default"].prototype['data_type'] = undefined;
|
|
205
|
+
/**
|
|
206
|
+
* The request ID.
|
|
207
|
+
* @member {String} request_id
|
|
208
|
+
*/
|
|
209
|
+
_TSSBaseRequestEventData["default"].prototype['request_id'] = undefined;
|
|
210
|
+
/**
|
|
211
|
+
* @member {module:model/TSSRequestTypeEenum} request_type
|
|
212
|
+
*/
|
|
213
|
+
_TSSBaseRequestEventData["default"].prototype['request_type'] = undefined;
|
|
214
|
+
/**
|
|
215
|
+
* @member {module:model/TSSStatus} request_status
|
|
216
|
+
*/
|
|
217
|
+
_TSSBaseRequestEventData["default"].prototype['request_status'] = undefined;
|
|
218
|
+
/**
|
|
219
|
+
* The extra info.
|
|
220
|
+
* @member {String} extra_info
|
|
221
|
+
*/
|
|
222
|
+
_TSSBaseRequestEventData["default"].prototype['extra_info'] = undefined;
|
|
223
|
+
/**
|
|
224
|
+
* The failed reason.
|
|
225
|
+
* @member {String} failed_reason
|
|
226
|
+
*/
|
|
227
|
+
_TSSBaseRequestEventData["default"].prototype['failed_reason'] = undefined;
|
|
228
|
+
var _default = exports["default"] = TSSKeySignEventData;
|
|
@@ -0,0 +1,203 @@
|
|
|
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 _AddressInfo = _interopRequireDefault(require("./AddressInfo"));
|
|
9
|
+
var _KeyShareHolderGroup = _interopRequireDefault(require("./KeyShareHolderGroup"));
|
|
10
|
+
var _MPCProject = _interopRequireDefault(require("./MPCProject"));
|
|
11
|
+
var _MPCVault = _interopRequireDefault(require("./MPCVault"));
|
|
12
|
+
var _MPCWalletInfo = _interopRequireDefault(require("./MPCWalletInfo"));
|
|
13
|
+
var _OrgInfo = _interopRequireDefault(require("./OrgInfo"));
|
|
14
|
+
var _Transaction = _interopRequireDefault(require("./Transaction"));
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
|
+
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); }
|
|
17
|
+
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; } } }; }
|
|
18
|
+
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; } }
|
|
19
|
+
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; }
|
|
20
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
21
|
+
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); } }
|
|
22
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
23
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
24
|
+
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); } /**
|
|
25
|
+
* Cobo Wallet as a Service 2.0
|
|
26
|
+
*
|
|
27
|
+
* Contact: help@cobo.com
|
|
28
|
+
*
|
|
29
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
30
|
+
* https://openapi-generator.tech
|
|
31
|
+
* Do not edit the class manually.
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* The TSSKeySignExtra model module.
|
|
36
|
+
* @module model/TSSKeySignExtra
|
|
37
|
+
*/
|
|
38
|
+
var TSSKeySignExtra = /*#__PURE__*/function () {
|
|
39
|
+
/**
|
|
40
|
+
* Constructs a new <code>TSSKeySignExtra</code>.
|
|
41
|
+
* @alias module:model/TSSKeySignExtra
|
|
42
|
+
*/
|
|
43
|
+
function TSSKeySignExtra() {
|
|
44
|
+
_classCallCheck(this, TSSKeySignExtra);
|
|
45
|
+
TSSKeySignExtra.initialize(this);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Initializes the fields of this object.
|
|
50
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
51
|
+
* Only for internal use.
|
|
52
|
+
*/
|
|
53
|
+
return _createClass(TSSKeySignExtra, null, [{
|
|
54
|
+
key: "initialize",
|
|
55
|
+
value: function initialize(obj) {}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Constructs a <code>TSSKeySignExtra</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/TSSKeySignExtra} obj Optional instance to populate.
|
|
62
|
+
* @return {module:model/TSSKeySignExtra} The populated <code>TSSKeySignExtra</code> instance.
|
|
63
|
+
*/
|
|
64
|
+
}, {
|
|
65
|
+
key: "constructFromObject",
|
|
66
|
+
value: function constructFromObject(data, obj) {
|
|
67
|
+
if (data) {
|
|
68
|
+
obj = obj || new TSSKeySignExtra();
|
|
69
|
+
if (data.hasOwnProperty('org')) {
|
|
70
|
+
obj['org'] = _OrgInfo["default"].constructFromObject(data['org']);
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('project')) {
|
|
73
|
+
obj['project'] = _MPCProject["default"].constructFromObject(data['project']);
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('vault')) {
|
|
76
|
+
obj['vault'] = _MPCVault["default"].constructFromObject(data['vault']);
|
|
77
|
+
}
|
|
78
|
+
if (data.hasOwnProperty('wallet')) {
|
|
79
|
+
obj['wallet'] = _MPCWalletInfo["default"].constructFromObject(data['wallet']);
|
|
80
|
+
}
|
|
81
|
+
if (data.hasOwnProperty('signer_key_share_holder_group')) {
|
|
82
|
+
obj['signer_key_share_holder_group'] = _KeyShareHolderGroup["default"].constructFromObject(data['signer_key_share_holder_group']);
|
|
83
|
+
}
|
|
84
|
+
if (data.hasOwnProperty('source_addresses')) {
|
|
85
|
+
obj['source_addresses'] = _ApiClient["default"].convertToType(data['source_addresses'], [_AddressInfo["default"]]);
|
|
86
|
+
}
|
|
87
|
+
if (data.hasOwnProperty('transaction')) {
|
|
88
|
+
obj['transaction'] = _Transaction["default"].constructFromObject(data['transaction']);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return obj;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Validates the JSON data with respect to <code>TSSKeySignExtra</code>.
|
|
96
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
97
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TSSKeySignExtra</code>.
|
|
98
|
+
*/
|
|
99
|
+
}, {
|
|
100
|
+
key: "validateJSON",
|
|
101
|
+
value: function validateJSON(data) {
|
|
102
|
+
// validate the optional field `org`
|
|
103
|
+
if (data['org']) {
|
|
104
|
+
// data not null
|
|
105
|
+
if (!!_OrgInfo["default"].validateJSON) {
|
|
106
|
+
_OrgInfo["default"].validateJSON(data['org']);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// validate the optional field `project`
|
|
110
|
+
if (data['project']) {
|
|
111
|
+
// data not null
|
|
112
|
+
if (!!_MPCProject["default"].validateJSON) {
|
|
113
|
+
_MPCProject["default"].validateJSON(data['project']);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// validate the optional field `vault`
|
|
117
|
+
if (data['vault']) {
|
|
118
|
+
// data not null
|
|
119
|
+
if (!!_MPCVault["default"].validateJSON) {
|
|
120
|
+
_MPCVault["default"].validateJSON(data['vault']);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// validate the optional field `wallet`
|
|
124
|
+
if (data['wallet']) {
|
|
125
|
+
// data not null
|
|
126
|
+
if (!!_MPCWalletInfo["default"].validateJSON) {
|
|
127
|
+
_MPCWalletInfo["default"].validateJSON(data['wallet']);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// validate the optional field `signer_key_share_holder_group`
|
|
131
|
+
if (data['signer_key_share_holder_group']) {
|
|
132
|
+
// data not null
|
|
133
|
+
if (!!_KeyShareHolderGroup["default"].validateJSON) {
|
|
134
|
+
_KeyShareHolderGroup["default"].validateJSON(data['signer_key_share_holder_group']);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (data['source_addresses']) {
|
|
138
|
+
// data not null
|
|
139
|
+
// ensure the json data is an array
|
|
140
|
+
if (!Array.isArray(data['source_addresses'])) {
|
|
141
|
+
throw new Error("Expected the field `source_addresses` to be an array in the JSON data but got " + data['source_addresses']);
|
|
142
|
+
}
|
|
143
|
+
// validate the optional field `source_addresses` (array)
|
|
144
|
+
var _iterator = _createForOfIteratorHelper(data['source_addresses']),
|
|
145
|
+
_step;
|
|
146
|
+
try {
|
|
147
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
148
|
+
var item = _step.value;
|
|
149
|
+
_AddressInfo["default"].validateJSON(item);
|
|
150
|
+
}
|
|
151
|
+
} catch (err) {
|
|
152
|
+
_iterator.e(err);
|
|
153
|
+
} finally {
|
|
154
|
+
_iterator.f();
|
|
155
|
+
}
|
|
156
|
+
;
|
|
157
|
+
}
|
|
158
|
+
// validate the optional field `transaction`
|
|
159
|
+
if (data['transaction']) {
|
|
160
|
+
// data not null
|
|
161
|
+
if (!!_Transaction["default"].validateJSON) {
|
|
162
|
+
_Transaction["default"].validateJSON(data['transaction']);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
}]);
|
|
168
|
+
}();
|
|
169
|
+
/**
|
|
170
|
+
* @member {module:model/OrgInfo} org
|
|
171
|
+
*/
|
|
172
|
+
TSSKeySignExtra.prototype['org'] = undefined;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @member {module:model/MPCProject} project
|
|
176
|
+
*/
|
|
177
|
+
TSSKeySignExtra.prototype['project'] = undefined;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @member {module:model/MPCVault} vault
|
|
181
|
+
*/
|
|
182
|
+
TSSKeySignExtra.prototype['vault'] = undefined;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @member {module:model/MPCWalletInfo} wallet
|
|
186
|
+
*/
|
|
187
|
+
TSSKeySignExtra.prototype['wallet'] = undefined;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @member {module:model/KeyShareHolderGroup} signer_key_share_holder_group
|
|
191
|
+
*/
|
|
192
|
+
TSSKeySignExtra.prototype['signer_key_share_holder_group'] = undefined;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @member {Array.<module:model/AddressInfo>} source_addresses
|
|
196
|
+
*/
|
|
197
|
+
TSSKeySignExtra.prototype['source_addresses'] = undefined;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @member {module:model/Transaction} transaction
|
|
201
|
+
*/
|
|
202
|
+
TSSKeySignExtra.prototype['transaction'] = undefined;
|
|
203
|
+
var _default = exports["default"] = TSSKeySignExtra;
|
|
@@ -0,0 +1,192 @@
|
|
|
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 _TSSProtocol = _interopRequireDefault(require("./TSSProtocol"));
|
|
9
|
+
var _TSSSignatureType = _interopRequireDefault(require("./TSSSignatureType"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
14
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
17
|
+
* Cobo Wallet as a Service 2.0
|
|
18
|
+
*
|
|
19
|
+
* Contact: help@cobo.com
|
|
20
|
+
*
|
|
21
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
22
|
+
* https://openapi-generator.tech
|
|
23
|
+
* Do not edit the class manually.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The TSSKeySignRequest model module.
|
|
28
|
+
* @module model/TSSKeySignRequest
|
|
29
|
+
*/
|
|
30
|
+
var TSSKeySignRequest = /*#__PURE__*/function () {
|
|
31
|
+
/**
|
|
32
|
+
* Constructs a new <code>TSSKeySignRequest</code>.
|
|
33
|
+
* @alias module:model/TSSKeySignRequest
|
|
34
|
+
*/
|
|
35
|
+
function TSSKeySignRequest() {
|
|
36
|
+
_classCallCheck(this, TSSKeySignRequest);
|
|
37
|
+
TSSKeySignRequest.initialize(this);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Initializes the fields of this object.
|
|
42
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
43
|
+
* Only for internal use.
|
|
44
|
+
*/
|
|
45
|
+
return _createClass(TSSKeySignRequest, null, [{
|
|
46
|
+
key: "initialize",
|
|
47
|
+
value: function initialize(obj) {}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Constructs a <code>TSSKeySignRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
51
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
52
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
53
|
+
* @param {module:model/TSSKeySignRequest} obj Optional instance to populate.
|
|
54
|
+
* @return {module:model/TSSKeySignRequest} The populated <code>TSSKeySignRequest</code> instance.
|
|
55
|
+
*/
|
|
56
|
+
}, {
|
|
57
|
+
key: "constructFromObject",
|
|
58
|
+
value: function constructFromObject(data, obj) {
|
|
59
|
+
if (data) {
|
|
60
|
+
obj = obj || new TSSKeySignRequest();
|
|
61
|
+
if (data.hasOwnProperty('group_id')) {
|
|
62
|
+
obj['group_id'] = _ApiClient["default"].convertToType(data['group_id'], 'String');
|
|
63
|
+
}
|
|
64
|
+
if (data.hasOwnProperty('root_pub_key')) {
|
|
65
|
+
obj['root_pub_key'] = _ApiClient["default"].convertToType(data['root_pub_key'], 'String');
|
|
66
|
+
}
|
|
67
|
+
if (data.hasOwnProperty('used_node_ids')) {
|
|
68
|
+
obj['used_node_ids'] = _ApiClient["default"].convertToType(data['used_node_ids'], ['String']);
|
|
69
|
+
}
|
|
70
|
+
if (data.hasOwnProperty('bip32_path_list')) {
|
|
71
|
+
obj['bip32_path_list'] = _ApiClient["default"].convertToType(data['bip32_path_list'], ['String']);
|
|
72
|
+
}
|
|
73
|
+
if (data.hasOwnProperty('msg_hash_list')) {
|
|
74
|
+
obj['msg_hash_list'] = _ApiClient["default"].convertToType(data['msg_hash_list'], ['String']);
|
|
75
|
+
}
|
|
76
|
+
if (data.hasOwnProperty('tweak_list')) {
|
|
77
|
+
obj['tweak_list'] = _ApiClient["default"].convertToType(data['tweak_list'], ['String']);
|
|
78
|
+
}
|
|
79
|
+
if (data.hasOwnProperty('signature_type')) {
|
|
80
|
+
obj['signature_type'] = _TSSSignatureType["default"].constructFromObject(data['signature_type']);
|
|
81
|
+
}
|
|
82
|
+
if (data.hasOwnProperty('tss_protocol')) {
|
|
83
|
+
obj['tss_protocol'] = _TSSProtocol["default"].constructFromObject(data['tss_protocol']);
|
|
84
|
+
}
|
|
85
|
+
if (data.hasOwnProperty('task_id')) {
|
|
86
|
+
obj['task_id'] = _ApiClient["default"].convertToType(data['task_id'], 'String');
|
|
87
|
+
}
|
|
88
|
+
if (data.hasOwnProperty('biz_task_id')) {
|
|
89
|
+
obj['biz_task_id'] = _ApiClient["default"].convertToType(data['biz_task_id'], 'String');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return obj;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Validates the JSON data with respect to <code>TSSKeySignRequest</code>.
|
|
97
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
98
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TSSKeySignRequest</code>.
|
|
99
|
+
*/
|
|
100
|
+
}, {
|
|
101
|
+
key: "validateJSON",
|
|
102
|
+
value: function validateJSON(data) {
|
|
103
|
+
// ensure the json data is a string
|
|
104
|
+
if (data['group_id'] && !(typeof data['group_id'] === 'string' || data['group_id'] instanceof String)) {
|
|
105
|
+
throw new Error("Expected the field `group_id` to be a primitive type in the JSON string but got " + data['group_id']);
|
|
106
|
+
}
|
|
107
|
+
// ensure the json data is a string
|
|
108
|
+
if (data['root_pub_key'] && !(typeof data['root_pub_key'] === 'string' || data['root_pub_key'] instanceof String)) {
|
|
109
|
+
throw new Error("Expected the field `root_pub_key` to be a primitive type in the JSON string but got " + data['root_pub_key']);
|
|
110
|
+
}
|
|
111
|
+
// ensure the json data is an array
|
|
112
|
+
if (!Array.isArray(data['used_node_ids'])) {
|
|
113
|
+
throw new Error("Expected the field `used_node_ids` to be an array in the JSON data but got " + data['used_node_ids']);
|
|
114
|
+
}
|
|
115
|
+
// ensure the json data is an array
|
|
116
|
+
if (!Array.isArray(data['bip32_path_list'])) {
|
|
117
|
+
throw new Error("Expected the field `bip32_path_list` to be an array in the JSON data but got " + data['bip32_path_list']);
|
|
118
|
+
}
|
|
119
|
+
// ensure the json data is an array
|
|
120
|
+
if (!Array.isArray(data['msg_hash_list'])) {
|
|
121
|
+
throw new Error("Expected the field `msg_hash_list` to be an array in the JSON data but got " + data['msg_hash_list']);
|
|
122
|
+
}
|
|
123
|
+
// ensure the json data is an array
|
|
124
|
+
if (!Array.isArray(data['tweak_list'])) {
|
|
125
|
+
throw new Error("Expected the field `tweak_list` to be an array in the JSON data but got " + data['tweak_list']);
|
|
126
|
+
}
|
|
127
|
+
// ensure the json data is a string
|
|
128
|
+
if (data['task_id'] && !(typeof data['task_id'] === 'string' || data['task_id'] instanceof String)) {
|
|
129
|
+
throw new Error("Expected the field `task_id` to be a primitive type in the JSON string but got " + data['task_id']);
|
|
130
|
+
}
|
|
131
|
+
// ensure the json data is a string
|
|
132
|
+
if (data['biz_task_id'] && !(typeof data['biz_task_id'] === 'string' || data['biz_task_id'] instanceof String)) {
|
|
133
|
+
throw new Error("Expected the field `biz_task_id` to be a primitive type in the JSON string but got " + data['biz_task_id']);
|
|
134
|
+
}
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
}]);
|
|
138
|
+
}();
|
|
139
|
+
/**
|
|
140
|
+
* The TSS key share group ID.
|
|
141
|
+
* @member {String} group_id
|
|
142
|
+
*/
|
|
143
|
+
TSSKeySignRequest.prototype['group_id'] = undefined;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* The The old TSS key share group's root extended public key.
|
|
147
|
+
* @member {String} root_pub_key
|
|
148
|
+
*/
|
|
149
|
+
TSSKeySignRequest.prototype['root_pub_key'] = undefined;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* @member {Array.<String>} used_node_ids
|
|
153
|
+
*/
|
|
154
|
+
TSSKeySignRequest.prototype['used_node_ids'] = undefined;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @member {Array.<String>} bip32_path_list
|
|
158
|
+
*/
|
|
159
|
+
TSSKeySignRequest.prototype['bip32_path_list'] = undefined;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @member {Array.<String>} msg_hash_list
|
|
163
|
+
*/
|
|
164
|
+
TSSKeySignRequest.prototype['msg_hash_list'] = undefined;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @member {Array.<String>} tweak_list
|
|
168
|
+
*/
|
|
169
|
+
TSSKeySignRequest.prototype['tweak_list'] = undefined;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @member {module:model/TSSSignatureType} signature_type
|
|
173
|
+
*/
|
|
174
|
+
TSSKeySignRequest.prototype['signature_type'] = undefined;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @member {module:model/TSSProtocol} tss_protocol
|
|
178
|
+
*/
|
|
179
|
+
TSSKeySignRequest.prototype['tss_protocol'] = undefined;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* The task ID.
|
|
183
|
+
* @member {String} task_id
|
|
184
|
+
*/
|
|
185
|
+
TSSKeySignRequest.prototype['task_id'] = undefined;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* The business task ID. This field contains the transaction ID.
|
|
189
|
+
* @member {String} biz_task_id
|
|
190
|
+
*/
|
|
191
|
+
TSSKeySignRequest.prototype['biz_task_id'] = undefined;
|
|
192
|
+
var _default = exports["default"] = TSSKeySignRequest;
|