Skip to main content

Install the SDK

npm install vowena
The SDK requires Node.js 18+ and has a peer dependency on @stellar/stellar-sdk ^15.0.1. If your project doesn’t already include it, install it alongside:
npm install vowena @stellar/stellar-sdk

Create a Client

The VowenaClient is the main entry point for all contract interactions. It builds transactions locally - you sign and submit them with your own wallet or keypair.
import { VowenaClient, NETWORKS } from "vowena";

const client = new VowenaClient({
  contractId: NETWORKS.testnet.contractId,
  rpcUrl: NETWORKS.testnet.rpcUrl,
  networkPassphrase: NETWORKS.testnet.networkPassphrase,
});

Network Configuration

The SDK ships with pre-configured network constants via the NETWORKS object.
import { VowenaClient, NETWORKS } from "vowena";

const client = new VowenaClient({
  contractId: NETWORKS.testnet.contractId,
  rpcUrl: NETWORKS.testnet.rpcUrl,
  networkPassphrase: NETWORKS.testnet.networkPassphrase,
});
PropertyValue
rpcUrlhttps://soroban-testnet.stellar.org
networkPassphraseTest SDF Network ; September 2015
contractIdPre-deployed testnet contract
usdcAddressTestnet USDC token contract

Exports

Classes & Functions

import {
  VowenaClient,        // Main client for all contract interactions
  toStroops,           // Convert human-readable amount to stroops (bigint)
  fromStroops,         // Convert stroops (bigint) to human-readable string
  getEvents,           // Fetch contract events from Soroban RPC
  VowenaEventPoller,   // Continuous event polling class
  NETWORKS,            // Pre-configured network constants
  USDC_DECIMALS,       // 7
  SECONDS_PER_DAY,     // 86400
  SECONDS_PER_MONTH,   // 2592000
  SECONDS_PER_YEAR,    // 31536000
} from "vowena";

Types

import type {
  Plan,                  // On-chain plan data
  Subscription,          // On-chain subscription data
  SubscriptionStatus,    // "active" | "paused" | "cancelled" | "expired"
  CreatePlanParams,      // Parameters for buildCreatePlan()
  VowenaClientOptions,   // Constructor options for VowenaClient
  TransactionResult,     // Result from submitTransaction()
  VowenaEvent,           // Parsed contract event
  EventPollerOptions,    // Constructor options for VowenaEventPoller
} from "vowena";

Requirements

DependencyVersion
Node.js18+
@stellar/stellar-sdk^15.0.1
The SDK is a lightweight wrapper that builds Soroban transactions. It does not hold private keys or sign transactions - that is handled by your wallet integration (e.g., Freighter, Albedo, or a raw Keypair).

Next Steps

Client Reference

Full API reference for every VowenaClient method.

Quickstart

Build a complete subscription lifecycle in 5 minutes.