bn.getUniversalWeb3Provider
▸ getUniversalWeb3Provider(options?
): Promise
<{ result
: UniversalProvider
}>
Parameters
Name | Type |
---|---|
options? | Pick <UniversalProviderOptions , "topicId" | "metaData" > |
Returns
Promise
<{ result
: UniversalProvider
}>
Interface: UniversalProviderOptions
Name | Type | Description |
---|---|---|
rpcHooks | RPCHooks | |
topicId? | TopicId | |
metaData? | ClientMetadata |
Class: UniversalProvider
Name | Type | Description |
---|---|---|
topicId | TopicId | |
metaData? | ClientMetadata | |
events | SimpleEventEmitter | |
namespaces | NamespaceRecord = {} | |
rpcAdaptors | RpcAdaptorMap = {} | |
rpcHooks | RPCHooks | |
isConnecting | boolean = false | |
on | <E>(event : E , listener : ((args : EventArguments [E ]) => void ) => void | |
once | <E>(event : E , listener : ((args : EventArguments [E ]) => void ) => void | |
removeListener | <E>(event : E , listener : ((args : EventArguments [E ]) => void ) => void | |
off | <E>(event : E , listener : ((args : EventArguments [E ]) => void ) => void | |
emit | <E>(event : E , payload : EventArguments [E ]) => boolean | |
isConnected | boolean | |
request | (args , chain? ): Promise <T > | |
sendAsync | (args , callback , chain? ): void | |
enable | (__namedParameters? ): Promise <string []> | |
connect | (__namedParameters? ): Promise <void > | |
disconnect | (): Promise <void > | |
setDefaultChain | (chain ): void | |
onAccountsChanged | (accountsMap ): void | |
initialize | (): Promise <void > | |
createAdaptors | (): void | |
registerEventListeners | (): void | |
getAdaptor | (namespace ): IAdaptor | |
setNamespaces | (accountsMap ): void | |
validateChain | (chain? ): [Namespace , string ] | |
requestAccounts | (chain? ): Promise <string []> | |
onConnect | (): void | |
onChainChanged | (chain ): void | |
init | (options ): Promise <UniversalProvider > |
request
▸ request<T
>(args
, chain?
): Promise
<T
>
Type parameters
Name | Type |
---|---|
T | unknown |
Parameters
Name | Type |
---|---|
args | RequestArgs |
chain? | `eip155:${string}` | `cosmos:${string}` | `trust:${string}` | `w3w:${string}` |
Returns
Promise
<T
>
Implementation of
IUniversalProvider.request
sendAsync
▸ sendAsync<T
>(args
, callback
, chain?
): void
Type parameters
Name | Type |
---|---|
T | unknown |
Parameters
Name | Type |
---|---|
args | RequestArgs |
callback | (error : null | Error , response : undefined | T ) => void |
chain? | `eip155:${string}` | `cosmos:${string}` | `trust:${string}` | `w3w:${string}` |
Returns
void
Implementation of
IUniversalProvider.sendAsync
enable
▸ enable(__namedParameters?
): Promise
<string
[]>
Parameters
Name | Type |
---|---|
__namedParameters | EnableArgs |
Returns
Promise
<string
[]>
Implementation of
IUniversalProvider.enable
connect
▸ connect(__namedParameters?
): Promise
<void
>
Parameters
Name | Type |
---|---|
__namedParameters | ConnectArgs |
Returns
Promise
<void
>
Implementation of
IUniversalProvider.connect
disconnect
▸ disconnect(): Promise
<void
>
Returns
Promise
<void
>
Implementation of
IUniversalProvider.disconnect
setDefaultChain
▸ setDefaultChain(chain
): void
Parameters
Name | Type |
---|---|
chain | `eip155:${string}` | `cosmos:${string}` | `trust:${string}` | `w3w:${string}` |
Returns
void
onAccountsChanged
▸ onAccountsChanged(accountsMap
): void
Parameters
Name | Type |
---|---|
accountsMap | AccountsMap |
Returns
void
initialize
▸ Private
initialize(): Promise
<void
>
Returns
Promise
<void
>
createAdaptors
▸ Private
createAdaptors(): void
Returns
void
registerEventListeners
▸ Private
registerEventListeners(): void
Returns
void
getAdaptor
▸ Private
getAdaptor(namespace
): IAdaptor
Parameters
Name | Type |
---|---|
namespace | Namespace |
Returns
IAdaptor
setNamespaces
▸ Private
setNamespaces(accountsMap
): void
Parameters
Name | Type |
---|---|
accountsMap | AccountsMap |
Returns
void
validateChain
▸ Private
validateChain(chain?
): [Namespace
, string
]
Parameters
Name | Type |
---|---|
chain? | `eip155:${string}` | `cosmos:${string}` | `trust:${string}` | `w3w:${string}` |
Returns
[Namespace
, string
]
requestAccounts
▸ Private
requestAccounts(chain?
): Promise
<string
[]>
Parameters
Name | Type |
---|---|
chain? | `eip155:${string}` | `cosmos:${string}` | `trust:${string}` | `w3w:${string}` |
Returns
Promise
<string
[]>
onConnect
▸ Private
onConnect(): void
Returns
void
onChainChanged
▸ Private
onChainChanged(chain
): void
Parameters
Name | Type |
---|---|
chain | `eip155:${string}` | `cosmos:${string}` | `trust:${string}` | `w3w:${string}` |
Returns
void
init
▸ Static
init(options
): Promise
<UniversalProvider
>
Parameters
Name | Type |
---|---|
options | UniversalProviderOptions |
Returns
Promise
<UniversalProvider
>
Interface: RequestArgs
Name | Type | Description |
---|---|---|
method | string | |
params? | unknown [] | Record <string , unknown > | |
metadata? | ClientMetadata |