0.0.0-beta.7 • Published 2 years ago
@vitacore-company/vita3auth v0.0.0-beta.7
Vita3auth
React component based on ethers.js library for easy authorization in web3 applications. Login requires mail, password and a unique guid for more security. Save the generated guid for your next login. After creating the wallet, the component gives the Wallet object.
Installation
npm install @vitacore-company/vita3auth --saveUsage
import { Auth } from "@vitacore-company/vita3auth"
import "@vitacore-company/vita3auth/dist/index.css"
<Auth
onEOAchange={setEOAwallet}
label="Authorization"
language="en"
saveCodeExternal={[
{
label: "Console code",
fn: (code) => console.log(code),
icon: () => <div>Console</div>,
},
]}
addCodeExternal={[
{
label: "Add code external",
fn: () => "cf0a4220-50c1-4539-89b4-9155195b5e9e",
icon: () => <div>External</div>,
},
]}
providerURL="https://rpc.chiadochain.net"
/>Acknowledgements
Styles
add @vitacore-company/vita3auth/dist/index.css/scss
API
Auth
| Parameter | Type | Description | |
|---|---|---|---|
onEOAchange | (wallet: Wallet) => void | Required Returns wallet object after generating | |
label | string | Required Title of the login page | |
saveCodeExternal | obj | Required ISaveExternalMethod[] | |
addCodeExternal | obj | Required IAddExternalMethod[] | |
providerURL? | string | Blockchain provider | |
language? | string | en,ru,ch,ar,sp,in,it,ge |
Types
interface IAddExternalMethod {
label: string
fn: () => string
icon: () => JSX.Element
}
interface ISaveExternalMethod {
label: string
fn: (e: string) => void
icon: () => JSX.Element
}Predefined localization
sp Spainish, ge Deutsch, ru Russian
en English, ch Chinese, it Italian
in Indian, ar Arabic
AddressEOA
import { AddressEOA } from "@vitacore-company/vita3auth"
import "@vitacore-company/vita3auth/dist/index.css"
<AddressEOA address={EOAwallet.address} />| Parameter | Type | Description |
|---|---|---|
address? | string | |
noAddressLabel? | string |
Authors
🔗 Links
0.0.0-beta.7
2 years ago
0.0.0-beta.5
2 years ago
0.0.0-beta.6
2 years ago
0.0.0-beta.4
2 years ago
0.0.0-beta.3
2 years ago
0.0.0-beta.2
2 years ago
0.0.0-beta.1
2 years ago