import { BeetArgsStruct, FixableBeetArgsStruct, bignum, bool, bytes, u16, u32, u64, u8, uniformFixedSizeArray, } from '@metaplex-foundation/beet' import * as beetSolana from '@metaplex-foundation/beet-solana' import { PublicKey } from '@solana/web3.js' /** * Represents the address type as a fixed-size array of 32 bytes. */ export const AddressType = uniformFixedSizeArray(u8, 32) /** * Offset for message type. */ export const MSG_TYPE_OFFSET = 0 /** * Enum representing different message types. */ export enum MessageType { /** * Vanilla message type. */ VANILLA = 1, /** * Composed message type. */ COMPOSED_TYPE = 2, } /** * Interface representing the parameters for LzReceive. */ export interface LzReceiveParams { /** * Source EID. */ srcEid: number /** * Sender address (size: 32). */ sender: number[] /* size: 32 */ /** * Nonce value. */ nonce: bignum /** * GUID (size: 32). */ guid: number[] /* size: 32 */ /** * Message content. */ message: Uint8Array /** * Caller parameters. */ callerParams: Uint8Array } /** * Struct for serializing and deserializing LzReceiveParams. */ export const LzReceiveParamsBeet = new FixableBeetArgsStruct( [ ['srcEid', u32], ['sender', uniformFixedSizeArray(u8, 32)], ['nonce', u64], ['guid', uniformFixedSizeArray(u8, 32)], ['message', bytes], ['callerParams', bytes], ], 'LzReceiveParams' ) /** * pub from: Pubkey, pub to: Pubkey, pub guid: [u8; 32], pub index: u16, pub message: Vec, pub extra_data: Vec, **/ /** * Interface representing the parameters for LzCompose. */ export interface LzComposeParams { /** * Sender public key. */ from: PublicKey /** * Recipient public key. */ to: PublicKey /** * GUID (size: 32). */ guid: number[] /* size: 32 */ /** * Index value. */ index: number /** * Message content. */ message: Uint8Array /** * Extra data. */ extraData: Uint8Array } /** * Struct for serializing and deserializing LzComposeParams. * * @category userTypes * @category generated */ export const LzComposeParamsBeet = new FixableBeetArgsStruct( [ ['from', beetSolana.publicKey], ['to', beetSolana.publicKey], ['guid', uniformFixedSizeArray(u8, 32)], ['index', u16], ['message', bytes], ['extraData', bytes], ], 'LzComposeParams' ) /** * Interface representing an LzReceive account. */ export interface LzReceiveAccount { /** * Public key of the account. */ pubkey: PublicKey /** * Indicates if the account is a signer. */ isSigner: boolean /** * Indicates if the account is writable. */ isWritable: boolean } /** * Struct for serializing and deserializing LzReceiveAccount. * * @category userTypes * @category generated */ export const LzReceiveAccountBeet = new BeetArgsStruct( [ ['pubkey', beetSolana.publicKey], ['isSigner', bool], ['isWritable', bool], ], 'LzReceiveAccount' ) /** * Enum representing different executor option types. */ export enum ExecutorOptionType { /** * Placeholder option type. */ PlaceHolder = 0, /** * LzReceive option type. */ LzReceive = 1, /** * NativeDrop option type. */ NativeDrop = 2, /** * LzCompose option type. */ LzCompose = 3, /** * OrderExecution option type. */ OrderExecution = 4, } /** * Maximum length for executor option types. */ export const MaxExecutorOptionTypeLength = 10