We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6cd8870 commit 3f50577Copy full SHA for 3f50577
docs/wait-for-token.mdx
@@ -270,6 +270,18 @@ The `forToken` function returns a result object with the following properties:
270
timeout error.
271
</ParamField>
272
273
+### unwrap()
274
+
275
+We provide a handy `.unwrap()` method that will throw an error if the result is not ok. This means your happy path is a lot cleaner.
276
277
+```ts
278
+const approval = await wait.forToken<ApprovalToken>(tokenId).unwrap();
279
+// unwrap means an error will throw if the waitpoint times out 👆
280
281
+// This is the actual data you sent to the token now, not a result object
282
+console.log("Approval", approval);
283
+```
284
285
### Example
286
287
```ts
0 commit comments