Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

AEX-2 Compatibility #98

Open
wants to merge 11 commits into
base: aex-2
Choose a base branch
from
Open

AEX-2 Compatibility #98

wants to merge 11 commits into from

Conversation

petarbaykov
Copy link

@petarbaykov petarbaykov commented Nov 1, 2019

  • Connection between aepp and wallet
  • init RpcWallet
  • listen for changes in address and network
  • open connection popup

Aex-2 communication can be tested with this aepp -> http://aex2.aepps.tech/

There are several things that I saw while integrating sdk-s RpcWallet and RpcAepp that are connected to the sdk implementation of aex-2 (aeternity/aepp-sdk-js#512)

  • communication between the aepp and extension is done via chrome.runtime.connect method inside the aepp. This method will connect to the extension only if the domain of the aepp is specified in manifest.json of the extension (https://developer.chrome.com/apps/manifest/externally_connectable). I think content script should be in the middle of the aepp and the extension. This way it will work no matter what is the domain of the aepp
  • The object initiated in aepp is called RpcAepp. I think the object should be called Aepp and get the properties of the RpcAepp if extension wallet is available. Because now when I run the example aepp app it doesnt work with base aepp because the aepp initialize RpcAepp object and not an Aepp object. Another thing is that when you initiate RpcAepp object you need to specify network, I think the network should be retrieved from the wallet extension
  • Deploying smart contracts throws an error at this point with the current fork of the sdk used in this pull request. I think this is because of the aex-2 branch of the sdk not being up-to date with develop.

- Connection between aepp and wallet
- init RpcWallet
- listen for changes in address and network
- open connection popup
@mradkov mradkov self-requested a review November 4, 2019 06:33
@mradkov mradkov self-assigned this Nov 4, 2019
package.json Outdated
@@ -22,20 +22,21 @@
"dependencies": {
"@aeternity/aepp-components": "git+https://github.com/aeternity/aepp-components.git#develop",
"@aeternity/aepp-components-3": "3.0.0-alpha.9",
"@aeternity/aepp-sdk": "6.0.0",
"@aeternity/aepp-sdk": "github:aeternity/aepp-sdk-js#aex-2",
Copy link

Choose a reason for hiding this comment

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

This branch is not up-to date with the Lima release and results in Unable to connect to choosen node error.

Copy link

Choose a reason for hiding this comment

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

Are the new changes working with the branch of the pull request to the sdk that supports aex-2 (aeternity/aepp-sdk-js#512)?

Copy link
Author

Choose a reason for hiding this comment

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

The changes are working with fork of the sdk aex-2 branch. The only difference is changed node version because i was not able to connect to the testnet -> https://github.com/petbaik/aepp-sdk-js/blob/feature/aex-2/es/node.js#L158
"@aeternity/aepp-sdk": "github:petbaik/aepp-sdk-js#feature/aex-2"
The only difference between sdk aex-2 branch and my fork is the changed node version

- Open connection popup and confirm or reject connection with aepp
- Open tx sign popup
@mradkov mradkov changed the title Aex 2 AEX-2 Compatibility Nov 6, 2019
@mradkov mradkov self-requested a review November 6, 2019 08:17
@mradkov mradkov added the review label Nov 6, 2019
@mradkov
Copy link

mradkov commented Nov 7, 2019

After a discussion with the SDK team, we agreed that the AEX-2 functionality will be merged in the master branch after it is being finalized.

So we put this on hold until then.

@mradkov mradkov added the on hold label Nov 7, 2019
@mradkov
Copy link

mradkov commented Nov 22, 2019

aeternity/aepp-sdk-js#512

Is going to be included in v7.0.0 major release of the sdk-js.

@mradkov
Copy link

mradkov commented Nov 26, 2019

aeternity/aepp-sdk-js#512

Is going to be included in v7.0.0 major release of the sdk-js.

Merged. Ref. aeternity/aepp-sdk-js@e7e9eb4

@mradkov mradkov added rebase and removed on hold labels Nov 26, 2019
@mradkov
Copy link

mradkov commented Dec 3, 2019

@petarbaykov
Copy link
Author

aeternity/aepp-sdk-js#512
Is going to be included in v7.0.0 major release of the sdk-js.

Merged. Ref. aeternity/aepp-sdk-js@e7e9eb4

The object initialized in aepp is still called RpcAepp. The aepps created so far still will not be compatible with the extension unless they use RpcAepp.

@mradkov
Copy link

mradkov commented Dec 5, 2019

communication between the aepp and extension is done via chrome.runtime.connect method inside the aepp. This method will connect to the extension only if the domain of the aepp is specified in manifest.json of the extension (https://developer.chrome.com/apps/manifest/externally_connectable). I think content script should be in the middle of the aepp and the extension. This way it will work no matter what is the domain of the aepp

After investigating this I came to the conclusion we cannot use wildcard matches for the externally connectable, so what you've proposed with the content script in the middle is a good approach and maybe the only feasible one at this point in time.

Together with @nduchak we discussed that and we think we can remove the Aepp and stick to using post messages forwarding using the interface proposed in AEX2. In order to be compatible an application will need to import the RpcAepp rather than Aepp which will be the recommended way forward.

@mradkov
Copy link

mradkov commented Dec 11, 2019

petarbaykov added a commit to petarbaykov/aepp-waellet that referenced this pull request Jan 24, 2020
Transfer changes made for Aex-2 from pr aeternity#98
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants