@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,263 @@
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 _SourceGroup = _interopRequireDefault(require("./SourceGroup"));
9
+ var _TSSRequest = _interopRequireDefault(require("./TSSRequest"));
10
+ var _TSSRequestStatus = _interopRequireDefault(require("./TSSRequestStatus"));
11
+ var _TSSRequestType = _interopRequireDefault(require("./TSSRequestType"));
12
+ var _WebhookEventDataType = _interopRequireDefault(require("./WebhookEventDataType"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
14
+ 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); }
15
+ 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; } } }; }
16
+ 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; } }
17
+ 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; }
18
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
19
+ 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); } }
20
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
21
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
22
+ 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); } /**
23
+ * Cobo Wallet as a Service 2.0
24
+ *
25
+ * Contact: support@cobo.com
26
+ *
27
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
28
+ * https://openapi-generator.tech
29
+ * Do not edit the class manually.
30
+ *
31
+ */
32
+ /**
33
+ * The TSSRequestWebhookEventData model module.
34
+ * @module model/TSSRequestWebhookEventData
35
+ */
36
+ var TSSRequestWebhookEventData = /*#__PURE__*/function () {
37
+ /**
38
+ * Constructs a new <code>TSSRequestWebhookEventData</code>.
39
+ * @alias module:model/TSSRequestWebhookEventData
40
+ * @implements module:model/WebhookEventDataType
41
+ * @implements module:model/TSSRequest
42
+ * @param data_type {module:model/TSSRequestWebhookEventData.DataTypeEnum} The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data.
43
+ */
44
+ function TSSRequestWebhookEventData(data_type) {
45
+ _classCallCheck(this, TSSRequestWebhookEventData);
46
+ _WebhookEventDataType["default"].initialize(this, data_type);
47
+ _TSSRequest["default"].initialize(this);
48
+ TSSRequestWebhookEventData.initialize(this, data_type);
49
+ }
50
+
51
+ /**
52
+ * Initializes the fields of this object.
53
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
54
+ * Only for internal use.
55
+ */
56
+ return _createClass(TSSRequestWebhookEventData, null, [{
57
+ key: "initialize",
58
+ value: function initialize(obj, data_type) {
59
+ obj['data_type'] = data_type;
60
+ }
61
+
62
+ /**
63
+ * Constructs a <code>TSSRequestWebhookEventData</code> from a plain JavaScript object, optionally creating a new instance.
64
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
65
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
66
+ * @param {module:model/TSSRequestWebhookEventData} obj Optional instance to populate.
67
+ * @return {module:model/TSSRequestWebhookEventData} The populated <code>TSSRequestWebhookEventData</code> instance.
68
+ */
69
+ }, {
70
+ key: "constructFromObject",
71
+ value: function constructFromObject(data, obj) {
72
+ if (data) {
73
+ obj = obj || new TSSRequestWebhookEventData();
74
+ _WebhookEventDataType["default"].constructFromObject(data, obj);
75
+ _TSSRequest["default"].constructFromObject(data, obj);
76
+ if (data.hasOwnProperty('data_type')) {
77
+ obj['data_type'] = _ApiClient["default"].convertToType(data['data_type'], 'String');
78
+ }
79
+ if (data.hasOwnProperty('tss_request_id')) {
80
+ obj['tss_request_id'] = _ApiClient["default"].convertToType(data['tss_request_id'], 'String');
81
+ }
82
+ if (data.hasOwnProperty('source_key_share_holder_group')) {
83
+ obj['source_key_share_holder_group'] = _SourceGroup["default"].constructFromObject(data['source_key_share_holder_group']);
84
+ }
85
+ if (data.hasOwnProperty('target_key_share_holder_group_id')) {
86
+ obj['target_key_share_holder_group_id'] = _ApiClient["default"].convertToType(data['target_key_share_holder_group_id'], 'String');
87
+ }
88
+ if (data.hasOwnProperty('type')) {
89
+ obj['type'] = _TSSRequestType["default"].constructFromObject(data['type']);
90
+ }
91
+ if (data.hasOwnProperty('status')) {
92
+ obj['status'] = _TSSRequestStatus["default"].constructFromObject(data['status']);
93
+ }
94
+ if (data.hasOwnProperty('description')) {
95
+ obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
96
+ }
97
+ if (data.hasOwnProperty('created_timestamp')) {
98
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
99
+ }
100
+ }
101
+ return obj;
102
+ }
103
+
104
+ /**
105
+ * Validates the JSON data with respect to <code>TSSRequestWebhookEventData</code>.
106
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
107
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TSSRequestWebhookEventData</code>.
108
+ */
109
+ }, {
110
+ key: "validateJSON",
111
+ value: function validateJSON(data) {
112
+ // check to make sure all required properties are present in the JSON string
113
+ var _iterator = _createForOfIteratorHelper(TSSRequestWebhookEventData.RequiredProperties),
114
+ _step;
115
+ try {
116
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
117
+ var property = _step.value;
118
+ if (!data.hasOwnProperty(property)) {
119
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
120
+ }
121
+ }
122
+ // ensure the json data is a string
123
+ } catch (err) {
124
+ _iterator.e(err);
125
+ } finally {
126
+ _iterator.f();
127
+ }
128
+ if (data['data_type'] && !(typeof data['data_type'] === 'string' || data['data_type'] instanceof String)) {
129
+ throw new Error("Expected the field `data_type` to be a primitive type in the JSON string but got " + data['data_type']);
130
+ }
131
+ // ensure the json data is a string
132
+ if (data['tss_request_id'] && !(typeof data['tss_request_id'] === 'string' || data['tss_request_id'] instanceof String)) {
133
+ throw new Error("Expected the field `tss_request_id` to be a primitive type in the JSON string but got " + data['tss_request_id']);
134
+ }
135
+ // validate the optional field `source_key_share_holder_group`
136
+ if (data['source_key_share_holder_group']) {
137
+ // data not null
138
+ if (!!_SourceGroup["default"].validateJSON) {
139
+ _SourceGroup["default"].validateJSON(data['source_key_share_holder_group']);
140
+ }
141
+ }
142
+ // ensure the json data is a string
143
+ if (data['target_key_share_holder_group_id'] && !(typeof data['target_key_share_holder_group_id'] === 'string' || data['target_key_share_holder_group_id'] instanceof String)) {
144
+ throw new Error("Expected the field `target_key_share_holder_group_id` to be a primitive type in the JSON string but got " + data['target_key_share_holder_group_id']);
145
+ }
146
+ // ensure the json data is a string
147
+ if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
148
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
149
+ }
150
+ return true;
151
+ }
152
+ }]);
153
+ }();
154
+ TSSRequestWebhookEventData.RequiredProperties = ["data_type"];
155
+
156
+ /**
157
+ * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data.
158
+ * @member {module:model/TSSRequestWebhookEventData.DataTypeEnum} data_type
159
+ */
160
+ TSSRequestWebhookEventData.prototype['data_type'] = undefined;
161
+
162
+ /**
163
+ * The TSS request ID.
164
+ * @member {String} tss_request_id
165
+ */
166
+ TSSRequestWebhookEventData.prototype['tss_request_id'] = undefined;
167
+
168
+ /**
169
+ * @member {module:model/SourceGroup} source_key_share_holder_group
170
+ */
171
+ TSSRequestWebhookEventData.prototype['source_key_share_holder_group'] = undefined;
172
+
173
+ /**
174
+ * The target key share holder group ID.
175
+ * @member {String} target_key_share_holder_group_id
176
+ */
177
+ TSSRequestWebhookEventData.prototype['target_key_share_holder_group_id'] = undefined;
178
+
179
+ /**
180
+ * @member {module:model/TSSRequestType} type
181
+ */
182
+ TSSRequestWebhookEventData.prototype['type'] = undefined;
183
+
184
+ /**
185
+ * @member {module:model/TSSRequestStatus} status
186
+ */
187
+ TSSRequestWebhookEventData.prototype['status'] = undefined;
188
+
189
+ /**
190
+ * The description of the TSS request.
191
+ * @member {String} description
192
+ */
193
+ TSSRequestWebhookEventData.prototype['description'] = undefined;
194
+
195
+ /**
196
+ * The TSS request's creation time in Unix timestamp format, measured in milliseconds.
197
+ * @member {Number} created_timestamp
198
+ */
199
+ TSSRequestWebhookEventData.prototype['created_timestamp'] = undefined;
200
+
201
+ // Implement WebhookEventDataType interface:
202
+ /**
203
+ * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data.
204
+ * @member {module:model/WebhookEventDataType.DataTypeEnum} data_type
205
+ */
206
+ _WebhookEventDataType["default"].prototype['data_type'] = undefined;
207
+ // Implement TSSRequest interface:
208
+ /**
209
+ * The TSS request ID.
210
+ * @member {String} tss_request_id
211
+ */
212
+ _TSSRequest["default"].prototype['tss_request_id'] = undefined;
213
+ /**
214
+ * @member {module:model/SourceGroup} source_key_share_holder_group
215
+ */
216
+ _TSSRequest["default"].prototype['source_key_share_holder_group'] = undefined;
217
+ /**
218
+ * The target key share holder group ID.
219
+ * @member {String} target_key_share_holder_group_id
220
+ */
221
+ _TSSRequest["default"].prototype['target_key_share_holder_group_id'] = undefined;
222
+ /**
223
+ * @member {module:model/TSSRequestType} type
224
+ */
225
+ _TSSRequest["default"].prototype['type'] = undefined;
226
+ /**
227
+ * @member {module:model/TSSRequestStatus} status
228
+ */
229
+ _TSSRequest["default"].prototype['status'] = undefined;
230
+ /**
231
+ * The description of the TSS request.
232
+ * @member {String} description
233
+ */
234
+ _TSSRequest["default"].prototype['description'] = undefined;
235
+ /**
236
+ * The TSS request's creation time in Unix timestamp format, measured in milliseconds.
237
+ * @member {Number} created_timestamp
238
+ */
239
+ _TSSRequest["default"].prototype['created_timestamp'] = undefined;
240
+
241
+ /**
242
+ * Allowed values for the <code>data_type</code> property.
243
+ * @enum {String}
244
+ * @readonly
245
+ */
246
+ TSSRequestWebhookEventData['DataTypeEnum'] = {
247
+ /**
248
+ * value: "Transaction"
249
+ * @const
250
+ */
251
+ "Transaction": "Transaction",
252
+ /**
253
+ * value: "TSSRequest"
254
+ * @const
255
+ */
256
+ "TSSRequest": "TSSRequest",
257
+ /**
258
+ * value: "unknown_default_open_api"
259
+ * @const
260
+ */
261
+ "unknown_default_open_api": "unknown_default_open_api"
262
+ };
263
+ var _default = exports["default"] = TSSRequestWebhookEventData;
@@ -84,8 +84,8 @@ var TransactionDepositFromWalletSource = /*#__PURE__*/function () {
84
84
  if (data.hasOwnProperty('wallet_subtype')) {
85
85
  obj['wallet_subtype'] = _WalletSubtype["default"].constructFromObject(data['wallet_subtype']);
86
86
  }
87
- if (data.hasOwnProperty('sub_wallet_id')) {
88
- obj['sub_wallet_id'] = _ApiClient["default"].convertToType(data['sub_wallet_id'], 'String');
87
+ if (data.hasOwnProperty('trading_account_type')) {
88
+ obj['trading_account_type'] = _ApiClient["default"].convertToType(data['trading_account_type'], 'String');
89
89
  }
90
90
  }
91
91
  return obj;
@@ -119,8 +119,8 @@ var TransactionDepositFromWalletSource = /*#__PURE__*/function () {
119
119
  throw new Error("Expected the field `wallet_id` to be a primitive type in the JSON string but got " + data['wallet_id']);
120
120
  }
121
121
  // ensure the json data is a string
122
- if (data['sub_wallet_id'] && !(typeof data['sub_wallet_id'] === 'string' || data['sub_wallet_id'] instanceof String)) {
123
- throw new Error("Expected the field `sub_wallet_id` to be a primitive type in the JSON string but got " + data['sub_wallet_id']);
122
+ if (data['trading_account_type'] && !(typeof data['trading_account_type'] === 'string' || data['trading_account_type'] instanceof String)) {
123
+ throw new Error("Expected the field `trading_account_type` to be a primitive type in the JSON string but got " + data['trading_account_type']);
124
124
  }
125
125
  return true;
126
126
  }
@@ -151,7 +151,7 @@ TransactionDepositFromWalletSource.prototype['wallet_subtype'] = undefined;
151
151
 
152
152
  /**
153
153
  * The exchange trading account or a sub-wallet ID.
154
- * @member {String} sub_wallet_id
154
+ * @member {String} trading_account_type
155
155
  */
156
- TransactionDepositFromWalletSource.prototype['sub_wallet_id'] = undefined;
156
+ TransactionDepositFromWalletSource.prototype['trading_account_type'] = undefined;
157
157
  var _default = exports["default"] = TransactionDepositFromWalletSource;
@@ -40,7 +40,7 @@ var TransactionDepositToAddressDestination = /*#__PURE__*/function () {
40
40
  * @param wallet_id {String} The wallet ID.
41
41
  * @param wallet_type {module:model/WalletType}
42
42
  * @param address {String} The destination address.
43
- * @param amount {String} The quantity of the token in the transaction. For example, if you trade 1.5 ETH, then the value is `1.5`.
43
+ * @param amount {String} The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`.
44
44
  */
45
45
  function TransactionDepositToAddressDestination(destination_type, wallet_id, wallet_type, address, amount) {
46
46
  _classCallCheck(this, TransactionDepositToAddressDestination);
@@ -178,7 +178,7 @@ TransactionDepositToAddressDestination.prototype['address'] = undefined;
178
178
  TransactionDepositToAddressDestination.prototype['memo'] = undefined;
179
179
 
180
180
  /**
181
- * The quantity of the token in the transaction. For example, if you trade 1.5 ETH, then the value is `1.5`.
181
+ * The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`.
182
182
  * @member {String} amount
183
183
  */
184
184
  TransactionDepositToAddressDestination.prototype['amount'] = undefined;
@@ -41,7 +41,7 @@ var TransactionDepositToWalletDestination = /*#__PURE__*/function () {
41
41
  * @param wallet_id {String} The wallet ID.
42
42
  * @param wallet_type {module:model/WalletType}
43
43
  * @param wallet_subtype {module:model/WalletSubtype}
44
- * @param amount {String} The quantity of the token in the transaction. For example, if you trade 1.5 ETH, then the value is `1.5`.
44
+ * @param amount {String} The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`.
45
45
  */
46
46
  function TransactionDepositToWalletDestination(destination_type, wallet_id, wallet_type, wallet_subtype, amount) {
47
47
  _classCallCheck(this, TransactionDepositToWalletDestination);
@@ -87,8 +87,8 @@ var TransactionDepositToWalletDestination = /*#__PURE__*/function () {
87
87
  if (data.hasOwnProperty('wallet_subtype')) {
88
88
  obj['wallet_subtype'] = _WalletSubtype["default"].constructFromObject(data['wallet_subtype']);
89
89
  }
90
- if (data.hasOwnProperty('sub_wallet_id')) {
91
- obj['sub_wallet_id'] = _ApiClient["default"].convertToType(data['sub_wallet_id'], 'String');
90
+ if (data.hasOwnProperty('trading_account_type')) {
91
+ obj['trading_account_type'] = _ApiClient["default"].convertToType(data['trading_account_type'], 'String');
92
92
  }
93
93
  if (data.hasOwnProperty('exchange_id')) {
94
94
  obj['exchange_id'] = _ExchangeId["default"].constructFromObject(data['exchange_id']);
@@ -128,8 +128,8 @@ var TransactionDepositToWalletDestination = /*#__PURE__*/function () {
128
128
  throw new Error("Expected the field `wallet_id` to be a primitive type in the JSON string but got " + data['wallet_id']);
129
129
  }
130
130
  // ensure the json data is a string
131
- if (data['sub_wallet_id'] && !(typeof data['sub_wallet_id'] === 'string' || data['sub_wallet_id'] instanceof String)) {
132
- throw new Error("Expected the field `sub_wallet_id` to be a primitive type in the JSON string but got " + data['sub_wallet_id']);
131
+ if (data['trading_account_type'] && !(typeof data['trading_account_type'] === 'string' || data['trading_account_type'] instanceof String)) {
132
+ throw new Error("Expected the field `trading_account_type` to be a primitive type in the JSON string but got " + data['trading_account_type']);
133
133
  }
134
134
  // ensure the json data is a string
135
135
  if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
@@ -163,10 +163,10 @@ TransactionDepositToWalletDestination.prototype['wallet_type'] = undefined;
163
163
  TransactionDepositToWalletDestination.prototype['wallet_subtype'] = undefined;
164
164
 
165
165
  /**
166
- * The exchange trading account or the sub-wallet ID.
167
- * @member {String} sub_wallet_id
166
+ * The trading account type.
167
+ * @member {String} trading_account_type
168
168
  */
169
- TransactionDepositToWalletDestination.prototype['sub_wallet_id'] = undefined;
169
+ TransactionDepositToWalletDestination.prototype['trading_account_type'] = undefined;
170
170
 
171
171
  /**
172
172
  * @member {module:model/ExchangeId} exchange_id
@@ -174,7 +174,7 @@ TransactionDepositToWalletDestination.prototype['sub_wallet_id'] = undefined;
174
174
  TransactionDepositToWalletDestination.prototype['exchange_id'] = undefined;
175
175
 
176
176
  /**
177
- * The quantity of the token in the transaction. For example, if you trade 1.5 ETH, then the value is `1.5`.
177
+ * The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`.
178
178
  * @member {String} amount
179
179
  */
180
180
  TransactionDepositToWalletDestination.prototype['amount'] = undefined;
@@ -62,6 +62,43 @@ var TransactionDestination = /*#__PURE__*/function () {
62
62
  }
63
63
  var match = 0;
64
64
  var errorMessages = [];
65
+ var discriminatorValue = instance["destination_type"];
66
+ if (discriminatorValue) {
67
+ switch (discriminatorValue) {
68
+ case "Address":
69
+ this.actualInstance = _TransactionTransferToAddressDestination["default"].constructFromObject(instance);
70
+ match++;
71
+ break;
72
+ case "DepositToAddress":
73
+ this.actualInstance = _TransactionDepositToAddressDestination["default"].constructFromObject(instance);
74
+ match++;
75
+ break;
76
+ case "DepositToWallet":
77
+ this.actualInstance = _TransactionDepositToWalletDestination["default"].constructFromObject(instance);
78
+ match++;
79
+ break;
80
+ case "EVM_Contract":
81
+ this.actualInstance = _TransactionEvmContractDestination["default"].constructFromObject(instance);
82
+ match++;
83
+ break;
84
+ case "EVM_EIP_191_Signature":
85
+ this.actualInstance = _TransactionMessageSignEIP191Destination["default"].constructFromObject(instance);
86
+ match++;
87
+ break;
88
+ case "EVM_EIP_712_Signature":
89
+ this.actualInstance = _TransactionMessageSignEIP712Destination["default"].constructFromObject(instance);
90
+ match++;
91
+ break;
92
+ case "ExchangeWallet":
93
+ this.actualInstance = _TransactionTransferToWalletDestination["default"].constructFromObject(instance);
94
+ match++;
95
+ break;
96
+ default:
97
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
98
+ break;
99
+ }
100
+ return;
101
+ }
65
102
  try {
66
103
  if (instance instanceof _TransactionTransferToAddressDestination["default"]) {
67
104
  this.actualInstance = instance;
@@ -69,8 +106,16 @@ var TransactionDestination = /*#__PURE__*/function () {
69
106
  // plain JS object
70
107
  // create TransactionTransferToAddressDestination from JS object
71
108
  this.actualInstance = _TransactionTransferToAddressDestination["default"].constructFromObject(instance);
72
- } else if (_TransactionTransferToAddressDestination["default"].constructFromObject(instance)) {
73
- this.actualInstance = _TransactionTransferToAddressDestination["default"].constructFromObject(instance);
109
+ } else {
110
+ if (_TransactionTransferToAddressDestination["default"].constructFromObject(instance)) {
111
+ if (!!_TransactionTransferToAddressDestination["default"].constructFromObject(instance).toJSON) {
112
+ if (_TransactionTransferToAddressDestination["default"].constructFromObject(instance).toJSON()) {
113
+ this.actualInstance = _TransactionTransferToAddressDestination["default"].constructFromObject(instance);
114
+ }
115
+ } else {
116
+ this.actualInstance = _TransactionTransferToAddressDestination["default"].constructFromObject(instance);
117
+ }
118
+ }
74
119
  }
75
120
  match++;
76
121
  } catch (err) {
@@ -84,8 +129,16 @@ var TransactionDestination = /*#__PURE__*/function () {
84
129
  // plain JS object
85
130
  // create TransactionTransferToWalletDestination from JS object
86
131
  this.actualInstance = _TransactionTransferToWalletDestination["default"].constructFromObject(instance);
87
- } else if (_TransactionTransferToWalletDestination["default"].constructFromObject(instance)) {
88
- this.actualInstance = _TransactionTransferToWalletDestination["default"].constructFromObject(instance);
132
+ } else {
133
+ if (_TransactionTransferToWalletDestination["default"].constructFromObject(instance)) {
134
+ if (!!_TransactionTransferToWalletDestination["default"].constructFromObject(instance).toJSON) {
135
+ if (_TransactionTransferToWalletDestination["default"].constructFromObject(instance).toJSON()) {
136
+ this.actualInstance = _TransactionTransferToWalletDestination["default"].constructFromObject(instance);
137
+ }
138
+ } else {
139
+ this.actualInstance = _TransactionTransferToWalletDestination["default"].constructFromObject(instance);
140
+ }
141
+ }
89
142
  }
90
143
  match++;
91
144
  } catch (err) {
@@ -99,8 +152,16 @@ var TransactionDestination = /*#__PURE__*/function () {
99
152
  // plain JS object
100
153
  // create TransactionEvmContractDestination from JS object
101
154
  this.actualInstance = _TransactionEvmContractDestination["default"].constructFromObject(instance);
102
- } else if (_TransactionEvmContractDestination["default"].constructFromObject(instance)) {
103
- this.actualInstance = _TransactionEvmContractDestination["default"].constructFromObject(instance);
155
+ } else {
156
+ if (_TransactionEvmContractDestination["default"].constructFromObject(instance)) {
157
+ if (!!_TransactionEvmContractDestination["default"].constructFromObject(instance).toJSON) {
158
+ if (_TransactionEvmContractDestination["default"].constructFromObject(instance).toJSON()) {
159
+ this.actualInstance = _TransactionEvmContractDestination["default"].constructFromObject(instance);
160
+ }
161
+ } else {
162
+ this.actualInstance = _TransactionEvmContractDestination["default"].constructFromObject(instance);
163
+ }
164
+ }
104
165
  }
105
166
  match++;
106
167
  } catch (err) {
@@ -114,8 +175,16 @@ var TransactionDestination = /*#__PURE__*/function () {
114
175
  // plain JS object
115
176
  // create TransactionMessageSignEIP191Destination from JS object
116
177
  this.actualInstance = _TransactionMessageSignEIP191Destination["default"].constructFromObject(instance);
117
- } else if (_TransactionMessageSignEIP191Destination["default"].constructFromObject(instance)) {
118
- this.actualInstance = _TransactionMessageSignEIP191Destination["default"].constructFromObject(instance);
178
+ } else {
179
+ if (_TransactionMessageSignEIP191Destination["default"].constructFromObject(instance)) {
180
+ if (!!_TransactionMessageSignEIP191Destination["default"].constructFromObject(instance).toJSON) {
181
+ if (_TransactionMessageSignEIP191Destination["default"].constructFromObject(instance).toJSON()) {
182
+ this.actualInstance = _TransactionMessageSignEIP191Destination["default"].constructFromObject(instance);
183
+ }
184
+ } else {
185
+ this.actualInstance = _TransactionMessageSignEIP191Destination["default"].constructFromObject(instance);
186
+ }
187
+ }
119
188
  }
120
189
  match++;
121
190
  } catch (err) {
@@ -129,8 +198,16 @@ var TransactionDestination = /*#__PURE__*/function () {
129
198
  // plain JS object
130
199
  // create TransactionMessageSignEIP712Destination from JS object
131
200
  this.actualInstance = _TransactionMessageSignEIP712Destination["default"].constructFromObject(instance);
132
- } else if (_TransactionMessageSignEIP712Destination["default"].constructFromObject(instance)) {
133
- this.actualInstance = _TransactionMessageSignEIP712Destination["default"].constructFromObject(instance);
201
+ } else {
202
+ if (_TransactionMessageSignEIP712Destination["default"].constructFromObject(instance)) {
203
+ if (!!_TransactionMessageSignEIP712Destination["default"].constructFromObject(instance).toJSON) {
204
+ if (_TransactionMessageSignEIP712Destination["default"].constructFromObject(instance).toJSON()) {
205
+ this.actualInstance = _TransactionMessageSignEIP712Destination["default"].constructFromObject(instance);
206
+ }
207
+ } else {
208
+ this.actualInstance = _TransactionMessageSignEIP712Destination["default"].constructFromObject(instance);
209
+ }
210
+ }
134
211
  }
135
212
  match++;
136
213
  } catch (err) {
@@ -144,8 +221,16 @@ var TransactionDestination = /*#__PURE__*/function () {
144
221
  // plain JS object
145
222
  // create TransactionDepositToAddressDestination from JS object
146
223
  this.actualInstance = _TransactionDepositToAddressDestination["default"].constructFromObject(instance);
147
- } else if (_TransactionDepositToAddressDestination["default"].constructFromObject(instance)) {
148
- this.actualInstance = _TransactionDepositToAddressDestination["default"].constructFromObject(instance);
224
+ } else {
225
+ if (_TransactionDepositToAddressDestination["default"].constructFromObject(instance)) {
226
+ if (!!_TransactionDepositToAddressDestination["default"].constructFromObject(instance).toJSON) {
227
+ if (_TransactionDepositToAddressDestination["default"].constructFromObject(instance).toJSON()) {
228
+ this.actualInstance = _TransactionDepositToAddressDestination["default"].constructFromObject(instance);
229
+ }
230
+ } else {
231
+ this.actualInstance = _TransactionDepositToAddressDestination["default"].constructFromObject(instance);
232
+ }
233
+ }
149
234
  }
150
235
  match++;
151
236
  } catch (err) {
@@ -159,8 +244,16 @@ var TransactionDestination = /*#__PURE__*/function () {
159
244
  // plain JS object
160
245
  // create TransactionDepositToWalletDestination from JS object
161
246
  this.actualInstance = _TransactionDepositToWalletDestination["default"].constructFromObject(instance);
162
- } else if (_TransactionDepositToWalletDestination["default"].constructFromObject(instance)) {
163
- this.actualInstance = _TransactionDepositToWalletDestination["default"].constructFromObject(instance);
247
+ } else {
248
+ if (_TransactionDepositToWalletDestination["default"].constructFromObject(instance)) {
249
+ if (!!_TransactionDepositToWalletDestination["default"].constructFromObject(instance).toJSON) {
250
+ if (_TransactionDepositToWalletDestination["default"].constructFromObject(instance).toJSON()) {
251
+ this.actualInstance = _TransactionDepositToWalletDestination["default"].constructFromObject(instance);
252
+ }
253
+ } else {
254
+ this.actualInstance = _TransactionDepositToWalletDestination["default"].constructFromObject(instance);
255
+ }
256
+ }
164
257
  }
165
258
  match++;
166
259
  } catch (err) {
@@ -264,10 +357,10 @@ TransactionDestination.prototype['force_external'] = undefined;
264
357
  TransactionDestination.prototype['wallet_id'] = undefined;
265
358
 
266
359
  /**
267
- * The exchange trading account or the sub-wallet ID.
268
- * @member {String} sub_wallet_id
360
+ * The trading account type.
361
+ * @member {String} trading_account_type
269
362
  */
270
- TransactionDestination.prototype['sub_wallet_id'] = undefined;
363
+ TransactionDestination.prototype['trading_account_type'] = undefined;
271
364
 
272
365
  /**
273
366
  * @member {module:model/ExchangeId} exchange_id
@@ -275,7 +368,7 @@ TransactionDestination.prototype['sub_wallet_id'] = undefined;
275
368
  TransactionDestination.prototype['exchange_id'] = undefined;
276
369
 
277
370
  /**
278
- * The quantity of the token in the transaction. For example, if you trade 1.5 ETH, then the value is `1.5`.
371
+ * The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`.
279
372
  * @member {String} amount
280
373
  */
281
374
  TransactionDestination.prototype['amount'] = undefined;
@@ -287,7 +380,7 @@ TransactionDestination.prototype['amount'] = undefined;
287
380
  TransactionDestination.prototype['address'] = undefined;
288
381
 
289
382
  /**
290
- * The quantity of the token in the transaction. For example, if you trade 1.5 ETH, then the value is `1.5`.
383
+ * The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`.
291
384
  * @member {String} value
292
385
  */
293
386
  TransactionDestination.prototype['value'] = undefined;
@@ -133,7 +133,7 @@ TransactionEvmContractDestination.prototype['destination_type'] = undefined;
133
133
  TransactionEvmContractDestination.prototype['address'] = undefined;
134
134
 
135
135
  /**
136
- * The quantity of the token in the transaction. For example, if you trade 1.5 ETH, then the value is `1.5`.
136
+ * The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`.
137
137
  * @member {String} value
138
138
  */
139
139
  TransactionEvmContractDestination.prototype['value'] = undefined;
@@ -78,8 +78,8 @@ var TransactionExchangeWalletSource = /*#__PURE__*/function () {
78
78
  if (data.hasOwnProperty('wallet_id')) {
79
79
  obj['wallet_id'] = _ApiClient["default"].convertToType(data['wallet_id'], 'String');
80
80
  }
81
- if (data.hasOwnProperty('sub_wallet_id')) {
82
- obj['sub_wallet_id'] = _ApiClient["default"].convertToType(data['sub_wallet_id'], 'String');
81
+ if (data.hasOwnProperty('trading_account_type')) {
82
+ obj['trading_account_type'] = _ApiClient["default"].convertToType(data['trading_account_type'], 'String');
83
83
  }
84
84
  }
85
85
  return obj;
@@ -113,8 +113,8 @@ var TransactionExchangeWalletSource = /*#__PURE__*/function () {
113
113
  throw new Error("Expected the field `wallet_id` to be a primitive type in the JSON string but got " + data['wallet_id']);
114
114
  }
115
115
  // ensure the json data is a string
116
- if (data['sub_wallet_id'] && !(typeof data['sub_wallet_id'] === 'string' || data['sub_wallet_id'] instanceof String)) {
117
- throw new Error("Expected the field `sub_wallet_id` to be a primitive type in the JSON string but got " + data['sub_wallet_id']);
116
+ if (data['trading_account_type'] && !(typeof data['trading_account_type'] === 'string' || data['trading_account_type'] instanceof String)) {
117
+ throw new Error("Expected the field `trading_account_type` to be a primitive type in the JSON string but got " + data['trading_account_type']);
118
118
  }
119
119
  return true;
120
120
  }
@@ -140,7 +140,7 @@ TransactionExchangeWalletSource.prototype['wallet_id'] = undefined;
140
140
 
141
141
  /**
142
142
  * The exchange trading account or a sub-wallet ID.
143
- * @member {String} sub_wallet_id
143
+ * @member {String} trading_account_type
144
144
  */
145
- TransactionExchangeWalletSource.prototype['sub_wallet_id'] = undefined;
145
+ TransactionExchangeWalletSource.prototype['trading_account_type'] = undefined;
146
146
  var _default = exports["default"] = TransactionExchangeWalletSource;