import cobo_waas2
from cobo_waas2.models.create_stake_activity201_response import (
CreateStakeActivity201Response,
)
from cobo_waas2.models.create_unstake_activity_request import (
CreateUnstakeActivityRequest,
)
from cobo_waas2.rest import ApiException
from pprint import pprint
# See configuration.py for a list of all supported configurations.
configuration = cobo_waas2.Configuration(
# Replace `<YOUR_PRIVATE_KEY>` with your private key
api_private_key="<YOUR_PRIVATE_KEY>",
# Select the development environment. To use the production environment, change the URL to https://api.cobo.com/v2.
host="https://api.dev.cobo.com/v2",
)
# Enter a context with an instance of the API client
with cobo_waas2.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = cobo_waas2.StakingsApi(api_client)
create_unstake_activity_request = cobo_waas2.CreateUnstakeActivityRequest()
try:
# Create unstake activity
api_response = api_instance.create_unstake_activity(
create_unstake_activity_request=create_unstake_activity_request
)
print("The response of StakingsApi->create_unstake_activity:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling StakingsApi->create_unstake_activity: %s\n" % e)
Staking activities
Create unstake activity
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.
For the Babylon protocol, you can only select UTXO as the fee model.
