IReownAppKitModal class abstract

Either a projectId and metadata must be provided or an already created appKit. 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

IReownAppKitModal()

Properties

appKit IReownAppKit?
The object that manages sessions, authentication, events, and requests for WalletConnect.
no setter
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>
Returns the balance of the currently connected wallet on the selected chain.
no setter
chainBalance String
Returns the balance of the currently connected wallet on the selected chain.
no setter
featuresConfig FeaturesConfig
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 appKitModal 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 ReownAppKitModalNetworkInfo?
The currently selected chain.
no setter
selectedWallet ReownAppKitModalWalletInfo?
The currently selected wallet.
no setter
session ReownAppKitModalSession?
The current session's data.
no setter
status ReownAppKitModalStatus
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

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.
dispatchEnvelope(String url) Future<bool>
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({String? namespace}) List<String>?
List of approved chains by connected wallet
getApprovedEvents({String? namespace}) List<String>?
List of approved events by connected wallet
getApprovedMethods({String? namespace}) 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 appKit 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>
Loads/Refresh account balance and identity
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
openModalView([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.
openNetworksView() Future<void>
Opens modal on Network Selection Screen
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(ReownAppKitModalNetworkInfo newChain) Future<void>
requestReadContract({required String? topic, required String chainId, required DeployedContract deployedContract, required String functionName, EthereumAddress? sender, List parameters = const []}) Future<List>
requestSwitchToChain(ReownAppKitModalNetworkInfo 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(ReownAppKitModalNetworkInfo? chainInfo, {bool switchChain = false}) Future<void>
Sets the selectedChain 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(ReownAppKitModalWalletInfo? 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