sbv2-solana/programs/anchor-feed-parser/src/generated/instructions/readResult.ts

70 lines
1.6 KiB
TypeScript

/**
* This code was GENERATED using the solita package.
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
*
* See: https://github.com/metaplex-foundation/solita
*/
import * as beet from '@metaplex-foundation/beet'
import * as web3 from '@solana/web3.js'
/**
* @category Instructions
* @category ReadResult
* @category generated
*/
const readResultStruct = new beet.BeetArgsStruct<{
instructionDiscriminator: number[] /* size: 8 */
}>(
[['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)]],
'ReadResultInstructionArgs'
)
/**
* Accounts required by the _readResult_ instruction
* @category Instructions
* @category ReadResult
* @category generated
*/
export type ReadResultInstructionAccounts = {
aggregator: web3.PublicKey
}
const readResultInstructionDiscriminator = [
130, 229, 115, 203, 180, 191, 240, 90,
]
/**
* Creates a _ReadResult_ instruction.
*
* @param accounts that will be accessed while the instruction is processed
*
* @category Instructions
* @category ReadResult
* @category generated
*/
export function createReadResultInstruction(
accounts: ReadResultInstructionAccounts
) {
const { aggregator } = accounts
const [data] = readResultStruct.serialize({
instructionDiscriminator: readResultInstructionDiscriminator,
})
const keys: web3.AccountMeta[] = [
{
pubkey: aggregator,
isWritable: false,
isSigner: false,
},
]
const ix = new web3.TransactionInstruction({
programId: new web3.PublicKey(
'3Y2v9gVaFAKTDqcxxs8oSRWV8K9ctkCB8yiC6KA4sFz5'
),
keys,
data,
})
return ix
}