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

@zebec-network/zebec-vault-sdk

v3.1.0

Published

An SDK for zebec vault solana program

Downloads

138

Readme

Zebec Vault Sdk

Installation

yarn add @zebec-network/zebec-vault-sdk
npm install @zebec-network/zebec-vault-sdk

Dependency Map

Vault SDK Dependency Map

Development

To build the package

yarn build

To run specific test filess

yarn test <test file path> -f "<regex for test name>"
// example:
// yarn test ./test/<filename>.test.ts

publish

Build package and bump package version to specific need and publish

npm publish --access public

Usage

Create Vault Instance

const network = "devnet";
const wallet = <Anchor wallet>;
const connection = <Connection Instance>;
const provider = createAnchorProvider(connection, wallet);
const service = await ZebecVaultService.create(provider, network);

Create Vault

const vaultKeypair = Keypair.generate();
console.log("Vault Keypair:", vaultKeypair.publicKey.toBase58());
const payload = await service.createVault({
	vaultKeypair,
});

const signature = await payload.execute({ commitment: "finalized" });
console.log("Signature:", signature);

Get Vault Info of User

const vaultsInfo = await service.getVaultsInfoOfUser(wallet.publicKey);
console.log("vaults info:", JSON.stringify(vaultsInfo, null, 2));
const vault = vaultsInfo[0].vault;

Deposit Sol

const vault = <vault public key>;
const amount = 2;
const payload = await service.depositSol({ amount, vault });
const signature = await payload.execute({ commitment: "finalized" });

Withdraw Sol

const vault = <vault public key>;
const amount = 0.01;
const payload = await service.withdrawSol({ amount, vault });
const signature = await payload.execute({ commitment: "finalized" });

Deposit Token

const tokenMint = "De31sBPcDejCVpZZh1fq8SNs7AcuWcBKuU3k2jqnkmKc";
const vault = <vault public key>;
const amount = 1000
const payload = await service.depositToken({ amount, vault, tokenMint });
const signature = await payload.execute({ commitment: "finalized" });

Withdraw Token

const vault = <vault public key>;
const tokenMint = "De31sBPcDejCVpZZh1fq8SNs7AcuWcBKuU3k2jqnkmKc";
const amount = 1;
const payload = await service.withdrawToken({ amount, vault, tokenMint });
const signature = await payload.execute({ commitment: "finalized" });

Execute Proposal Direct

const proposer = <wallet public key>;
const vault = <vault public key>;

const memoInstruction = new TransactionInstruction({
 keys: [],
 programId: MEMO_PROGRAM_ID,
 data: Buffer.from("This is test memo", "utf8"),
});
const actions = [memoInstruction];

const payload = await service.executeProposalDirect({
 actions,
 proposer,
 vault,
});

const signature = await payload.execute({ commitment: "finalized" });
console.log("Execute Proposal Direct Signature:", signature);

Create Proposal

const proposer = <wallet public key>;
const receiver = <wallet public Key>;
const vault = <vault public key>;

const [vaultSigner] = deriveVaultSigner(vault, service.programId);
const name = "Transfer Funds";
const ix = SystemProgram.transfer({
 fromPubkey: vaultSigner,
 toPubkey: receiver,
 lamports: Number(parseSol(1)),
});
const actions = [ix];
const proposalKeypair = Keypair.generate();

const createProposalPayload = await service.createProposal({
 actions,
 name,
 proposer,
 vault,
 proposalKeypair,
});

const signature = await createProposalPayload.execute({ commitment: "finalized" });

Append Actions

const proposal = <proposal public key>;

const ixB = new TransactionInstruction({
 keys: [],
 programId: MEMO_PROGRAM_ID,
 data: Buffer.from("This is test memo", "utf8"),
});
const actionsB = [ixB];

const appendActionsPayload = await service.appendActions({
 actions: actionsB,
 proposal,
});

const appendActionsSignature = await appendActionsPayload.execute({ commitment: "confirmed" });

Execute Proposal

const proposal = <proposal public key>;
const payload = await service.executeProposal({
   proposal,
});

const signature = await payload.execute({ commitment: "confirmed" });
console.log("Execute Proposal Signature:", signature);

Delete Proposal

const proposal = <proposal public key>;

const deleteProposalPayload = await service.deleteProposal({ proposal });
const deleteProposalSignature = await deleteProposalPayload.execute({
 commitment: "confirmed",
});
console.log("Delete Proposal Signature:", deleteProposalSignature);

Get Proposals Info of a Vault

const vault = <vault public key>;

const proposalsInfo = await service.getProposalsInfoOfVault(vault);

Get All Vaults Info

const vaultsInfo = await service.getAllVaultsInfo();