tx_input

package
v0.0.0-...-d4ead40 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const SafetyTimeoutMargin = (5 * time.Minute)

Solana recent-block-hash timeout margin

Variables

This section is empty.

Functions

This section is empty.

Types

type ExistingStake

type ExistingStake struct {
	ActivationEpoch   xc.AmountBlockchain `json:"activation_epoch"`
	DeactivationEpoch xc.AmountBlockchain `json:"deactivation_epoch"`
	// The total activating-or-activated amount
	AmountActive xc.AmountBlockchain `json:"amount_active"`
	// unlocked/inactive amount
	AmountInactive xc.AmountBlockchain `json:"amount_inactive"`
	// ValidatorVoteAccount solana.PublicKey    `json:"validator_vote_account"`
	StakeAccount solana.PublicKey `json:"stake_account"`
}

type StakingInput

type StakingInput struct {
	TxInput
	ValidatorVoteAccount solana.PublicKey `json:"validator_vote_account"`
	// The new staking account to create
	StakingKey solana.PrivateKey `json:"staking_key"`
}

func (*StakingInput) GetVariant

func (*StakingInput) GetVariant() xc.TxVariantInputType

func (*StakingInput) Staking

func (*StakingInput) Staking()

type TokenAccount

type TokenAccount struct {
	Account solana.PublicKey    `json:"account,omitempty"`
	Balance xc.AmountBlockchain `json:"balance,omitempty"`
}

type TxInput

type TxInput struct {
	xc.TxInputEnvelope
	RecentBlockHash     solana.Hash         `json:"recent_block_hash,omitempty"`
	ToIsATA             bool                `json:"to_is_ata,omitempty"`
	TokenProgram        solana.PublicKey    `json:"token_program"`
	ShouldCreateATA     bool                `json:"should_create_ata,omitempty"`
	SourceTokenAccounts []*TokenAccount     `json:"source_token_accounts,omitempty"`
	PrioritizationFee   xc.AmountBlockchain `json:"prioritization_fee,omitempty"`
	Timestamp           int64               `json:"timestamp,omitempty"`
}

TxInput for Solana

func NewTxInput

func NewTxInput() *TxInput

NewTxInput returns a new Solana TxInput

func (*TxInput) GetDriver

func (input *TxInput) GetDriver() xc.Driver

func (*TxInput) GetFeeLimit

func (input *TxInput) GetFeeLimit() (xc.AmountBlockchain, xc.ContractAddress)

func (*TxInput) GetPrioritizationFee

func (input *TxInput) GetPrioritizationFee() uint64

Returns the microlamports to set the compute budget unit price. It will not go about the max price amount for safety concerns.

func (*TxInput) IndependentOf

func (input *TxInput) IndependentOf(other xc.TxInput) (independent bool)

func (*TxInput) SafeFromDoubleSend

func (input *TxInput) SafeFromDoubleSend(others ...xc.TxInput) (safe bool)

func (*TxInput) SetGasFeePriority

func (input *TxInput) SetGasFeePriority(other xc.GasFeePriority) error

func (*TxInput) SetUnix

func (input *TxInput) SetUnix(unix int64)

type UnstakingInput

type UnstakingInput struct {
	TxInput

	// The new staking account to create in the event of a split occuring
	StakingKey     solana.PrivateKey `json:"staking_key"`
	EligibleStakes []*ExistingStake  `json:"eligible_stakes"`
}

func (*UnstakingInput) GetVariant

func (*UnstakingInput) GetVariant() xc.TxVariantInputType

func (*UnstakingInput) Unstaking

func (*UnstakingInput) Unstaking()

type WithdrawInput

type WithdrawInput struct {
	TxInput
	EligibleStakes []*ExistingStake `json:"eligible_stakes"`
}

func (*WithdrawInput) GetVariant

func (*WithdrawInput) GetVariant() xc.TxVariantInputType

func (*WithdrawInput) Withdrawing

func (*WithdrawInput) Withdrawing()

Jump to

Keyboard shortcuts

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