core

package
v0.75.8 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoreClient

type CoreClient struct {
	CallTimeout time.Duration
	Conn        *grpc.ClientConn
	// contains filtered or unexported fields
}

CoreClient stores state for a Vega Core node or Data Node.

func NewCoreClient

func NewCoreClient(hosts []string, callTimeout time.Duration, logger *zap.Logger) *CoreClient

NewCoreClient returns a new node.

func (*CoreClient) CoreNetworkParameters

func (n *CoreClient) CoreNetworkParameters(parameterKey string) ([]*vega.NetworkParameter, error)

func (*CoreClient) DepositBuiltinAsset

func (n *CoreClient) DepositBuiltinAsset(
	vegaAssetId string,
	partyId string,
	amount string,
	signAny func([]byte) ([]byte, string, error),
) (bool, error)

func (*CoreClient) DepositERC20Asset

func (n *CoreClient) DepositERC20Asset(
	vegaAssetId string,
	sourceEthereumAddress string,
	targetPartyId string,
	amount string,
	signAny func([]byte) ([]byte, string, error),
) (bool, error)

func (*CoreClient) LastBlockData

func (n *CoreClient) LastBlockData() (*vegaapipb.LastBlockHeightResponse, error)

LastBlockData gets the latest blockchain data, height, hash and pow parameters.

func (*CoreClient) MustDialConnection

func (n *CoreClient) MustDialConnection(ctx context.Context)

MustDialConnection tries to establish a connection to one of the nodes from a list of locations. It is idempotent, while it each call will block the caller until a connection is established.

func (*CoreClient) MustDialConnectionIgnoreTime

func (n *CoreClient) MustDialConnectionIgnoreTime(ctx context.Context)

func (*CoreClient) ObserveEventBus

func (n *CoreClient) ObserveEventBus(
	ctx context.Context,
) (client vegaapipb.CoreService_ObserveEventBusClient, err error)

ObserveEventBus opens a stream.

func (*CoreClient) PropagateChainEvent

func (n *CoreClient) PropagateChainEvent(
	req *vegaapipb.PropagateChainEventRequest,
) (response *vegaapipb.PropagateChainEventResponse, err error)

PropagateChainEvent submits a signed v2 transaction.

func (*CoreClient) Statistics

func (n *CoreClient) Statistics() (*vegaapipb.StatisticsResponse, error)

func (*CoreClient) SubmitTransaction

func (n *CoreClient) SubmitTransaction(
	req *vegaapipb.SubmitTransactionRequest,
) (response *vegaapipb.SubmitTransactionResponse, err error)

SubmitTransaction submits a signed v2 transaction.

func (*CoreClient) Target

func (n *CoreClient) Target() string

func (*CoreClient) WaitForStateChange

func (n *CoreClient) WaitForStateChange(ctx context.Context, state connectivity.State) bool

Jump to

Keyboard shortcuts

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