# DID

## DID PreLogin

```csharp
Task<PreLoginResponse> PreLoginAsync(Uri nodeUri, string walletAddress)
```

Input params：

| Name          | Type   | Description         | Required |
| ------------- | ------ | ------------------- | -------- |
| nodeUri       | string | uri of the node     | true     |
| walletAddress | string | user wallet address | true     |

Output params：

| Name                          | Type   | Description                 | Required |
| ----------------------------- | ------ | --------------------------- | -------- |
| PreLoginResponse.Did          | string | user DID                    | true     |
| PreLoginResponse.Message      | string | message to be signed        | true     |
| PreLoginResponse.RandomServer | string | random nonce                | true     |
| PreLoginResponse.Updated      | string | update time of did document | true     |

## DID Login

```csharp
Task<LoginResponse> LoginAsync(string did, string nonce, string updateTime, string message, string signature)
```

Input params：

| Name       | Type   | Description                 | Required |
| ---------- | ------ | --------------------------- | -------- |
| did        | string | user did                    | true     |
| nonce      | string | random nonce                | true     |
| updateTime | string | update time of did document | true     |
| message    | string | message to be signed        | true     |
| signature  | string | signature of the message    | true     |

Output params：

| Name                      | Type   | Description  | Required |
| ------------------------- | ------ | ------------ | -------- |
| LoginResponse.UserId      | string | user did     | true     |
| LoginResponse.AccessToken | string | access token | true     |
| LoginResponse.DeviceId    | string | device id    | true     |


---

# 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://sending-network.gitbook.io/sending.network/sdk-documentation/unity-sdk/did.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.
