Documentation
¶
Index ¶
- func BLSWithdrawalCredentials(withdrawal bls.SecretKey) []byte
- func ExecutionAddressWithdrawalCredentials(address []byte) []byte
- type BLSToExecution
- type BLSToExecutionJSON
- type Deposit
- type DepositData
- type DepositJSON
- type DepositMessage
- type DepositOption
- type DepositOptions
- type SignedBLSToExecution
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BLSWithdrawalCredentials ¶
BLSWithdrawalCredentials returns credentials from BLS SecretKey
func ExecutionAddressWithdrawalCredentials ¶
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 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 ¶
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 WithContract ¶
func WithContract(address []byte) DepositOption
WithContract sets contract address
func WithWithdrawalAddress ¶
func WithWithdrawalAddress(address []byte) DepositOption
WithWithdrawalAddress sets withdrawal address
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