stellar / stellar-cli

CLI for Stellar developers
67 stars 65 forks source link

Have reserved Aliases that are prefilled, e.g. `native` #1409

Open willemneal opened 3 months ago

willemneal commented 3 months ago

What problem does your feature solve?

Currently to interact with a SAC you first need to use contract id asset to find the contract id.

What would you like to see?

Have special reserved aliases for example, xlm so that users can immediately use it. E.g. contract invoke --id native -- transfer ...

What alternatives are there?

fnando commented 3 months ago

+1 for this. The only thing is that we should use native instead, as it's what we use on our sdks.

willemneal commented 3 months ago

Works for me! Updating!

leighmcculloch commented 2 months ago

We can programmatically convert from any SEP-11 asset to the contract ID as well, where native is just one of the supported values. That way any ASSET:ADDRESS is an automatic alias that works.

I'd prefer programmatically converting from the asset values instead of hardcoding some reserved values because native's contract ID changes depending on the network passphrase/id, and this more holistically addresses the issues of referencing assets.

willemneal commented 2 months ago

This is definitely the way, but it would be nice to list the possible assets. Is there an official list of verified assets? Or at least a site that lists them?

leighmcculloch commented 2 months ago

There isn't a centralised list of assets and I wouldn't want to add one to the CLI. There is SEP-42 for asset lists from different providers, but I think we're jumping ahead to add support for that. Simply making it possible to reference contracts with their asset code+issuer is useful on its own without scoping this out to including asset lists.