# Renew Territory

Used for user renewal of territory transactions. After the user has minted a territory, this transaction can be called to extend the expiration date of a certain territory. `days` indicates the number of days for renewal. The fee paid depends on the renewal time and the space size of the current territory. Use the territory name to specify which territory.

```rust
/// Renews the expiration date of a territory for the user.
///
/// After the user has minted a territory, this transaction can be called to extend the expiration date.
/// The fee paid depends on the renewal time and the space size of the current territory.
/// The `territory_name` parameter specifies which territory to renew.
///
/// # Arguments
///
/// * `territory_name` - A reference to a string slice that holds the name of the territory to be renewed.
/// * `days` - The number of days for the renewal period.
///
/// # Returns
///
/// This function returns a `Result` which is:
/// * `Ok((TxHash, RenewalTerritory))` - A tuple containing the transaction hash and the `RenewalTerritory` struct.
/// * `Err(Box<dyn std::error::Error>)` - An error if the transaction fails.
///
pub async fn renew_territory(
    &self,
    territory_name: &str,
    days: u32,
) -> Result<(TxHash, RenewalTerritory), Box<dyn std::error::Error>>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/storage_handler/renew_territory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
