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

stella-verifier-sdk

v2.0.1

Published

Ultra-simplified SDK for STELLA Reward transaction submission - get developer apps and submit transactions with network-per-function approach

Readme

STELLA Verifier SDK v2.0.1

Ultra-simplified SDK for STELLA Reward transaction submission. Get developer app IDs and submit transactions for tracking with just two core functions.

🚀 Features

  • Network-per-function - Explicit testnet/mainnet selection
  • Auto app ID extraction - API extracts app ID from transaction memo
  • Core functionality only - Simple, focused API
  • TypeScript support - Full type safety and IntelliSense
  • React hooks - Easy frontend integration
  • Automatic retries - Built-in error handling
  • Validation utilities - Input validation helpers

📦 Installation

npm install stella-verifier-sdk

🎯 Quick Start

Basic Usage

import { StellaVerifier } from 'stella-verifier-sdk';

// Initialize SDK (no network needed in constructor)
const verifier = new StellaVerifier({
  timeout: 30000,
  retryAttempts: 3,
  debug: true
});

// Get developer's apps from testnet
const testnetApps = await verifier.getAppsByDeveloper({
  address: 'GAFTF57BRPZR23B23CMZVLOGGIJM5ND2DD7QU7P6QAHPFSGNNYIL5G2V',
  network: 'testnet'
});

console.log('Testnet apps:', testnetApps);
// Output: [{ appId: "B43A94D3B612-418E-9DF5", appName: "My DeFi Platform", owner: "GAFT...", createdAt: 1696000000 }]

// Get developer's apps from mainnet
const mainnetApps = await verifier.getAppsByDeveloper({
  address: 'GAFTF57BRPZR23B23CMZVLOGGIJM5ND2DD7QU7P6QAHPFSGNNYIL5G2V',
  network: 'mainnet'
});

// Submit a testnet transaction (app ID extracted automatically from memo)
const testnetResult = await verifier.submitTransaction({
  txHash: 'cf1bee75d4ac0a216cdd4fa826831424a6d86b345698cfee0a5e9979eb7b946a',
  network: 'testnet'
});

if (testnetResult.success) {
  console.log(`Testnet: Fee charged ${testnetResult.feeCharged} XLM for app ${testnetResult.appId}!`);
}

// Submit a mainnet transaction
const mainnetResult = await verifier.submitTransaction({
  txHash: 'cf1bee75d4ac0a216cdd4fa826831424a6d86b345698cfee0a5e9979eb7b946a',
  network: 'mainnet'
});

if (mainnetResult.success) {
  console.log(`Mainnet: Fee charged ${mainnetResult.feeCharged} XLM for app ${mainnetResult.appId}!`);
}

React Integration

import { useStellaVerifier } from 'stella-verifier-sdk/react';

function MyComponent() {
  const { 
    getAppsByDeveloper, 
    submitTransaction, 
    validateStellarAddress,
    validateTransactionHash,
    isLoading, 
    error 
  } = useStellaVerifier({
    timeout: 30000,
    debug: true
  });

  const handleGetApps = async () => {
    const apps = await getAppsByDeveloper({
      address: walletAddress,
      network: 'testnet'
    });
    
    console.log('Developer apps:', apps);
  };

  const handleSubmit = async () => {
    const result = await submitTransaction({
      txHash: transactionHash,
      network: 'testnet'
    });
    
    if (result.success) {
      alert(`Transaction submitted! Fee: ${result.feeCharged} XLM`);
    }
  };

  return (
    <div>
      <button onClick={handleGetApps} disabled={isLoading}>
        {isLoading ? 'Loading...' : 'Get My Apps'}
      </button>
      <button onClick={handleSubmit} disabled={isLoading}>
        {isLoading ? 'Submitting...' : 'Submit Transaction'}
      </button>
    </div>
  );
}

📚 API Reference

StellaVerifier Class

Constructor

new StellaVerifier(config?: StellaVerifierConfig)

Parameters:

  • config.timeout? - Request timeout in ms (default: 60000)
  • config.retryAttempts? - Retry attempts (default: 3)
  • config.debug? - Enable debug logging (default: false)

Note: Network is specified per function call, not in constructor.

Core Methods

getAppsByDeveloper()
await verifier.getAppsByDeveloper({
  address: string,
  network: 'testnet' | 'mainnet'
}): Promise<AppInfo[]>

Get all apps created by a developer.

Parameters:

  • address - Stellar address of the developer
  • network - Network to query ('testnet' or 'mainnet')

Returns: Array of app information objects:

{
  appId: string;        // UUID-style App ID
  appName: string;      // Human-readable app name
  owner: string;        // Developer's Stellar address
  createdAt: number;    // Registration timestamp
}[]
submitTransaction()
await verifier.submitTransaction({
  txHash: string,
  network: 'testnet' | 'mainnet'
}): Promise<SubmissionResult>

Submit a transaction for tracking and reward processing. The API automatically extracts the app ID from the transaction memo.

Parameters:

  • txHash - 64-character transaction hash
  • network - Network to submit against ('testnet' or 'mainnet')

Returns:

{
  success: boolean;                    // Whether submission was successful
  transactionHash: string;             // Transaction hash that was submitted
  appId: string;                       // App ID extracted from transaction memo
  feeCharged?: string;                 // Fee charged in XLM (if successful)
  volume?: string;                     // Volume in XLM (if successful)
  feeChargedStroops?: string;          // Fee charged in stroops (if successful)
  volumeStroops?: string;              // Volume in stroops (if successful)
  message: string;                     // Success/error message
  error?: string;                      // Error details (if failed)
  errorCode?: string;                  // Error code for programmatic handling
  timestamp: string;                   // Submission timestamp
}

Utility Methods

validateStellarAddress()
verifier.validateStellarAddress(address: string): boolean

Validate Stellar address format.

validateTransactionHash()
verifier.validateTransactionHash(txHash: string): boolean

Validate transaction hash format (64 hexadecimal characters).

getConfig()
verifier.getConfig(): Required<StellaVerifierConfig>

Get current SDK configuration.

🎨 React Hooks

useStellaVerifier()

const {
  getAppsByDeveloper,
  submitTransaction,
  validateStellarAddress,
  validateTransactionHash,
  isLoading,
  error,
  verifier
} = useStellaVerifier({
  timeout?: number,
  retryAttempts?: number,
  debug?: boolean,
  autoInit?: boolean
});

Features:

  • Automatic loading states
  • Error handling
  • Retry logic
  • TypeScript support

🌐 Network Configuration

The SDK uses a unified API endpoint for both testnet and mainnet:

  • API URL: https://stellarrewards.xyz/api
  • Network handling: API internally differentiates between testnet and mainnet based on the network parameter
  • No additional configuration needed

🛡️ Error Handling

import { StellaVerifierError, ERROR_CODES } from 'stella-verifier-sdk';

try {
  const result = await verifier.submitTransaction({
    txHash: 'invalid-hash',
    network: 'testnet'
  });
} catch (error) {
  if (error instanceof StellaVerifierError) {
    switch (error.code) {
      case ERROR_CODES.INVALID_TRANSACTION_HASH:
        console.log('Invalid transaction hash format');
        break;
      case ERROR_CODES.TRANSACTION_NOT_FOUND:
        console.log('Transaction not found on the Stellar network');
        break;
      case ERROR_CODES.INVALID_ADDRESS:
        console.log('Invalid Stellar address format');
        break;
      default:
        console.log('Unknown error:', error.message);
    }
  }
}

🔄 Migration from v1.x

Breaking Changes

  1. Network parameter moved: From constructor to individual function calls
  2. Simplified API: Removed non-core methods (registerApp, getAppStats, etc.)
  3. Auto app ID extraction: submitTransaction no longer requires appId parameter
  4. Function renamed: verifyTransaction → submitTransaction

Migration Guide

// ❌ Old v1.x syntax
const verifier = new StellaVerifier({ network: 'testnet' });
const result = await verifier.verifyTransaction({
  transactionHash: 'hash',
  appId: 'app-id'
});

// ✅ New v2.0.1 syntax
const verifier = new StellaVerifier();
const result = await verifier.submitTransaction({
  txHash: 'hash',
  network: 'testnet'
});

📖 Examples

Complete Integration Example

import { StellaVerifier } from 'stella-verifier-sdk';

async function integrateStellaRewards() {
  const verifier = new StellaVerifier({ debug: true });
  
  // Get developer's apps
  const apps = await verifier.getAppsByDeveloper({
    address: 'GAFTF57BRPZR23B23CMZVLOGGIJM5ND2DD7QU7P6QAHPFSGNNYIL5G2V',
    network: 'testnet'
  });
  
  console.log(`Found ${apps.length} apps:`, apps);
  
  // Submit a transaction
  const result = await verifier.submitTransaction({
    txHash: 'cf1bee75d4ac0a216cdd4fa826831424a6d86b345698cfee0a5e9979eb7b946a',
    network: 'testnet'
  });
  
  if (result.success) {
    console.log(`✅ Transaction submitted!`);
    console.log(`📊 App ID: ${result.appId}`);
    console.log(`💰 Fee charged: ${result.feeCharged} XLM`);
    console.log(`📈 Volume: ${result.volume} XLM`);
  } else {
    console.log(`❌ Submission failed: ${result.message}`);
  }
}

🔧 Development

# Install dependencies
npm install

# Build the package
npm run build

# Run tests
npm test

# Lint code
npm run lint

📄 License

MIT License - see LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests.

📞 Support


Version: 2.0.1
API Endpoint: https://stellarrewards.xyz/api
Network Support: Testnet & Mainnet
License: MIT