escrow_token_mint

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ProgramName = "EscrowTokenMint"

Variables

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

	Instruction_Swap = ag_binary.TypeID([8]byte{248, 198, 158, 145, 225, 117, 135, 200})

	Instruction_Sweep = ag_binary.TypeID([8]byte{40, 23, 234, 175, 14, 61, 154, 177})
)
View Source
var FaucetDiscriminator = [8]byte{146, 11, 249, 142, 199, 197, 61, 0}
View Source
var InstructionImplDef = ag_binary.NewVariantDefinition(
	ag_binary.AnchorTypeIDEncoding,
	[]ag_binary.VariantType{
		{
			"initialize", (*Initialize)(nil),
		},
		{
			"swap", (*Swap)(nil),
		},
		{
			"sweep", (*Sweep)(nil),
		},
	},
)
View Source
var ProgramID ag_solanago.PublicKey = ag_solanago.MustPublicKeyFromBase58("EoHnnTLWwErHgWyMvapADVfR9NRF3jUthDXgHqdDNAqm")

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 Faucet

type Faucet struct {
	Authority ag_solanago.PublicKey
	Mint      ag_solanago.PublicKey
}

func (Faucet) MarshalWithEncoder

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

func (*Faucet) UnmarshalWithDecoder

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

type Initialize

type Initialize struct {

	// [0] = [WRITE, SIGNER] authority
	//
	// [1] = [WRITE] tokenMint
	//
	// [2] = [WRITE] faucet
	//
	// [3] = [] systemProgram
	//
	// [4] = [] rent
	//
	// [5] = [] tokenProgram
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Initialize is the `initialize` instruction.

func NewInitializeInstruction

func NewInitializeInstruction(

	authority ag_solanago.PublicKey,
	tokenMint ag_solanago.PublicKey,
	faucet ag_solanago.PublicKey,
	systemProgram ag_solanago.PublicKey,
	rent ag_solanago.PublicKey,
	tokenProgram 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) GetAuthorityAccount

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

GetAuthorityAccount gets the "authority" account.

func (*Initialize) GetFaucetAccount

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

GetFaucetAccount gets the "faucet" account.

func (*Initialize) GetRentAccount

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

GetRentAccount gets the "rent" account.

func (*Initialize) GetSystemProgramAccount

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

GetSystemProgramAccount gets the "systemProgram" account.

func (*Initialize) GetTokenMintAccount

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

GetTokenMintAccount gets the "tokenMint" account.

func (*Initialize) GetTokenProgramAccount

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

GetTokenProgramAccount gets the "tokenProgram" account.

func (Initialize) MarshalWithEncoder

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

func (*Initialize) SetAuthorityAccount

func (inst *Initialize) SetAuthorityAccount(authority ag_solanago.PublicKey) *Initialize

SetAuthorityAccount sets the "authority" account.

func (*Initialize) SetFaucetAccount

func (inst *Initialize) SetFaucetAccount(faucet ag_solanago.PublicKey) *Initialize

SetFaucetAccount sets the "faucet" account.

func (*Initialize) SetRentAccount

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

SetRentAccount sets the "rent" account.

func (*Initialize) SetSystemProgramAccount

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

SetSystemProgramAccount sets the "systemProgram" account.

func (*Initialize) SetTokenMintAccount

func (inst *Initialize) SetTokenMintAccount(tokenMint ag_solanago.PublicKey) *Initialize

SetTokenMintAccount sets the "tokenMint" account.

func (*Initialize) SetTokenProgramAccount

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

SetTokenProgramAccount sets the "tokenProgram" 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 Swap

type Swap struct {
	Lamports *uint64

	// [0] = [WRITE, SIGNER] depositor
	//
	// [1] = [WRITE] receiverTokenAccount
	//
	// [2] = [WRITE] tokenMint
	//
	// [3] = [WRITE] faucet
	//
	// [4] = [] vaultAuthority
	//
	// [5] = [] systemProgram
	//
	// [6] = [] tokenProgram
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Swap is the `swap` instruction.

func NewSwapInstruction

func NewSwapInstruction(

	lamports uint64,

	depositor ag_solanago.PublicKey,
	receiverTokenAccount ag_solanago.PublicKey,
	tokenMint ag_solanago.PublicKey,
	faucet ag_solanago.PublicKey,
	vaultAuthority ag_solanago.PublicKey,
	systemProgram ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey) *Swap

NewSwapInstruction declares a new Swap instruction with the provided parameters and accounts.

func NewSwapInstructionBuilder

func NewSwapInstructionBuilder() *Swap

NewSwapInstructionBuilder creates a new `Swap` instruction builder.

func (Swap) Build

func (inst Swap) Build() *Instruction

func (*Swap) EncodeToTree

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

func (*Swap) GetDepositorAccount

func (inst *Swap) GetDepositorAccount() *ag_solanago.AccountMeta

GetDepositorAccount gets the "depositor" account.

func (*Swap) GetFaucetAccount

func (inst *Swap) GetFaucetAccount() *ag_solanago.AccountMeta

GetFaucetAccount gets the "faucet" account.

func (*Swap) GetReceiverTokenAccountAccount

func (inst *Swap) GetReceiverTokenAccountAccount() *ag_solanago.AccountMeta

GetReceiverTokenAccountAccount gets the "receiverTokenAccount" account.

func (*Swap) GetSystemProgramAccount

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

GetSystemProgramAccount gets the "systemProgram" account.

func (*Swap) GetTokenMintAccount

func (inst *Swap) GetTokenMintAccount() *ag_solanago.AccountMeta

GetTokenMintAccount gets the "tokenMint" account.

func (*Swap) GetTokenProgramAccount

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

GetTokenProgramAccount gets the "tokenProgram" account.

func (*Swap) GetVaultAuthorityAccount

func (inst *Swap) GetVaultAuthorityAccount() *ag_solanago.AccountMeta

GetVaultAuthorityAccount gets the "vaultAuthority" account.

func (Swap) MarshalWithEncoder

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

func (*Swap) SetDepositorAccount

func (inst *Swap) SetDepositorAccount(depositor ag_solanago.PublicKey) *Swap

SetDepositorAccount sets the "depositor" account.

func (*Swap) SetFaucetAccount

func (inst *Swap) SetFaucetAccount(faucet ag_solanago.PublicKey) *Swap

SetFaucetAccount sets the "faucet" account.

func (*Swap) SetLamports

func (inst *Swap) SetLamports(lamports uint64) *Swap

SetLamports sets the "lamports" parameter.

func (*Swap) SetReceiverTokenAccountAccount

func (inst *Swap) SetReceiverTokenAccountAccount(receiverTokenAccount ag_solanago.PublicKey) *Swap

SetReceiverTokenAccountAccount sets the "receiverTokenAccount" account.

func (*Swap) SetSystemProgramAccount

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

SetSystemProgramAccount sets the "systemProgram" account.

func (*Swap) SetTokenMintAccount

func (inst *Swap) SetTokenMintAccount(tokenMint ag_solanago.PublicKey) *Swap

SetTokenMintAccount sets the "tokenMint" account.

func (*Swap) SetTokenProgramAccount

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

SetTokenProgramAccount sets the "tokenProgram" account.

func (*Swap) SetVaultAuthorityAccount

func (inst *Swap) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *Swap

SetVaultAuthorityAccount sets the "vaultAuthority" account.

func (*Swap) UnmarshalWithDecoder

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

func (*Swap) Validate

func (inst *Swap) Validate() error

func (Swap) ValidateAndBuild

func (inst Swap) 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 Sweep

type Sweep struct {
	Lamports *uint64

	// [0] = [WRITE, SIGNER] authority
	//
	// [1] = [WRITE] faucet
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Sweep is the `sweep` instruction.

func NewSweepInstruction

func NewSweepInstruction(

	lamports uint64,

	authority ag_solanago.PublicKey,
	faucet ag_solanago.PublicKey) *Sweep

NewSweepInstruction declares a new Sweep instruction with the provided parameters and accounts.

func NewSweepInstructionBuilder

func NewSweepInstructionBuilder() *Sweep

NewSweepInstructionBuilder creates a new `Sweep` instruction builder.

func (Sweep) Build

func (inst Sweep) Build() *Instruction

func (*Sweep) EncodeToTree

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

func (*Sweep) GetAuthorityAccount

func (inst *Sweep) GetAuthorityAccount() *ag_solanago.AccountMeta

GetAuthorityAccount gets the "authority" account.

func (*Sweep) GetFaucetAccount

func (inst *Sweep) GetFaucetAccount() *ag_solanago.AccountMeta

GetFaucetAccount gets the "faucet" account.

func (Sweep) MarshalWithEncoder

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

func (*Sweep) SetAuthorityAccount

func (inst *Sweep) SetAuthorityAccount(authority ag_solanago.PublicKey) *Sweep

SetAuthorityAccount sets the "authority" account.

func (*Sweep) SetFaucetAccount

func (inst *Sweep) SetFaucetAccount(faucet ag_solanago.PublicKey) *Sweep

SetFaucetAccount sets the "faucet" account.

func (*Sweep) SetLamports

func (inst *Sweep) SetLamports(lamports uint64) *Sweep

SetLamports sets the "lamports" parameter.

func (*Sweep) UnmarshalWithDecoder

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

func (*Sweep) Validate

func (inst *Sweep) Validate() error

func (Sweep) ValidateAndBuild

func (inst Sweep) 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