-
Notifications
You must be signed in to change notification settings - Fork 6
Description
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.