@pear-protocol/hyperliquid-sdk 0.0.58 → 0.0.60

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -3
  2. 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,
@@ -7127,8 +7135,7 @@ const PearHyperliquidProvider = ({ children, apiBaseUrl = 'https://hl-v2.pearpro
7127
7135
  useEffect(() => {
7128
7136
  if (perpsMetaAssets === null) {
7129
7137
  fetchAllPerpMetas().then(res => {
7130
- // Only show HL and XYZ for now as other are using USDH collateral and need more work
7131
- const aggregatedPerpMetas = res.data.slice(0, 2).flatMap(item => item.universe);
7138
+ const aggregatedPerpMetas = res.data.flatMap(item => item.universe);
7132
7139
  const hip3Map = new Map();
7133
7140
  const displayToFull = new Map();
7134
7141
  const cleanedPerpMetas = aggregatedPerpMetas.map((asset) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/hyperliquid-sdk",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
4
4
  "description": "React SDK for Pear Protocol Hyperliquid API integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",