@xyo-network/react-connected-accounts 2.66.3 → 2.66.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/browser/classes/EnabledWallets.d.cts +39 -0
- package/dist/browser/classes/EnabledWallets.d.cts.map +1 -0
- package/dist/browser/classes/EnabledWallets.d.mts +39 -0
- package/dist/browser/classes/EnabledWallets.d.mts.map +1 -0
- package/dist/browser/classes/EnabledWallets.d.ts +39 -0
- package/dist/browser/classes/EnabledWallets.d.ts.map +1 -0
- package/dist/browser/classes/index.d.cts +2 -0
- package/dist/browser/classes/index.d.cts.map +1 -0
- package/dist/browser/classes/index.d.mts +2 -0
- package/dist/browser/classes/index.d.mts.map +1 -0
- package/dist/browser/classes/index.d.ts +2 -0
- package/dist/browser/classes/index.d.ts.map +1 -0
- package/dist/browser/components/ConnectedAccountsFlexbox.d.cts +5 -1
- package/dist/browser/components/ConnectedAccountsFlexbox.d.cts.map +1 -1
- package/dist/browser/components/ConnectedAccountsFlexbox.d.mts +5 -1
- package/dist/browser/components/ConnectedAccountsFlexbox.d.mts.map +1 -1
- package/dist/browser/components/ConnectedAccountsFlexbox.d.ts +5 -1
- package/dist/browser/components/ConnectedAccountsFlexbox.d.ts.map +1 -1
- package/dist/browser/components/wallet/dialogs/connect/CheckboxFormControl.d.cts +7 -0
- package/dist/browser/components/wallet/dialogs/connect/CheckboxFormControl.d.cts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/CheckboxFormControl.d.mts +7 -0
- package/dist/browser/components/wallet/dialogs/connect/CheckboxFormControl.d.mts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/CheckboxFormControl.d.ts +7 -0
- package/dist/browser/components/wallet/dialogs/connect/CheckboxFormControl.d.ts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/Dialog.d.cts +9 -0
- package/dist/browser/components/wallet/dialogs/connect/Dialog.d.cts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/Dialog.d.mts +9 -0
- package/dist/browser/components/wallet/dialogs/connect/Dialog.d.mts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/Dialog.d.ts +9 -0
- package/dist/browser/components/wallet/dialogs/connect/Dialog.d.ts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/LinkedProvidersFlexbox.d.cts +8 -0
- package/dist/browser/components/wallet/dialogs/connect/LinkedProvidersFlexbox.d.cts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/LinkedProvidersFlexbox.d.mts +8 -0
- package/dist/browser/components/wallet/dialogs/connect/LinkedProvidersFlexbox.d.mts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/LinkedProvidersFlexbox.d.ts +8 -0
- package/dist/browser/components/wallet/dialogs/connect/LinkedProvidersFlexbox.d.ts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/Permissions.d.cts +6 -0
- package/dist/browser/components/wallet/dialogs/connect/Permissions.d.cts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/Permissions.d.mts +6 -0
- package/dist/browser/components/wallet/dialogs/connect/Permissions.d.mts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/Permissions.d.ts +6 -0
- package/dist/browser/components/wallet/dialogs/connect/Permissions.d.ts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/index.d.cts +3 -0
- package/dist/browser/components/wallet/dialogs/connect/index.d.cts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/index.d.mts +3 -0
- package/dist/browser/components/wallet/dialogs/connect/index.d.mts.map +1 -0
- package/dist/browser/components/wallet/dialogs/connect/index.d.ts +3 -0
- package/dist/browser/components/wallet/dialogs/connect/index.d.ts.map +1 -0
- package/dist/browser/components/wallet/dialogs/index.d.cts +3 -0
- package/dist/browser/components/wallet/dialogs/index.d.cts.map +1 -0
- package/dist/browser/components/wallet/dialogs/index.d.mts +3 -0
- package/dist/browser/components/wallet/dialogs/index.d.mts.map +1 -0
- package/dist/browser/components/wallet/dialogs/index.d.ts +3 -0
- package/dist/browser/components/wallet/dialogs/index.d.ts.map +1 -0
- package/dist/browser/components/wallet/dialogs/revoke/Dialog.d.cts +8 -0
- package/dist/browser/components/wallet/dialogs/revoke/Dialog.d.cts.map +1 -0
- package/dist/browser/components/wallet/dialogs/revoke/Dialog.d.mts +8 -0
- package/dist/browser/components/wallet/dialogs/revoke/Dialog.d.mts.map +1 -0
- package/dist/browser/components/wallet/dialogs/revoke/Dialog.d.ts +8 -0
- package/dist/browser/components/wallet/dialogs/revoke/Dialog.d.ts.map +1 -0
- package/dist/browser/components/wallet/dialogs/revoke/index.d.cts +2 -0
- package/dist/browser/components/wallet/dialogs/revoke/index.d.cts.map +1 -0
- package/dist/browser/components/wallet/dialogs/revoke/index.d.mts +2 -0
- package/dist/browser/components/wallet/dialogs/revoke/index.d.mts.map +1 -0
- package/dist/browser/components/wallet/dialogs/revoke/index.d.ts +2 -0
- package/dist/browser/components/wallet/dialogs/revoke/index.d.ts.map +1 -0
- package/dist/browser/components/wallet/index.d.cts +1 -0
- package/dist/browser/components/wallet/index.d.cts.map +1 -1
- package/dist/browser/components/wallet/index.d.mts +1 -0
- package/dist/browser/components/wallet/index.d.mts.map +1 -1
- package/dist/browser/components/wallet/index.d.ts +1 -0
- package/dist/browser/components/wallet/index.d.ts.map +1 -1
- package/dist/browser/components/wallet/lib/ActiveProvider.d.cts +7 -0
- package/dist/browser/components/wallet/lib/ActiveProvider.d.cts.map +1 -0
- package/dist/browser/components/wallet/lib/ActiveProvider.d.mts +7 -0
- package/dist/browser/components/wallet/lib/ActiveProvider.d.mts.map +1 -0
- package/dist/browser/components/wallet/lib/ActiveProvider.d.ts +7 -0
- package/dist/browser/components/wallet/lib/ActiveProvider.d.ts.map +1 -0
- package/dist/browser/components/wallet/lib/TableHeadData.d.cts.map +1 -1
- package/dist/browser/components/wallet/lib/TableHeadData.d.mts.map +1 -1
- package/dist/browser/components/wallet/lib/TableHeadData.d.ts.map +1 -1
- package/dist/browser/components/wallet/lib/index.d.cts +1 -0
- package/dist/browser/components/wallet/lib/index.d.cts.map +1 -1
- package/dist/browser/components/wallet/lib/index.d.mts +1 -0
- package/dist/browser/components/wallet/lib/index.d.mts.map +1 -1
- package/dist/browser/components/wallet/lib/index.d.ts +1 -0
- package/dist/browser/components/wallet/lib/index.d.ts.map +1 -1
- package/dist/browser/components/wallet/table/ConnectedWalletsTable.d.cts +2 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTable.d.cts.map +1 -1
- package/dist/browser/components/wallet/table/ConnectedWalletsTable.d.mts +2 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTable.d.mts.map +1 -1
- package/dist/browser/components/wallet/table/ConnectedWalletsTable.d.ts +2 -0
- package/dist/browser/components/wallet/table/ConnectedWalletsTable.d.ts.map +1 -1
- package/dist/browser/components/wallet/table/ConnectedWalletsTableRow.d.cts +6 -10
- package/dist/browser/components/wallet/table/ConnectedWalletsTableRow.d.cts.map +1 -1
- package/dist/browser/components/wallet/table/ConnectedWalletsTableRow.d.mts +6 -10
- package/dist/browser/components/wallet/table/ConnectedWalletsTableRow.d.mts.map +1 -1
- package/dist/browser/components/wallet/table/ConnectedWalletsTableRow.d.ts +6 -10
- package/dist/browser/components/wallet/table/ConnectedWalletsTableRow.d.ts.map +1 -1
- package/dist/browser/components/wallet/table/cells/Accounts.d.cts +4 -0
- package/dist/browser/components/wallet/table/cells/Accounts.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/cells/Accounts.d.mts +4 -0
- package/dist/browser/components/wallet/table/cells/Accounts.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/cells/Accounts.d.ts +4 -0
- package/dist/browser/components/wallet/table/cells/Accounts.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/cells/Actions.d.cts +4 -0
- package/dist/browser/components/wallet/table/cells/Actions.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/cells/Actions.d.mts +4 -0
- package/dist/browser/components/wallet/table/cells/Actions.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/cells/Actions.d.ts +4 -0
- package/dist/browser/components/wallet/table/cells/Actions.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/cells/Cells.d.cts +4 -0
- package/dist/browser/components/wallet/table/cells/Cells.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/cells/Cells.d.mts +4 -0
- package/dist/browser/components/wallet/table/cells/Cells.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/cells/Cells.d.ts +4 -0
- package/dist/browser/components/wallet/table/cells/Cells.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/cells/ChainName.d.cts +4 -0
- package/dist/browser/components/wallet/table/cells/ChainName.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/cells/ChainName.d.mts +4 -0
- package/dist/browser/components/wallet/table/cells/ChainName.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/cells/ChainName.d.ts +4 -0
- package/dist/browser/components/wallet/table/cells/ChainName.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/cells/State.d.cts +4 -0
- package/dist/browser/components/wallet/table/cells/State.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/cells/State.d.mts +4 -0
- package/dist/browser/components/wallet/table/cells/State.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/cells/State.d.ts +4 -0
- package/dist/browser/components/wallet/table/cells/State.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/cells/Wallet.d.cts +4 -0
- package/dist/browser/components/wallet/table/cells/Wallet.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/cells/Wallet.d.mts +4 -0
- package/dist/browser/components/wallet/table/cells/Wallet.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/cells/Wallet.d.ts +4 -0
- package/dist/browser/components/wallet/table/cells/Wallet.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/cells/index.d.cts +7 -0
- package/dist/browser/components/wallet/table/cells/index.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/cells/index.d.mts +7 -0
- package/dist/browser/components/wallet/table/cells/index.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/cells/index.d.ts +7 -0
- package/dist/browser/components/wallet/table/cells/index.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.d.cts +15 -0
- package/dist/browser/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.d.mts +15 -0
- package/dist/browser/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.d.ts +15 -0
- package/dist/browser/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/cells/lib/index.d.cts +2 -0
- package/dist/browser/components/wallet/table/cells/lib/index.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/cells/lib/index.d.mts +2 -0
- package/dist/browser/components/wallet/table/cells/lib/index.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/cells/lib/index.d.ts +2 -0
- package/dist/browser/components/wallet/table/cells/lib/index.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/hooks/index.d.cts +2 -0
- package/dist/browser/components/wallet/table/hooks/index.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/hooks/index.d.mts +2 -0
- package/dist/browser/components/wallet/table/hooks/index.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/hooks/index.d.ts +2 -0
- package/dist/browser/components/wallet/table/hooks/index.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/hooks/useActiveProviderDialogState.d.cts +4 -0
- package/dist/browser/components/wallet/table/hooks/useActiveProviderDialogState.d.cts.map +1 -0
- package/dist/browser/components/wallet/table/hooks/useActiveProviderDialogState.d.mts +4 -0
- package/dist/browser/components/wallet/table/hooks/useActiveProviderDialogState.d.mts.map +1 -0
- package/dist/browser/components/wallet/table/hooks/useActiveProviderDialogState.d.ts +4 -0
- package/dist/browser/components/wallet/table/hooks/useActiveProviderDialogState.d.ts.map +1 -0
- package/dist/browser/components/wallet/table/index.d.cts +2 -0
- package/dist/browser/components/wallet/table/index.d.cts.map +1 -1
- package/dist/browser/components/wallet/table/index.d.mts +2 -0
- package/dist/browser/components/wallet/table/index.d.mts.map +1 -1
- package/dist/browser/components/wallet/table/index.d.ts +2 -0
- package/dist/browser/components/wallet/table/index.d.ts.map +1 -1
- package/dist/browser/hooks/index.d.cts +1 -0
- package/dist/browser/hooks/index.d.cts.map +1 -1
- package/dist/browser/hooks/index.d.mts +1 -0
- package/dist/browser/hooks/index.d.mts.map +1 -1
- package/dist/browser/hooks/index.d.ts +1 -0
- package/dist/browser/hooks/index.d.ts.map +1 -1
- package/dist/browser/hooks/useEnabledWallets.d.cts +15 -0
- package/dist/browser/hooks/useEnabledWallets.d.cts.map +1 -0
- package/dist/browser/hooks/useEnabledWallets.d.mts +15 -0
- package/dist/browser/hooks/useEnabledWallets.d.mts.map +1 -0
- package/dist/browser/hooks/useEnabledWallets.d.ts +15 -0
- package/dist/browser/hooks/useEnabledWallets.d.ts.map +1 -0
- package/dist/browser/img/index.d.cts +4 -0
- package/dist/browser/img/index.d.cts.map +1 -0
- package/dist/browser/img/index.d.mts +4 -0
- package/dist/browser/img/index.d.mts.map +1 -0
- package/dist/browser/img/index.d.ts +4 -0
- package/dist/browser/img/index.d.ts.map +1 -0
- package/dist/browser/index.cjs +462 -79
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +1 -0
- package/dist/browser/index.d.cts.map +1 -1
- package/dist/browser/index.d.mts +1 -0
- package/dist/browser/index.d.mts.map +1 -1
- package/dist/browser/index.d.ts +1 -0
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +452 -79
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/xyo-color-logo-LHR2SMEM.svg +1 -0
- package/dist/browser/xyo-color-logo-text-only-QPAW5BSQ.svg +1 -0
- package/dist/node/classes/EnabledWallets.d.cts +39 -0
- package/dist/node/classes/EnabledWallets.d.cts.map +1 -0
- package/dist/node/classes/EnabledWallets.d.mts +39 -0
- package/dist/node/classes/EnabledWallets.d.mts.map +1 -0
- package/dist/node/classes/EnabledWallets.d.ts +39 -0
- package/dist/node/classes/EnabledWallets.d.ts.map +1 -0
- package/dist/node/classes/index.d.cts +2 -0
- package/dist/node/classes/index.d.cts.map +1 -0
- package/dist/node/classes/index.d.mts +2 -0
- package/dist/node/classes/index.d.mts.map +1 -0
- package/dist/node/classes/index.d.ts +2 -0
- package/dist/node/classes/index.d.ts.map +1 -0
- package/dist/node/components/ConnectedAccountsFlexbox.d.cts +5 -1
- package/dist/node/components/ConnectedAccountsFlexbox.d.cts.map +1 -1
- package/dist/node/components/ConnectedAccountsFlexbox.d.mts +5 -1
- package/dist/node/components/ConnectedAccountsFlexbox.d.mts.map +1 -1
- package/dist/node/components/ConnectedAccountsFlexbox.d.ts +5 -1
- package/dist/node/components/ConnectedAccountsFlexbox.d.ts.map +1 -1
- package/dist/node/components/wallet/dialogs/connect/CheckboxFormControl.d.cts +7 -0
- package/dist/node/components/wallet/dialogs/connect/CheckboxFormControl.d.cts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/CheckboxFormControl.d.mts +7 -0
- package/dist/node/components/wallet/dialogs/connect/CheckboxFormControl.d.mts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/CheckboxFormControl.d.ts +7 -0
- package/dist/node/components/wallet/dialogs/connect/CheckboxFormControl.d.ts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/Dialog.d.cts +9 -0
- package/dist/node/components/wallet/dialogs/connect/Dialog.d.cts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/Dialog.d.mts +9 -0
- package/dist/node/components/wallet/dialogs/connect/Dialog.d.mts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/Dialog.d.ts +9 -0
- package/dist/node/components/wallet/dialogs/connect/Dialog.d.ts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/LinkedProvidersFlexbox.d.cts +8 -0
- package/dist/node/components/wallet/dialogs/connect/LinkedProvidersFlexbox.d.cts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/LinkedProvidersFlexbox.d.mts +8 -0
- package/dist/node/components/wallet/dialogs/connect/LinkedProvidersFlexbox.d.mts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/LinkedProvidersFlexbox.d.ts +8 -0
- package/dist/node/components/wallet/dialogs/connect/LinkedProvidersFlexbox.d.ts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/Permissions.d.cts +6 -0
- package/dist/node/components/wallet/dialogs/connect/Permissions.d.cts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/Permissions.d.mts +6 -0
- package/dist/node/components/wallet/dialogs/connect/Permissions.d.mts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/Permissions.d.ts +6 -0
- package/dist/node/components/wallet/dialogs/connect/Permissions.d.ts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/index.d.cts +3 -0
- package/dist/node/components/wallet/dialogs/connect/index.d.cts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/index.d.mts +3 -0
- package/dist/node/components/wallet/dialogs/connect/index.d.mts.map +1 -0
- package/dist/node/components/wallet/dialogs/connect/index.d.ts +3 -0
- package/dist/node/components/wallet/dialogs/connect/index.d.ts.map +1 -0
- package/dist/node/components/wallet/dialogs/index.d.cts +3 -0
- package/dist/node/components/wallet/dialogs/index.d.cts.map +1 -0
- package/dist/node/components/wallet/dialogs/index.d.mts +3 -0
- package/dist/node/components/wallet/dialogs/index.d.mts.map +1 -0
- package/dist/node/components/wallet/dialogs/index.d.ts +3 -0
- package/dist/node/components/wallet/dialogs/index.d.ts.map +1 -0
- package/dist/node/components/wallet/dialogs/revoke/Dialog.d.cts +8 -0
- package/dist/node/components/wallet/dialogs/revoke/Dialog.d.cts.map +1 -0
- package/dist/node/components/wallet/dialogs/revoke/Dialog.d.mts +8 -0
- package/dist/node/components/wallet/dialogs/revoke/Dialog.d.mts.map +1 -0
- package/dist/node/components/wallet/dialogs/revoke/Dialog.d.ts +8 -0
- package/dist/node/components/wallet/dialogs/revoke/Dialog.d.ts.map +1 -0
- package/dist/node/components/wallet/dialogs/revoke/index.d.cts +2 -0
- package/dist/node/components/wallet/dialogs/revoke/index.d.cts.map +1 -0
- package/dist/node/components/wallet/dialogs/revoke/index.d.mts +2 -0
- package/dist/node/components/wallet/dialogs/revoke/index.d.mts.map +1 -0
- package/dist/node/components/wallet/dialogs/revoke/index.d.ts +2 -0
- package/dist/node/components/wallet/dialogs/revoke/index.d.ts.map +1 -0
- package/dist/node/components/wallet/index.d.cts +1 -0
- package/dist/node/components/wallet/index.d.cts.map +1 -1
- package/dist/node/components/wallet/index.d.mts +1 -0
- package/dist/node/components/wallet/index.d.mts.map +1 -1
- package/dist/node/components/wallet/index.d.ts +1 -0
- package/dist/node/components/wallet/index.d.ts.map +1 -1
- package/dist/node/components/wallet/lib/ActiveProvider.d.cts +7 -0
- package/dist/node/components/wallet/lib/ActiveProvider.d.cts.map +1 -0
- package/dist/node/components/wallet/lib/ActiveProvider.d.mts +7 -0
- package/dist/node/components/wallet/lib/ActiveProvider.d.mts.map +1 -0
- package/dist/node/components/wallet/lib/ActiveProvider.d.ts +7 -0
- package/dist/node/components/wallet/lib/ActiveProvider.d.ts.map +1 -0
- package/dist/node/components/wallet/lib/TableHeadData.d.cts.map +1 -1
- package/dist/node/components/wallet/lib/TableHeadData.d.mts.map +1 -1
- package/dist/node/components/wallet/lib/TableHeadData.d.ts.map +1 -1
- package/dist/node/components/wallet/lib/index.d.cts +1 -0
- package/dist/node/components/wallet/lib/index.d.cts.map +1 -1
- package/dist/node/components/wallet/lib/index.d.mts +1 -0
- package/dist/node/components/wallet/lib/index.d.mts.map +1 -1
- package/dist/node/components/wallet/lib/index.d.ts +1 -0
- package/dist/node/components/wallet/lib/index.d.ts.map +1 -1
- package/dist/node/components/wallet/table/ConnectedWalletsTable.d.cts +2 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTable.d.cts.map +1 -1
- package/dist/node/components/wallet/table/ConnectedWalletsTable.d.mts +2 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTable.d.mts.map +1 -1
- package/dist/node/components/wallet/table/ConnectedWalletsTable.d.ts +2 -0
- package/dist/node/components/wallet/table/ConnectedWalletsTable.d.ts.map +1 -1
- package/dist/node/components/wallet/table/ConnectedWalletsTableRow.d.cts +6 -10
- package/dist/node/components/wallet/table/ConnectedWalletsTableRow.d.cts.map +1 -1
- package/dist/node/components/wallet/table/ConnectedWalletsTableRow.d.mts +6 -10
- package/dist/node/components/wallet/table/ConnectedWalletsTableRow.d.mts.map +1 -1
- package/dist/node/components/wallet/table/ConnectedWalletsTableRow.d.ts +6 -10
- package/dist/node/components/wallet/table/ConnectedWalletsTableRow.d.ts.map +1 -1
- package/dist/node/components/wallet/table/cells/Accounts.d.cts +4 -0
- package/dist/node/components/wallet/table/cells/Accounts.d.cts.map +1 -0
- package/dist/node/components/wallet/table/cells/Accounts.d.mts +4 -0
- package/dist/node/components/wallet/table/cells/Accounts.d.mts.map +1 -0
- package/dist/node/components/wallet/table/cells/Accounts.d.ts +4 -0
- package/dist/node/components/wallet/table/cells/Accounts.d.ts.map +1 -0
- package/dist/node/components/wallet/table/cells/Actions.d.cts +4 -0
- package/dist/node/components/wallet/table/cells/Actions.d.cts.map +1 -0
- package/dist/node/components/wallet/table/cells/Actions.d.mts +4 -0
- package/dist/node/components/wallet/table/cells/Actions.d.mts.map +1 -0
- package/dist/node/components/wallet/table/cells/Actions.d.ts +4 -0
- package/dist/node/components/wallet/table/cells/Actions.d.ts.map +1 -0
- package/dist/node/components/wallet/table/cells/Cells.d.cts +4 -0
- package/dist/node/components/wallet/table/cells/Cells.d.cts.map +1 -0
- package/dist/node/components/wallet/table/cells/Cells.d.mts +4 -0
- package/dist/node/components/wallet/table/cells/Cells.d.mts.map +1 -0
- package/dist/node/components/wallet/table/cells/Cells.d.ts +4 -0
- package/dist/node/components/wallet/table/cells/Cells.d.ts.map +1 -0
- package/dist/node/components/wallet/table/cells/ChainName.d.cts +4 -0
- package/dist/node/components/wallet/table/cells/ChainName.d.cts.map +1 -0
- package/dist/node/components/wallet/table/cells/ChainName.d.mts +4 -0
- package/dist/node/components/wallet/table/cells/ChainName.d.mts.map +1 -0
- package/dist/node/components/wallet/table/cells/ChainName.d.ts +4 -0
- package/dist/node/components/wallet/table/cells/ChainName.d.ts.map +1 -0
- package/dist/node/components/wallet/table/cells/State.d.cts +4 -0
- package/dist/node/components/wallet/table/cells/State.d.cts.map +1 -0
- package/dist/node/components/wallet/table/cells/State.d.mts +4 -0
- package/dist/node/components/wallet/table/cells/State.d.mts.map +1 -0
- package/dist/node/components/wallet/table/cells/State.d.ts +4 -0
- package/dist/node/components/wallet/table/cells/State.d.ts.map +1 -0
- package/dist/node/components/wallet/table/cells/Wallet.d.cts +4 -0
- package/dist/node/components/wallet/table/cells/Wallet.d.cts.map +1 -0
- package/dist/node/components/wallet/table/cells/Wallet.d.mts +4 -0
- package/dist/node/components/wallet/table/cells/Wallet.d.mts.map +1 -0
- package/dist/node/components/wallet/table/cells/Wallet.d.ts +4 -0
- package/dist/node/components/wallet/table/cells/Wallet.d.ts.map +1 -0
- package/dist/node/components/wallet/table/cells/index.d.cts +7 -0
- package/dist/node/components/wallet/table/cells/index.d.cts.map +1 -0
- package/dist/node/components/wallet/table/cells/index.d.mts +7 -0
- package/dist/node/components/wallet/table/cells/index.d.mts.map +1 -0
- package/dist/node/components/wallet/table/cells/index.d.ts +7 -0
- package/dist/node/components/wallet/table/cells/index.d.ts.map +1 -0
- package/dist/node/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.d.cts +15 -0
- package/dist/node/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.d.cts.map +1 -0
- package/dist/node/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.d.mts +15 -0
- package/dist/node/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.d.mts.map +1 -0
- package/dist/node/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.d.ts +15 -0
- package/dist/node/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.d.ts.map +1 -0
- package/dist/node/components/wallet/table/cells/lib/index.d.cts +2 -0
- package/dist/node/components/wallet/table/cells/lib/index.d.cts.map +1 -0
- package/dist/node/components/wallet/table/cells/lib/index.d.mts +2 -0
- package/dist/node/components/wallet/table/cells/lib/index.d.mts.map +1 -0
- package/dist/node/components/wallet/table/cells/lib/index.d.ts +2 -0
- package/dist/node/components/wallet/table/cells/lib/index.d.ts.map +1 -0
- package/dist/node/components/wallet/table/hooks/index.d.cts +2 -0
- package/dist/node/components/wallet/table/hooks/index.d.cts.map +1 -0
- package/dist/node/components/wallet/table/hooks/index.d.mts +2 -0
- package/dist/node/components/wallet/table/hooks/index.d.mts.map +1 -0
- package/dist/node/components/wallet/table/hooks/index.d.ts +2 -0
- package/dist/node/components/wallet/table/hooks/index.d.ts.map +1 -0
- package/dist/node/components/wallet/table/hooks/useActiveProviderDialogState.d.cts +4 -0
- package/dist/node/components/wallet/table/hooks/useActiveProviderDialogState.d.cts.map +1 -0
- package/dist/node/components/wallet/table/hooks/useActiveProviderDialogState.d.mts +4 -0
- package/dist/node/components/wallet/table/hooks/useActiveProviderDialogState.d.mts.map +1 -0
- package/dist/node/components/wallet/table/hooks/useActiveProviderDialogState.d.ts +4 -0
- package/dist/node/components/wallet/table/hooks/useActiveProviderDialogState.d.ts.map +1 -0
- package/dist/node/components/wallet/table/index.d.cts +2 -0
- package/dist/node/components/wallet/table/index.d.cts.map +1 -1
- package/dist/node/components/wallet/table/index.d.mts +2 -0
- package/dist/node/components/wallet/table/index.d.mts.map +1 -1
- package/dist/node/components/wallet/table/index.d.ts +2 -0
- package/dist/node/components/wallet/table/index.d.ts.map +1 -1
- package/dist/node/hooks/index.d.cts +1 -0
- package/dist/node/hooks/index.d.cts.map +1 -1
- package/dist/node/hooks/index.d.mts +1 -0
- package/dist/node/hooks/index.d.mts.map +1 -1
- package/dist/node/hooks/index.d.ts +1 -0
- package/dist/node/hooks/index.d.ts.map +1 -1
- package/dist/node/hooks/useEnabledWallets.d.cts +15 -0
- package/dist/node/hooks/useEnabledWallets.d.cts.map +1 -0
- package/dist/node/hooks/useEnabledWallets.d.mts +15 -0
- package/dist/node/hooks/useEnabledWallets.d.mts.map +1 -0
- package/dist/node/hooks/useEnabledWallets.d.ts +15 -0
- package/dist/node/hooks/useEnabledWallets.d.ts.map +1 -0
- package/dist/node/img/index.d.cts +4 -0
- package/dist/node/img/index.d.cts.map +1 -0
- package/dist/node/img/index.d.mts +4 -0
- package/dist/node/img/index.d.mts.map +1 -0
- package/dist/node/img/index.d.ts +4 -0
- package/dist/node/img/index.d.ts.map +1 -0
- package/dist/node/index.cjs +487 -84
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +1 -0
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.mts +1 -0
- package/dist/node/index.d.mts.map +1 -1
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +463 -82
- package/dist/node/index.js.map +1 -1
- package/dist/node/xyo-color-logo-LHR2SMEM.svg +1 -0
- package/dist/node/xyo-color-logo-text-only-QPAW5BSQ.svg +1 -0
- package/package.json +4 -4
- package/src/classes/EnabledWallets.ts +128 -0
- package/src/classes/index.ts +1 -0
- package/src/components/ConnectedAccountsFlexbox.stories.tsx +11 -1
- package/src/components/ConnectedAccountsFlexbox.tsx +28 -17
- package/src/components/wallet/dialogs/connect/CheckboxFormControl.tsx +16 -0
- package/src/components/wallet/dialogs/connect/Dialog.tsx +43 -0
- package/src/components/wallet/dialogs/connect/LinkedProvidersFlexbox.tsx +27 -0
- package/src/components/wallet/dialogs/connect/Permissions.tsx +30 -0
- package/src/components/wallet/dialogs/connect/index.ts +2 -0
- package/src/components/wallet/dialogs/index.ts +2 -0
- package/src/components/wallet/dialogs/revoke/Dialog.tsx +32 -0
- package/src/components/wallet/dialogs/revoke/index.ts +1 -0
- package/src/components/wallet/index.ts +1 -0
- package/src/components/wallet/lib/ActiveProvider.ts +7 -0
- package/src/components/wallet/lib/TableHeadData.ts +7 -0
- package/src/components/wallet/lib/index.ts +1 -0
- package/src/components/wallet/table/ConnectedWalletsTable.tsx +41 -17
- package/src/components/wallet/table/ConnectedWalletsTableRow.tsx +56 -82
- package/src/components/wallet/table/cells/Accounts.tsx +23 -0
- package/src/components/wallet/table/cells/Actions.tsx +29 -0
- package/src/components/wallet/table/cells/Cells.tsx +16 -0
- package/src/components/wallet/table/cells/ChainName.tsx +7 -0
- package/src/components/wallet/table/cells/State.tsx +23 -0
- package/src/components/wallet/table/cells/Wallet.tsx +18 -0
- package/src/components/wallet/table/cells/index.ts +6 -0
- package/src/components/wallet/table/cells/lib/ConnectedWalletTableCellProps.tsx +17 -0
- package/src/components/wallet/table/cells/lib/index.ts +1 -0
- package/src/components/wallet/table/hooks/index.ts +1 -0
- package/src/components/wallet/table/hooks/useActiveProviderDialogState.tsx +20 -0
- package/src/components/wallet/table/index.ts +2 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useEnabledWallets.tsx +45 -0
- package/src/img/index.ts +4 -0
- package/src/img/xyo-color-logo-text-only.svg +1 -0
- package/src/img/xyo-color-logo.svg +1 -0
- package/src/index.ts +1 -0
- package/src/types/images.d.ts +5 -0
@@ -1,30 +1,54 @@
|
|
1
1
|
import { Table, TableBody, TableCell, TableHead, TableProps, TableRow } from '@mui/material'
|
2
2
|
import { EIP6963Connector } from '@xylabs/react-crypto'
|
3
|
+
import { useState } from 'react'
|
3
4
|
|
4
|
-
import {
|
5
|
+
import { ConnectWalletDialog, RevokeWalletConnectionDialog } from '../dialogs'
|
6
|
+
import { ActiveProvider, WalletsTableHeadCells } from '../lib'
|
5
7
|
import { WalletConnectionsTableRow } from './ConnectedWalletsTableRow'
|
8
|
+
import { useActiveProviderDialogState } from './hooks'
|
6
9
|
|
7
10
|
export interface ConnectedWalletsTableProps extends TableProps {
|
11
|
+
ignoreConnectDialog?: boolean
|
12
|
+
onIgnoreConnectDialog?: (checked: boolean) => void
|
8
13
|
wallets?: EIP6963Connector[]
|
9
14
|
}
|
10
15
|
|
11
|
-
export const ConnectedWalletsTable: React.FC<ConnectedWalletsTableProps> = ({ wallets, ...props }) => {
|
16
|
+
export const ConnectedWalletsTable: React.FC<ConnectedWalletsTableProps> = ({ ignoreConnectDialog, onIgnoreConnectDialog, wallets, ...props }) => {
|
17
|
+
const [activeProvider, setActiveProvider] = useState<ActiveProvider>()
|
18
|
+
const [showConnect, onSetActiveProviderConnect, onConnectClose] = useActiveProviderDialogState(setActiveProvider)
|
19
|
+
const [showRevoke, onSetActiveProviderRevoke, onRevokeClose] = useActiveProviderDialogState(setActiveProvider)
|
20
|
+
|
12
21
|
return (
|
13
|
-
|
14
|
-
<
|
15
|
-
<
|
16
|
-
|
17
|
-
|
18
|
-
{
|
19
|
-
|
22
|
+
<>
|
23
|
+
<Table {...props}>
|
24
|
+
<TableHead>
|
25
|
+
<TableRow>
|
26
|
+
{WalletsTableHeadCells.map(({ disablePadding, id, label, align, width }) => (
|
27
|
+
<TableCell align={align} key={id} padding={disablePadding ? 'none' : 'normal'} width={width ?? 'auto'}>
|
28
|
+
{label}
|
29
|
+
</TableCell>
|
30
|
+
))}
|
31
|
+
</TableRow>
|
32
|
+
</TableHead>
|
33
|
+
<TableBody>
|
34
|
+
{(wallets ?? []).map((wallet) => (
|
35
|
+
<WalletConnectionsTableRow
|
36
|
+
ignoreConnectDialog={ignoreConnectDialog}
|
37
|
+
key={wallet.providerInfo?.rdns}
|
38
|
+
onConnectClick={onSetActiveProviderConnect}
|
39
|
+
onRevoke={onSetActiveProviderRevoke}
|
40
|
+
wallet={wallet}
|
41
|
+
/>
|
20
42
|
))}
|
21
|
-
</
|
22
|
-
</
|
23
|
-
<
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
43
|
+
</TableBody>
|
44
|
+
</Table>
|
45
|
+
<RevokeWalletConnectionDialog open={showRevoke} onClose={onRevokeClose} activeProvider={activeProvider} />
|
46
|
+
<ConnectWalletDialog
|
47
|
+
activeProvider={activeProvider}
|
48
|
+
onClose={onConnectClose}
|
49
|
+
open={showConnect}
|
50
|
+
onIgnoreConnectDialog={onIgnoreConnectDialog}
|
51
|
+
/>
|
52
|
+
</>
|
29
53
|
)
|
30
54
|
}
|
@@ -1,95 +1,69 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import { FlexRow } from '@xylabs/react-flexbox'
|
5
|
-
import { ReactNode, useMemo } from 'react'
|
1
|
+
import { TableRow, TableRowProps } from '@mui/material'
|
2
|
+
import { EthWalletConnectorBase, useEthWallet } from '@xylabs/react-crypto'
|
3
|
+
import { useCallback, useMemo } from 'react'
|
6
4
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
import { ActiveProvider } from '../lib'
|
6
|
+
import { ConnectedWalletTableCells } from './cells'
|
7
|
+
|
8
|
+
export interface WalletConnectionsTableRowProps extends TableRowProps {
|
9
|
+
ignoreConnectDialog?: boolean
|
10
|
+
onConnectClick?: (activeProvider: ActiveProvider) => void
|
11
|
+
onRevoke?: (activeProvider: ActiveProvider) => void
|
12
|
+
wallet: EthWalletConnectorBase
|
13
13
|
}
|
14
14
|
|
15
|
-
export const
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
name,
|
15
|
+
export const WalletConnectionsTableRow: React.FC<WalletConnectionsTableRowProps> = ({
|
16
|
+
ignoreConnectDialog,
|
17
|
+
onConnectClick,
|
18
|
+
onRevoke,
|
19
|
+
wallet,
|
21
20
|
...props
|
22
21
|
}) => {
|
23
|
-
const
|
22
|
+
const { currentAccount: currentAccountFromWallet, additionalAccounts, chainName, connectWallet, providerInfo } = useEthWallet(wallet)
|
24
23
|
|
24
|
+
const currentAccount = currentAccountFromWallet?.toString() ? [currentAccountFromWallet.toString()] : []
|
25
25
|
const totalAccounts = (additionalAccounts?.length ?? 0) + (currentAccount?.length ?? 0)
|
26
|
-
const connected = currentAccount?.length ?? 0 > 0
|
26
|
+
const connected = !!(currentAccount?.length ?? 0 > 0)
|
27
|
+
const { icon, name, rdns } = useMemo(() => providerInfo ?? { icon: undefined, name: undefined, rdns: undefined }, [providerInfo])
|
27
28
|
|
28
|
-
const
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
</TableCell>
|
37
|
-
),
|
38
|
-
// eslint-disable-next-line sort-keys-fix/sort-keys-fix
|
39
|
-
chain: <TableCell key={2}>{chainName}</TableCell>,
|
40
|
-
// eslint-disable-next-line sort-keys-fix/sort-keys-fix
|
41
|
-
accounts: (
|
42
|
-
<TableCell key={3}>
|
43
|
-
<Tooltip
|
44
|
-
sx={{ cursor: totalAccounts > 0 ? 'pointer' : 'auto' }}
|
45
|
-
title={[...(currentAccount ?? []), ...(additionalAccounts ?? [])].map((address, index) => (
|
46
|
-
<p key={index}>{address}</p>
|
47
|
-
))}
|
48
|
-
>
|
49
|
-
<Typography>{totalAccounts}</Typography>
|
50
|
-
</Tooltip>
|
51
|
-
</TableCell>
|
52
|
-
),
|
53
|
-
actions: (
|
54
|
-
<TableCell key={4}>
|
55
|
-
<FlexRow gap={2} justifyContent="start">
|
56
|
-
{connected ? (
|
57
|
-
<Typography sx={{ display: 'inline-flex', gap: 0.5 }}>
|
58
|
-
<Check />
|
59
|
-
Connected
|
60
|
-
</Typography>
|
61
|
-
) : (
|
62
|
-
<Button variant={'contained'}>Connect</Button>
|
63
|
-
)}
|
64
|
-
{connected ? (
|
65
|
-
<Button variant={'outlined'} color={'error'}>
|
66
|
-
Revoke
|
67
|
-
</Button>
|
68
|
-
) : null}
|
69
|
-
</FlexRow>
|
70
|
-
</TableCell>
|
71
|
-
),
|
72
|
-
}
|
73
|
-
return TableCells
|
74
|
-
}, [additionalAccounts, chainName, connected, currentAccount, icon, name, theme, totalAccounts])
|
29
|
+
const activeProvider = useMemo<ActiveProvider>(
|
30
|
+
() => ({
|
31
|
+
connectWallet,
|
32
|
+
icon,
|
33
|
+
providerName: name,
|
34
|
+
}),
|
35
|
+
[connectWallet, icon, name],
|
36
|
+
)
|
75
37
|
|
76
|
-
|
77
|
-
|
38
|
+
const onRevokeLocal = useCallback(() => {
|
39
|
+
onRevoke?.(activeProvider)
|
40
|
+
}, [activeProvider, onRevoke])
|
41
|
+
|
42
|
+
const onConnectLocal = useCallback(async () => {
|
43
|
+
if (ignoreConnectDialog) {
|
44
|
+
await connectWallet?.()
|
45
|
+
} else {
|
46
|
+
onConnectClick?.(activeProvider)
|
47
|
+
}
|
48
|
+
}, [activeProvider, connectWallet, ignoreConnectDialog, onConnectClick])
|
78
49
|
|
79
|
-
export interface WalletConnectionsTableRow extends TableRowProps {
|
80
|
-
wallet: EthWalletConnectorBase
|
81
|
-
}
|
82
|
-
export const WalletConnectionsTableRow: React.FC<WalletConnectionsTableRow> = ({ wallet, ...props }) => {
|
83
|
-
const { currentAccount, additionalAccounts, chainName, providerInfo, providerName } = useEthWallet(wallet)
|
84
|
-
const currentAccountString = currentAccount?.toString()
|
85
50
|
return (
|
86
|
-
<
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
51
|
+
<TableRow {...props}>
|
52
|
+
{Object.values(ConnectedWalletTableCells).map((Cell, index) => (
|
53
|
+
<Cell
|
54
|
+
key={index}
|
55
|
+
additionalAccounts={additionalAccounts}
|
56
|
+
chainName={chainName}
|
57
|
+
connected={connected}
|
58
|
+
currentAccount={currentAccount}
|
59
|
+
icon={icon}
|
60
|
+
onConnect={onConnectLocal}
|
61
|
+
onRevoke={onRevokeLocal}
|
62
|
+
totalAccounts={totalAccounts}
|
63
|
+
walletName={name}
|
64
|
+
walletRdns={rdns}
|
65
|
+
/>
|
66
|
+
))}
|
67
|
+
</TableRow>
|
94
68
|
)
|
95
69
|
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { TableCell, Tooltip, Typography } from '@mui/material'
|
2
|
+
|
3
|
+
import { ConnectedWalletTableCellProps } from './lib'
|
4
|
+
|
5
|
+
export const ConnectedWalletsAccountsTableCell: React.FC<ConnectedWalletTableCellProps> = ({
|
6
|
+
additionalAccounts,
|
7
|
+
currentAccount,
|
8
|
+
totalAccounts,
|
9
|
+
tableCellProps,
|
10
|
+
}) => {
|
11
|
+
return (
|
12
|
+
<TableCell {...tableCellProps}>
|
13
|
+
<Tooltip
|
14
|
+
sx={{ cursor: totalAccounts > 0 ? 'pointer' : 'auto' }}
|
15
|
+
title={[...(currentAccount ?? []), ...(additionalAccounts ?? [])].map((address, index) => (
|
16
|
+
<p key={index}>{address}</p>
|
17
|
+
))}
|
18
|
+
>
|
19
|
+
<Typography>{totalAccounts}</Typography>
|
20
|
+
</Tooltip>
|
21
|
+
</TableCell>
|
22
|
+
)
|
23
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { Check, InfoOutlined } from '@mui/icons-material'
|
2
|
+
import { Button, IconButton, TableCell, Typography } from '@mui/material'
|
3
|
+
import { FlexRow } from '@xylabs/react-flexbox'
|
4
|
+
|
5
|
+
import { ConnectedWalletTableCellProps } from './lib'
|
6
|
+
|
7
|
+
export const ConnectedWalletsActionsTableCell: React.FC<ConnectedWalletTableCellProps> = ({ connected, onConnect, onRevoke, tableCellProps }) => {
|
8
|
+
return (
|
9
|
+
<TableCell {...tableCellProps}>
|
10
|
+
<FlexRow gap={2} justifyContent="start">
|
11
|
+
{connected ? (
|
12
|
+
<Typography sx={{ display: 'inline-flex', gap: 0.5 }}>
|
13
|
+
<Check />
|
14
|
+
Connected
|
15
|
+
</Typography>
|
16
|
+
) : (
|
17
|
+
<Button variant={'contained'} onClick={onConnect}>
|
18
|
+
Connect
|
19
|
+
</Button>
|
20
|
+
)}
|
21
|
+
{connected ? (
|
22
|
+
<IconButton onClick={onRevoke}>
|
23
|
+
<InfoOutlined />
|
24
|
+
</IconButton>
|
25
|
+
) : null}
|
26
|
+
</FlexRow>
|
27
|
+
</TableCell>
|
28
|
+
)
|
29
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { ComponentType } from 'react'
|
2
|
+
|
3
|
+
import { ConnectedWalletsAccountsTableCell } from './Accounts'
|
4
|
+
import { ConnectedWalletsActionsTableCell } from './Actions'
|
5
|
+
import { ConnectedWalletsChainNameTableCell } from './ChainName'
|
6
|
+
import { ConnectedWalletTableCellProps } from './lib'
|
7
|
+
import { ConnectedWalletState } from './State'
|
8
|
+
import { ConnectedWalletsWalletTableCell } from './Wallet'
|
9
|
+
|
10
|
+
export const ConnectedWalletTableCells: ComponentType<ConnectedWalletTableCellProps>[] = [
|
11
|
+
ConnectedWalletsWalletTableCell,
|
12
|
+
ConnectedWalletsChainNameTableCell,
|
13
|
+
ConnectedWalletsAccountsTableCell,
|
14
|
+
ConnectedWalletsActionsTableCell,
|
15
|
+
ConnectedWalletState,
|
16
|
+
]
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { TableCell } from '@mui/material'
|
2
|
+
|
3
|
+
import { ConnectedWalletTableCellProps } from './lib'
|
4
|
+
|
5
|
+
export const ConnectedWalletsChainNameTableCell: React.FC<ConnectedWalletTableCellProps> = ({ chainName, tableCellProps }) => {
|
6
|
+
return <TableCell {...tableCellProps}>{chainName}</TableCell>
|
7
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { Switch, TableCell } from '@mui/material'
|
2
|
+
import { ChangeEvent, useMemo } from 'react'
|
3
|
+
|
4
|
+
import { useEnabledWallets } from '../../../../hooks'
|
5
|
+
import { ConnectedWalletTableCellProps } from './lib'
|
6
|
+
|
7
|
+
export const ConnectedWalletState: React.FC<ConnectedWalletTableCellProps> = ({ connected, walletRdns, tableCellProps }) => {
|
8
|
+
const { disableWallet, enableWallet, wallets } = useEnabledWallets()
|
9
|
+
|
10
|
+
const enabled = useMemo(() => (walletRdns ? wallets[walletRdns].enabled : false), [wallets, walletRdns])
|
11
|
+
|
12
|
+
const handleClick = (event: ChangeEvent<HTMLInputElement>) => {
|
13
|
+
const checked = event.target?.checked
|
14
|
+
if (walletRdns) {
|
15
|
+
checked ? enableWallet?.(walletRdns) : disableWallet?.(walletRdns)
|
16
|
+
}
|
17
|
+
}
|
18
|
+
return (
|
19
|
+
<TableCell {...tableCellProps}>
|
20
|
+
<Switch disabled={!connected} checked={connected && enabled} onChange={handleClick} />
|
21
|
+
</TableCell>
|
22
|
+
)
|
23
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { TableCell, useTheme } from '@mui/material'
|
2
|
+
import { ConstrainedImage } from '@xylabs/react-crypto'
|
3
|
+
import { FlexRow } from '@xylabs/react-flexbox'
|
4
|
+
|
5
|
+
import { ConnectedWalletTableCellProps } from './lib'
|
6
|
+
|
7
|
+
export const ConnectedWalletsWalletTableCell: React.FC<ConnectedWalletTableCellProps> = ({ icon, walletName, tableCellProps }) => {
|
8
|
+
const theme = useTheme()
|
9
|
+
|
10
|
+
return (
|
11
|
+
<TableCell {...tableCellProps}>
|
12
|
+
<FlexRow gap={2} justifyContent="start">
|
13
|
+
<ConstrainedImage constrainedValue={theme.spacing(4)} src={icon} />
|
14
|
+
{walletName}
|
15
|
+
</FlexRow>
|
16
|
+
</TableCell>
|
17
|
+
)
|
18
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { TableCellProps } from '@mui/material'
|
2
|
+
|
3
|
+
export interface ConnectedWalletTableCellProps {
|
4
|
+
additionalAccounts?: string[]
|
5
|
+
chainName?: string
|
6
|
+
connected?: boolean
|
7
|
+
currentAccount?: string[]
|
8
|
+
icon?: string
|
9
|
+
onConnect?: () => Promise<void>
|
10
|
+
onRevoke?: () => void
|
11
|
+
// Using a separate prop instead of extending the interface so we can safely pass all props to
|
12
|
+
// the individual components and let them pick off the ones they want.
|
13
|
+
tableCellProps?: TableCellProps
|
14
|
+
totalAccounts: number
|
15
|
+
walletName?: string
|
16
|
+
walletRdns?: string
|
17
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './ConnectedWalletTableCellProps'
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './useActiveProviderDialogState'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Dispatch, SetStateAction, useState } from 'react'
|
2
|
+
|
3
|
+
import { ActiveProvider } from '../../lib'
|
4
|
+
|
5
|
+
export const useActiveProviderDialogState = (
|
6
|
+
setActiveProvider: Dispatch<SetStateAction<ActiveProvider | undefined>>,
|
7
|
+
): [boolean, (activeProvider: ActiveProvider) => void, () => void] => {
|
8
|
+
const [show, setShow] = useState(false)
|
9
|
+
const onSetActiveProvider = (activeProvider: ActiveProvider) => {
|
10
|
+
setShow(true)
|
11
|
+
setActiveProvider(activeProvider)
|
12
|
+
}
|
13
|
+
|
14
|
+
const onClose = () => {
|
15
|
+
setShow(false)
|
16
|
+
setActiveProvider({})
|
17
|
+
}
|
18
|
+
|
19
|
+
return [show, onSetActiveProvider, onClose]
|
20
|
+
}
|
package/src/hooks/index.ts
CHANGED
@@ -0,0 +1,45 @@
|
|
1
|
+
import { useWalletDiscovery } from '@xylabs/react-crypto'
|
2
|
+
import { useMemo, useSyncExternalStore } from 'react'
|
3
|
+
|
4
|
+
import { EnabledEthWalletConnections, EnabledEthWalletsState, EnabledWalletsSavedState } from '../classes'
|
5
|
+
|
6
|
+
let enabledEthWallets: EnabledEthWalletConnections | undefined
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Takes the discovered wallets and tracks their enabled state globally
|
10
|
+
*/
|
11
|
+
export const useEnabledWalletsInner = (enabledWalletsRdns?: EnabledWalletsSavedState) => {
|
12
|
+
const discoveredWallets = useWalletDiscovery()
|
13
|
+
|
14
|
+
// when we discover new wallets, build their enabled state
|
15
|
+
const wallets = useMemo(() => {
|
16
|
+
if (enabledEthWallets === undefined) enabledEthWallets = new EnabledEthWalletConnections()
|
17
|
+
enabledEthWallets.resetWallets(discoveredWallets)
|
18
|
+
Object.entries(enabledWalletsRdns ?? {}).forEach(([rdns, enabled]) => enabledEthWallets?.toggleEnabledWallet(rdns, enabled))
|
19
|
+
return enabledEthWallets
|
20
|
+
}, [discoveredWallets, enabledWalletsRdns])
|
21
|
+
|
22
|
+
return useSyncExternalStore(wallets.subscribe.bind(wallets), () => wallets.wallets)
|
23
|
+
}
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Expose an interface for enabling and disabling wallets
|
27
|
+
*/
|
28
|
+
export const useEnabledWallets = (enabledWalletsRdns?: EnabledWalletsSavedState) => {
|
29
|
+
const wallets = useEnabledWalletsInner(enabledWalletsRdns)
|
30
|
+
const enabledWallets = useMemo(
|
31
|
+
() =>
|
32
|
+
Object.entries(wallets).reduce((acc, [walletName, wallet]) => {
|
33
|
+
if (wallet.enabled) acc[walletName] = wallet
|
34
|
+
return acc
|
35
|
+
}, {} as EnabledEthWalletsState),
|
36
|
+
[wallets],
|
37
|
+
)
|
38
|
+
|
39
|
+
return {
|
40
|
+
disableWallet: enabledEthWallets?.disableWallet.bind(enabledEthWallets),
|
41
|
+
enableWallet: enabledEthWallets?.enableWallet.bind(enabledEthWallets),
|
42
|
+
enabledWallets,
|
43
|
+
wallets,
|
44
|
+
}
|
45
|
+
}
|
package/src/img/index.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="250 0 451 238"><defs><style>.cls-1{fill:#8d8fc6;}.cls-2{fill:#579fd6;}.cls-3{fill:#f27046;}.cls-4{fill:#eb407a;}</style></defs><path class="cls-1" d="M570,55.35a61.13,61.13,0,1,0,61.11,61.1A61.21,61.21,0,0,0,570,55.35Zm-266.4.1-8.2,8.14,53,52.91-53,52.91,8.2,8.2,52.91-53,44.77,44.77,8.14,8.2,114-114-8.14-8.14-52.91,52.91-53-52.91-8.14,8.14-44.77,44.77ZM570,66.84a49.61,49.61,0,1,1-49.61,49.61A49.54,49.54,0,0,1,570,66.84ZM409.45,71.73l44.77,44.77-44.77,44.77L364.68,116.5Z"/></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 238"><defs><style>.cls-1{fill:#8d8fc6;}.cls-2{fill:#579fd6;}.cls-3{fill:#f27046;}.cls-4{fill:#eb407a;}</style></defs><path class="cls-1" d="M74.5,28.33,21.29,120.5,74.5,212.67H180.94l1.76-3,51.46-89.13L180.94,28.33ZM84.65,40.54h78.83L111.65,56.93a15.85,15.85,0,0,1,2,5l59.66-18.81L185.22,101a20.12,20.12,0,0,1,5.36-.78l-10-47.91,37.87,65.53h-7.62a24.21,24.21,0,0,1,.15,2.68,23.29,23.29,0,0,1-.15,2.68h7.62l-39.1,67.75,10.92-50.13A20.57,20.57,0,0,1,185,140l-12.88,59-58.37-19.53a17.61,17.61,0,0,1-1.7,5l47.5,15.92H84.65l4-6.85A20.17,20.17,0,0,1,83.93,191L80,197.78,42.67,133.13l37,32.66a20.52,20.52,0,0,1,3.6-4L36.69,120.66,85,77.79a17.45,17.45,0,0,1-3.19-4.32l-39.46,35L80,43.22l5.56,9.69A17.51,17.51,0,0,1,90.12,50Zm28.24,31.17a16.15,16.15,0,0,1-2.68,4.64l62,35.81a19.74,19.74,0,0,1,2.83-4.54Zm-20,10.51v75.33a18,18,0,0,1,2.47-.16,17.18,17.18,0,0,1,2.89.21v-75a11.21,11.21,0,0,1-1.29,0,17.57,17.57,0,0,1-4.07-.47Zm79.34,46.63-62.08,35.81a18.45,18.45,0,0,1,2.68,4.68l62.23-36a19.68,19.68,0,0,1-2.83-4.53Z"/><path class="cls-2" d="M97,48.58a17.06,17.06,0,1,0,17,17,17.08,17.08,0,0,0-17-17Zm0,5.36a11.7,11.7,0,1,1-11.7,11.69A11.65,11.65,0,0,1,97,53.94Z"/><path class="cls-3" d="M95.37,157.39a18.73,18.73,0,1,0,18.7,18.7,18.74,18.74,0,0,0-18.7-18.7Zm0,5.31A13.4,13.4,0,1,1,82,176.09a13.37,13.37,0,0,1,13.4-13.39Z"/><path class="cls-4" d="M190.73,100.2A20.3,20.3,0,1,0,211,120.5a20.34,20.34,0,0,0-20.3-20.3Zm0,5.36a14.94,14.94,0,1,1-14.94,14.94,14.88,14.88,0,0,1,14.94-14.94Z"/></svg>
|
package/src/index.ts
CHANGED