0.3.0 • Published 3 months ago
@hicaru/bearby-react v0.3.0
Introduction
The react web3 module of bearby wallet.
Quick Start
In your project:
yarn add @hicaru/bearby-react # or npm install @hicaru/bearby-react
The first step is to wrap you App or any React subtree with the BearbyProvider
import { BearbyProvider } from '@hicaru/bearby-react';
ReactDOM.render(
<React.StrictMode>
<BearbyProvider>
<App />
</BearbyProvider>
</React.StrictMode>,
document.getElementById('root')
);
In any React child of the provider, one can use the useBearby
hook in order to access the state and methods.
import { useBearby, BearbyProvider } from '@hicaru/bearby-react';
function App() {
const { connected, enabled, wallet, massa, contract, base58, net, period } = useBearby();
return (
<div>
<p>
connected:({String(connected)})
</p>
<p>
period:({String(period)})
</p>
<p>
enabled:({String(enabled)})
</p>
<p>
base58:({String(base58)})
</p>
<p>
network:({String(net)})
</p>
<button onClick={() => wallet.connect()}>
connect
</button>
</div>
);
}
0.3.0
3 months ago
0.2.7
10 months ago
0.2.9
9 months ago
0.2.8
10 months ago
0.2.6
1 year ago
0.2.5
1 year ago
0.2.1
1 year ago
0.2.3
1 year ago
0.2.4
1 year ago
0.2.0
2 years ago
0.1.9
2 years ago
0.1.7
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.0
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago