Documentation ¶
Index ¶
- type GetReceiptRequest
- type GetReceiptResponse
- type RPCService
- func (rs *RPCService) GetReceipt(ctx context.Context, req GetReceiptRequest) (GetReceiptResponse, error)
- func (rs *RPCService) RelayWriteQuery(ctx context.Context, req RelayWriteQueryRequest) (RelayWriteQueryResponse, error)
- func (rs *RPCService) RunReadQuery(ctx context.Context, req RunReadQueryRequest) (RunReadQueryResponse, error)
- func (rs *RPCService) SetController(ctx context.Context, req SetControllerRequest) (SetControllerResponse, error)
- func (rs *RPCService) ValidateCreateTable(ctx context.Context, req ValidateCreateTableRequest) (ValidateCreateTableResponse, error)
- func (rs *RPCService) ValidateWriteQuery(ctx context.Context, req ValidateWriteQueryRequest) (ValidateWriteQueryResponse, error)
- type RelayWriteQueryRequest
- type RelayWriteQueryResponse
- type RunReadQueryRequest
- type RunReadQueryResponse
- type SetControllerRequest
- type SetControllerResponse
- type TxnReceipt
- type ValidateCreateTableRequest
- type ValidateCreateTableResponse
- type ValidateWriteQueryRequest
- type ValidateWriteQueryResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetReceiptRequest ¶
type GetReceiptRequest struct {
TxnHash string `json:"txn_hash"`
}
GetReceiptRequest is a GetTxnReceipt request.
type GetReceiptResponse ¶
type GetReceiptResponse struct { Ok bool `json:"ok"` Receipt *TxnReceipt `json:"receipt,omitempty"` }
GetReceiptResponse is a GetTxnReceipt response.
type RPCService ¶
type RPCService struct {
// contains filtered or unexported fields
}
RPCService provides the JSON RPC API.
func NewRPCService ¶
func NewRPCService(tbl tableland.Tableland) *RPCService
NewRPCService creates a new RPCService.
func (*RPCService) GetReceipt ¶
func (rs *RPCService) GetReceipt( ctx context.Context, req GetReceiptRequest, ) (GetReceiptResponse, error)
GetReceipt returns the receipt of a processed event by txn hash.
func (*RPCService) RelayWriteQuery ¶
func (rs *RPCService) RelayWriteQuery( ctx context.Context, req RelayWriteQueryRequest, ) (RelayWriteQueryResponse, error)
RelayWriteQuery allows the user to rely on the validator wrapping the query in a chain transaction.
func (*RPCService) RunReadQuery ¶
func (rs *RPCService) RunReadQuery( ctx context.Context, req RunReadQueryRequest, ) (RunReadQueryResponse, error)
RunReadQuery allows the user to run SQL.
func (*RPCService) SetController ¶
func (rs *RPCService) SetController( ctx context.Context, req SetControllerRequest, ) (SetControllerResponse, error)
SetController allows users to the controller for a token id.
func (*RPCService) ValidateCreateTable ¶
func (rs *RPCService) ValidateCreateTable( ctx context.Context, req ValidateCreateTableRequest, ) (ValidateCreateTableResponse, error)
ValidateCreateTable allows to validate a CREATE TABLE statement and also return the structure hash of it. This RPC method is stateless.
func (*RPCService) ValidateWriteQuery ¶
func (rs *RPCService) ValidateWriteQuery( ctx context.Context, req ValidateWriteQueryRequest, ) (ValidateWriteQueryResponse, error)
ValidateWriteQuery allows the user to validate a write query.
type RelayWriteQueryRequest ¶
type RelayWriteQueryRequest struct {
Statement string `json:"statement"`
}
RelayWriteQueryRequest is a user RelayWriteQuery request.
type RelayWriteQueryResponse ¶
type RelayWriteQueryResponse struct { Transaction struct { Hash string `json:"hash"` } `json:"tx"` }
RelayWriteQueryResponse is a RelayWriteQuery response.
type RunReadQueryRequest ¶
type RunReadQueryRequest struct { Statement string `json:"statement"` Output *string `json:"output"` Unwrap *bool `json:"unwrap"` Extract *bool `json:"extract"` }
RunReadQueryRequest is a user RunReadQuery request.
func (*RunReadQueryRequest) FormatOpts ¶
func (rrqr *RunReadQueryRequest) FormatOpts() ([]formatter.FormatOption, error)
FormatOpts extracts formatter options from a request.
type RunReadQueryResponse ¶
type RunReadQueryResponse struct {
Result interface{} `json:"data"`
}
RunReadQueryResponse is a RunReadQuery response.
type SetControllerRequest ¶
type SetControllerRequest struct { Controller string `json:"controller"` TokenID string `json:"token_id"` }
SetControllerRequest is a user SetController request.
type SetControllerResponse ¶
type SetControllerResponse struct { Transaction struct { Hash string `json:"hash"` } `json:"tx"` }
SetControllerResponse is a RunSQL response.
type TxnReceipt ¶
type TxnReceipt struct { ChainID int64 `json:"chain_id"` TxnHash string `json:"txn_hash"` BlockNumber int64 `json:"block_number"` TableID *string `json:"table_id,omitempty"` Error string `json:"error"` ErrorEventIdx int `json:"error_event_idx"` }
TxnReceipt is a Tableland event processing receipt.
type ValidateCreateTableRequest ¶
type ValidateCreateTableRequest struct {
CreateStatement string `json:"create_statement"`
}
ValidateCreateTableRequest is a ValidateCreateTable request.
type ValidateCreateTableResponse ¶
type ValidateCreateTableResponse struct {
StructureHash string `json:"structure_hash"`
}
ValidateCreateTableResponse is a ValidateCreateTable response.
type ValidateWriteQueryRequest ¶
type ValidateWriteQueryRequest struct {
Statement string `json:"statement"`
}
ValidateWriteQueryRequest is a ValidateWriteQuery request.
type ValidateWriteQueryResponse ¶
type ValidateWriteQueryResponse struct {
TableID string `json:"table_id"`
}
ValidateWriteQueryResponse is a ValidateWriteQuery response.