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

celora

v0.1.2

Published

A lightweight and fully-typed TypeScript SDK for interacting with the Celora Payment API. This package provides an easy and reliable way to create payments and check their finalization status.

Readme

celora

A lightweight and fully-typed TypeScript SDK for interacting with the Celora Payment API.
This package provides an easy and reliable way to create payments and check their finalization status.


Features

  • Clean and minimal OOP architecture
  • Written entirely in TypeScript
  • Secure API key handling
  • Fully typed responses and requests
  • No external dependencies

Installation

npm install celora

or

yarn add celora

Initialization

Import and initialize the SDK with your API key and base API URL.

import { Celora } from 'celora';

const celora = new Celora('YOUR_API_KEY', 'https://api.celora.com');

Create a Payment

The createPayment method creates a new payment session and returns a paymentAddr (the address to which the user should send funds).

const paymentAddress = await celora.createPayment({
  token: 'USDC',
  amount: '50',
  currency: 'usd',
  descriptions: 'Test purchase',
  isTransferFiat: false,
  redirectUrl: 'https://example.com/payment-success/:address'
});

console.log('Payment address:', paymentAddress);

Response Example

The API returns the following structure:

{
  "message": "Get payment successfully",
  "result": {
    "amount": "50",
    "currency": "usd",
    "finalized": false,
    "isTransfer": false,
    "redirectUrl": "https://example.com/payment-success",
    "expiredTime": 1730795400000,
    "descriptions": "Test purchase",
    "initialAmount": "50",
    "isTransferFiat": false,
    "depositedAmount": 0,
    "user": "653bd2c9e9a...",
    "token": "USDC",
    "status": "pending",
    "invoiceId": "INV-00001",
    "paymentAddr": "0x123456..."
  }
}

You only need to use paymentAddr from the result.


Check Payment Finalization

The checkFinalize method allows you to verify whether a payment is completed.

const finalized = await celora.checkFinalize(paymentAddr);
console.log('Is payment finalized:', finalized);

This method returns a boolean:

  • true if the payment has been finalized
  • false if the payment is still pending

It is recommended to create a route in your backend (for example /check-payment/:address) and use this function there to securely check the payment status for your users.


Types

CreatePaymentBody

{
  token: string;
  amount: string;
  currency: string;
  descriptions: string;
  isTransferFiat: boolean;
  redirectUrl: string;
}

IPayment

{
  amount: string;
  currency: string;
  finalized: boolean;
  isTransfer: boolean;
  redirectUrl: string;
  expiredTime: number;
  descriptions: string;
  initialAmount: string;
  isTransferFiat: boolean;
  depositedAmount: number;
  user: string;
  token: string;
  status: 'pending' | 'completed' | 'expired' | 'cancelled';
  invoiceId: string;
  paymentAddr: string;
}

Best Practices

  • Never expose your API key in frontend code. Always use it on the backend.
  • Always verify payment finalization on your server before confirming an order or providing access.
  • Use HTTPS for all redirect URLs to ensure security.
  • Store paymentAddr and invoiceId in your database for tracking and verification.

Example Workflow

  1. Initialize the SDK using your API key and base URL.
  2. Call createPayment to generate a new payment address.
  3. Display the returned address to the user or redirect them to the payment page.
  4. Create a backend route for checking payment status.
  5. Inside that route, use checkFinalize(address) to confirm whether the payment has been completed.
  6. Once finalized, update your database or mark the payment as complete.