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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zerohash-sdk/capacitor

v1.0.3

Published

Capacitor plugin bridging zerohash's native iOS and Android SDKs

Readme

@zerohash-sdk/capacitor

Capacitor plugin for embedding zerohash's Fund (deposit) flow into your iOS and Android app. It wraps the native zerohash iOS and Android SDKs and presents their Fund UI over your app.

Install

npm install @zerohash-sdk/capacitor
npx cap sync

Requirements

  • iOS 15+
  • Android minSdkVersion 24+

Setup

Android

The plugin's Android side pulls in the native zerohash Android SDK (com.github.zerohash-ext:zerohash-android), which is hosted on JitPack. Add JitPack to your app's Gradle repositories so it can be resolved:

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}

On newer Gradle setups that use dependencyResolutionManagement, add the same maven { ... } line to that block in settings.gradle instead.

iOS

No extra steps — npx cap sync wires the native SDK in automatically via Swift Package Manager.

Usage

import { Zerohash } from '@zerohash-sdk/capacitor';

// Register listeners before presenting.
await Zerohash.addListener('fundCompleted', (event) => {
  console.log('Deposit complete', event);
});
await Zerohash.addListener('close', () => console.log('Flow closed'));
await Zerohash.addListener('error', (e) => console.error(e.code, e.message));

// Present the Fund flow. The JWT is a short-lived Fund session token your
// backend mints from the zerohash API.
await Zerohash.presentFund({
  jwt: '<fund-session-jwt>',
  environment: 'production', // or 'sandbox'
  theme: 'system', // 'light' | 'dark' | 'system'
});

Use Zerohash.cancel() to dismiss the flow programmatically, Zerohash.isActive() to check whether it's currently presented, and Zerohash.removeAllListeners() when tearing down.

API

presentFund(...)

presentFund(options: PresentFundOptions) => Promise<void>

Present the Fund (deposit) flow. Rejects if a session is already active.

| Param | Type | | ------------- | ----------------------------------------------------------------- | | options | PresentFundOptions |


cancel()

cancel() => Promise<void>

Dismiss the active Fund session, if any.


isActive()

isActive() => Promise<{ isActive: boolean; }>

Whether a Fund session is currently presented.

Returns: Promise<{ isActive: boolean; }>


addListener('close', ...)

addListener(eventName: 'close', listenerFunc: () => void) => Promise<PluginListenerHandle>

The user closed the Fund flow.

| Param | Type | | ------------------ | -------------------------- | | eventName | 'close' | | listenerFunc | () => void |

Returns: Promise<PluginListenerHandle>


addListener('error', ...)

addListener(eventName: 'error', listenerFunc: (event: ZerohashErrorEvent) => void) => Promise<PluginListenerHandle>

The Fund flow reported an error.

| Param | Type | | ------------------ | ------------------------------------------------------------------------------------- | | eventName | 'error' | | listenerFunc | (event: ZerohashErrorEvent) => void |

Returns: Promise<PluginListenerHandle>


addListener('event', ...)

addListener(eventName: 'event', listenerFunc: (event: GenericEvent) => void) => Promise<PluginListenerHandle>

A low-level event was forwarded from the Fund flow.

| Param | Type | | ------------------ | ------------------------------------------------------------------------- | | eventName | 'event' | | listenerFunc | (event: GenericEvent) => void |

Returns: Promise<PluginListenerHandle>


addListener('fundCompleted', ...)

addListener(eventName: 'fundCompleted', listenerFunc: (event: FundCompletedEvent) => void) => Promise<PluginListenerHandle>

A deposit completed successfully.

| Param | Type | | ------------------ | ------------------------------------------------------------------------------------- | | eventName | 'fundCompleted' | | listenerFunc | (event: FundCompletedEvent) => void |

Returns: Promise<PluginListenerHandle>


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners registered by this plugin.


Interfaces

PresentFundOptions

| Prop | Type | Description | | ----------------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | jwt | string | Short-lived Fund session JWT, minted by your backend from the zerohash API. | | environment | ZerohashEnvironment | Defaults to production. | | theme | ZerohashTheme | Defaults to system. | | allowList | string[] | Restrict the hosts the embedded WebView may load. Android only — passing it on iOS rejects the call. |

PluginListenerHandle

| Prop | Type | | ------------ | ----------------------------------------- | | remove | () => Promise<void> |

ZerohashErrorEvent

Payload of the error event.

| Prop | Type | | ------------- | ------------------- | | code | string | | message | string |

GenericEvent

Payload of the low-level event events forwarded from the Fund flow.

| Prop | Type | | ---------- | ---------------------------------------- | | type | string | | data | { [key: string]: unknown; } |

FundCompletedEvent

Payload of the fundCompleted event, emitted when a deposit completes. Any field the flow does not provide is null.

| Prop | Type | | -------------------- | --------------------------- | | depositAddress | string | null | | network | string | null | | assetSymbol | string | null | | amount | string | null | | transactionId | string | null | | fundId | string | null | | notionalAmount | string | null |

Type Aliases

ZerohashEnvironment

Which zerohash environment the Fund session runs against.

'sandbox' | 'production'

ZerohashTheme

Colour scheme for the Fund UI. system follows the device setting.

'light' | 'dark' | 'system'