api

package
v0.1.0-a1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiRequester

type ApiRequester struct {
	Service *ServiceRequester
	Tx      *TxRequester
	Utils   *UtilsRequester
	Wallet  *WalletRequester
	// contains filtered or unexported fields
}

Binder for the Hyperdrive daemon API server

func NewApiRequester

func NewApiRequester(socketPath string, debugMode bool) *ApiRequester

Creates a new API requester instance

type BatchInputType

type BatchInputType interface {
	uint64 | common.Address
}

Types that can be batched into a comma-delmited string

type IRequester

type IRequester interface {
	GetName() string
	GetRoute() string
	GetContext() *RequesterContext
}

type RequesterContext

type RequesterContext struct {
	// contains filtered or unexported fields
}

type ServiceRequester

type ServiceRequester struct {
	// contains filtered or unexported fields
}

func NewServiceRequester

func NewServiceRequester(context *RequesterContext) *ServiceRequester

func (*ServiceRequester) ClientStatus

Gets the status of the configured Execution and Beacon clients

func (*ServiceRequester) GetContext

func (r *ServiceRequester) GetContext() *RequesterContext

func (*ServiceRequester) GetName

func (r *ServiceRequester) GetName() string

func (*ServiceRequester) GetRoute

func (r *ServiceRequester) GetRoute() string

func (*ServiceRequester) RestartVc

func (r *ServiceRequester) RestartVc() (*api.ApiResponse[api.SuccessData], error)

Restarts the Validator client

func (*ServiceRequester) TerminateDataFolder

Deletes the data folder including the wallet file, password file, and all validator keys. Don't use this unless you have a very good reason to do it (such as switching from Prater to Mainnet).

func (*ServiceRequester) Version

Gets the version of the daemon

type TxRequester

type TxRequester struct {
	// contains filtered or unexported fields
}

func NewTxRequester

func NewTxRequester(context *RequesterContext) *TxRequester

func (*TxRequester) GetContext

func (r *TxRequester) GetContext() *RequesterContext

func (*TxRequester) GetName

func (r *TxRequester) GetName() string

func (*TxRequester) GetRoute

func (r *TxRequester) GetRoute() string

func (*TxRequester) SignTx

func (r *TxRequester) SignTx(txSubmission *eth.TransactionSubmission, nonce *big.Int, maxFee *big.Int, maxPriorityFee *big.Int) (*api.ApiResponse[api.TxSignTxData], error)

Use the node private key to sign a transaction without submitting it

func (*TxRequester) SignTxBatch

func (r *TxRequester) SignTxBatch(txSubmissions []*eth.TransactionSubmission, firstNonce *big.Int, maxFee *big.Int, maxPriorityFee *big.Int) (*api.ApiResponse[api.TxBatchSignTxData], error)

Use the node private key to sign a batch of transactions without submitting them

func (*TxRequester) SubmitTx

func (r *TxRequester) SubmitTx(txSubmission *eth.TransactionSubmission, nonce *big.Int, maxFee *big.Int, maxPriorityFee *big.Int) (*api.ApiResponse[api.TxData], error)

Submit a transaction

func (*TxRequester) SubmitTxBatch

func (r *TxRequester) SubmitTxBatch(txSubmissions []*eth.TransactionSubmission, firstNonce *big.Int, maxFee *big.Int, maxPriorityFee *big.Int) (*api.ApiResponse[api.BatchTxData], error)

Submit a batch of transactions

func (*TxRequester) WaitForTransaction

func (r *TxRequester) WaitForTransaction(txHash common.Hash) (*api.ApiResponse[api.SuccessData], error)

Wait for a transaction

type UtilsRequester

type UtilsRequester struct {
	// contains filtered or unexported fields
}

func NewUtilsRequester

func NewUtilsRequester(context *RequesterContext) *UtilsRequester

func (*UtilsRequester) Balance

Get the node's ETH balance

func (*UtilsRequester) GetContext

func (r *UtilsRequester) GetContext() *RequesterContext

func (*UtilsRequester) GetName

func (r *UtilsRequester) GetName() string

func (*UtilsRequester) GetRoute

func (r *UtilsRequester) GetRoute() string

func (*UtilsRequester) ResolveEns

func (r *UtilsRequester) ResolveEns(address common.Address, name string) (*api.ApiResponse[api.UtilsResolveEnsData], error)

Resolves an ENS name or reserve resolves an address

type WalletRequester

type WalletRequester struct {
	// contains filtered or unexported fields
}

func NewWalletRequester

func NewWalletRequester(context *RequesterContext) *WalletRequester

func (*WalletRequester) DeletePassword

func (r *WalletRequester) DeletePassword() (*api.ApiResponse[api.SuccessData], error)

Delete the wallet keystore's password from disk

func (*WalletRequester) Export

Export wallet

func (*WalletRequester) ExportEthKey

Export the wallet in encrypted ETH key format

func (*WalletRequester) GetContext

func (r *WalletRequester) GetContext() *RequesterContext

func (*WalletRequester) GetName

func (r *WalletRequester) GetName() string

func (*WalletRequester) GetRoute

func (r *WalletRequester) GetRoute() string

func (*WalletRequester) Initialize

func (r *WalletRequester) Initialize(derivationPath *string, index *uint64, password string, save bool) (*api.ApiResponse[api.WalletInitializeData], error)

Initialize the wallet with a new key

func (*WalletRequester) Masquerade

func (r *WalletRequester) Masquerade(address common.Address) (*api.ApiResponse[api.SuccessData], error)

Set the node address to an arbitrary address

func (*WalletRequester) Rebuild

Rebuild the validator keys associated with the wallet

func (*WalletRequester) Recover

func (r *WalletRequester) Recover(derivationPath *string, mnemonic *string, index *uint64, password string, save bool) (*api.ApiResponse[api.WalletRecoverData], error)

Recover wallet

func (*WalletRequester) RestoreAddress

func (r *WalletRequester) RestoreAddress() (*api.ApiResponse[api.SuccessData], error)

Set the node address back to the wallet address

func (*WalletRequester) SearchAndRecover

func (r *WalletRequester) SearchAndRecover(mnemonic string, address common.Address, password string, save bool) (*api.ApiResponse[api.WalletSearchAndRecoverData], error)

Search and recover wallet

func (*WalletRequester) SendMessage

func (r *WalletRequester) SendMessage(message []byte, address common.Address) (*api.ApiResponse[api.TxInfoData], error)

Sends a zero-value message with a payload

func (*WalletRequester) SetEnsName

Set an ENS reverse record to a name

func (*WalletRequester) SetPassword

func (r *WalletRequester) SetPassword(password string, save bool) (*api.ApiResponse[api.SuccessData], error)

Sets the wallet keystore's password

func (*WalletRequester) SignMessage

func (r *WalletRequester) SignMessage(message []byte) (*api.ApiResponse[api.WalletSignMessageData], error)

Use the node private key to sign an arbitrary message

func (*WalletRequester) Status

Get wallet status

func (*WalletRequester) TestRecover

func (r *WalletRequester) TestRecover(derivationPath *string, mnemonic string, index *uint64) (*api.ApiResponse[api.WalletRecoverData], error)

Recover wallet in test-mode so none of the artifacts are saved

func (*WalletRequester) TestSearchAndRecover

func (r *WalletRequester) TestSearchAndRecover(mnemonic string, address common.Address) (*api.ApiResponse[api.WalletSearchAndRecoverData], error)

Search for and recover the wallet in test-mode so none of the artifacts are saved

Jump to

Keyboard shortcuts

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