contractmanager

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDeliveryRangeEnded = errors.New("delivery range ended")
)

Functions

This section is empty.

Types

type ContractManager

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

func NewContractManager

func NewContractManager(clonefactoryAddr, ownerAddr common.Address, createContractFn CreateContractFn, store *contracts.HashrateEthereum, contracts *lib.Collection[resources.Contract], log interfaces.ILogger) *ContractManager

func (*ContractManager) AddContract

func (cm *ContractManager) AddContract(ctx context.Context, data *hashrate.EncryptedTerms)

func (*ContractManager) GetContract

func (cm *ContractManager) GetContract(id string) (resources.Contract, bool)

func (*ContractManager) GetContracts

func (cm *ContractManager) GetContracts() *lib.Collection[resources.Contract]

func (*ContractManager) Run

func (cm *ContractManager) Run(ctx context.Context) error

type CreateContractFn

type CreateContractFn func(terms *hashrate.EncryptedTerms) (resources.Contract, error)

type CreateFuturesContractFn added in v1.9.0

type CreateFuturesContractFn func(terms *contracts.FuturesContract) (resources.Contract, error)

type FuturesManagerSeller added in v1.9.0

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

func NewFuturesManagerSeller added in v1.9.0

func NewFuturesManagerSeller(privKey string, futuresAddr, userAddr common.Address, blockchain *contracts.FuturesEthereum, subgraph *subgraph.SubgraphClient, contracts *lib.Collection[resources.Contract], createContractFn CreateFuturesContractFn, log interfaces.ILogger) *FuturesManagerSeller

func (*FuturesManagerSeller) AddContract added in v1.9.0

func (fm *FuturesManagerSeller) AddContract(ctx context.Context, data *contracts.FuturesContract, errGroup *errgroup.Group)

func (*FuturesManagerSeller) GetContract added in v1.9.0

func (fm *FuturesManagerSeller) GetContract(id string) (resources.Contract, bool)

func (*FuturesManagerSeller) GetContracts added in v1.9.0

func (fm *FuturesManagerSeller) GetContracts() *lib.Collection[resources.Contract]

func (*FuturesManagerSeller) RemoveContract added in v1.9.0

func (fm *FuturesManagerSeller) RemoveContract(ctx context.Context, data *contracts.FuturesContract) error

func (*FuturesManagerSeller) Run added in v1.9.0

type FuturesManagerValidator added in v1.9.0

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

func NewFuturesManagerValidator added in v1.9.0

func NewFuturesManagerValidator(privKey string, futuresAddr, validatorAddr common.Address, blockchain *contracts.FuturesEthereum, subgraph *subgraph.SubgraphClient, contracts *lib.Collection[resources.Contract], createContractValidator CreateFuturesContractFn, log interfaces.ILogger) *FuturesManagerValidator

func (*FuturesManagerValidator) AddContract added in v1.9.0

func (fm *FuturesManagerValidator) AddContract(ctx context.Context, data *contracts.FuturesContract, errGroup *errgroup.Group)

func (*FuturesManagerValidator) RemoveContract added in v1.9.0

func (fm *FuturesManagerValidator) RemoveContract(ctx context.Context, positionID common.Hash) error

func (*FuturesManagerValidator) Run added in v1.9.0

type TermsCommon

type TermsCommon interface {
	ID() string
	BlockchainState() hashrate.BlockchainState
	Seller() string
	Buyer() string
	Validator() string
	StartTime() time.Time
	Duration() time.Duration
	HashrateGHS() float64
}

Jump to

Keyboard shortcuts

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