@sundaeswap/wallet-lite 0.0.53 → 0.0.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sundaeswap/wallet-lite",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -21,11 +21,12 @@ const TestComponent = (state: TRenderWalletHandlesFunctionState) => {
21
21
  {state.network?.toString()}
22
22
  {state.unusedAddresses.toString()}
23
23
  {state.usedAddresses.toString()}
24
- {[...state.handles.values()].map(({ metadata }) => (
25
- <p key={metadata.assetId} data-testid={metadata.name}>
26
- {JSON.stringify(metadata)}
27
- </p>
28
- ))}
24
+ {state.handles &&
25
+ [...state.handles.values()].map(({ metadata }) => (
26
+ <p key={metadata.assetId} data-testid={metadata.name}>
27
+ {JSON.stringify(metadata)}
28
+ </p>
29
+ ))}
29
30
  <button
30
31
  data-testid="connect-with-handles"
31
32
  onClick={() => state.connectWallet("eternl")}
@@ -41,11 +42,7 @@ describe("RenderWalletHandles", () => {
41
42
  KoraLabsProvider.prototype,
42
43
  "getAllDataBatch",
43
44
  );
44
- spiedOnGetAllDataBatch.mockImplementationOnce(
45
- // @ts-expect-error Bug in Bun.sh that mocks the function result rather than the reference.
46
- () => async () => mockHandleMetadata,
47
- );
48
- spiedOnGetAllDataBatch.mockImplementationOnce(
45
+ spiedOnGetAllDataBatch.mockImplementation(
49
46
  // @ts-expect-error Bug in Bun.sh that mocks the function result rather than the reference.
50
47
  () => async () => mockHandleMetadata,
51
48
  );
@@ -76,18 +73,5 @@ describe("RenderWalletHandles", () => {
76
73
  expect(queryByTestId("calvin")).not.toBeNull();
77
74
  expect(queryByTestId("pi")).not.toBeNull();
78
75
  expect(container.innerHTML).toMatchSnapshot();
79
-
80
- spiedOnGetAllDataBatch.mockImplementationOnce(
81
- // @ts-expect-error See first mock comment.
82
- () => async () => mockHandleMetadata.map(({ name }) => `${name}-updated`),
83
- );
84
-
85
- rerender(<RenderWalletHandles render={TestComponent} />);
86
-
87
- expect(container.innerHTML).toMatchSnapshot();
88
- // expect(queryByTestId("calvin")).toBeNull();
89
- // expect(queryByTestId("pi")).toBeUndefined();
90
- // expect(queryByTestId("calvin-updated")).not.toBeUndefined();
91
- // expect(queryByTestId("pi-updated")).not.toBeUndefined();
92
76
  });
93
77
  });
@@ -101,17 +101,15 @@ export const useWalletHandles = <
101
101
  },
102
102
  refetchInterval: false,
103
103
  notifyOnChangeProps: ["data", "isLoading"],
104
- initialData: new WalletAssetMap<THandleMetadata<AssetMetadata>>([
105
- ...state.balance.getHandles(),
106
- ]),
107
104
  });
108
105
 
109
106
  const memoizedResult = useMemo(
110
107
  () => ({
111
108
  handles,
112
109
  loadingHandles: isLoading,
110
+ totalCount: memoizedHandleDep.length,
113
111
  }),
114
- [handles, isLoading],
112
+ [handles, isLoading, memoizedHandleDep],
115
113
  );
116
114
 
117
115
  return memoizedResult;