@ledgerhq/connect-kit 1.0.0-beta.8 → 1.0.1

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.
@@ -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;
@@ -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
+ }
@@ -1,4 +1,4 @@
1
- export declare type Logger = (message: string, ...others: unknown[]) => void;
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;
@@ -1,4 +1,4 @@
1
1
  import { ConnectWithLedgerLiveModalProps } from "../components/ConnectWithLedgerLiveModal/ConnectWithLedgerLiveModal";
2
- declare type ModalType = 'ConnectWithLedgerLiveModal' | 'PlatformNotSupportedModal' | 'ExtensionUnavailableModal';
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 declare type ProviderResult = EthereumProvider | SolanaProvider | WalletConnectProvider;
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 declare type CheckSupportOptions = {
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 declare type CheckSupportResult = {
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 declare type CheckEthereumSupportOptions = CheckSupportOptions & {
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(...args: unknown[]): Promise<unknown>;
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(...args: unknown[]): void;
12
- removeListener(...args: unknown[]): void;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/connect-kit",
3
- "version": "1.0.0-beta.8",
3
+ "version": "1.0.1",
4
4
  "description": "A library for dapps to integrate with Ledger Connect and Ledger Live",
5
5
  "author": "Hugo Lopes",
6
6
  "license": "MIT",