Documentation ¶
Index ¶
- Constants
- Variables
- type AssetArgs
- type AssetReply
- type BalanceArgs
- type BalanceReply
- type BlockHeadersResponse
- type BlockInfo
- type Controller
- type GenesisReply
- type GetBlockCommitmentArgs
- type GetBlockHeadersByHeightArgs
- type GetBlockHeadersByStartArgs
- type GetBlockHeadersIDArgs
- type GetBlockTransactionsArgs
- type GetBlockTransactionsByNamespaceArgs
- type JSONRPCClient
- func (cli *JSONRPCClient) Asset(ctx context.Context, asset ids.ID, useCache bool) (bool, []byte, uint8, []byte, uint64, string, bool, error)
- func (cli *JSONRPCClient) Balance(ctx context.Context, addr string, asset ids.ID) (uint64, error)
- func (cli *JSONRPCClient) Genesis(ctx context.Context) (*genesis.Genesis, error)
- func (cli *JSONRPCClient) GetBlockHeadersByHeight(ctx context.Context, height uint64, end int64) (*BlockHeadersResponse, error)
- func (cli *JSONRPCClient) GetBlockHeadersByStart(ctx context.Context, start int64, end int64) (*BlockHeadersResponse, error)
- func (cli *JSONRPCClient) GetBlockHeadersID(ctx context.Context, id string, end int64) (*BlockHeadersResponse, error)
- func (cli *JSONRPCClient) GetBlockTransactions(ctx context.Context, id string) (*TransactionResponse, error)
- func (cli *JSONRPCClient) GetBlockTransactionsByNamespace(ctx context.Context, height uint64, namespace string) (*SEQTransactionResponse, error)
- func (cli *JSONRPCClient) GetCommitmentBlocks(ctx context.Context, first uint64, height uint64, maxBlocks int) (*SequencerWarpBlockResponse, error)
- func (cli *JSONRPCClient) Loan(ctx context.Context, asset ids.ID, destination ids.ID) (uint64, error)
- func (cli *JSONRPCClient) Parser(ctx context.Context) (chain.Parser, error)
- func (cli *JSONRPCClient) Tx(ctx context.Context, id ids.ID) (bool, bool, int64, uint64, error)
- func (cli *JSONRPCClient) WaitForBalance(ctx context.Context, addr string, asset ids.ID, min uint64) error
- func (cli *JSONRPCClient) WaitForTransaction(ctx context.Context, txID ids.ID) (bool, uint64, error)
- type JSONRPCServer
- func (j *JSONRPCServer) AcceptBlock(blk *chain.StatelessBlock) error
- func (j *JSONRPCServer) Asset(req *http.Request, args *AssetArgs, reply *AssetReply) error
- func (j *JSONRPCServer) Balance(req *http.Request, args *BalanceArgs, reply *BalanceReply) error
- func (j *JSONRPCServer) Genesis(_ *http.Request, _ *struct{}, reply *GenesisReply) (err error)
- func (j *JSONRPCServer) GetBlockHeadersByHeight(req *http.Request, args *GetBlockHeadersByHeightArgs, ...) error
- func (j *JSONRPCServer) GetBlockHeadersByStart(req *http.Request, args *GetBlockHeadersByStartArgs, ...) error
- func (j *JSONRPCServer) GetBlockHeadersID(req *http.Request, args *GetBlockHeadersIDArgs, reply *BlockHeadersResponse) error
- func (j *JSONRPCServer) GetBlockTransactions(req *http.Request, args *GetBlockTransactionsArgs, reply *TransactionResponse) error
- func (j *JSONRPCServer) GetBlockTransactionsByNamespace(req *http.Request, args *GetBlockTransactionsByNamespaceArgs, ...) error
- func (j *JSONRPCServer) GetCommitmentBlocks(req *http.Request, args *GetBlockCommitmentArgs, ...) error
- func (j *JSONRPCServer) Loan(req *http.Request, args *LoanArgs, reply *LoanReply) error
- func (j *JSONRPCServer) ServerParser(ctx context.Context, networkId uint32, chainId ids.ID) chain.Parser
- func (j *JSONRPCServer) SubmitMsgTx(req *http.Request, args *SubmitMsgTxArgs, reply *SubmitMsgTxReply) error
- func (j *JSONRPCServer) Tx(req *http.Request, args *TxArgs, reply *TxReply) error
- type LoanArgs
- type LoanReply
- type Parser
- type SEQTransactionResponse
- type SequencerWarpBlock
- type SequencerWarpBlockResponse
- type ServerParser
- type SubmitMsgTxArgs
- type SubmitMsgTxReply
- type TransactionResponse
- type TxArgs
- type TxReply
Constants ¶
View Source
const (
JSONRPCEndpoint = "/tokenapi"
)
Variables ¶
View Source
var ( ErrTxNotFound = errors.New("tx not found") ErrAssetNotFound = errors.New("asset not found") )
Functions ¶
This section is empty.
Types ¶
type AssetReply ¶
type BalanceArgs ¶
type BalanceReply ¶
type BalanceReply struct {
Amount uint64 `json:"amount"`
}
type BlockHeadersResponse ¶ added in v0.4.0
type Controller ¶
type Controller interface { Genesis() *genesis.Genesis Tracer() trace.Tracer GetTransaction(context.Context, ids.ID) (bool, int64, bool, chain.Dimensions, uint64, error) GetAssetFromState(context.Context, ids.ID) (bool, []byte, uint8, []byte, uint64, ed25519.PublicKey, bool, error) GetBalanceFromState(context.Context, ed25519.PublicKey, ids.ID) (uint64, error) GetLoanFromState(context.Context, ids.ID, ids.ID) (uint64, error) UnitPrices(ctx context.Context) (chain.Dimensions, error) Submit( ctx context.Context, verifySig bool, txs []*chain.Transaction, ) (errs []error) }
type GenesisReply ¶
type GetBlockCommitmentArgs ¶ added in v0.8.22
type GetBlockHeadersByHeightArgs ¶ added in v0.4.0
type GetBlockHeadersByStartArgs ¶ added in v0.4.0
type GetBlockHeadersIDArgs ¶ added in v0.4.0
type GetBlockTransactionsArgs ¶ added in v0.4.0
type GetBlockTransactionsArgs struct {
ID string `json:"block_id"`
}
type GetBlockTransactionsByNamespaceArgs ¶ added in v0.4.0
type JSONRPCClient ¶
type JSONRPCClient struct {
// contains filtered or unexported fields
}
func NewJSONRPCClient ¶
func NewJSONRPCClient(uri string, networkID uint32, chainID ids.ID) *JSONRPCClient
New creates a new client object.
func (*JSONRPCClient) GetBlockHeadersByHeight ¶ added in v0.5.0
func (cli *JSONRPCClient) GetBlockHeadersByHeight( ctx context.Context, height uint64, end int64, ) (*BlockHeadersResponse, error)
func (*JSONRPCClient) GetBlockHeadersByStart ¶ added in v0.5.0
func (cli *JSONRPCClient) GetBlockHeadersByStart( ctx context.Context, start int64, end int64, ) (*BlockHeadersResponse, error)
func (*JSONRPCClient) GetBlockHeadersID ¶ added in v0.5.0
func (cli *JSONRPCClient) GetBlockHeadersID( ctx context.Context, id string, end int64, ) (*BlockHeadersResponse, error)
func (*JSONRPCClient) GetBlockTransactions ¶ added in v0.5.0
func (cli *JSONRPCClient) GetBlockTransactions( ctx context.Context, id string, ) (*TransactionResponse, error)
func (*JSONRPCClient) GetBlockTransactionsByNamespace ¶ added in v0.5.0
func (cli *JSONRPCClient) GetBlockTransactionsByNamespace( ctx context.Context, height uint64, namespace string, ) (*SEQTransactionResponse, error)
func (*JSONRPCClient) GetCommitmentBlocks ¶ added in v0.8.22
func (cli *JSONRPCClient) GetCommitmentBlocks( ctx context.Context, first uint64, height uint64, maxBlocks int, ) (*SequencerWarpBlockResponse, error)
func (*JSONRPCClient) WaitForBalance ¶
func (cli *JSONRPCClient) WaitForBalance( ctx context.Context, addr string, asset ids.ID, min uint64, ) error
TODO add more methods
func (*JSONRPCClient) WaitForTransaction ¶
type JSONRPCServer ¶
type JSONRPCServer struct {
// contains filtered or unexported fields
}
func NewJSONRPCServer ¶
func NewJSONRPCServer(c Controller) *JSONRPCServer
func (*JSONRPCServer) AcceptBlock ¶ added in v0.4.0
func (j *JSONRPCServer) AcceptBlock(blk *chain.StatelessBlock) error
func (*JSONRPCServer) Asset ¶
func (j *JSONRPCServer) Asset(req *http.Request, args *AssetArgs, reply *AssetReply) error
func (*JSONRPCServer) Balance ¶
func (j *JSONRPCServer) Balance(req *http.Request, args *BalanceArgs, reply *BalanceReply) error
func (*JSONRPCServer) Genesis ¶
func (j *JSONRPCServer) Genesis(_ *http.Request, _ *struct{}, reply *GenesisReply) (err error)
func (*JSONRPCServer) GetBlockHeadersByHeight ¶ added in v0.5.0
func (j *JSONRPCServer) GetBlockHeadersByHeight(req *http.Request, args *GetBlockHeadersByHeightArgs, reply *BlockHeadersResponse) error
func (*JSONRPCServer) GetBlockHeadersByStart ¶ added in v0.5.0
func (j *JSONRPCServer) GetBlockHeadersByStart(req *http.Request, args *GetBlockHeadersByStartArgs, reply *BlockHeadersResponse) error
func (*JSONRPCServer) GetBlockHeadersID ¶ added in v0.5.0
func (j *JSONRPCServer) GetBlockHeadersID(req *http.Request, args *GetBlockHeadersIDArgs, reply *BlockHeadersResponse) error
func (*JSONRPCServer) GetBlockTransactions ¶ added in v0.5.0
func (j *JSONRPCServer) GetBlockTransactions(req *http.Request, args *GetBlockTransactionsArgs, reply *TransactionResponse) error
func (*JSONRPCServer) GetBlockTransactionsByNamespace ¶ added in v0.5.0
func (j *JSONRPCServer) GetBlockTransactionsByNamespace(req *http.Request, args *GetBlockTransactionsByNamespaceArgs, reply *SEQTransactionResponse) error
func (*JSONRPCServer) GetCommitmentBlocks ¶ added in v0.8.22
func (j *JSONRPCServer) GetCommitmentBlocks(req *http.Request, args *GetBlockCommitmentArgs, reply *SequencerWarpBlockResponse) error
func (*JSONRPCServer) ServerParser ¶ added in v0.4.0
func (*JSONRPCServer) SubmitMsgTx ¶ added in v0.8.0
func (j *JSONRPCServer) SubmitMsgTx( req *http.Request, args *SubmitMsgTxArgs, reply *SubmitMsgTxReply, ) error
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) Registry ¶
func (*Parser) Registry() (chain.ActionRegistry, chain.AuthRegistry)
type SEQTransactionResponse ¶ added in v0.4.0
type SEQTransactionResponse struct { Txs []*types.SEQTransaction `json:"txs"` BlockId string `json:"id"` }
type SequencerWarpBlock ¶ added in v0.8.22
type SequencerWarpBlockResponse ¶ added in v0.8.22
type SequencerWarpBlockResponse struct {
Blocks []SequencerWarpBlock `json:"blocks"`
}
type ServerParser ¶ added in v0.4.0
type ServerParser struct {
// contains filtered or unexported fields
}
func (*ServerParser) ChainID ¶ added in v0.4.0
func (p *ServerParser) ChainID() ids.ID
func (*ServerParser) Registry ¶ added in v0.4.0
func (*ServerParser) Registry() (chain.ActionRegistry, chain.AuthRegistry)
type SubmitMsgTxArgs ¶ added in v0.8.0
type SubmitMsgTxReply ¶ added in v0.8.0
type SubmitMsgTxReply struct {
TxID string `json:"txId"`
}
type TransactionResponse ¶ added in v0.4.0
type TransactionResponse struct { Txs []*chain.Transaction `json:"txs"` BlockId string `json:"id"` }
TODO need to fix this. Tech debt
Click to show internal directories.
Click to hide internal directories.