@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
package/dist/api/OAuthApi.js
CHANGED
|
@@ -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
|
|
@@ -45,7 +45,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Get access token
|
|
48
|
-
* <Note>This operation is only applicable to Cobo Portal App developers. To call this operation, you need to use the OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to get an access token and a refresh token with a specified App ID, Organization ID, and grant type. Access tokens allow the app to signal to the WaaS service that it has received permission to access specific resources of the app user's [organization](https://manuals.cobo.com/en/portal/organization/introduction). Once the app has been granted permission by the organization's admin, it can use this operation to obtain both an access token and a refresh token. For security purposes, access tokens expire after a certain period. Once they expire, the app needs to call [Refresh token](/v2/api-references/oauth/refresh-access-token) to get a new access token and a new refresh token.
|
|
48
|
+
* <Note>This operation is only applicable to Cobo Portal App developers. To call this operation, you need to use the OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to get an access token and a refresh token with a specified App ID, Organization ID, and grant type. Access tokens allow the app to signal to the WaaS service that it has received permission to access specific resources of the app user's [organization](https://manuals.cobo.com/en/portal/organization/introduction). Once the app has been granted permission by the organization's admin, it can use this operation to obtain both an access token and a refresh token. For security purposes, access tokens expire after a certain period. Once they expire, the app needs to call [Refresh token](/v2/api-references/oauth/refresh-access-token) to get a new access token and a new refresh token.
|
|
49
49
|
* @param {String} client_id The App ID, a unique identifier to distinguish Cobo Portal Apps. You can get the App ID by retrieving the Manifest file after receiving the notification of app launch approval.
|
|
50
50
|
* @param {String} org_id Organization ID, a unique identifier to distinguish different organizations. You can get the Organization ID by retrieving the Manifest file after receiving the notification of app launch approval.
|
|
51
51
|
* @param {String} grant_type The OAuth grant type. Set the value as `org_implicit`.
|
|
@@ -87,7 +87,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
89
|
* Get access token
|
|
90
|
-
* <Note>This operation is only applicable to Cobo Portal App developers. To call this operation, you need to use the OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to get an access token and a refresh token with a specified App ID, Organization ID, and grant type. Access tokens allow the app to signal to the WaaS service that it has received permission to access specific resources of the app user's [organization](https://manuals.cobo.com/en/portal/organization/introduction). Once the app has been granted permission by the organization's admin, it can use this operation to obtain both an access token and a refresh token. For security purposes, access tokens expire after a certain period. Once they expire, the app needs to call [Refresh token](/v2/api-references/oauth/refresh-access-token) to get a new access token and a new refresh token.
|
|
90
|
+
* <Note>This operation is only applicable to Cobo Portal App developers. To call this operation, you need to use the OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to get an access token and a refresh token with a specified App ID, Organization ID, and grant type. Access tokens allow the app to signal to the WaaS service that it has received permission to access specific resources of the app user's [organization](https://manuals.cobo.com/en/portal/organization/introduction). Once the app has been granted permission by the organization's admin, it can use this operation to obtain both an access token and a refresh token. For security purposes, access tokens expire after a certain period. Once they expire, the app needs to call [Refresh token](/v2/api-references/oauth/refresh-access-token) to get a new access token and a new refresh token.
|
|
91
91
|
* @param {String} client_id The App ID, a unique identifier to distinguish Cobo Portal Apps. You can get the App ID by retrieving the Manifest file after receiving the notification of app launch approval.
|
|
92
92
|
* @param {String} org_id Organization ID, a unique identifier to distinguish different organizations. You can get the Organization ID by retrieving the Manifest file after receiving the notification of app launch approval.
|
|
93
93
|
* @param {String} grant_type The OAuth grant type. Set the value as `org_implicit`.
|
|
@@ -103,7 +103,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* Refresh access token
|
|
106
|
-
* <Note>This operation is only applicable to Cobo Portal Apps developers. To call this operation, you need to use the OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to obtain a new access token with a specified App ID, grant type and a refresh token. For security purposes, access tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new access token and a new refresh token.
|
|
106
|
+
* <Note>This operation is only applicable to Cobo Portal Apps developers. To call this operation, you need to use the OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to obtain a new access token with a specified App ID, grant type and a refresh token. For security purposes, access tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new access token and a new refresh token.
|
|
107
107
|
* @param {module:model/RefreshTokenRequest} RefreshTokenRequest The request body for refreshing an access token.
|
|
108
108
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RefreshToken200Response} and HTTP response
|
|
109
109
|
*/
|
|
@@ -131,7 +131,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
133
|
* Refresh access token
|
|
134
|
-
* <Note>This operation is only applicable to Cobo Portal Apps developers. To call this operation, you need to use the OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to obtain a new access token with a specified App ID, grant type and a refresh token. For security purposes, access tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new access token and a new refresh token.
|
|
134
|
+
* <Note>This operation is only applicable to Cobo Portal Apps developers. To call this operation, you need to use the OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to obtain a new access token with a specified App ID, grant type and a refresh token. For security purposes, access tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new access token and a new refresh token.
|
|
135
135
|
* @param {module:model/RefreshTokenRequest} RefreshTokenRequest The request body for refreshing an access token.
|
|
136
136
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RefreshToken200Response}
|
|
137
137
|
*/
|
|
@@ -0,0 +1,538 @@
|
|
|
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 _Activity = _interopRequireDefault(require("../model/Activity"));
|
|
9
|
+
var _ActivityStatus = _interopRequireDefault(require("../model/ActivityStatus"));
|
|
10
|
+
var _ActivityType = _interopRequireDefault(require("../model/ActivityType"));
|
|
11
|
+
var _CreateStakeActivity201Response = _interopRequireDefault(require("../model/CreateStakeActivity201Response"));
|
|
12
|
+
var _CreateStakeActivityRequest = _interopRequireDefault(require("../model/CreateStakeActivityRequest"));
|
|
13
|
+
var _CreateUnstakeActivityRequest = _interopRequireDefault(require("../model/CreateUnstakeActivityRequest"));
|
|
14
|
+
var _CreateWithdrawActivityRequest = _interopRequireDefault(require("../model/CreateWithdrawActivityRequest"));
|
|
15
|
+
var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
|
|
16
|
+
var _GetStakingEstimationFee201Response = _interopRequireDefault(require("../model/GetStakingEstimationFee201Response"));
|
|
17
|
+
var _GetStakingEstimationFeeRequest = _interopRequireDefault(require("../model/GetStakingEstimationFeeRequest"));
|
|
18
|
+
var _ListStakingActivities200Response = _interopRequireDefault(require("../model/ListStakingActivities200Response"));
|
|
19
|
+
var _ListStakingPools200Response = _interopRequireDefault(require("../model/ListStakingPools200Response"));
|
|
20
|
+
var _ListStakings200Response = _interopRequireDefault(require("../model/ListStakings200Response"));
|
|
21
|
+
var _PoolDetails = _interopRequireDefault(require("../model/PoolDetails"));
|
|
22
|
+
var _Stakings = _interopRequireDefault(require("../model/Stakings"));
|
|
23
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
24
|
+
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); }
|
|
25
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
26
|
+
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); } }
|
|
27
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
28
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
29
|
+
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); } /**
|
|
30
|
+
* Cobo Wallet as a Service 2.0
|
|
31
|
+
*
|
|
32
|
+
* Contact: help@cobo.com
|
|
33
|
+
*
|
|
34
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
35
|
+
* https://openapi-generator.tech
|
|
36
|
+
* Do not edit the class manually.
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Stakings service.
|
|
41
|
+
* @module api/StakingsApi
|
|
42
|
+
*/
|
|
43
|
+
var StakingsApi = exports["default"] = /*#__PURE__*/function () {
|
|
44
|
+
/**
|
|
45
|
+
* Constructs a new StakingsApi.
|
|
46
|
+
* @alias module:api/StakingsApi
|
|
47
|
+
* @class
|
|
48
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
|
49
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
|
50
|
+
*/
|
|
51
|
+
function StakingsApi(apiClient) {
|
|
52
|
+
_classCallCheck(this, StakingsApi);
|
|
53
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Create stake activity
|
|
58
|
+
* This operation creates a staking request. For some protocols, you can use the `fee` property in the request body to specify the maximum fee you are willing to pay. The transaction will fail if the actual fee exceeds the specified maximum fee. <Note>For the Babylon protocol, you can only select UTXO as the fee model.</Note>
|
|
59
|
+
* @param {Object} opts Optional parameters
|
|
60
|
+
* @param {module:model/CreateStakeActivityRequest} [CreateStakeActivityRequest] The request body to create a staking request.
|
|
61
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CreateStakeActivity201Response} and HTTP response
|
|
62
|
+
*/
|
|
63
|
+
return _createClass(StakingsApi, [{
|
|
64
|
+
key: "createStakeActivityWithHttpInfo",
|
|
65
|
+
value: function createStakeActivityWithHttpInfo(opts) {
|
|
66
|
+
opts = opts || {};
|
|
67
|
+
var postBody = opts['CreateStakeActivityRequest'];
|
|
68
|
+
if (postBody && postBody.toJSON) {
|
|
69
|
+
postBody = postBody.toJSON();
|
|
70
|
+
}
|
|
71
|
+
var pathParams = {};
|
|
72
|
+
var queryParams = {};
|
|
73
|
+
var headerParams = {};
|
|
74
|
+
var formParams = {};
|
|
75
|
+
var authNames = ['CoboAuth'];
|
|
76
|
+
var contentTypes = ['application/json'];
|
|
77
|
+
var accepts = ['application/json'];
|
|
78
|
+
var returnType = _CreateStakeActivity201Response["default"];
|
|
79
|
+
return this.apiClient.callApi('/stakings/activities/stake', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Create stake activity
|
|
84
|
+
* This operation creates a staking request. For some protocols, you can use the `fee` property in the request body to specify the maximum fee you are willing to pay. The transaction will fail if the actual fee exceeds the specified maximum fee. <Note>For the Babylon protocol, you can only select UTXO as the fee model.</Note>
|
|
85
|
+
* @param {Object} opts Optional parameters
|
|
86
|
+
* @param {module:model/CreateStakeActivityRequest} opts.CreateStakeActivityRequest The request body to create a staking request.
|
|
87
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CreateStakeActivity201Response}
|
|
88
|
+
*/
|
|
89
|
+
}, {
|
|
90
|
+
key: "createStakeActivity",
|
|
91
|
+
value: function createStakeActivity(opts) {
|
|
92
|
+
return this.createStakeActivityWithHttpInfo(opts).then(function (response_and_data) {
|
|
93
|
+
return response_and_data.data;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Create unstake activity
|
|
99
|
+
* This operation creates an unstaking request. Your staked tokens will be automatically unlocked once the specified locking period ends. If you want to withdraw your tokens beforehand, you can unstake them with this operation. For some protocols, you can use the `fee` property in the request body to specify the maximum fee you are willing to pay. The transaction will fail if the actual fee exceeds the specified maximum fee. <Note>For the Babylon protocol, you can only select UTXO as the fee model.</Note>
|
|
100
|
+
* @param {Object} opts Optional parameters
|
|
101
|
+
* @param {module:model/CreateUnstakeActivityRequest} [CreateUnstakeActivityRequest] The request body to create a unstaking request.
|
|
102
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CreateStakeActivity201Response} and HTTP response
|
|
103
|
+
*/
|
|
104
|
+
}, {
|
|
105
|
+
key: "createUnstakeActivityWithHttpInfo",
|
|
106
|
+
value: function createUnstakeActivityWithHttpInfo(opts) {
|
|
107
|
+
opts = opts || {};
|
|
108
|
+
var postBody = opts['CreateUnstakeActivityRequest'];
|
|
109
|
+
if (postBody && postBody.toJSON) {
|
|
110
|
+
postBody = postBody.toJSON();
|
|
111
|
+
}
|
|
112
|
+
var pathParams = {};
|
|
113
|
+
var queryParams = {};
|
|
114
|
+
var headerParams = {};
|
|
115
|
+
var formParams = {};
|
|
116
|
+
var authNames = ['CoboAuth'];
|
|
117
|
+
var contentTypes = ['application/json'];
|
|
118
|
+
var accepts = ['application/json'];
|
|
119
|
+
var returnType = _CreateStakeActivity201Response["default"];
|
|
120
|
+
return this.apiClient.callApi('/stakings/activities/unstake', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Create unstake activity
|
|
125
|
+
* This operation creates an unstaking request. Your staked tokens will be automatically unlocked once the specified locking period ends. If you want to withdraw your tokens beforehand, you can unstake them with this operation. For some protocols, you can use the `fee` property in the request body to specify the maximum fee you are willing to pay. The transaction will fail if the actual fee exceeds the specified maximum fee. <Note>For the Babylon protocol, you can only select UTXO as the fee model.</Note>
|
|
126
|
+
* @param {Object} opts Optional parameters
|
|
127
|
+
* @param {module:model/CreateUnstakeActivityRequest} opts.CreateUnstakeActivityRequest The request body to create a unstaking request.
|
|
128
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CreateStakeActivity201Response}
|
|
129
|
+
*/
|
|
130
|
+
}, {
|
|
131
|
+
key: "createUnstakeActivity",
|
|
132
|
+
value: function createUnstakeActivity(opts) {
|
|
133
|
+
return this.createUnstakeActivityWithHttpInfo(opts).then(function (response_and_data) {
|
|
134
|
+
return response_and_data.data;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Create withdraw activity
|
|
140
|
+
* This operation creates a withdrawal request. For some protocols, you can use the `fee` property in the request body to specify the maximum fee you are willing to pay. The transaction will fail if the actual fee exceeds the specified maximum fee. <Note>For the Babylon protocol, you can only select UTXO as the fee model.</Note>
|
|
141
|
+
* @param {Object} opts Optional parameters
|
|
142
|
+
* @param {module:model/CreateWithdrawActivityRequest} [CreateWithdrawActivityRequest] The request body to create a withdraw activity.
|
|
143
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CreateStakeActivity201Response} and HTTP response
|
|
144
|
+
*/
|
|
145
|
+
}, {
|
|
146
|
+
key: "createWithdrawActivityWithHttpInfo",
|
|
147
|
+
value: function createWithdrawActivityWithHttpInfo(opts) {
|
|
148
|
+
opts = opts || {};
|
|
149
|
+
var postBody = opts['CreateWithdrawActivityRequest'];
|
|
150
|
+
if (postBody && postBody.toJSON) {
|
|
151
|
+
postBody = postBody.toJSON();
|
|
152
|
+
}
|
|
153
|
+
var pathParams = {};
|
|
154
|
+
var queryParams = {};
|
|
155
|
+
var headerParams = {};
|
|
156
|
+
var formParams = {};
|
|
157
|
+
var authNames = ['CoboAuth'];
|
|
158
|
+
var contentTypes = ['application/json'];
|
|
159
|
+
var accepts = ['application/json'];
|
|
160
|
+
var returnType = _CreateStakeActivity201Response["default"];
|
|
161
|
+
return this.apiClient.callApi('/stakings/activities/withdraw', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Create withdraw activity
|
|
166
|
+
* This operation creates a withdrawal request. For some protocols, you can use the `fee` property in the request body to specify the maximum fee you are willing to pay. The transaction will fail if the actual fee exceeds the specified maximum fee. <Note>For the Babylon protocol, you can only select UTXO as the fee model.</Note>
|
|
167
|
+
* @param {Object} opts Optional parameters
|
|
168
|
+
* @param {module:model/CreateWithdrawActivityRequest} opts.CreateWithdrawActivityRequest The request body to create a withdraw activity.
|
|
169
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CreateStakeActivity201Response}
|
|
170
|
+
*/
|
|
171
|
+
}, {
|
|
172
|
+
key: "createWithdrawActivity",
|
|
173
|
+
value: function createWithdrawActivity(opts) {
|
|
174
|
+
return this.createWithdrawActivityWithHttpInfo(opts).then(function (response_and_data) {
|
|
175
|
+
return response_and_data.data;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Get staking activity details
|
|
181
|
+
* This operation retrieves the details of a specified staking activity.
|
|
182
|
+
* @param {String} activity_id The activity ID.
|
|
183
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Activity} and HTTP response
|
|
184
|
+
*/
|
|
185
|
+
}, {
|
|
186
|
+
key: "getStakingActivityByIdWithHttpInfo",
|
|
187
|
+
value: function getStakingActivityByIdWithHttpInfo(activity_id) {
|
|
188
|
+
var postBody = null;
|
|
189
|
+
if (postBody && postBody.toJSON) {
|
|
190
|
+
postBody = postBody.toJSON();
|
|
191
|
+
}
|
|
192
|
+
// verify the required parameter 'activity_id' is set
|
|
193
|
+
if (activity_id === undefined || activity_id === null) {
|
|
194
|
+
throw new Error("Missing the required parameter 'activity_id' when calling getStakingActivityById");
|
|
195
|
+
}
|
|
196
|
+
var pathParams = {
|
|
197
|
+
'activity_id': activity_id
|
|
198
|
+
};
|
|
199
|
+
var queryParams = {};
|
|
200
|
+
var headerParams = {};
|
|
201
|
+
var formParams = {};
|
|
202
|
+
var authNames = ['CoboAuth'];
|
|
203
|
+
var contentTypes = [];
|
|
204
|
+
var accepts = ['application/json'];
|
|
205
|
+
var returnType = _Activity["default"];
|
|
206
|
+
return this.apiClient.callApi('/stakings/activities/{activity_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Get staking activity details
|
|
211
|
+
* This operation retrieves the details of a specified staking activity.
|
|
212
|
+
* @param {String} activity_id The activity ID.
|
|
213
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Activity}
|
|
214
|
+
*/
|
|
215
|
+
}, {
|
|
216
|
+
key: "getStakingActivityById",
|
|
217
|
+
value: function getStakingActivityById(activity_id) {
|
|
218
|
+
return this.getStakingActivityByIdWithHttpInfo(activity_id).then(function (response_and_data) {
|
|
219
|
+
return response_and_data.data;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Get staking position details
|
|
225
|
+
* This operation retrieves the detailed information about a specified staking position.
|
|
226
|
+
* @param {String} staking_id The ID of the staking position. You can retrieve a list of staking positions by calling [List staking positions](/v2/api-references/stakings/list-all-stakings).
|
|
227
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Stakings} and HTTP response
|
|
228
|
+
*/
|
|
229
|
+
}, {
|
|
230
|
+
key: "getStakingByIdWithHttpInfo",
|
|
231
|
+
value: function getStakingByIdWithHttpInfo(staking_id) {
|
|
232
|
+
var postBody = null;
|
|
233
|
+
if (postBody && postBody.toJSON) {
|
|
234
|
+
postBody = postBody.toJSON();
|
|
235
|
+
}
|
|
236
|
+
// verify the required parameter 'staking_id' is set
|
|
237
|
+
if (staking_id === undefined || staking_id === null) {
|
|
238
|
+
throw new Error("Missing the required parameter 'staking_id' when calling getStakingById");
|
|
239
|
+
}
|
|
240
|
+
var pathParams = {
|
|
241
|
+
'staking_id': staking_id
|
|
242
|
+
};
|
|
243
|
+
var queryParams = {};
|
|
244
|
+
var headerParams = {};
|
|
245
|
+
var formParams = {};
|
|
246
|
+
var authNames = ['CoboAuth'];
|
|
247
|
+
var contentTypes = [];
|
|
248
|
+
var accepts = ['application/json'];
|
|
249
|
+
var returnType = _Stakings["default"];
|
|
250
|
+
return this.apiClient.callApi('/stakings/{staking_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Get staking position details
|
|
255
|
+
* This operation retrieves the detailed information about a specified staking position.
|
|
256
|
+
* @param {String} staking_id The ID of the staking position. You can retrieve a list of staking positions by calling [List staking positions](/v2/api-references/stakings/list-all-stakings).
|
|
257
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Stakings}
|
|
258
|
+
*/
|
|
259
|
+
}, {
|
|
260
|
+
key: "getStakingById",
|
|
261
|
+
value: function getStakingById(staking_id) {
|
|
262
|
+
return this.getStakingByIdWithHttpInfo(staking_id).then(function (response_and_data) {
|
|
263
|
+
return response_and_data.data;
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Estimate staking fees
|
|
269
|
+
* This operation calculates the fee required for a staking activity based on factors such as network congestion and transaction complexity. For some protocols, you can use the `fee.fee_rate` property in the request body to specify the fee rate you are willing to pay. The `fee.max_fee_amount` property in the request body will be ignored. <Note>For the Babylon protocol, you can only select UTXO as the fee model.</Note>
|
|
270
|
+
* @param {Object} opts Optional parameters
|
|
271
|
+
* @param {module:model/GetStakingEstimationFeeRequest} [GetStakingEstimationFeeRequest] The request body to get the estimated fee of a staking activity.
|
|
272
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetStakingEstimationFee201Response} and HTTP response
|
|
273
|
+
*/
|
|
274
|
+
}, {
|
|
275
|
+
key: "getStakingEstimationFeeWithHttpInfo",
|
|
276
|
+
value: function getStakingEstimationFeeWithHttpInfo(opts) {
|
|
277
|
+
opts = opts || {};
|
|
278
|
+
var postBody = opts['GetStakingEstimationFeeRequest'];
|
|
279
|
+
if (postBody && postBody.toJSON) {
|
|
280
|
+
postBody = postBody.toJSON();
|
|
281
|
+
}
|
|
282
|
+
var pathParams = {};
|
|
283
|
+
var queryParams = {};
|
|
284
|
+
var headerParams = {};
|
|
285
|
+
var formParams = {};
|
|
286
|
+
var authNames = ['CoboAuth'];
|
|
287
|
+
var contentTypes = ['application/json'];
|
|
288
|
+
var accepts = ['application/json'];
|
|
289
|
+
var returnType = _GetStakingEstimationFee201Response["default"];
|
|
290
|
+
return this.apiClient.callApi('/stakings/estimate_fee', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Estimate staking fees
|
|
295
|
+
* This operation calculates the fee required for a staking activity based on factors such as network congestion and transaction complexity. For some protocols, you can use the `fee.fee_rate` property in the request body to specify the fee rate you are willing to pay. The `fee.max_fee_amount` property in the request body will be ignored. <Note>For the Babylon protocol, you can only select UTXO as the fee model.</Note>
|
|
296
|
+
* @param {Object} opts Optional parameters
|
|
297
|
+
* @param {module:model/GetStakingEstimationFeeRequest} opts.GetStakingEstimationFeeRequest The request body to get the estimated fee of a staking activity.
|
|
298
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetStakingEstimationFee201Response}
|
|
299
|
+
*/
|
|
300
|
+
}, {
|
|
301
|
+
key: "getStakingEstimationFee",
|
|
302
|
+
value: function getStakingEstimationFee(opts) {
|
|
303
|
+
return this.getStakingEstimationFeeWithHttpInfo(opts).then(function (response_and_data) {
|
|
304
|
+
return response_and_data.data;
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Get staking pool details
|
|
310
|
+
* This operation retrieves the detailed information about a specified staking pool.
|
|
311
|
+
* @param {String} pool_id The ID of the staking pool. A staking pool is a pairing of a staking protocol and a specific type of token. You can call [List staking pools](/v2/api-references/stakings/list-staking-pools) to retrieve a list of staking pools.
|
|
312
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/PoolDetails} and HTTP response
|
|
313
|
+
*/
|
|
314
|
+
}, {
|
|
315
|
+
key: "getStakingPoolByIdWithHttpInfo",
|
|
316
|
+
value: function getStakingPoolByIdWithHttpInfo(pool_id) {
|
|
317
|
+
var postBody = null;
|
|
318
|
+
if (postBody && postBody.toJSON) {
|
|
319
|
+
postBody = postBody.toJSON();
|
|
320
|
+
}
|
|
321
|
+
// verify the required parameter 'pool_id' is set
|
|
322
|
+
if (pool_id === undefined || pool_id === null) {
|
|
323
|
+
throw new Error("Missing the required parameter 'pool_id' when calling getStakingPoolById");
|
|
324
|
+
}
|
|
325
|
+
var pathParams = {
|
|
326
|
+
'pool_id': pool_id
|
|
327
|
+
};
|
|
328
|
+
var queryParams = {};
|
|
329
|
+
var headerParams = {};
|
|
330
|
+
var formParams = {};
|
|
331
|
+
var authNames = ['CoboAuth'];
|
|
332
|
+
var contentTypes = [];
|
|
333
|
+
var accepts = ['application/json'];
|
|
334
|
+
var returnType = _PoolDetails["default"];
|
|
335
|
+
return this.apiClient.callApi('/stakings/pools/{pool_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Get staking pool details
|
|
340
|
+
* This operation retrieves the detailed information about a specified staking pool.
|
|
341
|
+
* @param {String} pool_id The ID of the staking pool. A staking pool is a pairing of a staking protocol and a specific type of token. You can call [List staking pools](/v2/api-references/stakings/list-staking-pools) to retrieve a list of staking pools.
|
|
342
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PoolDetails}
|
|
343
|
+
*/
|
|
344
|
+
}, {
|
|
345
|
+
key: "getStakingPoolById",
|
|
346
|
+
value: function getStakingPoolById(pool_id) {
|
|
347
|
+
return this.getStakingPoolByIdWithHttpInfo(pool_id).then(function (response_and_data) {
|
|
348
|
+
return response_and_data.data;
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* List staking activities
|
|
354
|
+
* This operation retrieves a list of staking activities.
|
|
355
|
+
* @param {Object} opts Optional parameters
|
|
356
|
+
* @param {String} [pool_id] The ID of the staking pool. A staking pool is a pairing of a staking protocol and a specific type of token. You can call [List staking pools](/v2/api-references/stakings/list-staking-pools) to retrieve a list of staking pools.
|
|
357
|
+
* @param {String} [staking_id] The position ID.
|
|
358
|
+
* @param {module:model/ActivityType} [activity_type]
|
|
359
|
+
* @param {module:model/ActivityStatus} [activity_status]
|
|
360
|
+
* @param {Number} [min_modified_timestamp] The start time of the query. All staking activities updated after the specified time will be retrieved. The time is in Unix timestamp format, measured in milliseconds.
|
|
361
|
+
* @param {Number} [max_modified_timestamp] The end time of the query. All staking activities updated before the specified time will be retrieved. The time is in Unix timestamp format, measured in milliseconds.
|
|
362
|
+
* @param {String} [initiator] The activity initiator, which is your API key by default. You can also specify the initiator when creating the activity.
|
|
363
|
+
* @param {Number} [limit = 10)] The maximum number of objects to return. For most operations, the value range is [1, 50].
|
|
364
|
+
* @param {String} [before] An object ID that serves as a starting point for retrieving data in reverse chronological order. For example, if you specify `before` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`, the request will retrieve a list of data objects that end before the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`. You can set this parameter to the value of `pagination.before` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set `before` to `infinity`, the last page of data is returned.
|
|
365
|
+
* @param {String} [after] An object ID that acts as a starting point for retrieving data in chronological order. For example, if you specify `after` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`, the request will retrieve a list of data objects that start after the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`. You can set this parameter to the value of `pagination.after` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
|
|
366
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListStakingActivities200Response} and HTTP response
|
|
367
|
+
*/
|
|
368
|
+
}, {
|
|
369
|
+
key: "listStakingActivitiesWithHttpInfo",
|
|
370
|
+
value: function listStakingActivitiesWithHttpInfo(opts) {
|
|
371
|
+
opts = opts || {};
|
|
372
|
+
var postBody = null;
|
|
373
|
+
if (postBody && postBody.toJSON) {
|
|
374
|
+
postBody = postBody.toJSON();
|
|
375
|
+
}
|
|
376
|
+
var pathParams = {};
|
|
377
|
+
var queryParams = {
|
|
378
|
+
'pool_id': opts['pool_id'],
|
|
379
|
+
'staking_id': opts['staking_id'],
|
|
380
|
+
'activity_type': opts['activity_type'],
|
|
381
|
+
'activity_status': opts['activity_status'],
|
|
382
|
+
'min_modified_timestamp': opts['min_modified_timestamp'],
|
|
383
|
+
'max_modified_timestamp': opts['max_modified_timestamp'],
|
|
384
|
+
'initiator': opts['initiator'],
|
|
385
|
+
'limit': opts['limit'],
|
|
386
|
+
'before': opts['before'],
|
|
387
|
+
'after': opts['after']
|
|
388
|
+
};
|
|
389
|
+
var headerParams = {};
|
|
390
|
+
var formParams = {};
|
|
391
|
+
var authNames = ['CoboAuth'];
|
|
392
|
+
var contentTypes = [];
|
|
393
|
+
var accepts = ['application/json'];
|
|
394
|
+
var returnType = _ListStakingActivities200Response["default"];
|
|
395
|
+
return this.apiClient.callApi('/stakings/activities', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* List staking activities
|
|
400
|
+
* This operation retrieves a list of staking activities.
|
|
401
|
+
* @param {Object} opts Optional parameters
|
|
402
|
+
* @param {String} opts.pool_id The ID of the staking pool. A staking pool is a pairing of a staking protocol and a specific type of token. You can call [List staking pools](/v2/api-references/stakings/list-staking-pools) to retrieve a list of staking pools.
|
|
403
|
+
* @param {String} opts.staking_id The position ID.
|
|
404
|
+
* @param {module:model/ActivityType} opts.activity_type
|
|
405
|
+
* @param {module:model/ActivityStatus} opts.activity_status
|
|
406
|
+
* @param {Number} opts.min_modified_timestamp The start time of the query. All staking activities updated after the specified time will be retrieved. The time is in Unix timestamp format, measured in milliseconds.
|
|
407
|
+
* @param {Number} opts.max_modified_timestamp The end time of the query. All staking activities updated before the specified time will be retrieved. The time is in Unix timestamp format, measured in milliseconds.
|
|
408
|
+
* @param {String} opts.initiator The activity initiator, which is your API key by default. You can also specify the initiator when creating the activity.
|
|
409
|
+
* @param {Number} opts.limit The maximum number of objects to return. For most operations, the value range is [1, 50]. (default to 10)
|
|
410
|
+
* @param {String} opts.before An object ID that serves as a starting point for retrieving data in reverse chronological order. For example, if you specify `before` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`, the request will retrieve a list of data objects that end before the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`. You can set this parameter to the value of `pagination.before` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set `before` to `infinity`, the last page of data is returned.
|
|
411
|
+
* @param {String} opts.after An object ID that acts as a starting point for retrieving data in chronological order. For example, if you specify `after` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`, the request will retrieve a list of data objects that start after the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`. You can set this parameter to the value of `pagination.after` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
|
|
412
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListStakingActivities200Response}
|
|
413
|
+
*/
|
|
414
|
+
}, {
|
|
415
|
+
key: "listStakingActivities",
|
|
416
|
+
value: function listStakingActivities(opts) {
|
|
417
|
+
return this.listStakingActivitiesWithHttpInfo(opts).then(function (response_and_data) {
|
|
418
|
+
return response_and_data.data;
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* List staking pools
|
|
424
|
+
* This operation retrieves a list of staking pools currently supported.
|
|
425
|
+
* @param {Object} opts Optional parameters
|
|
426
|
+
* @param {String} [chain_id] The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](/v2/api-references/wallets/list-enabled-chains).
|
|
427
|
+
* @param {String} [token_id] The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens).
|
|
428
|
+
* @param {Number} [limit = 10)] The maximum number of objects to return. For most operations, the value range is [1, 50].
|
|
429
|
+
* @param {String} [before] An object ID that serves as a starting point for retrieving data in reverse chronological order. For example, if you specify `before` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`, the request will retrieve a list of data objects that end before the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`. You can set this parameter to the value of `pagination.before` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set `before` to `infinity`, the last page of data is returned.
|
|
430
|
+
* @param {String} [after] An object ID that acts as a starting point for retrieving data in chronological order. For example, if you specify `after` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`, the request will retrieve a list of data objects that start after the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`. You can set this parameter to the value of `pagination.after` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
|
|
431
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListStakingPools200Response} and HTTP response
|
|
432
|
+
*/
|
|
433
|
+
}, {
|
|
434
|
+
key: "listStakingPoolsWithHttpInfo",
|
|
435
|
+
value: function listStakingPoolsWithHttpInfo(opts) {
|
|
436
|
+
opts = opts || {};
|
|
437
|
+
var postBody = null;
|
|
438
|
+
if (postBody && postBody.toJSON) {
|
|
439
|
+
postBody = postBody.toJSON();
|
|
440
|
+
}
|
|
441
|
+
var pathParams = {};
|
|
442
|
+
var queryParams = {
|
|
443
|
+
'chain_id': opts['chain_id'],
|
|
444
|
+
'token_id': opts['token_id'],
|
|
445
|
+
'limit': opts['limit'],
|
|
446
|
+
'before': opts['before'],
|
|
447
|
+
'after': opts['after']
|
|
448
|
+
};
|
|
449
|
+
var headerParams = {};
|
|
450
|
+
var formParams = {};
|
|
451
|
+
var authNames = ['CoboAuth'];
|
|
452
|
+
var contentTypes = [];
|
|
453
|
+
var accepts = ['application/json'];
|
|
454
|
+
var returnType = _ListStakingPools200Response["default"];
|
|
455
|
+
return this.apiClient.callApi('/stakings/pools', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* List staking pools
|
|
460
|
+
* This operation retrieves a list of staking pools currently supported.
|
|
461
|
+
* @param {Object} opts Optional parameters
|
|
462
|
+
* @param {String} opts.chain_id The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](/v2/api-references/wallets/list-enabled-chains).
|
|
463
|
+
* @param {String} opts.token_id The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens).
|
|
464
|
+
* @param {Number} opts.limit The maximum number of objects to return. For most operations, the value range is [1, 50]. (default to 10)
|
|
465
|
+
* @param {String} opts.before An object ID that serves as a starting point for retrieving data in reverse chronological order. For example, if you specify `before` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`, the request will retrieve a list of data objects that end before the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`. You can set this parameter to the value of `pagination.before` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set `before` to `infinity`, the last page of data is returned.
|
|
466
|
+
* @param {String} opts.after An object ID that acts as a starting point for retrieving data in chronological order. For example, if you specify `after` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`, the request will retrieve a list of data objects that start after the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`. You can set this parameter to the value of `pagination.after` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
|
|
467
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListStakingPools200Response}
|
|
468
|
+
*/
|
|
469
|
+
}, {
|
|
470
|
+
key: "listStakingPools",
|
|
471
|
+
value: function listStakingPools(opts) {
|
|
472
|
+
return this.listStakingPoolsWithHttpInfo(opts).then(function (response_and_data) {
|
|
473
|
+
return response_and_data.data;
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* List staking positions
|
|
479
|
+
* This operation retrieves a list of staking positions.
|
|
480
|
+
* @param {Object} opts Optional parameters
|
|
481
|
+
* @param {String} [pool_id] The ID of the staking pool. A staking pool is a pairing of a staking protocol and a specific type of token. You can call [List staking pools](/v2/api-references/stakings/list-staking-pools) to retrieve a list of staking pools.
|
|
482
|
+
* @param {String} [statuses] The statuses of the staking amounts, separated by comma. Possible values include: - `StakeInProgress`: The staking request is submitted and is waiting to be confirmed by the staking protocol. - `Active`: The amount has been staked. - `Rejected`: The staking request has been rejected because the signer refuses to sign the transaction. - `LimitExceeded`: The total staking cap of the staking protocol has been reached. - `Invalid`: The staking request is invalid. This is often due to the failure to broadcast the transaction. - `UnstakeInProgress`: The unstaking request is submitted and is waiting to be confirmed by the staking protocol. - `Withdrawable`: The tokens have been unstaked and are ready to be withdrawn. - `WithdrawInProgress`: The withdrawal request is submitted and is waiting to be confirmed on the chain network. - `Closed`: The staking position is closed.
|
|
483
|
+
* @param {String} [wallet_id] The wallet ID.
|
|
484
|
+
* @param {String} [token_id] The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens).
|
|
485
|
+
* @param {Number} [limit = 10)] The maximum number of objects to return. For most operations, the value range is [1, 50].
|
|
486
|
+
* @param {String} [before] An object ID that serves as a starting point for retrieving data in reverse chronological order. For example, if you specify `before` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`, the request will retrieve a list of data objects that end before the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`. You can set this parameter to the value of `pagination.before` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set `before` to `infinity`, the last page of data is returned.
|
|
487
|
+
* @param {String} [after] An object ID that acts as a starting point for retrieving data in chronological order. For example, if you specify `after` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`, the request will retrieve a list of data objects that start after the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`. You can set this parameter to the value of `pagination.after` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
|
|
488
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListStakings200Response} and HTTP response
|
|
489
|
+
*/
|
|
490
|
+
}, {
|
|
491
|
+
key: "listStakingsWithHttpInfo",
|
|
492
|
+
value: function listStakingsWithHttpInfo(opts) {
|
|
493
|
+
opts = opts || {};
|
|
494
|
+
var postBody = null;
|
|
495
|
+
if (postBody && postBody.toJSON) {
|
|
496
|
+
postBody = postBody.toJSON();
|
|
497
|
+
}
|
|
498
|
+
var pathParams = {};
|
|
499
|
+
var queryParams = {
|
|
500
|
+
'pool_id': opts['pool_id'],
|
|
501
|
+
'statuses': opts['statuses'],
|
|
502
|
+
'wallet_id': opts['wallet_id'],
|
|
503
|
+
'token_id': opts['token_id'],
|
|
504
|
+
'limit': opts['limit'],
|
|
505
|
+
'before': opts['before'],
|
|
506
|
+
'after': opts['after']
|
|
507
|
+
};
|
|
508
|
+
var headerParams = {};
|
|
509
|
+
var formParams = {};
|
|
510
|
+
var authNames = ['CoboAuth'];
|
|
511
|
+
var contentTypes = [];
|
|
512
|
+
var accepts = ['application/json'];
|
|
513
|
+
var returnType = _ListStakings200Response["default"];
|
|
514
|
+
return this.apiClient.callApi('/stakings', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* List staking positions
|
|
519
|
+
* This operation retrieves a list of staking positions.
|
|
520
|
+
* @param {Object} opts Optional parameters
|
|
521
|
+
* @param {String} opts.pool_id The ID of the staking pool. A staking pool is a pairing of a staking protocol and a specific type of token. You can call [List staking pools](/v2/api-references/stakings/list-staking-pools) to retrieve a list of staking pools.
|
|
522
|
+
* @param {String} opts.statuses The statuses of the staking amounts, separated by comma. Possible values include: - `StakeInProgress`: The staking request is submitted and is waiting to be confirmed by the staking protocol. - `Active`: The amount has been staked. - `Rejected`: The staking request has been rejected because the signer refuses to sign the transaction. - `LimitExceeded`: The total staking cap of the staking protocol has been reached. - `Invalid`: The staking request is invalid. This is often due to the failure to broadcast the transaction. - `UnstakeInProgress`: The unstaking request is submitted and is waiting to be confirmed by the staking protocol. - `Withdrawable`: The tokens have been unstaked and are ready to be withdrawn. - `WithdrawInProgress`: The withdrawal request is submitted and is waiting to be confirmed on the chain network. - `Closed`: The staking position is closed.
|
|
523
|
+
* @param {String} opts.wallet_id The wallet ID.
|
|
524
|
+
* @param {String} opts.token_id The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens).
|
|
525
|
+
* @param {Number} opts.limit The maximum number of objects to return. For most operations, the value range is [1, 50]. (default to 10)
|
|
526
|
+
* @param {String} opts.before An object ID that serves as a starting point for retrieving data in reverse chronological order. For example, if you specify `before` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`, the request will retrieve a list of data objects that end before the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`. You can set this parameter to the value of `pagination.before` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set `before` to `infinity`, the last page of data is returned.
|
|
527
|
+
* @param {String} opts.after An object ID that acts as a starting point for retrieving data in chronological order. For example, if you specify `after` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`, the request will retrieve a list of data objects that start after the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`. You can set this parameter to the value of `pagination.after` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned.
|
|
528
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListStakings200Response}
|
|
529
|
+
*/
|
|
530
|
+
}, {
|
|
531
|
+
key: "listStakings",
|
|
532
|
+
value: function listStakings(opts) {
|
|
533
|
+
return this.listStakingsWithHttpInfo(opts).then(function (response_and_data) {
|
|
534
|
+
return response_and_data.data;
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
}]);
|
|
538
|
+
}();
|