@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 CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 1.0.1 - 2022-12-02
11
+ ### Changed
12
+ - Don't open a blank tab when pressing the User Ledger Live deeplink.
13
+ - Correctly detect the Brave browser on iOS.
14
+ - Patch the provider's request method to handle the Connect With Ledger Live
15
+ modal in the `eth_requestAccounts` method, allowing us to reject with the
16
+ "user rejected connection" error when the modal is closed.
17
+
18
+ ## 1.0.0 - 2022-11-17
19
+ ### Changed
20
+ - Promoted to 1.0.
21
+
10
22
  ## 1.0.0-beta.4-5 - 2022-11-01
11
23
  ### Changed
12
24
  - Release workflow changes.
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  export declare let setWalletConnectUri: (uri: string) => void;
3
- export declare type ConnectWithLedgerLiveModalProps = {
3
+ export type ConnectWithLedgerLiveModalProps = {
4
4
  withQrCode?: boolean;
5
+ onClose?: () => void;
5
6
  };
6
- declare const ConnectWithLedgerLiveModal: ({ withQrCode }: ConnectWithLedgerLiveModalProps) => JSX.Element;
7
+ declare const ConnectWithLedgerLiveModal: ({ withQrCode, onClose, }: ConnectWithLedgerLiveModalProps) => JSX.Element;
7
8
  export default ConnectWithLedgerLiveModal;
@@ -2,7 +2,8 @@ import { ReactElement } from "react";
2
2
  export declare let setIsModalOpen: (isModalOpen: boolean) => void;
3
3
  interface ModalProps {
4
4
  isOpen?: boolean;
5
+ onClose?: () => void;
5
6
  children: ReactElement | null;
6
7
  }
7
- export declare const Modal: ({ children }: ModalProps) => JSX.Element | null;
8
+ export declare const Modal: ({ onClose, children }: ModalProps) => JSX.Element | null;
8
9
  export default Modal;
@@ -6,7 +6,7 @@ export declare const ModalSection: import("styled-components").StyledComponent<"
6
6
  export declare const ModalTitle: import("styled-components").StyledComponent<"h2", any, {}, never>;
7
7
  export declare const ModalSubtitle: import("styled-components").StyledComponent<"h3", any, {}, never>;
8
8
  export declare const ModalText: import("styled-components").StyledComponent<"p", any, {}, never>;
9
- export declare type VariantOptions = {
9
+ export type VariantOptions = {
10
10
  variant?: string;
11
11
  };
12
12
  export declare const ModalButton: import("styled-components").StyledComponent<"button", any, {
@@ -1,14 +1,18 @@
1
1
  import WalletConnectProvider from '@walletconnect/ethereum-provider/dist/esm';
2
2
 
3
+ type EthereumRequestPayload = {
4
+ method: string;
5
+ params?: unknown[] | object;
6
+ };
3
7
  interface EthereumProvider {
4
8
  providers?: EthereumProvider[];
5
- request(...args: unknown[]): Promise<unknown>;
9
+ request(payload: EthereumRequestPayload): Promise<unknown>;
6
10
  disconnect?: {
7
11
  (): Promise<void>;
8
12
  };
9
13
  emit(eventName: string | symbol, ...args: any[]): boolean;
10
- on(...args: unknown[]): void;
11
- removeListener(...args: unknown[]): void;
14
+ on(event: any, listener: any): void;
15
+ removeListener(event: string, listener: any): void;
12
16
  }
13
17
 
14
18
  declare const LEDGER_CONNECT_SOLANA_PROP = "isLedgerConnect";
@@ -29,10 +33,10 @@ declare enum SupportedProviderImplementations {
29
33
  LedgerConnect = "LedgerConnect",
30
34
  WalletConnect = "WalletConnect"
31
35
  }
32
- declare type ProviderResult = EthereumProvider | SolanaProvider | WalletConnectProvider;
36
+ type ProviderResult = EthereumProvider | SolanaProvider | WalletConnectProvider;
33
37
  declare function getProvider(): Promise<ProviderResult>;
34
38
 
35
- declare type CheckSupportOptions = {
39
+ type CheckSupportOptions = {
36
40
  providerType: SupportedProviders;
37
41
  chainId?: number;
38
42
  bridge?: string;
@@ -41,7 +45,7 @@ declare type CheckSupportOptions = {
41
45
  [chainId: number]: string;
42
46
  };
43
47
  };
44
- declare type CheckSupportResult = {
48
+ type CheckSupportResult = {
45
49
  isLedgerConnectSupported?: boolean;
46
50
  isLedgerConnectEnabled?: boolean;
47
51
  isChainIdSupported?: boolean;