# Upload Declaration

The `upload_declaration` is used to generate file storage orders.

```rust
/// Generates file storage orders for a given file.
/// 
/// This function is used to create storage orders by declaring the details of the file,
/// including its hash, segment list, user information, and size. The resulting storage
/// orders facilitate the process of storing the file in the system.
/// 
/// # Parameters
/// 
/// - `file_hash`: A reference to a string slice that represents the unique hash identifier of the file.
/// - `segment_list`: A `BoundedVec` containing the segments of the file. Each segment is described by the `SegmentList` struct.
/// - `user_brief`: A `UserBrief` struct that contains brief information about the user making the declaration.
/// - `file_size`: A `u128` value representing the size of the file in bytes.
/// 
/// # Returns
/// 
/// - `Result<(TxHash, UploadDeclaration), Box<dyn std::error::Error>>`: 
///   The function returns a `Result` which on success contains a tuple:
///   - `(TxHash, UploadDeclaration)` where `TxHash` is the transaction hash of the upload declaration and 
///     `UploadDeclaration` contains the details of the generated file storage order.
///   On failure, it returns an error wrapped in a `Box<dyn std::error::Error>`.
/// 

pub async fn upload_declaration(
    &self,
    file_hash: &str,
    segment_list: BoundedVec<SegmentList>,
    user_brief: UserBrief,
    file_size: u128,
) -> Result<(TxHash, UploadDeclaration), 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/file_bank/upload_declaration.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.
