Skip to content

Commit

Permalink
v12
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Aug 8, 2024
1 parent 46c758e commit 8883d13
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 22 deletions.
1 change: 1 addition & 0 deletions web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const nextConfig = {
reactStrictMode: true,
webpack: (config, { dev }) => {
config.optimization.minimize = false;
config.externals.push("pino-pretty", "lokijs", "encoding");
return config;
},
Expand Down
4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"@rainbow-me/rainbowkit": "^2.1.3",
"@tanstack/react-query": "^5.28.4",
"@zetachain/universalkit": "^1.0.0",
"@zetachain/universalkit": "^2.0.0",
"autoprefixer": "^10.4.19",
"next": "^14.2.3",
"next-themes": "^0.3.0",
Expand All @@ -29,4 +29,4 @@
"node": ">=18.0.0"
},
"packageManager": "[email protected]+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
}
}
7 changes: 4 additions & 3 deletions web/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { ConnectButton } from "@rainbow-me/rainbowkit";
import { ConnectBitcoin } from "@zetachain/universalkit";
import { ConnectBitcoin, Balances } from "@zetachain/universalkit";
import { Welcome } from "./welcome";

const Page = () => {
Expand All @@ -11,9 +11,10 @@ const Page = () => {
<ConnectBitcoin />
<ConnectButton label="Connect EVM" showBalance={false} />
</div>
<Welcome />
<div className="flex justify-center">
<div className="w-[400px]">{/* Add components here */}</div>
<div className="w-[400px]">
<Balances></Balances>
</div>
</div>
</div>
);
Expand Down
45 changes: 38 additions & 7 deletions web/src/app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import { useState, useEffect } from "react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { WagmiProvider } from "wagmi";
import { WagmiProvider, useChainId, useWalletClient } from "wagmi";
import {
RainbowKitProvider,
darkTheme,
lightTheme,
} from "@rainbow-me/rainbowkit";
import { UniversalKitProvider } from "@zetachain/universalkit";
import { UniversalKitProvider, useEthersSigner } from "@zetachain/universalkit";
import { config } from "../wagmi";
import { useTheme, ThemeProvider as NextThemesProvider } from "next-themes";

Expand All @@ -23,6 +23,39 @@ const ThemeProvider = ({ children }: { children: React.ReactNode }) => {
);
};

const WagmiWrapper = ({ children }: { children: React.ReactNode }) => {
const chainId = useChainId();
const { data: walletClient } = useWalletClient({ chainId });
const signer = useEthersSigner({ walletClient });

if (!signer) null;

const zetaConfig = {
network: "testnet",
signer,
chains: {
zeta_testnet: {
api: [
{
url: "https://zetachain-athens.g.allthatnode.com/archive/evm",
type: "evm",
},
],
},
},
};

return (
<UniversalKitProvider
config={config}
client={queryClient}
zetaChainConfig={zetaConfig}
>
{children}
</UniversalKitProvider>
);
};

export const Providers = ({ children }: { children: React.ReactNode }) => {
const [mounted, setMounted] = useState(false);

Expand All @@ -41,11 +74,9 @@ export const Providers = ({ children }: { children: React.ReactNode }) => {
enableSystem
disableTransitionOnChange
>
<ThemeProvider>
<UniversalKitProvider config={config} client={queryClient}>
{children}
</UniversalKitProvider>
</ThemeProvider>
<WagmiWrapper>
<ThemeProvider>{children}</ThemeProvider>
</WagmiWrapper>
</NextThemesProvider>
</QueryClientProvider>
</WagmiProvider>
Expand Down
28 changes: 18 additions & 10 deletions web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3067,6 +3067,13 @@
dependencies:
dotenv "^16.1.4"

"@zetachain/networks@^9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@zetachain/networks/-/networks-9.0.0.tgz#59eddb02578d784a1d76299ead600dffce87f48c"
integrity sha512-vCSkzyiubgYHK0NAJFFCv9gQziGrB+BT9q6DEu29owWxHcGLHPbI4VJ5PbkWH+z8pExVSDe2wKxGN5l2ZAcbGA==
dependencies:
dotenv "^16.1.4"

"@zetachain/[email protected]":
version "8.0.0-rc1"
resolved "https://registry.yarnpkg.com/@zetachain/protocol-contracts/-/protocol-contracts-8.0.0-rc1.tgz#34df589c1b56df77f2695b37bd8a4b79df1787b1"
Expand All @@ -3077,18 +3084,18 @@
resolved "https://registry.yarnpkg.com/@zetachain/protocol-contracts/-/protocol-contracts-7.0.0.tgz#20eb6c62d805d7470408ccdff0e3614684bca174"
integrity sha512-8JTNFZxVZYmDtAXJIEr+tkakuML12X42Fya4bJ1NkfWiVMkcSej92BSTl/35qYtHdjY7vXy9uMrfXEqfw5rsPw==

"@zetachain/toolkit@^11.0.0":
version "11.0.0"
resolved "https://registry.yarnpkg.com/@zetachain/toolkit/-/toolkit-11.0.0.tgz#3e6138082b1b8d2cbab7124d28204090c99555a2"
integrity sha512-gKQAHOcBPMRBnkn7mhshWTj5JRBJ5Y+TAiM2aCUmPpdEDgcxsnBcKbKsSVziop6QQjRwcjrG+6YM6GLnmLOJ3w==
"@zetachain/toolkit@^12.0.0":
version "12.0.0"
resolved "https://registry.yarnpkg.com/@zetachain/toolkit/-/toolkit-12.0.0.tgz#383b0ea165ca417ede01beb7617aa04aee7d82d4"
integrity sha512-3ZIXHaI3OMf7bAp91bryalmq6HEvYFjG8wTNjCGqyBYaK6oQafgH8+zkgrVotm6LmO9EDOZd2E1L4sPOyFS7Mw==
dependencies:
"@inquirer/prompts" "^2.1.1"
"@inquirer/select" "1.1.3"
"@nomiclabs/hardhat-ethers" "^2.2.3"
"@openzeppelin/contracts" "^4.9.6"
"@uniswap/v2-periphery" "^1.1.0-beta.0"
"@zetachain/faucet-cli" "^4.0.1"
"@zetachain/networks" "^8.0.0"
"@zetachain/networks" "^9.0.0"
"@zetachain/protocol-contracts" "8.0.0-rc1"
axios "^1.4.0"
bech32 "^2.0.0"
Expand All @@ -3110,10 +3117,10 @@
tiny-secp256k1 "^2.2.3"
ws "^8.13.0"

"@zetachain/universalkit@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@zetachain/universalkit/-/universalkit-1.0.0.tgz#e10094cbadba9e5edcaf4cf5341f9316f023d280"
integrity sha512-cLqaxwg3jXLektmLtxtmjAzc3UKbSV6ToeP/H9K4H+ep3kUnVHoDM7gZbazEKevO4/aRIKyzbjmZagOWeG4eZg==
"@zetachain/universalkit@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@zetachain/universalkit/-/universalkit-2.0.0.tgz#cb49036403181c7dcd30bef64de195646bc1425a"
integrity sha512-80WNBZJfOn8x3z9N+bCmsdNCb6+JWTCXJ1c0OuATZVBEAg1UHgNgooBo76gadjJtGwqxPU80LKMEpF6muOntXA==
dependencies:
"@evmos/provider" "0.3.1"
"@evmos/transactions" "0.2.10"
Expand All @@ -3130,7 +3137,7 @@
"@web3-name-sdk/core" "^0.2.0"
"@zetachain/networks" "^8.0.0"
"@zetachain/protocol-contracts" "^7.0.0"
"@zetachain/toolkit" "^11.0.0"
"@zetachain/toolkit" "^12.0.0"
autoprefixer "^10.4.19"
bech32 "^2.0.0"
class-variance-authority "^0.7.0"
Expand Down Expand Up @@ -7404,6 +7411,7 @@ workerpool@^6.5.1:
integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
name wrap-ansi-cjs
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down

0 comments on commit 8883d13

Please sign in to comment.