@wagmi/core 0.3.3 → 0.3.4
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.
|
@@ -137,16 +137,18 @@ class WalletConnectConnector extends base.Connector {
|
|
|
137
137
|
|
|
138
138
|
async getProvider(create) {
|
|
139
139
|
if (!base._classPrivateFieldGet(this, _provider) || create) {
|
|
140
|
-
var _this$options, _this$options2;
|
|
140
|
+
var _this$options, _this$options2, _this$options3;
|
|
141
141
|
|
|
142
|
-
const
|
|
142
|
+
const chainId = ((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.chainId) || this.chains[0].id;
|
|
143
|
+
const rpc = !((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.infuraId) ? this.chains.reduce((rpc, chain) => ({ ...rpc,
|
|
143
144
|
[chain.id]: chain.rpcUrls.default
|
|
144
145
|
}), {}) : {};
|
|
145
146
|
const WalletConnectProvider = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@walletconnect/ethereum-provider')); })).default;
|
|
146
147
|
|
|
147
148
|
base._classPrivateFieldSet(this, _provider, new WalletConnectProvider({ ...this.options,
|
|
149
|
+
chainId,
|
|
148
150
|
rpc: { ...rpc,
|
|
149
|
-
...((_this$
|
|
151
|
+
...((_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.rpc)
|
|
150
152
|
}
|
|
151
153
|
}));
|
|
152
154
|
}
|
|
@@ -137,16 +137,18 @@ class WalletConnectConnector extends base.Connector {
|
|
|
137
137
|
|
|
138
138
|
async getProvider(create) {
|
|
139
139
|
if (!base._classPrivateFieldGet(this, _provider) || create) {
|
|
140
|
-
var _this$options, _this$options2;
|
|
140
|
+
var _this$options, _this$options2, _this$options3;
|
|
141
141
|
|
|
142
|
-
const
|
|
142
|
+
const chainId = ((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.chainId) || this.chains[0].id;
|
|
143
|
+
const rpc = !((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.infuraId) ? this.chains.reduce((rpc, chain) => ({ ...rpc,
|
|
143
144
|
[chain.id]: chain.rpcUrls.default
|
|
144
145
|
}), {}) : {};
|
|
145
146
|
const WalletConnectProvider = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@walletconnect/ethereum-provider')); })).default;
|
|
146
147
|
|
|
147
148
|
base._classPrivateFieldSet(this, _provider, new WalletConnectProvider({ ...this.options,
|
|
149
|
+
chainId,
|
|
148
150
|
rpc: { ...rpc,
|
|
149
|
-
...((_this$
|
|
151
|
+
...((_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.rpc)
|
|
150
152
|
}
|
|
151
153
|
}));
|
|
152
154
|
}
|
|
@@ -115,16 +115,18 @@ class WalletConnectConnector extends Connector {
|
|
|
115
115
|
|
|
116
116
|
async getProvider(create) {
|
|
117
117
|
if (!_classPrivateFieldGet(this, _provider) || create) {
|
|
118
|
-
var _this$options, _this$options2;
|
|
118
|
+
var _this$options, _this$options2, _this$options3;
|
|
119
119
|
|
|
120
|
-
const
|
|
120
|
+
const chainId = ((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.chainId) || this.chains[0].id;
|
|
121
|
+
const rpc = !((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.infuraId) ? this.chains.reduce((rpc, chain) => ({ ...rpc,
|
|
121
122
|
[chain.id]: chain.rpcUrls.default
|
|
122
123
|
}), {}) : {};
|
|
123
124
|
const WalletConnectProvider = (await import('@walletconnect/ethereum-provider')).default;
|
|
124
125
|
|
|
125
126
|
_classPrivateFieldSet(this, _provider, new WalletConnectProvider({ ...this.options,
|
|
127
|
+
chainId,
|
|
126
128
|
rpc: { ...rpc,
|
|
127
|
-
...((_this$
|
|
129
|
+
...((_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.rpc)
|
|
128
130
|
}
|
|
129
131
|
}));
|
|
130
132
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@wagmi/core",
|
|
3
3
|
"description": "Vanilla JS library for Ethereum",
|
|
4
4
|
"license": "WAGMIT",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.4",
|
|
6
6
|
"repository": "tmm/wagmi",
|
|
7
7
|
"author": "awkweb.eth",
|
|
8
8
|
"ethereum": "awkweb.eth",
|
|
@@ -100,6 +100,5 @@
|
|
|
100
100
|
"dapps",
|
|
101
101
|
"wallet",
|
|
102
102
|
"web3"
|
|
103
|
-
]
|
|
104
|
-
"readme": "# @wagmi/core\n\n## Documentation\n\nFor full documentation and examples, visit [wagmi.sh](https://wagmi.sh).\n\n## Installation\n\nInstall wagmi and its ethers peer dependency.\n\n```bash\nnpm install @wagmi/core ethers\n```\n\n## Community\n\nCheck out the following places for more wagmi-related content:\n\n- Join the [discussions on GitHub](https://github.com/tmm/wagmi/discussions)\n- Follow [@awkweb](https://twitter.com/awkweb) and [@wagmi_sh](https://twitter.com/wagmi_sh) on Twitter for project updates\n- Sign the [guestbook](https://github.com/tmm/wagmi/discussions/2)\n- Share [your project/organization](https://github.com/tmm/wagmi/discussions/201) using wagmi\n\n## Support\n\nIf you find wagmi useful, please consider supporting development. Thank you 🙏\n\n- [GitHub Sponsors](https://github.com/sponsors/tmm?metadata_campaign=readme_core)\n- [Gitcoin Grant](https://gitcoin.co/grants/4493/wagmi-react-hooks-library-for-ethereum)\n- [awkweb.eth](https://etherscan.io/enslookup-search?search=awkweb.eth)\n"
|
|
103
|
+
]
|
|
105
104
|
}
|