@wagmi/core 0.8.17 → 0.8.18-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/dist/chains.js +71 -71
- package/dist/chunk-BHJV5MXX.js +72 -72
- package/dist/chunk-BVC4KGLQ.js +8 -8
- package/dist/chunk-EQOEZP46.js +5 -5
- package/dist/chunk-KFW652VN.js +6 -6
- package/dist/chunk-KX4UEHS5.js +1 -0
- package/dist/chunk-MQXBDTVK.js +7 -7
- package/dist/chunk-TQJMA6J5.js +242 -242
- package/dist/connectors/coinbaseWallet.js +5 -5
- package/dist/connectors/index.js +9 -9
- package/dist/connectors/injected.js +7 -7
- package/dist/connectors/ledger.js +5 -5
- package/dist/connectors/metaMask.js +5 -5
- package/dist/connectors/mock.js +9 -9
- package/dist/connectors/walletConnect.js +5 -5
- package/dist/index.js +164 -164
- package/dist/internal/index.js +8 -8
- package/dist/internal/test.js +25 -25
- package/dist/providers/alchemy.js +11 -11
- package/dist/providers/infura.js +11 -11
- package/dist/providers/jsonRpc.js +8 -8
- package/dist/providers/public.js +7 -7
- package/package.json +4 -5
package/dist/providers/infura.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }require('../chunk-MQXBDTVK.js');
|
|
2
2
|
|
|
3
3
|
// src/providers/infura.ts
|
|
4
|
-
|
|
4
|
+
var _ethers = require('ethers');
|
|
5
5
|
function infuraProvider({
|
|
6
6
|
apiKey,
|
|
7
7
|
priority,
|
|
@@ -9,38 +9,38 @@ function infuraProvider({
|
|
|
9
9
|
weight
|
|
10
10
|
}) {
|
|
11
11
|
return function(chain) {
|
|
12
|
-
if (!chain.rpcUrls.infura
|
|
12
|
+
if (!_optionalChain([chain, 'access', _ => _.rpcUrls, 'access', _2 => _2.infura, 'optionalAccess', _3 => _3.http, 'access', _4 => _4[0]]))
|
|
13
13
|
return null;
|
|
14
14
|
return {
|
|
15
15
|
chain: {
|
|
16
16
|
...chain,
|
|
17
17
|
rpcUrls: {
|
|
18
18
|
...chain.rpcUrls,
|
|
19
|
-
default: { http: [`${chain.rpcUrls.infura
|
|
19
|
+
default: { http: [`${_optionalChain([chain, 'access', _5 => _5.rpcUrls, 'access', _6 => _6.infura, 'optionalAccess', _7 => _7.http, 'access', _8 => _8[0]])}/${apiKey}`] }
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
provider: () => {
|
|
23
|
-
const provider = new providers.InfuraProvider(
|
|
23
|
+
const provider = new _ethers.providers.InfuraProvider(
|
|
24
24
|
{
|
|
25
25
|
chainId: chain.id,
|
|
26
26
|
name: chain.network,
|
|
27
|
-
ensAddress: chain.contracts
|
|
27
|
+
ensAddress: _optionalChain([chain, 'access', _9 => _9.contracts, 'optionalAccess', _10 => _10.ensRegistry, 'optionalAccess', _11 => _11.address])
|
|
28
28
|
},
|
|
29
29
|
apiKey
|
|
30
30
|
);
|
|
31
31
|
return Object.assign(provider, { priority, stallTimeout, weight });
|
|
32
32
|
},
|
|
33
|
-
webSocketProvider: () => new providers.InfuraWebSocketProvider(
|
|
33
|
+
webSocketProvider: () => new _ethers.providers.InfuraWebSocketProvider(
|
|
34
34
|
{
|
|
35
35
|
chainId: chain.id,
|
|
36
36
|
name: chain.network,
|
|
37
|
-
ensAddress: chain.contracts
|
|
37
|
+
ensAddress: _optionalChain([chain, 'access', _12 => _12.contracts, 'optionalAccess', _13 => _13.ensRegistry, 'optionalAccess', _14 => _14.address])
|
|
38
38
|
},
|
|
39
39
|
apiKey
|
|
40
40
|
)
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
exports.infuraProvider = infuraProvider;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }require('../chunk-MQXBDTVK.js');
|
|
2
2
|
|
|
3
3
|
// src/providers/jsonRpc.ts
|
|
4
|
-
|
|
4
|
+
var _ethers = require('ethers');
|
|
5
5
|
function jsonRpcProvider({
|
|
6
6
|
priority,
|
|
7
7
|
rpc,
|
|
@@ -22,16 +22,16 @@ function jsonRpcProvider({
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
provider: () => {
|
|
25
|
-
const RpcProvider = static_ ? providers.StaticJsonRpcProvider : providers.JsonRpcProvider;
|
|
25
|
+
const RpcProvider = static_ ? _ethers.providers.StaticJsonRpcProvider : _ethers.providers.JsonRpcProvider;
|
|
26
26
|
const provider = new RpcProvider(rpcConfig.http, {
|
|
27
|
-
ensAddress: chain.contracts
|
|
27
|
+
ensAddress: _optionalChain([chain, 'access', _ => _.contracts, 'optionalAccess', _2 => _2.ensRegistry, 'optionalAccess', _3 => _3.address]),
|
|
28
28
|
chainId: chain.id,
|
|
29
29
|
name: chain.network
|
|
30
30
|
});
|
|
31
31
|
return Object.assign(provider, { priority, stallTimeout, weight });
|
|
32
32
|
},
|
|
33
33
|
...rpcConfig.webSocket && {
|
|
34
|
-
webSocketProvider: () => new providers.WebSocketProvider(
|
|
34
|
+
webSocketProvider: () => new _ethers.providers.WebSocketProvider(
|
|
35
35
|
rpcConfig.webSocket,
|
|
36
36
|
chain.id
|
|
37
37
|
)
|
|
@@ -39,6 +39,6 @@ function jsonRpcProvider({
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
exports.jsonRpcProvider = jsonRpcProvider;
|
package/dist/providers/public.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }require('../chunk-MQXBDTVK.js');
|
|
2
2
|
|
|
3
3
|
// src/providers/public.ts
|
|
4
|
-
|
|
4
|
+
var _ethers = require('ethers');
|
|
5
5
|
function publicProvider({
|
|
6
6
|
priority,
|
|
7
7
|
stallTimeout,
|
|
@@ -13,12 +13,12 @@ function publicProvider({
|
|
|
13
13
|
return {
|
|
14
14
|
chain,
|
|
15
15
|
provider: () => {
|
|
16
|
-
const provider = new providers.StaticJsonRpcProvider(
|
|
16
|
+
const provider = new _ethers.providers.StaticJsonRpcProvider(
|
|
17
17
|
chain.rpcUrls.default.http[0],
|
|
18
18
|
{
|
|
19
19
|
chainId: chain.id,
|
|
20
20
|
name: chain.network,
|
|
21
|
-
ensAddress: chain.contracts
|
|
21
|
+
ensAddress: _optionalChain([chain, 'access', _ => _.contracts, 'optionalAccess', _2 => _2.ensRegistry, 'optionalAccess', _3 => _3.address])
|
|
22
22
|
}
|
|
23
23
|
);
|
|
24
24
|
return Object.assign(provider, { priority, stallTimeout, weight });
|
|
@@ -26,6 +26,6 @@ function publicProvider({
|
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
exports.publicProvider = publicProvider;
|
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.8.
|
|
5
|
+
"version": "0.8.18-cjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/wagmi-dev/wagmi.git",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"url": "https://github.com/sponsors/wagmi-dev"
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
|
-
"type": "module",
|
|
27
26
|
"main": "dist/index.js",
|
|
28
27
|
"types": "dist/index.d.ts",
|
|
29
28
|
"exports": {
|
|
@@ -111,11 +110,11 @@
|
|
|
111
110
|
}
|
|
112
111
|
},
|
|
113
112
|
"dependencies": {
|
|
113
|
+
"@wagmi/chains": "0.1.13-cjs",
|
|
114
|
+
"@wagmi/connectors": "0.1.9-cjs",
|
|
114
115
|
"abitype": "^0.2.5",
|
|
115
116
|
"eventemitter3": "^4.0.7",
|
|
116
|
-
"zustand": "^4.3.1"
|
|
117
|
-
"@wagmi/chains": "0.1.12",
|
|
118
|
-
"@wagmi/connectors": "0.1.9"
|
|
117
|
+
"zustand": "^4.3.1"
|
|
119
118
|
},
|
|
120
119
|
"devDependencies": {
|
|
121
120
|
"@coinbase/wallet-sdk": "^3.6.0",
|