EthosConnect example using Next.js
This is a Next.js app written with TypeScript implementing EthosConnect, the easiest way to connect with any wallet on Sui.
For a start to finish guide, check out the EthosConnect docs.
Here are the places in the code that implement EthosConnect:
The EthosConnectProvider
wraps the whole app:
function MyApp({ Component, pageProps }: AppProps) {
return (
<EthosConnectProvider>
<Component {...pageProps} />
</EthosConnectProvider>
);
}
This is the rest of the app. It's a simple app for signing in with a wallet, funding the wallet with the TestNet faucet, and minting an NFT.
It uses the EthosConnect
hooks:
const { status, wallet } = ethos.useWallet();
The SignInButton
component:
<SignInButton />
...and more!
You can publish the Move contract using the following command:
sui client publish --gas-budget 10000
yarn dev
And then open a browser window to the specified port (e.g. http://localhost:3000)
Simply deploy to the main branch and the live site should update.