diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml
index b7a23270..5e6d8ec6 100644
--- a/.github/workflows/dev_deploy.yml
+++ b/.github/workflows/dev_deploy.yml
@@ -17,17 +17,16 @@ on:
branches:
- 'dev'
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
deploy:
name: Deployment
runs-on: ubuntu-latest
steps:
- - name: Cancel Previous Runs
- uses: styfle/cancel-workflow-action@0.8.0
- with:
- access_token: ${{ github.token }}
-
- name: Remove broken apt repos [Ubuntu]
if: ${{ matrix.os }} == 'ubuntu-latest'
run: |
diff --git a/.github/workflows/prod_deploy.yml b/.github/workflows/prod_deploy.yml
index 572fb3fa..03716061 100644
--- a/.github/workflows/prod_deploy.yml
+++ b/.github/workflows/prod_deploy.yml
@@ -8,17 +8,16 @@ on:
required: true
type: string
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
deploy:
name: Deployment
runs-on: ubuntu-latest
steps:
- - name: Cancel Previous Runs
- uses: styfle/cancel-workflow-action@0.8.0
- with:
- access_token: ${{ github.token }}
-
- name: Remove broken apt repos [Ubuntu]
if: ${{ matrix.os }} == 'ubuntu-latest'
run: |
diff --git a/.github/workflows/tag_release.yml b/.github/workflows/tag_release.yml
index 9982864d..1dd035fc 100644
--- a/.github/workflows/tag_release.yml
+++ b/.github/workflows/tag_release.yml
@@ -9,17 +9,16 @@ on:
permissions:
contents: write # This is required for actions/checkout and create release
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
release:
name: Github Release
runs-on: ubuntu-latest
steps:
- - name: Cancel Previous Runs
- uses: styfle/cancel-workflow-action@0.8.0
- with:
- access_token: ${{ github.token }}
-
- name: Create Github Release
uses: actions/github-script@v6
with:
diff --git a/docs/shutterized-gc/DeployedContracts.md b/docs/shutterized-gc/DeployedContracts.md
new file mode 100644
index 00000000..f5f148d5
--- /dev/null
+++ b/docs/shutterized-gc/DeployedContracts.md
@@ -0,0 +1,22 @@
+---
+sidebar_position: 3
+title : Deployed Contracts
+---
+
+### Deployed Contract for Shutterized Gnosis Chain Mainnet([Github](https://github.com/shutter-network/shutter-keyper-deployment/tree/gnosis/main?tab=readme-ov-file#contract-deployments))
+
+| Contract Name | Gnosis Chain Mainnet |
+| ------------ | ------------------------------------ |
+| Sequencer | https://gnosis.blockscout.com/address/0xc5C4b277277A1A8401E0F039dfC49151bA64DC2E |
+| ValidatorRegistry | https://gnosis.blockscout.com/address/0xefCC23E71f6bA9B22C4D28F7588141d44496A6D6 |
+| keyperSetManager | https://gnosis.blockscout.com/address/0x7C2337f9bFce19d8970661DA50dE8DD7d3D34abb |
+| keyBroadcastContract | https://gnosis.blockscout.com/address/0x626dB87f9a9aC47070016A50e802dd5974341301 |
+
+
+### Deployed Contract for Shutterized Chiado Testnet
+
+
+| Contract Name | Chiado Test |
+| ------------ | ------------------------------------ |
+| Relayer | https://gnosis-chiado.blockscout.com/address/0xfA606b7eE5Cb3Bb4580FBAa304fE245F91799418 |
+| Sequencer Contract (Encrypted Mempool) | https://gnosis-chiado.blockscout.com/address/0xd073BD5A717Dce1832890f2Fdd9F4fBC4555e41A
\ No newline at end of file
diff --git a/docs/shutterized-gc/README.md b/docs/shutterized-gc/README.md
new file mode 100644
index 00000000..a7f11ffa
--- /dev/null
+++ b/docs/shutterized-gc/README.md
@@ -0,0 +1,47 @@
+---
+sidebar_position: 1
+title: Shutterized Gnosis Chain
+description: The Shutterized Gnosis Chain tackles significant issues, focusing on base-layer neutrality, countering the risk of malicious Maximal Extractable Value (MEV), and maintaining censorship resistance.
+
+keywords: [shutter network shutterized gnosis chain MEV attacks frontrunning]
+---
+
+import React from 'react';
+import Button from '@site/src/components/Button';
+import { changeOrAddNetwork } from '@site/src/utils/changeNetwork';
+
+### Protecting Against MEV Attacks: Shutterized Gnosis Chain
+
+Maximal Extractable Value (MEV) refers to the maximum value that can be extracted from block production in blockchain protocols, particularly in Ethereum. It represents the profits that can be made by miners or validators by reordering, including, or censoring transactions within a block.
+To combat this, the Shutterized Gnosis Chain introduces a mechanism for submitting transactions that resist censorship and front-running attacks by allowing users to encrypt their transactions.
+
+Transactions on the Shutterized Gnosis Chain are only decrypted and executed after their inclusion in the blockchain is confirmed and the order of preceding transactions is finalized. Consequently, any third-party attempting to censor or front-run the transaction will be unable to do so without knowledge of its content, thereby nullifying their efforts. This ensures that transactions are protected from MEV attacks, safeguarding users from financial exploitation and maintaining the integrity of the decentralized system.
+
+### Add the RPC endpoint to your wallet: Take the first step towards secure and private trades on the Gnosis Chain.
+
+
+
+### Shutter Protocol and Threshold Encryption
+
+The Shutter Protocol employs threshold encryption to shield transactions. By encrypting transactions before they enter the public mempool, the protocol prevents malicious actors from exploiting them to their advantage. Participating validators on the Gnosis Chain commit to including these encrypted transactions, making it virtually impossible for front-runners to interfere. This level of protection ensures that end-users are shielded from financial losses and market manipulation, maintaining the integrity of the decentralized system.
+
+With the contribution from teams of [Shutter Network](https://shutter.network/), [Gnosis](https://www.gnosis.io/) and [Nethermind](https://www.nethermind.io/), we released shutterized chiado testnet followed by mainnet release.
+
+### Shutterized Chiado Testnet and Gnosis Mainnet
+
+
+| Network Name | Gnosis (mainnet) | Chiado (testnet) |
+| ------------------ | -------------------------------- | ------------------------------------ |
+| Native (fee) token | xDAI | Chiado xDAI |
+| Chain ID | 100 | 10200 |
+| New RPC URL | https://erpc.gnosis.shutter.network | https://erpc.chiado.staging.shutter.network |
+| Block Explorer | https://gnosis.blockscout.com/ | https://blockscout.com/gnosis/chiado |
+| Faucet | https://faucet.gnosischain.com/ | https://faucet.chiadochain.net/ |
+
+
+### Shutterized Chiado Test dApp
+
+You can test out the test version of Shutterized Chiado [here](https://gnosis-shutter.web.app)
\ No newline at end of file
diff --git a/docs/tools/Data Indexing/covalent.md b/docs/tools/Data Indexing/covalent.md
index 57bb05ec..79c59378 100644
--- a/docs/tools/Data Indexing/covalent.md
+++ b/docs/tools/Data Indexing/covalent.md
@@ -1,66 +1,67 @@
-# Covalent
+# GoldRush - powered by Covalent
-[Covalent](https://www.covalenthq.com/?utm_source=gnosis-chain&utm_medium=partner-docs) is a hosted blockchain data solution providing access to historical and current onchain data for [200+ supported blockchains](https://www.covalenthq.com/docs/networks/?utm_source=gnosis-chain&utm_medium=partner-docs), including Gnosis Chain.
+[GoldRush](https://goldrush.dev/?utm_source=gnosis-chain&utm_medium=partner-docs) is a set of data tools that enable easy web3 development across [200+ supported blockchains](https://goldrush.dev/docs/networks/?utm_source=gnosis-chain&utm_medium=partner-docs),
+including Gnosis Chain. The mission of GoldRush is to improve the lives of developers by providing structured onchain data for dapps.
-Covalent maintains a full replica of every supported blockchain, meaning you have access to:
+Developers can utilize GoldRush via SDKs, APIs, UI Kits, human-readable transactions and pre-built templates for a number of web3 use cases. The GoldRush suite is powered by Covalent, which is decentralized and cryptographically secure. Whether you are fetching NFTs, DeFi transactions, or other onchain data, GoldRush helps scale hundreds of projects from crypto native teams to Fortune 500 companies.
-- Current and historical account balances
+With GoldRush, you have access to:
+
+- Every wallet's token balances
- Full transaction histories
- Every contract log event
- All NFTs including assets and metadata
-**Use Covalent if you need:**
+**Use GoldRush if you need:**
-- Wallet, Transactions, NFT, DEX, Staking or core blockchain data (log events, blocks)
+- Wallet, Transactions, NFT, DEX, Staking or core blockchain data (i.e. log events, blocks, gas)
- Normalized, aggregated and enhanced multichain data, well beyond what you get from RPC providers
- Enterprise-grade performance
-> **[Sign up to start building on Gnosis Chain](https://www.covalenthq.com/platform/?utm_source=gnosis-chain&utm_medium=partner-docs)**
+> [Sign up to start building on Gnosis Chain](https://goldrush.dev/platform/?utm_source=gnosis-chain&utm_medium=partner-docs)
-# APIs
+## APIs
-The Covalent APIs enables developers to quickly and easily access structured onchain data. This means consistent response schemas regardless of the blockchain. Available APIs and corresponding use cases include:
+The GoldRush APIs enables developers to quickly and easily access structured onchain data. This means consistent response schemas that are blockchain agnostic. Available APIs and corresponding use cases include:
### Wallet API
-- **Features:** All token balances (ERC20, 721, 1155, native), token transfers and prices (spot & historical) for a wallet.
+- **Features:** All token balances (ERC20, 721, 1155, native), token transfers and prices (spot and
+historical) for a wallet.
- **Use cases:** [Wallets, portfolio trackers](https://goldrush-wallet-portfolio-ui.vercel.app/?utm_source=gnosis-chain&utm_medium=partner-docs), token gating, airdrop snapshots.
-### NFT API
+### Transactions API
-- **Features:** Media assets, metadata, sales, owners, trait & attribute filters, thumbnails & previews.
-- **Use cases:** [NFT galleries & marketplaces](https://goldrush-nft-gallery-ui.vercel.app/?utm_source=gnosis-chain&utm_medium=partner-docs), real world asset (RWA) tracking, token gating.
+- **Features:** All historical transactions with human-readable log events. Includes gas usage/spend
+summaries.
+- **Use cases:** [Accounting and tax tools](https://bit.ly/crypto-tax-tool), branded in-app [transaction receipts](https://goldrush-dfk-tx-receipt-ui.vercel.app/tx/defi-kingdoms-mainnet/0x4e5c0af28b2cea27d06677fae1f573572e0ff863c43ae42d2959ca67b90c4390/?utm_source=gnosis-chain&utm_medium=partner-docs).
-### DEX API
+### NFT API
-- **Features:** Positions, rewards, pool and token details for major DEX protocols.
-- **Use cases:** [Analytics dashboards](https://goldrush-uniswap-dex-dashboard.vercel.app/?utm_source=gnosis-chain&utm_medium=partner-docs), leaderboards, reward calculators.
+- **Features:** Media assets, metadata, sales, owners, trait & attribute filters, thumbnails, and
+previews.
+- **Use cases:** [NFT galleries and marketplaces](https://goldrush-nft-gallery-ui.vercel.app/?utm_source=gnosis-chain&utm_medium=partner-docs), real world asset (RWA) tracking, token gating.
### Cross-Chain Activity API
- **Features:** Single API call to fetch a list of active chains and the latest transaction date on each for an address.
- **Use cases:** [App onboarding](https://goldrush-wallet-portfolio-ui.vercel.app/activity/0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de/?utm_source=gnosis-chain&utm_medium=partner-docs).
-### Transactions API
-
-- **Features:** All historical transactions with human-readable log events. Includes gas usage/spend summaries.
-- **Use cases:** [Accounting and tax tools](https://bit.ly/crypto-tax-tool), branded in-app [transaction receipts](https://goldrush-dfk-tx-receipt-ui.vercel.app/tx/defi-kingdoms-mainnet/0x4e5c0af28b2cea27d06677fae1f573572e0ff863c43ae42d2959ca67b90c4390/?utm_source=gnosis-chain&utm_medium=partner-docs).
-
### Security API
- **Features:** NFT and ERC20 token allowances, including value-at-risk.
-- **Use cases:** Revoke features in wallets, security applications.
+- **Use cases:** [Revoke features](https://goldrush-revokehub.vercel.app/?utm_source=gnosis-chain&utm_medium=partner-docs) in wallets, security applications.
### Blockchain API
-- **Features:** Block details, log events by contract address or topic hash, gas prices.
-- **Use cases:** Custom block explorers.
+- **Features:** Block details, log events by contract address or topic hash, gas prices, token prices and holders.
+- **Use cases:** [Custom block explorers](https://goldrush-block-explorer.vercel.app/?utm_source=gnosis-chain>&utm_medium=partner-docs).
## Developer Tools
-There are 3 primary developer tools for using the APIs:
+There are 4 primary developer tools for using the APIs:
-1. [**Unified API**](https://www.covalenthq.com/docs/api/?utm_source=gnosis-chain&utm_medium=partner-docs) - enterprise-grade endpoints to use with any programming language. Switch blockchains with one path parameter.
+1. [GoldRush API](https://goldrush.dev/docs/api/?utm_source=gnosis-chain&utm_medium=partner-docs) - REST API with enterprise-grade endpoints to use with any programming language. Switch blockchains with one path parameter.
```bash
curl -X GET https://api.covalenthq.com/v1/gnosis-mainnet/address/0x2C6900b24221dE2B4A45c8c89482fFF96FFB7E55/balances_v2/ \
@@ -68,7 +69,7 @@ There are 3 primary developer tools for using the APIs:
-u YOUR_API_KEY:
```
-2. [**Client SDKs**](https://www.covalenthq.com/docs/unified-api/sdk/?utm_source=gnosis-chain&utm_medium=partner-docs) - official client libraries including TypeScript, Go and Python.
+2. [GoldRush SDKs](https://goldrush.dev/docs/unified-api/sdk/?utm_source=gnosis-chain&utm_medium=partner-docs) - official client libraries including TypeScript, Python, Go and Viem.
```jsx
npm install @covalenthq/client-sdk
```
@@ -91,31 +92,79 @@ There are 3 primary developer tools for using the APIs:
})();
```
-3. [**GoldRush Kit**](https://github.com/covalenthq/goldrush-kit/?utm_source=gnosis-chain&utm_medium=partner-docs) - beautifully designed React components for your dApp frontend
- [![GoldRush Component Example](https://www.datocms-assets.com/86369/1711147954-goldrush_wallet_ui_example.png)](https://goldrush-wallet-portfolio-ui.vercel.app/dashboard/balance/0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de/transfers/eth-mainnet/0xf8c3527cc04340b208c854e985240c02f7b7793f)
+3. [GoldRush UI Kit](https://github.com/covalenthq/goldrush-kit/?utm_source=gnosis-chain&utm_medium=partner-docs) - beautifully designed React components for your dApp frontend.
-## Get started
-
-- **[API Key](https://www.covalenthq.com/platform/auth/register/?utm_source=gnosis-chain&utm_medium=partner-docs)** - sign up for free
-- [**Docs**](https://www.covalenthq.com/docs/unified-api/?utm_source=gnosis-chain&utm_medium=partner-docs) - comprehensive knowledge base for all things Covalent
-- **[Guides](https://www.covalenthq.com/docs/unified-api/guides/?utm_source=gnosis-chain&utm_medium=partner-docs)** - learn how to build for various use cases and expand your onchain knowledge
-
-
-# Increment
-[![example-increment-chart](https://www.datocms-assets.com/86369/1684974544-increment-example-partner-docs.png)](https://www.covalenthq.com/platform/increment/#/?utm_source=gnosis-chain&utm_medium=partner-docs)
-
-Increment is a novel no-code charting and reporting tool powered by Covalent. *Simply type SQL, get charts.*
+ [![GoldRush Component Example](https://www.datocms-assets.com/86369/1711147954-goldrush_wallet_ui_example.png)](https://goldrush-wallet-portfolio-ui.vercel.app/dashboard/balance/0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de/transfers/eth-mainnet/0xf8c3527cc04340b208c854e985240c02f7b7793f)
-## Use cases
-Increment can be used for:
+4. [GoldRush Decoder](https://github.com/covalenthq/goldrush-decoder/?utm_source=gnosis-chain&utm_medium=partner-docs) - decode any raw event logs into human-readable structured data.
-- [Analyzing Blockchain Networks](https://www.covalenthq.com/docs/increment/data-models/chain-gdp/?utm_source=gnosis-chain&utm_medium=partner-docs)
-- [Analyzing DEXs](https://www.covalenthq.com/docs/increment/data-models/swap-land/?utm_source=gnosis-chain&utm_medium=partner-docs)
-- [Analyzing NFT Marketplaces](https://www.covalenthq.com/docs/increment/data-models/jpeg-analysis/?utm_source=gnosis-chain&utm_medium=partner-docs)
+ **Request:**
+ ```bash
+ curl -X POST http://localhost:8080/api/v1/tx/decode \
+ -H 'Content-Type: application/json' \
+ -d '{
+ "chain_name": "gnosis-mainnet",
+ "tx_hash": "0xe9e807d78673ad214ce51d0c13d13cf15f2ddf8e85498db64e6ffad75e12733f"
+ }'
+ ```
+ **Custom decoded response:**
+ ```json
+ {
+ "success": true,
+ "events": [
+ {
+ "action": "Account Abstraction Transaction",
+ "category": "Others",
+ "name": "User Operation Event",
+ "protocol": {
+ "logo": "https://logos.covalenthq.com/tokens/100/0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789.png",
+ "name": "4337 Entry Point"
+ },
+ "details": [
+ {
+ "heading": "Gas Cost",
+ "value": "2504932000000000",
+ "type": "text"
+ },
+ {
+ "heading": "Gas Used",
+ "value": "1252466",
+ "type": "text"
+ },
+ {
+ "heading": "Paymaster",
+ "value": "0x00000f79B7FaF42EEBAdbA19aCc07cD08Af44789",
+ "type": "address"
+ },
+ {
+ "heading": "Sender",
+ "value": "0x1B19D70F192bEb4E1fc4FCf72219E742b0B3661c",
+ "type": "address"
+ },
+ {
+ "heading": "User Operation Hash",
+ "value": "0x31ec6a8084b4f3677120313986f0f2dc9dffdb5c15d4eccf2094603a690efcb6",
+ "type": "address"
+ }
+ ]
+ }
+ ],
+ "tx_metadata": {
+ ...
+ },
+ "explorers": [
+ {
+ "label": null,
+ "url": "https://gnosis.blockscout.com/tx/0xe9e807d78673ad214ce51d0c13d13cf15f2ddf8e85498db64e6ffad75e12733f"
+ }
+ ]
+ }
+ }
+ ```
## Get started
-- [Increment](https://www.covalenthq.com/platform/increment/#/?utm_source=gnosis-chain&utm_medium=partner-docs) - login via the Covalent Platform
-- [Docs](https://www.covalenthq.com/docs/increment/?utm_source=gnosis-chain&utm_medium=partner-docs) - learn how to use Increment to build dynamic, custom charts
-- [Data Models Demo](https://www.covalenthq.com/docs/increment/data-models/model-intro/?utm_source=gnosis-chain&utm_medium=partner-docs) - build analytics in 3 clicks
+- [API Key](https://goldrush.dev/platform/auth/register/?utm_source=gnosis-chain&utm_medium=partner-docs) - sign up for free
+- [Docs](https://goldrush.dev/docs/unified-api/?utm_source=gnosis-chain&utm_medium=partner-docs) - comprehensive knowledge base for all things GoldRush
+- [Guides](https://goldrush.dev/docs/unified-api/guides/?utm_source=gnosis-chain&utm_medium=partner-docs) - learn how to build for various use cases and expand your onchain knowledge
diff --git a/docusaurus.config.js b/docusaurus.config.js
index f6f0ea2d..34145e84 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -74,7 +74,7 @@ const config = {
announcementBar: {
id: "support_us",
content:
- 'Dencun upgrade is now live on Gnosis Chain. Check out here.',
+ 'Shutterized Gnosis Chain is live now.',
backgroundColor: "#fafbfc",
textColor: "#091E42",
isCloseable: false,
@@ -107,16 +107,22 @@ const config = {
label: "Updates",
},
{
- href: "https://ecosystem.gnosischain.com/",
+ type: "docSidebar",
position: "left",
- label: "Ecosystem",
+ sidebarId: "shutterizedgc",
+ label: "Shutterized Gnosis Chain",
},
{
type: "docSidebar",
- position: "left",
+ position: "right",
sidebarId: "faq",
label: "FAQ",
},
+ {
+ href: "https://ecosystem.gnosischain.com/",
+ position: "right",
+ label: "Ecosystem",
+ },
{
href: "https://twitter.com/gnosischain",
html: `
diff --git a/sidebars.js b/sidebars.js
index 9097c68c..281f2978 100644
--- a/sidebars.js
+++ b/sidebars.js
@@ -20,7 +20,8 @@ const sidebars = {
node: [{ type: "autogenerated", dirName: "node" }],
technicalGuides: [{ type: "autogenerated", dirName: "technicalguides" }],
termsConditions: [{ type: "autogenerated", dirName: "terms-conditions" }],
- tools: [{ type: "autogenerated", dirName: "tools" }]
+ tools: [{ type: "autogenerated", dirName: "tools" }],
+ shutterizedgc : [{type:'autogenerated', dirName:"shutterized-gc"}]
};
module.exports = sidebars;
diff --git a/src/components/Button/index.jsx b/src/components/Button/index.jsx
new file mode 100644
index 00000000..cbc1d812
--- /dev/null
+++ b/src/components/Button/index.jsx
@@ -0,0 +1,44 @@
+// src/components/Button/index.js
+import React from 'react';
+import clsx from 'clsx';
+import Link from '@docusaurus/Link';
+
+const Button = ({
+ size = null,
+ outline = false,
+ variant = 'primary',
+ block = false,
+ disabled = false,
+ className,
+ style,
+ link,
+ label,
+ onClick, // Add the onClick prop
+}) => {
+ const sizeMap = {
+ sm: 'sm',
+ small: 'sm',
+ lg: 'lg',
+ large: 'lg',
+ medium: null,
+ };
+ const buttonSize = size ? sizeMap[size] : '';
+ const sizeClass = buttonSize ? `button--${buttonSize}` : '';
+ const outlineClass = outline ? 'button--outline' : '';
+ const variantClass = variant ? `button--${variant}` : '';
+ const blockClass = block ? 'button--block' : '';
+ const disabledClass = disabled ? 'disabled' : '';
+ return (
+
+ );
+};
+
+export default Button;
diff --git a/src/theme/MDXComponents.js b/src/theme/MDXComponents.js
index 3e09aab6..e527305e 100644
--- a/src/theme/MDXComponents.js
+++ b/src/theme/MDXComponents.js
@@ -6,6 +6,7 @@ import tabItem from '@theme/TabItem';
import Card from '@site/src/components/Card/Card';
import FeatureCard from '@site/src/components/Card/FeatureCard';
import CardContainer from '@site/src/components/Card/CardContainer';
+import Button from '@site/src/components/Button';
// import outlineCard from '@site/src/components/Card/outlineCard';
@@ -18,5 +19,5 @@ export default {
Card,
CardContainer,
FeatureCard,
-
+ Button,
};
\ No newline at end of file
diff --git a/src/utils/changeNetwork.js b/src/utils/changeNetwork.js
new file mode 100644
index 00000000..b603ae45
--- /dev/null
+++ b/src/utils/changeNetwork.js
@@ -0,0 +1,45 @@
+import React from 'react';
+import Button from '@site/src/components/Button';
+
+// JavaScript function for changing or adding the network
+export async function changeOrAddNetwork() {
+ const chainId = '0x64';
+ if (window.ethereum) {
+ try {
+ // Try to switch to the network
+ await window.ethereum.request({
+ method: 'wallet_switchEthereumChain',
+ params: [{ chainId: chainId }],
+ });
+ console.log('Switched to the network with chainId:', chainId);
+ } catch (switchError) {
+ if (switchError.code === 4902) {
+ try {
+ const chainParams = {
+ chainId: chainId,
+ rpcUrls: ["https://erpc.gnosis.shutter.network"],
+ chainName: "Shutterized Gnosis Chain",
+ nativeCurrency: {
+ name: "xDai",
+ symbol: "xDAI",
+ decimals: 18
+ },
+ blockExplorerUrls: ["https://www.gnosisscan.com"]
+ };
+
+ await window.ethereum.request({
+ method: 'wallet_addEthereumChain',
+ params: [chainParams],
+ });
+ console.log('Network added and switched to:', chainParams.chainName);
+ } catch (addError) {
+ console.error('Failed to add the network:', addError);
+ }
+ } else {
+ console.error('Failed to switch the network:', switchError);
+ }
+ }
+ } else {
+ console.error('MetaMask is not installed!');
+ }
+}
\ No newline at end of file