@cobo/cobo-waas2 1.18.0 → 1.19.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 +78 -4
- package/dist/ApiClient.js +1 -1
- package/dist/api/OAuthApi.js +2 -2
- package/dist/api/TransactionsApi.js +0 -92
- package/dist/api/WalletsApi.js +50 -0
- package/dist/index.js +518 -7
- package/dist/model/AddressesEventData.js +13 -8
- package/dist/model/ApprovalDetail.js +160 -0
- package/dist/model/ApprovalResult.js +66 -0
- package/dist/model/ApprovalShowInfo.js +140 -0
- package/dist/model/ApprovalTemplate.js +114 -0
- package/dist/model/ApprovalTransactionResult.js +66 -0
- package/dist/model/ApprovalUserDetail.js +196 -0
- package/dist/model/AutoFuelType.js +5 -0
- package/dist/model/BalanceUpdateInfoEventData.js +13 -8
- package/dist/model/ChainsEventData.js +13 -8
- package/dist/model/CreatePaymentOrderRequest.js +7 -6
- package/dist/model/CreateSettlement.js +1 -2
- package/dist/model/CustodialWeb3TransferSource.js +2 -2
- package/dist/model/EstimatedEvmEip1559Fee.js +2 -2
- package/dist/model/EstimatedEvmLegacyFee.js +2 -2
- package/dist/model/EstimatedFILFee.js +2 -2
- package/dist/model/EstimatedFILFeeSlow.js +12 -12
- package/dist/model/EstimatedFee.js +1 -1
- package/dist/model/EstimatedFixedFee.js +2 -2
- package/dist/model/EstimatedSOLFee.js +2 -2
- package/dist/model/EstimatedSOLFeeSlow.js +11 -11
- package/dist/model/EstimatedUtxoFee.js +2 -2
- package/dist/model/EvmEip1559FeeBasePrice.js +0 -1
- package/dist/model/EvmEip1559FeeRate.js +2 -2
- package/dist/model/EvmLegacyFeeBasePrice.js +0 -1
- package/dist/model/EvmLegacyFeeRate.js +2 -2
- package/dist/model/FILBase.js +1 -1
- package/dist/model/FILPrice.js +3 -4
- package/dist/model/FeeRate.js +1 -1
- package/dist/model/FixedFeeRate.js +2 -2
- package/dist/model/GetMaxTransferableValueWithFeeModelRequest.js +156 -0
- package/dist/model/MPCVaultEventData.js +13 -8
- package/dist/model/MaxFeeAmount.js +0 -1
- package/dist/model/MaxTransferableValue.js +2 -2
- package/dist/model/MpcTransferSource.js +2 -2
- package/dist/model/PaymentOrderEventData.js +13 -8
- package/dist/model/PaymentRefundEventData.js +13 -8
- package/dist/model/PaymentSettlementEvent.js +13 -8
- package/dist/model/{ListTransactionApprovalDetails200Response.js → RoleDetail.js} +46 -27
- package/dist/model/SOLBase.js +2 -2
- package/dist/model/SOLComputeUnit.js +2 -3
- package/dist/model/SuspendedTokenEventData.js +225 -0
- package/dist/model/SuspendedTokenOperationType.js +61 -0
- package/dist/model/SwapActivity.js +29 -0
- package/dist/model/SwapActivityDetail.js +38 -0
- package/dist/model/TSSRequestWebhookEventData.js +13 -8
- package/dist/model/TokenListingEventData.js +13 -8
- package/dist/model/TokenizationActivityInfo.js +224 -0
- package/dist/model/TokenizationActivityStatus.js +66 -0
- package/dist/model/TokenizationAddressPermission.js +135 -0
- package/dist/model/TokenizationAllowlistActivationParams.js +124 -0
- package/dist/model/TokenizationAllowlistActivationRequest.js +180 -0
- package/dist/model/TokenizationAllowlistAddressNote.js +132 -0
- package/dist/model/TokenizationAppInitiator.js +87 -0
- package/dist/model/TokenizationBlocklistAddressNote.js +132 -0
- package/dist/model/TokenizationBurnEstimateFeeParams.js +187 -0
- package/dist/model/TokenizationBurnTokenParams.js +146 -0
- package/dist/model/TokenizationBurnTokenParamsBurnsInner.js +125 -0
- package/dist/model/TokenizationBurnTokenRequest.js +202 -0
- package/dist/model/TokenizationContractCallEstimateFeeParams.js +167 -0
- package/dist/model/TokenizationContractCallParams.js +107 -0
- package/dist/model/TokenizationContractCallParamsData.js +164 -0
- package/dist/model/TokenizationContractCallRequest.js +182 -0
- package/dist/model/TokenizationContractCallType.js +56 -0
- package/dist/model/TokenizationERC20TokenParams.js +173 -0
- package/dist/model/TokenizationEstimateFeeRequest.js +113 -0
- package/dist/model/TokenizationEstimateFeeRequestOperationParams.js +439 -0
- package/dist/model/TokenizationEvmContractCallParams.js +133 -0
- package/dist/model/TokenizationHoldingInfo.js +166 -0
- package/dist/model/TokenizationIssueEstimateFeeParams.js +176 -0
- package/dist/model/TokenizationIssueTokenParams.js +146 -0
- package/dist/model/TokenizationIssueTokenParamsTokenParams.js +183 -0
- package/dist/model/TokenizationIssuedTokenRequest.js +206 -0
- package/dist/model/TokenizationListActivitiesResponse.js +146 -0
- package/dist/model/TokenizationListEnabledChainsResponse.js +128 -0
- package/dist/model/TokenizationListHoldingsResponse.js +146 -0
- package/dist/model/TokenizationListTokenInfoResponse.js +146 -0
- package/dist/model/TokenizationMintEstimateFeeParams.js +187 -0
- package/dist/model/TokenizationMintTokenParams.js +146 -0
- package/dist/model/TokenizationMintTokenParamsMintsInner.js +125 -0
- package/dist/model/TokenizationMintTokenRequest.js +202 -0
- package/dist/model/TokenizationMpcOperationSource.js +136 -0
- package/dist/model/TokenizationOperationResponse.js +110 -0
- package/dist/model/TokenizationOperationSourceType.js +61 -0
- package/dist/model/TokenizationOperationType.js +96 -0
- package/dist/model/TokenizationPauseEstimateFeeParams.js +149 -0
- package/dist/model/TokenizationPauseTokenParams.js +113 -0
- package/dist/model/TokenizationPauseTokenRequest.js +164 -0
- package/dist/model/TokenizationStatus.js +71 -0
- package/dist/model/TokenizationToggleAllowlistEstimateFeeParams.js +165 -0
- package/dist/model/TokenizationTokenDetailInfo.js +309 -0
- package/dist/model/TokenizationTokenInfo.js +223 -0
- package/dist/model/TokenizationTokenOperationSource.js +192 -0
- package/dist/model/TokenizationTokenPermission.js +147 -0
- package/dist/model/TokenizationTokenPermissionParams.js +166 -0
- package/dist/model/TokenizationTokenPermissionType.js +86 -0
- package/dist/model/TokenizationTokenPermissionsResponse.js +139 -0
- package/dist/model/TokenizationTokenStandard.js +56 -0
- package/dist/model/TokenizationUnpauseEstimateFeeParams.js +149 -0
- package/dist/model/TokenizationUnpauseTokenParams.js +113 -0
- package/dist/model/TokenizationUnpauseTokenRequest.js +164 -0
- package/dist/model/TokenizationUpdateAddressAction.js +61 -0
- package/dist/model/TokenizationUpdateAllowlistAddressesEstimateFeeParams.js +202 -0
- package/dist/model/TokenizationUpdateAllowlistAddressesParams.js +157 -0
- package/dist/model/TokenizationUpdateAllowlistAddressesParamsAddressesInner.js +123 -0
- package/dist/model/TokenizationUpdateAllowlistAddressesRequest.js +217 -0
- package/dist/model/TokenizationUpdateBlocklistAddressesEstimateFeeParams.js +202 -0
- package/dist/model/TokenizationUpdateBlocklistAddressesParams.js +157 -0
- package/dist/model/TokenizationUpdateBlocklistAddressesParamsAddressesInner.js +123 -0
- package/dist/model/TokenizationUpdateBlocklistAddressesRequest.js +217 -0
- package/dist/model/TokenizationWeb3OperationSource.js +136 -0
- package/dist/model/TokensEventData.js +13 -8
- package/dist/model/TopUpAddress.js +2 -2
- package/dist/model/TransactionEvmEip1559Fee.js +2 -2
- package/dist/model/TransactionEvmLegacyFee.js +2 -2
- package/dist/model/TransactionFILFee.js +11 -11
- package/dist/model/TransactionFee.js +10 -10
- package/dist/model/TransactionFixedFee.js +2 -2
- package/dist/model/TransactionRbfSource.js +1 -1
- package/dist/model/TransactionRequestEvmEip1559Fee.js +2 -2
- package/dist/model/TransactionRequestEvmLegacyFee.js +2 -2
- package/dist/model/TransactionRequestFILFee.js +11 -11
- package/dist/model/TransactionRequestFee.js +6 -6
- package/dist/model/TransactionRequestFixedFee.js +2 -2
- package/dist/model/TransactionRequestSOLFee.js +9 -9
- package/dist/model/TransactionRequestUtxoFee.js +2 -2
- package/dist/model/TransactionSOLFee.js +11 -11
- package/dist/model/TransactionSubStatus.js +5 -0
- package/dist/model/TransactionUtxoFee.js +2 -2
- package/dist/model/TransactionWebhookEventData.js +13 -8
- package/dist/model/UtxoFeeBasePrice.js +0 -1
- package/dist/model/UtxoFeeRate.js +2 -2
- package/dist/model/WalletInfoEventData.js +13 -8
- package/dist/model/WebhookEvent.js +2 -2
- package/dist/model/WebhookEventData.js +49 -9
- package/dist/model/WebhookEventDataType.js +12 -7
- package/dist/model/WebhookEventLog.js +2 -2
- package/dist/model/WebhookEventType.js +20 -0
- package/docs/AddressesEventData.md +5 -3
- package/docs/ApprovalDetail.md +14 -0
- package/docs/ApprovalResult.md +14 -0
- package/docs/ApprovalShowInfo.md +13 -0
- package/docs/ApprovalTemplate.md +11 -0
- package/docs/ApprovalTransactionResult.md +14 -0
- package/docs/ApprovalUserDetail.md +18 -0
- package/docs/AutoFuelType.md +2 -0
- package/docs/BalanceUpdateInfoEventData.md +5 -3
- package/docs/ChainsEventData.md +5 -3
- package/docs/CreatePaymentOrderRequest.md +4 -4
- package/docs/CreateSettlement.md +2 -2
- package/docs/CustodialWeb3TransferSource.md +1 -1
- package/docs/EstimatedEvmEip1559Fee.md +1 -1
- package/docs/EstimatedEvmLegacyFee.md +1 -1
- package/docs/EstimatedFILFee.md +1 -1
- package/docs/EstimatedFILFeeSlow.md +4 -4
- package/docs/EstimatedFee.md +1 -1
- package/docs/EstimatedFixedFee.md +1 -1
- package/docs/EstimatedSOLFee.md +1 -1
- package/docs/EstimatedSOLFeeSlow.md +4 -4
- package/docs/EstimatedUtxoFee.md +1 -1
- package/docs/EvmEip1559FeeRate.md +1 -1
- package/docs/EvmLegacyFeeRate.md +1 -1
- package/docs/FILBase.md +1 -1
- package/docs/FILPrice.md +3 -3
- package/docs/FeeRate.md +1 -1
- package/docs/FixedFeeRate.md +1 -1
- package/docs/GetMaxTransferableValueWithFeeModelRequest.md +12 -0
- package/docs/MPCVaultEventData.md +5 -3
- package/docs/MaxTransferableValue.md +1 -1
- package/docs/MpcTransferSource.md +1 -1
- package/docs/OAuthApi.md +1 -1
- package/docs/PaymentOrderEventData.md +5 -3
- package/docs/PaymentRefundEventData.md +5 -3
- package/docs/PaymentSettlementEvent.md +5 -3
- package/docs/RoleDetail.md +11 -0
- package/docs/SOLBase.md +2 -2
- package/docs/SOLComputeUnit.md +2 -2
- package/docs/SuspendedTokenEventData.md +46 -0
- package/docs/SuspendedTokenOperationType.md +12 -0
- package/docs/SwapActivity.md +2 -0
- package/docs/SwapActivityDetail.md +2 -0
- package/docs/TSSRequestWebhookEventData.md +5 -3
- package/docs/TokenListingEventData.md +5 -3
- package/docs/TokenizationActivityInfo.md +18 -0
- package/docs/TokenizationActivityStatus.md +14 -0
- package/docs/TokenizationAddressPermission.md +11 -0
- package/docs/TokenizationAllowlistActivationParams.md +10 -0
- package/docs/TokenizationAllowlistActivationRequest.md +12 -0
- package/docs/TokenizationAllowlistAddressNote.md +11 -0
- package/docs/TokenizationAppInitiator.md +9 -0
- package/docs/TokenizationBlocklistAddressNote.md +11 -0
- package/docs/TokenizationBurnEstimateFeeParams.md +12 -0
- package/docs/TokenizationBurnTokenParams.md +10 -0
- package/docs/TokenizationBurnTokenParamsBurnsInner.md +10 -0
- package/docs/TokenizationBurnTokenRequest.md +12 -0
- package/docs/TokenizationContractCallEstimateFeeParams.md +12 -0
- package/docs/TokenizationContractCallParams.md +10 -0
- package/docs/TokenizationContractCallParamsData.md +11 -0
- package/docs/TokenizationContractCallRequest.md +12 -0
- package/docs/TokenizationContractCallType.md +10 -0
- package/docs/TokenizationERC20TokenParams.md +14 -0
- package/docs/TokenizationEstimateFeeRequest.md +9 -0
- package/docs/TokenizationEstimateFeeRequestOperationParams.md +19 -0
- package/docs/TokenizationEvmContractCallParams.md +11 -0
- package/docs/TokenizationHoldingInfo.md +13 -0
- package/docs/TokenizationIssueEstimateFeeParams.md +12 -0
- package/docs/TokenizationIssueTokenParams.md +11 -0
- package/docs/TokenizationIssueTokenParamsTokenParams.md +14 -0
- package/docs/TokenizationIssuedTokenRequest.md +13 -0
- package/docs/TokenizationListActivitiesResponse.md +10 -0
- package/docs/TokenizationListEnabledChainsResponse.md +10 -0
- package/docs/TokenizationListHoldingsResponse.md +10 -0
- package/docs/TokenizationListTokenInfoResponse.md +10 -0
- package/docs/TokenizationMintEstimateFeeParams.md +12 -0
- package/docs/TokenizationMintTokenParams.md +10 -0
- package/docs/TokenizationMintTokenParamsMintsInner.md +10 -0
- package/docs/TokenizationMintTokenRequest.md +12 -0
- package/docs/TokenizationMpcOperationSource.md +11 -0
- package/docs/TokenizationOperationResponse.md +9 -0
- package/docs/TokenizationOperationSourceType.md +12 -0
- package/docs/TokenizationOperationType.md +26 -0
- package/docs/TokenizationPauseEstimateFeeParams.md +11 -0
- package/docs/TokenizationPauseTokenParams.md +9 -0
- package/docs/TokenizationPauseTokenRequest.md +11 -0
- package/docs/TokenizationStatus.md +16 -0
- package/docs/TokenizationToggleAllowlistEstimateFeeParams.md +12 -0
- package/docs/TokenizationTokenDetailInfo.md +19 -0
- package/docs/TokenizationTokenInfo.md +18 -0
- package/docs/TokenizationTokenOperationSource.md +11 -0
- package/docs/TokenizationTokenPermission.md +12 -0
- package/docs/TokenizationTokenPermissionParams.md +15 -0
- package/docs/TokenizationTokenPermissionType.md +22 -0
- package/docs/TokenizationTokenPermissionsResponse.md +10 -0
- package/docs/TokenizationTokenStandard.md +10 -0
- package/docs/TokenizationUnpauseEstimateFeeParams.md +11 -0
- package/docs/TokenizationUnpauseTokenParams.md +9 -0
- package/docs/TokenizationUnpauseTokenRequest.md +11 -0
- package/docs/TokenizationUpdateAddressAction.md +12 -0
- package/docs/TokenizationUpdateAllowlistAddressesEstimateFeeParams.md +13 -0
- package/docs/TokenizationUpdateAllowlistAddressesParams.md +11 -0
- package/docs/TokenizationUpdateAllowlistAddressesParamsAddressesInner.md +10 -0
- package/docs/TokenizationUpdateAllowlistAddressesRequest.md +13 -0
- package/docs/TokenizationUpdateBlocklistAddressesEstimateFeeParams.md +13 -0
- package/docs/TokenizationUpdateBlocklistAddressesParams.md +11 -0
- package/docs/TokenizationUpdateBlocklistAddressesParamsAddressesInner.md +10 -0
- package/docs/TokenizationUpdateBlocklistAddressesRequest.md +13 -0
- package/docs/TokenizationWeb3OperationSource.md +11 -0
- package/docs/TokensEventData.md +5 -3
- package/docs/TopUpAddress.md +1 -1
- package/docs/TransactionEvmEip1559Fee.md +2 -2
- package/docs/TransactionEvmLegacyFee.md +2 -2
- package/docs/TransactionFILFee.md +6 -6
- package/docs/TransactionFee.md +10 -10
- package/docs/TransactionFixedFee.md +2 -2
- package/docs/TransactionRbfSource.md +1 -1
- package/docs/TransactionRequestEvmEip1559Fee.md +1 -1
- package/docs/TransactionRequestEvmLegacyFee.md +1 -1
- package/docs/TransactionRequestFILFee.md +4 -4
- package/docs/TransactionRequestFee.md +6 -6
- package/docs/TransactionRequestFixedFee.md +1 -1
- package/docs/TransactionRequestSOLFee.md +3 -3
- package/docs/TransactionRequestUtxoFee.md +1 -1
- package/docs/TransactionSOLFee.md +6 -6
- package/docs/TransactionSubStatus.md +2 -0
- package/docs/TransactionUtxoFee.md +2 -2
- package/docs/TransactionWebhookEventData.md +5 -3
- package/docs/TransactionsApi.md +0 -106
- package/docs/UtxoFeeRate.md +1 -1
- package/docs/WalletInfoEventData.md +5 -3
- package/docs/WalletsApi.md +55 -0
- package/docs/WebhookEvent.md +1 -1
- package/docs/WebhookEventData.md +7 -3
- package/docs/WebhookEventDataType.md +5 -3
- package/docs/WebhookEventLog.md +1 -1
- package/docs/WebhookEventType.md +8 -0
- package/package.json +1 -1
- package/docs/ListTransactionApprovalDetails200Response.md +0 -9
|
@@ -0,0 +1,223 @@
|
|
|
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 _TokenizationStatus = _interopRequireDefault(require("./TokenizationStatus"));
|
|
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 TokenizationTokenInfo model module.
|
|
30
|
+
* @module model/TokenizationTokenInfo
|
|
31
|
+
*/
|
|
32
|
+
var TokenizationTokenInfo = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>TokenizationTokenInfo</code>.
|
|
35
|
+
* @alias module:model/TokenizationTokenInfo
|
|
36
|
+
* @param token_id {String} The unique token identifier.
|
|
37
|
+
* @param chain_id {String} The chain ID of the tokenization contract.
|
|
38
|
+
* @param token_symbol {String} The unique token symbol.
|
|
39
|
+
* @param decimals {Number} The number of decimals of the token.
|
|
40
|
+
* @param status {module:model/TokenizationStatus}
|
|
41
|
+
*/
|
|
42
|
+
function TokenizationTokenInfo(token_id, chain_id, token_symbol, decimals, status) {
|
|
43
|
+
_classCallCheck(this, TokenizationTokenInfo);
|
|
44
|
+
TokenizationTokenInfo.initialize(this, token_id, chain_id, token_symbol, decimals, status);
|
|
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(TokenizationTokenInfo, null, [{
|
|
53
|
+
key: "initialize",
|
|
54
|
+
value: function initialize(obj, token_id, chain_id, token_symbol, decimals, status) {
|
|
55
|
+
obj['token_id'] = token_id;
|
|
56
|
+
obj['chain_id'] = chain_id;
|
|
57
|
+
obj['token_symbol'] = token_symbol;
|
|
58
|
+
obj['decimals'] = decimals;
|
|
59
|
+
obj['status'] = status;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Constructs a <code>TokenizationTokenInfo</code> from a plain JavaScript object, optionally creating a new instance.
|
|
64
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
65
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
66
|
+
* @param {module:model/TokenizationTokenInfo} obj Optional instance to populate.
|
|
67
|
+
* @return {module:model/TokenizationTokenInfo} The populated <code>TokenizationTokenInfo</code> instance.
|
|
68
|
+
*/
|
|
69
|
+
}, {
|
|
70
|
+
key: "constructFromObject",
|
|
71
|
+
value: function constructFromObject(data, obj) {
|
|
72
|
+
if (data) {
|
|
73
|
+
obj = obj || new TokenizationTokenInfo();
|
|
74
|
+
if (data.hasOwnProperty('token_id')) {
|
|
75
|
+
obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('chain_id')) {
|
|
78
|
+
obj['chain_id'] = _ApiClient["default"].convertToType(data['chain_id'], 'String');
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('token_address')) {
|
|
81
|
+
obj['token_address'] = _ApiClient["default"].convertToType(data['token_address'], 'String');
|
|
82
|
+
}
|
|
83
|
+
if (data.hasOwnProperty('token_name')) {
|
|
84
|
+
obj['token_name'] = _ApiClient["default"].convertToType(data['token_name'], 'String');
|
|
85
|
+
}
|
|
86
|
+
if (data.hasOwnProperty('token_symbol')) {
|
|
87
|
+
obj['token_symbol'] = _ApiClient["default"].convertToType(data['token_symbol'], 'String');
|
|
88
|
+
}
|
|
89
|
+
if (data.hasOwnProperty('decimals')) {
|
|
90
|
+
obj['decimals'] = _ApiClient["default"].convertToType(data['decimals'], 'Number');
|
|
91
|
+
}
|
|
92
|
+
if (data.hasOwnProperty('allowlist_activated')) {
|
|
93
|
+
obj['allowlist_activated'] = _ApiClient["default"].convertToType(data['allowlist_activated'], 'Boolean');
|
|
94
|
+
}
|
|
95
|
+
if (data.hasOwnProperty('status')) {
|
|
96
|
+
obj['status'] = _TokenizationStatus["default"].constructFromObject(data['status']);
|
|
97
|
+
}
|
|
98
|
+
if (data.hasOwnProperty('total_supply')) {
|
|
99
|
+
obj['total_supply'] = _ApiClient["default"].convertToType(data['total_supply'], 'String');
|
|
100
|
+
}
|
|
101
|
+
if (data.hasOwnProperty('holdings')) {
|
|
102
|
+
obj['holdings'] = _ApiClient["default"].convertToType(data['holdings'], 'String');
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return obj;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Validates the JSON data with respect to <code>TokenizationTokenInfo</code>.
|
|
110
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
111
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TokenizationTokenInfo</code>.
|
|
112
|
+
*/
|
|
113
|
+
}, {
|
|
114
|
+
key: "validateJSON",
|
|
115
|
+
value: function validateJSON(data) {
|
|
116
|
+
// check to make sure all required properties are present in the JSON string
|
|
117
|
+
var _iterator = _createForOfIteratorHelper(TokenizationTokenInfo.RequiredProperties),
|
|
118
|
+
_step;
|
|
119
|
+
try {
|
|
120
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
121
|
+
var property = _step.value;
|
|
122
|
+
if (!data.hasOwnProperty(property)) {
|
|
123
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// ensure the json data is a string
|
|
127
|
+
} catch (err) {
|
|
128
|
+
_iterator.e(err);
|
|
129
|
+
} finally {
|
|
130
|
+
_iterator.f();
|
|
131
|
+
}
|
|
132
|
+
if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
|
|
133
|
+
throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
|
|
134
|
+
}
|
|
135
|
+
// ensure the json data is a string
|
|
136
|
+
if (data['chain_id'] && !(typeof data['chain_id'] === 'string' || data['chain_id'] instanceof String)) {
|
|
137
|
+
throw new Error("Expected the field `chain_id` to be a primitive type in the JSON string but got " + data['chain_id']);
|
|
138
|
+
}
|
|
139
|
+
// ensure the json data is a string
|
|
140
|
+
if (data['token_address'] && !(typeof data['token_address'] === 'string' || data['token_address'] instanceof String)) {
|
|
141
|
+
throw new Error("Expected the field `token_address` to be a primitive type in the JSON string but got " + data['token_address']);
|
|
142
|
+
}
|
|
143
|
+
// ensure the json data is a string
|
|
144
|
+
if (data['token_name'] && !(typeof data['token_name'] === 'string' || data['token_name'] instanceof String)) {
|
|
145
|
+
throw new Error("Expected the field `token_name` to be a primitive type in the JSON string but got " + data['token_name']);
|
|
146
|
+
}
|
|
147
|
+
// ensure the json data is a string
|
|
148
|
+
if (data['token_symbol'] && !(typeof data['token_symbol'] === 'string' || data['token_symbol'] instanceof String)) {
|
|
149
|
+
throw new Error("Expected the field `token_symbol` to be a primitive type in the JSON string but got " + data['token_symbol']);
|
|
150
|
+
}
|
|
151
|
+
// ensure the json data is a string
|
|
152
|
+
if (data['total_supply'] && !(typeof data['total_supply'] === 'string' || data['total_supply'] instanceof String)) {
|
|
153
|
+
throw new Error("Expected the field `total_supply` to be a primitive type in the JSON string but got " + data['total_supply']);
|
|
154
|
+
}
|
|
155
|
+
// ensure the json data is a string
|
|
156
|
+
if (data['holdings'] && !(typeof data['holdings'] === 'string' || data['holdings'] instanceof String)) {
|
|
157
|
+
throw new Error("Expected the field `holdings` to be a primitive type in the JSON string but got " + data['holdings']);
|
|
158
|
+
}
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
}]);
|
|
162
|
+
}();
|
|
163
|
+
TokenizationTokenInfo.RequiredProperties = ["token_id", "chain_id", "token_symbol", "decimals", "status"];
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The unique token identifier.
|
|
167
|
+
* @member {String} token_id
|
|
168
|
+
*/
|
|
169
|
+
TokenizationTokenInfo.prototype['token_id'] = undefined;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The chain ID of the tokenization contract.
|
|
173
|
+
* @member {String} chain_id
|
|
174
|
+
*/
|
|
175
|
+
TokenizationTokenInfo.prototype['chain_id'] = undefined;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* The address of the token contract.
|
|
179
|
+
* @member {String} token_address
|
|
180
|
+
*/
|
|
181
|
+
TokenizationTokenInfo.prototype['token_address'] = undefined;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* The name of the token.
|
|
185
|
+
* @member {String} token_name
|
|
186
|
+
*/
|
|
187
|
+
TokenizationTokenInfo.prototype['token_name'] = undefined;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The unique token symbol.
|
|
191
|
+
* @member {String} token_symbol
|
|
192
|
+
*/
|
|
193
|
+
TokenizationTokenInfo.prototype['token_symbol'] = undefined;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* The number of decimals of the token.
|
|
197
|
+
* @member {Number} decimals
|
|
198
|
+
*/
|
|
199
|
+
TokenizationTokenInfo.prototype['decimals'] = undefined;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Whether the allowlist feature is activated for the token.
|
|
203
|
+
* @member {Boolean} allowlist_activated
|
|
204
|
+
*/
|
|
205
|
+
TokenizationTokenInfo.prototype['allowlist_activated'] = undefined;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* @member {module:model/TokenizationStatus} status
|
|
209
|
+
*/
|
|
210
|
+
TokenizationTokenInfo.prototype['status'] = undefined;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The total supply of the token.
|
|
214
|
+
* @member {String} total_supply
|
|
215
|
+
*/
|
|
216
|
+
TokenizationTokenInfo.prototype['total_supply'] = undefined;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* The amount of tokens held by the organization.
|
|
220
|
+
* @member {String} holdings
|
|
221
|
+
*/
|
|
222
|
+
TokenizationTokenInfo.prototype['holdings'] = undefined;
|
|
223
|
+
var _default = exports["default"] = TokenizationTokenInfo;
|
|
@@ -0,0 +1,192 @@
|
|
|
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 _TokenizationMpcOperationSource = _interopRequireDefault(require("./TokenizationMpcOperationSource"));
|
|
9
|
+
var _TokenizationOperationSourceType = _interopRequireDefault(require("./TokenizationOperationSourceType"));
|
|
10
|
+
var _TokenizationWeb3OperationSource = _interopRequireDefault(require("./TokenizationWeb3OperationSource"));
|
|
11
|
+
var _TokenizationTokenOperationSource;
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
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); }
|
|
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 _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; }
|
|
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 TokenizationTokenOperationSource model module.
|
|
31
|
+
* @module model/TokenizationTokenOperationSource
|
|
32
|
+
*/
|
|
33
|
+
var TokenizationTokenOperationSource = /*#__PURE__*/function () {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new <code>TokenizationTokenOperationSource</code>.
|
|
36
|
+
* @alias module:model/TokenizationTokenOperationSource
|
|
37
|
+
* @param {(module:model/TokenizationMpcOperationSource|module:model/TokenizationWeb3OperationSource)} instance The actual instance to initialize TokenizationTokenOperationSource.
|
|
38
|
+
*/
|
|
39
|
+
function TokenizationTokenOperationSource() {
|
|
40
|
+
var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
41
|
+
_classCallCheck(this, TokenizationTokenOperationSource);
|
|
42
|
+
/**
|
|
43
|
+
* Returns the JSON representation of the actual instance.
|
|
44
|
+
* @return {string}
|
|
45
|
+
*/
|
|
46
|
+
_defineProperty(this, "toJSON", function () {
|
|
47
|
+
return this.getActualInstance();
|
|
48
|
+
});
|
|
49
|
+
if (instance === null) {
|
|
50
|
+
this.actualInstance = null;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
var match = 0;
|
|
54
|
+
var errorMessages = [];
|
|
55
|
+
var discriminatorValue = instance["source_type"];
|
|
56
|
+
if (discriminatorValue) {
|
|
57
|
+
switch (discriminatorValue) {
|
|
58
|
+
case "Org-Controlled":
|
|
59
|
+
this.actualInstance = _TokenizationMpcOperationSource["default"].constructFromObject(instance);
|
|
60
|
+
match++;
|
|
61
|
+
break;
|
|
62
|
+
case "Web3":
|
|
63
|
+
this.actualInstance = _TokenizationWeb3OperationSource["default"].constructFromObject(instance);
|
|
64
|
+
match++;
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
if (instance instanceof _TokenizationMpcOperationSource["default"]) {
|
|
74
|
+
this.actualInstance = instance;
|
|
75
|
+
} else if (!!_TokenizationMpcOperationSource["default"].validateJSON && _TokenizationMpcOperationSource["default"].validateJSON(instance)) {
|
|
76
|
+
// plain JS object
|
|
77
|
+
// create TokenizationMpcOperationSource from JS object
|
|
78
|
+
this.actualInstance = _TokenizationMpcOperationSource["default"].constructFromObject(instance);
|
|
79
|
+
} else {
|
|
80
|
+
if (_TokenizationMpcOperationSource["default"].constructFromObject(instance)) {
|
|
81
|
+
if (!!_TokenizationMpcOperationSource["default"].constructFromObject(instance).toJSON) {
|
|
82
|
+
if (_TokenizationMpcOperationSource["default"].constructFromObject(instance).toJSON()) {
|
|
83
|
+
this.actualInstance = _TokenizationMpcOperationSource["default"].constructFromObject(instance);
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
this.actualInstance = _TokenizationMpcOperationSource["default"].constructFromObject(instance);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
match++;
|
|
91
|
+
} catch (err) {
|
|
92
|
+
// json data failed to deserialize into TokenizationMpcOperationSource
|
|
93
|
+
errorMessages.push("Failed to construct TokenizationMpcOperationSource: " + err);
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
if (instance instanceof _TokenizationWeb3OperationSource["default"]) {
|
|
97
|
+
this.actualInstance = instance;
|
|
98
|
+
} else if (!!_TokenizationWeb3OperationSource["default"].validateJSON && _TokenizationWeb3OperationSource["default"].validateJSON(instance)) {
|
|
99
|
+
// plain JS object
|
|
100
|
+
// create TokenizationWeb3OperationSource from JS object
|
|
101
|
+
this.actualInstance = _TokenizationWeb3OperationSource["default"].constructFromObject(instance);
|
|
102
|
+
} else {
|
|
103
|
+
if (_TokenizationWeb3OperationSource["default"].constructFromObject(instance)) {
|
|
104
|
+
if (!!_TokenizationWeb3OperationSource["default"].constructFromObject(instance).toJSON) {
|
|
105
|
+
if (_TokenizationWeb3OperationSource["default"].constructFromObject(instance).toJSON()) {
|
|
106
|
+
this.actualInstance = _TokenizationWeb3OperationSource["default"].constructFromObject(instance);
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
this.actualInstance = _TokenizationWeb3OperationSource["default"].constructFromObject(instance);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
match++;
|
|
114
|
+
} catch (err) {
|
|
115
|
+
// json data failed to deserialize into TokenizationWeb3OperationSource
|
|
116
|
+
errorMessages.push("Failed to construct TokenizationWeb3OperationSource: " + err);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// if (match > 1) {
|
|
120
|
+
// throw new Error("Multiple matches found constructing `TokenizationTokenOperationSource` with oneOf schemas TokenizationMpcOperationSource, TokenizationWeb3OperationSource. Input: " + JSON.stringify(instance));
|
|
121
|
+
// } else
|
|
122
|
+
if (match === 0) {
|
|
123
|
+
// this.actualInstance = null; // clear the actual instance in case there are multiple matches
|
|
124
|
+
// throw new Error("No match found constructing `TokenizationTokenOperationSource` with oneOf schemas TokenizationMpcOperationSource, TokenizationWeb3OperationSource. Details: " +
|
|
125
|
+
// errorMessages.join(", "));
|
|
126
|
+
return;
|
|
127
|
+
} else {// only 1 match
|
|
128
|
+
// the input is valid
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Constructs a <code>TokenizationTokenOperationSource</code> from a plain JavaScript object, optionally creating a new instance.
|
|
134
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
135
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
136
|
+
* @param {module:model/TokenizationTokenOperationSource} obj Optional instance to populate.
|
|
137
|
+
* @return {module:model/TokenizationTokenOperationSource} The populated <code>TokenizationTokenOperationSource</code> instance.
|
|
138
|
+
*/
|
|
139
|
+
return _createClass(TokenizationTokenOperationSource, [{
|
|
140
|
+
key: "getActualInstance",
|
|
141
|
+
value:
|
|
142
|
+
/**
|
|
143
|
+
* Gets the actual instance, which can be <code>TokenizationMpcOperationSource</code>, <code>TokenizationWeb3OperationSource</code>.
|
|
144
|
+
* @return {(module:model/TokenizationMpcOperationSource|module:model/TokenizationWeb3OperationSource)} The actual instance.
|
|
145
|
+
*/
|
|
146
|
+
function getActualInstance() {
|
|
147
|
+
return this.actualInstance;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Sets the actual instance, which can be <code>TokenizationMpcOperationSource</code>, <code>TokenizationWeb3OperationSource</code>.
|
|
152
|
+
* @param {(module:model/TokenizationMpcOperationSource|module:model/TokenizationWeb3OperationSource)} obj The actual instance.
|
|
153
|
+
*/
|
|
154
|
+
}, {
|
|
155
|
+
key: "setActualInstance",
|
|
156
|
+
value: function setActualInstance(obj) {
|
|
157
|
+
this.actualInstance = TokenizationTokenOperationSource.constructFromObject(obj).getActualInstance();
|
|
158
|
+
}
|
|
159
|
+
}], [{
|
|
160
|
+
key: "constructFromObject",
|
|
161
|
+
value: function constructFromObject(data, obj) {
|
|
162
|
+
return new TokenizationTokenOperationSource(data);
|
|
163
|
+
}
|
|
164
|
+
}]);
|
|
165
|
+
}();
|
|
166
|
+
/**
|
|
167
|
+
* @member {module:model/TokenizationOperationSourceType} source_type
|
|
168
|
+
*/
|
|
169
|
+
_TokenizationTokenOperationSource = TokenizationTokenOperationSource;
|
|
170
|
+
/**
|
|
171
|
+
* Create an instance of TokenizationTokenOperationSource from a JSON string.
|
|
172
|
+
* @param {string} json_string JSON string.
|
|
173
|
+
* @return {module:model/TokenizationTokenOperationSource} An instance of TokenizationTokenOperationSource.
|
|
174
|
+
*/
|
|
175
|
+
_defineProperty(TokenizationTokenOperationSource, "fromJSON", function (json_string) {
|
|
176
|
+
return _TokenizationTokenOperationSource.constructFromObject(JSON.parse(json_string));
|
|
177
|
+
});
|
|
178
|
+
TokenizationTokenOperationSource.prototype['source_type'] = undefined;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* The wallet ID.
|
|
182
|
+
* @member {String} wallet_id
|
|
183
|
+
*/
|
|
184
|
+
TokenizationTokenOperationSource.prototype['wallet_id'] = undefined;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* The wallet address to interact with the token contract from.
|
|
188
|
+
* @member {String} address
|
|
189
|
+
*/
|
|
190
|
+
TokenizationTokenOperationSource.prototype['address'] = undefined;
|
|
191
|
+
TokenizationTokenOperationSource.OneOf = ["TokenizationMpcOperationSource", "TokenizationWeb3OperationSource"];
|
|
192
|
+
var _default = exports["default"] = TokenizationTokenOperationSource;
|
|
@@ -0,0 +1,147 @@
|
|
|
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 _TokenizationTokenPermissionType = _interopRequireDefault(require("./TokenizationTokenPermissionType"));
|
|
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 TokenizationTokenPermission model module.
|
|
30
|
+
* @module model/TokenizationTokenPermission
|
|
31
|
+
*/
|
|
32
|
+
var TokenizationTokenPermission = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>TokenizationTokenPermission</code>.
|
|
35
|
+
* @alias module:model/TokenizationTokenPermission
|
|
36
|
+
* @param permission_type {module:model/TokenizationTokenPermissionType}
|
|
37
|
+
* @param name {String} The display name of the permission.
|
|
38
|
+
* @param description {String} Detailed description of what this permission allows.
|
|
39
|
+
* @param enabled {Boolean} Whether this permission is currently enabled.
|
|
40
|
+
*/
|
|
41
|
+
function TokenizationTokenPermission(permission_type, name, description, enabled) {
|
|
42
|
+
_classCallCheck(this, TokenizationTokenPermission);
|
|
43
|
+
TokenizationTokenPermission.initialize(this, permission_type, name, description, enabled);
|
|
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(TokenizationTokenPermission, null, [{
|
|
52
|
+
key: "initialize",
|
|
53
|
+
value: function initialize(obj, permission_type, name, description, enabled) {
|
|
54
|
+
obj['permission_type'] = permission_type;
|
|
55
|
+
obj['name'] = name;
|
|
56
|
+
obj['description'] = description;
|
|
57
|
+
obj['enabled'] = enabled;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Constructs a <code>TokenizationTokenPermission</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/TokenizationTokenPermission} obj Optional instance to populate.
|
|
65
|
+
* @return {module:model/TokenizationTokenPermission} The populated <code>TokenizationTokenPermission</code> instance.
|
|
66
|
+
*/
|
|
67
|
+
}, {
|
|
68
|
+
key: "constructFromObject",
|
|
69
|
+
value: function constructFromObject(data, obj) {
|
|
70
|
+
if (data) {
|
|
71
|
+
obj = obj || new TokenizationTokenPermission();
|
|
72
|
+
if (data.hasOwnProperty('permission_type')) {
|
|
73
|
+
obj['permission_type'] = _TokenizationTokenPermissionType["default"].constructFromObject(data['permission_type']);
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('name')) {
|
|
76
|
+
obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
|
|
77
|
+
}
|
|
78
|
+
if (data.hasOwnProperty('description')) {
|
|
79
|
+
obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
|
|
80
|
+
}
|
|
81
|
+
if (data.hasOwnProperty('enabled')) {
|
|
82
|
+
obj['enabled'] = _ApiClient["default"].convertToType(data['enabled'], 'Boolean');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return obj;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Validates the JSON data with respect to <code>TokenizationTokenPermission</code>.
|
|
90
|
+
* @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>TokenizationTokenPermission</code>.
|
|
92
|
+
*/
|
|
93
|
+
}, {
|
|
94
|
+
key: "validateJSON",
|
|
95
|
+
value: function validateJSON(data) {
|
|
96
|
+
// check to make sure all required properties are present in the JSON string
|
|
97
|
+
var _iterator = _createForOfIteratorHelper(TokenizationTokenPermission.RequiredProperties),
|
|
98
|
+
_step;
|
|
99
|
+
try {
|
|
100
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
101
|
+
var property = _step.value;
|
|
102
|
+
if (!data.hasOwnProperty(property)) {
|
|
103
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// ensure the json data is a string
|
|
107
|
+
} catch (err) {
|
|
108
|
+
_iterator.e(err);
|
|
109
|
+
} finally {
|
|
110
|
+
_iterator.f();
|
|
111
|
+
}
|
|
112
|
+
if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
|
|
113
|
+
throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
|
|
114
|
+
}
|
|
115
|
+
// ensure the json data is a string
|
|
116
|
+
if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
|
|
117
|
+
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
|
|
118
|
+
}
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
}]);
|
|
122
|
+
}();
|
|
123
|
+
TokenizationTokenPermission.RequiredProperties = ["permission_type", "name", "description", "enabled"];
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @member {module:model/TokenizationTokenPermissionType} permission_type
|
|
127
|
+
*/
|
|
128
|
+
TokenizationTokenPermission.prototype['permission_type'] = undefined;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The display name of the permission.
|
|
132
|
+
* @member {String} name
|
|
133
|
+
*/
|
|
134
|
+
TokenizationTokenPermission.prototype['name'] = undefined;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Detailed description of what this permission allows.
|
|
138
|
+
* @member {String} description
|
|
139
|
+
*/
|
|
140
|
+
TokenizationTokenPermission.prototype['description'] = undefined;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Whether this permission is currently enabled.
|
|
144
|
+
* @member {Boolean} enabled
|
|
145
|
+
*/
|
|
146
|
+
TokenizationTokenPermission.prototype['enabled'] = undefined;
|
|
147
|
+
var _default = exports["default"] = TokenizationTokenPermission;
|