@@ -29,6 +29,8 @@ const onboard = Onboard.init({
2929 modules: {
3030 // default wallets that are included: MetaMask, Dapper, Coinbase, Trust, WalletConnect
3131 walletSelect: Onboard .modules .select .defaults ({
32+ // if you want squarelink as a wallet option
33+ squarelinkInit: { apiKey: " Your squarelink key here" },
3234 // if you want fortmatic as a wallet option
3335 fortmaticInit: { apiKey: " Your fortmatic key here" },
3436 // if you want portis as a wallet option
@@ -88,7 +90,7 @@ const options = {
8890 address: Function , // Called with the current account address of the user [String]
8991 network: Function , // Called with the current network id the users' wallet is connected to [Number]
9092 balance: Function , // Called with the current balance in `wei` of the users' current account address [String]
91- wallet: Function // Called with the users' current selected wallet [Object]: {provider: Object, name: String}
93+ wallet: Function // Called with the users' current selected wallet [Object]: {provider: Object, name: String, instance: Object (if a sdk wallet) }
9294 },
9395 modules: {
9496 walletSelect: {
@@ -176,6 +178,7 @@ The wallet select modules are functions that return a wallet object. The followi
176178- ` dapper `
177179- ` walletConnect ` (requires initialization)
178180- ` portis ` (requires initialization)
181+ - ` squarelink ` (requires initialization)
179182- ` fortmatic ` (requires initialization)
180183
181184#### Mobile Wallets
@@ -184,6 +187,7 @@ The wallet select modules are functions that return a wallet object. The followi
184187- ` coinbase `
185188- ` walletConnect ` (requires initialization)
186189- ` portis ` (requires initialization)
190+ - ` squarelink ` (requires initialization)
187191- ` fortmatic ` (requires initialization)
188192
189193` defaults ` Initialization:
@@ -192,7 +196,8 @@ The wallet select modules are functions that return a wallet object. The followi
192196modules .select .defaults ({
193197 heading: String , // Override the default heading [optional]
194198 description: String , // Override the default description [optional]
195- networkId: Number , // Required if you want the Portis or Fortmatic modules to be included
199+ networkId: Number , // Required if you want the Portis, Squarelink, or Fortmatic modules to be included
200+ squarelinkInit: Object , // initialization object for Squarelink module (see below)
196201 portisInit: Object , // initialization object for Portis module (see below)
197202 fortmaticInit: Object // initialization object for Fortmatic module (see below)
198203})
@@ -203,23 +208,32 @@ modules.select.defaults({
203208``` javascript
204209portis ({
205210 apiKey: String , // your Portis api key
206- network: String // the name of network you want to connect to
211+ networkId: Number // the networkId of network you want to connect to
212+ })
213+ ```
214+
215+ ` squarelink ` Initialization:
216+
217+ ``` javascript
218+ squarelink ({
219+ apiKey: String , // your Squarelink api key
220+ networkId: Number // the networkId of the network you want to connect to
207221})
208222```
209223
210224` fortmatic ` Initialization:
211225
212226``` javascript
213227fortmatic ({
214- apiKey: String , // your Portis api key
215- network : String // the name of the network you want to connect to
228+ apiKey: String , // your Fortmatic api key
229+ networkId : Number // the networkId of the network you want to connect to
216230})
217231```
218232
219233` walletConnect ` Initialization:
220234
221235``` javascript
222- fortmatic ({
236+ walletConnect ({
223237 infuraKey: String
224238})
225239```
@@ -231,7 +245,13 @@ import Onboard from "bnc-onboard"
231245
232246// PICK AND CHOOSE MODULES
233247
234- const { portis , dapper , metamask , fortmatic } = Onboard .modules .select
248+ const {
249+ portis ,
250+ squarelink ,
251+ dapper ,
252+ metamask ,
253+ fortmatic
254+ } = Onboard .modules .select
235255
236256const onboard = Onboard .init ({
237257 // ...
@@ -242,11 +262,12 @@ const onboard = Onboard.init({
242262 " Please select the wallet that you would like to use with this Dapp" ,
243263 wallets: {
244264 desktop: [
245- portis ({ apiKey: ' sdda-w2-ds3' , network: ' main' })
265+ portis ({ apiKey: " sdda-w2-ds3" , networkId: 1 }),
266+ squarelink ({ apiKey: " sdda-w2-ds3" , networkId: 1 }),
246267 dapper (),
247- metmask (),
268+ metmask ()
248269 ],
249- mobile: [fortmatic ({apiKey: ' sd-3d3-d' , network : ' main ' })]
270+ mobile: [fortmatic ({ apiKey: " sd-3d3-d" , networkId : 1 })]
250271 }
251272 }
252273 // ....
@@ -263,7 +284,7 @@ const onboard = Onboard.init({
263284 walletSelect: Onboard .modules .select .defaults ({
264285 portisInit: { apiKey: " Your portis key here" },
265286 networkId: 4
266- }),
287+ })
267288 // ...
268289 }
269290})
0 commit comments