@pushchain/ui-kit 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/package.json +3 -3
  3. package/src/lib/components/LoginModal/index.js +19 -18
  4. package/src/lib/components/LoginModal/index.js.map +1 -1
  5. package/src/lib/components/LoginModal/useSmartModalPosition.js +1 -2
  6. package/src/lib/components/LoginModal/useSmartModalPosition.js.map +1 -1
  7. package/src/lib/components/PushUniversalAccountButton/TogglePushWalletButton.js +4 -1
  8. package/src/lib/components/PushUniversalAccountButton/TogglePushWalletButton.js.map +1 -1
  9. package/src/lib/components/PushUniversalAccountButton/index.js +9 -8
  10. package/src/lib/components/PushUniversalAccountButton/index.js.map +1 -1
  11. package/src/lib/components/PushWalletToast/index.js +4 -4
  12. package/src/lib/components/PushWalletToast/index.js.map +1 -1
  13. package/src/lib/components/common/Button.js +1 -4
  14. package/src/lib/components/common/Button.js.map +1 -1
  15. package/src/lib/constants/index.js +5 -0
  16. package/src/lib/constants/index.js.map +1 -1
  17. package/src/lib/context/WalletContext.js +172 -55
  18. package/src/lib/context/WalletContext.js.map +1 -1
  19. package/src/lib/helpers/txnAuthGuard.js +25 -19
  20. package/src/lib/helpers/txnAuthGuard.js.map +1 -1
  21. package/src/lib/hooks/useAppMetadata.js +1 -1
  22. package/src/lib/hooks/useAppMetadata.js.map +1 -1
  23. package/src/lib/hooks/usePushChainClient.js +22 -18
  24. package/src/lib/hooks/usePushChainClient.js.map +1 -1
  25. package/src/lib/providers/PushWalletProvider.js +28 -6
  26. package/src/lib/providers/PushWalletProvider.js.map +1 -1
  27. package/src/lib/providers/theme/ThemeContext.js +0 -1
  28. package/src/lib/providers/walletProviders/WalletProviderRegistry.js +1 -2
  29. package/src/lib/providers/walletProviders/WalletProviderRegistry.js.map +1 -1
  30. package/src/lib/providers/walletProviders/ethereum/chains.js +4 -1
  31. package/src/lib/providers/walletProviders/ethereum/chains.js.map +1 -1
  32. package/src/lib/providers/walletProviders/ethereum/metamask.js +45 -47
  33. package/src/lib/providers/walletProviders/ethereum/metamask.js.map +1 -1
  34. package/src/lib/providers/walletProviders/ethereum/rabby.js +41 -41
  35. package/src/lib/providers/walletProviders/ethereum/rabby.js.map +1 -1
  36. package/src/lib/providers/walletProviders/ethereum/walletConnect.js +62 -65
  37. package/src/lib/providers/walletProviders/ethereum/walletConnect.js.map +1 -1
  38. package/src/lib/providers/walletProviders/ethereum/zerion.js +41 -41
  39. package/src/lib/providers/walletProviders/ethereum/zerion.js.map +1 -1
  40. package/src/lib/providers/walletProviders/solana/phantom.js +56 -60
  41. package/src/lib/providers/walletProviders/solana/phantom.js.map +1 -1
  42. package/src/lib/providers/walletProviders/utils/eip6963.js +2 -4
  43. package/src/lib/providers/walletProviders/utils/eip6963.js.map +1 -1
  44. package/src/lib/styles/token.js +5 -1
  45. package/src/lib/styles/token.js.map +1 -1
  46. package/src/index.d.ts +0 -2
  47. package/src/lib/components/LoginModal/index.d.ts +0 -23
  48. package/src/lib/components/LoginModal/useSmartModalPosition.d.ts +0 -6
  49. package/src/lib/components/PushUniversalAccountButton/ConnectWalletButton.d.ts +0 -11
  50. package/src/lib/components/PushUniversalAccountButton/TogglePushWalletButton.d.ts +0 -11
  51. package/src/lib/components/PushUniversalAccountButton/index.d.ts +0 -17
  52. package/src/lib/components/PushWalletToast/index.d.ts +0 -8
  53. package/src/lib/components/common/Button.d.ts +0 -23
  54. package/src/lib/components/common/Spinner.d.ts +0 -6
  55. package/src/lib/components/common/icons/ArbitrumMonotone.d.ts +0 -2
  56. package/src/lib/components/common/icons/AvalancheMonotone.d.ts +0 -2
  57. package/src/lib/components/common/icons/BaseMonotone.d.ts +0 -2
  58. package/src/lib/components/common/icons/BnbMonotone.d.ts +0 -2
  59. package/src/lib/components/common/icons/CaretDown.d.ts +0 -6
  60. package/src/lib/components/common/icons/CaretUp.d.ts +0 -6
  61. package/src/lib/components/common/icons/CrossIcon.d.ts +0 -6
  62. package/src/lib/components/common/icons/DashIcon.d.ts +0 -2
  63. package/src/lib/components/common/icons/EllipseIcon.d.ts +0 -2
  64. package/src/lib/components/common/icons/EthereumMonotone.d.ts +0 -2
  65. package/src/lib/components/common/icons/OptimismMonotone.d.ts +0 -2
  66. package/src/lib/components/common/icons/PolygonMonotone.d.ts +0 -2
  67. package/src/lib/components/common/icons/PushLogo.d.ts +0 -2
  68. package/src/lib/components/common/icons/PushMonotone.d.ts +0 -2
  69. package/src/lib/components/common/icons/SolanaMonotone.d.ts +0 -2
  70. package/src/lib/components/common/icons/TickIcon.d.ts +0 -2
  71. package/src/lib/components/common/icons/WarningIcon.d.ts +0 -2
  72. package/src/lib/components/common/icons/index.d.ts +0 -14
  73. package/src/lib/components/common/index.d.ts +0 -3
  74. package/src/lib/constants/environment.d.ts +0 -15
  75. package/src/lib/constants/index.d.ts +0 -67
  76. package/src/lib/context/WalletContext.d.ts +0 -40
  77. package/src/lib/context/WalletContextMap.d.ts +0 -2
  78. package/src/lib/helpers/index.d.ts +0 -1
  79. package/src/lib/helpers/txnAuthGuard.d.ts +0 -10
  80. package/src/lib/helpers/wallet.helpers.d.ts +0 -8
  81. package/src/lib/hooks/useAppMetadata.d.ts +0 -1
  82. package/src/lib/hooks/usePushChain.d.ts +0 -4
  83. package/src/lib/hooks/usePushChainClient.d.ts +0 -6
  84. package/src/lib/hooks/usePushWallet.d.ts +0 -2
  85. package/src/lib/index.d.ts +0 -7
  86. package/src/lib/polyfills/index.d.ts +0 -4
  87. package/src/lib/providers/PushWalletProvider.d.ts +0 -3
  88. package/src/lib/providers/theme/ThemeContext.d.ts +0 -0
  89. package/src/lib/providers/walletProviders/BaseWalletProvider.d.ts +0 -19
  90. package/src/lib/providers/walletProviders/WalletProviderRegistry.d.ts +0 -13
  91. package/src/lib/providers/walletProviders/ethereum/chains.d.ts +0 -44
  92. package/src/lib/providers/walletProviders/ethereum/metamask.d.ts +0 -18
  93. package/src/lib/providers/walletProviders/ethereum/rabby.d.ts +0 -17
  94. package/src/lib/providers/walletProviders/ethereum/walletConnect.d.ts +0 -17
  95. package/src/lib/providers/walletProviders/ethereum/zerion.d.ts +0 -17
  96. package/src/lib/providers/walletProviders/helpers/address.d.ts +0 -11
  97. package/src/lib/providers/walletProviders/solana/phantom.d.ts +0 -46
  98. package/src/lib/providers/walletProviders/utils/eip6963.d.ts +0 -12
  99. package/src/lib/styles/token.d.ts +0 -76
  100. package/src/lib/types/PushWalletProvider.types.d.ts +0 -71
  101. package/src/lib/types/index.d.ts +0 -2
  102. package/src/lib/types/wallet.types.d.ts +0 -52
  103. package/src/lib/utils/theme.d.ts +0 -2
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { UniversalAccount } from '../../types';
3
- export type TogglePushWalletButtonProps = {
4
- uid?: string;
5
- universalAccount: UniversalAccount;
6
- style?: React.CSSProperties;
7
- customComponent?: React.ReactNode;
8
- className?: string;
9
- };
10
- declare const TogglePushWalletButton: React.FC<TogglePushWalletButtonProps>;
11
- export { TogglePushWalletButton };
@@ -1,17 +0,0 @@
1
- import React, { FC } from 'react';
2
- import { ButtonThemeOverrides } from '../../styles/token';
3
- import { AppMetadata } from '../../types';
4
- type PushUniversalAccountButtonProps = {
5
- uid?: string;
6
- connectButtonText?: string;
7
- loadingComponent?: React.ReactNode;
8
- modalAppOverride?: AppMetadata;
9
- loginAppOverride?: AppMetadata;
10
- themeOverrides?: ButtonThemeOverrides;
11
- customConnectComponent?: React.ReactNode;
12
- customConnectedComponent?: React.ReactNode;
13
- connectButtonClassName?: string;
14
- connectedButtonClassName?: string;
15
- };
16
- declare const PushUniversalAccountButton: FC<PushUniversalAccountButtonProps>;
17
- export { PushUniversalAccountButton };
@@ -1,8 +0,0 @@
1
- import React, { FC } from 'react';
2
- import { ProgressEvent } from '@pushchain/core/src/lib/progress-hook/progress-hook.types';
3
- type PushWalletToastProps = {
4
- progress: ProgressEvent | null;
5
- setProgress: React.Dispatch<React.SetStateAction<ProgressEvent | null>>;
6
- };
7
- declare const PushWalletToast: FC<PushWalletToastProps>;
8
- export { PushWalletToast };
@@ -1,23 +0,0 @@
1
- import React, { HTMLAttributes, ReactNode } from 'react';
2
- export type TransformedHTMLAttributes<T> = Omit<HTMLAttributes<T>, 'style' | 'color'>;
3
- export type ButtonProps = {
4
- children?: ReactNode;
5
- bgColor?: React.CSSProperties['backgroundColor'];
6
- textColor?: React.CSSProperties['color'];
7
- borderRadius?: React.CSSProperties['borderRadius'];
8
- gap?: React.CSSProperties['gap'];
9
- padding?: React.CSSProperties['padding'];
10
- disabled?: boolean;
11
- style?: React.CSSProperties;
12
- } & TransformedHTMLAttributes<HTMLButtonElement>;
13
- declare const Button: React.ForwardRefExoticComponent<{
14
- children?: ReactNode;
15
- bgColor?: React.CSSProperties["backgroundColor"];
16
- textColor?: React.CSSProperties["color"];
17
- borderRadius?: React.CSSProperties["borderRadius"];
18
- gap?: React.CSSProperties["gap"];
19
- padding?: React.CSSProperties["padding"];
20
- disabled?: boolean;
21
- style?: React.CSSProperties;
22
- } & TransformedHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
23
- export { Button };
@@ -1,6 +0,0 @@
1
- import { FC } from 'react';
2
- type SpinnerProps = {
3
- color?: string;
4
- };
5
- declare const Spinner: FC<SpinnerProps>;
6
- export default Spinner;
@@ -1,2 +0,0 @@
1
- declare const ArbitrumMonotone: () => import("react/jsx-runtime").JSX.Element;
2
- export default ArbitrumMonotone;
@@ -1,2 +0,0 @@
1
- declare const AvalancheMonotone: () => import("react/jsx-runtime").JSX.Element;
2
- export default AvalancheMonotone;
@@ -1,2 +0,0 @@
1
- declare const BaseMonotone: () => import("react/jsx-runtime").JSX.Element;
2
- export default BaseMonotone;
@@ -1,2 +0,0 @@
1
- declare const BnbMonotone: () => import("react/jsx-runtime").JSX.Element;
2
- export default BnbMonotone;
@@ -1,6 +0,0 @@
1
- declare const CaretDown: ({ height, width, color }: {
2
- height: string;
3
- width: string;
4
- color: string;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default CaretDown;
@@ -1,6 +0,0 @@
1
- declare const CaretUp: ({ height, width, color }: {
2
- height: string;
3
- width: string;
4
- color: string;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default CaretUp;
@@ -1,6 +0,0 @@
1
- declare const CrossIcon: ({ height, width, color }: {
2
- height: string;
3
- width: string;
4
- color: string;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default CrossIcon;
@@ -1,2 +0,0 @@
1
- declare const DashIcon: () => import("react/jsx-runtime").JSX.Element;
2
- export default DashIcon;
@@ -1,2 +0,0 @@
1
- declare const EllipseIcon: () => import("react/jsx-runtime").JSX.Element;
2
- export default EllipseIcon;
@@ -1,2 +0,0 @@
1
- declare const EthereumMonotone: () => import("react/jsx-runtime").JSX.Element;
2
- export default EthereumMonotone;
@@ -1,2 +0,0 @@
1
- declare const OptimismMonotone: () => import("react/jsx-runtime").JSX.Element;
2
- export default OptimismMonotone;
@@ -1,2 +0,0 @@
1
- declare const PolygonMonotone: () => import("react/jsx-runtime").JSX.Element;
2
- export default PolygonMonotone;
@@ -1,2 +0,0 @@
1
- declare const PushLogo: () => import("react/jsx-runtime").JSX.Element;
2
- export default PushLogo;
@@ -1,2 +0,0 @@
1
- declare const PushMonotone: () => import("react/jsx-runtime").JSX.Element;
2
- export default PushMonotone;
@@ -1,2 +0,0 @@
1
- declare const SolanaMonotone: () => import("react/jsx-runtime").JSX.Element;
2
- export default SolanaMonotone;
@@ -1,2 +0,0 @@
1
- declare const TickIcon: () => import("react/jsx-runtime").JSX.Element;
2
- export default TickIcon;
@@ -1,2 +0,0 @@
1
- declare const WarningIcon: () => import("react/jsx-runtime").JSX.Element;
2
- export default WarningIcon;
@@ -1,14 +0,0 @@
1
- export { default as DashIcon } from './DashIcon';
2
- export { default as CrossIcon } from './CrossIcon';
3
- export { default as Ellipse } from './EllipseIcon';
4
- export { default as PushLogo } from './PushLogo';
5
- export { default as PushMonotone } from './PushMonotone';
6
- export { default as EthereumMonotone } from './EthereumMonotone';
7
- export { default as ArbitrumMonotone } from './ArbitrumMonotone';
8
- export { default as AvalancheMonotone } from './AvalancheMonotone';
9
- export { default as BnbMonotone } from './BnbMonotone';
10
- export { default as OptimismMonotone } from './OptimismMonotone';
11
- export { default as PolygonMonotone } from './PolygonMonotone';
12
- export { default as SolanaMonotone } from './SolanaMonotone';
13
- export { default as TickIcon } from './TickIcon';
14
- export { default as WarningIcon } from './WarningIcon';
@@ -1,3 +0,0 @@
1
- export { default as Spinner } from "./Spinner";
2
- export * from "./icons";
3
- export * from "./Button";
@@ -1,15 +0,0 @@
1
- import { PUSH_NETWORK } from '@pushchain/core/src/lib/constants/enums';
2
- export type ConfigType = {
3
- WALLET_URL: {
4
- [PUSH_NETWORK.MAINNET]: string;
5
- [PUSH_NETWORK.TESTNET]: string;
6
- [PUSH_NETWORK.TESTNET_DONUT]: string;
7
- [PUSH_NETWORK.LOCALNET]: string;
8
- };
9
- };
10
- export declare const WALLET_CONFIG_URL: {
11
- MAINNET: string;
12
- TESTNET: string;
13
- TESTNET_DONUT: string;
14
- LOCALNET: string;
15
- };
@@ -1,67 +0,0 @@
1
- import { ConnectionStatus } from '../types';
2
- export declare const PushUI: {
3
- CONSTANTS: {
4
- PUSH_NETWORK: typeof import("@pushchain/core/src/lib/constants/enums").PUSH_NETWORK;
5
- CHAIN: {
6
- PUSH: string;
7
- ETHEREUM: string;
8
- SOLANA: string;
9
- BASE: string;
10
- ARBITRUM: string;
11
- BINANCE: string;
12
- WALLET_CONNECT: string;
13
- };
14
- THEME: {
15
- LIGHT: string;
16
- DARK: string;
17
- };
18
- LOGIN: {
19
- LAYOUT: {
20
- SPLIT: string;
21
- SIMPLE: string;
22
- };
23
- };
24
- CONNECTED: {
25
- LAYOUT: {
26
- FULL: string;
27
- HOVER: string;
28
- };
29
- INTERACTION: {
30
- INTERACTIVE: string;
31
- BLUR: string;
32
- };
33
- };
34
- CONNECTION: {
35
- STATUS: typeof ConnectionStatus;
36
- };
37
- CHAIN_CONFIG: typeof import("@pushchain/core/src/lib/constants/enums").CHAIN;
38
- };
39
- };
40
- export declare enum WALLET_TO_APP_ACTION {
41
- CONNECT_EXTERNAL_WALLET = "connectWallet",
42
- APP_CONNECTION_SUCCESS = "appConnectionSuccess",
43
- APP_CONNECTION_REJECTED = "appConnectionRejected",
44
- APP_CONNECTION_CANCELLED = "appConnectionCancelled",
45
- IS_LOGGED_IN = "isLoggedIn",
46
- IS_LOGGED_OUT = "loggedOut",
47
- SIGN_MESSAGE = "signatureMessage",
48
- SIGN_TRANSACTION = "signatureTransaction",
49
- SIGN_TYPED_DATA = "signatureTypedData",
50
- ERROR = "error",
51
- PUSH_SEND_TRANSACTION = "pushSendTransaction",
52
- CLOSE_IFRAME = "closeIFrame"
53
- }
54
- export declare enum APP_TO_WALLET_ACTION {
55
- NEW_CONNECTION_REQUEST = "newConnectionRequest",
56
- SIGN_MESSAGE = "signMessage",
57
- SIGN_TRANSACTION = "signTransaction",
58
- SIGN_TYPED_DATA = "signTypedData",
59
- LOG_OUT = "logOut",
60
- CONNECTION_STATUS = "connectionStatus",
61
- WALLET_CONFIG = "walletConfig",
62
- PUSH_SEND_TRANSACTION_RESPONSE = "pushSendTransactionResponse",
63
- READ_ONLY_CONNECTION_STATUS = "readOnlyConnectionStatus",
64
- RECONNECT_WALLET = "ReconnectWallet"
65
- }
66
- export declare const CHAIN_LOGO: Record<string, React.FC | React.ComponentType>;
67
- export * from './environment';
@@ -1,40 +0,0 @@
1
- import React, { FC } from 'react';
2
- import { ProgressEvent } from '@pushchain/core/src/lib/progress-hook/progress-hook.types';
3
- import { ChainType, ConnectionStatus, IWalletProvider, ModalAppDetails, PushWalletProviderProps, UniversalAccount, WalletAppDetails, ThemeMode, ITypedData } from '../types';
4
- import { ThemeOverrides } from '../styles/token';
5
- export type WalletContextType = {
6
- universalAccount: UniversalAccount | null;
7
- connectionStatus: ConnectionStatus;
8
- isWalletMinimised: boolean;
9
- setMinimiseWallet: (isWalletMinimised: boolean) => void;
10
- handleConnectToPushWallet: () => void;
11
- handleUserLogOutEvent: () => void;
12
- handleSignMessage: (data: Uint8Array) => Promise<Uint8Array>;
13
- handleSignAndSendTransaction: (data: Uint8Array) => Promise<Uint8Array>;
14
- handleSignTypedData: (data: ITypedData) => Promise<Uint8Array>;
15
- handleExternalWalletConnection: (data: {
16
- chain: ChainType;
17
- provider: IWalletProvider["name"];
18
- }) => Promise<void>;
19
- config: PushWalletProviderProps['config'];
20
- app?: PushWalletProviderProps['app'];
21
- modalAppData: ModalAppDetails | undefined;
22
- updateModalAppData: (newData: Partial<ModalAppDetails>) => void;
23
- walletAppData: WalletAppDetails | undefined;
24
- updateWalletAppData: (newData: Partial<WalletAppDetails>) => void;
25
- themeMode: ThemeMode;
26
- themeOverrides: ThemeOverrides;
27
- progress: ProgressEvent | null;
28
- setProgress: React.Dispatch<React.SetStateAction<ProgressEvent | null>>;
29
- isReadOnly: boolean;
30
- setIsReadOnly: React.Dispatch<React.SetStateAction<boolean>>;
31
- requestPushWalletConnection: () => Promise<{
32
- chain: ChainType;
33
- provider: IWalletProvider["name"];
34
- }>;
35
- activeTriggerId: string | undefined;
36
- setActiveTriggerId: React.Dispatch<React.SetStateAction<string | undefined>>;
37
- toggleButtonRefs: React.MutableRefObject<Record<string, HTMLDivElement | null>>;
38
- };
39
- export declare const WalletContext: React.Context<WalletContextType | null>;
40
- export declare const WalletContextProvider: FC<PushWalletProviderProps>;
@@ -1,2 +0,0 @@
1
- import { WalletContextType } from './WalletContext';
2
- export declare const getWalletContext: (uid?: string) => import("react").Context<WalletContextType | null>;
@@ -1 +0,0 @@
1
- export * from "./wallet.helpers";
@@ -1,10 +0,0 @@
1
- import { PushChain } from "@pushchain/core";
2
- import { UniversalSigner } from "@pushchain/core/src/lib/universal/universal.types";
3
- import { ChainType, IWalletProvider } from "../types";
4
- export declare function createGuardedPushChain(baseClient: PushChain, handleExternalWalletConnection: (data: {
5
- chain: ChainType;
6
- provider: IWalletProvider["name"];
7
- }) => Promise<void>, requestPushWalletConnection: () => Promise<{
8
- chain: ChainType;
9
- provider: IWalletProvider["name"];
10
- }>, universalSigner: UniversalSigner, intializeProps: any, uid: string, callback?: () => void): PushChain;
@@ -1,8 +0,0 @@
1
- import { CHAIN } from '@pushchain/core/src/lib/constants/enums';
2
- export declare const getWalletDataFromAccount: (account: string) => {
3
- chainId: string;
4
- chain: string;
5
- address: string;
6
- };
7
- export declare function centerMaskString(str: string, len?: number): string;
8
- export declare const getChainId: (chain: CHAIN) => string;
@@ -1 +0,0 @@
1
- export declare const useAppMetadata: (uid?: string) => import("..").AppMetadata | undefined;
@@ -1,4 +0,0 @@
1
- import { PushChain as PushChainCore } from '@pushchain/core';
2
- export declare const usePushChain: () => {
3
- PushChain: typeof PushChainCore;
4
- };
@@ -1,6 +0,0 @@
1
- import { PushChain } from '@pushchain/core';
2
- export declare const usePushChainClient: (uid?: string) => {
3
- pushChainClient: PushChain | null;
4
- error: Error | null;
5
- isInitialized: boolean;
6
- };
@@ -1,2 +0,0 @@
1
- import { WalletContextType } from '../context/WalletContext';
2
- export declare const usePushWalletContext: (uid?: string) => WalletContextType;
@@ -1,7 +0,0 @@
1
- export * from './constants';
2
- export * from './providers/PushWalletProvider';
3
- export * from './types';
4
- export * from './components/PushUniversalAccountButton';
5
- export * from './hooks/usePushWallet';
6
- export * from './hooks/usePushChainClient';
7
- export * from './hooks/usePushChain';
@@ -1,4 +0,0 @@
1
- import type { Buffer as BufferType } from 'buffer';
2
- declare global {
3
- var Buffer: BufferType;
4
- }
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
- import { PushWalletProviderProps } from '../types/index';
3
- export declare const PushUniversalWalletProvider: FC<PushWalletProviderProps>;
File without changes
@@ -1,19 +0,0 @@
1
- import { ChainType, IWalletProvider, ITypedData } from '../../types/wallet.types';
2
- export declare abstract class BaseWalletProvider implements IWalletProvider {
3
- readonly name: string;
4
- readonly icon: string;
5
- readonly supportedChains: ChainType[];
6
- constructor(name: string, icon: string, supportedChains: ChainType[]);
7
- abstract connect(chainType?: ChainType): Promise<{
8
- caipAddress: string;
9
- }>;
10
- abstract signMessage(message: Uint8Array): Promise<Uint8Array>;
11
- abstract signAndSendTransaction(txn: Uint8Array): Promise<Uint8Array>;
12
- abstract signTypedData(typedData: ITypedData): Promise<Uint8Array>;
13
- abstract disconnect(): Promise<void>;
14
- abstract getChainId(): Promise<unknown>;
15
- protected formatAddress(rawAddress: string, chainType: ChainType, chainId: number): {
16
- caipAddress: string;
17
- };
18
- protected validateChainType(chainType?: ChainType): ChainType;
19
- }
@@ -1,13 +0,0 @@
1
- import { ChainType, IWalletProvider } from '../../types/wallet.types';
2
- declare class WalletProviderRegistry {
3
- private providers;
4
- private chainProviders;
5
- constructor();
6
- registerProvider(provider: IWalletProvider): void;
7
- getProvider(name: string): IWalletProvider | undefined;
8
- getProvidersByChain(chain: ChainType): IWalletProvider[];
9
- getAllProviders(): IWalletProvider[];
10
- getAllSupportedChains(): ChainType[];
11
- }
12
- export declare const walletRegistry: WalletProviderRegistry;
13
- export {};
@@ -1,44 +0,0 @@
1
- import * as viemChains from 'viem/chains';
2
- type ChainType = typeof viemChains & Record<string, unknown>;
3
- export declare const pushWalletDonut: {
4
- blockExplorers: {
5
- readonly default: {
6
- readonly name: "Push Testnet Explorer";
7
- readonly url: "https://donut.push.network/";
8
- };
9
- };
10
- blockTime?: number | undefined;
11
- contracts?: viemChains.Prettify<{
12
- [key: string]: import("viem").ChainContract | {
13
- [sourceId: number]: import("viem").ChainContract | undefined;
14
- } | undefined;
15
- } & {
16
- ensRegistry?: import("viem").ChainContract | undefined;
17
- ensUniversalResolver?: import("viem").ChainContract | undefined;
18
- multicall3?: import("viem").ChainContract | undefined;
19
- erc6492Verifier?: import("viem").ChainContract | undefined;
20
- }> | undefined;
21
- ensTlds?: readonly string[] | undefined;
22
- id: 42101;
23
- name: "Push Testnet Donut";
24
- nativeCurrency: {
25
- readonly decimals: 18;
26
- readonly name: "Push Chain";
27
- readonly symbol: "PC";
28
- };
29
- experimental_preconfirmationTime?: number | undefined;
30
- rpcUrls: {
31
- readonly default: {
32
- readonly http: readonly ["https://evm.donut.rpc.push.org/"];
33
- readonly webSocket: readonly ["wss://evm.donut.rpc.push.org"];
34
- };
35
- };
36
- sourceId?: number | undefined;
37
- testnet?: boolean | undefined;
38
- custom?: Record<string, unknown> | undefined;
39
- fees?: import("viem").ChainFees<undefined> | undefined;
40
- formatters?: undefined;
41
- serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
42
- };
43
- export declare const chains: ChainType;
44
- export {};
@@ -1,18 +0,0 @@
1
- import { BaseWalletProvider } from '../BaseWalletProvider';
2
- import { ChainType, ITypedData } from '../../../types/wallet.types';
3
- export declare class MetamaskProvider extends BaseWalletProvider {
4
- private sdk;
5
- constructor();
6
- isInstalled: () => Promise<boolean>;
7
- getProvider: () => import("@metamask/sdk").SDKProvider | undefined;
8
- getSigner: () => Promise<import("ethers").JsonRpcSigner>;
9
- connect(chainType: ChainType): Promise<{
10
- caipAddress: string;
11
- }>;
12
- getChainId: () => Promise<number>;
13
- switchNetwork: (chainName: ChainType) => Promise<void>;
14
- signAndSendTransaction: (txn: Uint8Array) => Promise<Uint8Array>;
15
- signMessage: (message: Uint8Array) => Promise<Uint8Array>;
16
- signTypedData: (typedData: ITypedData) => Promise<Uint8Array>;
17
- disconnect: () => Promise<void>;
18
- }
@@ -1,17 +0,0 @@
1
- import { BaseWalletProvider } from '../BaseWalletProvider';
2
- import { ChainType, ITypedData } from '../../../types/wallet.types';
3
- export declare class RabbyProvider extends BaseWalletProvider {
4
- constructor();
5
- isInstalled: () => Promise<boolean>;
6
- private getProvider;
7
- getSigner: () => Promise<import("ethers").JsonRpcSigner>;
8
- getChainId: () => Promise<number>;
9
- connect: (chainType: ChainType) => Promise<{
10
- caipAddress: string;
11
- }>;
12
- switchNetwork: (chainName: ChainType) => Promise<void>;
13
- signAndSendTransaction: (txn: Uint8Array) => Promise<Uint8Array>;
14
- signMessage: (message: Uint8Array) => Promise<Uint8Array>;
15
- signTypedData: (typedData: ITypedData) => Promise<Uint8Array>;
16
- disconnect: () => Promise<void>;
17
- }
@@ -1,17 +0,0 @@
1
- import { BaseWalletProvider } from '../BaseWalletProvider';
2
- import { ITypedData } from '../../../types/wallet.types';
3
- export declare class WalletConnectProvider extends BaseWalletProvider {
4
- private provider;
5
- constructor();
6
- isInstalled: () => Promise<boolean>;
7
- getProvider: () => import("@walletconnect/ethereum-provider").default;
8
- private initProvider;
9
- connect(): Promise<{
10
- caipAddress: string;
11
- }>;
12
- getChainId: () => Promise<number>;
13
- signAndSendTransaction: (txn: Uint8Array) => Promise<Uint8Array>;
14
- signMessage: (message: Uint8Array) => Promise<Uint8Array>;
15
- signTypedData: (typedData: ITypedData) => Promise<Uint8Array>;
16
- disconnect: () => Promise<void>;
17
- }
@@ -1,17 +0,0 @@
1
- import { BaseWalletProvider } from '../BaseWalletProvider';
2
- import { ChainType, ITypedData } from '../../../types/wallet.types';
3
- export declare class ZerionProvider extends BaseWalletProvider {
4
- constructor();
5
- isInstalled: () => Promise<boolean>;
6
- private getProvider;
7
- getSigner: () => Promise<import("ethers").JsonRpcSigner>;
8
- getChainId: () => Promise<number>;
9
- connect: (chainType: ChainType) => Promise<{
10
- caipAddress: string;
11
- }>;
12
- switchNetwork: (chainName: ChainType) => Promise<void>;
13
- signAndSendTransaction: (txn: Uint8Array) => Promise<Uint8Array>;
14
- signMessage: (message: Uint8Array) => Promise<Uint8Array>;
15
- signTypedData: (typedData: ITypedData) => Promise<Uint8Array>;
16
- disconnect: () => Promise<void>;
17
- }
@@ -1,11 +0,0 @@
1
- import { ChainType } from '../../../types/wallet.types';
2
- export declare const chainToNamespace: {
3
- EVM: string;
4
- SOL: string;
5
- };
6
- export declare function fromCAIPFormat(caipAddress: string): {
7
- chain: ChainType.ETHEREUM | ChainType.SOLANA | ChainType.BINANCE | ChainType.ARBITRUM | ChainType.AVALANCHE;
8
- chainId: string;
9
- rawAddress: string;
10
- };
11
- export declare function toCAIPFormat(rawAddress: string, chain: ChainType, chainId: number | string): string;
@@ -1,46 +0,0 @@
1
- import { BaseWalletProvider } from '../BaseWalletProvider';
2
- import { ChainType, ITypedData } from '../../../types/wallet.types';
3
- import { Transaction, VersionedTransaction } from '@solana/web3.js';
4
- declare global {
5
- interface Window {
6
- phantom?: {
7
- ethereum?: {
8
- isConnected?: boolean;
9
- request: (args: {
10
- method: string;
11
- params?: any[];
12
- }) => Promise<any>;
13
- };
14
- solana?: {
15
- isConnected?: boolean;
16
- chainId?: number;
17
- connect: () => Promise<{
18
- publicKey: {
19
- toString: () => string;
20
- };
21
- }>;
22
- disconnect: () => Promise<void>;
23
- signMessage: (message: Uint8Array, encoding: string) => Promise<{
24
- signature: Uint8Array;
25
- }>;
26
- signAndSendTransaction: (txn: Transaction | VersionedTransaction) => Promise<string>;
27
- };
28
- };
29
- ethereum?: any;
30
- }
31
- }
32
- export declare class PhantomProvider extends BaseWalletProvider {
33
- constructor();
34
- private connectedChainType;
35
- isInstalled: () => Promise<boolean>;
36
- private connectEthereum;
37
- private connectSolana;
38
- connect: (chainType?: ChainType) => Promise<{
39
- caipAddress: string;
40
- }>;
41
- getChainId: (chainType?: ChainType) => Promise<number>;
42
- signMessage: (message: Uint8Array) => Promise<Uint8Array>;
43
- signAndSendTransaction: (txn: Uint8Array) => Promise<Uint8Array>;
44
- signTypedData: (typedData: ITypedData) => Promise<Uint8Array>;
45
- disconnect: () => Promise<void>;
46
- }
@@ -1,12 +0,0 @@
1
- export type EIP6963ProviderDetail = {
2
- info: {
3
- uuid: string;
4
- name: string;
5
- icon: string;
6
- rdns: string;
7
- };
8
- provider: any;
9
- };
10
- export declare function startEIP6963Listener(): void;
11
- export declare function getEIP6963ProviderByRdns(rdns: string): any;
12
- export declare function getAllEIP6963Providers(): EIP6963ProviderDetail[];