@anchor-protocol/wallet-provider
v0.4.0
Published
<https://anchor-storybook.vercel.app/?path=/story/core-wallet-provider--handle-status>
Downloads
17
Keywords
Readme
@anchor-protocol/wallet-provider
https://anchor-storybook.vercel.app/?path=/story/core-wallet-provider--handle-status
Usage
import { WalletProvider } from '@anchor-protocol/wallet-provider';
const mainnet = {
chainID: 'columbus-4',
fcd: 'https://fcd.terra.dev',
lcd: 'https://lcd.terra.dev',
name: 'mainnet',
ws: 'wss://fcd.terra.dev',
};
const testnet = {
chainID: 'tequila-0004',
fcd: 'https://tequila-fcd.terra.dev',
lcd: 'https://tequila-lcd.terra.dev',
name: 'testnet',
ws: 'wss://tequila-ws.terra.dev',
};
function App() {
return (
<WalletProvider
defaultNetwork={mainnet}
walletConnectChainIds={
new Map([
[1, mainnet],
[2, testnet],
])
}
>
<YOUR_APP />
</WalletProvider>
);
}
import { useWallet } from '@anchor-protocol/wallet-provider';
function Component() {
const {
status,
network,
walletAddress,
availableExtension,
connect,
disconnect,
} = useWallet();
return null;
}