Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update metaport to 3.0.0, rainbowkit v2 #327

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ src/metadata/faucet.json
.vercel

public/sitemap.xml
public/robots.txt
public/robots.txt
tools/*
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@mdx-js/rollup": "^2.3.0",
"@mui/icons-material": "^5.15.14",
"@mui/material": "^5.15.14",
"@skalenetwork/metaport": "2.3.0-develop.1",
"@skalenetwork/metaport": "3.0.0-develop.0",
"@skalenetwork/skale-contracts-ethers-v6": "1.0.1",
"@transak/transak-sdk": "^3.1.1",
"@types/react-copy-to-clipboard": "^5.0.4",
Expand Down
4 changes: 2 additions & 2 deletions src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function Router() {

const { address } = useWagmiAccount()
const { data: walletClient } = useWagmiWalletClient()
const { switchNetworkAsync } = useWagmiSwitchNetwork()
const { switchChainAsync } = useWagmiSwitchNetwork()

const [searchParams, _] = useSearchParams()
const endpoint = PROXY_ENDPOINTS[mpc.config.skaleNetwork]
Expand All @@ -112,7 +112,7 @@ export default function Router() {
await enforceNetwork(
chainId,
walletClient,
switchNetworkAsync!,
switchChainAsync!,
mpc.config.skaleNetwork,
MAINNET_CHAIN_NAME
)
Expand Down
6 changes: 3 additions & 3 deletions src/components/Paymaster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function Paymaster(props: { mpc: MetaportCore; name: string }) {
const [info, setInfo] = useState<PaymasterInfo>(DEFAULT_PAYMASTER_INFO)

const { data: walletClient } = useWagmiWalletClient()
const { switchNetworkAsync } = useWagmiSwitchNetwork()
const { switchChainAsync } = useWagmiSwitchNetwork()

useEffect(() => {
loadPaymasterInfo()
Expand All @@ -104,7 +104,7 @@ export default function Paymaster(props: { mpc: MetaportCore; name: string }) {
}

async function topupChain() {
if (!paymaster.runner?.provider || !walletClient || !switchNetworkAsync) {
if (!paymaster.runner?.provider || !walletClient || !switchChainAsync) {
setErrorMsg('Something is wrong with your wallet, try again')
return
}
Expand All @@ -115,7 +115,7 @@ export default function Paymaster(props: { mpc: MetaportCore; name: string }) {
const { chainId } = await paymaster.runner.provider.getNetwork()
const paymasterAddress = getPaymasterAddress(network)

await enforceNetwork(chainId, walletClient, switchNetworkAsync, network, paymasterChain)
await enforceNetwork(chainId, walletClient, switchChainAsync, network, paymasterChain)
setBtnText('Sending transaction...')
const signer = walletClientToSigner(walletClient)
const connectedPaymaster = new Contract(paymasterAddress, getPaymasterAbi(), signer)
Expand Down
4 changes: 2 additions & 2 deletions src/components/TokenBalanceTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function TokenBalanceTile(props: { mpc: MetaportCore; chain: stri

const { address } = useWagmiAccount()
const { data: walletClient } = useWagmiWalletClient()
const { switchNetworkAsync } = useWagmiSwitchNetwork()
const { switchChainAsync } = useWagmiSwitchNetwork()

useEffect(() => {
setTokenContract(
Expand Down Expand Up @@ -86,7 +86,7 @@ export default function TokenBalanceTile(props: { mpc: MetaportCore; chain: stri
await enforceNetwork(
chainId,
walletClient,
switchNetworkAsync!,
switchChainAsync!,
props.mpc.config.skaleNetwork,
props.chain
)
Expand Down
Loading