跳到主要内容

bn.getWalletConnectorContext

getWalletConnectorContext(): WalletConnectorContext

description The api to get WalletConnectorContext

example

 const walletConnectorContext = bn.getWalletConnectorContext()

Returns

WalletConnectorContext

Class: WalletConnectorContext

NameTypeDescription
_rpcHooksRPCHooks
callbacksMap<number, (error: null | Error | ProviderRpcError, response: Maybe<string[]>) => void>
requestIdnumber
walletnull | WalletType = null
isProcessingRequestAccountsboolean = false
web3ProviderWeb3Provider
walletConnectProviderWalletConnectProvider
experimentalExperimental
request(payload): Promise<EthJsonRpc[T]["response"]["result"]>
disconnect(): void
handleInitialRequest(payload): Promise<EthJsonRpc[T]["response"]["result"]>
setIncomingMessages(socketMessage): void
registerEvent(): Promise<void>
resetConnection(): void
updateWallet(wallet, walletId?): void

request

request<T>(payload): Promise<EthJsonRpc[T]["response"]["result"]>

Type parameters

NameType
Textends keyof EthJsonRpc

Parameters

NameType
payloadEthJsonRpc[T]["request"]

Returns

Promise<EthJsonRpc[T]["response"]["result"]>


disconnect

disconnect(): void

Returns

void


handleInitialRequest

Private handleInitialRequest<T>(payload): Promise<EthJsonRpc[T]["response"]["result"]>

Type parameters

NameType
Textends keyof EthJsonRpc

Parameters

NameType
payloadEthJsonRpc[T]["request"]

Returns

Promise<EthJsonRpc[T]["response"]["result"]>


setIncomingMessages

setIncomingMessages(socketMessage): void

Parameters

NameType
socketMessageWalletConnectorEventMessagePayload

Returns

void


registerEvent

Private registerEvent(): Promise<void>

Returns

Promise<void>


resetConnection

Private resetConnection(): void

Returns

void


updateWallet

Private updateWallet(wallet, walletId?): void

Parameters

NameType
walletnull | WalletType
walletId?string

Returns

void

Interface: EthJsonRpc

NameTypeDescription
eth_requestAccountsJsonRpc<"eth_requestAccounts", [number], string[]>
eth_signTypedDataJsonRpc<"eth_signTypedData", [string, string], string>
eth_signTypedData_v1JsonRpc<"eth_signTypedData_v1", [string, string], string>
eth_signTypedData_v2JsonRpc<"eth_signTypedData_v2", [string, string], string>
eth_signTypedData_v3JsonRpc<"eth_signTypedData_v3", [string, string], string>
eth_signTypedData_v4JsonRpc<"eth_signTypedData_v4", [string, string], string>
wallet_getPermissionsJsonRpc<"wallet_getPermissions", undefined, boolean>
wallet_requestPermissionsJsonRpc<"wallet_requestPermissions", undefined, boolean>
wallet_registerOnboardingJsonRpc<"wallet_registerOnboarding", undefined, boolean>
wallet_scanQRCodeJsonRpc<"wallet_scanQRCode", undefined, boolean>
unknownJsonRpc<"unknown", unknown, UnknownResponse>
eth_accountsJsonRpc<"eth_accounts", undefined, string[]>
eth_coinbaseJsonRpc<"eth_coinbase", undefined, string>
net_versionJsonRpc<"net_version", undefined, string>
eth_chainIdJsonRpc<"eth_chainId", undefined, string>
eth_signJsonRpc<"eth_sign", [string, string], string>
personal_signJsonRpc<"personal_sign", [string], string>
personal_ecRecoverJsonRpc<"personal_ecRecover", [string, string], string>
eth_sendTransactionJsonRpc<"eth_sendTransaction", [EthTransaction], string>
eth_sendRawTransactionJsonRpc<"eth_sendRawTransaction", [string], string>
eth_signTransactionJsonRpc<"eth_signTransaction", [EthTransaction], string>
eth_privateRequestAccountsJsonRpc<"eth_privateRequestAccounts", undefined, string[]>
eth_getTransactionCountJsonRpc<"eth_getTransactionCount", [string, BlockTag], string>
eth_gasPriceJsonRpc<"eth_gasPrice", undefined, string>
eth_estimateGasJsonRpc<"eth_estimateGas", [EthTransaction], string>
wallet_watchAssetJsonRpc<"wallet_watchAsset", WatchAssetParameter, boolean>
wallet_addEthereumChainJsonRpc<"wallet_addEthereumChain", [Pick<AddEthereumChainParameter, "chainName" | "nativeCurrency" | "rpcUrls" | "blockExplorerUrls" | "iconUrls"> & { chainId: string }], null>
wallet_switchEthereumChainJsonRpc<"wallet_switchEthereumChain", [Omit<SwitchEthereumChainParameter, "chainId"> & { chainId: string }], null>
eth_newFilterJsonRpc<"eth_newFilter", never, never>
eth_newBlockFilterJsonRpc<"eth_newBlockFilter", never, never>
eth_newPendingTransactionFilterJsonRpc<"eth_newPendingTransactionFilter", never, never>
eth_uninstallFilterJsonRpc<"eth_uninstallFilter", never, never>
eth_subscribeJsonRpc<"eth_subscribe", never, never>

Interface: WalletConnectorEventMessagePayload

NameTypeDescription
topicstring
payloadstring

Enumeration: WalletType

NameTypeDescription

Enumeration members

internalWallet

internalWallet = "internalWallet"


externalWallet

externalWallet = "externalWallet"