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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@graviton-inc/xeenon-tokens-program-idl

v0.0.10

Published

TypeScript IDL (Interface Definition Language) for the Xeenon Tokens Program on Solana.

Readme

@graviton-inc/xeenon-tokens-program-idl

TypeScript IDL (Interface Definition Language) for the Xeenon Tokens Program on Solana.

Overview

This package provides the complete IDL definition for the Xeenon Tokens Program, a Solana program that enables token trading, borrowing, staking, and rewards distribution. The IDL is available in both JSON format and TypeScript types for easy integration with Solana development tools.

Features

  • Complete IDL Definition: Full interface definition for all program instructions, accounts, events, and types
  • TypeScript Support: Strongly typed definitions for all program structures
  • Solana Integration: Compatible with Anchor, Solana Web3.js, and other Solana development tools
  • Rewards System: Support for creator and staker rewards distribution
  • Trading Operations: Buy/sell operations with exact cash/token amounts
  • Borrowing System: Collateralized borrowing with debt management
  • Market Management: Market creation, configuration, and period management

Installation

npm install @graviton-inc/xeenon-tokens-program-idl

or

yarn add @graviton-inc/xeenon-tokens-program-idl

Usage

Basic Import

import { idl, Tokens } from '@graviton-inc/xeenon-tokens-program-idl';

// Use the IDL with Anchor
const program = new Program<Tokens>(idl, programId, provider);

// Use the TypeScript types
const marketAccount: Tokens['accounts'][0] = // ... your market account

Program ID

The Xeenon Tokens Program ID is:

XEENqbVXt8y94cH7WMwYyQSuDgkvzZTzEzpsWLZu7Jf

Key Instructions

Market Operations

  • initXeenonPosition: Create a user position in a market, required to stake and borrow

Trading Operations

  • buyWithExactCashIn: Buy tokens with exact cash amount
  • sellWithExactTokenIn: Sell tokens for exact cash amount

Staking & Borrowing

  • depositToken: Deposit tokens to stake
  • withdrawToken: Withdraw staked tokens
  • borrow: Borrow against staked collateral
  • repay: Repay borrowed amount

Rewards

  • claimCreatorRewards: Claim rewards for market creators
  • claimStakerRewards: Claim rewards for stakers
  • accruePositionRewards: Accrue rewards for positions for previous period. Needs to be called before depositToken, withdrawToken, or claimStakerRewards for every period that has passed and the position has been active.

Account Types

Core Accounts

  • xeenonMarket: Main market account with trading and staking data
  • xeenonMarketGroup: Market group configuration
  • xeenonPosition: User position in a market
  • xeenonMarketPeriod: Period-specific rewards of a market

Mayflower Integration

  • marketMeta: Market metadata and configuration
  • marketLinear: Linear market state and price curve
  • personalPosition: User's personal position data

Event Types

The program emits various events for tracking operations:

  • marketCreatedEvent: Market creation
  • depositEvent: Token deposits
  • withdrawEvent: Token withdrawals
  • borrowEvent: Borrowing operations
  • repayEvent: Repayment operations
  • buyWithExactCashInEvent: Buy operations
  • sellWithExactTokenInEvent: Sell operations
  • claimCreatorRewardsEvent: Creator reward claims
  • claimStakerRewardsEvent: Staker reward claims
  • marketPeriodClosedEvent: Period closure
  • floorRaisedEvent: Floor price updates

Error Codes

The program includes comprehensive error handling:

  • 6000: Insufficient Staked Balance
  • 6001: Insufficient Global Staked Balance
  • 6002: Invalid Mint Percentage Options
  • 6003: Invalid Creator Rewards Share Percentage
  • 6004: Invalid Closing Period
  • 6005: Borrow Power Exceeded
  • 6006: Insufficient Debt to Repay
  • 6007: Cannot withdraw collateral with outstanding debt
  • 6008: Invalid Period Provided
  • 6009: Invalid Next Period Provided
  • 6010: Period is not closed
  • 6011: Position period does not match market period
  • 6012: No rewards to claim
  • 6013: Arithmetic overflow

Development

Building

yarn build

Project Structure

src/
├── index.ts          # Main exports
├── tokens.ts         # TypeScript type definitions
└── tokens.json       # Raw IDL JSON

TypeScript Configuration

The project uses TypeScript 5.5.4 with strict type checking. The build process generates both JavaScript and TypeScript declaration files.

Integration Examples

With Anchor Framework

import { Program, AnchorProvider } from '@coral-xyz/anchor';
import { idl, Tokens } from '@graviton-inc/xeenon-tokens-program-idl';

const provider = AnchorProvider.env();
const program = new Program<Tokens>(idl, programId, provider);

// Initialize a market
await program.methods
  .initXeenonMarket({
    name: "My Token",
    symbol: "MTK",
    uri: "https://example.com/metadata.json",
    creatorRewardsSharePercentage: 10
  })
  .accounts({
    payer: wallet.publicKey,
    // ... other required accounts
  })
  .rpc();

With Solana Web3.js

import { Connection, PublicKey, Transaction } from '@solana/web3.js';
import { idl } from '@graviton-inc/xeenon-tokens-program-idl';

// Create instruction from IDL
const instruction = await program.methods
  .depositToken(new BN(1000000))
  .accounts({
    payer: wallet.publicKey,
    // ... other accounts
  })
  .instruction();

const transaction = new Transaction().add(instruction);

License

MIT License.

Support

For questions and support, please create an issue in this repository.

Related Links