IW3MService class abstract
Either a projectId
and metadata
must be provided or an already created web3App.
optionalNamespaces is mostly not needed, if you use it, the values set here will override every optionalNamespaces set in evey chain
- Mixed-in types
- Implementers
Constructors
Properties
- avatarUrl → String?
-
The url to the account's avatar image.
Pass this into a Image.network and it will load the avatar image.
no setter
-
balanceNotifier
→ ValueNotifier<
String> -
no setter
- chainBalance → String
-
Returns the balance of the currently connected wallet on the selected chain.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- hasNamespaces → bool
-
no setter
- isConnected → bool
-
Variable that can be used to check if the web3App is connected
no setter
- isOpen → bool
-
Variable that can be used to check if the modal is visible on screen.
no setter
- modalContext → BuildContext?
-
no setter
-
onModalConnect
→ Event<
ModalConnect> -
final
-
onModalDisconnect
→ Event<
ModalDisconnect> -
final
-
onModalError
→ Event<
ModalError> -
final
-
onModalNetworkChange
→ Event<
ModalNetworkChange> -
final
-
onModalUpdate
→ Event<
ModalConnect> -
final
-
onSessionEventEvent
→ Event<
SessionEvent> -
final
-
onSessionExpireEvent
→ Event<
SessionExpire> -
final
-
onSessionUpdateEvent
→ Event<
SessionUpdate> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedChain → W3MChainInfo?
-
The currently selected chain.
no setter
- selectedWallet → W3MWalletInfo?
-
The currently selected wallet.
no setter
- session → W3MSession?
-
The current session's data.
no setter
- status → W3MServiceStatus
-
Whether or not this object has been initialized.
no setter
- wcUri → String?
-
The URI that can be used to connect to this dApp.
This is only available after the openModalView function is called.
no setter
- web3App → IWeb3App?
-
The object that manages sessions, authentication, events, and requests for WalletConnect.
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
buildConnectionUri(
) → Future< void> - This will do nothing if isConnected is true.
-
closeModal(
{bool disconnectSession = false}) → void - Closes the modal.
-
connectSelectedWallet(
{bool inBrowser = false}) → Future< void> - Connects the selectedWallet previously selected
-
disconnect(
{bool disconnectAllSessions = true}) → Future< void> - Disconnects the session and pairing, if any. If there is no session, this does nothing.
-
dispose(
) → Future< void> -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
expirePreviousInactivePairings(
) → Future< void> - Used to expire and delete any inactive pairing
-
getApprovedChains(
) → List< String> ? - List of approved chains by connected wallet
-
getApprovedEvents(
) → List< String> ? - List of approved events by connected wallet
-
getApprovedMethods(
) → List< String> ? - List of approved methods by connected wallet
-
getAvailableChains(
) → List< String> ? - List of available chains to be added in connected wallet
-
init(
) → Future< void> - Sets up the explorer and the web3App if they already been initialized.
-
launchBlockExplorer(
) → void - Launch blockchain explorer for the current chain in external browser
-
launchConnectedWallet(
) → void - Opens the native wallet selectedWallet after connected
-
loadAccountData(
) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
openModal(
BuildContext context, [Widget? startWidget]) → Future< void> -
Opens the modal with the provided
startWidget
(if any). If none is provided, the default state will be used based on platform. -
openModalView(
[Widget? startWidget]) → Future< void> -
openNetworks(
BuildContext context) → Future< void> -
openNetworksView(
) → Future< void> -
reconnectRelay(
) → Future< void> - Connects to the relay if not already connected. If the relay is already connected, this does nothing.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
request(
{required String? topic, required String chainId, String? switchToChainId, required SessionRequestParams request}) → Future - Make a request
-
requestAddChain(
W3MChainInfo newChain) → Future< void> -
requestReadContract(
{required String? topic, required String chainId, required DeployedContract deployedContract, required String functionName, EthereumAddress? sender, List parameters = const []}) → Future< List> -
requestSwitchToChain(
W3MChainInfo newChain) → Future< void> -
requestWriteContract(
{required String? topic, required String chainId, required DeployedContract deployedContract, required String functionName, required Transaction transaction, List parameters = const [], String? method}) → Future -
selectChain(
W3MChainInfo? chainInfo, {bool switchChain = false}) → Future< void> -
Sets the selectedChain and gets the chainBalance.
If the wallet is already connected, it will request the chain to be changed and will update the session with the new chain.
If
chainInfo
is null this will disconnect the wallet. -
selectWallet(
W3MWalletInfo? walletInfo) → void - Sets the selectedWallet to be connected
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited