@cobo/cobo-waas2 1.16.0 → 1.18.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 +46 -6
- package/dist/ApiClient.js +1 -1
- package/dist/PreRequestScript.js +27 -33
- package/dist/api/AppWorkflowsApi.js +22 -22
- package/dist/api/FeeStationApi.js +2 -2
- package/dist/api/OAuthApi.js +93 -6
- package/dist/api/OrganizationsApi.js +79 -0
- package/dist/api/PaymentApi.js +265 -55
- package/dist/api/TransactionsApi.js +2 -2
- package/dist/api/WalletsApi.js +11 -8
- package/dist/index.js +252 -14
- package/dist/model/Account.js +174 -0
- package/dist/model/AcquiringType.js +61 -0
- package/dist/model/AddressTransferDestination.js +2 -2
- package/dist/model/AddressesEventData.js +8 -3
- package/dist/model/AppWorkflow.js +7 -7
- package/dist/model/AppWorkflowField.js +5 -5
- package/dist/model/AppWorkflowPolicy.js +1 -1
- package/dist/model/ApprovalEntry.js +1 -1
- package/dist/model/ApprovalRequest.js +5 -3
- package/dist/model/ApprovalRequestDetail.js +2 -1
- package/dist/model/ApprovalUser.js +4 -4
- package/dist/model/BalanceUpdateInfo.js +170 -0
- package/dist/model/BalanceUpdateInfoEventData.js +297 -0
- package/dist/model/BankAccount.js +2 -2
- package/dist/model/ChainInfo.js +1 -1
- package/dist/model/ChainsEventData.js +8 -3
- package/dist/model/CreateApprovalRequest201Response.js +2 -1
- package/dist/model/CreateMerchantRequest.js +13 -0
- package/dist/model/CreatePaymentOrderRequest.js +14 -5
- package/dist/model/CreateRefundRequest.js +41 -8
- package/dist/model/CreateSettlement.js +28 -12
- package/dist/model/CreateSettlementRequestRequest.js +27 -0
- package/dist/model/CryptoAddress.js +171 -0
- package/dist/model/CustodialTransferDestination.js +137 -0
- package/dist/model/EstimateContractCallFeeParams.js +2 -2
- package/dist/model/EstimateFeeParams.js +1 -1
- package/dist/model/EstimatedFILFee.js +170 -0
- package/dist/model/EstimatedFILFeeSlow.js +186 -0
- package/dist/model/EstimatedFee.js +68 -12
- package/dist/model/EstimatedSOLFee.js +170 -0
- package/dist/model/EstimatedSOLFeeSlow.js +184 -0
- package/dist/model/ExchangePermissionToken201Response.js +122 -0
- package/dist/model/{CreateBankAccountRequest.js → ExchangePermissionTokenRequest.js} +30 -28
- package/dist/model/FILBase.js +88 -0
- package/dist/model/FILPrice.js +114 -0
- package/dist/model/FeeType.js +10 -0
- package/dist/model/GetExchangeRate200Response.js +2 -2
- package/dist/model/GraphQLError.js +135 -0
- package/dist/model/GraphQLErrorLocationsInner.js +92 -0
- package/dist/model/{TransactionMessageSignBTCEIP191Destination.js → GraphQLRequest.js} +49 -36
- package/dist/model/GraphQLResponse.js +119 -0
- package/dist/model/ListTopUpPayers200Response.js +123 -0
- package/dist/model/ListTopUpPayers200ResponseDataInner.js +189 -0
- package/dist/model/MPCVaultEventData.js +8 -3
- package/dist/model/Merchant.js +15 -2
- package/dist/model/Order.js +16 -7
- package/dist/model/PayerAccount.js +189 -0
- package/dist/model/PaymentOrderEventData.js +33 -15
- package/dist/model/PaymentRefundEventData.js +66 -11
- package/dist/model/PaymentSettlementEvent.js +14 -9
- package/dist/model/PayoutChannel.js +61 -0
- package/dist/model/PolicyAction.js +1 -1
- package/dist/model/PolicyActionContent.js +6 -4
- package/dist/model/PolicyCondition.js +5 -5
- package/dist/model/RefreshPermissionTokenRequest.js +110 -0
- package/dist/model/Refund.js +39 -4
- package/dist/model/RefundStatus.js +5 -0
- package/dist/model/RequestApproval.js +9 -9
- package/dist/model/RevokeApprovalRequest201Response.js +2 -1
- package/dist/model/RevokeApprovalRequestRequest.js +2 -2
- package/dist/model/SOLBase.js +101 -0
- package/dist/model/SOLComputeUnit.js +101 -0
- package/dist/model/Settlement.js +3 -3
- package/dist/model/SettlementDetail.js +24 -6
- package/dist/model/SettlementInfo.js +11 -2
- package/dist/model/SupportedToken.js +222 -0
- package/dist/model/SwapActivityDetail.js +30 -0
- package/dist/model/SwapActivitySigners.js +110 -0
- package/dist/model/SwapQuote.js +17 -4
- package/dist/model/SwapSingingStatus.js +71 -0
- package/dist/model/TSSRequestWebhookEventData.js +8 -3
- package/dist/model/TokenListingEventData.js +8 -3
- package/dist/model/TokensEventData.js +8 -3
- package/dist/model/TopUpAddress.js +230 -0
- package/dist/model/TransactionCoboCategory.js +20 -0
- package/dist/model/TransactionDestination.js +14 -38
- package/dist/model/TransactionDestinationType.js +5 -0
- package/dist/model/TransactionEvmCalldataInfo.js +1 -1
- package/dist/model/TransactionFILFee.js +229 -0
- package/dist/model/TransactionFee.js +107 -9
- package/dist/model/TransactionRequestFILFee.js +186 -0
- package/dist/model/TransactionRequestFee.js +89 -9
- package/dist/model/TransactionRequestSOLFee.js +168 -0
- package/dist/model/TransactionSOLFee.js +229 -0
- package/dist/model/TransactionTransferToAddressDestination.js +2 -2
- package/dist/model/TransactionTransferToWalletDestination.js +2 -2
- package/dist/model/TransactionWebhookEventData.js +8 -3
- package/dist/model/TransferDestination.js +44 -16
- package/dist/model/TransferDestinationType.js +5 -0
- package/dist/model/UpdateMerchantByIdRequest.js +13 -0
- package/dist/model/UpdateRefundByIdRequest.js +110 -0
- package/dist/model/UpdateTopUpAddress.js +141 -0
- package/dist/model/WalletInfoEventData.js +8 -3
- package/dist/model/WebhookEvent.js +2 -2
- package/dist/model/WebhookEventData.js +83 -13
- package/dist/model/WebhookEventDataType.js +7 -2
- package/dist/model/WebhookEventLog.js +2 -2
- package/dist/model/WebhookEventType.js +15 -0
- package/docs/Account.md +14 -0
- package/docs/AcquiringType.md +12 -0
- package/docs/AddressTransferDestination.md +2 -2
- package/docs/AddressesEventData.md +3 -1
- package/docs/AppWorkflow.md +3 -3
- package/docs/AppWorkflowField.md +2 -2
- package/docs/AppWorkflowsApi.md +12 -12
- package/docs/ApprovalRequest.md +2 -2
- package/docs/ApprovalRequestDetail.md +1 -1
- package/docs/ApprovalUser.md +2 -2
- package/docs/BalanceUpdateInfo.md +13 -0
- package/docs/BalanceUpdateInfoEventData.md +47 -0
- package/docs/BankAccount.md +2 -2
- package/docs/ChainInfo.md +1 -1
- package/docs/ChainsEventData.md +3 -1
- package/docs/CreateApprovalRequest201Response.md +1 -1
- package/docs/CreateMerchantRequest.md +1 -0
- package/docs/CreatePaymentOrderRequest.md +2 -1
- package/docs/CreateRefundRequest.md +5 -2
- package/docs/CreateSettlement.md +7 -6
- package/docs/CreateSettlementRequestRequest.md +3 -0
- package/docs/CryptoAddress.md +14 -0
- package/docs/CustodialTransferDestination.md +11 -0
- package/docs/EstimateContractCallFeeParams.md +1 -1
- package/docs/EstimateFeeParams.md +1 -1
- package/docs/EstimatedFILFee.md +13 -0
- package/docs/EstimatedFILFeeSlow.md +12 -0
- package/docs/EstimatedFee.md +3 -3
- package/docs/EstimatedSOLFee.md +13 -0
- package/docs/EstimatedSOLFeeSlow.md +12 -0
- package/docs/ExchangePermissionToken201Response.md +12 -0
- package/docs/ExchangePermissionTokenRequest.md +9 -0
- package/docs/FILBase.md +9 -0
- package/docs/FILPrice.md +11 -0
- package/docs/FeeStationApi.md +1 -1
- package/docs/FeeType.md +4 -0
- package/docs/GetExchangeRate200Response.md +1 -1
- package/docs/GraphQLError.md +11 -0
- package/docs/GraphQLErrorLocationsInner.md +10 -0
- package/docs/GraphQLRequest.md +11 -0
- package/docs/GraphQLResponse.md +10 -0
- package/docs/ListTopUpPayers200Response.md +10 -0
- package/docs/ListTopUpPayers200ResponseDataInner.md +14 -0
- package/docs/MPCVaultEventData.md +3 -1
- package/docs/Merchant.md +3 -2
- package/docs/OAuthApi.md +102 -0
- package/docs/Order.md +6 -5
- package/docs/OrganizationsApi.md +55 -0
- package/docs/PayerAccount.md +14 -0
- package/docs/PaymentApi.md +247 -29
- package/docs/PaymentOrderEventData.md +9 -6
- package/docs/PaymentRefundEventData.md +10 -5
- package/docs/PaymentSettlementEvent.md +6 -4
- package/docs/PayoutChannel.md +12 -0
- package/docs/PolicyActionContent.md +4 -4
- package/docs/PolicyCondition.md +2 -2
- package/docs/RefreshPermissionTokenRequest.md +9 -0
- package/docs/Refund.md +7 -4
- package/docs/RefundStatus.md +2 -0
- package/docs/RequestApproval.md +4 -4
- package/docs/RevokeApprovalRequest201Response.md +1 -1
- package/docs/RevokeApprovalRequestRequest.md +1 -1
- package/docs/SOLBase.md +10 -0
- package/docs/SOLComputeUnit.md +10 -0
- package/docs/Settlement.md +3 -3
- package/docs/SettlementDetail.md +8 -6
- package/docs/SettlementInfo.md +3 -2
- package/docs/SupportedToken.md +17 -0
- package/docs/SwapActivityDetail.md +1 -0
- package/docs/SwapActivitySigners.md +11 -0
- package/docs/SwapQuote.md +3 -2
- package/docs/SwapSingingStatus.md +16 -0
- package/docs/TSSRequestWebhookEventData.md +3 -1
- package/docs/TokenListingEventData.md +3 -1
- package/docs/TokensEventData.md +3 -1
- package/docs/TopUpAddress.md +18 -0
- package/docs/TransactionCoboCategory.md +8 -0
- package/docs/TransactionDestination.md +2 -2
- package/docs/TransactionDestinationType.md +2 -0
- package/docs/TransactionEvmCalldataInfo.md +1 -1
- package/docs/TransactionFILFee.md +16 -0
- package/docs/TransactionFee.md +8 -1
- package/docs/TransactionRequestFILFee.md +13 -0
- package/docs/TransactionRequestFee.md +5 -1
- package/docs/TransactionRequestSOLFee.md +12 -0
- package/docs/TransactionSOLFee.md +16 -0
- package/docs/TransactionTransferToAddressDestination.md +2 -2
- package/docs/TransactionTransferToWalletDestination.md +1 -1
- package/docs/TransactionWebhookEventData.md +3 -1
- package/docs/TransactionsApi.md +1 -1
- package/docs/TransferDestination.md +3 -3
- package/docs/TransferDestinationType.md +2 -0
- package/docs/UpdateMerchantByIdRequest.md +1 -0
- package/docs/UpdateRefundByIdRequest.md +9 -0
- package/docs/UpdateTopUpAddress.md +11 -0
- package/docs/WalletInfoEventData.md +3 -1
- package/docs/WalletsApi.md +6 -4
- package/docs/WebhookEvent.md +1 -1
- package/docs/WebhookEventData.md +14 -5
- package/docs/WebhookEventDataType.md +3 -1
- package/docs/WebhookEventLog.md +1 -1
- package/docs/WebhookEventType.md +6 -0
- package/package.json +1 -1
- package/docs/CreateBankAccountRequest.md +0 -9
- package/docs/TransactionMessageSignBTCEIP191Destination.md +0 -10
|
@@ -5,7 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _AcquiringType = _interopRequireDefault(require("./AcquiringType"));
|
|
8
9
|
var _CreateSettlement = _interopRequireDefault(require("./CreateSettlement"));
|
|
10
|
+
var _PayoutChannel = _interopRequireDefault(require("./PayoutChannel"));
|
|
11
|
+
var _SettlementType = _interopRequireDefault(require("./SettlementType"));
|
|
9
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
13
|
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
14
|
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; } } }; }
|
|
@@ -68,6 +71,15 @@ var CreateSettlementRequestRequest = /*#__PURE__*/function () {
|
|
|
68
71
|
if (data.hasOwnProperty('request_id')) {
|
|
69
72
|
obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
|
|
70
73
|
}
|
|
74
|
+
if (data.hasOwnProperty('acquiring_type')) {
|
|
75
|
+
obj['acquiring_type'] = _AcquiringType["default"].constructFromObject(data['acquiring_type']);
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('payout_channel')) {
|
|
78
|
+
obj['payout_channel'] = _PayoutChannel["default"].constructFromObject(data['payout_channel']);
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('settlement_type')) {
|
|
81
|
+
obj['settlement_type'] = _SettlementType["default"].constructFromObject(data['settlement_type']);
|
|
82
|
+
}
|
|
71
83
|
if (data.hasOwnProperty('settlements')) {
|
|
72
84
|
obj['settlements'] = _ApiClient["default"].convertToType(data['settlements'], [_CreateSettlement["default"]]);
|
|
73
85
|
}
|
|
@@ -135,6 +147,21 @@ CreateSettlementRequestRequest.RequiredProperties = ["request_id", "settlements"
|
|
|
135
147
|
*/
|
|
136
148
|
CreateSettlementRequestRequest.prototype['request_id'] = undefined;
|
|
137
149
|
|
|
150
|
+
/**
|
|
151
|
+
* @member {module:model/AcquiringType} acquiring_type
|
|
152
|
+
*/
|
|
153
|
+
CreateSettlementRequestRequest.prototype['acquiring_type'] = undefined;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @member {module:model/PayoutChannel} payout_channel
|
|
157
|
+
*/
|
|
158
|
+
CreateSettlementRequestRequest.prototype['payout_channel'] = undefined;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @member {module:model/SettlementType} settlement_type
|
|
162
|
+
*/
|
|
163
|
+
CreateSettlementRequestRequest.prototype['settlement_type'] = undefined;
|
|
164
|
+
|
|
138
165
|
/**
|
|
139
166
|
* @member {Array.<module:model/CreateSettlement>} settlements
|
|
140
167
|
*/
|
|
@@ -0,0 +1,171 @@
|
|
|
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 CryptoAddress model module.
|
|
29
|
+
* @module model/CryptoAddress
|
|
30
|
+
*/
|
|
31
|
+
var CryptoAddress = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>CryptoAddress</code>.
|
|
34
|
+
* @alias module:model/CryptoAddress
|
|
35
|
+
* @param token_id {String} The token identifier (e.g., ETH_USDT, TRON_USDT) that this address is associated with.
|
|
36
|
+
* @param address_id {String} A unique identifier for this crypto address, automatically generated by Cobo. Use this ID (not the raw blockchain address) when submitting a settlement request.
|
|
37
|
+
* @param address {String} The blockchain address in its native format. This is the actual destination address where funds will be sent. Note: When submitting a settlement request, use the address ID rather than this raw address.
|
|
38
|
+
*/
|
|
39
|
+
function CryptoAddress(token_id, address_id, address) {
|
|
40
|
+
_classCallCheck(this, CryptoAddress);
|
|
41
|
+
CryptoAddress.initialize(this, token_id, address_id, address);
|
|
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(CryptoAddress, null, [{
|
|
50
|
+
key: "initialize",
|
|
51
|
+
value: function initialize(obj, token_id, address_id, address) {
|
|
52
|
+
obj['token_id'] = token_id;
|
|
53
|
+
obj['address_id'] = address_id;
|
|
54
|
+
obj['address'] = address;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Constructs a <code>CryptoAddress</code> from a plain JavaScript object, optionally creating a new instance.
|
|
59
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
60
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
61
|
+
* @param {module:model/CryptoAddress} obj Optional instance to populate.
|
|
62
|
+
* @return {module:model/CryptoAddress} The populated <code>CryptoAddress</code> instance.
|
|
63
|
+
*/
|
|
64
|
+
}, {
|
|
65
|
+
key: "constructFromObject",
|
|
66
|
+
value: function constructFromObject(data, obj) {
|
|
67
|
+
if (data) {
|
|
68
|
+
obj = obj || new CryptoAddress();
|
|
69
|
+
if (data.hasOwnProperty('token_id')) {
|
|
70
|
+
obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('address_id')) {
|
|
73
|
+
obj['address_id'] = _ApiClient["default"].convertToType(data['address_id'], 'String');
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('address')) {
|
|
76
|
+
obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
|
|
77
|
+
}
|
|
78
|
+
if (data.hasOwnProperty('label')) {
|
|
79
|
+
obj['label'] = _ApiClient["default"].convertToType(data['label'], 'String');
|
|
80
|
+
}
|
|
81
|
+
if (data.hasOwnProperty('created_timestamp')) {
|
|
82
|
+
obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
|
|
83
|
+
}
|
|
84
|
+
if (data.hasOwnProperty('updated_timestamp')) {
|
|
85
|
+
obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return obj;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Validates the JSON data with respect to <code>CryptoAddress</code>.
|
|
93
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
94
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CryptoAddress</code>.
|
|
95
|
+
*/
|
|
96
|
+
}, {
|
|
97
|
+
key: "validateJSON",
|
|
98
|
+
value: function validateJSON(data) {
|
|
99
|
+
// check to make sure all required properties are present in the JSON string
|
|
100
|
+
var _iterator = _createForOfIteratorHelper(CryptoAddress.RequiredProperties),
|
|
101
|
+
_step;
|
|
102
|
+
try {
|
|
103
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
104
|
+
var property = _step.value;
|
|
105
|
+
if (!data.hasOwnProperty(property)) {
|
|
106
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// ensure the json data is a string
|
|
110
|
+
} catch (err) {
|
|
111
|
+
_iterator.e(err);
|
|
112
|
+
} finally {
|
|
113
|
+
_iterator.f();
|
|
114
|
+
}
|
|
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['address_id'] && !(typeof data['address_id'] === 'string' || data['address_id'] instanceof String)) {
|
|
120
|
+
throw new Error("Expected the field `address_id` to be a primitive type in the JSON string but got " + data['address_id']);
|
|
121
|
+
}
|
|
122
|
+
// ensure the json data is a string
|
|
123
|
+
if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
|
|
124
|
+
throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
|
|
125
|
+
}
|
|
126
|
+
// ensure the json data is a string
|
|
127
|
+
if (data['label'] && !(typeof data['label'] === 'string' || data['label'] instanceof String)) {
|
|
128
|
+
throw new Error("Expected the field `label` to be a primitive type in the JSON string but got " + data['label']);
|
|
129
|
+
}
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
}]);
|
|
133
|
+
}();
|
|
134
|
+
CryptoAddress.RequiredProperties = ["token_id", "address_id", "address"];
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* The token identifier (e.g., ETH_USDT, TRON_USDT) that this address is associated with.
|
|
138
|
+
* @member {String} token_id
|
|
139
|
+
*/
|
|
140
|
+
CryptoAddress.prototype['token_id'] = undefined;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* A unique identifier for this crypto address, automatically generated by Cobo. Use this ID (not the raw blockchain address) when submitting a settlement request.
|
|
144
|
+
* @member {String} address_id
|
|
145
|
+
*/
|
|
146
|
+
CryptoAddress.prototype['address_id'] = undefined;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The blockchain address in its native format. This is the actual destination address where funds will be sent. Note: When submitting a settlement request, use the address ID rather than this raw address.
|
|
150
|
+
* @member {String} address
|
|
151
|
+
*/
|
|
152
|
+
CryptoAddress.prototype['address'] = undefined;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* A label to help identify the address's purpose.
|
|
156
|
+
* @member {String} label
|
|
157
|
+
*/
|
|
158
|
+
CryptoAddress.prototype['label'] = undefined;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The creation time of the crypto address, represented as a UNIX timestamp in seconds.
|
|
162
|
+
* @member {Number} created_timestamp
|
|
163
|
+
*/
|
|
164
|
+
CryptoAddress.prototype['created_timestamp'] = undefined;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The last update time of the crypto address, represented as a UNIX timestamp in seconds.
|
|
168
|
+
* @member {Number} updated_timestamp
|
|
169
|
+
*/
|
|
170
|
+
CryptoAddress.prototype['updated_timestamp'] = undefined;
|
|
171
|
+
var _default = exports["default"] = CryptoAddress;
|
|
@@ -0,0 +1,137 @@
|
|
|
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 _TransferDestinationType = _interopRequireDefault(require("./TransferDestinationType"));
|
|
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 CustodialTransferDestination model module.
|
|
30
|
+
* @module model/CustodialTransferDestination
|
|
31
|
+
*/
|
|
32
|
+
var CustodialTransferDestination = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>CustodialTransferDestination</code>.
|
|
35
|
+
* The information about the transaction destination type `CustodialWallet`. 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.
|
|
36
|
+
* @alias module:model/CustodialTransferDestination
|
|
37
|
+
* @param destination_type {module:model/TransferDestinationType}
|
|
38
|
+
* @param wallet_id {String} The wallet ID.
|
|
39
|
+
* @param amount {String} The transfer amount. For example, if you trade 1.5 BTC, then the value is `1.5`.
|
|
40
|
+
*/
|
|
41
|
+
function CustodialTransferDestination(destination_type, wallet_id, amount) {
|
|
42
|
+
_classCallCheck(this, CustodialTransferDestination);
|
|
43
|
+
CustodialTransferDestination.initialize(this, destination_type, wallet_id, amount);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Initializes the fields of this object.
|
|
48
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
49
|
+
* Only for internal use.
|
|
50
|
+
*/
|
|
51
|
+
return _createClass(CustodialTransferDestination, null, [{
|
|
52
|
+
key: "initialize",
|
|
53
|
+
value: function initialize(obj, destination_type, wallet_id, amount) {
|
|
54
|
+
obj['destination_type'] = destination_type;
|
|
55
|
+
obj['wallet_id'] = wallet_id;
|
|
56
|
+
obj['amount'] = amount;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constructs a <code>CustodialTransferDestination</code> from a plain JavaScript object, optionally creating a new instance.
|
|
61
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
62
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
63
|
+
* @param {module:model/CustodialTransferDestination} obj Optional instance to populate.
|
|
64
|
+
* @return {module:model/CustodialTransferDestination} The populated <code>CustodialTransferDestination</code> instance.
|
|
65
|
+
*/
|
|
66
|
+
}, {
|
|
67
|
+
key: "constructFromObject",
|
|
68
|
+
value: function constructFromObject(data, obj) {
|
|
69
|
+
if (data) {
|
|
70
|
+
obj = obj || new CustodialTransferDestination();
|
|
71
|
+
if (data.hasOwnProperty('destination_type')) {
|
|
72
|
+
obj['destination_type'] = _TransferDestinationType["default"].constructFromObject(data['destination_type']);
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty('wallet_id')) {
|
|
75
|
+
obj['wallet_id'] = _ApiClient["default"].convertToType(data['wallet_id'], 'String');
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('amount')) {
|
|
78
|
+
obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return obj;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Validates the JSON data with respect to <code>CustodialTransferDestination</code>.
|
|
86
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
87
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CustodialTransferDestination</code>.
|
|
88
|
+
*/
|
|
89
|
+
}, {
|
|
90
|
+
key: "validateJSON",
|
|
91
|
+
value: function validateJSON(data) {
|
|
92
|
+
// check to make sure all required properties are present in the JSON string
|
|
93
|
+
var _iterator = _createForOfIteratorHelper(CustodialTransferDestination.RequiredProperties),
|
|
94
|
+
_step;
|
|
95
|
+
try {
|
|
96
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
97
|
+
var property = _step.value;
|
|
98
|
+
if (!data.hasOwnProperty(property)) {
|
|
99
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// ensure the json data is a string
|
|
103
|
+
} catch (err) {
|
|
104
|
+
_iterator.e(err);
|
|
105
|
+
} finally {
|
|
106
|
+
_iterator.f();
|
|
107
|
+
}
|
|
108
|
+
if (data['wallet_id'] && !(typeof data['wallet_id'] === 'string' || data['wallet_id'] instanceof String)) {
|
|
109
|
+
throw new Error("Expected the field `wallet_id` to be a primitive type in the JSON string but got " + data['wallet_id']);
|
|
110
|
+
}
|
|
111
|
+
// ensure the json data is a string
|
|
112
|
+
if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
|
|
113
|
+
throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
|
|
114
|
+
}
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
}]);
|
|
118
|
+
}();
|
|
119
|
+
CustodialTransferDestination.RequiredProperties = ["destination_type", "wallet_id", "amount"];
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @member {module:model/TransferDestinationType} destination_type
|
|
123
|
+
*/
|
|
124
|
+
CustodialTransferDestination.prototype['destination_type'] = undefined;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The wallet ID.
|
|
128
|
+
* @member {String} wallet_id
|
|
129
|
+
*/
|
|
130
|
+
CustodialTransferDestination.prototype['wallet_id'] = undefined;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The transfer amount. For example, if you trade 1.5 BTC, then the value is `1.5`.
|
|
134
|
+
* @member {String} amount
|
|
135
|
+
*/
|
|
136
|
+
CustodialTransferDestination.prototype['amount'] = undefined;
|
|
137
|
+
var _default = exports["default"] = CustodialTransferDestination;
|
|
@@ -38,7 +38,7 @@ var EstimateContractCallFeeParams = /*#__PURE__*/function () {
|
|
|
38
38
|
* The information about a transaction that interacts with a smart contract
|
|
39
39
|
* @alias module:model/EstimateContractCallFeeParams
|
|
40
40
|
* @param request_type {module:model/EstimateFeeRequestType}
|
|
41
|
-
* @param chain_id {String} The chain ID of the chain on which the smart contract is
|
|
41
|
+
* @param chain_id {String} The chain ID of the chain on which the smart contract is issued. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-chains).
|
|
42
42
|
* @param source {module:model/ContractCallSource}
|
|
43
43
|
* @param destination {module:model/ContractCallDestination}
|
|
44
44
|
*/
|
|
@@ -165,7 +165,7 @@ EstimateContractCallFeeParams.prototype['request_id'] = undefined;
|
|
|
165
165
|
EstimateContractCallFeeParams.prototype['request_type'] = undefined;
|
|
166
166
|
|
|
167
167
|
/**
|
|
168
|
-
* The chain ID of the chain on which the smart contract is
|
|
168
|
+
* The chain ID of the chain on which the smart contract is issued. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-chains).
|
|
169
169
|
* @member {String} chain_id
|
|
170
170
|
*/
|
|
171
171
|
EstimateContractCallFeeParams.prototype['chain_id'] = undefined;
|
|
@@ -214,7 +214,7 @@ EstimateFeeParams.prototype['fee_type'] = undefined;
|
|
|
214
214
|
EstimateFeeParams.prototype['replaced_transaction_id'] = undefined;
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
|
-
* The chain ID of the chain on which the smart contract is
|
|
217
|
+
* The chain ID of the chain on which the smart contract is issued. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-chains).
|
|
218
218
|
* @member {String} chain_id
|
|
219
219
|
*/
|
|
220
220
|
EstimateFeeParams.prototype['chain_id'] = undefined;
|
|
@@ -0,0 +1,170 @@
|
|
|
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 _EstimatedFILFeeSlow = _interopRequireDefault(require("./EstimatedFILFeeSlow"));
|
|
9
|
+
var _FeeType = _interopRequireDefault(require("./FeeType"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
20
|
+
* Cobo Wallet as a Service 2.0
|
|
21
|
+
*
|
|
22
|
+
* Contact: help@cobo.com
|
|
23
|
+
*
|
|
24
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
25
|
+
* https://openapi-generator.tech
|
|
26
|
+
* Do not edit the class manually.
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* The EstimatedFILFee model module.
|
|
31
|
+
* @module model/EstimatedFILFee
|
|
32
|
+
*/
|
|
33
|
+
var EstimatedFILFee = /*#__PURE__*/function () {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new <code>EstimatedFILFee</code>.
|
|
36
|
+
* The estimated transaction fee based on the fil fee model.
|
|
37
|
+
* @alias module:model/EstimatedFILFee
|
|
38
|
+
* @param fee_type {module:model/FeeType}
|
|
39
|
+
* @param token_id {String} The token ID of the transaction fee.
|
|
40
|
+
* @param recommended {module:model/EstimatedFILFeeSlow}
|
|
41
|
+
*/
|
|
42
|
+
function EstimatedFILFee(fee_type, token_id, recommended) {
|
|
43
|
+
_classCallCheck(this, EstimatedFILFee);
|
|
44
|
+
EstimatedFILFee.initialize(this, fee_type, token_id, recommended);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Initializes the fields of this object.
|
|
49
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
50
|
+
* Only for internal use.
|
|
51
|
+
*/
|
|
52
|
+
return _createClass(EstimatedFILFee, null, [{
|
|
53
|
+
key: "initialize",
|
|
54
|
+
value: function initialize(obj, fee_type, token_id, recommended) {
|
|
55
|
+
obj['fee_type'] = fee_type;
|
|
56
|
+
obj['token_id'] = token_id;
|
|
57
|
+
obj['recommended'] = recommended;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Constructs a <code>EstimatedFILFee</code> from a plain JavaScript object, optionally creating a new instance.
|
|
62
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
63
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
64
|
+
* @param {module:model/EstimatedFILFee} obj Optional instance to populate.
|
|
65
|
+
* @return {module:model/EstimatedFILFee} The populated <code>EstimatedFILFee</code> instance.
|
|
66
|
+
*/
|
|
67
|
+
}, {
|
|
68
|
+
key: "constructFromObject",
|
|
69
|
+
value: function constructFromObject(data, obj) {
|
|
70
|
+
if (data) {
|
|
71
|
+
obj = obj || new EstimatedFILFee();
|
|
72
|
+
if (data.hasOwnProperty('fee_type')) {
|
|
73
|
+
obj['fee_type'] = _FeeType["default"].constructFromObject(data['fee_type']);
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('token_id')) {
|
|
76
|
+
obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
|
|
77
|
+
}
|
|
78
|
+
if (data.hasOwnProperty('slow')) {
|
|
79
|
+
obj['slow'] = _EstimatedFILFeeSlow["default"].constructFromObject(data['slow']);
|
|
80
|
+
}
|
|
81
|
+
if (data.hasOwnProperty('recommended')) {
|
|
82
|
+
obj['recommended'] = _EstimatedFILFeeSlow["default"].constructFromObject(data['recommended']);
|
|
83
|
+
}
|
|
84
|
+
if (data.hasOwnProperty('fast')) {
|
|
85
|
+
obj['fast'] = _EstimatedFILFeeSlow["default"].constructFromObject(data['fast']);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return obj;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Validates the JSON data with respect to <code>EstimatedFILFee</code>.
|
|
93
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
94
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>EstimatedFILFee</code>.
|
|
95
|
+
*/
|
|
96
|
+
}, {
|
|
97
|
+
key: "validateJSON",
|
|
98
|
+
value: function validateJSON(data) {
|
|
99
|
+
// check to make sure all required properties are present in the JSON string
|
|
100
|
+
var _iterator = _createForOfIteratorHelper(EstimatedFILFee.RequiredProperties),
|
|
101
|
+
_step;
|
|
102
|
+
try {
|
|
103
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
104
|
+
var property = _step.value;
|
|
105
|
+
if (!data.hasOwnProperty(property)) {
|
|
106
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// ensure the json data is a string
|
|
110
|
+
} catch (err) {
|
|
111
|
+
_iterator.e(err);
|
|
112
|
+
} finally {
|
|
113
|
+
_iterator.f();
|
|
114
|
+
}
|
|
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
|
+
// validate the optional field `slow`
|
|
119
|
+
if (data['slow']) {
|
|
120
|
+
// data not null
|
|
121
|
+
if (!!_EstimatedFILFeeSlow["default"].validateJSON) {
|
|
122
|
+
_EstimatedFILFeeSlow["default"].validateJSON(data['slow']);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// validate the optional field `recommended`
|
|
126
|
+
if (data['recommended']) {
|
|
127
|
+
// data not null
|
|
128
|
+
if (!!_EstimatedFILFeeSlow["default"].validateJSON) {
|
|
129
|
+
_EstimatedFILFeeSlow["default"].validateJSON(data['recommended']);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// validate the optional field `fast`
|
|
133
|
+
if (data['fast']) {
|
|
134
|
+
// data not null
|
|
135
|
+
if (!!_EstimatedFILFeeSlow["default"].validateJSON) {
|
|
136
|
+
_EstimatedFILFeeSlow["default"].validateJSON(data['fast']);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
}]);
|
|
142
|
+
}();
|
|
143
|
+
EstimatedFILFee.RequiredProperties = ["fee_type", "token_id", "recommended"];
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @member {module:model/FeeType} fee_type
|
|
147
|
+
*/
|
|
148
|
+
EstimatedFILFee.prototype['fee_type'] = undefined;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The token ID of the transaction fee.
|
|
152
|
+
* @member {String} token_id
|
|
153
|
+
*/
|
|
154
|
+
EstimatedFILFee.prototype['token_id'] = undefined;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @member {module:model/EstimatedFILFeeSlow} slow
|
|
158
|
+
*/
|
|
159
|
+
EstimatedFILFee.prototype['slow'] = undefined;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @member {module:model/EstimatedFILFeeSlow} recommended
|
|
163
|
+
*/
|
|
164
|
+
EstimatedFILFee.prototype['recommended'] = undefined;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @member {module:model/EstimatedFILFeeSlow} fast
|
|
168
|
+
*/
|
|
169
|
+
EstimatedFILFee.prototype['fast'] = undefined;
|
|
170
|
+
var _default = exports["default"] = EstimatedFILFee;
|