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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sqds/mesh

v1.0.6

Published

An SDK for easily interacting with Squads Mesh Program

Downloads

558

Readme

Squads Mesh Program SDK

This package provides classes and utilities to make it easier to interact with the Squads Mesh Program.

Contents

Get started

import Squads from "@sqds/mesh";

// By default, the canonical Program IDs for Squads Mesh Program will be used
// The 'wallet' passed in will be the signer/feePayer on all transactions through the Squads object.
const squads = Squads.localnet(wallet); // or Squads.devnet(...); Squads.mainnet(...)

const multisigAccount = await squads.createMultisig(externalAuthority, threshold, createKey, members);

Generally you will want to import the default Squads class from @sqds/mesh and pass in a Wallet instance. This would come from your preferred client-side wallet adapter or would likely be a NodeWallet if running server-side.

This class gives you access to essentially all instructions on the main Squads Mesh program.

For more information about the instructions and program capabilities, see the https://github.com/squads-protocol/squads-mpl README.

Important Classes

Squads

This class has an extensive interface covering instructions from both the main Squads-MPL program and the ProgramManager program. It is configured with a wallet, connection-related parameters, and program IDs. All operations that originate from the instance will use these parameters to send RPC requests, submit Transactions and pay fees.

Getters

Some of the methods on Squads are simple 'getters' which take an address (of something like a Multisig or an MsTransaction) and return the deserialized account data.

const multisigAccount = await squads.getMultisig(...);
const multisigAccounts = await squads.getMultisigs([...]);
const msTransaction = await squads.getTransaction(...);
// etc.

Immediate Instructions

Other methods immediately execute an instruction against one of the configured program IDs and often return relevant account data.

const multisigAccount = await squads.createMultisig(...);
const msInstruction = await squads.addInstruction(...);
const msTransaction = await squads.executeTransaction(...);
// etc.

Built Instructions

For most 'immediate' instructions, there is an alternate form which does not execute the instruction, but instead returns it so that the caller can handle wrapping it in a Transaction and sending it to the cluster. These can be identified by the prefix build in front of the immediate counterpart.

const createMultisigInstruction = await squads.buildCreateMultisig(...);
const addInstructionInstruction = await squads.buildAddInstruction(...);
const executeTransactionInstruction = await squads.buildExecuteTransaction(...);

const tx = new Transaction(...);
tx.add(createMultisigInstruction, addInstructionInstruction, executeTransactionInstruction);
await squads.wallet.signTransaction(tx);
await sendAndConfirmTransaction(...);
// etc.