@ledgerhq/connect-kit 1.1.0-beta.0 → 1.1.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/dist/umd/components/ExtensionInstallModal/ExtensionInstallModal.d.ts +4 -0
  3. package/dist/umd/components/ExtensionInstallModal/index.d.ts +1 -0
  4. package/dist/umd/components/Modal/Modal.d.ts +1 -1
  5. package/dist/umd/components/UseLedgerLiveModal/UseLedgerLiveModal.d.ts +8 -0
  6. package/dist/umd/components/UseLedgerLiveModal/index.d.ts +1 -0
  7. package/dist/umd/components/index.d.ts +2 -2
  8. package/dist/umd/index.d.ts +34 -5
  9. package/dist/umd/index.js +307 -41
  10. package/dist/umd/index.js.map +1 -1
  11. package/dist/umd/lib/errors.d.ts +5 -3
  12. package/dist/umd/lib/modal.d.ts +14 -4
  13. package/dist/umd/lib/provider.d.ts +11 -8
  14. package/dist/umd/lib/support.d.ts +9 -13
  15. package/dist/umd/lib/supportOptions.d.ts +40 -0
  16. package/dist/umd/providers/ExtensionEvm.d.ts +46 -0
  17. package/dist/umd/providers/{Solana.d.ts → ExtensionSolana.d.ts} +6 -3
  18. package/dist/umd/providers/WalletConnectEvm.d.ts +13 -0
  19. package/dist/umd/providers/WalletConnectLegacy.d.ts +7 -0
  20. package/dist/umd/support/EthereumProvider/EthereumProvider.d.ts +126 -0
  21. package/dist/umd/support/EthereumProvider/constants/index.d.ts +2 -0
  22. package/dist/umd/support/EthereumProvider/constants/rpc.d.ts +4 -0
  23. package/dist/umd/support/EthereumProvider/constants/values.d.ts +5 -0
  24. package/dist/umd/support/EthereumProvider/types.d.ts +57 -0
  25. package/package.json +20 -13
  26. package/dist/umd/components/ConnectWithLedgerLiveModal/ConnectWithLedgerLiveModal.d.ts +0 -7
  27. package/dist/umd/components/ConnectWithLedgerLiveModal/index.d.ts +0 -1
  28. package/dist/umd/components/ExtensionUnavailableModal/ExtensionUnavailableModal.d.ts +0 -4
  29. package/dist/umd/components/ExtensionUnavailableModal/index.d.ts +0 -1
  30. package/dist/umd/lib/connectSupport.d.ts +0 -2
  31. package/dist/umd/providers/Ethereum.d.ts +0 -21
  32. package/dist/umd/providers/TryConnectEthereum.d.ts +0 -7
  33. package/dist/umd/providers/WalletConnect.d.ts +0 -13
  34. /package/dist/umd/components/{ExtensionUnavailableModal/ExtensionUnavailableModal.styles.d.ts → ExtensionInstallModal/ExtensionInstallModal.styles.d.ts} +0 -0
  35. /package/dist/umd/components/{ConnectWithLedgerLiveModal/ConnectWithLedgerLiveModal.styles.d.ts → UseLedgerLiveModal/UseLedgerLiveModal.styles.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -7,7 +7,9 @@ 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.0 - 2023-06-16
10
+ ## 1.1.0-beta.1 - 2023-06-19
11
+ ### Added
12
+ - Support for WalletConnect v2.
11
13
 
12
14
  ## 1.0.16 - 2023-04-04
13
15
  ### Changed
@@ -0,0 +1,4 @@
1
+ import { ModalProps } from "../Modal/Modal";
2
+ export type ExtensionInstallModalProps = ModalProps;
3
+ declare const ExtensionInstallModal: ({ onClose, }: ExtensionInstallModalProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default ExtensionInstallModal;
@@ -0,0 +1 @@
1
+ export { default } from "./ExtensionInstallModal";
@@ -2,7 +2,7 @@ import { ReactElement } from "react";
2
2
  export declare let setIsModalOpen: (isModalOpen: boolean) => void;
3
3
  export interface ModalProps {
4
4
  isOpen?: boolean;
5
- onClose?: () => void;
5
+ onClose?: Function;
6
6
  children?: ReactElement | null;
7
7
  }
8
8
  export declare const Modal: ({ onClose, children }: ModalProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -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 ExtensionUnavailableModal } from "./ExtensionUnavailableModal";
2
- export { default as ConnectWithLedgerLiveModal } from "./ConnectWithLedgerLiveModal";
1
+ export { default as ExtensionInstallModal } from "./ExtensionInstallModal";
2
+ export { default as UseLedgerLiveModal } from "./UseLedgerLiveModal";
3
3
  export { default as PlatformNotSupportedModal } from "./PlatformNotSupportedModal";
@@ -1,22 +1,27 @@
1
+ import { CoreTypes } from '@walletconnect/types';
2
+
1
3
  type EthereumRequestPayload = {
2
4
  method: string;
3
- params?: unknown[] | object;
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 LEDGER_CONNECT_SOLANA_PROP = "isLedgerConnect";
22
+ declare const EXTENSION_SOLANA_PROP = "isLedgerConnect";
18
23
  interface SolanaProvider {
19
- [LEDGER_CONNECT_SOLANA_PROP]: boolean;
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 CheckSupportOptions = {
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;