// Code generated by https://github.com/daog1/solana-anchor-go. DO NOT EDIT.

package pump

import (
	ag_binary "github.com/gagliardetto/binary"
	ag_solanago "github.com/gagliardetto/solana-go"
)

type BondingCurve struct {
	VirtualTokenReserves uint64
	VirtualSolReserves   uint64
	RealTokenReserves    uint64
	RealSolReserves      uint64
	TokenTotalSupply     uint64
	Complete             bool
	Creator              ag_solanago.PublicKey
}

func (obj BondingCurve) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
	// Serialize `VirtualTokenReserves` param:
	err = encoder.Encode(obj.VirtualTokenReserves)
	if err != nil {
		return err
	}
	// Serialize `VirtualSolReserves` param:
	err = encoder.Encode(obj.VirtualSolReserves)
	if err != nil {
		return err
	}
	// Serialize `RealTokenReserves` param:
	err = encoder.Encode(obj.RealTokenReserves)
	if err != nil {
		return err
	}
	// Serialize `RealSolReserves` param:
	err = encoder.Encode(obj.RealSolReserves)
	if err != nil {
		return err
	}
	// Serialize `TokenTotalSupply` param:
	err = encoder.Encode(obj.TokenTotalSupply)
	if err != nil {
		return err
	}
	// Serialize `Complete` param:
	err = encoder.Encode(obj.Complete)
	if err != nil {
		return err
	}
	// Serialize `Creator` param:
	err = encoder.Encode(obj.Creator)
	if err != nil {
		return err
	}
	return nil
}

func (obj *BondingCurve) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
	// Deserialize `VirtualTokenReserves`:
	err = decoder.Decode(&obj.VirtualTokenReserves)
	if err != nil {
		return err
	}
	// Deserialize `VirtualSolReserves`:
	err = decoder.Decode(&obj.VirtualSolReserves)
	if err != nil {
		return err
	}
	// Deserialize `RealTokenReserves`:
	err = decoder.Decode(&obj.RealTokenReserves)
	if err != nil {
		return err
	}
	// Deserialize `RealSolReserves`:
	err = decoder.Decode(&obj.RealSolReserves)
	if err != nil {
		return err
	}
	// Deserialize `TokenTotalSupply`:
	err = decoder.Decode(&obj.TokenTotalSupply)
	if err != nil {
		return err
	}
	// Deserialize `Complete`:
	err = decoder.Decode(&obj.Complete)
	if err != nil {
		return err
	}
	// Deserialize `Creator`:
	err = decoder.Decode(&obj.Creator)
	if err != nil {
		return err
	}
	return nil
}

type CollectCreatorFeeEvent struct {
	Timestamp  int64
	Creator    ag_solanago.PublicKey
	CreatorFee uint64
}

func (obj CollectCreatorFeeEvent) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
	// Serialize `Timestamp` param:
	err = encoder.Encode(obj.Timestamp)
	if err != nil {
		return err
	}
	// Serialize `Creator` param:
	err = encoder.Encode(obj.Creator)
	if err != nil {
		return err
	}
	// Serialize `CreatorFee` param:
	err = encoder.Encode(obj.CreatorFee)
	if err != nil {
		return err
	}
	return nil
}

func (obj *CollectCreatorFeeEvent) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
	// Deserialize `Timestamp`:
	err = decoder.Decode(&obj.Timestamp)
	if err != nil {
		return err
	}
	// Deserialize `Creator`:
	err = decoder.Decode(&obj.Creator)
	if err != nil {
		return err
	}
	// Deserialize `CreatorFee`:
	err = decoder.Decode(&obj.CreatorFee)
	if err != nil {
		return err
	}
	return nil
}

type CompleteEvent struct {
	User         ag_solanago.PublicKey
	Mint         ag_solanago.PublicKey
	BondingCurve ag_solanago.PublicKey
	Timestamp    int64
}

func (obj CompleteEvent) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
	// Serialize `User` param:
	err = encoder.Encode(obj.User)
	if err != nil {
		return err
	}
	// Serialize `Mint` param:
	err = encoder.Encode(obj.Mint)
	if err != nil {
		return err
	}
	// Serialize `BondingCurve` param:
	err = encoder.Encode(obj.BondingCurve)
	if err != nil {
		return err
	}
	// Serialize `Timestamp` param:
	err = encoder.Encode(obj.Timestamp)
	if err != nil {
		return err
	}
	return nil
}

func (obj *CompleteEvent) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
	// Deserialize `User`:
	err = decoder.Decode(&obj.User)
	if err != nil {
		return err
	}
	// Deserialize `Mint`:
	err = decoder.Decode(&obj.Mint)
	if err != nil {
		return err
	}
	// Deserialize `BondingCurve`:
	err = decoder.Decode(&obj.BondingCurve)
	if err != nil {
		return err
	}
	// Deserialize `Timestamp`:
	err = decoder.Decode(&obj.Timestamp)
	if err != nil {
		return err
	}
	return nil
}

type CompletePumpAmmMigrationEvent struct {
	User             ag_solanago.PublicKey
	Mint             ag_solanago.PublicKey
	MintAmount       uint64
	SolAmount        uint64
	PoolMigrationFee uint64
	BondingCurve     ag_solanago.PublicKey
	Timestamp        int64
	Pool             ag_solanago.PublicKey
}

func (obj CompletePumpAmmMigrationEvent) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
	// Serialize `User` param:
	err = encoder.Encode(obj.User)
	if err != nil {
		return err
	}
	// Serialize `Mint` param:
	err = encoder.Encode(obj.Mint)
	if err != nil {
		return err
	}
	// Serialize `MintAmount` param:
	err = encoder.Encode(obj.MintAmount)
	if err != nil {
		return err
	}
	// Serialize `SolAmount` param:
	err = encoder.Encode(obj.SolAmount)
	if err != nil {
		return err
	}
	// Serialize `PoolMigrationFee` param:
	err = encoder.Encode(obj.PoolMigrationFee)
	if err != nil {
		return err
	}
	// Serialize `BondingCurve` param:
	err = encoder.Encode(obj.BondingCurve)
	if err != nil {
		return err
	}
	// Serialize `Timestamp` param:
	err = encoder.Encode(obj.Timestamp)
	if err != nil {
		return err
	}
	// Serialize `Pool` param:
	err = encoder.Encode(obj.Pool)
	if err != nil {
		return err
	}
	return nil
}

func (obj *CompletePumpAmmMigrationEvent) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
	// Deserialize `User`:
	err = decoder.Decode(&obj.User)
	if err != nil {
		return err
	}
	// Deserialize `Mint`:
	err = decoder.Decode(&obj.Mint)
	if err != nil {
		return err
	}
	// Deserialize `MintAmount`:
	err = decoder.Decode(&obj.MintAmount)
	if err != nil {
		return err
	}
	// Deserialize `SolAmount`:
	err = decoder.Decode(&obj.SolAmount)
	if err != nil {
		return err
	}
	// Deserialize `PoolMigrationFee`:
	err = decoder.Decode(&obj.PoolMigrationFee)
	if err != nil {
		return err
	}
	// Deserialize `BondingCurve`:
	err = decoder.Decode(&obj.BondingCurve)
	if err != nil {
		return err
	}
	// Deserialize `Timestamp`:
	err = decoder.Decode(&obj.Timestamp)
	if err != nil {
		return err
	}
	// Deserialize `Pool`:
	err = decoder.Decode(&obj.Pool)
	if err != nil {
		return err
	}
	return nil
}

type CreateEvent struct {
	Name                 string
	Symbol               string
	Uri                  string
	Mint                 ag_solanago.PublicKey
	BondingCurve         ag_solanago.PublicKey
	User                 ag_solanago.PublicKey
	Creator              ag_solanago.PublicKey
	Timestamp            int64
	VirtualTokenReserves uint64
	VirtualSolReserves   uint64
	RealTokenReserves    uint64
	TokenTotalSupply     uint64
}

func (obj CreateEvent) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
	// Serialize `Name` param:
	err = encoder.Encode(obj.Name)
	if err != nil {
		return err
	}
	// Serialize `Symbol` param:
	err = encoder.Encode(obj.Symbol)
	if err != nil {
		return err
	}
	// Serialize `Uri` param:
	err = encoder.Encode(obj.Uri)
	if err != nil {
		return err
	}
	// Serialize `Mint` param:
	err = encoder.Encode(obj.Mint)
	if err != nil {
		return err
	}
	// Serialize `BondingCurve` param:
	err = encoder.Encode(obj.BondingCurve)
	if err != nil {
		return err
	}
	// Serialize `User` param:
	err = encoder.Encode(obj.User)
	if err != nil {
		return err
	}
	// Serialize `Creator` param:
	err = encoder.Encode(obj.Creator)
	if err != nil {
		return err
	}
	// Serialize `Timestamp` param:
	err = encoder.Encode(obj.Timestamp)
	if err != nil {
		return err
	}
	// Serialize `VirtualTokenReserves` param:
	err = encoder.Encode(obj.VirtualTokenReserves)
	if err != nil {
		return err
	}
	// Serialize `VirtualSolReserves` param:
	err = encoder.Encode(obj.VirtualSolReserves)
	if err != nil {
		return err
	}
	// Serialize `RealTokenReserves` param:
	err = encoder.Encode(obj.RealTokenReserves)
	if err != nil {
		return err
	}
	// Serialize `TokenTotalSupply` param:
	err = encoder.Encode(obj.TokenTotalSupply)
	if err != nil {
		return err
	}
	return nil
}

func (obj *CreateEvent) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
	// Deserialize `Name`:
	err = decoder.Decode(&obj.Name)
	if err != nil {
		return err
	}
	// Deserialize `Symbol`:
	err = decoder.Decode(&obj.Symbol)
	if err != nil {
		return err
	}
	// Deserialize `Uri`:
	err = decoder.Decode(&obj.Uri)
	if err != nil {
		return err
	}
	// Deserialize `Mint`:
	err = decoder.Decode(&obj.Mint)
	if err != nil {
		return err
	}
	// Deserialize `BondingCurve`:
	err = decoder.Decode(&obj.BondingCurve)
	if err != nil {
		return err
	}
	// Deserialize `User`:
	err = decoder.Decode(&obj.User)
	if err != nil {
		return err
	}
	// Deserialize `Creator`:
	err = decoder.Decode(&obj.Creator)
	if err != nil {
		return err
	}
	// Deserialize `Timestamp`:
	err = decoder.Decode(&obj.Timestamp)
	if err != nil {
		return err
	}
	// Deserialize `VirtualTokenReserves`:
	err = decoder.Decode(&obj.VirtualTokenReserves)
	if err != nil {
		return err
	}
	// Deserialize `VirtualSolReserves`:
	err = decoder.Decode(&obj.VirtualSolReserves)
	if err != nil {
		return err
	}
	// Deserialize `RealTokenReserves`:
	err = decoder.Decode(&obj.RealTokenReserves)
	if err != nil {
		return err
	}
	// Deserialize `TokenTotalSupply`:
	err = decoder.Decode(&obj.TokenTotalSupply)
	if err != nil {
		return err
	}
	return nil
}

type ExtendAccountEvent struct {
	Account     ag_solanago.PublicKey
	User        ag_solanago.PublicKey
	CurrentSize uint64
	NewSize     uint64
	Timestamp   int64
}

func (obj ExtendAccountEvent) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
	// Serialize `Account` param:
	err = encoder.Encode(obj.Account)
	if err != nil {
		return err
	}
	// Serialize `User` param:
	err = encoder.Encode(obj.User)
	if err != nil {
		return err
	}
	// Serialize `CurrentSize` param:
	err = encoder.Encode(obj.CurrentSize)
	if err != nil {
		return err
	}
	// Serialize `NewSize` param:
	err = encoder.Encode(obj.NewSize)
	if err != nil {
		return err
	}
	// Serialize `Timestamp` param:
	err = encoder.Encode(obj.Timestamp)
	if err != nil {
		return err
	}
	return nil
}

func (obj *ExtendAccountEvent) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
	// Deserialize `Account`:
	err = decoder.Decode(&obj.Account)
	if err != nil {
		return err
	}
	// Deserialize `User`:
	err = decoder.Decode(&obj.User)
	if err != nil {
		return err
	}
	// Deserialize `CurrentSize`:
	err = decoder.Decode(&obj.CurrentSize)
	if err != nil {
		return err
	}
	// Deserialize `NewSize`:
	err = decoder.Decode(&obj.NewSize)
	if err != nil {
		return err
	}
	// Deserialize `Timestamp`:
	err = decoder.Decode(&obj.Timestamp)
	if err != nil {
		return err
	}
	return nil
}

type Global struct {
	// Unused
	Initialized                 bool
	Authority                   ag_solanago.PublicKey
	FeeRecipient                ag_solanago.PublicKey
	InitialVirtualTokenReserves uint64
	InitialVirtualSolReserves   uint64
	InitialRealTokenReserves    uint64
	TokenTotalSupply            uint64
	FeeBasisPoints              uint64
	WithdrawAuthority           ag_solanago.PublicKey

	// Unused
	EnableMigrate         bool
	PoolMigrationFee      uint64
	CreatorFeeBasisPoints uint64
	FeeRecipients         [7]ag_solanago.PublicKey
	SetCreatorAuthority   ag_solanago.PublicKey
}

func (obj Global) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
	// Serialize `Initialized` param:
	err = encoder.Encode(obj.Initialized)
	if err != nil {
		return err
	}
	// Serialize `Authority` param:
	err = encoder.Encode(obj.Authority)
	if err != nil {
		return err
	}
	// Serialize `FeeRecipient` param:
	err = encoder.Encode(obj.FeeRecipient)
	if err != nil {
		return err
	}
	// Serialize `InitialVirtualTokenReserves` param:
	err = encoder.Encode(obj.InitialVirtualTokenReserves)
	if err != nil {
		return err
	}
	// Serialize `InitialVirtualSolReserves` param:
	err = encoder.Encode(obj.InitialVirtualSolReserves)
	if err != nil {
		return err
	}
	// Serialize `InitialRealTokenReserves` param:
	err = encoder.Encode(obj.InitialRealTokenReserves)
	if err != nil {
		return err
	}
	// Serialize `TokenTotalSupply` param:
	err = encoder.Encode(obj.TokenTotalSupply)
	if err != nil {
		return err
	}
	// Serialize `FeeBasisPoints` param:
	err = encoder.Encode(obj.FeeBasisPoints)
	if err != nil {
		return err
	}
	// Serialize `WithdrawAuthority` param:
	err = encoder.Encode(obj.WithdrawAuthority)
	if err != nil {
		return err
	}
	// Serialize `EnableMigrate` param:
	err = encoder.Encode(obj.EnableMigrate)
	if err != nil {
		return err
	}
	// Serialize `PoolMigrationFee` param:
	err = encoder.Encode(obj.PoolMigrationFee)
	if err != nil {
		return err
	}
	// Serialize `CreatorFeeBasisPoints` param:
	err = encoder.Encode(obj.CreatorFeeBasisPoints)
	if err != nil {
		return err
	}
	// Serialize `FeeRecipients` param:
	err = encoder.Encode(obj.FeeRecipients)
	if err != nil {
		return err
	}
	// Serialize `SetCreatorAuthority` param:
	err = encoder.Encode(obj.SetCreatorAuthority)
	if err != nil {
		return err
	}
	return nil
}

func (obj *Global) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
	// Deserialize `Initialized`:
	err = decoder.Decode(&obj.Initialized)
	if err != nil {
		return err
	}
	// Deserialize `Authority`:
	err = decoder.Decode(&obj.Authority)
	if err != nil {
		return err
	}
	// Deserialize `FeeRecipient`:
	err = decoder.Decode(&obj.FeeRecipient)
	if err != nil {
		return err
	}
	// Deserialize `InitialVirtualTokenReserves`:
	err = decoder.Decode(&obj.InitialVirtualTokenReserves)
	if err != nil {
		return err
	}
	// Deserialize `InitialVirtualSolReserves`:
	err = decoder.Decode(&obj.InitialVirtualSolReserves)
	if err != nil {
		return err
	}
	// Deserialize `InitialRealTokenReserves`:
	err = decoder.Decode(&obj.InitialRealTokenReserves)
	if err != nil {
		return err
	}
	// Deserialize `TokenTotalSupply`:
	err = decoder.Decode(&obj.TokenTotalSupply)
	if err != nil {
		return err
	}
	// Deserialize `FeeBasisPoints`:
	err = decoder.Decode(&obj.FeeBasisPoints)
	if err != nil {
		return err
	}
	// Deserialize `WithdrawAuthority`:
	err = decoder.Decode(&obj.WithdrawAuthority)
	if err != nil {
		return err
	}
	// Deserialize `EnableMigrate`:
	err = decoder.Decode(&obj.EnableMigrate)
	if err != nil {
		return err
	}
	// Deserialize `PoolMigrationFee`:
	err = decoder.Decode(&obj.PoolMigrationFee)
	if err != nil {
		return err
	}
	// Deserialize `CreatorFeeBasisPoints`:
	err = decoder.Decode(&obj.CreatorFeeBasisPoints)
	if err != nil {
		return err
	}
	// Deserialize `FeeRecipients`:
	err = decoder.Decode(&obj.FeeRecipients)
	if err != nil {
		return err
	}
	// Deserialize `SetCreatorAuthority`:
	err = decoder.Decode(&obj.SetCreatorAuthority)
	if err != nil {
		return err
	}
	return nil
}

type SetCreatorEvent struct {
	Timestamp    int64
	Mint         ag_solanago.PublicKey
	BondingCurve ag_solanago.PublicKey
	Creator      ag_solanago.PublicKey
}

func (obj SetCreatorEvent) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
	// Serialize `Timestamp` param:
	err = encoder.Encode(obj.Timestamp)
	if err != nil {
		return err
	}
	// Serialize `Mint` param:
	err = encoder.Encode(obj.Mint)
	if err != nil {
		return err
	}
	// Serialize `BondingCurve` param:
	err = encoder.Encode(obj.BondingCurve)
	if err != nil {
		return err
	}
	// Serialize `Creator` param:
	err = encoder.Encode(obj.Creator)
	if err != nil {
		return err
	}
	return nil
}

func (obj *SetCreatorEvent) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
	// Deserialize `Timestamp`:
	err = decoder.Decode(&obj.Timestamp)
	if err != nil {
		return err
	}
	// Deserialize `Mint`:
	err = decoder.Decode(&obj.Mint)
	if err != nil {
		return err
	}
	// Deserialize `BondingCurve`:
	err = decoder.Decode(&obj.BondingCurve)
	if err != nil {
		return err
	}
	// Deserialize `Creator`:
	err = decoder.Decode(&obj.Creator)
	if err != nil {
		return err
	}
	return nil
}

type SetMetaplexCreatorEvent struct {
	Timestamp    int64
	Mint         ag_solanago.PublicKey
	BondingCurve ag_solanago.PublicKey
	Metadata     ag_solanago.PublicKey
	Creator      ag_solanago.PublicKey
}

func (obj SetMetaplexCreatorEvent) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
	// Serialize `Timestamp` param:
	err = encoder.Encode(obj.Timestamp)
	if err != nil {
		return err
	}
	// Serialize `Mint` param:
	err = encoder.Encode(obj.Mint)
	if err != nil {
		return err
	}
	// Serialize `BondingCurve` param:
	err = encoder.Encode(obj.BondingCurve)
	if err != nil {
		return err
	}
	// Serialize `Metadata` param:
	err = encoder.Encode(obj.Metadata)
	if err != nil {
		return err
	}
	// Serialize `Creator` param:
	err = encoder.Encode(obj.Creator)
	if err != nil {
		return err
	}
	return nil
}

func (obj *SetMetaplexCreatorEvent) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
	// Deserialize `Timestamp`:
	err = decoder.Decode(&obj.Timestamp)
	if err != nil {
		return err
	}
	// Deserialize `Mint`:
	err = decoder.Decode(&obj.Mint)
	if err != nil {
		return err
	}
	// Deserialize `BondingCurve`:
	err = decoder.Decode(&obj.BondingCurve)
	if err != nil {
		return err
	}
	// Deserialize `Metadata`:
	err = decoder.Decode(&obj.Metadata)
	if err != nil {
		return err
	}
	// Deserialize `Creator`:
	err = decoder.Decode(&obj.Creator)
	if err != nil {
		return err
	}
	return nil
}

type SetParamsEvent struct {
	InitialVirtualTokenReserves uint64
	InitialVirtualSolReserves   uint64
	InitialRealTokenReserves    uint64
	FinalRealSolReserves        uint64
	TokenTotalSupply            uint64
	FeeBasisPoints              uint64
	WithdrawAuthority           ag_solanago.PublicKey
	EnableMigrate               bool
	PoolMigrationFee            uint64
	CreatorFeeBasisPoints       uint64
	FeeRecipients               [8]ag_solanago.PublicKey
	Timestamp                   int64
	SetCreatorAuthority         ag_solanago.PublicKey
}

func (obj SetParamsEvent) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
	// Serialize `InitialVirtualTokenReserves` param:
	err = encoder.Encode(obj.InitialVirtualTokenReserves)
	if err != nil {
		return err
	}
	// Serialize `InitialVirtualSolReserves` param:
	err = encoder.Encode(obj.InitialVirtualSolReserves)
	if err != nil {
		return err
	}
	// Serialize `InitialRealTokenReserves` param:
	err = encoder.Encode(obj.InitialRealTokenReserves)
	if err != nil {
		return err
	}
	// Serialize `FinalRealSolReserves` param:
	err = encoder.Encode(obj.FinalRealSolReserves)
	if err != nil {
		return err
	}
	// Serialize `TokenTotalSupply` param:
	err = encoder.Encode(obj.TokenTotalSupply)
	if err != nil {
		return err
	}
	// Serialize `FeeBasisPoints` param:
	err = encoder.Encode(obj.FeeBasisPoints)
	if err != nil {
		return err
	}
	// Serialize `WithdrawAuthority` param:
	err = encoder.Encode(obj.WithdrawAuthority)
	if err != nil {
		return err
	}
	// Serialize `EnableMigrate` param:
	err = encoder.Encode(obj.EnableMigrate)
	if err != nil {
		return err
	}
	// Serialize `PoolMigrationFee` param:
	err = encoder.Encode(obj.PoolMigrationFee)
	if err != nil {
		return err
	}
	// Serialize `CreatorFeeBasisPoints` param:
	err = encoder.Encode(obj.CreatorFeeBasisPoints)
	if err != nil {
		return err
	}
	// Serialize `FeeRecipients` param:
	err = encoder.Encode(obj.FeeRecipients)
	if err != nil {
		return err
	}
	// Serialize `Timestamp` param:
	err = encoder.Encode(obj.Timestamp)
	if err != nil {
		return err
	}
	// Serialize `SetCreatorAuthority` param:
	err = encoder.Encode(obj.SetCreatorAuthority)
	if err != nil {
		return err
	}
	return nil
}

func (obj *SetParamsEvent) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
	// Deserialize `InitialVirtualTokenReserves`:
	err = decoder.Decode(&obj.InitialVirtualTokenReserves)
	if err != nil {
		return err
	}
	// Deserialize `InitialVirtualSolReserves`:
	err = decoder.Decode(&obj.InitialVirtualSolReserves)
	if err != nil {
		return err
	}
	// Deserialize `InitialRealTokenReserves`:
	err = decoder.Decode(&obj.InitialRealTokenReserves)
	if err != nil {
		return err
	}
	// Deserialize `FinalRealSolReserves`:
	err = decoder.Decode(&obj.FinalRealSolReserves)
	if err != nil {
		return err
	}
	// Deserialize `TokenTotalSupply`:
	err = decoder.Decode(&obj.TokenTotalSupply)
	if err != nil {
		return err
	}
	// Deserialize `FeeBasisPoints`:
	err = decoder.Decode(&obj.FeeBasisPoints)
	if err != nil {
		return err
	}
	// Deserialize `WithdrawAuthority`:
	err = decoder.Decode(&obj.WithdrawAuthority)
	if err != nil {
		return err
	}
	// Deserialize `EnableMigrate`:
	err = decoder.Decode(&obj.EnableMigrate)
	if err != nil {
		return err
	}
	// Deserialize `PoolMigrationFee`:
	err = decoder.Decode(&obj.PoolMigrationFee)
	if err != nil {
		return err
	}
	// Deserialize `CreatorFeeBasisPoints`:
	err = decoder.Decode(&obj.CreatorFeeBasisPoints)
	if err != nil {
		return err
	}
	// Deserialize `FeeRecipients`:
	err = decoder.Decode(&obj.FeeRecipients)
	if err != nil {
		return err
	}
	// Deserialize `Timestamp`:
	err = decoder.Decode(&obj.Timestamp)
	if err != nil {
		return err
	}
	// Deserialize `SetCreatorAuthority`:
	err = decoder.Decode(&obj.SetCreatorAuthority)
	if err != nil {
		return err
	}
	return nil
}

type TradeEvent struct {
	Mint                  ag_solanago.PublicKey
	SolAmount             uint64
	TokenAmount           uint64
	IsBuy                 bool
	User                  ag_solanago.PublicKey
	Timestamp             int64
	VirtualSolReserves    uint64
	VirtualTokenReserves  uint64
	RealSolReserves       uint64
	RealTokenReserves     uint64
	FeeRecipient          ag_solanago.PublicKey
	FeeBasisPoints        uint64
	Fee                   uint64
	Creator               ag_solanago.PublicKey
	CreatorFeeBasisPoints uint64
	CreatorFee            uint64
}

func (obj TradeEvent) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
	// Serialize `Mint` param:
	err = encoder.Encode(obj.Mint)
	if err != nil {
		return err
	}
	// Serialize `SolAmount` param:
	err = encoder.Encode(obj.SolAmount)
	if err != nil {
		return err
	}
	// Serialize `TokenAmount` param:
	err = encoder.Encode(obj.TokenAmount)
	if err != nil {
		return err
	}
	// Serialize `IsBuy` param:
	err = encoder.Encode(obj.IsBuy)
	if err != nil {
		return err
	}
	// Serialize `User` param:
	err = encoder.Encode(obj.User)
	if err != nil {
		return err
	}
	// Serialize `Timestamp` param:
	err = encoder.Encode(obj.Timestamp)
	if err != nil {
		return err
	}
	// Serialize `VirtualSolReserves` param:
	err = encoder.Encode(obj.VirtualSolReserves)
	if err != nil {
		return err
	}
	// Serialize `VirtualTokenReserves` param:
	err = encoder.Encode(obj.VirtualTokenReserves)
	if err != nil {
		return err
	}
	// Serialize `RealSolReserves` param:
	err = encoder.Encode(obj.RealSolReserves)
	if err != nil {
		return err
	}
	// Serialize `RealTokenReserves` param:
	err = encoder.Encode(obj.RealTokenReserves)
	if err != nil {
		return err
	}
	// Serialize `FeeRecipient` param:
	err = encoder.Encode(obj.FeeRecipient)
	if err != nil {
		return err
	}
	// Serialize `FeeBasisPoints` param:
	err = encoder.Encode(obj.FeeBasisPoints)
	if err != nil {
		return err
	}
	// Serialize `Fee` param:
	err = encoder.Encode(obj.Fee)
	if err != nil {
		return err
	}
	// Serialize `Creator` param:
	err = encoder.Encode(obj.Creator)
	if err != nil {
		return err
	}
	// Serialize `CreatorFeeBasisPoints` param:
	err = encoder.Encode(obj.CreatorFeeBasisPoints)
	if err != nil {
		return err
	}
	// Serialize `CreatorFee` param:
	err = encoder.Encode(obj.CreatorFee)
	if err != nil {
		return err
	}
	return nil
}

func (obj *TradeEvent) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
	// Deserialize `Mint`:
	err = decoder.Decode(&obj.Mint)
	if err != nil {
		return err
	}
	// Deserialize `SolAmount`:
	err = decoder.Decode(&obj.SolAmount)
	if err != nil {
		return err
	}
	// Deserialize `TokenAmount`:
	err = decoder.Decode(&obj.TokenAmount)
	if err != nil {
		return err
	}
	// Deserialize `IsBuy`:
	err = decoder.Decode(&obj.IsBuy)
	if err != nil {
		return err
	}
	// Deserialize `User`:
	err = decoder.Decode(&obj.User)
	if err != nil {
		return err
	}
	// Deserialize `Timestamp`:
	err = decoder.Decode(&obj.Timestamp)
	if err != nil {
		return err
	}
	// Deserialize `VirtualSolReserves`:
	err = decoder.Decode(&obj.VirtualSolReserves)
	if err != nil {
		return err
	}
	// Deserialize `VirtualTokenReserves`:
	err = decoder.Decode(&obj.VirtualTokenReserves)
	if err != nil {
		return err
	}
	// Deserialize `RealSolReserves`:
	err = decoder.Decode(&obj.RealSolReserves)
	if err != nil {
		return err
	}
	// Deserialize `RealTokenReserves`:
	err = decoder.Decode(&obj.RealTokenReserves)
	if err != nil {
		return err
	}
	// Deserialize `FeeRecipient`:
	err = decoder.Decode(&obj.FeeRecipient)
	if err != nil {
		return err
	}
	// Deserialize `FeeBasisPoints`:
	err = decoder.Decode(&obj.FeeBasisPoints)
	if err != nil {
		return err
	}
	// Deserialize `Fee`:
	err = decoder.Decode(&obj.Fee)
	if err != nil {
		return err
	}
	// Deserialize `Creator`:
	err = decoder.Decode(&obj.Creator)
	if err != nil {
		return err
	}
	// Deserialize `CreatorFeeBasisPoints`:
	err = decoder.Decode(&obj.CreatorFeeBasisPoints)
	if err != nil {
		return err
	}
	// Deserialize `CreatorFee`:
	err = decoder.Decode(&obj.CreatorFee)
	if err != nil {
		return err
	}
	return nil
}

type UpdateGlobalAuthorityEvent struct {
	Global       ag_solanago.PublicKey
	Authority    ag_solanago.PublicKey
	NewAuthority ag_solanago.PublicKey
	Timestamp    int64
}

func (obj UpdateGlobalAuthorityEvent) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
	// Serialize `Global` param:
	err = encoder.Encode(obj.Global)
	if err != nil {
		return err
	}
	// Serialize `Authority` param:
	err = encoder.Encode(obj.Authority)
	if err != nil {
		return err
	}
	// Serialize `NewAuthority` param:
	err = encoder.Encode(obj.NewAuthority)
	if err != nil {
		return err
	}
	// Serialize `Timestamp` param:
	err = encoder.Encode(obj.Timestamp)
	if err != nil {
		return err
	}
	return nil
}

func (obj *UpdateGlobalAuthorityEvent) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
	// Deserialize `Global`:
	err = decoder.Decode(&obj.Global)
	if err != nil {
		return err
	}
	// Deserialize `Authority`:
	err = decoder.Decode(&obj.Authority)
	if err != nil {
		return err
	}
	// Deserialize `NewAuthority`:
	err = decoder.Decode(&obj.NewAuthority)
	if err != nil {
		return err
	}
	// Deserialize `Timestamp`:
	err = decoder.Decode(&obj.Timestamp)
	if err != nil {
		return err
	}
	return nil
}
