npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@helium/wallet-link

v4.12.1-alpha.0

Published

Utilities for linking a 3rd party app to the helium wallet.

Downloads

619

Readme

@helium/wallet-link

Utilities for linking a 3rd party app to the helium wallet. The link token is used for hotspot onboarding, location assertion, and ownership transfer transaction signing with the Helium Wallet and Hotspot apps.

Installation

React Native

$ yarn add @helium/wallet-link @helium/crypto-react-native
$ yarn add --dev patch-package postinstall-postinstall
# or
$ npm install @helium/wallet-link @helium/crypto-react-native
$ npm install --save-dev patch-package

When using this library in React Native you must patch the @helium/crypto calls with @helium/crypto-react-native. You can do this using patch-package by adding the following file to your React Native root at /patches/@helium+wallet-link+4.6.1.patch.

diff --git a/node_modules/@helium/wallet-link/build/walletLink.js b/node_modules/@helium/wallet-link/build/walletLink.js
index 5378554..de9d701 100644
--- a/node_modules/@helium/wallet-link/build/walletLink.js
+++ b/node_modules/@helium/wallet-link/build/walletLink.js
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
 exports.createUpdateHotspotUrl = exports.createSignHotspotCallbackUrl = exports.createLinkWalletCallbackUrl = exports.createWalletLinkUrl = exports.parseWalletLinkToken = exports.verifyWalletLinkToken = exports.makeAppLinkAuthToken = void 0;
 /* eslint-disable object-curly-newline */
 const address_1 = __importDefault(require("@helium/address"));
-const crypto_1 = require("@helium/crypto");
+const crypto_1 = require("@helium/crypto-react-native");
 const query_string_1 = __importDefault(require("query-string"));
 const date_fns_1 = require("date-fns");
 const types_1 = require("./types");

In your package.json add the following script to run the patch on postinstall:

 "scripts": {
+  "postinstall": "patch-package"
 }

Lastly run yarn or npm install and the patch will be installed.

Browser or other JS environments

$ yarn add @helium/wallet-link @helium/crypto
# or
$ npm install @helium/wallet-link @helium/crypto

Usage

// Create link to Helium app
const url = createWalletLinkUrl({
  universalLink: 'https://wallet.helium.com/',
  requestAppId: 'com.maker.app',
  callbackUrl: 'makerappscheme://',
  appName: 'Maker App',
})

Linking.openURL(url)

// parse received token
const parsed = parseWalletLinkToken(token)

// verify token
const verified = verifyWalletLinkToken(parsed)

// verify token with max age
const verified = verifyWalletLinkToken(parsed, { maxAgeInSeconds: 60 })

// Create link to update a hotspot
const updateParams = {
  token,
  platform: Platform.OS,
  addGatewayTxn: 'your_optional_unsigned_txn',
  assertLocationTxn: 'your_optional_unsigned_txn',
  transferHotspotTxn: 'your_optional_unsigned_txn',
  configurationMessage: 'your_optional_configuration_msg',
} as SignHotspotRequest

const url = createUpdateHotspotUrl(updateParams)
Linking.openURL(url)

// submit signed txn