Versions in this module Expand all Collapse all v1 v1.1.2 Sep 16, 2021 Changes in this version + const FAIL + const SUCCESS + var ErrBadAction = errors.New("bad action object") + var ErrBadActionConstruction = errors.New("bad action construction") + var ErrBadActionType = errors.New("bad action type") + var ErrCompileContract = errors.New("compile contract failed") + var ErrDefault = errors.New("Bytom API Error") + var ErrInstContract = errors.New("instantiate contract failed") + func AuthHandler(handler http.Handler, accessTokens *accesstoken.CredentialStore, ...) http.Handler + func RedirectHandler(next http.Handler) http.Handler + type API struct + func NewAPI(sync NetSync, wallet *wallet.Wallet, txfeeds *txfeed.Tracker, ...) *API + func (a *API) GetNodeInfo() *NetInfo + func (a *API) GetTxFeedByAlias(ctx context.Context, filter string) ([]byte, error) + func (a *API) GetWork() (*GetWorkResp, error) + func (a *API) GetWorkJSON() (*GetWorkJSONResp, error) + func (a *API) IsMining() bool + func (a *API) ServeHTTP(rw http.ResponseWriter, req *http.Request) + func (a *API) StartServer(address string) + func (a *API) SubmitWork(bh *types.BlockHeader) error + type AccountInfo struct + Info string + type AccountPubkey struct + PubKeyInfos []PubKeyInfo + RootXPub chainkd.XPub + type BlockHeaderJSON struct + Bits uint64 + BlockCommitment *types.BlockCommitment + Height uint64 + Nonce uint64 + PreviousBlockHash bc.Hash + Timestamp uint64 + Version uint64 + type BlockReq struct + BlockHash chainjson.HexBytes + BlockHeight uint64 + type BlockTx struct + ID bc.Hash + Inputs []*query.AnnotatedInput + MuxID bc.Hash + Outputs []*query.AnnotatedOutput + Size uint64 + StatusFail bool + TimeRange uint64 + Version uint64 + type BuildRequest struct + Actions []map[string]interface{} + TTL json.Duration + TimeRange uint64 + Tx *types.TxData + type CheckPasswordResp struct + CheckResult bool + type CoinbaseArbitrary struct + Arbitrary chainjson.HexBytes + type DecodeProgResp struct + Instructions string + type GetBlockHeaderResp struct + BlockHeader *types.BlockHeader + Reward uint64 + type GetBlockResp struct + Bits uint64 + Difficulty string + Hash *bc.Hash + Height uint64 + Nonce uint64 + PreviousBlockHash *bc.Hash + Size uint64 + Timestamp uint64 + TransactionStatusHash *bc.Hash + Transactions []*BlockTx + TransactionsMerkleRoot *bc.Hash + Version uint64 + type GetDifficultyResp struct + Bits uint64 + BlockHash *bc.Hash + BlockHeight uint64 + Difficulty string + type GetMerkleBlockResp struct + BlockHeader types.BlockHeader + Flags []uint32 + MatchedTxIDs []*bc.Hash + StatusHashes []*bc.Hash + TxHashes []*bc.Hash + type GetRawBlockResp struct + RawBlock *types.Block + TransactionStatus *bc.TransactionStatus + type GetWorkJSONResp struct + BlockHeader *BlockHeaderJSON + Seed *bc.Hash + type GetWorkResp struct + BlockHeader *types.BlockHeader + Seed *bc.Hash + type MerkleBlockReq struct + BlockHash chainjson.HexBytes + TxIDs []chainjson.HexBytes + type NetInfo struct + CurrentBlock uint64 + HighestBlock uint64 + Listening bool + Mining bool + NetWorkID string + PeerCount int + Syncing bool + Version *VersionInfo + type NetSync interface + BestPeer func() *netsync.PeerInfo + DialPeerWithAddress func(addr *p2p.NetAddress) error + GetNetwork func() string + GetPeerInfos func() []*netsync.PeerInfo + IsCaughtUp func() bool + IsListening func() bool + PeerCount func() int + StopPeer func(peerID string) error + type PubKeyInfo struct + Path []chainjson.HexBytes + Pubkey string + type RawTx struct + Fee uint64 + ID bc.Hash + Inputs []*query.AnnotatedInput + Outputs []*query.AnnotatedOutput + Size uint64 + TimeRange uint64 + Version uint64 + type ResetPasswordResp struct + Changed bool + type Response struct + Code string + Data interface{} + ErrorDetail string + Msg string + Status string + func FormatErrResp(err error) (response Response) + func NewErrorResponse(err error) Response + func NewSuccessResponse(data interface{}) Response + type SignMsgResp struct + DerivedXPub chainkd.XPub + Signature string + type SortByIndex []addressResp + func (a SortByIndex) Len() int + func (a SortByIndex) Less(i, j int) bool + func (a SortByIndex) Swap(i, j int) + type SubmitBlockReq struct + Block *types.Block + type SubmitWorkJSONReq struct + BlockHeader *BlockHeaderJSON + type SubmitWorkReq struct + BlockHeader *types.BlockHeader + type VerifyMsgResp struct + VerifyResult bool + type VersionInfo struct + NewVer string + Update uint16 + Version string + type WalletImage struct + AccountImage *account.Image + AssetImage *asset.Image + KeyImages *pseudohsm.KeyImage + type WalletInfo struct + BestBlockHeight uint64 + WalletHeight uint64