@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
@@ -56,11 +56,13 @@ var TransactionDetails = /*#__PURE__*/function () {
56
56
  * @param source {module:model/TransactionSource}
57
57
  * @param destination {module:model/TransactionDestination}
58
58
  * @param initiator_type {module:model/TransactionInitiatorType}
59
+ * @param created_timestamp {Number} The time when the transaction was created, in Unix timestamp format, measured in milliseconds.
60
+ * @param updated_timestamp {Number} The time when the transaction was updated, in Unix timestamp format, measured in milliseconds.
59
61
  */
60
- function TransactionDetails(transaction_id, wallet_id, status, source, destination, initiator_type) {
62
+ function TransactionDetails(transaction_id, wallet_id, status, source, destination, initiator_type, created_timestamp, updated_timestamp) {
61
63
  _classCallCheck(this, TransactionDetails);
62
- _Transaction["default"].initialize(this, transaction_id, wallet_id, status, source, destination, initiator_type);
63
- TransactionDetails.initialize(this, transaction_id, wallet_id, status, source, destination, initiator_type);
64
+ _Transaction["default"].initialize(this, transaction_id, wallet_id, status, source, destination, initiator_type, created_timestamp, updated_timestamp);
65
+ TransactionDetails.initialize(this, transaction_id, wallet_id, status, source, destination, initiator_type, created_timestamp, updated_timestamp);
64
66
  }
65
67
 
66
68
  /**
@@ -70,13 +72,15 @@ var TransactionDetails = /*#__PURE__*/function () {
70
72
  */
71
73
  return _createClass(TransactionDetails, null, [{
72
74
  key: "initialize",
73
- value: function initialize(obj, transaction_id, wallet_id, status, source, destination, initiator_type) {
75
+ value: function initialize(obj, transaction_id, wallet_id, status, source, destination, initiator_type, created_timestamp, updated_timestamp) {
74
76
  obj['transaction_id'] = transaction_id;
75
77
  obj['wallet_id'] = wallet_id;
76
78
  obj['status'] = status;
77
79
  obj['source'] = source;
78
80
  obj['destination'] = destination;
79
81
  obj['initiator_type'] = initiator_type;
82
+ obj['created_timestamp'] = created_timestamp;
83
+ obj['updated_timestamp'] = updated_timestamp;
80
84
  }
81
85
 
82
86
  /**
@@ -173,6 +177,9 @@ var TransactionDetails = /*#__PURE__*/function () {
173
177
  if (data.hasOwnProperty('cobo_category')) {
174
178
  obj['cobo_category'] = _ApiClient["default"].convertToType(data['cobo_category'], ['String']);
175
179
  }
180
+ if (data.hasOwnProperty('extra')) {
181
+ obj['extra'] = _ApiClient["default"].convertToType(data['extra'], ['String']);
182
+ }
176
183
  if (data.hasOwnProperty('fueling_info')) {
177
184
  obj['fueling_info'] = _TransactionFuelingInfo["default"].constructFromObject(data['fueling_info']);
178
185
  }
@@ -337,6 +344,10 @@ var TransactionDetails = /*#__PURE__*/function () {
337
344
  if (!Array.isArray(data['cobo_category'])) {
338
345
  throw new Error("Expected the field `cobo_category` to be an array in the JSON data but got " + data['cobo_category']);
339
346
  }
347
+ // ensure the json data is an array
348
+ if (!Array.isArray(data['extra'])) {
349
+ throw new Error("Expected the field `extra` to be an array in the JSON data but got " + data['extra']);
350
+ }
340
351
  // validate the optional field `fueling_info`
341
352
  if (data['fueling_info']) {
342
353
  // data not null
@@ -434,7 +445,7 @@ var TransactionDetails = /*#__PURE__*/function () {
434
445
  }
435
446
  }]);
436
447
  }();
437
- TransactionDetails.RequiredProperties = ["transaction_id", "wallet_id", "status", "source", "destination", "initiator_type"];
448
+ TransactionDetails.RequiredProperties = ["transaction_id", "wallet_id", "status", "source", "destination", "initiator_type", "created_timestamp", "updated_timestamp"];
438
449
 
439
450
  /**
440
451
  * The transaction ID.
@@ -582,11 +593,17 @@ TransactionDetails.prototype['description'] = undefined;
582
593
  TransactionDetails.prototype['is_loop'] = undefined;
583
594
 
584
595
  /**
585
- * A transaction category for cobo to identify your transactions.
596
+ * 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.
586
597
  * @member {Array.<String>} cobo_category
587
598
  */
588
599
  TransactionDetails.prototype['cobo_category'] = undefined;
589
600
 
601
+ /**
602
+ * The transaction extra information.
603
+ * @member {Array.<String>} extra
604
+ */
605
+ TransactionDetails.prototype['extra'] = undefined;
606
+
590
607
  /**
591
608
  * @member {module:model/TransactionFuelingInfo} fueling_info
592
609
  */
@@ -775,10 +792,15 @@ _Transaction["default"].prototype['description'] = undefined;
775
792
  */
776
793
  _Transaction["default"].prototype['is_loop'] = undefined;
777
794
  /**
778
- * A transaction category for cobo to identify your transactions.
795
+ * 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.
779
796
  * @member {Array.<String>} cobo_category
780
797
  */
781
798
  _Transaction["default"].prototype['cobo_category'] = undefined;
799
+ /**
800
+ * The transaction extra information.
801
+ * @member {Array.<String>} extra
802
+ */
803
+ _Transaction["default"].prototype['extra'] = undefined;
782
804
  /**
783
805
  * @member {module:model/TransactionFuelingInfo} fueling_info
784
806
  */
@@ -0,0 +1,278 @@
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 _ActivityType = _interopRequireDefault(require("./ActivityType"));
9
+ var _AddressInfo = _interopRequireDefault(require("./AddressInfo"));
10
+ var _TransactionBabylonBusinessInfo = _interopRequireDefault(require("./TransactionBabylonBusinessInfo"));
11
+ var _TransactionBabylonTxParameters = _interopRequireDefault(require("./TransactionBabylonTxParameters"));
12
+ var _TransactionCoreStakeInfo = _interopRequireDefault(require("./TransactionCoreStakeInfo"));
13
+ var _TransactionExtraType = _interopRequireDefault(require("./TransactionExtraType"));
14
+ var _TransactionExtra;
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
16
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
17
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
18
+ 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); } }
19
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
20
+ 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; }
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: help@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 TransactionExtra model module.
34
+ * @module model/TransactionExtra
35
+ */
36
+ var TransactionExtra = /*#__PURE__*/function () {
37
+ /**
38
+ * Constructs a new <code>TransactionExtra</code>.
39
+ * @alias module:model/TransactionExtra
40
+ * @param {(module:model/TransactionBabylonBusinessInfo|module:model/TransactionBabylonTxParameters|module:model/TransactionCoreStakeInfo)} instance The actual instance to initialize TransactionExtra.
41
+ */
42
+ function TransactionExtra() {
43
+ var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
44
+ _classCallCheck(this, TransactionExtra);
45
+ /**
46
+ * Returns the JSON representation of the actual instance.
47
+ * @return {string}
48
+ */
49
+ _defineProperty(this, "toJSON", function () {
50
+ return this.getActualInstance();
51
+ });
52
+ if (instance === null) {
53
+ this.actualInstance = null;
54
+ return;
55
+ }
56
+ var match = 0;
57
+ var errorMessages = [];
58
+ var discriminatorValue = instance["extra_type"];
59
+ if (discriminatorValue) {
60
+ switch (discriminatorValue) {
61
+ case "BabylonBusinessInfo":
62
+ this.actualInstance = _TransactionBabylonBusinessInfo["default"].constructFromObject(instance);
63
+ match++;
64
+ break;
65
+ case "BabylonTxParameters":
66
+ this.actualInstance = _TransactionBabylonTxParameters["default"].constructFromObject(instance);
67
+ match++;
68
+ break;
69
+ case "CoreStakeInfo":
70
+ this.actualInstance = _TransactionCoreStakeInfo["default"].constructFromObject(instance);
71
+ match++;
72
+ break;
73
+ default:
74
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
75
+ break;
76
+ }
77
+ return;
78
+ }
79
+ try {
80
+ if (instance instanceof _TransactionBabylonBusinessInfo["default"]) {
81
+ this.actualInstance = instance;
82
+ } else if (!!_TransactionBabylonBusinessInfo["default"].validateJSON && _TransactionBabylonBusinessInfo["default"].validateJSON(instance)) {
83
+ // plain JS object
84
+ // create TransactionBabylonBusinessInfo from JS object
85
+ this.actualInstance = _TransactionBabylonBusinessInfo["default"].constructFromObject(instance);
86
+ } else {
87
+ if (_TransactionBabylonBusinessInfo["default"].constructFromObject(instance)) {
88
+ if (!!_TransactionBabylonBusinessInfo["default"].constructFromObject(instance).toJSON) {
89
+ if (_TransactionBabylonBusinessInfo["default"].constructFromObject(instance).toJSON()) {
90
+ this.actualInstance = _TransactionBabylonBusinessInfo["default"].constructFromObject(instance);
91
+ }
92
+ } else {
93
+ this.actualInstance = _TransactionBabylonBusinessInfo["default"].constructFromObject(instance);
94
+ }
95
+ }
96
+ }
97
+ match++;
98
+ } catch (err) {
99
+ // json data failed to deserialize into TransactionBabylonBusinessInfo
100
+ errorMessages.push("Failed to construct TransactionBabylonBusinessInfo: " + err);
101
+ }
102
+ try {
103
+ if (instance instanceof _TransactionBabylonTxParameters["default"]) {
104
+ this.actualInstance = instance;
105
+ } else if (!!_TransactionBabylonTxParameters["default"].validateJSON && _TransactionBabylonTxParameters["default"].validateJSON(instance)) {
106
+ // plain JS object
107
+ // create TransactionBabylonTxParameters from JS object
108
+ this.actualInstance = _TransactionBabylonTxParameters["default"].constructFromObject(instance);
109
+ } else {
110
+ if (_TransactionBabylonTxParameters["default"].constructFromObject(instance)) {
111
+ if (!!_TransactionBabylonTxParameters["default"].constructFromObject(instance).toJSON) {
112
+ if (_TransactionBabylonTxParameters["default"].constructFromObject(instance).toJSON()) {
113
+ this.actualInstance = _TransactionBabylonTxParameters["default"].constructFromObject(instance);
114
+ }
115
+ } else {
116
+ this.actualInstance = _TransactionBabylonTxParameters["default"].constructFromObject(instance);
117
+ }
118
+ }
119
+ }
120
+ match++;
121
+ } catch (err) {
122
+ // json data failed to deserialize into TransactionBabylonTxParameters
123
+ errorMessages.push("Failed to construct TransactionBabylonTxParameters: " + err);
124
+ }
125
+ try {
126
+ if (instance instanceof _TransactionCoreStakeInfo["default"]) {
127
+ this.actualInstance = instance;
128
+ } else if (!!_TransactionCoreStakeInfo["default"].validateJSON && _TransactionCoreStakeInfo["default"].validateJSON(instance)) {
129
+ // plain JS object
130
+ // create TransactionCoreStakeInfo from JS object
131
+ this.actualInstance = _TransactionCoreStakeInfo["default"].constructFromObject(instance);
132
+ } else {
133
+ if (_TransactionCoreStakeInfo["default"].constructFromObject(instance)) {
134
+ if (!!_TransactionCoreStakeInfo["default"].constructFromObject(instance).toJSON) {
135
+ if (_TransactionCoreStakeInfo["default"].constructFromObject(instance).toJSON()) {
136
+ this.actualInstance = _TransactionCoreStakeInfo["default"].constructFromObject(instance);
137
+ }
138
+ } else {
139
+ this.actualInstance = _TransactionCoreStakeInfo["default"].constructFromObject(instance);
140
+ }
141
+ }
142
+ }
143
+ match++;
144
+ } catch (err) {
145
+ // json data failed to deserialize into TransactionCoreStakeInfo
146
+ errorMessages.push("Failed to construct TransactionCoreStakeInfo: " + err);
147
+ }
148
+
149
+ // if (match > 1) {
150
+ // throw new Error("Multiple matches found constructing `TransactionExtra` with oneOf schemas TransactionBabylonBusinessInfo, TransactionBabylonTxParameters, TransactionCoreStakeInfo. Input: " + JSON.stringify(instance));
151
+ // } else
152
+ if (match === 0) {
153
+ // this.actualInstance = null; // clear the actual instance in case there are multiple matches
154
+ // throw new Error("No match found constructing `TransactionExtra` with oneOf schemas TransactionBabylonBusinessInfo, TransactionBabylonTxParameters, TransactionCoreStakeInfo. Details: " +
155
+ // errorMessages.join(", "));
156
+ return;
157
+ } else {// only 1 match
158
+ // the input is valid
159
+ }
160
+ }
161
+
162
+ /**
163
+ * Constructs a <code>TransactionExtra</code> from a plain JavaScript object, optionally creating a new instance.
164
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
165
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
166
+ * @param {module:model/TransactionExtra} obj Optional instance to populate.
167
+ * @return {module:model/TransactionExtra} The populated <code>TransactionExtra</code> instance.
168
+ */
169
+ return _createClass(TransactionExtra, [{
170
+ key: "getActualInstance",
171
+ value:
172
+ /**
173
+ * Gets the actual instance, which can be <code>TransactionBabylonBusinessInfo</code>, <code>TransactionBabylonTxParameters</code>, <code>TransactionCoreStakeInfo</code>.
174
+ * @return {(module:model/TransactionBabylonBusinessInfo|module:model/TransactionBabylonTxParameters|module:model/TransactionCoreStakeInfo)} The actual instance.
175
+ */
176
+ function getActualInstance() {
177
+ return this.actualInstance;
178
+ }
179
+
180
+ /**
181
+ * Sets the actual instance, which can be <code>TransactionBabylonBusinessInfo</code>, <code>TransactionBabylonTxParameters</code>, <code>TransactionCoreStakeInfo</code>.
182
+ * @param {(module:model/TransactionBabylonBusinessInfo|module:model/TransactionBabylonTxParameters|module:model/TransactionCoreStakeInfo)} obj The actual instance.
183
+ */
184
+ }, {
185
+ key: "setActualInstance",
186
+ value: function setActualInstance(obj) {
187
+ this.actualInstance = TransactionExtra.constructFromObject(obj).getActualInstance();
188
+ }
189
+ }], [{
190
+ key: "constructFromObject",
191
+ value: function constructFromObject(data, obj) {
192
+ return new TransactionExtra(data);
193
+ }
194
+ }]);
195
+ }();
196
+ /**
197
+ * @member {module:model/TransactionExtraType} extra_type
198
+ */
199
+ _TransactionExtra = TransactionExtra;
200
+ /**
201
+ * Create an instance of TransactionExtra from a JSON string.
202
+ * @param {string} json_string JSON string.
203
+ * @return {module:model/TransactionExtra} An instance of TransactionExtra.
204
+ */
205
+ _defineProperty(TransactionExtra, "fromJSON", function (json_string) {
206
+ return _TransactionExtra.constructFromObject(JSON.parse(json_string));
207
+ });
208
+ TransactionExtra.prototype['extra_type'] = undefined;
209
+
210
+ /**
211
+ * @member {module:model/AddressInfo} babylon_address_info
212
+ */
213
+ TransactionExtra.prototype['babylon_address_info'] = undefined;
214
+
215
+ /**
216
+ * @member {module:model/AddressInfo} btc_address_info
217
+ */
218
+ TransactionExtra.prototype['btc_address_info'] = undefined;
219
+
220
+ /**
221
+ * The origin staking amount.
222
+ * @member {String} stake_amount
223
+ */
224
+ TransactionExtra.prototype['stake_amount'] = undefined;
225
+
226
+ /**
227
+ * The public key of the finality provider.
228
+ * @member {String} finality_provider_public_key
229
+ */
230
+ TransactionExtra.prototype['finality_provider_public_key'] = undefined;
231
+
232
+ /**
233
+ * The number of blocks that need to be processed before the locked tokens are unlocked and become accessible.
234
+ * @member {Number} stake_block_time
235
+ */
236
+ TransactionExtra.prototype['stake_block_time'] = undefined;
237
+
238
+ /**
239
+ * The version of babylon global parameters.
240
+ * @member {Number} param_version
241
+ */
242
+ TransactionExtra.prototype['param_version'] = undefined;
243
+
244
+ /**
245
+ * @member {module:model/ActivityType} withdraw_from_type
246
+ */
247
+ TransactionExtra.prototype['withdraw_from_type'] = undefined;
248
+
249
+ /**
250
+ * @member {module:model/ActivityType} slash_from_type
251
+ */
252
+ TransactionExtra.prototype['slash_from_type'] = undefined;
253
+
254
+ /**
255
+ * The Unix timestamp (in seconds) when the staking position will be unlocked and available for withdrawal.
256
+ * @member {Number} timelock
257
+ */
258
+ TransactionExtra.prototype['timelock'] = undefined;
259
+
260
+ /**
261
+ * The change address on the Bitcoin chain. If not provided, the source wallet's address will be used as the change address.
262
+ * @member {String} change_address
263
+ */
264
+ TransactionExtra.prototype['change_address'] = undefined;
265
+
266
+ /**
267
+ * The validator's EVM address.
268
+ * @member {String} validator_address
269
+ */
270
+ TransactionExtra.prototype['validator_address'] = undefined;
271
+
272
+ /**
273
+ * The EVM address to receive staking rewards.
274
+ * @member {String} reward_address
275
+ */
276
+ TransactionExtra.prototype['reward_address'] = undefined;
277
+ TransactionExtra.OneOf = ["TransactionBabylonBusinessInfo", "TransactionBabylonTxParameters", "TransactionCoreStakeInfo"];
278
+ var _default = exports["default"] = TransactionExtra;
@@ -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 TransactionExtraType.
27
+ * @enum {}
28
+ * @readonly
29
+ */
30
+ var TransactionExtraType = exports["default"] = /*#__PURE__*/function () {
31
+ function TransactionExtraType() {
32
+ _classCallCheck(this, TransactionExtraType);
33
+ /**
34
+ * value: "BabylonBusinessInfo"
35
+ * @const
36
+ */
37
+ _defineProperty(this, "BabylonBusinessInfo", "BabylonBusinessInfo");
38
+ /**
39
+ * value: "BabylonTxParameters"
40
+ * @const
41
+ */
42
+ _defineProperty(this, "BabylonTxParameters", "BabylonTxParameters");
43
+ /**
44
+ * value: "CoreStakeInfo"
45
+ * @const
46
+ */
47
+ _defineProperty(this, "CoreStakeInfo", "CoreStakeInfo");
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(TransactionExtraType, null, [{
55
+ key: "constructFromObject",
56
+ value:
57
+ /**
58
+ * Returns a <code>TransactionExtraType</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/TransactionExtraType} The enum <code>TransactionExtraType</code> value.
61
+ */
62
+ function constructFromObject(object) {
63
+ return object;
64
+ }
65
+ }]);
66
+ }();
@@ -28,7 +28,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
28
28
  var TransactionFuelingInfo = /*#__PURE__*/function () {
29
29
  /**
30
30
  * Constructs a new <code>TransactionFuelingInfo</code>.
31
- * The fuel transaction data.
31
+ * Details of the auto-fueling transaction that provides gas for the current transaction.
32
32
  * @alias module:model/TransactionFuelingInfo
33
33
  */
34
34
  function TransactionFuelingInfo() {
@@ -88,13 +88,13 @@ var TransactionFuelingInfo = /*#__PURE__*/function () {
88
88
  }]);
89
89
  }();
90
90
  /**
91
- * The fuel transaction request ID.
91
+ * The request ID of the transaction.
92
92
  * @member {String} request_id
93
93
  */
94
94
  TransactionFuelingInfo.prototype['request_id'] = undefined;
95
95
 
96
96
  /**
97
- * The fuel transaction ID.
97
+ * The transaction ID.
98
98
  * @member {String} transaction_id
99
99
  */
100
100
  TransactionFuelingInfo.prototype['transaction_id'] = undefined;
@@ -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 TransactionMessageSignBTCEIP191Destination model module.
30
+ * @module model/TransactionMessageSignBTCEIP191Destination
31
+ */
32
+ var TransactionMessageSignBTCEIP191Destination = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>TransactionMessageSignBTCEIP191Destination</code>.
35
+ * The information about the destination &#x60;BTC_EIP_191_Signature&#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.
36
+ * @alias module:model/TransactionMessageSignBTCEIP191Destination
37
+ * @param destination_type {module:model/TransactionDestinationType}
38
+ * @param message {String} The raw data of the message to be signed, encoded in Base64 format.
39
+ */
40
+ function TransactionMessageSignBTCEIP191Destination(destination_type, message) {
41
+ _classCallCheck(this, TransactionMessageSignBTCEIP191Destination);
42
+ TransactionMessageSignBTCEIP191Destination.initialize(this, destination_type, message);
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(TransactionMessageSignBTCEIP191Destination, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, destination_type, message) {
53
+ obj['destination_type'] = destination_type;
54
+ obj['message'] = message;
55
+ }
56
+
57
+ /**
58
+ * Constructs a <code>TransactionMessageSignBTCEIP191Destination</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/TransactionMessageSignBTCEIP191Destination} obj Optional instance to populate.
62
+ * @return {module:model/TransactionMessageSignBTCEIP191Destination} The populated <code>TransactionMessageSignBTCEIP191Destination</code> instance.
63
+ */
64
+ }, {
65
+ key: "constructFromObject",
66
+ value: function constructFromObject(data, obj) {
67
+ if (data) {
68
+ obj = obj || new TransactionMessageSignBTCEIP191Destination();
69
+ if (data.hasOwnProperty('destination_type')) {
70
+ obj['destination_type'] = _TransactionDestinationType["default"].constructFromObject(data['destination_type']);
71
+ }
72
+ if (data.hasOwnProperty('message')) {
73
+ obj['message'] = _ApiClient["default"].convertToType(data['message'], 'String');
74
+ }
75
+ }
76
+ return obj;
77
+ }
78
+
79
+ /**
80
+ * Validates the JSON data with respect to <code>TransactionMessageSignBTCEIP191Destination</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>TransactionMessageSignBTCEIP191Destination</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(TransactionMessageSignBTCEIP191Destination.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'] && !(typeof data['message'] === 'string' || data['message'] instanceof String)) {
104
+ throw new Error("Expected the field `message` to be a primitive type in the JSON string but got " + data['message']);
105
+ }
106
+ return true;
107
+ }
108
+ }]);
109
+ }();
110
+ TransactionMessageSignBTCEIP191Destination.RequiredProperties = ["destination_type", "message"];
111
+
112
+ /**
113
+ * @member {module:model/TransactionDestinationType} destination_type
114
+ */
115
+ TransactionMessageSignBTCEIP191Destination.prototype['destination_type'] = undefined;
116
+
117
+ /**
118
+ * The raw data of the message to be signed, encoded in Base64 format.
119
+ * @member {String} message
120
+ */
121
+ TransactionMessageSignBTCEIP191Destination.prototype['message'] = undefined;
122
+ var _default = exports["default"] = TransactionMessageSignBTCEIP191Destination;