Documentation ¶
Index ¶
- Constants
- Variables
- func CreateRouter(client *client.APIClient, asserter *asserter.Asserter, ...) (http.Handler, error)
- type AccountAPIService
- type BlockAPIService
- type ConstructionAPIService
- func (s *ConstructionAPIService) ConstructionCombine(ctx context.Context, request *types.ConstructionCombineRequest) (*types.ConstructionCombineResponse, *types.Error)
- func (s *ConstructionAPIService) ConstructionDerive(ctx context.Context, request *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error)
- func (s *ConstructionAPIService) ConstructionHash(ctx context.Context, request *types.ConstructionHashRequest) (*types.TransactionIdentifierResponse, *types.Error)
- func (s *ConstructionAPIService) ConstructionMetadata(ctx context.Context, request *types.ConstructionMetadataRequest) (*types.ConstructionMetadataResponse, *types.Error)
- func (s *ConstructionAPIService) ConstructionParse(ctx context.Context, request *types.ConstructionParseRequest) (*types.ConstructionParseResponse, *types.Error)
- func (s *ConstructionAPIService) ConstructionPayloads(ctx context.Context, request *types.ConstructionPayloadsRequest) (*types.ConstructionPayloadsResponse, *types.Error)
- func (s *ConstructionAPIService) ConstructionPreprocess(ctx context.Context, request *types.ConstructionPreprocessRequest) (*types.ConstructionPreprocessResponse, *types.Error)
- func (s *ConstructionAPIService) ConstructionSubmit(ctx context.Context, request *types.ConstructionSubmitRequest) (*types.TransactionIdentifierResponse, *types.Error)
- type MempoolAPIService
- type NetworkAPIService
- func (s *NetworkAPIService) NetworkList(ctx context.Context, request *types.MetadataRequest) (*types.NetworkListResponse, *types.Error)
- func (s *NetworkAPIService) NetworkOptions(ctx context.Context, request *types.NetworkRequest) (*types.NetworkOptionsResponse, *types.Error)
- func (s *NetworkAPIService) NetworkStatus(ctx context.Context, request *types.NetworkRequest) (*types.NetworkStatusResponse, *types.Error)
- type StableToken
Constants ¶
const ( // Operations OpTransfer = "transfer" OpFee = "fee" OpMint = "mint" OpBurn = "burn" )
const (
// TODO revisit: manage dependency upon RosettaCore server running alongside this
RosettaCoreVersion = "beta/construction"
)
Variables ¶
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, } )
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 ¶
func (s *AccountAPIService) AccountBalance( ctx context.Context, request *types.AccountBalanceRequest, ) (*types.AccountBalanceResponse, *types.Error)
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 ¶
func (s *BlockAPIService) Block( ctx context.Context, request *types.BlockRequest, ) (*types.BlockResponse, *types.Error)
endpoint: /block
func (*BlockAPIService) BlockTransaction ¶
func (s *BlockAPIService) BlockTransaction( ctx context.Context, request *types.BlockTransactionRequest, ) (*types.BlockTransactionResponse, *types.Error)
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 ¶
func (s *ConstructionAPIService) ConstructionCombine( ctx context.Context, request *types.ConstructionCombineRequest, ) (*types.ConstructionCombineResponse, *types.Error)
endpoint: /construction/combine
func (*ConstructionAPIService) ConstructionDerive ¶
func (s *ConstructionAPIService) ConstructionDerive( ctx context.Context, request *types.ConstructionDeriveRequest, ) (*types.ConstructionDeriveResponse, *types.Error)
endpoint: /construction/derive
func (*ConstructionAPIService) ConstructionHash ¶
func (s *ConstructionAPIService) ConstructionHash( ctx context.Context, request *types.ConstructionHashRequest, ) (*types.TransactionIdentifierResponse, *types.Error)
endpoint: /construction/hash
func (*ConstructionAPIService) ConstructionMetadata ¶
func (s *ConstructionAPIService) ConstructionMetadata( ctx context.Context, request *types.ConstructionMetadataRequest, ) (*types.ConstructionMetadataResponse, *types.Error)
endpoint: /construction/metadata
func (*ConstructionAPIService) ConstructionParse ¶
func (s *ConstructionAPIService) ConstructionParse( ctx context.Context, request *types.ConstructionParseRequest, ) (*types.ConstructionParseResponse, *types.Error)
endpoint: /construction/parse
func (*ConstructionAPIService) ConstructionPayloads ¶
func (s *ConstructionAPIService) ConstructionPayloads( ctx context.Context, request *types.ConstructionPayloadsRequest, ) (*types.ConstructionPayloadsResponse, *types.Error)
endpoint: /construction/payloads
func (*ConstructionAPIService) ConstructionPreprocess ¶
func (s *ConstructionAPIService) ConstructionPreprocess( ctx context.Context, request *types.ConstructionPreprocessRequest, ) (*types.ConstructionPreprocessResponse, *types.Error)
endpoint: /construction/preprocess
func (*ConstructionAPIService) ConstructionSubmit ¶
func (s *ConstructionAPIService) ConstructionSubmit( ctx context.Context, request *types.ConstructionSubmitRequest, ) (*types.TransactionIdentifierResponse, *types.Error)
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 ¶
func (s *MempoolAPIService) Mempool( ctx context.Context, request *types.NetworkRequest, ) (*types.MempoolResponse, *types.Error)
endpoint: /mempool
func (*MempoolAPIService) MempoolTransaction ¶
func (s *MempoolAPIService) MempoolTransaction( ctx context.Context, request *types.MempoolTransactionRequest, ) (*types.MempoolTransactionResponse, *types.Error)
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 ¶
func (s *NetworkAPIService) NetworkList( ctx context.Context, request *types.MetadataRequest, ) (*types.NetworkListResponse, *types.Error)
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 ¶
func (s *NetworkAPIService) NetworkStatus( ctx context.Context, request *types.NetworkRequest, ) (*types.NetworkStatusResponse, *types.Error)
endpoint: /network/status
type StableToken ¶
Types and wrappers for types that are not specific to one service
func NewStableToken ¶
func NewStableToken(networkId string) (*StableToken, error)