You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here we can see the structure of the `InvokeResult` object. It's `ok` field denotes whether the Wrap's invocation was successful, and the `value`is the return value of the invocation.
43
+
This is the return value of our invocation.
93
44
94
45
#### What's going on here?
95
46
@@ -99,14 +50,12 @@ Under the hood, through a process we call URI Resolution, the Polywrap Client kn
99
50
100
51
The `PolywrapClient` comes pre-configured with everything you need for most Web2 and Web3 use-cases by default.
101
52
102
-
#### The `InvokeResult` object
103
-
104
-
The `InvokeResult` object can have one of two structures:
53
+
#### Invocation return value
105
54
106
-
- A successful Wrap invocation returns `{ ok: true, value: ... }` with `value` being the return value of the Wrap invocation. This can be anything - a boolean value, a string, an object, etc.
107
-
- A failed Wrap invocation returns `{ ok: false, error: ... }` with `error` describing the reason for invocation failure.
55
+
Invoking a wrap can result in one of two scenarios:
108
56
109
-
Although not particularly useful in our last example, our next example leverages the fact that Wrap invocations return a value.
57
+
- A successful Wrap invocation returns the return value of the Wrap invocation. This can be anything - a boolean value, a string, an object, etc.
58
+
- A failed Wrap invocation throws an exception describing the reason for invocation failure.
110
59
111
60
### Universal SDKs
112
61
@@ -120,58 +69,8 @@ Now we'll invoke the Uniswap V3 Wrap which is a port of the Uniswap SDK, but wri
120
69
121
70
We can use the Uniswap Wrap to fetch Uniswap's basic data related to the WETH and USDC tokes, find the address of the pool for those two tokens. We are also checking each result for errors.
0 commit comments