X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=api%2Fapi.go;h=cc54ae8a6a5b1089464f70634a6945ea3d89a43d;hp=88f43e59d75a48e221817c3cd4fc086439c74b62;hb=1337be95f74a1d2a1a7316737efde413f29bcb2f;hpb=0bd22d212b767702bd1c99edb05d5f3a57cb572c diff --git a/api/api.go b/api/api.go index 88f43e59..cc54ae8a 100644 --- a/api/api.go +++ b/api/api.go @@ -11,23 +11,22 @@ import ( log "github.com/sirupsen/logrus" cmn "github.com/tendermint/tmlibs/common" - "github.com/vapor/accesstoken" - "github.com/vapor/blockchain/txfeed" - cfg "github.com/vapor/config" - "github.com/vapor/dashboard/dashboard" - "github.com/vapor/dashboard/equity" - "github.com/vapor/errors" - "github.com/vapor/event" - "github.com/vapor/net/http/authn" - "github.com/vapor/net/http/gzip" - "github.com/vapor/net/http/httpjson" - "github.com/vapor/net/http/static" - "github.com/vapor/net/websocket" - "github.com/vapor/netsync/peers" - "github.com/vapor/p2p" - "github.com/vapor/proposal/blockproposer" - "github.com/vapor/protocol" - "github.com/vapor/wallet" + "github.com/bytom/vapor/accesstoken" + cfg "github.com/bytom/vapor/config" + "github.com/bytom/vapor/dashboard/dashboard" + "github.com/bytom/vapor/dashboard/equity" + "github.com/bytom/vapor/errors" + "github.com/bytom/vapor/event" + "github.com/bytom/vapor/net/http/authn" + "github.com/bytom/vapor/net/http/gzip" + "github.com/bytom/vapor/net/http/httpjson" + "github.com/bytom/vapor/net/http/static" + "github.com/bytom/vapor/net/websocket" + "github.com/bytom/vapor/netsync/peers" + "github.com/bytom/vapor/p2p" + "github.com/bytom/vapor/proposal/blockproposer" + "github.com/bytom/vapor/protocol" + "github.com/bytom/vapor/wallet" ) var ( @@ -112,7 +111,6 @@ type API struct { chain *protocol.Chain server *http.Server handler http.Handler - txFeedTracker *txfeed.Tracker blockProposer *blockproposer.BlockProposer notificationMgr *websocket.WSNotificationManager eventDispatcher *event.Dispatcher @@ -180,13 +178,12 @@ type NetSync interface { } // NewAPI create and initialize the API -func NewAPI(sync NetSync, wallet *wallet.Wallet, txfeeds *txfeed.Tracker, blockProposer *blockproposer.BlockProposer, chain *protocol.Chain, config *cfg.Config, token *accesstoken.CredentialStore, dispatcher *event.Dispatcher, notificationMgr *websocket.WSNotificationManager) *API { +func NewAPI(sync NetSync, wallet *wallet.Wallet, blockProposer *blockproposer.BlockProposer, chain *protocol.Chain, config *cfg.Config, token *accesstoken.CredentialStore, dispatcher *event.Dispatcher, notificationMgr *websocket.WSNotificationManager) *API { api := &API{ sync: sync, wallet: wallet, chain: chain, accessTokens: token, - txFeedTracker: txfeeds, blockProposer: blockProposer, eventDispatcher: dispatcher, notificationMgr: notificationMgr, @@ -266,12 +263,6 @@ func (a *API) buildHandler() { m.Handle("/delete-access-token", jsonHandler(a.deleteAccessToken)) m.Handle("/check-access-token", jsonHandler(a.checkAccessToken)) - m.Handle("/create-transaction-feed", jsonHandler(a.createTxFeed)) - m.Handle("/get-transaction-feed", jsonHandler(a.getTxFeed)) - m.Handle("/update-transaction-feed", jsonHandler(a.updateTxFeed)) - m.Handle("/delete-transaction-feed", jsonHandler(a.deleteTxFeed)) - m.Handle("/list-transaction-feeds", jsonHandler(a.listTxFeeds)) - m.Handle("/submit-transaction", jsonHandler(a.submit)) m.Handle("/submit-transactions", jsonHandler(a.submitTxs)) m.Handle("/estimate-transaction-gas", jsonHandler(a.estimateTxGas))