types

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MPL-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	GetProgramID() string
	GetProgramName() string
	GetInstructionName() string
}

type BaseAction

type BaseAction struct {
	ProgramID       string `json:"programId"`
	ProgramName     string `json:"programName"`
	InstructionName string `json:"instructionName"`
}

func (BaseAction) GetInstructionName

func (a BaseAction) GetInstructionName() string

func (BaseAction) GetProgramID

func (a BaseAction) GetProgramID() string

func (BaseAction) GetProgramName

func (a BaseAction) GetProgramName() string

type ComputeBudgetSetComputeUnitLimitAction

type ComputeBudgetSetComputeUnitLimitAction struct {
	BaseAction
	ComputeUnitLimit uint32 `json:"computeUnitLimit"`
}

type ComputeBudgetSetComputeUnitPriceAction

type ComputeBudgetSetComputeUnitPriceAction struct {
	BaseAction
	MicroLamports uint64 `json:"microLamports"`
}
type Header struct {
	NumReadonlySignedAccounts   int `json:"numReadonlySignedAccounts"`
	NumReadonlyUnsignedAccounts int `json:"numReadonlyUnsignedAccounts"`
	NumRequiredSignatures       int `json:"numRequiredSignatures"`
}

type InnerInstructions

type InnerInstructions struct {
	Index        int           `json:"index"`
	Instructions []Instruction `json:"instructions"`
}

type Instruction

type Instruction struct {
	Accounts       []int  `json:"accounts"`
	Data           string `json:"data"`
	ProgramIDIndex int    `json:"programIdIndex"`
	StackHeight    *int   `json:"stackHeight"`
}

type JupiterAggregatorV6RouteAction added in v0.3.0

type JupiterAggregatorV6RouteAction struct {
	BaseAction
	Who               string `json:"who"`
	FromToken         string `json:"fromToken"`
	FromTokenAmount   uint64 `json:"fromTokenAmount"`
	FromTokenDecimals uint64 `json:"fromTokenDecimals"`
	ToToken           string `json:"toToken"`
	ToTokenAmount     uint64 `json:"toTokenAmount"`
	ToTokenDecimals   uint64 `json:"toTokenDecimals"`
}

type JupiterAggregatorV6SharedAccountRouteAction added in v0.3.0

type JupiterAggregatorV6SharedAccountRouteAction struct {
	BaseAction
	Who               string `json:"who"`
	FromToken         string `json:"fromToken"`
	FromTokenAmount   uint64 `json:"fromTokenAmount"`
	FromTokenDecimals uint64 `json:"fromTokenDecimals"`
	ToToken           string `json:"toToken"`
	ToTokenAmount     uint64 `json:"toTokenAmount"`
	ToTokenDecimals   uint64 `json:"toTokenDecimals"`
}

type JupiterDcaCloseDcaAction

type JupiterDcaCloseDcaAction struct {
	BaseAction
	User       string `json:"user"`
	Dca        string `json:"dca"`
	InputMint  string `json:"inputMint"`
	OutputMint string `json:"outputMint"`
	InAta      string `json:"inAta"`
	OutAta     string `json:"outAta"`
	UserInAta  string `json:"userInAta"`
	UserOutAta string `json:"userOutAta"`
}

type JupiterDcaDepositAction

type JupiterDcaDepositAction struct {
	BaseAction
	DepositIn uint64 `json:"depositIn"`
	User      string `json:"user"`
	Dca       string `json:"dca"`
	InAta     string `json:"inAta"`
	UserInAta string `json:"userInAta"`
}

type JupiterDcaEndAndCloseAction

type JupiterDcaEndAndCloseAction struct {
	BaseAction
	Keeper     string `json:"keeper"`
	Dca        string `json:"dca"`
	InputMint  string `json:"inputMint"`
	OutputMint string `json:"outputMint"`
	InAta      string `json:"inAta"`
	OutAta     string `json:"outAta"`
	User       string `json:"user"`
	UserOutAta string `json:"userOutAta"`
}

type JupiterDcaOpenV2Action

type JupiterDcaOpenV2Action struct {
	BaseAction
	InAmount         uint64  `json:"inAmount"`
	InAmountPerCycle uint64  `json:"inAmountPerCycle"`
	CycleFrequency   int64   `json:"cycleFrequency"`
	MinOutAmount     *uint64 `json:"minOutAmount"`
	MaxOutAmount     *uint64 `json:"maxOutAmount"`
	StartAt          *int64  `json:"startAt"`

	Dca        string `json:"dca"`
	User       string `json:"user"`
	Payer      string `json:"payer"`
	InputMint  string `json:"inputMint"`
	OutputMint string `json:"outputMint"`
	UserAta    string `json:"userAta"`
	InAta      string `json:"inAta"`
	OutAta     string `json:"payerAta"`
}

type JupiterWithDrawAction

type JupiterWithDrawAction struct {
	BaseAction
	// WithDrawParams
	// ...
	// 58eYP8XhJKfVNm189hQinBcLacDqiYXnTadwzxXbdh9ssDNnmBi9FqaMKMkzgeiykfCDGowfREfh8p7Gziggikm9
	User       string `json:"user"`
	Dca        string `json:"dca"`
	InputMint  string `json:"inputMint"`
	OutputMint string `json:"outputMint"`
	DcaAta     string `json:"dcaAta"`
	UserInAta  string `json:"userInAta"`
	UserOutAta string `json:"userOutAta"`
}

type LoadedAddresses

type LoadedAddresses struct {
	Readonly []string `json:"readonly"`
	Writable []string `json:"writable"`
}

type Message

type Message struct {
	AccountKeys         []string      `json:"accountKeys"`
	AddressTableLookups interface{}   `json:"addressTableLookups"`
	Header              Header        `json:"header"`
	Instructions        []Instruction `json:"instructions"`
	RecentBlockHash     string        `json:"recentBlockhash"`
}

type Meta

type Meta struct {
	Err               interface{}         `json:"err"`
	Fee               uint64              `json:"fee"`
	InnerInstructions []InnerInstructions `json:"innerInstructions"`
	LoadedAddresses   LoadedAddresses     `json:"loadedAddresses"`
	LogMessages       []string            `json:"logMessages"`
	PostBalances      []uint64            `json:"postBalances"`
	PostTokenBalances []TokenBalance      `json:"postTokenBalances"`
	PreBalances       []uint64            `json:"preBalances"`
	PreTokenBalances  []TokenBalance      `json:"preTokenBalances"`
	Rewards           []interface{}       `json:"rewards"`
}

type ParsedResult

type ParsedResult struct {
	RawTx       RawTx    `json:"rawTx"`
	AccountList []string `json:"accountList"`
	Actions     []Action `json:"actions"`
}

type ParsedTx

type ParsedTx struct {
	AccountData []struct {
		Account             string        `json:"account"`
		NativeBalanceChange float64       `json:"nativeBalanceChange"`
		TokenBalanceChanges []interface{} `json:"tokenBalanceChanges"`
	} `json:"accountData"`
	Description  string `json:"description"`
	Fee          int    `json:"fee"`
	FeePayer     string `json:"feePayer"`
	Instructions []struct {
		Accounts          []string `json:"accounts"`
		Data              string   `json:"data"`
		InnerInstructions []struct {
			Accounts  []string `json:"accounts"`
			Data      string   `json:"data"`
			ProgramID string   `json:"programId"`
		} `json:"innerInstructions"`
		ProgramID string `json:"programId"`
	} `json:"instructions"`
	NativeTransfers []struct {
		Amount          float64 `json:"amount"`
		FromUserAccount string  `json:"fromUserAccount"`
		ToUserAccount   string  `json:"toUserAccount"`
	} `json:"nativeTransfers"`
	Signature      string `json:"signature"`
	Slot           int    `json:"slot"`
	Source         string `json:"source"`
	Timestamp      int    `json:"timestamp"`
	TokenTransfers []struct {
		FromTokenAccount string  `json:"fromTokenAccount"`
		FromUserAccount  string  `json:"fromUserAccount"`
		Mint             string  `json:"mint"`
		ToTokenAccount   string  `json:"toTokenAccount"`
		ToUserAccount    string  `json:"toUserAccount"`
		TokenAmount      float64 `json:"tokenAmount"`
		TokenStandard    string  `json:"tokenStandard"`
	} `json:"tokenTransfers"`
	TransactionError interface{} `json:"transactionError"`
	Type             string      `json:"type"`
}

type PumpFunAnchorSelfCPILogSwapAction added in v0.4.0

type PumpFunAnchorSelfCPILogSwapAction struct {
	BaseAction
	Mint                 string `json:"mint"`
	SolAmount            uint64 `json:"solAmount"`
	TokenAmount          uint64 `json:"tokenAmount"`
	IsBuy                bool   `json:"isBuy"`
	User                 string `json:"user"`
	Timestamp            int64  `json:"timestamp"`
	VirtualSolReserves   uint64 `json:"virtualSolReserves"`
	VirtualTokenReserves uint64 `json:"virtualTokenReserves"`
}

type PumpFunBuyAction

type PumpFunBuyAction struct {
	BaseAction
	Who             string `json:"who"`
	FromToken       string `json:"fromToken"`
	FromTokenAmount uint64 `json:"fromTokenAmount"`
	ToToken         string `json:"toToken"`
	ToTokenAmount   uint64 `json:"toTokenAmount"`
	MaxSolCost      uint64 `json:"maxSolCost"`
}

type PumpFunCreateAction added in v0.2.0

type PumpFunCreateAction struct {
	BaseAction
	Who                    string `json:"who"`
	Mint                   string `json:"mint"`
	MintAuthority          string `json:"mintAuthority"`
	BondingCurve           string `json:"bondingCurve"`
	AssociatedBondingCurve string `json:"associatedBondingCurve"`
	MplTokenMetadata       string `json:"mplTokenMetadata"`
	MetaData               string `json:"metaData"`

	Name   string `json:"name"`
	Symbol string `json:"symbol"`
	Uri    string `json:"uri"`
}

type PumpFunSellAction

type PumpFunSellAction struct {
	BaseAction
	Who             string `json:"who"`
	FromToken       string `json:"fromToken"`
	FromTokenAmount uint64 `json:"fromTokenAmount"`
	ToToken         string `json:"toToken"`
	ToTokenAmount   uint64 `json:"toTokenAmount"`
	MinSolOutput    uint64 `json:"minSolOutput"`
}

type RPCResponse added in v0.2.0

type RPCResponse struct {
	JsonRPC string `json:"jsonrpc"`
	Result  RawTx  `json:"result"`
	ID      int    `json:"id"`
}

type RawTx

type RawTx struct {
	BlockTime        int64       `json:"blockTime"`
	IndexWithinBlock int64       `json:"indexWithinBlock"`
	Meta             Meta        `json:"meta"`
	Slot             int64       `json:"slot"`
	Transaction      Transaction `json:"transaction"`
}

type RawTxs

type RawTxs []RawTx

type RaydiumLiquidityPoolV4SwapAction added in v0.2.0

type RaydiumLiquidityPoolV4SwapAction struct {
	BaseAction
	Who               string `json:"who"`
	FromToken         string `json:"fromToken"`
	FromTokenAmount   uint64 `json:"fromTokenAmount"`
	FromTokenDecimals uint64 `json:"fromTokenDecimals"`
	ToToken           string `json:"toToken"`
	ToTokenAmount     uint64 `json:"toTokenAmount"`
	ToTokenDecimals   uint64 `json:"toTokenDecimals"`

	MinimumAmountOut uint64 `json:"minimumAmountOut"`
}

type SystemProgramCreateAccountWithSeedAction added in v0.2.0

type SystemProgramCreateAccountWithSeedAction struct {
	BaseAction
	Who        string `json:"who"`
	NewAccount string `json:"newAccount"`
	Base       string `json:"base"`
	Seed       string `json:"seed"`
	Lamports   uint64 `json:"lamports"`
	Space      uint64 `json:"space"`
	Owner      string `json:"owner"`
}

type SystemProgramTransferAction

type SystemProgramTransferAction struct {
	BaseAction
	From     string `json:"from"`
	To       string `json:"to"`
	Lamports uint64 `json:"lamports"`
}

type TokenBalance

type TokenBalance struct {
	AccountIndex  int           `json:"accountIndex"`
	Mint          string        `json:"mint"`
	Owner         string        `json:"owner"`
	ProgramID     string        `json:"programId"`
	UITokenAmount UITokenAmount `json:"uiTokenAmount"`
}

type TokenProgramInitializeAccountAction added in v0.2.0

type TokenProgramInitializeAccountAction struct {
	BaseAction
	Account    string `json:"account"`
	Mint       string `json:"mint"`
	Owner      string `json:"owner"`
	RentSysvar string `json:"rentSysvar"`
}

type TokenProgramTransferAction

type TokenProgramTransferAction struct {
	BaseAction
	From   string `json:"from"`
	To     string `json:"to"`
	Amount uint64 `json:"amount"`
}

type TokenProgramTransferCheckedAction

type TokenProgramTransferCheckedAction struct {
	BaseAction
	From     string `json:"from"`
	To       string `json:"to"`
	Amount   uint64 `json:"amount"`
	Mint     string `json:"mint"`
	Decimals uint64 `json:"decimals"`
}

type Transaction

type Transaction struct {
	Message    Message  `json:"message"`
	Signatures []string `json:"signatures"`
}

type UITokenAmount

type UITokenAmount struct {
	Amount         string  `json:"amount"`
	Decimals       uint64  `json:"decimals"`
	UIAmount       float64 `json:"uiAmount"`
	UIAmountString string  `json:"uiAmountString"`
}

type UnknownAction

type UnknownAction struct {
	BaseAction
	Error error `json:"error"`
}

Jump to

Keyboard shortcuts

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