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

@vowena/sdk

v0.1.5

Published

TypeScript SDK for the Vowena recurring payment protocol on Stellar

Readme

vowena

TypeScript SDK for the Vowena recurring payment protocol on Stellar. Build, simulate, and submit subscription transactions against the Vowena smart contract on Soroban.

npm version License CI TypeScript

Install

npm install @vowena/sdk

Quick start

import { VowenaClient } from "@vowena/sdk";

const client = new VowenaClient({
  contractId: "C...",
  rpcUrl: "https://soroban-testnet.stellar.org",
  networkPassphrase: "Test SDF Network ; September 2015",
});

// Read a plan
const plan = await client.getPlan(1, callerAddress);

// Build a subscribe transaction (returns XDR for wallet signing)
const tx = await client.buildSubscribe(subscriberAddress, planId);

Every build* method returns an assembled Soroban transaction as base64 XDR. Pass it to the user's wallet for signing, then submit:

const result = await client.submitTransaction(signedXdr);
console.log(result.hash, result.success);

API

Write methods

These return assembled transaction XDR (base64 string) ready for wallet signing.

| Method | Description | | ------------------------------------------------------- | ---------------------------------------------- | | buildCreatePlan(params) | Create a new subscription plan | | buildSubscribe(subscriber, planId) | Subscribe to a plan | | buildCharge(caller, subId) | Charge a subscription for the current period | | buildCancel(caller, subId) | Cancel a subscription | | buildRefund(merchant, subId, amount) | Refund a subscriber | | buildUpdatePlanAmount(merchant, planId, newAmount) | Update a plan's recurring amount | | buildRequestMigration(merchant, oldPlanId, newPlanId) | Request migration of subscribers to a new plan | | buildAcceptMigration(subscriber, subId) | Accept a pending migration | | buildRejectMigration(subscriber, subId) | Reject a pending migration | | buildReactivate(subscriber, subId) | Reactivate a cancelled subscription |

Read methods

These simulate the contract call and return parsed data directly.

| Method | Description | | ------------------------------------------------ | -------------------------------------- | | getPlan(planId, caller) | Fetch a plan by ID | | getSubscription(subId, caller) | Fetch a subscription by ID | | getMerchantPlans(merchant, caller) | List plan IDs for a merchant | | getSubscriberSubscriptions(subscriber, caller) | List subscription IDs for a subscriber | | getPlanSubscribers(planId, caller) | List subscription IDs for a plan |

Submit

| Method | Description | | ------------------------------ | ----------------------------------------------------- | | submitTransaction(signedXdr) | Submit a signed transaction and wait for confirmation |

Amount conversion

Amounts on the contract use stroops (7 decimal places). Use the included conversion utilities:

import { toStroops, fromStroops } from "@vowena/sdk";

const amount = toStroops("9.99"); // 99900000n
const display = fromStroops(99900000n); // "9.99"

Events

Poll for contract events using getEvents or the VowenaEventPoller class:

import { getEvents, VowenaEventPoller } from "@vowena/sdk";

// One-shot fetch
const { events, latestLedger } = await getEvents(
  rpcUrl,
  contractId,
  startLedger,
);

// Continuous polling
const poller = new VowenaEventPoller({
  contractId: "C...",
  rpcUrl: "https://soroban-testnet.stellar.org",
  onEvent: (event) => console.log(event.type, event.data),
  intervalMs: 5000,
});

await poller.start();
// later: poller.stop();

Constants

The SDK exports pre-configured network settings and time constants:

import {
  NETWORKS,
  USDC_DECIMALS,
  SECONDS_PER_DAY,
  SECONDS_PER_MONTH,
  SECONDS_PER_YEAR,
} from "@vowena/sdk";

console.log(NETWORKS.testnet.rpcUrl); // "https://soroban-testnet.stellar.org"

Keeper bot

The keeper/ directory contains a standalone billing automation bot that charges subscriptions on schedule. See keeper/ for details.

Links

Contributing

Contributions are welcome. Please read the contributing guide before opening a pull request.

License

Apache 2.0