apiv0

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: AGPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// The provided network was invalid
	InvalidNetworkKey string = "invalid_network"
)
View Source
const (
	// Format for signing node address messages
	NodeAddressMessageFormat string = `{"email":"%s","node_address":"%s"}`
)
View Source
const (
	// Deposit data has withdrawal creds that don't match a StakeWise vault
	VaultNotFoundKey string = "vault_not_found"
)

Variables

View Source
var (
	// The provided network was invalid
	ErrInvalidNetwork error = errors.New("the provided network was invalid")
)
View Source
var (
	// The requested StakeWise vault didn't exist
	ErrVaultNotFound error = errors.New("deposit data has withdrawal creds that don't match a StakeWise vault")
)

Functions

This section is empty.

Types

type NodeAddressRequest

type NodeAddressRequest struct {
	// The email address of the NodeSet account
	Email string `json:"email"`

	// The node's wallet address
	NodeAddress string `json:"node_address"`

	// Signature of the request
	Signature string `json:"signature"` // Must be 0x-prefixed hex encoded
}

Request to register a node with the NodeSet server

type NodeSetClient

type NodeSetClient struct {
	*common.CommonNodeSetClient
}

Client for interacting with the NodeSet server

func NewNodeSetClient

func NewNodeSetClient(baseUrl string, timeout time.Duration) *NodeSetClient

Creates a new NodeSet client baseUrl: The base URL to use for the client, for example [https://nodeset.io/api]

func (*NodeSetClient) DepositDataMeta

func (c *NodeSetClient) DepositDataMeta(ctx context.Context, logger *slog.Logger, vault ethcommon.Address, network string) (stakewise.DepositDataMetaData, error)

Get the current version of the aggregated deposit data on the server

func (*NodeSetClient) DepositData_Get

func (c *NodeSetClient) DepositData_Get(ctx context.Context, logger *slog.Logger, vault ethcommon.Address, network string) (stakewise.DepositDataData, error)

Get the aggregated deposit data from the server

func (*NodeSetClient) DepositData_Post

func (c *NodeSetClient) DepositData_Post(ctx context.Context, logger *slog.Logger, depositData []beacon.ExtendedDepositData) error

Uploads deposit data to NodeSet

func (*NodeSetClient) Login

func (c *NodeSetClient) Login(ctx context.Context, logger *slog.Logger, nonce string, address ethcommon.Address, signer func([]byte) ([]byte, error)) (core.LoginData, error)

Logs into the NodeSet server, starting a new session

func (*NodeSetClient) NodeAddress

func (c *NodeSetClient) NodeAddress(ctx context.Context, logger *slog.Logger, email string, nodeWallet ethcommon.Address, signer func([]byte) ([]byte, error)) error

Registers the node with the NodeSet server. Assumes wallet validation has already been done and the actual wallet address is provided here; if it's not, the signature won't come from the node being registered so it will fail validation.

func (*NodeSetClient) Nonce

func (c *NodeSetClient) Nonce(ctx context.Context, logger *slog.Logger) (core.NonceData, error)

Get a nonce from the NodeSet server for a new session

func (*NodeSetClient) Validators_Get

func (c *NodeSetClient) Validators_Get(ctx context.Context, logger *slog.Logger, network string) (stakewise.ValidatorsData, error)

Get a list of all of the pubkeys that have already been registered with NodeSet for this node

func (*NodeSetClient) Validators_Patch

func (c *NodeSetClient) Validators_Patch(ctx context.Context, logger *slog.Logger, exitData []common.ExitData, network string) error

Submit signed exit data to NodeSet

Jump to

Keyboard shortcuts

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