Comparing version 0.0.5 to 0.0.7
@@ -26,3 +26,3 @@ "use strict"; | ||
listeners.clear(); | ||
unwatch(); | ||
unwatch?.(); | ||
}, | ||
@@ -37,3 +37,3 @@ findProvider({ rdns }) { | ||
this.clear(); | ||
unwatch(); | ||
unwatch?.(); | ||
unwatch = request(); | ||
@@ -40,0 +40,0 @@ }, |
@@ -13,2 +13,4 @@ "use strict"; | ||
function requestProviders(listener) { | ||
if (typeof window === 'undefined') | ||
return; | ||
const handler = (event) => listener(event.detail); | ||
@@ -15,0 +17,0 @@ window.addEventListener('eip6963:announceProvider', handler); |
@@ -23,3 +23,3 @@ import { requestProviders } from './utils.js'; | ||
listeners.clear(); | ||
unwatch(); | ||
unwatch?.(); | ||
}, | ||
@@ -34,3 +34,3 @@ findProvider({ rdns }) { | ||
this.clear(); | ||
unwatch(); | ||
unwatch?.(); | ||
unwatch = request(); | ||
@@ -37,0 +37,0 @@ }, |
@@ -15,2 +15,4 @@ /** | ||
export function requestProviders(listener) { | ||
if (typeof window === 'undefined') | ||
return; | ||
const handler = (event) => listener(event.detail); | ||
@@ -17,0 +19,0 @@ window.addEventListener('eip6963:announceProvider', handler); |
@@ -13,3 +13,3 @@ import type { EIP1193Provider, Rdns } from './register.js'; | ||
export interface EIP6963ProviderInfo<TRdns extends string = Rdns> { | ||
icon: string; | ||
icon: `data:image/${string}`; | ||
name: string; | ||
@@ -16,0 +16,0 @@ rdns: TRdns; |
@@ -10,3 +10,3 @@ import type { EIP1193Provider } from './register.js'; | ||
export type RequestProvidersParameters = (providerDetail: EIP6963ProviderDetail) => void; | ||
export type RequestProvidersReturnType = () => void; | ||
export type RequestProvidersReturnType = (() => void) | undefined; | ||
/** | ||
@@ -13,0 +13,0 @@ * Watches for EIP-1193 Providers to be announced. |
{ | ||
"name": "mipd", | ||
"description": "TypeScript Utilities for EIP-6963", | ||
"version": "0.0.5", | ||
"version": "0.0.7", | ||
"license": "MIT", | ||
@@ -47,5 +47,2 @@ "repository": "wagmi-dev/mipd", | ||
}, | ||
"dependencies": { | ||
"viem": "^1.1.4" | ||
}, | ||
"contributors": [ | ||
@@ -52,0 +49,0 @@ "jxom.eth <j@wagmi.sh>", |
@@ -284,3 +284,3 @@ <br/> | ||
info: { | ||
icon: 'https://example.com/icon.png', | ||
icon: 'data:image/svg+xml,<svg width="32px" height="32px" viewBox="0 0 32 32"/>', | ||
name: 'Example', | ||
@@ -428,3 +428,3 @@ rdns: 'com.example', | ||
| `provider` | `import('viem').EIP1193Provider` | The EIP-1193 Provider. | | ||
| `rdns` | `'com.coinbase' | 'com.enkrypt' | 'io.metamask' | 'io.zerion'` | Deterministic identifier for the Provider in the form of an rDNS (Reverse Domain Name Notation) | | ||
| `rdns` | `'com.coinbase' \| 'com.enkrypt' \| 'io.metamask' \| 'io.zerion' \| (string & {})` | Deterministic identifier for the Provider in the form of an rDNS (Reverse Domain Name Notation) | | ||
@@ -431,0 +431,0 @@ Configuration options are customizable using [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html). Extend the `Register` interface either directly in your code or in a `d.ts` file (e.g. `eip6963.d.ts`): |
@@ -84,3 +84,3 @@ import type { Rdns } from './register.js' | ||
listeners.clear() | ||
unwatch() | ||
unwatch?.() | ||
}, | ||
@@ -97,3 +97,3 @@ findProvider({ rdns }) { | ||
this.clear() | ||
unwatch() | ||
unwatch?.() | ||
unwatch = request() | ||
@@ -100,0 +100,0 @@ }, |
@@ -18,3 +18,3 @@ import type { EIP1193Provider, Rdns } from './register.js' | ||
export interface EIP6963ProviderInfo<TRdns extends string = Rdns> { | ||
icon: string | ||
icon: `data:image/${string}` // RFC-2397 | ||
name: string | ||
@@ -21,0 +21,0 @@ rdns: TRdns |
@@ -40,3 +40,3 @@ import type { EIP1193Provider } from './register.js' | ||
) => void | ||
export type RequestProvidersReturnType = () => void | ||
export type RequestProvidersReturnType = (() => void) | undefined | ||
@@ -49,2 +49,3 @@ /** | ||
): RequestProvidersReturnType { | ||
if (typeof window === 'undefined') return | ||
const handler = (event: EIP6963AnnounceProviderEvent) => | ||
@@ -51,0 +52,0 @@ listener(event.detail) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
40767
1
535
0
- Removedviem@^1.1.4
- Removed@adraffy/ens-normalize@1.10.0(transitive)
- Removed@noble/curves@1.2.0(transitive)
- Removed@noble/hashes@1.3.2(transitive)
- Removed@scure/base@1.1.9(transitive)
- Removed@scure/bip32@1.3.2(transitive)
- Removed@scure/bip39@1.2.1(transitive)
- Removedabitype@0.9.8(transitive)
- Removedisows@1.0.3(transitive)
- Removedviem@1.21.4(transitive)
- Removedws@8.13.0(transitive)