@ledgerhq/connect-kit 1.0.0-beta.8 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +12 -0
- package/dist/umd/components/ConnectWithLedgerLiveModal/ConnectWithLedgerLiveModal.d.ts +3 -2
- package/dist/umd/components/Modal/Modal.d.ts +2 -1
- package/dist/umd/components/Modal/Modal.styles.d.ts +1 -1
- package/dist/umd/index.d.ts +10 -6
- package/dist/umd/index.js +6 -6
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/lib/browser.d.ts +1 -1
- package/dist/umd/lib/errors.d.ts +5 -0
- package/dist/umd/lib/logger.d.ts +1 -1
- package/dist/umd/lib/modal.d.ts +1 -1
- package/dist/umd/lib/provider.d.ts +1 -2
- package/dist/umd/lib/support.d.ts +3 -3
- package/dist/umd/providers/Ethereum.d.ts +7 -3
- package/package.json +1 -1
@@ -7,7 +7,7 @@ declare type DeviceBrowser = {
|
|
7
7
|
version: string;
|
8
8
|
};
|
9
9
|
declare type DeviceOSName = "Windows Phone" | "Windows" | "macOS" | "iOS" | "Android" | "Linux" | "Chrome OS";
|
10
|
-
declare type DeviceBrowserName = "Android Browser" | "Chrome" | "Chromium" | "Firefox" | "Microsoft Edge" | "Opera" | "Safari";
|
10
|
+
declare type DeviceBrowserName = "Android Browser" | "Chrome" | "Chromium" | "Firefox" | "Microsoft Edge" | "Opera" | "Brave" | "Safari";
|
11
11
|
declare type DeviceType = "desktop" | "mobile" | "tablet";
|
12
12
|
export declare type Device = {
|
13
13
|
os: DeviceOS;
|
package/dist/umd/lib/errors.d.ts
CHANGED
@@ -4,3 +4,8 @@ export declare class ProviderNotFoundError extends Error {
|
|
4
4
|
export declare class ProviderTypeIsNotSupportedError extends Error {
|
5
5
|
constructor();
|
6
6
|
}
|
7
|
+
export declare class UserRejectedRequestError extends Error {
|
8
|
+
name: string;
|
9
|
+
readonly code: number;
|
10
|
+
constructor();
|
11
|
+
}
|
package/dist/umd/lib/logger.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export
|
1
|
+
export type Logger = (message: string, ...others: unknown[]) => void;
|
2
2
|
export declare const getDebugLogger: (context: string) => Logger;
|
3
3
|
export declare const getErrorLogger: (context: string) => Logger;
|
4
4
|
export declare const enableDebugLogs: () => void;
|
package/dist/umd/lib/modal.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
import { ConnectWithLedgerLiveModalProps } from "../components/ConnectWithLedgerLiveModal/ConnectWithLedgerLiveModal";
|
2
|
-
|
2
|
+
type ModalType = 'ConnectWithLedgerLiveModal' | 'PlatformNotSupportedModal' | 'ExtensionUnavailableModal';
|
3
3
|
export declare function showModal(modalType: ModalType, props?: ConnectWithLedgerLiveModalProps): void;
|
4
4
|
export {};
|
@@ -4,7 +4,6 @@ import { SolanaProvider } from "../providers/Solana";
|
|
4
4
|
export declare enum ConnectSupportedChains {
|
5
5
|
EthereumMainnet = 1
|
6
6
|
}
|
7
|
-
export declare function setChainId(chainId: ConnectSupportedChains): void;
|
8
7
|
export declare function isChainIdSupported(chainId: ConnectSupportedChains): boolean;
|
9
8
|
export declare enum SupportedProviders {
|
10
9
|
Ethereum = "Ethereum",
|
@@ -14,7 +13,7 @@ export declare enum SupportedProviderImplementations {
|
|
14
13
|
LedgerConnect = "LedgerConnect",
|
15
14
|
WalletConnect = "WalletConnect"
|
16
15
|
}
|
17
|
-
export
|
16
|
+
export type ProviderResult = EthereumProvider | SolanaProvider | WalletConnectProvider;
|
18
17
|
export declare function setProviderType(providerType: SupportedProviders): void;
|
19
18
|
export declare function setProviderImplementation(providerImplementation: SupportedProviderImplementations): void;
|
20
19
|
export declare function getProvider(): Promise<ProviderResult>;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ConnectSupportedChains, SupportedProviders, SupportedProviderImplementations } from "./provider";
|
2
|
-
export
|
2
|
+
export type CheckSupportOptions = {
|
3
3
|
providerType: SupportedProviders;
|
4
4
|
chainId?: number;
|
5
5
|
bridge?: string;
|
@@ -8,13 +8,13 @@ export declare type CheckSupportOptions = {
|
|
8
8
|
[chainId: number]: string;
|
9
9
|
};
|
10
10
|
};
|
11
|
-
export
|
11
|
+
export type CheckSupportResult = {
|
12
12
|
isLedgerConnectSupported?: boolean;
|
13
13
|
isLedgerConnectEnabled?: boolean;
|
14
14
|
isChainIdSupported?: boolean;
|
15
15
|
providerImplementation: SupportedProviderImplementations;
|
16
16
|
};
|
17
17
|
export declare function checkSupport(options: CheckSupportOptions): CheckSupportResult;
|
18
|
-
export
|
18
|
+
export type CheckEthereumSupportOptions = CheckSupportOptions & {
|
19
19
|
chainId: ConnectSupportedChains;
|
20
20
|
};
|
@@ -1,15 +1,19 @@
|
|
1
1
|
import { ProviderResult } from "../lib/provider";
|
2
2
|
export declare const LEDGER_ETHEREUM_PROVIDER = "ethereum";
|
3
3
|
export declare const LEDGER_CONNECT_ETHEREUM_PROP = "isLedgerConnect";
|
4
|
+
export type EthereumRequestPayload = {
|
5
|
+
method: string;
|
6
|
+
params?: unknown[] | object;
|
7
|
+
};
|
4
8
|
export interface EthereumProvider {
|
5
9
|
providers?: EthereumProvider[];
|
6
|
-
request(
|
10
|
+
request(payload: EthereumRequestPayload): Promise<unknown>;
|
7
11
|
disconnect?: {
|
8
12
|
(): Promise<void>;
|
9
13
|
};
|
10
14
|
emit(eventName: string | symbol, ...args: any[]): boolean;
|
11
|
-
on(
|
12
|
-
removeListener(
|
15
|
+
on(event: any, listener: any): void;
|
16
|
+
removeListener(event: string, listener: any): void;
|
13
17
|
}
|
14
18
|
export interface LedgerConnectProvider extends EthereumProvider {
|
15
19
|
[LEDGER_CONNECT_ETHEREUM_PROP]: boolean;
|