> ## Documentation Index
> Fetch the complete documentation index at: https://baileys.wiki/llms.txt
> Use this file to discover all available pages before exploring further.

# encodeSyncdPatch

> Function encodeSyncdPatch in the Baileys API.

> **encodeSyncdPatch**(`__namedParameters`, `myAppStateKeyId`, `state`, `getAppStateSyncKey`): `Promise`\<\{ `patch`: [`ISyncdPatch`](/proto-reference/interfaces/ISyncdPatch); `state`: [`LTHashState`](/api-reference/type-aliases/LTHashState); }>

Defined in: [src/Utils/chat-utils.ts:163](https://github.com/WhiskeySockets/Baileys/blob/master/src/Utils/chat-utils.ts#L163)

## Parameters

### \_\_namedParameters

[`WAPatchCreate`](/api-reference/type-aliases/WAPatchCreate)

### myAppStateKeyId

`string`

### state

[`LTHashState`](/api-reference/type-aliases/LTHashState)

### getAppStateSyncKey

`FetchAppStateSyncKey`

## Returns

`Promise`\<\{ `patch`: [`ISyncdPatch`](/proto-reference/interfaces/ISyncdPatch); `state`: [`LTHashState`](/api-reference/type-aliases/LTHashState); }>
