Skip to content

Instantly share code, notes, and snippets.

@shreykoo
Created March 6, 2022 12:32
Show Gist options
  • Save shreykoo/2f52b172cb69abd640be6697f0ace5ac to your computer and use it in GitHub Desktop.
Save shreykoo/2f52b172cb69abd640be6697f0ace5ac to your computer and use it in GitHub Desktop.
import React, { useState, useEffect } from 'react';
import Connex from '@vechain/connex';
const App = () => {
const [walletClient, setWalletClient] = useState(null);
const connectWallet = async() => {
const client = new Connex({
node: 'https://testnet.veblocks.net/',
network: 'test'
});
const clientDetails = client.thor.block().get();
setWalletClient(clientDetails);
};
return (
<div>
<button onClick={connectWallet}>Connect wallet</button>
<p>
{JSON.stringify(walletClient, 2, null)}
</p>
</div>
);
};
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment