types

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BLSWithdrawalCredentials

func BLSWithdrawalCredentials(withdrawal bls.SecretKey) []byte

BLSWithdrawalCredentials returns credentials from BLS SecretKey

func ExecutionAddressWithdrawalCredentials

func ExecutionAddressWithdrawalCredentials(address []byte) []byte

ExecutionAddressWithdrawalCredentials returns execution address in withdrawal credentials format

Types

type BLSToExecution

type BLSToExecution struct {
	ValidatorIndex     uint64
	FromBLSPublicKey   []byte `ssz-size:"48"`
	ToExecutionAddress []byte `ssz-size:"20"`
}

BLSToExecution contains data needed for switching from BLS withdrawal credentials to contract address

func (*BLSToExecution) MarshalJSON

func (m *BLSToExecution) MarshalJSON() ([]byte, error)

type BLSToExecutionJSON

type BLSToExecutionJSON struct {
	ValidatorIndex     string      `json:"validator_index"`
	FromBLSPublicKey   helpers.Hex `json:"from_bls_pubkey"`
	ToExecutionAddress helpers.Hex `json:"to_execution_address"`
}

type Deposit

type Deposit struct {
	DepositData
	DepositMessageRoot []byte
	DepositDataRoot    []byte
	ForkVersion        []byte
	NetworkName        string
	DepositCLIVersion  string
}

Deposit contains data needed for deposit smart-contract

func NewDeposit

func NewDeposit(signingKey, withdrawalKey bls.SecretKey, config *config.ChainConfig, opts ...DepositOption) (*Deposit, error)

NewDeposit returns new signed Deposit

func (*Deposit) MarshalJSON

func (d *Deposit) MarshalJSON() ([]byte, error)

type DepositData

type DepositData struct {
	DepositMessage
	Signature []byte `ssz-size:"96"`
}

DepositData contains signed validator deposit data

type DepositJSON

type DepositJSON struct {
	PublicKey             helpers.Hex `json:"pubkey"`
	WithdrawalCredentials helpers.Hex `json:"withdrawal_credentials"`
	ContractAddress       helpers.Hex `json:"contract_address"`
	Amount                uint64      `json:"amount"`
	Signature             helpers.Hex `json:"signature"`
	DepositMessageRoot    helpers.Hex `json:"deposit_message_root"`
	DepositDataRoot       helpers.Hex `json:"deposit_data_root"`
	ForkVersion           helpers.Hex `json:"fork_version"`
	NetworkName           string      `json:"network_name"`
	DepositCLIVersion     string      `json:"deposit_cli_version"`
}

type DepositMessage

type DepositMessage struct {
	PublicKey             []byte `ssz-size:"48"`
	WithdrawalCredentials []byte `ssz-size:"32"`
	ContractAddress       []byte `ssz-size:"20"`
	Amount                uint64
}

DepositMessage contains Bahamut chain validator deposit data

func DefaultDepositMessage

func DefaultDepositMessage(signingKey, withdrawalKey bls.SecretKey) DepositMessage

DefaultDepositMessage returns DepositMessage with default values

type DepositOption

type DepositOption = helpers.Option[*DepositMessage]

Type aliases

func WithAmount

func WithAmount(amount uint64) DepositOption

WithAmount sets amount

func WithContract

func WithContract(address []byte) DepositOption

WithContract sets contract address

func WithWithdrawalAddress

func WithWithdrawalAddress(address []byte) DepositOption

WithWithdrawalAddress sets withdrawal address

type DepositOptions

type DepositOptions = helpers.Options[*DepositMessage]

Type aliases

type SignedBLSToExecution

type SignedBLSToExecution struct {
	Message   BLSToExecution `json:"message"`
	Signature helpers.Hex    `json:"signature"`
}

BLSToExecution contains signed data needed for switching from BLS withdrawal credentials to contract address

func NewBLSToExecution

func NewBLSToExecution(
	withdrawalKey bls.SecretKey,
	config *config.ChainConfig,
	validatorIndex uint64,
	address []byte,
) (*SignedBLSToExecution, error)

NewBLSToExecution return new signed BLSToExecution message

Jump to

Keyboard shortcuts

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