diff --git a/docs/docs.go b/docs/docs.go index f90e791..5cafef4 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1450,6 +1450,132 @@ const docTemplate = `{ } } } + }, + "/{chainId}/wallet-transactions": { + "get": { + "security": [ + { + "BasicAuth": [] + } + ], + "description": "Retrieve all incoming and outgoing transactions for a specific wallet address", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "wallet" + ], + "summary": "Get wallet transactions", + "parameters": [ + { + "type": "string", + "description": "Chain ID", + "name": "chainId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Wallet address", + "name": "wallet_address", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Filter parameters", + "name": "filter", + "in": "query" + }, + { + "type": "string", + "description": "Field to group results by", + "name": "group_by", + "in": "query" + }, + { + "type": "string", + "description": "Field to sort results by", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "Sort order (asc or desc)", + "name": "sort_order", + "in": "query" + }, + { + "type": "integer", + "description": "Page number for pagination", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "default": 5, + "description": "Number of items per page", + "name": "limit", + "in": "query" + }, + { + "type": "boolean", + "description": "Force consistent data at the expense of query speed", + "name": "force_consistent_data", + "in": "query" + }, + { + "type": "boolean", + "description": "Decode transaction data", + "name": "decode", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/api.QueryResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/common.DecodedTransactionModel" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/api.Error" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/api.Error" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/api.Error" + } + } + } + } } }, "definitions": { @@ -1604,18 +1730,12 @@ const docTemplate = `{ "common.DecodedLogDataModel": { "type": "object", "properties": { - "indexedParams": { - "type": "object" - }, "indexed_params": { "type": "object" }, "name": { "type": "string" }, - "nonIndexedParams": { - "type": "object" - }, "non_indexed_params": { "type": "object" }, @@ -1648,14 +1768,6 @@ const docTemplate = `{ "decoded": { "$ref": "#/definitions/common.DecodedLogDataModel" }, - "decodedData": { - "description": "Deprecated: Use Decoded field instead", - "allOf": [ - { - "$ref": "#/definitions/common.DecodedLogDataModel" - } - ] - }, "log_index": { "type": "integer" }, @@ -1724,14 +1836,6 @@ const docTemplate = `{ "decoded": { "$ref": "#/definitions/common.DecodedTransactionDataModel" }, - "decodedData": { - "description": "Deprecated: Use Decoded field instead", - "allOf": [ - { - "$ref": "#/definitions/common.DecodedTransactionDataModel" - } - ] - }, "effective_gas_price": { "type": "string" }, diff --git a/docs/swagger.json b/docs/swagger.json index 044fcd3..35e68a0 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1443,6 +1443,132 @@ } } } + }, + "/{chainId}/wallet-transactions": { + "get": { + "security": [ + { + "BasicAuth": [] + } + ], + "description": "Retrieve all incoming and outgoing transactions for a specific wallet address", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "wallet" + ], + "summary": "Get wallet transactions", + "parameters": [ + { + "type": "string", + "description": "Chain ID", + "name": "chainId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Wallet address", + "name": "wallet_address", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Filter parameters", + "name": "filter", + "in": "query" + }, + { + "type": "string", + "description": "Field to group results by", + "name": "group_by", + "in": "query" + }, + { + "type": "string", + "description": "Field to sort results by", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "Sort order (asc or desc)", + "name": "sort_order", + "in": "query" + }, + { + "type": "integer", + "description": "Page number for pagination", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "default": 5, + "description": "Number of items per page", + "name": "limit", + "in": "query" + }, + { + "type": "boolean", + "description": "Force consistent data at the expense of query speed", + "name": "force_consistent_data", + "in": "query" + }, + { + "type": "boolean", + "description": "Decode transaction data", + "name": "decode", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/api.QueryResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/common.DecodedTransactionModel" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/api.Error" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/api.Error" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/api.Error" + } + } + } + } } }, "definitions": { @@ -1597,18 +1723,12 @@ "common.DecodedLogDataModel": { "type": "object", "properties": { - "indexedParams": { - "type": "object" - }, "indexed_params": { "type": "object" }, "name": { "type": "string" }, - "nonIndexedParams": { - "type": "object" - }, "non_indexed_params": { "type": "object" }, @@ -1641,14 +1761,6 @@ "decoded": { "$ref": "#/definitions/common.DecodedLogDataModel" }, - "decodedData": { - "description": "Deprecated: Use Decoded field instead", - "allOf": [ - { - "$ref": "#/definitions/common.DecodedLogDataModel" - } - ] - }, "log_index": { "type": "integer" }, @@ -1717,14 +1829,6 @@ "decoded": { "$ref": "#/definitions/common.DecodedTransactionDataModel" }, - "decodedData": { - "description": "Deprecated: Use Decoded field instead", - "allOf": [ - { - "$ref": "#/definitions/common.DecodedTransactionDataModel" - } - ] - }, "effective_gas_price": { "type": "string" }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 686f367..17762a5 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -105,14 +105,10 @@ definitions: properties: indexed_params: type: object - indexedParams: - type: object name: type: string non_indexed_params: type: object - nonIndexedParams: - type: object signature: type: string type: object @@ -132,10 +128,6 @@ definitions: type: string decoded: $ref: '#/definitions/common.DecodedLogDataModel' - decodedData: - allOf: - - $ref: '#/definitions/common.DecodedLogDataModel' - description: 'Deprecated: Use Decoded field instead' log_index: type: integer topics: @@ -181,10 +173,6 @@ definitions: type: string decoded: $ref: '#/definitions/common.DecodedTransactionDataModel' - decodedData: - allOf: - - $ref: '#/definitions/common.DecodedTransactionDataModel' - description: 'Deprecated: Use Decoded field instead' effective_gas_price: type: string from_address: @@ -1273,6 +1261,87 @@ paths: summary: Get token transfers tags: - transfers + /{chainId}/wallet-transactions: + get: + consumes: + - application/json + description: Retrieve all incoming and outgoing transactions for a specific + wallet address + parameters: + - description: Chain ID + in: path + name: chainId + required: true + type: string + - description: Wallet address + in: path + name: wallet_address + required: true + type: string + - description: Filter parameters + in: query + name: filter + type: string + - description: Field to group results by + in: query + name: group_by + type: string + - description: Field to sort results by + in: query + name: sort_by + type: string + - description: Sort order (asc or desc) + in: query + name: sort_order + type: string + - description: Page number for pagination + in: query + name: page + type: integer + - default: 5 + description: Number of items per page + in: query + name: limit + type: integer + - description: Force consistent data at the expense of query speed + in: query + name: force_consistent_data + type: boolean + - description: Decode transaction data + in: query + name: decode + type: boolean + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/api.QueryResponse' + - properties: + data: + items: + $ref: '#/definitions/common.DecodedTransactionModel' + type: array + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/api.Error' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/api.Error' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/api.Error' + security: + - BasicAuth: [] + summary: Get wallet transactions + tags: + - wallet /search/:input: get: consumes: diff --git a/internal/common/log.go b/internal/common/log.go index 49a66bd..04ff16e 100644 --- a/internal/common/log.go +++ b/internal/common/log.go @@ -58,18 +58,15 @@ type LogModel struct { } type DecodedLogDataModel struct { - Name string `json:"name"` - Signature string `json:"signature"` - IndexedParamsDeprecated map[string]interface{} `json:"indexedParams" swaggertype:"object" deprecated:"true"` - IndexedParams map[string]interface{} `json:"indexed_params" swaggertype:"object"` - NonIndexedParamsDeprecated map[string]interface{} `json:"nonIndexedParams" swaggertype:"object" deprecated:"true"` - NonIndexedParams map[string]interface{} `json:"non_indexed_params" swaggertype:"object"` + Name string `json:"name"` + Signature string `json:"signature"` + IndexedParams map[string]interface{} `json:"indexed_params" swaggertype:"object"` + NonIndexedParams map[string]interface{} `json:"non_indexed_params" swaggertype:"object"` } type DecodedLogModel struct { LogModel - Decoded DecodedLogDataModel `json:"decoded"` - DecodedData DecodedLogDataModel `json:"decodedData" deprecated:"true"` // Deprecated: Use Decoded field instead + Decoded DecodedLogDataModel `json:"decoded"` } type RawLogs = []map[string]interface{} @@ -252,17 +249,13 @@ func (l *Log) Serialize() LogModel { } func (l *DecodedLog) Serialize() DecodedLogModel { - decodedData := DecodedLogDataModel{ - Name: l.Decoded.Name, - Signature: l.Decoded.Signature, - IndexedParams: l.Decoded.IndexedParams, - IndexedParamsDeprecated: l.Decoded.IndexedParams, - NonIndexedParams: l.Decoded.NonIndexedParams, - NonIndexedParamsDeprecated: l.Decoded.NonIndexedParams, - } return DecodedLogModel{ - LogModel: l.Log.Serialize(), - Decoded: decodedData, - DecodedData: decodedData, + LogModel: l.Log.Serialize(), + Decoded: DecodedLogDataModel{ + Name: l.Decoded.Name, + Signature: l.Decoded.Signature, + IndexedParams: l.Decoded.IndexedParams, + NonIndexedParams: l.Decoded.NonIndexedParams, + }, } } diff --git a/internal/common/transaction.go b/internal/common/transaction.go index 127aae8..ee92534 100644 --- a/internal/common/transaction.go +++ b/internal/common/transaction.go @@ -97,8 +97,7 @@ type DecodedTransactionDataModel struct { type DecodedTransactionModel struct { TransactionModel - Decoded DecodedTransactionDataModel `json:"decoded"` - DecodedData DecodedTransactionDataModel `json:"decodedData" deprecated:"true"` // Deprecated: Use Decoded field instead + Decoded DecodedTransactionDataModel `json:"decoded"` } func DecodeTransactions(chainId string, txs []Transaction) []*DecodedTransaction { @@ -218,14 +217,12 @@ func (t *Transaction) Serialize() TransactionModel { } func (t *DecodedTransaction) Serialize() DecodedTransactionModel { - decodedData := DecodedTransactionDataModel{ - Name: t.Decoded.Name, - Signature: t.Decoded.Signature, - Inputs: t.Decoded.Inputs, - } return DecodedTransactionModel{ TransactionModel: t.Transaction.Serialize(), - Decoded: decodedData, - DecodedData: decodedData, + Decoded: DecodedTransactionDataModel{ + Name: t.Decoded.Name, + Signature: t.Decoded.Signature, + Inputs: t.Decoded.Inputs, + }, } }