komodo_coins 0.3.0+1
komodo_coins: ^0.3.0+1 copied to clipboard
A package for fetching managing Komodo Platform coin configuration data storage, runtime updates, and queries.
Komodo Coins #
Fetch and transform the Komodo coins registry for use across Komodo SDK packages and apps. Provides filtering strategies and helpers to work with coin/asset metadata.
Install #
flutter pub add komodo_coins
Quick start #
import 'package:komodo_coins/komodo_coins.dart';
import 'package:komodo_defi_types/komodo_defi_types.dart';
final coins = KomodoCoins();
await coins.init();
// All assets, keyed by AssetId
final all = coins.all;
// Find a specific ticker variant
final btcVariants = coins.findVariantsOfCoin('BTC');
// Get child assets for a platform id (e.g. tokens on a chain)
final erc20 = coins.findChildAssets(
AssetId.parse({'coin': 'ETH', 'protocol': {'type': 'ETH'}}),
);
Filtering strategies #
Use strategies to filter the visible set of assets for a given context (e.g., hardware wallet support):
final filtered = coins.filteredAssets(const TrezorAssetFilterStrategy());
Included strategies:
NoAssetFilterStrategy(default)TrezorAssetFilterStrategyUtxoAssetFilterStrategyEvmAssetFilterStrategy
With the SDK #
KomodoDefiSdk uses this package under the hood for asset discovery, ordering, and historical/custom tokens.
License #
MIT