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

Custom Network #74

Merged
merged 2 commits into from
Nov 22, 2023
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@etherspot/prime-sdk",
"version": "1.3.12",
"version": "1.3.13",
"description": "Etherspot Prime (Account Abstraction) SDK",
"keywords": [
"ether",
Expand Down
6 changes: 1 addition & 5 deletions src/sdk/network/network.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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);
}
Expand Down