@wagmi/core 0.2.0-next.6 → 0.2.0-next.7
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/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.dev.js +3 -1
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.prod.js +3 -1
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.esm.js +3 -1
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.dev.js +5 -2
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.prod.js +5 -2
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.esm.js +5 -2
- package/dist/declarations/src/client.d.ts +1 -1
- package/dist/declarations/src/connectors/base.d.ts +4 -1
- package/dist/wagmi-core.cjs.dev.js +3 -1
- package/dist/wagmi-core.cjs.prod.js +3 -1
- package/dist/wagmi-core.esm.js +3 -1
- package/package.json +1 -1
|
@@ -83,7 +83,9 @@ class CoinbaseWalletConnector extends base.Connector {
|
|
|
83
83
|
provider.on('chainChanged', _this.onChainChanged);
|
|
84
84
|
provider.on('disconnect', _this.onDisconnect);
|
|
85
85
|
|
|
86
|
-
_this.emit('
|
|
86
|
+
_this.emit('message', {
|
|
87
|
+
type: 'connecting'
|
|
88
|
+
});
|
|
87
89
|
|
|
88
90
|
var accounts = yield provider.enable();
|
|
89
91
|
var account = utils.getAddress(accounts[0]);
|
|
@@ -83,7 +83,9 @@ class CoinbaseWalletConnector extends base.Connector {
|
|
|
83
83
|
provider.on('chainChanged', _this.onChainChanged);
|
|
84
84
|
provider.on('disconnect', _this.onDisconnect);
|
|
85
85
|
|
|
86
|
-
_this.emit('
|
|
86
|
+
_this.emit('message', {
|
|
87
|
+
type: 'connecting'
|
|
88
|
+
});
|
|
87
89
|
|
|
88
90
|
var accounts = yield provider.enable();
|
|
89
91
|
var account = utils.getAddress(accounts[0]);
|
|
@@ -61,7 +61,9 @@ class CoinbaseWalletConnector extends Connector {
|
|
|
61
61
|
provider.on('chainChanged', _this.onChainChanged);
|
|
62
62
|
provider.on('disconnect', _this.onDisconnect);
|
|
63
63
|
|
|
64
|
-
_this.emit('
|
|
64
|
+
_this.emit('message', {
|
|
65
|
+
type: 'connecting'
|
|
66
|
+
});
|
|
65
67
|
|
|
66
68
|
var accounts = yield provider.enable();
|
|
67
69
|
var account = getAddress(accounts[0]);
|
|
@@ -81,8 +81,11 @@ class WalletConnectConnector extends base.Connector {
|
|
|
81
81
|
var provider = yield _this.getProvider(true);
|
|
82
82
|
provider.on('accountsChanged', _this.onAccountsChanged);
|
|
83
83
|
provider.on('chainChanged', _this.onChainChanged);
|
|
84
|
-
provider.on('disconnect', _this.onDisconnect);
|
|
85
|
-
|
|
84
|
+
provider.on('disconnect', _this.onDisconnect); // Defer message to the next tick to ensure wallet connect data (provided by `.enable()`) is available
|
|
85
|
+
|
|
86
|
+
setTimeout(() => _this.emit('message', {
|
|
87
|
+
type: 'connecting'
|
|
88
|
+
}), 0);
|
|
86
89
|
var accounts = yield provider.enable();
|
|
87
90
|
var account = utils.getAddress(accounts[0]);
|
|
88
91
|
var id = yield _this.getChainId();
|
|
@@ -81,8 +81,11 @@ class WalletConnectConnector extends base.Connector {
|
|
|
81
81
|
var provider = yield _this.getProvider(true);
|
|
82
82
|
provider.on('accountsChanged', _this.onAccountsChanged);
|
|
83
83
|
provider.on('chainChanged', _this.onChainChanged);
|
|
84
|
-
provider.on('disconnect', _this.onDisconnect);
|
|
85
|
-
|
|
84
|
+
provider.on('disconnect', _this.onDisconnect); // Defer message to the next tick to ensure wallet connect data (provided by `.enable()`) is available
|
|
85
|
+
|
|
86
|
+
setTimeout(() => _this.emit('message', {
|
|
87
|
+
type: 'connecting'
|
|
88
|
+
}), 0);
|
|
86
89
|
var accounts = yield provider.enable();
|
|
87
90
|
var account = utils.getAddress(accounts[0]);
|
|
88
91
|
var id = yield _this.getChainId();
|
|
@@ -59,8 +59,11 @@ class WalletConnectConnector extends Connector {
|
|
|
59
59
|
var provider = yield _this.getProvider(true);
|
|
60
60
|
provider.on('accountsChanged', _this.onAccountsChanged);
|
|
61
61
|
provider.on('chainChanged', _this.onChainChanged);
|
|
62
|
-
provider.on('disconnect', _this.onDisconnect);
|
|
63
|
-
|
|
62
|
+
provider.on('disconnect', _this.onDisconnect); // Defer message to the next tick to ensure wallet connect data (provided by `.enable()`) is available
|
|
63
|
+
|
|
64
|
+
setTimeout(() => _this.emit('message', {
|
|
65
|
+
type: 'connecting'
|
|
66
|
+
}), 0);
|
|
64
67
|
var accounts = yield provider.enable();
|
|
65
68
|
var account = getAddress(accounts[0]);
|
|
66
69
|
var id = yield _this.getChainId();
|
|
@@ -61,7 +61,7 @@ export declare class Client {
|
|
|
61
61
|
get data(): Data | undefined;
|
|
62
62
|
get error(): Error | undefined;
|
|
63
63
|
get provider(): BaseProvider;
|
|
64
|
-
get status(): "
|
|
64
|
+
get status(): "connecting" | "connected" | "reconnecting" | "disconnected";
|
|
65
65
|
get subscribe(): {
|
|
66
66
|
(listener: (selectedState: State, previousSelectedState: State) => void): () => void;
|
|
67
67
|
<U>(selector: (state: State) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -12,7 +12,10 @@ export declare type ConnectorData<Provider = any> = {
|
|
|
12
12
|
export interface ConnectorEvents<Provider = any> {
|
|
13
13
|
change(data: ConnectorData<Provider>): void;
|
|
14
14
|
connect(data: ConnectorData<Provider>): void;
|
|
15
|
-
|
|
15
|
+
message({ type, data }: {
|
|
16
|
+
type: string;
|
|
17
|
+
data?: unknown;
|
|
18
|
+
}): void;
|
|
16
19
|
disconnect(): void;
|
|
17
20
|
error(error: Error): void;
|
|
18
21
|
}
|
|
@@ -358,7 +358,9 @@ class InjectedConnector extends base.Connector {
|
|
|
358
358
|
provider.on('disconnect', _this.onDisconnect);
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
-
_this.emit('
|
|
361
|
+
_this.emit('message', {
|
|
362
|
+
type: 'connecting'
|
|
363
|
+
});
|
|
362
364
|
|
|
363
365
|
var account = yield _this.getAccount();
|
|
364
366
|
var id = yield _this.getChainId();
|
|
@@ -358,7 +358,9 @@ class InjectedConnector extends base.Connector {
|
|
|
358
358
|
provider.on('disconnect', _this.onDisconnect);
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
-
_this.emit('
|
|
361
|
+
_this.emit('message', {
|
|
362
|
+
type: 'connecting'
|
|
363
|
+
});
|
|
362
364
|
|
|
363
365
|
var account = yield _this.getAccount();
|
|
364
366
|
var id = yield _this.getChainId();
|
package/dist/wagmi-core.esm.js
CHANGED
|
@@ -351,7 +351,9 @@ class InjectedConnector extends Connector {
|
|
|
351
351
|
provider.on('disconnect', _this.onDisconnect);
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
-
_this.emit('
|
|
354
|
+
_this.emit('message', {
|
|
355
|
+
type: 'connecting'
|
|
356
|
+
});
|
|
355
357
|
|
|
356
358
|
var account = yield _this.getAccount();
|
|
357
359
|
var id = yield _this.getChainId();
|