diff --git a/openapi.json b/openapi.json new file mode 100644 index 0000000..a2f1e2a --- /dev/null +++ b/openapi.json @@ -0,0 +1,2604 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Token Balance API", + "description": "This API provides realtime balances information from accounts across different blockchains.", + "license": { + "name": "LicenseRef-DuneAnalytics" + }, + "version": "0.1.0" + }, + "servers": [ + { + "url": "https://api.sim.dune.com" + } + ], + "paths": { + "/echo/beta/tokens/evm/{contract_address}": { + "get": { + "tags": [ + "prices" + ], + "summary": "Get EVM token prices for a specified contract address (or the native token), on any chain.", + "operationId": "getEvmTokenData", + "parameters": [ + { + "name": "X-Dune-Api-Key", + "in": "header", + "description": "API key to access the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "contract_address", + "in": "path", + "description": "The contract address of the token or 'native' for the native token of the chain", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "historical_prices", + "in": "query", + "description": "A comma-separated list of unsigned 32-bit integers representing a number of hours offset from the present.", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TokensResponse" + }, + "example": { + "contract_address": "native", + "tokens": [ + { + "chain": "ethereum", + "chain_id": 1, + "price_usd": 12.34, + "symbol": "ETH" + } + ] + } + } + } + }, + "400": { + "description": "Bad Request - The request could not be understood by the server due to malformed data" + }, + "404": { + "description": "Not Found" + }, + "500": { + "description": "Internal Server Error - A generic error occurred on the server." + } + } + } + }, + "/echo/beta/transactions/svm/{address}": { + "get": { + "tags": [ + "transactions" + ], + "summary": "Get SVM transactions for a given address", + "description": "This endpoint returns transactions for a given address across several SVM chains.", + "operationId": "getSvmTransactions", + "parameters": [ + { + "name": "X-Dune-Api-Key", + "in": "header", + "description": "API key to access the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "address", + "in": "path", + "description": "Wallet to get transactions for", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "offset", + "in": "query", + "description": "The offset to paginate through the result sets. This is a cursor being passed from the previous response, only use what the backend has returned on previous responses.", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of transactions to return", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "nullable": true, + "minimum": 0 + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransactionsSvmResponse" + } + } + } + }, + "400": { + "description": "Bad Request - The request could not be understood by the server due to malformed data" + }, + "404": { + "description": "Not Found" + }, + "500": { + "description": "Internal Server Error - A generic error occurred on the server" + } + } + } + }, + "/echo/v1/balance/{address}/token/{token}": { + "get": { + "tags": [ + "balances" + ], + "summary": "Get balance for a specific token for a given address", + "description": "This endpoint returns the balance of a specific token for an address on a specified chain", + "operationId": "getTokenBalance", + "parameters": [ + { + "name": "X-Dune-Api-Key", + "in": "header", + "description": "API key to access the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "address", + "in": "path", + "description": "Wallet to get balance for", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "token", + "in": "path", + "description": "Token address or 'native' for native token", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "chain_ids", + "in": "query", + "description": "A single chain ID to get balance for. Example: chain_ids=1. Please see the response of the /chains endpoint for supported chain IDs.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "metadata", + "in": "query", + "description": "A comma-separated list of additional metadata fields to include for each token. Supported values: `logo`, `url`", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "historical_prices", + "in": "query", + "description": "A comma-separated list of unsigned 32-bit integers representing a number of hours offset from the present at which to fetch historical prices for each token.", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BalancesResponse" + }, + "example": { + "balances": [ + { + "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + "amount": "1000000000", + "chain": "ethereum", + "decimals": 6, + "price_usd": 1.0, + "symbol": "USDC", + "value_usd": 1000.0 + } + ], + "request_time": "2023-11-07T05:31:56Z", + "response_time": "2023-11-07T05:31:56Z", + "wallet_address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" + } + } + } + }, + "400": { + "description": "Bad Request - The request could not be understood by the server due to malformed data" + }, + "404": { + "description": "Not Found" + }, + "500": { + "description": "Internal Server Error - A generic error occurred on the server." + } + } + } + }, + "/echo/v1/balances/evm/{address}": { + "get": { + "tags": [ + "balances" + ], + "summary": "Get EVM token balances for a given address", + "description": "This endpoint returns EVM token balances for an address for any token that the address has interacted with", + "operationId": "getEvmBalances", + "parameters": [ + { + "name": "X-Dune-Api-Key", + "in": "header", + "description": "API key to access the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "address", + "in": "path", + "description": "Wallet to get balances for", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "chain_ids", + "in": "query", + "description": "A comma separated list of chain_ids or tags for blockchains to get balances for. Examples: chain_ids=1,8453,10, chain_ids=mainnet,testnet. Only balances for blockchains tagged with all the specified tags are returned. Please see the response of the /chains endpoint for the tags on each blockchain.", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "exclude_spam_tokens", + "in": "query", + "description": "Specify this to exclude spam tokens from the response", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "filters", + "in": "query", + "description": "Specify `ERC20` or `NATIVE` to get only ERC20 tokens or native assets, respectively", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "metadata", + "in": "query", + "description": "A comma separated list of additional metadata fields to include for each token. Supported values: `logo`, `url`, `pools`", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "offset", + "in": "query", + "description": "The offset to paginate through result sets. This is a cursor being passed from the previous response, only use what the backend returns here.", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of transactions to return", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "nullable": true, + "minimum": 0 + } + }, + { + "name": "historical_prices", + "in": "query", + "description": "A comma separated list of unsigned 32-bit integers representing a number of hours offset from the present at which to fetch historical prices for each token.", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BalancesResponse" + }, + "example": { + "balances": [ + { + "address": "native", + "amount": "605371497350928252303", + "chain": "ethereum", + "decimals": 18, + "price_usd": 3042.816964922323, + "symbol": "ETH", + "value_usd": 1842034.6622198338 + } + ], + "next_offset": "dKMBWDLqM7vlyn5OMEXsLWp0nI4AAAABA5JLazNO7x4poVGqUwsgxgqvvIg", + "request_time": "2023-11-07T05:31:56Z", + "response_time": "2023-11-07T05:31:56Z", + "wallet_address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" + } + } + } + }, + "400": { + "description": "Bad Request - The request could not be understood by the server due to malformed data" + }, + "404": { + "description": "Not Found" + }, + "500": { + "description": "Internal Server Error - A generic error occurred on the server." + } + } + } + }, + "/echo/v1/collectibles/evm/{address}": { + "get": { + "tags": [ + "collectibles" + ], + "summary": "Get holdings of ERC721 tokens and balances of ERC1155 tokens for a specified wallet, on any EVM chains.", + "operationId": "getEvmCollectibles", + "parameters": [ + { + "name": "X-Dune-Api-Key", + "in": "header", + "description": "API key to access the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "address", + "in": "path", + "description": "Wallet to get collectibles for", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "offset", + "in": "query", + "description": "The offset for paginating through result sets; this is a cursor passed from the previous response, only use what the backend returns here", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of collectibles to return", + "required": false, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Limit" + } + ], + "nullable": true + }, + "example": "100" + }, + { + "name": "filter_spam", + "in": "query", + "description": "Filter out spam collectibles (default: true)", + "required": false, + "schema": { + "type": "boolean" + }, + "example": "true" + }, + { + "name": "show_spam_scores", + "in": "query", + "description": "Show spam scores for collectibles (default: false)", + "required": false, + "schema": { + "type": "boolean" + }, + "example": "false" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectiblesResponse" + }, + "example": { + "address": "0x0000000000000000000000000000000000000000", + "entries": [ + { + "balance": "1", + "chain": "ethereum", + "chain_id": 1, + "contract_address": "0x0000000000000000000000000000000000000000", + "token_id": "0x101010101010101010101010101010101010101010101010101010101010101", + "token_standard": "ERC721" + } + ], + "request_time": "2025-05-16T09:24:22.855924+00:00", + "response_time": "2025-05-16T09:24:22.855964+00:00" + } + } + } + }, + "400": { + "description": "Bad Request - The request could not be understood by the server due to malformed data" + }, + "404": { + "description": "Not Found" + }, + "500": { + "description": "Internal Server Error - A generic error occurred on the server." + } + } + } + }, + "/echo/v1/leaderboard/evm/{address}": { + "get": { + "tags": [ + "leaderboard" + ], + "summary": "Get the balances leaderboard for any ERC20 token on any EVM chain.", + "operationId": "getEvmTokenHolderLeaderboard", + "parameters": [ + { + "name": "X-Dune-Api-Key", + "in": "header", + "description": "API key to access the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "address", + "in": "path", + "description": "Contract address of the token to get the leaderboard for", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "offset", + "in": "query", + "description": "The offset to paginate through result sets; this is a cursor passed from the previous response, only use what the backend returns here", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of leaderboard entries to return", + "required": false, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Limit" + } + ], + "nullable": true + }, + "example": "100" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LeaderBoardResponse" + }, + "example": { + "chain_id": 8453, + "holders": [ + { + "balance": "751361023633170444436302", + "wallet_address": "0x581F301b65e26DDD19F032218d60eE8067afb0c7" + }, + { + "balance": "673633023633170444431234", + "wallet_address": "0x1234501b65e26DDD19F032218d60eE8067afb0c7" + }, + { + "balance": "555553023633170444435456", + "wallet_address": "0x6789ab1b65e26DDD19F032218d60eE8067afb0c7" + }, + { + "balance": "555543023633170444431111", + "wallet_address": "0xaaaaaaaa65e26DDD19F032218d60eE8067afb0c7" + } + ], + "token_address": "0xbbcA29E5674EfaF7DC212370C3A58d746D98DB07" + } + } + } + }, + "400": { + "description": "Bad Request - The request could not be understood by the server due to malformed data" + }, + "404": { + "description": "Not Found" + }, + "500": { + "description": "Internal Server Error - A generic error occurred on the server." + } + } + } + }, + "/echo/v1/subscriptions/webhooks": { + "get": { + "tags": [ + "webhooks" + ], + "operationId": "list_webhooks", + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhooks" + } + } + } + }, + "500": { + "description": "A generic error occurred on the server" + } + } + }, + "post": { + "tags": [ + "webhooks" + ], + "operationId": "create_webhook", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWebhook" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + } + } + }, + "500": { + "description": "A generic error occurred on the server" + } + } + } + }, + "/echo/v1/subscriptions/webhooks/{id}": { + "get": { + "tags": [ + "webhooks" + ], + "operationId": "get_webhook", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Id of the webhook", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + } + } + }, + "500": { + "description": "A generic error occurred on the server" + } + } + }, + "delete": { + "tags": [ + "webhooks" + ], + "operationId": "delete_webhook", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Id of the webhook", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response" + }, + "500": { + "description": "A generic error occurred on the server" + } + } + }, + "patch": { + "tags": [ + "webhooks" + ], + "operationId": "update_webhook", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Id of the webhook", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWebhook" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + } + } + }, + "500": { + "description": "A generic error occurred on the server" + } + } + } + }, + "/echo/v1/subscriptions/webhooks/{id}/addresses": { + "get": { + "tags": [ + "webhooks" + ], + "operationId": "get_webhook_addresses", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Id of the webhook", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Addresses" + } + } + } + }, + "500": { + "description": "A generic error occurred on the server" + } + } + }, + "put": { + "tags": [ + "webhooks" + ], + "operationId": "replace_webhook_addresses", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Id of the webhook", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReplaceAddresses" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful response" + }, + "500": { + "description": "A generic error occurred on the server" + } + } + }, + "patch": { + "tags": [ + "webhooks" + ], + "operationId": "update_webhook_addresses", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Id of the webhook", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateAddresses" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful response" + }, + "500": { + "description": "A generic error occurred on the server" + } + } + } + }, + "/echo/v1/transactions/evm/{address}": { + "get": { + "tags": [ + "transactions" + ], + "summary": "Get EVM transactions for a given address", + "description": "This endpoint returns transactions for a given address across several EVM chains.\nBy setting the decode parameter you can optionally choose to get both function calls and logs decoded.", + "operationId": "getEvmTransactions", + "parameters": [ + { + "name": "address", + "in": "path", + "description": "Wallet to get transactions for", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "X-Dune-Api-Key", + "in": "header", + "description": "API key to access the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "offset", + "in": "query", + "description": "The offset to paginate through result sets. This is a cursor being passed from the previous response, only use what the backend has returned on previous responses.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of transactions to return", + "required": false, + "schema": { + "type": "integer", + "nullable": true, + "minimum": 0 + } + }, + { + "name": "block_time", + "in": "query", + "description": "Return only transactions before this block time", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "nullable": true, + "minimum": 0 + } + }, + { + "name": "to", + "in": "query", + "description": "Filter transactions to a given address", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "method_id", + "in": "query", + "description": "Return only transactions with this method id", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "decode", + "in": "query", + "description": "Return abi decoded transactions and logs", + "required": false, + "schema": { + "type": "boolean", + "nullable": true + } + }, + { + "name": "log_address", + "in": "query", + "description": "Return only transactions with this address in logs", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "topic0", + "in": "query", + "description": "Return only transactions with this topic0 in logs", + "required": false, + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "min_block_number", + "in": "query", + "description": "Return only transactions from blocks with block number equal to or greater than this value", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "nullable": true, + "minimum": 0 + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransactionsResponse" + }, + "example": { + "next_offset": "AAYd_b6aoIAAAAABAAAAAA4KZhIAAAAAAAAAAAAAAAAAAAAE", + "transactions": [ + { + "address": "0x7893015832ea33bbe5ca7e4e3045ec2d6a749c8e", + "block_hash": "0x6761509c675c0afd7737611513e39e4334c0f4ed176992d92c57d7cc296f9d58", + "block_number": 40517009, + "block_time": "2024-05-18T09:32:32+00:00", + "block_version": 0, + "chain": "Ethereum", + "data": "0x4e71d92d", + "from": "0x7893015832ea33bbe5ca7e4e3045ec2d6a749c8e", + "gas_price": "0x62b85e900", + "hash": "0x029e21354ec2afad789c5fcd24987871d832b05b4159722a731d28141c2bd00f", + "index": 4, + "max_fee_per_gas": "0x835105080", + "max_priority_fee_per_gas": "0x59682f00", + "nonce": "0xd00b000000000000", + "to": "0x5857019c749147eee22b1fe63500f237f3c1b692", + "transaction_type": "Sender", + "value": "0x0" + } + ] + } + } + } + }, + "400": { + "description": "Bad Request - The request could not be understood by the server due to malformed data" + }, + "404": { + "description": "Not Found" + }, + "500": { + "description": "Internal Server Error - A generic error occurred on the server" + } + } + } + } + }, + "components": { + "schemas": { + "ActivityType": { + "type": "string", + "enum": [ + "approve", + "mint", + "burn", + "receive", + "send", + "swap", + "call" + ] + }, + "Addresses": { + "type": "object", + "required": [ + "addresses" + ], + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "next_offset": { + "type": "string" + } + } + }, + "AssetType": { + "type": "string", + "enum": [ + "native", + "erc20", + "erc721", + "erc1155" + ] + }, + "BalanceData": { + "type": "object", + "required": [ + "chain", + "address", + "amount" + ], + "properties": { + "address": { + "type": "string" + }, + "amount": { + "type": "string" + }, + "chain": { + "type": "string" + }, + "chain_id": { + "type": "integer", + "format": "int64" + }, + "decimals": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "historical_prices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/HistoricalPrice" + } + }, + "low_liquidity": { + "type": "boolean" + }, + "name": { + "type": "string", + "nullable": true + }, + "pool": { + "allOf": [ + { + "$ref": "#/components/schemas/PoolDetails" + } + ], + "nullable": true + }, + "pool_size": { + "type": "number", + "format": "double", + "nullable": true + }, + "price_usd": { + "type": "number", + "format": "double", + "nullable": true + }, + "symbol": { + "type": "string", + "nullable": true + }, + "token_metadata": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseTokenMetadata" + } + ], + "nullable": true + }, + "value_usd": { + "type": "number", + "format": "double", + "nullable": true + } + } + }, + "BalanceErrorInformation": { + "type": "object", + "required": [ + "chain_id", + "address" + ], + "properties": { + "address": { + "type": "string" + }, + "chain_id": { + "type": "integer", + "format": "int64" + }, + "description": { + "type": "string" + } + } + }, + "BalanceErrors": { + "type": "object", + "properties": { + "error_message": { + "type": "string", + "nullable": true + }, + "token_errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BalanceErrorInformation" + } + } + } + }, + "BalancesResponse": { + "type": "object", + "required": [ + "wallet_address", + "balances" + ], + "properties": { + "balances": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BalanceData" + } + }, + "errors": { + "allOf": [ + { + "$ref": "#/components/schemas/BalanceErrors" + } + ], + "nullable": true + }, + "next_offset": { + "type": "string" + }, + "request_time": { + "type": "string", + "nullable": true + }, + "response_time": { + "type": "string", + "nullable": true + }, + "wallet_address": { + "type": "string", + "example": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" + }, + "warnings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Warning" + } + } + } + }, + "Chain": { + "type": "string", + "enum": [ + "solana", + "eclipse" + ] + }, + "ChainId": { + "type": "integer", + "format": "int64" + }, + "CollectibleMetadata": { + "type": "object", + "properties": { + "attributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollectibleMetadataAttribute" + }, + "nullable": true + }, + "uri": { + "type": "string", + "nullable": true + } + } + }, + "CollectibleMetadataAttribute": { + "type": "object", + "required": [ + "key", + "value" + ], + "properties": { + "attribute_type": { + "type": "string", + "nullable": true + }, + "format": { + "type": "string", + "nullable": true + }, + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "CollectiblesEntry": { + "allOf": [ + { + "type": "object", + "properties": { + "explanations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpamFeature" + } + }, + "is_spam": { + "type": "boolean" + }, + "spam_score": { + "type": "integer", + "format": "int32", + "example": 42, + "minimum": 0 + } + } + }, + { + "type": "object", + "required": [ + "contract_address", + "token_standard", + "token_id", + "chain", + "chain_id", + "balance" + ], + "properties": { + "balance": { + "type": "string" + }, + "chain": { + "type": "string" + }, + "chain_id": { + "$ref": "#/components/schemas/ChainId" + }, + "contract_address": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "floor_price": { + "type": "string", + "nullable": true + }, + "image_url": { + "type": "string", + "nullable": true + }, + "last_acquired": { + "type": "string", + "nullable": true + }, + "last_sale_price": { + "type": "string", + "nullable": true + }, + "metadata": { + "allOf": [ + { + "$ref": "#/components/schemas/CollectibleMetadata" + } + ], + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "symbol": { + "type": "string", + "nullable": true + }, + "token_id": { + "type": "string" + }, + "token_standard": { + "type": "string" + } + } + } + ] + }, + "CollectiblesErrorInformation": { + "type": "object", + "required": [ + "chain_id", + "address" + ], + "properties": { + "address": { + "type": "string" + }, + "chain_id": { + "type": "integer", + "format": "int64" + }, + "description": { + "type": "string" + } + } + }, + "CollectiblesErrors": { + "type": "object", + "properties": { + "error_message": { + "type": "string", + "nullable": true + }, + "token_errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollectiblesErrorInformation" + } + } + } + }, + "CollectiblesResponse": { + "type": "object", + "required": [ + "address", + "entries", + "request_time", + "response_time" + ], + "properties": { + "address": { + "type": "string" + }, + "entries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollectiblesEntry" + } + }, + "errors": { + "allOf": [ + { + "$ref": "#/components/schemas/CollectiblesErrors" + } + ], + "nullable": true + }, + "next_offset": { + "type": "string" + }, + "request_time": { + "type": "string" + }, + "response_time": { + "type": "string" + } + } + }, + "CreateWebhook": { + "type": "object", + "required": [ + "name", + "url", + "type", + "addresses", + "counterparty", + "token_address" + ], + "properties": { + "activity_type": { + "allOf": [ + { + "$ref": "#/components/schemas/ActivityType" + } + ], + "nullable": true + }, + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "asset_type": { + "allOf": [ + { + "$ref": "#/components/schemas/AssetType" + } + ], + "nullable": true + }, + "chain_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "nullable": true + }, + "counterparty": { + "type": "string" + }, + "name": { + "type": "string" + }, + "token_address": { + "type": "string" + }, + "transaction_type": { + "allOf": [ + { + "$ref": "#/components/schemas/TransactionType" + } + ], + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/WebhookType" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false + }, + "DecodedEvent": { + "type": "object", + "required": [ + "name", + "inputs" + ], + "properties": { + "inputs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Input" + } + }, + "name": { + "type": "string" + } + } + }, + "DecodedFunction": { + "type": "object", + "required": [ + "name", + "inputs" + ], + "properties": { + "inputs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Input" + } + }, + "name": { + "type": "string" + } + } + }, + "HistoricalPrice": { + "type": "object", + "description": "A single historical price for the balances and tokens endpoints.", + "required": [ + "offset_hours", + "price_usd" + ], + "properties": { + "offset_hours": { + "type": "integer", + "format": "int32", + "description": "Offset in hours (in the past) from the current time.", + "minimum": 0 + }, + "price_usd": { + "type": "number", + "format": "double", + "description": "Price in USD at the offset." + } + } + }, + "Input": { + "type": "object", + "required": [ + "name", + "type", + "value" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "$ref": "#/components/schemas/Token" + } + } + }, + "LeaderBoardEntryResponse": { + "type": "object", + "required": [ + "wallet_address", + "balance", + "first_acquired", + "has_initiated_transfer" + ], + "properties": { + "balance": { + "type": "string" + }, + "first_acquired": { + "$ref": "#/components/schemas/Microseconds" + }, + "has_initiated_transfer": { + "type": "boolean" + }, + "wallet_address": { + "type": "string" + } + } + }, + "LeaderBoardResponse": { + "type": "object", + "required": [ + "token_address", + "chain_id" + ], + "properties": { + "chain_id": { + "$ref": "#/components/schemas/ChainId" + }, + "error": { + "type": "string", + "nullable": true + }, + "holders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LeaderBoardEntryResponse" + } + }, + "next_offset": { + "type": "string" + }, + "token_address": { + "type": "string" + } + } + }, + "LeaderBoardResponseError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "Limit": { + "type": "integer", + "minimum": 0 + }, + "Log": { + "type": "object", + "required": [ + "address", + "data", + "topics" + ], + "properties": { + "address": { + "type": "string" + }, + "data": { + "type": "string" + }, + "topics": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Microseconds": { + "type": "integer", + "format": "int64" + }, + "PoolDetails": { + "oneOf": [ + { + "type": "object", + "required": [ + "pool_type", + "address", + "token0", + "token1", + "fee", + "tick_spacing", + "hooks", + "pool_id" + ], + "properties": { + "address": { + "type": "string" + }, + "fee": { + "type": "integer", + "format": "int32", + "minimum": 0 + }, + "hooks": { + "type": "string" + }, + "pool_id": { + "type": "string" + }, + "pool_type": { + "type": "string" + }, + "tick_spacing": { + "type": "integer", + "format": "int32" + }, + "token0": { + "type": "string" + }, + "token1": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "pool_type", + "address", + "token0", + "token1" + ], + "properties": { + "address": { + "type": "string" + }, + "pool_type": { + "type": "string" + }, + "token0": { + "type": "string" + }, + "token1": { + "type": "string" + } + } + } + ] + }, + "ReplaceAddresses": { + "type": "object", + "required": [ + "addresses" + ], + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ResponseLog": { + "allOf": [ + { + "$ref": "#/components/schemas/Log" + }, + { + "type": "object", + "properties": { + "decoded": { + "allOf": [ + { + "$ref": "#/components/schemas/DecodedEvent" + } + ], + "nullable": true + } + } + } + ] + }, + "ResponseTokenMetadata": { + "type": "object", + "properties": { + "logo": { + "type": "string", + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + } + }, + "ResponseTransaction": { + "allOf": [ + { + "$ref": "#/components/schemas/TransactionBase" + }, + { + "type": "object", + "required": [ + "chain", + "logs" + ], + "properties": { + "chain": { + "type": "string" + }, + "decoded": { + "allOf": [ + { + "$ref": "#/components/schemas/DecodedFunction" + } + ], + "nullable": true + }, + "logs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ResponseLog" + } + } + } + } + ] + }, + "SpamFeature": { + "oneOf": [ + { + "type": "object", + "required": [ + "feature" + ], + "properties": { + "feature": { + "type": "string", + "enum": [ + "unknown" + ] + } + } + }, + { + "type": "object", + "required": [ + "value", + "feature_score", + "feature_weight", + "feature" + ], + "properties": { + "feature": { + "type": "string", + "enum": [ + "trade_volume" + ] + }, + "feature_score": { + "type": "integer", + "format": "int32", + "example": 42, + "maximum": 100, + "minimum": 0 + }, + "feature_weight": { + "type": "number", + "format": "double" + }, + "value": { + "type": "integer", + "format": "int64", + "minimum": 0 + } + } + }, + { + "type": "object", + "required": [ + "value", + "feature_score", + "feature_weight", + "feature" + ], + "properties": { + "feature": { + "type": "string", + "enum": [ + "unique_sellers" + ] + }, + "feature_score": { + "type": "integer", + "format": "int32", + "example": 42, + "maximum": 100, + "minimum": 0 + }, + "feature_weight": { + "type": "number", + "format": "double" + }, + "value": { + "type": "integer", + "format": "int64", + "minimum": 0 + } + } + }, + { + "type": "object", + "required": [ + "value", + "feature_score", + "feature_weight", + "feature" + ], + "properties": { + "feature": { + "type": "string", + "enum": [ + "unique_buyers" + ] + }, + "feature_score": { + "type": "integer", + "format": "int32", + "example": 42, + "maximum": 100, + "minimum": 0 + }, + "feature_weight": { + "type": "number", + "format": "double" + }, + "value": { + "type": "integer", + "format": "int64", + "minimum": 0 + } + } + }, + { + "type": "object", + "description": "Originally sourced from Alchemy's spam detection system, renamed for API consistency", + "required": [ + "value", + "feature_score", + "feature_weight", + "feature" + ], + "properties": { + "feature": { + "type": "string", + "enum": [ + "externally_flagged" + ] + }, + "feature_score": { + "type": "integer", + "format": "int32", + "example": 42, + "maximum": 100, + "minimum": 0 + }, + "feature_weight": { + "type": "number", + "format": "double" + }, + "value": { + "type": "boolean" + } + } + }, + { + "type": "object", + "required": [ + "value", + "feature_score", + "feature_weight", + "feature" + ], + "properties": { + "feature": { + "type": "string", + "enum": [ + "uri_non_ipfs" + ] + }, + "feature_score": { + "type": "integer", + "format": "int32", + "example": 42, + "maximum": 100, + "minimum": 0 + }, + "feature_weight": { + "type": "number", + "format": "double" + }, + "value": { + "type": "boolean" + } + } + }, + { + "type": "object", + "required": [ + "value", + "feature_score", + "feature_weight", + "feature" + ], + "properties": { + "feature": { + "type": "string", + "enum": [ + "suspicious_words" + ] + }, + "feature_score": { + "type": "integer", + "format": "int32", + "example": 42, + "maximum": 100, + "minimum": 0 + }, + "feature_weight": { + "type": "number", + "format": "double" + }, + "value": { + "type": "boolean" + } + } + }, + { + "type": "object", + "required": [ + "value", + "feature_score", + "feature_weight", + "feature" + ], + "properties": { + "feature": { + "type": "string", + "enum": [ + "url_shortener" + ] + }, + "feature_score": { + "type": "integer", + "format": "int32", + "example": 42, + "maximum": 100, + "minimum": 0 + }, + "feature_weight": { + "type": "number", + "format": "double" + }, + "value": { + "type": "boolean" + } + } + }, + { + "type": "object", + "required": [ + "value", + "feature_score", + "feature_weight", + "feature" + ], + "properties": { + "feature": { + "type": "string", + "enum": [ + "manual_classification" + ] + }, + "feature_score": { + "type": "integer", + "format": "int32", + "example": 42, + "maximum": 100, + "minimum": 0 + }, + "feature_weight": { + "type": "number", + "format": "double" + }, + "value": { + "type": "string" + } + } + } + ], + "discriminator": { + "propertyName": "feature" + } + }, + "Token": { + "type": "object" + }, + "TokenData": { + "type": "object", + "required": [ + "chain_id", + "chain" + ], + "properties": { + "chain": { + "type": "string" + }, + "chain_id": { + "type": "integer", + "format": "int64" + }, + "decimals": { + "type": "integer", + "format": "int32", + "nullable": true, + "minimum": 0 + }, + "fully_diluted_value": { + "type": "number", + "format": "double", + "nullable": true + }, + "historical_prices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/HistoricalPrice" + } + }, + "logo": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "pool": { + "allOf": [ + { + "$ref": "#/components/schemas/PoolDetails" + } + ], + "nullable": true + }, + "pool_size": { + "type": "number", + "format": "double", + "nullable": true + }, + "price_usd": { + "type": "number", + "format": "double", + "nullable": true + }, + "symbol": { + "type": "string", + "nullable": true + }, + "total_supply": { + "type": "string", + "nullable": true + } + } + }, + "TokensResponse": { + "type": "object", + "description": "Response type for both price endpoints.", + "required": [ + "contract_address", + "tokens" + ], + "properties": { + "contract_address": { + "type": "string" + }, + "tokens": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TokenData" + } + } + } + }, + "Transaction": { + "type": "object", + "required": [ + "address", + "chain", + "block_slot", + "raw_transaction" + ], + "properties": { + "address": { + "type": "string" + }, + "block_slot": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "block_time": { + "allOf": [ + { + "$ref": "#/components/schemas/Microseconds" + } + ], + "nullable": true + }, + "chain": { + "type": "string" + }, + "raw_transaction": { + "type": "object" + } + } + }, + "TransactionBase": { + "type": "object", + "required": [ + "chain_id", + "address", + "block_time", + "block_number", + "index", + "hash", + "block_hash", + "value", + "from", + "to", + "nonce", + "gas_price", + "data" + ], + "properties": { + "address": { + "type": "string" + }, + "block_hash": { + "type": "string" + }, + "block_number": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "block_time": { + "type": "string" + }, + "chain_id": { + "type": "integer", + "format": "int64" + }, + "data": { + "type": "string", + "format": "binary" + }, + "effective_gas_price": { + "type": "string" + }, + "from": { + "type": "string" + }, + "gas_price": { + "type": "string" + }, + "gas_used": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "index": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "nonce": { + "type": "string" + }, + "success": { + "type": "boolean", + "nullable": true + }, + "to": { + "type": "string" + }, + "transaction_type": { + "allOf": [ + { + "$ref": "#/components/schemas/TransactionType" + } + ], + "nullable": true + }, + "value": { + "type": "string" + } + } + }, + "TransactionType": { + "type": "string", + "enum": [ + "Sender", + "Receiver" + ] + }, + "TransactionsResponse": { + "type": "object", + "required": [ + "transactions" + ], + "properties": { + "next_offset": { + "type": "string" + }, + "transactions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ResponseTransaction" + } + }, + "warnings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Warning" + }, + "nullable": true + } + } + }, + "TransactionsSvmResponse": { + "type": "object", + "required": [ + "transactions" + ], + "properties": { + "next_offset": { + "type": "string" + }, + "transactions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Transaction" + } + } + } + }, + "UpdateAddresses": { + "type": "object", + "properties": { + "add_addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "remove_addresses": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "UpdateWebhook": { + "type": "object", + "required": [ + "counterparty", + "token_address" + ], + "properties": { + "active": { + "type": "boolean", + "nullable": true + }, + "activity_type": { + "allOf": [ + { + "$ref": "#/components/schemas/ActivityType" + } + ], + "nullable": true + }, + "asset_type": { + "allOf": [ + { + "$ref": "#/components/schemas/AssetType" + } + ], + "nullable": true + }, + "chain_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "nullable": true + }, + "counterparty": { + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + }, + "token_address": { + "type": "string" + }, + "transaction_type": { + "allOf": [ + { + "$ref": "#/components/schemas/TransactionType" + } + ], + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Warning": { + "type": "object", + "description": "Warning that can be included in API responses", + "required": [ + "code", + "message" + ], + "properties": { + "chain_ids": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChainId" + }, + "nullable": true + }, + "code": { + "$ref": "#/components/schemas/WarningCode" + }, + "docs_url": { + "type": "string", + "nullable": true + }, + "message": { + "type": "string" + } + } + }, + "WarningCode": { + "type": "string", + "description": "Warning code enum for different types of warnings", + "enum": [ + "UNSUPPORTED_CHAIN_IDS" + ] + }, + "Webhook": { + "type": "object", + "required": [ + "id", + "team_id", + "name", + "type", + "url", + "active", + "created_at", + "updated_at" + ], + "properties": { + "active": { + "type": "boolean" + }, + "activity_type": { + "allOf": [ + { + "$ref": "#/components/schemas/ActivityType" + } + ], + "nullable": true + }, + "asset_type": { + "allOf": [ + { + "$ref": "#/components/schemas/AssetType" + } + ], + "nullable": true + }, + "chain_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "nullable": true + }, + "counterparty": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "team_id": { + "type": "string" + }, + "token_address": { + "type": "string" + }, + "transaction_type": { + "allOf": [ + { + "$ref": "#/components/schemas/TransactionType" + } + ], + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/WebhookType" + }, + "updated_at": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "WebhookType": { + "type": "string", + "enum": [ + "transactions", + "activities", + "balances" + ] + }, + "Webhooks": { + "type": "object", + "required": [ + "webhooks" + ], + "properties": { + "next_offset": { + "type": "string" + }, + "webhooks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Webhook" + } + } + } + } + } + }, + "tags": [ + { + "name": "balance", + "description": "Balances API" + }, + { + "name": "transactions", + "description": "Transactions API" + }, + { + "name": "leaderboard", + "description": "Leaderboard API" + }, + { + "name": "defi-positions", + "description": "DeFi Positions API" + }, + { + "name": "collectibles", + "description": "Collectibles API" + }, + { + "name": "webhooks", + "description": "Webhooks API" + }, + { + "name": "worker", + "description": "Worker API" + } + ] +} \ No newline at end of file