@cobo/cobo-waas2 1.2.0 → 1.3.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 +41 -9
- package/dist/ApiClient.js +2 -2
- package/dist/PreRequestScript.js +640 -0
- package/dist/api/DevelopersWebhooksApi.js +1 -1
- package/dist/api/OAuthApi.js +5 -5
- package/dist/api/StakingsApi.js +538 -0
- package/dist/api/TransactionsApi.js +111 -9
- package/dist/api/WalletsApi.js +1 -60
- package/dist/api/WalletsExchangeWalletApi.js +5 -5
- package/dist/api/WalletsMPCWalletsApi.js +1 -1
- package/dist/index.js +154 -0
- package/dist/model/Activity.js +21 -12
- package/dist/model/ActivityAction.js +1 -1
- package/dist/model/ActivityInitiator.js +8 -8
- package/dist/model/ActivityStatus.js +1 -1
- package/dist/model/ActivityTimeline.js +4 -2
- package/dist/model/ActivityType.js +1 -16
- package/dist/model/AddressEncoding.js +1 -1
- package/dist/model/AddressInfo.js +40 -1
- package/dist/model/AddressTransferDestination.js +2 -2
- package/dist/model/AddressTransferDestinationAccountOutput.js +3 -3
- package/dist/model/AddressTransferDestinationUtxoOutputsInner.js +2 -2
- package/dist/model/AmountDetailsInner.js +1 -14
- package/dist/model/AmountStatus.js +1 -1
- package/dist/model/AssetBalance.js +1 -1
- package/dist/model/AssetInfo.js +1 -1
- package/dist/model/BabylonStakeExtra.js +10 -10
- package/dist/model/BabylonStakingExtra.js +175 -0
- package/dist/model/BabylonValidator.js +35 -15
- package/dist/model/BaseContractCallSource.js +2 -2
- package/dist/model/BaseEstimateStakingFee.js +1 -1
- package/dist/model/BaseStakeExtra.js +2 -2
- package/dist/model/BaseStakeSource.js +137 -0
- package/dist/model/BookkeepingRecord.js +243 -0
- package/dist/model/BookkeepingSummary.js +150 -0
- package/dist/model/BroadcastSignedTransactions201ResponseInner.js +125 -0
- package/dist/model/BroadcastSignedTransactionsRequest.js +87 -0
- package/dist/model/ChainInfo.js +10 -1
- package/dist/model/CheckAddressValidity200Response.js +1 -1
- package/dist/model/CheckAddressesValidity200ResponseInner.js +1 -1
- package/dist/model/CheckLoopTransfers200ResponseInner.js +2 -2
- package/dist/model/CoboSafeDelegate.js +28 -3
- package/dist/model/CoboSafeDelegateType.js +1 -1
- package/dist/model/ContractCallDestination.js +25 -4
- package/dist/model/ContractCallDestinationType.js +1 -1
- package/dist/model/ContractCallParams.js +1 -1
- package/dist/model/ContractCallSource.js +42 -5
- package/dist/model/ContractCallSourceType.js +1 -1
- package/dist/model/CreateAddressRequest.js +1 -1
- package/dist/model/CreateCustodialWalletParams.js +1 -1
- package/dist/model/CreateExchangeWalletParams.js +1 -1
- package/dist/model/CreateKeyShareHolder.js +1 -1
- package/dist/model/CreateKeyShareHolderGroupRequest.js +1 -1
- package/dist/model/CreateMpcProjectRequest.js +1 -1
- package/dist/model/CreateMpcVaultRequest.js +1 -1
- package/dist/model/CreateMpcWalletParams.js +1 -1
- package/dist/model/CreateSafeWalletParams.js +1 -1
- package/dist/model/CreateSmartContractWalletParams.js +24 -3
- package/dist/model/CreateStakeActivity.js +5 -5
- package/dist/model/CreateStakeActivity201Response.js +123 -0
- package/dist/model/CreateStakeActivityExtra.js +37 -60
- package/dist/model/CreateStakeActivityRequest.js +246 -0
- package/dist/model/CreateTransferTransaction201Response.js +1 -1
- package/dist/model/CreateTssRequestRequest.js +1 -1
- package/dist/model/CreateUnstakeActivity.js +4 -4
- package/dist/model/CreateUnstakeActivityRequest.js +200 -0
- package/dist/model/CreateWalletParams.js +52 -7
- package/dist/model/CreateWebhookEndpointRequest.js +1 -1
- package/dist/model/CreateWithdrawActivity.js +5 -5
- package/dist/model/CreateWithdrawActivityRequest.js +220 -0
- package/dist/model/CreatedWalletInfo.js +52 -7
- package/dist/model/CurveType.js +1 -1
- package/dist/model/CustodialTransferSource.js +2 -2
- package/dist/model/CustodialWalletInfo.js +1 -1
- package/dist/model/DeleteKeyShareHolderGroupById201Response.js +1 -1
- package/dist/model/DeleteWalletById201Response.js +1 -1
- package/dist/model/EigenLayerLstStakeExtra.js +2 -2
- package/dist/model/EigenLayerNativeStakeExtra.js +1 -1
- package/dist/model/EigenlayerValidator.js +1 -1
- package/dist/model/ErrorResponse.js +1 -1
- package/dist/model/EstimateContractCallFeeParams.js +1 -1
- package/dist/model/EstimateFeeParams.js +38 -5
- package/dist/model/EstimateFeeRequestType.js +1 -1
- package/dist/model/EstimateStakeFee.js +7 -7
- package/dist/model/EstimateTransferFeeParams.js +1 -1
- package/dist/model/EstimateUnstakeFee.js +6 -6
- package/dist/model/EstimateWithdrawFee.js +8 -8
- package/dist/model/EstimatedEvmEip1559Fee.js +1 -1
- package/dist/model/EstimatedEvmEip1559FeeSlow.js +1 -1
- package/dist/model/EstimatedEvmLegacyFee.js +1 -1
- package/dist/model/EstimatedEvmLegacyFeeSlow.js +1 -1
- package/dist/model/EstimatedFee.js +66 -9
- package/dist/model/EstimatedFixedFee.js +1 -1
- package/dist/model/EstimatedUtxoFee.js +1 -1
- package/dist/model/EstimatedUtxoFeeSlow.js +1 -1
- package/dist/model/EvmContractCallDestination.js +9 -5
- package/dist/model/EvmEIP191MessageSignDestination.js +2 -2
- package/dist/model/EvmEIP712MessageSignDestination.js +2 -2
- package/dist/model/EvmEip1559FeeBasePrice.js +1 -1
- package/dist/model/EvmEip1559FeeRate.js +1 -1
- package/dist/model/EvmLegacyFeeBasePrice.js +1 -1
- package/dist/model/EvmLegacyFeeRate.js +1 -1
- package/dist/model/ExchangeId.js +1 -1
- package/dist/model/ExchangeTransferDestination.js +4 -4
- package/dist/model/ExchangeTransferSource.js +2 -2
- package/dist/model/ExchangeWalletInfo.js +1 -1
- package/dist/model/ExtendedTokenInfo.js +37 -1
- package/dist/model/FeeAmount.js +1 -1
- package/dist/model/FeeGasLimit.js +1 -1
- package/dist/model/FeeRate.js +66 -9
- package/dist/model/FeeType.js +1 -1
- package/dist/model/FixedFeeRate.js +1 -1
- package/dist/model/GetStakingEstimationFee201Response.js +109 -0
- package/dist/model/GetStakingEstimationFeeRequest.js +256 -0
- package/dist/model/GetToken200Response.js +1 -1
- package/dist/model/GetToken4XXResponse.js +1 -1
- package/dist/model/KeyShareHolder.js +1 -1
- package/dist/model/KeyShareHolderGroup.js +1 -1
- package/dist/model/KeyShareHolderGroupStatus.js +1 -1
- package/dist/model/KeyShareHolderGroupType.js +1 -1
- package/dist/model/KeyShareHolderStatus.js +1 -1
- package/dist/model/KeyShareHolderType.js +1 -1
- package/dist/model/ListAddresses200Response.js +1 -1
- package/dist/model/ListAssetBalancesForExchangeWallet200Response.js +1 -1
- package/dist/model/ListExchanges200ResponseInner.js +1 -1
- package/dist/model/ListKeyShareHolderGroups200Response.js +1 -1
- package/dist/model/ListMpcProjects200Response.js +1 -1
- package/dist/model/ListMpcVaults200Response.js +1 -1
- package/dist/model/ListStakingActivities200Response.js +123 -0
- package/dist/model/ListStakingPools200Response.js +123 -0
- package/dist/model/ListStakings200Response.js +123 -0
- package/dist/model/ListSupportedAssetsForExchange200Response.js +1 -1
- package/dist/model/ListSupportedChains200Response.js +1 -1
- package/dist/model/ListSupportedTokens200Response.js +1 -1
- package/dist/model/ListTokenBalancesForAddress200Response.js +1 -1
- package/dist/model/ListTransactions200Response.js +1 -1
- package/dist/model/ListTssRequests200Response.js +1 -1
- package/dist/model/ListUtxos200Response.js +1 -1
- package/dist/model/ListWallets200Response.js +1 -1
- package/dist/model/ListWebhookEndpoints200Response.js +1 -1
- package/dist/model/ListWebhookEventDefinitions200ResponseInner.js +1 -1
- package/dist/model/ListWebhookEventLogs200Response.js +1 -1
- package/dist/model/ListWebhookEvents200Response.js +1 -1
- package/dist/model/LockUtxos201Response.js +1 -1
- package/dist/model/LockUtxosRequest.js +1 -1
- package/dist/model/LockUtxosRequestUtxosInner.js +1 -1
- package/dist/model/MPCDelegate.js +1 -1
- package/dist/model/MPCProject.js +1 -1
- package/dist/model/MPCVault.js +1 -1
- package/dist/model/MPCVaultType.js +1 -1
- package/dist/model/MPCWalletInfo.js +1 -1
- package/dist/model/MaxFeeAmount.js +1 -1
- package/dist/model/MaxTransferableValue.js +1 -1
- package/dist/model/MessageSignDestination.js +38 -5
- package/dist/model/MessageSignDestinationType.js +1 -1
- package/dist/model/MessageSignParams.js +1 -1
- package/dist/model/MessageSignSource.js +28 -3
- package/dist/model/MessageSignSourceType.js +1 -1
- package/dist/model/MpcContractCallSource.js +1 -1
- package/dist/model/MpcMessageSignSource.js +1 -1
- package/dist/model/MpcSigningGroup.js +1 -1
- package/dist/model/MpcStakeSource.js +156 -0
- package/dist/model/MpcTransferSource.js +2 -2
- package/dist/model/Pagination.js +1 -1
- package/dist/model/PoolDetails.js +27 -27
- package/dist/model/PoolDetailsAllOfValidatorsInfo.js +45 -40
- package/dist/model/PoolSummary.js +14 -14
- package/dist/model/RawMessageSignDestination.js +122 -0
- package/dist/model/RefreshToken200Response.js +1 -1
- package/dist/model/RefreshTokenRequest.js +1 -1
- package/dist/model/ReplaceType.js +1 -1
- package/dist/model/RetryWebhookEventById201Response.js +1 -1
- package/dist/model/RootPubkey.js +1 -1
- package/dist/model/SafeContractCallSource.js +2 -2
- package/dist/model/SafeTransferSource.js +2 -2
- package/dist/model/SafeWallet.js +1 -1
- package/dist/model/SmartContractInitiator.js +1 -1
- package/dist/model/SmartContractWalletInfo.js +24 -3
- package/dist/model/SmartContractWalletOperationType.js +1 -1
- package/dist/model/SmartContractWalletType.js +1 -1
- package/dist/model/SourceGroup.js +1 -1
- package/dist/model/StakeSourceType.js +56 -0
- package/dist/model/StakingPoolType.js +1 -11
- package/dist/model/StakingSource.js +39 -46
- package/dist/model/Stakings.js +35 -63
- package/dist/model/StakingsExtra.js +182 -0
- package/dist/model/StakingsValidatorInfo.js +7 -2
- package/dist/model/SubWalletAssetBalance.js +1 -1
- package/dist/model/TSSGroups.js +1 -1
- package/dist/model/TSSRequest.js +1 -1
- package/dist/model/TSSRequestStatus.js +1 -1
- package/dist/model/TSSRequestType.js +1 -1
- package/dist/model/TSSRequestWebhookEventData.js +1 -1
- package/dist/model/TokenBalance.js +1 -1
- package/dist/model/TokenBalanceBalance.js +1 -1
- package/dist/model/TokenInfo.js +27 -1
- package/dist/model/Transaction.js +1 -1
- package/dist/model/TransactionApprover.js +1 -1
- package/dist/model/TransactionBlockInfo.js +1 -1
- package/dist/model/TransactionCustodialAssetWalletSource.js +2 -2
- package/dist/model/TransactionDepositFromAddressSource.js +2 -2
- package/dist/model/TransactionDepositFromLoopSource.js +2 -2
- package/dist/model/TransactionDepositFromWalletSource.js +2 -2
- package/dist/model/TransactionDepositToAddressDestination.js +4 -4
- package/dist/model/TransactionDepositToWalletDestination.js +4 -4
- package/dist/model/TransactionDestination.js +110 -17
- package/dist/model/TransactionDestinationType.js +1 -1
- package/dist/model/TransactionDetail.js +1 -1
- package/dist/model/TransactionDetails.js +1 -1
- package/dist/model/TransactionEvmContractDestination.js +9 -5
- package/dist/model/TransactionEvmEip1559Fee.js +2 -2
- package/dist/model/TransactionEvmLegacyFee.js +2 -2
- package/dist/model/TransactionExchangeWalletSource.js +2 -2
- package/dist/model/TransactionFee.js +66 -9
- package/dist/model/TransactionFeeStationWalletSource.js +1 -1
- package/dist/model/TransactionFixedFee.js +2 -2
- package/dist/model/TransactionInitiatorType.js +1 -1
- package/dist/model/TransactionMPCWalletSource.js +2 -2
- package/dist/model/TransactionMessageSignEIP191Destination.js +2 -2
- package/dist/model/TransactionMessageSignEIP712Destination.js +2 -2
- package/dist/model/TransactionRawTxInfo.js +1 -1
- package/dist/model/TransactionRbf.js +1 -1
- package/dist/model/TransactionRbfSource.js +28 -3
- package/dist/model/TransactionReplacement.js +1 -1
- package/dist/model/TransactionRequestEvmEip1559Fee.js +2 -2
- package/dist/model/TransactionRequestEvmLegacyFee.js +2 -2
- package/dist/model/TransactionRequestFee.js +66 -9
- package/dist/model/TransactionRequestFixedFee.js +2 -2
- package/dist/model/TransactionRequestUtxoFee.js +2 -2
- package/dist/model/TransactionResend.js +1 -1
- package/dist/model/TransactionResult.js +24 -3
- package/dist/model/TransactionResultType.js +1 -1
- package/dist/model/TransactionSignatureResult.js +1 -1
- package/dist/model/TransactionSigner.js +1 -1
- package/dist/model/TransactionSmartContractSafeWalletSource.js +2 -2
- package/dist/model/TransactionSource.js +116 -15
- package/dist/model/TransactionSourceType.js +1 -1
- package/dist/model/TransactionStatus.js +1 -1
- package/dist/model/TransactionSubStatus.js +1 -1
- package/dist/model/TransactionTimeline.js +1 -1
- package/dist/model/TransactionTokeApproval.js +37 -1
- package/dist/model/TransactionTokenAmount.js +1 -1
- package/dist/model/TransactionTransferToAddressDestination.js +2 -2
- package/dist/model/TransactionTransferToAddressDestinationAccountOutput.js +2 -2
- package/dist/model/TransactionTransferToAddressDestinationUtxoOutputsInner.js +2 -2
- package/dist/model/TransactionTransferToWalletDestination.js +4 -4
- package/dist/model/TransactionType.js +11 -1
- package/dist/model/TransactionUtxo.js +1 -1
- package/dist/model/TransactionUtxoFee.js +2 -2
- package/dist/model/TransactionWebhookEventData.js +1 -1
- package/dist/model/TransferDestination.js +39 -6
- package/dist/model/TransferDestinationType.js +1 -1
- package/dist/model/TransferParams.js +1 -1
- package/dist/model/TransferSource.js +74 -9
- package/dist/model/UTXO.js +1 -1
- package/dist/model/UpdateCustodialWalletParams.js +1 -1
- package/dist/model/UpdateExchangeWalletParams.js +1 -1
- package/dist/model/UpdateGroupAction.js +1 -1
- package/dist/model/UpdateKeyShareHolderGroupByIdRequest.js +1 -1
- package/dist/model/UpdateMpcProjectByIdRequest.js +1 -1
- package/dist/model/UpdateMpcVaultByIdRequest.js +1 -1
- package/dist/model/UpdateMpcWalletParams.js +1 -1
- package/dist/model/UpdateSmartContractWalletParams.js +1 -1
- package/dist/model/UpdateWalletParams.js +66 -9
- package/dist/model/UpdateWebhookEndpointByIdRequest.js +1 -1
- package/dist/model/UtxoFeeBasePrice.js +1 -1
- package/dist/model/UtxoFeeRate.js +1 -1
- package/dist/model/WalletBalanceSnapshot.js +120 -0
- package/dist/model/WalletBalanceSnapshotRecord.js +163 -0
- package/dist/model/WalletInfo.js +66 -9
- package/dist/model/WalletSubtype.js +1 -1
- package/dist/model/WalletType.js +1 -1
- package/dist/model/WebhookEndpoint.js +1 -1
- package/dist/model/WebhookEndpointStatus.js +1 -1
- package/dist/model/WebhookEvent.js +1 -1
- package/dist/model/WebhookEventData.js +38 -5
- package/dist/model/WebhookEventDataType.js +1 -1
- package/dist/model/WebhookEventLog.js +1 -1
- package/dist/model/WebhookEventStatus.js +1 -1
- package/dist/model/WebhookEventType.js +1 -1
- package/docs/Activity.md +9 -8
- package/docs/ActivityInitiator.md +1 -1
- package/docs/ActivityTimeline.md +3 -3
- package/docs/ActivityType.md +0 -6
- package/docs/AddressInfo.md +3 -0
- package/docs/AddressTransferDestinationAccountOutput.md +1 -1
- package/docs/AddressTransferDestinationUtxoOutputsInner.md +1 -1
- package/docs/AmountDetailsInner.md +0 -1
- package/docs/BabylonStakeExtra.md +3 -3
- package/docs/BabylonStakingExtra.md +14 -0
- package/docs/BabylonValidator.md +6 -5
- package/docs/BaseStakeSource.md +11 -0
- package/docs/BookkeepingRecord.md +19 -0
- package/docs/BookkeepingSummary.md +12 -0
- package/docs/BroadcastSignedTransactions201ResponseInner.md +10 -0
- package/docs/BroadcastSignedTransactionsRequest.md +9 -0
- package/docs/ChainInfo.md +1 -0
- package/docs/CheckLoopTransfers200ResponseInner.md +1 -1
- package/docs/ContractCallDestination.md +1 -1
- package/docs/CreateStakeActivity.md +2 -2
- package/docs/CreateStakeActivity201Response.md +10 -0
- package/docs/CreateStakeActivityExtra.md +3 -5
- package/docs/CreateStakeActivityRequest.md +15 -0
- package/docs/CreateUnstakeActivity.md +2 -2
- package/docs/CreateUnstakeActivityRequest.md +13 -0
- package/docs/CreateWithdrawActivity.md +3 -3
- package/docs/CreateWithdrawActivityRequest.md +14 -0
- package/docs/EigenLayerLstStakeExtra.md +1 -1
- package/docs/EstimateStakeFee.md +2 -2
- package/docs/EstimateUnstakeFee.md +2 -2
- package/docs/EstimateWithdrawFee.md +3 -3
- package/docs/EvmContractCallDestination.md +1 -1
- package/docs/ExchangeTransferDestination.md +1 -1
- package/docs/ExtendedTokenInfo.md +2 -0
- package/docs/GetStakingEstimationFee201Response.md +11 -0
- package/docs/GetStakingEstimationFeeRequest.md +17 -0
- package/docs/ListStakingActivities200Response.md +10 -0
- package/docs/ListStakingPools200Response.md +10 -0
- package/docs/ListStakings200Response.md +10 -0
- package/docs/MpcStakeSource.md +11 -0
- package/docs/OAuthApi.md +2 -2
- package/docs/PoolDetails.md +13 -13
- package/docs/PoolDetailsAllOfValidatorsInfo.md +6 -6
- package/docs/PoolSummary.md +6 -6
- package/docs/RawMessageSignDestination.md +10 -0
- package/docs/StakeSourceType.md +10 -0
- package/docs/StakingPoolType.md +0 -4
- package/docs/StakingSource.md +1 -3
- package/docs/Stakings.md +10 -13
- package/docs/StakingsApi.md +570 -0
- package/docs/StakingsExtra.md +14 -0
- package/docs/StakingsValidatorInfo.md +5 -5
- package/docs/TokenInfo.md +2 -0
- package/docs/TransactionDepositToAddressDestination.md +1 -1
- package/docs/TransactionDepositToWalletDestination.md +1 -1
- package/docs/TransactionDestination.md +2 -2
- package/docs/TransactionEvmContractDestination.md +1 -1
- package/docs/TransactionTokeApproval.md +2 -0
- package/docs/TransactionTransferToAddressDestinationAccountOutput.md +1 -1
- package/docs/TransactionTransferToAddressDestinationUtxoOutputsInner.md +1 -1
- package/docs/TransactionTransferToWalletDestination.md +1 -1
- package/docs/TransactionType.md +4 -0
- package/docs/TransactionsApi.md +110 -2
- package/docs/TransferDestination.md +1 -1
- package/docs/WalletBalanceSnapshot.md +10 -0
- package/docs/WalletBalanceSnapshotRecord.md +13 -0
- package/docs/WalletsApi.md +0 -55
- package/docs/WalletsExchangeWalletApi.md +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1,123 @@
|
|
|
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 CreateStakeActivity201Response model module.
|
|
29
|
+
* @module model/CreateStakeActivity201Response
|
|
30
|
+
*/
|
|
31
|
+
var CreateStakeActivity201Response = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>CreateStakeActivity201Response</code>.
|
|
34
|
+
* @alias module:model/CreateStakeActivity201Response
|
|
35
|
+
* @param activity_id {String} The activity ID.
|
|
36
|
+
*/
|
|
37
|
+
function CreateStakeActivity201Response(activity_id) {
|
|
38
|
+
_classCallCheck(this, CreateStakeActivity201Response);
|
|
39
|
+
CreateStakeActivity201Response.initialize(this, activity_id);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Initializes the fields of this object.
|
|
44
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
45
|
+
* Only for internal use.
|
|
46
|
+
*/
|
|
47
|
+
return _createClass(CreateStakeActivity201Response, null, [{
|
|
48
|
+
key: "initialize",
|
|
49
|
+
value: function initialize(obj, activity_id) {
|
|
50
|
+
obj['activity_id'] = activity_id;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Constructs a <code>CreateStakeActivity201Response</code> from a plain JavaScript object, optionally creating a new instance.
|
|
55
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
56
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
57
|
+
* @param {module:model/CreateStakeActivity201Response} obj Optional instance to populate.
|
|
58
|
+
* @return {module:model/CreateStakeActivity201Response} The populated <code>CreateStakeActivity201Response</code> instance.
|
|
59
|
+
*/
|
|
60
|
+
}, {
|
|
61
|
+
key: "constructFromObject",
|
|
62
|
+
value: function constructFromObject(data, obj) {
|
|
63
|
+
if (data) {
|
|
64
|
+
obj = obj || new CreateStakeActivity201Response();
|
|
65
|
+
if (data.hasOwnProperty('activity_id')) {
|
|
66
|
+
obj['activity_id'] = _ApiClient["default"].convertToType(data['activity_id'], 'String');
|
|
67
|
+
}
|
|
68
|
+
if (data.hasOwnProperty('staking_id')) {
|
|
69
|
+
obj['staking_id'] = _ApiClient["default"].convertToType(data['staking_id'], 'String');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return obj;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Validates the JSON data with respect to <code>CreateStakeActivity201Response</code>.
|
|
77
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
78
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateStakeActivity201Response</code>.
|
|
79
|
+
*/
|
|
80
|
+
}, {
|
|
81
|
+
key: "validateJSON",
|
|
82
|
+
value: function validateJSON(data) {
|
|
83
|
+
// check to make sure all required properties are present in the JSON string
|
|
84
|
+
var _iterator = _createForOfIteratorHelper(CreateStakeActivity201Response.RequiredProperties),
|
|
85
|
+
_step;
|
|
86
|
+
try {
|
|
87
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
88
|
+
var property = _step.value;
|
|
89
|
+
if (!data.hasOwnProperty(property)) {
|
|
90
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// ensure the json data is a string
|
|
94
|
+
} catch (err) {
|
|
95
|
+
_iterator.e(err);
|
|
96
|
+
} finally {
|
|
97
|
+
_iterator.f();
|
|
98
|
+
}
|
|
99
|
+
if (data['activity_id'] && !(typeof data['activity_id'] === 'string' || data['activity_id'] instanceof String)) {
|
|
100
|
+
throw new Error("Expected the field `activity_id` to be a primitive type in the JSON string but got " + data['activity_id']);
|
|
101
|
+
}
|
|
102
|
+
// ensure the json data is a string
|
|
103
|
+
if (data['staking_id'] && !(typeof data['staking_id'] === 'string' || data['staking_id'] instanceof String)) {
|
|
104
|
+
throw new Error("Expected the field `staking_id` to be a primitive type in the JSON string but got " + data['staking_id']);
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
}]);
|
|
109
|
+
}();
|
|
110
|
+
CreateStakeActivity201Response.RequiredProperties = ["activity_id"];
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The activity ID.
|
|
114
|
+
* @member {String} activity_id
|
|
115
|
+
*/
|
|
116
|
+
CreateStakeActivity201Response.prototype['activity_id'] = undefined;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The ID of the staking position.
|
|
120
|
+
* @member {String} staking_id
|
|
121
|
+
*/
|
|
122
|
+
CreateStakeActivity201Response.prototype['staking_id'] = undefined;
|
|
123
|
+
var _default = exports["default"] = CreateStakeActivity201Response;
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
8
|
var _BabylonStakeExtra = _interopRequireDefault(require("./BabylonStakeExtra"));
|
|
9
|
-
var _EigenLayerLstStakeExtra = _interopRequireDefault(require("./EigenLayerLstStakeExtra"));
|
|
10
|
-
var _EigenLayerNativeStakeExtra = _interopRequireDefault(require("./EigenLayerNativeStakeExtra"));
|
|
11
9
|
var _StakingPoolType = _interopRequireDefault(require("./StakingPoolType"));
|
|
12
10
|
var _CreateStakeActivityExtra;
|
|
13
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -20,7 +18,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
20
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); } /**
|
|
21
19
|
* Cobo Wallet as a Service 2.0
|
|
22
20
|
*
|
|
23
|
-
* Contact:
|
|
21
|
+
* Contact: help@cobo.com
|
|
24
22
|
*
|
|
25
23
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
26
24
|
* https://openapi-generator.tech
|
|
@@ -35,7 +33,7 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
|
|
|
35
33
|
/**
|
|
36
34
|
* Constructs a new <code>CreateStakeActivityExtra</code>.
|
|
37
35
|
* @alias module:model/CreateStakeActivityExtra
|
|
38
|
-
* @param {(module:model/BabylonStakeExtra
|
|
36
|
+
* @param {(module:model/BabylonStakeExtra)} instance The actual instance to initialize CreateStakeActivityExtra.
|
|
39
37
|
*/
|
|
40
38
|
function CreateStakeActivityExtra() {
|
|
41
39
|
var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
@@ -53,6 +51,19 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
|
|
|
53
51
|
}
|
|
54
52
|
var match = 0;
|
|
55
53
|
var errorMessages = [];
|
|
54
|
+
var discriminatorValue = instance["pool_type"];
|
|
55
|
+
if (discriminatorValue) {
|
|
56
|
+
switch (discriminatorValue) {
|
|
57
|
+
case "Babylon":
|
|
58
|
+
this.actualInstance = _BabylonStakeExtra["default"].constructFromObject(instance);
|
|
59
|
+
match++;
|
|
60
|
+
break;
|
|
61
|
+
default:
|
|
62
|
+
errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
56
67
|
try {
|
|
57
68
|
if (instance instanceof _BabylonStakeExtra["default"]) {
|
|
58
69
|
this.actualInstance = instance;
|
|
@@ -60,51 +71,29 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
|
|
|
60
71
|
// plain JS object
|
|
61
72
|
// create BabylonStakeExtra from JS object
|
|
62
73
|
this.actualInstance = _BabylonStakeExtra["default"].constructFromObject(instance);
|
|
63
|
-
} else
|
|
64
|
-
|
|
74
|
+
} else {
|
|
75
|
+
if (_BabylonStakeExtra["default"].constructFromObject(instance)) {
|
|
76
|
+
if (!!_BabylonStakeExtra["default"].constructFromObject(instance).toJSON) {
|
|
77
|
+
if (_BabylonStakeExtra["default"].constructFromObject(instance).toJSON()) {
|
|
78
|
+
this.actualInstance = _BabylonStakeExtra["default"].constructFromObject(instance);
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
this.actualInstance = _BabylonStakeExtra["default"].constructFromObject(instance);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
65
84
|
}
|
|
66
85
|
match++;
|
|
67
86
|
} catch (err) {
|
|
68
87
|
// json data failed to deserialize into BabylonStakeExtra
|
|
69
88
|
errorMessages.push("Failed to construct BabylonStakeExtra: " + err);
|
|
70
89
|
}
|
|
71
|
-
try {
|
|
72
|
-
if (instance instanceof _EigenLayerLstStakeExtra["default"]) {
|
|
73
|
-
this.actualInstance = instance;
|
|
74
|
-
} else if (!!_EigenLayerLstStakeExtra["default"].validateJSON && _EigenLayerLstStakeExtra["default"].validateJSON(instance)) {
|
|
75
|
-
// plain JS object
|
|
76
|
-
// create EigenLayerLstStakeExtra from JS object
|
|
77
|
-
this.actualInstance = _EigenLayerLstStakeExtra["default"].constructFromObject(instance);
|
|
78
|
-
} else if (_EigenLayerLstStakeExtra["default"].constructFromObject(instance)) {
|
|
79
|
-
this.actualInstance = _EigenLayerLstStakeExtra["default"].constructFromObject(instance);
|
|
80
|
-
}
|
|
81
|
-
match++;
|
|
82
|
-
} catch (err) {
|
|
83
|
-
// json data failed to deserialize into EigenLayerLstStakeExtra
|
|
84
|
-
errorMessages.push("Failed to construct EigenLayerLstStakeExtra: " + err);
|
|
85
|
-
}
|
|
86
|
-
try {
|
|
87
|
-
if (instance instanceof _EigenLayerNativeStakeExtra["default"]) {
|
|
88
|
-
this.actualInstance = instance;
|
|
89
|
-
} else if (!!_EigenLayerNativeStakeExtra["default"].validateJSON && _EigenLayerNativeStakeExtra["default"].validateJSON(instance)) {
|
|
90
|
-
// plain JS object
|
|
91
|
-
// create EigenLayerNativeStakeExtra from JS object
|
|
92
|
-
this.actualInstance = _EigenLayerNativeStakeExtra["default"].constructFromObject(instance);
|
|
93
|
-
} else if (_EigenLayerNativeStakeExtra["default"].constructFromObject(instance)) {
|
|
94
|
-
this.actualInstance = _EigenLayerNativeStakeExtra["default"].constructFromObject(instance);
|
|
95
|
-
}
|
|
96
|
-
match++;
|
|
97
|
-
} catch (err) {
|
|
98
|
-
// json data failed to deserialize into EigenLayerNativeStakeExtra
|
|
99
|
-
errorMessages.push("Failed to construct EigenLayerNativeStakeExtra: " + err);
|
|
100
|
-
}
|
|
101
90
|
|
|
102
91
|
// if (match > 1) {
|
|
103
|
-
// throw new Error("Multiple matches found constructing `CreateStakeActivityExtra` with oneOf schemas BabylonStakeExtra
|
|
92
|
+
// throw new Error("Multiple matches found constructing `CreateStakeActivityExtra` with oneOf schemas BabylonStakeExtra. Input: " + JSON.stringify(instance));
|
|
104
93
|
// } else
|
|
105
94
|
if (match === 0) {
|
|
106
95
|
// this.actualInstance = null; // clear the actual instance in case there are multiple matches
|
|
107
|
-
// throw new Error("No match found constructing `CreateStakeActivityExtra` with oneOf schemas BabylonStakeExtra
|
|
96
|
+
// throw new Error("No match found constructing `CreateStakeActivityExtra` with oneOf schemas BabylonStakeExtra. Details: " +
|
|
108
97
|
// errorMessages.join(", "));
|
|
109
98
|
return;
|
|
110
99
|
} else {// only 1 match
|
|
@@ -123,16 +112,16 @@ var CreateStakeActivityExtra = /*#__PURE__*/function () {
|
|
|
123
112
|
key: "getActualInstance",
|
|
124
113
|
value:
|
|
125
114
|
/**
|
|
126
|
-
* Gets the actual instance, which can be <code>BabylonStakeExtra</code
|
|
127
|
-
* @return {(module:model/BabylonStakeExtra
|
|
115
|
+
* Gets the actual instance, which can be <code>BabylonStakeExtra</code>.
|
|
116
|
+
* @return {(module:model/BabylonStakeExtra)} The actual instance.
|
|
128
117
|
*/
|
|
129
118
|
function getActualInstance() {
|
|
130
119
|
return this.actualInstance;
|
|
131
120
|
}
|
|
132
121
|
|
|
133
122
|
/**
|
|
134
|
-
* Sets the actual instance, which can be <code>BabylonStakeExtra</code
|
|
135
|
-
* @param {(module:model/BabylonStakeExtra
|
|
123
|
+
* Sets the actual instance, which can be <code>BabylonStakeExtra</code>.
|
|
124
|
+
* @param {(module:model/BabylonStakeExtra)} obj The actual instance.
|
|
136
125
|
*/
|
|
137
126
|
}, {
|
|
138
127
|
key: "setActualInstance",
|
|
@@ -161,33 +150,21 @@ _defineProperty(CreateStakeActivityExtra, "fromJSON", function (json_string) {
|
|
|
161
150
|
CreateStakeActivityExtra.prototype['pool_type'] = undefined;
|
|
162
151
|
|
|
163
152
|
/**
|
|
164
|
-
* The public key of finality provider.
|
|
153
|
+
* The public key of the finality provider.
|
|
165
154
|
* @member {String} finality_provider_public_key
|
|
166
155
|
*/
|
|
167
156
|
CreateStakeActivityExtra.prototype['finality_provider_public_key'] = undefined;
|
|
168
157
|
|
|
169
158
|
/**
|
|
170
|
-
* The
|
|
159
|
+
* The number of blocks that need to be processed before the locked tokens are unlocked and become accessible.
|
|
171
160
|
* @member {Number} stake_block_time
|
|
172
161
|
*/
|
|
173
162
|
CreateStakeActivityExtra.prototype['stake_block_time'] = undefined;
|
|
174
163
|
|
|
175
164
|
/**
|
|
176
|
-
* Whether to
|
|
177
|
-
* @member {Boolean}
|
|
178
|
-
*/
|
|
179
|
-
CreateStakeActivityExtra.prototype['only_sign'] = undefined;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* The operator address.
|
|
183
|
-
* @member {String} operator
|
|
184
|
-
*/
|
|
185
|
-
CreateStakeActivityExtra.prototype['operator'] = undefined;
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* The fee recipient address, if not provided the staker address will be used.
|
|
189
|
-
* @member {Number} fee_recipient
|
|
165
|
+
* Whether to automatically broadcast the transaction. The default value is `true`. - `true`: Automatically broadcast the transaction. - `false`: The transaction will not be submitted to the blockchain automatically. You can call [Broadcast signed transactions](/v2/api-references/transactions/broadcast-signed-transactions) to broadcast the transaction to the blockchain, or retrieve the signed raw transaction data `raw_tx` by calling [Get transaction information](/v2/api-references/transactions/get-transaction-information) and broadcast it yourself.
|
|
166
|
+
* @member {Boolean} auto_broadcast
|
|
190
167
|
*/
|
|
191
|
-
CreateStakeActivityExtra.prototype['
|
|
192
|
-
CreateStakeActivityExtra.OneOf = ["BabylonStakeExtra"
|
|
168
|
+
CreateStakeActivityExtra.prototype['auto_broadcast'] = undefined;
|
|
169
|
+
CreateStakeActivityExtra.OneOf = ["BabylonStakeExtra"];
|
|
193
170
|
var _default = exports["default"] = CreateStakeActivityExtra;
|
|
@@ -0,0 +1,246 @@
|
|
|
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 _ActivityInitiator = _interopRequireDefault(require("./ActivityInitiator"));
|
|
9
|
+
var _CreateStakeActivity = _interopRequireDefault(require("./CreateStakeActivity"));
|
|
10
|
+
var _CreateStakeActivityExtra = _interopRequireDefault(require("./CreateStakeActivityExtra"));
|
|
11
|
+
var _StakingSource = _interopRequireDefault(require("./StakingSource"));
|
|
12
|
+
var _TransactionRequestFee = _interopRequireDefault(require("./TransactionRequestFee"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
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); }
|
|
15
|
+
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; } } }; }
|
|
16
|
+
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; } }
|
|
17
|
+
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; }
|
|
18
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
19
|
+
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); } }
|
|
20
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
|
+
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); } /**
|
|
23
|
+
* Cobo Wallet as a Service 2.0
|
|
24
|
+
*
|
|
25
|
+
* Contact: help@cobo.com
|
|
26
|
+
*
|
|
27
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
28
|
+
* https://openapi-generator.tech
|
|
29
|
+
* Do not edit the class manually.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* The CreateStakeActivityRequest model module.
|
|
34
|
+
* @module model/CreateStakeActivityRequest
|
|
35
|
+
*/
|
|
36
|
+
var CreateStakeActivityRequest = /*#__PURE__*/function () {
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new <code>CreateStakeActivityRequest</code>.
|
|
39
|
+
* @alias module:model/CreateStakeActivityRequest
|
|
40
|
+
* @implements module:model/CreateStakeActivity
|
|
41
|
+
* @implements module:model/ActivityInitiator
|
|
42
|
+
* @param pool_id {String} The ID of the staking pool.
|
|
43
|
+
* @param amount {String} The amount to stake.
|
|
44
|
+
* @param fee {module:model/TransactionRequestFee}
|
|
45
|
+
* @param extra {module:model/CreateStakeActivityExtra}
|
|
46
|
+
*/
|
|
47
|
+
function CreateStakeActivityRequest(pool_id, amount, fee, extra) {
|
|
48
|
+
_classCallCheck(this, CreateStakeActivityRequest);
|
|
49
|
+
_CreateStakeActivity["default"].initialize(this, pool_id, amount, fee, extra);
|
|
50
|
+
_ActivityInitiator["default"].initialize(this);
|
|
51
|
+
CreateStakeActivityRequest.initialize(this, pool_id, amount, fee, extra);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Initializes the fields of this object.
|
|
56
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
57
|
+
* Only for internal use.
|
|
58
|
+
*/
|
|
59
|
+
return _createClass(CreateStakeActivityRequest, null, [{
|
|
60
|
+
key: "initialize",
|
|
61
|
+
value: function initialize(obj, pool_id, amount, fee, extra) {
|
|
62
|
+
obj['pool_id'] = pool_id;
|
|
63
|
+
obj['amount'] = amount;
|
|
64
|
+
obj['fee'] = fee;
|
|
65
|
+
obj['extra'] = extra;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Constructs a <code>CreateStakeActivityRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
70
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
71
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
72
|
+
* @param {module:model/CreateStakeActivityRequest} obj Optional instance to populate.
|
|
73
|
+
* @return {module:model/CreateStakeActivityRequest} The populated <code>CreateStakeActivityRequest</code> instance.
|
|
74
|
+
*/
|
|
75
|
+
}, {
|
|
76
|
+
key: "constructFromObject",
|
|
77
|
+
value: function constructFromObject(data, obj) {
|
|
78
|
+
if (data) {
|
|
79
|
+
obj = obj || new CreateStakeActivityRequest();
|
|
80
|
+
_CreateStakeActivity["default"].constructFromObject(data, obj);
|
|
81
|
+
_ActivityInitiator["default"].constructFromObject(data, obj);
|
|
82
|
+
if (data.hasOwnProperty('request_id')) {
|
|
83
|
+
obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
|
|
84
|
+
}
|
|
85
|
+
if (data.hasOwnProperty('source')) {
|
|
86
|
+
obj['source'] = _StakingSource["default"].constructFromObject(data['source']);
|
|
87
|
+
}
|
|
88
|
+
if (data.hasOwnProperty('pool_id')) {
|
|
89
|
+
obj['pool_id'] = _ApiClient["default"].convertToType(data['pool_id'], 'String');
|
|
90
|
+
}
|
|
91
|
+
if (data.hasOwnProperty('amount')) {
|
|
92
|
+
obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
|
|
93
|
+
}
|
|
94
|
+
if (data.hasOwnProperty('fee')) {
|
|
95
|
+
obj['fee'] = _TransactionRequestFee["default"].constructFromObject(data['fee']);
|
|
96
|
+
}
|
|
97
|
+
if (data.hasOwnProperty('extra')) {
|
|
98
|
+
obj['extra'] = _CreateStakeActivityExtra["default"].constructFromObject(data['extra']);
|
|
99
|
+
}
|
|
100
|
+
if (data.hasOwnProperty('app_initiator')) {
|
|
101
|
+
obj['app_initiator'] = _ApiClient["default"].convertToType(data['app_initiator'], 'String');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return obj;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Validates the JSON data with respect to <code>CreateStakeActivityRequest</code>.
|
|
109
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
110
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateStakeActivityRequest</code>.
|
|
111
|
+
*/
|
|
112
|
+
}, {
|
|
113
|
+
key: "validateJSON",
|
|
114
|
+
value: function validateJSON(data) {
|
|
115
|
+
// check to make sure all required properties are present in the JSON string
|
|
116
|
+
var _iterator = _createForOfIteratorHelper(CreateStakeActivityRequest.RequiredProperties),
|
|
117
|
+
_step;
|
|
118
|
+
try {
|
|
119
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
120
|
+
var property = _step.value;
|
|
121
|
+
if (!data.hasOwnProperty(property)) {
|
|
122
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// ensure the json data is a string
|
|
126
|
+
} catch (err) {
|
|
127
|
+
_iterator.e(err);
|
|
128
|
+
} finally {
|
|
129
|
+
_iterator.f();
|
|
130
|
+
}
|
|
131
|
+
if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
|
|
132
|
+
throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
|
|
133
|
+
}
|
|
134
|
+
// validate the optional field `source`
|
|
135
|
+
if (data['source']) {
|
|
136
|
+
// data not null
|
|
137
|
+
if (!!_StakingSource["default"].validateJSON) {
|
|
138
|
+
_StakingSource["default"].validateJSON(data['source']);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// ensure the json data is a string
|
|
142
|
+
if (data['pool_id'] && !(typeof data['pool_id'] === 'string' || data['pool_id'] instanceof String)) {
|
|
143
|
+
throw new Error("Expected the field `pool_id` to be a primitive type in the JSON string but got " + data['pool_id']);
|
|
144
|
+
}
|
|
145
|
+
// ensure the json data is a string
|
|
146
|
+
if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
|
|
147
|
+
throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
|
|
148
|
+
}
|
|
149
|
+
// validate the optional field `fee`
|
|
150
|
+
if (data['fee']) {
|
|
151
|
+
// data not null
|
|
152
|
+
if (!!_TransactionRequestFee["default"].validateJSON) {
|
|
153
|
+
_TransactionRequestFee["default"].validateJSON(data['fee']);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// validate the optional field `extra`
|
|
157
|
+
if (data['extra']) {
|
|
158
|
+
// data not null
|
|
159
|
+
if (!!_CreateStakeActivityExtra["default"].validateJSON) {
|
|
160
|
+
_CreateStakeActivityExtra["default"].validateJSON(data['extra']);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// ensure the json data is a string
|
|
164
|
+
if (data['app_initiator'] && !(typeof data['app_initiator'] === 'string' || data['app_initiator'] instanceof String)) {
|
|
165
|
+
throw new Error("Expected the field `app_initiator` to be a primitive type in the JSON string but got " + data['app_initiator']);
|
|
166
|
+
}
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
}]);
|
|
170
|
+
}();
|
|
171
|
+
CreateStakeActivityRequest.RequiredProperties = ["pool_id", "amount", "fee", "extra"];
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
|
|
175
|
+
* @member {String} request_id
|
|
176
|
+
*/
|
|
177
|
+
CreateStakeActivityRequest.prototype['request_id'] = undefined;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @member {module:model/StakingSource} source
|
|
181
|
+
*/
|
|
182
|
+
CreateStakeActivityRequest.prototype['source'] = undefined;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The ID of the staking pool.
|
|
186
|
+
* @member {String} pool_id
|
|
187
|
+
*/
|
|
188
|
+
CreateStakeActivityRequest.prototype['pool_id'] = undefined;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* The amount to stake.
|
|
192
|
+
* @member {String} amount
|
|
193
|
+
*/
|
|
194
|
+
CreateStakeActivityRequest.prototype['amount'] = undefined;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @member {module:model/TransactionRequestFee} fee
|
|
198
|
+
*/
|
|
199
|
+
CreateStakeActivityRequest.prototype['fee'] = undefined;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @member {module:model/CreateStakeActivityExtra} extra
|
|
203
|
+
*/
|
|
204
|
+
CreateStakeActivityRequest.prototype['extra'] = undefined;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* The initiator of the staking activity. If you do not specify this property, the WaaS service will automatically designate the API key as the initiator.
|
|
208
|
+
* @member {String} app_initiator
|
|
209
|
+
*/
|
|
210
|
+
CreateStakeActivityRequest.prototype['app_initiator'] = undefined;
|
|
211
|
+
|
|
212
|
+
// Implement CreateStakeActivity interface:
|
|
213
|
+
/**
|
|
214
|
+
* The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
|
|
215
|
+
* @member {String} request_id
|
|
216
|
+
*/
|
|
217
|
+
_CreateStakeActivity["default"].prototype['request_id'] = undefined;
|
|
218
|
+
/**
|
|
219
|
+
* @member {module:model/StakingSource} source
|
|
220
|
+
*/
|
|
221
|
+
_CreateStakeActivity["default"].prototype['source'] = undefined;
|
|
222
|
+
/**
|
|
223
|
+
* The ID of the staking pool.
|
|
224
|
+
* @member {String} pool_id
|
|
225
|
+
*/
|
|
226
|
+
_CreateStakeActivity["default"].prototype['pool_id'] = undefined;
|
|
227
|
+
/**
|
|
228
|
+
* The amount to stake.
|
|
229
|
+
* @member {String} amount
|
|
230
|
+
*/
|
|
231
|
+
_CreateStakeActivity["default"].prototype['amount'] = undefined;
|
|
232
|
+
/**
|
|
233
|
+
* @member {module:model/TransactionRequestFee} fee
|
|
234
|
+
*/
|
|
235
|
+
_CreateStakeActivity["default"].prototype['fee'] = undefined;
|
|
236
|
+
/**
|
|
237
|
+
* @member {module:model/CreateStakeActivityExtra} extra
|
|
238
|
+
*/
|
|
239
|
+
_CreateStakeActivity["default"].prototype['extra'] = undefined;
|
|
240
|
+
// Implement ActivityInitiator interface:
|
|
241
|
+
/**
|
|
242
|
+
* The initiator of the staking activity. If you do not specify this property, the WaaS service will automatically designate the API key as the initiator.
|
|
243
|
+
* @member {String} app_initiator
|
|
244
|
+
*/
|
|
245
|
+
_ActivityInitiator["default"].prototype['app_initiator'] = undefined;
|
|
246
|
+
var _default = exports["default"] = CreateStakeActivityRequest;
|
|
@@ -18,7 +18,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
18
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
19
|
* Cobo Wallet as a Service 2.0
|
|
20
20
|
*
|
|
21
|
-
* Contact:
|
|
21
|
+
* Contact: help@cobo.com
|
|
22
22
|
*
|
|
23
23
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
24
24
|
* https://openapi-generator.tech
|
|
@@ -19,7 +19,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
19
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
20
|
* Cobo Wallet as a Service 2.0
|
|
21
21
|
*
|
|
22
|
-
* Contact:
|
|
22
|
+
* Contact: help@cobo.com
|
|
23
23
|
*
|
|
24
24
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
25
25
|
* https://openapi-generator.tech
|
|
@@ -18,7 +18,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
18
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
19
|
* Cobo Wallet as a Service 2.0
|
|
20
20
|
*
|
|
21
|
-
* Contact:
|
|
21
|
+
* Contact: help@cobo.com
|
|
22
22
|
*
|
|
23
23
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
24
24
|
* https://openapi-generator.tech
|
|
@@ -33,7 +33,7 @@ var CreateUnstakeActivity = /*#__PURE__*/function () {
|
|
|
33
33
|
/**
|
|
34
34
|
* Constructs a new <code>CreateUnstakeActivity</code>.
|
|
35
35
|
* @alias module:model/CreateUnstakeActivity
|
|
36
|
-
* @param staking_id {String} The
|
|
36
|
+
* @param staking_id {String} The ID of the corresponding staking position.
|
|
37
37
|
*/
|
|
38
38
|
function CreateUnstakeActivity(staking_id) {
|
|
39
39
|
_classCallCheck(this, CreateUnstakeActivity);
|
|
@@ -134,13 +134,13 @@ CreateUnstakeActivity.RequiredProperties = ["staking_id"];
|
|
|
134
134
|
CreateUnstakeActivity.prototype['request_id'] = undefined;
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
|
-
* The
|
|
137
|
+
* The ID of the corresponding staking position.
|
|
138
138
|
* @member {String} staking_id
|
|
139
139
|
*/
|
|
140
140
|
CreateUnstakeActivity.prototype['staking_id'] = undefined;
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
* The amount to
|
|
143
|
+
* The amount to unstake. For the Babylon protocol, this property is ignored.
|
|
144
144
|
* @member {String} amount
|
|
145
145
|
*/
|
|
146
146
|
CreateUnstakeActivity.prototype['amount'] = undefined;
|