@xyo-network/react-wallet 2.55.0 → 2.55.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/cjs/components/WalletAccountDetails/WalletAccountDetails.js +4 -4
- package/dist/cjs/components/WalletAccountDetails/WalletAccountDetails.js.map +1 -1
- package/dist/docs.json +140 -140
- package/dist/esm/components/WalletAccountDetails/WalletAccountDetails.js +4 -4
- package/dist/esm/components/WalletAccountDetails/WalletAccountDetails.js.map +1 -1
- package/dist/types/components/WalletAccountDetails/WalletAccountDetails.d.ts +2 -2
- package/dist/types/components/WalletAccountDetails/WalletAccountDetails.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/WalletAccountDetails/WalletAccountDetails.tsx +6 -10
|
@@ -5,10 +5,10 @@ import { FlexCol, FlexRow } from '@xylabs/react-flexbox';
|
|
|
5
5
|
import { NumberStatus } from '@xylabs/react-number-status';
|
|
6
6
|
import { useNetwork } from '@xyo-network/react-network';
|
|
7
7
|
import { useAccount } from '../../hooks';
|
|
8
|
-
export const WalletAccountDetails = ({ exploreUrl = 'https://explore.xyo.network', account
|
|
9
|
-
const [
|
|
8
|
+
export const WalletAccountDetails = ({ exploreUrl = 'https://explore.xyo.network', account, ...props }) => {
|
|
9
|
+
const [accountToUse] = useAccount({ account });
|
|
10
10
|
const { network } = useNetwork();
|
|
11
|
-
const exploreAddressUrl = `${exploreUrl}/recent?account=${
|
|
12
|
-
return (_jsxs(FlexCol, { ...props, children: [_jsx(EthAccountButton, { address: EthAddress.fromString(
|
|
11
|
+
const exploreAddressUrl = `${exploreUrl}/recent?account=${accountToUse?.address}&network=${network?.name ?? 'main'}`;
|
|
12
|
+
return (_jsxs(FlexCol, { ...props, children: [_jsx(EthAccountButton, { address: EthAddress.fromString(accountToUse?.address) }), _jsxs(FlexRow, { gap: 1, children: [_jsx(NumberStatus, { rounded: true, title: "Tokens", value: 0, to: `${exploreAddressUrl}&schema=network.xyo.account.tokens`, target: "_blank" }), _jsx(NumberStatus, { rounded: true, title: "NFTs", value: 0, to: `${exploreAddressUrl}&schema=network.xyo.account.nfts`, target: "_blank" }), _jsx(NumberStatus, { rounded: true, title: "Signatures", value: 0, to: `${exploreAddressUrl}&schema=network.xyo.account.signatures`, target: "_blank" }), _jsx(NumberStatus, { rounded: true, title: "Signins", value: 0, to: `${exploreAddressUrl}&schema=network.xyo.account.signins`, target: "_blank" })] })] }));
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=WalletAccountDetails.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletAccountDetails.js","sourceRoot":"","sources":["../../../../src/components/WalletAccountDetails/WalletAccountDetails.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAgB,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"WalletAccountDetails.js","sourceRoot":"","sources":["../../../../src/components/WalletAccountDetails/WalletAccountDetails.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAgB,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAOxC,MAAM,CAAC,MAAM,oBAAoB,GAAwC,CAAC,EAAE,UAAU,GAAG,6BAA6B,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC7I,MAAM,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;IAC9C,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,CAAA;IAChC,MAAM,iBAAiB,GAAG,GAAG,UAAU,mBAAmB,YAAY,EAAE,OAAO,YAAY,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,CAAA;IAEpH,OAAO,CACL,MAAC,OAAO,OAAK,KAAK,aAChB,KAAC,gBAAgB,IAAC,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,GAAI,EAC3E,MAAC,OAAO,IAAC,GAAG,EAAE,CAAC,aACb,KAAC,YAAY,IAAC,OAAO,QAAC,KAAK,EAAC,QAAQ,EAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,iBAAiB,oCAAoC,EAAE,MAAM,EAAC,QAAQ,GAAG,EAC/H,KAAC,YAAY,IAAC,OAAO,QAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,iBAAiB,kCAAkC,EAAE,MAAM,EAAC,QAAQ,GAAG,EAC3H,KAAC,YAAY,IAAC,OAAO,QAAC,KAAK,EAAC,YAAY,EAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,iBAAiB,wCAAwC,EAAE,MAAM,EAAC,QAAQ,GAAG,EACvI,KAAC,YAAY,IAAC,OAAO,QAAC,KAAK,EAAC,SAAS,EAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,iBAAiB,qCAAqC,EAAE,MAAM,EAAC,QAAQ,GAAG,IACzH,IACF,CACX,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
3
|
-
import {
|
|
3
|
+
import { WalletInstance } from '@xyo-network/wallet-model';
|
|
4
4
|
export interface WalletAccountDetailsProps extends FlexBoxProps {
|
|
5
|
-
account?:
|
|
5
|
+
account?: WalletInstance;
|
|
6
6
|
exploreUrl?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare const WalletAccountDetails: React.FC<WalletAccountDetailsProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletAccountDetails.d.ts","sourceRoot":"","sources":["../../../../src/components/WalletAccountDetails/WalletAccountDetails.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAoB,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"WalletAccountDetails.d.ts","sourceRoot":"","sources":["../../../../src/components/WalletAccountDetails/WalletAccountDetails.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAoB,MAAM,uBAAuB,CAAA;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAI1D,MAAM,WAAW,yBAA0B,SAAQ,YAAY;IAC7D,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAgBpE,CAAA"}
|
package/package.json
CHANGED
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"@xylabs/react-shared": "^2.17.3",
|
|
22
22
|
"@xyo-network/account": "^2.63.1",
|
|
23
23
|
"@xyo-network/core": "^2.63.1",
|
|
24
|
-
"@xyo-network/react-address-render": "^2.55.
|
|
25
|
-
"@xyo-network/react-network": "^2.55.
|
|
26
|
-
"@xyo-network/react-shared": "^2.55.
|
|
24
|
+
"@xyo-network/react-address-render": "^2.55.1",
|
|
25
|
+
"@xyo-network/react-network": "^2.55.1",
|
|
26
|
+
"@xyo-network/react-shared": "^2.55.1",
|
|
27
27
|
"@xyo-network/wallet-model": "^2.63.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@storybook/react": "^7.0.23",
|
|
41
41
|
"@xylabs/ts-scripts-yarn3": "^2.17.17",
|
|
42
42
|
"@xylabs/tsconfig-react": "^2.17.17",
|
|
43
|
-
"@xyo-network/react-storybook": "^2.55.
|
|
43
|
+
"@xyo-network/react-storybook": "^2.55.1",
|
|
44
44
|
"typescript": "^5.1.3"
|
|
45
45
|
},
|
|
46
46
|
"browser": "dist/esm/index.js",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
},
|
|
86
86
|
"sideEffects": false,
|
|
87
87
|
"types": "dist/types/index.d.ts",
|
|
88
|
-
"version": "2.55.
|
|
88
|
+
"version": "2.55.1"
|
|
89
89
|
}
|
|
@@ -2,28 +2,24 @@ import { EthAddress } from '@xylabs/eth-address'
|
|
|
2
2
|
import { EthAccountButton } from '@xylabs/react-crypto'
|
|
3
3
|
import { FlexBoxProps, FlexCol, FlexRow } from '@xylabs/react-flexbox'
|
|
4
4
|
import { NumberStatus } from '@xylabs/react-number-status'
|
|
5
|
-
import { Account } from '@xyo-network/account'
|
|
6
5
|
import { useNetwork } from '@xyo-network/react-network'
|
|
6
|
+
import { WalletInstance } from '@xyo-network/wallet-model'
|
|
7
7
|
|
|
8
8
|
import { useAccount } from '../../hooks'
|
|
9
9
|
|
|
10
10
|
export interface WalletAccountDetailsProps extends FlexBoxProps {
|
|
11
|
-
account?:
|
|
11
|
+
account?: WalletInstance
|
|
12
12
|
exploreUrl?: string
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export const WalletAccountDetails: React.FC<WalletAccountDetailsProps> = ({
|
|
16
|
-
|
|
17
|
-
account: accountProp,
|
|
18
|
-
...props
|
|
19
|
-
}) => {
|
|
20
|
-
const [account = accountProp] = useAccount()
|
|
15
|
+
export const WalletAccountDetails: React.FC<WalletAccountDetailsProps> = ({ exploreUrl = 'https://explore.xyo.network', account, ...props }) => {
|
|
16
|
+
const [accountToUse] = useAccount({ account })
|
|
21
17
|
const { network } = useNetwork()
|
|
22
|
-
const exploreAddressUrl = `${exploreUrl}/recent?account=${
|
|
18
|
+
const exploreAddressUrl = `${exploreUrl}/recent?account=${accountToUse?.address}&network=${network?.name ?? 'main'}`
|
|
23
19
|
|
|
24
20
|
return (
|
|
25
21
|
<FlexCol {...props}>
|
|
26
|
-
<EthAccountButton address={EthAddress.fromString(
|
|
22
|
+
<EthAccountButton address={EthAddress.fromString(accountToUse?.address)} />
|
|
27
23
|
<FlexRow gap={1}>
|
|
28
24
|
<NumberStatus rounded title="Tokens" value={0} to={`${exploreAddressUrl}&schema=network.xyo.account.tokens`} target="_blank" />
|
|
29
25
|
<NumberStatus rounded title="NFTs" value={0} to={`${exploreAddressUrl}&schema=network.xyo.account.nfts`} target="_blank" />
|