@fingerlabs/klaytn-wallets
v0.1.5
Published
## Usage Add it to your project: ``` yarn add @fingerlabs/klaytn-wallets ```
Downloads
4
Keywords
Readme
@fingerlabs/klaytn-wallets
Usage
Add it to your project:
yarn add @fingerlabs/klaytn-wallets
Create wallet instance:
import KlaytnWallet, { AvailableConnectors } from '@fingerlabs/klaytn-wallets'
const wallet = new KlaytnWallet([
AvailableConnectors.KAIKAS,
AvailableConnectors.KLIP,
AvailableConnectors.METAMASK,
AvailableConnectors.DCENT,
AvailableConnectors.TOKENPOCKET,
])
Connect {connectorId} wallet:
if (wallet.isAvailable(connectorId)) {
await wallet.current.activate(connectorId)
}
Get account, connectorId:
console.log(wallet.account)
console.log(wallet.connectorId)
Disconnect wallet:
wallet.deactivate()
if Klip
wallet.initKlip({
{
qrClassName: 'klip-qr',
intervalClassName: 'klip-interval',
renderTimeFormat(time: number) {
return time
},
},
{
show: () => onShowModal(),
hide: () => onHideModal(),
},
})