Update docs

This commit is contained in:
Jon Staab
2025-09-30 09:39:11 -07:00
parent 4a0d4c9b85
commit b417525cd3
3 changed files with 84 additions and 30 deletions
-25
View File
@@ -64,28 +64,3 @@ async function example() {
}
}
```
## Request Serialization
The signer implements a lock mechanism to prevent concurrent calls to the extension:
```typescript
class Nip07Signer implements ISigner {
#lock = Promise.resolve()
#then = async <T>(f: (ext: Nip07) => T | Promise<T>) => {
const promise = this.#lock.then(() => {
const ext = getNip07()
if (!ext) throw new Error("Nip07 is not enabled")
return f(ext)
})
// Reset lock after completion or error
this.#lock = promise.then(
() => undefined,
() => undefined
)
return promise
}
}
```