Skip to content

Commit

Permalink
remove default chain config, make the field mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
yashovardhan committed Feb 13, 2024
1 parent 903bfeb commit 4a74e43
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
12 changes: 0 additions & 12 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
import { TORUS_SAPPHIRE_NETWORK } from "@toruslabs/constants";
import { CHAIN_NAMESPACES, CustomChainConfig } from "@web3auth/base";
import { ec as EllipticCurve } from "elliptic";

export const DEFAULT_CHAIN_CONFIG: CustomChainConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x5",
rpcTarget: "https://rpc.ankr.com/eth_goerli",
displayName: "Goerli Testnet",
blockExplorer: "https://goerli.etherscan.io",
ticker: "ETH",
tickerName: "Ethereum",
decimals: 18,
};

export const WEB3AUTH_NETWORK = {
MAINNET: TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET,
DEVNET: TORUS_SAPPHIRE_NETWORK.SAPPHIRE_DEVNET,
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export interface Web3AuthOptions {
/**
* Chain Config for the chain you want to connect to. Currently supports only EVM based chains.
*/
chainConfig?: CustomChainConfig;
chainConfig: CustomChainConfig;

/**
* @defaultValue `false`
Expand Down
1 change: 0 additions & 1 deletion src/mpcCoreKit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
private ready = false;

constructor(options: Web3AuthOptions) {
if (!options.chainConfig) options.chainConfig = DEFAULT_CHAIN_CONFIG;
if (options.chainConfig.chainNamespace !== CHAIN_NAMESPACES.EIP155) {
throw new Error("You must specify a eip155 chain config.");
}
Expand Down

0 comments on commit 4a74e43

Please sign in to comment.