algorandfoundation / algokit-lora

https://lora.algokit.io
13 stars 5 forks source link

Txn Wizard: Accept keyreg txn arguments from URL query string #337

Open lempira opened 1 week ago

lempira commented 1 week ago

Objectives Support for keyreg txn parameters through url

Future compatible for possible extensions to support groups, more transaction types, etc

I would restrict this to just keyregs for the time being, the security UX needs to be considered before we roll this out for everything that may include closeAssetTo, rekey, etc.

Note that rekeyTo field is not specified, make sure not to support it

Use case Facilitate Keyreg signing/broadcasting for users of TUI with desktop wallets (Lute, Defly Web, …)

TUI will have a desktop option for signing, which show a lora URL to visit. This should have the keyreg txn params prefilled.

Proposed URL Structure Base of keyreg arguments: ARC-78

Changes required from ARC-78:

Future proofing: Added index to each argument to allow for groups be passed in the future. E.g. enforce type[0]= instead of accepting type=

We could support both indexes and no indexes but this could be more error prone for devs. Safer to enforce indexes even when it is a single txn.

Add sender= argument

Note: note / xnote arguments are not required for now - feel free to leave them out

Example URL: (online keyreg)

https://lora.algokit.io/transaction-wizard ?type[0]=keyreg &sender[0]=I3345FUQQ2GRBHFZQPLYQQX5HJMMRZMABCHRLWV6RCJYC6OO4MOLEUBEGU &selkey[0]=-lfw-Y04lTnllJfncgMjXuAePe8i8YyVeoR9c1Xi78c &sprfkey[0]=3NoXc2sEWlvQZ7XIrwVJjgjM30ndhvwGgcqwKugk1u5W_iy_JITXrykuy0hUvAxbVv0njOgBPtGFsFif3yLJpg &votefst[0]=1300 &votekd[0]=100 &votekey[0]=UU8zLMrFVfZPnzbnL6ThAArXFsznV3TvFVAun2ONcEI &votelst[0]=11300 &fee[0]=2000000 Example URL: (offline keyreg)

https://lora.algokit.io/transaction-wizard ?type[0]=keyreg &sender[0]=I3345FUQQ2GRBHFZQPLYQQX5HJMMRZMABCHRLWV6RCJYC6OO4MOLEU