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

How to make trigger a popup of a browser-based wallet? #1013

Open
GildedHonour opened this issue Oct 8, 2022 · 2 comments
Open

How to make trigger a popup of a browser-based wallet? #1013

GildedHonour opened this issue Oct 8, 2022 · 2 comments

Comments

@GildedHonour
Copy link

GildedHonour commented Oct 8, 2022

I have this code in a browser:

  const { connect, keyStores, WalletConnection } = nearAPI;
  const testnetConnectionConfig = {
    networkId: "testnet",
    keyStore: new keyStores.BrowserLocalStorageKeyStore(),
    nodeUrl: "https://rpc.testnet.near.org",
    walletUrl: "https://wallet.testnet.near.org",
    helperUrl: "https://helper.testnet.near.org",
    explorerUrl: "https://explorer.testnet.near.org",
  };

  async function connectAndSignIn() {
    const testnetNearConnection = await connect(testnetConnectionConfig);
    const testnetWalletConnection = new WalletConnection(testnetNearConnection);

    //
    testnetWalletConnection.requestSignIn(
      //.......... [....]

This, however, will redirect me to https://wallet.testnet.near.org/login. But this isn't want I want.

Why won't it trigger a popup with a browser wallet, the way it'll happen with MetaMask on other websites? I have Sender wallet installed in Chromium.

More globally, I want to allow a user to send a transaction to my smart contract, with certain parameters that are unique to each user and purchase.

How to do it?

@GildedHonour
Copy link
Author

GildedHonour commented Oct 8, 2022

2nd question which may make the 1st one irrelevant:

if I do use browser-based wallet instead of the one as extention, how will I allow and make a user to transfer coins to a smart contract? For during authentication there's a text which says that this type of an authentication process won't permit a user, or an application, to transfer coins from a user's wallet. Whereas this is what I need.

Screenshot_2022-10-07_21-36-44

Will a special parameter have to be provided to an authentication request which will allow coins to be transfered?

@DevSlashRichie
Copy link

This sounds like a duplicated of the issue I opened: #1010

I am planning on doing a PR for that on the following days / next week.

KartikSoneji added a commit to KartikSoneji/metaplex-js-examples that referenced this issue Nov 14, 2022
vite is not compatible with the near js sdk
this is a temporary workaround until the issue is fixed
near/near-api-js#1013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog 🥶
Development

No branches or pull requests

2 participants