@pear-protocol/hyperliquid-sdk 0.0.58 → 0.0.59
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/index.js +9 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6068,6 +6068,7 @@ function useAgentWallet() {
|
|
|
6068
6068
|
const isAuthenticated = useUserData((state) => state.isAuthenticated);
|
|
6069
6069
|
const address = useUserData((state) => state.address);
|
|
6070
6070
|
const setAgentWallets = useUserData((state) => state.setUserExtraAgents);
|
|
6071
|
+
const setAccountSummary = useUserData((state) => state.setAccountSummary);
|
|
6071
6072
|
const refreshAgentWalletStatus = useCallback(async () => {
|
|
6072
6073
|
const hlAgentWallets = await fetchExtraAgents(address);
|
|
6073
6074
|
setAgentWallets((hlAgentWallets === null || hlAgentWallets === void 0 ? void 0 : hlAgentWallets.data) || []);
|
|
@@ -6082,11 +6083,18 @@ function useAgentWallet() {
|
|
|
6082
6083
|
throw new Error('Not authenticated');
|
|
6083
6084
|
}
|
|
6084
6085
|
const response = await createAgentWallet(apiBaseUrl);
|
|
6086
|
+
const accountSummary = useUserData.getState().accountSummary;
|
|
6087
|
+
if (accountSummary) {
|
|
6088
|
+
const updatedSummary = {
|
|
6089
|
+
agentWalletAddress: response.data.agentWalletAddress,
|
|
6090
|
+
};
|
|
6091
|
+
setAccountSummary(updatedSummary);
|
|
6092
|
+
}
|
|
6085
6093
|
return response.data;
|
|
6086
6094
|
}, [apiBaseUrl, isAuthenticated]);
|
|
6087
6095
|
const notifyAgentWalletApproved = useCallback(async () => {
|
|
6088
6096
|
return refreshAgentWalletStatus();
|
|
6089
|
-
}, [refreshAgentWalletStatus]);
|
|
6097
|
+
}, [refreshAgentWalletStatus, setAccountSummary]);
|
|
6090
6098
|
return {
|
|
6091
6099
|
refreshAgentWalletStatus,
|
|
6092
6100
|
createAgentWallet: createAgentWallet$1,
|