@wagmi/core 0.10.10 → 1.0.0-next.1
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 +2 -2
- package/connectors/walletConnectV1/package.json +4 -0
- package/dist/{chunk-VQG3VKOR.js → chunk-LF3Y5HFO.js} +714 -1242
- package/dist/index-fc9ab085.d.ts +22 -0
- package/dist/index.d.ts +1039 -1291
- package/dist/index.js +17 -45
- package/dist/internal/index.d.ts +18 -8
- package/dist/internal/index.js +5 -3
- package/dist/internal/test.d.ts +771 -9
- package/dist/internal/test.js +46 -34
- package/dist/providers/alchemy.d.ts +4 -6
- package/dist/providers/alchemy.js +9 -26
- package/dist/providers/infura.d.ts +4 -6
- package/dist/providers/infura.js +9 -26
- package/dist/providers/jsonRpc.d.ts +4 -7
- package/dist/providers/jsonRpc.js +4 -20
- package/dist/providers/public.d.ts +4 -7
- package/dist/providers/public.js +3 -18
- package/dist/window.d.ts +7 -0
- package/dist/window.js +0 -0
- package/internal/dist/wagmi-core-internal.cjs.d.ts +11 -0
- package/internal/dist/wagmi-core-internal.cjs.js +16 -0
- package/package.json +11 -6
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.d.ts +11 -0
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.js +16 -0
- package/providers/infura/dist/wagmi-core-providers-infura.cjs.d.ts +11 -0
- package/providers/infura/dist/wagmi-core-providers-infura.cjs.js +16 -0
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.d.ts +11 -0
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.js +16 -0
- package/providers/public/dist/wagmi-core-providers-public.cjs.d.ts +11 -0
- package/providers/public/dist/wagmi-core-providers-public.cjs.js +16 -0
- package/window/package.json +4 -0
- package/dist/getContract-2443b222.d.ts +0 -310
- package/dist/index-35b6525c.d.ts +0 -49
package/dist/internal/test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-KX4UEHS5.js";
|
|
2
|
-
import "../chunk-
|
|
2
|
+
import "../chunk-LF3Y5HFO.js";
|
|
3
3
|
import {
|
|
4
4
|
foundry,
|
|
5
5
|
goerli,
|
|
@@ -13,39 +13,38 @@ import "../chunk-KFW652VN.js";
|
|
|
13
13
|
import "../chunk-MQXBDTVK.js";
|
|
14
14
|
|
|
15
15
|
// test/utils.ts
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
16
|
+
import {
|
|
17
|
+
createPublicClient,
|
|
18
|
+
createWalletClient,
|
|
19
|
+
custom,
|
|
20
|
+
http,
|
|
21
|
+
webSocket
|
|
22
|
+
} from "viem";
|
|
23
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
24
|
+
import { rpc } from "viem/utils";
|
|
24
25
|
var foundryMainnet = {
|
|
25
26
|
...mainnet,
|
|
26
27
|
rpcUrls: foundry.rpcUrls
|
|
27
28
|
};
|
|
28
29
|
var testChains = [foundryMainnet, mainnet, goerli, optimism, polygon];
|
|
29
|
-
|
|
30
|
-
toJSON() {
|
|
31
|
-
return `<Provider network={${this.network.chainId}} />`;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
function getProvider({
|
|
30
|
+
function getPublicClient({
|
|
35
31
|
chains = testChains,
|
|
36
32
|
chainId
|
|
37
33
|
} = {}) {
|
|
38
|
-
const chain =
|
|
34
|
+
const chain = chains.find((x) => x.id === chainId) ?? foundryMainnet;
|
|
39
35
|
const url = foundryMainnet.rpcUrls.default.http[0];
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
const publicClient = createPublicClient({
|
|
37
|
+
chain,
|
|
38
|
+
transport: http(url),
|
|
39
|
+
pollingInterval: 1e3
|
|
40
|
+
});
|
|
41
|
+
return Object.assign(publicClient, {
|
|
42
|
+
chains,
|
|
43
|
+
toJSON() {
|
|
44
|
+
return `<PublicClient network={${chain.id}} />`;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
43
47
|
}
|
|
44
|
-
var EthersWebSocketProviderWrapper = class extends providers.WebSocketProvider {
|
|
45
|
-
toJSON() {
|
|
46
|
-
return `<WebSocketProvider network={${this.network.chainId}} />`;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
48
|
var accounts = [
|
|
50
49
|
{
|
|
51
50
|
privateKey: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
|
|
@@ -128,17 +127,30 @@ var accounts = [
|
|
|
128
127
|
balance: "10000000000000000000000"
|
|
129
128
|
}
|
|
130
129
|
];
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
130
|
+
function getWalletClients() {
|
|
131
|
+
const publicClient = getPublicClient();
|
|
132
|
+
publicClient.request = async ({ method, params }) => {
|
|
133
|
+
if (method === "personal_sign") {
|
|
134
|
+
method = "eth_sign";
|
|
135
|
+
params = [params[1], params[0]];
|
|
136
|
+
}
|
|
137
|
+
const { result } = await rpc.http(foundryMainnet.rpcUrls.default.http[0], {
|
|
138
|
+
body: {
|
|
139
|
+
method,
|
|
140
|
+
params
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
return result;
|
|
144
|
+
};
|
|
145
|
+
return accounts.map(
|
|
146
|
+
(x) => createWalletClient({
|
|
147
|
+
account: privateKeyToAccount(x.privateKey).address,
|
|
148
|
+
chain: publicClient.chain,
|
|
149
|
+
transport: custom(publicClient)
|
|
150
|
+
})
|
|
151
|
+
);
|
|
140
152
|
}
|
|
141
153
|
export {
|
|
142
|
-
|
|
154
|
+
getWalletClients,
|
|
143
155
|
testChains
|
|
144
156
|
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { providers } from 'ethers';
|
|
2
1
|
import { Chain } from '@wagmi/chains';
|
|
3
|
-
import {
|
|
4
|
-
import '
|
|
5
|
-
import 'abitype';
|
|
2
|
+
import { C as ChainProviderFn } from '../index-fc9ab085.js';
|
|
3
|
+
import 'viem';
|
|
6
4
|
|
|
7
|
-
type AlchemyProviderConfig =
|
|
5
|
+
type AlchemyProviderConfig = {
|
|
8
6
|
/** Your Alchemy API key from the [Alchemy Dashboard](https://dashboard.alchemyapi.io/). */
|
|
9
7
|
apiKey: string;
|
|
10
8
|
};
|
|
11
|
-
declare function alchemyProvider<TChain extends Chain = Chain>({ apiKey,
|
|
9
|
+
declare function alchemyProvider<TChain extends Chain = Chain>({ apiKey, }: AlchemyProviderConfig): ChainProviderFn<TChain>;
|
|
12
10
|
|
|
13
11
|
export { AlchemyProviderConfig, alchemyProvider };
|
|
@@ -1,43 +1,26 @@
|
|
|
1
1
|
import "../chunk-MQXBDTVK.js";
|
|
2
2
|
|
|
3
3
|
// src/providers/alchemy.ts
|
|
4
|
-
import { providers } from "ethers";
|
|
5
4
|
function alchemyProvider({
|
|
6
|
-
apiKey
|
|
7
|
-
priority,
|
|
8
|
-
stallTimeout,
|
|
9
|
-
weight
|
|
5
|
+
apiKey
|
|
10
6
|
}) {
|
|
11
7
|
return function(chain) {
|
|
12
|
-
|
|
8
|
+
const baseHttpUrl = chain.rpcUrls.alchemy?.http[0];
|
|
9
|
+
const baseWsUrl = chain.rpcUrls.alchemy?.webSocket?.[0];
|
|
10
|
+
if (!baseHttpUrl)
|
|
13
11
|
return null;
|
|
14
12
|
return {
|
|
15
13
|
chain: {
|
|
16
14
|
...chain,
|
|
17
15
|
rpcUrls: {
|
|
18
16
|
...chain.rpcUrls,
|
|
19
|
-
default: { http: [`${
|
|
17
|
+
default: { http: [`${baseHttpUrl}/${apiKey}`] }
|
|
20
18
|
}
|
|
21
19
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
name: chain.network,
|
|
27
|
-
ensAddress: chain.contracts?.ensRegistry?.address
|
|
28
|
-
},
|
|
29
|
-
apiKey
|
|
30
|
-
);
|
|
31
|
-
return Object.assign(provider, { priority, stallTimeout, weight });
|
|
32
|
-
},
|
|
33
|
-
webSocketProvider: () => new providers.AlchemyWebSocketProvider(
|
|
34
|
-
{
|
|
35
|
-
chainId: chain.id,
|
|
36
|
-
name: chain.network,
|
|
37
|
-
ensAddress: chain.contracts?.ensRegistry?.address
|
|
38
|
-
},
|
|
39
|
-
apiKey
|
|
40
|
-
)
|
|
20
|
+
rpcUrls: {
|
|
21
|
+
http: [`${baseHttpUrl}/${apiKey}`],
|
|
22
|
+
webSocket: [`${baseWsUrl}/${apiKey}`]
|
|
23
|
+
}
|
|
41
24
|
};
|
|
42
25
|
};
|
|
43
26
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { providers } from 'ethers';
|
|
2
1
|
import { Chain } from '@wagmi/chains';
|
|
3
|
-
import {
|
|
4
|
-
import '
|
|
5
|
-
import 'abitype';
|
|
2
|
+
import { C as ChainProviderFn } from '../index-fc9ab085.js';
|
|
3
|
+
import 'viem';
|
|
6
4
|
|
|
7
|
-
type InfuraProviderConfig =
|
|
5
|
+
type InfuraProviderConfig = {
|
|
8
6
|
/** Your Infura API key from the [Infura Dashboard](https://infura.io/login). */
|
|
9
7
|
apiKey: string;
|
|
10
8
|
};
|
|
11
|
-
declare function infuraProvider<TChain extends Chain = Chain>({ apiKey,
|
|
9
|
+
declare function infuraProvider<TChain extends Chain = Chain>({ apiKey, }: InfuraProviderConfig): ChainProviderFn<TChain>;
|
|
12
10
|
|
|
13
11
|
export { InfuraProviderConfig, infuraProvider };
|
package/dist/providers/infura.js
CHANGED
|
@@ -1,43 +1,26 @@
|
|
|
1
1
|
import "../chunk-MQXBDTVK.js";
|
|
2
2
|
|
|
3
3
|
// src/providers/infura.ts
|
|
4
|
-
import { providers } from "ethers";
|
|
5
4
|
function infuraProvider({
|
|
6
|
-
apiKey
|
|
7
|
-
priority,
|
|
8
|
-
stallTimeout,
|
|
9
|
-
weight
|
|
5
|
+
apiKey
|
|
10
6
|
}) {
|
|
11
7
|
return function(chain) {
|
|
12
|
-
|
|
8
|
+
const baseHttpUrl = chain.rpcUrls.infura?.http[0];
|
|
9
|
+
const baseWsUrl = chain.rpcUrls.infura?.webSocket?.[0];
|
|
10
|
+
if (!baseHttpUrl)
|
|
13
11
|
return null;
|
|
14
12
|
return {
|
|
15
13
|
chain: {
|
|
16
14
|
...chain,
|
|
17
15
|
rpcUrls: {
|
|
18
16
|
...chain.rpcUrls,
|
|
19
|
-
default: { http: [`${
|
|
17
|
+
default: { http: [`${baseHttpUrl}/${apiKey}`] }
|
|
20
18
|
}
|
|
21
19
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
name: chain.network,
|
|
27
|
-
ensAddress: chain.contracts?.ensRegistry?.address
|
|
28
|
-
},
|
|
29
|
-
apiKey
|
|
30
|
-
);
|
|
31
|
-
return Object.assign(provider, { priority, stallTimeout, weight });
|
|
32
|
-
},
|
|
33
|
-
webSocketProvider: () => new providers.InfuraWebSocketProvider(
|
|
34
|
-
{
|
|
35
|
-
chainId: chain.id,
|
|
36
|
-
name: chain.network,
|
|
37
|
-
ensAddress: chain.contracts?.ensRegistry?.address
|
|
38
|
-
},
|
|
39
|
-
apiKey
|
|
40
|
-
)
|
|
20
|
+
rpcUrls: {
|
|
21
|
+
http: [`${baseHttpUrl}/${apiKey}`],
|
|
22
|
+
webSocket: [`${baseWsUrl}/${apiKey}`]
|
|
23
|
+
}
|
|
41
24
|
};
|
|
42
25
|
};
|
|
43
26
|
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { providers } from 'ethers';
|
|
2
1
|
import { Chain } from '@wagmi/chains';
|
|
3
|
-
import {
|
|
4
|
-
import '
|
|
5
|
-
import 'abitype';
|
|
2
|
+
import { C as ChainProviderFn } from '../index-fc9ab085.js';
|
|
3
|
+
import 'viem';
|
|
6
4
|
|
|
7
|
-
type JsonRpcProviderConfig =
|
|
5
|
+
type JsonRpcProviderConfig = {
|
|
8
6
|
rpc: (chain: Chain) => {
|
|
9
7
|
http: string;
|
|
10
8
|
webSocket?: string;
|
|
11
9
|
} | null;
|
|
12
|
-
static?: boolean;
|
|
13
10
|
};
|
|
14
|
-
declare function jsonRpcProvider<TChain extends Chain = Chain>({
|
|
11
|
+
declare function jsonRpcProvider<TChain extends Chain = Chain>({ rpc, }: JsonRpcProviderConfig): ChainProviderFn<TChain>;
|
|
15
12
|
|
|
16
13
|
export { JsonRpcProviderConfig, jsonRpcProvider };
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import "../chunk-MQXBDTVK.js";
|
|
2
2
|
|
|
3
3
|
// src/providers/jsonRpc.ts
|
|
4
|
-
import { providers } from "ethers";
|
|
5
4
|
function jsonRpcProvider({
|
|
6
|
-
|
|
7
|
-
rpc,
|
|
8
|
-
stallTimeout,
|
|
9
|
-
static: static_ = true,
|
|
10
|
-
weight
|
|
5
|
+
rpc
|
|
11
6
|
}) {
|
|
12
7
|
return function(chain) {
|
|
13
8
|
const rpcConfig = rpc(chain);
|
|
@@ -21,20 +16,9 @@ function jsonRpcProvider({
|
|
|
21
16
|
default: { http: [rpcConfig.http] }
|
|
22
17
|
}
|
|
23
18
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
ensAddress: chain.contracts?.ensRegistry?.address,
|
|
28
|
-
chainId: chain.id,
|
|
29
|
-
name: chain.network
|
|
30
|
-
});
|
|
31
|
-
return Object.assign(provider, { priority, stallTimeout, weight });
|
|
32
|
-
},
|
|
33
|
-
...rpcConfig.webSocket && {
|
|
34
|
-
webSocketProvider: () => new providers.WebSocketProvider(
|
|
35
|
-
rpcConfig.webSocket,
|
|
36
|
-
chain.id
|
|
37
|
-
)
|
|
19
|
+
rpcUrls: {
|
|
20
|
+
http: [rpcConfig.http],
|
|
21
|
+
webSocket: rpcConfig.webSocket ? [rpcConfig.webSocket] : void 0
|
|
38
22
|
}
|
|
39
23
|
};
|
|
40
24
|
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { providers } from 'ethers';
|
|
2
1
|
import { Chain } from '@wagmi/chains';
|
|
3
|
-
import {
|
|
4
|
-
import '
|
|
5
|
-
import 'abitype';
|
|
2
|
+
import { C as ChainProviderFn } from '../index-fc9ab085.js';
|
|
3
|
+
import 'viem';
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
declare function publicProvider<TChain extends Chain = Chain>({ priority, stallTimeout, weight, }?: PublicProviderConfig): ChainProviderFn<TChain, providers.StaticJsonRpcProvider>;
|
|
5
|
+
declare function publicProvider<TChain extends Chain = Chain>(): ChainProviderFn<TChain>;
|
|
9
6
|
|
|
10
|
-
export {
|
|
7
|
+
export { publicProvider };
|
package/dist/providers/public.js
CHANGED
|
@@ -1,28 +1,13 @@
|
|
|
1
1
|
import "../chunk-MQXBDTVK.js";
|
|
2
2
|
|
|
3
3
|
// src/providers/public.ts
|
|
4
|
-
|
|
5
|
-
function publicProvider({
|
|
6
|
-
priority,
|
|
7
|
-
stallTimeout,
|
|
8
|
-
weight
|
|
9
|
-
} = {}) {
|
|
4
|
+
function publicProvider() {
|
|
10
5
|
return function(chain) {
|
|
11
|
-
if (!chain.rpcUrls.
|
|
6
|
+
if (!chain.rpcUrls.public.http[0])
|
|
12
7
|
return null;
|
|
13
8
|
return {
|
|
14
9
|
chain,
|
|
15
|
-
|
|
16
|
-
const provider = new providers.StaticJsonRpcProvider(
|
|
17
|
-
chain.rpcUrls.default.http[0],
|
|
18
|
-
{
|
|
19
|
-
chainId: chain.id,
|
|
20
|
-
name: chain.network,
|
|
21
|
-
ensAddress: chain.contracts?.ensRegistry?.address
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
return Object.assign(provider, { priority, stallTimeout, weight });
|
|
25
|
-
}
|
|
10
|
+
rpcUrls: chain.rpcUrls.public
|
|
26
11
|
};
|
|
27
12
|
};
|
|
28
13
|
}
|
package/dist/window.d.ts
ADDED
package/dist/window.js
ADDED
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
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";
|
|
@@ -0,0 +1,16 @@
|
|
|
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();
|
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": "0.
|
|
5
|
+
"version": "1.0.0-next.1",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/wagmi-dev/wagmi.git",
|
|
@@ -95,6 +95,10 @@
|
|
|
95
95
|
"types": "./dist/providers/public.d.ts",
|
|
96
96
|
"default": "./dist/providers/public.js"
|
|
97
97
|
},
|
|
98
|
+
"./window": {
|
|
99
|
+
"types": "./dist/window.d.ts",
|
|
100
|
+
"default": "./dist/window.js"
|
|
101
|
+
},
|
|
98
102
|
"./package.json": "./package.json"
|
|
99
103
|
},
|
|
100
104
|
"sideEffects": false,
|
|
@@ -103,10 +107,11 @@
|
|
|
103
107
|
"/connectors",
|
|
104
108
|
"/internal",
|
|
105
109
|
"/providers",
|
|
110
|
+
"/window",
|
|
106
111
|
"/dist"
|
|
107
112
|
],
|
|
108
113
|
"peerDependencies": {
|
|
109
|
-
"
|
|
114
|
+
"viem": "~0.3.16",
|
|
110
115
|
"typescript": ">=4.9.4"
|
|
111
116
|
},
|
|
112
117
|
"peerDependenciesMeta": {
|
|
@@ -115,14 +120,14 @@
|
|
|
115
120
|
}
|
|
116
121
|
},
|
|
117
122
|
"dependencies": {
|
|
118
|
-
"abitype": "^0.
|
|
123
|
+
"abitype": "^0.7.1",
|
|
119
124
|
"eventemitter3": "^4.0.7",
|
|
120
125
|
"zustand": "^4.3.1",
|
|
121
|
-
"@wagmi/chains": "0.2.
|
|
122
|
-
"@wagmi/connectors": "0.
|
|
126
|
+
"@wagmi/chains": "0.2.18",
|
|
127
|
+
"@wagmi/connectors": "1.0.0-next.2"
|
|
123
128
|
},
|
|
124
129
|
"devDependencies": {
|
|
125
|
-
"
|
|
130
|
+
"viem": "~0.3.16"
|
|
126
131
|
},
|
|
127
132
|
"keywords": [
|
|
128
133
|
"eth",
|
|
@@ -0,0 +1,11 @@
|
|
|
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";
|
|
@@ -0,0 +1,16 @@
|
|
|
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();
|
|
@@ -0,0 +1,11 @@
|
|
|
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";
|
|
@@ -0,0 +1,16 @@
|
|
|
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();
|
|
@@ -0,0 +1,11 @@
|
|
|
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";
|
|
@@ -0,0 +1,16 @@
|
|
|
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();
|
|
@@ -0,0 +1,11 @@
|
|
|
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";
|
|
@@ -0,0 +1,16 @@
|
|
|
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();
|