# encodeRecipient

> For the complete documentation index, see [llms.txt](https://docs.midnight.network/llms.txt)

[**@midnight-ntwrk/compact-runtime v0.21.0**](https://docs.midnight.network/api-reference/compact-runtime.md)

***

[@midnight-ntwrk/compact-runtime](https://docs.midnight.network/api-reference/compact-runtime/globals.md) / encodeRecipient

# Function: encodeRecipient()

```
function encodeRecipient(__namedParameters): EncodedRecipient;
```

Converts an [Recipient](https://docs.midnight.network/api-reference/compact-runtime/interfaces/Recipient.md) to an [EncodedRecipient](https://docs.midnight.network/api-reference/compact-runtime/interfaces/EncodedRecipient.md). Useful for testing.

## Parameters[​](#parameters "Direct link to Parameters")

### \_\_namedParameters[​](#__namedparameters "Direct link to __namedParameters")

[`Recipient`](https://docs.midnight.network/api-reference/compact-runtime/interfaces/Recipient.md)

## Returns[​](#returns "Direct link to Returns")

[`EncodedRecipient`](https://docs.midnight.network/api-reference/compact-runtime/interfaces/EncodedRecipient.md)
