@broxus/evm-connect 1.8.4 → 1.9.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.
- package/dist/index.cjs.js +2 -0
- package/dist/index.esm.js +2 -0
- package/dist/style.min.css +1 -1
- package/dist/uikit.min.css +1 -0
- package/{dist → lib}/cjs/components/EvmConnectDialog/index.js +1 -0
- package/{dist → lib}/cjs/context/EvmWalletProvidersContext.js +1 -0
- package/{dist → lib}/cjs/context/EvmWalletServiceContext.js +1 -0
- package/{dist → lib}/esm/components/EvmConnectDialog/index.js +1 -0
- package/{dist → lib}/esm/context/EvmWalletProvidersContext.js +1 -0
- package/{dist → lib}/esm/context/EvmWalletServiceContext.js +1 -0
- package/lib/esm/uikit.d.ts +1 -0
- package/package.json +36 -23
- package/dist/cjs/intl/index.d.ts +0 -103
- package/dist/cjs/main.d.ts +0 -1
- package/dist/cjs/main.js +0 -3
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +0 -1
- package/dist/esm/components/EvmConnectButton/index.d.ts +0 -23
- package/dist/esm/components/EvmConnectDialog/index.d.ts +0 -11
- package/dist/esm/components/EvmConnector/index.d.ts +0 -21
- package/dist/esm/components/EvmProvidersDispatcher/ConnectionRequest/index.d.ts +0 -3
- package/dist/esm/components/EvmProvidersDispatcher/ProviderButton/index.d.ts +0 -11
- package/dist/esm/components/EvmProvidersDispatcher/index.d.ts +0 -5
- package/dist/esm/components/index.d.ts +0 -4
- package/dist/esm/connectors/EIP6963Connector.d.ts +0 -17
- package/dist/esm/connectors/MetaMask.d.ts +0 -24
- package/dist/esm/connectors/WalletConnect.d.ts +0 -20
- package/dist/esm/connectors/index.d.ts +0 -3
- package/dist/esm/constants.d.ts +0 -1
- package/dist/esm/context/EvmWalletProvidersContext.d.ts +0 -20
- package/dist/esm/context/EvmWalletServiceContext.d.ts +0 -11
- package/dist/esm/context/index.d.ts +0 -2
- package/dist/esm/core/EthereumConnector.d.ts +0 -43
- package/dist/esm/core/index.d.ts +0 -1
- package/dist/esm/hooks/index.d.ts +0 -4
- package/dist/esm/hooks/useEIP6963Connections.d.ts +0 -6
- package/dist/esm/hooks/useFilteredConnections.d.ts +0 -2
- package/dist/esm/hooks/useOrderedConnections.d.ts +0 -2
- package/dist/esm/hooks/useRecentConnectionMeta.d.ts +0 -15
- package/dist/esm/index.d.ts +0 -9
- package/dist/esm/intl/index.d.ts +0 -103
- package/dist/esm/main.d.ts +0 -1
- package/dist/esm/main.js +0 -1
- package/dist/esm/services/EvmWalletService.d.ts +0 -178
- package/dist/esm/services/index.d.ts +0 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +0 -1
- package/dist/esm/types.d.ts +0 -55
- package/dist/esm/utils/convert-network-to-chain-params.d.ts +0 -2
- package/dist/esm/utils/get-evm-provider-platform-link.d.ts +0 -2
- package/dist/esm/utils/index.d.ts +0 -3
- package/dist/esm/utils/parse-chain-id.d.ts +0 -1
- /package/{dist → lib}/cjs/components/EvmConnectButton/index.js +0 -0
- /package/{dist → lib}/cjs/components/EvmConnectDialog/index.css +0 -0
- /package/{dist → lib}/cjs/components/EvmConnector/index.css +0 -0
- /package/{dist → lib}/cjs/components/EvmConnector/index.js +0 -0
- /package/{dist → lib}/cjs/components/EvmProvidersDispatcher/ConnectionRequest/index.css +0 -0
- /package/{dist → lib}/cjs/components/EvmProvidersDispatcher/ConnectionRequest/index.js +0 -0
- /package/{dist → lib}/cjs/components/EvmProvidersDispatcher/ProviderButton/index.css +0 -0
- /package/{dist → lib}/cjs/components/EvmProvidersDispatcher/ProviderButton/index.js +0 -0
- /package/{dist → lib}/cjs/components/EvmProvidersDispatcher/index.css +0 -0
- /package/{dist → lib}/cjs/components/EvmProvidersDispatcher/index.js +0 -0
- /package/{dist → lib}/cjs/components/index.js +0 -0
- /package/{dist → lib}/cjs/connectors/EIP6963Connector.js +0 -0
- /package/{dist → lib}/cjs/connectors/MetaMask.js +0 -0
- /package/{dist → lib}/cjs/connectors/WalletConnect.js +0 -0
- /package/{dist → lib}/cjs/connectors/index.js +0 -0
- /package/{dist → lib}/cjs/constants.js +0 -0
- /package/{dist → lib}/cjs/context/index.js +0 -0
- /package/{dist → lib}/cjs/core/EthereumConnector.js +0 -0
- /package/{dist → lib}/cjs/core/index.js +0 -0
- /package/{dist → lib}/cjs/hooks/index.js +0 -0
- /package/{dist → lib}/cjs/hooks/useEIP6963Connections.js +0 -0
- /package/{dist → lib}/cjs/hooks/useFilteredConnections.js +0 -0
- /package/{dist → lib}/cjs/hooks/useOrderedConnections.js +0 -0
- /package/{dist → lib}/cjs/hooks/useRecentConnectionMeta.js +0 -0
- /package/{dist → lib}/cjs/index.js +0 -0
- /package/{dist → lib}/cjs/intl/index.js +0 -0
- /package/{dist → lib}/cjs/services/EvmWalletService.js +0 -0
- /package/{dist → lib}/cjs/services/index.js +0 -0
- /package/{dist → lib}/cjs/types.js +0 -0
- /package/{dist → lib}/cjs/utils/convert-network-to-chain-params.js +0 -0
- /package/{dist → lib}/cjs/utils/get-evm-provider-platform-link.js +0 -0
- /package/{dist → lib}/cjs/utils/index.js +0 -0
- /package/{dist → lib}/cjs/utils/parse-chain-id.js +0 -0
- /package/{dist/cjs → lib/esm}/components/EvmConnectButton/index.d.ts +0 -0
- /package/{dist → lib}/esm/components/EvmConnectButton/index.js +0 -0
- /package/{dist → lib}/esm/components/EvmConnectDialog/index.css +0 -0
- /package/{dist/cjs → lib/esm}/components/EvmConnectDialog/index.d.ts +0 -0
- /package/{dist → lib}/esm/components/EvmConnector/index.css +0 -0
- /package/{dist/cjs → lib/esm}/components/EvmConnector/index.d.ts +0 -0
- /package/{dist → lib}/esm/components/EvmConnector/index.js +0 -0
- /package/{dist → lib}/esm/components/EvmProvidersDispatcher/ConnectionRequest/index.css +0 -0
- /package/{dist/cjs → lib/esm}/components/EvmProvidersDispatcher/ConnectionRequest/index.d.ts +0 -0
- /package/{dist → lib}/esm/components/EvmProvidersDispatcher/ConnectionRequest/index.js +0 -0
- /package/{dist → lib}/esm/components/EvmProvidersDispatcher/ProviderButton/index.css +0 -0
- /package/{dist/cjs → lib/esm}/components/EvmProvidersDispatcher/ProviderButton/index.d.ts +0 -0
- /package/{dist → lib}/esm/components/EvmProvidersDispatcher/ProviderButton/index.js +0 -0
- /package/{dist → lib}/esm/components/EvmProvidersDispatcher/index.css +0 -0
- /package/{dist/cjs → lib/esm}/components/EvmProvidersDispatcher/index.d.ts +0 -0
- /package/{dist → lib}/esm/components/EvmProvidersDispatcher/index.js +0 -0
- /package/{dist/cjs → lib/esm}/components/index.d.ts +0 -0
- /package/{dist → lib}/esm/components/index.js +0 -0
- /package/{dist/cjs → lib/esm}/connectors/EIP6963Connector.d.ts +0 -0
- /package/{dist → lib}/esm/connectors/EIP6963Connector.js +0 -0
- /package/{dist/cjs → lib/esm}/connectors/MetaMask.d.ts +0 -0
- /package/{dist → lib}/esm/connectors/MetaMask.js +0 -0
- /package/{dist/cjs → lib/esm}/connectors/WalletConnect.d.ts +0 -0
- /package/{dist → lib}/esm/connectors/WalletConnect.js +0 -0
- /package/{dist/cjs → lib/esm}/connectors/index.d.ts +0 -0
- /package/{dist → lib}/esm/connectors/index.js +0 -0
- /package/{dist/cjs → lib/esm}/constants.d.ts +0 -0
- /package/{dist → lib}/esm/constants.js +0 -0
- /package/{dist/cjs → lib/esm}/context/EvmWalletProvidersContext.d.ts +0 -0
- /package/{dist/cjs → lib/esm}/context/EvmWalletServiceContext.d.ts +0 -0
- /package/{dist/cjs → lib/esm}/context/index.d.ts +0 -0
- /package/{dist → lib}/esm/context/index.js +0 -0
- /package/{dist/cjs → lib/esm}/core/EthereumConnector.d.ts +0 -0
- /package/{dist → lib}/esm/core/EthereumConnector.js +0 -0
- /package/{dist/cjs → lib/esm}/core/index.d.ts +0 -0
- /package/{dist → lib}/esm/core/index.js +0 -0
- /package/{dist/cjs → lib/esm}/hooks/index.d.ts +0 -0
- /package/{dist → lib}/esm/hooks/index.js +0 -0
- /package/{dist/cjs → lib/esm}/hooks/useEIP6963Connections.d.ts +0 -0
- /package/{dist → lib}/esm/hooks/useEIP6963Connections.js +0 -0
- /package/{dist/cjs → lib/esm}/hooks/useFilteredConnections.d.ts +0 -0
- /package/{dist → lib}/esm/hooks/useFilteredConnections.js +0 -0
- /package/{dist/cjs → lib/esm}/hooks/useOrderedConnections.d.ts +0 -0
- /package/{dist → lib}/esm/hooks/useOrderedConnections.js +0 -0
- /package/{dist/cjs → lib/esm}/hooks/useRecentConnectionMeta.d.ts +0 -0
- /package/{dist → lib}/esm/hooks/useRecentConnectionMeta.js +0 -0
- /package/{dist/cjs → lib/esm}/index.d.ts +0 -0
- /package/{dist → lib}/esm/index.js +0 -0
- /package/{dist → lib}/esm/intl/index.js +0 -0
- /package/{dist/cjs → lib/esm}/services/EvmWalletService.d.ts +0 -0
- /package/{dist → lib}/esm/services/EvmWalletService.js +0 -0
- /package/{dist/cjs → lib/esm}/services/index.d.ts +0 -0
- /package/{dist → lib}/esm/services/index.js +0 -0
- /package/{dist/cjs → lib/esm}/types.d.ts +0 -0
- /package/{dist → lib}/esm/types.js +0 -0
- /package/{dist/cjs → lib/esm}/utils/convert-network-to-chain-params.d.ts +0 -0
- /package/{dist → lib}/esm/utils/convert-network-to-chain-params.js +0 -0
- /package/{dist/cjs → lib/esm}/utils/get-evm-provider-platform-link.d.ts +0 -0
- /package/{dist → lib}/esm/utils/get-evm-provider-platform-link.js +0 -0
- /package/{dist/cjs → lib/esm}/utils/index.d.ts +0 -0
- /package/{dist → lib}/esm/utils/index.js +0 -0
- /package/{dist/cjs → lib/esm}/utils/parse-chain-id.d.ts +0 -0
- /package/{dist → lib}/esm/utils/parse-chain-id.js +0 -0
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type ButtonProps } from '@broxus/react-uikit';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { type EvmConnectDialogProps } from '../../components/EvmConnectDialog';
|
|
4
|
-
import { type EvmWalletService } from '../../services';
|
|
5
|
-
import { type EvmNetworkConfig } from '../../types';
|
|
6
|
-
export type EvmConnectButtonProps = React.PropsWithChildren<{
|
|
7
|
-
agreementsNote?: React.ReactNode;
|
|
8
|
-
className?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
network?: EvmNetworkConfig;
|
|
11
|
-
popupClassName?: EvmConnectDialogProps['className'];
|
|
12
|
-
popupType?: EvmConnectDialogProps['type'];
|
|
13
|
-
shape?: ButtonProps['shape'];
|
|
14
|
-
size?: ButtonProps['size'];
|
|
15
|
-
standalone?: boolean;
|
|
16
|
-
type?: ButtonProps['type'];
|
|
17
|
-
onClose?: VoidFunction;
|
|
18
|
-
onConnect?: (walletService?: EvmWalletService) => Promise<void> | void;
|
|
19
|
-
onOpen?: VoidFunction;
|
|
20
|
-
}>;
|
|
21
|
-
export declare const EvmConnectButton: (({ children, className, disabled, network, popupClassName, popupType, shape, size, type, onClose, onConnect, onOpen, ...props }: EvmConnectButtonProps) => React.JSX.Element) & {
|
|
22
|
-
displayName: string;
|
|
23
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import './index.css';
|
|
3
|
-
export interface EvmConnectDialogProps {
|
|
4
|
-
className?: string;
|
|
5
|
-
open?: boolean;
|
|
6
|
-
type?: 'drawer';
|
|
7
|
-
onClose?: VoidFunction;
|
|
8
|
-
}
|
|
9
|
-
export declare const EvmConnectDialog: (({ className, open, type, onClose }: EvmConnectDialogProps) => React.JSX.Element) & {
|
|
10
|
-
displayName: string;
|
|
11
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type ButtonProps } from '@broxus/react-uikit';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { type EvmNetworkConfig } from '../../types';
|
|
4
|
-
import './index.css';
|
|
5
|
-
export interface EvmConnectorProps {
|
|
6
|
-
changeWalletButtonText?: React.ReactNode;
|
|
7
|
-
className?: string;
|
|
8
|
-
connectButtonShape?: ButtonProps['shape'];
|
|
9
|
-
connectButtonText?: React.ReactNode;
|
|
10
|
-
connectButtonType?: ButtonProps['type'];
|
|
11
|
-
disconnectButtonText?: React.ReactNode;
|
|
12
|
-
network?: EvmNetworkConfig;
|
|
13
|
-
popupType?: 'drawer';
|
|
14
|
-
suffix?: React.ReactNode;
|
|
15
|
-
showDropMenu?: boolean;
|
|
16
|
-
showSubIcon?: boolean;
|
|
17
|
-
standalone?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare const EvmConnector: ((props: EvmConnectorProps) => React.JSX.Element) & {
|
|
20
|
-
displayName: string;
|
|
21
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type EvmWalletProviderConfig } from '../../../types';
|
|
3
|
-
import './index.css';
|
|
4
|
-
interface ProviderButtonProps {
|
|
5
|
-
providerConfig: EvmWalletProviderConfig;
|
|
6
|
-
onSelect?: (providerConfig: EvmWalletProviderConfig) => Promise<void> | void;
|
|
7
|
-
}
|
|
8
|
-
export declare const ProviderButton: ((props: ProviderButtonProps) => React.JSX.Element) & {
|
|
9
|
-
displayName: string;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type EIP6963ProviderInfo } from 'web3/lib/commonjs/web3_eip6963';
|
|
2
|
-
import { type EthExecutionAPI, type ProviderConnectInfo } from 'web3-types';
|
|
3
|
-
import { EthereumConnector, type EthereumConnectorCtorParams } from '../core';
|
|
4
|
-
import { type AddEthereumChainParams, EthereumConnectionType, type SupportedProviders } from '../types';
|
|
5
|
-
export interface EIP6963ConnectorCtorParams extends EthereumConnectorCtorParams {
|
|
6
|
-
info: EIP6963ProviderInfo;
|
|
7
|
-
provider: Readonly<SupportedProviders<EthExecutionAPI>>;
|
|
8
|
-
}
|
|
9
|
-
export declare class EIP6963Connector extends EthereumConnector {
|
|
10
|
-
protected readonly params: Readonly<EIP6963ConnectorCtorParams>;
|
|
11
|
-
readonly type = EthereumConnectionType.EIP_6963_INJECTED;
|
|
12
|
-
constructor(params: Readonly<EIP6963ConnectorCtorParams>);
|
|
13
|
-
connect(chainIdOrParams?: number | AddEthereumChainParams): Promise<void>;
|
|
14
|
-
disconnect(): Promise<void>;
|
|
15
|
-
protected init(): Promise<void>;
|
|
16
|
-
protected handleConnect({ chainId }: ProviderConnectInfo): void;
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import detectEthereumProvider from '@metamask/detect-provider';
|
|
2
|
-
import { type EthExecutionAPI, type MetaMaskProvider, type ProviderConnectInfo } from 'web3-types';
|
|
3
|
-
import { EthereumConnector, type EthereumConnectorCtorParams } from '../core';
|
|
4
|
-
import { type AddEthereumChainParams, EthereumConnectionType } from '../types';
|
|
5
|
-
interface MetaMaskEthereumProvider extends MetaMaskProvider<EthExecutionAPI> {
|
|
6
|
-
isConnected?: () => boolean;
|
|
7
|
-
providers?: MetaMaskEthereumProvider[];
|
|
8
|
-
get accounts(): string[];
|
|
9
|
-
get chainId(): string;
|
|
10
|
-
}
|
|
11
|
-
export interface MetaMaskCtorParams extends EthereumConnectorCtorParams {
|
|
12
|
-
options?: Parameters<typeof detectEthereumProvider>[0];
|
|
13
|
-
}
|
|
14
|
-
export declare class MetaMask extends EthereumConnector {
|
|
15
|
-
protected readonly params?: Readonly<MetaMaskCtorParams> | undefined;
|
|
16
|
-
readonly type = EthereumConnectionType.INJECTED;
|
|
17
|
-
provider?: MetaMaskEthereumProvider;
|
|
18
|
-
constructor(params?: Readonly<MetaMaskCtorParams> | undefined);
|
|
19
|
-
connect(chainIdOrParams?: number | AddEthereumChainParams): Promise<void>;
|
|
20
|
-
disconnect(): Promise<void>;
|
|
21
|
-
protected init(): Promise<void>;
|
|
22
|
-
protected handleConnect({ chainId }: ProviderConnectInfo): void;
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import EthereumProvider, { type EthereumProviderOptions } from '@walletconnect/ethereum-provider';
|
|
2
|
-
import { EthereumConnector, type EthereumConnectorCtorParams } from '../core';
|
|
3
|
-
import { type AddEthereumChainParams, EthereumConnectionType } from '../types';
|
|
4
|
-
export interface WalletConnectOptions extends Omit<EthereumProviderOptions, 'rpcMap'> {
|
|
5
|
-
rpcMap?: Record<number, string | string[]>;
|
|
6
|
-
}
|
|
7
|
-
export interface WalletConnectCtorParams extends EthereumConnectorCtorParams {
|
|
8
|
-
options: WalletConnectOptions;
|
|
9
|
-
}
|
|
10
|
-
export declare class WalletConnect extends EthereumConnector {
|
|
11
|
-
protected readonly params: Readonly<WalletConnectCtorParams>;
|
|
12
|
-
readonly type = EthereumConnectionType.WALLET_CONNECT_V2;
|
|
13
|
-
provider?: EthereumProvider;
|
|
14
|
-
protected readonly options: WalletConnectOptions;
|
|
15
|
-
constructor(params: Readonly<WalletConnectCtorParams>);
|
|
16
|
-
connect(chainIdOrParams?: number | AddEthereumChainParams): Promise<void>;
|
|
17
|
-
disconnect(): Promise<void>;
|
|
18
|
-
protected init(): Promise<void>;
|
|
19
|
-
protected createProvider(): Promise<EthereumProvider>;
|
|
20
|
-
}
|
package/dist/esm/constants.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const EVM_RECENT_CONNECTION = "EVM_RECENT_CONNECTION";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type EthereumConnector } from '../core';
|
|
3
|
-
import { type EvmNetworkConfig, type EvmWalletProviderConfig } from '../types';
|
|
4
|
-
export interface EvmWalletProvidersContextConsumer {
|
|
5
|
-
agreementsNote?: React.ReactNode;
|
|
6
|
-
connect: (providerConfig: EvmWalletProviderConfig) => Promise<void>;
|
|
7
|
-
connectingProvider?: EvmWalletProviderConfig | null;
|
|
8
|
-
error?: Error | null;
|
|
9
|
-
reset: VoidFunction;
|
|
10
|
-
}
|
|
11
|
-
export declare const EvmWalletProvidersContext: React.Context<EvmWalletProvidersContextConsumer | null>;
|
|
12
|
-
export declare function useEvmWalletProviders(): EvmWalletProvidersContextConsumer;
|
|
13
|
-
export type EvmWalletProvidersProviderProps = React.PropsWithChildren<{
|
|
14
|
-
agreementsNote?: React.ReactNode;
|
|
15
|
-
network?: EvmNetworkConfig;
|
|
16
|
-
onConnect?: (connector?: EthereumConnector) => Promise<void> | void;
|
|
17
|
-
}>;
|
|
18
|
-
export declare const EvmWalletProvidersProvider: (({ agreementsNote, children, network, onConnect, }: EvmWalletProvidersProviderProps) => React.JSX.Element) & {
|
|
19
|
-
displayName: string;
|
|
20
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { EvmWalletService, type EvmWalletServiceCtorParams } from '../services';
|
|
3
|
-
export declare const EvmWalletServiceContext: React.Context<EvmWalletService | null>;
|
|
4
|
-
export declare function useEvmWalletService(): EvmWalletService;
|
|
5
|
-
interface EvmWalletProviderProps {
|
|
6
|
-
agreementsNote?: React.ReactNode;
|
|
7
|
-
params?: EvmWalletServiceCtorParams;
|
|
8
|
-
wallet?: EvmWalletService;
|
|
9
|
-
}
|
|
10
|
-
export declare function EvmWalletServiceProvider({ agreementsNote, children, params, wallet, }: React.PropsWithChildren<EvmWalletProviderProps>): React.JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { AbstractStore } from '@broxus/js-core';
|
|
2
|
-
import { type EthExecutionAPI, type ProviderRpcError } from 'web3-types';
|
|
3
|
-
import { type AddEthereumChainParams, type EthereumConnectionType, type SupportedProviders, type WatchAssetParameters } from '../types';
|
|
4
|
-
export interface EthereumConnectorCtorParams {
|
|
5
|
-
onDisconnect?: (err: ProviderRpcError) => Promise<void> | void;
|
|
6
|
-
}
|
|
7
|
-
export interface EthereumConnectorData {
|
|
8
|
-
accounts?: string[];
|
|
9
|
-
chainId?: number;
|
|
10
|
-
}
|
|
11
|
-
export interface EthereumConnectorState {
|
|
12
|
-
isConnecting?: boolean;
|
|
13
|
-
isDisconnecting?: boolean;
|
|
14
|
-
isInitialized?: boolean;
|
|
15
|
-
isInitializing?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare abstract class EthereumConnector extends AbstractStore<EthereumConnectorData, EthereumConnectorState> {
|
|
18
|
-
protected readonly params?: Readonly<EthereumConnectorCtorParams> | undefined;
|
|
19
|
-
readonly type?: EthereumConnectionType;
|
|
20
|
-
/**
|
|
21
|
-
* An
|
|
22
|
-
* EIP-1193 ({@link https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md}) and
|
|
23
|
-
* EIP-1102 ({@link https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1102.md}) compliant provider.
|
|
24
|
-
* May also comply with EIP-3085 ({@link https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3085.md}).
|
|
25
|
-
* This property must be defined while the connector is active.
|
|
26
|
-
*/
|
|
27
|
-
provider?: SupportedProviders<EthExecutionAPI>;
|
|
28
|
-
protected constructor(params?: Readonly<EthereumConnectorCtorParams> | undefined);
|
|
29
|
-
abstract connect(...args: unknown[]): Promise<void>;
|
|
30
|
-
abstract disconnect(...args: unknown[]): Promise<void>;
|
|
31
|
-
addNetwork(chainParams: AddEthereumChainParams): Promise<void>;
|
|
32
|
-
switchNetwork(chainIdOrParams: number | AddEthereumChainParams): Promise<void>;
|
|
33
|
-
watchAsset(params: WatchAssetParameters): Promise<true>;
|
|
34
|
-
get accounts(): EthereumConnectorData['accounts'];
|
|
35
|
-
get chainId(): EthereumConnectorData['chainId'];
|
|
36
|
-
get isConnecting(): EthereumConnectorState['isConnecting'];
|
|
37
|
-
get isDisconnecting(): EthereumConnectorState['isDisconnecting'];
|
|
38
|
-
get isInitialized(): EthereumConnectorState['isInitialized'];
|
|
39
|
-
get isInitializing(): EthereumConnectorState['isInitializing'];
|
|
40
|
-
protected handleAccountsChanged(accounts: string[]): void;
|
|
41
|
-
protected handleChainChanged(chainId: string): void;
|
|
42
|
-
protected handleDisconnect(err: ProviderRpcError): void;
|
|
43
|
-
}
|
package/dist/esm/core/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core/EthereumConnector';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type EIP6963ProviderDetail } from 'web3/lib/commonjs/web3_eip6963';
|
|
2
|
-
export declare const store: {
|
|
3
|
-
readonly subscribe: (callback: () => void) => () => void;
|
|
4
|
-
readonly value: () => EIP6963ProviderDetail<unknown>[];
|
|
5
|
-
};
|
|
6
|
-
export declare function useEIP6963Connections(): EIP6963ProviderDetail[];
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { EthereumConnectionType } from '../types';
|
|
2
|
-
export interface RecentConnectionMeta {
|
|
3
|
-
chainId?: string;
|
|
4
|
-
disconnected?: boolean;
|
|
5
|
-
providerId: string;
|
|
6
|
-
type?: EthereumConnectionType;
|
|
7
|
-
}
|
|
8
|
-
export declare function storeRecentConnectionMeta(meta: RecentConnectionMeta | undefined): void;
|
|
9
|
-
export declare function getRecentConnectionMeta(): RecentConnectionMeta | undefined;
|
|
10
|
-
type UseRecentConnectionMeta = [
|
|
11
|
-
value: RecentConnectionMeta | undefined,
|
|
12
|
-
setValue: (meta: RecentConnectionMeta | undefined) => void
|
|
13
|
-
];
|
|
14
|
-
export declare function useRecentConnectionMeta(): UseRecentConnectionMeta;
|
|
15
|
-
export {};
|
package/dist/esm/index.d.ts
DELETED
package/dist/esm/intl/index.d.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
EVM_CONNECT_AGREEMENTS_NOTE: {
|
|
3
|
-
defaultMessage: string;
|
|
4
|
-
id: string;
|
|
5
|
-
};
|
|
6
|
-
EVM_CONNECT_NOT_CONNECTED_HINT: {
|
|
7
|
-
defaultMessage: string;
|
|
8
|
-
id: string;
|
|
9
|
-
};
|
|
10
|
-
EVM_CONNECT_INITIALIZING_HINT: {
|
|
11
|
-
defaultMessage: string;
|
|
12
|
-
id: string;
|
|
13
|
-
};
|
|
14
|
-
EVM_CONNECT_CONNECT_BTN_TEXT: {
|
|
15
|
-
defaultMessage: string;
|
|
16
|
-
id: string;
|
|
17
|
-
};
|
|
18
|
-
EVM_CONNECT_DISCONNECT_BTN_TEXT: {
|
|
19
|
-
defaultMessage: string;
|
|
20
|
-
id: string;
|
|
21
|
-
};
|
|
22
|
-
EVM_CONNECT_CHANGE_WALLET_BTN_TEXT: {
|
|
23
|
-
defaultMessage: string;
|
|
24
|
-
id: string;
|
|
25
|
-
};
|
|
26
|
-
EVM_CONNECT_UNSUPPORTED_NETWORK_WARNING: {
|
|
27
|
-
defaultMessage: string;
|
|
28
|
-
id: string;
|
|
29
|
-
};
|
|
30
|
-
EVM_CONNECT_CONNECTOR_BLOCKCHAIN_NAME: {
|
|
31
|
-
defaultMessage: string;
|
|
32
|
-
id: string;
|
|
33
|
-
};
|
|
34
|
-
EVM_CONNECT_CONNECTOR_EXPLORER_HINT: {
|
|
35
|
-
defaultMessage: string;
|
|
36
|
-
id: string;
|
|
37
|
-
};
|
|
38
|
-
EVM_CONNECT_INSTALL_PROVIDER: {
|
|
39
|
-
defaultMessage: string;
|
|
40
|
-
id: string;
|
|
41
|
-
};
|
|
42
|
-
EVM_CONNECT_INSTALL_ANDROID_PLATFORM: {
|
|
43
|
-
defaultMessage: string;
|
|
44
|
-
id: string;
|
|
45
|
-
};
|
|
46
|
-
EVM_CONNECT_INSTALL_IOS_PLATFORM: {
|
|
47
|
-
defaultMessage: string;
|
|
48
|
-
id: string;
|
|
49
|
-
};
|
|
50
|
-
EVM_CONNECT_INSTALL_CHROME_EXTENSION_PLATFORM: {
|
|
51
|
-
defaultMessage: string;
|
|
52
|
-
id: string;
|
|
53
|
-
};
|
|
54
|
-
EVM_CONNECT_INSTALL_FIREFOX_EXTENSION_PLATFORM: {
|
|
55
|
-
defaultMessage: string;
|
|
56
|
-
id: string;
|
|
57
|
-
};
|
|
58
|
-
EVM_CONNECT_INSTALL_SAFARI_EXTENSION_PLATFORM: {
|
|
59
|
-
defaultMessage: string;
|
|
60
|
-
id: string;
|
|
61
|
-
};
|
|
62
|
-
EVM_CONNECT_INSTALL_UNKNOWN_PLATFORM: {
|
|
63
|
-
defaultMessage: string;
|
|
64
|
-
id: string;
|
|
65
|
-
};
|
|
66
|
-
EVM_CONNECT_DISPATCHER_POPUP_TITLE: {
|
|
67
|
-
defaultMessage: string;
|
|
68
|
-
id: string;
|
|
69
|
-
};
|
|
70
|
-
EVM_CONNECT_DISPATCHER_POPUP_NOTE: {
|
|
71
|
-
defaultMessage: string;
|
|
72
|
-
id: string;
|
|
73
|
-
};
|
|
74
|
-
EVM_CONNECT_DISPATCHER_POPUP_REQUEST_TITLE: {
|
|
75
|
-
defaultMessage: string;
|
|
76
|
-
id: string;
|
|
77
|
-
};
|
|
78
|
-
EVM_CONNECT_DISPATCHER_POPUP_REQUEST_NOTE: {
|
|
79
|
-
defaultMessage: string;
|
|
80
|
-
id: string;
|
|
81
|
-
};
|
|
82
|
-
EVM_CONNECT_DISPATCHER_POPUP_REQUEST_FAILED_TITLE: {
|
|
83
|
-
defaultMessage: string;
|
|
84
|
-
id: string;
|
|
85
|
-
};
|
|
86
|
-
EVM_CONNECT_DISPATCHER_POPUP_REQUEST_FAILED_NOTE: {
|
|
87
|
-
defaultMessage: string;
|
|
88
|
-
id: string;
|
|
89
|
-
};
|
|
90
|
-
EVM_CONNECT_DISPATCHER_POPUP_REQUEST_TRY_AGAIN_BTN_TEXT: {
|
|
91
|
-
defaultMessage: string;
|
|
92
|
-
id: string;
|
|
93
|
-
};
|
|
94
|
-
EVM_CONNECT_DISPATCHER_POPUP_CONNECTED_HINT: {
|
|
95
|
-
defaultMessage: string;
|
|
96
|
-
id: string;
|
|
97
|
-
};
|
|
98
|
-
EVM_CONNECT_DISPATCHER_POPUP_RECENT_HINT: {
|
|
99
|
-
defaultMessage: string;
|
|
100
|
-
id: string;
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
export default _default;
|
package/dist/esm/main.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/esm/main.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './main.scss';
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { AbstractStore, type NativeCurrency } from '@broxus/js-core';
|
|
2
|
-
import { type IReactionDisposer } from 'mobx';
|
|
3
|
-
import Web3 from 'web3';
|
|
4
|
-
import { type EthereumConnector } from '../core';
|
|
5
|
-
import { type AddEthereumChainParams, type EvmNetworkConfig, type EvmWalletProviderConfig, type WatchAssetParameters } from '../types';
|
|
6
|
-
export interface EvmWalletServiceCtorParams {
|
|
7
|
-
autoInit?: boolean;
|
|
8
|
-
defaultNetworkId?: number;
|
|
9
|
-
/**
|
|
10
|
-
* List of supported networks
|
|
11
|
-
*/
|
|
12
|
-
networks?: Readonly<EvmNetworkConfig[]>;
|
|
13
|
-
providerId?: string;
|
|
14
|
-
/**
|
|
15
|
-
* List of supported Providers
|
|
16
|
-
*/
|
|
17
|
-
providers?: Readonly<EvmWalletProviderConfig[]>;
|
|
18
|
-
}
|
|
19
|
-
export interface EvmWalletServiceData {
|
|
20
|
-
balance?: string;
|
|
21
|
-
networks: Readonly<EvmNetworkConfig[]>;
|
|
22
|
-
}
|
|
23
|
-
export interface EvmWalletServiceState {
|
|
24
|
-
isSyncing?: boolean;
|
|
25
|
-
providerId?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare class EvmWalletService extends AbstractStore<EvmWalletServiceData, EvmWalletServiceState> {
|
|
28
|
-
protected readonly params?: Readonly<EvmWalletServiceCtorParams> | undefined;
|
|
29
|
-
constructor(params?: Readonly<EvmWalletServiceCtorParams> | undefined);
|
|
30
|
-
/**
|
|
31
|
-
* Define current provider connector
|
|
32
|
-
* @returns {EthereumConnector|undefined}
|
|
33
|
-
*/
|
|
34
|
-
get connector(): EthereumConnector | undefined;
|
|
35
|
-
init(): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Manually connect to the wallet
|
|
38
|
-
* @returns {Promise<void>}
|
|
39
|
-
*/
|
|
40
|
-
connect(chainIdOrParams?: number | AddEthereumChainParams): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Manually disconnect from the wallet
|
|
43
|
-
* @returns {Promise<void>}
|
|
44
|
-
*/
|
|
45
|
-
disconnect(force?: boolean): Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Add network to the current connected wallet
|
|
48
|
-
* @param {AddEthereumChainParams} chainParams
|
|
49
|
-
* @returns {Promise<void>}
|
|
50
|
-
*/
|
|
51
|
-
addNetwork(chainParams: AddEthereumChainParams): Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* Switch network or add a new one if not exists in the current connected wallet
|
|
54
|
-
* @param {number|AddEthereumChainParams} chainIdOrParams
|
|
55
|
-
* @returns {Promise<void>}
|
|
56
|
-
*/
|
|
57
|
-
switchNetwork(chainIdOrParams: number | AddEthereumChainParams): Promise<void>;
|
|
58
|
-
/**
|
|
59
|
-
* Request to the wallet for watch asset
|
|
60
|
-
* @param {WatchAssetParameters} params
|
|
61
|
-
* @returns {Promise<true | undefined>}
|
|
62
|
-
*/
|
|
63
|
-
watchAsset(params: WatchAssetParameters): Promise<true | undefined>;
|
|
64
|
-
/**
|
|
65
|
-
* An independent RPC connection that allows you to receive data from the blockchain without being
|
|
66
|
-
* able to send transactions.
|
|
67
|
-
*
|
|
68
|
-
* This connection does not require connection permissions and wrapped on `Web3` interface.
|
|
69
|
-
* @returns {Web3|undefined}
|
|
70
|
-
*/
|
|
71
|
-
get connection(): Web3 | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* Returns current Web3 Instance
|
|
74
|
-
*/
|
|
75
|
-
get provider(): Web3 | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Returns computed wallet balance value
|
|
78
|
-
* @returns {EvmWalletServiceData["balance"]}
|
|
79
|
-
*/
|
|
80
|
-
get balance(): EvmWalletServiceData['balance'];
|
|
81
|
-
/**
|
|
82
|
-
* List of the supported networks
|
|
83
|
-
* @returns {EvmWalletServiceData["networks"]}
|
|
84
|
-
*/
|
|
85
|
-
get networks(): EvmWalletServiceData['networks'];
|
|
86
|
-
/**
|
|
87
|
-
* Returns `true` if wallet contract is updating
|
|
88
|
-
* @returns {EvmWalletServiceState["isSyncing"]}
|
|
89
|
-
*/
|
|
90
|
-
get isSyncing(): EvmWalletServiceState['isSyncing'];
|
|
91
|
-
/**
|
|
92
|
-
A unique identifier of the connected wallet (provider)
|
|
93
|
-
* @returns {EvmWalletServiceState["providerId"]}
|
|
94
|
-
*/
|
|
95
|
-
get providerId(): EvmWalletServiceState['providerId'];
|
|
96
|
-
/**
|
|
97
|
-
* Returns computed wallet address value
|
|
98
|
-
* @returns {string|undefined}
|
|
99
|
-
*/
|
|
100
|
-
get address(): string | undefined;
|
|
101
|
-
/**
|
|
102
|
-
* Returns wallet native currency
|
|
103
|
-
* @returns {Readonly<NativeCurrency<string>>}
|
|
104
|
-
*/
|
|
105
|
-
get currency(): Readonly<NativeCurrency<string>>;
|
|
106
|
-
/**
|
|
107
|
-
* Returns `true` if provider is available.
|
|
108
|
-
* That means extension is installed and activated, else `false`
|
|
109
|
-
* @returns {boolean}
|
|
110
|
-
*/
|
|
111
|
-
get hasProvider(): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Returns `true` if wallet is connected
|
|
114
|
-
* @returns {boolean}
|
|
115
|
-
*/
|
|
116
|
-
get isConnected(): boolean;
|
|
117
|
-
/**
|
|
118
|
-
* Returns `true` if wallet is initialized and connected
|
|
119
|
-
* @returns {boolean}
|
|
120
|
-
*/
|
|
121
|
-
get isReady(): boolean;
|
|
122
|
-
/**
|
|
123
|
-
* Checks network support
|
|
124
|
-
* @returns {boolean}
|
|
125
|
-
*/
|
|
126
|
-
get isUnsupportedNetwork(): boolean;
|
|
127
|
-
/**
|
|
128
|
-
* Returns current network config
|
|
129
|
-
* @returns {Readonly<EvmNetworkConfig|undefined>}
|
|
130
|
-
*/
|
|
131
|
-
get network(): Readonly<EvmNetworkConfig | undefined>;
|
|
132
|
-
/**
|
|
133
|
-
Returns details about current connected provider
|
|
134
|
-
* @returns {EvmWalletProviderConfig["info"]|undefined}
|
|
135
|
-
*/
|
|
136
|
-
get providerInfo(): EvmWalletProviderConfig['info'] | undefined;
|
|
137
|
-
/**
|
|
138
|
-
* The list of the supported providers
|
|
139
|
-
* @returns {Readonly<EvmWalletProviderConfig[]|undefined>}
|
|
140
|
-
*/
|
|
141
|
-
get providers(): Readonly<EvmWalletProviderConfig[] | undefined>;
|
|
142
|
-
/**
|
|
143
|
-
* Returns current network chain id
|
|
144
|
-
* @returns {EthereumConnector["chainId"]}
|
|
145
|
-
*/
|
|
146
|
-
get chainId(): EthereumConnector['chainId'];
|
|
147
|
-
/**
|
|
148
|
-
* Returns `true` if wallet is connecting
|
|
149
|
-
* @returns {EthereumConnector["isConnecting"]}
|
|
150
|
-
*/
|
|
151
|
-
get isConnecting(): EthereumConnector['isConnecting'];
|
|
152
|
-
/**
|
|
153
|
-
* Returns `true` if wallet is disconnecting
|
|
154
|
-
* @returns {EthereumConnector["isDisconnecting"]}
|
|
155
|
-
*/
|
|
156
|
-
get isDisconnecting(): EthereumConnector['isDisconnecting'];
|
|
157
|
-
/**
|
|
158
|
-
* Returns `true` if wallet is initialized
|
|
159
|
-
* @returns {EthereumConnector["isInitialized"]}
|
|
160
|
-
*/
|
|
161
|
-
get isInitialized(): EthereumConnector['isInitialized'];
|
|
162
|
-
/**
|
|
163
|
-
* Returns `true` if wallet is initializing
|
|
164
|
-
* @returns {EthereumConnector["isInitializing"]}
|
|
165
|
-
*/
|
|
166
|
-
get isInitializing(): EthereumConnector['isInitializing'];
|
|
167
|
-
/**
|
|
168
|
-
* Sync account balance
|
|
169
|
-
*/
|
|
170
|
-
protected syncBalance(): Promise<void>;
|
|
171
|
-
/**
|
|
172
|
-
* Trying to resolve EVM Wallet connection
|
|
173
|
-
* @protected
|
|
174
|
-
*/
|
|
175
|
-
protected _init(): Promise<void>;
|
|
176
|
-
protected accountDisposer: IReactionDisposer | undefined;
|
|
177
|
-
protected networkDisposer: IReactionDisposer | undefined;
|
|
178
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../services/EvmWalletService';
|