# Mint Territory

Used for transactions where users mint territories. `gib_count` indicates the size of the territory the user wants to mint, in gib. The default expiration time for a territory is 30 days. Through the `territory_name` field, users can customize the name of the territory they mint, but the name of a territory owned by a user cannot be repeated.

```rust
/// Mints a new territory for the user.
///
/// This transaction is used when a user wants to mint a new territory. 
/// The size of the territory is specified by `gib_count` in GiB. 
/// The default expiration time for a territory is 30 days. 
/// Users can customize the name of the territory through the `territory_name` field, 
/// but the name of a territory owned by a user cannot be repeated.
///
/// # Arguments
///
/// * `gib_count` - The size of the territory to be minted, in GiB.
/// * `territory_name` - A reference to a string slice that holds the custom name of the territory to be minted.
/// * `days` - The duration in days for which the territory is to be valid. Defaults to 30 days if not specified.
///
/// # Returns
///
/// This function returns a `Result` which is:
/// * `Ok((TxHash, MintTerritory))` - A tuple containing the transaction hash and the `MintTerritory` struct.
/// * `Err(Box<dyn std::error::Error>)` - An error if the transaction fails.
///
pub async fn mint_territory(
    &self,
    gib_count: u32,
    territory_name: &str,
    days: u32,
) -> Result<(TxHash, MintTerritory), 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/mint_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.
