HERE Wallet
  • Technology description
    • Storage
      • Getting Income
      • Security
      • Security audit
    • 📞Phone number transfer
    • Apple app clip
    • Binance connect
    • Score
    • Token swaps
  • ⚙️Tools for dApps
    • Instant wallet
    • Push notifications
    • Non-blocking storage with APY
    • Universal sign links
  • App
    • 🚀First step
    • 💻Login
    • ☁️RPC NODE
    • ⛽Gas-free transactions
  • partners
    • 🎅Santa Token
    • HERE Connect (js)
    • NEAR Foundation
    • Tonic DEX
    • Astrostakers
    • GetBlock
Powered by GitBook
On this page
  • Connect @here-wallet/connect
  • Advance. Change the near-api-js configuration
  • Testnet
  • Result

Was this helpful?

  1. partners

HERE Connect (js)

Connect HERE Wallet to your site to push access to more users

PreviousSanta TokenNextNEAR Foundation

Last updated 2 years ago

Was this helpful?

is a simple web service that allows web3 applications to interact with the Here mobile wallet. It uses the same transaction signing interface as the official Near Wallet. This allows web3 apps to integrate Here Wallet without changing their code.

To sign a transaction you need to scan the QR code with the phone on which the installed Here Wallet:

Connect @here-wallet/connect

The easiest way to integrate Here Wallet

Here Wallet Connect integrates itself into the near-api-js library, so you don't have to add extra logic to work with the wallet.

Import here-wallet/connect into the main js/ts file of your project:

import * as near from "near-api-js"
import runHereWallet from "@here-wallet/connect"
import "@here-wallet/connect/index.css" // you need css loader

// Initialize here wallet bridge
runHereWallet({ near })

// You dont need change your code! js

Now all near-api-js calls that automatically redirect to wallet.near.org will open a built-in modal window in which the user can choose which wallet he wants to use to log in or upvote a transaction:

If you want to use only Here Wallet in your application, add only HERE: true to the library initializer:

runHereWallet({ near, onlyHere: true }) 

Advance. Change the near-api-js configuration

If you do not want to install unnecessary dependencies, you can simply change the configuration of near-api-js. This is done as follows:

import * as near from "near-api-js"

const config = {
    networkId: "mainnet",
    walletUrl: "https://web.herewallet.app", // <<< that!
    nodeUrl: "https://rpc.mainnet.near.org",
    helperUrl: "https://helper.mainnet.near.org",
    explorerUrl: "https://explorer.mainnet.near.org"
    keyStore: new keyStores.BrowserLocalStorageKeyStore(),
}

// Just keep using the near api just like you did before!
const initialize = async () => {
    const near = await connect(config)
    const wallet = new WalletConnection(near, "app");

    wallet.requestSignIn({
      contractId: "contract",
      methodNames: ["method"],
    });
}ja

Testnet

const config = {
    networkId: "testnet",
    walletUrl: "https://web.testnet.herewallet.app", // <<< this!
    // default testnet setup...
}

Result

If you have any questions about using our library, you can always email us at

github
The Here Wallet Connector
Logonpm: @here-wallet/connectnpm