@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.
- package/README.md +54 -18
- package/dist/ApiClient.js +1 -1
- package/dist/api/FeeStationApi.js +18 -18
- package/dist/api/TransactionsApi.js +2 -2
- package/dist/api/WalletsApi.js +8 -8
- package/dist/index.js +260 -43
- package/dist/model/ActivityExtra.js +0 -23
- package/dist/model/AddressEncoding.js +15 -0
- package/dist/model/AddressesEventData.js +8 -3
- package/dist/model/BTCBIP137MessageSignDestination.js +122 -0
- package/dist/model/BTCBIP322MessageSignDestination.js +122 -0
- package/dist/model/BabylonStakingActivityDetailExtra.js +0 -39
- package/dist/model/{ListSwapActivities200Response.js → BankAccount.js} +51 -51
- package/dist/model/ChainsEventData.js +8 -3
- package/dist/model/CosmosAdr36MessageSignDestination.js +122 -0
- package/dist/model/CosmosContractCallDestination.js +152 -0
- package/dist/model/CosmosContractCallMessage.js +126 -0
- package/dist/model/CreateSettlement.js +174 -0
- package/dist/model/MPCVaultEventData.js +8 -3
- package/dist/model/{CreateSwapActivityRequest.js → Merchant.js} +45 -58
- package/dist/model/MessageSignDestination.js +111 -9
- package/dist/model/MessageSignDestinationType.js +15 -0
- package/dist/model/Order.js +306 -0
- package/dist/model/OrderStatus.js +76 -0
- package/dist/model/PaymentTransaction.js +201 -0
- package/dist/model/RefreshAddressBalancesByTokenRequest.js +2 -3
- package/dist/model/Refund.js +237 -0
- package/dist/model/RefundStatus.js +76 -0
- package/dist/model/RefundType.js +61 -0
- package/dist/model/SettleRequestStatus.js +76 -0
- package/dist/model/SettleStatus.js +76 -0
- package/dist/model/Settlement.js +168 -0
- package/dist/model/SettlementDetail.js +184 -0
- package/dist/model/SettlementInfo.js +175 -0
- package/dist/model/SettlementType.js +61 -0
- package/dist/model/SwapActivity.js +36 -5
- package/dist/model/SwapActivityStatus.js +66 -0
- package/dist/model/SwapActivityType.js +61 -0
- package/dist/model/SwapQuote.js +21 -34
- package/dist/model/{CreateSwapQuoteRequest.js → SwapToken.js} +73 -60
- package/dist/model/TSSRequestWebhookEventData.js +8 -3
- package/dist/model/TokenListing.js +230 -0
- package/dist/model/TokenListingEventData.js +363 -0
- package/dist/model/TokenListingRequestSource.js +61 -0
- package/dist/model/TokenListingRequestStatus.js +66 -0
- package/dist/model/TokensEventData.js +8 -3
- package/dist/model/Transaction.js +22 -5
- package/dist/model/TransactionBIP137Destination.js +122 -0
- package/dist/model/TransactionBIP322Destination.js +122 -0
- package/dist/model/TransactionBabylonBusinessInfo.js +138 -0
- package/dist/model/TransactionBabylonTxParameters.js +168 -0
- package/dist/model/TransactionCoreStakeInfo.js +168 -0
- package/dist/model/TransactionCosmosAdr36Destination.js +122 -0
- package/dist/model/TransactionCosmosContractDestination.js +152 -0
- package/dist/model/{ListEnableTokenPairs200Response.js → TransactionCosmosMessage.js} +54 -51
- package/dist/model/TransactionDestination.js +172 -8
- package/dist/model/TransactionDestinationType.js +20 -0
- package/dist/model/TransactionDetail.js +29 -7
- package/dist/model/TransactionDetails.js +29 -7
- package/dist/model/TransactionExtra.js +278 -0
- package/dist/model/TransactionExtraType.js +66 -0
- package/dist/model/TransactionFuelingInfo.js +3 -3
- package/dist/model/TransactionMessageSignBTCEIP191Destination.js +122 -0
- package/dist/model/TransactionRbfSource.js +37 -9
- package/dist/model/TransactionSelectedUtxo.js +2 -2
- package/dist/model/TransactionSubStatus.js +45 -0
- package/dist/model/TransactionWebhookEventData.js +37 -10
- package/dist/model/UpdateCustodialWalletParams.js +6 -4
- package/dist/model/UpdateExchangeWalletParams.js +6 -4
- package/dist/model/UpdateMpcWalletParams.js +6 -4
- package/dist/model/UpdateSmartContractWalletParams.js +6 -4
- package/dist/model/WalletInfoEventData.js +8 -3
- package/dist/model/WebhookEventData.js +81 -18
- package/dist/model/WebhookEventDataType.js +7 -2
- package/dist/model/WebhookEventType.js +10 -0
- package/docs/ActivityExtra.md +0 -4
- package/docs/AddressEncoding.md +6 -0
- package/docs/AddressesEventData.md +3 -1
- package/docs/BTCBIP137MessageSignDestination.md +10 -0
- package/docs/BTCBIP322MessageSignDestination.md +10 -0
- package/docs/BabylonStakingActivityDetailExtra.md +0 -4
- package/docs/BankAccount.md +10 -0
- package/docs/ChainsEventData.md +3 -1
- package/docs/CosmosAdr36MessageSignDestination.md +10 -0
- package/docs/CosmosContractCallDestination.md +11 -0
- package/docs/CosmosContractCallMessage.md +10 -0
- package/docs/CreateSettlement.md +14 -0
- package/docs/FeeStationApi.md +13 -13
- package/docs/MPCVaultEventData.md +3 -1
- package/docs/Merchant.md +11 -0
- package/docs/MessageSignDestination.md +3 -0
- package/docs/MessageSignDestinationType.md +6 -0
- package/docs/Order.md +23 -0
- package/docs/OrderStatus.md +18 -0
- package/docs/PaymentTransaction.md +16 -0
- package/docs/RefreshAddressBalancesByTokenRequest.md +1 -1
- package/docs/Refund.md +17 -0
- package/docs/RefundStatus.md +18 -0
- package/docs/RefundType.md +12 -0
- package/docs/SettleRequestStatus.md +18 -0
- package/docs/SettleStatus.md +18 -0
- package/docs/Settlement.md +12 -0
- package/docs/SettlementDetail.md +15 -0
- package/docs/SettlementInfo.md +14 -0
- package/docs/SettlementType.md +12 -0
- package/docs/SwapActivity.md +4 -1
- package/docs/SwapActivityStatus.md +14 -0
- package/docs/SwapActivityType.md +12 -0
- package/docs/SwapQuote.md +3 -4
- package/docs/SwapToken.md +14 -0
- package/docs/TSSRequestWebhookEventData.md +3 -1
- package/docs/TokenListing.md +19 -0
- package/docs/TokenListingEventData.md +45 -0
- package/docs/TokenListingRequestSource.md +12 -0
- package/docs/TokenListingRequestStatus.md +14 -0
- package/docs/TokensEventData.md +3 -1
- package/docs/Transaction.md +4 -3
- package/docs/TransactionBIP137Destination.md +10 -0
- package/docs/TransactionBIP322Destination.md +10 -0
- package/docs/TransactionBabylonBusinessInfo.md +11 -0
- package/docs/TransactionBabylonTxParameters.md +15 -0
- package/docs/TransactionCoreStakeInfo.md +14 -0
- package/docs/TransactionCosmosAdr36Destination.md +10 -0
- package/docs/TransactionCosmosContractDestination.md +11 -0
- package/docs/TransactionCosmosMessage.md +10 -0
- package/docs/TransactionDestination.md +4 -0
- package/docs/TransactionDestinationType.md +8 -0
- package/docs/TransactionDetail.md +4 -3
- package/docs/TransactionDetails.md +4 -3
- package/docs/TransactionExtra.md +21 -0
- package/docs/TransactionExtraType.md +14 -0
- package/docs/TransactionFuelingInfo.md +2 -2
- package/docs/TransactionMessageSignBTCEIP191Destination.md +10 -0
- package/docs/TransactionRbfSource.md +1 -1
- package/docs/TransactionSelectedUtxo.md +2 -2
- package/docs/TransactionSubStatus.md +18 -0
- package/docs/TransactionWebhookEventData.md +7 -4
- package/docs/TransactionsApi.md +1 -1
- package/docs/UpdateCustodialWalletParams.md +1 -1
- package/docs/UpdateExchangeWalletParams.md +1 -1
- package/docs/UpdateMpcWalletParams.md +1 -1
- package/docs/UpdateSmartContractWalletParams.md +1 -1
- package/docs/UpdateWalletParams.md +1 -1
- package/docs/WalletInfoEventData.md +3 -1
- package/docs/WalletsApi.md +5 -5
- package/docs/WebhookEventData.md +16 -8
- package/docs/WebhookEventDataType.md +3 -1
- package/docs/WebhookEventType.md +4 -0
- package/package.json +1 -1
- package/dist/api/SwapsApi.js +0 -360
- package/dist/model/CreateSwapQuote201Response.js +0 -264
- package/dist/model/SwapTokenPair.js +0 -100
- package/docs/CreateSwapActivityRequest.md +0 -12
- package/docs/CreateSwapQuote201Response.md +0 -17
- package/docs/CreateSwapQuoteRequest.md +0 -13
- package/docs/ListEnableTokenPairs200Response.md +0 -10
- package/docs/ListSwapActivities200Response.md +0 -10
- package/docs/SwapTokenPair.md +0 -10
- package/docs/SwapsApi.md +0 -348
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _SwapActivityStatus = _interopRequireDefault(require("./SwapActivityStatus"));
|
|
9
|
+
var _SwapActivityType = _interopRequireDefault(require("./SwapActivityType"));
|
|
8
10
|
var _TransactionInitiatorType = _interopRequireDefault(require("./TransactionInitiatorType"));
|
|
9
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
12
|
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); }
|
|
@@ -60,8 +62,14 @@ var SwapActivity = /*#__PURE__*/function () {
|
|
|
60
62
|
if (data.hasOwnProperty('activity_id')) {
|
|
61
63
|
obj['activity_id'] = _ApiClient["default"].convertToType(data['activity_id'], 'String');
|
|
62
64
|
}
|
|
65
|
+
if (data.hasOwnProperty('activity_type')) {
|
|
66
|
+
obj['activity_type'] = _SwapActivityType["default"].constructFromObject(data['activity_type']);
|
|
67
|
+
}
|
|
63
68
|
if (data.hasOwnProperty('status')) {
|
|
64
|
-
obj['status'] =
|
|
69
|
+
obj['status'] = _SwapActivityStatus["default"].constructFromObject(data['status']);
|
|
70
|
+
}
|
|
71
|
+
if (data.hasOwnProperty('request_id')) {
|
|
72
|
+
obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
|
|
65
73
|
}
|
|
66
74
|
if (data.hasOwnProperty('wallet_id')) {
|
|
67
75
|
obj['wallet_id'] = _ApiClient["default"].convertToType(data['wallet_id'], 'String');
|
|
@@ -87,6 +95,9 @@ var SwapActivity = /*#__PURE__*/function () {
|
|
|
87
95
|
if (data.hasOwnProperty('initiator_type')) {
|
|
88
96
|
obj['initiator_type'] = _TransactionInitiatorType["default"].constructFromObject(data['initiator_type']);
|
|
89
97
|
}
|
|
98
|
+
if (data.hasOwnProperty('description')) {
|
|
99
|
+
obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
|
|
100
|
+
}
|
|
90
101
|
if (data.hasOwnProperty('created_timestamp')) {
|
|
91
102
|
obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
|
|
92
103
|
}
|
|
@@ -110,8 +121,8 @@ var SwapActivity = /*#__PURE__*/function () {
|
|
|
110
121
|
throw new Error("Expected the field `activity_id` to be a primitive type in the JSON string but got " + data['activity_id']);
|
|
111
122
|
}
|
|
112
123
|
// ensure the json data is a string
|
|
113
|
-
if (data['
|
|
114
|
-
throw new Error("Expected the field `
|
|
124
|
+
if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
|
|
125
|
+
throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
|
|
115
126
|
}
|
|
116
127
|
// ensure the json data is a string
|
|
117
128
|
if (data['wallet_id'] && !(typeof data['wallet_id'] === 'string' || data['wallet_id'] instanceof String)) {
|
|
@@ -141,6 +152,10 @@ var SwapActivity = /*#__PURE__*/function () {
|
|
|
141
152
|
if (data['initiator'] && !(typeof data['initiator'] === 'string' || data['initiator'] instanceof String)) {
|
|
142
153
|
throw new Error("Expected the field `initiator` to be a primitive type in the JSON string but got " + data['initiator']);
|
|
143
154
|
}
|
|
155
|
+
// ensure the json data is a string
|
|
156
|
+
if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
|
|
157
|
+
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
|
|
158
|
+
}
|
|
144
159
|
return true;
|
|
145
160
|
}
|
|
146
161
|
}]);
|
|
@@ -152,11 +167,21 @@ var SwapActivity = /*#__PURE__*/function () {
|
|
|
152
167
|
SwapActivity.prototype['activity_id'] = undefined;
|
|
153
168
|
|
|
154
169
|
/**
|
|
155
|
-
*
|
|
156
|
-
|
|
170
|
+
* @member {module:model/SwapActivityType} activity_type
|
|
171
|
+
*/
|
|
172
|
+
SwapActivity.prototype['activity_type'] = undefined;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @member {module:model/SwapActivityStatus} status
|
|
157
176
|
*/
|
|
158
177
|
SwapActivity.prototype['status'] = undefined;
|
|
159
178
|
|
|
179
|
+
/**
|
|
180
|
+
* The request id of the swap activity.
|
|
181
|
+
* @member {String} request_id
|
|
182
|
+
*/
|
|
183
|
+
SwapActivity.prototype['request_id'] = undefined;
|
|
184
|
+
|
|
160
185
|
/**
|
|
161
186
|
* The unique identifier of the wallet.
|
|
162
187
|
* @member {String} wallet_id
|
|
@@ -204,6 +229,12 @@ SwapActivity.prototype['initiator'] = undefined;
|
|
|
204
229
|
*/
|
|
205
230
|
SwapActivity.prototype['initiator_type'] = undefined;
|
|
206
231
|
|
|
232
|
+
/**
|
|
233
|
+
* The description of the swap activity.
|
|
234
|
+
* @member {String} description
|
|
235
|
+
*/
|
|
236
|
+
SwapActivity.prototype['description'] = undefined;
|
|
237
|
+
|
|
207
238
|
/**
|
|
208
239
|
* The time when the swap activity was created, in Unix timestamp format, measured in milliseconds.
|
|
209
240
|
* @member {Number} created_timestamp
|
|
@@ -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 SwapActivityStatus.
|
|
27
|
+
* @enum {}
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
var SwapActivityStatus = exports["default"] = /*#__PURE__*/function () {
|
|
31
|
+
function SwapActivityStatus() {
|
|
32
|
+
_classCallCheck(this, SwapActivityStatus);
|
|
33
|
+
/**
|
|
34
|
+
* value: "Success"
|
|
35
|
+
* @const
|
|
36
|
+
*/
|
|
37
|
+
_defineProperty(this, "Success", "Success");
|
|
38
|
+
/**
|
|
39
|
+
* value: "Processing"
|
|
40
|
+
* @const
|
|
41
|
+
*/
|
|
42
|
+
_defineProperty(this, "Processing", "Processing");
|
|
43
|
+
/**
|
|
44
|
+
* value: "Failed"
|
|
45
|
+
* @const
|
|
46
|
+
*/
|
|
47
|
+
_defineProperty(this, "Failed", "Failed");
|
|
48
|
+
/**
|
|
49
|
+
* value: "unknown_default_open_api"
|
|
50
|
+
* @const
|
|
51
|
+
*/
|
|
52
|
+
_defineProperty(this, "unknown_default_open_api", "unknown_default_open_api");
|
|
53
|
+
}
|
|
54
|
+
return _createClass(SwapActivityStatus, null, [{
|
|
55
|
+
key: "constructFromObject",
|
|
56
|
+
value:
|
|
57
|
+
/**
|
|
58
|
+
* Returns a <code>SwapActivityStatus</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/SwapActivityStatus} The enum <code>SwapActivityStatus</code> value.
|
|
61
|
+
*/
|
|
62
|
+
function constructFromObject(object) {
|
|
63
|
+
return object;
|
|
64
|
+
}
|
|
65
|
+
}]);
|
|
66
|
+
}();
|
|
@@ -0,0 +1,61 @@
|
|
|
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 SwapActivityType.
|
|
27
|
+
* @enum {}
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
var SwapActivityType = exports["default"] = /*#__PURE__*/function () {
|
|
31
|
+
function SwapActivityType() {
|
|
32
|
+
_classCallCheck(this, SwapActivityType);
|
|
33
|
+
/**
|
|
34
|
+
* value: "Bridge"
|
|
35
|
+
* @const
|
|
36
|
+
*/
|
|
37
|
+
_defineProperty(this, "Bridge", "Bridge");
|
|
38
|
+
/**
|
|
39
|
+
* value: "Exchange"
|
|
40
|
+
* @const
|
|
41
|
+
*/
|
|
42
|
+
_defineProperty(this, "Exchange", "Exchange");
|
|
43
|
+
/**
|
|
44
|
+
* value: "unknown_default_open_api"
|
|
45
|
+
* @const
|
|
46
|
+
*/
|
|
47
|
+
_defineProperty(this, "unknown_default_open_api", "unknown_default_open_api");
|
|
48
|
+
}
|
|
49
|
+
return _createClass(SwapActivityType, null, [{
|
|
50
|
+
key: "constructFromObject",
|
|
51
|
+
value:
|
|
52
|
+
/**
|
|
53
|
+
* Returns a <code>SwapActivityType</code> enum value from a Javascript object name.
|
|
54
|
+
* @param {Object} data The plain JavaScript object containing the name of the enum value.
|
|
55
|
+
* @return {module:model/SwapActivityType} The enum <code>SwapActivityType</code> value.
|
|
56
|
+
*/
|
|
57
|
+
function constructFromObject(object) {
|
|
58
|
+
return object;
|
|
59
|
+
}
|
|
60
|
+
}]);
|
|
61
|
+
}();
|
package/dist/model/SwapQuote.js
CHANGED
|
@@ -68,6 +68,9 @@ var SwapQuote = /*#__PURE__*/function () {
|
|
|
68
68
|
value: function constructFromObject(data, obj) {
|
|
69
69
|
if (data) {
|
|
70
70
|
obj = obj || new SwapQuote();
|
|
71
|
+
if (data.hasOwnProperty('quote_id')) {
|
|
72
|
+
obj['quote_id'] = _ApiClient["default"].convertToType(data['quote_id'], 'String');
|
|
73
|
+
}
|
|
71
74
|
if (data.hasOwnProperty('pay_amount')) {
|
|
72
75
|
obj['pay_amount'] = _ApiClient["default"].convertToType(data['pay_amount'], 'String');
|
|
73
76
|
}
|
|
@@ -77,17 +80,11 @@ var SwapQuote = /*#__PURE__*/function () {
|
|
|
77
80
|
if (data.hasOwnProperty('fee_amount')) {
|
|
78
81
|
obj['fee_amount'] = _ApiClient["default"].convertToType(data['fee_amount'], 'String');
|
|
79
82
|
}
|
|
80
|
-
if (data.hasOwnProperty('min_pay_amount')) {
|
|
81
|
-
obj['min_pay_amount'] = _ApiClient["default"].convertToType(data['min_pay_amount'], 'String');
|
|
82
|
-
}
|
|
83
|
-
if (data.hasOwnProperty('max_pay_amount')) {
|
|
84
|
-
obj['max_pay_amount'] = _ApiClient["default"].convertToType(data['max_pay_amount'], 'String');
|
|
85
|
-
}
|
|
86
83
|
if (data.hasOwnProperty('min_receive_amount')) {
|
|
87
84
|
obj['min_receive_amount'] = _ApiClient["default"].convertToType(data['min_receive_amount'], 'String');
|
|
88
85
|
}
|
|
89
|
-
if (data.hasOwnProperty('
|
|
90
|
-
obj['
|
|
86
|
+
if (data.hasOwnProperty('max_pay_amount')) {
|
|
87
|
+
obj['max_pay_amount'] = _ApiClient["default"].convertToType(data['max_pay_amount'], 'String');
|
|
91
88
|
}
|
|
92
89
|
if (data.hasOwnProperty('quote_expired_timestamp')) {
|
|
93
90
|
obj['quote_expired_timestamp'] = _ApiClient["default"].convertToType(data['quote_expired_timestamp'], 'Number');
|
|
@@ -120,6 +117,10 @@ var SwapQuote = /*#__PURE__*/function () {
|
|
|
120
117
|
} finally {
|
|
121
118
|
_iterator.f();
|
|
122
119
|
}
|
|
120
|
+
if (data['quote_id'] && !(typeof data['quote_id'] === 'string' || data['quote_id'] instanceof String)) {
|
|
121
|
+
throw new Error("Expected the field `quote_id` to be a primitive type in the JSON string but got " + data['quote_id']);
|
|
122
|
+
}
|
|
123
|
+
// ensure the json data is a string
|
|
123
124
|
if (data['pay_amount'] && !(typeof data['pay_amount'] === 'string' || data['pay_amount'] instanceof String)) {
|
|
124
125
|
throw new Error("Expected the field `pay_amount` to be a primitive type in the JSON string but got " + data['pay_amount']);
|
|
125
126
|
}
|
|
@@ -132,20 +133,12 @@ var SwapQuote = /*#__PURE__*/function () {
|
|
|
132
133
|
throw new Error("Expected the field `fee_amount` to be a primitive type in the JSON string but got " + data['fee_amount']);
|
|
133
134
|
}
|
|
134
135
|
// ensure the json data is a string
|
|
135
|
-
if (data['min_pay_amount'] && !(typeof data['min_pay_amount'] === 'string' || data['min_pay_amount'] instanceof String)) {
|
|
136
|
-
throw new Error("Expected the field `min_pay_amount` to be a primitive type in the JSON string but got " + data['min_pay_amount']);
|
|
137
|
-
}
|
|
138
|
-
// ensure the json data is a string
|
|
139
|
-
if (data['max_pay_amount'] && !(typeof data['max_pay_amount'] === 'string' || data['max_pay_amount'] instanceof String)) {
|
|
140
|
-
throw new Error("Expected the field `max_pay_amount` to be a primitive type in the JSON string but got " + data['max_pay_amount']);
|
|
141
|
-
}
|
|
142
|
-
// ensure the json data is a string
|
|
143
136
|
if (data['min_receive_amount'] && !(typeof data['min_receive_amount'] === 'string' || data['min_receive_amount'] instanceof String)) {
|
|
144
137
|
throw new Error("Expected the field `min_receive_amount` to be a primitive type in the JSON string but got " + data['min_receive_amount']);
|
|
145
138
|
}
|
|
146
139
|
// ensure the json data is a string
|
|
147
|
-
if (data['
|
|
148
|
-
throw new Error("Expected the field `
|
|
140
|
+
if (data['max_pay_amount'] && !(typeof data['max_pay_amount'] === 'string' || data['max_pay_amount'] instanceof String)) {
|
|
141
|
+
throw new Error("Expected the field `max_pay_amount` to be a primitive type in the JSON string but got " + data['max_pay_amount']);
|
|
149
142
|
}
|
|
150
143
|
return true;
|
|
151
144
|
}
|
|
@@ -153,6 +146,12 @@ var SwapQuote = /*#__PURE__*/function () {
|
|
|
153
146
|
}();
|
|
154
147
|
SwapQuote.RequiredProperties = ["pay_amount", "receive_amount", "fee_amount", "quote_expired_timestamp"];
|
|
155
148
|
|
|
149
|
+
/**
|
|
150
|
+
* The unique id of quote.
|
|
151
|
+
* @member {String} quote_id
|
|
152
|
+
*/
|
|
153
|
+
SwapQuote.prototype['quote_id'] = undefined;
|
|
154
|
+
|
|
156
155
|
/**
|
|
157
156
|
* The amount of tokens to pay.
|
|
158
157
|
* @member {String} pay_amount
|
|
@@ -172,28 +171,16 @@ SwapQuote.prototype['receive_amount'] = undefined;
|
|
|
172
171
|
SwapQuote.prototype['fee_amount'] = undefined;
|
|
173
172
|
|
|
174
173
|
/**
|
|
175
|
-
* The minimum amount of tokens to pay.
|
|
176
|
-
* @member {String} min_pay_amount
|
|
177
|
-
*/
|
|
178
|
-
SwapQuote.prototype['min_pay_amount'] = undefined;
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* The maximum amount of tokens to pay.
|
|
182
|
-
* @member {String} max_pay_amount
|
|
183
|
-
*/
|
|
184
|
-
SwapQuote.prototype['max_pay_amount'] = undefined;
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* The minimum amount of tokens to receive.
|
|
174
|
+
* The minimum amount of tokens to receive if the pay amount is specified.
|
|
188
175
|
* @member {String} min_receive_amount
|
|
189
176
|
*/
|
|
190
177
|
SwapQuote.prototype['min_receive_amount'] = undefined;
|
|
191
178
|
|
|
192
179
|
/**
|
|
193
|
-
* The maximum amount of tokens to receive.
|
|
194
|
-
* @member {String}
|
|
180
|
+
* The maximum amount of tokens to pay if the receive amount is specified.
|
|
181
|
+
* @member {String} max_pay_amount
|
|
195
182
|
*/
|
|
196
|
-
SwapQuote.prototype['
|
|
183
|
+
SwapQuote.prototype['max_pay_amount'] = undefined;
|
|
197
184
|
|
|
198
185
|
/**
|
|
199
186
|
* The time when the quote will expire, in Unix timestamp format, measured in milliseconds.
|
|
@@ -25,20 +25,20 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
25
25
|
*
|
|
26
26
|
*/
|
|
27
27
|
/**
|
|
28
|
-
* The
|
|
29
|
-
* @module model/
|
|
28
|
+
* The SwapToken model module.
|
|
29
|
+
* @module model/SwapToken
|
|
30
30
|
*/
|
|
31
|
-
var
|
|
31
|
+
var SwapToken = /*#__PURE__*/function () {
|
|
32
32
|
/**
|
|
33
|
-
* Constructs a new <code>
|
|
34
|
-
* @alias module:model/
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
33
|
+
* Constructs a new <code>SwapToken</code>.
|
|
34
|
+
* @alias module:model/SwapToken
|
|
35
|
+
* @param token_id {String} The token id.
|
|
36
|
+
* @param chain_id {String} The chain id.
|
|
37
|
+
* @param asset_id {String} The asset id.
|
|
38
38
|
*/
|
|
39
|
-
function
|
|
40
|
-
_classCallCheck(this,
|
|
41
|
-
|
|
39
|
+
function SwapToken(token_id, chain_id, asset_id) {
|
|
40
|
+
_classCallCheck(this, SwapToken);
|
|
41
|
+
SwapToken.initialize(this, token_id, chain_id, asset_id);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
@@ -46,55 +46,58 @@ var CreateSwapQuoteRequest = /*#__PURE__*/function () {
|
|
|
46
46
|
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
47
47
|
* Only for internal use.
|
|
48
48
|
*/
|
|
49
|
-
return _createClass(
|
|
49
|
+
return _createClass(SwapToken, null, [{
|
|
50
50
|
key: "initialize",
|
|
51
|
-
value: function initialize(obj,
|
|
52
|
-
obj['
|
|
53
|
-
obj['
|
|
54
|
-
obj['
|
|
51
|
+
value: function initialize(obj, token_id, chain_id, asset_id) {
|
|
52
|
+
obj['token_id'] = token_id;
|
|
53
|
+
obj['chain_id'] = chain_id;
|
|
54
|
+
obj['asset_id'] = asset_id;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* Constructs a <code>
|
|
58
|
+
* Constructs a <code>SwapToken</code> from a plain JavaScript object, optionally creating a new instance.
|
|
59
59
|
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
60
60
|
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
61
|
-
* @param {module:model/
|
|
62
|
-
* @return {module:model/
|
|
61
|
+
* @param {module:model/SwapToken} obj Optional instance to populate.
|
|
62
|
+
* @return {module:model/SwapToken} The populated <code>SwapToken</code> instance.
|
|
63
63
|
*/
|
|
64
64
|
}, {
|
|
65
65
|
key: "constructFromObject",
|
|
66
66
|
value: function constructFromObject(data, obj) {
|
|
67
67
|
if (data) {
|
|
68
|
-
obj = obj || new
|
|
69
|
-
if (data.hasOwnProperty('
|
|
70
|
-
obj['
|
|
68
|
+
obj = obj || new SwapToken();
|
|
69
|
+
if (data.hasOwnProperty('token_id')) {
|
|
70
|
+
obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
|
|
71
71
|
}
|
|
72
|
-
if (data.hasOwnProperty('
|
|
73
|
-
obj['
|
|
72
|
+
if (data.hasOwnProperty('chain_id')) {
|
|
73
|
+
obj['chain_id'] = _ApiClient["default"].convertToType(data['chain_id'], 'String');
|
|
74
74
|
}
|
|
75
|
-
if (data.hasOwnProperty('
|
|
76
|
-
obj['
|
|
75
|
+
if (data.hasOwnProperty('asset_id')) {
|
|
76
|
+
obj['asset_id'] = _ApiClient["default"].convertToType(data['asset_id'], 'String');
|
|
77
77
|
}
|
|
78
|
-
if (data.hasOwnProperty('
|
|
79
|
-
obj['
|
|
78
|
+
if (data.hasOwnProperty('token_address')) {
|
|
79
|
+
obj['token_address'] = _ApiClient["default"].convertToType(data['token_address'], 'String');
|
|
80
80
|
}
|
|
81
|
-
if (data.hasOwnProperty('
|
|
82
|
-
obj['
|
|
81
|
+
if (data.hasOwnProperty('min_amount')) {
|
|
82
|
+
obj['min_amount'] = _ApiClient["default"].convertToType(data['min_amount'], 'String');
|
|
83
|
+
}
|
|
84
|
+
if (data.hasOwnProperty('max_amount')) {
|
|
85
|
+
obj['max_amount'] = _ApiClient["default"].convertToType(data['max_amount'], 'String');
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
return obj;
|
|
86
89
|
}
|
|
87
90
|
|
|
88
91
|
/**
|
|
89
|
-
* Validates the JSON data with respect to <code>
|
|
92
|
+
* Validates the JSON data with respect to <code>SwapToken</code>.
|
|
90
93
|
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
91
|
-
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>
|
|
94
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>SwapToken</code>.
|
|
92
95
|
*/
|
|
93
96
|
}, {
|
|
94
97
|
key: "validateJSON",
|
|
95
98
|
value: function validateJSON(data) {
|
|
96
99
|
// check to make sure all required properties are present in the JSON string
|
|
97
|
-
var _iterator = _createForOfIteratorHelper(
|
|
100
|
+
var _iterator = _createForOfIteratorHelper(SwapToken.RequiredProperties),
|
|
98
101
|
_step;
|
|
99
102
|
try {
|
|
100
103
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -109,58 +112,68 @@ var CreateSwapQuoteRequest = /*#__PURE__*/function () {
|
|
|
109
112
|
} finally {
|
|
110
113
|
_iterator.f();
|
|
111
114
|
}
|
|
112
|
-
if (data['
|
|
113
|
-
throw new Error("Expected the field `
|
|
115
|
+
if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
|
|
116
|
+
throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
|
|
117
|
+
}
|
|
118
|
+
// ensure the json data is a string
|
|
119
|
+
if (data['chain_id'] && !(typeof data['chain_id'] === 'string' || data['chain_id'] instanceof String)) {
|
|
120
|
+
throw new Error("Expected the field `chain_id` to be a primitive type in the JSON string but got " + data['chain_id']);
|
|
114
121
|
}
|
|
115
122
|
// ensure the json data is a string
|
|
116
|
-
if (data['
|
|
117
|
-
throw new Error("Expected the field `
|
|
123
|
+
if (data['asset_id'] && !(typeof data['asset_id'] === 'string' || data['asset_id'] instanceof String)) {
|
|
124
|
+
throw new Error("Expected the field `asset_id` to be a primitive type in the JSON string but got " + data['asset_id']);
|
|
118
125
|
}
|
|
119
126
|
// ensure the json data is a string
|
|
120
|
-
if (data['
|
|
121
|
-
throw new Error("Expected the field `
|
|
127
|
+
if (data['token_address'] && !(typeof data['token_address'] === 'string' || data['token_address'] instanceof String)) {
|
|
128
|
+
throw new Error("Expected the field `token_address` to be a primitive type in the JSON string but got " + data['token_address']);
|
|
122
129
|
}
|
|
123
130
|
// ensure the json data is a string
|
|
124
|
-
if (data['
|
|
125
|
-
throw new Error("Expected the field `
|
|
131
|
+
if (data['min_amount'] && !(typeof data['min_amount'] === 'string' || data['min_amount'] instanceof String)) {
|
|
132
|
+
throw new Error("Expected the field `min_amount` to be a primitive type in the JSON string but got " + data['min_amount']);
|
|
126
133
|
}
|
|
127
134
|
// ensure the json data is a string
|
|
128
|
-
if (data['
|
|
129
|
-
throw new Error("Expected the field `
|
|
135
|
+
if (data['max_amount'] && !(typeof data['max_amount'] === 'string' || data['max_amount'] instanceof String)) {
|
|
136
|
+
throw new Error("Expected the field `max_amount` to be a primitive type in the JSON string but got " + data['max_amount']);
|
|
130
137
|
}
|
|
131
138
|
return true;
|
|
132
139
|
}
|
|
133
140
|
}]);
|
|
134
141
|
}();
|
|
135
|
-
|
|
142
|
+
SwapToken.RequiredProperties = ["token_id", "chain_id", "asset_id"];
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The token id.
|
|
146
|
+
* @member {String} token_id
|
|
147
|
+
*/
|
|
148
|
+
SwapToken.prototype['token_id'] = undefined;
|
|
136
149
|
|
|
137
150
|
/**
|
|
138
|
-
* The
|
|
139
|
-
* @member {String}
|
|
151
|
+
* The chain id.
|
|
152
|
+
* @member {String} chain_id
|
|
140
153
|
*/
|
|
141
|
-
|
|
154
|
+
SwapToken.prototype['chain_id'] = undefined;
|
|
142
155
|
|
|
143
156
|
/**
|
|
144
|
-
*
|
|
145
|
-
* @member {String}
|
|
157
|
+
* The asset id.
|
|
158
|
+
* @member {String} asset_id
|
|
146
159
|
*/
|
|
147
|
-
|
|
160
|
+
SwapToken.prototype['asset_id'] = undefined;
|
|
148
161
|
|
|
149
162
|
/**
|
|
150
|
-
*
|
|
151
|
-
* @member {String}
|
|
163
|
+
* The token address.
|
|
164
|
+
* @member {String} token_address
|
|
152
165
|
*/
|
|
153
|
-
|
|
166
|
+
SwapToken.prototype['token_address'] = undefined;
|
|
154
167
|
|
|
155
168
|
/**
|
|
156
|
-
*
|
|
157
|
-
* @member {String}
|
|
169
|
+
* The minimum amount to swap.
|
|
170
|
+
* @member {String} min_amount
|
|
158
171
|
*/
|
|
159
|
-
|
|
172
|
+
SwapToken.prototype['min_amount'] = undefined;
|
|
160
173
|
|
|
161
174
|
/**
|
|
162
|
-
*
|
|
163
|
-
* @member {String}
|
|
175
|
+
* The maximum amount to swap.
|
|
176
|
+
* @member {String} max_amount
|
|
164
177
|
*/
|
|
165
|
-
|
|
166
|
-
var _default = exports["default"] =
|
|
178
|
+
SwapToken.prototype['max_amount'] = undefined;
|
|
179
|
+
var _default = exports["default"] = SwapToken;
|
|
@@ -39,7 +39,7 @@ var TSSRequestWebhookEventData = /*#__PURE__*/function () {
|
|
|
39
39
|
* @alias module:model/TSSRequestWebhookEventData
|
|
40
40
|
* @implements module:model/WebhookEventDataType
|
|
41
41
|
* @implements module:model/TSSRequest
|
|
42
|
-
* @param data_type {module:model/TSSRequestWebhookEventData.DataTypeEnum} The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data.
|
|
42
|
+
* @param data_type {module:model/TSSRequestWebhookEventData.DataTypeEnum} The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data.
|
|
43
43
|
*/
|
|
44
44
|
function TSSRequestWebhookEventData(data_type) {
|
|
45
45
|
_classCallCheck(this, TSSRequestWebhookEventData);
|
|
@@ -154,7 +154,7 @@ var TSSRequestWebhookEventData = /*#__PURE__*/function () {
|
|
|
154
154
|
TSSRequestWebhookEventData.RequiredProperties = ["data_type"];
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
|
-
* The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data.
|
|
157
|
+
* The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data.
|
|
158
158
|
* @member {module:model/TSSRequestWebhookEventData.DataTypeEnum} data_type
|
|
159
159
|
*/
|
|
160
160
|
TSSRequestWebhookEventData.prototype['data_type'] = undefined;
|
|
@@ -200,7 +200,7 @@ TSSRequestWebhookEventData.prototype['created_timestamp'] = undefined;
|
|
|
200
200
|
|
|
201
201
|
// Implement WebhookEventDataType interface:
|
|
202
202
|
/**
|
|
203
|
-
* The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data.
|
|
203
|
+
* The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. - `Addresses`: The addresses event data. - `WalletInfo`: The wallet information event data. - `MPCVault`: The MPC vault event data. - `Chains`: The enabled chain event data. - `Tokens`: The enabled token event data. - `TokenListing`: The token listing event data.
|
|
204
204
|
* @member {module:model/WebhookEventDataType.DataTypeEnum} data_type
|
|
205
205
|
*/
|
|
206
206
|
_WebhookEventDataType["default"].prototype['data_type'] = undefined;
|
|
@@ -279,6 +279,11 @@ TSSRequestWebhookEventData['DataTypeEnum'] = {
|
|
|
279
279
|
* @const
|
|
280
280
|
*/
|
|
281
281
|
"Tokens": "Tokens",
|
|
282
|
+
/**
|
|
283
|
+
* value: "TokenListing"
|
|
284
|
+
* @const
|
|
285
|
+
*/
|
|
286
|
+
"TokenListing": "TokenListing",
|
|
282
287
|
/**
|
|
283
288
|
* value: "unknown_default_open_api"
|
|
284
289
|
* @const
|