Much like the shouldRequestAccountName method on a provider, it would also be useful (for our implementation specifically) if the interface also had a shouldRequestChainId method on the provider. It would be a prompt like the account name request, except have some sort of selection (dropdown, icons, etc) which prompts the user to select a blockchain. This step would only be required if more than one chain was provided to UAL and the provider specified shouldRequestChainId = true.
The reason behind this is within the EOSIO Signing Request specification we're using - we expect the chain to be already defined at the time an identity request is made. When using UAL in conjunction with multiple blockchains and the UAL-Anchor plugin, we essentially are forced right now to inject a selection in before initializing UAL and just passing one chain at a time.
My thoughts is the interface could require something like this:
/**
* Returns whether or not the button should show chain ID field.
* This is for Authenticators that require a single chain ID is specified for authentication.
*/
public async shouldRequestChainId(): Promise<boolean> {
return true
}
If you are interested to see the workaround we have tossed together just to get things working now, we have one available and published here:
We are basically reinstantiating the UALProvider with a single chain, whenever the user changes blockchains using the dropdown above the login button. Making this selection process part of the UAL modal flow I believe would be a much better user experience.
I considered submitting a PR with this change - but before I took the effort of writing/testing it, I figured I should open an issue first to discuss the idea. Thanks, and look forward to hearing your thoughts!
Much like the
shouldRequestAccountName
method on a provider, it would also be useful (for our implementation specifically) if the interface also had ashouldRequestChainId
method on the provider. It would be a prompt like the account name request, except have some sort of selection (dropdown, icons, etc) which prompts the user to select a blockchain. This step would only be required if more than one chain was provided to UAL and the provider specifiedshouldRequestChainId = true
.The reason behind this is within the EOSIO Signing Request specification we're using - we expect the chain to be already defined at the time an identity request is made. When using UAL in conjunction with multiple blockchains and the UAL-Anchor plugin, we essentially are forced right now to inject a selection in before initializing UAL and just passing one chain at a time.
My thoughts is the interface could require something like this:
If you are interested to see the workaround we have tossed together just to get things working now, we have one available and published here:
Demo: https://greymass.github.io/ual-anchor-demo/ Source: https://github.com/greymass/ual-anchor-demo/
We are basically reinstantiating the
UALProvider
with a single chain, whenever the user changes blockchains using the dropdown above the login button. Making this selection process part of the UAL modal flow I believe would be a much better user experience.I considered submitting a PR with this change - but before I took the effort of writing/testing it, I figured I should open an issue first to discuss the idea. Thanks, and look forward to hearing your thoughts!