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

@threefold/extension_api

v0.0.1-rc10

Published

`tf-wallet-connector-api` is a npm package which allows to easily interact with **`tf-wallet-connector-extension`** by exposing an interface which will be clarified below.

Downloads

107

Readme

Threefold wallet connector API

tf-wallet-connector-api is a npm package which allows to easily interact with tf-wallet-connector-extension by exposing an interface which will be clarified below.

Install

Exactly like any regular npm package you can go ahead and install it with yarn or npm as follow

# Using yarn
yarn add @threefold/extension_api

# Using npm
npm install @threefold/extension_api

Usage

Api package doesn't require any special configuration or api key just import it and go.

import { ThreefoldWalletConnectorApi } from '@threefold/extension_api'
import type {
  KeypairType,
  NetworkOptions,
  PublicAccount,
  SignReturn,
  Unsubscribe
} from '@threefold/extension_api'

// Go ahead and use it (note: check blow for api details)
console.log('API', ThreefoldWalletConnectorApi)

API Details

Note: All methods in api are static you don't need to initialize an instance from api constructor.

Here is a list of the available api methods:

| Method | Description | | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | isInstalledSync(): boolean | Checks whether the extension is installed or no. if not installed and the document.readyState !== complete will log a warn and returns false. | | isInstalled(): Promise<boolean> | Same as isInstalledSync but awaits window.onload. (Recommended) | | hasAccess(): Promise<boolean> | Checks whether this website granted access permission from the extension or no. | | requestAccess(): Promise<boolean> | Same as hasAccess but if the user doesn't have access it will show a popup requesting the user to allow that specific website to get access permission. | | selectAccount(network?: string \| string[]): Promise<PublicAccount \| null> | Select a decrypted account from the user accounts list. | | getPublicAccounts(network?: string \| string[]): Promise<Account[]> | Fetch all visible (aka. public) accounts from the extension. (note: seed is encrypted) | | listenToPublicAccounts(listener: (accounts: Account[], error?: string) => void): Unsubscribe | Same as getPublicAccounts but continually listen to public accountss changes. | | listenToAuthList(listener: (list: AuthList) => void): Unsubscribe | Allows to listen to changed applied to auth list. | | requestDecryptedAccount(mnemonic: string, network?: string \| string[]): Promise<string \| null> | Request a specific mnemonic to be decrypted. shows a popup for the user asking him to enter his account password in order to decrypt his account. | | selectDecryptedAccount(): Promise<Account \| null> | Shows a popup with all the user accounts and asks him to pick an account and enter his password in order to decrypt it's seed and returns it back. | | sign(content: string, mnemonic: string, keypairType: KeypairType): Promise<SignReturn \| null> | signs your content using your mnemonic. |