api

package
v0.0.0-...-589da53 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 52 Imported by: 0

README

Conventions Followed in datanode/api Code Implementation

Errors

For all types of errors that are handled in the datanode/api scope, please use errors part of the package. Example:

return nil, apiError(codes.InvalidArgument, ErrMalformedRequest)

The purpose is to have a common way of handling error reporting outside of the core component and keep them clean and simple. Some gradual refactoring work on places where the above is not yet applied is welcomed, though as a friendly and respectful reminder - please consider not breaking the current state.

Documentation

Overview

Package api contains code for running the gRPC server.

In order to add a new gRPC endpoint, add proto content (rpc call, request and response messages), then add the endpoint function implementation in `api/somefile.go`. Example:

func (s *tradingService) SomeNewEndpoint(
    ctx context.Context, req *protoapi.SomeNewEndpointRequest,
) (*protoapi.SomeNewEndpointResponse, error) {
    /* Implementation goes here */
    return &protoapi.SomeNewEndpointResponse{/* ... */}, nil
}

Add a test for the newly created endpoint in `api/trading_test.go`.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrChannelClosed signals that the channel streaming data is closed.
	ErrChannelClosed = errors.New("channel closed")
	// ErrNotAValidFuryID signals an invalid id.
	ErrNotAValidFuryID = newInvalidArgumentError("not a valid fury id")
	// ErrMissingResourceID signals to the caller that the request expected a
	// resource id but the field is missing or empty.
	ErrMissingResourceID = newInvalidArgumentError("missing resource ID")
	// ErrEmptyMissingMarketID signals to the caller that the request expected a
	// market id but the field is missing or empty.
	ErrEmptyMissingMarketID = newInvalidArgumentError("empty or missing market ID")
	// ErrInvalidMarketID signals to the caller that the request expected a
	// market id but the field is not in the right format.
	ErrInvalidMarketID = newInvalidArgumentError("invalid market ID")
	// ErrMissingPrice signals to the caller that the request expected a price.
	ErrMissingPrice = newInvalidArgumentError("missing price")
	// ErrInvalidOrderPrice signals to the caller that the request expected a valid price.
	ErrInvalidOrderPrice = newInvalidArgumentError("invalid order price")
	// ErrInvalidOrderSize signals to the caller that the request expected a valid size.
	ErrInvalidOrderSize = newInvalidArgumentError("invalid order size")
	// ErrServerShutdown signals to the client that the server  is shutting down.
	ErrServerShutdown = errors.New("server shutdown")
	// ErrStreamClosed signals to the users that the grpc stream is closing.
	ErrStreamClosed = errors.New("stream closed")
	// ErrStreamInternal signals to the users that the grpc stream has an internal problem.
	ErrStreamInternal = errors.New("internal stream failure")
	// ErrNotMapped is when an error cannot be found in the current error map/lookup table.
	ErrNotMapped = errors.New("error not found in error lookup table")
	// ErrMissingPartyID signals that the payload is expected to contain a party id.
	ErrMissingPartyID = newInvalidArgumentError("missing party id")
	// ErrInvalidPartyID signals that the given party id is not a valid ID.
	ErrInvalidPartyID = newInvalidArgumentError("invalid party id")
	// ErrInvalidPagination signals that the pagination is invalid.
	ErrInvalidPagination = newInvalidArgumentError("invalid pagination")
	// ErrInvalidCandleID signals an invalid candle ID submitted.
	ErrInvalidCandleID = newInvalidArgumentError("invalid candle id")
	// ErrInvalidCandleTimestampsRange signals an impossible range with the candle timestamps.
	ErrInvalidCandleTimestampsRange = newInvalidArgumentError("invalid candle timestamps range")
	// ErrInvalidFilter signals that the filter is invalid.
	ErrInvalidFilter = newInvalidArgumentError("invalid filter")
	// ErrMalformedRequest signals that the request was malformed.
	ErrMalformedRequest = newInvalidArgumentError("malformed request")
	// ErrMissingOrderID signals that an order ID was required but not specified.
	ErrMissingOrderID = newInvalidArgumentError("missing orderID parameter")
	// ErrInvalidOrderID signals that an order ID provided was not a valid ID.
	ErrInvalidOrderID = newInvalidArgumentError("invalid orderID parameter")
	// ErrMissingCandleID returned if candle with this id is missing.
	ErrMissingCandleID = newInvalidArgumentError("candle id is a required parameter")
	// ErrMissingProposalID returned if proposal with this id is missing.
	ErrMissingProposalID = newInvalidArgumentError("proposal id is a required parameter")
	// ErrMissingProposalIDAndPartyID returned if proposal id and party id is missing.
	ErrMissingProposalIDAndPartyID = newInvalidArgumentError("missing proposal id and party id")
	// ErrMissingProposalIDOrPartyID returned if proposal id and party id is missing.
	ErrMissingProposalIDOrPartyID = newInvalidArgumentError("missing proposal id or party id")
	// ErrMissingProposalIDOrReference returned if proposal id or reference is missing.
	ErrMissingProposalIDOrReference = newInvalidArgumentError("missing proposal ID or reference")
	// ErrInvalidProposalID returned if proposal id is invalid.
	ErrInvalidProposalID = newInvalidArgumentError("invalid proposal id")
	// ErrMissingWithdrawalID is returned when the withdrawal ID is missing from the request.
	ErrMissingWithdrawalID = newInvalidArgumentError("missing withdrawal ID")
	// ErrInvalidWithdrawalID is returned when the withdrawal ID is not a valid fury ID.
	ErrInvalidWithdrawalID = newInvalidArgumentError("invalid withdrawal ID")
	// ErrMissingOracleSpecID is returned when the ID is missing from the request.
	ErrMissingOracleSpecID = newInvalidArgumentError("missing oracle spec ID")
	// ErrInvalidOracleSpecID is returned when the ID is not a valid ID.
	ErrInvalidOracleSpecID = newInvalidArgumentError("invalid oracle spec ID")
	// ErrMissingDepositID is returned when the deposit ID is missing from the request.
	ErrMissingDepositID = newInvalidArgumentError("missing deposit ID")
	// ErrMissingAssetID is returned when the Asset ID is missing from the request.
	ErrMissingAssetID = newInvalidArgumentError("missing asset ID")
	// ErrInvalidAssetID is returned when the Asset ID is not a valid ID.
	ErrInvalidAssetID = newInvalidArgumentError("invalid asset ID")
	// ErrMissingNodeID is returned when the node ID is missing from the request.
	ErrMissingNodeID = newInvalidArgumentError("missing node id")
	// ErrNegativeOrderVersion is returned when a request is made for an
	// order with a negative version.
	ErrNegativeOrderVersion = newInvalidArgumentError("negative order version")

	// ErrOracleServiceSpecID is returned when there was no data found for the given ID.
	ErrOracleServiceGetSpec = errors.New("failed to retrieve data for oracle spec")
	// ErrERC20InvalidTokenContractAddress is returned when the ERC20 token contract address is invalid.
	ErrERC20InvalidTokenContractAddress = errors.New("invalid erc20 token contract address")
	ErrSendingGRPCHeader                = errors.New("failed to send header")
	ErrEstimateFee                      = errors.New("failed to estimate fee")
	ErrEstimateMargin                   = errors.New("failed to estimate margin")
	// OrderService...
	ErrOrderServiceGetOrders        = errors.New("failed to get orders")
	ErrOrderServiceGetVersions      = errors.New("failed to get order versions")
	ErrOrderNotFound                = errors.New("order not found")
	ErrOrderServiceGetByMarket      = errors.New("failed to get orders for market")
	ErrOrderServiceGetByMarketAndID = errors.New("failed to get orders for market and ID")
	ErrOrderServiceGetByParty       = errors.New("failed to get orders for party")
	ErrOrderServiceGetByReference   = errors.New("failed to get orders for reference")
	ErrOrderServiceGetByTxHash      = errors.New("failed to get orders for tx hash")
	ErrMissingOrderIDParameter      = errors.New("missing orderID parameter")
	// NodeService...
	ErrNodeServiceGetNodes    = errors.New("failed to get nodes")
	ErrNodeServiceGetNodeData = errors.New("failed to get node data")
	ErrNodeServiceGetByTxHash = errors.New("failed to get nodes for tx hash")
	// TradeService...
	ErrTradeServiceGetByParty          = errors.New("failed to get trades for party")
	ErrTradeServiceGetByMarket         = errors.New("failed to get trades for market")
	ErrTradeServiceList                = errors.New("failed to list trades")
	ErrTradeServiceGetPositionsByParty = errors.New("failed to get positions for party")
	ErrTradeServiceGetByOrderID        = errors.New("failed to get trades for order ID")
	ErrTradeServiceGetByTxHash         = errors.New("failed to get trades for tx hash")
	// MarketService...
	ErrMarketServiceGetByID              = errors.New("failed to get market for ID")
	ErrMarketServiceGetAllPaged          = errors.New("failed to get all markets paged")
	ErrMarketServiceGetMarketData        = errors.New("failed to get market data")
	ErrMarketServiceGetMarketDataHistory = errors.New("failed to get market data history")
	ErrMarketServiceGetMarkets           = errors.New("failed to get markets")
	ErrMarketServiceGetByTxHash          = errors.New("failed to get orders for tx hash")
	ErrMarketServiceGetDepth             = errors.New("failed to get market depth")
	// AccountService...
	ErrAccountServiceListAccounts        = errors.New("failed to get accounts")
	ErrFailedToSendSnapshot              = errors.New("failed to send accounts snapshot")
	ErrAccountServiceGetBalances         = errors.New("failed to get balances")
	ErrAccountServiceGetByTxHash         = errors.New("failed to get accounts for tx hash")
	ErrAccountServiceGetBalancesByTxHash = errors.New("failed to get balances for tx hash")
	// DelegationService...
	ErrDelegationServiceGet = errors.New("failed to get delegation")
	// SummaryService...
	ErrSummaryServiceGet = errors.New("failed to get summary")
	// WithdrawalService...
	ErrWithdrawalServiceGet = errors.New("failed to get withdrawal")
	// PositionService...
	ErrPositionServiceGetByParty   = errors.New("failed to get positions for party")
	ErrPositionServiceSendSnapshot = errors.New("failed to send positions snapshot")
	// RiskService...
	ErrRiskServiceGetMarginLevelsByID = errors.New("failed to get margin levels")
	ErrInvalidOrderSide               = newInvalidArgumentError("invalid order side")
	// RiskFactorService...
	ErrRiskFactorServiceGet = errors.New("failed to get risk factor")
	// GovernanceService...
	ErrGovernanceServiceGet          = errors.New("failed to get proposal")
	ErrGovernanceServiceGetProposals = errors.New("failed to get proposals")
	ErrGovernanceServiceGetVotes     = errors.New("failed to get votes")
	// CandleService...
	ErrCandleServiceGetCandleData       = errors.New("failed to get candle data")
	ErrCandleServiceSubscribeToCandles  = errors.New("failed to subscribe to candle data")
	ErrCandleServiceGetCandlesForMarket = errors.New("failed to get candles for market")
	// PartyService...
	ErrPartyServiceGetAll      = errors.New("failed to get parties")
	ErrPartyServiceGetByID     = errors.New("failed to get party for ID")
	ErrPartyServiceGetByTxHash = errors.New("failed to get parties for tx hash")
	// NotaryService...
	ErrNotaryServiceGetByResourceID = errors.New("failed to get notary for resource ID")
	// OracleSpecService...
	// ErrOracleSpecServiceGet is returned when there was no data found for the given ID.
	ErrOracleSpecServiceGet = errors.New("failed retrieve data for oracle spec")
	// ErrOracleSpecServiceGetAll is returned when there was no data found for the given ID.
	ErrOracleSpecServiceGetAll = errors.New("failed retrieve data for oracle specs")
	// OracleDataService...
	// ErrOracleDataServiceGet is returned when there was no data found for the given ID.
	ErrOracleDataServiceGet = errors.New("failed retrieve data for oracle data")
	// AssetService...
	ErrAssetServiceGetAll            = errors.New("failed to get assets")
	ErrAssetServiceGetByID           = errors.New("failed to get asset for ID")
	ErrScalingPriceFromMarketToAsset = errors.New("failed to scale price from market to asset")
	// DepositService...
	ErrDepositServiceGet = errors.New("failed to get deposit")
	// TransferService...
	ErrTransferServiceGet = errors.New("failed to get transfer")
	// NetworkLimits...
	ErrGetNetworkLimits = errors.New("failed to get network limits")
	// ErrGetNetworkParameters is returned when the network parameters cannot be retrieved.
	ErrGetNetworkParameters = errors.New("failed to get network parameters")
	// Network History...
	ErrGetConnectedPeerAddresses = errors.New("failed to get connected peer addresses")
	// TimeService...
	ErrTimeServiceGetTimeNow = errors.New("failed to get time now")
	// Blockchain...
	ErrBlockchainBacklogLength = errors.New("failed to get backlog length from blockchain")
	ErrBlockchainNetworkInfo   = errors.New("failed to get network info from blockchain")
	ErrBlockchainGenesisTime   = errors.New("failed to get genesis time from blockchain")
	ErrBlockchainChainID       = errors.New("failed to get chain ID from blockchain")
	// Rewards.
	ErrGetRewards         = errors.New("failed to get rewards")
	ErrRewardsGetByTxHash = errors.New("failed to get rewards for tx hash")
	// Network History.
	ErrGetActivePeerAddresses              = errors.New("failed to get active peer addresses")
	ErrGetMostRecentHistorySegment         = errors.New("failed to get most recent history segment")
	ErrListAllNetworkHistorySegment        = errors.New("failed to list all history segments")
	ErrFetchNetworkHistorySegment          = errors.New("failed to fetch segment")
	ErrNetworkHistoryNotEnabled            = errors.New("network history not enabled")
	ErrCopyHistorySegmentToFile            = errors.New("failed to copy history segment to file")
	ErrGetIpfsAddress                      = errors.New("failed to get node's ipfs address")
	ErrNetworkHistoryNoTableName           = errors.New("no table name for network history supplied")
	ErrNetworkHistoryGetContiguousSegments = errors.New("failed to get contiguous history segments")
	ErrNetworkHistoryOpeningSegment        = errors.New("failed to open network history segment file")
	ErrNetworkHistoryExtractingSegment     = errors.New("failed to extract data from network history segment file")
	ErrNetworkHistoryCreatingZipFile       = errors.New("failed to create zip file writer for network history segment")
	ErrNetworkHistoryServiceNotInitialised = errors.New("network history service not initialised")

	// ErrGetEpoch is returned when the epoch cannot be retrieved.
	ErrGetEpoch     = errors.New("failed to get epoch")
	ErrEpochIDParse = newInvalidArgumentError("failed to parse epoch id")
	// LedgerService...
	ErrLedgerServiceGet    = errors.New("failed to query ledger entries")
	ErrLedgerServiceExport = errors.New("failed to export ledger entries")
	// MultiSigService...
	ErrMultiSigServiceGetAdded   = errors.New("failed to get added multisig events")
	ErrMultiSigServiceGetRemoved = errors.New("failed to get removed multisig events")
	// LiquidityProvisionService...
	ErrLiquidityProvisionServiceGet = errors.New("failed to get liquidity provision")
	// CheckpointService...
	ErrCheckpointServiceGet = errors.New("failed to get checkpoint")
	// StakeLinkingService...
	ErrStakeLinkingServiceGet = errors.New("failed to get stake linking")
	// CoreSnapshotService...
	ErrCoreSnapshotServiceListSnapshots = errors.New("failed to list core snapshots")
	// ProtocolUpgradeService...
	ErrProtocolUpgradeServiceListProposals = errors.New("failed to list protocol upgrade proposals")
	// KeyRotationService...
	ErrKeyRotationServiceGetPerNode = errors.New("failed to get key rotations for node")
	ErrKeyRotationServiceGetAll     = errors.New("failed to get all key rotations")
	// EthereumKeyRotationService...
	ErrEthereumKeyRotationServiceGetPerNode = errors.New("failed to get ethereum key rotations for node")
	ErrEthereumKeyRotationServiceGetAll     = errors.New("failed to get all ethereum key rotations")
	// BlockService...
	ErrBlockServiceGetLast = errors.New("failed to get last block")
	// Positions...
	ErrPositionsGetByTxHash             = errors.New("failed to get positions for tx hash")
	ErrPositionsInvalidCollateralAmount = newInvalidArgumentError("invalid collateral amount")
	// Ledger entries...
	ErrLedgerEntriesGetByTxHash = errors.New("failed to get ledger entries for tx hash")
	// Transfers...
	ErrTransfersGetByTxHash = errors.New("failed to get transfers for tx hash")
	// Votes...
	ErrVotesGetByTxHash = errors.New("failed to get votes for tx hash")
	// ERC20MultiSigSignerEvents...
	ErrERC20MultiSigSignerAddedEventGetByTxHash   = errors.New("failed to get ERC20 multisig signer add events for tx hash")
	ErrERC20MultiSigSignerRemovedEventGetByTxHash = errors.New("failed to get ERC20 multisig signer removed events for tx hash")
	// Oracles...
	ErrOracleSpecGetByTxHash = errors.New("failed to get oracle spec for tx hash")
	ErrOracleDataGetByTxHash = errors.New("failed to get oracle data for tx hash")
	// Deposits...
	ErrDepositsGetByTxHash = errors.New("failed to get deposits for tx hash")
	// Withdrawals...
	ErrWithdrawalsGetByTxHash = errors.New("failed to get withdrawals for tx hash")
	// Assets...
	ErrAssetsGetByTxHash = errors.New("failed to get assets for tx hash")
	// Liquidity provision...
	ErrLiquidityProvisionGetByTxHash = errors.New("failed to get liquidity provision for tx hash")
	// Proposals...
	ErrProposalsGetByTxHash = errors.New("failed to get proposals for tx hash")
	// Delegations...
	ErrDelegationsGetByTxHash = errors.New("failed to get delegations for tx hash")
	// Signatures...
	ErrSignaturesGetByTxHash = errors.New("failed to get signatures for tx hash")
	// NetworkParamaters...
	ErrNetworkParametersGetByTxHash = errors.New("failed to get network parameters for tx hash")
	ErrNetworkParameterNotFound     = errors.New("network parameter not found")

	// KeyRotations...
	ErrKeyRotationsGetByTxHash = errors.New("failed to get key rotations for tx hash")
	// EthereumKeyRotations...
	ErrEthereumKeyRotationsGetByTxHash = errors.New("failed to get ethereum key rotations for tx hash")
	// ProtocolUpgradeProposals...
	ErrProtocolUpgradeProposalsGetByTxHash = errors.New("failed to get protocol upgrade proposals for tx hash")
	// MarginLevels...
	ErrMarginLevelsGetByTxHash = errors.New("failed to get margin levels for tx hash")

	// TxHashes...
	ErrMissingEmptyTxHash = newInvalidArgumentError("missing or empty transaction hash")
	ErrInvalidTxHash      = newInvalidArgumentError("not a valid transaction hash")
)

API Errors and descriptions.

View Source
var FormatE = formatE

FormatE exports the formatE function (primarily for testing).

Functions

func ErrorMap

func ErrorMap() map[string]int32

ErrorMap returns a map of error to code, which is a mapping between API errors and Fury API specific numeric codes.

Types

type BlockService

type BlockService interface {
	GetLastBlock(ctx context.Context) (entities.Block, error)
}

BlockService ...

type Config

type Config struct {
	Level                    encoding.LogLevel `long:"log-level"`
	Timeout                  encoding.Duration `long:"timeout"`
	Port                     int               `long:"port"`
	WebUIPort                int               `long:"web-ui-port"`
	WebUIEnabled             encoding.Bool     `long:"web-ui-enabled"`
	Reflection               encoding.Bool     `long:"reflection"`
	IP                       string            `long:"ip"`
	StreamRetries            int               `long:"stream-retries"`
	CoreNodeIP               string            `long:"core-node-ip"`
	CoreNodeGRPCPort         int               `long:"core-node-grpc-port"`
	RateLimit                ratelimit.Config  `group:"rate-limits"`
	MaxSubscriptionPerClient uint32            `long:"max-subscription-per-client"`
}

Config represents the configuration of the api package.

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig creates an instance of the package specific configuration, given a pointer to a logger instance to be used for logging within the package.

type CoreServiceClient

type CoreServiceClient interface {
	protoapi.CoreServiceClient
}

CoreServiceClient ...

type EventService

type EventService interface {
	ObserveEvents(ctx context.Context, retries int, eTypes []events.Type, batchSize int, filters ...subscribers.EventFilter) (<-chan []*eventspb.BusEvent, chan<- int)
}

EventService ...

type FuryIDsSlice

type FuryIDsSlice []string

func (FuryIDsSlice) Ensure

func (s FuryIDsSlice) Ensure() error

type GRPCServer

type GRPCServer struct {
	Config
	// contains filtered or unexported fields
}

GRPCServer represent the grpc api provided by the fury node.

func NewGRPCServer

func NewGRPCServer(
	log *logging.Logger,
	config Config,
	coreServiceClient CoreServiceClient,
	eventService *subscribers.Service,
	orderService *service.Order,
	networkLimitsService *service.NetworkLimits,
	marketDataService *service.MarketData,
	tradeService *service.Trade,
	assetService *service.Asset,
	accountService *service.Account,
	rewardService *service.Reward,
	marketsService *service.Markets,
	delegationService *service.Delegation,
	epochService *service.Epoch,
	depositService *service.Deposit,
	withdrawalService *service.Withdrawal,
	governanceService *service.Governance,
	riskFactorService *service.RiskFactor,
	riskService *service.Risk,
	networkParameterService *service.NetworkParameter,
	blockService BlockService,
	checkpointService *service.Checkpoint,
	partyService *service.Party,
	candleService *candlesv2.Svc,
	oracleSpecService *service.OracleSpec,
	oracleDataService *service.OracleData,
	liquidityProvisionService *service.LiquidityProvision,
	positionService *service.Position,
	transferService *service.Transfer,
	stakeLinkingService *service.StakeLinking,
	notaryService *service.Notary,
	multiSigService *service.MultiSig,
	keyRotationService *service.KeyRotations,
	ethereumKeyRotationService *service.EthereumKeyRotation,
	nodeService *service.Node,
	marketDepthService *service.MarketDepth,
	ledgerService *service.Ledger,
	protocolUpgradeService *service.ProtocolUpgrade,
	networkHistoryService NetworkHistoryService,
	coreSnapshotService *service.SnapshotData,
) *GRPCServer

NewGRPCServer create a new instance of the GPRC api for the fury node.

func (*GRPCServer) ReloadConf

func (g *GRPCServer) ReloadConf(cfg Config)

ReloadConf update the internal configuration of the GRPC server.

func (*GRPCServer) Start

func (g *GRPCServer) Start(ctx context.Context, lis net.Listener) error

Start starts the grpc server. Uses default TCP listener if no provided.

type NetworkHistoryService

type NetworkHistoryService interface {
	GetHighestBlockHeightHistorySegment() (segment.Full, error)
	ListAllHistorySegments() (segment.Segments[segment.Full], error)
	FetchHistorySegment(ctx context.Context, historySegmentID string) (segment.Full, error)
	GetActivePeerIPAddresses() []string
	CopyHistorySegmentToFile(ctx context.Context, historySegmentID string, outFile string) error
	GetHistorySegmentReader(ctx context.Context, historySegmentID string) (io.ReadSeekCloser, int64, error)
	GetSwarmKeySeed() string
	GetConnectedPeerAddresses() ([]string, error)
	GetIpfsAddress() (string, error)
	GetSwarmKey() string
	GetBootstrapPeers() []string
}

NetworkHistoryService ...

it would be nice to use go:generate go run github.com/golang/mock/mockgen -destination mocks/networkhistory_service_mock.go -package mocks github.com/elysiumstation/fury/datanode/api NetworkHistoryService however it currently can't handle generic arguments and the generated code is not compilable without a bit of manual tweaking.

type TradingDataServiceV2

type TradingDataServiceV2 struct {
	v2.UnimplementedTradingDataServiceServer

	NetworkHistoryService NetworkHistoryService
	// contains filtered or unexported fields
}

func (*TradingDataServiceV2) EstimateFee

EstimateFee estimates the fee for a given market, price and size.

func (*TradingDataServiceV2) EstimateMargin

EstimateMargin estimates the margin required for a given order.

func (*TradingDataServiceV2) EstimatePosition

func (*TradingDataServiceV2) ExportLedgerEntries

ExportLedgerEntries returns a list of ledger entries matching the request.

func (*TradingDataServiceV2) ExportNetworkHistory

-- NetworkHistory --.

func (*TradingDataServiceV2) GetActiveNetworkHistoryPeerAddresses

GetActiveNetworkHistoryPeerAddresses returns the active network history peer addresses.

func (*TradingDataServiceV2) GetAsset

GetAsset gets an asset by ID.

func (*TradingDataServiceV2) GetDeposit

GetDeposit gets a deposit by ID.

func (*TradingDataServiceV2) GetERC20ListAssetBundle

func (*TradingDataServiceV2) GetERC20SetAssetLimitsBundle

GetERC20SetAssetLimitsBundle returns the signature bundle needed to update the asset limits on the ERC20 contract.

func (*TradingDataServiceV2) GetERC20WithdrawalApproval

GetERC20WithdrawalApproval returns the signature bundle needed to approve a withdrawal on the ERC20 contract.

func (*TradingDataServiceV2) GetEpoch

GetEpoch retrieves data for a specific epoch, if id omitted it gets the current epoch.

func (*TradingDataServiceV2) GetFuryTime

GetFuryTime returns the current fury time.

func (*TradingDataServiceV2) GetGovernanceData

GetGovernanceData gets governance data.

func (*TradingDataServiceV2) GetLastTrade

GetLastTrade returns the last trade for a given market.

func (*TradingDataServiceV2) GetLatestMarketData

GetLatestMarketData returns the latest market data for a given market.

func (*TradingDataServiceV2) GetLatestMarketDepth

GetLatestMarketDepth returns the latest market depth for a given market.

func (*TradingDataServiceV2) GetMarket

GetMarket returns a market by its ID.

func (*TradingDataServiceV2) GetMarketDataHistoryByID

GetMarketDataHistoryByID returns the market data history for a given market.

func (*TradingDataServiceV2) GetMostRecentNetworkHistorySegment

GetMostRecentNetworkHistorySegment returns the most recent network history segment.

func (*TradingDataServiceV2) GetNetworkData

GetNetworkData retrieve network data regarding the nodes of the network.

func (*TradingDataServiceV2) GetNetworkHistoryBootstrapPeers

NetworkHistoryBootstrapPeers returns the network history bootstrap peers.

func (*TradingDataServiceV2) GetNetworkHistoryStatus

NetworkHistoryStatus returns the network history status.

func (*TradingDataServiceV2) GetNetworkLimits

GetNetworkLimits returns the latest network limits.

func (*TradingDataServiceV2) GetNetworkParameter

GetNetworkParameter returns a network parameter by key.

func (*TradingDataServiceV2) GetNode

GetNode retrieves information about a given node.

func (*TradingDataServiceV2) GetOracleSpec

GetOracleSpec gets an oracle spec by ID.

func (*TradingDataServiceV2) GetOrder

GetOrder gets an order by ID.

func (*TradingDataServiceV2) GetParty

GetParty returns a Party by ID.

func (*TradingDataServiceV2) GetProtocolUpgradeStatus

GetProtocolUpgradeStatus returns the status of the protocol upgrade process.

func (*TradingDataServiceV2) GetRiskFactors

GetRiskFactors returns the risk factors for a given market.

func (*TradingDataServiceV2) GetStake

GetStake returns the stake for a party and the linkings to that stake.

func (*TradingDataServiceV2) GetWithdrawal

GetWithdrawal gets a withdrawal by ID.

func (*TradingDataServiceV2) Info

Info returns the version and commit hash of the trading data service.

func (*TradingDataServiceV2) ListAccounts

ListAccounts lists accounts matching the request.

func (*TradingDataServiceV2) ListAllNetworkHistorySegments

ListAllNetworkHistorySegments returns all network history segments.

func (*TradingDataServiceV2) ListAllPositions

ListAllPositions lists all positions.

func (*TradingDataServiceV2) ListAssets

ListAssets gets all assets. If an asset ID is provided, it will return a single asset.

func (*TradingDataServiceV2) ListBalanceChanges

ListBalanceChanges returns a list of balance changes matching the request.

func (*TradingDataServiceV2) ListCandleData

ListCandleData for a given market, time range and interval. Interval must be a valid postgres interval value.

func (*TradingDataServiceV2) ListCandleIntervals

ListCandleIntervals gets all available intervals for a given market along with the corresponding candle id.

func (*TradingDataServiceV2) ListCheckpoints

ListCheckpoints returns a list of checkpoints.

func (*TradingDataServiceV2) ListCoreSnapshots

ListCoreSnapshots returns a list of core snapshots.

func (*TradingDataServiceV2) ListDelegations

ListDelegations returns a list of delegations using cursor pagination.

func (*TradingDataServiceV2) ListDeposits

ListDeposits gets deposits for a party.

func (*TradingDataServiceV2) ListERC20MultiSigSignerAddedBundles

ListERC20MultiSigSignerAddedBundles returns the signature bundles needed to add a new validator to the multisig control ERC20 contract.

func (*TradingDataServiceV2) ListERC20MultiSigSignerRemovedBundles

ListERC20MultiSigSignerRemovedBundles returns the signature bundles needed to add a new validator to the multisig control ERC20 contract.

func (*TradingDataServiceV2) ListEntities

func (*TradingDataServiceV2) ListEpochRewardSummaries

ListEpochRewardSummaries gets reward summaries for epoch range.

func (*TradingDataServiceV2) ListEthereumKeyRotations

ListEthereumKeyRotations returns a list of Ethereum key rotations.

func (*TradingDataServiceV2) ListGovernanceData

ListGovernanceData lists governance data using cursor pagination.

func (*TradingDataServiceV2) ListKeyRotations

ListKeyRotations returns a list of key rotations for a given node.

func (*TradingDataServiceV2) ListLatestMarketData

ListLatestMarketData returns the latest market data for every market.

func (*TradingDataServiceV2) ListLedgerEntries

ListLedgerEntries returns a list of ledger entries matching the request.

func (*TradingDataServiceV2) ListLiquidityProvisions

ListLiquidityProvisions gets all liquidity provisions.

func (*TradingDataServiceV2) ListMarginLevels

ListMarginLevels lists MarginLevels.

func (*TradingDataServiceV2) ListMarkets

ListMarkets lists all markets.

func (*TradingDataServiceV2) ListNetworkParameters

ListNetworkParameters returns a list of network parameters.

func (*TradingDataServiceV2) ListNodeSignatures

ListNodeSignatures returns the signatures for a given node.

func (*TradingDataServiceV2) ListNodes

ListNodes returns information about the nodes on the network.

func (*TradingDataServiceV2) ListOracleData

ListOracleData gets all oracle data.

func (*TradingDataServiceV2) ListOracleSpecs

ListOracleSpecs gets all oracle specs.

func (*TradingDataServiceV2) ListOrderVersions

ListOrderVersions lists order versions using cursor pagination.

func (*TradingDataServiceV2) ListOrders

ListOrders lists orders using cursor pagination.

func (*TradingDataServiceV2) ListParties

ListParties lists Parties.

func (*TradingDataServiceV2) ListPositions deprecated

List all Positions.

Deprecated: Use ListAllPositions instead.

func (*TradingDataServiceV2) ListProtocolUpgradeProposals

ListProtocolUpgradeProposals returns a list of protocol upgrade proposals.

func (*TradingDataServiceV2) ListRewardSummaries

ListRewardSummaries gets reward summaries.

func (*TradingDataServiceV2) ListRewards

ListRewards lists Rewards.

func (*TradingDataServiceV2) ListTrades

ListTrades lists trades by using a cursor based pagination model.

func (*TradingDataServiceV2) ListTransfers

ListTransfers lists transfers using cursor pagination. If a pubkey is provided, it will list transfers for that pubkey.

func (*TradingDataServiceV2) ListVotes

ListVotes gets all Votes.

func (*TradingDataServiceV2) ListWithdrawals

ListWithdrawals gets withdrawals for a party.

func (*TradingDataServiceV2) ObserveAccounts

ObserveAccounts streams account balances matching the request.

func (*TradingDataServiceV2) ObserveCandleData

ObserveCandleData subscribes to candle updates for a given market and interval. Interval must be a valid postgres interval value.

func (*TradingDataServiceV2) ObserveEventBus

ObserveEventBus subscribes to a stream of events.

func (*TradingDataServiceV2) ObserveGovernance

ObserveGovernance streams governance updates to the client.

func (*TradingDataServiceV2) ObserveLedgerMovements

ObserveLedgerMovements subscribes to a stream of ledger movements.

func (*TradingDataServiceV2) ObserveLiquidityProvisions

ObserveLiquidityProvisions subscribes to liquidity provisions.

func (*TradingDataServiceV2) ObserveMarginLevels

ObserveMarginLevels subscribes to a stream of Margin Levels.

func (*TradingDataServiceV2) ObserveMarketsData

ObserveMarketsData subscribes to market data updates.

func (*TradingDataServiceV2) ObserveMarketsDepth

ObserveMarketsDepth subscribes to market depth updates.

func (*TradingDataServiceV2) ObserveMarketsDepthUpdates

ObserveMarketsDepthUpdates subscribes to market depth updates.

func (*TradingDataServiceV2) ObserveOrders

ObserveOrders subscribes to a stream of orders.

func (*TradingDataServiceV2) ObservePositions

ObservePositions subscribes to a stream of Positions.

func (*TradingDataServiceV2) ObserveTrades

ObserveTrades opens a subscription to the Trades service.

func (*TradingDataServiceV2) ObserveVotes

ObserveVotes streams votes for a given party or proposal.

func (*TradingDataServiceV2) Ping

Ping returns a ping response.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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