onflow/hybrid-custody

[FEATURE] Add metadata as optional parameter on example transaction

lmcmz opened this issue · 0 comments

lmcmz commented

Issue to be solved

In HC contract, the metadata is optional for both owned and child accounts, by following use example code in the repo, the developer will easily miss configuring the metadata. And once the account is claimed or published, it's hard to configure it again.
This will cause UX trouble on the parent end since one parent can link with multiple account if multiple accounts doesn't have metadata on them. Users will be hard to identify which address belongs to which dApp.

Screenshot 2023-07-22 at 12 54 23 am

Suggest A Solution

I'd suggest that when a child account is claimed, it should provide some default metadata on it, and then the user can edit it later. Ideally, I'd reckon it's better to make the metadata as a mandatory configuration on owned and child accounts.

In reality, I think the minimum we can do that provides the metadata field as an optional parameter in some of example transactions, so the developer won't miss it easily and in our example dApp we should configure metadata by default, instead of leaving it empty.

Although, there is a number of transaction that can be added to metadata configuration. here is an example: setup_owned_account_and_publish_to_parent.cdc

Change

transaction(parent: Address, factoryAddress: Address, filterAddress: Address) {

to

transaction(parent: Address, factoryAddress: Address, filterAddress: Address, childAccountName: String?, childAccoutDesc: String?, childAccountImage: String?) {

Here is an ideal look for multiple child accounts under parent in my mind:
Screenshot 2023-07-22 at 12 56 15 am

What are you currently working on that this is blocking?

Not a blocker, just sth could be improved