@cobo/cobo-waas2 1.23.0 → 1.24.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 (171) hide show
  1. package/README.md +45 -6
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/api/AddressBooksApi.js +6 -6
  4. package/dist/api/FeeStationApi.js +47 -4
  5. package/dist/api/PaymentApi.js +194 -47
  6. package/dist/api/SwapsApi.js +374 -0
  7. package/dist/api/TransactionsApi.js +4 -4
  8. package/dist/index.js +224 -14
  9. package/dist/model/AddressInfo.js +13 -0
  10. package/dist/model/AddressesEventDataAllOfAddresses.js +18 -0
  11. package/dist/model/BridgingFee.js +136 -0
  12. package/dist/model/CommissionFee.js +110 -0
  13. package/dist/model/ContractCallDestination.js +48 -8
  14. package/dist/model/ContractCallDestinationType.js +5 -0
  15. package/dist/model/CreateMerchantRequest.js +13 -6
  16. package/dist/model/CreatePaymentOrderRequest.js +14 -1
  17. package/dist/model/CreateSettlement.js +2 -2
  18. package/dist/model/CreateSettlementRequestRequest.js +39 -0
  19. package/dist/model/CreateSwapActivityRequest.js +193 -0
  20. package/dist/model/CustodialTransferDestination.js +1 -1
  21. package/dist/model/EstimateContractCallFeeParams.js +1 -1
  22. package/dist/model/EstimateFeeParams.js +1 -1
  23. package/dist/model/EstimateTransferFeeParams.js +1 -1
  24. package/dist/model/EstimatedEvmEip1559Fee.js +1 -1
  25. package/dist/model/EstimatedEvmLegacyFee.js +1 -1
  26. package/dist/model/EstimatedFILFee.js +1 -1
  27. package/dist/model/EstimatedFixedFee.js +1 -1
  28. package/dist/model/EstimatedSOLFee.js +1 -1
  29. package/dist/model/EstimatedUtxoFee.js +1 -1
  30. package/dist/model/FeeStationCheckFeeStationUsage.js +186 -0
  31. package/dist/model/FeeStationCheckFeeStationUsageResponse.js +200 -0
  32. package/dist/model/FeeStationGasStationType.js +61 -0
  33. package/dist/model/ListSwapActivities200Response.js +123 -0
  34. package/dist/model/ListSwapEnabledTokens200Response.js +123 -0
  35. package/dist/model/ListTopUpPayerAccounts200Response.js +123 -0
  36. package/dist/model/Merchant.js +9 -0
  37. package/dist/model/MerchantBalance.js +3 -3
  38. package/dist/model/MessageSignDestination.js +8 -70
  39. package/dist/model/OtcFee.js +123 -0
  40. package/dist/model/PaymentEstimateFee.js +125 -0
  41. package/dist/model/PaymentEstimateFee201Response.js +107 -0
  42. package/dist/model/{RawMessageSignDestination.js → PaymentEstimateFeeRequest.js} +51 -37
  43. package/dist/model/PaymentEstimatedFee.js +173 -0
  44. package/dist/model/PaymentFeeType.js +71 -0
  45. package/dist/model/PaymentRefundEventData.js +22 -2
  46. package/dist/model/PaymentSettlementEvent.js +62 -6
  47. package/dist/model/PspBalance.js +3 -3
  48. package/dist/model/Refund.js +17 -1
  49. package/dist/model/SettleRequestStatus.js +5 -0
  50. package/dist/model/Settlement.js +45 -3
  51. package/dist/model/SettlementDetail.js +33 -1
  52. package/dist/model/SettlementInfo.js +7 -7
  53. package/dist/model/SolContractCallAddressLookupTableAccount.js +126 -0
  54. package/dist/model/SolContractCallDestination.js +30 -0
  55. package/dist/model/StellarContractCallContractParam.js +164 -0
  56. package/dist/model/StellarContractCallContractType.js +56 -0
  57. package/dist/model/StellarContractCallDestination.js +125 -0
  58. package/dist/model/StellarContractCallTrustLineOperationType.js +56 -0
  59. package/dist/model/StellarContractCallTrustLineParam.js +133 -0
  60. package/dist/model/SupportedToken.js +9 -0
  61. package/dist/model/SwapActivity.js +9 -9
  62. package/dist/model/SwapActivityApprovers.js +1 -1
  63. package/dist/model/SwapActivityDetail.js +34 -18
  64. package/dist/model/SwapActivitySigners.js +2 -2
  65. package/dist/model/SwapActivityTimeline.js +5 -5
  66. package/dist/model/SwapEstimateFee.js +147 -0
  67. package/dist/model/SwapQuote.js +18 -31
  68. package/dist/model/SwapReceivingTransaction.js +133 -0
  69. package/dist/model/SwapToken.js +9 -9
  70. package/dist/model/TransactionCoboCategory.js +5 -0
  71. package/dist/model/TransactionDestination.js +48 -8
  72. package/dist/model/TransactionDestinationType.js +5 -0
  73. package/dist/model/TransactionEvmEip1559Fee.js +1 -1
  74. package/dist/model/TransactionEvmLegacyFee.js +1 -1
  75. package/dist/model/TransactionFILFee.js +1 -1
  76. package/dist/model/TransactionFixedFee.js +1 -1
  77. package/dist/model/TransactionFuelingInfo.js +13 -0
  78. package/dist/model/TransactionRequestEvmEip1559Fee.js +1 -1
  79. package/dist/model/TransactionRequestEvmLegacyFee.js +1 -1
  80. package/dist/model/TransactionRequestFILFee.js +1 -1
  81. package/dist/model/TransactionRequestSOLFee.js +1 -1
  82. package/dist/model/TransactionRequestUtxoFee.js +1 -1
  83. package/dist/model/TransactionSOLFee.js +1 -1
  84. package/dist/model/TransactionSolContractAddressLookupTableAccount.js +126 -0
  85. package/dist/model/TransactionSolContractDestination.js +30 -0
  86. package/dist/model/TransactionStellarContractParam.js +164 -0
  87. package/dist/model/TransactionStellarContractType.js +56 -0
  88. package/dist/model/{BTCEIP191MessageSignDestination.js → TransactionStellarDestination.js} +38 -35
  89. package/dist/model/TransactionStellarTrustLineOperationType.js +56 -0
  90. package/dist/model/TransactionStellarTrustLineParam.js +133 -0
  91. package/dist/model/TransactionUtxoFee.js +1 -1
  92. package/dist/model/UpdateBankAccountByIdRequest.js +108 -0
  93. package/dist/model/UpdateTopUpAddress.js +4 -6
  94. package/dist/model/WalletSetup.js +66 -0
  95. package/dist/model/WebhookEventData.js +19 -1
  96. package/docs/AddressBooksApi.md +3 -3
  97. package/docs/AddressInfo.md +1 -0
  98. package/docs/AddressesEventDataAllOfAddresses.md +1 -0
  99. package/docs/BridgingFee.md +11 -0
  100. package/docs/CommissionFee.md +9 -0
  101. package/docs/ContractCallDestination.md +2 -0
  102. package/docs/ContractCallDestinationType.md +2 -0
  103. package/docs/CreateMerchantRequest.md +2 -1
  104. package/docs/CreatePaymentOrderRequest.md +2 -1
  105. package/docs/CreateSettlement.md +2 -2
  106. package/docs/CreateSettlementRequestRequest.md +3 -0
  107. package/docs/CreateSwapActivityRequest.md +15 -0
  108. package/docs/EstimateContractCallFeeParams.md +1 -1
  109. package/docs/EstimateFeeParams.md +1 -1
  110. package/docs/EstimateTransferFeeParams.md +1 -1
  111. package/docs/FeeStationApi.md +53 -0
  112. package/docs/FeeStationCheckFeeStationUsage.md +14 -0
  113. package/docs/FeeStationCheckFeeStationUsageResponse.md +16 -0
  114. package/docs/FeeStationGasStationType.md +12 -0
  115. package/docs/ListSwapActivities200Response.md +10 -0
  116. package/docs/ListSwapEnabledTokens200Response.md +10 -0
  117. package/docs/ListTopUpPayerAccounts200Response.md +10 -0
  118. package/docs/Merchant.md +1 -0
  119. package/docs/MerchantBalance.md +3 -3
  120. package/docs/MessageSignDestination.md +0 -1
  121. package/docs/OtcFee.md +10 -0
  122. package/docs/PaymentApi.md +196 -21
  123. package/docs/PaymentEstimateFee.md +10 -0
  124. package/docs/PaymentEstimateFee201Response.md +9 -0
  125. package/docs/PaymentEstimateFeeRequest.md +10 -0
  126. package/docs/PaymentEstimatedFee.md +13 -0
  127. package/docs/PaymentFeeType.md +16 -0
  128. package/docs/PaymentRefundEventData.md +2 -1
  129. package/docs/PaymentSettlementEvent.md +6 -3
  130. package/docs/PspBalance.md +3 -3
  131. package/docs/Refund.md +2 -1
  132. package/docs/SettleRequestStatus.md +2 -0
  133. package/docs/Settlement.md +6 -3
  134. package/docs/SettlementDetail.md +3 -1
  135. package/docs/SettlementInfo.md +6 -6
  136. package/docs/SolContractCallAddressLookupTableAccount.md +10 -0
  137. package/docs/SolContractCallDestination.md +1 -0
  138. package/docs/StellarContractCallContractParam.md +11 -0
  139. package/docs/StellarContractCallContractType.md +10 -0
  140. package/docs/StellarContractCallDestination.md +10 -0
  141. package/docs/StellarContractCallTrustLineOperationType.md +10 -0
  142. package/docs/StellarContractCallTrustLineParam.md +11 -0
  143. package/docs/SupportedToken.md +1 -0
  144. package/docs/SwapActivity.md +9 -9
  145. package/docs/SwapActivityDetail.md +10 -9
  146. package/docs/SwapActivitySigners.md +1 -1
  147. package/docs/SwapActivityTimeline.md +3 -3
  148. package/docs/SwapEstimateFee.md +12 -0
  149. package/docs/SwapQuote.md +10 -11
  150. package/docs/SwapReceivingTransaction.md +11 -0
  151. package/docs/SwapToken.md +6 -6
  152. package/docs/SwapsApi.md +356 -0
  153. package/docs/TransactionCoboCategory.md +2 -0
  154. package/docs/TransactionDestination.md +2 -0
  155. package/docs/TransactionDestinationType.md +2 -0
  156. package/docs/TransactionFuelingInfo.md +1 -0
  157. package/docs/TransactionSolContractAddressLookupTableAccount.md +10 -0
  158. package/docs/TransactionSolContractDestination.md +1 -0
  159. package/docs/TransactionStellarContractParam.md +11 -0
  160. package/docs/TransactionStellarContractType.md +10 -0
  161. package/docs/TransactionStellarDestination.md +10 -0
  162. package/docs/TransactionStellarTrustLineOperationType.md +10 -0
  163. package/docs/TransactionStellarTrustLineParam.md +11 -0
  164. package/docs/TransactionsApi.md +2 -2
  165. package/docs/UpdateBankAccountByIdRequest.md +9 -0
  166. package/docs/UpdateTopUpAddress.md +1 -1
  167. package/docs/WalletSetup.md +14 -0
  168. package/docs/WebhookEventData.md +4 -1
  169. package/package.json +1 -1
  170. package/docs/BTCEIP191MessageSignDestination.md +0 -10
  171. package/docs/RawMessageSignDestination.md +0 -10
@@ -0,0 +1,193 @@
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 _TransactionRequestFee = _interopRequireDefault(require("./TransactionRequestFee"));
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 CreateSwapActivityRequest model module.
30
+ * @module model/CreateSwapActivityRequest
31
+ */
32
+ var CreateSwapActivityRequest = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>CreateSwapActivityRequest</code>.
35
+ * @alias module:model/CreateSwapActivityRequest
36
+ * @param wallet_id {String} The ID of the wallet used to pay.
37
+ * @param quote_id {String} The unique identifier of the swap quote.
38
+ */
39
+ function CreateSwapActivityRequest(wallet_id, quote_id) {
40
+ _classCallCheck(this, CreateSwapActivityRequest);
41
+ CreateSwapActivityRequest.initialize(this, wallet_id, quote_id);
42
+ }
43
+
44
+ /**
45
+ * Initializes the fields of this object.
46
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
47
+ * Only for internal use.
48
+ */
49
+ return _createClass(CreateSwapActivityRequest, null, [{
50
+ key: "initialize",
51
+ value: function initialize(obj, wallet_id, quote_id) {
52
+ obj['wallet_id'] = wallet_id;
53
+ obj['quote_id'] = quote_id;
54
+ }
55
+
56
+ /**
57
+ * Constructs a <code>CreateSwapActivityRequest</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/CreateSwapActivityRequest} obj Optional instance to populate.
61
+ * @return {module:model/CreateSwapActivityRequest} The populated <code>CreateSwapActivityRequest</code> instance.
62
+ */
63
+ }, {
64
+ key: "constructFromObject",
65
+ value: function constructFromObject(data, obj) {
66
+ if (data) {
67
+ obj = obj || new CreateSwapActivityRequest();
68
+ if (data.hasOwnProperty('wallet_id')) {
69
+ obj['wallet_id'] = _ApiClient["default"].convertToType(data['wallet_id'], 'String');
70
+ }
71
+ if (data.hasOwnProperty('address')) {
72
+ obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
73
+ }
74
+ if (data.hasOwnProperty('quote_id')) {
75
+ obj['quote_id'] = _ApiClient["default"].convertToType(data['quote_id'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('app_initiator')) {
78
+ obj['app_initiator'] = _ApiClient["default"].convertToType(data['app_initiator'], 'String');
79
+ }
80
+ if (data.hasOwnProperty('request_id')) {
81
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
82
+ }
83
+ if (data.hasOwnProperty('receiver_address')) {
84
+ obj['receiver_address'] = _ApiClient["default"].convertToType(data['receiver_address'], 'String');
85
+ }
86
+ if (data.hasOwnProperty('fee')) {
87
+ obj['fee'] = _TransactionRequestFee["default"].constructFromObject(data['fee']);
88
+ }
89
+ }
90
+ return obj;
91
+ }
92
+
93
+ /**
94
+ * Validates the JSON data with respect to <code>CreateSwapActivityRequest</code>.
95
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
96
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateSwapActivityRequest</code>.
97
+ */
98
+ }, {
99
+ key: "validateJSON",
100
+ value: function validateJSON(data) {
101
+ // check to make sure all required properties are present in the JSON string
102
+ var _iterator = _createForOfIteratorHelper(CreateSwapActivityRequest.RequiredProperties),
103
+ _step;
104
+ try {
105
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
106
+ var property = _step.value;
107
+ if (!data.hasOwnProperty(property)) {
108
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
109
+ }
110
+ }
111
+ // ensure the json data is a string
112
+ } catch (err) {
113
+ _iterator.e(err);
114
+ } finally {
115
+ _iterator.f();
116
+ }
117
+ if (data['wallet_id'] && !(typeof data['wallet_id'] === 'string' || data['wallet_id'] instanceof String)) {
118
+ throw new Error("Expected the field `wallet_id` to be a primitive type in the JSON string but got " + data['wallet_id']);
119
+ }
120
+ // ensure the json data is a string
121
+ if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
122
+ throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
123
+ }
124
+ // ensure the json data is a string
125
+ if (data['quote_id'] && !(typeof data['quote_id'] === 'string' || data['quote_id'] instanceof String)) {
126
+ throw new Error("Expected the field `quote_id` to be a primitive type in the JSON string but got " + data['quote_id']);
127
+ }
128
+ // ensure the json data is a string
129
+ if (data['app_initiator'] && !(typeof data['app_initiator'] === 'string' || data['app_initiator'] instanceof String)) {
130
+ throw new Error("Expected the field `app_initiator` to be a primitive type in the JSON string but got " + data['app_initiator']);
131
+ }
132
+ // ensure the json data is a string
133
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
134
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
135
+ }
136
+ // ensure the json data is a string
137
+ if (data['receiver_address'] && !(typeof data['receiver_address'] === 'string' || data['receiver_address'] instanceof String)) {
138
+ throw new Error("Expected the field `receiver_address` to be a primitive type in the JSON string but got " + data['receiver_address']);
139
+ }
140
+ // validate the optional field `fee`
141
+ if (data['fee']) {
142
+ // data not null
143
+ if (!!_TransactionRequestFee["default"].validateJSON) {
144
+ _TransactionRequestFee["default"].validateJSON(data['fee']);
145
+ }
146
+ }
147
+ return true;
148
+ }
149
+ }]);
150
+ }();
151
+ CreateSwapActivityRequest.RequiredProperties = ["wallet_id", "quote_id"];
152
+
153
+ /**
154
+ * The ID of the wallet used to pay.
155
+ * @member {String} wallet_id
156
+ */
157
+ CreateSwapActivityRequest.prototype['wallet_id'] = undefined;
158
+
159
+ /**
160
+ * The address of the wallet used to pay.
161
+ * @member {String} address
162
+ */
163
+ CreateSwapActivityRequest.prototype['address'] = undefined;
164
+
165
+ /**
166
+ * The unique identifier of the swap quote.
167
+ * @member {String} quote_id
168
+ */
169
+ CreateSwapActivityRequest.prototype['quote_id'] = undefined;
170
+
171
+ /**
172
+ * The initiator of the swap activity. It is optional and defaults to your API key if not specified.
173
+ * @member {String} app_initiator
174
+ */
175
+ CreateSwapActivityRequest.prototype['app_initiator'] = undefined;
176
+
177
+ /**
178
+ * The request ID of the swap activity.
179
+ * @member {String} request_id
180
+ */
181
+ CreateSwapActivityRequest.prototype['request_id'] = undefined;
182
+
183
+ /**
184
+ * The destination address of the swap activity. This property is required only when the swap type is `Bridge` and the wallet is not a Custodial Wallet (Asset Wallet).
185
+ * @member {String} receiver_address
186
+ */
187
+ CreateSwapActivityRequest.prototype['receiver_address'] = undefined;
188
+
189
+ /**
190
+ * @member {module:model/TransactionRequestFee} fee
191
+ */
192
+ CreateSwapActivityRequest.prototype['fee'] = undefined;
193
+ var _default = exports["default"] = CreateSwapActivityRequest;
@@ -32,7 +32,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
32
32
  var CustodialTransferDestination = /*#__PURE__*/function () {
33
33
  /**
34
34
  * Constructs a new <code>CustodialTransferDestination</code>.
35
- * The information about the transaction destination type &#x60;CustodialWallet&#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. A Custodial Wallet (Asset Wallet) can only receive transfers from another Custodial Wallet (Asset Wallet) by using [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop). Switch between the tabs to display the properties for different transaction destinations.
35
+ * The information about the transaction destination type &#x60;CustodialWallet&#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. A Custodial Wallet (Asset Wallet) can only receive transfers from another Custodial Wallet (Asset Wallet) by using [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop). &lt;Note&gt;This destination type is available upon request. Please contact our [customer support](mailto:help@cobo.com) to enable it.&lt;/Note&gt; Switch between the tabs to display the properties for different transaction destinations.
36
36
  * @alias module:model/CustodialTransferDestination
37
37
  * @param destination_type {module:model/TransferDestinationType}
38
38
  * @param wallet_id {String} The wallet ID.
@@ -152,7 +152,7 @@ var EstimateContractCallFeeParams = /*#__PURE__*/function () {
152
152
  EstimateContractCallFeeParams.RequiredProperties = ["request_type", "chain_id", "source"];
153
153
 
154
154
  /**
155
- * The request ID that is used to track a transaction request. The request ID is provided by you and must be unique within your organization. It is recommended to use the same request ID as the transaction for which you want to estimate the transaction fee.
155
+ * The request ID that is used to track a transaction request.
156
156
  * @member {String} request_id
157
157
  */
158
158
  EstimateContractCallFeeParams.prototype['request_id'] = undefined;
@@ -167,7 +167,7 @@ var EstimateFeeParams = /*#__PURE__*/function () {
167
167
  }]);
168
168
  }();
169
169
  /**
170
- * The request ID that is used to track a transaction request. The request ID is provided by you and must be unique within your organization. It is recommended to use the same request ID as the transaction for which you want to estimate the transaction fee.
170
+ * The request ID that is used to track a transaction request.
171
171
  * @member {String} request_id
172
172
  */
173
173
  _EstimateFeeParams = EstimateFeeParams;
@@ -152,7 +152,7 @@ var EstimateTransferFeeParams = /*#__PURE__*/function () {
152
152
  EstimateTransferFeeParams.RequiredProperties = ["request_type", "source", "token_id"];
153
153
 
154
154
  /**
155
- * The request ID that is used to track a transaction request. The request ID is provided by you and must be unique within your organization. It is recommended to use the same request ID as the transaction for which you want to estimate the transaction fee.
155
+ * The request ID that is used to track a transaction request.
156
156
  * @member {String} request_id
157
157
  */
158
158
  EstimateTransferFeeParams.prototype['request_id'] = undefined;
@@ -33,7 +33,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
33
  var EstimatedEvmEip1559Fee = /*#__PURE__*/function () {
34
34
  /**
35
35
  * Constructs a new <code>EstimatedEvmEip1559Fee</code>.
36
- * The estimated transaction fee based on the EIP-1559 fee model.
36
+ * The estimated transaction fee based on the EIP-1559 fee model. For more details about the EIP-1559 fee model, see [Fee models](https://www.cobo.com/developers/v2/guides/transactions/estimate-fees#fee-models).
37
37
  * @alias module:model/EstimatedEvmEip1559Fee
38
38
  * @param fee_type {module:model/FeeType}
39
39
  * @param token_id {String} The token used to pay the transaction fee.
@@ -33,7 +33,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
33
  var EstimatedEvmLegacyFee = /*#__PURE__*/function () {
34
34
  /**
35
35
  * Constructs a new <code>EstimatedEvmLegacyFee</code>.
36
- * The estimated transaction fee based on the legacy fee model.
36
+ * The estimated transaction fee based on the Legacy fee model. For more details about the Legacy fee model, see [Fee models](https://www.cobo.com/developers/v2/guides/transactions/estimate-fees#fee-models).
37
37
  * @alias module:model/EstimatedEvmLegacyFee
38
38
  * @param fee_type {module:model/FeeType}
39
39
  * @param token_id {String} The token used to pay the transaction fee.
@@ -33,7 +33,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
33
  var EstimatedFILFee = /*#__PURE__*/function () {
34
34
  /**
35
35
  * Constructs a new <code>EstimatedFILFee</code>.
36
- * The estimated transaction fee based on the fil fee model.
36
+ * The estimated transaction fee based on the FIL fee model. For more details about the FIL fee model, see [Fee models](https://www.cobo.com/developers/v2/guides/transactions/estimate-fees#fee-models).
37
37
  * @alias module:model/EstimatedFILFee
38
38
  * @param fee_type {module:model/FeeType}
39
39
  * @param token_id {String} The token used to pay the transaction fee.
@@ -33,7 +33,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
33
  var EstimatedFixedFee = /*#__PURE__*/function () {
34
34
  /**
35
35
  * Constructs a new <code>EstimatedFixedFee</code>.
36
- * The estimated transaction fee based on the fixed fee model.
36
+ * The estimated transaction fee based on the fixed fee model. For more details about the fixed fee model, see [Fee models](https://www.cobo.com/developers/v2/guides/transactions/estimate-fees#fee-models).
37
37
  * @alias module:model/EstimatedFixedFee
38
38
  * @implements module:model/FeeAmount
39
39
  * @param fee_amount {String} The transaction fee that you need to pay for the transaction.
@@ -33,7 +33,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
33
  var EstimatedSOLFee = /*#__PURE__*/function () {
34
34
  /**
35
35
  * Constructs a new <code>EstimatedSOLFee</code>.
36
- * The estimated transaction fee based on the sol fee model.
36
+ * The estimated transaction fee based on the SOL fee model. For more details about the SOL fee model, see [Fee models](https://www.cobo.com/developers/v2/guides/transactions/estimate-fees#fee-models).
37
37
  * @alias module:model/EstimatedSOLFee
38
38
  * @param fee_type {module:model/FeeType}
39
39
  * @param token_id {String} The token used to pay the transaction fee.
@@ -33,7 +33,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
33
  var EstimatedUtxoFee = /*#__PURE__*/function () {
34
34
  /**
35
35
  * Constructs a new <code>EstimatedUtxoFee</code>.
36
- * The estimated transaction fee for UTXO-based chains.
36
+ * The estimated transaction fee for UTXO-based chains. For more details about the UTXO fee model, see [Fee models](https://www.cobo.com/developers/v2/guides/transactions/estimate-fees#fee-models).
37
37
  * @alias module:model/EstimatedUtxoFee
38
38
  * @param fee_type {module:model/FeeType}
39
39
  * @param token_id {String} The token used to pay the transaction fee.
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18
+ * Cobo Wallet as a Service 2.0
19
+ *
20
+ * Contact: help@cobo.com
21
+ *
22
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
+ * https://openapi-generator.tech
24
+ * Do not edit the class manually.
25
+ *
26
+ */
27
+ /**
28
+ * The FeeStationCheckFeeStationUsage model module.
29
+ * @module model/FeeStationCheckFeeStationUsage
30
+ */
31
+ var FeeStationCheckFeeStationUsage = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>FeeStationCheckFeeStationUsage</code>.
34
+ * The information for evaluating Fee Station usage.
35
+ * @alias module:model/FeeStationCheckFeeStationUsage
36
+ * @param request_id {String} The request ID that is used to track a transaction request. The request ID is provided by you and must be unique within your organization.
37
+ * @param amount {String} The amount of tokens to be transferred in this request.
38
+ * @param token_id {String} The token ID of the transferred token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens).
39
+ * @param estimated_fee_amount {String} The estimated transaction fee required for this transfer, before applying any Fee Station rules.
40
+ * @param from_address {String} The blockchain address that initiates the transfer.
41
+ * @param from_wallet_id {String} The wallet ID.
42
+ */
43
+ function FeeStationCheckFeeStationUsage(request_id, amount, token_id, estimated_fee_amount, from_address, from_wallet_id) {
44
+ _classCallCheck(this, FeeStationCheckFeeStationUsage);
45
+ FeeStationCheckFeeStationUsage.initialize(this, request_id, amount, token_id, estimated_fee_amount, from_address, from_wallet_id);
46
+ }
47
+
48
+ /**
49
+ * Initializes the fields of this object.
50
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
51
+ * Only for internal use.
52
+ */
53
+ return _createClass(FeeStationCheckFeeStationUsage, null, [{
54
+ key: "initialize",
55
+ value: function initialize(obj, request_id, amount, token_id, estimated_fee_amount, from_address, from_wallet_id) {
56
+ obj['request_id'] = request_id;
57
+ obj['amount'] = amount;
58
+ obj['token_id'] = token_id;
59
+ obj['estimated_fee_amount'] = estimated_fee_amount;
60
+ obj['from_address'] = from_address;
61
+ obj['from_wallet_id'] = from_wallet_id;
62
+ }
63
+
64
+ /**
65
+ * Constructs a <code>FeeStationCheckFeeStationUsage</code> from a plain JavaScript object, optionally creating a new instance.
66
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
67
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
68
+ * @param {module:model/FeeStationCheckFeeStationUsage} obj Optional instance to populate.
69
+ * @return {module:model/FeeStationCheckFeeStationUsage} The populated <code>FeeStationCheckFeeStationUsage</code> instance.
70
+ */
71
+ }, {
72
+ key: "constructFromObject",
73
+ value: function constructFromObject(data, obj) {
74
+ if (data) {
75
+ obj = obj || new FeeStationCheckFeeStationUsage();
76
+ if (data.hasOwnProperty('request_id')) {
77
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
78
+ }
79
+ if (data.hasOwnProperty('amount')) {
80
+ obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
81
+ }
82
+ if (data.hasOwnProperty('token_id')) {
83
+ obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
84
+ }
85
+ if (data.hasOwnProperty('estimated_fee_amount')) {
86
+ obj['estimated_fee_amount'] = _ApiClient["default"].convertToType(data['estimated_fee_amount'], 'String');
87
+ }
88
+ if (data.hasOwnProperty('from_address')) {
89
+ obj['from_address'] = _ApiClient["default"].convertToType(data['from_address'], 'String');
90
+ }
91
+ if (data.hasOwnProperty('from_wallet_id')) {
92
+ obj['from_wallet_id'] = _ApiClient["default"].convertToType(data['from_wallet_id'], 'String');
93
+ }
94
+ }
95
+ return obj;
96
+ }
97
+
98
+ /**
99
+ * Validates the JSON data with respect to <code>FeeStationCheckFeeStationUsage</code>.
100
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
101
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>FeeStationCheckFeeStationUsage</code>.
102
+ */
103
+ }, {
104
+ key: "validateJSON",
105
+ value: function validateJSON(data) {
106
+ // check to make sure all required properties are present in the JSON string
107
+ var _iterator = _createForOfIteratorHelper(FeeStationCheckFeeStationUsage.RequiredProperties),
108
+ _step;
109
+ try {
110
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
111
+ var property = _step.value;
112
+ if (!data.hasOwnProperty(property)) {
113
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
114
+ }
115
+ }
116
+ // ensure the json data is a string
117
+ } catch (err) {
118
+ _iterator.e(err);
119
+ } finally {
120
+ _iterator.f();
121
+ }
122
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
123
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
124
+ }
125
+ // ensure the json data is a string
126
+ if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
127
+ throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
128
+ }
129
+ // ensure the json data is a string
130
+ if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
131
+ throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
132
+ }
133
+ // ensure the json data is a string
134
+ if (data['estimated_fee_amount'] && !(typeof data['estimated_fee_amount'] === 'string' || data['estimated_fee_amount'] instanceof String)) {
135
+ throw new Error("Expected the field `estimated_fee_amount` to be a primitive type in the JSON string but got " + data['estimated_fee_amount']);
136
+ }
137
+ // ensure the json data is a string
138
+ if (data['from_address'] && !(typeof data['from_address'] === 'string' || data['from_address'] instanceof String)) {
139
+ throw new Error("Expected the field `from_address` to be a primitive type in the JSON string but got " + data['from_address']);
140
+ }
141
+ // ensure the json data is a string
142
+ if (data['from_wallet_id'] && !(typeof data['from_wallet_id'] === 'string' || data['from_wallet_id'] instanceof String)) {
143
+ throw new Error("Expected the field `from_wallet_id` to be a primitive type in the JSON string but got " + data['from_wallet_id']);
144
+ }
145
+ return true;
146
+ }
147
+ }]);
148
+ }();
149
+ FeeStationCheckFeeStationUsage.RequiredProperties = ["request_id", "amount", "token_id", "estimated_fee_amount", "from_address", "from_wallet_id"];
150
+
151
+ /**
152
+ * The request ID that is used to track a transaction request. The request ID is provided by you and must be unique within your organization.
153
+ * @member {String} request_id
154
+ */
155
+ FeeStationCheckFeeStationUsage.prototype['request_id'] = undefined;
156
+
157
+ /**
158
+ * The amount of tokens to be transferred in this request.
159
+ * @member {String} amount
160
+ */
161
+ FeeStationCheckFeeStationUsage.prototype['amount'] = undefined;
162
+
163
+ /**
164
+ * The token ID of the transferred token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens).
165
+ * @member {String} token_id
166
+ */
167
+ FeeStationCheckFeeStationUsage.prototype['token_id'] = undefined;
168
+
169
+ /**
170
+ * The estimated transaction fee required for this transfer, before applying any Fee Station rules.
171
+ * @member {String} estimated_fee_amount
172
+ */
173
+ FeeStationCheckFeeStationUsage.prototype['estimated_fee_amount'] = undefined;
174
+
175
+ /**
176
+ * The blockchain address that initiates the transfer.
177
+ * @member {String} from_address
178
+ */
179
+ FeeStationCheckFeeStationUsage.prototype['from_address'] = undefined;
180
+
181
+ /**
182
+ * The wallet ID.
183
+ * @member {String} from_wallet_id
184
+ */
185
+ FeeStationCheckFeeStationUsage.prototype['from_wallet_id'] = undefined;
186
+ var _default = exports["default"] = FeeStationCheckFeeStationUsage;