diff --git a/.github/workflows/dashboard-ci.yml b/.github/workflows/dashboard-ci.yml
index be1e19186..2b004c875 100644
--- a/.github/workflows/dashboard-ci.yml
+++ b/.github/workflows/dashboard-ci.yml
@@ -29,7 +29,7 @@ jobs:
- uses: actions/setup-node@v3
with:
- node-version: "18"
+ node-version: "20"
cache: "yarn"
# This step forces Git to download dependencies using `https://` protocol,
@@ -58,7 +58,7 @@ jobs:
- uses: actions/setup-node@v3
with:
- node-version: "18"
+ node-version: "20"
cache: "yarn"
# We need this step because the `@keep-network/tbtc` which we update in
diff --git a/.github/workflows/dashboard-mainnet.yml b/.github/workflows/dashboard-mainnet.yml
index df3472a87..8e41eba6b 100644
--- a/.github/workflows/dashboard-mainnet.yml
+++ b/.github/workflows/dashboard-mainnet.yml
@@ -17,7 +17,7 @@ jobs:
- uses: actions/setup-node@v3
with:
- node-version: "18"
+ node-version: "20"
cache: "yarn"
# This step forces Git to download dependencies using `https://` protocol,
diff --git a/.github/workflows/reusable-build-and-publish.yml b/.github/workflows/reusable-build-and-publish.yml
index 5b41ed3fc..4e4559b2f 100644
--- a/.github/workflows/reusable-build-and-publish.yml
+++ b/.github/workflows/reusable-build-and-publish.yml
@@ -87,7 +87,7 @@ jobs:
- uses: actions/setup-node@v3
with:
- node-version: "18"
+ node-version: "20"
cache: "yarn"
# We need this step because the `@keep-network/tbtc` which we update in
diff --git a/craco.config.js b/craco.config.js
index 7c558aa58..773e1a720 100644
--- a/craco.config.js
+++ b/craco.config.js
@@ -1,6 +1,8 @@
module.exports = {
babel: {
plugins: [
+ "@babel/plugin-proposal-numeric-separator",
+ "@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining",
/*
@@ -10,4 +12,16 @@ module.exports = {
["@babel/plugin-transform-class-properties", { loose: true }],
],
},
+ webpack: {
+ configure: (webpackConfig, { env, paths }) => {
+ // Add a rule to handle .mjs files
+ webpackConfig.module.rules.push({
+ test: /\.mjs$/,
+ include: /node_modules/,
+ type: "javascript/auto",
+ })
+
+ return webpackConfig
+ },
+ },
}
diff --git a/package.json b/package.json
index ef9b0c052..e169380e8 100644
--- a/package.json
+++ b/package.json
@@ -44,6 +44,12 @@
"@web3-react/injected-connector": "^6.0.7",
"@web3-react/types": "^6.0.7",
"@web3-react/walletlink-connector": "^6.2.13",
+ "@solana/wallet-adapter-base": "^0.9.24",
+ "@solana/wallet-adapter-react": "^0.15.36",
+ "@solana/wallet-adapter-react-ui": "^0.9.36",
+ "@solana/wallet-adapter-wallets": "^0.19.33",
+ "@solana/web3.js": "^1.98.0",
+ "@coral-xyz/anchor": "^0.31.0",
"axios": "^0.24.0",
"bignumber.js": "^9.1.2",
"bitcoin-address-validation": "^2.2.1",
diff --git a/src/App.tsx b/src/App.tsx
index 1eb7a8ab9..625a187ee 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -7,7 +7,7 @@ import "@fontsource/ibm-plex-mono/400.css"
import { FC, useEffect, Fragment } from "react"
import { Box, ChakraProvider, useColorModeValue } from "@chakra-ui/react"
import { Provider as ReduxProvider, useDispatch } from "react-redux"
-import { useWeb3React, Web3ReactProvider } from "@web3-react/core"
+import { Web3ReactProvider } from "@web3-react/core"
import { ConnectorEvent, ConnectorUpdate } from "@web3-react/types"
import {
BrowserRouter as Router,
@@ -38,7 +38,7 @@ import { useSubscribeToToppedUpEvent } from "./hooks/useSubscribeToToppedUpEvent
import { pages } from "./pages"
import { useCheckBonusEligibility } from "./hooks/useCheckBonusEligibility"
import { useFetchStakingRewards } from "./hooks/useFetchStakingRewards"
-import { isSameETHAddress } from "./web3/utils"
+import { isSameAddress } from "./web3/utils"
import { ThresholdProvider } from "./contexts/ThresholdContext"
import { LedgerLiveAppProvider } from "./contexts/LedgerLiveAppContext"
import {
@@ -63,9 +63,10 @@ import { useIsEmbed } from "./hooks/useIsEmbed"
import TBTC from "./pages/tBTC"
import { useDetectIfEmbed } from "./hooks/useDetectIfEmbed"
import { useGoogleTagManager } from "./hooks/google-tag-manager"
-import { hexToNumber, isSameChainId } from "./networks/utils"
+import { hexToNumber, isSameChainNameOrId } from "./networks/utils"
import { walletConnected } from "./store/account"
import { useIsActive } from "./hooks/useIsActive"
+import SolanaWalletProvider from "./contexts/SolanaWalletProvider"
const Web3EventHandlerComponent = () => {
useSubscribeToVendingMachineContractEvents()
@@ -95,7 +96,7 @@ const Web3EventHandlerComponent = () => {
// TODO: Let's move this to its own hook like useKeep, useT, etc
const useSubscribeToVendingMachineContractEvents = () => {
- const { account } = useWeb3React()
+ const { account } = useIsActive()
const { openModal } = useModal()
const keepVendingMachine = useVendingMachineContract(Token.Keep)
const nuVendingMachine = useVendingMachineContract(Token.Nu)
@@ -142,7 +143,10 @@ const AppBody = () => {
const updateHandler = (update: ConnectorUpdate) => {
// if chain is changed then just update the redux store for the wallet
// connection
- if (update.chainId && !isSameChainId(update.chainId, chainId as number)) {
+ if (
+ update.chainId &&
+ !isSameChainNameOrId(update.chainId, chainId as number)
+ ) {
dispatch(
walletConnected({
address: account || "",
@@ -151,7 +155,7 @@ const AppBody = () => {
)
} else if (
update.account &&
- !isSameETHAddress(update.account, account as string)
+ !isSameAddress(update.account, account as string)
) {
// dispatch(resetStoreAction())
@@ -266,19 +270,21 @@ const App: FC = () => {
return (
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
)
diff --git a/src/components/Modal/ConfirmStakingParams/AdvancedParamsForm.tsx b/src/components/Modal/ConfirmStakingParams/AdvancedParamsForm.tsx
index bb5848eeb..c4b62fce7 100644
--- a/src/components/Modal/ConfirmStakingParams/AdvancedParamsForm.tsx
+++ b/src/components/Modal/ConfirmStakingParams/AdvancedParamsForm.tsx
@@ -8,9 +8,9 @@ import {
BodyXs,
useColorModeValue,
} from "@threshold-network/components"
-import { useWeb3React } from "@web3-react/core"
-import { isAddress, isSameETHAddress } from "../../../web3/utils"
+import { isEthereumAddress, isSameAddress } from "../../../web3/utils"
import Link from "../../Link"
+import { useIsActive } from "../../../hooks/useIsActive"
export interface FormValues {
stakingProvider: string
@@ -27,7 +27,7 @@ const AdvancedParamsFormBase: FC> = ({
values,
}) => {
const { authorizer } = values
- const { account } = useWeb3React()
+ const { account } = useIsActive()
return (