PolkawalletPlugin class abstract

Implemented types

Constructors

PolkawalletPlugin()

Properties

appUtils AppUtils
final
balances BalancesStore
Plugin should retrieve balances from sdk for display in Assets page of Polkawallet App.
final
basic PluginBasicData
A plugin's basic info, including: name, primaryColor and icons.
finalinherited
defaultTokens List<String>
Plugin should provide a list of defaultTokens for users of Polkawallet App.
no setter
hashCode int
The hash code for this object.
no setterinherited
networkConst Map
no setter
networkState NetworkStateData
Plugin should retrieve networkState & networkConst while start
no setter
nodeList List<NetworkParams>
Plugin should define a list of node to connect for users of Polkawallet App.
no setterinherited
noneNativeTokensAll List<TokenBalanceData>
Plugin should provide a list of noneNativeToken for users of Polkawallet App.
no setter
recoveryEnabled bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sdk WalletSDK
A plugin has a WalletSDK instance for connecting to it's node.
final
tokenIcons Map<String, Widget>
Plugin should provide tokenIcons for display in Assets page of Polkawallet App.
finalinherited

Methods

beforeStart(Keyring keyring, {KeyringEVM? keyringEVM, WebViewRunner? webView, String? jsCode, Function? socketDisconnectedAction, bool isEVM = false}) Future<void>
This method will be called while App switched to a plugin. In this method, the plugin will init WalletSDK and start a webView for running polkadot-js/api.
changeAccount(KeyPairData account) Future<void>
This method will be called while App user changes account.
dispose() Future<void>
we don't really need this method, calling webView.launch more than once will cause some exception. We just pass a webViewParam instance to the sdk.init function, so the sdk knows how to deal with the webView.
getAggregatedAssetsWidget({String priceCurrency = 'USD', bool hideBalance = false, double rate = 1.0, Function? onSwitchBack, Function? onSwitchHideBalance}) Widget?
The App will display this widget in assets page
getNativeTokenTransfers({required String address, int transferType = 0}) Widget?
The App will display this widget in native token detail page @paramtransferType = 0 | 1 | 2, (0 = all, 1 = in, 2 = out)
getNavItems(BuildContext context, Keyring keyring) List<HomeNavItem>
The getNavItems method returns a list of HomeNavItem which defines the Widget to be used in home page of polkawallet App.
inherited
getRoutes(Keyring keyring) Map<String, WidgetBuilder>
App will add plugin's pages with custom routes.
inherited
loadBalances(KeyPairData acc) → void
loadJSCode() Future<String>?
App will inject plugin's jsCode into webview to connect.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAccountChanged(KeyPairData account) Future<void>
This method will be called while App user changes account. In this method, the plugin should do:
onStarted(Keyring keyring) Future<void>
This method will be called after plugin started
onStartedEVM(KeyringEVM keyringEvm) Future<void>
This method will be called after plugin started
onWillStart(Keyring keyring) Future<void>
This method will be called before plugin start
onWillStartEVM(KeyringEVM keyring) Future<void>
start(Keyring keyring, {List<NetworkParams>? nodes, KeyringEVM? keyringEVM, NetworkParams? nodeEVM}) Future<NetworkParams?>
This method will be called while App switched to a plugin. In this method, the plugin will:
toString() String
A string representation of this object.
inherited
updateBalances(KeyPairData acc) Future<void>
This method will be called while user request to query balance.
updateNetworkState() Future<void>

Operators

operator ==(Object other) bool
The equality operator.
inherited