Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: transactions and address doc string #51

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/api/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const docTemplate = `{
"tags": [
"Addresses"
],
"summary": "Get contracts",
"summary": "Get Contracts",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -1024,7 +1024,7 @@ const docTemplate = `{
"tags": [
"Transactions"
],
"summary": "Get internal transactions by address",
"summary": "Get Internal Transactions By Address",
"parameters": [
{
"type": "integer",
Expand Down Expand Up @@ -1078,7 +1078,7 @@ const docTemplate = `{
"tags": [
"Transactions"
],
"summary": "Get internal transactions by block number",
"summary": "Get Internal Transactions By Block Number",
"parameters": [
{
"type": "integer",
Expand Down Expand Up @@ -1132,7 +1132,7 @@ const docTemplate = `{
"tags": [
"Transactions"
],
"summary": "Get internal transactions by hash",
"summary": "Get Internal Transactions By Hash",
"parameters": [
{
"type": "integer",
Expand Down Expand Up @@ -1186,7 +1186,7 @@ const docTemplate = `{
"tags": [
"Transactions"
],
"summary": "Get token holders by token contract",
"summary": "Get Token Holders By Token Contract",
"parameters": [
{
"type": "integer",
Expand Down Expand Up @@ -1240,7 +1240,7 @@ const docTemplate = `{
"tags": [
"Transactions"
],
"summary": "Get token transfers",
"summary": "Get Token Transfers",
"parameters": [
{
"type": "integer",
Expand Down Expand Up @@ -1329,7 +1329,7 @@ const docTemplate = `{
"tags": [
"Transactions"
],
"summary": "Get token transfer by address",
"summary": "Get Token Transfer By Address",
"parameters": [
{
"type": "integer",
Expand Down Expand Up @@ -1383,7 +1383,7 @@ const docTemplate = `{
"tags": [
"Transactions"
],
"summary": "Get token transfers by token contract",
"summary": "Get Token Transfers By Token Contract",
"parameters": [
{
"type": "integer",
Expand Down
16 changes: 8 additions & 8 deletions src/api/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"tags": [
"Addresses"
],
"summary": "Get contracts",
"summary": "Get Contracts",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -1016,7 +1016,7 @@
"tags": [
"Transactions"
],
"summary": "Get internal transactions by address",
"summary": "Get Internal Transactions By Address",
"parameters": [
{
"type": "integer",
Expand Down Expand Up @@ -1070,7 +1070,7 @@
"tags": [
"Transactions"
],
"summary": "Get internal transactions by block number",
"summary": "Get Internal Transactions By Block Number",
"parameters": [
{
"type": "integer",
Expand Down Expand Up @@ -1124,7 +1124,7 @@
"tags": [
"Transactions"
],
"summary": "Get internal transactions by hash",
"summary": "Get Internal Transactions By Hash",
"parameters": [
{
"type": "integer",
Expand Down Expand Up @@ -1178,7 +1178,7 @@
"tags": [
"Transactions"
],
"summary": "Get token holders by token contract",
"summary": "Get Token Holders By Token Contract",
"parameters": [
{
"type": "integer",
Expand Down Expand Up @@ -1232,7 +1232,7 @@
"tags": [
"Transactions"
],
"summary": "Get token transfers",
"summary": "Get Token Transfers",
"parameters": [
{
"type": "integer",
Expand Down Expand Up @@ -1321,7 +1321,7 @@
"tags": [
"Transactions"
],
"summary": "Get token transfer by address",
"summary": "Get Token Transfer By Address",
"parameters": [
{
"type": "integer",
Expand Down Expand Up @@ -1375,7 +1375,7 @@
"tags": [
"Transactions"
],
"summary": "Get token transfers by token contract",
"summary": "Get Token Transfers By Token Contract",
"parameters": [
{
"type": "integer",
Expand Down
16 changes: 8 additions & 8 deletions src/api/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ paths:
schema:
additionalProperties: true
type: object
summary: Get contracts
summary: Get Contracts
tags:
- Addresses
/api/v1/addresses/details/{address}:
Expand Down Expand Up @@ -1031,7 +1031,7 @@ paths:
schema:
additionalProperties: true
type: object
summary: Get internal transactions by hash
summary: Get Internal Transactions By Hash
tags:
- Transactions
/api/v1/transactions/internal/address/{address}:
Expand Down Expand Up @@ -1067,7 +1067,7 @@ paths:
schema:
additionalProperties: true
type: object
summary: Get internal transactions by address
summary: Get Internal Transactions By Address
tags:
- Transactions
/api/v1/transactions/internal/block-number/{block_number}:
Expand Down Expand Up @@ -1103,7 +1103,7 @@ paths:
schema:
additionalProperties: true
type: object
summary: Get internal transactions by block number
summary: Get Internal Transactions By Block Number
tags:
- Transactions
/api/v1/transactions/token-holders/token-contract/{token_contract_address}:
Expand Down Expand Up @@ -1139,7 +1139,7 @@ paths:
schema:
additionalProperties: true
type: object
summary: Get token holders by token contract
summary: Get Token Holders By Token Contract
tags:
- Transactions
/api/v1/transactions/token-transfers:
Expand Down Expand Up @@ -1198,7 +1198,7 @@ paths:
schema:
additionalProperties: true
type: object
summary: Get token transfers
summary: Get Token Transfers
tags:
- Transactions
/api/v1/transactions/token-transfers/address/{address}:
Expand Down Expand Up @@ -1234,7 +1234,7 @@ paths:
schema:
additionalProperties: true
type: object
summary: Get token transfer by address
summary: Get Token Transfer By Address
tags:
- Transactions
/api/v1/transactions/token-transfers/token-contract/{token_contract_address}:
Expand Down Expand Up @@ -1270,7 +1270,7 @@ paths:
schema:
additionalProperties: true
type: object
summary: Get token transfers by token contract
summary: Get Token Transfers By Token Contract
tags:
- Transactions
/metadata:
Expand Down
5 changes: 3 additions & 2 deletions src/api/rest/addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package rest
import (
"encoding/json"
"errors"
"gorm.io/gorm"
"strconv"

"gorm.io/gorm"

fiber "github.com/gofiber/fiber/v2"
"go.uber.org/zap"

Expand Down Expand Up @@ -197,7 +198,7 @@ type ContractsQuery struct {
}

// Contract
// @Summary Get contracts
// @Summary Get Contracts
// @Description get list of contracts
// @Tags Addresses
// @BasePath /api/v1
Expand Down
19 changes: 10 additions & 9 deletions src/api/rest/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
"encoding/json"
"errors"
"fmt"
"strconv"
"sync"

fiber "github.com/gofiber/fiber/v2"
"github.com/sudoblockio/icon-go-api/models"
"go.uber.org/zap"
"gorm.io/gorm"
"strconv"
"sync"

"github.com/sudoblockio/icon-go-api/config"
"github.com/sudoblockio/icon-go-api/crud"
Expand Down Expand Up @@ -479,7 +480,7 @@ func handlerGetTransactionAddress(c *fiber.Ctx) error {
}

// Internal transactions by hash
// @Summary Get internal transactions by hash
// @Summary Get Internal Transactions By Hash
// @Description Get internal transactions by hash
// @Tags Transactions
// @BasePath /api/v1
Expand Down Expand Up @@ -551,7 +552,7 @@ func handlerGetInternalTransactionsByHash(c *fiber.Ctx) error {
}

// Internal transactions by address
// @Summary Get internal transactions by address
// @Summary Get Internal Transactions By Address
// @Description Get internal transactions by address
// @Tags Transactions
// @BasePath /api/v1
Expand Down Expand Up @@ -625,7 +626,7 @@ func handlerGetInternalTransactionsAddress(c *fiber.Ctx) error {
}

// Internal transactions by block number
// @Summary Get internal transactions by block number
// @Summary Get Internal Transactions By Block Number
// @Description Get internal transactions by block number
// @Tags Transactions
// @BasePath /api/v1
Expand Down Expand Up @@ -704,7 +705,7 @@ func handlerGetInternalTransactionsBlockNumber(c *fiber.Ctx) error {
}

// TokenTransfers
// @Summary Get token transfers
// @Summary Get Token Transfers
// @Description get historical token transfers
// @Tags Transactions
// @BasePath /api/v1
Expand Down Expand Up @@ -794,7 +795,7 @@ func handlerGetTokenTransfers(c *fiber.Ctx) error {
}

// TokenTransfersAddress
// @Summary Get token transfer by address
// @Summary Get Token Transfer By Address
// @Description get historical token transfers by address
// @Tags Transactions
// @BasePath /api/v1
Expand Down Expand Up @@ -869,7 +870,7 @@ func handlerGetTokenTransfersAddress(c *fiber.Ctx) error {
}

// TokenTransfersTokenContract
// @Summary Get token transfers by token contract
// @Summary Get Token Transfers By Token Contract
// @Description get historical token transfers by token contract
// @Tags Transactions
// @BasePath /api/v1
Expand Down Expand Up @@ -944,7 +945,7 @@ func handlerGetTokenTransfersTokenContract(c *fiber.Ctx) error {
}

// TokenAddressesTokenContract
// @Summary Get token holders by token contract
// @Summary Get Token Holders By Token Contract
// @Description get token holders
// @Tags Transactions
// @BasePath /api/v1
Expand Down
Loading