diff --git a/api/client.go b/api/client.go index d1d723c4..9316bdc5 100644 --- a/api/client.go +++ b/api/client.go @@ -222,12 +222,6 @@ func (c *Client) V2Contracts(ids []types.FileContractID) (resp []explorer.V2File return } -// V2ContractsKey returns the v2 contracts for a particular ed25519 key. -func (c *Client) V2ContractsKey(key types.PublicKey) (resp []explorer.V2FileContract, err error) { - err = c.c.GET(fmt.Sprintf("/pubkey/%s/v2/contracts", key), &resp) - return -} - // V2ContractRevisions returns all the revisions of the contract with the // specified ID. func (c *Client) V2ContractRevisions(id types.FileContractID) (resp []explorer.V2FileContract, err error) { @@ -235,6 +229,12 @@ func (c *Client) V2ContractRevisions(id types.FileContractID) (resp []explorer.V return } +// V2ContractsKey returns the v2 contracts for a particular ed25519 key. +func (c *Client) V2ContractsKey(key types.PublicKey) (resp []explorer.V2FileContract, err error) { + err = c.c.GET(fmt.Sprintf("/v2/pubkey/%s/contracts", key), &resp) + return +} + // Host returns information about the host with a given ed25519 key. func (c *Client) Host(key types.PublicKey) (resp explorer.Host, err error) { err = c.c.GET(fmt.Sprintf("/pubkey/%s/host", key), &resp) diff --git a/api/server.go b/api/server.go index e40fd296..fa4615aa 100644 --- a/api/server.go +++ b/api/server.go @@ -588,7 +588,7 @@ func (s *server) v2ContractsIDRevisionsHandler(jc jape.Context) { jc.Encode(fcs) } -func (s *server) pubkeyV2ContractsHandler(jc jape.Context) { +func (s *server) v2PubkeyContractsHandler(jc jape.Context) { var key types.PublicKey if jc.DecodeParam("key", &key) != nil { return @@ -705,9 +705,10 @@ func NewServer(e Explorer, cm ChainManager, s Syncer) http.Handler { "GET /v2/contracts/:id/revisions": srv.v2ContractsIDRevisionsHandler, "POST /v2/contracts": srv.v2ContractsBatchHandler, - "GET /pubkey/:key/v2/contracts": srv.pubkeyV2ContractsHandler, - "GET /pubkey/:key/contracts": srv.pubkeyContractsHandler, - "GET /pubkey/:key/host": srv.pubkeyHostHandler, + "GET /v2/pubkey/:key/contracts": srv.v2PubkeyContractsHandler, + + "GET /pubkey/:key/contracts": srv.pubkeyContractsHandler, + "GET /pubkey/:key/host": srv.pubkeyHostHandler, "GET /metrics/block": srv.blocksMetricsHandler, "GET /metrics/block/:id": srv.blocksMetricsIDHandler,