Documentation ¶
Overview ¶
Package api implements the Rosetta API for Flow.
Index ¶
- type Server
- func (s *Server) AccountBalance(ctx context.Context, r *types.AccountBalanceRequest) (*types.AccountBalanceResponse, *types.Error)
- func (s *Server) AccountCoins(ctx context.Context, r *types.AccountCoinsRequest) (*types.AccountCoinsResponse, *types.Error)
- func (s *Server) Block(ctx context.Context, r *types.BlockRequest) (*types.BlockResponse, *types.Error)
- func (s *Server) BlockTransaction(ctx context.Context, r *types.BlockTransactionRequest) (*types.BlockTransactionResponse, *types.Error)
- func (s *Server) Call(ctx context.Context, r *types.CallRequest) (*types.CallResponse, *types.Error)
- func (s *Server) ConstructionCombine(ctx context.Context, r *types.ConstructionCombineRequest) (*types.ConstructionCombineResponse, *types.Error)
- func (s *Server) ConstructionDerive(ctx context.Context, r *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error)
- func (s *Server) ConstructionHash(ctx context.Context, r *types.ConstructionHashRequest) (*types.TransactionIdentifierResponse, *types.Error)
- func (s *Server) ConstructionMetadata(ctx context.Context, r *types.ConstructionMetadataRequest) (*types.ConstructionMetadataResponse, *types.Error)
- func (s *Server) ConstructionParse(ctx context.Context, r *types.ConstructionParseRequest) (*types.ConstructionParseResponse, *types.Error)
- func (s *Server) ConstructionPayloads(ctx context.Context, r *types.ConstructionPayloadsRequest) (*types.ConstructionPayloadsResponse, *types.Error)
- func (s *Server) ConstructionPreprocess(ctx context.Context, r *types.ConstructionPreprocessRequest) (*types.ConstructionPreprocessResponse, *types.Error)
- func (s *Server) ConstructionSubmit(ctx context.Context, r *types.ConstructionSubmitRequest) (*types.TransactionIdentifierResponse, *types.Error)
- func (s *Server) Mempool(ctx context.Context, r *types.NetworkRequest) (*types.MempoolResponse, *types.Error)
- func (s *Server) MempoolTransaction(ctx context.Context, r *types.MempoolTransactionRequest) (*types.MempoolTransactionResponse, *types.Error)
- func (s *Server) NetworkList(ctx context.Context, r *types.MetadataRequest) (*types.NetworkListResponse, *types.Error)
- func (s *Server) NetworkOptions(ctx context.Context, r *types.NetworkRequest) (*types.NetworkOptionsResponse, *types.Error)
- func (s *Server) NetworkStatus(ctx context.Context, r *types.NetworkRequest) (*types.NetworkStatusResponse, *types.Error)
- func (s *Server) Run(ctx context.Context)
- type Wrapper
- func (w Wrapper) AccountBalance(ctx context.Context, r *types.AccountBalanceRequest) (*types.AccountBalanceResponse, *types.Error)
- func (w Wrapper) AccountCoins(ctx context.Context, r *types.AccountCoinsRequest) (*types.AccountCoinsResponse, *types.Error)
- func (w Wrapper) Block(ctx context.Context, r *types.BlockRequest) (*types.BlockResponse, *types.Error)
- func (w Wrapper) BlockTransaction(ctx context.Context, r *types.BlockTransactionRequest) (*types.BlockTransactionResponse, *types.Error)
- func (w Wrapper) Call(ctx context.Context, r *types.CallRequest) (*types.CallResponse, *types.Error)
- func (w Wrapper) ConstructionCombine(ctx context.Context, r *types.ConstructionCombineRequest) (*types.ConstructionCombineResponse, *types.Error)
- func (w Wrapper) ConstructionDerive(ctx context.Context, r *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error)
- func (w Wrapper) ConstructionHash(ctx context.Context, r *types.ConstructionHashRequest) (*types.TransactionIdentifierResponse, *types.Error)
- func (w Wrapper) ConstructionMetadata(ctx context.Context, r *types.ConstructionMetadataRequest) (*types.ConstructionMetadataResponse, *types.Error)
- func (w Wrapper) ConstructionParse(ctx context.Context, r *types.ConstructionParseRequest) (*types.ConstructionParseResponse, *types.Error)
- func (w Wrapper) ConstructionPayloads(ctx context.Context, r *types.ConstructionPayloadsRequest) (*types.ConstructionPayloadsResponse, *types.Error)
- func (w Wrapper) ConstructionPreprocess(ctx context.Context, r *types.ConstructionPreprocessRequest) (*types.ConstructionPreprocessResponse, *types.Error)
- func (w Wrapper) ConstructionSubmit(ctx context.Context, r *types.ConstructionSubmitRequest) (*types.TransactionIdentifierResponse, *types.Error)
- func (w Wrapper) Mempool(ctx context.Context, r *types.NetworkRequest) (*types.MempoolResponse, *types.Error)
- func (w Wrapper) MempoolTransaction(ctx context.Context, r *types.MempoolTransactionRequest) (*types.MempoolTransactionResponse, *types.Error)
- func (w Wrapper) NetworkList(ctx context.Context, r *types.MetadataRequest) (*types.NetworkListResponse, *types.Error)
- func (w Wrapper) NetworkOptions(ctx context.Context, r *types.NetworkRequest) (*types.NetworkOptionsResponse, *types.Error)
- func (w Wrapper) NetworkStatus(ctx context.Context, r *types.NetworkRequest) (*types.NetworkStatusResponse, *types.Error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { Chain *config.Chain ConstructionAccessNodes access.Pool DataAccessNodes access.Pool Index *indexdb.Store Indexer *state.Indexer Offline bool Port uint16 // contains filtered or unexported fields }
Server is the Flow Rosetta API server.
func (*Server) AccountBalance ¶
func (s *Server) AccountBalance(ctx context.Context, r *types.AccountBalanceRequest) (*types.AccountBalanceResponse, *types.Error)
AccountBalance implements the /account/balance endpoint.
func (*Server) AccountCoins ¶
func (s *Server) AccountCoins(ctx context.Context, r *types.AccountCoinsRequest) (*types.AccountCoinsResponse, *types.Error)
AccountCoins implements the /account/coins endpoint.
func (*Server) Block ¶
func (s *Server) Block(ctx context.Context, r *types.BlockRequest) (*types.BlockResponse, *types.Error)
Block implements the /block endpoint.
func (*Server) BlockTransaction ¶
func (s *Server) BlockTransaction(ctx context.Context, r *types.BlockTransactionRequest) (*types.BlockTransactionResponse, *types.Error)
BlockTransaction implements the /block/transaction endpoint.
func (*Server) Call ¶
func (s *Server) Call(ctx context.Context, r *types.CallRequest) (*types.CallResponse, *types.Error)
Call implements the /call endpoint.
func (*Server) ConstructionCombine ¶
func (s *Server) ConstructionCombine(ctx context.Context, r *types.ConstructionCombineRequest) (*types.ConstructionCombineResponse, *types.Error)
ConstructionCombine implements the /construction/combine endpoint.
func (*Server) ConstructionDerive ¶
func (s *Server) ConstructionDerive(ctx context.Context, r *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error)
ConstructionDerive implements the /construction/derive endpoint.
func (*Server) ConstructionHash ¶
func (s *Server) ConstructionHash(ctx context.Context, r *types.ConstructionHashRequest) (*types.TransactionIdentifierResponse, *types.Error)
ConstructionHash implements the /construction/hash endpoint.
func (*Server) ConstructionMetadata ¶
func (s *Server) ConstructionMetadata(ctx context.Context, r *types.ConstructionMetadataRequest) (*types.ConstructionMetadataResponse, *types.Error)
ConstructionMetadata implements the /construction/metadata endpoint.
func (*Server) ConstructionParse ¶
func (s *Server) ConstructionParse(ctx context.Context, r *types.ConstructionParseRequest) (*types.ConstructionParseResponse, *types.Error)
ConstructionParse implements the /construction/parse endpoint.
func (*Server) ConstructionPayloads ¶
func (s *Server) ConstructionPayloads(ctx context.Context, r *types.ConstructionPayloadsRequest) (*types.ConstructionPayloadsResponse, *types.Error)
ConstructionPayloads implements the /construction/payloads endpoint.
func (*Server) ConstructionPreprocess ¶
func (s *Server) ConstructionPreprocess(ctx context.Context, r *types.ConstructionPreprocessRequest) (*types.ConstructionPreprocessResponse, *types.Error)
ConstructionPreprocess implements the /construction/preprocess endpoint.
func (*Server) ConstructionSubmit ¶
func (s *Server) ConstructionSubmit(ctx context.Context, r *types.ConstructionSubmitRequest) (*types.TransactionIdentifierResponse, *types.Error)
ConstructionSubmit implements the /construction/submit endpoint.
func (*Server) Mempool ¶
func (s *Server) Mempool(ctx context.Context, r *types.NetworkRequest) (*types.MempoolResponse, *types.Error)
Mempool implements the /mempool endpoint.
func (*Server) MempoolTransaction ¶
func (s *Server) MempoolTransaction(ctx context.Context, r *types.MempoolTransactionRequest) (*types.MempoolTransactionResponse, *types.Error)
MempoolTransaction implements the /mempool/transaction endpoint.
func (*Server) NetworkList ¶
func (s *Server) NetworkList(ctx context.Context, r *types.MetadataRequest) (*types.NetworkListResponse, *types.Error)
NetworkList implements the /network/list endpoint.
func (*Server) NetworkOptions ¶
func (s *Server) NetworkOptions(ctx context.Context, r *types.NetworkRequest) (*types.NetworkOptionsResponse, *types.Error)
NetworkOptions implements the /network/options endpoint.
func (*Server) NetworkStatus ¶
func (s *Server) NetworkStatus(ctx context.Context, r *types.NetworkRequest) (*types.NetworkStatusResponse, *types.Error)
NetworkStatus implements the /network/status endpoint.
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper wraps the Rosetta API handlers so that all requests are automatically traced with any response errors logged.
If the system has encountered any invalid indexed state errors, then the first such error will be returned on all endpoints except for /call and /network/* API calls.
func (Wrapper) AccountBalance ¶
func (w Wrapper) AccountBalance(ctx context.Context, r *types.AccountBalanceRequest) (*types.AccountBalanceResponse, *types.Error)
func (Wrapper) AccountCoins ¶
func (w Wrapper) AccountCoins(ctx context.Context, r *types.AccountCoinsRequest) (*types.AccountCoinsResponse, *types.Error)
func (Wrapper) Block ¶
func (w Wrapper) Block(ctx context.Context, r *types.BlockRequest) (*types.BlockResponse, *types.Error)
func (Wrapper) BlockTransaction ¶
func (w Wrapper) BlockTransaction(ctx context.Context, r *types.BlockTransactionRequest) (*types.BlockTransactionResponse, *types.Error)
func (Wrapper) Call ¶
func (w Wrapper) Call(ctx context.Context, r *types.CallRequest) (*types.CallResponse, *types.Error)
func (Wrapper) ConstructionCombine ¶
func (w Wrapper) ConstructionCombine(ctx context.Context, r *types.ConstructionCombineRequest) (*types.ConstructionCombineResponse, *types.Error)
func (Wrapper) ConstructionDerive ¶
func (w Wrapper) ConstructionDerive(ctx context.Context, r *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error)
func (Wrapper) ConstructionHash ¶
func (w Wrapper) ConstructionHash(ctx context.Context, r *types.ConstructionHashRequest) (*types.TransactionIdentifierResponse, *types.Error)
func (Wrapper) ConstructionMetadata ¶
func (w Wrapper) ConstructionMetadata(ctx context.Context, r *types.ConstructionMetadataRequest) (*types.ConstructionMetadataResponse, *types.Error)
func (Wrapper) ConstructionParse ¶
func (w Wrapper) ConstructionParse(ctx context.Context, r *types.ConstructionParseRequest) (*types.ConstructionParseResponse, *types.Error)
func (Wrapper) ConstructionPayloads ¶
func (w Wrapper) ConstructionPayloads(ctx context.Context, r *types.ConstructionPayloadsRequest) (*types.ConstructionPayloadsResponse, *types.Error)
func (Wrapper) ConstructionPreprocess ¶
func (w Wrapper) ConstructionPreprocess(ctx context.Context, r *types.ConstructionPreprocessRequest) (*types.ConstructionPreprocessResponse, *types.Error)
func (Wrapper) ConstructionSubmit ¶
func (w Wrapper) ConstructionSubmit(ctx context.Context, r *types.ConstructionSubmitRequest) (*types.TransactionIdentifierResponse, *types.Error)
func (Wrapper) Mempool ¶
func (w Wrapper) Mempool(ctx context.Context, r *types.NetworkRequest) (*types.MempoolResponse, *types.Error)
func (Wrapper) MempoolTransaction ¶
func (w Wrapper) MempoolTransaction(ctx context.Context, r *types.MempoolTransactionRequest) (*types.MempoolTransactionResponse, *types.Error)
func (Wrapper) NetworkList ¶
func (w Wrapper) NetworkList(ctx context.Context, r *types.MetadataRequest) (*types.NetworkListResponse, *types.Error)
func (Wrapper) NetworkOptions ¶
func (w Wrapper) NetworkOptions(ctx context.Context, r *types.NetworkRequest) (*types.NetworkOptionsResponse, *types.Error)
func (Wrapper) NetworkStatus ¶
func (w Wrapper) NetworkStatus(ctx context.Context, r *types.NetworkRequest) (*types.NetworkStatusResponse, *types.Error)