Documentation ¶
Index ¶
- Constants
- Variables
- type AssetArgs
- type AssetReply
- type BalanceArgs
- type BalanceReply
- type Controller
- type GenesisReply
- type JSONRPCClient
- func (cli *JSONRPCClient) Asset(ctx context.Context, asset ids.ID) (bool, []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) 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, 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, error)
- type JSONRPCServer
- 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) Loan(req *http.Request, args *LoanArgs, reply *LoanReply) error
- func (j *JSONRPCServer) Tx(req *http.Request, args *TxArgs, reply *TxReply) error
- type LoanArgs
- type LoanReply
- type Parser
- 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 Controller ¶
type Controller interface { Genesis() *genesis.Genesis Tracer() trace.Tracer GetTransaction(context.Context, ids.ID) (bool, int64, bool, uint64, error) GetAssetFromState(context.Context, ids.ID) (bool, []byte, uint64, crypto.PublicKey, bool, error) GetBalanceFromState(context.Context, crypto.PublicKey, ids.ID) (uint64, error) GetLoanFromState(context.Context, ids.ID, ids.ID) (uint64, error) }
type GenesisReply ¶
type JSONRPCClient ¶
type JSONRPCClient struct {
// contains filtered or unexported fields
}
func NewJSONRPCClient ¶
func NewJSONRPCClient(uri string, chainID ids.ID) *JSONRPCClient
New creates a new client object.
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) 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)
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) Registry ¶
func (*Parser) Registry() (chain.ActionRegistry, chain.AuthRegistry)
Click to show internal directories.
Click to hide internal directories.