@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.js
CHANGED
|
@@ -429,6 +429,7 @@ var useWS = () => {
|
|
|
429
429
|
return ws;
|
|
430
430
|
};
|
|
431
431
|
var OrderlyConfigProvider = (props) => {
|
|
432
|
+
const [account5, setAccount] = React__default.default.useState(null);
|
|
432
433
|
const { configStore, keyStore, getWalletAdapter, brokerId, networkId } = props;
|
|
433
434
|
if (!brokerId && typeof configStore === "undefined") {
|
|
434
435
|
console.error("[OrderlyConfigProvider]: brokerId is required");
|
|
@@ -443,16 +444,20 @@ var OrderlyConfigProvider = (props) => {
|
|
|
443
444
|
return getWalletAdapter || ((options) => new core.EtherAdapter(options));
|
|
444
445
|
});
|
|
445
446
|
React.useEffect(() => {
|
|
446
|
-
let
|
|
447
|
-
if (!
|
|
448
|
-
|
|
447
|
+
let account6 = core.SimpleDI.get(core.Account.instanceName);
|
|
448
|
+
if (!account6) {
|
|
449
|
+
account6 = new core.Account(
|
|
449
450
|
innerConfigStore,
|
|
450
451
|
innerKeyStore,
|
|
451
452
|
innerGetWalletAdapter
|
|
452
453
|
);
|
|
453
|
-
core.SimpleDI.registerByName(core.Account.instanceName,
|
|
454
|
+
core.SimpleDI.registerByName(core.Account.instanceName, account6);
|
|
454
455
|
}
|
|
456
|
+
setAccount(account6);
|
|
455
457
|
}, []);
|
|
458
|
+
if (!account5) {
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
456
461
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
457
462
|
OrderlyProvider,
|
|
458
463
|
{
|