@ledgerhq/connect-kit 1.0.16 → 1.1.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +4 -0
- package/dist/umd/components/ExtensionInstallModal/ExtensionInstallModal.d.ts +4 -0
- package/dist/umd/components/ExtensionInstallModal/index.d.ts +1 -0
- package/dist/umd/components/Modal/Modal.d.ts +2 -2
- package/dist/umd/components/PlatformNotSupportedModal/PlatformNotSupportedModal.d.ts +1 -2
- package/dist/umd/components/UseLedgerLiveModal/UseLedgerLiveModal.d.ts +8 -0
- package/dist/umd/components/UseLedgerLiveModal/index.d.ts +1 -0
- package/dist/umd/components/index.d.ts +2 -2
- package/dist/umd/index.d.ts +34 -5
- package/dist/umd/index.js +307 -41
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/lib/errors.d.ts +5 -3
- package/dist/umd/lib/modal.d.ts +14 -4
- package/dist/umd/lib/provider.d.ts +11 -8
- package/dist/umd/lib/support.d.ts +9 -13
- package/dist/umd/lib/supportOptions.d.ts +40 -0
- package/dist/umd/providers/ExtensionEvm.d.ts +46 -0
- package/dist/umd/providers/{Solana.d.ts → ExtensionSolana.d.ts} +6 -3
- package/dist/umd/providers/WalletConnectEvm.d.ts +13 -0
- package/dist/umd/providers/WalletConnectLegacy.d.ts +7 -0
- package/dist/umd/support/EthereumProvider/EthereumProvider.d.ts +126 -0
- package/dist/umd/support/EthereumProvider/constants/index.d.ts +2 -0
- package/dist/umd/support/EthereumProvider/constants/rpc.d.ts +4 -0
- package/dist/umd/support/EthereumProvider/constants/values.d.ts +5 -0
- package/dist/umd/support/EthereumProvider/types.d.ts +57 -0
- package/package.json +20 -13
- package/dist/umd/components/ConnectWithLedgerLiveModal/ConnectWithLedgerLiveModal.d.ts +0 -8
- package/dist/umd/components/ConnectWithLedgerLiveModal/index.d.ts +0 -1
- package/dist/umd/components/ExtensionUnavailableModal/ExtensionUnavailableModal.d.ts +0 -5
- package/dist/umd/components/ExtensionUnavailableModal/index.d.ts +0 -1
- package/dist/umd/lib/connectSupport.d.ts +0 -2
- package/dist/umd/providers/Ethereum.d.ts +0 -21
- package/dist/umd/providers/TryConnectEthereum.d.ts +0 -7
- package/dist/umd/providers/WalletConnect.d.ts +0 -13
- /package/dist/umd/components/{ExtensionUnavailableModal/ExtensionUnavailableModal.styles.d.ts → ExtensionInstallModal/ExtensionInstallModal.styles.d.ts} +0 -0
- /package/dist/umd/components/{ConnectWithLedgerLiveModal/ConnectWithLedgerLiveModal.styles.d.ts → UseLedgerLiveModal/UseLedgerLiveModal.styles.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## Unreleased
|
9
9
|
|
10
|
+
## 1.1.0-beta.1 - 2023-06-19
|
11
|
+
### Added
|
12
|
+
- Support for WalletConnect v2.
|
13
|
+
|
10
14
|
## 1.0.16 - 2023-04-04
|
11
15
|
### Changed
|
12
16
|
- Add campaign params to App Store link.
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "./ExtensionInstallModal";
|
@@ -2,8 +2,8 @@ import { ReactElement } from "react";
|
|
2
2
|
export declare let setIsModalOpen: (isModalOpen: boolean) => void;
|
3
3
|
export interface ModalProps {
|
4
4
|
isOpen?: boolean;
|
5
|
-
onClose?:
|
5
|
+
onClose?: Function;
|
6
6
|
children?: ReactElement | null;
|
7
7
|
}
|
8
|
-
export declare const Modal: ({ onClose, children }: ModalProps) => JSX.Element | null;
|
8
|
+
export declare const Modal: ({ onClose, children }: ModalProps) => import("react/jsx-runtime").JSX.Element | null;
|
9
9
|
export default Modal;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ModalProps } from "../Modal/Modal";
|
2
|
+
export declare let setWalletConnectUri: (uri: string) => void;
|
3
|
+
export type UseLedgerLiveModalProps = {
|
4
|
+
isDesktop?: boolean;
|
5
|
+
uri?: string;
|
6
|
+
} & ModalProps;
|
7
|
+
declare const UseLedgerLiveModal: ({ isDesktop, uri, onClose, }: UseLedgerLiveModalProps) => import("react/jsx-runtime").JSX.Element;
|
8
|
+
export default UseLedgerLiveModal;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "./UseLedgerLiveModal";
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export { default as
|
2
|
-
export { default as
|
1
|
+
export { default as ExtensionInstallModal } from "./ExtensionInstallModal";
|
2
|
+
export { default as UseLedgerLiveModal } from "./UseLedgerLiveModal";
|
3
3
|
export { default as PlatformNotSupportedModal } from "./PlatformNotSupportedModal";
|
package/dist/umd/index.d.ts
CHANGED
@@ -1,22 +1,27 @@
|
|
1
|
+
import { CoreTypes } from '@walletconnect/types';
|
2
|
+
|
1
3
|
type EthereumRequestPayload = {
|
2
4
|
method: string;
|
3
|
-
params?: unknown[] |
|
5
|
+
params?: unknown[] | Record<string, unknown> | undefined;
|
4
6
|
};
|
7
|
+
/**
|
8
|
+
* A common interface for all the returned providers.
|
9
|
+
*/
|
5
10
|
interface EthereumProvider {
|
6
11
|
providers?: EthereumProvider[];
|
7
12
|
connector?: unknown;
|
13
|
+
session?: unknown;
|
8
14
|
request<T = unknown>(args: EthereumRequestPayload): Promise<T>;
|
9
15
|
disconnect?: {
|
10
16
|
(): Promise<void>;
|
11
17
|
};
|
12
|
-
emit(eventName: string | symbol, ...args: any[]): boolean;
|
13
18
|
on(event: any, listener: any): void;
|
14
19
|
removeListener(event: string, listener: any): void;
|
15
20
|
}
|
16
21
|
|
17
|
-
declare const
|
22
|
+
declare const EXTENSION_SOLANA_PROP = "isLedgerConnect";
|
18
23
|
interface SolanaProvider {
|
19
|
-
[
|
24
|
+
[EXTENSION_SOLANA_PROP]: boolean;
|
20
25
|
signTransaction(...args: unknown[]): Promise<unknown>;
|
21
26
|
signAllTransactions(...args: unknown[]): Promise<unknown>;
|
22
27
|
signAndSendTransaction(...args: unknown[]): Promise<unknown>;
|
@@ -33,10 +38,29 @@ declare enum SupportedProviderImplementations {
|
|
33
38
|
WalletConnect = "WalletConnect"
|
34
39
|
}
|
35
40
|
type ProviderResult = EthereumProvider | SolanaProvider;
|
41
|
+
/**
|
42
|
+
* Gets a provider instance based on the implementation set earlier.
|
43
|
+
*/
|
36
44
|
declare function getProvider(): Promise<ProviderResult>;
|
37
45
|
|
38
|
-
type
|
46
|
+
type CheckSupportCommonOptions = {
|
47
|
+
version?: number;
|
39
48
|
providerType: SupportedProviders;
|
49
|
+
};
|
50
|
+
type CheckSupportWalletConnectProviderOptions = {
|
51
|
+
projectId?: string;
|
52
|
+
chains?: number[];
|
53
|
+
optionalChains?: number[];
|
54
|
+
methods?: string[];
|
55
|
+
optionalMethods?: string[];
|
56
|
+
events?: string[];
|
57
|
+
optionalEvents?: string[];
|
58
|
+
rpcMap?: {
|
59
|
+
[chainId: string]: string;
|
60
|
+
};
|
61
|
+
metadata?: CoreTypes.Metadata;
|
62
|
+
};
|
63
|
+
type CheckSupportWalletConnectLegacyProviderOptions = {
|
40
64
|
chainId?: number;
|
41
65
|
bridge?: string;
|
42
66
|
infuraId?: string;
|
@@ -44,12 +68,17 @@ type CheckSupportOptions = {
|
|
44
68
|
[chainId: number]: string;
|
45
69
|
};
|
46
70
|
};
|
71
|
+
type CheckSupportOptions = CheckSupportCommonOptions & CheckSupportWalletConnectProviderOptions & CheckSupportWalletConnectLegacyProviderOptions;
|
72
|
+
|
47
73
|
type CheckSupportResult = {
|
48
74
|
isLedgerConnectSupported?: boolean;
|
49
75
|
isLedgerConnectEnabled?: boolean;
|
50
76
|
isChainIdSupported?: boolean;
|
51
77
|
providerImplementation: SupportedProviderImplementations;
|
52
78
|
};
|
79
|
+
/**
|
80
|
+
* Check support for user's platform.
|
81
|
+
*/
|
53
82
|
declare function checkSupport(options: CheckSupportOptions): CheckSupportResult;
|
54
83
|
|
55
84
|
declare const enableDebugLogs: () => void;
|