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

@memoo/memoo-sdk

v0.1.0

Published

An SDK for interacting with Memoo bonding curve programs on Solana

Downloads

16

Readme

Memoo SDK

An SDK for interacting with Memoo bonding curve programs on Solana.

Installation

npm install @memoo/memoo-sdk
# or
yarn add @memoo/memoo-sdk

Setup

The SDK supports multiple ways to initialize. The built-in IDL is recommended for the simplest setup:

Option 1: Using Built-in IDL (Recommended - Simplest)

The SDK includes the IDL by default, so you don't need to import it manually:

import { MemooSDK } from '@memoo/memoo-sdk'
import { Connection, PublicKey, Keypair } from '@solana/web3.js'
import { Wallet } from '@coral-xyz/anchor'

// Initialize connection and wallet
const connection = new Connection('https://api.mainnet-beta.solana.com')
const wallet = Keypair.generate() // or use your wallet

// Create SDK instance - IDL is built-in, no need to import!
const sdk = new MemooSDK({
	connection,
	wallet: wallet as unknown as Wallet, // Wallet for AnchorProvider
	programId: new PublicKey('YOUR_PROGRAM_ID'),
	globalMemeConfigId: new PublicKey('YOUR_GLOBAL_MEME_CONFIG_ID'),
	owner: wallet.publicKey,
	defaultDecimals: 9,
	metaDataPublicKey: new PublicKey(
		'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'
	),
	defaultPriorityFee: 1000000
})

Option 2: Using Custom IDL

If you need to use a custom IDL (e.g., for a different program version):

import { MemooSDK } from '@memoo/memoo-sdk'
import { Connection, PublicKey, Keypair } from '@solana/web3.js'
import { Wallet, Idl } from '@coral-xyz/anchor'
import IDL from './idl/memoo.json' // Your custom IDL file

// Initialize connection and wallet
const connection = new Connection('https://api.mainnet-beta.solana.com')
const wallet = Keypair.generate() // or use your wallet

// Create SDK instance with custom IDL
const sdk = new MemooSDK({
	connection,
	idl: IDL as Idl, // Your custom IDL definition
	wallet: wallet as unknown as Wallet, // Wallet for AnchorProvider
	programId: new PublicKey('YOUR_PROGRAM_ID'),
	globalMemeConfigId: new PublicKey('YOUR_GLOBAL_MEME_CONFIG_ID'),
	owner: wallet.publicKey,
	defaultDecimals: 9,
	defaultPriorityFee: 1000000
})

Option 3: Using Program Instance

Alternatively, you can create the program yourself and pass it to the SDK:

import { MemooSDK } from '@memoo/memoo-sdk'
import { Connection, PublicKey, Keypair } from '@solana/web3.js'
import { Program, AnchorProvider, Idl } from '@coral-xyz/anchor'
import { IDL } from '@memoo/memoo-sdk' // Or import your own IDL

// Initialize connection and wallet
const connection = new Connection('https://api.mainnet-beta.solana.com')
const wallet = Keypair.generate() // or use your wallet

// Initialize Anchor provider and program
const provider = new AnchorProvider(connection, wallet, {})
const program = new Program(IDL as Idl, provider)

// Create SDK instance with program
const sdk = new MemooSDK({
	connection,
	program, // Pre-created program instance
	programId: new PublicKey('YOUR_PROGRAM_ID'),
	globalMemeConfigId: new PublicKey('YOUR_GLOBAL_MEME_CONFIG_ID'),
	owner: wallet.publicKey,
	defaultDecimals: 9,
	metaDataPublicKey: new PublicKey(
		'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'
	),
	defaultPriorityFee: 1000000
})

Usage Examples

Register a Bonding Curve

const transaction = await sdk.registerBondingCurve({
	memeId: new PublicKey('YOUR_MEME_ID'),
	metadata: {
		name: 'My Token',
		symbol: 'MTK',
		uri: 'https://example.com/metadata.json'
	},
	amount: '1.0', // Optional: initial buy amount
	priorityFee: 0.001 // Optional priority fee in SOL
})

// Sign and send transaction
transaction.recentBlockhash = (await connection.getLatestBlockhash()).blockhash
transaction.feePayer = wallet.publicKey
const signedTx = await wallet.signTransaction(transaction)
const txId = await connection.sendRawTransaction(signedTx.serialize())

Buy Tokens

const transaction = await sdk.bondingCurveBuy({
	memeId: 'YOUR_MEME_ID', // Can be string or PublicKey
	amount: '0.5', // SOL amount to spend
	priorityFee: 0.001 // Optional priority fee in SOL
})

transaction.recentBlockhash = (await connection.getLatestBlockhash()).blockhash
transaction.feePayer = wallet.publicKey
const signedTx = await wallet.signTransaction(transaction)
const txId = await connection.sendRawTransaction(signedTx.serialize())

Sell Tokens

const transaction = await sdk.bondingCurveSell({
	memeId: 'YOUR_MEME_ID',
	amount: '1000', // Token amount to sell
	priorityFee: 0.001
})

transaction.recentBlockhash = (await connection.getLatestBlockhash()).blockhash
transaction.feePayer = wallet.publicKey
const signedTx = await wallet.signTransaction(transaction)
const txId = await connection.sendRawTransaction(signedTx.serialize())

Creator Claim

const transaction = await sdk.bondingCurveCreatorClaim({
	memeId: 'YOUR_MEME_ID'
})

transaction.recentBlockhash = (await connection.getLatestBlockhash()).blockhash
transaction.feePayer = wallet.publicKey
const signedTx = await wallet.signTransaction(transaction)
const txId = await connection.sendRawTransaction(signedTx.serialize())

Airdrop Claim

const transaction = await sdk.bondingCurveAirdropClaim({
	memeId: 'YOUR_MEME_ID',
	encoded: messageBytes, // Uint8Array
	signature: signatureBytes, // Uint8Array
	signerPublicKey: signerPubKey, // PublicKey
	addEd25519Instruction: true // Optional, default true
})

transaction.recentBlockhash = (await connection.getLatestBlockhash()).blockhash
transaction.feePayer = wallet.publicKey
const signedTx = await wallet.signTransaction(transaction)
const txId = await connection.sendRawTransaction(signedTx.serialize())

Yapper Claim

const transaction = await sdk.bondingCurveYapperClaim({
	memeId: 'YOUR_MEME_ID',
	encoded: messageBytes,
	signature: signatureBytes,
	signerPublicKey: signerPubKey,
	addEd25519Instruction: true
})

transaction.recentBlockhash = (await connection.getLatestBlockhash()).blockhash
transaction.feePayer = wallet.publicKey
const signedTx = await wallet.signTransaction(transaction)
const txId = await connection.sendRawTransaction(signedTx.serialize())

Get Exchange Rate

const rate = await sdk.getExchangeRate({
	memeId: 'YOUR_MEME_ID',
	amount: '1.0',
	from: 'SOL', // or "TOKEN"
	type: 'Buy' // or "Sell"
})

console.log('Exchange rate:', rate)

Fetch Bonding Curve Config

const config = await sdk.fetchBondingCurveConfig('YOUR_MEME_ID')

console.log('Total SOL:', config?.totalSol.toString())
console.log('Total Count:', config?.totalCount.toString())

Fetch Global Config

const globalConfig = await sdk.fetchGlobalConfig()

console.log(
	'Platform Fee Recipient:',
	globalConfig?.platformFeeRecipient.toString()
)
console.log('Total Supply:', globalConfig?.totalSupply.toString())

PDA Functions

The SDK provides helper functions for calculating PDAs:

import {
	getPdaBondingCurveState,
	getPdaGlobalBondingCurveConfig,
	getPdaPoolSolAuthority,
	getPdaBondingCurveMintAccountA,
	getPdaBondingCurvePoolAuthorityA,
	getPdaBondingCurveUserData,
	getPdaBondingCurveMetadata
} from '@memoo/memoo-sdk'

const programId = new PublicKey('YOUR_PROGRAM_ID')
const memeId = new PublicKey('YOUR_MEME_ID')

const bondingCurveState = getPdaBondingCurveState(programId, memeId)
const globalConfig = getPdaGlobalBondingCurveConfig(
	programId,
	globalMemeConfigId
)
// ... etc

Notes

  • The SDK requires an Anchor program instance to be passed in the config
  • All amounts should be provided as strings or numbers (will be converted internally)
  • The getExchangeRate method requires implementation of bonding curve calculation functions based on your specific formula (see TODO comments in code)
  • Priority fees are calculated automatically, but can be overridden
  • All transactions need to be signed and sent manually (SDK only creates the transactions)

Development

# Install dependencies
yarn install

# Build
yarn build

# Watch mode
yarn watch

# Run tests
yarn test

License

MIT