@pear-protocol/symmio-client 0.2.45 → 0.2.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/index.js +13 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +13 -1
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react/index.mjs
CHANGED
|
@@ -25343,6 +25343,7 @@ function useResolveTradeAuthToken(params = {}) {
|
|
|
25343
25343
|
function useSymmOpenBasketMutation(options) {
|
|
25344
25344
|
const { symmCoreClient } = useSymmContext();
|
|
25345
25345
|
const queryClient = useQueryClient();
|
|
25346
|
+
const resolveAuthToken = useResolveTradeAuthToken();
|
|
25346
25347
|
return useMutation({
|
|
25347
25348
|
...withSymmMutationConfig(options?.mutation, {
|
|
25348
25349
|
onSuccess: () => {
|
|
@@ -25351,7 +25352,18 @@ function useSymmOpenBasketMutation(options) {
|
|
|
25351
25352
|
}),
|
|
25352
25353
|
mutationFn: async (request) => {
|
|
25353
25354
|
if (!symmCoreClient) throw new Error("symm-core client not available");
|
|
25354
|
-
|
|
25355
|
+
const typedRequest = request;
|
|
25356
|
+
const authToken = await resolveAuthToken(
|
|
25357
|
+
typedRequest.authToken,
|
|
25358
|
+
typedRequest.accountAddress
|
|
25359
|
+
);
|
|
25360
|
+
if (!authToken) {
|
|
25361
|
+
throw new Error("auth token is required to open a position");
|
|
25362
|
+
}
|
|
25363
|
+
return symmCoreClient.positions.openBasket({
|
|
25364
|
+
...request,
|
|
25365
|
+
authToken
|
|
25366
|
+
});
|
|
25355
25367
|
}
|
|
25356
25368
|
});
|
|
25357
25369
|
}
|