@cobo/cobo-waas2 1.1.2 → 1.2.1

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.
Files changed (143) hide show
  1. package/README.md +16 -3
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/PreRequestScript.js +640 -0
  4. package/dist/api/OAuthApi.js +16 -15
  5. package/dist/api/TransactionsApi.js +18 -18
  6. package/dist/api/WalletsApi.js +123 -12
  7. package/dist/api/WalletsExchangeWalletApi.js +254 -0
  8. package/dist/api/WalletsMPCWalletsApi.js +8 -8
  9. package/dist/index.js +56 -0
  10. package/dist/model/AddressInfo.js +1 -1
  11. package/dist/model/AddressTransferDestination.js +3 -3
  12. package/dist/model/AddressTransferDestinationAccountOutput.js +2 -2
  13. package/dist/model/AddressTransferDestinationUtxoOutputsInner.js +1 -1
  14. package/dist/model/AssetInfo.js +2 -2
  15. package/dist/model/BabylonStakeExtra.js +9 -0
  16. package/dist/model/CheckAddressValidity200Response.js +2 -2
  17. package/dist/model/CheckAddressesValidity200ResponseInner.js +121 -0
  18. package/dist/model/CheckLoopTransfers200ResponseInner.js +96 -0
  19. package/dist/model/CoboSafeDelegate.js +27 -2
  20. package/dist/model/ContractCallDestination.js +24 -3
  21. package/dist/model/ContractCallSource.js +41 -4
  22. package/dist/model/CreateSmartContractWalletParams.js +23 -2
  23. package/dist/model/CreateStakeActivity.js +14 -1
  24. package/dist/model/CreateStakeActivityExtra.js +57 -6
  25. package/dist/model/CreateTssRequestRequest.js +13 -0
  26. package/dist/model/CreateUnstakeActivity.js +13 -0
  27. package/dist/model/CreateWalletParams.js +51 -6
  28. package/dist/model/CreateWithdrawActivity.js +13 -0
  29. package/dist/model/CreatedWalletInfo.js +63 -6
  30. package/dist/model/EstimateFeeParams.js +37 -4
  31. package/dist/model/EstimateStakeFee.js +19 -1
  32. package/dist/model/EstimateUnstakeFee.js +18 -0
  33. package/dist/model/EstimateWithdrawFee.js +18 -0
  34. package/dist/model/EstimatedFee.js +65 -8
  35. package/dist/model/EvmContractCallDestination.js +1 -1
  36. package/dist/model/ExchangeId.js +5 -0
  37. package/dist/model/ExchangeTransferDestination.js +16 -16
  38. package/dist/model/ExchangeTransferSource.js +14 -14
  39. package/dist/model/FeeRate.js +65 -8
  40. package/dist/model/GetToken200Response.js +4 -4
  41. package/dist/model/KeyShareHolder.js +13 -0
  42. package/dist/model/ListAssetBalancesForExchangeWallet200Response.js +123 -0
  43. package/dist/model/ListExchanges200ResponseInner.js +122 -0
  44. package/dist/model/ListSupportedAssetsForExchange200Response.js +123 -0
  45. package/dist/model/MPCWalletInfo.js +26 -0
  46. package/dist/model/MessageSignDestination.js +37 -4
  47. package/dist/model/MessageSignSource.js +27 -2
  48. package/dist/model/PoolDetailsAllOfValidatorsInfo.js +20 -4
  49. package/dist/model/RefreshToken200Response.js +135 -0
  50. package/dist/model/RefreshTokenRequest.js +2 -2
  51. package/dist/model/SmartContractWalletInfo.js +23 -2
  52. package/dist/model/SmartContractWalletType.js +2 -2
  53. package/dist/model/StakingSource.js +41 -4
  54. package/dist/model/SubWalletAssetBalance.js +10 -10
  55. package/dist/model/TSSRequest.js +23 -1
  56. package/dist/model/TSSRequestWebhookEventData.js +263 -0
  57. package/dist/model/TransactionDepositFromWalletSource.js +6 -6
  58. package/dist/model/TransactionDepositToAddressDestination.js +2 -2
  59. package/dist/model/TransactionDepositToWalletDestination.js +9 -9
  60. package/dist/model/TransactionDestination.js +112 -19
  61. package/dist/model/TransactionEvmContractDestination.js +1 -1
  62. package/dist/model/TransactionExchangeWalletSource.js +6 -6
  63. package/dist/model/TransactionFee.js +65 -8
  64. package/dist/model/TransactionMPCWalletSource.js +13 -0
  65. package/dist/model/TransactionRbfSource.js +27 -2
  66. package/dist/model/TransactionRequestFee.js +65 -8
  67. package/dist/model/TransactionResult.js +23 -2
  68. package/dist/model/TransactionSource.js +123 -16
  69. package/dist/model/TransactionSubStatus.js +5 -0
  70. package/dist/model/TransactionTransferToAddressDestinationAccountOutput.js +1 -1
  71. package/dist/model/TransactionTransferToAddressDestinationUtxoOutputsInner.js +1 -1
  72. package/dist/model/TransactionTransferToWalletDestination.js +9 -9
  73. package/dist/model/TransactionWebhookEventData.js +8 -3
  74. package/dist/model/TransferDestination.js +43 -10
  75. package/dist/model/TransferParams.js +2 -2
  76. package/dist/model/TransferSource.js +76 -11
  77. package/dist/model/UpdateWalletParams.js +65 -8
  78. package/dist/model/WalletInfo.js +77 -8
  79. package/dist/model/WebhookEventData.js +84 -17
  80. package/dist/model/WebhookEventDataType.js +7 -2
  81. package/dist/model/WebhookEventType.js +24 -4
  82. package/docs/AddressInfo.md +1 -1
  83. package/docs/AddressTransferDestination.md +2 -2
  84. package/docs/AddressTransferDestinationAccountOutput.md +1 -1
  85. package/docs/AddressTransferDestinationUtxoOutputsInner.md +1 -1
  86. package/docs/AssetInfo.md +1 -1
  87. package/docs/BabylonStakeExtra.md +1 -0
  88. package/docs/CheckAddressValidity200Response.md +1 -1
  89. package/docs/CheckAddressesValidity200ResponseInner.md +10 -0
  90. package/docs/CheckLoopTransfers200ResponseInner.md +10 -0
  91. package/docs/ContractCallDestination.md +1 -1
  92. package/docs/CreateStakeActivity.md +1 -0
  93. package/docs/CreateStakeActivityExtra.md +1 -0
  94. package/docs/CreateTssRequestRequest.md +1 -0
  95. package/docs/CreateUnstakeActivity.md +1 -0
  96. package/docs/CreateWithdrawActivity.md +1 -0
  97. package/docs/CreatedWalletInfo.md +2 -0
  98. package/docs/DevelopersWebhooksApi.md +78 -69
  99. package/docs/EstimateStakeFee.md +1 -0
  100. package/docs/EstimateUnstakeFee.md +1 -0
  101. package/docs/EstimateWithdrawFee.md +1 -0
  102. package/docs/EvmContractCallDestination.md +1 -1
  103. package/docs/ExchangeId.md +2 -0
  104. package/docs/ExchangeTransferDestination.md +2 -2
  105. package/docs/ExchangeTransferSource.md +1 -1
  106. package/docs/GetToken200Response.md +4 -4
  107. package/docs/KeyShareHolder.md +1 -0
  108. package/docs/ListAssetBalancesForExchangeWallet200Response.md +10 -0
  109. package/docs/ListExchanges200ResponseInner.md +10 -0
  110. package/docs/ListSupportedAssetsForExchange200Response.md +10 -0
  111. package/docs/MPCWalletInfo.md +2 -0
  112. package/docs/OAuthApi.md +26 -24
  113. package/docs/RefreshToken200Response.md +13 -0
  114. package/docs/RefreshTokenRequest.md +2 -2
  115. package/docs/SmartContractWalletType.md +1 -1
  116. package/docs/SubWalletAssetBalance.md +2 -2
  117. package/docs/TSSRequest.md +2 -0
  118. package/docs/TSSRequestWebhookEventData.md +29 -0
  119. package/docs/TransactionDepositFromWalletSource.md +1 -1
  120. package/docs/TransactionDepositToAddressDestination.md +1 -1
  121. package/docs/TransactionDepositToWalletDestination.md +2 -2
  122. package/docs/TransactionDestination.md +3 -3
  123. package/docs/TransactionEvmContractDestination.md +1 -1
  124. package/docs/TransactionExchangeWalletSource.md +1 -1
  125. package/docs/TransactionMPCWalletSource.md +1 -0
  126. package/docs/TransactionSource.md +2 -1
  127. package/docs/TransactionSubStatus.md +2 -0
  128. package/docs/TransactionTransferToAddressDestinationAccountOutput.md +1 -1
  129. package/docs/TransactionTransferToAddressDestinationUtxoOutputsInner.md +1 -1
  130. package/docs/TransactionTransferToWalletDestination.md +2 -2
  131. package/docs/TransactionWebhookEventData.md +3 -1
  132. package/docs/TransactionsApi.md +98 -88
  133. package/docs/TransferDestination.md +4 -4
  134. package/docs/TransferParams.md +1 -1
  135. package/docs/TransferSource.md +1 -1
  136. package/docs/WalletInfo.md +2 -0
  137. package/docs/WalletsApi.md +316 -187
  138. package/docs/WalletsExchangeWalletApi.md +230 -0
  139. package/docs/WalletsMPCWalletsApi.md +153 -135
  140. package/docs/WebhookEventData.md +10 -5
  141. package/docs/WebhookEventDataType.md +3 -1
  142. package/docs/WebhookEventType.md +12 -4
  143. package/package.json +1 -1
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18
+ * Cobo Wallet as a Service 2.0
19
+ *
20
+ * Contact: support@cobo.com
21
+ *
22
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
+ * https://openapi-generator.tech
24
+ * Do not edit the class manually.
25
+ *
26
+ */
27
+ /**
28
+ * The CheckAddressesValidity200ResponseInner model module.
29
+ * @module model/CheckAddressesValidity200ResponseInner
30
+ */
31
+ var CheckAddressesValidity200ResponseInner = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>CheckAddressesValidity200ResponseInner</code>.
34
+ * @alias module:model/CheckAddressesValidity200ResponseInner
35
+ * @param address {String} The wallet address.
36
+ * @param validity {Boolean} Whether the address is valid. - `true`: The address is valid. - `false`: The address is invalid.
37
+ */
38
+ function CheckAddressesValidity200ResponseInner(address, validity) {
39
+ _classCallCheck(this, CheckAddressesValidity200ResponseInner);
40
+ CheckAddressesValidity200ResponseInner.initialize(this, address, validity);
41
+ }
42
+
43
+ /**
44
+ * Initializes the fields of this object.
45
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
46
+ * Only for internal use.
47
+ */
48
+ return _createClass(CheckAddressesValidity200ResponseInner, null, [{
49
+ key: "initialize",
50
+ value: function initialize(obj, address, validity) {
51
+ obj['address'] = address;
52
+ obj['validity'] = validity;
53
+ }
54
+
55
+ /**
56
+ * Constructs a <code>CheckAddressesValidity200ResponseInner</code> from a plain JavaScript object, optionally creating a new instance.
57
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
58
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
59
+ * @param {module:model/CheckAddressesValidity200ResponseInner} obj Optional instance to populate.
60
+ * @return {module:model/CheckAddressesValidity200ResponseInner} The populated <code>CheckAddressesValidity200ResponseInner</code> instance.
61
+ */
62
+ }, {
63
+ key: "constructFromObject",
64
+ value: function constructFromObject(data, obj) {
65
+ if (data) {
66
+ obj = obj || new CheckAddressesValidity200ResponseInner();
67
+ if (data.hasOwnProperty('address')) {
68
+ obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
69
+ }
70
+ if (data.hasOwnProperty('validity')) {
71
+ obj['validity'] = _ApiClient["default"].convertToType(data['validity'], 'Boolean');
72
+ }
73
+ }
74
+ return obj;
75
+ }
76
+
77
+ /**
78
+ * Validates the JSON data with respect to <code>CheckAddressesValidity200ResponseInner</code>.
79
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
80
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CheckAddressesValidity200ResponseInner</code>.
81
+ */
82
+ }, {
83
+ key: "validateJSON",
84
+ value: function validateJSON(data) {
85
+ // check to make sure all required properties are present in the JSON string
86
+ var _iterator = _createForOfIteratorHelper(CheckAddressesValidity200ResponseInner.RequiredProperties),
87
+ _step;
88
+ try {
89
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
90
+ var property = _step.value;
91
+ if (!data.hasOwnProperty(property)) {
92
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
93
+ }
94
+ }
95
+ // ensure the json data is a string
96
+ } catch (err) {
97
+ _iterator.e(err);
98
+ } finally {
99
+ _iterator.f();
100
+ }
101
+ if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
102
+ throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
103
+ }
104
+ return true;
105
+ }
106
+ }]);
107
+ }();
108
+ CheckAddressesValidity200ResponseInner.RequiredProperties = ["address", "validity"];
109
+
110
+ /**
111
+ * The wallet address.
112
+ * @member {String} address
113
+ */
114
+ CheckAddressesValidity200ResponseInner.prototype['address'] = undefined;
115
+
116
+ /**
117
+ * Whether the address is valid. - `true`: The address is valid. - `false`: The address is invalid.
118
+ * @member {Boolean} validity
119
+ */
120
+ CheckAddressesValidity200ResponseInner.prototype['validity'] = undefined;
121
+ var _default = exports["default"] = CheckAddressesValidity200ResponseInner;
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ 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); } /**
15
+ * Cobo Wallet as a Service 2.0
16
+ *
17
+ * Contact: support@cobo.com
18
+ *
19
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
20
+ * https://openapi-generator.tech
21
+ * Do not edit the class manually.
22
+ *
23
+ */
24
+ /**
25
+ * The CheckLoopTransfers200ResponseInner model module.
26
+ * @module model/CheckLoopTransfers200ResponseInner
27
+ */
28
+ var CheckLoopTransfers200ResponseInner = /*#__PURE__*/function () {
29
+ /**
30
+ * Constructs a new <code>CheckLoopTransfers200ResponseInner</code>.
31
+ * @alias module:model/CheckLoopTransfers200ResponseInner
32
+ */
33
+ function CheckLoopTransfers200ResponseInner() {
34
+ _classCallCheck(this, CheckLoopTransfers200ResponseInner);
35
+ CheckLoopTransfers200ResponseInner.initialize(this);
36
+ }
37
+
38
+ /**
39
+ * Initializes the fields of this object.
40
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
41
+ * Only for internal use.
42
+ */
43
+ return _createClass(CheckLoopTransfers200ResponseInner, null, [{
44
+ key: "initialize",
45
+ value: function initialize(obj) {}
46
+
47
+ /**
48
+ * Constructs a <code>CheckLoopTransfers200ResponseInner</code> from a plain JavaScript object, optionally creating a new instance.
49
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
50
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
51
+ * @param {module:model/CheckLoopTransfers200ResponseInner} obj Optional instance to populate.
52
+ * @return {module:model/CheckLoopTransfers200ResponseInner} The populated <code>CheckLoopTransfers200ResponseInner</code> instance.
53
+ */
54
+ }, {
55
+ key: "constructFromObject",
56
+ value: function constructFromObject(data, obj) {
57
+ if (data) {
58
+ obj = obj || new CheckLoopTransfers200ResponseInner();
59
+ if (data.hasOwnProperty('address')) {
60
+ obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
61
+ }
62
+ if (data.hasOwnProperty('is_loop')) {
63
+ obj['is_loop'] = _ApiClient["default"].convertToType(data['is_loop'], 'Boolean');
64
+ }
65
+ }
66
+ return obj;
67
+ }
68
+
69
+ /**
70
+ * Validates the JSON data with respect to <code>CheckLoopTransfers200ResponseInner</code>.
71
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
72
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CheckLoopTransfers200ResponseInner</code>.
73
+ */
74
+ }, {
75
+ key: "validateJSON",
76
+ value: function validateJSON(data) {
77
+ // ensure the json data is a string
78
+ if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
79
+ throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
80
+ }
81
+ return true;
82
+ }
83
+ }]);
84
+ }();
85
+ /**
86
+ * The wallet address.
87
+ * @member {String} address
88
+ */
89
+ CheckLoopTransfers200ResponseInner.prototype['address'] = undefined;
90
+
91
+ /**
92
+ * Whether the transaction from the given source wallet to the destination address can be executed as a Loop transfer. - `true`: The transaction can be executed as a Loop transfer. - `false`: The transaction cannot be executed as a Loop transfer.
93
+ * @member {Boolean} is_loop
94
+ */
95
+ CheckLoopTransfers200ResponseInner.prototype['is_loop'] = undefined;
96
+ var _default = exports["default"] = CheckLoopTransfers200ResponseInner;
@@ -51,6 +51,23 @@ var CoboSafeDelegate = /*#__PURE__*/function () {
51
51
  }
52
52
  var match = 0;
53
53
  var errorMessages = [];
54
+ var discriminatorValue = instance["delegate_type"];
55
+ if (discriminatorValue) {
56
+ switch (discriminatorValue) {
57
+ case "Org-Controlled":
58
+ this.actualInstance = _MPCDelegate["default"].constructFromObject(instance);
59
+ match++;
60
+ break;
61
+ case "User-Controlled":
62
+ this.actualInstance = _MPCDelegate["default"].constructFromObject(instance);
63
+ match++;
64
+ break;
65
+ default:
66
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
67
+ break;
68
+ }
69
+ return;
70
+ }
54
71
  try {
55
72
  if (instance instanceof _MPCDelegate["default"]) {
56
73
  this.actualInstance = instance;
@@ -58,8 +75,16 @@ var CoboSafeDelegate = /*#__PURE__*/function () {
58
75
  // plain JS object
59
76
  // create MPCDelegate from JS object
60
77
  this.actualInstance = _MPCDelegate["default"].constructFromObject(instance);
61
- } else if (_MPCDelegate["default"].constructFromObject(instance)) {
62
- this.actualInstance = _MPCDelegate["default"].constructFromObject(instance);
78
+ } else {
79
+ if (_MPCDelegate["default"].constructFromObject(instance)) {
80
+ if (!!_MPCDelegate["default"].constructFromObject(instance).toJSON) {
81
+ if (_MPCDelegate["default"].constructFromObject(instance).toJSON()) {
82
+ this.actualInstance = _MPCDelegate["default"].constructFromObject(instance);
83
+ }
84
+ } else {
85
+ this.actualInstance = _MPCDelegate["default"].constructFromObject(instance);
86
+ }
87
+ }
63
88
  }
64
89
  match++;
65
90
  } catch (err) {
@@ -51,6 +51,19 @@ var ContractCallDestination = /*#__PURE__*/function () {
51
51
  }
52
52
  var match = 0;
53
53
  var errorMessages = [];
54
+ var discriminatorValue = instance["destination_type"];
55
+ if (discriminatorValue) {
56
+ switch (discriminatorValue) {
57
+ case "EVM":
58
+ this.actualInstance = _EvmContractCallDestination["default"].constructFromObject(instance);
59
+ match++;
60
+ break;
61
+ default:
62
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
63
+ break;
64
+ }
65
+ return;
66
+ }
54
67
  try {
55
68
  if (instance instanceof _EvmContractCallDestination["default"]) {
56
69
  this.actualInstance = instance;
@@ -58,8 +71,16 @@ var ContractCallDestination = /*#__PURE__*/function () {
58
71
  // plain JS object
59
72
  // create EvmContractCallDestination from JS object
60
73
  this.actualInstance = _EvmContractCallDestination["default"].constructFromObject(instance);
61
- } else if (_EvmContractCallDestination["default"].constructFromObject(instance)) {
62
- this.actualInstance = _EvmContractCallDestination["default"].constructFromObject(instance);
74
+ } else {
75
+ if (_EvmContractCallDestination["default"].constructFromObject(instance)) {
76
+ if (!!_EvmContractCallDestination["default"].constructFromObject(instance).toJSON) {
77
+ if (_EvmContractCallDestination["default"].constructFromObject(instance).toJSON()) {
78
+ this.actualInstance = _EvmContractCallDestination["default"].constructFromObject(instance);
79
+ }
80
+ } else {
81
+ this.actualInstance = _EvmContractCallDestination["default"].constructFromObject(instance);
82
+ }
83
+ }
63
84
  }
64
85
  match++;
65
86
  } catch (err) {
@@ -135,7 +156,7 @@ ContractCallDestination.prototype['destination_type'] = undefined;
135
156
  ContractCallDestination.prototype['address'] = undefined;
136
157
 
137
158
  /**
138
- * The quantity of the token in the transaction. For example, if you trade 1.5 ETH, then the value is `1.5`.
159
+ * The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`.
139
160
  * @member {String} value
140
161
  */
141
162
  ContractCallDestination.prototype['value'] = undefined;
@@ -53,6 +53,27 @@ var ContractCallSource = /*#__PURE__*/function () {
53
53
  }
54
54
  var match = 0;
55
55
  var errorMessages = [];
56
+ var discriminatorValue = instance["source_type"];
57
+ if (discriminatorValue) {
58
+ switch (discriminatorValue) {
59
+ case "Org-Controlled":
60
+ this.actualInstance = _MpcContractCallSource["default"].constructFromObject(instance);
61
+ match++;
62
+ break;
63
+ case "Safe{Wallet}":
64
+ this.actualInstance = _SafeContractCallSource["default"].constructFromObject(instance);
65
+ match++;
66
+ break;
67
+ case "User-Controlled":
68
+ this.actualInstance = _MpcContractCallSource["default"].constructFromObject(instance);
69
+ match++;
70
+ break;
71
+ default:
72
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
73
+ break;
74
+ }
75
+ return;
76
+ }
56
77
  try {
57
78
  if (instance instanceof _MpcContractCallSource["default"]) {
58
79
  this.actualInstance = instance;
@@ -60,8 +81,16 @@ var ContractCallSource = /*#__PURE__*/function () {
60
81
  // plain JS object
61
82
  // create MpcContractCallSource from JS object
62
83
  this.actualInstance = _MpcContractCallSource["default"].constructFromObject(instance);
63
- } else if (_MpcContractCallSource["default"].constructFromObject(instance)) {
64
- this.actualInstance = _MpcContractCallSource["default"].constructFromObject(instance);
84
+ } else {
85
+ if (_MpcContractCallSource["default"].constructFromObject(instance)) {
86
+ if (!!_MpcContractCallSource["default"].constructFromObject(instance).toJSON) {
87
+ if (_MpcContractCallSource["default"].constructFromObject(instance).toJSON()) {
88
+ this.actualInstance = _MpcContractCallSource["default"].constructFromObject(instance);
89
+ }
90
+ } else {
91
+ this.actualInstance = _MpcContractCallSource["default"].constructFromObject(instance);
92
+ }
93
+ }
65
94
  }
66
95
  match++;
67
96
  } catch (err) {
@@ -75,8 +104,16 @@ var ContractCallSource = /*#__PURE__*/function () {
75
104
  // plain JS object
76
105
  // create SafeContractCallSource from JS object
77
106
  this.actualInstance = _SafeContractCallSource["default"].constructFromObject(instance);
78
- } else if (_SafeContractCallSource["default"].constructFromObject(instance)) {
79
- this.actualInstance = _SafeContractCallSource["default"].constructFromObject(instance);
107
+ } else {
108
+ if (_SafeContractCallSource["default"].constructFromObject(instance)) {
109
+ if (!!_SafeContractCallSource["default"].constructFromObject(instance).toJSON) {
110
+ if (_SafeContractCallSource["default"].constructFromObject(instance).toJSON()) {
111
+ this.actualInstance = _SafeContractCallSource["default"].constructFromObject(instance);
112
+ }
113
+ } else {
114
+ this.actualInstance = _SafeContractCallSource["default"].constructFromObject(instance);
115
+ }
116
+ }
80
117
  }
81
118
  match++;
82
119
  } catch (err) {
@@ -54,6 +54,19 @@ var CreateSmartContractWalletParams = /*#__PURE__*/function () {
54
54
  }
55
55
  var match = 0;
56
56
  var errorMessages = [];
57
+ var discriminatorValue = instance["smart_contract_wallet_type"];
58
+ if (discriminatorValue) {
59
+ switch (discriminatorValue) {
60
+ case "Safe":
61
+ this.actualInstance = _CreateSafeWalletParams["default"].constructFromObject(instance);
62
+ match++;
63
+ break;
64
+ default:
65
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
66
+ break;
67
+ }
68
+ return;
69
+ }
57
70
  try {
58
71
  if (instance instanceof _CreateSafeWalletParams["default"]) {
59
72
  this.actualInstance = instance;
@@ -61,8 +74,16 @@ var CreateSmartContractWalletParams = /*#__PURE__*/function () {
61
74
  // plain JS object
62
75
  // create CreateSafeWalletParams from JS object
63
76
  this.actualInstance = _CreateSafeWalletParams["default"].constructFromObject(instance);
64
- } else if (_CreateSafeWalletParams["default"].constructFromObject(instance)) {
65
- this.actualInstance = _CreateSafeWalletParams["default"].constructFromObject(instance);
77
+ } else {
78
+ if (_CreateSafeWalletParams["default"].constructFromObject(instance)) {
79
+ if (!!_CreateSafeWalletParams["default"].constructFromObject(instance).toJSON) {
80
+ if (_CreateSafeWalletParams["default"].constructFromObject(instance).toJSON()) {
81
+ this.actualInstance = _CreateSafeWalletParams["default"].constructFromObject(instance);
82
+ }
83
+ } else {
84
+ this.actualInstance = _CreateSafeWalletParams["default"].constructFromObject(instance);
85
+ }
86
+ }
66
87
  }
67
88
  match++;
68
89
  } catch (err) {
@@ -71,6 +71,9 @@ var CreateStakeActivity = /*#__PURE__*/function () {
71
71
  value: function constructFromObject(data, obj) {
72
72
  if (data) {
73
73
  obj = obj || new CreateStakeActivity();
74
+ if (data.hasOwnProperty('request_id')) {
75
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
76
+ }
74
77
  if (data.hasOwnProperty('source')) {
75
78
  obj['source'] = _StakingSource["default"].constructFromObject(data['source']);
76
79
  }
@@ -108,12 +111,16 @@ var CreateStakeActivity = /*#__PURE__*/function () {
108
111
  throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
109
112
  }
110
113
  }
111
- // validate the optional field `source`
114
+ // ensure the json data is a string
112
115
  } catch (err) {
113
116
  _iterator.e(err);
114
117
  } finally {
115
118
  _iterator.f();
116
119
  }
120
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
121
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
122
+ }
123
+ // validate the optional field `source`
117
124
  if (data['source']) {
118
125
  // data not null
119
126
  if (!!_StakingSource["default"].validateJSON) {
@@ -148,6 +155,12 @@ var CreateStakeActivity = /*#__PURE__*/function () {
148
155
  }();
149
156
  CreateStakeActivity.RequiredProperties = ["pool_id", "amount", "fee", "extra"];
150
157
 
158
+ /**
159
+ * The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
160
+ * @member {String} request_id
161
+ */
162
+ CreateStakeActivity.prototype['request_id'] = undefined;
163
+
151
164
  /**
152
165
  * @member {module:model/StakingSource} source
153
166
  */
@@ -53,6 +53,27 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
53
53
  }
54
54
  var match = 0;
55
55
  var errorMessages = [];
56
+ var discriminatorValue = instance["pool_type"];
57
+ if (discriminatorValue) {
58
+ switch (discriminatorValue) {
59
+ case "Babylon":
60
+ this.actualInstance = _BabylonStakeExtra["default"].constructFromObject(instance);
61
+ match++;
62
+ break;
63
+ case "EigenLayerLST":
64
+ this.actualInstance = _EigenLayerNativeStakeExtra["default"].constructFromObject(instance);
65
+ match++;
66
+ break;
67
+ case "EigenLayerNativeETH":
68
+ this.actualInstance = _EigenLayerLstStakeExtra["default"].constructFromObject(instance);
69
+ match++;
70
+ break;
71
+ default:
72
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
73
+ break;
74
+ }
75
+ return;
76
+ }
56
77
  try {
57
78
  if (instance instanceof _BabylonStakeExtra["default"]) {
58
79
  this.actualInstance = instance;
@@ -60,8 +81,16 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
60
81
  // plain JS object
61
82
  // create BabylonStakeExtra from JS object
62
83
  this.actualInstance = _BabylonStakeExtra["default"].constructFromObject(instance);
63
- } else if (_BabylonStakeExtra["default"].constructFromObject(instance)) {
64
- this.actualInstance = _BabylonStakeExtra["default"].constructFromObject(instance);
84
+ } else {
85
+ if (_BabylonStakeExtra["default"].constructFromObject(instance)) {
86
+ if (!!_BabylonStakeExtra["default"].constructFromObject(instance).toJSON) {
87
+ if (_BabylonStakeExtra["default"].constructFromObject(instance).toJSON()) {
88
+ this.actualInstance = _BabylonStakeExtra["default"].constructFromObject(instance);
89
+ }
90
+ } else {
91
+ this.actualInstance = _BabylonStakeExtra["default"].constructFromObject(instance);
92
+ }
93
+ }
65
94
  }
66
95
  match++;
67
96
  } catch (err) {
@@ -75,8 +104,16 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
75
104
  // plain JS object
76
105
  // create EigenLayerLstStakeExtra from JS object
77
106
  this.actualInstance = _EigenLayerLstStakeExtra["default"].constructFromObject(instance);
78
- } else if (_EigenLayerLstStakeExtra["default"].constructFromObject(instance)) {
79
- this.actualInstance = _EigenLayerLstStakeExtra["default"].constructFromObject(instance);
107
+ } else {
108
+ if (_EigenLayerLstStakeExtra["default"].constructFromObject(instance)) {
109
+ if (!!_EigenLayerLstStakeExtra["default"].constructFromObject(instance).toJSON) {
110
+ if (_EigenLayerLstStakeExtra["default"].constructFromObject(instance).toJSON()) {
111
+ this.actualInstance = _EigenLayerLstStakeExtra["default"].constructFromObject(instance);
112
+ }
113
+ } else {
114
+ this.actualInstance = _EigenLayerLstStakeExtra["default"].constructFromObject(instance);
115
+ }
116
+ }
80
117
  }
81
118
  match++;
82
119
  } catch (err) {
@@ -90,8 +127,16 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
90
127
  // plain JS object
91
128
  // create EigenLayerNativeStakeExtra from JS object
92
129
  this.actualInstance = _EigenLayerNativeStakeExtra["default"].constructFromObject(instance);
93
- } else if (_EigenLayerNativeStakeExtra["default"].constructFromObject(instance)) {
94
- this.actualInstance = _EigenLayerNativeStakeExtra["default"].constructFromObject(instance);
130
+ } else {
131
+ if (_EigenLayerNativeStakeExtra["default"].constructFromObject(instance)) {
132
+ if (!!_EigenLayerNativeStakeExtra["default"].constructFromObject(instance).toJSON) {
133
+ if (_EigenLayerNativeStakeExtra["default"].constructFromObject(instance).toJSON()) {
134
+ this.actualInstance = _EigenLayerNativeStakeExtra["default"].constructFromObject(instance);
135
+ }
136
+ } else {
137
+ this.actualInstance = _EigenLayerNativeStakeExtra["default"].constructFromObject(instance);
138
+ }
139
+ }
95
140
  }
96
141
  match++;
97
142
  } catch (err) {
@@ -172,6 +217,12 @@ CreateStakeActivityExtra.prototype['finality_provider_public_key'] = undefined;
172
217
  */
173
218
  CreateStakeActivityExtra.prototype['stake_block_time'] = undefined;
174
219
 
220
+ /**
221
+ * Whether to only sign transactions. Default is `false`, if set to `true`, the transaction will not be submitted to the blockchain automatically. You can call `Broadcast transactions` to submit the transaction to the blockchain, Or you can find the signed raw_tx by `Get transaction information` and broadcast it yourself.
222
+ * @member {Boolean} only_sign
223
+ */
224
+ CreateStakeActivityExtra.prototype['only_sign'] = undefined;
225
+
175
226
  /**
176
227
  * The operator address.
177
228
  * @member {String} operator
@@ -75,6 +75,9 @@ var CreateTssRequestRequest = /*#__PURE__*/function () {
75
75
  if (data.hasOwnProperty('source_key_share_holder_group')) {
76
76
  obj['source_key_share_holder_group'] = _SourceGroup["default"].constructFromObject(data['source_key_share_holder_group']);
77
77
  }
78
+ if (data.hasOwnProperty('description')) {
79
+ obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
80
+ }
78
81
  }
79
82
  return obj;
80
83
  }
@@ -113,6 +116,10 @@ var CreateTssRequestRequest = /*#__PURE__*/function () {
113
116
  _SourceGroup["default"].validateJSON(data['source_key_share_holder_group']);
114
117
  }
115
118
  }
119
+ // ensure the json data is a string
120
+ if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
121
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
122
+ }
116
123
  return true;
117
124
  }
118
125
  }]);
@@ -134,4 +141,10 @@ CreateTssRequestRequest.prototype['target_key_share_holder_group_id'] = undefine
134
141
  * @member {module:model/SourceGroup} source_key_share_holder_group
135
142
  */
136
143
  CreateTssRequestRequest.prototype['source_key_share_holder_group'] = undefined;
144
+
145
+ /**
146
+ * The description of the TSS request.
147
+ * @member {String} description
148
+ */
149
+ CreateTssRequestRequest.prototype['description'] = undefined;
137
150
  var _default = exports["default"] = CreateTssRequestRequest;
@@ -63,6 +63,9 @@ var CreateUnstakeActivity = /*#__PURE__*/function () {
63
63
  value: function constructFromObject(data, obj) {
64
64
  if (data) {
65
65
  obj = obj || new CreateUnstakeActivity();
66
+ if (data.hasOwnProperty('request_id')) {
67
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
68
+ }
66
69
  if (data.hasOwnProperty('staking_id')) {
67
70
  obj['staking_id'] = _ApiClient["default"].convertToType(data['staking_id'], 'String');
68
71
  }
@@ -100,6 +103,10 @@ var CreateUnstakeActivity = /*#__PURE__*/function () {
100
103
  } finally {
101
104
  _iterator.f();
102
105
  }
106
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
107
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
108
+ }
109
+ // ensure the json data is a string
103
110
  if (data['staking_id'] && !(typeof data['staking_id'] === 'string' || data['staking_id'] instanceof String)) {
104
111
  throw new Error("Expected the field `staking_id` to be a primitive type in the JSON string but got " + data['staking_id']);
105
112
  }
@@ -120,6 +127,12 @@ var CreateUnstakeActivity = /*#__PURE__*/function () {
120
127
  }();
121
128
  CreateUnstakeActivity.RequiredProperties = ["staking_id"];
122
129
 
130
+ /**
131
+ * The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
132
+ * @member {String} request_id
133
+ */
134
+ CreateUnstakeActivity.prototype['request_id'] = undefined;
135
+
123
136
  /**
124
137
  * The id of the related staking.
125
138
  * @member {String} staking_id