@wagmi/connectors 0.3.22 → 0.3.24
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/index.d.ts +162 -2
- package/dist/injected.d.ts +1 -1
- package/dist/metaMask.d.ts +1 -1
- package/package.json +10 -10
- package/LICENSE +0 -21
- package/dist/types-82d07ee0.d.ts +0 -162
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,166 @@
|
|
|
1
1
|
export { C as Connector, a as ConnectorData, b as ConnectorEvents } from './base-84a689bb.js';
|
|
2
|
-
|
|
2
|
+
import { Address, ResolvedConfig } from 'abitype';
|
|
3
3
|
import '@wagmi/core';
|
|
4
4
|
import '@wagmi/core/chains';
|
|
5
5
|
import 'eventemitter3';
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
type AddEthereumChainParameter = {
|
|
8
|
+
/** A 0x-prefixed hexadecimal string */
|
|
9
|
+
chainId: string;
|
|
10
|
+
chainName: string;
|
|
11
|
+
nativeCurrency?: {
|
|
12
|
+
name: string;
|
|
13
|
+
/** 2-6 characters long */
|
|
14
|
+
symbol: string;
|
|
15
|
+
decimals: number;
|
|
16
|
+
};
|
|
17
|
+
rpcUrls: string[];
|
|
18
|
+
blockExplorerUrls?: string[];
|
|
19
|
+
/** Currently ignored. */
|
|
20
|
+
iconUrls?: string[];
|
|
21
|
+
};
|
|
22
|
+
type WalletPermissionCaveat = {
|
|
23
|
+
type: string;
|
|
24
|
+
value: any;
|
|
25
|
+
};
|
|
26
|
+
type WalletPermission = {
|
|
27
|
+
caveats: WalletPermissionCaveat[];
|
|
28
|
+
date: number;
|
|
29
|
+
id: string;
|
|
30
|
+
invoker: `http://${string}` | `https://${string}`;
|
|
31
|
+
parentCapability: 'eth_accounts' | string;
|
|
32
|
+
};
|
|
33
|
+
type WatchAssetParams = {
|
|
34
|
+
/** In the future, other standards will be supported */
|
|
35
|
+
type: 'ERC20';
|
|
36
|
+
options: {
|
|
37
|
+
/** Address of token contract */
|
|
38
|
+
address: Address;
|
|
39
|
+
/** Number of token decimals */
|
|
40
|
+
decimals: ResolvedConfig['IntType'];
|
|
41
|
+
/** String url of token logo */
|
|
42
|
+
image?: string;
|
|
43
|
+
/** A ticker symbol or shorthand, up to 5 characters */
|
|
44
|
+
symbol: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
type InjectedProviderFlags = {
|
|
48
|
+
isApexWallet?: true;
|
|
49
|
+
isAvalanche?: true;
|
|
50
|
+
isBackpack?: true;
|
|
51
|
+
isBifrost?: true;
|
|
52
|
+
isBitKeep?: true;
|
|
53
|
+
isBitski?: true;
|
|
54
|
+
isBlockWallet?: true;
|
|
55
|
+
isBraveWallet?: true;
|
|
56
|
+
isCoinbaseWallet?: true;
|
|
57
|
+
isDawn?: true;
|
|
58
|
+
isEnkrypt?: true;
|
|
59
|
+
isExodus?: true;
|
|
60
|
+
isFrame?: true;
|
|
61
|
+
isFrontier?: true;
|
|
62
|
+
isGamestop?: true;
|
|
63
|
+
isHyperPay?: true;
|
|
64
|
+
isImToken?: true;
|
|
65
|
+
isKuCoinWallet?: true;
|
|
66
|
+
isMathWallet?: true;
|
|
67
|
+
isMetaMask?: true;
|
|
68
|
+
isOkxWallet?: true;
|
|
69
|
+
isOKExWallet?: true;
|
|
70
|
+
isOneInchAndroidWallet?: true;
|
|
71
|
+
isOneInchIOSWallet?: true;
|
|
72
|
+
isOpera?: true;
|
|
73
|
+
isPhantom?: true;
|
|
74
|
+
isPortal?: true;
|
|
75
|
+
isRabby?: true;
|
|
76
|
+
isRainbow?: true;
|
|
77
|
+
isStatus?: true;
|
|
78
|
+
isTally?: true;
|
|
79
|
+
isTokenPocket?: true;
|
|
80
|
+
isTokenary?: true;
|
|
81
|
+
isTrust?: true;
|
|
82
|
+
isTrustWallet?: true;
|
|
83
|
+
isXDEFI?: true;
|
|
84
|
+
isZerion?: true;
|
|
85
|
+
};
|
|
86
|
+
type InjectedProviders = InjectedProviderFlags & {
|
|
87
|
+
isMetaMask: true;
|
|
88
|
+
/** Only exists in MetaMask as of 2022/04/03 */
|
|
89
|
+
_events: {
|
|
90
|
+
connect?: () => void;
|
|
91
|
+
};
|
|
92
|
+
/** Only exists in MetaMask as of 2022/04/03 */
|
|
93
|
+
_state?: {
|
|
94
|
+
accounts?: string[];
|
|
95
|
+
initialized?: boolean;
|
|
96
|
+
isConnected?: boolean;
|
|
97
|
+
isPermanentlyDisconnected?: boolean;
|
|
98
|
+
isUnlocked?: boolean;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
interface Ethereum extends InjectedProviders {
|
|
102
|
+
on?: (...args: any[]) => void;
|
|
103
|
+
removeListener?: (...args: any[]) => void;
|
|
104
|
+
providers?: Ethereum[];
|
|
105
|
+
/**
|
|
106
|
+
* EIP-747: Add wallet_watchAsset to Provider
|
|
107
|
+
* https://eips.ethereum.org/EIPS/eip-747
|
|
108
|
+
*/
|
|
109
|
+
request(args: {
|
|
110
|
+
method: 'wallet_watchAsset';
|
|
111
|
+
params: WatchAssetParams;
|
|
112
|
+
}): Promise<boolean>;
|
|
113
|
+
/**
|
|
114
|
+
* EIP-1193: Ethereum Provider JavaScript API
|
|
115
|
+
* https://eips.ethereum.org/EIPS/eip-1193
|
|
116
|
+
*/
|
|
117
|
+
request(args: {
|
|
118
|
+
method: 'eth_accounts';
|
|
119
|
+
}): Promise<Address[]>;
|
|
120
|
+
request(args: {
|
|
121
|
+
method: 'eth_chainId';
|
|
122
|
+
}): Promise<string>;
|
|
123
|
+
request(args: {
|
|
124
|
+
method: 'eth_requestAccounts';
|
|
125
|
+
}): Promise<Address[]>;
|
|
126
|
+
/**
|
|
127
|
+
* EIP-1474: Remote procedure call specification
|
|
128
|
+
* https://eips.ethereum.org/EIPS/eip-1474
|
|
129
|
+
*/
|
|
130
|
+
request(args: {
|
|
131
|
+
method: 'web3_clientVersion';
|
|
132
|
+
}): Promise<string>;
|
|
133
|
+
/**
|
|
134
|
+
* EIP-2255: Wallet Permissions System
|
|
135
|
+
* https://eips.ethereum.org/EIPS/eip-2255
|
|
136
|
+
*/
|
|
137
|
+
request(args: {
|
|
138
|
+
method: 'wallet_requestPermissions';
|
|
139
|
+
params: [{
|
|
140
|
+
eth_accounts: Record<string, any>;
|
|
141
|
+
}];
|
|
142
|
+
}): Promise<WalletPermission[]>;
|
|
143
|
+
request(args: {
|
|
144
|
+
method: 'wallet_getPermissions';
|
|
145
|
+
}): Promise<WalletPermission[]>;
|
|
146
|
+
/**
|
|
147
|
+
* EIP-3085: Wallet Add Ethereum Chain RPC Method
|
|
148
|
+
* https://eips.ethereum.org/EIPS/eip-3085
|
|
149
|
+
*/
|
|
150
|
+
request(args: {
|
|
151
|
+
method: 'wallet_addEthereumChain';
|
|
152
|
+
params: AddEthereumChainParameter[];
|
|
153
|
+
}): Promise<null>;
|
|
154
|
+
/**
|
|
155
|
+
* EIP-3326: Wallet Switch Ethereum Chain RPC Method
|
|
156
|
+
* https://eips.ethereum.org/EIPS/eip-3326
|
|
157
|
+
*/
|
|
158
|
+
request(args: {
|
|
159
|
+
method: 'wallet_switchEthereumChain';
|
|
160
|
+
params: [{
|
|
161
|
+
chainId: string;
|
|
162
|
+
}];
|
|
163
|
+
}): Promise<null>;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export { Ethereum };
|
package/dist/injected.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Address } from '@wagmi/core';
|
|
|
2
2
|
import { Chain } from '@wagmi/core/chains';
|
|
3
3
|
import { providers } from 'ethers';
|
|
4
4
|
import { C as Connector } from './base-84a689bb.js';
|
|
5
|
-
import {
|
|
5
|
+
import { Ethereum } from './index.js';
|
|
6
6
|
import 'eventemitter3';
|
|
7
7
|
import 'abitype';
|
|
8
8
|
|
package/dist/metaMask.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Chain } from '@wagmi/core/chains';
|
|
2
2
|
import { InjectedConnectorOptions, InjectedConnector } from './injected.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Ethereum } from './index.js';
|
|
4
4
|
import '@wagmi/core';
|
|
5
5
|
import 'ethers';
|
|
6
6
|
import './base-84a689bb.js';
|
package/package.json
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
"name": "@wagmi/connectors",
|
|
3
3
|
"description": "A collection of connectors for wagmi",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.24",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsup",
|
|
8
|
+
"dev": "DEV=true tsup"
|
|
9
|
+
},
|
|
6
10
|
"peerDependencies": {
|
|
7
11
|
"@wagmi/core": ">=0.9.x",
|
|
8
12
|
"ethers": ">=5.5.1 <6",
|
|
@@ -19,11 +23,11 @@
|
|
|
19
23
|
"dependencies": {
|
|
20
24
|
"@coinbase/wallet-sdk": "^3.6.6",
|
|
21
25
|
"@ledgerhq/connect-kit-loader": "^1.0.1",
|
|
22
|
-
"@walletconnect/ethereum-provider": "2.8.4",
|
|
23
|
-
"@walletconnect/legacy-provider": "^2.0.0",
|
|
24
|
-
"@walletconnect/modal": "^2.5.4",
|
|
25
26
|
"@safe-global/safe-apps-provider": "^0.15.2",
|
|
26
27
|
"@safe-global/safe-apps-sdk": "^7.9.0",
|
|
28
|
+
"@walletconnect/ethereum-provider": "2.9.0",
|
|
29
|
+
"@walletconnect/legacy-provider": "^2.0.0",
|
|
30
|
+
"@walletconnect/modal": "^2.5.9",
|
|
27
31
|
"abitype": "^0.3.0",
|
|
28
32
|
"eventemitter3": "^4.0.7"
|
|
29
33
|
},
|
|
@@ -115,9 +119,5 @@
|
|
|
115
119
|
"wallet",
|
|
116
120
|
"web3",
|
|
117
121
|
"abi"
|
|
118
|
-
]
|
|
119
|
-
|
|
120
|
-
"build": "tsup",
|
|
121
|
-
"dev": "DEV=true tsup"
|
|
122
|
-
}
|
|
123
|
-
}
|
|
122
|
+
]
|
|
123
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022–PRESENT weth, LLC
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/dist/types-82d07ee0.d.ts
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { Address, ResolvedConfig } from 'abitype';
|
|
2
|
-
|
|
3
|
-
type AddEthereumChainParameter = {
|
|
4
|
-
/** A 0x-prefixed hexadecimal string */
|
|
5
|
-
chainId: string;
|
|
6
|
-
chainName: string;
|
|
7
|
-
nativeCurrency?: {
|
|
8
|
-
name: string;
|
|
9
|
-
/** 2-6 characters long */
|
|
10
|
-
symbol: string;
|
|
11
|
-
decimals: number;
|
|
12
|
-
};
|
|
13
|
-
rpcUrls: string[];
|
|
14
|
-
blockExplorerUrls?: string[];
|
|
15
|
-
/** Currently ignored. */
|
|
16
|
-
iconUrls?: string[];
|
|
17
|
-
};
|
|
18
|
-
type WalletPermissionCaveat = {
|
|
19
|
-
type: string;
|
|
20
|
-
value: any;
|
|
21
|
-
};
|
|
22
|
-
type WalletPermission = {
|
|
23
|
-
caveats: WalletPermissionCaveat[];
|
|
24
|
-
date: number;
|
|
25
|
-
id: string;
|
|
26
|
-
invoker: `http://${string}` | `https://${string}`;
|
|
27
|
-
parentCapability: 'eth_accounts' | string;
|
|
28
|
-
};
|
|
29
|
-
type WatchAssetParams = {
|
|
30
|
-
/** In the future, other standards will be supported */
|
|
31
|
-
type: 'ERC20';
|
|
32
|
-
options: {
|
|
33
|
-
/** Address of token contract */
|
|
34
|
-
address: Address;
|
|
35
|
-
/** Number of token decimals */
|
|
36
|
-
decimals: ResolvedConfig['IntType'];
|
|
37
|
-
/** String url of token logo */
|
|
38
|
-
image?: string;
|
|
39
|
-
/** A ticker symbol or shorthand, up to 5 characters */
|
|
40
|
-
symbol: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
type InjectedProviderFlags = {
|
|
44
|
-
isApexWallet?: true;
|
|
45
|
-
isAvalanche?: true;
|
|
46
|
-
isBackpack?: true;
|
|
47
|
-
isBifrost?: true;
|
|
48
|
-
isBitKeep?: true;
|
|
49
|
-
isBitski?: true;
|
|
50
|
-
isBlockWallet?: true;
|
|
51
|
-
isBraveWallet?: true;
|
|
52
|
-
isCoinbaseWallet?: true;
|
|
53
|
-
isDawn?: true;
|
|
54
|
-
isEnkrypt?: true;
|
|
55
|
-
isExodus?: true;
|
|
56
|
-
isFrame?: true;
|
|
57
|
-
isFrontier?: true;
|
|
58
|
-
isGamestop?: true;
|
|
59
|
-
isHyperPay?: true;
|
|
60
|
-
isImToken?: true;
|
|
61
|
-
isKuCoinWallet?: true;
|
|
62
|
-
isMathWallet?: true;
|
|
63
|
-
isMetaMask?: true;
|
|
64
|
-
isOkxWallet?: true;
|
|
65
|
-
isOKExWallet?: true;
|
|
66
|
-
isOneInchAndroidWallet?: true;
|
|
67
|
-
isOneInchIOSWallet?: true;
|
|
68
|
-
isOpera?: true;
|
|
69
|
-
isPhantom?: true;
|
|
70
|
-
isPortal?: true;
|
|
71
|
-
isRabby?: true;
|
|
72
|
-
isRainbow?: true;
|
|
73
|
-
isStatus?: true;
|
|
74
|
-
isTally?: true;
|
|
75
|
-
isTokenPocket?: true;
|
|
76
|
-
isTokenary?: true;
|
|
77
|
-
isTrust?: true;
|
|
78
|
-
isTrustWallet?: true;
|
|
79
|
-
isXDEFI?: true;
|
|
80
|
-
isZerion?: true;
|
|
81
|
-
};
|
|
82
|
-
type InjectedProviders = InjectedProviderFlags & {
|
|
83
|
-
isMetaMask: true;
|
|
84
|
-
/** Only exists in MetaMask as of 2022/04/03 */
|
|
85
|
-
_events: {
|
|
86
|
-
connect?: () => void;
|
|
87
|
-
};
|
|
88
|
-
/** Only exists in MetaMask as of 2022/04/03 */
|
|
89
|
-
_state?: {
|
|
90
|
-
accounts?: string[];
|
|
91
|
-
initialized?: boolean;
|
|
92
|
-
isConnected?: boolean;
|
|
93
|
-
isPermanentlyDisconnected?: boolean;
|
|
94
|
-
isUnlocked?: boolean;
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
interface Ethereum extends InjectedProviders {
|
|
98
|
-
on?: (...args: any[]) => void;
|
|
99
|
-
removeListener?: (...args: any[]) => void;
|
|
100
|
-
providers?: Ethereum[];
|
|
101
|
-
/**
|
|
102
|
-
* EIP-747: Add wallet_watchAsset to Provider
|
|
103
|
-
* https://eips.ethereum.org/EIPS/eip-747
|
|
104
|
-
*/
|
|
105
|
-
request(args: {
|
|
106
|
-
method: 'wallet_watchAsset';
|
|
107
|
-
params: WatchAssetParams;
|
|
108
|
-
}): Promise<boolean>;
|
|
109
|
-
/**
|
|
110
|
-
* EIP-1193: Ethereum Provider JavaScript API
|
|
111
|
-
* https://eips.ethereum.org/EIPS/eip-1193
|
|
112
|
-
*/
|
|
113
|
-
request(args: {
|
|
114
|
-
method: 'eth_accounts';
|
|
115
|
-
}): Promise<Address[]>;
|
|
116
|
-
request(args: {
|
|
117
|
-
method: 'eth_chainId';
|
|
118
|
-
}): Promise<string>;
|
|
119
|
-
request(args: {
|
|
120
|
-
method: 'eth_requestAccounts';
|
|
121
|
-
}): Promise<Address[]>;
|
|
122
|
-
/**
|
|
123
|
-
* EIP-1474: Remote procedure call specification
|
|
124
|
-
* https://eips.ethereum.org/EIPS/eip-1474
|
|
125
|
-
*/
|
|
126
|
-
request(args: {
|
|
127
|
-
method: 'web3_clientVersion';
|
|
128
|
-
}): Promise<string>;
|
|
129
|
-
/**
|
|
130
|
-
* EIP-2255: Wallet Permissions System
|
|
131
|
-
* https://eips.ethereum.org/EIPS/eip-2255
|
|
132
|
-
*/
|
|
133
|
-
request(args: {
|
|
134
|
-
method: 'wallet_requestPermissions';
|
|
135
|
-
params: [{
|
|
136
|
-
eth_accounts: Record<string, any>;
|
|
137
|
-
}];
|
|
138
|
-
}): Promise<WalletPermission[]>;
|
|
139
|
-
request(args: {
|
|
140
|
-
method: 'wallet_getPermissions';
|
|
141
|
-
}): Promise<WalletPermission[]>;
|
|
142
|
-
/**
|
|
143
|
-
* EIP-3085: Wallet Add Ethereum Chain RPC Method
|
|
144
|
-
* https://eips.ethereum.org/EIPS/eip-3085
|
|
145
|
-
*/
|
|
146
|
-
request(args: {
|
|
147
|
-
method: 'wallet_addEthereumChain';
|
|
148
|
-
params: AddEthereumChainParameter[];
|
|
149
|
-
}): Promise<null>;
|
|
150
|
-
/**
|
|
151
|
-
* EIP-3326: Wallet Switch Ethereum Chain RPC Method
|
|
152
|
-
* https://eips.ethereum.org/EIPS/eip-3326
|
|
153
|
-
*/
|
|
154
|
-
request(args: {
|
|
155
|
-
method: 'wallet_switchEthereumChain';
|
|
156
|
-
params: [{
|
|
157
|
-
chainId: string;
|
|
158
|
-
}];
|
|
159
|
-
}): Promise<null>;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export { Ethereum as E };
|