@unseen_fi/sdk
v0.1.1
Published
Server-side SDK for Unseen Pay — privacy-preserving payments on Solana
Maintainers
Readme
@unseen_fi/sdk
Server-side SDK for Unseen Pay — privacy-preserving payments on Solana.
Install
npm install @unseen_fi/sdkQuick Start
import { UnseenClient } from "@unseen_fi/sdk";
const unseen = new UnseenClient({
apiKey: "usk_test_...", // from your Unseen dashboard
network: "devnet", // "mainnet" | "devnet"
});
// Create a payment session
const payment = await unseen.payments.create({
amount: 50_000_000, // 50 USDC (6 decimals)
reference: "order_123", // your order ID
description: "Premium Plan",
});
// Share checkoutUrl with your customer
// → "https://pay.unseen.finance/pay/pay_abc123"
console.log(payment.checkoutUrl);
// After customer pays & clicks "I have paid"
const result = await unseen.payments.verify(payment.id);
if (result.status === "confirmed") {
console.log("✅ Payment confirmed!", result.txSignature);
}API Reference
unseen.payments.create(input)
Create a new payment session. Returns a Payment with checkoutUrl.
unseen.payments.get(paymentId)
Get a single payment by ID.
unseen.payments.verify(paymentId)
Verify a payment on-chain. Returns { status, txSignature, confirmedAt }.
unseen.payments.list(filters?)
List payments with optional filters (status, reference, limit, cursor).
unseen.payments.cancel(paymentId)
Cancel a pending payment.
unseen.webhooks.verify(rawBody, signature, secret)
Verify that an incoming webhook was signed by Unseen.
unseen.me()
Get the authenticated merchant's profile.
