Socket
Socket
Sign inDemoInstall

@solana/instructions

Package Overview
Dependencies
0
Maintainers
13
Versions
957
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/instructions

Helpers for creating transaction instructions


Version published
Weekly downloads
3.3K
decreased by-72.15%
Maintainers
13
Created
Weekly downloads
 

Readme

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

Last updated on 09 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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc