tech-solana-connector
v1.0.4
Published
https://www.npmjs.com/package/tech-solana-connector
Downloads
11
Readme
Connector for solana wallets
https://www.npmjs.com/package/tech-solana-connector
yarn add tech-solana-connector
or npm i tech-solana-connector
Usage
WalletProvider autoConnect
is optional parameter
const { balance, walletAddress } = useAccountInfo()
returns balance and address of user wallet
const { wallets, endpoint } = useWallets()
For styling WalletButtons you can use styled-components or classnames styling.
import { ConnectionProvider, WalletProvider } from 'tech-solana-connector';
import { useWallets } from 'tech-solana-connector'
import { WalletModalProvider, WalletMultiButton } from 'tech-solana-connector'
import { useAccountInfo } from 'tech-solana-connector'
function App() {
const {wallets, endpoint} = useWallets()
const {balance, walletAddress} = useAccountInfo()
return (
<ConnectionProvider endpoint={endpoint}>
<WalletProvider wallets={wallets} autoConnect>
<div className="App">
<header className="App-header">
<WalletModalProvider>
<WalletMultiButton />
</WalletModalProvider>
</header>
</div>
</WalletProvider>
</ConnectionProvider>
);
}