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

xtrader-sdk

v0.0.4-dev

Published

Javascript SDK for the xTrader Protocol

Readme

xtrader-sdk

Javascript SDK for the xTrader Blockchain Program on Solana

powered by solana

xTrader Blockchain Program

xtrader program

Install SDK

npm i xtrader-sdk

Import

import xtrader from 'xtrader-sdk';

Methods

xtrader.Create
xtrader.Execute
xtrader.Cancel
xtrader.Received
xtrader.Sent
xtrader.Find
xtrader.Fetch
xtrader.Fee
xtrader.Send
xtrader.Status
xtrader.Sns

Examples

Setup Example

import { Keypair } from "@solana/web3.js";
const rpc = "https://staked.helius-rpc.com?api-key=YOUR-KEY";
const secret = [1,2,3,4,5,~];
const signer = Keypair.fromSecretKey(new Uint8Array(secret));

Create Offer

const tx = await xtrader.Create({
    rpc: rpc,
    priority: "Medium", // priority fee level
    convert: true, // true because we're passing decimal values below
    seller: "7Z3LJB2rxV4LiRBwgwTcufAWxnFTVJpcoCMiCo8Z5Ere",
    token1Mint: "Xsc9qvGR1efVDFGLrVsmkzv3qi45LTBjeUKSPmx9qEh",
    token1Amount: "0.001",
    buyer: "B8owyFUUu46g8Z4JNZMXmLSc2D725zv6fcXuBewGeTyj",
    token2Mint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    token2Amount: "0.007",
    memo: "", // optional reference also applied to accepted offer tx
});
if(tx.tx){
    tx.tx.sign([signer]);
    const signature = await xtrader.Send(rpc,tx.tx);
    console.log("signature", signature);
    console.log("awaiting status...");
    const status = await xtrader.Status(rpc,signature);
    if(status!="finalized"){console.log(status);}
    else{
        console.log(status);
        const offer = await xtrader.Fetch({
            rpc:rpc, display:true, offer:tx.offer
        });
        console.log(offer);
    }
}
else{
    console.log(tx);
}

Cancel Offer

const tx = await xtrader.Cancel({
    rpc: rpc,
    offer: "2jcih7dUFmEQfMUXQQnL2Fkq9zMqj4jwpHqvRVe3gGLL" // offer id
});
if(typeof tx.status!="undefined"){console.log(tx);}
else{
    tx.sign([signer]);
    const signature = await xtrader.Send(rpc,tx);
    console.log("signature", signature);
    console.log("awaiting status...");
    const status = await xtrader.Status(rpc,signature);
    console.log(status);
}

Execute Offer

const tx = await xtrader.Execute({
    rpc: rpc,
    offer: "3pjxfm25WWwD9BcWSqBFamJKYgEpNAnEz8mEmxk9biBQ",
    buyer: "B8owyFUUu46g8Z4JNZMXmLSc2D725zv6fcXuBewGeTyj"
});
if(typeof tx.status!="undefined"){console.log(tx);}
else{
    tx.sign([signer]);
    const signature = await xtrader.Send(rpc,tx);
    console.log("signature", signature);
    console.log("awaiting status...");
    const status = await xtrader.Status(rpc,signature);
    console.log(status);
}

Received Offers

const received = await xtrader.Received({
    rpc: rpc,
    display: true,
    wallet: "B8owyFUUu46g8Z4JNZMXmLSc2D725zv6fcXuBewGeTyj"
});
console.log(received);

Sent Offers

const sent = await xtrader.Sent({
    rpc: rpc,
    display: true,
    wallet: "7Z3LJB2rxV4LiRBwgwTcufAWxnFTVJpcoCMiCo8Z5Ere"
});
console.log(sent);

Fetch Offer Details

returns an offers's details

const offer = await xtrader.Fetch({
    rpc: rpc,
    display: true,
    offer: "DUjEPTHQsUizXcyfix5iEnxvU6vMxU6EJW4FEHs9Xgrb",
});
console.log(offer);

Get Base Fee

get the base offer fee

const fee = await xtrader.Fee({
    rpc: rpc, 
    display: true, // true = sol, false = lamports
});
console.log(fee);