pump

package
v0.0.0-...-11a2452 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ProgramName = "Pump"

Variables

View Source
var (
	// Creates the global state.
	Instruction_Initialize = ag_binary.TypeID([8]byte{175, 175, 109, 31, 13, 152, 155, 237})

	// Sets the global state parameters.
	Instruction_SetParams = ag_binary.TypeID([8]byte{27, 234, 178, 52, 147, 2, 187, 141})

	// Creates a new coin and bonding curve.
	Instruction_Create = ag_binary.TypeID([8]byte{24, 30, 200, 40, 5, 28, 7, 119})

	// Buys tokens from a bonding curve.
	Instruction_Buy = ag_binary.TypeID([8]byte{102, 6, 61, 18, 1, 218, 235, 234})

	// Sells tokens into a bonding curve.
	Instruction_Sell = ag_binary.TypeID([8]byte{51, 230, 133, 164, 1, 127, 131, 173})

	// Allows the admin to withdraw liquidity for a migration once the bonding curve completes
	Instruction_Withdraw = ag_binary.TypeID([8]byte{183, 18, 70, 156, 148, 109, 161, 34})
)
View Source
var BondingCurveDiscriminator = [8]byte{23, 183, 248, 55, 96, 216, 172, 96}
View Source
var GlobalDiscriminator = [8]byte{167, 232, 232, 177, 200, 108, 114, 127}
View Source
var InstructionImplDef = ag_binary.NewVariantDefinition(
	ag_binary.AnchorTypeIDEncoding,
	[]ag_binary.VariantType{
		{
			"initialize", (*Initialize)(nil),
		},
		{
			"set_params", (*SetParams)(nil),
		},
		{
			"create", (*Create)(nil),
		},
		{
			"buy", (*Buy)(nil),
		},
		{
			"sell", (*Sell)(nil),
		},
		{
			"withdraw", (*Withdraw)(nil),
		},
	},
)
View Source
var ProgramID ag_solanago.PublicKey = ag_solanago.MustPublicKeyFromBase58("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P")

Functions

func InstructionIDToName

func InstructionIDToName(id ag_binary.TypeID) string

InstructionIDToName returns the name of the instruction given its ID.

func SetProgramID

func SetProgramID(pubkey ag_solanago.PublicKey)

Types

type BondingCurve

type BondingCurve struct {
	VirtualTokenReserves uint64
	VirtualSolReserves   uint64
	RealTokenReserves    uint64
	RealSolReserves      uint64
	TokenTotalSupply     uint64
	Complete             bool
}

func (BondingCurve) MarshalWithEncoder

func (obj BondingCurve) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*BondingCurve) UnmarshalWithDecoder

func (obj *BondingCurve) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

type Buy

type Buy struct {
	Amount     *uint64
	MaxSolCost *uint64

	// [0] = [] global
	//
	// [1] = [WRITE] feeRecipient
	//
	// [2] = [] mint
	//
	// [3] = [WRITE] bondingCurve
	//
	// [4] = [WRITE] associatedBondingCurve
	//
	// [5] = [WRITE] associatedUser
	//
	// [6] = [WRITE, SIGNER] user
	//
	// [7] = [] systemProgram
	//
	// [8] = [] tokenProgram
	//
	// [9] = [] rent
	//
	// [10] = [] eventAuthority
	//
	// [11] = [] program
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Buys tokens from a bonding curve.

func NewBuyInstruction

func NewBuyInstruction(

	amount uint64,
	maxSolCost uint64,

	global ag_solanago.PublicKey,
	feeRecipient ag_solanago.PublicKey,
	mint ag_solanago.PublicKey,
	bondingCurve ag_solanago.PublicKey,
	associatedBondingCurve ag_solanago.PublicKey,
	associatedUser ag_solanago.PublicKey,
	user ag_solanago.PublicKey,
	systemProgram ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey,
	rent ag_solanago.PublicKey,
	eventAuthority ag_solanago.PublicKey,
	program ag_solanago.PublicKey) *Buy

NewBuyInstruction declares a new Buy instruction with the provided parameters and accounts.

func NewBuyInstructionBuilder

func NewBuyInstructionBuilder() *Buy

NewBuyInstructionBuilder creates a new `Buy` instruction builder.

func (Buy) Build

func (inst Buy) Build() *Instruction

func (*Buy) EncodeToTree

func (inst *Buy) EncodeToTree(parent ag_treeout.Branches)

func (*Buy) GetAssociatedBondingCurveAccount

func (inst *Buy) GetAssociatedBondingCurveAccount() *ag_solanago.AccountMeta

GetAssociatedBondingCurveAccount gets the "associatedBondingCurve" account.

func (*Buy) GetAssociatedUserAccount

func (inst *Buy) GetAssociatedUserAccount() *ag_solanago.AccountMeta

GetAssociatedUserAccount gets the "associatedUser" account.

func (*Buy) GetBondingCurveAccount

func (inst *Buy) GetBondingCurveAccount() *ag_solanago.AccountMeta

GetBondingCurveAccount gets the "bondingCurve" account.

func (*Buy) GetEventAuthorityAccount

func (inst *Buy) GetEventAuthorityAccount() *ag_solanago.AccountMeta

GetEventAuthorityAccount gets the "eventAuthority" account.

func (*Buy) GetFeeRecipientAccount

func (inst *Buy) GetFeeRecipientAccount() *ag_solanago.AccountMeta

GetFeeRecipientAccount gets the "feeRecipient" account.

func (*Buy) GetGlobalAccount

func (inst *Buy) GetGlobalAccount() *ag_solanago.AccountMeta

GetGlobalAccount gets the "global" account.

func (*Buy) GetMintAccount

func (inst *Buy) GetMintAccount() *ag_solanago.AccountMeta

GetMintAccount gets the "mint" account.

func (*Buy) GetProgramAccount

func (inst *Buy) GetProgramAccount() *ag_solanago.AccountMeta

GetProgramAccount gets the "program" account.

func (*Buy) GetRentAccount

func (inst *Buy) GetRentAccount() *ag_solanago.AccountMeta

GetRentAccount gets the "rent" account.

func (*Buy) GetSystemProgramAccount

func (inst *Buy) GetSystemProgramAccount() *ag_solanago.AccountMeta

GetSystemProgramAccount gets the "systemProgram" account.

func (*Buy) GetTokenProgramAccount

func (inst *Buy) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account.

func (*Buy) GetUserAccount

func (inst *Buy) GetUserAccount() *ag_solanago.AccountMeta

GetUserAccount gets the "user" account.

func (Buy) MarshalWithEncoder

func (obj Buy) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*Buy) SetAmount

func (inst *Buy) SetAmount(amount uint64) *Buy

SetAmount sets the "amount" parameter.

func (*Buy) SetAssociatedBondingCurveAccount

func (inst *Buy) SetAssociatedBondingCurveAccount(associatedBondingCurve ag_solanago.PublicKey) *Buy

SetAssociatedBondingCurveAccount sets the "associatedBondingCurve" account.

func (*Buy) SetAssociatedUserAccount

func (inst *Buy) SetAssociatedUserAccount(associatedUser ag_solanago.PublicKey) *Buy

SetAssociatedUserAccount sets the "associatedUser" account.

func (*Buy) SetBondingCurveAccount

func (inst *Buy) SetBondingCurveAccount(bondingCurve ag_solanago.PublicKey) *Buy

SetBondingCurveAccount sets the "bondingCurve" account.

func (*Buy) SetEventAuthorityAccount

func (inst *Buy) SetEventAuthorityAccount(eventAuthority ag_solanago.PublicKey) *Buy

SetEventAuthorityAccount sets the "eventAuthority" account.

func (*Buy) SetFeeRecipientAccount

func (inst *Buy) SetFeeRecipientAccount(feeRecipient ag_solanago.PublicKey) *Buy

SetFeeRecipientAccount sets the "feeRecipient" account.

func (*Buy) SetGlobalAccount

func (inst *Buy) SetGlobalAccount(global ag_solanago.PublicKey) *Buy

SetGlobalAccount sets the "global" account.

func (*Buy) SetMaxSolCost

func (inst *Buy) SetMaxSolCost(maxSolCost uint64) *Buy

SetMaxSolCost sets the "maxSolCost" parameter.

func (*Buy) SetMintAccount

func (inst *Buy) SetMintAccount(mint ag_solanago.PublicKey) *Buy

SetMintAccount sets the "mint" account.

func (*Buy) SetProgramAccount

func (inst *Buy) SetProgramAccount(program ag_solanago.PublicKey) *Buy

SetProgramAccount sets the "program" account.

func (*Buy) SetRentAccount

func (inst *Buy) SetRentAccount(rent ag_solanago.PublicKey) *Buy

SetRentAccount sets the "rent" account.

func (*Buy) SetSystemProgramAccount

func (inst *Buy) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Buy

SetSystemProgramAccount sets the "systemProgram" account.

func (*Buy) SetTokenProgramAccount

func (inst *Buy) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *Buy

SetTokenProgramAccount sets the "tokenProgram" account.

func (*Buy) SetUserAccount

func (inst *Buy) SetUserAccount(user ag_solanago.PublicKey) *Buy

SetUserAccount sets the "user" account.

func (*Buy) UnmarshalWithDecoder

func (obj *Buy) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*Buy) Validate

func (inst *Buy) Validate() error

func (Buy) ValidateAndBuild

func (inst Buy) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type Create

type Create struct {
	Name   *string
	Symbol *string
	Uri    *string

	// [0] = [WRITE, SIGNER] mint
	//
	// [1] = [] mintAuthority
	//
	// [2] = [WRITE] bondingCurve
	//
	// [3] = [WRITE] associatedBondingCurve
	//
	// [4] = [] global
	//
	// [5] = [] mplTokenMetadata
	//
	// [6] = [WRITE] metadata
	//
	// [7] = [WRITE, SIGNER] user
	//
	// [8] = [] systemProgram
	//
	// [9] = [] tokenProgram
	//
	// [10] = [] associatedTokenProgram
	//
	// [11] = [] rent
	//
	// [12] = [] eventAuthority
	//
	// [13] = [] program
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Creates a new coin and bonding curve.

func NewCreateInstruction

func NewCreateInstruction(

	name string,
	symbol string,
	uri string,

	mint ag_solanago.PublicKey,
	mintAuthority ag_solanago.PublicKey,
	bondingCurve ag_solanago.PublicKey,
	associatedBondingCurve ag_solanago.PublicKey,
	global ag_solanago.PublicKey,
	mplTokenMetadata ag_solanago.PublicKey,
	metadata ag_solanago.PublicKey,
	user ag_solanago.PublicKey,
	systemProgram ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey,
	associatedTokenProgram ag_solanago.PublicKey,
	rent ag_solanago.PublicKey,
	eventAuthority ag_solanago.PublicKey,
	program ag_solanago.PublicKey) *Create

NewCreateInstruction declares a new Create instruction with the provided parameters and accounts.

func NewCreateInstructionBuilder

func NewCreateInstructionBuilder() *Create

NewCreateInstructionBuilder creates a new `Create` instruction builder.

func (Create) Build

func (inst Create) Build() *Instruction

func (*Create) EncodeToTree

func (inst *Create) EncodeToTree(parent ag_treeout.Branches)

func (*Create) GetAssociatedBondingCurveAccount

func (inst *Create) GetAssociatedBondingCurveAccount() *ag_solanago.AccountMeta

GetAssociatedBondingCurveAccount gets the "associatedBondingCurve" account.

func (*Create) GetAssociatedTokenProgramAccount

func (inst *Create) GetAssociatedTokenProgramAccount() *ag_solanago.AccountMeta

GetAssociatedTokenProgramAccount gets the "associatedTokenProgram" account.

func (*Create) GetBondingCurveAccount

func (inst *Create) GetBondingCurveAccount() *ag_solanago.AccountMeta

GetBondingCurveAccount gets the "bondingCurve" account.

func (*Create) GetEventAuthorityAccount

func (inst *Create) GetEventAuthorityAccount() *ag_solanago.AccountMeta

GetEventAuthorityAccount gets the "eventAuthority" account.

func (*Create) GetGlobalAccount

func (inst *Create) GetGlobalAccount() *ag_solanago.AccountMeta

GetGlobalAccount gets the "global" account.

func (*Create) GetMetadataAccount

func (inst *Create) GetMetadataAccount() *ag_solanago.AccountMeta

GetMetadataAccount gets the "metadata" account.

func (*Create) GetMintAccount

func (inst *Create) GetMintAccount() *ag_solanago.AccountMeta

GetMintAccount gets the "mint" account.

func (*Create) GetMintAuthorityAccount

func (inst *Create) GetMintAuthorityAccount() *ag_solanago.AccountMeta

GetMintAuthorityAccount gets the "mintAuthority" account.

func (*Create) GetMplTokenMetadataAccount

func (inst *Create) GetMplTokenMetadataAccount() *ag_solanago.AccountMeta

GetMplTokenMetadataAccount gets the "mplTokenMetadata" account.

func (*Create) GetProgramAccount

func (inst *Create) GetProgramAccount() *ag_solanago.AccountMeta

GetProgramAccount gets the "program" account.

func (*Create) GetRentAccount

func (inst *Create) GetRentAccount() *ag_solanago.AccountMeta

GetRentAccount gets the "rent" account.

func (*Create) GetSystemProgramAccount

func (inst *Create) GetSystemProgramAccount() *ag_solanago.AccountMeta

GetSystemProgramAccount gets the "systemProgram" account.

func (*Create) GetTokenProgramAccount

func (inst *Create) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account.

func (*Create) GetUserAccount

func (inst *Create) GetUserAccount() *ag_solanago.AccountMeta

GetUserAccount gets the "user" account.

func (Create) MarshalWithEncoder

func (obj Create) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*Create) SetAssociatedBondingCurveAccount

func (inst *Create) SetAssociatedBondingCurveAccount(associatedBondingCurve ag_solanago.PublicKey) *Create

SetAssociatedBondingCurveAccount sets the "associatedBondingCurve" account.

func (*Create) SetAssociatedTokenProgramAccount

func (inst *Create) SetAssociatedTokenProgramAccount(associatedTokenProgram ag_solanago.PublicKey) *Create

SetAssociatedTokenProgramAccount sets the "associatedTokenProgram" account.

func (*Create) SetBondingCurveAccount

func (inst *Create) SetBondingCurveAccount(bondingCurve ag_solanago.PublicKey) *Create

SetBondingCurveAccount sets the "bondingCurve" account.

func (*Create) SetEventAuthorityAccount

func (inst *Create) SetEventAuthorityAccount(eventAuthority ag_solanago.PublicKey) *Create

SetEventAuthorityAccount sets the "eventAuthority" account.

func (*Create) SetGlobalAccount

func (inst *Create) SetGlobalAccount(global ag_solanago.PublicKey) *Create

SetGlobalAccount sets the "global" account.

func (*Create) SetMetadataAccount

func (inst *Create) SetMetadataAccount(metadata ag_solanago.PublicKey) *Create

SetMetadataAccount sets the "metadata" account.

func (*Create) SetMintAccount

func (inst *Create) SetMintAccount(mint ag_solanago.PublicKey) *Create

SetMintAccount sets the "mint" account.

func (*Create) SetMintAuthorityAccount

func (inst *Create) SetMintAuthorityAccount(mintAuthority ag_solanago.PublicKey) *Create

SetMintAuthorityAccount sets the "mintAuthority" account.

func (*Create) SetMplTokenMetadataAccount

func (inst *Create) SetMplTokenMetadataAccount(mplTokenMetadata ag_solanago.PublicKey) *Create

SetMplTokenMetadataAccount sets the "mplTokenMetadata" account.

func (*Create) SetName

func (inst *Create) SetName(name string) *Create

SetName sets the "name" parameter.

func (*Create) SetProgramAccount

func (inst *Create) SetProgramAccount(program ag_solanago.PublicKey) *Create

SetProgramAccount sets the "program" account.

func (*Create) SetRentAccount

func (inst *Create) SetRentAccount(rent ag_solanago.PublicKey) *Create

SetRentAccount sets the "rent" account.

func (*Create) SetSymbol

func (inst *Create) SetSymbol(symbol string) *Create

SetSymbol sets the "symbol" parameter.

func (*Create) SetSystemProgramAccount

func (inst *Create) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Create

SetSystemProgramAccount sets the "systemProgram" account.

func (*Create) SetTokenProgramAccount

func (inst *Create) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *Create

SetTokenProgramAccount sets the "tokenProgram" account.

func (*Create) SetUri

func (inst *Create) SetUri(uri string) *Create

SetUri sets the "uri" parameter.

func (*Create) SetUserAccount

func (inst *Create) SetUserAccount(user ag_solanago.PublicKey) *Create

SetUserAccount sets the "user" account.

func (*Create) UnmarshalWithDecoder

func (obj *Create) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*Create) Validate

func (inst *Create) Validate() error

func (Create) ValidateAndBuild

func (inst Create) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type Global

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

func (Global) MarshalWithEncoder

func (obj Global) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*Global) UnmarshalWithDecoder

func (obj *Global) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

type Initialize

type Initialize struct {

	// [0] = [WRITE] global
	//
	// [1] = [WRITE, SIGNER] user
	//
	// [2] = [] systemProgram
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Creates the global state.

func NewInitializeInstruction

func NewInitializeInstruction(

	global ag_solanago.PublicKey,
	user ag_solanago.PublicKey,
	systemProgram ag_solanago.PublicKey) *Initialize

NewInitializeInstruction declares a new Initialize instruction with the provided parameters and accounts.

func NewInitializeInstructionBuilder

func NewInitializeInstructionBuilder() *Initialize

NewInitializeInstructionBuilder creates a new `Initialize` instruction builder.

func (Initialize) Build

func (inst Initialize) Build() *Instruction

func (*Initialize) EncodeToTree

func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches)

func (*Initialize) GetGlobalAccount

func (inst *Initialize) GetGlobalAccount() *ag_solanago.AccountMeta

GetGlobalAccount gets the "global" account.

func (*Initialize) GetSystemProgramAccount

func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta

GetSystemProgramAccount gets the "systemProgram" account.

func (*Initialize) GetUserAccount

func (inst *Initialize) GetUserAccount() *ag_solanago.AccountMeta

GetUserAccount gets the "user" account.

func (Initialize) MarshalWithEncoder

func (obj Initialize) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*Initialize) SetGlobalAccount

func (inst *Initialize) SetGlobalAccount(global ag_solanago.PublicKey) *Initialize

SetGlobalAccount sets the "global" account.

func (*Initialize) SetSystemProgramAccount

func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Initialize

SetSystemProgramAccount sets the "systemProgram" account.

func (*Initialize) SetUserAccount

func (inst *Initialize) SetUserAccount(user ag_solanago.PublicKey) *Initialize

SetUserAccount sets the "user" account.

func (*Initialize) UnmarshalWithDecoder

func (obj *Initialize) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*Initialize) Validate

func (inst *Initialize) Validate() error

func (Initialize) ValidateAndBuild

func (inst Initialize) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type Instruction

type Instruction struct {
	ag_binary.BaseVariant
}

func DecodeInstruction

func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error)

func (*Instruction) Accounts

func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta)

func (*Instruction) Data

func (inst *Instruction) Data() ([]byte, error)

func (*Instruction) EncodeToTree

func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches)

func (*Instruction) MarshalWithEncoder

func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*Instruction) ProgramID

func (inst *Instruction) ProgramID() ag_solanago.PublicKey

func (*Instruction) TextEncode

func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error

func (*Instruction) UnmarshalWithDecoder

func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

type Sell

type Sell struct {
	Amount       *uint64
	MinSolOutput *uint64

	// [0] = [] global
	//
	// [1] = [WRITE] feeRecipient
	//
	// [2] = [] mint
	//
	// [3] = [WRITE] bondingCurve
	//
	// [4] = [WRITE] associatedBondingCurve
	//
	// [5] = [WRITE] associatedUser
	//
	// [6] = [WRITE, SIGNER] user
	//
	// [7] = [] systemProgram
	//
	// [8] = [] associatedTokenProgram
	//
	// [9] = [] tokenProgram
	//
	// [10] = [] eventAuthority
	//
	// [11] = [] program
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Sells tokens into a bonding curve.

func NewSellInstruction

func NewSellInstruction(

	amount uint64,
	minSolOutput uint64,

	global ag_solanago.PublicKey,
	feeRecipient ag_solanago.PublicKey,
	mint ag_solanago.PublicKey,
	bondingCurve ag_solanago.PublicKey,
	associatedBondingCurve ag_solanago.PublicKey,
	associatedUser ag_solanago.PublicKey,
	user ag_solanago.PublicKey,
	systemProgram ag_solanago.PublicKey,
	associatedTokenProgram ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey,
	eventAuthority ag_solanago.PublicKey,
	program ag_solanago.PublicKey) *Sell

NewSellInstruction declares a new Sell instruction with the provided parameters and accounts.

func NewSellInstructionBuilder

func NewSellInstructionBuilder() *Sell

NewSellInstructionBuilder creates a new `Sell` instruction builder.

func (Sell) Build

func (inst Sell) Build() *Instruction

func (*Sell) EncodeToTree

func (inst *Sell) EncodeToTree(parent ag_treeout.Branches)

func (*Sell) GetAssociatedBondingCurveAccount

func (inst *Sell) GetAssociatedBondingCurveAccount() *ag_solanago.AccountMeta

GetAssociatedBondingCurveAccount gets the "associatedBondingCurve" account.

func (*Sell) GetAssociatedTokenProgramAccount

func (inst *Sell) GetAssociatedTokenProgramAccount() *ag_solanago.AccountMeta

GetAssociatedTokenProgramAccount gets the "associatedTokenProgram" account.

func (*Sell) GetAssociatedUserAccount

func (inst *Sell) GetAssociatedUserAccount() *ag_solanago.AccountMeta

GetAssociatedUserAccount gets the "associatedUser" account.

func (*Sell) GetBondingCurveAccount

func (inst *Sell) GetBondingCurveAccount() *ag_solanago.AccountMeta

GetBondingCurveAccount gets the "bondingCurve" account.

func (*Sell) GetEventAuthorityAccount

func (inst *Sell) GetEventAuthorityAccount() *ag_solanago.AccountMeta

GetEventAuthorityAccount gets the "eventAuthority" account.

func (*Sell) GetFeeRecipientAccount

func (inst *Sell) GetFeeRecipientAccount() *ag_solanago.AccountMeta

GetFeeRecipientAccount gets the "feeRecipient" account.

func (*Sell) GetGlobalAccount

func (inst *Sell) GetGlobalAccount() *ag_solanago.AccountMeta

GetGlobalAccount gets the "global" account.

func (*Sell) GetMintAccount

func (inst *Sell) GetMintAccount() *ag_solanago.AccountMeta

GetMintAccount gets the "mint" account.

func (*Sell) GetProgramAccount

func (inst *Sell) GetProgramAccount() *ag_solanago.AccountMeta

GetProgramAccount gets the "program" account.

func (*Sell) GetSystemProgramAccount

func (inst *Sell) GetSystemProgramAccount() *ag_solanago.AccountMeta

GetSystemProgramAccount gets the "systemProgram" account.

func (*Sell) GetTokenProgramAccount

func (inst *Sell) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account.

func (*Sell) GetUserAccount

func (inst *Sell) GetUserAccount() *ag_solanago.AccountMeta

GetUserAccount gets the "user" account.

func (Sell) MarshalWithEncoder

func (obj Sell) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*Sell) SetAmount

func (inst *Sell) SetAmount(amount uint64) *Sell

SetAmount sets the "amount" parameter.

func (*Sell) SetAssociatedBondingCurveAccount

func (inst *Sell) SetAssociatedBondingCurveAccount(associatedBondingCurve ag_solanago.PublicKey) *Sell

SetAssociatedBondingCurveAccount sets the "associatedBondingCurve" account.

func (*Sell) SetAssociatedTokenProgramAccount

func (inst *Sell) SetAssociatedTokenProgramAccount(associatedTokenProgram ag_solanago.PublicKey) *Sell

SetAssociatedTokenProgramAccount sets the "associatedTokenProgram" account.

func (*Sell) SetAssociatedUserAccount

func (inst *Sell) SetAssociatedUserAccount(associatedUser ag_solanago.PublicKey) *Sell

SetAssociatedUserAccount sets the "associatedUser" account.

func (*Sell) SetBondingCurveAccount

func (inst *Sell) SetBondingCurveAccount(bondingCurve ag_solanago.PublicKey) *Sell

SetBondingCurveAccount sets the "bondingCurve" account.

func (*Sell) SetEventAuthorityAccount

func (inst *Sell) SetEventAuthorityAccount(eventAuthority ag_solanago.PublicKey) *Sell

SetEventAuthorityAccount sets the "eventAuthority" account.

func (*Sell) SetFeeRecipientAccount

func (inst *Sell) SetFeeRecipientAccount(feeRecipient ag_solanago.PublicKey) *Sell

SetFeeRecipientAccount sets the "feeRecipient" account.

func (*Sell) SetGlobalAccount

func (inst *Sell) SetGlobalAccount(global ag_solanago.PublicKey) *Sell

SetGlobalAccount sets the "global" account.

func (*Sell) SetMinSolOutput

func (inst *Sell) SetMinSolOutput(minSolOutput uint64) *Sell

SetMinSolOutput sets the "minSolOutput" parameter.

func (*Sell) SetMintAccount

func (inst *Sell) SetMintAccount(mint ag_solanago.PublicKey) *Sell

SetMintAccount sets the "mint" account.

func (*Sell) SetProgramAccount

func (inst *Sell) SetProgramAccount(program ag_solanago.PublicKey) *Sell

SetProgramAccount sets the "program" account.

func (*Sell) SetSystemProgramAccount

func (inst *Sell) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Sell

SetSystemProgramAccount sets the "systemProgram" account.

func (*Sell) SetTokenProgramAccount

func (inst *Sell) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *Sell

SetTokenProgramAccount sets the "tokenProgram" account.

func (*Sell) SetUserAccount

func (inst *Sell) SetUserAccount(user ag_solanago.PublicKey) *Sell

SetUserAccount sets the "user" account.

func (*Sell) UnmarshalWithDecoder

func (obj *Sell) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*Sell) Validate

func (inst *Sell) Validate() error

func (Sell) ValidateAndBuild

func (inst Sell) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type SetParams

type SetParams struct {
	FeeRecipient                *ag_solanago.PublicKey
	InitialVirtualTokenReserves *uint64
	InitialVirtualSolReserves   *uint64
	InitialRealTokenReserves    *uint64
	TokenTotalSupply            *uint64
	FeeBasisPoints              *uint64

	// [0] = [WRITE] global
	//
	// [1] = [WRITE, SIGNER] user
	//
	// [2] = [] systemProgram
	//
	// [3] = [] eventAuthority
	//
	// [4] = [] program
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Sets the global state parameters.

func NewSetParamsInstruction

func NewSetParamsInstruction(

	feeRecipient ag_solanago.PublicKey,
	initialVirtualTokenReserves uint64,
	initialVirtualSolReserves uint64,
	initialRealTokenReserves uint64,
	tokenTotalSupply uint64,
	feeBasisPoints uint64,

	global ag_solanago.PublicKey,
	user ag_solanago.PublicKey,
	systemProgram ag_solanago.PublicKey,
	eventAuthority ag_solanago.PublicKey,
	program ag_solanago.PublicKey) *SetParams

NewSetParamsInstruction declares a new SetParams instruction with the provided parameters and accounts.

func NewSetParamsInstructionBuilder

func NewSetParamsInstructionBuilder() *SetParams

NewSetParamsInstructionBuilder creates a new `SetParams` instruction builder.

func (SetParams) Build

func (inst SetParams) Build() *Instruction

func (*SetParams) EncodeToTree

func (inst *SetParams) EncodeToTree(parent ag_treeout.Branches)

func (*SetParams) GetEventAuthorityAccount

func (inst *SetParams) GetEventAuthorityAccount() *ag_solanago.AccountMeta

GetEventAuthorityAccount gets the "eventAuthority" account.

func (*SetParams) GetGlobalAccount

func (inst *SetParams) GetGlobalAccount() *ag_solanago.AccountMeta

GetGlobalAccount gets the "global" account.

func (*SetParams) GetProgramAccount

func (inst *SetParams) GetProgramAccount() *ag_solanago.AccountMeta

GetProgramAccount gets the "program" account.

func (*SetParams) GetSystemProgramAccount

func (inst *SetParams) GetSystemProgramAccount() *ag_solanago.AccountMeta

GetSystemProgramAccount gets the "systemProgram" account.

func (*SetParams) GetUserAccount

func (inst *SetParams) GetUserAccount() *ag_solanago.AccountMeta

GetUserAccount gets the "user" account.

func (SetParams) MarshalWithEncoder

func (obj SetParams) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*SetParams) SetEventAuthorityAccount

func (inst *SetParams) SetEventAuthorityAccount(eventAuthority ag_solanago.PublicKey) *SetParams

SetEventAuthorityAccount sets the "eventAuthority" account.

func (*SetParams) SetFeeBasisPoints

func (inst *SetParams) SetFeeBasisPoints(feeBasisPoints uint64) *SetParams

SetFeeBasisPoints sets the "feeBasisPoints" parameter.

func (*SetParams) SetFeeRecipient

func (inst *SetParams) SetFeeRecipient(feeRecipient ag_solanago.PublicKey) *SetParams

SetFeeRecipient sets the "feeRecipient" parameter.

func (*SetParams) SetGlobalAccount

func (inst *SetParams) SetGlobalAccount(global ag_solanago.PublicKey) *SetParams

SetGlobalAccount sets the "global" account.

func (*SetParams) SetInitialRealTokenReserves

func (inst *SetParams) SetInitialRealTokenReserves(initialRealTokenReserves uint64) *SetParams

SetInitialRealTokenReserves sets the "initialRealTokenReserves" parameter.

func (*SetParams) SetInitialVirtualSolReserves

func (inst *SetParams) SetInitialVirtualSolReserves(initialVirtualSolReserves uint64) *SetParams

SetInitialVirtualSolReserves sets the "initialVirtualSolReserves" parameter.

func (*SetParams) SetInitialVirtualTokenReserves

func (inst *SetParams) SetInitialVirtualTokenReserves(initialVirtualTokenReserves uint64) *SetParams

SetInitialVirtualTokenReserves sets the "initialVirtualTokenReserves" parameter.

func (*SetParams) SetProgramAccount

func (inst *SetParams) SetProgramAccount(program ag_solanago.PublicKey) *SetParams

SetProgramAccount sets the "program" account.

func (*SetParams) SetSystemProgramAccount

func (inst *SetParams) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *SetParams

SetSystemProgramAccount sets the "systemProgram" account.

func (*SetParams) SetTokenTotalSupply

func (inst *SetParams) SetTokenTotalSupply(tokenTotalSupply uint64) *SetParams

SetTokenTotalSupply sets the "tokenTotalSupply" parameter.

func (*SetParams) SetUserAccount

func (inst *SetParams) SetUserAccount(user ag_solanago.PublicKey) *SetParams

SetUserAccount sets the "user" account.

func (*SetParams) UnmarshalWithDecoder

func (obj *SetParams) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*SetParams) Validate

func (inst *SetParams) Validate() error

func (SetParams) ValidateAndBuild

func (inst SetParams) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type Withdraw

type Withdraw struct {

	// [0] = [] global
	//
	// [1] = [] mint
	//
	// [2] = [WRITE] bondingCurve
	//
	// [3] = [WRITE] associatedBondingCurve
	//
	// [4] = [WRITE] associatedUser
	//
	// [5] = [WRITE, SIGNER] user
	//
	// [6] = [] systemProgram
	//
	// [7] = [] tokenProgram
	//
	// [8] = [] rent
	//
	// [9] = [] eventAuthority
	//
	// [10] = [] program
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Allows the admin to withdraw liquidity for a migration once the bonding curve completes

func NewWithdrawInstruction

func NewWithdrawInstruction(

	global ag_solanago.PublicKey,
	mint ag_solanago.PublicKey,
	bondingCurve ag_solanago.PublicKey,
	associatedBondingCurve ag_solanago.PublicKey,
	associatedUser ag_solanago.PublicKey,
	user ag_solanago.PublicKey,
	systemProgram ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey,
	rent ag_solanago.PublicKey,
	eventAuthority ag_solanago.PublicKey,
	program ag_solanago.PublicKey) *Withdraw

NewWithdrawInstruction declares a new Withdraw instruction with the provided parameters and accounts.

func NewWithdrawInstructionBuilder

func NewWithdrawInstructionBuilder() *Withdraw

NewWithdrawInstructionBuilder creates a new `Withdraw` instruction builder.

func (Withdraw) Build

func (inst Withdraw) Build() *Instruction

func (*Withdraw) EncodeToTree

func (inst *Withdraw) EncodeToTree(parent ag_treeout.Branches)

func (*Withdraw) GetAssociatedBondingCurveAccount

func (inst *Withdraw) GetAssociatedBondingCurveAccount() *ag_solanago.AccountMeta

GetAssociatedBondingCurveAccount gets the "associatedBondingCurve" account.

func (*Withdraw) GetAssociatedUserAccount

func (inst *Withdraw) GetAssociatedUserAccount() *ag_solanago.AccountMeta

GetAssociatedUserAccount gets the "associatedUser" account.

func (*Withdraw) GetBondingCurveAccount

func (inst *Withdraw) GetBondingCurveAccount() *ag_solanago.AccountMeta

GetBondingCurveAccount gets the "bondingCurve" account.

func (*Withdraw) GetEventAuthorityAccount

func (inst *Withdraw) GetEventAuthorityAccount() *ag_solanago.AccountMeta

GetEventAuthorityAccount gets the "eventAuthority" account.

func (*Withdraw) GetGlobalAccount

func (inst *Withdraw) GetGlobalAccount() *ag_solanago.AccountMeta

GetGlobalAccount gets the "global" account.

func (*Withdraw) GetMintAccount

func (inst *Withdraw) GetMintAccount() *ag_solanago.AccountMeta

GetMintAccount gets the "mint" account.

func (*Withdraw) GetProgramAccount

func (inst *Withdraw) GetProgramAccount() *ag_solanago.AccountMeta

GetProgramAccount gets the "program" account.

func (*Withdraw) GetRentAccount

func (inst *Withdraw) GetRentAccount() *ag_solanago.AccountMeta

GetRentAccount gets the "rent" account.

func (*Withdraw) GetSystemProgramAccount

func (inst *Withdraw) GetSystemProgramAccount() *ag_solanago.AccountMeta

GetSystemProgramAccount gets the "systemProgram" account.

func (*Withdraw) GetTokenProgramAccount

func (inst *Withdraw) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account.

func (*Withdraw) GetUserAccount

func (inst *Withdraw) GetUserAccount() *ag_solanago.AccountMeta

GetUserAccount gets the "user" account.

func (Withdraw) MarshalWithEncoder

func (obj Withdraw) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*Withdraw) SetAssociatedBondingCurveAccount

func (inst *Withdraw) SetAssociatedBondingCurveAccount(associatedBondingCurve ag_solanago.PublicKey) *Withdraw

SetAssociatedBondingCurveAccount sets the "associatedBondingCurve" account.

func (*Withdraw) SetAssociatedUserAccount

func (inst *Withdraw) SetAssociatedUserAccount(associatedUser ag_solanago.PublicKey) *Withdraw

SetAssociatedUserAccount sets the "associatedUser" account.

func (*Withdraw) SetBondingCurveAccount

func (inst *Withdraw) SetBondingCurveAccount(bondingCurve ag_solanago.PublicKey) *Withdraw

SetBondingCurveAccount sets the "bondingCurve" account.

func (*Withdraw) SetEventAuthorityAccount

func (inst *Withdraw) SetEventAuthorityAccount(eventAuthority ag_solanago.PublicKey) *Withdraw

SetEventAuthorityAccount sets the "eventAuthority" account.

func (*Withdraw) SetGlobalAccount

func (inst *Withdraw) SetGlobalAccount(global ag_solanago.PublicKey) *Withdraw

SetGlobalAccount sets the "global" account.

func (*Withdraw) SetMintAccount

func (inst *Withdraw) SetMintAccount(mint ag_solanago.PublicKey) *Withdraw

SetMintAccount sets the "mint" account.

func (*Withdraw) SetProgramAccount

func (inst *Withdraw) SetProgramAccount(program ag_solanago.PublicKey) *Withdraw

SetProgramAccount sets the "program" account.

func (*Withdraw) SetRentAccount

func (inst *Withdraw) SetRentAccount(rent ag_solanago.PublicKey) *Withdraw

SetRentAccount sets the "rent" account.

func (*Withdraw) SetSystemProgramAccount

func (inst *Withdraw) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Withdraw

SetSystemProgramAccount sets the "systemProgram" account.

func (*Withdraw) SetTokenProgramAccount

func (inst *Withdraw) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *Withdraw

SetTokenProgramAccount sets the "tokenProgram" account.

func (*Withdraw) SetUserAccount

func (inst *Withdraw) SetUserAccount(user ag_solanago.PublicKey) *Withdraw

SetUserAccount sets the "user" account.

func (*Withdraw) UnmarshalWithDecoder

func (obj *Withdraw) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*Withdraw) Validate

func (inst *Withdraw) Validate() error

func (Withdraw) ValidateAndBuild

func (inst Withdraw) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL