@dynamic-labs/wallet-connector-core 0.15.0-RC.8
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/index.cjs +8 -0
- package/package.json +19 -0
- package/src/index.d.ts +1 -0
- package/src/lib/WalletConnector.d.ts +51 -0
package/index.cjs
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dynamic-labs/wallet-connector-core",
|
|
3
|
+
"version": "0.15.0-RC.8",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
7
|
+
"directory": "packages/wallet-connector-core"
|
|
8
|
+
},
|
|
9
|
+
"description": "Core package for utilities and types for handling multiple wallet/chain support Dynamic SDK",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/dynamic-labs/DynamicAuth/issues"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/dynamic-labs/DynamicAuth/main/packages/wallet-connector-core#readme",
|
|
14
|
+
"author": "Dynamic Labs, Inc.",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"main": "./index.cjs",
|
|
17
|
+
"type": "commonjs",
|
|
18
|
+
"types": "./src/index.d.ts"
|
|
19
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/WalletConnector';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const Chains: readonly ["ETH", "FLOW", "SOL", "EVM", "ALGO", "STARK"];
|
|
2
|
+
export type Chain = typeof Chains[number];
|
|
3
|
+
export type PayloadParams = {
|
|
4
|
+
params: {
|
|
5
|
+
accounts: string[];
|
|
6
|
+
chainId: number;
|
|
7
|
+
message: string;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
export type FetchPublicAddressOpts = {
|
|
11
|
+
onConnect?(payload: PayloadParams): void;
|
|
12
|
+
onDesktopUri?(uri: string): void;
|
|
13
|
+
onDisplayUri?(uri: string): void;
|
|
14
|
+
};
|
|
15
|
+
export type WalletEventListeners = {
|
|
16
|
+
onAccountChange?(accounts: string[]): Promise<void>;
|
|
17
|
+
onChainChange?(chain: string): Promise<void>;
|
|
18
|
+
onDisconnect?(): Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
export interface WalletConnector {
|
|
21
|
+
canConnectViaCustodialService: boolean;
|
|
22
|
+
canConnectViaQrCode: boolean;
|
|
23
|
+
connect: () => Promise<void>;
|
|
24
|
+
connectedChain?: Chain;
|
|
25
|
+
endSession?(): Promise<void>;
|
|
26
|
+
fetchPublicAddress(opts?: FetchPublicAddressOpts): Promise<string | undefined>;
|
|
27
|
+
getBalance(): Promise<string | undefined>;
|
|
28
|
+
getConnectedAccounts(): Promise<string[]>;
|
|
29
|
+
getNetwork(): Promise<number | undefined>;
|
|
30
|
+
getRpcProvider(): Promise<unknown>;
|
|
31
|
+
getRpcProvider<T>(): Promise<T>;
|
|
32
|
+
getSigner(): Promise<unknown>;
|
|
33
|
+
getSigner<T>(): Promise<T>;
|
|
34
|
+
getWeb3Provider(): unknown;
|
|
35
|
+
getWeb3Provider<T>(): T;
|
|
36
|
+
isInstalledOnBrowser(): boolean;
|
|
37
|
+
isWalletConnect: boolean;
|
|
38
|
+
key: string;
|
|
39
|
+
name: string;
|
|
40
|
+
proveOwnership(messageToSign: string): Promise<string | undefined>;
|
|
41
|
+
setupEventListeners(listeners: WalletEventListeners): void;
|
|
42
|
+
signMessage(messageToSign: string): Promise<string | undefined>;
|
|
43
|
+
supportedChains: Chain[];
|
|
44
|
+
supportsNetworkSwitching(): boolean;
|
|
45
|
+
switchNetwork({ networkName, networkChainId, }: {
|
|
46
|
+
networkChainId?: number;
|
|
47
|
+
networkName?: string;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
switchNetworkOnlyFromWallet?: boolean;
|
|
50
|
+
teardownEventListeners(): void;
|
|
51
|
+
}
|