@orderly.network/hooks 0.0.25 → 0.0.26

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.mjs CHANGED
@@ -89,7 +89,7 @@ var useQuery = (query, options) => {
89
89
  );
90
90
  };
91
91
  var useAccountInstance = () => {
92
- const { configStore, keyStore, walletAdapter } = useContext(OrderlyContext);
92
+ const { configStore, keyStore, contractManager, walletAdapter } = useContext(OrderlyContext);
93
93
  if (!configStore)
94
94
  throw new Error("configStore is not defined, please use OrderlyProvider");
95
95
  if (!keyStore) {
@@ -100,7 +100,12 @@ var useAccountInstance = () => {
100
100
  const account5 = useConstant(() => {
101
101
  let account6 = SimpleDI.get("account");
102
102
  if (!account6) {
103
- account6 = new Account(configStore, keyStore, walletAdapter);
103
+ account6 = new Account(
104
+ configStore,
105
+ keyStore,
106
+ contractManager,
107
+ walletAdapter
108
+ );
104
109
  SimpleDI.registerByName("account", account6);
105
110
  }
106
111
  return account6;
@@ -199,6 +204,7 @@ var useAccount = () => {
199
204
  configStore,
200
205
  keyStore,
201
206
  walletAdapter,
207
+ contractManager,
202
208
  onWalletConnect,
203
209
  onWalletDisconnect,
204
210
  onSetChain
@@ -210,14 +216,7 @@ var useAccount = () => {
210
216
  "keyStore is not defined, please use OrderlyProvider and provide keyStore"
211
217
  );
212
218
  }
213
- const account5 = useConstant(() => {
214
- let account6 = SimpleDI.get("account");
215
- if (!account6) {
216
- account6 = new Account(configStore, keyStore, walletAdapter);
217
- SimpleDI.registerByName("account", account6);
218
- }
219
- return account6;
220
- });
219
+ const account5 = useAccountInstance();
221
220
  const [state, setState] = useState(account5.stateValue);
222
221
  const statusChangeHandler = (nextState) => {
223
222
  setState(() => nextState);