wallet-selector icon indicating copy to clipboard operation
wallet-selector copied to clipboard

Near Snap - MetaMask Snap to support NEAR network

Open BeroBurny opened this issue 3 years ago • 3 comments

Description

NEAR Snap extends the capability of MetaMask to interact with the NEAR network.

  • Snaps is a system that allows anyone to expand the capabilities of MetaMask safely.
  • Snaps is pre-release software, To try Snaps, install MetaMask Flask.

Checklist:

  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings

BeroBurny avatar Sep 15 '22 12:09 BeroBurny

Hey, @BeroBurny thank you for submitting this PR.

Can you make sure that Near Snap follows these criteria: https://github.com/near/wallet-selector/blob/main/CONTRIBUTING.md#listing-criteria-for-third-party-wallet-on-wallet-selector

Could you please explain how to use this wallet: how do we create an account or import an existing one (i.e kujtimprenku.testnet)?

kujtimprenkuSQA avatar Sep 19 '22 13:09 kujtimprenkuSQA

Hey, @BeroBurny thank you for submitting this PR.

Can you make sure that Near Snap follows these criteria: https://github.com/near/wallet-selector/blob/main/CONTRIBUTING.md#listing-criteria-for-third-party-wallet-on-wallet-selector

Could you please explain how to use this wallet: how do we create an account or import an existing one (i.e kujtimprenku.testnet)?

Hi @kujtimprenkuSQA, Near Snap follows the criteria linked above. It uses Metamask Flask extension https://metamask.io/flask/ that support snaps, it derives Near address from metamask seed. Importing and exporting is the same as with Metamask, through extension. I'll update readme to be more specific about Metamask interaction.

irubido avatar Sep 22 '22 14:09 irubido

Hey, @BeroBurny.

I will share my experience with Near Snap and I also have some questions.

For a user it is very unclear what is happening under the hood when using this wallet, I downloaded and installed the extension then created a new "Ethereum" account it was not clear how this account will be used just when I tried to sign in via Wallet Selector then I noticed a message 429380d6c79d10d1b7cd5b457153d8f433e9dec37e29bf52467cc1a30bdd74c0 does not exist this account was somehow created based on the "Ethereum" account created through the extension but because it had 0 NEAR on it the sign in did not work what's strange is that I never saw that account id anywhere in the Extension indicating that this is the account id based on the Ethereum account.

Questions/ comments:

  • There's no way to know if the above account id is testnet or mainnet (near) account.
  • The network in the extension shows as Ethereum Mainnet even though I was able to signIn and signOut with a near account (possibly testnet). - How do we add a NEAR testnet or mainnet network?
  • When I try to sign and send a transaction the UI is not showing any useful information (like the amount, action type, text message, gas price etc).
  • When you connect/signIn to a website through MetaMask on the left side there's a button that says Connected but in this case even though I sing in successfully it still says Not Connected
  • I created a second Ethereum account and switching to that account does nothing when I sign in via Wallet Selector it still selects the above account id which was created for my first account.
  • I transferred 5 NEAR from kujtimprenku.testnet to 429380d6c79d10d1b7cd5b457153d8f433e9dec37e29bf52467cc1a30bdd74c0 but they don't show anywhere in the Near Snap shows as 0 ETH $0.00 USD
  • How does signOut work? - I click the signout button and switch the account in the extension then try to sign in it still selects the first account I created there.
  • Assets and Activity tabs in the extension don't show any information.

Did anything change in the source code of Near Snap?

Today I tried to test how this would work if I exported the account first and then removed the extension after that I re-installed it and imported the account but this wallet does not work anymore I see this error when I click Connect on the wallet's UI: Errors-Flask

kujtimprenkuSQA avatar Sep 26 '22 08:09 kujtimprenkuSQA

Hey @BeroBurny @irubido I just wanted to check the status regarding the work on this. Do you guys have any updates or any questions? Hvala :wink:

AmmarHumackicSQA avatar Nov 04 '22 15:11 AmmarHumackicSQA

Hi, @AmmarHumackicSQA - I am the ChainSafe project manager for our work on the NEAR snap. this Pull Request was made as part of a contract that was signed by ChainSafe and the NEAR Foundation. I agree with many of the concerns raised by @kujtimprenkuSQA, but in many/most cases they speak to limitations of the snap system itself. Snaps are still in beta so it's possible that as the snap ecosystem matures the concerns that have been brought up will be addressed, but at this time it's not within the scope of work (or in many cases even the scope of possibility) for ChainSafe developers to address the issues that have been brought up. Please let me know if you'd like to set up some time to chat about this and we'll figure out a way to make that work.

danforbes avatar Nov 04 '22 16:11 danforbes

Hey, @danforbes I have noticed two potential issues and I am unable to use this Wallet (snap)

  • When Metamask is installed then this error shows up, and the wallet selector fails to initialize (disabling Metamaks makes the error go away):

near-snap-error

  • I am unable to sign in with this Wallet, this error shows up for me (this is the same error I mentioned on September 26 see the comment):

near-snap-sign-in-error

I just installed MetaMask Flask DEVELOPMENT and created a new Account, and tried to sign in with Wallet Selector, is there any extra step/work I need to do to successfully signIn in to the guest-book example with Near Snap?

kujtimprenkuSQA avatar Nov 08 '22 10:11 kujtimprenkuSQA

@kujtimprenkuSQA - this is a known bug that occurs when both MetaMask and MetaMask Flask are installed as extensions in the same browser. Based on the first screenshot you shared, that seems to be the cause of the problem you're experiencing.

danforbes avatar Nov 08 '22 14:11 danforbes

d on the first screenshot yo

@kujtimprenkuSQA - this is a known bug that occurs when both MetaMask and MetaMask Flask are installed as extensions in the same browser. Based on the first screenshot you shared, that seems to be the cause of the problem you're experiencing.

@danforbes Should we expect an update that'd fix these or is this out of the domain of Snaps?

gutsyphilip avatar Nov 08 '22 17:11 gutsyphilip

@gutsyphilip the answer to that question is out of my domain as I am not associated with the MetaMask team; I am associated with the team at ChainSafe that implemented the Near snap, with the support of the Near Foundation.

danforbes avatar Nov 08 '22 17:11 danforbes

Hey @irubido, any news on the status regarding the work on addressing the comments left by @kujtimprenkuSQA ?

AmmarHumackicSQA avatar Jan 23 '23 17:01 AmmarHumackicSQA

@kujtimprenkuSQA - are there any pending tasks related to this PR for the ChainSafe team?

danforbes avatar Feb 14 '23 18:02 danforbes

Hey, @danforbes the PR looks good to me, there are no pending tasks for the ChainSafe/ Near Snap team.

kujtimprenkuSQA avatar Feb 14 '23 18:02 kujtimprenkuSQA

Updated breaking changes for metamask flask v1.25 released today

irubido avatar Feb 17 '23 14:02 irubido

Updated breaking changes for metamask flask v1.25 released today

@irubido after this last update we're seeing an error when we try to signIn:

Screenshot 2023-02-20 155021

Version 10.25.0-flask.0

kujtimprenkuSQA avatar Feb 20 '23 14:02 kujtimprenkuSQA

Updated breaking changes for metamask flask v1.25 released today

@irubido after this last update we're seeing an error when we try to signIn:

Screenshot 2023-02-20 155021

Version 10.25.0-flask.0

Can you tell me a version of snap installed on Flask? (should be 1.0.6)

You can find it under Account -> Settings -> Snaps -> Near Snap - See Details (buttons)
  1. image
  2. image
  3. image
  4. image

BeroBurny avatar Feb 20 '23 18:02 BeroBurny

Is there a "right" way to upgrade these snaps?

The way I did it was by removing the previous version and trying to connect with the new one, now it's working.

kujtimprenkuSQA avatar Feb 20 '23 21:02 kujtimprenkuSQA