Documentation ¶
Index ¶
- Constants
- Variables
- func GetPreSwapStateAddress(args *GetPreSwapStateAddressArgs) (ed25519.PublicKey, uint8, error)
- type AccountMeta
- type GetPreSwapStateAddressArgs
- type Instruction
- type PostSwapInstructionAccounts
- type PostSwapInstructionArgs
- type PreSwapInstructionAccounts
- type PreSwapInstructionArgs
- type SwapValidatorError
Constants ¶
View Source
const ( PostSwapInstructionArgsSize = (1 + 8 + 8) // MinToReceive )
View Source
const (
PreSwapInstructionArgsSize = 0
)
Variables ¶
View Source
var ( ErrInvalidProgram = errors.New("invalid program id") ErrInvalidAccountData = errors.New("unexpected account data") ErrInvalidInstructionData = errors.New("unexpected instruction data") )
View Source
var ( PROGRAM_ADDRESS = mustBase58Decode("sWvA66HNNvgamibZe88v3NN5nQwE8tp3KitfViFjukA") PROGRAM_ID = ed25519.PublicKey(PROGRAM_ADDRESS) )
View Source
var ( SYSTEM_PROGRAM_ID = ed25519.PublicKey(mustBase58Decode("11111111111111111111111111111111")) SYSVAR_RENT_PUBKEY = ed25519.PublicKey(mustBase58Decode("SysvarRent111111111111111111111111111111111")) )
Functions ¶
func GetPreSwapStateAddress ¶
func GetPreSwapStateAddress(args *GetPreSwapStateAddressArgs) (ed25519.PublicKey, uint8, error)
Types ¶
type AccountMeta ¶
AccountMeta represents the account information required for building transactions.
type Instruction ¶
type Instruction struct { Program ed25519.PublicKey Accounts []AccountMeta Data []byte }
Instruction represents a transaction instruction.
func NewPostSwapInstruction ¶
func NewPostSwapInstruction( accounts *PostSwapInstructionAccounts, args *PostSwapInstructionArgs, ) Instruction
func NewPreSwapInstruction ¶
func NewPreSwapInstruction( accounts *PreSwapInstructionAccounts, args *PreSwapInstructionArgs, ) Instruction
func (Instruction) ToLegacyInstruction ¶
func (i Instruction) ToLegacyInstruction() solana.Instruction
type PostSwapInstructionArgs ¶
type PreSwapInstructionArgs ¶
type PreSwapInstructionArgs struct { }
type SwapValidatorError ¶
type SwapValidatorError uint32
const ( // Invalid input token amount sent InvalidInputTokenAmountSent SwapValidatorError = iota + 0x1770 // Invalid output token amount received InvalidOutputTokenAmountReceived // Unexpected writable user account UnexpectedWritableUserAccount // Unexpected update to user token account UnexpectedUserTokenAccountUpdate )
Click to show internal directories.
Click to hide internal directories.