Skip to content

Commit

Permalink
Rename account/nonce to nonce (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
orkunkl authored Apr 7, 2020
1 parent 8d3d079 commit 8f41134
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 133 deletions.
94 changes: 47 additions & 47 deletions cmd/bnsapi/docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2020-04-02 11:02:25.4904652 +0000 UTC m=+10.383077301
// 2020-04-07 09:36:19.268982074 +0000 UTC m=+8.400265190

package docs

Expand Down Expand Up @@ -103,52 +103,6 @@ var doc = `{
}
}
},
"/account/nonce/address/{address}": {
"get": {
"description": "Returns nonce and public key registered for a given address if it was ever used.",
"tags": [
"Nonce"
],
"summary": "Returns nonce based on an address",
"parameters": [
{
"type": "string",
"description": "Address to query for nonce. ex: iov1qnpaklxv4n6cam7v99hl0tg0dkmu97sh6007un",
"name": "address",
"in": "path",
"required": true
}
],
"responses": {
"200": {},
"404": {},
"500": {}
}
}
},
"/account/nonce/pubkey/{pubKey}": {
"get": {
"description": "Returns nonce and public key registered for a given pubkey if it was ever used.",
"tags": [
"Nonce"
],
"summary": "Returns nonce based on an address",
"parameters": [
{
"type": "string",
"description": "Public key to query for nonce. ex: 12ee6f581fe55673a1e9e1382a0829e32075a0aa4763c968bc526e1852e78c95",
"name": "pubKey",
"in": "path",
"required": true
}
],
"responses": {
"200": {},
"404": {},
"500": {}
}
}
},
"/account/resolve/{starname}": {
"get": {
"description": "Resolve a given starname (like orkun*neuma) and return all metadata related to this starname,\nlist of crypto-addresses (targets), expiration date and owner address of the starname.",
Expand Down Expand Up @@ -463,6 +417,52 @@ var doc = `{
}
}
},
"/nonce/address/{address}": {
"get": {
"description": "Returns nonce and public key registered for a given address if it was ever used.",
"tags": [
"Nonce"
],
"summary": "Returns nonce based on an address",
"parameters": [
{
"type": "string",
"description": "Address to query for nonce. ex: iov1qnpaklxv4n6cam7v99hl0tg0dkmu97sh6007un",
"name": "address",
"in": "path",
"required": true
}
],
"responses": {
"200": {},
"404": {},
"500": {}
}
}
},
"/nonce/pubkey/{pubKey}": {
"get": {
"description": "Returns nonce and public key registered for a given pubkey if it was ever used.",
"tags": [
"Nonce"
],
"summary": "Returns nonce based on an address",
"parameters": [
{
"type": "string",
"description": "Public key to query for nonce. ex: 12ee6f581fe55673a1e9e1382a0829e32075a0aa4763c968bc526e1852e78c95",
"name": "pubKey",
"in": "path",
"required": true
}
],
"responses": {
"200": {},
"404": {},
"500": {}
}
}
},
"/termdeposit/contracts": {
"get": {
"description": "The term deposit Contract are the contract defining the dates until which one can deposit.",
Expand Down
92 changes: 46 additions & 46 deletions cmd/bnsapi/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,52 +83,6 @@
}
}
},
"/account/nonce/address/{address}": {
"get": {
"description": "Returns nonce and public key registered for a given address if it was ever used.",
"tags": [
"Nonce"
],
"summary": "Returns nonce based on an address",
"parameters": [
{
"type": "string",
"description": "Address to query for nonce. ex: iov1qnpaklxv4n6cam7v99hl0tg0dkmu97sh6007un",
"name": "address",
"in": "path",
"required": true
}
],
"responses": {
"200": {},
"404": {},
"500": {}
}
}
},
"/account/nonce/pubkey/{pubKey}": {
"get": {
"description": "Returns nonce and public key registered for a given pubkey if it was ever used.",
"tags": [
"Nonce"
],
"summary": "Returns nonce based on an address",
"parameters": [
{
"type": "string",
"description": "Public key to query for nonce. ex: 12ee6f581fe55673a1e9e1382a0829e32075a0aa4763c968bc526e1852e78c95",
"name": "pubKey",
"in": "path",
"required": true
}
],
"responses": {
"200": {},
"404": {},
"500": {}
}
}
},
"/account/resolve/{starname}": {
"get": {
"description": "Resolve a given starname (like orkun*neuma) and return all metadata related to this starname,\nlist of crypto-addresses (targets), expiration date and owner address of the starname.",
Expand Down Expand Up @@ -443,6 +397,52 @@
}
}
},
"/nonce/address/{address}": {
"get": {
"description": "Returns nonce and public key registered for a given address if it was ever used.",
"tags": [
"Nonce"
],
"summary": "Returns nonce based on an address",
"parameters": [
{
"type": "string",
"description": "Address to query for nonce. ex: iov1qnpaklxv4n6cam7v99hl0tg0dkmu97sh6007un",
"name": "address",
"in": "path",
"required": true
}
],
"responses": {
"200": {},
"404": {},
"500": {}
}
}
},
"/nonce/pubkey/{pubKey}": {
"get": {
"description": "Returns nonce and public key registered for a given pubkey if it was ever used.",
"tags": [
"Nonce"
],
"summary": "Returns nonce based on an address",
"parameters": [
{
"type": "string",
"description": "Public key to query for nonce. ex: 12ee6f581fe55673a1e9e1382a0829e32075a0aa4763c968bc526e1852e78c95",
"name": "pubKey",
"in": "path",
"required": true
}
],
"responses": {
"200": {},
"404": {},
"500": {}
}
}
},
"/termdeposit/contracts": {
"get": {
"description": "The term deposit Contract are the contract defining the dates until which one can deposit.",
Expand Down
68 changes: 34 additions & 34 deletions cmd/bnsapi/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,40 +211,6 @@ paths:
summary: Returns a list of `bnsd/x/domain` entities (like *neuma).
tags:
- Starname
/account/nonce/address/{address}:
get:
description: Returns nonce and public key registered for a given address if
it was ever used.
parameters:
- description: 'Address to query for nonce. ex: iov1qnpaklxv4n6cam7v99hl0tg0dkmu97sh6007un'
in: path
name: address
required: true
type: string
responses:
"200": {}
"404": {}
"500": {}
summary: Returns nonce based on an address
tags:
- Nonce
/account/nonce/pubkey/{pubKey}:
get:
description: Returns nonce and public key registered for a given pubkey if it
was ever used.
parameters:
- description: 'Public key to query for nonce. ex: 12ee6f581fe55673a1e9e1382a0829e32075a0aa4763c968bc526e1852e78c95'
in: path
name: pubKey
required: true
type: string
responses:
"200": {}
"404": {}
"500": {}
summary: Returns nonce based on an address
tags:
- Nonce
/account/resolve/{starname}:
get:
description: |-
Expand Down Expand Up @@ -462,6 +428,40 @@ paths:
summary: Returns a list of all the multisig Contracts.
tags:
- IOV token
/nonce/address/{address}:
get:
description: Returns nonce and public key registered for a given address if
it was ever used.
parameters:
- description: 'Address to query for nonce. ex: iov1qnpaklxv4n6cam7v99hl0tg0dkmu97sh6007un'
in: path
name: address
required: true
type: string
responses:
"200": {}
"404": {}
"500": {}
summary: Returns nonce based on an address
tags:
- Nonce
/nonce/pubkey/{pubKey}:
get:
description: Returns nonce and public key registered for a given pubkey if it
was ever used.
parameters:
- description: 'Public key to query for nonce. ex: 12ee6f581fe55673a1e9e1382a0829e32075a0aa4763c968bc526e1852e78c95'
in: path
name: pubKey
required: true
type: string
responses:
"200": {}
"404": {}
"500": {}
summary: Returns nonce based on an address
tags:
- Nonce
/termdeposit/contracts:
get:
description: The term deposit Contract are the contract defining the dates until
Expand Down
8 changes: 4 additions & 4 deletions cmd/bnsapi/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ var wEndpoint = []string{
"/account/domains?admin=_&offset=_",
"/account/resolve/{starname}",
"/account/accounts/{accountKey}",
"/account/nonce/address/{address}",
"/account/nonce/pubkey/{pubKey}",
"/nonce/address/{address}",
"/nonce/pubkey/{pubKey}",
"/cash/balances?address=_[OR]offset=_",
"/msgfee/msgfee?msgfee=_",
"/username/resolve/{username}",
Expand Down Expand Up @@ -632,7 +632,7 @@ type NonceAddressHandler struct {
// @Success 200
// @Failure 404
// @Failure 500
// @Router /account/nonce/address/{address} [get]
// @Router /nonce/address/{address} [get]
func (h *NonceAddressHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
addressStr := LastChunk(r.URL.Path)
addr, err := WeaveAddressFromQuery(addressStr)
Expand Down Expand Up @@ -668,7 +668,7 @@ type NoncePubKeyHandler struct {
// @Success 200
// @Failure 404
// @Failure 500
// @Router /account/nonce/pubkey/{pubKey} [get]
// @Router /nonce/pubkey/{pubKey} [get]
func (h *NoncePubKeyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
pubKeyStr := LastChunk(r.URL.Path)
hexKey, err := hex.DecodeString(pubKeyStr)
Expand Down
4 changes: 2 additions & 2 deletions cmd/bnsapi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ func run(conf Configuration) error {
rt.Handle("/account/domains", &handlers.DomainsHandler{Bns: bnscli})
rt.Handle("/account/accounts", &handlers.AccountsHandler{Bns: bnscli})
rt.Handle("/account/resolve/", &handlers.AccountResolveHandler{Bns: bnscli})
rt.Handle("/account/nonce/address/", &handlers.NonceAddressHandler{Bns: bnscli})
rt.Handle("/account/nonce/pubkey/", &handlers.NoncePubKeyHandler{Bns: bnscli})
rt.Handle("/nonce/address/", &handlers.NonceAddressHandler{Bns: bnscli})
rt.Handle("/nonce/pubkey/", &handlers.NoncePubKeyHandler{Bns: bnscli})
rt.Handle("/username/owner/", &handlers.OwnerHandler{Bns: bnscli})
rt.Handle("/username/resolve/", &handlers.ResolveHandler{Bns: bnscli})
rt.Handle("/cash/balances", &handlers.CashBalanceHandler{Bns: bnscli})
Expand Down

0 comments on commit 8f41134

Please sign in to comment.