solana_token_list 0.0.3+2 copy "solana_token_list: ^0.0.3+2" to clipboard
solana_token_list: ^0.0.3+2 copied to clipboard

Solana Token Registry is a package that allows application to query for list of tokens.

example/main.dart

import 'package:solana_token_list/solana_token_list.dart';

void main() async {
  //Static Solana Tokens
  var staticTokens = staticTokenList.tokens;
  print('staticTokens size: ${staticTokens.length}');

  var tokenListStrategy = TokenListStrategy();

  // Fetch CDN Tokens
  final cdnTokens = await tokenListStrategy.fetchTokenList(Strategy.cdn);
  print('CDN solanaTokenList size: ${cdnTokens.length}');

  //Token list can exclude by a tag
  final noNftTokenList =
      (await tokenListStrategy.fetchTokenList(Strategy.static))
          .filterByChainEnv(ChainEnv.mainNetBeta)
          .excludeByTag('nft');

  //Filter by cluster name
  final list = cdnTokens.filterByClusterSlug('Mainnet-Beta');

  //Filter MainNet Beta tokens
  final mainNetList = cdnTokens.filterByChainEnv(ChainEnv.mainNetBeta);
}
3
likes
130
points
34
downloads

Publisher

unverified uploader

Weekly Downloads

Solana Token Registry is a package that allows application to query for list of tokens.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

http, json_annotation, json_serializable

More

Packages that depend on solana_token_list