peterkc / ethos-example-app

an example app using the ethos-wallet-beta npm package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.


Important files in this repository

Here are the places in the code that implement EthosConnect:

_app.tsx

The EthosConnectProvider wraps the whole app:

function MyApp({ Component, pageProps }: AppProps) {
  return (
    <EthosConnectProvider>
      <Component {...pageProps} />
    </EthosConnectProvider>
  );
}

index.tsx

This is the rest of the app. It's a simple app for signing in with a wallet, funding the wallet with the DevNet faucet, and minting an NFT.

It uses the EthosConnect hooks:

  const { status, wallet } = ethos.useWallet();

The SignInButton component:

<SignInButton />

...and more!

The Move Contract

You can publish the move contract using the following command:

sui client publish --gas-budget 10000

Running The Frunt End

yarn dev

And then open a browser window to the specified port (e.g. http://localhost:3000)

Deploying the front end

Simply deploy to the main branch and the live site should update.

About

an example app using the ethos-wallet-beta npm package


Languages

Language:TypeScript 89.1%Language:Move 8.8%Language:CSS 1.1%Language:JavaScript 1.0%