@wagmi/core 0.4.6 → 0.4.9
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/chains/dist/wagmi-core-chains.cjs.dev.js +1 -1
- package/chains/dist/wagmi-core-chains.cjs.prod.js +1 -1
- package/chains/dist/wagmi-core-chains.esm.js +1 -1
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.dev.js +4 -3
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.prod.js +4 -3
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.esm.js +4 -3
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.dev.js +5 -5
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.prod.js +5 -5
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.esm.js +5 -5
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.dev.js +2 -2
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.prod.js +2 -2
- package/connectors/mock/dist/wagmi-core-connectors-mock.esm.js +2 -2
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.dev.js +3 -3
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.prod.js +3 -3
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.esm.js +3 -3
- package/dist/{base-797ad073.cjs.prod.js → base-337e6424.cjs.prod.js} +1 -1
- package/dist/{base-90b7f3e4.cjs.dev.js → base-bd337280.cjs.dev.js} +1 -1
- package/dist/{base-b565d5d4.esm.js → base-f1bbf263.esm.js} +1 -1
- package/dist/{chains-fd2c546c.esm.js → chains-174cf4b4.esm.js} +3 -3
- package/dist/{chains-f7bb3211.cjs.prod.js → chains-b8e32454.cjs.prod.js} +3 -3
- package/dist/{chains-7e6dc59c.cjs.dev.js → chains-ba6218fb.cjs.dev.js} +3 -3
- package/dist/{client-71ece661.cjs.dev.js → client-4983a639.cjs.dev.js} +17 -14
- package/dist/{client-a6e61429.cjs.prod.js → client-dfad744f.cjs.prod.js} +17 -14
- package/dist/{client-a05fd511.esm.js → client-fbdcbdb2.esm.js} +18 -14
- package/dist/declarations/src/actions/tokens/fetchToken.d.ts +1 -0
- package/dist/declarations/src/client.d.ts +1 -1
- package/dist/declarations/src/connectors/index.d.ts +1 -1
- package/dist/declarations/src/connectors/injected.d.ts +3 -3
- package/dist/declarations/src/connectors/metaMask.d.ts +1 -1
- package/dist/declarations/src/index.d.ts +3 -3
- package/dist/declarations/src/types/index.d.ts +129 -128
- package/dist/declarations/src/utils/getInjectedName.d.ts +2 -1
- package/dist/declarations/src/utils/index.d.ts +1 -0
- package/dist/declarations/src/utils/parseContractResult.d.ts +7 -0
- package/dist/wagmi-core.cjs.dev.js +53 -11
- package/dist/wagmi-core.cjs.prod.js +53 -11
- package/dist/wagmi-core.esm.js +58 -17
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { g as arbitrum, h as arbitrumRinkeby, i as foundry, j as goerli, k as hardhat, l as kovan, m as localhost, n as mainnet, o as optimism, p as optimismKovan, q as polygon, r as polygonMumbai, s as rinkeby, t as ropsten } from '../../dist/chains-
|
|
1
|
+
export { g as arbitrum, h as arbitrumRinkeby, i as foundry, j as goerli, k as hardhat, l as kovan, m as localhost, n as mainnet, o as optimism, p as optimismKovan, q as polygon, r as polygonMumbai, s as rinkeby, t as ropsten } from '../../dist/chains-174cf4b4.esm.js';
|
|
2
2
|
import '../../dist/rpcs-b73a8f60.esm.js';
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var base = require('../../../dist/base-
|
|
5
|
+
var base = require('../../../dist/base-bd337280.cjs.dev.js');
|
|
6
6
|
var ethers = require('ethers');
|
|
7
7
|
var utils = require('ethers/lib/utils');
|
|
8
8
|
require('eventemitter3');
|
|
9
|
-
require('../../../dist/chains-
|
|
9
|
+
require('../../../dist/chains-ba6218fb.cjs.dev.js');
|
|
10
10
|
require('../../../dist/rpcs-f1d24f0e.cjs.dev.js');
|
|
11
11
|
|
|
12
12
|
function _interopNamespace(e) {
|
|
@@ -159,7 +159,8 @@ class CoinbaseWalletConnector extends base.Connector {
|
|
|
159
159
|
let CoinbaseWalletSDK = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@coinbase/wallet-sdk')); })).default; // Workaround for Vite dev import errors
|
|
160
160
|
// https://github.com/vitejs/vite/issues/7112
|
|
161
161
|
|
|
162
|
-
if (
|
|
162
|
+
if (typeof CoinbaseWalletSDK !== 'function' && // @ts-expect-error This import error is not visible to TypeScript
|
|
163
|
+
typeof CoinbaseWalletSDK.default === 'function') CoinbaseWalletSDK = CoinbaseWalletSDK.default;
|
|
163
164
|
|
|
164
165
|
base._classPrivateFieldSet(this, _client, new CoinbaseWalletSDK(this.options));
|
|
165
166
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var base = require('../../../dist/base-
|
|
5
|
+
var base = require('../../../dist/base-337e6424.cjs.prod.js');
|
|
6
6
|
var ethers = require('ethers');
|
|
7
7
|
var utils = require('ethers/lib/utils');
|
|
8
8
|
require('eventemitter3');
|
|
9
|
-
require('../../../dist/chains-
|
|
9
|
+
require('../../../dist/chains-b8e32454.cjs.prod.js');
|
|
10
10
|
require('../../../dist/rpcs-1fd0a12f.cjs.prod.js');
|
|
11
11
|
|
|
12
12
|
function _interopNamespace(e) {
|
|
@@ -159,7 +159,8 @@ class CoinbaseWalletConnector extends base.Connector {
|
|
|
159
159
|
let CoinbaseWalletSDK = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@coinbase/wallet-sdk')); })).default; // Workaround for Vite dev import errors
|
|
160
160
|
// https://github.com/vitejs/vite/issues/7112
|
|
161
161
|
|
|
162
|
-
if (
|
|
162
|
+
if (typeof CoinbaseWalletSDK !== 'function' && // @ts-expect-error This import error is not visible to TypeScript
|
|
163
|
+
typeof CoinbaseWalletSDK.default === 'function') CoinbaseWalletSDK = CoinbaseWalletSDK.default;
|
|
163
164
|
|
|
164
165
|
base._classPrivateFieldSet(this, _client, new CoinbaseWalletSDK(this.options));
|
|
165
166
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { e as Connector, m as _classPrivateMethodInitSpec, _ as _defineProperty, j as _classPrivateFieldInitSpec, n as normalizeChainId, U as UserRejectedRequestError, k as _classPrivateFieldGet, l as _classPrivateFieldSet, f as ChainNotConfiguredError, o as _classPrivateMethodGet, A as AddChainError, i as SwitchChainError } from '../../../dist/base-
|
|
1
|
+
import { e as Connector, m as _classPrivateMethodInitSpec, _ as _defineProperty, j as _classPrivateFieldInitSpec, n as normalizeChainId, U as UserRejectedRequestError, k as _classPrivateFieldGet, l as _classPrivateFieldSet, f as ChainNotConfiguredError, o as _classPrivateMethodGet, A as AddChainError, i as SwitchChainError } from '../../../dist/base-f1bbf263.esm.js';
|
|
2
2
|
import { providers } from 'ethers';
|
|
3
3
|
import { getAddress, hexValue } from 'ethers/lib/utils';
|
|
4
4
|
import 'eventemitter3';
|
|
5
|
-
import '../../../dist/chains-
|
|
5
|
+
import '../../../dist/chains-174cf4b4.esm.js';
|
|
6
6
|
import '../../../dist/rpcs-b73a8f60.esm.js';
|
|
7
7
|
|
|
8
8
|
var _client = /*#__PURE__*/new WeakMap();
|
|
@@ -137,7 +137,8 @@ class CoinbaseWalletConnector extends Connector {
|
|
|
137
137
|
let CoinbaseWalletSDK = (await import('@coinbase/wallet-sdk')).default; // Workaround for Vite dev import errors
|
|
138
138
|
// https://github.com/vitejs/vite/issues/7112
|
|
139
139
|
|
|
140
|
-
if (
|
|
140
|
+
if (typeof CoinbaseWalletSDK !== 'function' && // @ts-expect-error This import error is not visible to TypeScript
|
|
141
|
+
typeof CoinbaseWalletSDK.default === 'function') CoinbaseWalletSDK = CoinbaseWalletSDK.default;
|
|
141
142
|
|
|
142
143
|
_classPrivateFieldSet(this, _client, new CoinbaseWalletSDK(this.options));
|
|
143
144
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var base = require('../../../dist/base-
|
|
6
|
-
var client = require('../../../dist/client-
|
|
5
|
+
var base = require('../../../dist/base-bd337280.cjs.dev.js');
|
|
6
|
+
var client = require('../../../dist/client-4983a639.cjs.dev.js');
|
|
7
7
|
require('eventemitter3');
|
|
8
|
-
require('../../../dist/chains-
|
|
8
|
+
require('../../../dist/chains-ba6218fb.cjs.dev.js');
|
|
9
9
|
require('../../../dist/rpcs-f1d24f0e.cjs.dev.js');
|
|
10
10
|
require('zustand/vanilla');
|
|
11
11
|
require('zustand/middleware');
|
|
@@ -80,7 +80,7 @@ class MetaMaskConnector extends client.InjectedConnector {
|
|
|
80
80
|
}); // Attempt to show wallet select prompt with `wallet_requestPermissions` when
|
|
81
81
|
// `shimDisconnect` is active and account is in disconnected state (flag in storage)
|
|
82
82
|
|
|
83
|
-
if (base._classPrivateFieldGet(this, _UNSTABLE_shimOnConnectSelectAccount) && (_this$options = this.options) !== null && _this$options !== void 0 && _this$options.shimDisconnect && !((_getClient$storage = client.getClient().storage) !== null && _getClient$storage !== void 0 && _getClient$storage.getItem(
|
|
83
|
+
if (base._classPrivateFieldGet(this, _UNSTABLE_shimOnConnectSelectAccount) && (_this$options = this.options) !== null && _this$options !== void 0 && _this$options.shimDisconnect && !((_getClient$storage = client.getClient().storage) !== null && _getClient$storage !== void 0 && _getClient$storage.getItem(this.shimDisconnectKey))) {
|
|
84
84
|
const accounts = await provider.request({
|
|
85
85
|
method: 'eth_accounts'
|
|
86
86
|
}).catch(() => []);
|
|
@@ -104,7 +104,7 @@ class MetaMaskConnector extends client.InjectedConnector {
|
|
|
104
104
|
unsupported = this.isChainUnsupported(id);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
if ((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.shimDisconnect) (_getClient$storage2 = client.getClient().storage) === null || _getClient$storage2 === void 0 ? void 0 : _getClient$storage2.setItem(
|
|
107
|
+
if ((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.shimDisconnect) (_getClient$storage2 = client.getClient().storage) === null || _getClient$storage2 === void 0 ? void 0 : _getClient$storage2.setItem(this.shimDisconnectKey, true);
|
|
108
108
|
return {
|
|
109
109
|
account,
|
|
110
110
|
chain: {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var base = require('../../../dist/base-
|
|
6
|
-
var client = require('../../../dist/client-
|
|
5
|
+
var base = require('../../../dist/base-337e6424.cjs.prod.js');
|
|
6
|
+
var client = require('../../../dist/client-dfad744f.cjs.prod.js');
|
|
7
7
|
require('eventemitter3');
|
|
8
|
-
require('../../../dist/chains-
|
|
8
|
+
require('../../../dist/chains-b8e32454.cjs.prod.js');
|
|
9
9
|
require('../../../dist/rpcs-1fd0a12f.cjs.prod.js');
|
|
10
10
|
require('zustand/vanilla');
|
|
11
11
|
require('zustand/middleware');
|
|
@@ -80,7 +80,7 @@ class MetaMaskConnector extends client.InjectedConnector {
|
|
|
80
80
|
}); // Attempt to show wallet select prompt with `wallet_requestPermissions` when
|
|
81
81
|
// `shimDisconnect` is active and account is in disconnected state (flag in storage)
|
|
82
82
|
|
|
83
|
-
if (base._classPrivateFieldGet(this, _UNSTABLE_shimOnConnectSelectAccount) && (_this$options = this.options) !== null && _this$options !== void 0 && _this$options.shimDisconnect && !((_getClient$storage = client.getClient().storage) !== null && _getClient$storage !== void 0 && _getClient$storage.getItem(
|
|
83
|
+
if (base._classPrivateFieldGet(this, _UNSTABLE_shimOnConnectSelectAccount) && (_this$options = this.options) !== null && _this$options !== void 0 && _this$options.shimDisconnect && !((_getClient$storage = client.getClient().storage) !== null && _getClient$storage !== void 0 && _getClient$storage.getItem(this.shimDisconnectKey))) {
|
|
84
84
|
const accounts = await provider.request({
|
|
85
85
|
method: 'eth_accounts'
|
|
86
86
|
}).catch(() => []);
|
|
@@ -104,7 +104,7 @@ class MetaMaskConnector extends client.InjectedConnector {
|
|
|
104
104
|
unsupported = this.isChainUnsupported(id);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
if ((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.shimDisconnect) (_getClient$storage2 = client.getClient().storage) === null || _getClient$storage2 === void 0 ? void 0 : _getClient$storage2.setItem(
|
|
107
|
+
if ((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.shimDisconnect) (_getClient$storage2 = client.getClient().storage) === null || _getClient$storage2 === void 0 ? void 0 : _getClient$storage2.setItem(this.shimDisconnectKey, true);
|
|
108
108
|
return {
|
|
109
109
|
account,
|
|
110
110
|
chain: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { m as _classPrivateMethodInitSpec, _ as _defineProperty, o as _classPrivateMethodGet, j as _classPrivateFieldInitSpec, l as _classPrivateFieldSet, c as ConnectorNotFoundError, k as _classPrivateFieldGet, U as UserRejectedRequestError, R as ResourceUnavailableError } from '../../../dist/base-
|
|
2
|
-
import { I as InjectedConnector, g as getClient
|
|
1
|
+
import { m as _classPrivateMethodInitSpec, _ as _defineProperty, o as _classPrivateMethodGet, j as _classPrivateFieldInitSpec, l as _classPrivateFieldSet, c as ConnectorNotFoundError, k as _classPrivateFieldGet, U as UserRejectedRequestError, R as ResourceUnavailableError } from '../../../dist/base-f1bbf263.esm.js';
|
|
2
|
+
import { I as InjectedConnector, g as getClient } from '../../../dist/client-fbdcbdb2.esm.js';
|
|
3
3
|
import 'eventemitter3';
|
|
4
|
-
import '../../../dist/chains-
|
|
4
|
+
import '../../../dist/chains-174cf4b4.esm.js';
|
|
5
5
|
import '../../../dist/rpcs-b73a8f60.esm.js';
|
|
6
6
|
import 'zustand/vanilla';
|
|
7
7
|
import 'zustand/middleware';
|
|
@@ -76,7 +76,7 @@ class MetaMaskConnector extends InjectedConnector {
|
|
|
76
76
|
}); // Attempt to show wallet select prompt with `wallet_requestPermissions` when
|
|
77
77
|
// `shimDisconnect` is active and account is in disconnected state (flag in storage)
|
|
78
78
|
|
|
79
|
-
if (_classPrivateFieldGet(this, _UNSTABLE_shimOnConnectSelectAccount) && (_this$options = this.options) !== null && _this$options !== void 0 && _this$options.shimDisconnect && !((_getClient$storage = getClient().storage) !== null && _getClient$storage !== void 0 && _getClient$storage.getItem(shimDisconnectKey))) {
|
|
79
|
+
if (_classPrivateFieldGet(this, _UNSTABLE_shimOnConnectSelectAccount) && (_this$options = this.options) !== null && _this$options !== void 0 && _this$options.shimDisconnect && !((_getClient$storage = getClient().storage) !== null && _getClient$storage !== void 0 && _getClient$storage.getItem(this.shimDisconnectKey))) {
|
|
80
80
|
const accounts = await provider.request({
|
|
81
81
|
method: 'eth_accounts'
|
|
82
82
|
}).catch(() => []);
|
|
@@ -100,7 +100,7 @@ class MetaMaskConnector extends InjectedConnector {
|
|
|
100
100
|
unsupported = this.isChainUnsupported(id);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
if ((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.shimDisconnect) (_getClient$storage2 = getClient().storage) === null || _getClient$storage2 === void 0 ? void 0 : _getClient$storage2.setItem(shimDisconnectKey, true);
|
|
103
|
+
if ((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.shimDisconnect) (_getClient$storage2 = getClient().storage) === null || _getClient$storage2 === void 0 ? void 0 : _getClient$storage2.setItem(this.shimDisconnectKey, true);
|
|
104
104
|
return {
|
|
105
105
|
account,
|
|
106
106
|
chain: {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var base = require('../../../dist/base-
|
|
5
|
+
var base = require('../../../dist/base-bd337280.cjs.dev.js');
|
|
6
6
|
var utils = require('ethers/lib/utils');
|
|
7
7
|
var EventEmitter = require('eventemitter3');
|
|
8
8
|
var ethers = require('ethers');
|
|
9
|
-
require('../../../dist/chains-
|
|
9
|
+
require('../../../dist/chains-ba6218fb.cjs.dev.js');
|
|
10
10
|
require('../../../dist/rpcs-f1d24f0e.cjs.dev.js');
|
|
11
11
|
|
|
12
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var base = require('../../../dist/base-
|
|
5
|
+
var base = require('../../../dist/base-337e6424.cjs.prod.js');
|
|
6
6
|
var utils = require('ethers/lib/utils');
|
|
7
7
|
var EventEmitter = require('eventemitter3');
|
|
8
8
|
var ethers = require('ethers');
|
|
9
|
-
require('../../../dist/chains-
|
|
9
|
+
require('../../../dist/chains-b8e32454.cjs.prod.js');
|
|
10
10
|
require('../../../dist/rpcs-1fd0a12f.cjs.prod.js');
|
|
11
11
|
|
|
12
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as _defineProperty, j as _classPrivateFieldInitSpec, l as _classPrivateFieldSet, k as _classPrivateFieldGet, U as UserRejectedRequestError, e as Connector, m as _classPrivateMethodInitSpec, n as normalizeChainId, o as _classPrivateMethodGet } from '../../../dist/base-
|
|
1
|
+
import { _ as _defineProperty, j as _classPrivateFieldInitSpec, l as _classPrivateFieldSet, k as _classPrivateFieldGet, U as UserRejectedRequestError, e as Connector, m as _classPrivateMethodInitSpec, n as normalizeChainId, o as _classPrivateMethodGet } from '../../../dist/base-f1bbf263.esm.js';
|
|
2
2
|
import { getAddress } from 'ethers/lib/utils';
|
|
3
3
|
import EventEmitter from 'eventemitter3';
|
|
4
4
|
import { providers } from 'ethers';
|
|
5
|
-
import '../../../dist/chains-
|
|
5
|
+
import '../../../dist/chains-174cf4b4.esm.js';
|
|
6
6
|
import '../../../dist/rpcs-b73a8f60.esm.js';
|
|
7
7
|
|
|
8
8
|
var _options = /*#__PURE__*/new WeakMap();
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var base = require('../../../dist/base-
|
|
5
|
+
var base = require('../../../dist/base-bd337280.cjs.dev.js');
|
|
6
6
|
var ethers = require('ethers');
|
|
7
7
|
var utils = require('ethers/lib/utils');
|
|
8
|
-
var client = require('../../../dist/client-
|
|
8
|
+
var client = require('../../../dist/client-4983a639.cjs.dev.js');
|
|
9
9
|
require('eventemitter3');
|
|
10
|
-
require('../../../dist/chains-
|
|
10
|
+
require('../../../dist/chains-ba6218fb.cjs.dev.js');
|
|
11
11
|
require('../../../dist/rpcs-f1d24f0e.cjs.dev.js');
|
|
12
12
|
require('zustand/vanilla');
|
|
13
13
|
require('zustand/middleware');
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var base = require('../../../dist/base-
|
|
5
|
+
var base = require('../../../dist/base-337e6424.cjs.prod.js');
|
|
6
6
|
var ethers = require('ethers');
|
|
7
7
|
var utils = require('ethers/lib/utils');
|
|
8
|
-
var client = require('../../../dist/client-
|
|
8
|
+
var client = require('../../../dist/client-dfad744f.cjs.prod.js');
|
|
9
9
|
require('eventemitter3');
|
|
10
|
-
require('../../../dist/chains-
|
|
10
|
+
require('../../../dist/chains-b8e32454.cjs.prod.js');
|
|
11
11
|
require('../../../dist/rpcs-1fd0a12f.cjs.prod.js');
|
|
12
12
|
require('zustand/vanilla');
|
|
13
13
|
require('zustand/middleware');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { e as Connector, m as _classPrivateMethodInitSpec, _ as _defineProperty, j as _classPrivateFieldInitSpec, n as normalizeChainId, o as _classPrivateMethodGet, U as UserRejectedRequestError, k as _classPrivateFieldGet, l as _classPrivateFieldSet, i as SwitchChainError } from '../../../dist/base-
|
|
1
|
+
import { e as Connector, m as _classPrivateMethodInitSpec, _ as _defineProperty, j as _classPrivateFieldInitSpec, n as normalizeChainId, o as _classPrivateMethodGet, U as UserRejectedRequestError, k as _classPrivateFieldGet, l as _classPrivateFieldSet, i as SwitchChainError } from '../../../dist/base-f1bbf263.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-
|
|
4
|
+
import { g as getClient } from '../../../dist/client-fbdcbdb2.esm.js';
|
|
5
5
|
import 'eventemitter3';
|
|
6
|
-
import '../../../dist/chains-
|
|
6
|
+
import '../../../dist/chains-174cf4b4.esm.js';
|
|
7
7
|
import '../../../dist/rpcs-b73a8f60.esm.js';
|
|
8
8
|
import 'zustand/vanilla';
|
|
9
9
|
import 'zustand/middleware';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventEmitter from 'eventemitter3';
|
|
2
|
-
import { d as defaultChains } from './chains-
|
|
2
|
+
import { d as defaultChains } from './chains-174cf4b4.esm.js';
|
|
3
3
|
|
|
4
4
|
function _checkPrivateRedeclaration(obj, privateCollection) {
|
|
5
5
|
if (privateCollection.has(obj)) {
|
|
@@ -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 };
|
|
@@ -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;
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var base = require('./base-
|
|
3
|
+
var base = require('./base-bd337280.cjs.dev.js');
|
|
4
4
|
var create = require('zustand/vanilla');
|
|
5
5
|
var middleware = require('zustand/middleware');
|
|
6
6
|
var ethers = require('ethers');
|
|
@@ -56,8 +56,6 @@ function getInjectedName(ethereum) {
|
|
|
56
56
|
return (_getName = getName(ethereum)) !== null && _getName !== void 0 ? _getName : 'Injected';
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
const shimDisconnectKey = 'injected.shimDisconnect';
|
|
60
|
-
|
|
61
59
|
var _provider = /*#__PURE__*/new WeakMap();
|
|
62
60
|
|
|
63
61
|
var _switchingChains = /*#__PURE__*/new WeakMap();
|
|
@@ -91,6 +89,8 @@ class InjectedConnector extends base.Connector {
|
|
|
91
89
|
value: void 0
|
|
92
90
|
});
|
|
93
91
|
|
|
92
|
+
base._defineProperty(this, "shimDisconnectKey", 'injected.shimDisconnect');
|
|
93
|
+
|
|
94
94
|
base._defineProperty(this, "onAccountsChanged", accounts => {
|
|
95
95
|
if (accounts.length === 0) this.emit('disconnect');else this.emit('change', {
|
|
96
96
|
account: utils.getAddress(accounts[0])
|
|
@@ -122,17 +122,15 @@ class InjectedConnector extends base.Connector {
|
|
|
122
122
|
|
|
123
123
|
this.emit('disconnect'); // Remove shim signalling wallet is disconnected
|
|
124
124
|
|
|
125
|
-
if ((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.shimDisconnect) (_getClient$storage = getClient().storage) === null || _getClient$storage === void 0 ? void 0 : _getClient$storage.removeItem(shimDisconnectKey);
|
|
125
|
+
if ((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.shimDisconnect) (_getClient$storage = getClient().storage) === null || _getClient$storage === void 0 ? void 0 : _getClient$storage.removeItem(this.shimDisconnectKey);
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
let name = 'Injected';
|
|
129
|
-
|
|
130
|
-
if (typeof window !== 'undefined') {
|
|
131
|
-
const overrideName = options.name;
|
|
129
|
+
const overrideName = options.name;
|
|
130
|
+
if (typeof overrideName === 'string') name = overrideName;else if (typeof window !== 'undefined') {
|
|
132
131
|
const detectedName = getInjectedName(window.ethereum);
|
|
133
|
-
if (overrideName) name =
|
|
132
|
+
if (overrideName) name = overrideName(detectedName);else name = typeof detectedName === 'string' ? detectedName : detectedName[0];
|
|
134
133
|
}
|
|
135
|
-
|
|
136
134
|
this.id = 'injected';
|
|
137
135
|
this.name = name;
|
|
138
136
|
}
|
|
@@ -169,7 +167,7 @@ class InjectedConnector extends base.Connector {
|
|
|
169
167
|
} // Add shim to storage signalling wallet is connected
|
|
170
168
|
|
|
171
169
|
|
|
172
|
-
if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.shimDisconnect) (_getClient$storage2 = getClient().storage) === null || _getClient$storage2 === void 0 ? void 0 : _getClient$storage2.setItem(shimDisconnectKey, true);
|
|
170
|
+
if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.shimDisconnect) (_getClient$storage2 = getClient().storage) === null || _getClient$storage2 === void 0 ? void 0 : _getClient$storage2.setItem(this.shimDisconnectKey, true);
|
|
173
171
|
return {
|
|
174
172
|
account,
|
|
175
173
|
chain: {
|
|
@@ -194,7 +192,7 @@ class InjectedConnector extends base.Connector {
|
|
|
194
192
|
provider.removeListener('chainChanged', this.onChainChanged);
|
|
195
193
|
provider.removeListener('disconnect', this.onDisconnect); // Remove shim signalling wallet is disconnected
|
|
196
194
|
|
|
197
|
-
if ((_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.shimDisconnect) (_getClient$storage3 = getClient().storage) === null || _getClient$storage3 === void 0 ? void 0 : _getClient$storage3.removeItem(shimDisconnectKey);
|
|
195
|
+
if ((_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.shimDisconnect) (_getClient$storage3 = getClient().storage) === null || _getClient$storage3 === void 0 ? void 0 : _getClient$storage3.removeItem(this.shimDisconnectKey);
|
|
198
196
|
}
|
|
199
197
|
|
|
200
198
|
async getAccount() {
|
|
@@ -230,7 +228,7 @@ class InjectedConnector extends base.Connector {
|
|
|
230
228
|
var _this$options5, _getClient$storage4;
|
|
231
229
|
|
|
232
230
|
if ((_this$options5 = this.options) !== null && _this$options5 !== void 0 && _this$options5.shimDisconnect && // If shim does not exist in storage, wallet is disconnected
|
|
233
|
-
!((_getClient$storage4 = getClient().storage) !== null && _getClient$storage4 !== void 0 && _getClient$storage4.getItem(shimDisconnectKey))) return false;
|
|
231
|
+
!((_getClient$storage4 = getClient().storage) !== null && _getClient$storage4 !== void 0 && _getClient$storage4.getItem(this.shimDisconnectKey))) return false;
|
|
234
232
|
const provider = await this.getProvider();
|
|
235
233
|
if (!provider) throw new base.ConnectorNotFoundError();
|
|
236
234
|
const accounts = await provider.request({
|
|
@@ -536,7 +534,13 @@ class Client {
|
|
|
536
534
|
|
|
537
535
|
base._classPrivateFieldSet(this, _isAutoConnecting, true);
|
|
538
536
|
|
|
539
|
-
|
|
537
|
+
this.setState(x => {
|
|
538
|
+
var _x$data;
|
|
539
|
+
|
|
540
|
+
return { ...x,
|
|
541
|
+
status: (_x$data = x.data) !== null && _x$data !== void 0 && _x$data.account ? 'reconnecting' : 'connecting'
|
|
542
|
+
};
|
|
543
|
+
}); // Try last used connector first
|
|
540
544
|
|
|
541
545
|
const sorted = base._classPrivateFieldGet(this, _lastUsedConnector) ? [...this.connectors].sort(x => x.id === base._classPrivateFieldGet(this, _lastUsedConnector) ? -1 : 1) : this.connectors;
|
|
542
546
|
let connected = false;
|
|
@@ -656,4 +660,3 @@ exports.createClient = createClient;
|
|
|
656
660
|
exports.createStorage = createStorage;
|
|
657
661
|
exports.getClient = getClient;
|
|
658
662
|
exports.noopStorage = noopStorage;
|
|
659
|
-
exports.shimDisconnectKey = shimDisconnectKey;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var base = require('./base-
|
|
3
|
+
var base = require('./base-337e6424.cjs.prod.js');
|
|
4
4
|
var create = require('zustand/vanilla');
|
|
5
5
|
var middleware = require('zustand/middleware');
|
|
6
6
|
var ethers = require('ethers');
|
|
@@ -56,8 +56,6 @@ function getInjectedName(ethereum) {
|
|
|
56
56
|
return (_getName = getName(ethereum)) !== null && _getName !== void 0 ? _getName : 'Injected';
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
const shimDisconnectKey = 'injected.shimDisconnect';
|
|
60
|
-
|
|
61
59
|
var _provider = /*#__PURE__*/new WeakMap();
|
|
62
60
|
|
|
63
61
|
var _switchingChains = /*#__PURE__*/new WeakMap();
|
|
@@ -91,6 +89,8 @@ class InjectedConnector extends base.Connector {
|
|
|
91
89
|
value: void 0
|
|
92
90
|
});
|
|
93
91
|
|
|
92
|
+
base._defineProperty(this, "shimDisconnectKey", 'injected.shimDisconnect');
|
|
93
|
+
|
|
94
94
|
base._defineProperty(this, "onAccountsChanged", accounts => {
|
|
95
95
|
if (accounts.length === 0) this.emit('disconnect');else this.emit('change', {
|
|
96
96
|
account: utils.getAddress(accounts[0])
|
|
@@ -122,17 +122,15 @@ class InjectedConnector extends base.Connector {
|
|
|
122
122
|
|
|
123
123
|
this.emit('disconnect'); // Remove shim signalling wallet is disconnected
|
|
124
124
|
|
|
125
|
-
if ((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.shimDisconnect) (_getClient$storage = getClient().storage) === null || _getClient$storage === void 0 ? void 0 : _getClient$storage.removeItem(shimDisconnectKey);
|
|
125
|
+
if ((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.shimDisconnect) (_getClient$storage = getClient().storage) === null || _getClient$storage === void 0 ? void 0 : _getClient$storage.removeItem(this.shimDisconnectKey);
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
let name = 'Injected';
|
|
129
|
-
|
|
130
|
-
if (typeof window !== 'undefined') {
|
|
131
|
-
const overrideName = options.name;
|
|
129
|
+
const overrideName = options.name;
|
|
130
|
+
if (typeof overrideName === 'string') name = overrideName;else if (typeof window !== 'undefined') {
|
|
132
131
|
const detectedName = getInjectedName(window.ethereum);
|
|
133
|
-
if (overrideName) name =
|
|
132
|
+
if (overrideName) name = overrideName(detectedName);else name = typeof detectedName === 'string' ? detectedName : detectedName[0];
|
|
134
133
|
}
|
|
135
|
-
|
|
136
134
|
this.id = 'injected';
|
|
137
135
|
this.name = name;
|
|
138
136
|
}
|
|
@@ -169,7 +167,7 @@ class InjectedConnector extends base.Connector {
|
|
|
169
167
|
} // Add shim to storage signalling wallet is connected
|
|
170
168
|
|
|
171
169
|
|
|
172
|
-
if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.shimDisconnect) (_getClient$storage2 = getClient().storage) === null || _getClient$storage2 === void 0 ? void 0 : _getClient$storage2.setItem(shimDisconnectKey, true);
|
|
170
|
+
if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.shimDisconnect) (_getClient$storage2 = getClient().storage) === null || _getClient$storage2 === void 0 ? void 0 : _getClient$storage2.setItem(this.shimDisconnectKey, true);
|
|
173
171
|
return {
|
|
174
172
|
account,
|
|
175
173
|
chain: {
|
|
@@ -194,7 +192,7 @@ class InjectedConnector extends base.Connector {
|
|
|
194
192
|
provider.removeListener('chainChanged', this.onChainChanged);
|
|
195
193
|
provider.removeListener('disconnect', this.onDisconnect); // Remove shim signalling wallet is disconnected
|
|
196
194
|
|
|
197
|
-
if ((_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.shimDisconnect) (_getClient$storage3 = getClient().storage) === null || _getClient$storage3 === void 0 ? void 0 : _getClient$storage3.removeItem(shimDisconnectKey);
|
|
195
|
+
if ((_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.shimDisconnect) (_getClient$storage3 = getClient().storage) === null || _getClient$storage3 === void 0 ? void 0 : _getClient$storage3.removeItem(this.shimDisconnectKey);
|
|
198
196
|
}
|
|
199
197
|
|
|
200
198
|
async getAccount() {
|
|
@@ -230,7 +228,7 @@ class InjectedConnector extends base.Connector {
|
|
|
230
228
|
var _this$options5, _getClient$storage4;
|
|
231
229
|
|
|
232
230
|
if ((_this$options5 = this.options) !== null && _this$options5 !== void 0 && _this$options5.shimDisconnect && // If shim does not exist in storage, wallet is disconnected
|
|
233
|
-
!((_getClient$storage4 = getClient().storage) !== null && _getClient$storage4 !== void 0 && _getClient$storage4.getItem(shimDisconnectKey))) return false;
|
|
231
|
+
!((_getClient$storage4 = getClient().storage) !== null && _getClient$storage4 !== void 0 && _getClient$storage4.getItem(this.shimDisconnectKey))) return false;
|
|
234
232
|
const provider = await this.getProvider();
|
|
235
233
|
if (!provider) throw new base.ConnectorNotFoundError();
|
|
236
234
|
const accounts = await provider.request({
|
|
@@ -536,7 +534,13 @@ class Client {
|
|
|
536
534
|
|
|
537
535
|
base._classPrivateFieldSet(this, _isAutoConnecting, true);
|
|
538
536
|
|
|
539
|
-
|
|
537
|
+
this.setState(x => {
|
|
538
|
+
var _x$data;
|
|
539
|
+
|
|
540
|
+
return { ...x,
|
|
541
|
+
status: (_x$data = x.data) !== null && _x$data !== void 0 && _x$data.account ? 'reconnecting' : 'connecting'
|
|
542
|
+
};
|
|
543
|
+
}); // Try last used connector first
|
|
540
544
|
|
|
541
545
|
const sorted = base._classPrivateFieldGet(this, _lastUsedConnector) ? [...this.connectors].sort(x => x.id === base._classPrivateFieldGet(this, _lastUsedConnector) ? -1 : 1) : this.connectors;
|
|
542
546
|
let connected = false;
|
|
@@ -656,4 +660,3 @@ exports.createClient = createClient;
|
|
|
656
660
|
exports.createStorage = createStorage;
|
|
657
661
|
exports.getClient = getClient;
|
|
658
662
|
exports.noopStorage = noopStorage;
|
|
659
|
-
exports.shimDisconnectKey = shimDisconnectKey;
|