@orderly.network/hooks 1.0.0 → 1.0.1
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 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -420,6 +420,7 @@ var useWS = () => {
|
|
|
420
420
|
return ws;
|
|
421
421
|
};
|
|
422
422
|
var OrderlyConfigProvider = (props) => {
|
|
423
|
+
const [account5, setAccount] = React.useState(null);
|
|
423
424
|
const { configStore, keyStore, getWalletAdapter, brokerId, networkId } = props;
|
|
424
425
|
if (!brokerId && typeof configStore === "undefined") {
|
|
425
426
|
console.error("[OrderlyConfigProvider]: brokerId is required");
|
|
@@ -434,16 +435,20 @@ var OrderlyConfigProvider = (props) => {
|
|
|
434
435
|
return getWalletAdapter || ((options) => new EtherAdapter(options));
|
|
435
436
|
});
|
|
436
437
|
useEffect(() => {
|
|
437
|
-
let
|
|
438
|
-
if (!
|
|
439
|
-
|
|
438
|
+
let account6 = SimpleDI.get(Account.instanceName);
|
|
439
|
+
if (!account6) {
|
|
440
|
+
account6 = new Account(
|
|
440
441
|
innerConfigStore,
|
|
441
442
|
innerKeyStore,
|
|
442
443
|
innerGetWalletAdapter
|
|
443
444
|
);
|
|
444
|
-
SimpleDI.registerByName(Account.instanceName,
|
|
445
|
+
SimpleDI.registerByName(Account.instanceName, account6);
|
|
445
446
|
}
|
|
447
|
+
setAccount(account6);
|
|
446
448
|
}, []);
|
|
449
|
+
if (!account5) {
|
|
450
|
+
return null;
|
|
451
|
+
}
|
|
447
452
|
return /* @__PURE__ */ React.createElement(
|
|
448
453
|
OrderlyProvider,
|
|
449
454
|
{
|