transaction

package
v0.0.0-...-c6effd4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAvailableNonces = errors.New("no available nonces")
)

Functions

func MakeCompressAccountTransaction

func MakeCompressAccountTransaction(
	nonce *common.Account,
	bh solana.Blockhash,

	vm *common.Account,
	memory *common.Account,
	accountIndex uint16,
	storage *common.Account,
	virtualAccountState []byte,
) (solana.Transaction, error)

func MakeExternalTransferWithAuthorityTransaction

func MakeExternalTransferWithAuthorityTransaction(
	nonce *common.Account,
	bh solana.Blockhash,

	virtualSignature solana.Signature,

	vm *common.Account,
	vmOmnibus *common.Account,

	nonceMemory *common.Account,
	nonceIndex uint16,
	sourceMemory *common.Account,
	sourceIndex uint16,

	externalDestination *common.Account,
	kinAmountInQuarks uint64,
) (solana.Transaction, error)

func MakeExternalWithdrawTransaction

func MakeExternalWithdrawTransaction(
	nonce *common.Account,
	bh solana.Blockhash,

	virtualSignature solana.Signature,

	vm *common.Account,
	vmOmnibus *common.Account,

	nonceMemory *common.Account,
	nonceIndex uint16,
	sourceMemory *common.Account,
	sourceIndex uint16,

	externalDestination *common.Account,
) (solana.Transaction, error)

func MakeInternalTransferWithAuthorityTransaction

func MakeInternalTransferWithAuthorityTransaction(
	nonce *common.Account,
	bh solana.Blockhash,

	virtualSignature solana.Signature,

	vm *common.Account,
	nonceMemory *common.Account,
	nonceIndex uint16,
	sourceMemory *common.Account,
	sourceIndex uint16,
	destinationMemory *common.Account,
	destinationIndex uint16,

	kinAmountInQuarks uint64,
) (solana.Transaction, error)

func MakeInternalWithdrawTransaction

func MakeInternalWithdrawTransaction(
	nonce *common.Account,
	bh solana.Blockhash,

	virtualSignature solana.Signature,

	vm *common.Account,
	nonceMemory *common.Account,
	nonceIndex uint16,
	sourceMemory *common.Account,
	sourceIndex uint16,
	destinationMemory *common.Account,
	destinationIndex uint16,
) (solana.Transaction, error)

func MakeNoncedTransaction

func MakeNoncedTransaction(nonce *common.Account, bh solana.Blockhash, instructions ...solana.Instruction) (solana.Transaction, error)

MakeNoncedTransaction makes a transaction that's backed by a nonce. The returned transaction is not signed.

func MakeOpenAccountTransaction

func MakeOpenAccountTransaction(
	nonce *common.Account,
	bh solana.Blockhash,

	memory *common.Account,
	accountIndex uint16,

	timelockAccounts *common.TimelockAccounts,
) (solana.Transaction, error)

Types

type MergedMemoryBankResult

type MergedMemoryBankResult struct {
	A       *ed25519.PublicKey
	B       *ed25519.PublicKey
	C       *ed25519.PublicKey
	D       *ed25519.PublicKey
	Indices []uint8
}

func MergeMemoryBanks

func MergeMemoryBanks(accounts ...*common.Account) (*MergedMemoryBankResult, error)

type SelectedNonce

type SelectedNonce struct {
	Account   *common.Account
	Blockhash solana.Blockhash
	// contains filtered or unexported fields
}

SelectedNonce is a nonce that is available and selected for use in a transaction. Implementations should unlock the lock after using the nonce. If used, its state must be updated as reserved.

func SelectAvailableNonce

func SelectAvailableNonce(ctx context.Context, data code_data.Provider, env nonce.Environment, instance string, useCase nonce.Purpose) (*SelectedNonce, error)

SelectAvailableNonce selects an available from the nonce pool within an environment for the specified use case. The returned nonce is marked as reserved without a signature, so it cannot be selected again. It's the responsibility of the external caller to make it available again if it doesn't get assigned a fulfillment.

func (*SelectedNonce) MarkReservedWithSignature

func (n *SelectedNonce) MarkReservedWithSignature(ctx context.Context, sig string) error

MarkReservedWithSignature marks the nonce as reserved with a signature

func (*SelectedNonce) ReleaseIfNotReserved

func (n *SelectedNonce) ReleaseIfNotReserved() error

ReleaseIfNotReserved makes a nonce available if it hasn't been reserved with a signature. It's recommended to call this in tandem with Unlock when the caller knows it's safe to go from the reserved to available state (ie. don't use this in uprade flows!).

func (*SelectedNonce) Unlock

func (n *SelectedNonce) Unlock()

Jump to

Keyboard shortcuts

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