fix(wallet)_: Filter non-bridgeable assets in Bridge Modal (#15924)
- Implemented a bridgeableGroupedAccountAssetsModel in WalletAssetsStore.qml to dynamically filter assets based on their bridgeability. closes: #15697 Co-authored-by: belalshehab <belal@status.im>
This commit is contained in:
parent
9cf9fa0470
commit
8343fe3076
|
@ -101,4 +101,21 @@ QtObject {
|
||||||
rightModel: _jointTokensBySymbolModel
|
rightModel: _jointTokensBySymbolModel
|
||||||
joinRole: "tokensKey"
|
joinRole: "tokensKey"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is hard coded for now, and should be updated whenever Hop add new tokens for support
|
||||||
|
// This should be dynamically fetched somehow in the future
|
||||||
|
readonly property var tokensSupportedByHopBridge: ["USDC", "USDC.e", "USDT", "DAI", "HOP", "SNX", "sUSD", "rETH", "MAGIC"]
|
||||||
|
|
||||||
|
readonly property SortFilterProxyModel bridgeableGroupedAccountAssetsModel: SortFilterProxyModel {
|
||||||
|
objectName: "bridgeableGroupedAccountAssetsModel"
|
||||||
|
sourceModel: root.groupedAccountAssetsModel
|
||||||
|
|
||||||
|
filters: [
|
||||||
|
FastExpressionFilter {
|
||||||
|
expression: root.tokensSupportedByHopBridge.includes(model.symbol)
|
||||||
|
expectedRoles: ["symbol"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -358,7 +358,9 @@ StatusDialog {
|
||||||
TokenSelectorViewAdaptor {
|
TokenSelectorViewAdaptor {
|
||||||
id: assetsAdaptor
|
id: assetsAdaptor
|
||||||
|
|
||||||
assetsModel: popup.store.walletAssetStore.groupedAccountAssetsModel
|
assetsModel: d.isBridgeTx ?
|
||||||
|
popup.store.walletAssetStore.bridgeableGroupedAccountAssetsModel :
|
||||||
|
popup.store.walletAssetStore.groupedAccountAssetsModel
|
||||||
|
|
||||||
flatNetworksModel: popup.store.flatNetworksModel
|
flatNetworksModel: popup.store.flatNetworksModel
|
||||||
currentCurrency: popup.store.currencyStore.currentCurrency
|
currentCurrency: popup.store.currencyStore.currentCurrency
|
||||||
|
|
Loading…
Reference in New Issue