@wagmi/core 0.4.8 → 0.5.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/README.md +5 -5
- package/chains/dist/wagmi-core-chains.cjs.dev.js +2 -2
- package/chains/dist/wagmi-core-chains.cjs.prod.js +2 -2
- package/chains/dist/wagmi-core-chains.esm.js +2 -2
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.dev.js +28 -26
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.prod.js +28 -26
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.esm.js +5 -3
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.dev.js +22 -23
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.prod.js +22 -23
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.esm.js +7 -8
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.dev.js +33 -31
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.prod.js +33 -31
- package/connectors/mock/dist/wagmi-core-connectors-mock.esm.js +6 -4
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.dev.js +24 -25
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.prod.js +24 -25
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.esm.js +5 -6
- package/dist/{chains-7e6dc59c.cjs.dev.js → chains-13baf029.cjs.prod.js} +4 -4
- package/dist/{chains-fd2c546c.esm.js → chains-4b1a6cf8.esm.js} +4 -4
- package/dist/{chains-f7bb3211.cjs.prod.js → chains-a1aae67e.cjs.dev.js} +4 -4
- package/dist/declarations/src/actions/accounts/fetchBalance.d.ts +0 -1
- package/dist/declarations/src/actions/accounts/fetchSigner.d.ts +3 -3
- package/dist/declarations/src/actions/contracts/deprecatedWriteContract.d.ts +16 -0
- package/dist/declarations/src/actions/{tokens → contracts}/fetchToken.d.ts +1 -0
- package/dist/declarations/src/actions/contracts/index.d.ts +4 -1
- package/dist/declarations/src/actions/contracts/prepareWriteContract.d.ts +37 -0
- package/dist/declarations/src/actions/contracts/writeContract.d.ts +44 -8
- package/dist/declarations/src/actions/ens/fetchEnsAddress.d.ts +2 -1
- package/dist/declarations/src/actions/index.d.ts +2 -3
- package/dist/declarations/src/actions/transactions/deprecatedSendTransaction.d.ts +12 -0
- package/dist/declarations/src/actions/transactions/fetchTransaction.d.ts +21 -0
- package/dist/declarations/src/actions/transactions/index.d.ts +4 -1
- package/dist/declarations/src/actions/transactions/prepareSendTransaction.d.ts +36 -0
- package/dist/declarations/src/actions/transactions/sendTransaction.d.ts +43 -8
- package/dist/declarations/src/client.d.ts +3 -3
- package/dist/declarations/src/connectors/base.d.ts +1 -2
- package/dist/declarations/src/connectors/coinbaseWallet.d.ts +2 -2
- package/dist/declarations/src/connectors/index.d.ts +1 -1
- package/dist/declarations/src/connectors/injected.d.ts +4 -4
- package/dist/declarations/src/connectors/metaMask.d.ts +1 -1
- package/dist/declarations/src/connectors/mock/provider.d.ts +3 -2
- package/dist/declarations/src/connectors/walletConnect.d.ts +3 -2
- package/dist/declarations/src/constants/index.d.ts +1 -1
- package/dist/declarations/src/constants/rpcs.d.ts +2 -2
- package/dist/declarations/src/errors.d.ts +10 -3
- package/dist/declarations/src/index.d.ts +5 -5
- package/dist/declarations/src/providers/alchemy.d.ts +2 -3
- package/dist/declarations/src/providers/infura.d.ts +2 -3
- package/dist/declarations/src/providers/jsonRpc.d.ts +1 -2
- package/dist/declarations/src/providers/public.d.ts +2 -4
- package/dist/declarations/src/types/index.d.ts +133 -129
- package/dist/declarations/src/utils/configureChains.d.ts +3 -1
- package/dist/declarations/src/utils/getInjectedName.d.ts +2 -1
- package/dist/{client-a6e61429.cjs.prod.js → getProvider-5b369460.cjs.prod.js} +449 -56
- package/dist/{client-a05fd511.esm.js → getProvider-dda5b21b.esm.js} +383 -14
- package/dist/{client-71ece661.cjs.dev.js → getProvider-e4848469.cjs.dev.js} +449 -56
- package/dist/{rpcs-1fd0a12f.cjs.prod.js → rpcs-3d4e8104.cjs.dev.js} +9 -9
- package/dist/{rpcs-f1d24f0e.cjs.dev.js → rpcs-4b3a7778.cjs.prod.js} +9 -9
- package/dist/{rpcs-b73a8f60.esm.js → rpcs-5dc0ea1f.esm.js} +8 -8
- package/dist/wagmi-core.cjs.dev.js +591 -298
- package/dist/wagmi-core.cjs.prod.js +591 -298
- package/dist/wagmi-core.esm.js +499 -213
- package/package.json +8 -4
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.dev.js +5 -7
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.prod.js +5 -7
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.esm.js +5 -7
- package/providers/infura/dist/wagmi-core-providers-infura.cjs.dev.js +5 -7
- package/providers/infura/dist/wagmi-core-providers-infura.cjs.prod.js +5 -7
- package/providers/infura/dist/wagmi-core-providers-infura.esm.js +5 -7
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.dev.js +0 -2
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.prod.js +0 -2
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.esm.js +0 -2
- package/providers/public/dist/wagmi-core-providers-public.cjs.dev.js +0 -2
- package/providers/public/dist/wagmi-core-providers-public.cjs.prod.js +0 -2
- package/providers/public/dist/wagmi-core-providers-public.esm.js +0 -2
- package/dist/base-797ad073.cjs.prod.js +0 -343
- package/dist/base-90b7f3e4.cjs.dev.js +0 -343
- package/dist/base-b565d5d4.esm.js +0 -316
- package/dist/declarations/src/actions/tokens/index.d.ts +0 -1
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var getProvider = require('../../../dist/getProvider-5b369460.cjs.prod.js');
|
|
6
6
|
var ethers = require('ethers');
|
|
7
7
|
var utils = require('ethers/lib/utils');
|
|
8
|
-
var client = require('../../../dist/client-a6e61429.cjs.prod.js');
|
|
9
|
-
require('eventemitter3');
|
|
10
|
-
require('../../../dist/chains-f7bb3211.cjs.prod.js');
|
|
11
|
-
require('../../../dist/rpcs-1fd0a12f.cjs.prod.js');
|
|
12
|
-
require('zustand/vanilla');
|
|
13
8
|
require('zustand/middleware');
|
|
9
|
+
require('zustand/vanilla');
|
|
10
|
+
require('eventemitter3');
|
|
11
|
+
require('../../../dist/chains-13baf029.cjs.prod.js');
|
|
12
|
+
require('../../../dist/rpcs-4b3a7778.cjs.prod.js');
|
|
14
13
|
|
|
15
14
|
function _interopNamespace(e) {
|
|
16
15
|
if (e && e.__esModule) return e;
|
|
@@ -43,31 +42,31 @@ var _provider = /*#__PURE__*/new WeakMap();
|
|
|
43
42
|
|
|
44
43
|
var _switchChain = /*#__PURE__*/new WeakSet();
|
|
45
44
|
|
|
46
|
-
class WalletConnectConnector extends
|
|
45
|
+
class WalletConnectConnector extends getProvider.Connector {
|
|
47
46
|
constructor(config) {
|
|
48
47
|
super(config);
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
getProvider._classPrivateMethodInitSpec(this, _switchChain);
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
getProvider._defineProperty(this, "id", 'walletConnect');
|
|
53
52
|
|
|
54
|
-
|
|
53
|
+
getProvider._defineProperty(this, "name", 'WalletConnect');
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
getProvider._defineProperty(this, "ready", true);
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
getProvider._classPrivateFieldInitSpec(this, _provider, {
|
|
59
58
|
writable: true,
|
|
60
59
|
value: void 0
|
|
61
60
|
});
|
|
62
61
|
|
|
63
|
-
|
|
62
|
+
getProvider._defineProperty(this, "onAccountsChanged", accounts => {
|
|
64
63
|
if (accounts.length === 0) this.emit('disconnect');else this.emit('change', {
|
|
65
64
|
account: utils.getAddress(accounts[0])
|
|
66
65
|
});
|
|
67
66
|
});
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
const id =
|
|
68
|
+
getProvider._defineProperty(this, "onChainChanged", chainId => {
|
|
69
|
+
const id = getProvider.normalizeChainId(chainId);
|
|
71
70
|
const unsupported = this.isChainUnsupported(id);
|
|
72
71
|
this.emit('change', {
|
|
73
72
|
chain: {
|
|
@@ -77,7 +76,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
77
76
|
});
|
|
78
77
|
});
|
|
79
78
|
|
|
80
|
-
|
|
79
|
+
getProvider._defineProperty(this, "onDisconnect", () => {
|
|
81
80
|
this.emit('disconnect');
|
|
82
81
|
});
|
|
83
82
|
}
|
|
@@ -93,7 +92,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
93
92
|
let targetChainId = chainId;
|
|
94
93
|
|
|
95
94
|
if (!targetChainId) {
|
|
96
|
-
const lastUsedChainId =
|
|
95
|
+
const lastUsedChainId = getProvider.getClient().lastUsedChainId;
|
|
97
96
|
if (lastUsedChainId && !this.isChainUnsupported(lastUsedChainId)) targetChainId = lastUsedChainId;
|
|
98
97
|
}
|
|
99
98
|
|
|
@@ -115,7 +114,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
115
114
|
// Only enable for wallet options that do
|
|
116
115
|
|
|
117
116
|
const walletName = (_provider$connector$p = (_provider$connector = provider.connector) === null || _provider$connector === void 0 ? void 0 : (_provider$connector$p2 = _provider$connector.peerMeta) === null || _provider$connector$p2 === void 0 ? void 0 : _provider$connector$p2.name) !== null && _provider$connector$p !== void 0 ? _provider$connector$p : '';
|
|
118
|
-
if (switchChainAllowedRegex.test(walletName)) this.switchChain =
|
|
117
|
+
if (switchChainAllowedRegex.test(walletName)) this.switchChain = getProvider._classPrivateMethodGet(this, _switchChain, _switchChain2);
|
|
119
118
|
return {
|
|
120
119
|
account,
|
|
121
120
|
chain: {
|
|
@@ -125,7 +124,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
125
124
|
provider: new ethers.providers.Web3Provider(provider)
|
|
126
125
|
};
|
|
127
126
|
} catch (error) {
|
|
128
|
-
if (/user closed modal/i.test(error.message)) throw new
|
|
127
|
+
if (/user closed modal/i.test(error.message)) throw new getProvider.UserRejectedRequestError(error);
|
|
129
128
|
throw error;
|
|
130
129
|
}
|
|
131
130
|
}
|
|
@@ -148,7 +147,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
148
147
|
|
|
149
148
|
async getChainId() {
|
|
150
149
|
const provider = await this.getProvider();
|
|
151
|
-
const chainId =
|
|
150
|
+
const chainId = getProvider.normalizeChainId(provider.chainId);
|
|
152
151
|
return chainId;
|
|
153
152
|
}
|
|
154
153
|
|
|
@@ -159,7 +158,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
159
158
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
160
159
|
|
|
161
160
|
// Force create new provider
|
|
162
|
-
if (!
|
|
161
|
+
if (!getProvider._classPrivateFieldGet(this, _provider) || chainId || create) {
|
|
163
162
|
var _this$options, _this$options2;
|
|
164
163
|
|
|
165
164
|
const rpc = !((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.infuraId) ? this.chains.reduce((rpc, chain) => ({ ...rpc,
|
|
@@ -167,7 +166,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
167
166
|
}), {}) : {};
|
|
168
167
|
const WalletConnectProvider = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@walletconnect/ethereum-provider')); })).default;
|
|
169
168
|
|
|
170
|
-
|
|
169
|
+
getProvider._classPrivateFieldSet(this, _provider, new WalletConnectProvider({ ...this.options,
|
|
171
170
|
chainId,
|
|
172
171
|
rpc: { ...rpc,
|
|
173
172
|
...((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.rpc)
|
|
@@ -175,7 +174,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
175
174
|
}));
|
|
176
175
|
}
|
|
177
176
|
|
|
178
|
-
return
|
|
177
|
+
return getProvider._classPrivateFieldGet(this, _provider);
|
|
179
178
|
}
|
|
180
179
|
|
|
181
180
|
async getSigner() {
|
|
@@ -222,8 +221,8 @@ async function _switchChain2(chainId) {
|
|
|
222
221
|
};
|
|
223
222
|
} catch (error) {
|
|
224
223
|
const message = typeof error === 'string' ? error : error === null || error === void 0 ? void 0 : error.message;
|
|
225
|
-
if (/user rejected request/i.test(message)) throw new
|
|
226
|
-
throw new
|
|
224
|
+
if (/user rejected request/i.test(message)) throw new getProvider.UserRejectedRequestError(error);
|
|
225
|
+
throw new getProvider.SwitchChainError(error);
|
|
227
226
|
}
|
|
228
227
|
}
|
|
229
228
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { j as Connector, _ as _classPrivateMethodInitSpec, r as _defineProperty, s as _classPrivateFieldInitSpec, n as normalizeChainId, g as getClient, v as _classPrivateMethodGet, U as UserRejectedRequestError, t as _classPrivateFieldGet, u as _classPrivateFieldSet, o as SwitchChainError } from '../../../dist/getProvider-dda5b21b.esm.js';
|
|
2
2
|
import { providers } from 'ethers';
|
|
3
3
|
import { getAddress, hexValue } from 'ethers/lib/utils';
|
|
4
|
-
import { g as getClient } from '../../../dist/client-a05fd511.esm.js';
|
|
5
|
-
import 'eventemitter3';
|
|
6
|
-
import '../../../dist/chains-fd2c546c.esm.js';
|
|
7
|
-
import '../../../dist/rpcs-b73a8f60.esm.js';
|
|
8
|
-
import 'zustand/vanilla';
|
|
9
4
|
import 'zustand/middleware';
|
|
5
|
+
import 'zustand/vanilla';
|
|
6
|
+
import 'eventemitter3';
|
|
7
|
+
import '../../../dist/chains-4b1a6cf8.esm.js';
|
|
8
|
+
import '../../../dist/rpcs-5dc0ea1f.esm.js';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Wallets that support chain switching through WalletConnect
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var rpcs = require('./rpcs-
|
|
3
|
+
var rpcs = require('./rpcs-4b3a7778.cjs.prod.js');
|
|
4
4
|
|
|
5
5
|
const etherscanBlockExplorers = {
|
|
6
6
|
mainnet: {
|
|
@@ -401,9 +401,9 @@ const chain = {
|
|
|
401
401
|
hardhat,
|
|
402
402
|
foundry
|
|
403
403
|
};
|
|
404
|
-
const allChains =
|
|
405
|
-
const defaultChains = [
|
|
406
|
-
const defaultL2Chains = [
|
|
404
|
+
const allChains = [mainnet, ropsten, rinkeby, goerli, kovan, optimism, optimismKovan, polygon, polygonMumbai, arbitrum, arbitrumRinkeby, localhost, hardhat, foundry];
|
|
405
|
+
const defaultChains = [mainnet, ropsten, rinkeby, goerli, kovan];
|
|
406
|
+
const defaultL2Chains = [arbitrum, arbitrumRinkeby, optimism, optimismKovan];
|
|
407
407
|
|
|
408
408
|
exports.allChains = allChains;
|
|
409
409
|
exports.arbitrum = arbitrum;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as alchemyRpcUrls, p as publicRpcUrls, i as infuraRpcUrls } from './rpcs-
|
|
1
|
+
import { a as alchemyRpcUrls, p as publicRpcUrls, i as infuraRpcUrls } from './rpcs-5dc0ea1f.esm.js';
|
|
2
2
|
|
|
3
3
|
const etherscanBlockExplorers = {
|
|
4
4
|
mainnet: {
|
|
@@ -399,8 +399,8 @@ const chain = {
|
|
|
399
399
|
hardhat,
|
|
400
400
|
foundry
|
|
401
401
|
};
|
|
402
|
-
const allChains =
|
|
403
|
-
const defaultChains = [
|
|
404
|
-
const defaultL2Chains = [
|
|
402
|
+
const allChains = [mainnet, ropsten, rinkeby, goerli, kovan, optimism, optimismKovan, polygon, polygonMumbai, arbitrum, arbitrumRinkeby, localhost, hardhat, foundry];
|
|
403
|
+
const defaultChains = [mainnet, ropsten, rinkeby, goerli, kovan];
|
|
404
|
+
const defaultL2Chains = [arbitrum, arbitrumRinkeby, optimism, optimismKovan];
|
|
405
405
|
|
|
406
406
|
export { allChains as a, chainId as b, chain as c, defaultChains as d, defaultL2Chains as e, etherscanBlockExplorers as f, arbitrum as g, arbitrumRinkeby as h, foundry as i, goerli as j, hardhat as k, kovan as l, localhost as m, mainnet as n, optimism as o, optimismKovan as p, polygon as q, polygonMumbai as r, rinkeby as s, ropsten as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var rpcs = require('./rpcs-
|
|
3
|
+
var rpcs = require('./rpcs-3d4e8104.cjs.dev.js');
|
|
4
4
|
|
|
5
5
|
const etherscanBlockExplorers = {
|
|
6
6
|
mainnet: {
|
|
@@ -401,9 +401,9 @@ const chain = {
|
|
|
401
401
|
hardhat,
|
|
402
402
|
foundry
|
|
403
403
|
};
|
|
404
|
-
const allChains =
|
|
405
|
-
const defaultChains = [
|
|
406
|
-
const defaultL2Chains = [
|
|
404
|
+
const allChains = [mainnet, ropsten, rinkeby, goerli, kovan, optimism, optimismKovan, polygon, polygonMumbai, arbitrum, arbitrumRinkeby, localhost, hardhat, foundry];
|
|
405
|
+
const defaultChains = [mainnet, ropsten, rinkeby, goerli, kovan];
|
|
406
|
+
const defaultL2Chains = [arbitrum, arbitrumRinkeby, optimism, optimismKovan];
|
|
407
407
|
|
|
408
408
|
exports.allChains = allChains;
|
|
409
409
|
exports.arbitrum = arbitrum;
|
|
@@ -14,7 +14,6 @@ export declare type FetchBalanceResult = {
|
|
|
14
14
|
decimals: number;
|
|
15
15
|
formatted: string;
|
|
16
16
|
symbol: string;
|
|
17
|
-
unit: Unit | number;
|
|
18
17
|
value: BigNumber;
|
|
19
18
|
};
|
|
20
19
|
export declare function fetchBalance({ addressOrName, chainId, formatUnits: unit, token, }: FetchBalanceArgs): Promise<FetchBalanceResult>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Signer } from '
|
|
2
|
-
export declare type FetchSignerResult = Signer | null;
|
|
3
|
-
export declare function fetchSigner(): Promise<FetchSignerResult
|
|
1
|
+
import { Signer } from '../../types';
|
|
2
|
+
export declare type FetchSignerResult<TSigner extends Signer = Signer> = TSigner | null;
|
|
3
|
+
export declare function fetchSigner<TSigner extends Signer = Signer>(): Promise<FetchSignerResult<TSigner>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CallOverrides, Contract, providers } from 'ethers';
|
|
2
|
+
import { GetContractArgs } from './getContract';
|
|
3
|
+
export declare type DeprecatedWriteContractConfig = GetContractArgs & {
|
|
4
|
+
/**
|
|
5
|
+
* Chain id to use for write
|
|
6
|
+
* If signer is not active on this chain, it will attempt to programmatically switch
|
|
7
|
+
*/
|
|
8
|
+
chainId?: number;
|
|
9
|
+
/** Method to call on contract */
|
|
10
|
+
functionName: string;
|
|
11
|
+
/** Arguments to pass contract method */
|
|
12
|
+
args?: any | any[];
|
|
13
|
+
overrides?: CallOverrides;
|
|
14
|
+
};
|
|
15
|
+
export declare type DeprecatedWriteContractResult = providers.TransactionResponse;
|
|
16
|
+
export declare function deprecatedWriteContract<TContract extends Contract = Contract>({ addressOrName, args, chainId, contractInterface, functionName, overrides, signerOrProvider, }: DeprecatedWriteContractConfig): Promise<DeprecatedWriteContractResult>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
export { deprecatedWriteContract, type DeprecatedWriteContractConfig, type DeprecatedWriteContractResult, } from './deprecatedWriteContract';
|
|
2
|
+
export { fetchToken, type FetchTokenArgs, type FetchTokenResult, } from './fetchToken';
|
|
3
|
+
export { prepareWriteContract, type PrepareWriteContractConfig, type PrepareWriteContractResult, } from './prepareWriteContract';
|
|
1
4
|
export { getContract, type GetContractArgs } from './getContract';
|
|
2
5
|
export { readContract, type ReadContractConfig, type ReadContractResult, } from './readContract';
|
|
3
6
|
export { readContracts, type ReadContractsConfig, type ReadContractsResult, } from './readContracts';
|
|
4
7
|
export { watchContractEvent } from './watchContractEvent';
|
|
5
8
|
export { watchReadContract, type WatchReadContractConfig, type WatchReadContractResult, } from './watchReadContract';
|
|
6
9
|
export { watchReadContracts, type WatchReadContractsConfig, type WatchReadContractsResult, } from './watchReadContracts';
|
|
7
|
-
export { writeContract, type
|
|
10
|
+
export { writeContract, type WriteContractArgs, type WriteContractPreparedArgs, type WriteContractResult, type WriteContractUnpreparedArgs, } from './writeContract';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CallOverrides, Contract, PopulatedTransaction } from 'ethers/lib/ethers';
|
|
2
|
+
import { Address, Signer } from '../../types';
|
|
3
|
+
import { GetContractArgs } from './getContract';
|
|
4
|
+
export declare type PrepareWriteContractConfig<TSigner extends Signer = Signer> = Omit<GetContractArgs, 'signerOrProvider'> & {
|
|
5
|
+
/** Chain ID used to validate if the signer is connected to the target chain */
|
|
6
|
+
chainId?: number;
|
|
7
|
+
/** Method to call on contract */
|
|
8
|
+
functionName: string;
|
|
9
|
+
/** Arguments to pass contract method */
|
|
10
|
+
args?: any | any[];
|
|
11
|
+
overrides?: CallOverrides;
|
|
12
|
+
signer?: TSigner | null;
|
|
13
|
+
};
|
|
14
|
+
export declare type PrepareWriteContractResult<TSigner extends Signer = Signer> = PrepareWriteContractConfig<TSigner> & {
|
|
15
|
+
chainId?: number;
|
|
16
|
+
request: PopulatedTransaction & {
|
|
17
|
+
to: Address;
|
|
18
|
+
gasLimit: NonNullable<PopulatedTransaction['gasLimit']>;
|
|
19
|
+
};
|
|
20
|
+
mode: 'prepared';
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* @description Prepares the parameters required for a contract write transaction.
|
|
24
|
+
*
|
|
25
|
+
* Returns config to be passed through to `writeContract`.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* import { prepareWriteContract, writeContract } from '@wagmi/core'
|
|
29
|
+
*
|
|
30
|
+
* const config = await prepareWriteContract({
|
|
31
|
+
* addressOrName: '0x...',
|
|
32
|
+
* contractInterface: wagmiAbi,
|
|
33
|
+
* functionName: 'mint',
|
|
34
|
+
* })
|
|
35
|
+
* const result = await writeContract(config)
|
|
36
|
+
*/
|
|
37
|
+
export declare function prepareWriteContract<TContract extends Contract = Contract, TSigner extends Signer = Signer>({ addressOrName, args, chainId, contractInterface, functionName, overrides, signer: signer_, }: PrepareWriteContractConfig): Promise<PrepareWriteContractResult<TSigner>>;
|
|
@@ -1,16 +1,52 @@
|
|
|
1
|
-
import { CallOverrides,
|
|
1
|
+
import { CallOverrides, PopulatedTransaction } from 'ethers';
|
|
2
|
+
import { Address } from '../../types';
|
|
3
|
+
import { SendTransactionResult } from '../transactions';
|
|
2
4
|
import { GetContractArgs } from './getContract';
|
|
3
|
-
export declare type
|
|
5
|
+
export declare type WriteContractPreparedArgs = {
|
|
4
6
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
7
|
+
* `recklesslyUnprepared`: Allow to pass through unprepared config. Note: This has
|
|
8
|
+
* [UX pitfalls](https://wagmi.sh/docs/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks),
|
|
9
|
+
* it is highly recommended to not use this and instead prepare the request upfront
|
|
10
|
+
* using the {@link prepareWriteContract} function.
|
|
11
|
+
*
|
|
12
|
+
* `prepared`: The request has been prepared with parameters required for sending a transaction
|
|
13
|
+
* via the {@link prepareWriteContract} function
|
|
14
|
+
* */
|
|
15
|
+
mode: 'prepared';
|
|
16
|
+
/** The prepared request. */
|
|
17
|
+
request: PopulatedTransaction & {
|
|
18
|
+
to: Address;
|
|
19
|
+
gasLimit: NonNullable<PopulatedTransaction['gasLimit']>;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare type WriteContractUnpreparedArgs = {
|
|
23
|
+
mode: 'recklesslyUnprepared';
|
|
24
|
+
request?: undefined;
|
|
25
|
+
};
|
|
26
|
+
export declare type WriteContractArgs = Omit<GetContractArgs, 'signerOrProvider'> & {
|
|
27
|
+
/** Chain ID used to validate if the signer is connected to the target chain */
|
|
8
28
|
chainId?: number;
|
|
9
29
|
/** Method to call on contract */
|
|
10
30
|
functionName: string;
|
|
11
31
|
/** Arguments to pass contract method */
|
|
12
32
|
args?: any | any[];
|
|
13
33
|
overrides?: CallOverrides;
|
|
14
|
-
};
|
|
15
|
-
export declare type WriteContractResult =
|
|
16
|
-
|
|
34
|
+
} & (WriteContractUnpreparedArgs | WriteContractPreparedArgs);
|
|
35
|
+
export declare type WriteContractResult = SendTransactionResult;
|
|
36
|
+
/**
|
|
37
|
+
* @description Function to call a contract write method.
|
|
38
|
+
*
|
|
39
|
+
* It is recommended to pair this with the {@link prepareWriteContract} function
|
|
40
|
+
* to avoid [UX pitfalls](https://wagmi.sh/docs/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks).
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* import { prepareWriteContract, writeContract } from '@wagmi/core'
|
|
44
|
+
*
|
|
45
|
+
* const config = await prepareWriteContract({
|
|
46
|
+
* addressOrName: '0x...',
|
|
47
|
+
* contractInterface: wagmiAbi,
|
|
48
|
+
* functionName: 'mint',
|
|
49
|
+
* })
|
|
50
|
+
* const result = await writeContract(config)
|
|
51
|
+
*/
|
|
52
|
+
export declare function writeContract({ addressOrName, args, chainId, contractInterface, functionName, mode, overrides, request: request_, }: WriteContractArgs): Promise<WriteContractResult>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { Address } from '../../types';
|
|
1
2
|
export declare type FetchEnsAddressArgs = {
|
|
2
3
|
/** Chain id to use for provider */
|
|
3
4
|
chainId?: number;
|
|
4
5
|
/** ENS name to resolve */
|
|
5
6
|
name: string;
|
|
6
7
|
};
|
|
7
|
-
export declare type FetchEnsAddressResult =
|
|
8
|
+
export declare type FetchEnsAddressResult = Address | null;
|
|
8
9
|
export declare function fetchEnsAddress({ chainId, name, }: FetchEnsAddressArgs): Promise<FetchEnsAddressResult>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { connect, disconnect, fetchBalance, fetchSigner, getAccount, getNetwork, signMessage, signTypedData, switchNetwork, watchAccount, watchNetwork, watchSigner, type ConnectArgs, type ConnectResult, type FetchBalanceArgs, type FetchBalanceResult, type FetchSignerResult, type GetAccountResult, type GetNetworkResult, type SignMessageArgs, type SignMessageResult, type SignTypedDataArgs, type SignTypedDataResult, type SwitchNetworkArgs, type SwitchNetworkResult, type WatchAccountCallback, type WatchNetworkCallback, type WatchSignerCallback, } from './accounts';
|
|
2
|
-
export { getContract, readContract, readContracts, watchContractEvent, watchReadContract, watchReadContracts, writeContract, type GetContractArgs, type ReadContractConfig, type ReadContractResult, type ReadContractsConfig, type ReadContractsResult, type WatchReadContractConfig, type WatchReadContractResult, type WatchReadContractsConfig, type WatchReadContractsResult, type
|
|
2
|
+
export { deprecatedWriteContract, fetchToken, getContract, prepareWriteContract, readContract, readContracts, watchContractEvent, watchReadContract, watchReadContracts, writeContract, type DeprecatedWriteContractConfig, type DeprecatedWriteContractResult, type FetchTokenArgs, type FetchTokenResult, type GetContractArgs, type PrepareWriteContractConfig, type PrepareWriteContractResult, type ReadContractConfig, type ReadContractResult, type ReadContractsConfig, type ReadContractsResult, type WatchReadContractConfig, type WatchReadContractResult, type WatchReadContractsConfig, type WatchReadContractsResult, type WriteContractArgs, type WriteContractPreparedArgs, type WriteContractResult, type WriteContractUnpreparedArgs, } from './contracts';
|
|
3
3
|
export { fetchEnsAddress, fetchEnsAvatar, fetchEnsName, fetchEnsResolver, type FetchEnsAddressArgs, type FetchEnsAddressResult, type FetchEnsAvatarArgs, type FetchEnsAvatarResult, type FetchEnsNameArgs, type FetchEnsNameResult, type FetchEnsResolverArgs, type FetchEnsResolverResult, } from './ens';
|
|
4
4
|
export { fetchBlockNumber, fetchFeeData, watchBlockNumber, type FetchBlockNumberArgs, type FetchBlockNumberResult, type FetchFeeDataArgs, type FetchFeeDataResult, type WatchBlockNumberArgs, type WatchBlockNumberCallback, } from './network-status';
|
|
5
5
|
export { getProvider, getWebSocketProvider, watchProvider, watchWebSocketProvider, type GetProviderArgs, type GetProviderResult, type GetWebSocketProviderArgs, type GetWebSocketProviderResult, type WatchProviderCallback, type WatchWebSocketProviderCallback, } from './providers';
|
|
6
|
-
export {
|
|
7
|
-
export { sendTransaction, waitForTransaction, type SendTransactionArgs, type SendTransactionResult, type WaitForTransactionArgs, type WaitForTransactionResult, } from './transactions';
|
|
6
|
+
export { deprecatedSendTransaction, fetchTransaction, prepareSendTransaction, sendTransaction, waitForTransaction, type DeprecatedSendTransactionArgs, type DeprecatedSendTransactionResult, type FetchTransactionArgs, type FetchTransactionResult, type PrepareSendTransactionArgs, type PrepareSendTransactionResult, type SendTransactionArgs, type SendTransactionPreparedRequest, type SendTransactionResult, type SendTransactionUnpreparedRequest, type WaitForTransactionArgs, type WaitForTransactionResult, } from './transactions';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { providers } from 'ethers';
|
|
2
|
+
export declare type DeprecatedSendTransactionArgs = {
|
|
3
|
+
/**
|
|
4
|
+
* Chain id to use for write
|
|
5
|
+
* If signer is not active on this chain, it will attempt to programmatically switch
|
|
6
|
+
*/
|
|
7
|
+
chainId?: number;
|
|
8
|
+
/** Object to use when creating transaction */
|
|
9
|
+
request: providers.TransactionRequest;
|
|
10
|
+
};
|
|
11
|
+
export declare type DeprecatedSendTransactionResult = providers.TransactionResponse;
|
|
12
|
+
export declare function deprecatedSendTransaction({ chainId, request, }: DeprecatedSendTransactionArgs): Promise<DeprecatedSendTransactionResult>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { providers } from 'ethers';
|
|
2
|
+
import { Hash } from '../../types';
|
|
3
|
+
export declare type FetchTransactionArgs = {
|
|
4
|
+
/** Chain ID used to validate if the signer is connected to the target chain */
|
|
5
|
+
chainId?: number;
|
|
6
|
+
/** Transaction hash */
|
|
7
|
+
hash: Hash;
|
|
8
|
+
};
|
|
9
|
+
export declare type FetchTransactionResult = providers.TransactionResponse;
|
|
10
|
+
/**
|
|
11
|
+
* @description Fetches transaction for hash
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* import { fetchTransaction } from '@wagmi/core'
|
|
15
|
+
*
|
|
16
|
+
* const transaction = await fetchTransaction({
|
|
17
|
+
* chainId: 1,
|
|
18
|
+
* hash: '0x...',
|
|
19
|
+
* })
|
|
20
|
+
*/
|
|
21
|
+
export declare function fetchTransaction({ chainId, hash, }: FetchTransactionArgs): Promise<FetchTransactionResult>;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { deprecatedSendTransaction, type DeprecatedSendTransactionArgs, type DeprecatedSendTransactionResult, } from './deprecatedSendTransaction';
|
|
2
|
+
export { fetchTransaction, type FetchTransactionArgs, type FetchTransactionResult, } from './fetchTransaction';
|
|
3
|
+
export { prepareSendTransaction, type PrepareSendTransactionArgs, type PrepareSendTransactionResult, } from './prepareSendTransaction';
|
|
4
|
+
export { sendTransaction, type SendTransactionArgs, type SendTransactionPreparedRequest, type SendTransactionResult, type SendTransactionUnpreparedRequest, } from './sendTransaction';
|
|
2
5
|
export { waitForTransaction, type WaitForTransactionArgs, type WaitForTransactionResult, } from './waitForTransaction';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { providers } from 'ethers';
|
|
2
|
+
import { Address } from '../../types';
|
|
3
|
+
export declare type PrepareSendTransactionArgs = {
|
|
4
|
+
/** Chain ID used to validate if the signer is connected to the target chain */
|
|
5
|
+
chainId?: number;
|
|
6
|
+
/** Request data to prepare the transaction */
|
|
7
|
+
request: providers.TransactionRequest & {
|
|
8
|
+
to: NonNullable<providers.TransactionRequest['to']>;
|
|
9
|
+
};
|
|
10
|
+
signerOrProvider?: providers.JsonRpcSigner | providers.Provider;
|
|
11
|
+
};
|
|
12
|
+
export declare type PrepareSendTransactionResult = {
|
|
13
|
+
chainId?: number;
|
|
14
|
+
request: providers.TransactionRequest & {
|
|
15
|
+
to: Address;
|
|
16
|
+
gasLimit: NonNullable<providers.TransactionRequest['gasLimit']>;
|
|
17
|
+
};
|
|
18
|
+
mode: 'prepared';
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* @description Prepares the parameters required for sending a transaction.
|
|
22
|
+
*
|
|
23
|
+
* Returns config to be passed through to `sendTransaction`.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* import { prepareSendTransaction, sendTransaction } from '@wagmi/core'
|
|
27
|
+
*
|
|
28
|
+
* const config = await prepareSendTransaction({
|
|
29
|
+
* request: {
|
|
30
|
+
* to: 'moxey.eth',
|
|
31
|
+
* value: parseEther('1'),
|
|
32
|
+
* }
|
|
33
|
+
* })
|
|
34
|
+
* const result = await sendTransaction(config)
|
|
35
|
+
*/
|
|
36
|
+
export declare function prepareSendTransaction({ chainId, request, signerOrProvider, }: PrepareSendTransactionArgs): Promise<PrepareSendTransactionResult>;
|
|
@@ -1,12 +1,47 @@
|
|
|
1
1
|
import { providers } from 'ethers';
|
|
2
|
-
|
|
2
|
+
import { Address } from '../../types';
|
|
3
|
+
export declare type SendTransactionPreparedRequest = {
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
* `recklesslyUnprepared`: Allow to pass through an unprepared `request`. Note: This has
|
|
6
|
+
* [UX pitfalls](/docs/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks), it is highly recommended
|
|
7
|
+
* to not use this and instead prepare the request upfront using the `prepareSendTransaction` function.
|
|
8
|
+
*
|
|
9
|
+
* `prepared`: The request has been prepared with parameters required for sending a transaction
|
|
10
|
+
* via the `prepareSendTransaction` function
|
|
11
|
+
* */
|
|
12
|
+
mode: 'prepared';
|
|
13
|
+
/** The prepared request for sending a transaction. */
|
|
14
|
+
request: providers.TransactionRequest & {
|
|
15
|
+
to: Address;
|
|
16
|
+
gasLimit: NonNullable<providers.TransactionRequest['gasLimit']>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare type SendTransactionUnpreparedRequest = {
|
|
20
|
+
mode: 'recklesslyUnprepared';
|
|
21
|
+
/** The unprepared request for sending a transaction. */
|
|
9
22
|
request: providers.TransactionRequest;
|
|
10
23
|
};
|
|
11
|
-
export declare type
|
|
12
|
-
|
|
24
|
+
export declare type SendTransactionArgs = {
|
|
25
|
+
/** Chain ID used to validate if the signer is connected to the target chain */
|
|
26
|
+
chainId?: number;
|
|
27
|
+
} & (SendTransactionPreparedRequest | SendTransactionUnpreparedRequest);
|
|
28
|
+
export declare type SendTransactionResult = {
|
|
29
|
+
hash: providers.TransactionResponse['hash'];
|
|
30
|
+
wait: providers.TransactionResponse['wait'];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @description Function to send a transaction.
|
|
34
|
+
*
|
|
35
|
+
* It is recommended to pair this with the `prepareSendTransaction` function to avoid
|
|
36
|
+
* [UX pitfalls](https://wagmi.sh/docs/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks).
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* import { prepareSendTransaction, sendTransaction } from '@wagmi/core'
|
|
40
|
+
*
|
|
41
|
+
* const config = await prepareSendTransaction({
|
|
42
|
+
* to: 'moxey.eth',
|
|
43
|
+
* value: parseEther('1'),
|
|
44
|
+
* })
|
|
45
|
+
* const result = await sendTransaction(config)
|
|
46
|
+
*/
|
|
47
|
+
export declare function sendTransaction({ chainId, mode, request, }: SendTransactionArgs): Promise<SendTransactionResult>;
|
|
@@ -25,7 +25,7 @@ export declare type ClientConfig<TProvider extends Provider = Provider, TWebSock
|
|
|
25
25
|
}) => TWebSocketProvider | undefined) | TWebSocketProvider;
|
|
26
26
|
};
|
|
27
27
|
export declare type Data<TProvider extends Provider> = ConnectorData<TProvider>;
|
|
28
|
-
export declare type State<TProvider extends Provider, TWebSocketProvider extends WebSocketProvider = WebSocketProvider> = {
|
|
28
|
+
export declare type State<TProvider extends Provider = Provider, TWebSocketProvider extends WebSocketProvider = WebSocketProvider> = {
|
|
29
29
|
chains?: Connector['chains'];
|
|
30
30
|
connector?: Connector;
|
|
31
31
|
connectors: Connector[];
|
|
@@ -51,8 +51,8 @@ export declare class Client<TProvider extends Provider = Provider, TWebSocketPro
|
|
|
51
51
|
]>;
|
|
52
52
|
constructor({ autoConnect, connectors, provider, storage, webSocketProvider, }: ClientConfig<TProvider, TWebSocketProvider>);
|
|
53
53
|
get chains(): import("./types").Chain[] | undefined;
|
|
54
|
-
get connectors(): Connector<any, any>[];
|
|
55
|
-
get connector(): Connector<any, any> | undefined;
|
|
54
|
+
get connectors(): Connector<any, any, any>[];
|
|
55
|
+
get connector(): Connector<any, any, any> | undefined;
|
|
56
56
|
get data(): Data<TProvider> | undefined;
|
|
57
57
|
get error(): Error | undefined;
|
|
58
58
|
get lastUsedChainId(): number | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as EventEmitter } from 'eventemitter3';
|
|
2
|
-
import { Signer } from 'ethers/lib/ethers';
|
|
3
2
|
import { Chain } from '../types';
|
|
4
3
|
export declare type ConnectorData<Provider = any> = {
|
|
5
4
|
account?: string;
|
|
@@ -19,7 +18,7 @@ export interface ConnectorEvents<Provider = any> {
|
|
|
19
18
|
disconnect(): void;
|
|
20
19
|
error(error: Error): void;
|
|
21
20
|
}
|
|
22
|
-
export declare abstract class Connector<Provider = any, Options = any> extends EventEmitter<ConnectorEvents<Provider>> {
|
|
21
|
+
export declare abstract class Connector<Provider = any, Options = any, Signer = any> extends EventEmitter<ConnectorEvents<Provider>> {
|
|
23
22
|
/** Unique connector id */
|
|
24
23
|
abstract readonly id: string;
|
|
25
24
|
/** Connector name */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { providers } from 'ethers';
|
|
2
1
|
import type { CoinbaseWalletProvider } from '@coinbase/wallet-sdk';
|
|
3
2
|
import type { CoinbaseWalletSDKOptions } from '@coinbase/wallet-sdk/dist/CoinbaseWalletSDK';
|
|
3
|
+
import { providers } from 'ethers';
|
|
4
4
|
import { Chain } from '../types';
|
|
5
5
|
import { Connector } from './base';
|
|
6
6
|
declare type Options = CoinbaseWalletSDKOptions & {
|
|
@@ -15,7 +15,7 @@ declare type Options = CoinbaseWalletSDKOptions & {
|
|
|
15
15
|
*/
|
|
16
16
|
chainId?: number;
|
|
17
17
|
};
|
|
18
|
-
export declare class CoinbaseWalletConnector extends Connector<CoinbaseWalletProvider, Options> {
|
|
18
|
+
export declare class CoinbaseWalletConnector extends Connector<CoinbaseWalletProvider, Options, providers.JsonRpcSigner> {
|
|
19
19
|
#private;
|
|
20
20
|
readonly id = "coinbaseWallet";
|
|
21
21
|
readonly name = "Coinbase Wallet";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { InjectedConnector } from './injected';
|
|
1
|
+
export { InjectedConnector, type InjectedConnectorOptions } from './injected';
|
|
2
2
|
export { Connector, type ConnectorData, type ConnectorEvents } from './base';
|
|
@@ -18,12 +18,12 @@ export declare type InjectedConnectorOptions = {
|
|
|
18
18
|
*/
|
|
19
19
|
shimDisconnect?: boolean;
|
|
20
20
|
};
|
|
21
|
-
export declare
|
|
22
|
-
export declare class InjectedConnector extends Connector<Window['ethereum'], InjectedConnectorOptions | undefined> {
|
|
21
|
+
export declare class InjectedConnector extends Connector<Window['ethereum'], InjectedConnectorOptions | undefined, providers.JsonRpcSigner> {
|
|
23
22
|
#private;
|
|
24
23
|
readonly id: string;
|
|
25
24
|
readonly name: string;
|
|
26
25
|
readonly ready: boolean;
|
|
26
|
+
protected shimDisconnectKey: string;
|
|
27
27
|
constructor({ chains, options, }?: {
|
|
28
28
|
chains?: Chain[];
|
|
29
29
|
options?: InjectedConnectorOptions;
|
|
@@ -36,12 +36,12 @@ export declare class InjectedConnector extends Connector<Window['ethereum'], Inj
|
|
|
36
36
|
id: number;
|
|
37
37
|
unsupported: boolean;
|
|
38
38
|
};
|
|
39
|
-
provider: Ethereum;
|
|
39
|
+
provider: import("../types").Ethereum;
|
|
40
40
|
}>;
|
|
41
41
|
disconnect(): Promise<void>;
|
|
42
42
|
getAccount(): Promise<string>;
|
|
43
43
|
getChainId(): Promise<number>;
|
|
44
|
-
getProvider(): Promise<Ethereum | undefined>;
|
|
44
|
+
getProvider(): Promise<import("../types").Ethereum | undefined>;
|
|
45
45
|
getSigner(): Promise<providers.JsonRpcSigner>;
|
|
46
46
|
isAuthorized(): Promise<boolean>;
|
|
47
47
|
switchChain(chainId: number): Promise<Chain>;
|