signing_automation_ethereum

package
v0.1.19-rc.5 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EphemeralDepositContractAddr = "0x4242424242424242424242424242424242424242"
	EphemeralBeacon              = "https://eth.ephemeral.zeus.fyi"
	BeaconGenesisPath            = "/eth/v1/beacon/genesis"
	BeaconForkPath               = "/eth/v1/beacon/states/head/fork"
)

Variables

View Source
var (
	Gwei   = big.NewInt(1e9)
	Szabo  = big.NewInt(1e12)
	Finney = big.NewInt(1e15)
	Ether  = big.NewInt(1e18)

	OneHundred                       = big.NewInt(100)
	ThirtyTwo                        = big.NewInt(32)
	ValidatorDeposit32Eth            = big.NewInt(1).Mul(Ether, ThirtyTwo)
	ValidatorDeposit32EthInGweiUnits = big.NewInt(1).Mul(Gwei, ThirtyTwo)
)

Functions

func ABIOpenFile

func ABIOpenFile(ctx context.Context, abiFile string) (*abi.ABI, error)

func ForceDirToEthSigningDirLocation

func ForceDirToEthSigningDirLocation() string

func GetEphemeralForkVersion

func GetEphemeralForkVersion(ctx context.Context) (*spec.Version, error)

func GetForkVersion

func GetForkVersion(ctx context.Context, beacon string) (*spec.Version, error)

func MultiplyEtherUnit

func MultiplyEtherUnit(mul int64, unit *big.Int) *big.Int

func PrintJSONSlice

func PrintJSONSlice(p filepaths.Path, dpParamSlice []*DepositDataParams, network string)

func ValidateAndReturnBLSPubkeyBytes

func ValidateAndReturnBLSPubkeyBytes(blsPubKey string) ([]byte, error)

ValidateAndReturnBLSPubkeyBytes is borrowed from https://github.com/wealdtech/ethdo

func ValidateAndReturnEcdsaPubkeyBytes

func ValidateAndReturnEcdsaPubkeyBytes(ecdsaWithdrawalKey string) ([]byte, error)

ValidateAndReturnEcdsaPubkeyBytes is borrowed from https://github.com/wealdtech/ethdo

Types

type DepositDataJSON

type DepositDataJSON struct {
	Pubkey                string `json:"pubkey"`
	WithdrawalCredentials string `json:"withdrawal_credentials"`
	Signature             string `json:"signature"`
	Amount                int    `json:"amount"`
	DepositDataRoot       string `json:"deposit_data_root"`
	DepositMessageRoot    string `json:"deposit_message_root"`
	ForkVersion           string `json:"fork_version"`
}

type DepositDataParams

type DepositDataParams struct {
	*spec.DepositData
	DepositDataRoot    [32]byte
	DepositMessageRoot [32]byte
	ForkVersion        *spec.Version
}

func (*DepositDataParams) FormatJSON

func (dd *DepositDataParams) FormatJSON() DepositDataJSON

func (*DepositDataParams) GetValidatorDepositParamsStringValues

func (dd *DepositDataParams) GetValidatorDepositParamsStringValues() ValidatorDepositParams

type ExtendedDepositParams

type ExtendedDepositParams struct {
	ValidatorDepositParams
	Amount             int    `json:"amount"`
	DepositMessageRoot string `json:"deposit_message_root"`
	ForkVersion        string `json:"fork_version"`
	NetworkName        string `json:"network_name,omitempty"`
	DepositCliVersion  string `json:"deposit_cli_version,omitempty"`
}

type GenesisData

type GenesisData struct {
	Data struct {
		GenesisTime           string `json:"genesis_time"`
		GenesisValidatorsRoot string `json:"genesis_validators_root"`
		GenesisForkVersion    string `json:"genesis_fork_version"`
	} `json:"data"`
}

type ValidatorDepositGenerationParams

type ValidatorDepositGenerationParams struct {
	Fp                                  filepaths.Path
	Mnemonic, Pw                        string
	ValidatorIndexOffset, NumValidators int

	// used for looping derivations
	WithdrawalKeyIndexOffset, NumWithdrawalKeys int
}

func (*ValidatorDepositGenerationParams) DerivedKey

func (*ValidatorDepositGenerationParams) EthDepositEncryptionAndAddMetadata

func (vd *ValidatorDepositGenerationParams) EthDepositEncryptionAndAddMetadata(ctx context.Context, path string) (map[string]interface{}, error)

func (*ValidatorDepositGenerationParams) GenerateAndEncryptValidatorKeysFromSeedAndPath

func (vd *ValidatorDepositGenerationParams) GenerateAndEncryptValidatorKeysFromSeedAndPath(ctx context.Context, network string) error

func (*ValidatorDepositGenerationParams) GenerateDerivedWithdrawalKeys

func (vd *ValidatorDepositGenerationParams) GenerateDerivedWithdrawalKeys(ctx context.Context) ([]string, error)

func (*ValidatorDepositGenerationParams) GeneratePaddedBytesDefaultDerivedBLSWithdrawalKey

func (vd *ValidatorDepositGenerationParams) GeneratePaddedBytesDefaultDerivedBLSWithdrawalKey(ctx context.Context) ([]byte, error)

type ValidatorDepositParams

type ValidatorDepositParams struct {
	Pubkey                string `json:"pubkey"`
	WithdrawalCredentials string `json:"withdrawal_credentials"`
	Signature             string `json:"signature"`
	DepositDataRoot       string `json:"deposit_data_root"`
}

type ValidatorDepositSlice

type ValidatorDepositSlice []ExtendedDepositParams

func ParseValidatorDepositSliceJSON

func ParseValidatorDepositSliceJSON(ctx context.Context, p filepaths.Path) (ValidatorDepositSlice, error)

type Web3SignerClient

type Web3SignerClient struct {
	web3_actions.Web3Actions
}

func NewWeb3Client

func NewWeb3Client(nodeUrl string, acc *accounts.Account) Web3SignerClient

func (*Web3SignerClient) GenerateDepositData

func (w *Web3SignerClient) GenerateDepositData(ctx context.Context, blsSigner bls_signer.EthBLSAccount, withdrawalAddress []byte, forkVersion *spec.Version) (*DepositDataParams, error)

func (*Web3SignerClient) GenerateDepositDataWithDefaultWd

func (w *Web3SignerClient) GenerateDepositDataWithDefaultWd(ctx context.Context, vdg ValidatorDepositGenerationParams, fv *spec.Version) ([]*DepositDataParams, error)

func (*Web3SignerClient) GenerateEphemeryDepositDataWithDefaultWd

func (w *Web3SignerClient) GenerateEphemeryDepositDataWithDefaultWd(ctx context.Context, vdg ValidatorDepositGenerationParams) ([]*DepositDataParams, error)

func (*Web3SignerClient) SignValidatorDepositTxToBroadcast

func (w *Web3SignerClient) SignValidatorDepositTxToBroadcast(ctx context.Context, depositParams *DepositDataParams) (*types.Transaction, error)

Jump to

Keyboard shortcuts

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