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

@malloc-protocol/spl

v1.0.17

Published

Malloc SPL contains standard actions, such as swapping, LP depositing, farming, and lending, which integrate with Malloc.

Readme

Malloc SPL

Malloc SPL contains standard actions, such as swapping, LP depositing, farming, and lending, which integrate with Malloc.

Installation

yarn add @malloc-protocol/spl

General Usage

Usage, all that needs to be done to use the SPL is to pass in MallocSPLBuildActionMap to the malloc sdk when building and compiling. So, for example:

import { MallocSPLBuildActionMap } from '@malloc-protocol/spl'

// Do some stuff here like define the construction and creating malloc

await malloc.build(<myConstruction>, MallocSPLBuildActionMap, <opts>)

Then, when building your construction actions, you would want to use splConstants to get the UIDs and PIDs. The current splConstants map looks like

const splConstants = {
  BUILD_ACTION_UIDS: {
    TRANSFER: TransferAction.actionTypeUID,
    RAYDIUM_SWAP: RaydiumSwapAction.actionTypeUID,
    RAYDIUM_LP_DEPOSIT: RaydiumLPDepositAction.actionTypeUID,
    RAYDIUM_LP_STAKE: RaydiumLPStakeAction.actionTypeUID,
    SOLEND_LP_DEPOSIT: SolendLpDepositAction.actionTypeUID,
  },
  HELPER_UIDS: {
    RAYDIUM_SWAP: RaydiumSwapAction,
  },
  PIDS: {
    DEVNET: { CPI_ACTION: CPI_ACTION_PID },
    MAINNET: {
      CPI_ACTION: CPI_ACTION_PID,
      RAYDIUM_SWAP: CPI_ACTION_PID,
      RAYDIUM_LP_DEPOSIT: CPI_ACTION_PID,
      RAYDIUM_LP_STAKE: CPI_ACTION_PID,
      SOLEND_LP_DEPOSIT: CPI_ACTION_PID,
    },
  },
};

So, say you wanted to build a swap action, you would do,

action: {
	actionPID: splConstants.PIDS.MAINNET.CPI_ACTION,
	actionTypeUID: splConstants.BUILD_ACTION_UIDS.RAYDIUM_LP_DEPOSIT,
	inputs: {
		// some input here
	},
	nextActions: yourNextActions,
},

Action Details

| Action Type | Number of expected in mints | number of out mints | | --- | --- | ----------- | | RAYDIUM_SWAP | 1 (a token to swap from) | 1 (a token to swap to) | | RAYDIUM_LP_DEPOSIT | 2 (the tokens in the LP) | 1 (the LP's share token) | | RAYDIUM_LP_STAKE (farming) | 1 (a LP's share tokens) | 0 | | SOLEND_LP_DEPOSIT | 1 (the input token into the liquidity pool) | 1 (the LP's share tokens) | | TRANSFER | 1 (the token to be transferred) | 0 |

Raydium Swapping

A raydium swap expects one type of token to be inputted (i.e. the actions pointing to a swap must all share the same mint). It outputs 1 token.

The expected input is one of the following

{
	outMint: PublicKey | string
}

In this case, the action will attempt to find a liquidity pool which across the input mint to the output mint.

The other options is to specify a liquidity pool.

{
	liquidityPool: LiquidityPoolKeys
}

LiquidityPoolKeys is defined in the typescript package @raydium-io/raydium-sdk which can be used to select specific liquidity pools to swap across.

Raydium LP Depositing

A raydium LP deposit expects two different distinct prior token types: 1 for each side of the LP pool. The action outputs 1 token -- the Liquidity Pool Token.

The input can be {hasFarm?: boolean}. In this case, the action will attempt to find a liquidity pool. If hasFarm is true, then it will only look for LPs with an associated farm.

Otherwise, the liquidity pool can be specified by passing in

{
	liquidityPool: LiquidityPoolKeys
}

See the section on Raydium Swaps for more information on LiquidityPoolKeys

Raydium LP Staking/ farming

A raydium LP farm action expects 1 prior token, the liquidity pool token. It does not output any tokens. The action will default to reward accounts being the derived token account. If these token accounts do not yet exist, Malloc will create them.

The input can either be empty, in which the action attempts to find a farm for the input token LP account. Otherwise

{ farmPoolKeys: FarmPoolKeys }

can be specified. Again, FarmPoolKeys is defined in the typescript package @raydium-io/raydium-sdk which can be used to select a specific farm.

Specifying Reward Accounts

{ rewardTokenAccounts: (PublicKey | string)[] }

can also be specified to overwrite the default token accounts for rewards.

Solend Liquidity Depositing

Solend liquidity depositing expects 1 prior token. It outputs 1 token corresponding to the LP share token. The action expects no input and automatically attempts to find the market associated to the input token.

Transferring Fungible Tokens

Transferring expects 1 input token type. The input is expected to be

{ recipientWallet: string | PublicKey }

The transfer action then transfers tokens to the account associated with the recipient and the input token mint. If an associated account does not yet exist, Malloc will create one for the recipient.

Interested in creating an action or want to request an action?

Reach out to us on our Discord