Add sign timeout to thunk
This commit is contained in:
@@ -20,8 +20,11 @@ import { makeEvent } from '@welshman/util'
|
||||
import { ISigner, Nip01Signer, makeSecret } from '@welshman/signer'
|
||||
|
||||
const signer: ISigner = new Nip01Signer(makeSecret())
|
||||
const options = {
|
||||
signal: AbortSignal.timeout(10_000),
|
||||
}
|
||||
|
||||
signer.sign(makeEvent(1)).then(signedEvent => console.log(signedEvent))
|
||||
signer.sign(makeEvent(1), options).then(signedEvent => console.log(signedEvent))
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
Reference in New Issue
Block a user