@reown/appkit-adapter-ethers5 1.3.2 → 1.4.0
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/dist/esm/src/client.js +298 -753
- package/dist/esm/src/client.js.map +1 -1
- package/dist/esm/src/utils/Ethers5Methods.js +12 -3
- package/dist/esm/src/utils/Ethers5Methods.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/src/client.d.ts +32 -66
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/utils/Ethers5Methods.d.ts +3 -2
- package/package.json +10 -10
|
@@ -1,73 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import type { AppKit } from '@reown/appkit';
|
|
5
|
-
import type { ConnectionControllerClient, NetworkControllerClient } from '@reown/appkit-core';
|
|
6
|
-
import type { PublicStateControllerState } from '@reown/appkit-core';
|
|
7
|
-
export interface AdapterOptions {
|
|
8
|
-
ethersConfig: ProviderType;
|
|
9
|
-
defaultCaipNetwork?: CaipNetwork;
|
|
10
|
-
}
|
|
11
|
-
declare global {
|
|
12
|
-
interface Window {
|
|
13
|
-
ethereum?: Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
interface Info {
|
|
17
|
-
uuid: string;
|
|
18
|
-
name: string;
|
|
19
|
-
icon: string;
|
|
20
|
-
rdns: string;
|
|
21
|
-
}
|
|
1
|
+
import { AdapterBlueprint } from '@reown/appkit/adapters';
|
|
2
|
+
import { type Connector, type Provider } from '@reown/appkit-core';
|
|
3
|
+
import { type AppKitOptions } from '@reown/appkit';
|
|
22
4
|
export interface EIP6963ProviderDetail {
|
|
23
|
-
info:
|
|
5
|
+
info: Connector['info'];
|
|
24
6
|
provider: Provider;
|
|
25
7
|
}
|
|
26
|
-
export declare class Ethers5Adapter {
|
|
27
|
-
private appKit;
|
|
28
|
-
private EIP6963Providers;
|
|
8
|
+
export declare class Ethers5Adapter extends AdapterBlueprint {
|
|
29
9
|
private ethersConfig?;
|
|
30
|
-
|
|
31
|
-
options: AppKitOptions | undefined;
|
|
32
|
-
caipNetworks: CaipNetwork[];
|
|
33
|
-
chainNamespace: ChainNamespace;
|
|
34
|
-
networkControllerClient?: NetworkControllerClient;
|
|
35
|
-
connectionControllerClient?: ConnectionControllerClient;
|
|
36
|
-
siweControllerClient: import("@reown/appkit-siwe").AppKitSIWEClient | undefined;
|
|
37
|
-
tokens: import("@reown/appkit").Tokens | undefined;
|
|
38
|
-
defaultCaipNetwork: CaipNetwork | undefined;
|
|
39
|
-
adapterType: AdapterType;
|
|
40
|
-
private createEthersConfig;
|
|
10
|
+
adapterType: string;
|
|
41
11
|
constructor();
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
private removeListeners;
|
|
54
|
-
private setupAuthListeners;
|
|
55
|
-
private handleInvalidAuthRequest;
|
|
56
|
-
private handleAuthRpcError;
|
|
57
|
-
private handleAuthRpcSuccess;
|
|
58
|
-
private handleAuthNotConnected;
|
|
59
|
-
private handleAuthIsConnected;
|
|
60
|
-
private handleAuthSetPreferredAccount;
|
|
61
|
-
private syncReownName;
|
|
62
|
-
private syncAccount;
|
|
63
|
-
private syncProfile;
|
|
64
|
-
private syncBalance;
|
|
65
|
-
private syncConnectedWalletInfo;
|
|
66
|
-
private syncRequestedNetworks;
|
|
67
|
-
switchNetwork(caipNetwork: CaipNetwork): Promise<void>;
|
|
68
|
-
private syncConnectors;
|
|
69
|
-
private syncAuthConnector;
|
|
12
|
+
private createEthersConfig;
|
|
13
|
+
signMessage(params: AdapterBlueprint.SignMessageParams): Promise<AdapterBlueprint.SignMessageResult>;
|
|
14
|
+
sendTransaction(params: AdapterBlueprint.SendTransactionParams): Promise<AdapterBlueprint.SendTransactionResult>;
|
|
15
|
+
writeContract(params: AdapterBlueprint.WriteContractParams): Promise<AdapterBlueprint.WriteContractResult>;
|
|
16
|
+
estimateGas(params: AdapterBlueprint.EstimateGasTransactionArgs): Promise<AdapterBlueprint.EstimateGasTransactionResult>;
|
|
17
|
+
getEnsAddress(params: AdapterBlueprint.GetEnsAddressParams): Promise<AdapterBlueprint.GetEnsAddressResult>;
|
|
18
|
+
parseUnits(params: AdapterBlueprint.ParseUnitsParams): AdapterBlueprint.ParseUnitsResult;
|
|
19
|
+
formatUnits(params: AdapterBlueprint.FormatUnitsParams): AdapterBlueprint.FormatUnitsResult;
|
|
20
|
+
syncConnection(params: AdapterBlueprint.SyncConnectionParams): Promise<AdapterBlueprint.ConnectResult>;
|
|
21
|
+
syncConnectors(options: AppKitOptions): void;
|
|
22
|
+
connectWalletConnect(onUri: (uri: string) => void): Promise<void>;
|
|
70
23
|
private eip6963EventHandler;
|
|
71
|
-
private
|
|
24
|
+
private listenInjectedConnector;
|
|
25
|
+
connect({ id, type, chainId }: AdapterBlueprint.ConnectParams): Promise<AdapterBlueprint.ConnectResult>;
|
|
26
|
+
reconnect(params: AdapterBlueprint.ConnectParams): Promise<void>;
|
|
27
|
+
disconnect(params: AdapterBlueprint.DisconnectParams): Promise<void>;
|
|
28
|
+
getBalance(params: AdapterBlueprint.GetBalanceParams): Promise<AdapterBlueprint.GetBalanceResult>;
|
|
29
|
+
getProfile(params: AdapterBlueprint.GetProfileParams): Promise<AdapterBlueprint.GetProfileResult>;
|
|
30
|
+
private providerHandlers;
|
|
31
|
+
private listenProviderEvents;
|
|
32
|
+
private removeProviderListeners;
|
|
33
|
+
switchNetwork(params: AdapterBlueprint.SwitchNetworkParams): Promise<void>;
|
|
34
|
+
getWalletConnectProvider(): AdapterBlueprint.GetWalletConnectProviderResult;
|
|
35
|
+
private revokeProviderPermissions;
|
|
36
|
+
getCapabilities(params: AdapterBlueprint.GetCapabilitiesParams): Promise<unknown>;
|
|
37
|
+
grantPermissions(params: AdapterBlueprint.GrantPermissionsParams): Promise<unknown>;
|
|
38
|
+
revokePermissions(params: AdapterBlueprint.RevokePermissionsParams): Promise<`0x${string}`>;
|
|
72
39
|
}
|
|
73
|
-
export {};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
2
|
import { type Provider } from '@reown/appkit-utils/ethers';
|
|
3
3
|
import type { EstimateGasTransactionArgs, SendTransactionArgs, WriteContractArgs } from '@reown/appkit-core';
|
|
4
|
-
import type
|
|
4
|
+
import { type CaipNetwork } from '@reown/appkit-common';
|
|
5
5
|
export declare const Ethers5Methods: {
|
|
6
6
|
signMessage: (message: string, provider: Provider, address: string) => Promise<`0x${string}`>;
|
|
7
7
|
estimateGas: (data: EstimateGasTransactionArgs, provider: Provider, address: string, networkId: number) => Promise<bigint>;
|
|
8
8
|
sendTransaction: (data: SendTransactionArgs, provider: Provider, address: string, networkId: number) => Promise<`0x${string}`>;
|
|
9
9
|
writeContract: (data: WriteContractArgs, provider: Provider, address: string, chainId: number) => Promise<any>;
|
|
10
|
-
getEnsAddress: (value: string,
|
|
10
|
+
getEnsAddress: (value: string, caipNetwork: CaipNetwork) => Promise<string | false>;
|
|
11
11
|
getEnsAvatar: (value: string, chainId: number) => Promise<string | false>;
|
|
12
|
+
parseWalletCapabilities: (str: string) => any;
|
|
12
13
|
parseUnits: (value: string, _: number) => bigint;
|
|
13
14
|
formatUnits: typeof ethers.utils.formatUnits;
|
|
14
15
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-adapter-ethers5",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/esm/src/index.js",
|
|
6
6
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
"@walletconnect/utils": "2.17.0",
|
|
13
13
|
"@walletconnect/universal-provider": "2.17.0",
|
|
14
14
|
"valtio": "1.11.2",
|
|
15
|
-
"@reown/appkit": "1.
|
|
16
|
-
"@reown/appkit-common": "1.
|
|
17
|
-
"@reown/appkit-core": "1.
|
|
18
|
-
"@reown/appkit-polyfills": "1.
|
|
19
|
-
"@reown/appkit-scaffold-ui": "1.
|
|
20
|
-
"@reown/appkit-utils": "1.
|
|
21
|
-
"@reown/appkit-siwe": "1.
|
|
22
|
-
"@reown/appkit-ui": "1.
|
|
23
|
-
"@reown/appkit-wallet": "1.
|
|
15
|
+
"@reown/appkit": "1.4.0",
|
|
16
|
+
"@reown/appkit-common": "1.4.0",
|
|
17
|
+
"@reown/appkit-core": "1.4.0",
|
|
18
|
+
"@reown/appkit-polyfills": "1.4.0",
|
|
19
|
+
"@reown/appkit-scaffold-ui": "1.4.0",
|
|
20
|
+
"@reown/appkit-utils": "1.4.0",
|
|
21
|
+
"@reown/appkit-siwe": "1.4.0",
|
|
22
|
+
"@reown/appkit-ui": "1.4.0",
|
|
23
|
+
"@reown/appkit-wallet": "1.4.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@ethersproject/sha2": "5.7.0",
|