@ledgerhq/connect-kit 1.1.0 → 1.1.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.
- package/CHANGELOG.md +13 -0
- package/dist/umd/hooks/useAnalytics.d.ts +11 -0
- package/dist/umd/index.d.ts +3 -11
- package/dist/umd/index.js +819 -45
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/lib/modal.d.ts +7 -0
- package/dist/umd/lib/provider.d.ts +5 -2
- package/dist/umd/lib/supportOptions.d.ts +1 -0
- package/dist/umd/providers/ExtensionEvm.d.ts +1 -1
- package/dist/umd/support/EthereumProvider/EthereumProvider.d.ts +5 -1
- package/package.json +10 -5
- package/dist/umd/providers/ExtensionSolana.d.ts +0 -15
package/dist/umd/lib/modal.d.ts
CHANGED
@@ -12,4 +12,11 @@ export declare function showExtensionOrLLModal(props: {
|
|
12
12
|
uri: string;
|
13
13
|
onClose: Function;
|
14
14
|
}): void;
|
15
|
+
/**
|
16
|
+
* Shows one of two modals depending on if the extension is supported or not.
|
17
|
+
*/
|
18
|
+
export declare function showLLModal(props: {
|
19
|
+
uri: string;
|
20
|
+
onClose: Function;
|
21
|
+
}): void;
|
15
22
|
export {};
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { EthereumProvider } from "../providers/ExtensionEvm";
|
2
|
-
import { SolanaProvider } from "../providers/ExtensionSolana";
|
3
2
|
export declare const DEFAULT_CHAIN_ID: number;
|
4
3
|
export declare const DEFAULT_REQUIRED_CHAINS: number[];
|
5
4
|
export declare const DEFAULT_WALLETCONNECT_VERSION: number;
|
@@ -11,7 +10,7 @@ export declare enum SupportedProviderImplementations {
|
|
11
10
|
LedgerConnect = "LedgerConnect",
|
12
11
|
WalletConnect = "WalletConnect"
|
13
12
|
}
|
14
|
-
export type ProviderResult = EthereumProvider
|
13
|
+
export type ProviderResult = EthereumProvider;
|
15
14
|
/**
|
16
15
|
* Sets the provider implementation to be used by getProvider.
|
17
16
|
*/
|
@@ -20,3 +19,7 @@ export declare function setProviderImplementation(providerImplementation: Suppor
|
|
20
19
|
* Gets a provider instance based on the implementation set earlier.
|
21
20
|
*/
|
22
21
|
export declare function getProvider(): Promise<ProviderResult>;
|
22
|
+
/**
|
23
|
+
* Gets the hex chainId from a number or string.
|
24
|
+
*/
|
25
|
+
export declare const getHexChainId: (chainId: string | number) => string;
|
@@ -28,6 +28,7 @@ export interface EthereumProvider {
|
|
28
28
|
providers?: EthereumProvider[];
|
29
29
|
connector?: unknown;
|
30
30
|
session?: unknown;
|
31
|
+
chainId: string | number;
|
31
32
|
request<T = unknown>(args: EthereumRequestPayload): Promise<T>;
|
32
33
|
disconnect?: {
|
33
34
|
(): Promise<void>;
|
@@ -37,7 +38,6 @@ export interface EthereumProvider {
|
|
37
38
|
}
|
38
39
|
export interface ExtensionEvmProvider extends EthereumProvider {
|
39
40
|
[EXTENSION_EVM_PROP]: boolean;
|
40
|
-
chainId: string;
|
41
41
|
}
|
42
42
|
/**
|
43
43
|
* Gets the extension provider. In case it does not exist returns an instance
|
@@ -1,5 +1,6 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
import { EventEmitter } from "events";
|
3
|
+
import { KeyValueStorageOptions } from "@walletconnect/keyvaluestorage";
|
3
4
|
import { IEthereumProvider as IProvider, IEthereumProviderEvents, ProviderAccounts, RequestArguments } from "./types";
|
4
5
|
import { Metadata, Namespace, UniversalProvider } from "@walletconnect/universal-provider/dist/index.umd.js";
|
5
6
|
export type RpcEvent = "accountsChanged" | "chainChanged" | "message" | "disconnect" | "connect";
|
@@ -79,6 +80,9 @@ export interface EthereumProviderOptions {
|
|
79
80
|
optionalEvents?: string[];
|
80
81
|
rpcMap?: EthereumRpcMap;
|
81
82
|
metadata?: Metadata;
|
83
|
+
disableProviderPing?: boolean;
|
84
|
+
relayUrl?: string;
|
85
|
+
storageOptions?: KeyValueStorageOptions;
|
82
86
|
}
|
83
87
|
export declare class EthereumProvider implements IEthereumProvider {
|
84
88
|
events: EventEmitter;
|
@@ -104,7 +108,7 @@ export declare class EthereumProvider implements IEthereumProvider {
|
|
104
108
|
get isWalletConnect(): boolean;
|
105
109
|
get session(): any;
|
106
110
|
protected registerEventListeners(): void;
|
107
|
-
protected
|
111
|
+
protected switchEthereumChain(chainId: number): void;
|
108
112
|
protected isCompatibleChainId(chainId: string): boolean;
|
109
113
|
protected formatChainId(chainId: number): string;
|
110
114
|
protected parseChainId(chainId: string): number;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ledgerhq/connect-kit",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.1",
|
4
4
|
"description": "A library for dApps to integrate with the Ledger Extension and Ledger Live",
|
5
5
|
"author": "Ledger SAS <ledger.com>",
|
6
6
|
"license": "MIT",
|
@@ -31,10 +31,11 @@
|
|
31
31
|
"@types/react": "^18.0.0",
|
32
32
|
"@types/react-dom": "^18.0.0",
|
33
33
|
"@types/styled-components": "^5.1.25",
|
34
|
+
"@types/uuid": "^9.0.2",
|
34
35
|
"@walletconnect/legacy-provider": "^2.0.0",
|
35
|
-
"@walletconnect/types": "^2.
|
36
|
-
"@walletconnect/universal-provider": "^2.
|
37
|
-
"@walletconnect/utils": "^2.
|
36
|
+
"@walletconnect/types": "^2.9.1",
|
37
|
+
"@walletconnect/universal-provider": "^2.9.1",
|
38
|
+
"@walletconnect/utils": "^2.9.1",
|
38
39
|
"bowser": "^2.11.0",
|
39
40
|
"events": "^3.3.0",
|
40
41
|
"qrcode.react": "^3.1.0",
|
@@ -51,5 +52,9 @@
|
|
51
52
|
"tslib": "^2.4.0",
|
52
53
|
"typescript": "^4.7.3"
|
53
54
|
},
|
54
|
-
"dependencies": {
|
55
|
+
"dependencies": {
|
56
|
+
"@segment/analytics-next": "^1.53.0",
|
57
|
+
"rollup-plugin-dotenv": "^0.5.0",
|
58
|
+
"uuid": "^9.0.0"
|
59
|
+
}
|
55
60
|
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { ProviderResult } from "../lib/provider";
|
2
|
-
export declare const EXTENSION_SOLANA_PROVIDER = "solana";
|
3
|
-
export declare const EXTENSION_SOLANA_PROP = "isLedgerConnect";
|
4
|
-
export interface SolanaProvider {
|
5
|
-
[EXTENSION_SOLANA_PROP]: boolean;
|
6
|
-
signTransaction(...args: unknown[]): Promise<unknown>;
|
7
|
-
signAllTransactions(...args: unknown[]): Promise<unknown>;
|
8
|
-
signAndSendTransaction(...args: unknown[]): Promise<unknown>;
|
9
|
-
connect(): Promise<void>;
|
10
|
-
disconnect(): Promise<void>;
|
11
|
-
}
|
12
|
-
/**
|
13
|
-
* Gets the Solana provider.
|
14
|
-
*/
|
15
|
-
export declare function getSolanaProvider(): ProviderResult;
|