You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the providers in place, you can call `connectExtensionAccounts` to connect to an extension. The following example attempts to find and connect to Subwallet JS upon a button click.
58
+
With the providers in place, you can call `connectExtension` to connect to an extension. The following example attempts to find and connect to Subwallet JS upon a button click.
A Dapp identifier that is provided to the web3 extension(s) being connected to.
101
-
102
-
#### network
103
-
`string`
104
-
105
-
The active network, in lower-case.
106
-
107
89
#### ss58
108
90
`number`
109
91
110
92
The SS58 prefix of the current network.
111
93
112
-
_Planned to be derived from network in a future release._
113
-
114
-
#### activeAccount
115
-
`string|null`
116
-
117
-
The current active account on your Dapp, if any. `ExtensionAccountsProvider` will automatically connect to this active account, if found, when subscribing to extension account. See the next prop for more details.
118
-
119
-
#### setActiveAccount
120
-
`(address:string):void`
94
+
## Values
121
95
122
-
Provide a setter function to call if the active account is found when subscribing to extension accounts.
96
+
#### extensionsInitialised
97
+
`string[]`
123
98
99
+
A record of the extensions that have been initialised along with their status.
124
100
125
-
## Values
126
101
127
-
#### connectExtensionAccounts
102
+
#### connectExtension
128
103
`(id:string):Promise<boolean>`
129
104
130
105
Call this function to connect to the provided extension id and subscribe to its accounts.
@@ -134,8 +109,7 @@ Call this function to connect to the provided extension id and subscribe to its
134
109
135
110
Geta a list of available extension accounts, formatted by the provided ss58 prefix.
136
111
137
-
#### extensionAccountsSynced
138
-
`boolean`
139
-
140
-
Signals whether extensions are still being connected to and subscribed to. A value of true means that the process is complete.
112
+
#### extensionsSynced
113
+
`'unsynced'|'syncing'|'synced'`
141
114
115
+
Signals whether extensions are still being synced upon being initialised.
Web3 extensions are injected into the `window.injectedWeb3` object, which is an asynchronous process that happens when the window loads. For this reason, `ExtensionsProvider` also provides a `checkingInjectedWeb3` boolean value, that signals whether the initial check for injectedWeb3 is underway.
44
+
Web3 extensions are injected into the `window.injectedWeb3` object, which is an asynchronous process that happens when the window loads. For this reason, `ExtensionsProvider` also provides a `gettingExtensions` boolean value, that signals whether the initial check for injectedWeb3 is underway.
45
45
46
-
`checkingInjectedWeb3` will initially be true, and updated to false once `window.injectedWeb3` is present, or if injectedWeb3 is not found after a 5 second timeout.
46
+
`gettingExtensions` will initially be true, and updated to false once `window.injectedWeb3` is present, or if injectedWeb3 is not found after a 5 second timeout.
47
47
48
48
## Provider Values
49
49
50
-
#### checkingInjectedWeb3
50
+
#### gettingExtensions
51
51
`boolean`
52
52
53
53
Returns a boolean reflecting whether `window.injectedWeb3` is being checked.
0 commit comments