@wagmi/core 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-4FHLBJG5.js → chunk-VEUO7GWU.js} +9 -22
- package/dist/index.js +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/test.js +1 -1
- package/package.json +3 -3
- package/connectors/walletConnectV1/package.json +0 -4
- package/internal/dist/wagmi-core-internal.cjs.d.ts +0 -11
- package/internal/dist/wagmi-core-internal.cjs.js +0 -16
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.d.ts +0 -11
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.js +0 -16
- package/providers/infura/dist/wagmi-core-providers-infura.cjs.d.ts +0 -11
- package/providers/infura/dist/wagmi-core-providers-infura.cjs.js +0 -16
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.d.ts +0 -11
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.js +0 -16
- package/providers/public/dist/wagmi-core-providers-public.cjs.d.ts +0 -11
- package/providers/public/dist/wagmi-core-providers-public.cjs.js +0 -16
|
@@ -2058,7 +2058,7 @@ async function prepareWriteContract({
|
|
|
2058
2058
|
if (!walletClient)
|
|
2059
2059
|
throw new ConnectorNotFoundError();
|
|
2060
2060
|
if (chainId)
|
|
2061
|
-
assertActiveChain({ chainId
|
|
2061
|
+
assertActiveChain({ chainId });
|
|
2062
2062
|
const {
|
|
2063
2063
|
accessList,
|
|
2064
2064
|
blockNumber,
|
|
@@ -2334,11 +2334,11 @@ function watchReadContracts(args, callback) {
|
|
|
2334
2334
|
|
|
2335
2335
|
// src/actions/contracts/writeContract.ts
|
|
2336
2336
|
async function writeContract(config2) {
|
|
2337
|
-
const walletClient = await getWalletClient();
|
|
2337
|
+
const walletClient = await getWalletClient({ chainId: config2.chainId });
|
|
2338
2338
|
if (!walletClient)
|
|
2339
2339
|
throw new ConnectorNotFoundError();
|
|
2340
2340
|
if (config2.chainId)
|
|
2341
|
-
assertActiveChain({ chainId: config2.chainId
|
|
2341
|
+
assertActiveChain({ chainId: config2.chainId });
|
|
2342
2342
|
let request;
|
|
2343
2343
|
if (config2.mode === "prepared") {
|
|
2344
2344
|
request = config2;
|
|
@@ -2511,7 +2511,7 @@ async function signTypedData({
|
|
|
2511
2511
|
throw new ConnectorNotFoundError();
|
|
2512
2512
|
const { chainId } = domain;
|
|
2513
2513
|
if (chainId)
|
|
2514
|
-
assertActiveChain({ chainId
|
|
2514
|
+
assertActiveChain({ chainId });
|
|
2515
2515
|
return walletClient.signTypedData({
|
|
2516
2516
|
message,
|
|
2517
2517
|
primaryType,
|
|
@@ -2696,7 +2696,7 @@ async function prepareSendTransaction({
|
|
|
2696
2696
|
if (!walletClient)
|
|
2697
2697
|
throw new ConnectorNotFoundError();
|
|
2698
2698
|
if (chainId)
|
|
2699
|
-
assertActiveChain({ chainId
|
|
2699
|
+
assertActiveChain({ chainId });
|
|
2700
2700
|
const to = (to_ && !isAddress(to_) ? await fetchEnsAddress({ name: to_ }) : to_) || void 0;
|
|
2701
2701
|
if (to && !isAddress(to))
|
|
2702
2702
|
throw new Error("Invalid address");
|
|
@@ -2731,11 +2731,11 @@ async function sendTransaction({
|
|
|
2731
2731
|
to,
|
|
2732
2732
|
value
|
|
2733
2733
|
}) {
|
|
2734
|
-
const walletClient = await getWalletClient();
|
|
2734
|
+
const walletClient = await getWalletClient({ chainId });
|
|
2735
2735
|
if (!walletClient)
|
|
2736
2736
|
throw new ConnectorNotFoundError();
|
|
2737
2737
|
if (chainId)
|
|
2738
|
-
assertActiveChain({ chainId
|
|
2738
|
+
assertActiveChain({ chainId });
|
|
2739
2739
|
let args;
|
|
2740
2740
|
if (mode === "prepared") {
|
|
2741
2741
|
args = {
|
|
@@ -2766,7 +2766,7 @@ async function sendTransaction({
|
|
|
2766
2766
|
value
|
|
2767
2767
|
});
|
|
2768
2768
|
}
|
|
2769
|
-
const hash = await walletClient.sendTransaction(args);
|
|
2769
|
+
const hash = await walletClient.sendTransaction({ ...args, chain: null });
|
|
2770
2770
|
return { hash };
|
|
2771
2771
|
}
|
|
2772
2772
|
|
|
@@ -2839,10 +2839,7 @@ function watchPendingTransactions(args, callback) {
|
|
|
2839
2839
|
}
|
|
2840
2840
|
|
|
2841
2841
|
// src/utils/assertActiveChain.ts
|
|
2842
|
-
function assertActiveChain({
|
|
2843
|
-
chainId,
|
|
2844
|
-
walletClient
|
|
2845
|
-
}) {
|
|
2842
|
+
function assertActiveChain({ chainId }) {
|
|
2846
2843
|
const { chain: activeChain, chains } = getNetwork();
|
|
2847
2844
|
const activeChainId = activeChain?.id;
|
|
2848
2845
|
if (activeChainId && chainId !== activeChainId) {
|
|
@@ -2851,16 +2848,6 @@ function assertActiveChain({
|
|
|
2851
2848
|
targetChain: chains.find((x) => x.id === chainId)?.name ?? `Chain ${chainId}`
|
|
2852
2849
|
});
|
|
2853
2850
|
}
|
|
2854
|
-
if (walletClient) {
|
|
2855
|
-
const walletClientChainId = walletClient.chain.id;
|
|
2856
|
-
if (walletClientChainId && chainId !== walletClientChainId) {
|
|
2857
|
-
const connector = getConfig().connector;
|
|
2858
|
-
throw new ChainNotConfiguredError({
|
|
2859
|
-
chainId,
|
|
2860
|
-
connectorId: connector?.id ?? "unknown"
|
|
2861
|
-
});
|
|
2862
|
-
}
|
|
2863
|
-
}
|
|
2864
2851
|
}
|
|
2865
2852
|
|
|
2866
2853
|
export {
|
package/dist/index.js
CHANGED
package/dist/internal/index.js
CHANGED
package/dist/internal/test.js
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@wagmi/core",
|
|
3
3
|
"description": "Vanilla JS library for Ethereum",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.2",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/wagmi-dev/wagmi.git",
|
|
@@ -123,8 +123,8 @@
|
|
|
123
123
|
"abitype": "0.8.1",
|
|
124
124
|
"eventemitter3": "^4.0.7",
|
|
125
125
|
"zustand": "^4.3.1",
|
|
126
|
-
"@wagmi/
|
|
127
|
-
"@wagmi/
|
|
126
|
+
"@wagmi/chains": "0.2.22",
|
|
127
|
+
"@wagmi/connectors": "1.0.2"
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
130
|
"viem": "~0.3.18"
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// are you seeing an error that a default export doesn't exist but your source file has a default export?
|
|
2
|
-
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
|
|
3
|
-
|
|
4
|
-
// curious why you need to?
|
|
5
|
-
// this file exists so that you can import from the entrypoint normally
|
|
6
|
-
// except that it points to your source file and you don't need to run build constantly
|
|
7
|
-
// which means we need to re-export all of the modules from your source file
|
|
8
|
-
// and since export * doesn't include default exports, we need to read your source file
|
|
9
|
-
// to check for a default export and re-export it if it exists
|
|
10
|
-
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯
|
|
11
|
-
export * from "../../src/internal";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// this file might look strange and you might be wondering what it's for
|
|
3
|
-
// it's lets you import your source files by importing this entrypoint
|
|
4
|
-
// as you would import it if it was built with preconstruct build
|
|
5
|
-
// this file is slightly different to some others though
|
|
6
|
-
// it has a require hook which compiles your code with Babel
|
|
7
|
-
// this means that you don't have to set up @babel/register or anything like that
|
|
8
|
-
// but you can still require this module and it'll be compiled
|
|
9
|
-
|
|
10
|
-
// this bit of code imports the require hook and registers it
|
|
11
|
-
let unregister = require("../../../../node_modules/.pnpm/@preconstruct+hook@0.4.0/node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../..", "../..");
|
|
12
|
-
|
|
13
|
-
// this re-exports the source file
|
|
14
|
-
module.exports = require("../../src/internal.ts");
|
|
15
|
-
|
|
16
|
-
unregister();
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// are you seeing an error that a default export doesn't exist but your source file has a default export?
|
|
2
|
-
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
|
|
3
|
-
|
|
4
|
-
// curious why you need to?
|
|
5
|
-
// this file exists so that you can import from the entrypoint normally
|
|
6
|
-
// except that it points to your source file and you don't need to run build constantly
|
|
7
|
-
// which means we need to re-export all of the modules from your source file
|
|
8
|
-
// and since export * doesn't include default exports, we need to read your source file
|
|
9
|
-
// to check for a default export and re-export it if it exists
|
|
10
|
-
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯
|
|
11
|
-
export * from "../../../src/providers/alchemy";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// this file might look strange and you might be wondering what it's for
|
|
3
|
-
// it's lets you import your source files by importing this entrypoint
|
|
4
|
-
// as you would import it if it was built with preconstruct build
|
|
5
|
-
// this file is slightly different to some others though
|
|
6
|
-
// it has a require hook which compiles your code with Babel
|
|
7
|
-
// this means that you don't have to set up @babel/register or anything like that
|
|
8
|
-
// but you can still require this module and it'll be compiled
|
|
9
|
-
|
|
10
|
-
// this bit of code imports the require hook and registers it
|
|
11
|
-
let unregister = require("../../../../../node_modules/.pnpm/@preconstruct+hook@0.4.0/node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../../..", "../../..");
|
|
12
|
-
|
|
13
|
-
// this re-exports the source file
|
|
14
|
-
module.exports = require("../../../src/providers/alchemy.ts");
|
|
15
|
-
|
|
16
|
-
unregister();
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// are you seeing an error that a default export doesn't exist but your source file has a default export?
|
|
2
|
-
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
|
|
3
|
-
|
|
4
|
-
// curious why you need to?
|
|
5
|
-
// this file exists so that you can import from the entrypoint normally
|
|
6
|
-
// except that it points to your source file and you don't need to run build constantly
|
|
7
|
-
// which means we need to re-export all of the modules from your source file
|
|
8
|
-
// and since export * doesn't include default exports, we need to read your source file
|
|
9
|
-
// to check for a default export and re-export it if it exists
|
|
10
|
-
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯
|
|
11
|
-
export * from "../../../src/providers/infura";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// this file might look strange and you might be wondering what it's for
|
|
3
|
-
// it's lets you import your source files by importing this entrypoint
|
|
4
|
-
// as you would import it if it was built with preconstruct build
|
|
5
|
-
// this file is slightly different to some others though
|
|
6
|
-
// it has a require hook which compiles your code with Babel
|
|
7
|
-
// this means that you don't have to set up @babel/register or anything like that
|
|
8
|
-
// but you can still require this module and it'll be compiled
|
|
9
|
-
|
|
10
|
-
// this bit of code imports the require hook and registers it
|
|
11
|
-
let unregister = require("../../../../../node_modules/.pnpm/@preconstruct+hook@0.4.0/node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../../..", "../../..");
|
|
12
|
-
|
|
13
|
-
// this re-exports the source file
|
|
14
|
-
module.exports = require("../../../src/providers/infura.ts");
|
|
15
|
-
|
|
16
|
-
unregister();
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// are you seeing an error that a default export doesn't exist but your source file has a default export?
|
|
2
|
-
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
|
|
3
|
-
|
|
4
|
-
// curious why you need to?
|
|
5
|
-
// this file exists so that you can import from the entrypoint normally
|
|
6
|
-
// except that it points to your source file and you don't need to run build constantly
|
|
7
|
-
// which means we need to re-export all of the modules from your source file
|
|
8
|
-
// and since export * doesn't include default exports, we need to read your source file
|
|
9
|
-
// to check for a default export and re-export it if it exists
|
|
10
|
-
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯
|
|
11
|
-
export * from "../../../src/providers/jsonRpc";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// this file might look strange and you might be wondering what it's for
|
|
3
|
-
// it's lets you import your source files by importing this entrypoint
|
|
4
|
-
// as you would import it if it was built with preconstruct build
|
|
5
|
-
// this file is slightly different to some others though
|
|
6
|
-
// it has a require hook which compiles your code with Babel
|
|
7
|
-
// this means that you don't have to set up @babel/register or anything like that
|
|
8
|
-
// but you can still require this module and it'll be compiled
|
|
9
|
-
|
|
10
|
-
// this bit of code imports the require hook and registers it
|
|
11
|
-
let unregister = require("../../../../../node_modules/.pnpm/@preconstruct+hook@0.4.0/node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../../..", "../../..");
|
|
12
|
-
|
|
13
|
-
// this re-exports the source file
|
|
14
|
-
module.exports = require("../../../src/providers/jsonRpc.ts");
|
|
15
|
-
|
|
16
|
-
unregister();
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// are you seeing an error that a default export doesn't exist but your source file has a default export?
|
|
2
|
-
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
|
|
3
|
-
|
|
4
|
-
// curious why you need to?
|
|
5
|
-
// this file exists so that you can import from the entrypoint normally
|
|
6
|
-
// except that it points to your source file and you don't need to run build constantly
|
|
7
|
-
// which means we need to re-export all of the modules from your source file
|
|
8
|
-
// and since export * doesn't include default exports, we need to read your source file
|
|
9
|
-
// to check for a default export and re-export it if it exists
|
|
10
|
-
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯
|
|
11
|
-
export * from "../../../src/providers/public";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// this file might look strange and you might be wondering what it's for
|
|
3
|
-
// it's lets you import your source files by importing this entrypoint
|
|
4
|
-
// as you would import it if it was built with preconstruct build
|
|
5
|
-
// this file is slightly different to some others though
|
|
6
|
-
// it has a require hook which compiles your code with Babel
|
|
7
|
-
// this means that you don't have to set up @babel/register or anything like that
|
|
8
|
-
// but you can still require this module and it'll be compiled
|
|
9
|
-
|
|
10
|
-
// this bit of code imports the require hook and registers it
|
|
11
|
-
let unregister = require("../../../../../node_modules/.pnpm/@preconstruct+hook@0.4.0/node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../../..", "../../..");
|
|
12
|
-
|
|
13
|
-
// this re-exports the source file
|
|
14
|
-
module.exports = require("../../../src/providers/public.ts");
|
|
15
|
-
|
|
16
|
-
unregister();
|