Skip to content

shoaib-blocksdev/social-wallet-example

Repository files navigation

Cloud Social Wallet

Usage:

yarn add cloud-social-wallet
import {WalletProvider} from "cloud-social-wallet";

function App() {
    return (
        <WalletProvider config={{rpc: '', backend_url: '', prefix: 'juno'}}>
            <WalletApp/>
        </WalletProvider>
    )
}
import {useWallet} from "cloud-social-wallet";

function WalletApp() {
    const {address, logout, login} = useWallet()
    return (
        <>
            {
                address ? <>
                    <p>{address}</p>
                    <button onClick={logout}>Disconnect</p>
                </> : <>
                    <button onClick={() => login('google')}>Google Login</button>
                    <button onClick={() => login('facebook')}>Facebook Login</button>
                    <button onClick={() => login('twitter')}>Twitter Login</button>
                    <button onClick={() => login('auth')}>Login with Email</button>
                </>
            }
        </>
    )
}