@tevm/voltaire / provider / provider/eip6963
provider/eip6963
EIP-6963: Multi Injected Provider Discovery Enables dapps to discover multiple wallet providers and wallets to announce themselves.Dapp Usage (Consumer)
Wallet Usage (Producer)
See
https://eips.ethereum.org/EIPS/eip-6963Classes
EIP6963Error
Defined in: src/provider/eip6963/errors.ts:14 Base error for all EIP-6963 operationsExtends
Extended by
InvalidArgumentErrorInvalidFieldErrorInvalidIconErrorInvalidProviderErrorInvalidRdnsErrorInvalidUuidErrorMissingFieldErrorNotImplementedErrorUnsupportedEnvironmentError
Constructors
Constructor
new EIP6963Error(Defined in: src/provider/eip6963/errors.ts:15message,options?):EIP6963Error
Parameters
message
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
Returns
EIP6963Error
Overrides
PrimitiveError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
PrimitiveError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
PrimitiveError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
PrimitiveError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
PrimitiveError.docsPath
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
PrimitiveError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
PrimitiveError.toJSON
InvalidArgumentError
Defined in: src/provider/eip6963/errors.ts:152 Thrown when function argument is invalidExtends
Constructors
Constructor
new InvalidArgumentError(Defined in: src/provider/eip6963/errors.ts:155functionName,expected,got):InvalidArgumentError
Parameters
functionName
string
expected
string
got
string
Returns
InvalidArgumentError
Overrides
EIP6963Error.constructor
Properties
argument
Defined in: src/provider/eip6963/errors.ts:153readonlyargument:string
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
EIP6963Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
EIP6963Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
EIP6963Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
EIP6963Error.docsPath
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
EIP6963Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
EIP6963Error.toJSON
InvalidFieldError
Defined in: src/provider/eip6963/errors.ts:124 Thrown when field value is invalid (e.g., empty string)Extends
Constructors
Constructor
new InvalidFieldError(Defined in: src/provider/eip6963/errors.ts:127objectType,field,reason):InvalidFieldError
Parameters
objectType
string
field
string
reason
string
Returns
InvalidFieldError
Overrides
EIP6963Error.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
EIP6963Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
EIP6963Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
EIP6963Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
EIP6963Error.docsPath
field
Defined in: src/provider/eip6963/errors.ts:125readonlyfield:string
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
EIP6963Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
EIP6963Error.toJSON
InvalidIconError
Defined in: src/provider/eip6963/errors.ts:88 Thrown when icon format is invalidExtends
Constructors
Constructor
new InvalidIconError(Defined in: src/provider/eip6963/errors.ts:91icon):InvalidIconError
Parameters
icon
string
Returns
InvalidIconError
Overrides
EIP6963Error.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
EIP6963Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
EIP6963Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
EIP6963Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
EIP6963Error.docsPath
icon
Defined in: src/provider/eip6963/errors.ts:89readonlyicon:string
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
EIP6963Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
EIP6963Error.toJSON
InvalidProviderError
Defined in: src/provider/eip6963/errors.ts:140 Thrown when provider is invalid (missing request method)Extends
Constructors
Constructor
new InvalidProviderError(): InvalidProviderError
Defined in: src/provider/eip6963/errors.ts:141
Returns
InvalidProviderError
Overrides
EIP6963Error.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
EIP6963Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
EIP6963Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
EIP6963Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
EIP6963Error.docsPath
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
EIP6963Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
EIP6963Error.toJSON
InvalidRdnsError
Defined in: src/provider/eip6963/errors.ts:69 Thrown when RDNS format is invalidExtends
Constructors
Constructor
new InvalidRdnsError(Defined in: src/provider/eip6963/errors.ts:72rdns):InvalidRdnsError
Parameters
rdns
string
Returns
InvalidRdnsError
Overrides
EIP6963Error.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
EIP6963Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
EIP6963Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
EIP6963Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
EIP6963Error.docsPath
rdns
Defined in: src/provider/eip6963/errors.ts:70readonlyrdns:string
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
EIP6963Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
EIP6963Error.toJSON
InvalidUuidError
Defined in: src/provider/eip6963/errors.ts:53 Thrown when UUID format is invalidExtends
Constructors
Constructor
new InvalidUuidError(Defined in: src/provider/eip6963/errors.ts:56uuid):InvalidUuidError
Parameters
uuid
string
Returns
InvalidUuidError
Overrides
EIP6963Error.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
EIP6963Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
EIP6963Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
EIP6963Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
EIP6963Error.docsPath
uuid
Defined in: src/provider/eip6963/errors.ts:54readonlyuuid:string
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
EIP6963Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
EIP6963Error.toJSON
MissingFieldError
Defined in: src/provider/eip6963/errors.ts:108 Thrown when required field is missingExtends
Constructors
Constructor
new MissingFieldError(Defined in: src/provider/eip6963/errors.ts:111objectType,field):MissingFieldError
Parameters
objectType
string
field
string
Returns
MissingFieldError
Overrides
EIP6963Error.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
EIP6963Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
EIP6963Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
EIP6963Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
EIP6963Error.docsPath
field
Defined in: src/provider/eip6963/errors.ts:109readonlyfield:string
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
EIP6963Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
EIP6963Error.toJSON
NotImplementedError
Defined in: src/provider/eip6963/errors.ts:168 Thrown when method is not yet implementedExtends
Constructors
Constructor
new NotImplementedError(Defined in: src/provider/eip6963/errors.ts:169methodName):NotImplementedError
Parameters
methodName
string
Returns
NotImplementedError
Overrides
EIP6963Error.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
EIP6963Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
EIP6963Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
EIP6963Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
EIP6963Error.docsPath
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
EIP6963Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
EIP6963Error.toJSON
UnsupportedEnvironmentError
Defined in: src/provider/eip6963/errors.ts:37 Thrown when EIP-6963 is used in unsupported environmentExtends
Constructors
Constructor
new UnsupportedEnvironmentError(Defined in: src/provider/eip6963/errors.ts:40platform):UnsupportedEnvironmentError
Parameters
platform
string
Returns
UnsupportedEnvironmentError
Overrides
EIP6963Error.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
EIP6963Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
EIP6963Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
EIP6963Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
EIP6963Error.docsPath
platform
Defined in: src/provider/eip6963/errors.ts:38readonlyplatform:string
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
EIP6963Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
EIP6963Error.toJSON
Type Aliases
Platform
Platform =Defined in: src/provider/eip6963/types.ts:92 Platform detection result"browser"|"node"|"bun"|"worker"|"unknown"
ProviderDetailInput
ProviderDetailInput = object
Defined in: src/provider/eip6963/types.ts:79
Input type for ProviderDetail constructor
Properties
info
info: ProviderInfoInput
Defined in: src/provider/eip6963/types.ts:80
provider
provider: EIP1193Provider
Defined in: src/provider/eip6963/types.ts:81
ProviderDetailType
ProviderDetailType =Defined in: src/provider/eip6963/types.ts:69 Complete provider announcement Combines provider metadata with the actual EIP-1193 provider instance. All instances are frozen and immutable.Readonly<{info:ProviderInfoType;provider:EIP1193Provider; }> &object
Type Declaration
[brand]
readonly[brand]:"ProviderDetail"
Example
ProviderInfoInput
ProviderInfoInput = object
Defined in: src/provider/eip6963/types.ts:43
Input type for ProviderInfo constructor
Properties
icon
icon: string
Defined in: src/provider/eip6963/types.ts:46
name
name: string
Defined in: src/provider/eip6963/types.ts:45
rdns
rdns: string
Defined in: src/provider/eip6963/types.ts:47
uuid
uuid: string
Defined in: src/provider/eip6963/types.ts:44
ProviderInfoType
ProviderInfoType =Defined in: src/provider/eip6963/types.ts:29 Wallet provider metadata Contains identifying information about an EIP-1193 provider. All instances are frozen and immutable.Readonly<{icon:string;name:string;rdns:string;uuid:string; }> &object
Type Declaration
[brand]
readonly[brand]:"ProviderInfo"
Example
ProviderListener()
ProviderListener = (Defined in: src/provider/eip6963/types.ts:87 Listener function for provider announcementsproviders) =>void
Parameters
providers
ProviderDetailType[]
Returns
void
Variables
DATA_URI_REGEX
Defined in: src/provider/eip6963/validators.js:33 Data URI format regex for imagesconstDATA_URI_REGEX:RegExp
RDNS_REGEX
Defined in: src/provider/eip6963/validators.js:27 Reverse DNS format regexconstRDNS_REGEX:RegExp
UUID_V4_REGEX
Defined in: src/provider/eip6963/validators.js:20 UUIDv4 format regexconstUUID_V4_REGEX:RegExp
Functions
_reset()
_reset(): void
Defined in: src/provider/eip6963/state.js:52
Clear all state (for testing)
Returns
void
announce()
announce(Defined in: src/provider/eip6963/announce.js:51 Announce a wallet provider For wallet implementations: announces the provider to dapps and automatically re-announces when dapps request providers.detail): () =>void
Parameters
detail
ProviderDetailInput
Provider info and instance
Returns
Unsubscribe function to stop announcing
(): void
Returns
void
Throws
If not in browserThrows
If detail is missing info or providerThrows
If provider.request is not a functionThrows
If info.uuid is not valid UUIDv4Throws
If info.rdns is not valid reverse DNSThrows
If info.icon is not valid data URIExample
assertBrowser()
assertBrowser(): void
Defined in: src/provider/eip6963/getPlatform.js:76
Assert that we’re in a browser environment
Returns
void
Throws
If not in browserExample
findProvider()
findProvider(Defined in: src/provider/eip6963/findProvider.js:42 Find a provider by its reverse DNS identifier Searches the discovered providers for one matching the given rdns. Note that this requires subscribe() to have been called at least once to start discovery.options):ProviderDetailType|undefined
Parameters
options
Search optionsrdns
string
Returns
ProviderDetailType | undefined
Matching provider or undefined
Throws
If not in browserThrows
If options.rdns is missingExample
getPlatform()
getPlatform():Defined in: src/provider/eip6963/getPlatform.js:33 Detect the current platform"browser"|"node"|"bun"|"worker"|"unknown"
Returns
"browser" | "node" | "bun" | "worker" | "unknown"
The detected platform
Example
getProviders()
getProviders(): ProviderDetailType[]
Defined in: src/provider/eip6963/getProviders.js:34
Get snapshot of all currently discovered providers
Returns the current state of discovered providers without subscribing
to future updates. Note that this requires subscribe() to have been
called at least once to start discovery.
Returns
ProviderDetailType[]
Array of discovered providers
Throws
If not in browserExample
ProviderDetail()
ProviderDetail(Defined in: src/provider/eip6963/ProviderDetail.js:48 Create a validated ProviderDetail object Validates info and provider, then returns a frozen, branded object.input):ProviderDetailType
Parameters
input
ProviderDetailInput
Provider detail fields
Returns
ProviderDetailType
Frozen, branded ProviderDetail
Throws
If info or provider is missingThrows
If provider.request is not a functionThrows
If info.uuid is not valid UUIDv4Throws
If info.rdns is not valid reverse DNSThrows
If info.icon is not valid data URIThrows
If info.name is emptyExample
ProviderInfo()
ProviderInfo(Defined in: src/provider/eip6963/ProviderInfo.js:45 Create a validated ProviderInfo object Validates all fields and returns a frozen, branded object.input):ProviderInfoType
Parameters
input
ProviderInfoInput
Provider info fields
Returns
ProviderInfoType
Frozen, branded ProviderInfo
Throws
If any required field is missingThrows
If uuid is not valid UUIDv4Throws
If rdns is not valid reverse DNSThrows
If icon is not valid data URIThrows
If name is emptyExample
subscribe()
subscribe(Defined in: src/provider/eip6963/subscribe.js:75 Subscribe to wallet provider announcements Listens for EIP-6963 provider announcements and calls the listener with the current list of discovered providers. Automatically handles deduplication by UUID (same UUID updates existing entry).listener): () =>void
Parameters
listener
ProviderListener
Called with providers array on each change
Returns
Unsubscribe function
(): void
Returns
void
Throws
If not in browserThrows
If listener is not a functionExample
validateIcon()
validateIcon(Defined in: src/provider/eip6963/validators.js:99 Validate icon is a valid data URIicon):void
Parameters
icon
string
The icon data URI to validate
Returns
void
Throws
If icon is missingThrows
If icon is not a valid data URIExample
validateName()
validateName(Defined in: src/provider/eip6963/validators.js:143 Validate name is non-empty stringname):void
Parameters
name
string
The name to validate
Returns
void
Throws
If name is missingThrows
If name is emptyvalidateProvider()
validateProvider(Defined in: src/provider/eip6963/validators.js:124 Validate provider has request methodprovider):void
Parameters
provider
unknown
The provider to validate
Returns
void
Throws
If provider is missingThrows
If provider.request is not a functionExample
validateRdns()
validateRdns(Defined in: src/provider/eip6963/validators.js:74 Validate RDNS is valid reverse DNS formatrdns):void
Parameters
rdns
string
The reverse DNS to validate
Returns
void
Throws
If rdns is missingThrows
If rdns is not valid formatExample
validateUuid()
validateUuid(Defined in: src/provider/eip6963/validators.js:49 Validate UUID is UUIDv4 formatuuid):void
Parameters
uuid
string
The UUID to validate
Returns
void

