From 170cea0f40fcc939ba149b37718eba1c090c616c Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Mon, 1 Apr 2024 11:00:57 +0900 Subject: [PATCH] Update to toolkit v6 (#29) --- app/index.tsx | 5 ++++- app/layout.tsx | 4 ++-- components/transfer.tsx | 2 +- package.json | 4 ++-- yarn.lock | 28 ++++++++++++++-------------- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/app/index.tsx b/app/index.tsx index acaa31c..c7283c9 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -189,7 +189,10 @@ export default function Index({ children }: RootLayoutProps) { if (!isConnected) { return setBalances([]) } - const b = await client.getBalances(address, btc) + const b = await client.getBalances({ + evmAddress: address, + btcAddress: btc, + }) setBalances(b) } catch (e) { console.log(e) diff --git a/app/layout.tsx b/app/layout.tsx index 16a692d..16a292c 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -21,8 +21,8 @@ import { import { WagmiConfig, configureChains, createConfig } from "wagmi" import { bscTestnet, - goerli, polygonMumbai, + sepolia, zetachainAthensTestnet, } from "wagmi/chains" import { publicProvider } from "wagmi/providers/public" @@ -33,7 +33,7 @@ interface RootLayoutProps { const { chains, publicClient, webSocketPublicClient } = configureChains( [ - goerli, + sepolia, polygonMumbai, bscTestnet, { diff --git a/components/transfer.tsx b/components/transfer.tsx index 613f100..e8c92f6 100644 --- a/components/transfer.tsx +++ b/components/transfer.tsx @@ -198,7 +198,7 @@ const Transfer = () => { parseFloat(sourceAmount) > 0 && setDestinationAmountIsLoading(true) const rpc = getEndpoints("evm", "zeta_testnet")[0]?.url const provider = new ethers.providers.StaticJsonRpcProvider(rpc) - const routerAddress = getAddress("uniswapv2Router02", "zeta_testnet") + const routerAddress = getAddress("uniswapV2Router02", "zeta_testnet") const router = new ethers.Contract( routerAddress as any, UniswapV2Factory.abi, diff --git a/package.json b/package.json index f849e02..a5a6d6c 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@uniswap/v3-core": "^1.0.1", "@uniswap/v3-sdk": "^3.10.0", "@zetachain/example-contracts": "1.0.0-rc1", - "@zetachain/toolkit": "6.0.0-rc3", + "@zetachain/toolkit": "6.0.0", "bech32": "^2.0.0", "class-variance-authority": "^0.4.0", "clsx": "^1.2.1", @@ -85,4 +85,4 @@ "tailwindcss": "^3.3.2", "typescript": "^5.2.2" } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index e3d2400..d4388f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3664,22 +3664,22 @@ typescript "5.0.4" zod "3.19.1" -"@zetachain/networks@4.0.0-rc1": - version "4.0.0-rc1" - resolved "https://registry.yarnpkg.com/@zetachain/networks/-/networks-4.0.0-rc1.tgz#0ec6efabaa78d7124f5adb9218f25d85e252087b" - integrity sha512-Zl8cZc5PdKI46KZqPeIu7DmpSqUkXN07L9Yxy/Lp233L9pZKWUVr7RnEq2HUaN9F6gqtxlofNtKBFopphm1pEQ== +"@zetachain/networks@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@zetachain/networks/-/networks-6.0.0.tgz#ae5d3cd1678b32510edfaa71f8f4a6f4cbc1d9ab" + integrity sha512-yKFVP/yJDp76Q5lBGfZSpY/KO3TZ9ldo0lhE4MpBW43EsBxOZWixg6sqb56mcU/gg1lbWG8sHHWtYFK51SByjQ== dependencies: dotenv "^16.1.4" -"@zetachain/protocol-contracts@5.0.0-rc6": - version "5.0.0-rc6" - resolved "https://registry.yarnpkg.com/@zetachain/protocol-contracts/-/protocol-contracts-5.0.0-rc6.tgz#1ec1419a71cdea831ac8de159bfbffae257785f5" - integrity sha512-NIN3mkR4csq1yGtv9miOWKHj2S6azTo/QET7ALKh5dxPnpCmTHx9Lgf+xuDa95W/Tbw8BAGHdRoyp0z3j72kXQ== +"@zetachain/protocol-contracts@7.0.0-rc1": + version "7.0.0-rc1" + resolved "https://registry.yarnpkg.com/@zetachain/protocol-contracts/-/protocol-contracts-7.0.0-rc1.tgz#588483d1ec70e572b7e40e84ef5b34282b0ab375" + integrity sha512-vgS+Pjh4MysOyw8WbqTQVBsHJYqKvMcdV7cNVqxaTJd/dl2ak7NNvsIeaeUnxQrp8XfQol2B8GXJpVLM6MK/dg== -"@zetachain/toolkit@6.0.0-rc3": - version "6.0.0-rc3" - resolved "https://registry.yarnpkg.com/@zetachain/toolkit/-/toolkit-6.0.0-rc3.tgz#20c19eac528b836d781fa2c51ba16d574f565fd0" - integrity sha512-tyQkrLJnGBQ7LoH3tKqGwM3jaAm1Z85ZgtGfjjeLJNgsTo9urYZ2g++XhxjaQJKlE80295ieyZ2RwfyPAPvIkw== +"@zetachain/toolkit@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@zetachain/toolkit/-/toolkit-6.0.0.tgz#385cfd11f1ac39cbb6ca6410109523e2ab6f8841" + integrity sha512-JAtl7CX8cMJ+iw/byjcbLqgCfPS87vkdYCZOPBBOudqUySPTz4owqVgGZB/xYRyXBsF0KW0F6R65sc+fleQ86A== dependencies: "@inquirer/prompts" "^2.1.1" "@inquirer/select" "1.1.3" @@ -3687,8 +3687,8 @@ "@openzeppelin/contracts" "^4.9.2" "@uniswap/v2-periphery" "^1.1.0-beta.0" "@zetachain/faucet-cli" "^4.0.1" - "@zetachain/networks" "4.0.0-rc1" - "@zetachain/protocol-contracts" "5.0.0-rc6" + "@zetachain/networks" "6.0.0" + "@zetachain/protocol-contracts" "7.0.0-rc1" axios "^1.4.0" bech32 "^2.0.0" bip39 "^3.1.0"