@unielon/wallet-connect-react
v0.0.14
Published
unielon wallet js sdk rom react provider、swap pools base action, base use for React
Downloads
6
Readme
Unielon Wallet browser extension & React Provider
Powering the future for Unielon DRC20 Wallet. Connecting the Unielon Wallet to the base library through React Provider.
Installation
yarn add @unielon/wallet-connect-react
npm i @unielon/wallet-connect-react --save
Initialize
/* App.jsx */
import { WalletConnect } from 'unielon-react-react'
export default App(){
return (
<WalletProvider>
...
</WalletProvider>
)
}
connect to unielon wallet
/* ConnectButton.jsx */
import { useWallet } from './provider'
export default function ConnectButton() {
const { connect, connectLoading, address } = useWallet()
console.log(wallet)
return <button onClick={() => wallet?.connect()}>{connectLoading ? 'connecting...' : address ? wallet.address : 'Connect Wallet'}</button>
}