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

lamden_wallet_controller

v0.7.6

Published

An ES6 helper Class for handling the Lamden Wallet's broswer event interface.

Downloads

5

Readme

lamden_wallet_controller 0.6.3

An ES6 helper Class for handling the Lamden Wallet's broswer event interface.

walletController.js

constructor([connectionRequest])

Lamden Wallet Controller Class

This Class interfaces with the Lamden Wallet's content script. It provids helper methods for creating a connection, getting wallet info, sending transactions and retreiving tx information.

The connection information for your DAPP can be supplied now or later by calling "sendConnection" manually.

IMPORTANT: The window object needs to be available when creating this instance as it will attempt to create listeners.

Parameters

| Name | Type | Description | | | ---- | ---- | ----------- | -------- | | connectionRequest | Object | A connection request object | Optional | | connectionRequest.appName | string | The name of your dApp |   | | connectionRequest.version | string | Connection version. Older version will be over-written in the uers's wallet. |   | | connectionRequest.contractName | string | The smart contract your DAPP will transact to |   | | connectionRequest.networkType | string | Which Lamden network the approval is for (mainnet or testnet) are the only options |   | | connectionRequest.networkName | string | Name of a Lamden Network, leave blank for legacy Lamden, use "arko" for the new Lamden Network | Optional | | connectionRequest.logo | string | The reletive path of an image on your webserver to use as a logo for your Lamden Wallet Linked Account |   | | connectionRequest.background | string | The reletive path of an image on your webserver to use as a background for your Lamden Wallet Linked Account | Optional | | connectionRequest.charms.name | string | Charm name | Optional | | connectionRequest.charms.variableName | string | Smart contract variable to pull data from | Optional | | connectionRequest.charms.key | string | Key assoicated to the value you want to lookup | Optional | | connectionRequest.charms.formatAs | string | What format the data is | Optional | | connectionRequest.charms.iconPath | string | An icon to display along with your charm | Optional |

Returns
  • WalletController

getInfo()

Creates a "lamdenWalletGetInfo" CustomEvent to ask the Lamden Wallet for the current information. This will fire the "newInfo" events.on event

Returns
  • Void

walletIsInstalled()

Check if the Lamden Wallet extention is installed in the user's broswer.

This will fire the "newInfo" events.on event

Returns
  • Promise Wallet is Installed.

storeConnectionRequest(connectionRequest)

Store connectionRequest information but don't sent If the connectionRequest object wasn't supplied to the construtor then it can be supplied or updated here

Parameters

| Name | Type | Description | | | ---- | ---- | ----------- | -------- | | connectionRequest | Object | A connection request object |   |

Returns

sendConnection([connectionRequest])

Send a connection to the Lamden Wallet for approval. If the connectionRequest object wasn't supplied to the construtor then it must be supplied here.

This will fire the "newInfo" events.on event

Parameters

| Name | Type | Description | | | ---- | ---- | ----------- | -------- | | connectionRequest | Object | A connection request object | Optional | | connectionRequest.appName | string | The name of your dApp |   | | connectionRequest.version | string | Connection version. Older version will be over-written in the uers's wallet. |   | | connectionRequest.contractName | string | The smart contract your dApp will transact through |   | | connectionRequest.networkType | string | Which Lamden network the approval is for (Mainnet or testnet) |   | | connectionRequest.networkName | string | Name of a Lamden Network, leave blank for legacy Lamden, use "arko" for the new Lamden Network | Optional | | connectionRequest.background | string | A reletive path to an image to override the default lamden wallet account background | Optional | | connectionRequest.logo | string | A reletive path to an image to use as a logo in the Lamden Wallet |   | | connectionRequest.charms.name | string | Charm name | Optional | | connectionRequest.charms.variableName | string | Smart contract variable to pull data from | Optional | | connectionRequest.charms.key | string | Key assoicated to the value you want to lookup | Optional | | connectionRequest.charms.formatAs | string | What format the data is | Optional | | connectionRequest.charms.iconPath | string | An icon to display along with your charm | Optional |

Returns
  • Promise The User's Lamden Wallet Account details or errors from the wallet

sendTransaction(tx[, callback])

Creates a "lamdenWalletSendTx" event to send a transaction request to the Lamden Wallet. If a callback is specified here then it will be called with the transaction result.

This will fire the "txStatus" events.on event

Parameters

| Name | Type | Description | | | ---- | ---- | ----------- | -------- | | tx | Object | A connection request object |   | | tx.networkType | string | Which Lamden network the tx is for (Mainnet or testnet) |   | | tx.networkName | string | Name of a Lamden Network, leave blank for legacy Lamden, use "arko" for the new Lamden Network | Optional | | tx.stampLimit | string | The max Stamps this tx is allowed to use. Cannot be more but can be less. |   | | tx.methodName | string | The method on your approved smart contract to call |   | | tx.kwargs | Object | A keyword object to supply arguments to your method |   | | callback | Function | A function that will called and passed the tx results. | Optional |

Returns
  • Void

constructor(connectionRequest)

Wallet Connection Request Class

Validates and stores the information from a connectionRequest object. See WalletController constructor for connection request params.

Parameters

| Name | Type | Description | | | ---- | ---- | ----------- | -------- | | connectionRequest | Object | - request object |   |

Returns
  • WalletConnectionRequest

getInfo()

Get a JSON string of the approval request information

Returns
  • string - JSON string of all request information

Documentation generated with doxdox.