FuelLabs / fuels-wallet

💳 The official Fuel wallet.
https://wallet.fuel.network
Apache License 2.0
928 stars 411 forks source link

Adding connector type to fuel wallet SDK #1119

Open sameoldlab opened 8 months ago

sameoldlab commented 8 months ago

Motivation

Currently all the end user wallets for fuel are browser extensions, but a future wallet could connect from mobile or desktop application. This might already be happening on bridging UIs. Knowing the type of wallet would help with displaying updates and components on the frontend.

Usage example

await fuel.selectConnector(connector.name)
fuel.connect()
if(connector.type === 'injected' {
    // show pending UI
} else if (connector.type === 'walletConnect') {
    // show QR code UI
}

Possible implementations

adding a string property to FuelConnector to indicate the type of wallet, i.e. injected, extension, mobile, scannable, sso, etc. Wallets that connect the same way would have the same type

LuizAsFight commented 7 months ago

@luizstacio what you think on this one ??