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

feat: add Enkrypt support #1105

Merged
merged 2 commits into from
Jan 12, 2024
Merged

feat: add Enkrypt support #1105

merged 2 commits into from
Jan 12, 2024

Conversation

kvhnuke
Copy link
Contributor

@kvhnuke kvhnuke commented Dec 30, 2023

Pull Request Summary

Adds support for Enkrypt Extension

Check list

  • contains breaking changes
  • adds new feature
  • modifies existing feature (bug fix or improvements)
  • relies on other tasks
  • documentation changes
  • tested on mobile devices

This pull request makes the following changes:

Adds

  • Enkrypt support

@kvhnuke kvhnuke changed the title devop: add Enkrypt support Feat: add Enkrypt support Dec 30, 2023
@kvhnuke kvhnuke changed the title Feat: add Enkrypt support feat: add Enkrypt support Dec 30, 2023
@Kahonnohak
Copy link
Contributor

Thank you so much for the PR, would it be possible to create a staging link please? Happy New Year and all the best for 2024!

@gluneau gluneau self-requested a review January 2, 2024 13:47
@gluneau
Copy link
Contributor

gluneau commented Jan 2, 2024

Check here @kvhnuke for an example on how to create a staging preview for us to review.

https://docs.astar.network/docs/build/builder-guides/integration_toolings/deploy-astar-portal

@kvhnuke
Copy link
Contributor Author

kvhnuke commented Jan 3, 2024

@gluneau
Copy link
Contributor

gluneau commented Jan 4, 2024

Copy link
Contributor

@gluneau gluneau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need different source names for native and evm

Copy link
Contributor

@gluneau gluneau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gluneau gluneau requested review from bobo-k2 and impelcrypto January 9, 2024 14:05
Copy link
Member

@impelcrypto impelcrypto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The portal doesn't display the loading animation while waiting for finalizing the transaction. I think it's related to the same issue Hana wallet had before. Please take a look at comments below and resolve the issue on the wallet extension. Please let me know once Enkrypt extension has updated version after resolve the issue.

#563 (comment)

#563 (comment)

#563 (comment)

Demo:
https://www.loom.com/share/f6055ec55cda4a719e03922e52987c14?from_recorder=1&focus_title=1

=Polkadot.js=
The animation should work like this:
image

@kvhnuke
Copy link
Contributor Author

kvhnuke commented Jan 11, 2024

@impelcrypto after carefully reviewing how you handle the loading screen, I have to disagree with this approach.
as a DApp you should not listen to "messages" emitted by window event due to following reasons

  1. This is not a documented approach
  2. window events are inherently insecure and only reason we are still using it is due to the fact the modern communication streams such as "https://developer.chrome.com/docs/extensions/reference/api/runtime#method-sendMessage" are not implemented across all the browsers. However, when it happens we will move away from window messaging.
  3. As a dapp you should never implement functions that are not documented as they can easily change.
  4. you might get false positive loading screens, if there is a message with data.response and data.signature (https://github.com/Hana-Technology/astar-apps/blob/add-hana-wallet/src/v2/services/implementations/PolkadotWalletService.ts#L179)
  5. if you look closely at https://github.com/polkadot-js/extension/blob/297b2af14c68574b24bb8fdeda2208c473eccf43/packages/extension/src/page.ts#L10-L22 they only use the window message listener to handleResponse back to the dapp.
  6. This listener is never intended to be part of a dapp

I do understand you got lucky with talisman.subwallet etc as they probably just copy pasted polkadotjs communication method, however our messages are more complicated and made custom to Enkrypt.

Here is how you can implement the fix for loading screen on your end

  1. Use promises, this is the way https://polkadot.js.org/apps/ handles loading and the documented way at https://polkadot.js.org/docs/extension

if there is any standard or documented method we missed or improperly implemented please let us know, if not this is not a change we can comply with

@impelcrypto
Copy link
Member

@kvhnuke Thanks for letting me know.

@impelcrypto impelcrypto merged commit f14f0d5 into AstarNetwork:main Jan 12, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants