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

solinkify-sdk

v1.0.1

Published

Official SDK for Solinkify M2M & Merchant Gateway

Downloads

273

Readme

Solinkify SDK & Protocol ⚡

Solinkify is a decentralized payment infrastructure on the Solana network designed to bridge digital assets with Merchants (E-commerce) and Autonomous AI Agents (M2M).

This project combines Anchor Smart Contracts, a Rust (Axum) backend for off-chain scalability, and a plug-and-play JavaScript SDK.


🚀 Key Features

  1. DePIN Payment Gateway: Enables third-party merchants to accept SOL with an automated fee-splitting system.
  2. x402 Protocol (M2M): A new standard for AI agents to autonomously purchase digital assets.
  3. Solana Blinks Ready: Supports direct transaction integration via social media (Twitter/X).
  4. Idempotency & Security: Protection against Replay Attacks using on-chain and off-chain signature verification.

📦 SDK Installation

Use NPM or Yarn to integrate Solinkify into your project:

npm install solinkify-sdk

🛠 Integration Guide for Merchants (E-commerce)

Merchants can accept Solana payments without worrying about the complexities of building Web3 transactions.

Option A: Vanilla JavaScript / Node.js

Suitable for basic HTML or simple backend systems.

import { SolinkifyMerchant } from 'solinkify-sdk';

const merchant = new SolinkifyMerchant();

async function handlePayment() {
    // 1. Get a ready-to-use transaction from Solinkify
    const tx = await merchant.createPaymentTransaction(
        "YOUR_STORE_WALLET",
        "BUYER_WALLET",
        0.1,             // Amount in SOL
        "ORDER-12345"    // Order ID
    );

    // 2. Request buyer's wallet approval (Phantom, etc.)
    const provider = window.phantom?.solana;
    const { signature } = await provider.signAndSendTransaction(tx);
    
    console.log("Payment Successful! TxID:", signature);
}

Option B: React / Next.js (with Solana Wallet Adapter)

Direct integration into the checkout button in your modern frontend.

import { useWallet } from '@solana/wallet-adapter-react';
import { Connection } from '@solana/web3.js';
import { SolinkifyMerchant } from 'solinkify-sdk';

export default function CheckoutButton() {
    const { publicKey, sendTransaction } = useWallet();
    // Set to Devnet for the testing/development phase
    const connection = new Connection("[https://api.devnet.solana.com](https://api.devnet.solana.com)");

    const handleCheckout = async () => {
        if (!publicKey) return alert("Please connect your wallet first!");

        try {
            const merchantApi = new SolinkifyMerchant();
            
            // 1. Generate transaction from the Solinkify SDK
            const tx = await merchantApi.createPaymentTransaction(
                "YOUR_STORE_WALLET", 
                publicKey.toBase58(), 
                0.1, 
                "INV-REACT-001"
            );

            // 2. Execute transaction via the DApp's built-in Wallet Adapter
            const signature = await sendTransaction(tx, connection);
            alert(`Payment Successful! TxID: ${signature}`);
            
        } catch (error) {
            console.error("Payment failed:", error);
        }
    };

    return (
        <button 
            onClick={handleCheckout} 
            style={{ background: '#9945FF', color: 'white', padding: '10px 20px', borderRadius: '8px', cursor: 'pointer' }}
        >
            Pay 0.1 SOL (Devnet) via Phantom
        </button>
    );
}

🤖 Integration Guide for AI Agents (M2M Autonomy)

Solinkify's x402 Protocol enables AI to purchase data or APIs autonomously without human intervention. The SDK handles HTTP 402 Payment Required negotiation, blockchain payments, and cryptographic verification behind the scenes.

import { SolinkifyAgent } from 'solinkify-sdk';

// Initialize with AI Private Key (Base58)
const agent = new SolinkifyAgent("YOUR_AI_PRIVATE_KEY_BASE58");

async function buyDigitalAsset() {
    try {
        // Automated: Get Invoice -> Pay On-Chain -> Cryptographic Sign -> Download URL
        const downloadUrl = await agent.purchaseAndDownload("DIGITAL_ASSET_ID");
        console.log("✅ Asset successfully purchased. Download link:", downloadUrl);
    } catch (error) {
        console.error("❌ Failed to purchase asset:", error.message);
    }
}

⛓ Protocol Information (On-Chain)

  • Program ID: AaKvuhidmnrpXdHi762sJ1xZ5TrjragS9Y6ikwFVp1tr
  • Network: Solana Devnet (Testing Phase)
  • Gateway Tokenomics (DePIN):
    • Base Fee: 1% (Minimum: 0.00015 SOL, Maximum Cap: 0.05 SOL).
    • Revenue Split: 75% forwarded to Node Operators, 25% forwarded to Solinkify Admin.

🌐 API Reference (Off-Chain)

Base URL: https://api.solinkify.com/

| Endpoint | Method | Description | | :--- | :--- | :--- | | /gateway/create-payment | POST | Creates an unsigned M2M transaction with fee-splitting instructions for the Merchant. | | /x402/book/:id | GET | Requests an invoice or downloads the asset (Requires 3 Security Headers). | | /actions/buy/:id | GET/POST | Native endpoint for the Solana Blinks standard. | | /books | GET | Fetches the list of digital assets that are live in the database. |


🛡 Security (Security Headers)

If you are not using the SolinkifyAgent module and are making API calls manually, you must include these 3 headers in the second GET request (after the on-chain payment is complete) to claim the file:

  1. x-payment-signature: The TxID (Signature) of your SOL transfer proof on the Solana network.
  2. x-buyer-pubkey: The Public Key of the wallet used for the payment.
  3. x-auth-signature: A cryptographic signature (Ed25519) of a message containing the string ${book_id}:${signature} using the buyer's private key.

📄 License

Distributed under the ISC License.


Solinkify - Empowering the Machine-to-Machine Economy on Solana. Website | API Dashboard