From c2813c9b952cf6ad65751da10cf17bbc23f37541 Mon Sep 17 00:00:00 2001 From: vignesha22 <82584664+vignesha22@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:04:55 +0530 Subject: [PATCH] Custom Network (#74) --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- src/sdk/network/network.service.ts | 6 +----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbe4e9f..791e950 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## [1.3.13] - 2023-11-22 +### Bug Fixes +- Removed UnsupportedChainId error and now can add custom network details + ## [1.3.12] - 2023-11-17 ### New - Added Klaytn mainnet and Testnet (Baobab) diff --git a/package-lock.json b/package-lock.json index 27c0165..d9c02e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@etherspot/prime-sdk", - "version": "1.3.12", + "version": "1.3.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@etherspot/prime-sdk", - "version": "1.3.12", + "version": "1.3.13", "license": "MIT", "dependencies": { "@apollo/client": "3.8.6", diff --git a/package.json b/package.json index 0767d67..5be55e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@etherspot/prime-sdk", - "version": "1.3.12", + "version": "1.3.13", "description": "Etherspot Prime (Account Abstraction) SDK", "keywords": [ "ether", diff --git a/src/sdk/network/network.service.ts b/src/sdk/network/network.service.ts index c581937..757f99e 100644 --- a/src/sdk/network/network.service.ts +++ b/src/sdk/network/network.service.ts @@ -34,7 +34,7 @@ export class NetworkService extends Service { : this.supportedNetworks[0]; if (!this.defaultNetwork) { - throw new Exception('Unsupported network'); + this.defaultNetwork = this.supportedNetworks.find(({ chainId }) => chainId === 1) } this.chainId$ = this.network$.observeKey('chainId'); @@ -56,10 +56,6 @@ export class NetworkService extends Service { this.network$.next(this.supportedNetworks.find(({ name }) => name === networkName) || null); } - // isNetworkNameSupported(networkName: string): boolean { - // return !!this.supportedNetworks.find(({ name }) => name === networkName); - // } - isNetworkSupported(chainId: number): boolean { return SupportedNetworks.includes(chainId); }