@xyo-network/react-connected-accounts 2.66.3
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +165 -0
- package/README.md +13 -0
- package/dist/browser/components/ConnectedAccountsFlexbox.d.cts +4 -0
- package/dist/browser/components/ConnectedAccountsFlexbox.d.cts.map +1 -0
- package/dist/browser/components/ConnectedAccountsFlexbox.d.mts +4 -0
- package/dist/browser/components/ConnectedAccountsFlexbox.d.mts.map +1 -0
- package/dist/browser/components/ConnectedAccountsFlexbox.d.ts +4 -0
- package/dist/browser/components/ConnectedAccountsFlexbox.d.ts.map +1 -0
- package/dist/browser/components/index.d.cts +3 -0
- package/dist/browser/components/index.d.cts.map +1 -0
- package/dist/browser/components/index.d.mts +3 -0
- package/dist/browser/components/index.d.mts.map +1 -0
- package/dist/browser/components/index.d.ts +3 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/components/wallet/index.d.cts +2 -0
- package/dist/browser/components/wallet/index.d.cts.map +1 -0
- package/dist/browser/components/wallet/index.d.mts +2 -0
- package/dist/browser/components/wallet/index.d.mts.map +1 -0
- package/dist/browser/components/wallet/index.d.ts +2 -0
- package/dist/browser/components/wallet/index.d.ts.map +1 -0
- package/dist/browser/components/wallet/lib/TableHeadData.d.cts +3 -0
- package/dist/browser/components/wallet/lib/TableHeadData.d.cts.map +1 -0
- package/dist/browser/components/wallet/lib/TableHeadData.d.mts +3 -0
- package/dist/browser/components/wallet/lib/TableHeadData.d.mts.map +1 -0
- package/dist/browser/components/wallet/lib/TableHeadData.d.ts +3 -0
- package/dist/browser/components/wallet/lib/TableHeadData.d.ts.map +1 -0
- package/dist/browser/components/wallet/lib/index.d.cts +2 -0
- package/dist/browser/components/wallet/lib/index.d.cts.map +1 -0
- package/dist/browser/components/wallet/lib/index.d.mts +2 -0
- package/dist/browser/components/wallet/lib/index.d.mts.map +1 -0
- package/dist/browser/components/wallet/lib/index.d.ts +2 -0
- package/dist/browser/components/wallet/lib/index.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTable.d.cts +8 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTable.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTable.d.mts +8 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTable.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTable.d.ts +8 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTable.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTableRow.d.cts +16 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTableRow.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTableRow.d.mts +16 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTableRow.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTableRow.d.ts +16 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTableRow.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/index.d.cts +3 -0
- package/dist/browser/components/wallet/table/index.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/index.d.mts +3 -0
- package/dist/browser/components/wallet/table/index.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/index.d.ts +3 -0
- package/dist/browser/components/wallet/table/index.d.ts.map +1 -0
- package/dist/browser/hooks/index.d.cts +2 -0
- package/dist/browser/hooks/index.d.cts.map +1 -0
- package/dist/browser/hooks/index.d.mts +2 -0
- package/dist/browser/hooks/index.d.mts.map +1 -0
- package/dist/browser/hooks/index.d.ts +2 -0
- package/dist/browser/hooks/index.d.ts.map +1 -0
- package/dist/browser/hooks/useDetectWallets.d.cts +6 -0
- package/dist/browser/hooks/useDetectWallets.d.cts.map +1 -0
- package/dist/browser/hooks/useDetectWallets.d.mts +6 -0
- package/dist/browser/hooks/useDetectWallets.d.mts.map +1 -0
- package/dist/browser/hooks/useDetectWallets.d.ts +6 -0
- package/dist/browser/hooks/useDetectWallets.d.ts.map +1 -0
- package/dist/browser/index.cjs +188 -0
- package/dist/browser/index.cjs.map +1 -0
- package/dist/browser/index.d.cts +3 -0
- package/dist/browser/index.d.cts.map +1 -0
- package/dist/browser/index.d.mts +3 -0
- package/dist/browser/index.d.mts.map +1 -0
- package/dist/browser/index.d.ts +3 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +165 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/node/components/ConnectedAccountsFlexbox.d.cts +4 -0
- package/dist/node/components/ConnectedAccountsFlexbox.d.cts.map +1 -0
- package/dist/node/components/ConnectedAccountsFlexbox.d.mts +4 -0
- package/dist/node/components/ConnectedAccountsFlexbox.d.mts.map +1 -0
- package/dist/node/components/ConnectedAccountsFlexbox.d.ts +4 -0
- package/dist/node/components/ConnectedAccountsFlexbox.d.ts.map +1 -0
- package/dist/node/components/index.d.cts +3 -0
- package/dist/node/components/index.d.cts.map +1 -0
- package/dist/node/components/index.d.mts +3 -0
- package/dist/node/components/index.d.mts.map +1 -0
- package/dist/node/components/index.d.ts +3 -0
- package/dist/node/components/index.d.ts.map +1 -0
- package/dist/node/components/wallet/index.d.cts +2 -0
- package/dist/node/components/wallet/index.d.cts.map +1 -0
- package/dist/node/components/wallet/index.d.mts +2 -0
- package/dist/node/components/wallet/index.d.mts.map +1 -0
- package/dist/node/components/wallet/index.d.ts +2 -0
- package/dist/node/components/wallet/index.d.ts.map +1 -0
- package/dist/node/components/wallet/lib/TableHeadData.d.cts +3 -0
- package/dist/node/components/wallet/lib/TableHeadData.d.cts.map +1 -0
- package/dist/node/components/wallet/lib/TableHeadData.d.mts +3 -0
- package/dist/node/components/wallet/lib/TableHeadData.d.mts.map +1 -0
- package/dist/node/components/wallet/lib/TableHeadData.d.ts +3 -0
- package/dist/node/components/wallet/lib/TableHeadData.d.ts.map +1 -0
- package/dist/node/components/wallet/lib/index.d.cts +2 -0
- package/dist/node/components/wallet/lib/index.d.cts.map +1 -0
- package/dist/node/components/wallet/lib/index.d.mts +2 -0
- package/dist/node/components/wallet/lib/index.d.mts.map +1 -0
- package/dist/node/components/wallet/lib/index.d.ts +2 -0
- package/dist/node/components/wallet/lib/index.d.ts.map +1 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTable.d.cts +8 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTable.d.cts.map +1 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTable.d.mts +8 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTable.d.mts.map +1 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTable.d.ts +8 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTable.d.ts.map +1 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTableRow.d.cts +16 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTableRow.d.cts.map +1 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTableRow.d.mts +16 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTableRow.d.mts.map +1 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTableRow.d.ts +16 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTableRow.d.ts.map +1 -0
- package/dist/node/components/wallet/table/index.d.cts +3 -0
- package/dist/node/components/wallet/table/index.d.cts.map +1 -0
- package/dist/node/components/wallet/table/index.d.mts +3 -0
- package/dist/node/components/wallet/table/index.d.mts.map +1 -0
- package/dist/node/components/wallet/table/index.d.ts +3 -0
- package/dist/node/components/wallet/table/index.d.ts.map +1 -0
- package/dist/node/hooks/index.d.cts +2 -0
- package/dist/node/hooks/index.d.cts.map +1 -0
- package/dist/node/hooks/index.d.mts +2 -0
- package/dist/node/hooks/index.d.mts.map +1 -0
- package/dist/node/hooks/index.d.ts +2 -0
- package/dist/node/hooks/index.d.ts.map +1 -0
- package/dist/node/hooks/useDetectWallets.d.cts +6 -0
- package/dist/node/hooks/useDetectWallets.d.cts.map +1 -0
- package/dist/node/hooks/useDetectWallets.d.mts +6 -0
- package/dist/node/hooks/useDetectWallets.d.mts.map +1 -0
- package/dist/node/hooks/useDetectWallets.d.ts +6 -0
- package/dist/node/hooks/useDetectWallets.d.ts.map +1 -0
- package/dist/node/index.cjs +199 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.d.cts +3 -0
- package/dist/node/index.d.cts.map +1 -0
- package/dist/node/index.d.mts +3 -0
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +168 -0
- package/dist/node/index.js.map +1 -0
- package/package.json +83 -0
- package/src/components/ConnectedAccountsFlexbox.stories.tsx +26 -0
- package/src/components/ConnectedAccountsFlexbox.tsx +27 -0
- package/src/components/index.ts +2 -0
- package/src/components/wallet/index.ts +1 -0
- package/src/components/wallet/lib/TableHeadData.ts +32 -0
- package/src/components/wallet/lib/index.ts +1 -0
- package/src/components/wallet/table/ConnectedWalletsTable.tsx +30 -0
- package/src/components/wallet/table/ConnectedWalletsTableRow.tsx +95 -0
- package/src/components/wallet/table/index.ts +2 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useDetectWallets.tsx +40 -0
- package/src/index.ts +2 -0
- package/typedoc.json +5 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { TableRowProps } from '@mui/material';
|
3
|
+
import { EthWalletConnectorBase } from '@xylabs/react-crypto';
|
4
|
+
export interface WalletConnectionsTableRowInnerProps extends TableRowProps {
|
5
|
+
additionalAccounts?: string[];
|
6
|
+
chainName?: string;
|
7
|
+
currentAccount?: string[];
|
8
|
+
icon?: string;
|
9
|
+
name?: string;
|
10
|
+
}
|
11
|
+
export declare const WalletConnectionsTableRowInner: React.FC<WalletConnectionsTableRowInnerProps>;
|
12
|
+
export interface WalletConnectionsTableRow extends TableRowProps {
|
13
|
+
wallet: EthWalletConnectorBase;
|
14
|
+
}
|
15
|
+
export declare const WalletConnectionsTableRow: React.FC<WalletConnectionsTableRow>;
|
16
|
+
//# sourceMappingURL=ConnectedWalletsTableRow.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ConnectedWalletsTableRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/wallet/table/ConnectedWalletsTableRow.tsx"],"names":[],"mappings":";AACA,OAAO,EAA+B,aAAa,EAAiC,MAAM,eAAe,CAAA;AACzG,OAAO,EAAoB,sBAAsB,EAAgB,MAAM,sBAAsB,CAAA;AAI7F,MAAM,WAAW,mCAAoC,SAAQ,aAAa;IACxE,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,eAAO,MAAM,8BAA8B,EAAE,KAAK,CAAC,EAAE,CAAC,mCAAmC,CA8DxF,CAAA;AAED,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,MAAM,EAAE,sBAAsB,CAAA;CAC/B;AACD,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAazE,CAAA"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { TableRowProps } from '@mui/material';
|
3
|
+
import { EthWalletConnectorBase } from '@xylabs/react-crypto';
|
4
|
+
export interface WalletConnectionsTableRowInnerProps extends TableRowProps {
|
5
|
+
additionalAccounts?: string[];
|
6
|
+
chainName?: string;
|
7
|
+
currentAccount?: string[];
|
8
|
+
icon?: string;
|
9
|
+
name?: string;
|
10
|
+
}
|
11
|
+
export declare const WalletConnectionsTableRowInner: React.FC<WalletConnectionsTableRowInnerProps>;
|
12
|
+
export interface WalletConnectionsTableRow extends TableRowProps {
|
13
|
+
wallet: EthWalletConnectorBase;
|
14
|
+
}
|
15
|
+
export declare const WalletConnectionsTableRow: React.FC<WalletConnectionsTableRow>;
|
16
|
+
//# sourceMappingURL=ConnectedWalletsTableRow.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ConnectedWalletsTableRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/wallet/table/ConnectedWalletsTableRow.tsx"],"names":[],"mappings":";AACA,OAAO,EAA+B,aAAa,EAAiC,MAAM,eAAe,CAAA;AACzG,OAAO,EAAoB,sBAAsB,EAAgB,MAAM,sBAAsB,CAAA;AAI7F,MAAM,WAAW,mCAAoC,SAAQ,aAAa;IACxE,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,eAAO,MAAM,8BAA8B,EAAE,KAAK,CAAC,EAAE,CAAC,mCAAmC,CA8DxF,CAAA;AAED,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,MAAM,EAAE,sBAAsB,CAAA;CAC/B;AACD,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAazE,CAAA"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { TableRowProps } from '@mui/material';
|
3
|
+
import { EthWalletConnectorBase } from '@xylabs/react-crypto';
|
4
|
+
export interface WalletConnectionsTableRowInnerProps extends TableRowProps {
|
5
|
+
additionalAccounts?: string[];
|
6
|
+
chainName?: string;
|
7
|
+
currentAccount?: string[];
|
8
|
+
icon?: string;
|
9
|
+
name?: string;
|
10
|
+
}
|
11
|
+
export declare const WalletConnectionsTableRowInner: React.FC<WalletConnectionsTableRowInnerProps>;
|
12
|
+
export interface WalletConnectionsTableRow extends TableRowProps {
|
13
|
+
wallet: EthWalletConnectorBase;
|
14
|
+
}
|
15
|
+
export declare const WalletConnectionsTableRow: React.FC<WalletConnectionsTableRow>;
|
16
|
+
//# sourceMappingURL=ConnectedWalletsTableRow.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ConnectedWalletsTableRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/wallet/table/ConnectedWalletsTableRow.tsx"],"names":[],"mappings":";AACA,OAAO,EAA+B,aAAa,EAAiC,MAAM,eAAe,CAAA;AACzG,OAAO,EAAoB,sBAAsB,EAAgB,MAAM,sBAAsB,CAAA;AAI7F,MAAM,WAAW,mCAAoC,SAAQ,aAAa;IACxE,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,eAAO,MAAM,8BAA8B,EAAE,KAAK,CAAC,EAAE,CAAC,mCAAmC,CA8DxF,CAAA;AAED,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,MAAM,EAAE,sBAAsB,CAAA;CAC/B;AACD,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAazE,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/wallet/table/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/wallet/table/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/wallet/table/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useDetectWallets.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDetectWallets.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+C,gBAAgB,EAAsB,MAAM,sBAAsB,CAAA;AASxH,eAAO,MAAM,kBAAkB;;;CA8B9B,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useDetectWallets.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDetectWallets.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+C,gBAAgB,EAAsB,MAAM,sBAAsB,CAAA;AASxH,eAAO,MAAM,kBAAkB;;;CA8B9B,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useDetectWallets.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDetectWallets.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+C,gBAAgB,EAAsB,MAAM,sBAAsB,CAAA;AASxH,eAAO,MAAM,kBAAkB;;;CA8B9B,CAAA"}
|
@@ -0,0 +1,199 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
|
20
|
+
// src/index.ts
|
21
|
+
var src_exports = {};
|
22
|
+
__export(src_exports, {
|
23
|
+
ConnectedAccountsFlexbox: () => ConnectedAccountsFlexbox,
|
24
|
+
ConnectedWalletsTable: () => ConnectedWalletsTable,
|
25
|
+
WalletConnectionsTableRow: () => WalletConnectionsTableRow,
|
26
|
+
WalletConnectionsTableRowInner: () => WalletConnectionsTableRowInner,
|
27
|
+
useDetectedWallets: () => useDetectedWallets
|
28
|
+
});
|
29
|
+
module.exports = __toCommonJS(src_exports);
|
30
|
+
|
31
|
+
// src/components/ConnectedAccountsFlexbox.tsx
|
32
|
+
var import_material3 = require("@mui/material");
|
33
|
+
var import_react_flexbox2 = require("@xylabs/react-flexbox");
|
34
|
+
|
35
|
+
// src/hooks/useDetectWallets.tsx
|
36
|
+
var import_react_crypto = require("@xylabs/react-crypto");
|
37
|
+
var import_react = require("react");
|
38
|
+
var sortWallets = (wallets) => Object.values(wallets).reduce((acc, wallet) => {
|
39
|
+
wallet.allowedAccounts.length > 0 ? acc.unshift(wallet) : acc.push(wallet);
|
40
|
+
return acc;
|
41
|
+
}, []);
|
42
|
+
var useDetectedWallets = () => {
|
43
|
+
const wallets = (0, import_react_crypto.useWalletDiscovery)();
|
44
|
+
const [refresh, setRefresh] = (0, import_react.useState)(0);
|
45
|
+
const [sortedWallets, setSortedWallets] = (0, import_react.useState)([]);
|
46
|
+
(0, import_react.useEffect)(() => {
|
47
|
+
setSortedWallets(sortWallets(wallets));
|
48
|
+
}, [wallets, refresh]);
|
49
|
+
(0, import_react.useEffect)(() => {
|
50
|
+
const listener = () => {
|
51
|
+
setRefresh((refresh2) => refresh2 + 1);
|
52
|
+
};
|
53
|
+
window.addEventListener(import_react_crypto.AccountsChangedEventName, listener);
|
54
|
+
return () => {
|
55
|
+
window.removeEventListener(import_react_crypto.AccountsChangedEventName, listener);
|
56
|
+
};
|
57
|
+
}, [wallets]);
|
58
|
+
const totalConnectedAccounts = (0, import_react.useMemo)(
|
59
|
+
() => Object.values(sortedWallets).reduce((acc, wallet) => acc + wallet.allowedAccounts.length, 0),
|
60
|
+
[sortedWallets]
|
61
|
+
);
|
62
|
+
return { sortedWallets, totalConnectedAccounts };
|
63
|
+
};
|
64
|
+
|
65
|
+
// src/components/wallet/table/ConnectedWalletsTable.tsx
|
66
|
+
var import_material2 = require("@mui/material");
|
67
|
+
|
68
|
+
// src/components/wallet/lib/TableHeadData.ts
|
69
|
+
var WalletsTableHeadCells = [
|
70
|
+
{
|
71
|
+
disablePadding: false,
|
72
|
+
id: "wallet",
|
73
|
+
label: "Wallet",
|
74
|
+
numeric: false,
|
75
|
+
showOnMobile: true
|
76
|
+
},
|
77
|
+
{
|
78
|
+
disablePadding: false,
|
79
|
+
id: "chain",
|
80
|
+
label: "Chain",
|
81
|
+
numeric: false,
|
82
|
+
showOnMobile: true
|
83
|
+
},
|
84
|
+
{
|
85
|
+
disablePadding: false,
|
86
|
+
id: "accounts",
|
87
|
+
label: "Accounts",
|
88
|
+
numeric: true,
|
89
|
+
showOnMobile: true
|
90
|
+
},
|
91
|
+
{
|
92
|
+
disablePadding: false,
|
93
|
+
id: "actions",
|
94
|
+
label: "Actions",
|
95
|
+
numeric: false,
|
96
|
+
showOnMobile: true
|
97
|
+
}
|
98
|
+
];
|
99
|
+
|
100
|
+
// src/components/wallet/table/ConnectedWalletsTableRow.tsx
|
101
|
+
var import_icons_material = require("@mui/icons-material");
|
102
|
+
var import_material = require("@mui/material");
|
103
|
+
var import_react_crypto2 = require("@xylabs/react-crypto");
|
104
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
105
|
+
var import_react2 = require("react");
|
106
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
107
|
+
var WalletConnectionsTableRowInner = ({
|
108
|
+
additionalAccounts,
|
109
|
+
currentAccount,
|
110
|
+
chainName,
|
111
|
+
icon,
|
112
|
+
name,
|
113
|
+
...props
|
114
|
+
}) => {
|
115
|
+
const theme = (0, import_material.useTheme)();
|
116
|
+
const totalAccounts = ((additionalAccounts == null ? void 0 : additionalAccounts.length) ?? 0) + ((currentAccount == null ? void 0 : currentAccount.length) ?? 0);
|
117
|
+
const connected = (currentAccount == null ? void 0 : currentAccount.length) ?? 0 > 0;
|
118
|
+
const Cells = (0, import_react2.useMemo)(() => {
|
119
|
+
const TableCells = {
|
120
|
+
wallet: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { gap: 2, justifyContent: "start", children: [
|
121
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_crypto2.ConstrainedImage, { constrainedValue: theme.spacing(4), src: icon }),
|
122
|
+
name
|
123
|
+
] }) }, 1),
|
124
|
+
// eslint-disable-next-line sort-keys-fix/sort-keys-fix
|
125
|
+
chain: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableCell, { children: chainName }, 2),
|
126
|
+
// eslint-disable-next-line sort-keys-fix/sort-keys-fix
|
127
|
+
accounts: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
128
|
+
import_material.Tooltip,
|
129
|
+
{
|
130
|
+
sx: { cursor: totalAccounts > 0 ? "pointer" : "auto" },
|
131
|
+
title: [...currentAccount ?? [], ...additionalAccounts ?? []].map((address, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: address }, index)),
|
132
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { children: totalAccounts })
|
133
|
+
}
|
134
|
+
) }, 3),
|
135
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { gap: 2, justifyContent: "start", children: [
|
136
|
+
connected ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Typography, { sx: { display: "inline-flex", gap: 0.5 }, children: [
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Check, {}),
|
138
|
+
"Connected"
|
139
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { variant: "contained", children: "Connect" }),
|
140
|
+
connected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { variant: "outlined", color: "error", children: "Revoke" }) : null
|
141
|
+
] }) }, 4)
|
142
|
+
};
|
143
|
+
return TableCells;
|
144
|
+
}, [additionalAccounts, chainName, connected, currentAccount, icon, name, theme, totalAccounts]);
|
145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableRow, { ...props, children: Object.values(Cells).map((cell) => cell) });
|
146
|
+
};
|
147
|
+
var WalletConnectionsTableRow = ({ wallet, ...props }) => {
|
148
|
+
const { currentAccount, additionalAccounts, chainName, providerInfo, providerName } = (0, import_react_crypto2.useEthWallet)(wallet);
|
149
|
+
const currentAccountString = currentAccount == null ? void 0 : currentAccount.toString();
|
150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
151
|
+
WalletConnectionsTableRowInner,
|
152
|
+
{
|
153
|
+
additionalAccounts,
|
154
|
+
currentAccount: currentAccountString ? [currentAccountString] : [],
|
155
|
+
chainName,
|
156
|
+
icon: providerInfo == null ? void 0 : providerInfo.icon,
|
157
|
+
name: providerName,
|
158
|
+
...props
|
159
|
+
}
|
160
|
+
);
|
161
|
+
};
|
162
|
+
|
163
|
+
// src/components/wallet/table/ConnectedWalletsTable.tsx
|
164
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
165
|
+
var ConnectedWalletsTable = ({ wallets, ...props }) => {
|
166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material2.Table, { ...props, children: [
|
167
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.TableRow, { children: WalletsTableHeadCells.map(({ disablePadding, id, label, align, width }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.TableCell, { align, padding: disablePadding ? "none" : "normal", width: width ?? "auto", children: label }, id)) }) }),
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.TableBody, { children: (wallets ?? []).map((wallet) => {
|
169
|
+
var _a;
|
170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(WalletConnectionsTableRow, { wallet }, (_a = wallet.providerInfo) == null ? void 0 : _a.rdns);
|
171
|
+
}) })
|
172
|
+
] });
|
173
|
+
};
|
174
|
+
|
175
|
+
// src/components/ConnectedAccountsFlexbox.tsx
|
176
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
177
|
+
var ConnectedAccountsFlexbox = (props) => {
|
178
|
+
const theme = (0, import_material3.useTheme)();
|
179
|
+
const { totalConnectedAccounts, sortedWallets } = useDetectedWallets();
|
180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_flexbox2.FlexCol, { alignItems: "stretch", justifyContent: "start", gap: 2, ...props, children: [
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_flexbox2.FlexCol, { alignItems: "start", children: [
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Typography, { variant: "h2", sx: { mb: 0.5 }, children: "Detected Web3 Wallets" }),
|
183
|
+
totalConnectedAccounts ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_material3.Typography, { variant: "subtitle1", color: theme.palette.secondary.main, sx: { opacity: 0.5 }, children: [
|
184
|
+
"Total Connected Accounts: ",
|
185
|
+
totalConnectedAccounts
|
186
|
+
] }) : null
|
187
|
+
] }),
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ConnectedWalletsTable, { wallets: sortedWallets })
|
189
|
+
] });
|
190
|
+
};
|
191
|
+
// Annotate the CommonJS export names for ESM import in node:
|
192
|
+
0 && (module.exports = {
|
193
|
+
ConnectedAccountsFlexbox,
|
194
|
+
ConnectedWalletsTable,
|
195
|
+
WalletConnectionsTableRow,
|
196
|
+
WalletConnectionsTableRowInner,
|
197
|
+
useDetectedWallets
|
198
|
+
});
|
199
|
+
//# sourceMappingURL=index.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/components/ConnectedAccountsFlexbox.tsx","../../src/hooks/useDetectWallets.tsx","../../src/components/wallet/table/ConnectedWalletsTable.tsx","../../src/components/wallet/lib/TableHeadData.ts","../../src/components/wallet/table/ConnectedWalletsTableRow.tsx"],"sourcesContent":["export * from './components'\nexport * from './hooks'\n","import { Typography, useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\n\nimport { useDetectedWallets } from '../hooks'\nimport { ConnectedWalletsTable } from './wallet'\n\nexport const ConnectedAccountsFlexbox: React.FC<FlexBoxProps> = (props) => {\n const theme = useTheme()\n\n const { totalConnectedAccounts, sortedWallets } = useDetectedWallets()\n\n return (\n <FlexCol alignItems=\"stretch\" justifyContent=\"start\" gap={2} {...props}>\n <FlexCol alignItems=\"start\">\n <Typography variant={'h2'} sx={{ mb: 0.5 }}>\n Detected Web3 Wallets\n </Typography>\n {totalConnectedAccounts ? (\n <Typography variant={'subtitle1'} color={theme.palette.secondary.main} sx={{ opacity: 0.5 }}>\n Total Connected Accounts: {totalConnectedAccounts}\n </Typography>\n ) : null}\n </FlexCol>\n <ConnectedWalletsTable wallets={sortedWallets} />\n </FlexCol>\n )\n}\n","import { AccountsChangedEventName, DiscoveredWallets, EIP6963Connector, useWalletDiscovery } from '@xylabs/react-crypto'\nimport { useEffect, useMemo, useState } from 'react'\n\nconst sortWallets = (wallets: DiscoveredWallets) =>\n Object.values(wallets).reduce((acc, wallet) => {\n wallet.allowedAccounts.length > 0 ? acc.unshift(wallet) : acc.push(wallet)\n return acc\n }, [] as EIP6963Connector[])\n\nexport const useDetectedWallets = () => {\n const wallets = useWalletDiscovery()\n const [refresh, setRefresh] = useState(0)\n const [sortedWallets, setSortedWallets] = useState<EIP6963Connector[]>([])\n\n useEffect(() => {\n setSortedWallets(sortWallets(wallets))\n }, [wallets, refresh])\n\n /**\n * Rely on custom events from the wallet base class to know when accounts are changed.\n * This approach prevents the need to loop through all wallets and set up individual listeners.\n */\n useEffect(() => {\n const listener: (event: CustomEventInit) => void = () => {\n setRefresh((refresh) => refresh + 1)\n }\n window.addEventListener(AccountsChangedEventName, listener)\n\n return () => {\n window.removeEventListener(AccountsChangedEventName, listener)\n }\n }, [wallets])\n\n const totalConnectedAccounts = useMemo(\n () => Object.values(sortedWallets).reduce((acc, wallet) => acc + wallet.allowedAccounts.length, 0),\n [sortedWallets],\n )\n\n return { sortedWallets, totalConnectedAccounts }\n}\n","import { Table, TableBody, TableCell, TableHead, TableProps, TableRow } from '@mui/material'\nimport { EIP6963Connector } from '@xylabs/react-crypto'\n\nimport { WalletsTableHeadCells } from '../lib'\nimport { WalletConnectionsTableRow } from './ConnectedWalletsTableRow'\n\nexport interface ConnectedWalletsTableProps extends TableProps {\n wallets?: EIP6963Connector[]\n}\n\nexport const ConnectedWalletsTable: React.FC<ConnectedWalletsTableProps> = ({ wallets, ...props }) => {\n return (\n <Table {...props}>\n <TableHead>\n <TableRow>\n {WalletsTableHeadCells.map(({ disablePadding, id, label, align, width }) => (\n <TableCell align={align} key={id} padding={disablePadding ? 'none' : 'normal'} width={width ?? 'auto'}>\n {label}\n </TableCell>\n ))}\n </TableRow>\n </TableHead>\n <TableBody>\n {(wallets ?? []).map((wallet) => (\n <WalletConnectionsTableRow wallet={wallet} key={wallet.providerInfo?.rdns} />\n ))}\n </TableBody>\n </Table>\n )\n}\n","import { TableHeadCell } from '@xyo-network/react-table'\n\nexport const WalletsTableHeadCells: TableHeadCell[] = [\n {\n disablePadding: false,\n id: 'wallet',\n label: 'Wallet',\n numeric: false,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'chain',\n label: 'Chain',\n numeric: false,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'accounts',\n label: 'Accounts',\n numeric: true,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'actions',\n label: 'Actions',\n numeric: false,\n showOnMobile: true,\n },\n]\n","import { Check } from '@mui/icons-material'\nimport { Button, TableCell, TableRow, TableRowProps, Tooltip, Typography, useTheme } from '@mui/material'\nimport { ConstrainedImage, EthWalletConnectorBase, useEthWallet } from '@xylabs/react-crypto'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { ReactNode, useMemo } from 'react'\n\nexport interface WalletConnectionsTableRowInnerProps extends TableRowProps {\n additionalAccounts?: string[]\n chainName?: string\n currentAccount?: string[]\n icon?: string\n name?: string\n}\n\nexport const WalletConnectionsTableRowInner: React.FC<WalletConnectionsTableRowInnerProps> = ({\n additionalAccounts,\n currentAccount,\n chainName,\n icon,\n name,\n ...props\n}) => {\n const theme = useTheme()\n\n const totalAccounts = (additionalAccounts?.length ?? 0) + (currentAccount?.length ?? 0)\n const connected = currentAccount?.length ?? 0 > 0\n\n const Cells = useMemo(() => {\n const TableCells: Record<string, ReactNode> = {\n wallet: (\n <TableCell key={1}>\n <FlexRow gap={2} justifyContent=\"start\">\n <ConstrainedImage constrainedValue={theme.spacing(4)} src={icon} />\n {name}\n </FlexRow>\n </TableCell>\n ),\n // eslint-disable-next-line sort-keys-fix/sort-keys-fix\n chain: <TableCell key={2}>{chainName}</TableCell>,\n // eslint-disable-next-line sort-keys-fix/sort-keys-fix\n accounts: (\n <TableCell key={3}>\n <Tooltip\n sx={{ cursor: totalAccounts > 0 ? 'pointer' : 'auto' }}\n title={[...(currentAccount ?? []), ...(additionalAccounts ?? [])].map((address, index) => (\n <p key={index}>{address}</p>\n ))}\n >\n <Typography>{totalAccounts}</Typography>\n </Tooltip>\n </TableCell>\n ),\n actions: (\n <TableCell key={4}>\n <FlexRow gap={2} justifyContent=\"start\">\n {connected ? (\n <Typography sx={{ display: 'inline-flex', gap: 0.5 }}>\n <Check />\n Connected\n </Typography>\n ) : (\n <Button variant={'contained'}>Connect</Button>\n )}\n {connected ? (\n <Button variant={'outlined'} color={'error'}>\n Revoke\n </Button>\n ) : null}\n </FlexRow>\n </TableCell>\n ),\n }\n return TableCells\n }, [additionalAccounts, chainName, connected, currentAccount, icon, name, theme, totalAccounts])\n\n return <TableRow {...props}>{Object.values(Cells).map((cell) => cell)}</TableRow>\n}\n\nexport interface WalletConnectionsTableRow extends TableRowProps {\n wallet: EthWalletConnectorBase\n}\nexport const WalletConnectionsTableRow: React.FC<WalletConnectionsTableRow> = ({ wallet, ...props }) => {\n const { currentAccount, additionalAccounts, chainName, providerInfo, providerName } = useEthWallet(wallet)\n const currentAccountString = currentAccount?.toString()\n return (\n <WalletConnectionsTableRowInner\n additionalAccounts={additionalAccounts}\n currentAccount={currentAccountString ? [currentAccountString] : []}\n chainName={chainName}\n icon={providerInfo?.icon}\n name={providerName}\n {...props}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,mBAAqC;AACrC,IAAAC,wBAAsC;;;ACDtC,0BAAkG;AAClG,mBAA6C;AAE7C,IAAM,cAAc,CAAC,YACnB,OAAO,OA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,YAAQ,2BAAS;AAEvB,QAAM,EAAE,wBAAwB,cAAc,IAAI,mBAAmB;AAErE,SACE,8CAAC,iCAAQ,YAAW,WAAU,gBAAe,SAAQ,KAAK,GAAI,GAAG,OAC/D;AAAA,kDAAC,iCAAQ,YAAW,SAClB;AAAA,mDAAC,+BAAW,SAAS,MAAM,IAAI,EAAE,IAAI,IAAI,GAAG,mCAE5C;AAAA,MACC,yBACC,8CAAC,+BAAW,SAAS,aAAa,OAAO,MAAM,QAAQ,UAAU,MAAM,IAAI,EAAE,SAAS,IAAI,GAAG;AAAA;AAAA,QAChE;AAAA,SAC7B,IACE;AAAA,OACN;AAAA,IACA,6CAAC,yBAAsB,SAAS,eAAe;AAAA,KACjD;AAEJ;","names":["import_material","import_react_flexbox","refresh","import_material","import_react_crypto","import_react","import_jsx_runtime","import_jsx_runtime"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
|
@@ -0,0 +1,168 @@
|
|
1
|
+
// src/components/ConnectedAccountsFlexbox.tsx
|
2
|
+
import { Typography as Typography2, useTheme as useTheme2 } from "@mui/material";
|
3
|
+
import { FlexCol } from "@xylabs/react-flexbox";
|
4
|
+
|
5
|
+
// src/hooks/useDetectWallets.tsx
|
6
|
+
import { AccountsChangedEventName, useWalletDiscovery } from "@xylabs/react-crypto";
|
7
|
+
import { useEffect, useMemo, useState } from "react";
|
8
|
+
var sortWallets = (wallets) => Object.values(wallets).reduce((acc, wallet) => {
|
9
|
+
wallet.allowedAccounts.length > 0 ? acc.unshift(wallet) : acc.push(wallet);
|
10
|
+
return acc;
|
11
|
+
}, []);
|
12
|
+
var useDetectedWallets = () => {
|
13
|
+
const wallets = useWalletDiscovery();
|
14
|
+
const [refresh, setRefresh] = useState(0);
|
15
|
+
const [sortedWallets, setSortedWallets] = useState([]);
|
16
|
+
useEffect(() => {
|
17
|
+
setSortedWallets(sortWallets(wallets));
|
18
|
+
}, [wallets, refresh]);
|
19
|
+
useEffect(() => {
|
20
|
+
const listener = () => {
|
21
|
+
setRefresh((refresh2) => refresh2 + 1);
|
22
|
+
};
|
23
|
+
window.addEventListener(AccountsChangedEventName, listener);
|
24
|
+
return () => {
|
25
|
+
window.removeEventListener(AccountsChangedEventName, listener);
|
26
|
+
};
|
27
|
+
}, [wallets]);
|
28
|
+
const totalConnectedAccounts = useMemo(
|
29
|
+
() => Object.values(sortedWallets).reduce((acc, wallet) => acc + wallet.allowedAccounts.length, 0),
|
30
|
+
[sortedWallets]
|
31
|
+
);
|
32
|
+
return { sortedWallets, totalConnectedAccounts };
|
33
|
+
};
|
34
|
+
|
35
|
+
// src/components/wallet/table/ConnectedWalletsTable.tsx
|
36
|
+
import { Table, TableBody, TableCell as TableCell2, TableHead, TableRow as TableRow2 } from "@mui/material";
|
37
|
+
|
38
|
+
// src/components/wallet/lib/TableHeadData.ts
|
39
|
+
var WalletsTableHeadCells = [
|
40
|
+
{
|
41
|
+
disablePadding: false,
|
42
|
+
id: "wallet",
|
43
|
+
label: "Wallet",
|
44
|
+
numeric: false,
|
45
|
+
showOnMobile: true
|
46
|
+
},
|
47
|
+
{
|
48
|
+
disablePadding: false,
|
49
|
+
id: "chain",
|
50
|
+
label: "Chain",
|
51
|
+
numeric: false,
|
52
|
+
showOnMobile: true
|
53
|
+
},
|
54
|
+
{
|
55
|
+
disablePadding: false,
|
56
|
+
id: "accounts",
|
57
|
+
label: "Accounts",
|
58
|
+
numeric: true,
|
59
|
+
showOnMobile: true
|
60
|
+
},
|
61
|
+
{
|
62
|
+
disablePadding: false,
|
63
|
+
id: "actions",
|
64
|
+
label: "Actions",
|
65
|
+
numeric: false,
|
66
|
+
showOnMobile: true
|
67
|
+
}
|
68
|
+
];
|
69
|
+
|
70
|
+
// src/components/wallet/table/ConnectedWalletsTableRow.tsx
|
71
|
+
import { Check } from "@mui/icons-material";
|
72
|
+
import { Button, TableCell, TableRow, Tooltip, Typography, useTheme } from "@mui/material";
|
73
|
+
import { ConstrainedImage, useEthWallet } from "@xylabs/react-crypto";
|
74
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
75
|
+
import { useMemo as useMemo2 } from "react";
|
76
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
77
|
+
var WalletConnectionsTableRowInner = ({
|
78
|
+
additionalAccounts,
|
79
|
+
currentAccount,
|
80
|
+
chainName,
|
81
|
+
icon,
|
82
|
+
name,
|
83
|
+
...props
|
84
|
+
}) => {
|
85
|
+
const theme = useTheme();
|
86
|
+
const totalAccounts = ((additionalAccounts == null ? void 0 : additionalAccounts.length) ?? 0) + ((currentAccount == null ? void 0 : currentAccount.length) ?? 0);
|
87
|
+
const connected = (currentAccount == null ? void 0 : currentAccount.length) ?? 0 > 0;
|
88
|
+
const Cells = useMemo2(() => {
|
89
|
+
const TableCells = {
|
90
|
+
wallet: /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs(FlexRow, { gap: 2, justifyContent: "start", children: [
|
91
|
+
/* @__PURE__ */ jsx(ConstrainedImage, { constrainedValue: theme.spacing(4), src: icon }),
|
92
|
+
name
|
93
|
+
] }) }, 1),
|
94
|
+
// eslint-disable-next-line sort-keys-fix/sort-keys-fix
|
95
|
+
chain: /* @__PURE__ */ jsx(TableCell, { children: chainName }, 2),
|
96
|
+
// eslint-disable-next-line sort-keys-fix/sort-keys-fix
|
97
|
+
accounts: /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(
|
98
|
+
Tooltip,
|
99
|
+
{
|
100
|
+
sx: { cursor: totalAccounts > 0 ? "pointer" : "auto" },
|
101
|
+
title: [...currentAccount ?? [], ...additionalAccounts ?? []].map((address, index) => /* @__PURE__ */ jsx("p", { children: address }, index)),
|
102
|
+
children: /* @__PURE__ */ jsx(Typography, { children: totalAccounts })
|
103
|
+
}
|
104
|
+
) }, 3),
|
105
|
+
actions: /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs(FlexRow, { gap: 2, justifyContent: "start", children: [
|
106
|
+
connected ? /* @__PURE__ */ jsxs(Typography, { sx: { display: "inline-flex", gap: 0.5 }, children: [
|
107
|
+
/* @__PURE__ */ jsx(Check, {}),
|
108
|
+
"Connected"
|
109
|
+
] }) : /* @__PURE__ */ jsx(Button, { variant: "contained", children: "Connect" }),
|
110
|
+
connected ? /* @__PURE__ */ jsx(Button, { variant: "outlined", color: "error", children: "Revoke" }) : null
|
111
|
+
] }) }, 4)
|
112
|
+
};
|
113
|
+
return TableCells;
|
114
|
+
}, [additionalAccounts, chainName, connected, currentAccount, icon, name, theme, totalAccounts]);
|
115
|
+
return /* @__PURE__ */ jsx(TableRow, { ...props, children: Object.values(Cells).map((cell) => cell) });
|
116
|
+
};
|
117
|
+
var WalletConnectionsTableRow = ({ wallet, ...props }) => {
|
118
|
+
const { currentAccount, additionalAccounts, chainName, providerInfo, providerName } = useEthWallet(wallet);
|
119
|
+
const currentAccountString = currentAccount == null ? void 0 : currentAccount.toString();
|
120
|
+
return /* @__PURE__ */ jsx(
|
121
|
+
WalletConnectionsTableRowInner,
|
122
|
+
{
|
123
|
+
additionalAccounts,
|
124
|
+
currentAccount: currentAccountString ? [currentAccountString] : [],
|
125
|
+
chainName,
|
126
|
+
icon: providerInfo == null ? void 0 : providerInfo.icon,
|
127
|
+
name: providerName,
|
128
|
+
...props
|
129
|
+
}
|
130
|
+
);
|
131
|
+
};
|
132
|
+
|
133
|
+
// src/components/wallet/table/ConnectedWalletsTable.tsx
|
134
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
135
|
+
var ConnectedWalletsTable = ({ wallets, ...props }) => {
|
136
|
+
return /* @__PURE__ */ jsxs2(Table, { ...props, children: [
|
137
|
+
/* @__PURE__ */ jsx2(TableHead, { children: /* @__PURE__ */ jsx2(TableRow2, { children: WalletsTableHeadCells.map(({ disablePadding, id, label, align, width }) => /* @__PURE__ */ jsx2(TableCell2, { align, padding: disablePadding ? "none" : "normal", width: width ?? "auto", children: label }, id)) }) }),
|
138
|
+
/* @__PURE__ */ jsx2(TableBody, { children: (wallets ?? []).map((wallet) => {
|
139
|
+
var _a;
|
140
|
+
return /* @__PURE__ */ jsx2(WalletConnectionsTableRow, { wallet }, (_a = wallet.providerInfo) == null ? void 0 : _a.rdns);
|
141
|
+
}) })
|
142
|
+
] });
|
143
|
+
};
|
144
|
+
|
145
|
+
// src/components/ConnectedAccountsFlexbox.tsx
|
146
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
147
|
+
var ConnectedAccountsFlexbox = (props) => {
|
148
|
+
const theme = useTheme2();
|
149
|
+
const { totalConnectedAccounts, sortedWallets } = useDetectedWallets();
|
150
|
+
return /* @__PURE__ */ jsxs3(FlexCol, { alignItems: "stretch", justifyContent: "start", gap: 2, ...props, children: [
|
151
|
+
/* @__PURE__ */ jsxs3(FlexCol, { alignItems: "start", children: [
|
152
|
+
/* @__PURE__ */ jsx3(Typography2, { variant: "h2", sx: { mb: 0.5 }, children: "Detected Web3 Wallets" }),
|
153
|
+
totalConnectedAccounts ? /* @__PURE__ */ jsxs3(Typography2, { variant: "subtitle1", color: theme.palette.secondary.main, sx: { opacity: 0.5 }, children: [
|
154
|
+
"Total Connected Accounts: ",
|
155
|
+
totalConnectedAccounts
|
156
|
+
] }) : null
|
157
|
+
] }),
|
158
|
+
/* @__PURE__ */ jsx3(ConnectedWalletsTable, { wallets: sortedWallets })
|
159
|
+
] });
|
160
|
+
};
|
161
|
+
export {
|
162
|
+
ConnectedAccountsFlexbox,
|
163
|
+
ConnectedWalletsTable,
|
164
|
+
WalletConnectionsTableRow,
|
165
|
+
WalletConnectionsTableRowInner,
|
166
|
+
useDetectedWallets
|
167
|
+
};
|
168
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/components/ConnectedAccountsFlexbox.tsx","../../src/hooks/useDetectWallets.tsx","../../src/components/wallet/table/ConnectedWalletsTable.tsx","../../src/components/wallet/lib/TableHeadData.ts","../../src/components/wallet/table/ConnectedWalletsTableRow.tsx"],"sourcesContent":["import { Typography, useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\n\nimport { useDetectedWallets } from '../hooks'\nimport { ConnectedWalletsTable } from './wallet'\n\nexport const ConnectedAccountsFlexbox: React.FC<FlexBoxProps> = (props) => {\n const theme = useTheme()\n\n const { totalConnectedAccounts, sortedWallets } = useDetectedWallets()\n\n return (\n <FlexCol alignItems=\"stretch\" justifyContent=\"start\" gap={2} {...props}>\n <FlexCol alignItems=\"start\">\n <Typography variant={'h2'} sx={{ mb: 0.5 }}>\n Detected Web3 Wallets\n </Typography>\n {totalConnectedAccounts ? (\n <Typography variant={'subtitle1'} color={theme.palette.secondary.main} sx={{ opacity: 0.5 }}>\n Total Connected Accounts: {totalConnectedAccounts}\n </Typography>\n ) : null}\n </FlexCol>\n <ConnectedWalletsTable wallets={sortedWallets} />\n </FlexCol>\n )\n}\n","import { AccountsChangedEventName, DiscoveredWallets, EIP6963Connector, useWalletDiscovery } from '@xylabs/react-crypto'\nimport { useEffect, useMemo, useState } from 'react'\n\nconst sortWallets = (wallets: DiscoveredWallets) =>\n Object.values(wallets).reduce((acc, wallet) => {\n wallet.allowedAccounts.length > 0 ? acc.unshift(wallet) : acc.push(wallet)\n return acc\n }, [] as EIP6963Connector[])\n\nexport const useDetectedWallets = () => {\n const wallets = useWalletDiscovery()\n const [refresh, setRefresh] = useState(0)\n const [sortedWallets, setSortedWallets] = useState<EIP6963Connector[]>([])\n\n useEffect(() => {\n setSortedWallets(sortWallets(wallets))\n }, [wallets, refresh])\n\n /**\n * Rely on custom events from the wallet base class to know when accounts are changed.\n * This approach prevents the need to loop through all wallets and set up individual listeners.\n */\n useEffect(() => {\n const listener: (event: CustomEventInit) => void = () => {\n setRefresh((refresh) => refresh + 1)\n }\n window.addEventListener(AccountsChangedEventName, listener)\n\n return () => {\n window.removeEventListener(AccountsChangedEventName, listener)\n }\n }, [wallets])\n\n const totalConnectedAccounts = useMemo(\n () => Object.values(sortedWallets).reduce((acc, wallet) => acc + wallet.allowedAccounts.length, 0),\n [sortedWallets],\n )\n\n return { sortedWallets, totalConnectedAccounts }\n}\n","import { Table, TableBody, TableCell, TableHead, TableProps, TableRow } from '@mui/material'\nimport { EIP6963Connector } from '@xylabs/react-crypto'\n\nimport { WalletsTableHeadCells } from '../lib'\nimport { WalletConnectionsTableRow } from './ConnectedWalletsTableRow'\n\nexport interface ConnectedWalletsTableProps extends TableProps {\n wallets?: EIP6963Connector[]\n}\n\nexport const ConnectedWalletsTable: React.FC<ConnectedWalletsTableProps> = ({ wallets, ...props }) => {\n return (\n <Table {...props}>\n <TableHead>\n <TableRow>\n {WalletsTableHeadCells.map(({ disablePadding, id, label, align, width }) => (\n <TableCell align={align} key={id} padding={disablePadding ? 'none' : 'normal'} width={width ?? 'auto'}>\n {label}\n </TableCell>\n ))}\n </TableRow>\n </TableHead>\n <TableBody>\n {(wallets ?? []).map((wallet) => (\n <WalletConnectionsTableRow wallet={wallet} key={wallet.providerInfo?.rdns} />\n ))}\n </TableBody>\n </Table>\n )\n}\n","import { TableHeadCell } from '@xyo-network/react-table'\n\nexport const WalletsTableHeadCells: TableHeadCell[] = [\n {\n disablePadding: false,\n id: 'wallet',\n label: 'Wallet',\n numeric: false,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'chain',\n label: 'Chain',\n numeric: false,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'accounts',\n label: 'Accounts',\n numeric: true,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'actions',\n label: 'Actions',\n numeric: false,\n showOnMobile: true,\n },\n]\n","import { Check } from '@mui/icons-material'\nimport { Button, TableCell, TableRow, TableRowProps, Tooltip, Typography, useTheme } from '@mui/material'\nimport { ConstrainedImage, EthWalletConnectorBase, useEthWallet } from '@xylabs/react-crypto'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { ReactNode, useMemo } from 'react'\n\nexport interface WalletConnectionsTableRowInnerProps extends TableRowProps {\n additionalAccounts?: string[]\n chainName?: string\n currentAccount?: string[]\n icon?: string\n name?: string\n}\n\nexport const WalletConnectionsTableRowInner: React.FC<WalletConnectionsTableRowInnerProps> = ({\n additionalAccounts,\n currentAccount,\n chainName,\n icon,\n name,\n ...props\n}) => {\n const theme = useTheme()\n\n const totalAccounts = (additionalAccounts?.length ?? 0) + (currentAccount?.length ?? 0)\n const connected = currentAccount?.length ?? 0 > 0\n\n const Cells = useMemo(() => {\n const TableCells: Record<string, ReactNode> = {\n wallet: (\n <TableCell key={1}>\n <FlexRow gap={2} justifyContent=\"start\">\n <ConstrainedImage constrainedValue={theme.spacing(4)} src={icon} />\n {name}\n </FlexRow>\n </TableCell>\n ),\n // eslint-disable-next-line sort-keys-fix/sort-keys-fix\n chain: <TableCell key={2}>{chainName}</TableCell>,\n // eslint-disable-next-line sort-keys-fix/sort-keys-fix\n accounts: (\n <TableCell key={3}>\n <Tooltip\n sx={{ cursor: totalAccounts > 0 ? 'pointer' : 'auto' }}\n title={[...(currentAccount ?? []), ...(additionalAccounts ?? [])].map((address, index) => (\n <p key={index}>{address}</p>\n ))}\n >\n <Typography>{totalAccounts}</Typography>\n </Tooltip>\n </TableCell>\n ),\n actions: (\n <TableCell key={4}>\n <FlexRow gap={2} justifyContent=\"start\">\n {connected ? (\n <Typography sx={{ display: 'inline-flex', gap: 0.5 }}>\n <Check />\n Connected\n </Typography>\n ) : (\n <Button variant={'contained'}>Connect</Button>\n )}\n {connected ? (\n <Button variant={'outlined'} color={'error'}>\n Revoke\n </Button>\n ) : null}\n </FlexRow>\n </TableCell>\n ),\n }\n return TableCells\n }, [additionalAccounts, chainName, connected, currentAccount, icon, name, theme, totalAccounts])\n\n return <TableRow {...props}>{Object.values(Cells).map((cell) => cell)}</TableRow>\n}\n\nexport interface WalletConnectionsTableRow extends TableRowProps {\n wallet: EthWalletConnectorBase\n}\nexport const WalletConnectionsTableRow: React.FC<WalletConnectionsTableRow> = ({ wallet, ...props }) => {\n const { currentAccount, additionalAccounts, chainName, providerInfo, providerName } = useEthWallet(wallet)\n const currentAccountString = currentAccount?.toString()\n return (\n <WalletConnectionsTableRowInner\n additionalAccounts={additionalAccounts}\n currentAccount={currentAccountString ? [currentAccountString] : []}\n chainName={chainName}\n icon={providerInfo?.icon}\n name={providerName}\n {...props}\n />\n )\n}\n"],"mappings":";AAAA,SAAS,cAAAA,aAAY,YAAAC,iBAAgB;AACrC,SAAuB,eAAe;;;ACDtC,SAAS,0BAA+D,0BAA0B;AAClG,SAAS,WAAW,SAAS,gBAAgB;AAE7C,IAAM,cAAc,CAAC,YACnB,OAAO,OAAO,OAAO,EAAE,OAAO,CAAC,KAAK,WAAW;AAC7C,SAAO,gBAAgB,SAAS,IAAI,IAAI,QAAQ,MAAM,IAAI,IAAI,KAAK,MAAM;AACzE,SAAO;AACT,GAAG,CAAC,CAAuB;AAEtB,IAAM,qBAAqB,MAAM;AACtC,QAAM,UAAU,mBAAmB;AACnC,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,CAAC;AACxC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAA6B,CAAC,CAAC;AAEzE,YAAU,MAAM;AACd,qBAAiB,YAAY,OAAO,CAAC;AAAA,EACvC,GAAG,CAAC,SAAS,OAAO,CAAC;AAMrB,YAAU,MAAM;AACd,UAAM,WAA6C,MAAM;A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