Skip to content

Commit 3047b53

Browse files
authored
feat: Add status to ConnectEvm (#136)
* add status to ConnectEvm * changelog
1 parent ba1d897 commit 3047b53

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

packages/connect-evm/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Add `ConnectEvm.status` property which exposes the current `ConnectionStatus` ([#136](https://github.com/MetaMask/connect-monorepo/pull/136))
13+
1014
## [0.2.0]
1115

1216
### Added

packages/connect-evm/src/connect.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { analytics } from '@metamask/analytics';
22
import type { Caip25CaveatValue } from '@metamask/chain-agnostic-permission';
33
import type {
4+
ConnectionStatus,
45
MultichainCore,
56
MultichainOptions,
67
Scope,
@@ -915,6 +916,15 @@ export class MetamaskConnectEVM {
915916
get selectedChainId(): Hex | undefined {
916917
return this.#provider.selectedChainId;
917918
}
919+
920+
/**
921+
* Gets the current connection status
922+
*
923+
* @returns The current connection status
924+
*/
925+
get status(): ConnectionStatus {
926+
return this.#core.status;
927+
}
918928
}
919929

920930
/**

0 commit comments

Comments
 (0)