@xyo-network/react-module 2.56.3 → 2.56.5
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/cjs/components/Card/Module/CardHeader.js +4 -6
- package/dist/cjs/components/Card/Module/CardHeader.js.map +1 -1
- package/dist/cjs/components/DetailsBox.js +6 -8
- package/dist/cjs/components/DetailsBox.js.map +1 -1
- package/dist/cjs/components/TableCell.js +1 -3
- package/dist/cjs/components/TableCell.js.map +1 -1
- package/dist/cjs/hooks/WrappedModuleHookFactory.js +1 -1
- package/dist/cjs/hooks/WrappedModuleHookFactory.js.map +1 -1
- package/dist/cjs/hooks/WrappedModulesHookFactory.js +1 -1
- package/dist/cjs/hooks/WrappedModulesHookFactory.js.map +1 -1
- package/dist/docs.json +253 -217
- package/dist/esm/components/Card/Module/CardHeader.js +4 -6
- package/dist/esm/components/Card/Module/CardHeader.js.map +1 -1
- package/dist/esm/components/DetailsBox.js +6 -8
- package/dist/esm/components/DetailsBox.js.map +1 -1
- package/dist/esm/components/TableCell.js +1 -3
- package/dist/esm/components/TableCell.js.map +1 -1
- package/dist/esm/hooks/WrappedModuleHookFactory.js +1 -1
- package/dist/esm/hooks/WrappedModuleHookFactory.js.map +1 -1
- package/dist/esm/hooks/WrappedModulesHookFactory.js +1 -1
- package/dist/esm/hooks/WrappedModulesHookFactory.js.map +1 -1
- package/dist/types/components/Card/Module/CardHeader.d.ts.map +1 -1
- package/dist/types/components/DetailsBox.d.ts.map +1 -1
- package/dist/types/components/TableCell.d.ts.map +1 -1
- package/dist/types/hooks/WrappedModuleHookFactory.d.ts +1 -1
- package/dist/types/hooks/WrappedModuleHookFactory.d.ts.map +1 -1
- package/dist/types/hooks/useWrappedModule.d.ts +1 -1
- package/package.json +13 -13
- package/src/components/Card/Module/CardHeader.tsx +6 -8
- package/src/components/DetailsBox.tsx +7 -8
- package/src/components/TableCell.tsx +1 -3
- package/src/hooks/WrappedModuleHookFactory.tsx +3 -3
- package/src/hooks/WrappedModulesHookFactory.tsx +1 -1
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { CardHeader } from '@mui/material';
|
|
3
|
-
import { ModuleWrapper } from '@xyo-network/module';
|
|
4
3
|
import { findNetworkComponent } from '@xyo-network/react-shared';
|
|
5
|
-
const getModuleIcons = (moduleType,
|
|
6
|
-
return
|
|
4
|
+
const getModuleIcons = (moduleType, module) => {
|
|
5
|
+
return module?.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon : null;
|
|
7
6
|
};
|
|
8
7
|
export const ModuleCardHeader = ({ subheader, avatar, title, module, ...props }) => {
|
|
9
|
-
|
|
10
|
-
return (_jsx(CardHeader, { title: title ?? module?.config.name ?? 'Module', subheader: subheader ?? wrapper?.address, avatar: avatar ?? (_jsx(_Fragment, { children: wrapper
|
|
8
|
+
return (_jsx(CardHeader, { title: title ?? module?.config.name ?? 'Module', subheader: subheader ?? module?.address, avatar: avatar ?? (_jsx(_Fragment, { children: module
|
|
11
9
|
? ['sentinel', 'bridge', 'archivist', 'diviner', 'node', 'witness'].map((moduleType) => {
|
|
12
|
-
const Icon = getModuleIcons(moduleType,
|
|
10
|
+
const Icon = getModuleIcons(moduleType, module);
|
|
13
11
|
return Icon ? _jsx(Icon, { fontSize: 'large', color: "primary" }) : null;
|
|
14
12
|
})
|
|
15
13
|
: null })), ...props }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,eAAe,CA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4
|
import { EthAccountBox } from '@xylabs/react-crypto';
|
|
5
5
|
import { FlexCol, FlexRow } from '@xylabs/react-flexbox';
|
|
6
|
-
import { ModuleWrapper } from '@xyo-network/module';
|
|
7
6
|
import { findNetworkComponent } from '@xyo-network/react-shared';
|
|
8
7
|
import { useState } from 'react';
|
|
9
|
-
const getModuleIcon = (moduleType,
|
|
10
|
-
return
|
|
8
|
+
const getModuleIcon = (moduleType, module) => {
|
|
9
|
+
return module?.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon() : null;
|
|
11
10
|
};
|
|
12
11
|
export const ModuleDetailsBox = ({ children, module, ...props }) => {
|
|
13
|
-
const wrapper = module ? ModuleWrapper.wrap(module) : undefined;
|
|
14
12
|
const [showQueries, setShowQueries] = useState(false);
|
|
15
|
-
return (_jsxs(FlexCol, { ...props, children: [_jsxs(FlexRow, { children: [
|
|
13
|
+
return (_jsxs(FlexCol, { ...props, children: [_jsxs(FlexRow, { children: [module
|
|
16
14
|
? ['sentinel', 'bridge', 'archivist', 'diviner', 'node'].map((moduleType) => {
|
|
17
|
-
const icon = getModuleIcon(moduleType,
|
|
15
|
+
const icon = getModuleIcon(moduleType, module);
|
|
18
16
|
return icon ? (_jsx(ButtonEx, { onClick: () => setShowQueries(!showQueries), children: icon }, moduleType)) : null;
|
|
19
17
|
})
|
|
20
|
-
: null, _jsx(EthAccountBox, { address: EthAddress.fromString(
|
|
21
|
-
?
|
|
18
|
+
: null, _jsx(EthAccountBox, { address: EthAddress.fromString(module?.address) })] }), showQueries
|
|
19
|
+
? module?.queries.map((query) => {
|
|
22
20
|
return _jsx(FlexRow, { children: query }, query);
|
|
23
21
|
})
|
|
24
22
|
: null, children] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailsBox.js","sourceRoot":"","sources":["../../../src/components/DetailsBox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAA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AAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;4BACxE,MAAM,IAAI,GAAG,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;4BAC9C,OAAO,IAAI,CAAC,CAAC,CAAC,CACZ,KAAC,QAAQ,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,CAAC,WAAW,CAAC,YAClD,IAAI,IADqD,UAAU,CAE3D,CACZ,CAAC,CAAC,CAAC,IAAI,CAAA;wBACV,CAAC,CAAC;wBACJ,CAAC,CAAC,IAAI,EACR,KAAC,aAAa,IAAC,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,GAAI,IAC1D,EAET,WAAW;gBACV,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;oBAC5B,OAAO,KAAC,OAAO,cAAc,KAAK,IAAb,KAAK,CAAmB,CAAA;gBAC/C,CAAC,CAAC;gBACJ,CAAC,CAAC,IAAI,EACP,QAAQ,IACD,CACX,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -2,9 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { TableCell } from '@mui/material';
|
|
3
3
|
import { EthAddress } from '@xylabs/eth-address';
|
|
4
4
|
import { EthAccountBox } from '@xylabs/react-crypto';
|
|
5
|
-
import { ModuleWrapper } from '@xyo-network/module';
|
|
6
5
|
export const ModuleTableCell = ({ children, module, ...props }) => {
|
|
7
|
-
|
|
8
|
-
return (_jsxs(TableCell, { ...props, children: [_jsx(EthAccountBox, { address: EthAddress.fromString(wrapper?.address) }), children] }));
|
|
6
|
+
return (_jsxs(TableCell, { ...props, children: [_jsx(EthAccountBox, { address: EthAddress.fromString(module?.address) }), children] }));
|
|
9
7
|
};
|
|
10
8
|
//# sourceMappingURL=TableCell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../src/components/TableCell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../src/components/TableCell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAIpD,MAAM,CAAC,MAAM,eAAe,GAAiD,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC9G,OAAO,CACL,MAAC,SAAS,OAAK,KAAK,aAClB,KAAC,aAAa,IAAC,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,GAAI,EACjE,QAAQ,IACC,CACb,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,7 +4,7 @@ export const WrappedModuleHookFactory = {
|
|
|
4
4
|
create: (wrapperObject, name) => {
|
|
5
5
|
const useHook = (module, account, logger) => {
|
|
6
6
|
logger?.debug(`Render: ${name}`);
|
|
7
|
-
const wrapperAccount = useWrapperAccount();
|
|
7
|
+
const [wrapperAccount] = useWrapperAccount();
|
|
8
8
|
const [wrapper, setWrapper] = useState();
|
|
9
9
|
const [error, setError] = useState();
|
|
10
10
|
useEffect(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrappedModuleHookFactory.js","sourceRoot":"","sources":["../../../src/hooks/WrappedModuleHookFactory.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,QAA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S,CAAC,CAAA;oBACrB,QAAQ,CAAC,SAAS,CAAC,CAAA;iBACpB;YACH,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAA;YAErC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACzB,CAAC,CAAA;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAA"}
|
|
@@ -4,7 +4,7 @@ export const WrappedModulesHookFactory = {
|
|
|
4
4
|
create: (wrapperObject, name) => {
|
|
5
5
|
const useHook = (modules, account, logger) => {
|
|
6
6
|
logger?.debug(`Render: ${name}`);
|
|
7
|
-
const wrapperAccount = useWrapperAccount();
|
|
7
|
+
const [wrapperAccount] = useWrapperAccount();
|
|
8
8
|
const [wrappers, setWrappers] = useState();
|
|
9
9
|
const [error, setError] = useState();
|
|
10
10
|
useEffect(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrappedModulesHookFactory.js","sourceRoot":"","sources":["../../../src/hooks/WrappedModulesHookFactory.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE3C,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,MAAM,EAAE,CAAuC,aAAyD,EAAE,IAAa,EAAE,EAAE;QACzH,MAAM,OAAO,GAAG,CACd,OAAoC,EACpC,OAAyB,EACzB,MAAe,EACoC,EAAE;YACrD,MAAM,EAAE,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC,CAAA;YAChC,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"WrappedModulesHookFactory.js","sourceRoot":"","sources":["../../../src/hooks/WrappedModulesHookFactory.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EA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+1 @@
|
|
|
1
|
-
{"version":3,"file":"CardHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAA;AAI3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAM9D,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"CardHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAA;AAI3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAM9D,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG,eAAe,CAoB1E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailsBox.d.ts","sourceRoot":"","sources":["../../../src/components/DetailsBox.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAoB,MAAM,uBAAuB,CAAA;AAKtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAMxD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"DetailsBox.d.ts","sourceRoot":"","sources":["../../../src/components/DetailsBox.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAoB,MAAM,uBAAuB,CAAA;AAKtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAMxD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG,YAAY,CA0BvE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/components/TableCell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,cAAc,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/components/TableCell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,cAAc,EAAE,MAAM,eAAe,CAAA;AAIzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG,cAAc,CAOxE,CAAA"}
|
|
@@ -30,6 +30,6 @@ export declare const WrappedModuleHookFactory: {
|
|
|
30
30
|
readonly storeQueries?: boolean | undefined;
|
|
31
31
|
} & Omit<undefined, "schema">, "schema"> & {
|
|
32
32
|
schema: string;
|
|
33
|
-
}, "schema">, undefined>, import("@xyo-network/module").ModuleEventData>>>(wrapperObject: ConstructableModuleWrapper<TModuleWrapper>, name?: string) => (module?: TModuleWrapper["module"] | undefined, account?: AccountInstance, logger?: Logger) => [TModuleWrapper | undefined, Error | undefined];
|
|
33
|
+
}, "schema">, undefined>, import("@xyo-network/module").ModuleEventData>>>(wrapperObject: ConstructableModuleWrapper<TModuleWrapper>, name?: string) => (module?: TModuleWrapper["module"] | null | undefined, account?: AccountInstance | null, logger?: Logger) => [TModuleWrapper | undefined, Error | undefined];
|
|
34
34
|
};
|
|
35
35
|
//# sourceMappingURL=WrappedModuleHookFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrappedModuleHookFactory.d.ts","sourceRoot":"","sources":["../../../src/hooks/WrappedModuleHookFactory.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAI/E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iJAC8E,MAAM
|
|
1
|
+
{"version":3,"file":"WrappedModuleHookFactory.d.ts","sourceRoot":"","sources":["../../../src/hooks/WrappedModuleHookFactory.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAI/E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iJAC8E,MAAM,sEAGzG,eAAe,GAAG,IAAI,WACvB,MAAM;CA6BpB,CAAA"}
|
|
@@ -27,7 +27,7 @@ export declare const useWrappedModule: (module?: import("@xyo-network/module").M
|
|
|
27
27
|
readonly storeQueries?: boolean | undefined;
|
|
28
28
|
} & Omit<undefined, "schema">, "schema"> & {
|
|
29
29
|
schema: string;
|
|
30
|
-
}, "schema">, undefined>, import("@xyo-network/module").ModuleEventData> | undefined, account?: import("@xyo-network/account-model").AccountInstance | undefined, logger?: import("@xyo-network/core").Logger | undefined) => [ModuleWrapper<import("@xyo-network/module").Module<import("@xyo-network/module").ModuleParams<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
30
|
+
}, "schema">, undefined>, import("@xyo-network/module").ModuleEventData> | null | undefined, account?: import("@xyo-network/account-model").AccountInstance | null | undefined, logger?: import("@xyo-network/core").Logger | undefined) => [ModuleWrapper<import("@xyo-network/module").Module<import("@xyo-network/module").ModuleParams<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
31
31
|
readonly archivist?: import("@xyo-network/module").ArchivistModuleConfig | undefined;
|
|
32
32
|
readonly name?: string | undefined;
|
|
33
33
|
readonly paging?: Record<string, {
|
package/package.json
CHANGED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"@xylabs/react-button": "^2.17.6",
|
|
16
16
|
"@xylabs/react-crypto": "^2.17.6",
|
|
17
17
|
"@xylabs/react-flexbox": "^2.17.6",
|
|
18
|
-
"@xyo-network/account-model": "^2.64.
|
|
19
|
-
"@xyo-network/core": "^2.64.
|
|
20
|
-
"@xyo-network/diviner": "^2.64.
|
|
21
|
-
"@xyo-network/module": "^2.64.
|
|
22
|
-
"@xyo-network/payload-model": "^2.64.
|
|
23
|
-
"@xyo-network/react-shared": "^2.56.
|
|
24
|
-
"@xyo-network/react-wallet": "^2.56.
|
|
18
|
+
"@xyo-network/account-model": "^2.64.3",
|
|
19
|
+
"@xyo-network/core": "^2.64.3",
|
|
20
|
+
"@xyo-network/diviner": "^2.64.3",
|
|
21
|
+
"@xyo-network/module": "^2.64.3",
|
|
22
|
+
"@xyo-network/payload-model": "^2.64.3",
|
|
23
|
+
"@xyo-network/react-shared": "^2.56.5",
|
|
24
|
+
"@xyo-network/react-wallet": "^2.56.5"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@ethersproject/address": "^5.7.0",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"@ethersproject/networks": "^5.7.1",
|
|
30
30
|
"@ethersproject/providers": "^5.7.2",
|
|
31
31
|
"@ethersproject/solidity": "^5.7.0",
|
|
32
|
-
"@storybook/react": "^7.0.
|
|
32
|
+
"@storybook/react": "^7.0.25",
|
|
33
33
|
"@uniswap/sdk": "^3.0.3",
|
|
34
34
|
"@uniswap/sdk-core": "^3.2.6",
|
|
35
35
|
"@uniswap/v3-sdk": "^3.9.0",
|
|
36
36
|
"@xylabs/ts-scripts-yarn3": "^2.18.7",
|
|
37
37
|
"@xylabs/tsconfig-react": "^2.18.7",
|
|
38
|
-
"@xyo-network/archivist": "^2.64.
|
|
39
|
-
"@xyo-network/crypto-asset-plugin": "^2.64.
|
|
40
|
-
"@xyo-network/diviner-address-history": "^2.64.
|
|
41
|
-
"@xyo-network/node": "^2.64.
|
|
38
|
+
"@xyo-network/archivist": "^2.64.3",
|
|
39
|
+
"@xyo-network/crypto-asset-plugin": "^2.64.3",
|
|
40
|
+
"@xyo-network/diviner-address-history": "^2.64.3",
|
|
41
|
+
"@xyo-network/node": "^2.64.3",
|
|
42
42
|
"typescript": "^5.1.6"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
},
|
|
94
94
|
"sideEffects": false,
|
|
95
95
|
"types": "dist/types/index.d.ts",
|
|
96
|
-
"version": "2.56.
|
|
96
|
+
"version": "2.56.5"
|
|
97
97
|
}
|
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
import { CardHeader, CardHeaderProps } from '@mui/material'
|
|
2
|
-
import {
|
|
2
|
+
import { Module } from '@xyo-network/module'
|
|
3
3
|
import { findNetworkComponent } from '@xyo-network/react-shared'
|
|
4
4
|
|
|
5
5
|
import { ModuleRenderProps } from '../../../ModuleRenderProps'
|
|
6
6
|
|
|
7
|
-
const getModuleIcons = (moduleType: string,
|
|
8
|
-
return
|
|
7
|
+
const getModuleIcons = (moduleType: string, module: Module) => {
|
|
8
|
+
return module?.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon : null
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export const ModuleCardHeader: React.FC<ModuleRenderProps & CardHeaderProps> = ({ subheader, avatar, title, module, ...props }) => {
|
|
12
|
-
const wrapper = module ? ModuleWrapper.wrap(module) : undefined
|
|
13
|
-
|
|
14
12
|
return (
|
|
15
13
|
<CardHeader
|
|
16
14
|
title={title ?? module?.config.name ?? 'Module'}
|
|
17
|
-
subheader={subheader ??
|
|
15
|
+
subheader={subheader ?? module?.address}
|
|
18
16
|
avatar={
|
|
19
17
|
avatar ?? (
|
|
20
18
|
<>
|
|
21
|
-
{
|
|
19
|
+
{module
|
|
22
20
|
? ['sentinel', 'bridge', 'archivist', 'diviner', 'node', 'witness'].map((moduleType) => {
|
|
23
|
-
const Icon = getModuleIcons(moduleType,
|
|
21
|
+
const Icon = getModuleIcons(moduleType, module)
|
|
24
22
|
return Icon ? <Icon fontSize={'large'} color="primary" /> : null
|
|
25
23
|
})
|
|
26
24
|
: null}
|
|
@@ -2,25 +2,24 @@ import { EthAddress } from '@xylabs/eth-address'
|
|
|
2
2
|
import { ButtonEx } from '@xylabs/react-button'
|
|
3
3
|
import { EthAccountBox } from '@xylabs/react-crypto'
|
|
4
4
|
import { FlexBoxProps, FlexCol, FlexRow } from '@xylabs/react-flexbox'
|
|
5
|
-
import {
|
|
5
|
+
import { Module } from '@xyo-network/module'
|
|
6
6
|
import { findNetworkComponent } from '@xyo-network/react-shared'
|
|
7
7
|
import { useState } from 'react'
|
|
8
8
|
|
|
9
9
|
import { ModuleRenderProps } from '../ModuleRenderProps'
|
|
10
10
|
|
|
11
|
-
const getModuleIcon = (moduleType: string,
|
|
12
|
-
return
|
|
11
|
+
const getModuleIcon = (moduleType: string, module: Module) => {
|
|
12
|
+
return module?.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon() : null
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const ModuleDetailsBox: React.FC<ModuleRenderProps & FlexBoxProps> = ({ children, module, ...props }) => {
|
|
16
|
-
const wrapper = module ? ModuleWrapper.wrap(module) : undefined
|
|
17
16
|
const [showQueries, setShowQueries] = useState(false)
|
|
18
17
|
return (
|
|
19
18
|
<FlexCol {...props}>
|
|
20
19
|
<FlexRow>
|
|
21
|
-
{
|
|
20
|
+
{module
|
|
22
21
|
? ['sentinel', 'bridge', 'archivist', 'diviner', 'node'].map((moduleType) => {
|
|
23
|
-
const icon = getModuleIcon(moduleType,
|
|
22
|
+
const icon = getModuleIcon(moduleType, module)
|
|
24
23
|
return icon ? (
|
|
25
24
|
<ButtonEx onClick={() => setShowQueries(!showQueries)} key={moduleType}>
|
|
26
25
|
{icon}
|
|
@@ -28,11 +27,11 @@ export const ModuleDetailsBox: React.FC<ModuleRenderProps & FlexBoxProps> = ({ c
|
|
|
28
27
|
) : null
|
|
29
28
|
})
|
|
30
29
|
: null}
|
|
31
|
-
<EthAccountBox address={EthAddress.fromString(
|
|
30
|
+
<EthAccountBox address={EthAddress.fromString(module?.address)} />
|
|
32
31
|
</FlexRow>
|
|
33
32
|
|
|
34
33
|
{showQueries
|
|
35
|
-
?
|
|
34
|
+
? module?.queries.map((query) => {
|
|
36
35
|
return <FlexRow key={query}>{query}</FlexRow>
|
|
37
36
|
})
|
|
38
37
|
: null}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { TableCell, TableCellProps } from '@mui/material'
|
|
2
2
|
import { EthAddress } from '@xylabs/eth-address'
|
|
3
3
|
import { EthAccountBox } from '@xylabs/react-crypto'
|
|
4
|
-
import { ModuleWrapper } from '@xyo-network/module'
|
|
5
4
|
|
|
6
5
|
import { ModuleRenderProps } from '../ModuleRenderProps'
|
|
7
6
|
|
|
8
7
|
export const ModuleTableCell: React.FC<ModuleRenderProps & TableCellProps> = ({ children, module, ...props }) => {
|
|
9
|
-
const wrapper = module ? ModuleWrapper.wrap(module) : undefined
|
|
10
8
|
return (
|
|
11
9
|
<TableCell {...props}>
|
|
12
|
-
<EthAccountBox address={EthAddress.fromString(
|
|
10
|
+
<EthAccountBox address={EthAddress.fromString(module?.address)} />
|
|
13
11
|
{children}
|
|
14
12
|
</TableCell>
|
|
15
13
|
)
|
|
@@ -7,12 +7,12 @@ import { useEffect, useState } from 'react'
|
|
|
7
7
|
export const WrappedModuleHookFactory = {
|
|
8
8
|
create: <TModuleWrapper extends ModuleWrapper>(wrapperObject: ConstructableModuleWrapper<TModuleWrapper>, name?: string) => {
|
|
9
9
|
const useHook = (
|
|
10
|
-
module?: TModuleWrapper['module'],
|
|
11
|
-
account?: AccountInstance,
|
|
10
|
+
module?: TModuleWrapper['module'] | null,
|
|
11
|
+
account?: AccountInstance | null,
|
|
12
12
|
logger?: Logger,
|
|
13
13
|
): [TModuleWrapper | undefined, Error | undefined] => {
|
|
14
14
|
logger?.debug(`Render: ${name}`)
|
|
15
|
-
const wrapperAccount = useWrapperAccount()
|
|
15
|
+
const [wrapperAccount] = useWrapperAccount()
|
|
16
16
|
|
|
17
17
|
const [wrapper, setWrapper] = useState<TModuleWrapper>()
|
|
18
18
|
const [error, setError] = useState<Error>()
|
|
@@ -12,7 +12,7 @@ export const WrappedModulesHookFactory = {
|
|
|
12
12
|
logger?: Logger,
|
|
13
13
|
): [TModuleWrapper[] | undefined, Error | undefined] => {
|
|
14
14
|
logger?.debug(`Render: ${name}`)
|
|
15
|
-
const wrapperAccount = useWrapperAccount()
|
|
15
|
+
const [wrapperAccount] = useWrapperAccount()
|
|
16
16
|
|
|
17
17
|
const [wrappers, setWrappers] = useState<TModuleWrapper[]>()
|
|
18
18
|
const [error, setError] = useState<Error>()
|