/** * 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 '@convergence-rfq/beet' import * as web3 from '@solana/web3.js' /** * @category Instructions * @category RegisterMint * @category generated */ export const registerMintStruct = new beet.BeetArgsStruct<{ instructionDiscriminator: number[] /* size: 8 */ }>( [['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)]], 'RegisterMintInstructionArgs' ) /** * Accounts required by the _registerMint_ instruction * * @property [_writable_, **signer**] authority * @property [] protocol * @property [_writable_] mintInfo * @property [] baseAsset * @property [] mint * @category Instructions * @category RegisterMint * @category generated */ export type RegisterMintInstructionAccounts = { authority: web3.PublicKey protocol: web3.PublicKey mintInfo: web3.PublicKey baseAsset: web3.PublicKey mint: web3.PublicKey systemProgram?: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const registerMintInstructionDiscriminator = [ 242, 43, 74, 162, 217, 214, 191, 171, ] /** * Creates a _RegisterMint_ instruction. * * @param accounts that will be accessed while the instruction is processed * @category Instructions * @category RegisterMint * @category generated */ export function createRegisterMintInstruction( accounts: RegisterMintInstructionAccounts, programId = new web3.PublicKey('FqAhTZg86EKEzeWMLtutVDRXJuLWrey7oDHr3Au6RFdo') ) { const [data] = registerMintStruct.serialize({ instructionDiscriminator: registerMintInstructionDiscriminator, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.authority, isWritable: true, isSigner: true, }, { pubkey: accounts.protocol, isWritable: false, isSigner: false, }, { pubkey: accounts.mintInfo, isWritable: true, isSigner: false, }, { pubkey: accounts.baseAsset, isWritable: false, isSigner: false, }, { pubkey: accounts.mint, isWritable: false, isSigner: false, }, { pubkey: accounts.systemProgram ?? web3.SystemProgram.programId, isWritable: false, isSigner: false, }, ] if (accounts.anchorRemainingAccounts != null) { for (const acc of accounts.anchorRemainingAccounts) { keys.push(acc) } } const ix = new web3.TransactionInstruction({ programId, keys, data, }) return ix }