services

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operations
	OpTransfer = "transfer"
	OpFee      = "fee"
	OpMint     = "mint"
	OpBurn     = "burn"
)
View Source
const (
	// TODO revisit: manage dependency upon RosettaCore server running alongside this
	RosettaCoreVersion = "beta/construction"
)

Variables

View Source
var (
	// TODO potentially remove from Rosetta core, as it shouldn't really be used there (perhaps for Construction)
	CeloDollar = rpc.CeloDollar

	// StableToken contract param
	ZeroAddress common.Address = common.HexToAddress("0x0")

	// Error codes and messages
	ErrValidation    = rpc.ErrValidation
	ErrCeloClient    = rpc.ErrCeloClient
	ErrUnimplemented = rpc.ErrUnimplemented
	ErrInternal      = rpc.ErrInternal

	AllErrors = []*types.Error{
		ErrValidation,
		ErrCeloClient,
		ErrUnimplemented,
		ErrInternal,
	}

	// Operations and statuses
	OpSuccess = types.OperationStatus{
		Status:     "success",
		Successful: true,
	}
	OpFailed = types.OperationStatus{
		Status:     "failed",
		Successful: false,
	}
	AllOperationStatuses = []*types.OperationStatus{
		&OpSuccess,
		&OpFailed,
	}
	AllOperationTypes = []string{
		OpTransfer,
		OpFee,
		OpMint,
		OpBurn,
	}
)
View Source
var (
	// MiddlewareVersion is the version of this package.
	// We set this as a variable instead of a constant because
	// we typically need the pointer of this // value.
	MiddlewareVersion = "0.0.1"
)

Functions

func CreateRouter

func CreateRouter(
	client *client.APIClient,
	asserter *asserter.Asserter,
	stableToken *StableToken,
) (http.Handler, error)

Creates a Mux http.Handler from a collection of server controllers.

Types

type AccountAPIService

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

func NewAccountAPIService

func NewAccountAPIService(
	client *client.APIClient,
) *AccountAPIService

func (*AccountAPIService) AccountBalance

endpoint: /account/balance

type BlockAPIService

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

Implements the server.BlockAPIServicer interface.

func NewBlockAPIService

func NewBlockAPIService(
	client *client.APIClient,
	stableToken *StableToken,
) *BlockAPIService

func (*BlockAPIService) Block

endpoint: /block

func (*BlockAPIService) BlockTransaction

endpoint: /block/transaction

type ConstructionAPIService

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

Implements the server.ConstructionAPIServicer interface.

func NewConstructionAPIService

func NewConstructionAPIService(
	client *client.APIClient,
	stableToken *StableToken,
) *ConstructionAPIService

func (*ConstructionAPIService) ConstructionCombine

endpoint: /construction/combine

func (*ConstructionAPIService) ConstructionDerive

endpoint: /construction/derive

func (*ConstructionAPIService) ConstructionHash

endpoint: /construction/hash

func (*ConstructionAPIService) ConstructionMetadata

endpoint: /construction/metadata

func (*ConstructionAPIService) ConstructionParse

endpoint: /construction/parse

func (*ConstructionAPIService) ConstructionPayloads

endpoint: /construction/payloads

func (*ConstructionAPIService) ConstructionPreprocess

endpoint: /construction/preprocess

func (*ConstructionAPIService) ConstructionSubmit

endpoint: /construction/submit

type MempoolAPIService

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

Implements the server.MempoolAPIServicer interface.

func NewMempoolAPIService

func NewMempoolAPIService(
	client *client.APIClient,
) *MempoolAPIService

func (*MempoolAPIService) Mempool

endpoint: /mempool

func (*MempoolAPIService) MempoolTransaction

endpoint: /mempool/transaction

type NetworkAPIService

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

Implements the server.NetworkAPIService interface.

func NewNetworkAPIService

func NewNetworkAPIService(
	client *client.APIClient,
) *NetworkAPIService

func (*NetworkAPIService) NetworkList

endpoint: /network/list

func (*NetworkAPIService) NetworkOptions

func (s *NetworkAPIService) NetworkOptions(
	ctx context.Context,
	request *types.NetworkRequest,
) (*types.NetworkOptionsResponse, *types.Error)

endpoint: /network/options

func (*NetworkAPIService) NetworkStatus

endpoint: /network/status

type StableToken

type StableToken struct {
	BlockThreshold int64
	Address        common.Address
	ABI            *abi.ABI
}

Types and wrappers for types that are not specific to one service

func NewStableToken

func NewStableToken(networkId string) (*StableToken, error)

Jump to

Keyboard shortcuts

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