2.1.1 • Published 28 days ago

@solana/instructions v2.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
28 days ago

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.

2.1.1

2 months ago

2.1.0

4 months ago

2.0.0-rc.4

8 months ago

2.0.0

8 months ago

2.0.0-rc.2

8 months ago

2.0.0-rc.3

8 months ago

2.0.0-preview.4

1 year ago

2.0.0-rc.0

11 months ago

2.0.0-rc.1

11 months ago

2.0.0-preview.3

1 year ago

2.0.0-preview.2

1 year ago

2.0.0-preview.1

1 year ago