import { Address } from '@solana/addresses'; import { ReadonlyUint8Array } from '@solana/codecs-core'; import { AccountLookupMeta, AccountMeta } from './accounts'; /** * An instruction destined for a given program. * * @example * ```ts * type StakeProgramInstruction = Instruction<'StakeConfig11111111111111111111111111111111'>; * ``` */ export interface Instruction { readonly accounts?: TAccounts; readonly data?: ReadonlyUint8Array; readonly programAddress: Address; } /** * An instruction that loads certain accounts. * * @example * ```ts * type InstructionWithTwoAccounts = InstructionWithAccounts< * [ * WritableAccount, // First account * RentSysvar, // Second account * ] * >; * ``` */ export interface InstructionWithAccounts extends Instruction { readonly accounts: TAccounts; } export declare function isInstructionForProgram(instruction: TInstruction, programAddress: Address): instruction is TInstruction & { programAddress: Address; }; export declare function assertIsInstructionForProgram(instruction: TInstruction, programAddress: Address): asserts instruction is TInstruction & { programAddress: Address; }; export declare function isInstructionWithAccounts(instruction: TInstruction): instruction is InstructionWithAccounts & TInstruction; export declare function assertIsInstructionWithAccounts(instruction: TInstruction): asserts instruction is InstructionWithAccounts & TInstruction; /** * An instruction whose data conforms to a certain type. * * This is most useful when you have a branded `Uint8Array` that represents a particular * instruction's data. * * @example A type for the \`AdvanceNonce\` instruction of the System program * ```ts * type AdvanceNonceAccountInstruction< * TNonceAccountAddress extends string = string, * TNonceAuthorityAddress extends string = string, * > = Instruction<'11111111111111111111111111111111'> & * InstructionWithAccounts< * [ * WritableAccount, * ReadonlyAccount<'SysvarRecentB1ockHashes11111111111111111111'>, * ReadonlySignerAccount, * ] * > & * InstructionWithData; * ``` */ export interface InstructionWithData extends Instruction { readonly data: TData; } export declare function isInstructionWithData(instruction: TInstruction): instruction is InstructionWithData & TInstruction; export declare function assertIsInstructionWithData(instruction: TInstruction): asserts instruction is InstructionWithData & TInstruction; //# sourceMappingURL=instruction.d.ts.map