@wagmi/connectors 2.3.0 → 2.4.0-cjs
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/coinbaseWallet/package.json +1 -1
- package/dist/{base-0473abd3.d.ts → base-2dd7facf.d.ts} +1 -0
- package/dist/chunk-OQILYQDO.js +4 -4
- package/dist/chunk-QYMCVNHT.js +14 -14
- package/dist/{chunk-4BSCIAHY.js → chunk-Z2P63ELM.js} +75 -73
- package/dist/chunk-ZCAPXGBX.js +10 -10
- package/dist/coinbaseWallet.d.ts +1 -1
- package/dist/coinbaseWallet.js +58 -58
- package/dist/index.d.ts +4 -2
- package/dist/index.js +16 -12
- package/dist/injected.d.ts +1 -1
- package/dist/injected.js +9 -9
- package/dist/ledger.d.ts +33 -6
- package/dist/ledger.js +192 -124
- package/dist/metaMask.d.ts +1 -1
- package/dist/metaMask.js +37 -37
- package/dist/mock/index.d.ts +1 -1
- package/dist/mock/index.js +63 -63
- package/dist/safe.d.ts +1 -1
- package/dist/safe.js +46 -46
- package/dist/walletConnect.d.ts +1 -1
- package/dist/walletConnect.js +105 -105
- package/dist/walletConnectLegacy.d.ts +1 -1
- package/dist/walletConnectLegacy.js +58 -58
- package/injected/package.json +1 -1
- package/ledger/package.json +1 -1
- package/metaMask/package.json +1 -1
- package/mock/package.json +1 -1
- package/package.json +6 -46
- package/safe/package.json +1 -1
- package/walletConnect/package.json +1 -1
- package/walletConnectLegacy/package.json +1 -1
package/dist/chunk-OQILYQDO.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/normalizeChainId.ts
|
|
2
2
|
function normalizeChainId(chainId) {
|
|
3
3
|
if (typeof chainId === "string")
|
|
4
4
|
return Number.parseInt(
|
|
@@ -10,6 +10,6 @@ function normalizeChainId(chainId) {
|
|
|
10
10
|
return chainId;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.normalizeChainId = normalizeChainId;
|
package/dist/chunk-QYMCVNHT.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => {
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -28,11 +28,11 @@ var __privateMethod = (obj, member, method) => {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
// src/base.ts
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var Connector = class extends
|
|
31
|
+
var _eventemitter3 = require('eventemitter3'); var _eventemitter32 = _interopRequireDefault(_eventemitter3);
|
|
32
|
+
var _chains = require('viem/chains');
|
|
33
|
+
var Connector = class extends _eventemitter32.default {
|
|
34
34
|
constructor({
|
|
35
|
-
chains = [mainnet, goerli],
|
|
35
|
+
chains = [_chains.mainnet, _chains.goerli],
|
|
36
36
|
options
|
|
37
37
|
}) {
|
|
38
38
|
super();
|
|
@@ -43,7 +43,7 @@ var Connector = class extends EventEmitter {
|
|
|
43
43
|
this.options = options;
|
|
44
44
|
}
|
|
45
45
|
getBlockExplorerUrls(chain) {
|
|
46
|
-
const { default: blockExplorer, ...blockExplorers } = chain.blockExplorers
|
|
46
|
+
const { default: blockExplorer, ...blockExplorers } = _nullishCoalesce(chain.blockExplorers, () => ( {}));
|
|
47
47
|
if (blockExplorer)
|
|
48
48
|
return [
|
|
49
49
|
blockExplorer.url,
|
|
@@ -58,11 +58,11 @@ var Connector = class extends EventEmitter {
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
exports.__publicField = __publicField; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateMethod = __privateMethod; exports.Connector = Connector;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkZCAPXGBXjs = require('./chunk-ZCAPXGBX.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkOQILYQDOjs = require('./chunk-OQILYQDO.js');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunkQYMCVNHTjs = require('./chunk-QYMCVNHT.js');
|
|
15
15
|
|
|
16
16
|
// src/injected.ts
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var _viem = require('viem');
|
|
26
26
|
|
|
27
27
|
// src/utils/getInjectedName.ts
|
|
28
28
|
function getInjectedName(ethereum) {
|
|
@@ -61,6 +61,8 @@ function getInjectedName(ethereum) {
|
|
|
61
61
|
return "Frontier Wallet";
|
|
62
62
|
if (provider.isGamestop)
|
|
63
63
|
return "GameStop Wallet";
|
|
64
|
+
if (provider.isHaqqWallet)
|
|
65
|
+
return "HAQQ Wallet";
|
|
64
66
|
if (provider.isHyperPay)
|
|
65
67
|
return "HyperPay Wallet";
|
|
66
68
|
if (provider.isImToken)
|
|
@@ -108,7 +110,7 @@ function getInjectedName(ethereum) {
|
|
|
108
110
|
if (provider.isMetaMask)
|
|
109
111
|
return "MetaMask";
|
|
110
112
|
};
|
|
111
|
-
if (ethereum.providers
|
|
113
|
+
if (_optionalChain([ethereum, 'access', _ => _.providers, 'optionalAccess', _2 => _2.length])) {
|
|
112
114
|
const nameSet = /* @__PURE__ */ new Set();
|
|
113
115
|
let unknownCount = 1;
|
|
114
116
|
for (const provider of ethereum.providers) {
|
|
@@ -122,14 +124,14 @@ function getInjectedName(ethereum) {
|
|
|
122
124
|
const names = [...nameSet];
|
|
123
125
|
if (names.length)
|
|
124
126
|
return names;
|
|
125
|
-
return names[0]
|
|
127
|
+
return _nullishCoalesce(names[0], () => ( "Injected"));
|
|
126
128
|
}
|
|
127
|
-
return getName(ethereum)
|
|
129
|
+
return _nullishCoalesce(getName(ethereum), () => ( "Injected"));
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
// src/injected.ts
|
|
131
133
|
var _provider;
|
|
132
|
-
var InjectedConnector = class extends Connector {
|
|
134
|
+
var InjectedConnector = class extends _chunkQYMCVNHTjs.Connector {
|
|
133
135
|
constructor({
|
|
134
136
|
chains,
|
|
135
137
|
options: options_
|
|
@@ -140,32 +142,32 @@ var InjectedConnector = class extends Connector {
|
|
|
140
142
|
if (typeof window === "undefined")
|
|
141
143
|
return;
|
|
142
144
|
const ethereum = window.ethereum;
|
|
143
|
-
if (ethereum
|
|
145
|
+
if (_optionalChain([ethereum, 'optionalAccess', _3 => _3.providers]))
|
|
144
146
|
return ethereum.providers[0];
|
|
145
147
|
return ethereum;
|
|
146
148
|
},
|
|
147
149
|
...options_
|
|
148
150
|
};
|
|
149
151
|
super({ chains, options });
|
|
150
|
-
__publicField(this, "id", "injected");
|
|
151
|
-
__publicField(this, "name");
|
|
152
|
-
__publicField(this, "ready");
|
|
153
|
-
__privateAdd(this, _provider, void 0);
|
|
154
|
-
__publicField(this, "shimDisconnectKey", `${this.id}.shimDisconnect`);
|
|
155
|
-
__publicField(this, "onAccountsChanged", (accounts) => {
|
|
152
|
+
_chunkQYMCVNHTjs.__publicField.call(void 0, this, "id", "injected");
|
|
153
|
+
_chunkQYMCVNHTjs.__publicField.call(void 0, this, "name");
|
|
154
|
+
_chunkQYMCVNHTjs.__publicField.call(void 0, this, "ready");
|
|
155
|
+
_chunkQYMCVNHTjs.__privateAdd.call(void 0, this, _provider, void 0);
|
|
156
|
+
_chunkQYMCVNHTjs.__publicField.call(void 0, this, "shimDisconnectKey", `${this.id}.shimDisconnect`);
|
|
157
|
+
_chunkQYMCVNHTjs.__publicField.call(void 0, this, "onAccountsChanged", (accounts) => {
|
|
156
158
|
if (accounts.length === 0)
|
|
157
159
|
this.emit("disconnect");
|
|
158
160
|
else
|
|
159
161
|
this.emit("change", {
|
|
160
|
-
account: getAddress(accounts[0])
|
|
162
|
+
account: _viem.getAddress.call(void 0, accounts[0])
|
|
161
163
|
});
|
|
162
164
|
});
|
|
163
|
-
__publicField(this, "onChainChanged", (chainId) => {
|
|
164
|
-
const id = normalizeChainId(chainId);
|
|
165
|
+
_chunkQYMCVNHTjs.__publicField.call(void 0, this, "onChainChanged", (chainId) => {
|
|
166
|
+
const id = _chunkOQILYQDOjs.normalizeChainId.call(void 0, chainId);
|
|
165
167
|
const unsupported = this.isChainUnsupported(id);
|
|
166
168
|
this.emit("change", { chain: { id, unsupported } });
|
|
167
169
|
});
|
|
168
|
-
__publicField(this, "onDisconnect", async (error) => {
|
|
170
|
+
_chunkQYMCVNHTjs.__publicField.call(void 0, this, "onDisconnect", async (error) => {
|
|
169
171
|
if (error.code === 1013) {
|
|
170
172
|
const provider = await this.getProvider();
|
|
171
173
|
if (provider) {
|
|
@@ -176,7 +178,7 @@ var InjectedConnector = class extends Connector {
|
|
|
176
178
|
}
|
|
177
179
|
this.emit("disconnect");
|
|
178
180
|
if (this.options.shimDisconnect)
|
|
179
|
-
this.storage
|
|
181
|
+
_optionalChain([this, 'access', _4 => _4.storage, 'optionalAccess', _5 => _5.removeItem, 'call', _6 => _6(this.shimDisconnectKey)]);
|
|
180
182
|
});
|
|
181
183
|
const provider = options.getProvider();
|
|
182
184
|
if (typeof options.name === "string")
|
|
@@ -199,7 +201,7 @@ var InjectedConnector = class extends Connector {
|
|
|
199
201
|
try {
|
|
200
202
|
const provider = await this.getProvider();
|
|
201
203
|
if (!provider)
|
|
202
|
-
throw new ConnectorNotFoundError();
|
|
204
|
+
throw new (0, _chunkZCAPXGBXjs.ConnectorNotFoundError)();
|
|
203
205
|
if (provider.on) {
|
|
204
206
|
provider.on("accountsChanged", this.onAccountsChanged);
|
|
205
207
|
provider.on("chainChanged", this.onChainChanged);
|
|
@@ -209,7 +211,7 @@ var InjectedConnector = class extends Connector {
|
|
|
209
211
|
const accounts = await provider.request({
|
|
210
212
|
method: "eth_requestAccounts"
|
|
211
213
|
});
|
|
212
|
-
const account = getAddress(accounts[0]);
|
|
214
|
+
const account = _viem.getAddress.call(void 0, accounts[0]);
|
|
213
215
|
let id = await this.getChainId();
|
|
214
216
|
let unsupported = this.isChainUnsupported(id);
|
|
215
217
|
if (chainId && id !== chainId) {
|
|
@@ -218,46 +220,46 @@ var InjectedConnector = class extends Connector {
|
|
|
218
220
|
unsupported = this.isChainUnsupported(id);
|
|
219
221
|
}
|
|
220
222
|
if (this.options.shimDisconnect)
|
|
221
|
-
this.storage
|
|
223
|
+
_optionalChain([this, 'access', _7 => _7.storage, 'optionalAccess', _8 => _8.setItem, 'call', _9 => _9(this.shimDisconnectKey, true)]);
|
|
222
224
|
return { account, chain: { id, unsupported } };
|
|
223
225
|
} catch (error) {
|
|
224
226
|
if (this.isUserRejectedRequestError(error))
|
|
225
|
-
throw new UserRejectedRequestError(error);
|
|
227
|
+
throw new (0, _viem.UserRejectedRequestError)(error);
|
|
226
228
|
if (error.code === -32002)
|
|
227
|
-
throw new ResourceUnavailableRpcError(error);
|
|
229
|
+
throw new (0, _viem.ResourceUnavailableRpcError)(error);
|
|
228
230
|
throw error;
|
|
229
231
|
}
|
|
230
232
|
}
|
|
231
233
|
async disconnect() {
|
|
232
234
|
const provider = await this.getProvider();
|
|
233
|
-
if (!provider
|
|
235
|
+
if (!_optionalChain([provider, 'optionalAccess', _10 => _10.removeListener]))
|
|
234
236
|
return;
|
|
235
237
|
provider.removeListener("accountsChanged", this.onAccountsChanged);
|
|
236
238
|
provider.removeListener("chainChanged", this.onChainChanged);
|
|
237
239
|
provider.removeListener("disconnect", this.onDisconnect);
|
|
238
240
|
if (this.options.shimDisconnect)
|
|
239
|
-
this.storage
|
|
241
|
+
_optionalChain([this, 'access', _11 => _11.storage, 'optionalAccess', _12 => _12.removeItem, 'call', _13 => _13(this.shimDisconnectKey)]);
|
|
240
242
|
}
|
|
241
243
|
async getAccount() {
|
|
242
244
|
const provider = await this.getProvider();
|
|
243
245
|
if (!provider)
|
|
244
|
-
throw new ConnectorNotFoundError();
|
|
246
|
+
throw new (0, _chunkZCAPXGBXjs.ConnectorNotFoundError)();
|
|
245
247
|
const accounts = await provider.request({
|
|
246
248
|
method: "eth_accounts"
|
|
247
249
|
});
|
|
248
|
-
return getAddress(accounts[0]);
|
|
250
|
+
return _viem.getAddress.call(void 0, accounts[0]);
|
|
249
251
|
}
|
|
250
252
|
async getChainId() {
|
|
251
253
|
const provider = await this.getProvider();
|
|
252
254
|
if (!provider)
|
|
253
|
-
throw new ConnectorNotFoundError();
|
|
254
|
-
return provider.request({ method: "eth_chainId" }).then(normalizeChainId);
|
|
255
|
+
throw new (0, _chunkZCAPXGBXjs.ConnectorNotFoundError)();
|
|
256
|
+
return provider.request({ method: "eth_chainId" }).then(_chunkOQILYQDOjs.normalizeChainId);
|
|
255
257
|
}
|
|
256
258
|
async getProvider() {
|
|
257
259
|
const provider = this.options.getProvider();
|
|
258
260
|
if (provider)
|
|
259
|
-
__privateSet(this, _provider, provider);
|
|
260
|
-
return __privateGet(this, _provider);
|
|
261
|
+
_chunkQYMCVNHTjs.__privateSet.call(void 0, this, _provider, provider);
|
|
262
|
+
return _chunkQYMCVNHTjs.__privateGet.call(void 0, this, _provider);
|
|
261
263
|
}
|
|
262
264
|
async getWalletClient({ chainId } = {}) {
|
|
263
265
|
const [provider, account] = await Promise.all([
|
|
@@ -267,30 +269,30 @@ var InjectedConnector = class extends Connector {
|
|
|
267
269
|
const chain = this.chains.find((x) => x.id === chainId);
|
|
268
270
|
if (!provider)
|
|
269
271
|
throw new Error("provider is required.");
|
|
270
|
-
return createWalletClient({
|
|
272
|
+
return _viem.createWalletClient.call(void 0, {
|
|
271
273
|
account,
|
|
272
274
|
chain,
|
|
273
|
-
transport: custom(provider)
|
|
275
|
+
transport: _viem.custom.call(void 0, provider)
|
|
274
276
|
});
|
|
275
277
|
}
|
|
276
278
|
async isAuthorized() {
|
|
277
279
|
try {
|
|
278
|
-
if (this.options.shimDisconnect && !this.storage
|
|
280
|
+
if (this.options.shimDisconnect && !_optionalChain([this, 'access', _14 => _14.storage, 'optionalAccess', _15 => _15.getItem, 'call', _16 => _16(this.shimDisconnectKey)]))
|
|
279
281
|
return false;
|
|
280
282
|
const provider = await this.getProvider();
|
|
281
283
|
if (!provider)
|
|
282
|
-
throw new ConnectorNotFoundError();
|
|
284
|
+
throw new (0, _chunkZCAPXGBXjs.ConnectorNotFoundError)();
|
|
283
285
|
const account = await this.getAccount();
|
|
284
286
|
return !!account;
|
|
285
|
-
} catch {
|
|
287
|
+
} catch (e) {
|
|
286
288
|
return false;
|
|
287
289
|
}
|
|
288
290
|
}
|
|
289
291
|
async switchChain(chainId) {
|
|
290
292
|
const provider = await this.getProvider();
|
|
291
293
|
if (!provider)
|
|
292
|
-
throw new ConnectorNotFoundError();
|
|
293
|
-
const id = numberToHex(chainId);
|
|
294
|
+
throw new (0, _chunkZCAPXGBXjs.ConnectorNotFoundError)();
|
|
295
|
+
const id = _viem.numberToHex.call(void 0, chainId);
|
|
294
296
|
try {
|
|
295
297
|
await Promise.all([
|
|
296
298
|
provider.request({
|
|
@@ -299,26 +301,26 @@ var InjectedConnector = class extends Connector {
|
|
|
299
301
|
}),
|
|
300
302
|
new Promise(
|
|
301
303
|
(res) => this.on("change", ({ chain }) => {
|
|
302
|
-
if (chain
|
|
304
|
+
if (_optionalChain([chain, 'optionalAccess', _17 => _17.id]) === chainId)
|
|
303
305
|
res();
|
|
304
306
|
})
|
|
305
307
|
)
|
|
306
308
|
]);
|
|
307
|
-
return this.chains.find((x) => x.id === chainId)
|
|
309
|
+
return _nullishCoalesce(this.chains.find((x) => x.id === chainId), () => ( {
|
|
308
310
|
id: chainId,
|
|
309
311
|
name: `Chain ${id}`,
|
|
310
312
|
network: `${id}`,
|
|
311
313
|
nativeCurrency: { name: "Ether", decimals: 18, symbol: "ETH" },
|
|
312
314
|
rpcUrls: { default: { http: [""] }, public: { http: [""] } }
|
|
313
|
-
};
|
|
315
|
+
}));
|
|
314
316
|
} catch (error) {
|
|
315
317
|
const chain = this.chains.find((x) => x.id === chainId);
|
|
316
318
|
if (!chain)
|
|
317
|
-
throw new ChainNotConfiguredForConnectorError({
|
|
319
|
+
throw new (0, _chunkZCAPXGBXjs.ChainNotConfiguredForConnectorError)({
|
|
318
320
|
chainId,
|
|
319
321
|
connectorId: this.id
|
|
320
322
|
});
|
|
321
|
-
if (error.code === 4902 || error
|
|
323
|
+
if (error.code === 4902 || _optionalChain([error, 'optionalAccess', _18 => _18.data, 'optionalAccess', _19 => _19.originalError, 'optionalAccess', _20 => _20.code]) === 4902) {
|
|
322
324
|
try {
|
|
323
325
|
await provider.request({
|
|
324
326
|
method: "wallet_addEthereumChain",
|
|
@@ -327,24 +329,24 @@ var InjectedConnector = class extends Connector {
|
|
|
327
329
|
chainId: id,
|
|
328
330
|
chainName: chain.name,
|
|
329
331
|
nativeCurrency: chain.nativeCurrency,
|
|
330
|
-
rpcUrls: [chain.rpcUrls.public
|
|
332
|
+
rpcUrls: [_nullishCoalesce(_optionalChain([chain, 'access', _21 => _21.rpcUrls, 'access', _22 => _22.public, 'optionalAccess', _23 => _23.http, 'access', _24 => _24[0]]), () => ( ""))],
|
|
331
333
|
blockExplorerUrls: this.getBlockExplorerUrls(chain)
|
|
332
334
|
}
|
|
333
335
|
]
|
|
334
336
|
});
|
|
335
337
|
const currentChainId = await this.getChainId();
|
|
336
338
|
if (currentChainId !== chainId)
|
|
337
|
-
throw new UserRejectedRequestError(
|
|
339
|
+
throw new (0, _viem.UserRejectedRequestError)(
|
|
338
340
|
new Error("User rejected switch after adding network.")
|
|
339
341
|
);
|
|
340
342
|
return chain;
|
|
341
343
|
} catch (error2) {
|
|
342
|
-
throw new UserRejectedRequestError(error2);
|
|
344
|
+
throw new (0, _viem.UserRejectedRequestError)(error2);
|
|
343
345
|
}
|
|
344
346
|
}
|
|
345
347
|
if (this.isUserRejectedRequestError(error))
|
|
346
|
-
throw new UserRejectedRequestError(error);
|
|
347
|
-
throw new SwitchChainError(error);
|
|
348
|
+
throw new (0, _viem.UserRejectedRequestError)(error);
|
|
349
|
+
throw new (0, _viem.SwitchChainError)(error);
|
|
348
350
|
}
|
|
349
351
|
}
|
|
350
352
|
async watchAsset({
|
|
@@ -355,7 +357,7 @@ var InjectedConnector = class extends Connector {
|
|
|
355
357
|
}) {
|
|
356
358
|
const provider = await this.getProvider();
|
|
357
359
|
if (!provider)
|
|
358
|
-
throw new ConnectorNotFoundError();
|
|
360
|
+
throw new (0, _chunkZCAPXGBXjs.ConnectorNotFoundError)();
|
|
359
361
|
return provider.request({
|
|
360
362
|
method: "wallet_watchAsset",
|
|
361
363
|
params: {
|
|
@@ -375,6 +377,6 @@ var InjectedConnector = class extends Connector {
|
|
|
375
377
|
};
|
|
376
378
|
_provider = new WeakMap();
|
|
377
379
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
exports.InjectedConnector = InjectedConnector;
|
package/dist/chunk-ZCAPXGBX.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkQYMCVNHTjs = require('./chunk-QYMCVNHT.js');
|
|
4
4
|
|
|
5
5
|
// src/errors.ts
|
|
6
6
|
var ChainNotConfiguredForConnectorError = class extends Error {
|
|
@@ -9,18 +9,18 @@ var ChainNotConfiguredForConnectorError = class extends Error {
|
|
|
9
9
|
connectorId
|
|
10
10
|
}) {
|
|
11
11
|
super(`Chain "${chainId}" not configured for connector "${connectorId}".`);
|
|
12
|
-
__publicField(this, "name", "ChainNotConfiguredForConnectorError");
|
|
12
|
+
_chunkQYMCVNHTjs.__publicField.call(void 0, this, "name", "ChainNotConfiguredForConnectorError");
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
var ConnectorNotFoundError = class extends Error {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
|
-
__publicField(this, "name", "ConnectorNotFoundError");
|
|
19
|
-
__publicField(this, "message", "Connector not found");
|
|
18
|
+
_chunkQYMCVNHTjs.__publicField.call(void 0, this, "name", "ConnectorNotFoundError");
|
|
19
|
+
_chunkQYMCVNHTjs.__publicField.call(void 0, this, "message", "Connector not found");
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
exports.ChainNotConfiguredForConnectorError = ChainNotConfiguredForConnectorError; exports.ConnectorNotFoundError = ConnectorNotFoundError;
|
package/dist/coinbaseWallet.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as viem from 'viem';
|
|
|
2
2
|
import { CoinbaseWalletProvider } from '@coinbase/wallet-sdk';
|
|
3
3
|
import { CoinbaseWalletSDKOptions } from '@coinbase/wallet-sdk/dist/CoinbaseWalletSDK';
|
|
4
4
|
import { Chain } from '@wagmi/chains';
|
|
5
|
-
import { C as Connector } from './base-
|
|
5
|
+
import { C as Connector } from './base-2dd7facf.js';
|
|
6
6
|
import 'eventemitter3';
|
|
7
7
|
|
|
8
8
|
type Options = Omit<CoinbaseWalletSDKOptions, 'reloadOnDisconnect'> & {
|