@xyo-network/react-connected-accounts 4.1.6 → 4.1.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,16 @@
|
|
1
1
|
import type { DiscoveredWallets, EIP6963Connector } from '@xylabs/react-crypto';
|
2
|
+
/**
|
3
|
+
* State for storing wallets and their enabled/disabled status by name
|
4
|
+
*/
|
2
5
|
export interface EnabledEthWalletsState {
|
3
6
|
[rdns: string]: {
|
4
7
|
enabled: boolean;
|
5
8
|
wallet: EIP6963Connector;
|
6
9
|
};
|
7
10
|
}
|
11
|
+
/**
|
12
|
+
* State for storing only enabled/disabled status of a wallet by name
|
13
|
+
*/
|
8
14
|
export interface EnabledWalletsSavedState {
|
9
15
|
[rdns: string]: boolean;
|
10
16
|
}
|
@@ -19,6 +25,9 @@ export declare class EnabledEthWalletConnections {
|
|
19
25
|
get wallets(): EnabledEthWalletsState;
|
20
26
|
disableWallet(rdns: string): void;
|
21
27
|
enableWallet(rdns: string): void;
|
28
|
+
/**
|
29
|
+
* Given a new set of wallets, set their enabled state based off previous preferences
|
30
|
+
*/
|
22
31
|
resetWallets(wallets: DiscoveredWallets): void;
|
23
32
|
subscribe(listener: WalletListener): () => void;
|
24
33
|
toggleEnabledWallet(rdns: string, enabled: boolean): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EnabledWallets.d.ts","sourceRoot":"","sources":["../../../src/classes/EnabledWallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;
|
1
|
+
{"version":3,"file":"EnabledWallets.d.ts","sourceRoot":"","sources":["../../../src/classes/EnabledWallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAI/E;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,CAAC,IAAI,EAAE,MAAM,GAAG;QACd,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,gBAAgB,CAAA;KACzB,CAAA;CACF;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CACxB;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,IAAI,CAAA;AAEvC,qBAAa,2BAA2B;IAEtC,kBAAkB,UAAO;IAGzB,OAAO,CAAC,cAAc,CAA+B;IAGrD,OAAO,CAAC,eAAe,CAA6B;IAGpD,OAAO,CAAC,SAAS,CAAuB;IAGxC,OAAO,CAAC,eAAe,CAA4B;gBAEvC,eAAe,SAA4B;IAKvD,IAAI,OAAO,2BAEV;IAED,aAAa,CAAC,IAAI,EAAE,MAAM;IAI1B,YAAY,CAAC,IAAI,EAAE,MAAM;IAIzB;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,iBAAiB;IAiBvC,SAAS,CAAC,QAAQ,EAAE,cAAc;IAOlC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAQlD,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,cAAc;CAWvB"}
|
@@ -1,5 +1,11 @@
|
|
1
1
|
import type { EnabledEthWalletsState, EnabledWalletsSavedState } from '../classes/index.ts';
|
2
|
+
/**
|
3
|
+
* Takes the discovered wallets and tracks their enabled state globally
|
4
|
+
*/
|
2
5
|
export declare const useEnabledWalletsInner: (enabledWalletsRdns?: EnabledWalletsSavedState) => EnabledEthWalletsState;
|
6
|
+
/**
|
7
|
+
* Expose an interface for enabling and disabling wallets
|
8
|
+
*/
|
3
9
|
export declare const useEnabledWallets: (enabledWalletsRdns?: EnabledWalletsSavedState) => {
|
4
10
|
disableWallet: ((rdns: string) => void) | undefined;
|
5
11
|
enableWallet: ((rdns: string) => void) | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useEnabledWallets.d.ts","sourceRoot":"","sources":["../../../src/hooks/useEnabledWallets.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;
|
1
|
+
{"version":3,"file":"useEnabledWallets.d.ts","sourceRoot":"","sources":["../../../src/hooks/useEnabledWallets.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAK3F;;GAEG;AACH,eAAO,MAAM,sBAAsB,wBAAyB,wBAAwB,2BAYnF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,wBAAyB,wBAAwB;;;;;CAkB9E,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@xyo-network/react-connected-accounts",
|
3
|
-
"version": "4.1.
|
3
|
+
"version": "4.1.7",
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
5
5
|
"keywords": [
|
6
6
|
"xyo",
|
@@ -45,15 +45,15 @@
|
|
45
45
|
"dependencies": {
|
46
46
|
"@xylabs/react-crypto": "^5.2.2",
|
47
47
|
"@xylabs/react-flexbox": "^5.2.2",
|
48
|
-
"@xyo-network/react-table": "^4.1.
|
48
|
+
"@xyo-network/react-table": "^4.1.7"
|
49
49
|
},
|
50
50
|
"devDependencies": {
|
51
|
-
"@mui/icons-material": "^6.1.
|
52
|
-
"@mui/material": "^6.1.
|
53
|
-
"@mui/styles": "^6.1.
|
51
|
+
"@mui/icons-material": "^6.1.5",
|
52
|
+
"@mui/material": "^6.1.5",
|
53
|
+
"@mui/styles": "^6.1.5",
|
54
54
|
"@storybook/react": "^8.3.6",
|
55
|
-
"@xylabs/ts-scripts-yarn3": "^4.2.
|
56
|
-
"@xylabs/tsconfig-react": "^4.2.
|
55
|
+
"@xylabs/ts-scripts-yarn3": "^4.2.3",
|
56
|
+
"@xylabs/tsconfig-react": "^4.2.3",
|
57
57
|
"react": "^18.3.1",
|
58
58
|
"react-dom": "^18.3.1",
|
59
59
|
"storybook": "^8.3.6",
|