Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: KAP name resolution #190

Open
1 task done
lukemwillis opened this issue May 1, 2023 · 0 comments
Open
1 task done

[FEATURE]: KAP name resolution #190

lukemwillis opened this issue May 1, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@lukemwillis
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

New feature

Allow use of KAP names instead of addresses when using CLI for register, payer, and contract calls which accept an address as a parameter. (open to additional command suggestions)

🔐 > register luke luke.koin
Contract 'luke' at address 1Phen7sf6kjAgJ3jwiheWW6SFDumDoWgUf registered

🔐 > payer luke.koin
Payer set to address 1Phen7sf6kjAgJ3jwiheWW6SFDumDoWgUf

🔐 > koin.balance_of luke.koin
'luke.koin' resolved to address 1Phen7sf6kjAgJ3jwiheWW6SFDumDoWgUf
10.2888231 KOIN

If needed, names could be required to use the kap:// prefix.

🔐 > koin.balance_of kap://luke.koin

For register, payer, and read-only contract entry points, the output will display the address(es) for each of the names used. Current register output is fine. payer output should be added to always echo the address. Contract calls should echo each of the names resolved. If the entry point is not read-only, there should be an additional check before executing the command.

🔐 > koin.transfer luke.koin 1
'luke.koin' resolved to address 1Phen7sf6kjAgJ3jwiheWW6SFDumDoWgUf
Continue? (y/n) 

If user types y, execute the command as normal. If n, display contract call aborted and return.

To support this integration, I propose adding a address_of command which accepts a KAP name and returns the address of the name's owner.

Anything else?

Seeking feedback on this design and implementation details. I will devote time to implementing if this feature is desired.

@lukemwillis lukemwillis added the enhancement New feature or request label May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant