clients

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: GPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// NewForwardtest creates a new forwardtest.
	NewForwardtest(
		ctx context.Context,
		params api.CreateForwardtestWorkflowParams,
	) (Forwardtest, error)
	// ListForwardtests lists the forwardtests.
	ListForwardtests(
		ctx context.Context,
		params api.ListForwardtestsWorkflowParams,
	) ([]Forwardtest, error)
	// Info calls the service info.
	Info(ctx context.Context) (api.ServiceInfoResults, error)
	// RawClient returns the raw client.
	RawClient() RawClient
}

Client is a client for the cryptellation forwardtests service.

func New

New creates a new client to execute temporal workflows.

type Forwardtest

type Forwardtest struct {
	ID uuid.UUID
	// contains filtered or unexported fields
}

Forwardtest is a local representation of a forwardtest running on the Cryptellation API.

func (Forwardtest) CreateOrder

CreateOrder creates an order on the forwardtest.

func (Forwardtest) Get added in v1.1.1

Get retrieves the forwardtest data from the database.

func (Forwardtest) GetBalance added in v1.1.1

func (ft Forwardtest) GetBalance(
	ctx context.Context,
) (float64, error)

GetBalance gets the balance of the forwardtest.

func (Forwardtest) ListAccounts

func (ft Forwardtest) ListAccounts(
	ctx context.Context,
) (map[string]account.Account, error)

ListAccounts lists the accounts of the forwardtest.

func (*Forwardtest) Run added in v1.1.0

func (ft *Forwardtest) Run(ctx context.Context) error

Run runs the forwardtest with the given bot.

func (Forwardtest) Stop added in v1.1.0

func (ft Forwardtest) Stop(ctx context.Context) error

Stop stops the forwardtest by executing the exit callback.

type RawClient

RawClient is a client for the cryptellation backtests service with just the calls to the temporal workflows.

func NewRaw

func NewRaw(cl temporalclient.Client) RawClient

NewRaw creates a new raw client to execute temporal workflows.

type WfClient

type WfClient interface {
	// CreateForwardtestOrder creates a new order for a forwardtest.
	CreateForwardtestOrder(
		ctx workflow.Context,
		params api.CreateForwardtestOrderWorkflowParams,
	) (api.CreateForwardtestOrderWorkflowResults, error)

	// GetForwardtest retrieves a forwardtest from the database by its ID.
	GetForwardtest(
		ctx workflow.Context,
		params api.GetForwardtestWorkflowParams,
	) (api.GetForwardtestWorkflowResults, error)

	// SubscribeToPrice subscribes to specific price updates for a forwardtest.
	SubscribeToPrice(
		ctx workflow.Context,
		params api.SubscribeToPriceWorkflowParams,
	) (api.SubscribeToPriceWorkflowResults, error)
}

WfClient is a client for the cryptellation forwardtests service from a workflow perspective.

func NewWfClient

func NewWfClient() WfClient

NewWfClient creates a new workflow client. This client is used to call workflows from within other workflows. It is not used to call workflows from outside the workflow environment.

Jump to

Keyboard shortcuts

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