Beyond Amber-specific code snippets, NIP-46 (https://github.com/nostr-protocol/nips/blob/master/46.md#direct-connection-initiated-by-the-client ) itself needs some love.
For example, while implementing the Direct connection initiated by the client flow, the NIP states:
1. That a secret value must be provided to avoid connection spoofing, and that clients must validate the secret returned in the connect response.
2. That the connect command should return either "ack" or `
So I knew I needed to return the secret in the response… Still, I had no idea that most clients expect a response containing exactly:
```
{
"id": [secret],
"result": "ack"
}
```
I had to reverse engineer this from client libraries. It would be nice to clarify this kind of thing in the NIP itself.