@wagmi/core 0.4.2 → 0.4.3

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.
@@ -98,7 +98,8 @@ class WalletConnectConnector extends base.Connector {
98
98
  }
99
99
 
100
100
  const provider = await this.getProvider({
101
- chainId: targetChainId
101
+ chainId: targetChainId,
102
+ create: true
102
103
  });
103
104
  provider.on('accountsChanged', this.onAccountsChanged);
104
105
  provider.on('chainChanged', this.onChainChanged);
@@ -153,10 +154,12 @@ class WalletConnectConnector extends base.Connector {
153
154
 
154
155
  async getProvider() {
155
156
  let {
156
- chainId
157
+ chainId,
158
+ create
157
159
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
158
160
 
159
- if (!base._classPrivateFieldGet(this, _provider) || chainId) {
161
+ // Force create new provider
162
+ if (!base._classPrivateFieldGet(this, _provider) || chainId || create) {
160
163
  var _this$options, _this$options2;
161
164
 
162
165
  const rpc = !((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.infuraId) ? this.chains.reduce((rpc, chain) => ({ ...rpc,
@@ -98,7 +98,8 @@ class WalletConnectConnector extends base.Connector {
98
98
  }
99
99
 
100
100
  const provider = await this.getProvider({
101
- chainId: targetChainId
101
+ chainId: targetChainId,
102
+ create: true
102
103
  });
103
104
  provider.on('accountsChanged', this.onAccountsChanged);
104
105
  provider.on('chainChanged', this.onChainChanged);
@@ -153,10 +154,12 @@ class WalletConnectConnector extends base.Connector {
153
154
 
154
155
  async getProvider() {
155
156
  let {
156
- chainId
157
+ chainId,
158
+ create
157
159
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
158
160
 
159
- if (!base._classPrivateFieldGet(this, _provider) || chainId) {
161
+ // Force create new provider
162
+ if (!base._classPrivateFieldGet(this, _provider) || chainId || create) {
160
163
  var _this$options, _this$options2;
161
164
 
162
165
  const rpc = !((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.infuraId) ? this.chains.reduce((rpc, chain) => ({ ...rpc,
@@ -76,7 +76,8 @@ class WalletConnectConnector extends Connector {
76
76
  }
77
77
 
78
78
  const provider = await this.getProvider({
79
- chainId: targetChainId
79
+ chainId: targetChainId,
80
+ create: true
80
81
  });
81
82
  provider.on('accountsChanged', this.onAccountsChanged);
82
83
  provider.on('chainChanged', this.onChainChanged);
@@ -131,10 +132,12 @@ class WalletConnectConnector extends Connector {
131
132
 
132
133
  async getProvider() {
133
134
  let {
134
- chainId
135
+ chainId,
136
+ create
135
137
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
136
138
 
137
- if (!_classPrivateFieldGet(this, _provider) || chainId) {
139
+ // Force create new provider
140
+ if (!_classPrivateFieldGet(this, _provider) || chainId || create) {
138
141
  var _this$options, _this$options2;
139
142
 
140
143
  const rpc = !((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.infuraId) ? this.chains.reduce((rpc, chain) => ({ ...rpc,
@@ -25,8 +25,9 @@ export declare class WalletConnectConnector extends Connector<WalletConnectProvi
25
25
  disconnect(): Promise<void>;
26
26
  getAccount(): Promise<string>;
27
27
  getChainId(): Promise<number>;
28
- getProvider({ chainId }?: {
28
+ getProvider({ chainId, create, }?: {
29
29
  chainId?: number;
30
+ create?: boolean;
30
31
  }): Promise<WalletConnectProvider>;
31
32
  getSigner({ chainId }?: {
32
33
  chainId?: number;
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.4.2",
5
+ "version": "0.4.3",
6
6
  "repository": "tmm/wagmi",
7
7
  "author": "awkweb.eth",
8
8
  "ethereum": "awkweb.eth",