@cobo/cobo-waas2 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +54 -18
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/api/FeeStationApi.js +18 -18
  4. package/dist/api/TransactionsApi.js +2 -2
  5. package/dist/api/WalletsApi.js +8 -8
  6. package/dist/index.js +260 -43
  7. package/dist/model/ActivityExtra.js +0 -23
  8. package/dist/model/AddressEncoding.js +15 -0
  9. package/dist/model/AddressesEventData.js +8 -3
  10. package/dist/model/BTCBIP137MessageSignDestination.js +122 -0
  11. package/dist/model/BTCBIP322MessageSignDestination.js +122 -0
  12. package/dist/model/BabylonStakingActivityDetailExtra.js +0 -39
  13. package/dist/model/{ListSwapActivities200Response.js → BankAccount.js} +51 -51
  14. package/dist/model/ChainsEventData.js +8 -3
  15. package/dist/model/CosmosAdr36MessageSignDestination.js +122 -0
  16. package/dist/model/CosmosContractCallDestination.js +152 -0
  17. package/dist/model/CosmosContractCallMessage.js +126 -0
  18. package/dist/model/CreateSettlement.js +174 -0
  19. package/dist/model/MPCVaultEventData.js +8 -3
  20. package/dist/model/{CreateSwapActivityRequest.js → Merchant.js} +45 -58
  21. package/dist/model/MessageSignDestination.js +111 -9
  22. package/dist/model/MessageSignDestinationType.js +15 -0
  23. package/dist/model/Order.js +306 -0
  24. package/dist/model/OrderStatus.js +76 -0
  25. package/dist/model/PaymentTransaction.js +201 -0
  26. package/dist/model/RefreshAddressBalancesByTokenRequest.js +2 -3
  27. package/dist/model/Refund.js +237 -0
  28. package/dist/model/RefundStatus.js +76 -0
  29. package/dist/model/RefundType.js +61 -0
  30. package/dist/model/SettleRequestStatus.js +76 -0
  31. package/dist/model/SettleStatus.js +76 -0
  32. package/dist/model/Settlement.js +168 -0
  33. package/dist/model/SettlementDetail.js +184 -0
  34. package/dist/model/SettlementInfo.js +175 -0
  35. package/dist/model/SettlementType.js +61 -0
  36. package/dist/model/SwapActivity.js +36 -5
  37. package/dist/model/SwapActivityStatus.js +66 -0
  38. package/dist/model/SwapActivityType.js +61 -0
  39. package/dist/model/SwapQuote.js +21 -34
  40. package/dist/model/{CreateSwapQuoteRequest.js → SwapToken.js} +73 -60
  41. package/dist/model/TSSRequestWebhookEventData.js +8 -3
  42. package/dist/model/TokenListing.js +230 -0
  43. package/dist/model/TokenListingEventData.js +363 -0
  44. package/dist/model/TokenListingRequestSource.js +61 -0
  45. package/dist/model/TokenListingRequestStatus.js +66 -0
  46. package/dist/model/TokensEventData.js +8 -3
  47. package/dist/model/Transaction.js +22 -5
  48. package/dist/model/TransactionBIP137Destination.js +122 -0
  49. package/dist/model/TransactionBIP322Destination.js +122 -0
  50. package/dist/model/TransactionBabylonBusinessInfo.js +138 -0
  51. package/dist/model/TransactionBabylonTxParameters.js +168 -0
  52. package/dist/model/TransactionCoreStakeInfo.js +168 -0
  53. package/dist/model/TransactionCosmosAdr36Destination.js +122 -0
  54. package/dist/model/TransactionCosmosContractDestination.js +152 -0
  55. package/dist/model/{ListEnableTokenPairs200Response.js → TransactionCosmosMessage.js} +54 -51
  56. package/dist/model/TransactionDestination.js +172 -8
  57. package/dist/model/TransactionDestinationType.js +20 -0
  58. package/dist/model/TransactionDetail.js +29 -7
  59. package/dist/model/TransactionDetails.js +29 -7
  60. package/dist/model/TransactionExtra.js +278 -0
  61. package/dist/model/TransactionExtraType.js +66 -0
  62. package/dist/model/TransactionFuelingInfo.js +3 -3
  63. package/dist/model/TransactionMessageSignBTCEIP191Destination.js +122 -0
  64. package/dist/model/TransactionRbfSource.js +37 -9
  65. package/dist/model/TransactionSelectedUtxo.js +2 -2
  66. package/dist/model/TransactionSubStatus.js +45 -0
  67. package/dist/model/TransactionWebhookEventData.js +37 -10
  68. package/dist/model/UpdateCustodialWalletParams.js +6 -4
  69. package/dist/model/UpdateExchangeWalletParams.js +6 -4
  70. package/dist/model/UpdateMpcWalletParams.js +6 -4
  71. package/dist/model/UpdateSmartContractWalletParams.js +6 -4
  72. package/dist/model/WalletInfoEventData.js +8 -3
  73. package/dist/model/WebhookEventData.js +81 -18
  74. package/dist/model/WebhookEventDataType.js +7 -2
  75. package/dist/model/WebhookEventType.js +10 -0
  76. package/docs/ActivityExtra.md +0 -4
  77. package/docs/AddressEncoding.md +6 -0
  78. package/docs/AddressesEventData.md +3 -1
  79. package/docs/BTCBIP137MessageSignDestination.md +10 -0
  80. package/docs/BTCBIP322MessageSignDestination.md +10 -0
  81. package/docs/BabylonStakingActivityDetailExtra.md +0 -4
  82. package/docs/BankAccount.md +10 -0
  83. package/docs/ChainsEventData.md +3 -1
  84. package/docs/CosmosAdr36MessageSignDestination.md +10 -0
  85. package/docs/CosmosContractCallDestination.md +11 -0
  86. package/docs/CosmosContractCallMessage.md +10 -0
  87. package/docs/CreateSettlement.md +14 -0
  88. package/docs/FeeStationApi.md +13 -13
  89. package/docs/MPCVaultEventData.md +3 -1
  90. package/docs/Merchant.md +11 -0
  91. package/docs/MessageSignDestination.md +3 -0
  92. package/docs/MessageSignDestinationType.md +6 -0
  93. package/docs/Order.md +23 -0
  94. package/docs/OrderStatus.md +18 -0
  95. package/docs/PaymentTransaction.md +16 -0
  96. package/docs/RefreshAddressBalancesByTokenRequest.md +1 -1
  97. package/docs/Refund.md +17 -0
  98. package/docs/RefundStatus.md +18 -0
  99. package/docs/RefundType.md +12 -0
  100. package/docs/SettleRequestStatus.md +18 -0
  101. package/docs/SettleStatus.md +18 -0
  102. package/docs/Settlement.md +12 -0
  103. package/docs/SettlementDetail.md +15 -0
  104. package/docs/SettlementInfo.md +14 -0
  105. package/docs/SettlementType.md +12 -0
  106. package/docs/SwapActivity.md +4 -1
  107. package/docs/SwapActivityStatus.md +14 -0
  108. package/docs/SwapActivityType.md +12 -0
  109. package/docs/SwapQuote.md +3 -4
  110. package/docs/SwapToken.md +14 -0
  111. package/docs/TSSRequestWebhookEventData.md +3 -1
  112. package/docs/TokenListing.md +19 -0
  113. package/docs/TokenListingEventData.md +45 -0
  114. package/docs/TokenListingRequestSource.md +12 -0
  115. package/docs/TokenListingRequestStatus.md +14 -0
  116. package/docs/TokensEventData.md +3 -1
  117. package/docs/Transaction.md +4 -3
  118. package/docs/TransactionBIP137Destination.md +10 -0
  119. package/docs/TransactionBIP322Destination.md +10 -0
  120. package/docs/TransactionBabylonBusinessInfo.md +11 -0
  121. package/docs/TransactionBabylonTxParameters.md +15 -0
  122. package/docs/TransactionCoreStakeInfo.md +14 -0
  123. package/docs/TransactionCosmosAdr36Destination.md +10 -0
  124. package/docs/TransactionCosmosContractDestination.md +11 -0
  125. package/docs/TransactionCosmosMessage.md +10 -0
  126. package/docs/TransactionDestination.md +4 -0
  127. package/docs/TransactionDestinationType.md +8 -0
  128. package/docs/TransactionDetail.md +4 -3
  129. package/docs/TransactionDetails.md +4 -3
  130. package/docs/TransactionExtra.md +21 -0
  131. package/docs/TransactionExtraType.md +14 -0
  132. package/docs/TransactionFuelingInfo.md +2 -2
  133. package/docs/TransactionMessageSignBTCEIP191Destination.md +10 -0
  134. package/docs/TransactionRbfSource.md +1 -1
  135. package/docs/TransactionSelectedUtxo.md +2 -2
  136. package/docs/TransactionSubStatus.md +18 -0
  137. package/docs/TransactionWebhookEventData.md +7 -4
  138. package/docs/TransactionsApi.md +1 -1
  139. package/docs/UpdateCustodialWalletParams.md +1 -1
  140. package/docs/UpdateExchangeWalletParams.md +1 -1
  141. package/docs/UpdateMpcWalletParams.md +1 -1
  142. package/docs/UpdateSmartContractWalletParams.md +1 -1
  143. package/docs/UpdateWalletParams.md +1 -1
  144. package/docs/WalletInfoEventData.md +3 -1
  145. package/docs/WalletsApi.md +5 -5
  146. package/docs/WebhookEventData.md +16 -8
  147. package/docs/WebhookEventDataType.md +3 -1
  148. package/docs/WebhookEventType.md +4 -0
  149. package/package.json +1 -1
  150. package/dist/api/SwapsApi.js +0 -360
  151. package/dist/model/CreateSwapQuote201Response.js +0 -264
  152. package/dist/model/SwapTokenPair.js +0 -100
  153. package/docs/CreateSwapActivityRequest.md +0 -12
  154. package/docs/CreateSwapQuote201Response.md +0 -17
  155. package/docs/CreateSwapQuoteRequest.md +0 -13
  156. package/docs/ListEnableTokenPairs200Response.md +0 -10
  157. package/docs/ListSwapActivities200Response.md +0 -10
  158. package/docs/SwapTokenPair.md +0 -10
  159. package/docs/SwapsApi.md +0 -348
@@ -0,0 +1,66 @@
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 _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ 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); } /**
16
+ * Cobo Wallet as a Service 2.0
17
+ *
18
+ * Contact: help@cobo.com
19
+ *
20
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
21
+ * https://openapi-generator.tech
22
+ * Do not edit the class manually.
23
+ *
24
+ */
25
+ /**
26
+ * Enum class TokenListingRequestStatus.
27
+ * @enum {}
28
+ * @readonly
29
+ */
30
+ var TokenListingRequestStatus = exports["default"] = /*#__PURE__*/function () {
31
+ function TokenListingRequestStatus() {
32
+ _classCallCheck(this, TokenListingRequestStatus);
33
+ /**
34
+ * value: "Submitted"
35
+ * @const
36
+ */
37
+ _defineProperty(this, "Submitted", "Submitted");
38
+ /**
39
+ * value: "Succeeded"
40
+ * @const
41
+ */
42
+ _defineProperty(this, "Succeeded", "Succeeded");
43
+ /**
44
+ * value: "Failed"
45
+ * @const
46
+ */
47
+ _defineProperty(this, "Failed", "Failed");
48
+ /**
49
+ * value: "unknown_default_open_api"
50
+ * @const
51
+ */
52
+ _defineProperty(this, "unknown_default_open_api", "unknown_default_open_api");
53
+ }
54
+ return _createClass(TokenListingRequestStatus, null, [{
55
+ key: "constructFromObject",
56
+ value:
57
+ /**
58
+ * Returns a <code>TokenListingRequestStatus</code> enum value from a Javascript object name.
59
+ * @param {Object} data The plain JavaScript object containing the name of the enum value.
60
+ * @return {module:model/TokenListingRequestStatus} The enum <code>TokenListingRequestStatus</code> value.
61
+ */
62
+ function constructFromObject(object) {
63
+ return object;
64
+ }
65
+ }]);
66
+ }();
@@ -35,7 +35,7 @@ var TokensEventData = /*#__PURE__*/function () {
35
35
  * Constructs a new <code>TokensEventData</code>.
36
36
  * @alias module:model/TokensEventData
37
37
  * @implements module:model/WebhookEventDataType
38
- * @param data_type {module:model/TokensEventData.DataTypeEnum} The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data.
38
+ * @param data_type {module:model/TokensEventData.DataTypeEnum} The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data.
39
39
  * @param tokens {Array.<module:model/TokenInfo>} The enabled tokens.
40
40
  */
41
41
  function TokensEventData(data_type, tokens) {
@@ -134,7 +134,7 @@ var TokensEventData = /*#__PURE__*/function () {
134
134
  TokensEventData.RequiredProperties = ["data_type", "tokens"];
135
135
 
136
136
  /**
137
- * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data.
137
+ * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data.
138
138
  * @member {module:model/TokensEventData.DataTypeEnum} data_type
139
139
  */
140
140
  TokensEventData.prototype['data_type'] = undefined;
@@ -147,7 +147,7 @@ TokensEventData.prototype['tokens'] = undefined;
147
147
 
148
148
  // Implement WebhookEventDataType interface:
149
149
  /**
150
- * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data.
150
+ * The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data.
151
151
  * @member {module:model/WebhookEventDataType.DataTypeEnum} data_type
152
152
  */
153
153
  _WebhookEventDataType["default"].prototype['data_type'] = undefined;
@@ -193,6 +193,11 @@ TokensEventData['DataTypeEnum'] = {
193
193
  * @const
194
194
  */
195
195
  "Tokens": "Tokens",
196
+ /**
197
+ * value: "TokenListing"
198
+ * @const
199
+ */
200
+ "TokenListing": "TokenListing",
196
201
  /**
197
202
  * value: "unknown_default_open_api"
198
203
  * @const
@@ -51,10 +51,12 @@ var Transaction = /*#__PURE__*/function () {
51
51
  * @param source {module:model/TransactionSource}
52
52
  * @param destination {module:model/TransactionDestination}
53
53
  * @param initiator_type {module:model/TransactionInitiatorType}
54
+ * @param created_timestamp {Number} The time when the transaction was created, in Unix timestamp format, measured in milliseconds.
55
+ * @param updated_timestamp {Number} The time when the transaction was updated, in Unix timestamp format, measured in milliseconds.
54
56
  */
55
- function Transaction(transaction_id, wallet_id, status, source, destination, initiator_type) {
57
+ function Transaction(transaction_id, wallet_id, status, source, destination, initiator_type, created_timestamp, updated_timestamp) {
56
58
  _classCallCheck(this, Transaction);
57
- Transaction.initialize(this, transaction_id, wallet_id, status, source, destination, initiator_type);
59
+ Transaction.initialize(this, transaction_id, wallet_id, status, source, destination, initiator_type, created_timestamp, updated_timestamp);
58
60
  }
59
61
 
60
62
  /**
@@ -64,13 +66,15 @@ var Transaction = /*#__PURE__*/function () {
64
66
  */
65
67
  return _createClass(Transaction, null, [{
66
68
  key: "initialize",
67
- value: function initialize(obj, transaction_id, wallet_id, status, source, destination, initiator_type) {
69
+ value: function initialize(obj, transaction_id, wallet_id, status, source, destination, initiator_type, created_timestamp, updated_timestamp) {
68
70
  obj['transaction_id'] = transaction_id;
69
71
  obj['wallet_id'] = wallet_id;
70
72
  obj['status'] = status;
71
73
  obj['source'] = source;
72
74
  obj['destination'] = destination;
73
75
  obj['initiator_type'] = initiator_type;
76
+ obj['created_timestamp'] = created_timestamp;
77
+ obj['updated_timestamp'] = updated_timestamp;
74
78
  }
75
79
 
76
80
  /**
@@ -166,6 +170,9 @@ var Transaction = /*#__PURE__*/function () {
166
170
  if (data.hasOwnProperty('cobo_category')) {
167
171
  obj['cobo_category'] = _ApiClient["default"].convertToType(data['cobo_category'], ['String']);
168
172
  }
173
+ if (data.hasOwnProperty('extra')) {
174
+ obj['extra'] = _ApiClient["default"].convertToType(data['extra'], ['String']);
175
+ }
169
176
  if (data.hasOwnProperty('fueling_info')) {
170
177
  obj['fueling_info'] = _TransactionFuelingInfo["default"].constructFromObject(data['fueling_info']);
171
178
  }
@@ -303,6 +310,10 @@ var Transaction = /*#__PURE__*/function () {
303
310
  if (!Array.isArray(data['cobo_category'])) {
304
311
  throw new Error("Expected the field `cobo_category` to be an array in the JSON data but got " + data['cobo_category']);
305
312
  }
313
+ // ensure the json data is an array
314
+ if (!Array.isArray(data['extra'])) {
315
+ throw new Error("Expected the field `extra` to be an array in the JSON data but got " + data['extra']);
316
+ }
306
317
  // validate the optional field `fueling_info`
307
318
  if (data['fueling_info']) {
308
319
  // data not null
@@ -314,7 +325,7 @@ var Transaction = /*#__PURE__*/function () {
314
325
  }
315
326
  }]);
316
327
  }();
317
- Transaction.RequiredProperties = ["transaction_id", "wallet_id", "status", "source", "destination", "initiator_type"];
328
+ Transaction.RequiredProperties = ["transaction_id", "wallet_id", "status", "source", "destination", "initiator_type", "created_timestamp", "updated_timestamp"];
318
329
 
319
330
  /**
320
331
  * The transaction ID.
@@ -462,11 +473,17 @@ Transaction.prototype['description'] = undefined;
462
473
  Transaction.prototype['is_loop'] = undefined;
463
474
 
464
475
  /**
465
- * A transaction category for cobo to identify your transactions.
476
+ * The transaction category defined by Cobo. Possible values include: - `AutoSweep`: An auto-sweep transaction. - `AutoFueling`: A transaction where Fee Station pays transaction fees to an address within your wallet. - `AutoFuelingRefund`: A refund for an auto-fueling transaction. - `SafeTxMessage`: A message signing transaction to authorize a Smart Contract Wallet (Safe\\{Wallet\\}) transaction. - `BillPayment`: A transaction to pay Cobo bills through Fee Station. - `BillRefund`: A refund for a previously made bill payment. - `CommissionFeeCharge`: A transaction to charge commission fees via Fee Station. - `CommissionFeeRefund`: A refund of previously charged commission fees.
466
477
  * @member {Array.<String>} cobo_category
467
478
  */
468
479
  Transaction.prototype['cobo_category'] = undefined;
469
480
 
481
+ /**
482
+ * The transaction extra information.
483
+ * @member {Array.<String>} extra
484
+ */
485
+ Transaction.prototype['extra'] = undefined;
486
+
470
487
  /**
471
488
  * @member {module:model/TransactionFuelingInfo} fueling_info
472
489
  */
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _TransactionDestinationType = _interopRequireDefault(require("./TransactionDestinationType"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19
+ * Cobo Wallet as a Service 2.0
20
+ *
21
+ * Contact: help@cobo.com
22
+ *
23
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24
+ * https://openapi-generator.tech
25
+ * Do not edit the class manually.
26
+ *
27
+ */
28
+ /**
29
+ * The TransactionBIP137Destination model module.
30
+ * @module model/TransactionBIP137Destination
31
+ */
32
+ var TransactionBIP137Destination = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>TransactionBIP137Destination</code>.
35
+ * The information about the destination &#x60;BTC_BIP_137&#x60;. Refer to [Transaction sources and destinations](https://www.cobo.com/developers/v2/guides/transactions/sources-and-destinations) for a detailed introduction about the supported sources and destinations for each transaction type. Switch between the tabs to display the properties for different transaction destinations.
36
+ * @alias module:model/TransactionBIP137Destination
37
+ * @param destination_type {module:model/TransactionDestinationType}
38
+ * @param message_bip137 {String} Message to be signed, in hexadecimal format.
39
+ */
40
+ function TransactionBIP137Destination(destination_type, message_bip137) {
41
+ _classCallCheck(this, TransactionBIP137Destination);
42
+ TransactionBIP137Destination.initialize(this, destination_type, message_bip137);
43
+ }
44
+
45
+ /**
46
+ * Initializes the fields of this object.
47
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
48
+ * Only for internal use.
49
+ */
50
+ return _createClass(TransactionBIP137Destination, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, destination_type, message_bip137) {
53
+ obj['destination_type'] = destination_type;
54
+ obj['message_bip137'] = message_bip137;
55
+ }
56
+
57
+ /**
58
+ * Constructs a <code>TransactionBIP137Destination</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/TransactionBIP137Destination} obj Optional instance to populate.
62
+ * @return {module:model/TransactionBIP137Destination} The populated <code>TransactionBIP137Destination</code> instance.
63
+ */
64
+ }, {
65
+ key: "constructFromObject",
66
+ value: function constructFromObject(data, obj) {
67
+ if (data) {
68
+ obj = obj || new TransactionBIP137Destination();
69
+ if (data.hasOwnProperty('destination_type')) {
70
+ obj['destination_type'] = _TransactionDestinationType["default"].constructFromObject(data['destination_type']);
71
+ }
72
+ if (data.hasOwnProperty('message_bip137')) {
73
+ obj['message_bip137'] = _ApiClient["default"].convertToType(data['message_bip137'], 'String');
74
+ }
75
+ }
76
+ return obj;
77
+ }
78
+
79
+ /**
80
+ * Validates the JSON data with respect to <code>TransactionBIP137Destination</code>.
81
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
82
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TransactionBIP137Destination</code>.
83
+ */
84
+ }, {
85
+ key: "validateJSON",
86
+ value: function validateJSON(data) {
87
+ // check to make sure all required properties are present in the JSON string
88
+ var _iterator = _createForOfIteratorHelper(TransactionBIP137Destination.RequiredProperties),
89
+ _step;
90
+ try {
91
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
92
+ var property = _step.value;
93
+ if (!data.hasOwnProperty(property)) {
94
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
95
+ }
96
+ }
97
+ // ensure the json data is a string
98
+ } catch (err) {
99
+ _iterator.e(err);
100
+ } finally {
101
+ _iterator.f();
102
+ }
103
+ if (data['message_bip137'] && !(typeof data['message_bip137'] === 'string' || data['message_bip137'] instanceof String)) {
104
+ throw new Error("Expected the field `message_bip137` to be a primitive type in the JSON string but got " + data['message_bip137']);
105
+ }
106
+ return true;
107
+ }
108
+ }]);
109
+ }();
110
+ TransactionBIP137Destination.RequiredProperties = ["destination_type", "message_bip137"];
111
+
112
+ /**
113
+ * @member {module:model/TransactionDestinationType} destination_type
114
+ */
115
+ TransactionBIP137Destination.prototype['destination_type'] = undefined;
116
+
117
+ /**
118
+ * Message to be signed, in hexadecimal format.
119
+ * @member {String} message_bip137
120
+ */
121
+ TransactionBIP137Destination.prototype['message_bip137'] = undefined;
122
+ var _default = exports["default"] = TransactionBIP137Destination;
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _TransactionDestinationType = _interopRequireDefault(require("./TransactionDestinationType"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19
+ * Cobo Wallet as a Service 2.0
20
+ *
21
+ * Contact: help@cobo.com
22
+ *
23
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24
+ * https://openapi-generator.tech
25
+ * Do not edit the class manually.
26
+ *
27
+ */
28
+ /**
29
+ * The TransactionBIP322Destination model module.
30
+ * @module model/TransactionBIP322Destination
31
+ */
32
+ var TransactionBIP322Destination = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>TransactionBIP322Destination</code>.
35
+ * The information about the destination &#x60;BTC_BIP_322&#x60;. Refer to [Transaction sources and destinations](https://www.cobo.com/developers/v2/guides/transactions/sources-and-destinations) for a detailed introduction about the supported sources and destinations for each transaction type. Switch between the tabs to display the properties for different transaction destinations.
36
+ * @alias module:model/TransactionBIP322Destination
37
+ * @param destination_type {module:model/TransactionDestinationType}
38
+ * @param message_bip322 {String} Message to be signed, in hexadecimal format.
39
+ */
40
+ function TransactionBIP322Destination(destination_type, message_bip322) {
41
+ _classCallCheck(this, TransactionBIP322Destination);
42
+ TransactionBIP322Destination.initialize(this, destination_type, message_bip322);
43
+ }
44
+
45
+ /**
46
+ * Initializes the fields of this object.
47
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
48
+ * Only for internal use.
49
+ */
50
+ return _createClass(TransactionBIP322Destination, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, destination_type, message_bip322) {
53
+ obj['destination_type'] = destination_type;
54
+ obj['message_bip322'] = message_bip322;
55
+ }
56
+
57
+ /**
58
+ * Constructs a <code>TransactionBIP322Destination</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/TransactionBIP322Destination} obj Optional instance to populate.
62
+ * @return {module:model/TransactionBIP322Destination} The populated <code>TransactionBIP322Destination</code> instance.
63
+ */
64
+ }, {
65
+ key: "constructFromObject",
66
+ value: function constructFromObject(data, obj) {
67
+ if (data) {
68
+ obj = obj || new TransactionBIP322Destination();
69
+ if (data.hasOwnProperty('destination_type')) {
70
+ obj['destination_type'] = _TransactionDestinationType["default"].constructFromObject(data['destination_type']);
71
+ }
72
+ if (data.hasOwnProperty('message_bip322')) {
73
+ obj['message_bip322'] = _ApiClient["default"].convertToType(data['message_bip322'], 'String');
74
+ }
75
+ }
76
+ return obj;
77
+ }
78
+
79
+ /**
80
+ * Validates the JSON data with respect to <code>TransactionBIP322Destination</code>.
81
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
82
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TransactionBIP322Destination</code>.
83
+ */
84
+ }, {
85
+ key: "validateJSON",
86
+ value: function validateJSON(data) {
87
+ // check to make sure all required properties are present in the JSON string
88
+ var _iterator = _createForOfIteratorHelper(TransactionBIP322Destination.RequiredProperties),
89
+ _step;
90
+ try {
91
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
92
+ var property = _step.value;
93
+ if (!data.hasOwnProperty(property)) {
94
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
95
+ }
96
+ }
97
+ // ensure the json data is a string
98
+ } catch (err) {
99
+ _iterator.e(err);
100
+ } finally {
101
+ _iterator.f();
102
+ }
103
+ if (data['message_bip322'] && !(typeof data['message_bip322'] === 'string' || data['message_bip322'] instanceof String)) {
104
+ throw new Error("Expected the field `message_bip322` to be a primitive type in the JSON string but got " + data['message_bip322']);
105
+ }
106
+ return true;
107
+ }
108
+ }]);
109
+ }();
110
+ TransactionBIP322Destination.RequiredProperties = ["destination_type", "message_bip322"];
111
+
112
+ /**
113
+ * @member {module:model/TransactionDestinationType} destination_type
114
+ */
115
+ TransactionBIP322Destination.prototype['destination_type'] = undefined;
116
+
117
+ /**
118
+ * Message to be signed, in hexadecimal format.
119
+ * @member {String} message_bip322
120
+ */
121
+ TransactionBIP322Destination.prototype['message_bip322'] = undefined;
122
+ var _default = exports["default"] = TransactionBIP322Destination;
@@ -0,0 +1,138 @@
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 _TransactionExtraType = _interopRequireDefault(require("./TransactionExtraType"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
13
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
14
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
17
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
20
+ * Cobo Wallet as a Service 2.0
21
+ *
22
+ * Contact: help@cobo.com
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The TransactionBabylonBusinessInfo model module.
31
+ * @module model/TransactionBabylonBusinessInfo
32
+ */
33
+ var TransactionBabylonBusinessInfo = /*#__PURE__*/function () {
34
+ /**
35
+ * Constructs a new <code>TransactionBabylonBusinessInfo</code>.
36
+ * The Babylon business information.
37
+ * @alias module:model/TransactionBabylonBusinessInfo
38
+ * @param extra_type {module:model/TransactionExtraType}
39
+ */
40
+ function TransactionBabylonBusinessInfo(extra_type) {
41
+ _classCallCheck(this, TransactionBabylonBusinessInfo);
42
+ TransactionBabylonBusinessInfo.initialize(this, extra_type);
43
+ }
44
+
45
+ /**
46
+ * Initializes the fields of this object.
47
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
48
+ * Only for internal use.
49
+ */
50
+ return _createClass(TransactionBabylonBusinessInfo, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, extra_type) {
53
+ obj['extra_type'] = extra_type;
54
+ }
55
+
56
+ /**
57
+ * Constructs a <code>TransactionBabylonBusinessInfo</code> from a plain JavaScript object, optionally creating a new instance.
58
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
59
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
60
+ * @param {module:model/TransactionBabylonBusinessInfo} obj Optional instance to populate.
61
+ * @return {module:model/TransactionBabylonBusinessInfo} The populated <code>TransactionBabylonBusinessInfo</code> instance.
62
+ */
63
+ }, {
64
+ key: "constructFromObject",
65
+ value: function constructFromObject(data, obj) {
66
+ if (data) {
67
+ obj = obj || new TransactionBabylonBusinessInfo();
68
+ if (data.hasOwnProperty('extra_type')) {
69
+ obj['extra_type'] = _TransactionExtraType["default"].constructFromObject(data['extra_type']);
70
+ }
71
+ if (data.hasOwnProperty('babylon_address_info')) {
72
+ obj['babylon_address_info'] = _AddressInfo["default"].constructFromObject(data['babylon_address_info']);
73
+ }
74
+ if (data.hasOwnProperty('btc_address_info')) {
75
+ obj['btc_address_info'] = _AddressInfo["default"].constructFromObject(data['btc_address_info']);
76
+ }
77
+ }
78
+ return obj;
79
+ }
80
+
81
+ /**
82
+ * Validates the JSON data with respect to <code>TransactionBabylonBusinessInfo</code>.
83
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
84
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TransactionBabylonBusinessInfo</code>.
85
+ */
86
+ }, {
87
+ key: "validateJSON",
88
+ value: function validateJSON(data) {
89
+ // check to make sure all required properties are present in the JSON string
90
+ var _iterator = _createForOfIteratorHelper(TransactionBabylonBusinessInfo.RequiredProperties),
91
+ _step;
92
+ try {
93
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
94
+ var property = _step.value;
95
+ if (!data.hasOwnProperty(property)) {
96
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
97
+ }
98
+ }
99
+ // validate the optional field `babylon_address_info`
100
+ } catch (err) {
101
+ _iterator.e(err);
102
+ } finally {
103
+ _iterator.f();
104
+ }
105
+ if (data['babylon_address_info']) {
106
+ // data not null
107
+ if (!!_AddressInfo["default"].validateJSON) {
108
+ _AddressInfo["default"].validateJSON(data['babylon_address_info']);
109
+ }
110
+ }
111
+ // validate the optional field `btc_address_info`
112
+ if (data['btc_address_info']) {
113
+ // data not null
114
+ if (!!_AddressInfo["default"].validateJSON) {
115
+ _AddressInfo["default"].validateJSON(data['btc_address_info']);
116
+ }
117
+ }
118
+ return true;
119
+ }
120
+ }]);
121
+ }();
122
+ TransactionBabylonBusinessInfo.RequiredProperties = ["extra_type"];
123
+
124
+ /**
125
+ * @member {module:model/TransactionExtraType} extra_type
126
+ */
127
+ TransactionBabylonBusinessInfo.prototype['extra_type'] = undefined;
128
+
129
+ /**
130
+ * @member {module:model/AddressInfo} babylon_address_info
131
+ */
132
+ TransactionBabylonBusinessInfo.prototype['babylon_address_info'] = undefined;
133
+
134
+ /**
135
+ * @member {module:model/AddressInfo} btc_address_info
136
+ */
137
+ TransactionBabylonBusinessInfo.prototype['btc_address_info'] = undefined;
138
+ var _default = exports["default"] = TransactionBabylonBusinessInfo;