Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@solana/instructions

Package Overview
Dependencies
Maintainers
13
Versions
1361
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/instructions

Helpers for creating transaction instructions

  • 2.0.0-experimental.fbdf21a
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20K
decreased by-8.97%
Maintainers
13
Weekly downloads
 
Created
Source

npm npm-downloads semantic-release
code-style-prettier

@solana/instructions

This package contains types for creating transaction instructions. It can be used standalone, but it is also exported as part of the Solana JavaScript SDK @solana/web3.js@experimental.

Types

IAccountMeta<TAddress>

This type represents an account's address and metadata about its mutability and whether it must be a signer of the transaction.

Typically, you will use one of its subtypes.

isSignerisWritable
ReadonlyAccount<TAddress>
WritableAccount<TAddress>
ReadonlySignerAccount<TAddress>
WritableSignerAccount<TAddress>

For example, you could type the rent sysvar account like this:

type RentSysvar = ReadonlyAccount<'SysvarRent111111111111111111111111111111111'>;

Instruction<TProgramAddress, TAccounts, TData>

Use this to define the structure of a transaction instruction.

type InitializeStakeInstruction = Instruction<
    // Program address
    'StakeConfig11111111111111111111111111111111',
    // Accounts
    [
        WritableAccount, // Stake account
        RentSysvar
    ],
    // Data
    InitializeStakeInstructionData
>;

Instructions that do not require data may omit the TData type parameter.

Keywords

FAQs

Package last updated on 29 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc