Skip to content

Commit

Permalink
feat(requestEIP6963Providers): return-type
Browse files Browse the repository at this point in the history
Add return type to requestEIP6963Providers function signature.

Closes #7238
  • Loading branch information
danforbes committed Sep 5, 2024
1 parent 9b32205 commit 4114194
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/web3/src/web3_eip6963.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export interface EIP6963ProviderDetail<API = Web3APISpec> {
provider: EIP1193Provider<API>;
}

export type EIP6963ProviderResponse<API = Web3APISpec> = Map<string, EIP6963ProviderDetail<API>>;

export interface EIP6963AnnounceProviderEvent<API = Web3APISpec> extends CustomEvent {
type: Eip6963EventName.eip6963announceProvider;
detail: EIP6963ProviderDetail<API>;
Expand All @@ -52,7 +54,7 @@ export interface EIP6963ProvidersMapUpdateEvent extends CustomEvent {
detail: Map<string, EIP6963ProviderDetail>;
}

export const requestEIP6963Providers = async () =>
export const requestEIP6963Providers = async (): Promise<EIP6963ProviderResponse> =>
new Promise((resolve, reject) => {
if (typeof window === 'undefined') {
reject(new Error("window object not available, EIP-6963 is intended to be used within a browser"));
Expand Down

0 comments on commit 4114194

Please sign in to comment.