services

package
v0.0.0-...-c576f33 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Errors contains all errors that could be returned
	// by this Rosetta implementation.
	Errors = []*types.Error{
		ErrUnimplemented,
		ErrUnavailableOffline,
		ErrNotReady,
		ErrWrongBlockHash,
	}

	// ErrUnimplemented is returned when an endpoint
	// is called that is not implemented.
	ErrUnimplemented = &types.Error{
		Code:    0,
		Message: "Endpoint not implemented",
	}

	// ErrUnavailableOffline is returned when an endpoint
	// is called that is not available offline.
	ErrUnavailableOffline = &types.Error{
		Code:    1,
		Message: "Endpoint unavailable offline",
	}

	// ErrNotReady is returned when ICON Node is not
	// yet ready to serve queries.
	ErrNotReady = &types.Error{
		Code:      2,
		Message:   "ICON Node is not ready",
		Retriable: true,
	}

	// ErrUnableToDecompressPubkey is returned when
	// the *types.PublicKey provided in /construction/derive
	// cannot be decompressed.
	ErrUnableToDecompressPubkey = &types.Error{
		Code:    3,
		Message: "unable to decompress public key",
	}

	// ErrUnclearIntent is returned when operations
	// provided in /construction/preprocess or /construction/payloads
	// are not valid.
	ErrUnclearIntent = &types.Error{
		Code:    4,
		Message: "Unable to parse intent",
	}

	// ErrUnableToParseIntermediateResult is returned
	// when a data structure passed between Construction
	// API calls is not valid.
	ErrUnableToParseIntermediateResult = &types.Error{
		Code:    5,
		Message: "Unable to parse intermediate result",
	}

	// ErrSignatureInvalid is returned when a signature
	// cannot be parsed.
	ErrSignatureInvalid = &types.Error{
		Code:    6,
		Message: "Signature invalid",
	}

	// ErrBroadcastFailed is returned when transaction
	// broadcast fails.
	ErrBroadcastFailed = &types.Error{
		Code:    7,
		Message: "Unable to broadcast transaction",
	}

	// ErrInvalidAddress is returned when an address
	// is not valid.
	ErrInvalidAddress = &types.Error{
		Code:    12,
		Message: "Invalid address",
	}

	// ErrNotReady is returned when ICON Node is not
	// yet ready to serve queries.
	ErrWrongBlockHash = &types.Error{
		Code:      13,
		Message:   "Wrong Block Hash",
		Retriable: true,
	}
)

Functions

func NewBlockchainRouter

func NewBlockchainRouter(
	config *configuration.Configuration,
	client *icon.Client,
	asserter *asserter.Asserter,
) http.Handler

NewBlockchainRouter 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(
	config *configuration.Configuration,
	client *icon.Client,
) *AccountAPIService

func (*AccountAPIService) AccountBalance

AccountBalance implements /account/balance.

type BlockAPIService

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

func NewBlockAPIService

func NewBlockAPIService(
	config *configuration.Configuration,
	client *icon.Client,
) *BlockAPIService

func (*BlockAPIService) Block

Block implements the /block endpoint.

func (*BlockAPIService) BlockTransaction

BlockTransaction implements the /block/transaction endpoint.

type Client

type Client interface {
	GetBlock(
		context.Context,
		*types.PartialBlockIdentifier,
	) (*types.Block, error)
}

Client is used by the servicers to get block data and to submit transactions.

type ConstructionAPIService

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

func NewConstructionAPIService

func NewConstructionAPIService(
	cfg *configuration.Configuration,
	client *icon.Client,
) *ConstructionAPIService

func (*ConstructionAPIService) ConstructionCombine

func (*ConstructionAPIService) ConstructionDerive

func (*ConstructionAPIService) ConstructionHash

func (*ConstructionAPIService) ConstructionMetadata

func (*ConstructionAPIService) ConstructionParse

ConstructionParse implements the /construction/parse endpoint.

func (*ConstructionAPIService) ConstructionPayloads

func (*ConstructionAPIService) ConstructionPreprocess

func (*ConstructionAPIService) ConstructionSubmit

type NetworkAPIService

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

func NewNetworkAPIService

func NewNetworkAPIService(
	config *configuration.Configuration,
	client *icon.Client,
) *NetworkAPIService

func (*NetworkAPIService) NetworkList

NetworkList implements the /network/list endpoint

func (*NetworkAPIService) NetworkOptions

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

NetworkOptions implements the /network/options endpoint.

func (*NetworkAPIService) NetworkStatus

NetworkStatus implements the /network/status endpoint.

Jump to

Keyboard shortcuts

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