@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,306 @@
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 _OrderStatus = _interopRequireDefault(require("./OrderStatus"));
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 Order model module.
30
+ * @module model/Order
31
+ */
32
+ var Order = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>Order</code>.
35
+ * @alias module:model/Order
36
+ * @param order_id {String} The order ID.
37
+ * @param token_id {String} The ID of the cryptocurrency token used for payment.
38
+ * @param chain_id {String} The ID of the blockchain network where the payment transaction should be made.
39
+ * @param payable_amount {String} The cryptocurrency amount to be paid for this order.
40
+ * @param receive_address {String} The recipient wallet address to be used for the payment transaction.
41
+ * @param currency {String} The currency of the order.
42
+ * @param order_amount {String} The base amount in currency to be charged for the payment order, excluding the payment gateway fee (specified in `fee_amount`).
43
+ * @param fee_amount {String} The payment gateway fee in currency. It is added to the base amount (`order_amount`) to determine the final charge.
44
+ * @param exchange_rate {String} The exchange rate used to convert between currency and cryptocurrency token. Expressed as the amount of currency per one unit of cryptocurrency. For example, if the token is USDT and the currency is USD, a rate of \"0.99\" means 1 USDT = 0.99 USD.
45
+ * @param psp_order_code {String} A unique reference code assigned by the payment gateway to identify this order in their system.
46
+ * @param status {module:model/OrderStatus}
47
+ * @param received_token_amount {String} The total cryptocurrency amount received for this order. Updates until order expires. Precision matches the token standard (e.g., 6 decimals for USDT).
48
+ */
49
+ function Order(order_id, token_id, chain_id, payable_amount, receive_address, currency, order_amount, fee_amount, exchange_rate, psp_order_code, status, received_token_amount) {
50
+ _classCallCheck(this, Order);
51
+ Order.initialize(this, order_id, token_id, chain_id, payable_amount, receive_address, currency, order_amount, fee_amount, exchange_rate, psp_order_code, status, received_token_amount);
52
+ }
53
+
54
+ /**
55
+ * Initializes the fields of this object.
56
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
57
+ * Only for internal use.
58
+ */
59
+ return _createClass(Order, null, [{
60
+ key: "initialize",
61
+ value: function initialize(obj, order_id, token_id, chain_id, payable_amount, receive_address, currency, order_amount, fee_amount, exchange_rate, psp_order_code, status, received_token_amount) {
62
+ obj['order_id'] = order_id;
63
+ obj['token_id'] = token_id;
64
+ obj['chain_id'] = chain_id;
65
+ obj['payable_amount'] = payable_amount;
66
+ obj['receive_address'] = receive_address;
67
+ obj['currency'] = currency;
68
+ obj['order_amount'] = order_amount;
69
+ obj['fee_amount'] = fee_amount;
70
+ obj['exchange_rate'] = exchange_rate;
71
+ obj['psp_order_code'] = psp_order_code;
72
+ obj['status'] = status;
73
+ obj['received_token_amount'] = received_token_amount;
74
+ }
75
+
76
+ /**
77
+ * Constructs a <code>Order</code> from a plain JavaScript object, optionally creating a new instance.
78
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
79
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
80
+ * @param {module:model/Order} obj Optional instance to populate.
81
+ * @return {module:model/Order} The populated <code>Order</code> instance.
82
+ */
83
+ }, {
84
+ key: "constructFromObject",
85
+ value: function constructFromObject(data, obj) {
86
+ if (data) {
87
+ obj = obj || new Order();
88
+ if (data.hasOwnProperty('order_id')) {
89
+ obj['order_id'] = _ApiClient["default"].convertToType(data['order_id'], 'String');
90
+ }
91
+ if (data.hasOwnProperty('merchant_id')) {
92
+ obj['merchant_id'] = _ApiClient["default"].convertToType(data['merchant_id'], 'String');
93
+ }
94
+ if (data.hasOwnProperty('token_id')) {
95
+ obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
96
+ }
97
+ if (data.hasOwnProperty('chain_id')) {
98
+ obj['chain_id'] = _ApiClient["default"].convertToType(data['chain_id'], 'String');
99
+ }
100
+ if (data.hasOwnProperty('payable_amount')) {
101
+ obj['payable_amount'] = _ApiClient["default"].convertToType(data['payable_amount'], 'String');
102
+ }
103
+ if (data.hasOwnProperty('receive_address')) {
104
+ obj['receive_address'] = _ApiClient["default"].convertToType(data['receive_address'], 'String');
105
+ }
106
+ if (data.hasOwnProperty('currency')) {
107
+ obj['currency'] = _ApiClient["default"].convertToType(data['currency'], 'String');
108
+ }
109
+ if (data.hasOwnProperty('order_amount')) {
110
+ obj['order_amount'] = _ApiClient["default"].convertToType(data['order_amount'], 'String');
111
+ }
112
+ if (data.hasOwnProperty('fee_amount')) {
113
+ obj['fee_amount'] = _ApiClient["default"].convertToType(data['fee_amount'], 'String');
114
+ }
115
+ if (data.hasOwnProperty('exchange_rate')) {
116
+ obj['exchange_rate'] = _ApiClient["default"].convertToType(data['exchange_rate'], 'String');
117
+ }
118
+ if (data.hasOwnProperty('expired_at')) {
119
+ obj['expired_at'] = _ApiClient["default"].convertToType(data['expired_at'], 'Number');
120
+ }
121
+ if (data.hasOwnProperty('merchant_order_code')) {
122
+ obj['merchant_order_code'] = _ApiClient["default"].convertToType(data['merchant_order_code'], 'String');
123
+ }
124
+ if (data.hasOwnProperty('psp_order_code')) {
125
+ obj['psp_order_code'] = _ApiClient["default"].convertToType(data['psp_order_code'], 'String');
126
+ }
127
+ if (data.hasOwnProperty('status')) {
128
+ obj['status'] = _OrderStatus["default"].constructFromObject(data['status']);
129
+ }
130
+ if (data.hasOwnProperty('received_token_amount')) {
131
+ obj['received_token_amount'] = _ApiClient["default"].convertToType(data['received_token_amount'], 'String');
132
+ }
133
+ }
134
+ return obj;
135
+ }
136
+
137
+ /**
138
+ * Validates the JSON data with respect to <code>Order</code>.
139
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
140
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Order</code>.
141
+ */
142
+ }, {
143
+ key: "validateJSON",
144
+ value: function validateJSON(data) {
145
+ // check to make sure all required properties are present in the JSON string
146
+ var _iterator = _createForOfIteratorHelper(Order.RequiredProperties),
147
+ _step;
148
+ try {
149
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
150
+ var property = _step.value;
151
+ if (!data.hasOwnProperty(property)) {
152
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
153
+ }
154
+ }
155
+ // ensure the json data is a string
156
+ } catch (err) {
157
+ _iterator.e(err);
158
+ } finally {
159
+ _iterator.f();
160
+ }
161
+ if (data['order_id'] && !(typeof data['order_id'] === 'string' || data['order_id'] instanceof String)) {
162
+ throw new Error("Expected the field `order_id` to be a primitive type in the JSON string but got " + data['order_id']);
163
+ }
164
+ // ensure the json data is a string
165
+ if (data['merchant_id'] && !(typeof data['merchant_id'] === 'string' || data['merchant_id'] instanceof String)) {
166
+ throw new Error("Expected the field `merchant_id` to be a primitive type in the JSON string but got " + data['merchant_id']);
167
+ }
168
+ // ensure the json data is a string
169
+ if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
170
+ throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
171
+ }
172
+ // ensure the json data is a string
173
+ if (data['chain_id'] && !(typeof data['chain_id'] === 'string' || data['chain_id'] instanceof String)) {
174
+ throw new Error("Expected the field `chain_id` to be a primitive type in the JSON string but got " + data['chain_id']);
175
+ }
176
+ // ensure the json data is a string
177
+ if (data['payable_amount'] && !(typeof data['payable_amount'] === 'string' || data['payable_amount'] instanceof String)) {
178
+ throw new Error("Expected the field `payable_amount` to be a primitive type in the JSON string but got " + data['payable_amount']);
179
+ }
180
+ // ensure the json data is a string
181
+ if (data['receive_address'] && !(typeof data['receive_address'] === 'string' || data['receive_address'] instanceof String)) {
182
+ throw new Error("Expected the field `receive_address` to be a primitive type in the JSON string but got " + data['receive_address']);
183
+ }
184
+ // ensure the json data is a string
185
+ if (data['currency'] && !(typeof data['currency'] === 'string' || data['currency'] instanceof String)) {
186
+ throw new Error("Expected the field `currency` to be a primitive type in the JSON string but got " + data['currency']);
187
+ }
188
+ // ensure the json data is a string
189
+ if (data['order_amount'] && !(typeof data['order_amount'] === 'string' || data['order_amount'] instanceof String)) {
190
+ throw new Error("Expected the field `order_amount` to be a primitive type in the JSON string but got " + data['order_amount']);
191
+ }
192
+ // ensure the json data is a string
193
+ if (data['fee_amount'] && !(typeof data['fee_amount'] === 'string' || data['fee_amount'] instanceof String)) {
194
+ throw new Error("Expected the field `fee_amount` to be a primitive type in the JSON string but got " + data['fee_amount']);
195
+ }
196
+ // ensure the json data is a string
197
+ if (data['exchange_rate'] && !(typeof data['exchange_rate'] === 'string' || data['exchange_rate'] instanceof String)) {
198
+ throw new Error("Expected the field `exchange_rate` to be a primitive type in the JSON string but got " + data['exchange_rate']);
199
+ }
200
+ // ensure the json data is a string
201
+ if (data['merchant_order_code'] && !(typeof data['merchant_order_code'] === 'string' || data['merchant_order_code'] instanceof String)) {
202
+ throw new Error("Expected the field `merchant_order_code` to be a primitive type in the JSON string but got " + data['merchant_order_code']);
203
+ }
204
+ // ensure the json data is a string
205
+ if (data['psp_order_code'] && !(typeof data['psp_order_code'] === 'string' || data['psp_order_code'] instanceof String)) {
206
+ throw new Error("Expected the field `psp_order_code` to be a primitive type in the JSON string but got " + data['psp_order_code']);
207
+ }
208
+ // ensure the json data is a string
209
+ if (data['received_token_amount'] && !(typeof data['received_token_amount'] === 'string' || data['received_token_amount'] instanceof String)) {
210
+ throw new Error("Expected the field `received_token_amount` to be a primitive type in the JSON string but got " + data['received_token_amount']);
211
+ }
212
+ return true;
213
+ }
214
+ }]);
215
+ }();
216
+ Order.RequiredProperties = ["order_id", "token_id", "chain_id", "payable_amount", "receive_address", "currency", "order_amount", "fee_amount", "exchange_rate", "psp_order_code", "status", "received_token_amount"];
217
+
218
+ /**
219
+ * The order ID.
220
+ * @member {String} order_id
221
+ */
222
+ Order.prototype['order_id'] = undefined;
223
+
224
+ /**
225
+ * The merchant ID.
226
+ * @member {String} merchant_id
227
+ */
228
+ Order.prototype['merchant_id'] = undefined;
229
+
230
+ /**
231
+ * The ID of the cryptocurrency token used for payment.
232
+ * @member {String} token_id
233
+ */
234
+ Order.prototype['token_id'] = undefined;
235
+
236
+ /**
237
+ * The ID of the blockchain network where the payment transaction should be made.
238
+ * @member {String} chain_id
239
+ */
240
+ Order.prototype['chain_id'] = undefined;
241
+
242
+ /**
243
+ * The cryptocurrency amount to be paid for this order.
244
+ * @member {String} payable_amount
245
+ */
246
+ Order.prototype['payable_amount'] = undefined;
247
+
248
+ /**
249
+ * The recipient wallet address to be used for the payment transaction.
250
+ * @member {String} receive_address
251
+ */
252
+ Order.prototype['receive_address'] = undefined;
253
+
254
+ /**
255
+ * The currency of the order.
256
+ * @member {String} currency
257
+ */
258
+ Order.prototype['currency'] = undefined;
259
+
260
+ /**
261
+ * The base amount in currency to be charged for the payment order, excluding the payment gateway fee (specified in `fee_amount`).
262
+ * @member {String} order_amount
263
+ */
264
+ Order.prototype['order_amount'] = undefined;
265
+
266
+ /**
267
+ * The payment gateway fee in currency. It is added to the base amount (`order_amount`) to determine the final charge.
268
+ * @member {String} fee_amount
269
+ */
270
+ Order.prototype['fee_amount'] = undefined;
271
+
272
+ /**
273
+ * The exchange rate used to convert between currency and cryptocurrency token. Expressed as the amount of currency per one unit of cryptocurrency. For example, if the token is USDT and the currency is USD, a rate of \"0.99\" means 1 USDT = 0.99 USD.
274
+ * @member {String} exchange_rate
275
+ */
276
+ Order.prototype['exchange_rate'] = undefined;
277
+
278
+ /**
279
+ * The expiration time of the payment order, represented as a UNIX timestamp in seconds.
280
+ * @member {Number} expired_at
281
+ */
282
+ Order.prototype['expired_at'] = undefined;
283
+
284
+ /**
285
+ * A unique reference code assigned by the merchant to identify this order in their system.
286
+ * @member {String} merchant_order_code
287
+ */
288
+ Order.prototype['merchant_order_code'] = undefined;
289
+
290
+ /**
291
+ * A unique reference code assigned by the payment gateway to identify this order in their system.
292
+ * @member {String} psp_order_code
293
+ */
294
+ Order.prototype['psp_order_code'] = undefined;
295
+
296
+ /**
297
+ * @member {module:model/OrderStatus} status
298
+ */
299
+ Order.prototype['status'] = undefined;
300
+
301
+ /**
302
+ * The total cryptocurrency amount received for this order. Updates until order expires. Precision matches the token standard (e.g., 6 decimals for USDT).
303
+ * @member {String} received_token_amount
304
+ */
305
+ Order.prototype['received_token_amount'] = undefined;
306
+ var _default = exports["default"] = Order;
@@ -0,0 +1,76 @@
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 OrderStatus.
27
+ * @enum {}
28
+ * @readonly
29
+ */
30
+ var OrderStatus = exports["default"] = /*#__PURE__*/function () {
31
+ function OrderStatus() {
32
+ _classCallCheck(this, OrderStatus);
33
+ /**
34
+ * value: "Pending"
35
+ * @const
36
+ */
37
+ _defineProperty(this, "Pending", "Pending");
38
+ /**
39
+ * value: "Processing"
40
+ * @const
41
+ */
42
+ _defineProperty(this, "Processing", "Processing");
43
+ /**
44
+ * value: "Completed"
45
+ * @const
46
+ */
47
+ _defineProperty(this, "Completed", "Completed");
48
+ /**
49
+ * value: "Expired"
50
+ * @const
51
+ */
52
+ _defineProperty(this, "Expired", "Expired");
53
+ /**
54
+ * value: "Underpaid"
55
+ * @const
56
+ */
57
+ _defineProperty(this, "Underpaid", "Underpaid");
58
+ /**
59
+ * value: "unknown_default_open_api"
60
+ * @const
61
+ */
62
+ _defineProperty(this, "unknown_default_open_api", "unknown_default_open_api");
63
+ }
64
+ return _createClass(OrderStatus, null, [{
65
+ key: "constructFromObject",
66
+ value:
67
+ /**
68
+ * Returns a <code>OrderStatus</code> enum value from a Javascript object name.
69
+ * @param {Object} data The plain JavaScript object containing the name of the enum value.
70
+ * @return {module:model/OrderStatus} The enum <code>OrderStatus</code> value.
71
+ */
72
+ function constructFromObject(object) {
73
+ return object;
74
+ }
75
+ }]);
76
+ }();
@@ -0,0 +1,201 @@
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 _TransactionStatus = _interopRequireDefault(require("./TransactionStatus"));
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 PaymentTransaction model module.
30
+ * @module model/PaymentTransaction
31
+ */
32
+ var PaymentTransaction = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>PaymentTransaction</code>.
35
+ * @alias module:model/PaymentTransaction
36
+ * @param tx_id {String} Unique identifier for the transaction.
37
+ * @param from_address {String} Source cryptocurrency address for the transaction.
38
+ * @param to_address {String} Destination cryptocurrency address for the transaction.
39
+ * @param amount {String} The amount of cryptocurrency transferred, as a decimal string.
40
+ * @param status {module:model/TransactionStatus}
41
+ * @param created_timestamp {Number} The time when the transaction was created, in Unix timestamp format, measured in milliseconds.
42
+ * @param updated_timestamp {Number} The time when the transaction was updated, in Unix timestamp format, measured in milliseconds.
43
+ */
44
+ function PaymentTransaction(tx_id, from_address, to_address, amount, status, created_timestamp, updated_timestamp) {
45
+ _classCallCheck(this, PaymentTransaction);
46
+ PaymentTransaction.initialize(this, tx_id, from_address, to_address, amount, status, created_timestamp, updated_timestamp);
47
+ }
48
+
49
+ /**
50
+ * Initializes the fields of this object.
51
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
52
+ * Only for internal use.
53
+ */
54
+ return _createClass(PaymentTransaction, null, [{
55
+ key: "initialize",
56
+ value: function initialize(obj, tx_id, from_address, to_address, amount, status, created_timestamp, updated_timestamp) {
57
+ obj['tx_id'] = tx_id;
58
+ obj['from_address'] = from_address;
59
+ obj['to_address'] = to_address;
60
+ obj['amount'] = amount;
61
+ obj['status'] = status;
62
+ obj['created_timestamp'] = created_timestamp;
63
+ obj['updated_timestamp'] = updated_timestamp;
64
+ }
65
+
66
+ /**
67
+ * Constructs a <code>PaymentTransaction</code> from a plain JavaScript object, optionally creating a new instance.
68
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
69
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
70
+ * @param {module:model/PaymentTransaction} obj Optional instance to populate.
71
+ * @return {module:model/PaymentTransaction} The populated <code>PaymentTransaction</code> instance.
72
+ */
73
+ }, {
74
+ key: "constructFromObject",
75
+ value: function constructFromObject(data, obj) {
76
+ if (data) {
77
+ obj = obj || new PaymentTransaction();
78
+ if (data.hasOwnProperty('tx_id')) {
79
+ obj['tx_id'] = _ApiClient["default"].convertToType(data['tx_id'], 'String');
80
+ }
81
+ if (data.hasOwnProperty('tx_hash')) {
82
+ obj['tx_hash'] = _ApiClient["default"].convertToType(data['tx_hash'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('from_address')) {
85
+ obj['from_address'] = _ApiClient["default"].convertToType(data['from_address'], 'String');
86
+ }
87
+ if (data.hasOwnProperty('to_address')) {
88
+ obj['to_address'] = _ApiClient["default"].convertToType(data['to_address'], 'String');
89
+ }
90
+ if (data.hasOwnProperty('amount')) {
91
+ obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
92
+ }
93
+ if (data.hasOwnProperty('status')) {
94
+ obj['status'] = _TransactionStatus["default"].constructFromObject(data['status']);
95
+ }
96
+ if (data.hasOwnProperty('created_timestamp')) {
97
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
98
+ }
99
+ if (data.hasOwnProperty('updated_timestamp')) {
100
+ obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
101
+ }
102
+ }
103
+ return obj;
104
+ }
105
+
106
+ /**
107
+ * Validates the JSON data with respect to <code>PaymentTransaction</code>.
108
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
109
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>PaymentTransaction</code>.
110
+ */
111
+ }, {
112
+ key: "validateJSON",
113
+ value: function validateJSON(data) {
114
+ // check to make sure all required properties are present in the JSON string
115
+ var _iterator = _createForOfIteratorHelper(PaymentTransaction.RequiredProperties),
116
+ _step;
117
+ try {
118
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
119
+ var property = _step.value;
120
+ if (!data.hasOwnProperty(property)) {
121
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
122
+ }
123
+ }
124
+ // ensure the json data is a string
125
+ } catch (err) {
126
+ _iterator.e(err);
127
+ } finally {
128
+ _iterator.f();
129
+ }
130
+ if (data['tx_id'] && !(typeof data['tx_id'] === 'string' || data['tx_id'] instanceof String)) {
131
+ throw new Error("Expected the field `tx_id` to be a primitive type in the JSON string but got " + data['tx_id']);
132
+ }
133
+ // ensure the json data is a string
134
+ if (data['tx_hash'] && !(typeof data['tx_hash'] === 'string' || data['tx_hash'] instanceof String)) {
135
+ throw new Error("Expected the field `tx_hash` to be a primitive type in the JSON string but got " + data['tx_hash']);
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['to_address'] && !(typeof data['to_address'] === 'string' || data['to_address'] instanceof String)) {
143
+ throw new Error("Expected the field `to_address` to be a primitive type in the JSON string but got " + data['to_address']);
144
+ }
145
+ // ensure the json data is a string
146
+ if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
147
+ throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
148
+ }
149
+ return true;
150
+ }
151
+ }]);
152
+ }();
153
+ PaymentTransaction.RequiredProperties = ["tx_id", "from_address", "to_address", "amount", "status", "created_timestamp", "updated_timestamp"];
154
+
155
+ /**
156
+ * Unique identifier for the transaction.
157
+ * @member {String} tx_id
158
+ */
159
+ PaymentTransaction.prototype['tx_id'] = undefined;
160
+
161
+ /**
162
+ * The blockchain transaction hash, may be initially null and populated after submission.
163
+ * @member {String} tx_hash
164
+ */
165
+ PaymentTransaction.prototype['tx_hash'] = undefined;
166
+
167
+ /**
168
+ * Source cryptocurrency address for the transaction.
169
+ * @member {String} from_address
170
+ */
171
+ PaymentTransaction.prototype['from_address'] = undefined;
172
+
173
+ /**
174
+ * Destination cryptocurrency address for the transaction.
175
+ * @member {String} to_address
176
+ */
177
+ PaymentTransaction.prototype['to_address'] = undefined;
178
+
179
+ /**
180
+ * The amount of cryptocurrency transferred, as a decimal string.
181
+ * @member {String} amount
182
+ */
183
+ PaymentTransaction.prototype['amount'] = undefined;
184
+
185
+ /**
186
+ * @member {module:model/TransactionStatus} status
187
+ */
188
+ PaymentTransaction.prototype['status'] = undefined;
189
+
190
+ /**
191
+ * The time when the transaction was created, in Unix timestamp format, measured in milliseconds.
192
+ * @member {Number} created_timestamp
193
+ */
194
+ PaymentTransaction.prototype['created_timestamp'] = undefined;
195
+
196
+ /**
197
+ * The time when the transaction was updated, in Unix timestamp format, measured in milliseconds.
198
+ * @member {Number} updated_timestamp
199
+ */
200
+ PaymentTransaction.prototype['updated_timestamp'] = undefined;
201
+ var _default = exports["default"] = PaymentTransaction;
@@ -31,9 +31,8 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
31
31
  var RefreshAddressBalancesByTokenRequest = /*#__PURE__*/function () {
32
32
  /**
33
33
  * Constructs a new <code>RefreshAddressBalancesByTokenRequest</code>.
34
- * The request body to refresh the addresses balance by specified token within a specified wallet.
35
34
  * @alias module:model/RefreshAddressBalancesByTokenRequest
36
- * @param addresses {Array.<String>} A list of address.
35
+ * @param addresses {Array.<String>} A list of addresses.
37
36
  */
38
37
  function RefreshAddressBalancesByTokenRequest(addresses) {
39
38
  _classCallCheck(this, RefreshAddressBalancesByTokenRequest);
@@ -104,7 +103,7 @@ var RefreshAddressBalancesByTokenRequest = /*#__PURE__*/function () {
104
103
  RefreshAddressBalancesByTokenRequest.RequiredProperties = ["addresses"];
105
104
 
106
105
  /**
107
- * A list of address.
106
+ * A list of addresses.
108
107
  * @member {Array.<String>} addresses
109
108
  */
110
109
  RefreshAddressBalancesByTokenRequest.prototype['addresses'] = undefined;