diff --git a/packages/api/src/schema/zod/schemas/eventSchemas.ts b/packages/api/src/schema/zod/schemas/eventSchemas.ts index 0b9984a4..c32c454e 100644 --- a/packages/api/src/schema/zod/schemas/eventSchemas.ts +++ b/packages/api/src/schema/zod/schemas/eventSchemas.ts @@ -10,7 +10,7 @@ const isoRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/ const yyyymmddRegex = /^\d{4}-\d{2}-\d{2}$/ // Reusable refinement functions -const refineWithEthValueRequiresTokenData = (schema: z.ZodTypeAny) => +export const refineWithEthValueRequiresTokenData = (schema: z.ZodTypeAny) => schema.refine( (data) => { if (data.withEthValue && !data.withTokenData) { @@ -24,7 +24,7 @@ const refineWithEthValueRequiresTokenData = (schema: z.ZodTypeAny) => } ) -const refineStartEndDates = (schema: z.ZodTypeAny) => +export const refineStartEndDates = (schema: z.ZodTypeAny) => schema .refine( (data) => { @@ -55,7 +55,7 @@ const refineStartEndDates = (schema: z.ZodTypeAny) => } ) -const refineDelegationTypeRestrictions = (schema: z.ZodTypeAny) => +export const refineDelegationTypeRestrictions = (schema: z.ZodTypeAny) => schema.refine( (data) => { if (data.type === 'DELEGATION' || data.type === 'UNDELEGATION') { @@ -72,7 +72,7 @@ const refineDelegationTypeRestrictions = (schema: z.ZodTypeAny) => } ) -const refineWithdrawalTypeRestrictions = (schema: z.ZodTypeAny) => +export const refineWithdrawalTypeRestrictions = (schema: z.ZodTypeAny) => schema.refine( (data) => { if (data.type === 'WITHDRAWAL_COMPLETED') { @@ -90,7 +90,7 @@ const refineWithdrawalTypeRestrictions = (schema: z.ZodTypeAny) => ) // Base schema for shared fields -const BaseEventQuerySchema = z.object({ +export const BaseEventQuerySchema = z.object({ txHash: z .string() .regex(/^0x([A-Fa-f0-9]{64})$/, 'Invalid transaction hash') @@ -107,7 +107,6 @@ const BaseEventQuerySchema = z.object({ message: 'Invalid date format for startAt. Use YYYY-MM-DD or ISO 8601 format.' } ) - .default('') .describe('Start date in ISO string format'), endAt: z .string() @@ -120,11 +119,10 @@ const BaseEventQuerySchema = z.object({ message: 'Invalid date format for endAt. Use YYYY-MM-DD or ISO 8601 format.' } ) - .default('') .describe('End date in ISO string format') }) -const WithdrawalEventQuerySchemaBase = BaseEventQuerySchema.extend({ +export const WithdrawalEventQuerySchemaBase = BaseEventQuerySchema.extend({ type: z .enum(['WITHDRAWAL_QUEUED', 'WITHDRAWAL_COMPLETED']) .optional() @@ -152,7 +150,7 @@ export const WithdrawalEventQuerySchema = refineWithdrawalTypeRestrictions( refineWithEthValueRequiresTokenData(refineStartEndDates(WithdrawalEventQuerySchemaBase)) ) -const DepositEventQuerySchemaBase = BaseEventQuerySchema.extend({ +export const DepositEventQuerySchemaBase = BaseEventQuerySchema.extend({ tokenAddress: z .string() .regex(/^0x[a-fA-F0-9]{40}$/, 'Invalid token address') @@ -171,9 +169,9 @@ export const DepositEventQuerySchema = refineWithEthValueRequiresTokenData( refineStartEndDates(DepositEventQuerySchemaBase) ) -const DelegationEventQuerySchemaBase = BaseEventQuerySchema.extend({ +export const DelegationEventQuerySchemaBase = BaseEventQuerySchema.extend({ type: z - .enum(['SHARES_INCREASED', 'SHARES_DECREASED', 'DELEGATION', 'UNDELEGATION']) + .enum(['DELEGATION', 'UNDELEGATION', 'SHARES_INCREASED', 'SHARES_DECREASED']) .optional() .describe('The type of the delegation event'), strategyAddress: z @@ -182,42 +180,44 @@ const DelegationEventQuerySchemaBase = BaseEventQuerySchema.extend({ .optional() .describe('The contract address of the restaking strategy') }) - .merge(WithTokenDataQuerySchema) - .merge(WithEthValueQuerySchema) export const DelegationEventQuerySchema = refineDelegationTypeRestrictions( - refineWithEthValueRequiresTokenData(refineStartEndDates(DelegationEventQuerySchemaBase)) -) - -export const OperatorDelegationEventQuerySchema = refineDelegationTypeRestrictions( refineWithEthValueRequiresTokenData( refineStartEndDates( - DelegationEventQuerySchemaBase.extend({ - stakerAddress: z - .string() - .regex(/^0x[a-fA-F0-9]{40}$/, 'Invalid Ethereum address') - .optional() - .describe('The address of the staker') - }) + DelegationEventQuerySchemaBase.merge(WithTokenDataQuerySchema).merge(WithEthValueQuerySchema) ) ) ) +export const OperatorDelegationEventQuerySchemaBase = DelegationEventQuerySchemaBase.extend({ + stakerAddress: z + .string() + .regex(/^0x[a-fA-F0-9]{40}$/, 'Invalid Ethereum address') + .optional() + .describe('The address of the staker') +}) + .merge(WithTokenDataQuerySchema) + .merge(WithEthValueQuerySchema) + +export const OperatorDelegationEventQuerySchema = refineDelegationTypeRestrictions( + refineWithEthValueRequiresTokenData(refineStartEndDates(OperatorDelegationEventQuerySchemaBase)) +) + +export const StakerDelegationEventQuerySchemaBase = DelegationEventQuerySchemaBase.extend({ + operatorAddress: z + .string() + .regex(/^0x[a-fA-F0-9]{40}$/, 'Invalid Ethereum address') + .optional() + .describe('The address of the operator') +}) + .merge(WithTokenDataQuerySchema) + .merge(WithEthValueQuerySchema) + export const StakerDelegationEventQuerySchema = refineDelegationTypeRestrictions( - refineWithEthValueRequiresTokenData( - refineStartEndDates( - DelegationEventQuerySchemaBase.extend({ - operatorAddress: z - .string() - .regex(/^0x[a-fA-F0-9]{40}$/, 'Invalid Ethereum address') - .optional() - .describe('The address of the operator') - }) - ) - ) + refineWithEthValueRequiresTokenData(refineStartEndDates(StakerDelegationEventQuerySchemaBase)) ) -const RewardsEventQuerySchemaBase = BaseEventQuerySchema.extend({ +export const RewardsEventQuerySchemaBase = BaseEventQuerySchema.extend({ rewardsSubmissionHash: z .string() .regex(/^0x([A-Fa-f0-9]{64})$/, 'Invalid reward submission hash') @@ -234,28 +234,32 @@ const RewardsEventQuerySchemaBase = BaseEventQuerySchema.extend({ export const RewardsEventQuerySchema = refineStartEndDates(RewardsEventQuerySchemaBase) -const RegistrationEventQuerySchemaBase = BaseEventQuerySchema.extend({ +export const RegistrationEventQuerySchemaBase = BaseEventQuerySchema.extend({ status: z.enum(['REGISTERED', 'DEREGISTERED']).optional().describe('The status of Registration') }) export const RegistrationEventQuerySchema = refineStartEndDates(RegistrationEventQuerySchemaBase) +export const OperatorRegistrationEventQuerySchemaBase = RegistrationEventQuerySchemaBase.extend({ + avsAddress: z + .string() + .regex(/^0x[a-fA-F0-9]{40}$/, 'Invalid Ethereum address') + .optional() + .describe('The address of the avs') +}) + export const OperatorRegistrationEventQuerySchema = refineStartEndDates( - RegistrationEventQuerySchemaBase.extend({ - avsAddress: z - .string() - .regex(/^0x[a-fA-F0-9]{40}$/, 'Invalid Ethereum address') - .optional() - .describe('The address of the avs') - }) + OperatorRegistrationEventQuerySchemaBase ) +export const AvsRegistrationEventQuerySchemaBase = RegistrationEventQuerySchemaBase.extend({ + operatorAddress: z + .string() + .regex(/^0x[a-fA-F0-9]{40}$/, 'Invalid Ethereum address') + .optional() + .describe('The address of the operator') +}) + export const AvsRegistrationEventQuerySchema = refineStartEndDates( - RegistrationEventQuerySchemaBase.extend({ - operatorAddress: z - .string() - .regex(/^0x[a-fA-F0-9]{40}$/, 'Invalid Ethereum address') - .optional() - .describe('The address of the operator') - }) + AvsRegistrationEventQuerySchemaBase ) diff --git a/packages/openapi/openapi.json b/packages/openapi/openapi.json index ea1b2eef..52a683d1 100644 --- a/packages/openapi/openapi.json +++ b/packages/openapi/openapi.json @@ -4669,77 +4669,95 @@ } } }, - "/operators": { + "/avs/{address}/events/rewards": { "get": { - "operationId": "getAllOperators", - "summary": "Retrieve all operators", - "description": "Returns all operator records. This endpoint supports pagination.", - "tags": ["Operators"], + "operationId": "getAvsRewardsEvents", + "summary": "Retrieve all reward events for a given AVS address", + "description": "Returns a list of all reward events for a given AVS address.", + "tags": ["AVS"], "parameters": [ + { + "in": "path", + "name": "address", + "description": "AVS service manager contract address", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "AVS service manager contract address", + "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" + }, + "required": true + }, { "in": "query", - "name": "withTvl", - "description": "Toggle whether the route should calculate the TVL from shares", + "name": "txHash", + "description": "The transaction hash associated with the event", "schema": { "type": "string", - "enum": ["true", "false"], - "default": "false", - "description": "Toggle whether the route should calculate the TVL from shares", - "example": "false" + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The transaction hash associated with the event" } }, { "in": "query", - "name": "searchByText", - "description": "Case-insensitive search query", + "name": "startAt", + "description": "Start date in ISO string format", "schema": { "type": "string", - "description": "Case-insensitive search query", - "example": "eigen" + "description": "Start date in ISO string format" } }, { "in": "query", - "name": "sortByApy", - "description": "Sort results in asc or desc order of APY", + "name": "endAt", + "description": "End date in ISO string format", "schema": { "type": "string", - "enum": ["asc", "desc"], - "description": "Sort results in asc or desc order of APY", - "example": "desc" + "description": "End date in ISO string format" } }, { "in": "query", - "name": "sortByTvl", - "description": "Sort results in asc or desc order of TVL value", + "name": "rewardsSubmissionHash", + "description": "The reward submission hash associated with the event", "schema": { "type": "string", - "enum": ["asc", "desc"], - "description": "Sort results in asc or desc order of TVL value", - "example": "desc" + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The reward submission hash associated with the event" } }, { "in": "query", - "name": "sortByTotalAvs", - "description": "Sort results in asc or desc order of total AVS (only valid for Operator queries)", + "name": "rewardsSubmissionToken", + "description": "The token address used for the rewards submission", "schema": { "type": "string", - "enum": ["asc", "desc"], - "description": "Sort results in asc or desc order of total AVS (only valid for Operator queries)", - "example": "desc" + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The token address used for the rewards submission" } }, { "in": "query", - "name": "sortByTotalStakers", - "description": "Sort results in asc or desc order of total stakers", + "name": "withIndividualAmount", + "description": "Toggle whether the route should return individual share amount for each strategy", "schema": { "type": "string", - "enum": ["asc", "desc"], - "description": "Sort results in asc or desc order of total stakers", - "example": "desc" + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return individual share amount for each strategy", + "example": "false" + } + }, + { + "in": "query", + "name": "withEthValue", + "description": "Toggle whether the route should return value denominated in ETH", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return value denominated in ETH", + "example": "false" } }, { @@ -4767,284 +4785,114 @@ ], "responses": { "200": { - "description": "The list of operator records.", + "description": "The reward events found for the AVS.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "address": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the AVS operator", - "example": "0x09e6eb09213bdd3698bd8afb43ec3cb0ecff683a" - }, - "metadataName": { - "type": "string", - "description": "The name of the AVS operator", - "example": "Example AVS Operator" - }, - "metadataDescription": { - "type": "string", - "nullable": true, - "description": "The description of the AVS operator", - "example": "This is an example AVS operator" - }, - "metadataDiscord": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS operator's Discord server", - "example": "https://discord.com/invite/abcdefghij" - }, - "metadataLogo": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS operator's logo" - }, - "metadataTelegram": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS operator's Telegram channel", - "example": "https://t.me/acme" - }, - "metadataWebsite": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS operator's website", - "example": "https://acme.com" - }, - "metadataX": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS operator's X", - "example": "https://twitter.com/acme" - }, - "totalStakers": { - "type": "number", - "description": "The total number of stakers who have delegated to this AVS operator", - "example": 10 - }, - "totalAvs": { - "type": "number", - "description": "The total number of AVS opted by the AVS operator", - "example": 10 - }, - "apy": { - "type": "string", - "description": "The latest APY recorded for the operator", - "example": "1.0" - }, - "createdAtBlock": { - "type": "string", - "description": "The block number at which the AVS Operator was registered", - "example": "19631203" - }, - "updatedAtBlock": { - "type": "string", - "description": "The block number at which the AVS Operator registration was last updated", - "example": "19631203" - }, - "createdAt": { - "type": "string", - "description": "The time stamp at which the AVS Operator was registered", - "example": "2024-04-11T08:31:11.000Z" - }, - "updatedAt": { - "type": "string", - "description": "The time stamp at which the AVS Operator registration was last updated", - "example": "2024-04-11T08:31:11.000Z" - }, - "shares": { - "type": "array", - "items": { - "type": "object", - "properties": { - "strategyAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the restaking strategy", - "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" - }, - "shares": { - "type": "string", - "description": "The amount of shares held in the strategy", - "example": "1277920000000000000000000" - } - }, - "required": ["strategyAddress", "shares"] - }, - "description": "The strategy shares held in the AVS operator", - "example": [ - { - "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", - "shares": "135064894598947935263152" + "tx": { + "type": "string", + "description": "The transaction hash", + "example": "0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0" + }, + "blockNumber": { + "type": "number", + "description": "The block number of the transaction", + "example": 21045085 + }, + "blockTime": { + "type": "string", + "description": "The block time of the transaction as an ISO 8601 string", + "example": "2024-10-25T20:41:11.000Z" + }, + "type": { + "type": "string", + "enum": ["REWARDS"], + "description": "The type of the event", + "example": "REWARDS" + }, + "args": { + "type": "object", + "properties": { + "submissionNonce": { + "type": "number", + "description": "The nonce of the rewards submission", + "example": 2 + }, + "rewardsSubmissionHash": { + "type": "string", + "description": "The hash of the rewards submission", + "example": "0x1e391c015c923972811a27e1c6c3a874511e47033f1022021f29967a60ab2c87" + }, + "rewardsSubmissionToken": { + "type": "string", + "description": "The contract address of the token used for rewards distribution", + "example": "0xba50933c268f567bdc86e1ac131be072c6b0b71a" + }, + "rewardsSubmissionAmount": { + "type": "string", + "description": "The total amount of rewards allocated in this submission", + "example": "49000000000000000000000" + }, + "rewardsSubmissionStartTimeStamp": { + "type": "number", + "description": "The timestamp marking the start of this rewards distribution period", + "example": 1728518400 + }, + "rewardsSubmissionDuration": { + "type": "number", + "description": "The duration (in seconds) over which the rewards are distributed", + "example": 6048000 + }, + "strategies": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategy": { + "type": "string", + "description": "The contract address of the restaking strategy", + "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" }, - { - "strategyAddress": "0x54945180db7943c0ed0fee7edab2bd24620256bc", - "shares": "9323641881708650182301" - } - ] - }, - "avsRegistrations": { - "type": "array", - "items": { - "type": "object", - "properties": { - "avsAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "AVS service manager contract address", - "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" - }, - "isActive": { - "type": "boolean", - "description": "True indicates operator is an active participant while False indicates it used to be one but not anymore", - "example": false - } + "multiplier": { + "type": "string", + "description": "The multiplier associated with this strategy", + "example": "1068966896363604679" }, - "required": ["avsAddress", "isActive"] - }, - "description": "Operator AVS registrations and their participation status", - "example": [ - { - "avsAddress": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0", - "isActive": true + "amount": { + "type": "string", + "description": "The amount of rewards allocated to this strategy from the total rewards in this submissionn", + "example": "3.7932452554246293e+21" }, - { - "avsAddress": "0xe8e59c6c8b56f2c178f63bcfc4ce5e5e2359c8fc", - "isActive": false + "amountEthValue": { + "type": "number", + "description": "The value of the rewards amount allocated to this strategy in ETH", + "example": 0.0638779707245759 } - ] + }, + "required": ["strategy", "multiplier"] }, - "tvl": { - "type": "object", - "properties": { - "tvl": { - "type": "number", - "description": "The combined TVL of all restaking strategies in ETH", - "example": 1000000 - }, - "tvlBeaconChain": { - "type": "number", - "description": "The TVL of Beacon Chain restaking strategy in ETH", - "example": 1000000 - }, - "tvlRestaking": { - "type": "number", - "description": "The combined TVL of all liquid restaking strategies in ETH", - "example": 1000000 - }, - "tvlWETH": { - "type": "number", - "description": "The TVL of WETH restaking strategy in ETH", - "example": 1000000 - }, - "tvlStrategies": { - "type": "object", - "additionalProperties": { - "type": "number", - "description": "The total value locked (TVL) in the strategy, denominated in the strategy's native token", - "example": 1000000 - }, - "description": "The TVL of each individual restaking strategy in its native token", - "example": { - "Eigen": 1000000, - "cbETH": 2000000 - } - }, - "tvlStrategiesEth": { - "type": "object", - "additionalProperties": { - "type": "number", - "description": "The total value locked (TVL) in the strategy, denominated in ETH", - "example": 1000000 - }, - "description": "The TVL of each individual restaking strategy in ETH", - "example": { - "Eigen": 1000000, - "cbETH": 2000000 - } - } - }, - "required": [ - "tvl", - "tvlBeaconChain", - "tvlRestaking", - "tvlWETH", - "tvlStrategies", - "tvlStrategiesEth" - ], - "description": "The total value locked (TVL) in the AVS operator", - "example": { - "tvl": 1000000, - "tvlBeaconChain": 1000000, - "tvlWETH": 1000000, - "tvlRestaking": 1000000, - "tvlStrategies": { - "Eigen": 1000000, - "cbETH": 2000000 - }, - "tvlStrategiesEth": { - "stETH": 1000000, - "cbETH": 2000000 - } - } - } - }, - "required": [ - "address", - "metadataName", - "metadataDescription", - "metadataDiscord", - "metadataLogo", - "metadataTelegram", - "metadataWebsite", - "metadataX", - "totalStakers", - "totalAvs", - "apy", - "createdAtBlock", - "updatedAtBlock", - "createdAt", - "updatedAt", - "shares", - "avsRegistrations" - ] - } - }, - "meta": { - "type": "object", - "properties": { - "total": { - "type": "number", - "description": "Total number of records in the database", - "example": 30 - }, - "skip": { - "type": "number", - "description": "The number of skiped records for this query", - "example": 0 - }, - "take": { - "type": "number", - "description": "The number of records returned for this query", - "example": 12 + "description": "List of strategies involved in the rewards submission" } }, - "required": ["total", "skip", "take"] + "required": [ + "submissionNonce", + "rewardsSubmissionHash", + "rewardsSubmissionToken", + "rewardsSubmissionAmount", + "rewardsSubmissionStartTimeStamp", + "rewardsSubmissionDuration", + "strategies" + ] + }, + "ethValue": { + "type": "number", + "description": "The value of the shares in ETH", + "example": 1 } }, - "required": ["data", "meta"] + "required": ["tx", "blockNumber", "blockTime", "type", "args"] } } } @@ -5073,33 +4921,71 @@ } } }, - "/operators/addresses": { + "/avs/{address}/events/registration-status": { "get": { - "operationId": "getAllOperatorAddresses", - "summary": "Retrieve all operator addresses", - "description": "Returns a list of all operator addresses. This page supports pagination.", - "tags": ["Operators"], + "operationId": "getAvsRegistrationEvents", + "summary": "Retrieve all registration events for a given AVS address", + "description": "Returns a list of all registration events for a given AVS address.", + "tags": ["AVS"], "parameters": [ + { + "in": "path", + "name": "address", + "description": "AVS service manager contract address", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "AVS service manager contract address", + "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" + }, + "required": true + }, { "in": "query", - "name": "searchMode", - "description": "Search mode", + "name": "txHash", + "description": "The transaction hash associated with the event", "schema": { "type": "string", - "enum": ["contains", "startsWith"], - "default": "contains", - "description": "Search mode", - "example": "contains" + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The transaction hash associated with the event" } }, { "in": "query", - "name": "searchByText", - "description": "Case-insensitive search query", + "name": "startAt", + "description": "Start date in ISO string format", "schema": { "type": "string", - "description": "Case-insensitive search query", - "example": "eigen" + "description": "Start date in ISO string format" + } + }, + { + "in": "query", + "name": "endAt", + "description": "End date in ISO string format", + "schema": { + "type": "string", + "description": "End date in ISO string format" + } + }, + { + "in": "query", + "name": "status", + "description": "The status of Registration", + "schema": { + "type": "string", + "enum": ["REGISTERED", "DEREGISTERED"], + "description": "The status of Registration" + } + }, + { + "in": "query", + "name": "operatorAddress", + "description": "The address of the operator", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the operator" } }, { @@ -5127,60 +5013,52 @@ ], "responses": { "200": { - "description": "The list of operator addresses.", + "description": "The registration events found for the AVS.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "address": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the AVS operator", - "example": "0x0000039b2f2ac9e3492a0f805ec7aea9eaee0c25" - }, - "name": { - "type": "string", - "description": "The Operator's name", - "example": "Example Operator" - }, - "logo": { - "type": "string", - "description": "The Operator's logo URL", - "example": "https://example.operator/logo.png" - } - }, - "required": ["address", "name", "logo"] - } + "tx": { + "type": "string", + "description": "The transaction hash", + "example": "0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0" }, - "meta": { + "blockNumber": { + "type": "number", + "description": "The block number of the transaction", + "example": 21045085 + }, + "blockTime": { + "type": "string", + "description": "The block time of the transaction as an ISO 8601 string", + "example": "2024-10-25T20:41:11.000Z" + }, + "type": { + "type": "string", + "enum": ["REGISTRATION_STATUS"], + "description": "The type of the event", + "example": "REGISTRATION_STATUS" + }, + "args": { "type": "object", "properties": { - "total": { - "type": "number", - "description": "Total number of records in the database", - "example": 30 - }, - "skip": { - "type": "number", - "description": "The number of skiped records for this query", - "example": 0 + "operator": { + "type": "string", + "description": "The contract address of the AVS operator", + "example": "0x9abce41e1486210ad83deb831afcdd214af5b49d" }, - "take": { - "type": "number", - "description": "The number of records returned for this query", - "example": 12 + "status": { + "type": "string", + "enum": ["REGISTERED", "DEREGISTERED"], + "description": "The status of the registration", + "example": "REGISTERED" } }, - "required": ["total", "skip", "take"] + "required": ["operator", "status"] } }, - "required": ["data", "meta"] + "required": ["tx", "blockNumber", "blockTime", "type", "args"] } } } @@ -5209,25 +5087,13 @@ } } }, - "/operators/{address}": { + "/operators": { "get": { - "operationId": "getOperatorByAddress", - "summary": "Retrieve an operator by address", - "description": "Returns an operator record by address.", + "operationId": "getAllOperators", + "summary": "Retrieve all operators", + "description": "Returns all operator records. This endpoint supports pagination.", "tags": ["Operators"], "parameters": [ - { - "in": "path", - "name": "address", - "description": "The address of the operator", - "schema": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The address of the operator", - "example": "0x00107cfdeaddc0a3160ed2f6fedd627f313e7b1a" - }, - "required": true - }, { "in": "query", "name": "withTvl", @@ -5242,453 +5108,212 @@ }, { "in": "query", - "name": "withAvsData", - "description": "Toggle whether to return additional data for each AVS registration for a given Operator", + "name": "searchByText", + "description": "Case-insensitive search query", "schema": { "type": "string", - "enum": ["true", "false"], - "default": "false", - "description": "Toggle whether to return additional data for each AVS registration for a given Operator", - "example": "false" + "description": "Case-insensitive search query", + "example": "eigen" } }, { "in": "query", - "name": "withRewards", - "description": "Toggle whether the route should return Avs/Operator rewards APY data", + "name": "sortByApy", + "description": "Sort results in asc or desc order of APY", "schema": { "type": "string", - "enum": ["true", "false"], - "default": "false", - "description": "Toggle whether the route should return Avs/Operator rewards APY data", - "example": "false" + "enum": ["asc", "desc"], + "description": "Sort results in asc or desc order of APY", + "example": "desc" } - } + }, + { + "in": "query", + "name": "sortByTvl", + "description": "Sort results in asc or desc order of TVL value", + "schema": { + "type": "string", + "enum": ["asc", "desc"], + "description": "Sort results in asc or desc order of TVL value", + "example": "desc" + } + }, + { + "in": "query", + "name": "sortByTotalAvs", + "description": "Sort results in asc or desc order of total AVS (only valid for Operator queries)", + "schema": { + "type": "string", + "enum": ["asc", "desc"], + "description": "Sort results in asc or desc order of total AVS (only valid for Operator queries)", + "example": "desc" + } + }, + { + "in": "query", + "name": "sortByTotalStakers", + "description": "Sort results in asc or desc order of total stakers", + "schema": { + "type": "string", + "enum": ["asc", "desc"], + "description": "Sort results in asc or desc order of total stakers", + "example": "desc" + } + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + } ], "responses": { "200": { - "description": "The record of the requested operator.", + "description": "The list of operator records.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "address": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the AVS operator", - "example": "0x09e6eb09213bdd3698bd8afb43ec3cb0ecff683a" - }, - "metadataName": { - "type": "string", - "description": "The name of the AVS operator", - "example": "Example AVS Operator" - }, - "metadataDescription": { - "type": "string", - "nullable": true, - "description": "The description of the AVS operator", - "example": "This is an example AVS operator" - }, - "metadataDiscord": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS operator's Discord server", - "example": "https://discord.com/invite/abcdefghij" - }, - "metadataLogo": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS operator's logo" - }, - "metadataTelegram": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS operator's Telegram channel", - "example": "https://t.me/acme" - }, - "metadataWebsite": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS operator's website", - "example": "https://acme.com" - }, - "metadataX": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS operator's X", - "example": "https://twitter.com/acme" - }, - "totalStakers": { - "type": "number", - "description": "The total number of stakers who have delegated to this AVS operator", - "example": 10 - }, - "totalAvs": { - "type": "number", - "description": "The total number of AVS opted by the AVS operator", - "example": 10 - }, - "apy": { - "type": "string", - "description": "The latest APY recorded for the operator", - "example": "1.0" - }, - "createdAtBlock": { - "type": "string", - "description": "The block number at which the AVS Operator was registered", - "example": "19631203" - }, - "updatedAtBlock": { - "type": "string", - "description": "The block number at which the AVS Operator registration was last updated", - "example": "19631203" - }, - "createdAt": { - "type": "string", - "description": "The time stamp at which the AVS Operator was registered", - "example": "2024-04-11T08:31:11.000Z" - }, - "updatedAt": { - "type": "string", - "description": "The time stamp at which the AVS Operator registration was last updated", - "example": "2024-04-11T08:31:11.000Z" - }, - "shares": { - "type": "array", - "items": { - "type": "object", - "properties": { - "strategyAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the restaking strategy", - "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" - }, - "shares": { - "type": "string", - "description": "The amount of shares held in the strategy", - "example": "1277920000000000000000000" - } - }, - "required": ["strategyAddress", "shares"] - }, - "description": "The strategy shares held in the AVS operator", - "example": [ - { - "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", - "shares": "135064894598947935263152" - }, - { - "strategyAddress": "0x54945180db7943c0ed0fee7edab2bd24620256bc", - "shares": "9323641881708650182301" - } - ] - }, - "avsRegistrations": { + "data": { "type": "array", "items": { "type": "object", "properties": { - "avsAddress": { + "address": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The address of the AVS contract", - "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" - }, - "isActive": { - "type": "boolean", - "description": "True indicates operator is an active participant while False indicates it used to be one but not anymore", - "example": false + "description": "The contract address of the AVS operator", + "example": "0x09e6eb09213bdd3698bd8afb43ec3cb0ecff683a" }, "metadataName": { "type": "string", - "description": "The name of the AVS", - "example": "Example AVS" + "description": "The name of the AVS operator", + "example": "Example AVS Operator" }, "metadataDescription": { "type": "string", "nullable": true, - "description": "The description of the AVS", - "example": "This is an example AVS" + "description": "The description of the AVS operator", + "example": "This is an example AVS operator" }, "metadataDiscord": { "type": "string", "nullable": true, "format": "uri", - "description": "The URL of the AVS's Discord server", + "description": "The URL of the AVS operator's Discord server", "example": "https://discord.com/invite/abcdefghij" }, "metadataLogo": { "type": "string", "nullable": true, "format": "uri", - "description": "The URL of the AVS's logo" + "description": "The URL of the AVS operator's logo" }, "metadataTelegram": { "type": "string", "nullable": true, "format": "uri", - "description": "The URL of the AVS's Telegram channel", + "description": "The URL of the AVS operator's Telegram channel", "example": "https://t.me/acme" }, "metadataWebsite": { "type": "string", "nullable": true, "format": "uri", - "description": "The URL of the AVS's website", + "description": "The URL of the AVS operator's website", "example": "https://acme.com" }, "metadataX": { "type": "string", "nullable": true, "format": "uri", - "description": "The URL of the AVS's X", + "description": "The URL of the AVS operator's X", "example": "https://twitter.com/acme" }, - "metadataUrl": { + "totalStakers": { + "type": "number", + "description": "The total number of stakers who have delegated to this AVS operator", + "example": 10 + }, + "totalAvs": { + "type": "number", + "description": "The total number of AVS opted by the AVS operator", + "example": 10 + }, + "apy": { "type": "string", - "description": "URL for AVS metadata", - "example": "https://example.json" - }, - "curatedMetadata": { - "type": "object", - "properties": { - "metadataName": { - "type": "string", - "description": "The name of the AVS", - "example": "Example AVS" - }, - "metadataDescription": { - "type": "string", - "nullable": true, - "description": "The description of the AVS", - "example": "This is an example AVS" - }, - "metadataDiscord": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS's Discord server", - "example": "https://discord.com/invite/abcdefghij" - }, - "metadataLogo": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS's logo" - }, - "metadataTelegram": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS's Telegram channel", - "example": "https://t.me/acme" - }, - "metadataWebsite": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS's website", - "example": "https://acme.com" - }, - "metadataX": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS's X", - "example": "https://twitter.com/acme" - }, - "metadataGithub": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The URL of the AVS's Github", - "example": "https://github.com/acme" - }, - "metadataTokenAddress": { - "type": "string", - "nullable": true, - "format": "uri", - "description": "The Token Address of the AVS", - "example": "0x2344c0fe02ccd2b32155ca0ffcb1978a6d96a552" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Tags to describe the AVS", - "example": ["Example tag 1", "Example tag 2"] - }, - "isVisible": { - "type": "boolean", - "description": "Indicates if AVS visibility is allowed", - "example": false - }, - "isVerified": { - "type": "boolean", - "description": "Indicates if the AVS has been verified by the EigenExplorer team", - "example": false - } - }, - "required": [ - "metadataName", - "metadataDescription", - "metadataDiscord", - "metadataLogo", - "metadataTelegram", - "metadataWebsite", - "metadataX", - "metadataGithub", - "metadataTokenAddress", - "tags", - "isVisible", - "isVerified" - ], - "description": "Curated metadata information for AVS" - }, - "restakeableStrategies": { - "type": "array", - "items": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$" - }, - "description": "The list of restakeable strategies for AVS" - }, - "totalStakers": { - "type": "number", - "description": "Total number of stakers", - "example": 80000 - }, - "totalOperators": { - "type": "number", - "description": "Total number of operators", - "example": 200 - }, - "tvlEth": { - "type": "string", - "description": "Total TVL in ETH", - "example": "3000000" + "description": "The latest APY recorded for the operator", + "example": "1.0" }, "createdAtBlock": { - "type": "number", - "description": "The block number at which the AVS was created", - "example": 19592323 + "type": "string", + "description": "The block number at which the AVS Operator was registered", + "example": "19631203" }, "updatedAtBlock": { - "type": "number", - "description": "The block number at which the AVS was last updated", - "example": 19592323 + "type": "string", + "description": "The block number at which the AVS Operator registration was last updated", + "example": "19631203" }, "createdAt": { "type": "string", - "description": "The time stamp at which the AVS was created", - "example": "2024-04-05T21:49:59.000Z" + "description": "The time stamp at which the AVS Operator was registered", + "example": "2024-04-11T08:31:11.000Z" }, "updatedAt": { "type": "string", - "description": "The time stamp at which the AVS was last updated", - "example": "2024-04-05T21:49:59.000Z" - }, - "address": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "AVS service manager contract address", - "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" + "description": "The time stamp at which the AVS Operator registration was last updated", + "example": "2024-04-11T08:31:11.000Z" }, - "rewardsSubmissions": { + "shares": { "type": "array", "items": { "type": "object", "properties": { - "id": { - "type": "number", - "description": "Id for the rewards submission", - "example": 1 - }, - "submissionNonce": { - "type": "number", - "description": "The nonce of the rewards submission", - "example": 0 - }, - "rewardsSubmissionHash": { - "type": "string", - "description": "The hash of the rewards submission", - "example": "0x2bc2f7cef0974f7064dbdae054f9a0e5ea1c2293d180a749c70100506382d85" - }, - "avsAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "AVS address for the rewards submission", - "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" - }, "strategyAddress": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "Strategy address for the rewards submission", - "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" - }, - "multiplier": { - "type": "string", - "description": "The multiplier associated with this strategy", - "example": "1000000000000000000" - }, - "token": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the token used for rewards distribution", - "example": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" - }, - "amount": { - "type": "string", - "description": "The amount of rewards allocated to this strategy from the total rewards", - "example": "300000000000000000" - }, - "startTimestamp": { - "type": "number", - "description": "The timestamp marking the start of this rewards distribution period", - "example": 1720000000 - }, - "duration": { - "type": "number", - "description": "The duration (in seconds) over which the rewards are distributed", - "example": 2500000 - }, - "createdAtBlock": { - "type": "number", - "description": "The block number at which the reward submission was recorded", - "example": 20495824 + "description": "The contract address of the restaking strategy", + "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" }, - "createdAt": { + "shares": { "type": "string", - "description": "The timestamp at which the reward submission was recorded", - "example": "2024-08-10T04:28:47.000Z" + "description": "The amount of shares held in the strategy", + "example": "1277920000000000000000000" } }, - "required": [ - "id", - "submissionNonce", - "rewardsSubmissionHash", - "avsAddress", - "strategyAddress", - "multiplier", - "token", - "amount", - "startTimestamp", - "duration", - "createdAtBlock", - "createdAt" - ] + "required": ["strategyAddress", "shares"] }, - "description": "List of rewards submissions associated with AVS" + "description": "The strategy shares held in the AVS operator", + "example": [ + { + "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", + "shares": "135064894598947935263152" + }, + { + "strategyAddress": "0x54945180db7943c0ed0fee7edab2bd24620256bc", + "shares": "9323641881708650182301" + } + ] }, - "operators": { + "avsRegistrations": { "type": "array", "items": { "type": "object", @@ -5699,60 +5324,853 @@ "description": "AVS service manager contract address", "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" }, - "operatorAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the AVS operator", - "example": "0x4cd2086e1d708e65db5d4f5712a9ca46ed4bbd0a" - }, "isActive": { "type": "boolean", "description": "True indicates operator is an active participant while False indicates it used to be one but not anymore", - "example": true - }, - "restakedStrategies": { - "type": "array", - "items": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$" - }, - "description": "List of strategies restaked by the operator", - "example": [ - "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0", - "0x93c4b944d05dfe6df7645a86cd2206016c51564d" - ] - }, - "createdAtBlock": { - "type": "number", - "description": "The block number at which the AVS Operator was registered", - "example": 19614553 - }, - "updatedAtBlock": { - "type": "number", - "description": "The block number at which the AVS Operator registration was last updated", - "example": 19614553 - }, - "createdAt": { - "type": "string", - "description": "The time stamp at which the AVS Operator was registered", - "example": "2024-04-09T00:35:35.000Z" - }, - "updatedAt": { - "type": "string", - "description": "The time stamp at which the AVS Operator registration was last updated", - "example": "2024-04-09T00:35:35.000Z" - }, - "operator": { - "type": "object", - "properties": { - "address": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the AVS operator", - "example": "0x09e6eb09213bdd3698bd8afb43ec3cb0ecff683a" - }, - "metadataUrl": { - "type": "string", + "example": false + } + }, + "required": ["avsAddress", "isActive"] + }, + "description": "Operator AVS registrations and their participation status", + "example": [ + { + "avsAddress": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0", + "isActive": true + }, + { + "avsAddress": "0xe8e59c6c8b56f2c178f63bcfc4ce5e5e2359c8fc", + "isActive": false + } + ] + }, + "tvl": { + "type": "object", + "properties": { + "tvl": { + "type": "number", + "description": "The combined TVL of all restaking strategies in ETH", + "example": 1000000 + }, + "tvlBeaconChain": { + "type": "number", + "description": "The TVL of Beacon Chain restaking strategy in ETH", + "example": 1000000 + }, + "tvlRestaking": { + "type": "number", + "description": "The combined TVL of all liquid restaking strategies in ETH", + "example": 1000000 + }, + "tvlWETH": { + "type": "number", + "description": "The TVL of WETH restaking strategy in ETH", + "example": 1000000 + }, + "tvlStrategies": { + "type": "object", + "additionalProperties": { + "type": "number", + "description": "The total value locked (TVL) in the strategy, denominated in the strategy's native token", + "example": 1000000 + }, + "description": "The TVL of each individual restaking strategy in its native token", + "example": { + "Eigen": 1000000, + "cbETH": 2000000 + } + }, + "tvlStrategiesEth": { + "type": "object", + "additionalProperties": { + "type": "number", + "description": "The total value locked (TVL) in the strategy, denominated in ETH", + "example": 1000000 + }, + "description": "The TVL of each individual restaking strategy in ETH", + "example": { + "Eigen": 1000000, + "cbETH": 2000000 + } + } + }, + "required": [ + "tvl", + "tvlBeaconChain", + "tvlRestaking", + "tvlWETH", + "tvlStrategies", + "tvlStrategiesEth" + ], + "description": "The total value locked (TVL) in the AVS operator", + "example": { + "tvl": 1000000, + "tvlBeaconChain": 1000000, + "tvlWETH": 1000000, + "tvlRestaking": 1000000, + "tvlStrategies": { + "Eigen": 1000000, + "cbETH": 2000000 + }, + "tvlStrategiesEth": { + "stETH": 1000000, + "cbETH": 2000000 + } + } + } + }, + "required": [ + "address", + "metadataName", + "metadataDescription", + "metadataDiscord", + "metadataLogo", + "metadataTelegram", + "metadataWebsite", + "metadataX", + "totalStakers", + "totalAvs", + "apy", + "createdAtBlock", + "updatedAtBlock", + "createdAt", + "updatedAt", + "shares", + "avsRegistrations" + ] + } + }, + "meta": { + "type": "object", + "properties": { + "total": { + "type": "number", + "description": "Total number of records in the database", + "example": 30 + }, + "skip": { + "type": "number", + "description": "The number of skiped records for this query", + "example": 0 + }, + "take": { + "type": "number", + "description": "The number of records returned for this query", + "example": 12 + } + }, + "required": ["total", "skip", "take"] + } + }, + "required": ["data", "meta"] + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/operators/addresses": { + "get": { + "operationId": "getAllOperatorAddresses", + "summary": "Retrieve all operator addresses", + "description": "Returns a list of all operator addresses. This page supports pagination.", + "tags": ["Operators"], + "parameters": [ + { + "in": "query", + "name": "searchMode", + "description": "Search mode", + "schema": { + "type": "string", + "enum": ["contains", "startsWith"], + "default": "contains", + "description": "Search mode", + "example": "contains" + } + }, + { + "in": "query", + "name": "searchByText", + "description": "Case-insensitive search query", + "schema": { + "type": "string", + "description": "Case-insensitive search query", + "example": "eigen" + } + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + } + ], + "responses": { + "200": { + "description": "The list of operator addresses.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the AVS operator", + "example": "0x0000039b2f2ac9e3492a0f805ec7aea9eaee0c25" + }, + "name": { + "type": "string", + "description": "The Operator's name", + "example": "Example Operator" + }, + "logo": { + "type": "string", + "description": "The Operator's logo URL", + "example": "https://example.operator/logo.png" + } + }, + "required": ["address", "name", "logo"] + } + }, + "meta": { + "type": "object", + "properties": { + "total": { + "type": "number", + "description": "Total number of records in the database", + "example": 30 + }, + "skip": { + "type": "number", + "description": "The number of skiped records for this query", + "example": 0 + }, + "take": { + "type": "number", + "description": "The number of records returned for this query", + "example": 12 + } + }, + "required": ["total", "skip", "take"] + } + }, + "required": ["data", "meta"] + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/operators/{address}": { + "get": { + "operationId": "getOperatorByAddress", + "summary": "Retrieve an operator by address", + "description": "Returns an operator record by address.", + "tags": ["Operators"], + "parameters": [ + { + "in": "path", + "name": "address", + "description": "The address of the operator", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the operator", + "example": "0x00107cfdeaddc0a3160ed2f6fedd627f313e7b1a" + }, + "required": true + }, + { + "in": "query", + "name": "withTvl", + "description": "Toggle whether the route should calculate the TVL from shares", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should calculate the TVL from shares", + "example": "false" + } + }, + { + "in": "query", + "name": "withAvsData", + "description": "Toggle whether to return additional data for each AVS registration for a given Operator", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether to return additional data for each AVS registration for a given Operator", + "example": "false" + } + }, + { + "in": "query", + "name": "withRewards", + "description": "Toggle whether the route should return Avs/Operator rewards APY data", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return Avs/Operator rewards APY data", + "example": "false" + } + } + ], + "responses": { + "200": { + "description": "The record of the requested operator.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "address": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the AVS operator", + "example": "0x09e6eb09213bdd3698bd8afb43ec3cb0ecff683a" + }, + "metadataName": { + "type": "string", + "description": "The name of the AVS operator", + "example": "Example AVS Operator" + }, + "metadataDescription": { + "type": "string", + "nullable": true, + "description": "The description of the AVS operator", + "example": "This is an example AVS operator" + }, + "metadataDiscord": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS operator's Discord server", + "example": "https://discord.com/invite/abcdefghij" + }, + "metadataLogo": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS operator's logo" + }, + "metadataTelegram": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS operator's Telegram channel", + "example": "https://t.me/acme" + }, + "metadataWebsite": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS operator's website", + "example": "https://acme.com" + }, + "metadataX": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS operator's X", + "example": "https://twitter.com/acme" + }, + "totalStakers": { + "type": "number", + "description": "The total number of stakers who have delegated to this AVS operator", + "example": 10 + }, + "totalAvs": { + "type": "number", + "description": "The total number of AVS opted by the AVS operator", + "example": 10 + }, + "apy": { + "type": "string", + "description": "The latest APY recorded for the operator", + "example": "1.0" + }, + "createdAtBlock": { + "type": "string", + "description": "The block number at which the AVS Operator was registered", + "example": "19631203" + }, + "updatedAtBlock": { + "type": "string", + "description": "The block number at which the AVS Operator registration was last updated", + "example": "19631203" + }, + "createdAt": { + "type": "string", + "description": "The time stamp at which the AVS Operator was registered", + "example": "2024-04-11T08:31:11.000Z" + }, + "updatedAt": { + "type": "string", + "description": "The time stamp at which the AVS Operator registration was last updated", + "example": "2024-04-11T08:31:11.000Z" + }, + "shares": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategyAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy", + "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" + }, + "shares": { + "type": "string", + "description": "The amount of shares held in the strategy", + "example": "1277920000000000000000000" + } + }, + "required": ["strategyAddress", "shares"] + }, + "description": "The strategy shares held in the AVS operator", + "example": [ + { + "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", + "shares": "135064894598947935263152" + }, + { + "strategyAddress": "0x54945180db7943c0ed0fee7edab2bd24620256bc", + "shares": "9323641881708650182301" + } + ] + }, + "avsRegistrations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "avsAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the AVS contract", + "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" + }, + "isActive": { + "type": "boolean", + "description": "True indicates operator is an active participant while False indicates it used to be one but not anymore", + "example": false + }, + "metadataName": { + "type": "string", + "description": "The name of the AVS", + "example": "Example AVS" + }, + "metadataDescription": { + "type": "string", + "nullable": true, + "description": "The description of the AVS", + "example": "This is an example AVS" + }, + "metadataDiscord": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS's Discord server", + "example": "https://discord.com/invite/abcdefghij" + }, + "metadataLogo": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS's logo" + }, + "metadataTelegram": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS's Telegram channel", + "example": "https://t.me/acme" + }, + "metadataWebsite": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS's website", + "example": "https://acme.com" + }, + "metadataX": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS's X", + "example": "https://twitter.com/acme" + }, + "metadataUrl": { + "type": "string", + "description": "URL for AVS metadata", + "example": "https://example.json" + }, + "curatedMetadata": { + "type": "object", + "properties": { + "metadataName": { + "type": "string", + "description": "The name of the AVS", + "example": "Example AVS" + }, + "metadataDescription": { + "type": "string", + "nullable": true, + "description": "The description of the AVS", + "example": "This is an example AVS" + }, + "metadataDiscord": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS's Discord server", + "example": "https://discord.com/invite/abcdefghij" + }, + "metadataLogo": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS's logo" + }, + "metadataTelegram": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS's Telegram channel", + "example": "https://t.me/acme" + }, + "metadataWebsite": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS's website", + "example": "https://acme.com" + }, + "metadataX": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS's X", + "example": "https://twitter.com/acme" + }, + "metadataGithub": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The URL of the AVS's Github", + "example": "https://github.com/acme" + }, + "metadataTokenAddress": { + "type": "string", + "nullable": true, + "format": "uri", + "description": "The Token Address of the AVS", + "example": "0x2344c0fe02ccd2b32155ca0ffcb1978a6d96a552" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags to describe the AVS", + "example": ["Example tag 1", "Example tag 2"] + }, + "isVisible": { + "type": "boolean", + "description": "Indicates if AVS visibility is allowed", + "example": false + }, + "isVerified": { + "type": "boolean", + "description": "Indicates if the AVS has been verified by the EigenExplorer team", + "example": false + } + }, + "required": [ + "metadataName", + "metadataDescription", + "metadataDiscord", + "metadataLogo", + "metadataTelegram", + "metadataWebsite", + "metadataX", + "metadataGithub", + "metadataTokenAddress", + "tags", + "isVisible", + "isVerified" + ], + "description": "Curated metadata information for AVS" + }, + "restakeableStrategies": { + "type": "array", + "items": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "description": "The list of restakeable strategies for AVS" + }, + "totalStakers": { + "type": "number", + "description": "Total number of stakers", + "example": 80000 + }, + "totalOperators": { + "type": "number", + "description": "Total number of operators", + "example": 200 + }, + "tvlEth": { + "type": "string", + "description": "Total TVL in ETH", + "example": "3000000" + }, + "createdAtBlock": { + "type": "number", + "description": "The block number at which the AVS was created", + "example": 19592323 + }, + "updatedAtBlock": { + "type": "number", + "description": "The block number at which the AVS was last updated", + "example": 19592323 + }, + "createdAt": { + "type": "string", + "description": "The time stamp at which the AVS was created", + "example": "2024-04-05T21:49:59.000Z" + }, + "updatedAt": { + "type": "string", + "description": "The time stamp at which the AVS was last updated", + "example": "2024-04-05T21:49:59.000Z" + }, + "address": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "AVS service manager contract address", + "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" + }, + "rewardsSubmissions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "Id for the rewards submission", + "example": 1 + }, + "submissionNonce": { + "type": "number", + "description": "The nonce of the rewards submission", + "example": 0 + }, + "rewardsSubmissionHash": { + "type": "string", + "description": "The hash of the rewards submission", + "example": "0x2bc2f7cef0974f7064dbdae054f9a0e5ea1c2293d180a749c70100506382d85" + }, + "avsAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "AVS address for the rewards submission", + "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" + }, + "strategyAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "Strategy address for the rewards submission", + "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" + }, + "multiplier": { + "type": "string", + "description": "The multiplier associated with this strategy", + "example": "1000000000000000000" + }, + "token": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the token used for rewards distribution", + "example": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" + }, + "amount": { + "type": "string", + "description": "The amount of rewards allocated to this strategy from the total rewards", + "example": "300000000000000000" + }, + "startTimestamp": { + "type": "number", + "description": "The timestamp marking the start of this rewards distribution period", + "example": 1720000000 + }, + "duration": { + "type": "number", + "description": "The duration (in seconds) over which the rewards are distributed", + "example": 2500000 + }, + "createdAtBlock": { + "type": "number", + "description": "The block number at which the reward submission was recorded", + "example": 20495824 + }, + "createdAt": { + "type": "string", + "description": "The timestamp at which the reward submission was recorded", + "example": "2024-08-10T04:28:47.000Z" + } + }, + "required": [ + "id", + "submissionNonce", + "rewardsSubmissionHash", + "avsAddress", + "strategyAddress", + "multiplier", + "token", + "amount", + "startTimestamp", + "duration", + "createdAtBlock", + "createdAt" + ] + }, + "description": "List of rewards submissions associated with AVS" + }, + "operators": { + "type": "array", + "items": { + "type": "object", + "properties": { + "avsAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "AVS service manager contract address", + "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" + }, + "operatorAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the AVS operator", + "example": "0x4cd2086e1d708e65db5d4f5712a9ca46ed4bbd0a" + }, + "isActive": { + "type": "boolean", + "description": "True indicates operator is an active participant while False indicates it used to be one but not anymore", + "example": true + }, + "restakedStrategies": { + "type": "array", + "items": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "description": "List of strategies restaked by the operator", + "example": [ + "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0", + "0x93c4b944d05dfe6df7645a86cd2206016c51564d" + ] + }, + "createdAtBlock": { + "type": "number", + "description": "The block number at which the AVS Operator was registered", + "example": 19614553 + }, + "updatedAtBlock": { + "type": "number", + "description": "The block number at which the AVS Operator registration was last updated", + "example": 19614553 + }, + "createdAt": { + "type": "string", + "description": "The time stamp at which the AVS Operator was registered", + "example": "2024-04-09T00:35:35.000Z" + }, + "updatedAt": { + "type": "string", + "description": "The time stamp at which the AVS Operator registration was last updated", + "example": "2024-04-09T00:35:35.000Z" + }, + "operator": { + "type": "object", + "properties": { + "address": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the AVS operator", + "example": "0x09e6eb09213bdd3698bd8afb43ec3cb0ecff683a" + }, + "metadataUrl": { + "type": "string", "description": "URL for operator metadata", "example": "https://raw.githubusercontent.com/github-infstones/eigenlayer/main/metadata.json" }, @@ -5899,199 +6317,1892 @@ ] } }, - "required": [ - "avsAddress", - "operatorAddress", - "isActive", - "restakedStrategies", - "createdAtBlock", - "updatedAtBlock", - "createdAt", - "updatedAt", - "operator" - ] + "required": [ + "avsAddress", + "operatorAddress", + "isActive", + "restakedStrategies", + "createdAtBlock", + "updatedAtBlock", + "createdAt", + "updatedAt", + "operator" + ] + }, + "description": "List of operators associated with the AVS registration" + } + }, + "required": [ + "avsAddress", + "isActive", + "metadataName", + "metadataDescription", + "metadataDiscord", + "metadataLogo", + "metadataTelegram", + "metadataWebsite", + "metadataX", + "metadataUrl", + "restakeableStrategies", + "totalStakers", + "totalOperators", + "tvlEth", + "createdAtBlock", + "updatedAtBlock", + "createdAt", + "updatedAt", + "address", + "rewardsSubmissions", + "operators" + ] + }, + "description": "Detailed AVS registrations information for the operator" + }, + "tvl": { + "type": "object", + "properties": { + "tvl": { + "type": "number", + "description": "The combined TVL of all restaking strategies in ETH", + "example": 1000000 + }, + "tvlBeaconChain": { + "type": "number", + "description": "The TVL of Beacon Chain restaking strategy in ETH", + "example": 1000000 + }, + "tvlRestaking": { + "type": "number", + "description": "The combined TVL of all liquid restaking strategies in ETH", + "example": 1000000 + }, + "tvlWETH": { + "type": "number", + "description": "The TVL of WETH restaking strategy in ETH", + "example": 1000000 + }, + "tvlStrategies": { + "type": "object", + "additionalProperties": { + "type": "number", + "description": "The total value locked (TVL) in the strategy, denominated in the strategy's native token", + "example": 1000000 + }, + "description": "The TVL of each individual restaking strategy in its native token", + "example": { + "Eigen": 1000000, + "cbETH": 2000000 + } + }, + "tvlStrategiesEth": { + "type": "object", + "additionalProperties": { + "type": "number", + "description": "The total value locked (TVL) in the strategy, denominated in ETH", + "example": 1000000 + }, + "description": "The TVL of each individual restaking strategy in ETH", + "example": { + "Eigen": 1000000, + "cbETH": 2000000 + } + } + }, + "required": [ + "tvl", + "tvlBeaconChain", + "tvlRestaking", + "tvlWETH", + "tvlStrategies", + "tvlStrategiesEth" + ], + "description": "The total value locked (TVL) in the AVS operator", + "example": { + "tvl": 1000000, + "tvlBeaconChain": 1000000, + "tvlWETH": 1000000, + "tvlRestaking": 1000000, + "tvlStrategies": { + "Eigen": 1000000, + "cbETH": 2000000 + }, + "tvlStrategiesEth": { + "stETH": 1000000, + "cbETH": 2000000 + } + } + }, + "rewards": { + "type": "object", + "properties": { + "avs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "avsAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "AVS service manager contract address", + "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" + }, + "apy": { + "type": "number", + "description": "Latest APY recorded for the AVS", + "example": 0.15973119826488588 + } + }, + "required": ["avsAddress", "apy"] + } + }, + "strategies": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategyAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy", + "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" + }, + "apy": { + "type": "number", + "description": "APY of the restaking strategy", + "example": 0.1 + } + }, + "required": ["strategyAddress", "apy"] + } + }, + "aggregateApy": { + "type": "number", + "description": "The aggregate APY across all strategies", + "example": 1 + }, + "operatorEarningsEth": { + "type": "string", + "description": "Total earnings for the operator in ETH", + "example": "1000000000000000000" + } + }, + "required": ["avs", "strategies", "aggregateApy", "operatorEarningsEth"], + "description": "The rewards information for the operator" + } + }, + "required": [ + "address", + "metadataName", + "metadataDescription", + "metadataDiscord", + "metadataLogo", + "metadataTelegram", + "metadataWebsite", + "metadataX", + "totalStakers", + "totalAvs", + "apy", + "createdAtBlock", + "updatedAtBlock", + "createdAt", + "updatedAt", + "shares", + "avsRegistrations", + "rewards" + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/operators/{address}/rewards": { + "get": { + "operationId": "getOperatorRewards", + "summary": "Retrieve rewards info for an operator", + "description": "Returns a list of strategies that the Operator is rewarded for, and the tokens they are rewarded in.", + "tags": ["Operators"], + "parameters": [ + { + "in": "path", + "name": "address", + "description": "The address of the operator", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the operator", + "example": "0x00107cfdeaddc0a3160ed2f6fedd627f313e7b1a" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "The reward strategies and tokens found for the Operator.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "address": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the AVS operator", + "example": "0xdbed88d83176316fc46797b43adee927dc2ff2f5" + }, + "rewardTokens": { + "type": "array", + "items": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "description": "List of tokens in which the operator receives rewards", + "example": [ + "0xba50933c268f567bdc86e1ac131be072c6b0b71a", + "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" + ] + }, + "rewardStrategies": { + "type": "array", + "items": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "description": "List of strategies for which the operator receives rewards", + "example": [ + "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6", + "0x13760f50a9d7377e4f20cb8cf9e4c26586c658ff" + ] + } + }, + "required": ["address", "rewardTokens", "rewardStrategies"] + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/operators/{address}/events/delegation": { + "get": { + "operationId": "getOperatorDelegationEvents", + "summary": "Retrieve all delegation events for a given operator address", + "description": "Returns a list of all delegation events for a given operator address.", + "tags": ["Operators"], + "parameters": [ + { + "in": "path", + "name": "address", + "description": "The address of the operator", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the operator", + "example": "0x00107cfdeaddc0a3160ed2f6fedd627f313e7b1a" + }, + "required": true + }, + { + "in": "query", + "name": "txHash", + "description": "The transaction hash associated with the event", + "schema": { + "type": "string", + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The transaction hash associated with the event" + } + }, + { + "in": "query", + "name": "startAt", + "description": "Start date in ISO string format", + "schema": { + "type": "string", + "description": "Start date in ISO string format" + } + }, + { + "in": "query", + "name": "endAt", + "description": "End date in ISO string format", + "schema": { + "type": "string", + "description": "End date in ISO string format" + } + }, + { + "in": "query", + "name": "type", + "description": "The type of the delegation event", + "schema": { + "type": "string", + "enum": ["DELEGATION", "UNDELEGATION", "SHARES_INCREASED", "SHARES_DECREASED"], + "description": "The type of the delegation event" + } + }, + { + "in": "query", + "name": "strategyAddress", + "description": "The contract address of the restaking strategy", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy" + } + }, + { + "in": "query", + "name": "stakerAddress", + "description": "The address of the staker", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the staker" + } + }, + { + "in": "query", + "name": "withTokenData", + "description": "Toggle whether the route should return underlying token address and underlying value", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return underlying token address and underlying value", + "example": "false" + } + }, + { + "in": "query", + "name": "withEthValue", + "description": "Toggle whether the route should return value denominated in ETH", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return value denominated in ETH", + "example": "false" + } + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + } + ], + "responses": { + "200": { + "description": "The delegation events found for the operator.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tx": { + "type": "string", + "description": "The transaction hash", + "example": "0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0" + }, + "blockNumber": { + "type": "number", + "description": "The block number of the transaction", + "example": 21045085 + }, + "blockTime": { + "type": "string", + "description": "The block time of the transaction as an ISO 8601 string", + "example": "2024-10-25T20:41:11.000Z" + }, + "type": { + "type": "string", + "enum": [ + "DELEGATION", + "UNDELEGATION", + "SHARES_INCREASED", + "SHARES_DECREASED" + ], + "description": "The type of the event", + "example": "DELEGATION" + }, + "args": { + "type": "object", + "properties": { + "staker": { + "type": "string", + "description": "The contract address of the staker", + "example": "0x42318adf0773b8af4aa8ed1670ea0af7761d07c7" + }, + "strategy": { + "type": "string", + "description": "The contract address of the restaking strategy", + "example": "0x93c4b944d05dfe6df7645a86cd2206016c51564d" + }, + "shares": { + "type": "number", + "description": "The change in the operator's delegated shares, added or subtracted from the total.", + "example": 62816824424188010 + } + }, + "required": ["staker"] + }, + "underlyingToken": { + "type": "string", + "description": "The contract address of the token associated with this strategy", + "example": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84" + }, + "underlyingValue": { + "type": "number", + "description": "The value of the shares in terms of the underlying token", + "example": 5 + }, + "ethValue": { + "type": "number", + "description": "The value of the shares in ETH", + "example": 1 + } + }, + "required": ["tx", "blockNumber", "blockTime", "type", "args"] + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/operators/{address}/events/registration-status": { + "get": { + "operationId": "getOperatorRegistrationEvents", + "summary": "Retrieve all registration events for a given operator address", + "description": "Returns a list of all registration events for a given operator address.", + "tags": ["Operators"], + "parameters": [ + { + "in": "path", + "name": "address", + "description": "The address of the operator", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the operator", + "example": "0x00107cfdeaddc0a3160ed2f6fedd627f313e7b1a" + }, + "required": true + }, + { + "in": "query", + "name": "txHash", + "description": "The transaction hash associated with the event", + "schema": { + "type": "string", + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The transaction hash associated with the event" + } + }, + { + "in": "query", + "name": "startAt", + "description": "Start date in ISO string format", + "schema": { + "type": "string", + "description": "Start date in ISO string format" + } + }, + { + "in": "query", + "name": "endAt", + "description": "End date in ISO string format", + "schema": { + "type": "string", + "description": "End date in ISO string format" + } + }, + { + "in": "query", + "name": "status", + "description": "The status of Registration", + "schema": { + "type": "string", + "enum": ["REGISTERED", "DEREGISTERED"], + "description": "The status of Registration" + } + }, + { + "in": "query", + "name": "avsAddress", + "description": "The address of the avs", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the avs" + } + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + } + ], + "responses": { + "200": { + "description": "The registration events found for the operator.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tx": { + "type": "string", + "description": "The transaction hash", + "example": "0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0" + }, + "blockNumber": { + "type": "number", + "description": "The block number of the transaction", + "example": 21045085 + }, + "blockTime": { + "type": "string", + "description": "The block time of the transaction as an ISO 8601 string", + "example": "2024-10-25T20:41:11.000Z" + }, + "type": { + "type": "string", + "enum": ["REGISTRATION_STATUS"], + "description": "The type of the event", + "example": "REGISTRATION_STATUS" + }, + "args": { + "type": "object", + "properties": { + "avs": { + "type": "string", + "description": "AVS service manager contract address", + "example": "0xb73a87e8f7f9129816d40940ca19dfa396944c71" + }, + "status": { + "type": "string", + "enum": ["REGISTERED", "DEREGISTERED"], + "description": "The status of the registration", + "example": "REGISTERED" + } + }, + "required": ["avs", "status"] + } + }, + "required": ["tx", "blockNumber", "blockTime", "type", "args"] + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/withdrawals": { + "get": { + "operationId": "getAllWithdrawals", + "summary": "Retrieve all withdrawals", + "description": "Returns all withdrawal data, including the withdrawal root, nonce, withdrawal status, and other relevant information.", + "tags": ["Withdrawals"], + "parameters": [ + { + "in": "query", + "name": "stakerAddress", + "description": "The address of the staker", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the staker", + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + } + }, + { + "in": "query", + "name": "delegatedTo", + "description": "The address of the operator to which the stake is delegated", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the operator to which the stake is delegated", + "example": "0x5accc90436492f24e6af278569691e2c942a676d" + } + }, + { + "in": "query", + "name": "strategyAddress", + "description": "The contract address of the restaking strategy", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy", + "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" + } + }, + { + "in": "query", + "name": "status", + "description": "The status of the withdrawal", + "schema": { + "type": "string", + "enum": ["queued", "queued_withdrawable", "completed"], + "description": "The status of the withdrawal", + "example": "queued" + } + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + } + ], + "responses": { + "200": { + "description": "The list of withdrawals.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "withdrawalRoot": { + "type": "string", + "description": "The root hash of the withdrawal", + "example": "0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31" + }, + "nonce": { + "type": "number", + "description": "The nonce of the withdrawal, ensuring unique hashes for otherwise identical withdrawals", + "example": 0 + }, + "stakerAddress": { + "type": "string", + "description": "The contract address of the staker who initiated the withdrawal", + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + }, + "delegatedTo": { + "type": "string", + "description": "The address to which the staker was delegated when the withdrawal was initiated", + "example": "0x0000000000000000000000000000000000000000" + }, + "withdrawerAddress": { + "type": "string", + "description": "The address of the withdrawer, authorized to complete the withdrawal and receive the funds", + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + }, + "shares": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategyAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy", + "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" + }, + "shares": { + "type": "string", + "description": "The amount of shares held in the strategy", + "example": "1277920000000000000000000" + } + }, + "required": ["strategyAddress", "shares"] + }, + "description": "The list of strategy shares", + "example": [ + { + "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", + "shares": "1000288824523326631" + } + ] + }, + "createdAtBlock": { + "type": "number", + "description": "The block number when the withdrawal was recorded by EigenExplorer", + "example": 19912470 + }, + "createdAt": { + "type": "string", + "description": "The time stamp when the withdrawal was recorded by EigenExplorer", + "example": "2024-07-07T23:53:35.000Z" + }, + "updatedAtBlock": { + "type": "number", + "description": "The block number when the withdrawal was last updated", + "example": 19912470 + }, + "updatedAt": { + "type": "string", + "description": "The time stamp when the withdrawal was last updated", + "example": "2024-07-07T23:53:35.000Z" + }, + "isCompleted": { + "type": "boolean", + "description": "Indicates if the withdrawal is completed", + "example": false + } + }, + "required": [ + "withdrawalRoot", + "nonce", + "stakerAddress", + "delegatedTo", + "withdrawerAddress", + "shares", + "createdAtBlock", + "createdAt", + "updatedAtBlock", + "updatedAt", + "isCompleted" + ] + } + }, + "meta": { + "type": "object", + "properties": { + "total": { + "type": "number", + "description": "Total number of records in the database", + "example": 30 + }, + "skip": { + "type": "number", + "description": "The number of skiped records for this query", + "example": 0 + }, + "take": { + "type": "number", + "description": "The number of records returned for this query", + "example": 12 + } + }, + "required": ["total", "skip", "take"] + } + }, + "required": ["data", "meta"] + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/withdrawals/{withdrawalRoot}": { + "get": { + "operationId": "getWithdrawalByWithdrawalRoot", + "summary": "Retrieve withdrawal by withdrawal root", + "description": "Returns the withdrawal data by withdrawal root.", + "tags": ["Withdrawals"], + "parameters": [ + { + "in": "path", + "name": "withdrawalRoot", + "description": "The root hash of the withdrawal", + "schema": { + "type": "string", + "description": "The root hash of the withdrawal", + "example": "0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "The requested withdrawal record.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "withdrawalRoot": { + "type": "string", + "description": "The root hash of the withdrawal", + "example": "0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31" + }, + "nonce": { + "type": "number", + "description": "The nonce of the withdrawal, ensuring unique hashes for otherwise identical withdrawals", + "example": 0 + }, + "stakerAddress": { + "type": "string", + "description": "The contract address of the staker who initiated the withdrawal", + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + }, + "delegatedTo": { + "type": "string", + "description": "The address to which the staker was delegated when the withdrawal was initiated", + "example": "0x0000000000000000000000000000000000000000" + }, + "withdrawerAddress": { + "type": "string", + "description": "The address of the withdrawer, authorized to complete the withdrawal and receive the funds", + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + }, + "shares": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategyAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy", + "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" + }, + "shares": { + "type": "string", + "description": "The amount of shares held in the strategy", + "example": "1277920000000000000000000" + } + }, + "required": ["strategyAddress", "shares"] + }, + "description": "The list of strategy shares", + "example": [ + { + "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", + "shares": "1000288824523326631" + } + ] + }, + "createdAtBlock": { + "type": "number", + "description": "The block number when the withdrawal was recorded by EigenExplorer", + "example": 19912470 + }, + "createdAt": { + "type": "string", + "description": "The time stamp when the withdrawal was recorded by EigenExplorer", + "example": "2024-07-07T23:53:35.000Z" + }, + "updatedAtBlock": { + "type": "number", + "description": "The block number when the withdrawal was last updated", + "example": 19912470 + }, + "updatedAt": { + "type": "string", + "description": "The time stamp when the withdrawal was last updated", + "example": "2024-07-07T23:53:35.000Z" + }, + "isCompleted": { + "type": "boolean", + "description": "Indicates if the withdrawal is completed", + "example": false + } + }, + "required": [ + "withdrawalRoot", + "nonce", + "stakerAddress", + "delegatedTo", + "withdrawerAddress", + "shares", + "createdAtBlock", + "createdAt", + "updatedAtBlock", + "updatedAt", + "isCompleted" + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/stakers": { + "get": { + "operationId": "getAllStakers", + "summary": "Retrieve all stakers", + "description": "Returns all staker records. This endpoint supports pagination.", + "tags": ["Stakers"], + "parameters": [ + { + "in": "query", + "name": "withTvl", + "description": "Toggle whether the route should calculate the TVL from shares", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should calculate the TVL from shares", + "example": "false" + } + }, + { + "in": "query", + "name": "updatedSince", + "description": "Fetch stakers updated since this timestamp", + "schema": { + "type": "string", + "description": "Fetch stakers updated since this timestamp", + "example": "2024-04-11T08:31:11.000Z" + } + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + } + ], + "responses": { + "200": { + "description": "The list of staker records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the staker", + "example": "0x0000006c21964af0d420af8992851a30fa13a68b" + }, + "operatorAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the operator", + "example": "0x71c6f7ed8c2d4925d0baf16f6a85bb1736d412eb" + }, + "createdAtBlock": { + "type": "string", + "description": "The block number at which the Staker made first delegation", + "example": "19631203" + }, + "updatedAtBlock": { + "type": "string", + "description": "The block number at which the Staker made last delegation", + "example": "19631203" + }, + "createdAt": { + "type": "string", + "description": "The time stamp at which the Staker made first delegation", + "example": "2024-04-11T08:31:11.000Z" + }, + "updatedAt": { + "type": "string", + "description": "The time stamp at which the Staker made last delegation", + "example": "2024-04-11T08:31:11.000Z" + }, + "shares": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategyAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy", + "example": "0x93c4b944d05dfe6df7645a86cd2206016c51564a" + }, + "shares": { + "type": "string", + "description": "The amount of shares held in the strategy", + "example": "40000000000000000" + } + }, + "required": ["strategyAddress", "shares"] + } + }, + "tvl": { + "type": "object", + "properties": { + "tvl": { + "type": "number", + "description": "The combined TVL of all restaking strategies in ETH", + "example": 1000000 + }, + "tvlBeaconChain": { + "type": "number", + "description": "The TVL of Beacon Chain restaking strategy in ETH", + "example": 1000000 + }, + "tvlRestaking": { + "type": "number", + "description": "The combined TVL of all liquid restaking strategies in ETH", + "example": 1000000 + }, + "tvlWETH": { + "type": "number", + "description": "The TVL of WETH restaking strategy in ETH", + "example": 1000000 + }, + "tvlStrategies": { + "type": "object", + "additionalProperties": { + "type": "number", + "description": "The total value locked (TVL) in the strategy, denominated in the strategy's native token", + "example": 1000000 + }, + "description": "The TVL of each individual restaking strategy in its native token", + "example": { + "Eigen": 1000000, + "cbETH": 2000000 + } + }, + "tvlStrategiesEth": { + "type": "object", + "additionalProperties": { + "type": "number", + "description": "The total value locked (TVL) in the strategy, denominated in ETH", + "example": 1000000 + }, + "description": "The TVL of each individual restaking strategy in ETH", + "example": { + "Eigen": 1000000, + "cbETH": 2000000 + } + } + }, + "required": [ + "tvl", + "tvlBeaconChain", + "tvlRestaking", + "tvlWETH", + "tvlStrategies", + "tvlStrategiesEth" + ], + "description": "The total value locked (TVL) in the AVS staker", + "example": { + "tvl": 1000000, + "tvlBeaconChain": 1000000, + "tvlWETH": 1000000, + "tvlRestaking": 1000000, + "tvlStrategies": { + "Eigen": 1000000, + "cbETH": 2000000 + }, + "tvlStrategiesEth": { + "stETH": 1000000, + "cbETH": 2000000 + } + } + } + }, + "required": [ + "address", + "operatorAddress", + "createdAtBlock", + "updatedAtBlock", + "createdAt", + "updatedAt", + "shares" + ] + } + }, + "meta": { + "type": "object", + "properties": { + "total": { + "type": "number", + "description": "Total number of records in the database", + "example": 30 + }, + "skip": { + "type": "number", + "description": "The number of skiped records for this query", + "example": 0 + }, + "take": { + "type": "number", + "description": "The number of records returned for this query", + "example": 12 + } + }, + "required": ["total", "skip", "take"] + } + }, + "required": ["data", "meta"] + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/stakers/{address}": { + "get": { + "operationId": "getStakerByAddress", + "summary": "Retrieve a staker by address", + "description": "Returns a staker record by address.", + "tags": ["Stakers"], + "parameters": [ + { + "in": "path", + "name": "address", + "description": "The address of the staker", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the staker", + "example": "0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34" + }, + "required": true + }, + { + "in": "query", + "name": "withTvl", + "description": "Toggle whether the route should calculate the TVL from shares", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should calculate the TVL from shares", + "example": "false" + } + } + ], + "responses": { + "200": { + "description": "The record of the requested operator.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "address": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the staker", + "example": "0x0000006c21964af0d420af8992851a30fa13a68b" + }, + "operatorAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the operator", + "example": "0x71c6f7ed8c2d4925d0baf16f6a85bb1736d412eb" + }, + "createdAtBlock": { + "type": "string", + "description": "The block number at which the Staker made first delegation", + "example": "19631203" + }, + "updatedAtBlock": { + "type": "string", + "description": "The block number at which the Staker made last delegation", + "example": "19631203" + }, + "createdAt": { + "type": "string", + "description": "The time stamp at which the Staker made first delegation", + "example": "2024-04-11T08:31:11.000Z" + }, + "updatedAt": { + "type": "string", + "description": "The time stamp at which the Staker made last delegation", + "example": "2024-04-11T08:31:11.000Z" + }, + "shares": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategyAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy", + "example": "0x93c4b944d05dfe6df7645a86cd2206016c51564a" + }, + "shares": { + "type": "string", + "description": "The amount of shares held in the strategy", + "example": "40000000000000000" + } + }, + "required": ["strategyAddress", "shares"] + } + }, + "tvl": { + "type": "object", + "properties": { + "tvl": { + "type": "number", + "description": "The combined TVL of all restaking strategies in ETH", + "example": 1000000 + }, + "tvlBeaconChain": { + "type": "number", + "description": "The TVL of Beacon Chain restaking strategy in ETH", + "example": 1000000 + }, + "tvlRestaking": { + "type": "number", + "description": "The combined TVL of all liquid restaking strategies in ETH", + "example": 1000000 + }, + "tvlWETH": { + "type": "number", + "description": "The TVL of WETH restaking strategy in ETH", + "example": 1000000 + }, + "tvlStrategies": { + "type": "object", + "additionalProperties": { + "type": "number", + "description": "The total value locked (TVL) in the strategy, denominated in the strategy's native token", + "example": 1000000 + }, + "description": "The TVL of each individual restaking strategy in its native token", + "example": { + "Eigen": 1000000, + "cbETH": 2000000 + } + }, + "tvlStrategiesEth": { + "type": "object", + "additionalProperties": { + "type": "number", + "description": "The total value locked (TVL) in the strategy, denominated in ETH", + "example": 1000000 + }, + "description": "The TVL of each individual restaking strategy in ETH", + "example": { + "Eigen": 1000000, + "cbETH": 2000000 + } + } + }, + "required": [ + "tvl", + "tvlBeaconChain", + "tvlRestaking", + "tvlWETH", + "tvlStrategies", + "tvlStrategiesEth" + ], + "description": "The total value locked (TVL) in the AVS staker", + "example": { + "tvl": 1000000, + "tvlBeaconChain": 1000000, + "tvlWETH": 1000000, + "tvlRestaking": 1000000, + "tvlStrategies": { + "Eigen": 1000000, + "cbETH": 2000000 + }, + "tvlStrategiesEth": { + "stETH": 1000000, + "cbETH": 2000000 + } + } + } + }, + "required": [ + "address", + "operatorAddress", + "createdAtBlock", + "updatedAtBlock", + "createdAt", + "updatedAt", + "shares" + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/stakers/{address}/withdrawals": { + "get": { + "operationId": "getStakerWithdrawals", + "summary": "Retrieve all withdrawals by staker address", + "description": "Returns all withdrawal data of the requested staker, including the withdrawal root, nonce, withdrawal status, and other relevant information.", + "tags": ["Stakers"], + "parameters": [ + { + "in": "path", + "name": "address", + "description": "The address of the staker", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the staker", + "example": "0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34" + }, + "required": true + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + } + ], + "responses": { + "200": { + "description": "The list of withdrawals.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "withdrawalRoot": { + "type": "string", + "description": "The root hash of the withdrawal", + "example": "0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31" + }, + "nonce": { + "type": "number", + "description": "The nonce of the withdrawal, ensuring unique hashes for otherwise identical withdrawals", + "example": 0 + }, + "stakerAddress": { + "type": "string", + "description": "The contract address of the staker who initiated the withdrawal", + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + }, + "delegatedTo": { + "type": "string", + "description": "The address to which the staker was delegated when the withdrawal was initiated", + "example": "0x0000000000000000000000000000000000000000" + }, + "withdrawerAddress": { + "type": "string", + "description": "The address of the withdrawer, authorized to complete the withdrawal and receive the funds", + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + }, + "shares": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategyAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy", + "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" + }, + "shares": { + "type": "string", + "description": "The amount of shares held in the strategy", + "example": "1277920000000000000000000" + } + }, + "required": ["strategyAddress", "shares"] }, - "description": "List of operators associated with the AVS registration" + "description": "The list of strategy shares", + "example": [ + { + "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", + "shares": "1000288824523326631" + } + ] + }, + "createdAtBlock": { + "type": "number", + "description": "The block number when the withdrawal was recorded by EigenExplorer", + "example": 19912470 + }, + "createdAt": { + "type": "string", + "description": "The time stamp when the withdrawal was recorded by EigenExplorer", + "example": "2024-07-07T23:53:35.000Z" + }, + "updatedAtBlock": { + "type": "number", + "description": "The block number when the withdrawal was last updated", + "example": 19912470 + }, + "updatedAt": { + "type": "string", + "description": "The time stamp when the withdrawal was last updated", + "example": "2024-07-07T23:53:35.000Z" + }, + "isCompleted": { + "type": "boolean", + "description": "Indicates if the withdrawal is completed", + "example": false } }, "required": [ - "avsAddress", - "isActive", - "metadataName", - "metadataDescription", - "metadataDiscord", - "metadataLogo", - "metadataTelegram", - "metadataWebsite", - "metadataX", - "metadataUrl", - "restakeableStrategies", - "totalStakers", - "totalOperators", - "tvlEth", + "withdrawalRoot", + "nonce", + "stakerAddress", + "delegatedTo", + "withdrawerAddress", + "shares", "createdAtBlock", - "updatedAtBlock", "createdAt", + "updatedAtBlock", "updatedAt", - "address", - "rewardsSubmissions", - "operators" + "isCompleted" ] - }, - "description": "Detailed AVS registrations information for the operator" + } }, - "tvl": { + "meta": { "type": "object", "properties": { - "tvl": { - "type": "number", - "description": "The combined TVL of all restaking strategies in ETH", - "example": 1000000 - }, - "tvlBeaconChain": { + "total": { "type": "number", - "description": "The TVL of Beacon Chain restaking strategy in ETH", - "example": 1000000 + "description": "Total number of records in the database", + "example": 30 }, - "tvlRestaking": { + "skip": { "type": "number", - "description": "The combined TVL of all liquid restaking strategies in ETH", - "example": 1000000 + "description": "The number of skiped records for this query", + "example": 0 }, - "tvlWETH": { + "take": { "type": "number", - "description": "The TVL of WETH restaking strategy in ETH", - "example": 1000000 - }, - "tvlStrategies": { - "type": "object", - "additionalProperties": { + "description": "The number of records returned for this query", + "example": 12 + } + }, + "required": ["total", "skip", "take"] + } + }, + "required": ["data", "meta"] + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/stakers/{address}/withdrawals/queued": { + "get": { + "operationId": "getQueuedStakerWithdrawals", + "summary": "Retrieve queued withdrawals by staker address", + "description": "Returns all queued withdrawal data of the requested staker.", + "tags": ["Stakers"], + "parameters": [ + { + "in": "path", + "name": "address", + "description": "The address of the staker", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the staker", + "example": "0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34" + }, + "required": true + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + } + ], + "responses": { + "200": { + "description": "The list of queued withdrawals.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "withdrawalRoot": { + "type": "string", + "description": "The root hash of the withdrawal", + "example": "0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31" + }, + "nonce": { "type": "number", - "description": "The total value locked (TVL) in the strategy, denominated in the strategy's native token", - "example": 1000000 + "description": "The nonce of the withdrawal, ensuring unique hashes for otherwise identical withdrawals", + "example": 0 + }, + "stakerAddress": { + "type": "string", + "description": "The contract address of the staker who initiated the withdrawal", + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + }, + "delegatedTo": { + "type": "string", + "description": "The address to which the staker was delegated when the withdrawal was initiated", + "example": "0x0000000000000000000000000000000000000000" + }, + "withdrawerAddress": { + "type": "string", + "description": "The address of the withdrawer, authorized to complete the withdrawal and receive the funds", + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + }, + "shares": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategyAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy", + "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" + }, + "shares": { + "type": "string", + "description": "The amount of shares held in the strategy", + "example": "1277920000000000000000000" + } + }, + "required": ["strategyAddress", "shares"] + }, + "description": "The list of strategy shares", + "example": [ + { + "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", + "shares": "1000288824523326631" + } + ] }, - "description": "The TVL of each individual restaking strategy in its native token", - "example": { - "Eigen": 1000000, - "cbETH": 2000000 - } - }, - "tvlStrategiesEth": { - "type": "object", - "additionalProperties": { + "createdAtBlock": { "type": "number", - "description": "The total value locked (TVL) in the strategy, denominated in ETH", - "example": 1000000 + "description": "The block number when the withdrawal was recorded by EigenExplorer", + "example": 19912470 }, - "description": "The TVL of each individual restaking strategy in ETH", - "example": { - "Eigen": 1000000, - "cbETH": 2000000 + "createdAt": { + "type": "string", + "description": "The time stamp when the withdrawal was recorded by EigenExplorer", + "example": "2024-07-07T23:53:35.000Z" } - } - }, - "required": [ - "tvl", - "tvlBeaconChain", - "tvlRestaking", - "tvlWETH", - "tvlStrategies", - "tvlStrategiesEth" - ], - "description": "The total value locked (TVL) in the AVS operator", - "example": { - "tvl": 1000000, - "tvlBeaconChain": 1000000, - "tvlWETH": 1000000, - "tvlRestaking": 1000000, - "tvlStrategies": { - "Eigen": 1000000, - "cbETH": 2000000 }, - "tvlStrategiesEth": { - "stETH": 1000000, - "cbETH": 2000000 - } + "required": [ + "withdrawalRoot", + "nonce", + "stakerAddress", + "delegatedTo", + "withdrawerAddress", + "shares", + "createdAtBlock", + "createdAt" + ] } }, - "rewards": { + "meta": { "type": "object", "properties": { - "avs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "avsAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "AVS service manager contract address", - "example": "0x870679e138bcdf293b7ff14dd44b70fc97e12fc0" - }, - "apy": { - "type": "number", - "description": "Latest APY recorded for the AVS", - "example": 0.15973119826488588 - } - }, - "required": ["avsAddress", "apy"] - } - }, - "strategies": { - "type": "array", - "items": { - "type": "object", - "properties": { - "strategyAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the restaking strategy", - "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" - }, - "apy": { - "type": "number", - "description": "APY of the restaking strategy", - "example": 0.1 - } - }, - "required": ["strategyAddress", "apy"] - } + "total": { + "type": "number", + "description": "Total number of records in the database", + "example": 30 }, - "aggregateApy": { + "skip": { "type": "number", - "description": "The aggregate APY across all strategies", - "example": 1 + "description": "The number of skiped records for this query", + "example": 0 }, - "operatorEarningsEth": { - "type": "string", - "description": "Total earnings for the operator in ETH", - "example": "1000000000000000000" + "take": { + "type": "number", + "description": "The number of records returned for this query", + "example": 12 } }, - "required": ["avs", "strategies", "aggregateApy", "operatorEarningsEth"], - "description": "The rewards information for the operator" + "required": ["total", "skip", "take"] } }, - "required": [ - "address", - "metadataName", - "metadataDescription", - "metadataDiscord", - "metadataLogo", - "metadataTelegram", - "metadataWebsite", - "metadataX", - "totalStakers", - "totalAvs", - "apy", - "createdAtBlock", - "updatedAtBlock", - "createdAt", - "updatedAt", - "shares", - "avsRegistrations", - "rewards" - ] + "required": ["data", "meta"] } } } @@ -6120,66 +8231,159 @@ } } }, - "/operators/{address}/rewards": { + "/stakers/{address}/withdrawals/queued_withdrawable": { "get": { - "operationId": "getOperatorRewards", - "summary": "Retrieve rewards info for an operator", - "description": "Returns a list of strategies that the Operator is rewarded for, and the tokens they are rewarded in.", - "tags": ["Operators"], + "operationId": "getQueuedWithdrawableStakerWithdrawals", + "summary": "Retrieve queued and withdrawable withdrawals by staker address", + "description": "Returns all queued and withdrawable withdrawal data of the requested staker.", + "tags": ["Stakers"], "parameters": [ { "in": "path", "name": "address", - "description": "The address of the operator", + "description": "The address of the staker", "schema": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The address of the operator", - "example": "0x00107cfdeaddc0a3160ed2f6fedd627f313e7b1a" + "description": "The address of the staker", + "example": "0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34" }, "required": true + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } } ], "responses": { "200": { - "description": "The reward strategies and tokens found for the Operator.", + "description": "The list of queued and withdrawable withdrawals.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "address": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the AVS operator", - "example": "0xdbed88d83176316fc46797b43adee927dc2ff2f5" - }, - "rewardTokens": { + "data": { "type": "array", "items": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$" - }, - "description": "List of tokens in which the operator receives rewards", - "example": [ - "0xba50933c268f567bdc86e1ac131be072c6b0b71a", - "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" - ] + "type": "object", + "properties": { + "withdrawalRoot": { + "type": "string", + "description": "The root hash of the withdrawal", + "example": "0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31" + }, + "nonce": { + "type": "number", + "description": "The nonce of the withdrawal, ensuring unique hashes for otherwise identical withdrawals", + "example": 0 + }, + "stakerAddress": { + "type": "string", + "description": "The contract address of the staker who initiated the withdrawal", + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + }, + "delegatedTo": { + "type": "string", + "description": "The address to which the staker was delegated when the withdrawal was initiated", + "example": "0x0000000000000000000000000000000000000000" + }, + "withdrawerAddress": { + "type": "string", + "description": "The address of the withdrawer, authorized to complete the withdrawal and receive the funds", + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + }, + "shares": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategyAddress": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy", + "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" + }, + "shares": { + "type": "string", + "description": "The amount of shares held in the strategy", + "example": "1277920000000000000000000" + } + }, + "required": ["strategyAddress", "shares"] + }, + "description": "The list of strategy shares", + "example": [ + { + "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", + "shares": "1000288824523326631" + } + ] + }, + "createdAtBlock": { + "type": "number", + "description": "The block number when the withdrawal was recorded by EigenExplorer", + "example": 19912470 + }, + "createdAt": { + "type": "string", + "description": "The time stamp when the withdrawal was recorded by EigenExplorer", + "example": "2024-07-07T23:53:35.000Z" + } + }, + "required": [ + "withdrawalRoot", + "nonce", + "stakerAddress", + "delegatedTo", + "withdrawerAddress", + "shares", + "createdAtBlock", + "createdAt" + ] + } }, - "rewardStrategies": { - "type": "array", - "items": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$" + "meta": { + "type": "object", + "properties": { + "total": { + "type": "number", + "description": "Total number of records in the database", + "example": 30 + }, + "skip": { + "type": "number", + "description": "The number of skiped records for this query", + "example": 0 + }, + "take": { + "type": "number", + "description": "The number of records returned for this query", + "example": 12 + } }, - "description": "List of strategies for which the operator receives rewards", - "example": [ - "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6", - "0x13760f50a9d7377e4f20cb8cf9e4c26586c658ff" - ] + "required": ["total", "skip", "take"] } }, - "required": ["address", "rewardTokens", "rewardStrategies"] + "required": ["data", "meta"] } } } @@ -6208,56 +8412,24 @@ } } }, - "/withdrawals": { + "/stakers/{address}/withdrawals/completed": { "get": { - "operationId": "getAllWithdrawals", - "summary": "Retrieve all withdrawals", - "description": "Returns all withdrawal data, including the withdrawal root, nonce, withdrawal status, and other relevant information.", - "tags": ["Withdrawals"], + "operationId": "getCompletedStakerWithdrawals", + "summary": "Retrieve completed withdrawals by staker address", + "description": "Returns all completed withdrawal data of the requested staker.", + "tags": ["Stakers"], "parameters": [ { - "in": "query", - "name": "stakerAddress", + "in": "path", + "name": "address", "description": "The address of the staker", "schema": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "description": "The address of the staker", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" - } - }, - { - "in": "query", - "name": "delegatedTo", - "description": "The address of the operator to which the stake is delegated", - "schema": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The address of the operator to which the stake is delegated", - "example": "0x5accc90436492f24e6af278569691e2c942a676d" - } - }, - { - "in": "query", - "name": "strategyAddress", - "description": "The contract address of the restaking strategy", - "schema": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the restaking strategy", - "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" - } - }, - { - "in": "query", - "name": "status", - "description": "The status of the withdrawal", - "schema": { - "type": "string", - "enum": ["queued", "queued_withdrawable", "completed"], - "description": "The status of the withdrawal", - "example": "queued" - } + "example": "0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34" + }, + "required": true }, { "in": "query", @@ -6284,7 +8456,7 @@ ], "responses": { "200": { - "description": "The list of withdrawals.", + "description": "The list of completed withdrawals.", "content": { "application/json": { "schema": { @@ -6302,22 +8474,22 @@ }, "nonce": { "type": "number", - "description": "The nonce of the withdrawal", + "description": "The nonce of the withdrawal, ensuring unique hashes for otherwise identical withdrawals", "example": 0 }, "stakerAddress": { "type": "string", - "description": "The address of the staker", + "description": "The contract address of the staker who initiated the withdrawal", "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" }, "delegatedTo": { "type": "string", - "description": "The operator address to which staking is delegated", + "description": "The address to which the staker was delegated when the withdrawal was initiated", "example": "0x0000000000000000000000000000000000000000" }, "withdrawerAddress": { "type": "string", - "description": "The address of the withdrawer", + "description": "The address of the withdrawer, authorized to complete the withdrawal and receive the funds", "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" }, "shares": { @@ -6366,11 +8538,6 @@ "type": "string", "description": "The time stamp when the withdrawal was last updated", "example": "2024-07-07T23:53:35.000Z" - }, - "isCompleted": { - "type": "boolean", - "description": "Indicates if the withdrawal is completed", - "example": false } }, "required": [ @@ -6383,8 +8550,7 @@ "createdAtBlock", "createdAt", "updatedAtBlock", - "updatedAt", - "isCompleted" + "updatedAt" ] } }, @@ -6439,124 +8605,131 @@ } } }, - "/withdrawals/{withdrawalRoot}": { + "/stakers/{address}/deposits": { "get": { - "operationId": "getWithdrawalByWithdrawalRoot", - "summary": "Retrieve withdrawal by withdrawal root", - "description": "Returns the withdrawal data by withdrawal root.", - "tags": ["Withdrawals"], + "operationId": "getStakerDeposits", + "summary": "Retrieve all deposits by staker address", + "description": "Returns all deposit data of the requested staker, including the transaction hash, token address, strategy address, shares and other relevant information.", + "tags": ["Stakers"], "parameters": [ { "in": "path", - "name": "withdrawalRoot", - "description": "The root hash of the withdrawal", + "name": "address", + "description": "The address of the staker", "schema": { "type": "string", - "description": "The root hash of the withdrawal", - "example": "0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31" + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the staker", + "example": "0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34" }, "required": true + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } } ], "responses": { "200": { - "description": "The requested withdrawal record.", + "description": "The list of deposits.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "withdrawalRoot": { - "type": "string", - "description": "The root hash of the withdrawal", - "example": "0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31" - }, - "nonce": { - "type": "number", - "description": "The nonce of the withdrawal", - "example": 0 - }, - "stakerAddress": { - "type": "string", - "description": "The address of the staker", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" - }, - "delegatedTo": { - "type": "string", - "description": "The operator address to which staking is delegated", - "example": "0x0000000000000000000000000000000000000000" - }, - "withdrawerAddress": { - "type": "string", - "description": "The address of the withdrawer", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" - }, - "shares": { + "data": { "type": "array", "items": { "type": "object", "properties": { + "transactionHash": { + "type": "string", + "description": "The hash of the transaction", + "example": "0x9d0a355df5a937516dfaed6721b0b461a16b8fad005f66d7dbf56b8a39136297" + }, + "stakerAddress": { + "type": "string", + "description": "The address of the staker", + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + }, + "tokenAddress": { + "type": "string", + "description": "The address of the token", + "example": "0xe95a203b1a91a908f9b9ce46459d101078c2c3cb" + }, "strategyAddress": { "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", "description": "The contract address of the restaking strategy", - "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" + "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" }, "shares": { "type": "string", "description": "The amount of shares held in the strategy", - "example": "1277920000000000000000000" + "example": "40000000000000000" + }, + "createdAtBlock": { + "type": "number", + "description": "The block number when the withdrawal was recorded by EigenExplorer", + "example": 19912470 + }, + "createdAt": { + "type": "string", + "description": "The time stamp when the withdrawal was recorded by EigenExplorer", + "example": "2024-07-07T23:53:35.000Z" } }, - "required": ["strategyAddress", "shares"] - }, - "description": "The list of strategy shares", - "example": [ - { - "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", - "shares": "1000288824523326631" - } - ] - }, - "createdAtBlock": { - "type": "number", - "description": "The block number when the withdrawal was recorded by EigenExplorer", - "example": 19912470 - }, - "createdAt": { - "type": "string", - "description": "The time stamp when the withdrawal was recorded by EigenExplorer", - "example": "2024-07-07T23:53:35.000Z" - }, - "updatedAtBlock": { - "type": "number", - "description": "The block number when the withdrawal was last updated", - "example": 19912470 - }, - "updatedAt": { - "type": "string", - "description": "The time stamp when the withdrawal was last updated", - "example": "2024-07-07T23:53:35.000Z" + "required": [ + "transactionHash", + "stakerAddress", + "tokenAddress", + "strategyAddress", + "shares", + "createdAtBlock", + "createdAt" + ] + } }, - "isCompleted": { - "type": "boolean", - "description": "Indicates if the withdrawal is completed", - "example": false + "meta": { + "type": "object", + "properties": { + "total": { + "type": "number", + "description": "Total number of records in the database", + "example": 30 + }, + "skip": { + "type": "number", + "description": "The number of skiped records for this query", + "example": 0 + }, + "take": { + "type": "number", + "description": "The number of records returned for this query", + "example": 12 + } + }, + "required": ["total", "skip", "take"] } }, - "required": [ - "withdrawalRoot", - "nonce", - "stakerAddress", - "delegatedTo", - "withdrawerAddress", - "shares", - "createdAtBlock", - "createdAt", - "updatedAtBlock", - "updatedAt", - "isCompleted" - ] + "required": ["data", "meta"] } } } @@ -6585,33 +8758,105 @@ } } }, - "/stakers": { + "/stakers/{address}/events/delegation": { "get": { - "operationId": "getAllStakers", - "summary": "Retrieve all stakers", - "description": "Returns all staker records. This endpoint supports pagination.", + "operationId": "getStakerDelegationEvents", + "summary": "Retrieve all delegation events for a given staker address", + "description": "Returns a list of all delegation events for a given staker address.", "tags": ["Stakers"], "parameters": [ + { + "in": "path", + "name": "address", + "description": "The address of the staker", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the staker", + "example": "0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34" + }, + "required": true + }, { "in": "query", - "name": "withTvl", - "description": "Toggle whether the route should calculate the TVL from shares", + "name": "txHash", + "description": "The transaction hash associated with the event", + "schema": { + "type": "string", + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The transaction hash associated with the event" + } + }, + { + "in": "query", + "name": "startAt", + "description": "Start date in ISO string format", + "schema": { + "type": "string", + "description": "Start date in ISO string format" + } + }, + { + "in": "query", + "name": "endAt", + "description": "End date in ISO string format", + "schema": { + "type": "string", + "description": "End date in ISO string format" + } + }, + { + "in": "query", + "name": "type", + "description": "The type of the delegation event", + "schema": { + "type": "string", + "enum": ["DELEGATION", "UNDELEGATION", "SHARES_INCREASED", "SHARES_DECREASED"], + "description": "The type of the delegation event" + } + }, + { + "in": "query", + "name": "strategyAddress", + "description": "The contract address of the restaking strategy", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy" + } + }, + { + "in": "query", + "name": "operatorAddress", + "description": "The address of the operator", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the operator" + } + }, + { + "in": "query", + "name": "withTokenData", + "description": "Toggle whether the route should return underlying token address and underlying value", "schema": { "type": "string", "enum": ["true", "false"], "default": "false", - "description": "Toggle whether the route should calculate the TVL from shares", + "description": "Toggle whether the route should return underlying token address and underlying value", "example": "false" } }, { "in": "query", - "name": "updatedSince", - "description": "Fetch stakers updated since this timestamp", + "name": "withEthValue", + "description": "Toggle whether the route should return value denominated in ETH", "schema": { "type": "string", - "description": "Fetch stakers updated since this timestamp", - "example": "2024-04-11T08:31:11.000Z" + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return value denominated in ETH", + "example": "false" } }, { @@ -6628,189 +8873,87 @@ { "in": "query", "name": "take", - "description": "The number of records to return for pagination", - "schema": { - "type": "string", - "default": "12", - "description": "The number of records to return for pagination", - "example": 12 - } - } - ], - "responses": { - "200": { - "description": "The list of staker records.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "address": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the staker", - "example": "0x0000006c21964af0d420af8992851a30fa13a68b" - }, - "operatorAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The address of the operator", - "example": "0x71c6f7ed8c2d4925d0baf16f6a85bb1736d412eb" - }, - "createdAtBlock": { - "type": "string", - "description": "The block number at which the Staker made first delegation", - "example": "19631203" - }, - "updatedAtBlock": { - "type": "string", - "description": "The block number at which the Staker made last delegation", - "example": "19631203" - }, - "createdAt": { - "type": "string", - "description": "The time stamp at which the Staker made first delegation", - "example": "2024-04-11T08:31:11.000Z" - }, - "updatedAt": { - "type": "string", - "description": "The time stamp at which the Staker made last delegation", - "example": "2024-04-11T08:31:11.000Z" - }, - "shares": { - "type": "array", - "items": { - "type": "object", - "properties": { - "strategyAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the restaking strategy", - "example": "0x93c4b944d05dfe6df7645a86cd2206016c51564a" - }, - "shares": { - "type": "string", - "description": "The amount of shares held in the strategy", - "example": "40000000000000000" - } - }, - "required": ["strategyAddress", "shares"] - } - }, - "tvl": { - "type": "object", - "properties": { - "tvl": { - "type": "number", - "description": "The combined TVL of all restaking strategies in ETH", - "example": 1000000 - }, - "tvlBeaconChain": { - "type": "number", - "description": "The TVL of Beacon Chain restaking strategy in ETH", - "example": 1000000 - }, - "tvlRestaking": { - "type": "number", - "description": "The combined TVL of all liquid restaking strategies in ETH", - "example": 1000000 - }, - "tvlWETH": { - "type": "number", - "description": "The TVL of WETH restaking strategy in ETH", - "example": 1000000 - }, - "tvlStrategies": { - "type": "object", - "additionalProperties": { - "type": "number", - "description": "The total value locked (TVL) in the strategy, denominated in the strategy's native token", - "example": 1000000 - }, - "description": "The TVL of each individual restaking strategy in its native token", - "example": { - "Eigen": 1000000, - "cbETH": 2000000 - } - }, - "tvlStrategiesEth": { - "type": "object", - "additionalProperties": { - "type": "number", - "description": "The total value locked (TVL) in the strategy, denominated in ETH", - "example": 1000000 - }, - "description": "The TVL of each individual restaking strategy in ETH", - "example": { - "Eigen": 1000000, - "cbETH": 2000000 - } - } - }, - "required": [ - "tvl", - "tvlBeaconChain", - "tvlRestaking", - "tvlWETH", - "tvlStrategies", - "tvlStrategiesEth" - ], - "description": "The total value locked (TVL) in the AVS staker", - "example": { - "tvl": 1000000, - "tvlBeaconChain": 1000000, - "tvlWETH": 1000000, - "tvlRestaking": 1000000, - "tvlStrategies": { - "Eigen": 1000000, - "cbETH": 2000000 - }, - "tvlStrategiesEth": { - "stETH": 1000000, - "cbETH": 2000000 - } - } - } - }, - "required": [ - "address", - "operatorAddress", - "createdAtBlock", - "updatedAtBlock", - "createdAt", - "updatedAt", - "shares" - ] - } + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + } + ], + "responses": { + "200": { + "description": "The delegation events found for the staker.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tx": { + "type": "string", + "description": "The transaction hash", + "example": "0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0" }, - "meta": { + "blockNumber": { + "type": "number", + "description": "The block number of the transaction", + "example": 21045085 + }, + "blockTime": { + "type": "string", + "description": "The block time of the transaction as an ISO 8601 string", + "example": "2024-10-25T20:41:11.000Z" + }, + "type": { + "type": "string", + "enum": [ + "DELEGATION", + "UNDELEGATION", + "SHARES_INCREASED", + "SHARES_DECREASED" + ], + "description": "The type of the event", + "example": "DELEGATION" + }, + "args": { "type": "object", "properties": { - "total": { - "type": "number", - "description": "Total number of records in the database", - "example": 30 + "operator": { + "type": "string", + "description": "The contract address of the AVS operator", + "example": "0x71c6f7ed8c2d4925d0baf16f6a85bb1736d412eb" }, - "skip": { - "type": "number", - "description": "The number of skiped records for this query", - "example": 0 + "strategy": { + "type": "string", + "description": "The contract address of the restaking strategy", + "example": "0x93c4b944d05dfe6df7645a86cd2206016c51564d" }, - "take": { + "shares": { "type": "number", - "description": "The number of records returned for this query", - "example": 12 + "description": "The change in the operator's delegated shares, added or subtracted from the total.", + "example": 62816824424188010 } }, - "required": ["total", "skip", "take"] + "required": ["operator"] + }, + "underlyingToken": { + "type": "string", + "description": "The contract address of the token associated with this strategy", + "example": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84" + }, + "underlyingValue": { + "type": "number", + "description": "The value of the shares in terms of the underlying token", + "example": 5 + }, + "ethValue": { + "type": "number", + "description": "The value of the shares in ETH", + "example": 1 } }, - "required": ["data", "meta"] + "required": ["tx", "blockNumber", "blockTime", "type", "args"] } } } @@ -6839,11 +8982,11 @@ } } }, - "/stakers/{address}": { + "/stakers/{address}/events/deposit": { "get": { - "operationId": "getStakerByAddress", - "summary": "Retrieve a staker by address", - "description": "Returns a staker record by address.", + "operationId": "getStakerDepositEvents", + "summary": "Retrieve all deposit events for a given staker address", + "description": "Returns a list of all deposit events for a given staker address.", "tags": ["Stakers"], "parameters": [ { @@ -6860,161 +9003,166 @@ }, { "in": "query", - "name": "withTvl", - "description": "Toggle whether the route should calculate the TVL from shares", + "name": "txHash", + "description": "The transaction hash associated with the event", + "schema": { + "type": "string", + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The transaction hash associated with the event" + } + }, + { + "in": "query", + "name": "startAt", + "description": "Start date in ISO string format", + "schema": { + "type": "string", + "description": "Start date in ISO string format" + } + }, + { + "in": "query", + "name": "endAt", + "description": "End date in ISO string format", + "schema": { + "type": "string", + "description": "End date in ISO string format" + } + }, + { + "in": "query", + "name": "tokenAddress", + "description": "The contract address of the token", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the token" + } + }, + { + "in": "query", + "name": "strategyAddress", + "description": "The contract address of the restaking strategy", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy" + } + }, + { + "in": "query", + "name": "withTokenData", + "description": "Toggle whether the route should return underlying token address and underlying value", "schema": { "type": "string", "enum": ["true", "false"], "default": "false", - "description": "Toggle whether the route should calculate the TVL from shares", + "description": "Toggle whether the route should return underlying token address and underlying value", + "example": "false" + } + }, + { + "in": "query", + "name": "withEthValue", + "description": "Toggle whether the route should return value denominated in ETH", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return value denominated in ETH", "example": "false" } + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } } ], "responses": { "200": { - "description": "The record of the requested operator.", + "description": "The deposit events found for the staker.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "address": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the staker", - "example": "0x0000006c21964af0d420af8992851a30fa13a68b" - }, - "operatorAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The address of the operator", - "example": "0x71c6f7ed8c2d4925d0baf16f6a85bb1736d412eb" - }, - "createdAtBlock": { + "tx": { "type": "string", - "description": "The block number at which the Staker made first delegation", - "example": "19631203" + "description": "The transaction hash", + "example": "0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0" }, - "updatedAtBlock": { - "type": "string", - "description": "The block number at which the Staker made last delegation", - "example": "19631203" + "blockNumber": { + "type": "number", + "description": "The block number of the transaction", + "example": 21045085 }, - "createdAt": { + "blockTime": { "type": "string", - "description": "The time stamp at which the Staker made first delegation", - "example": "2024-04-11T08:31:11.000Z" + "description": "The block time of the transaction as an ISO 8601 string", + "example": "2024-10-25T20:41:11.000Z" }, - "updatedAt": { + "type": { "type": "string", - "description": "The time stamp at which the Staker made last delegation", - "example": "2024-04-11T08:31:11.000Z" - }, - "shares": { - "type": "array", - "items": { - "type": "object", - "properties": { - "strategyAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the restaking strategy", - "example": "0x93c4b944d05dfe6df7645a86cd2206016c51564a" - }, - "shares": { - "type": "string", - "description": "The amount of shares held in the strategy", - "example": "40000000000000000" - } - }, - "required": ["strategyAddress", "shares"] - } + "enum": ["DEPOSIT"], + "description": "The type of the event", + "example": "DEPOSIT" }, - "tvl": { + "args": { "type": "object", "properties": { - "tvl": { - "type": "number", - "description": "The combined TVL of all restaking strategies in ETH", - "example": 1000000 - }, - "tvlBeaconChain": { - "type": "number", - "description": "The TVL of Beacon Chain restaking strategy in ETH", - "example": 1000000 + "token": { + "type": "string", + "description": "The contract address of the token deposited", + "example": "0xec53bf9167f50cdeb3ae105f56099aaab9061f83" }, - "tvlRestaking": { - "type": "number", - "description": "The combined TVL of all liquid restaking strategies in ETH", - "example": 1000000 + "strategy": { + "type": "string", + "description": "The contract address of the restaking strategy", + "example": "0xacb55c530acdb2849e6d4f36992cd8c9d50ed8f7" }, - "tvlWETH": { + "shares": { "type": "number", - "description": "The TVL of WETH restaking strategy in ETH", - "example": 1000000 - }, - "tvlStrategies": { - "type": "object", - "additionalProperties": { - "type": "number", - "description": "The total value locked (TVL) in the strategy, denominated in the strategy's native token", - "example": 1000000 - }, - "description": "The TVL of each individual restaking strategy in its native token", - "example": { - "Eigen": 1000000, - "cbETH": 2000000 - } - }, - "tvlStrategiesEth": { - "type": "object", - "additionalProperties": { - "type": "number", - "description": "The total value locked (TVL) in the strategy, denominated in ETH", - "example": 1000000 - }, - "description": "The TVL of each individual restaking strategy in ETH", - "example": { - "Eigen": 1000000, - "cbETH": 2000000 - } + "description": "The amount of new shares given to the staker in this strategy", + "example": 10190000000000000000 } }, - "required": [ - "tvl", - "tvlBeaconChain", - "tvlRestaking", - "tvlWETH", - "tvlStrategies", - "tvlStrategiesEth" - ], - "description": "The total value locked (TVL) in the AVS staker", - "example": { - "tvl": 1000000, - "tvlBeaconChain": 1000000, - "tvlWETH": 1000000, - "tvlRestaking": 1000000, - "tvlStrategies": { - "Eigen": 1000000, - "cbETH": 2000000 - }, - "tvlStrategiesEth": { - "stETH": 1000000, - "cbETH": 2000000 - } - } + "required": ["token", "strategy", "shares"] + }, + "underlyingToken": { + "type": "string", + "description": "The contract address of the token associated with this strategy", + "example": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84" + }, + "underlyingValue": { + "type": "number", + "description": "The value of the shares in terms of the underlying token", + "example": 5 + }, + "ethValue": { + "type": "number", + "description": "The value of the shares in ETH", + "example": 1 } - }, - "required": [ - "address", - "operatorAddress", - "createdAtBlock", - "updatedAtBlock", - "createdAt", - "updatedAt", - "shares" - ] + }, + "required": ["tx", "blockNumber", "blockTime", "type", "args"] } } } @@ -7043,11 +9191,11 @@ } } }, - "/stakers/{address}/withdrawals": { + "/stakers/{address}/events/withdrawal": { "get": { - "operationId": "getStakerWithdrawals", - "summary": "Retrieve all withdrawals by staker address", - "description": "Returns all withdrawal data of the requested staker, including the withdrawal root, nonce, withdrawal status, and other relevant information.", + "operationId": "getStakerWithdrawalEvents", + "summary": "Retrieve all withdrawal events for a given staker address", + "description": "Returns a list of all withdrawal events for a given staker address.", "tags": ["Stakers"], "parameters": [ { @@ -7062,6 +9210,98 @@ }, "required": true }, + { + "in": "query", + "name": "txHash", + "description": "The transaction hash associated with the event", + "schema": { + "type": "string", + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The transaction hash associated with the event" + } + }, + { + "in": "query", + "name": "startAt", + "description": "Start date in ISO string format", + "schema": { + "type": "string", + "description": "Start date in ISO string format" + } + }, + { + "in": "query", + "name": "endAt", + "description": "End date in ISO string format", + "schema": { + "type": "string", + "description": "End date in ISO string format" + } + }, + { + "in": "query", + "name": "type", + "description": "The type of the withdrawal event", + "schema": { + "type": "string", + "enum": ["WITHDRAWAL_QUEUED", "WITHDRAWAL_COMPLETED"], + "description": "The type of the withdrawal event" + } + }, + { + "in": "query", + "name": "withdrawalRoot", + "description": "The withdrawal root associated with the event", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{64}$", + "description": "The withdrawal root associated with the event" + } + }, + { + "in": "query", + "name": "delegatedTo", + "description": "The address to which funds were delegated", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address to which funds were delegated" + } + }, + { + "in": "query", + "name": "withdrawer", + "description": "The address of the withdrawer", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the withdrawer" + } + }, + { + "in": "query", + "name": "withTokenData", + "description": "Toggle whether the route should return underlying token address and underlying value", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return underlying token address and underlying value", + "example": "false" + } + }, + { + "in": "query", + "name": "withEthValue", + "description": "Toggle whether the route should return value denominated in ETH", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return value denominated in ETH", + "example": "false" + } + }, { "in": "query", "name": "skip", @@ -7087,133 +9327,100 @@ ], "responses": { "200": { - "description": "The list of withdrawals.", + "description": "The withdrawal events found for the staker.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "withdrawalRoot": { - "type": "string", - "description": "The root hash of the withdrawal", - "example": "0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31" - }, - "nonce": { - "type": "number", - "description": "The nonce of the withdrawal", - "example": 0 - }, - "stakerAddress": { - "type": "string", - "description": "The address of the staker", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" - }, - "delegatedTo": { - "type": "string", - "description": "The operator address to which staking is delegated", - "example": "0x0000000000000000000000000000000000000000" - }, - "withdrawerAddress": { - "type": "string", - "description": "The address of the withdrawer", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" - }, - "shares": { - "type": "array", - "items": { - "type": "object", - "properties": { - "strategyAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the restaking strategy", - "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" - }, - "shares": { - "type": "string", - "description": "The amount of shares held in the strategy", - "example": "1277920000000000000000000" - } - }, - "required": ["strategyAddress", "shares"] - }, - "description": "The list of strategy shares", - "example": [ - { - "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", - "shares": "1000288824523326631" - } - ] - }, - "createdAtBlock": { - "type": "number", - "description": "The block number when the withdrawal was recorded by EigenExplorer", - "example": 19912470 - }, - "createdAt": { - "type": "string", - "description": "The time stamp when the withdrawal was recorded by EigenExplorer", - "example": "2024-07-07T23:53:35.000Z" - }, - "updatedAtBlock": { - "type": "number", - "description": "The block number when the withdrawal was last updated", - "example": 19912470 - }, - "updatedAt": { - "type": "string", - "description": "The time stamp when the withdrawal was last updated", - "example": "2024-07-07T23:53:35.000Z" - }, - "isCompleted": { - "type": "boolean", - "description": "Indicates if the withdrawal is completed", - "example": false - } - }, - "required": [ - "withdrawalRoot", - "nonce", - "stakerAddress", - "delegatedTo", - "withdrawerAddress", - "shares", - "createdAtBlock", - "createdAt", - "updatedAtBlock", - "updatedAt", - "isCompleted" - ] - } + "tx": { + "type": "string", + "description": "The transaction hash", + "example": "0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0" }, - "meta": { + "blockNumber": { + "type": "number", + "description": "The block number of the transaction", + "example": 21045085 + }, + "blockTime": { + "type": "string", + "description": "The block time of the transaction as an ISO 8601 string", + "example": "2024-10-25T20:41:11.000Z" + }, + "type": { + "type": "string", + "enum": ["WITHDRAWAL_QUEUED", "WITHDRAWAL_COMPLETED"], + "description": "The type of the event", + "example": "WITHDRAWAL_QUEUED" + }, + "args": { "type": "object", "properties": { - "total": { - "type": "number", - "description": "Total number of records in the database", - "example": 30 + "withdrawalRoot": { + "type": "string", + "description": "The root hash of the withdrawal", + "example": "0xe6cdf9110330e1648039cb98e680aeb9d1c63e022764186f1131eb9432605421" }, - "skip": { + "delegatedTo": { + "type": "string", + "description": "The address to which the staker was delegated when the withdrawal was initiated", + "example": "0x4cd2086e1d708e65db5d4f5712a9ca46ed4bbd0a" + }, + "withdrawer": { + "type": "string", + "description": "The address of the withdrawer, authorized to complete the withdrawal and receive the funds", + "example": "0x513ea5a99988252f3b2cd8382ac077d7fd26ef48" + }, + "nonce": { "type": "number", - "description": "The number of skiped records for this query", + "description": "The nonce of the withdrawal, ensuring unique hashes for otherwise identical withdrawals", "example": 0 }, - "take": { + "startBlock": { "type": "number", - "description": "The number of records returned for this query", - "example": 12 + "description": "The block number when the withdrawal was created", + "example": 21054925 + }, + "strategies": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategy": { + "type": "string", + "description": "The contract address of the restaking strategy", + "example": "0xacb55c530acdb2849e6d4f36992cd8c9d50ed8f7" + }, + "shares": { + "type": "string", + "description": "The amount of shares withdrawn for each strategy", + "example": "1000000000000000000" + }, + "underlyingToken": { + "type": "string", + "description": "The contract address of the token associated with this strategy", + "example": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84" + }, + "underlyingValue": { + "type": "number", + "description": "The value of the shares in terms of the underlying token", + "example": 5 + }, + "ethValue": { + "type": "number", + "description": "The value of the shares in ETH", + "example": 1 + } + }, + "required": ["strategy", "shares"] + } } }, - "required": ["total", "skip", "take"] + "required": ["withdrawalRoot"] } }, - "required": ["data", "meta"] + "required": ["tx", "blockNumber", "blockTime", "type", "args"] } } } @@ -7242,51 +9449,72 @@ } } }, - "/stakers/{address}/withdrawals/queued": { + "/deposits": { "get": { - "operationId": "getQueuedStakerWithdrawals", - "summary": "Retrieve queued withdrawals by staker address", - "description": "Returns all queued withdrawal data of the requested staker.", - "tags": ["Stakers"], + "operationId": "getAllDeposits", + "summary": "Retrieve all deposits", + "description": "Returns all deposit data, including the transaction hash, token address, and other relevant information.", + "tags": ["Deposits"], "parameters": [ { - "in": "path", - "name": "address", + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + }, + { + "in": "query", + "name": "stakerAddress", "description": "The address of the staker", "schema": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "description": "The address of the staker", - "example": "0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34" - }, - "required": true + "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + } }, { "in": "query", - "name": "skip", - "description": "The number of records to skip for pagination", + "name": "tokenAddress", + "description": "The address of the token deposited", "schema": { "type": "string", - "default": "0", - "description": "The number of records to skip for pagination", - "example": 0 + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address of the token deposited", + "example": "0xe95a203b1a91a908f9b9ce46459d101078c2c3cb" } }, { "in": "query", - "name": "take", - "description": "The number of records to return for pagination", + "name": "strategyAddress", + "description": "The contract address of the restaking strategy", "schema": { "type": "string", - "default": "12", - "description": "The number of records to return for pagination", - "example": 12 + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy", + "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" } } ], "responses": { "200": { - "description": "The list of queued withdrawals.", + "description": "The list of deposits.", "content": { "application/json": { "schema": { @@ -7297,57 +9525,30 @@ "items": { "type": "object", "properties": { - "withdrawalRoot": { + "transactionHash": { "type": "string", - "description": "The root hash of the withdrawal", - "example": "0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31" - }, - "nonce": { - "type": "number", - "description": "The nonce of the withdrawal", - "example": 0 + "description": "The hash of the transaction", + "example": "0x9d0a355df5a937516dfaed6721b0b461a16b8fad005f66d7dbf56b8a39136297" }, "stakerAddress": { "type": "string", "description": "The address of the staker", "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" }, - "delegatedTo": { + "tokenAddress": { "type": "string", - "description": "The operator address to which staking is delegated", - "example": "0x0000000000000000000000000000000000000000" + "description": "The address of the token", + "example": "0xe95a203b1a91a908f9b9ce46459d101078c2c3cb" }, - "withdrawerAddress": { + "strategyAddress": { "type": "string", - "description": "The address of the withdrawer", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + "description": "The contract address of the restaking strategy", + "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" }, "shares": { - "type": "array", - "items": { - "type": "object", - "properties": { - "strategyAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the restaking strategy", - "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" - }, - "shares": { - "type": "string", - "description": "The amount of shares held in the strategy", - "example": "1277920000000000000000000" - } - }, - "required": ["strategyAddress", "shares"] - }, - "description": "The list of strategy shares", - "example": [ - { - "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", - "shares": "1000288824523326631" - } - ] + "type": "string", + "description": "The amount of shares held in the strategy", + "example": "40000000000000000" }, "createdAtBlock": { "type": "number", @@ -7361,11 +9562,10 @@ } }, "required": [ - "withdrawalRoot", - "nonce", + "transactionHash", "stakerAddress", - "delegatedTo", - "withdrawerAddress", + "tokenAddress", + "strategyAddress", "shares", "createdAtBlock", "createdAt" @@ -7423,159 +9623,259 @@ } } }, - "/stakers/{address}/withdrawals/queued_withdrawable": { + "/rewards/strategies": { "get": { - "operationId": "getQueuedWithdrawableStakerWithdrawals", - "summary": "Retrieve queued and withdrawable withdrawals by staker address", - "description": "Returns all queued and withdrawable withdrawal data of the requested staker.", - "tags": ["Stakers"], - "parameters": [ - { - "in": "path", - "name": "address", - "description": "The address of the staker", - "schema": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The address of the staker", - "example": "0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34" - }, - "required": true - }, - { - "in": "query", - "name": "skip", - "description": "The number of records to skip for pagination", - "schema": { - "type": "string", - "default": "0", - "description": "The number of records to skip for pagination", - "example": 0 - } - }, - { - "in": "query", - "name": "take", - "description": "The number of records to return for pagination", - "schema": { - "type": "string", - "default": "12", - "description": "The number of records to return for pagination", - "example": 12 - } - } - ], + "operationId": "getStrategies", + "summary": "Retrieve all strategies with their reward tokens", + "description": "Returns a list of strategies with their corresponding reward tokens, including strategy addresses and associated token addresses.", + "tags": ["Rewards"], "responses": { "200": { - "description": "The list of queued and withdrawable withdrawals.", + "description": "List of strategies along with associated reward tokens.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "data": { + "strategies": { "type": "array", "items": { "type": "object", "properties": { - "withdrawalRoot": { - "type": "string", - "description": "The root hash of the withdrawal", - "example": "0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31" - }, - "nonce": { - "type": "number", - "description": "The nonce of the withdrawal", - "example": 0 - }, - "stakerAddress": { - "type": "string", - "description": "The address of the staker", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" - }, - "delegatedTo": { - "type": "string", - "description": "The operator address to which staking is delegated", - "example": "0x0000000000000000000000000000000000000000" - }, - "withdrawerAddress": { + "strategyAddress": { "type": "string", - "description": "The address of the withdrawer", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + "description": "The contract address of the restaking strategy", + "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" }, - "shares": { + "tokens": { "type": "array", "items": { - "type": "object", - "properties": { - "strategyAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the restaking strategy", - "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" - }, - "shares": { - "type": "string", - "description": "The amount of shares held in the strategy", - "example": "1277920000000000000000000" - } - }, - "required": ["strategyAddress", "shares"] + "type": "string" }, - "description": "The list of strategy shares", + "description": "List of reward token addresses associated with the strategy", "example": [ - { - "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", - "shares": "1000288824523326631" - } + "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + "0xba50933c268f567bdc86e1ac131be072c6b0b71a" ] - }, - "createdAtBlock": { - "type": "number", - "description": "The block number when the withdrawal was recorded by EigenExplorer", - "example": 19912470 - }, - "createdAt": { - "type": "string", - "description": "The time stamp when the withdrawal was recorded by EigenExplorer", - "example": "2024-07-07T23:53:35.000Z" } }, - "required": [ - "withdrawalRoot", - "nonce", - "stakerAddress", - "delegatedTo", - "withdrawerAddress", - "shares", - "createdAtBlock", - "createdAt" - ] + "required": ["strategyAddress", "tokens"] } }, - "meta": { + "total": { + "type": "number", + "description": "The total number of strategies", + "example": 15 + } + }, + "required": ["strategies", "total"] + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/events/delegation": { + "get": { + "operationId": "getDelegationEvents", + "summary": "Retrieve all delegation events", + "description": "Returns a list of all delegation events.", + "tags": ["Events"], + "parameters": [ + { + "in": "query", + "name": "txHash", + "description": "The transaction hash associated with the event", + "schema": { + "type": "string", + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The transaction hash associated with the event" + } + }, + { + "in": "query", + "name": "startAt", + "description": "Start date in ISO string format", + "schema": { + "type": "string", + "description": "Start date in ISO string format" + } + }, + { + "in": "query", + "name": "endAt", + "description": "End date in ISO string format", + "schema": { + "type": "string", + "description": "End date in ISO string format" + } + }, + { + "in": "query", + "name": "type", + "description": "The type of the delegation event", + "schema": { + "type": "string", + "enum": ["DELEGATION", "UNDELEGATION", "SHARES_INCREASED", "SHARES_DECREASED"], + "description": "The type of the delegation event" + } + }, + { + "in": "query", + "name": "strategyAddress", + "description": "The contract address of the restaking strategy", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy" + } + }, + { + "in": "query", + "name": "withTokenData", + "description": "Toggle whether the route should return underlying token address and underlying value", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return underlying token address and underlying value", + "example": "false" + } + }, + { + "in": "query", + "name": "withEthValue", + "description": "Toggle whether the route should return value denominated in ETH", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return value denominated in ETH", + "example": "false" + } + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + } + ], + "responses": { + "200": { + "description": "The delegation events found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tx": { + "type": "string", + "description": "The transaction hash", + "example": "0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0" + }, + "blockNumber": { + "type": "number", + "description": "The block number of the transaction", + "example": 21045085 + }, + "blockTime": { + "type": "string", + "description": "The block time of the transaction as an ISO 8601 string", + "example": "2024-10-25T20:41:11.000Z" + }, + "type": { + "type": "string", + "enum": [ + "DELEGATION", + "UNDELEGATION", + "SHARES_INCREASED", + "SHARES_DECREASED" + ], + "description": "The type of the event", + "example": "DELEGATION" + }, + "args": { "type": "object", "properties": { - "total": { - "type": "number", - "description": "Total number of records in the database", - "example": 30 + "operator": { + "type": "string", + "description": "The contract address of the AVS operator", + "example": "0x71c6f7ed8c2d4925d0baf16f6a85bb1736d412eb" }, - "skip": { - "type": "number", - "description": "The number of skiped records for this query", - "example": 0 + "staker": { + "type": "string", + "description": "The contract address of the staker", + "example": "0x42318adf0773b8af4aa8ed1670ea0af7761d07c7" }, - "take": { + "strategy": { + "type": "string", + "description": "The contract address of the restaking strategy", + "example": "0x93c4b944d05dfe6df7645a86cd2206016c51564d" + }, + "shares": { "type": "number", - "description": "The number of records returned for this query", - "example": 12 + "description": "The change in the operator's delegated shares, added or subtracted from the total.", + "example": 62816824424188010 } }, - "required": ["total", "skip", "take"] + "required": ["operator", "staker"] + }, + "underlyingToken": { + "type": "string", + "description": "The contract address of the token associated with this strategy", + "example": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84" + }, + "underlyingValue": { + "type": "number", + "description": "The value of the shares in terms of the underlying token", + "example": 5 + }, + "ethValue": { + "type": "number", + "description": "The value of the shares in ETH", + "example": 1 } }, - "required": ["data", "meta"] + "required": ["tx", "blockNumber", "blockTime", "type", "args"] } } } @@ -7604,171 +9904,224 @@ } } }, - "/stakers/{address}/withdrawals/completed": { + "/events/rewards": { "get": { - "operationId": "getCompletedStakerWithdrawals", - "summary": "Retrieve completed withdrawals by staker address", - "description": "Returns all completed withdrawal data of the requested staker.", - "tags": ["Stakers"], + "operationId": "getRewardsEvents", + "summary": "Retrieve all reward events", + "description": "Returns a list of all reward events.", + "tags": ["Events"], "parameters": [ { - "in": "path", - "name": "address", - "description": "The address of the staker", + "in": "query", + "name": "txHash", + "description": "The transaction hash associated with the event", + "schema": { + "type": "string", + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The transaction hash associated with the event" + } + }, + { + "in": "query", + "name": "startAt", + "description": "Start date in ISO string format", + "schema": { + "type": "string", + "description": "Start date in ISO string format" + } + }, + { + "in": "query", + "name": "endAt", + "description": "End date in ISO string format", + "schema": { + "type": "string", + "description": "End date in ISO string format" + } + }, + { + "in": "query", + "name": "rewardsSubmissionHash", + "description": "The reward submission hash associated with the event", + "schema": { + "type": "string", + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The reward submission hash associated with the event" + } + }, + { + "in": "query", + "name": "rewardsSubmissionToken", + "description": "The token address used for the rewards submission", "schema": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The address of the staker", - "example": "0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34" - }, - "required": true + "description": "The token address used for the rewards submission" + } }, { "in": "query", - "name": "skip", - "description": "The number of records to skip for pagination", + "name": "withIndividualAmount", + "description": "Toggle whether the route should return individual share amount for each strategy", "schema": { "type": "string", - "default": "0", - "description": "The number of records to skip for pagination", - "example": 0 + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return individual share amount for each strategy", + "example": "false" } }, { "in": "query", - "name": "take", - "description": "The number of records to return for pagination", + "name": "withEthValue", + "description": "Toggle whether the route should return value denominated in ETH", "schema": { "type": "string", - "default": "12", - "description": "The number of records to return for pagination", - "example": 12 + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return value denominated in ETH", + "example": "false" } - } - ], - "responses": { - "200": { - "description": "The list of completed withdrawals.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "withdrawalRoot": { - "type": "string", - "description": "The root hash of the withdrawal", - "example": "0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31" - }, - "nonce": { - "type": "number", - "description": "The nonce of the withdrawal", - "example": 0 - }, - "stakerAddress": { - "type": "string", - "description": "The address of the staker", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" - }, - "delegatedTo": { - "type": "string", - "description": "The operator address to which staking is delegated", - "example": "0x0000000000000000000000000000000000000000" - }, - "withdrawerAddress": { - "type": "string", - "description": "The address of the withdrawer", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" - }, - "shares": { - "type": "array", - "items": { - "type": "object", - "properties": { - "strategyAddress": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the restaking strategy", - "example": "0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0" - }, - "shares": { - "type": "string", - "description": "The amount of shares held in the strategy", - "example": "1277920000000000000000000" - } - }, - "required": ["strategyAddress", "shares"] - }, - "description": "The list of strategy shares", - "example": [ - { - "strategyAddress": "0x93c4b944d05dfe6df7645a86cd2206016c51564d", - "shares": "1000288824523326631" - } - ] - }, - "createdAtBlock": { - "type": "number", - "description": "The block number when the withdrawal was recorded by EigenExplorer", - "example": 19912470 - }, - "createdAt": { - "type": "string", - "description": "The time stamp when the withdrawal was recorded by EigenExplorer", - "example": "2024-07-07T23:53:35.000Z" - }, - "updatedAtBlock": { - "type": "number", - "description": "The block number when the withdrawal was last updated", - "example": 19912470 - }, - "updatedAt": { - "type": "string", - "description": "The time stamp when the withdrawal was last updated", - "example": "2024-07-07T23:53:35.000Z" - } - }, - "required": [ - "withdrawalRoot", - "nonce", - "stakerAddress", - "delegatedTo", - "withdrawerAddress", - "shares", - "createdAtBlock", - "createdAt", - "updatedAtBlock", - "updatedAt" - ] - } + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + } + ], + "responses": { + "200": { + "description": "The reward events found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tx": { + "type": "string", + "description": "The transaction hash", + "example": "0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0" }, - "meta": { + "blockNumber": { + "type": "number", + "description": "The block number of the transaction", + "example": 21045085 + }, + "blockTime": { + "type": "string", + "description": "The block time of the transaction as an ISO 8601 string", + "example": "2024-10-25T20:41:11.000Z" + }, + "type": { + "type": "string", + "enum": ["REWARDS"], + "description": "The type of the event", + "example": "REWARDS" + }, + "args": { "type": "object", "properties": { - "total": { + "avs": { + "type": "string", + "description": "AVS service manager contract address", + "example": "0x1de75eaab2df55d467494a172652579e6fa4540e" + }, + "submissionNonce": { "type": "number", - "description": "Total number of records in the database", - "example": 30 + "description": "The nonce of the rewards submission", + "example": 2 }, - "skip": { + "rewardsSubmissionHash": { + "type": "string", + "description": "The hash of the rewards submission", + "example": "0x1e391c015c923972811a27e1c6c3a874511e47033f1022021f29967a60ab2c87" + }, + "rewardsSubmissionToken": { + "type": "string", + "description": "The contract address of the token used for rewards distribution", + "example": "0xba50933c268f567bdc86e1ac131be072c6b0b71a" + }, + "rewardsSubmissionAmount": { + "type": "string", + "description": "The total amount of rewards allocated in this submission", + "example": "49000000000000000000000" + }, + "rewardsSubmissionStartTimeStamp": { "type": "number", - "description": "The number of skiped records for this query", - "example": 0 + "description": "The timestamp marking the start of this rewards distribution period", + "example": 1728518400 }, - "take": { + "rewardsSubmissionDuration": { "type": "number", - "description": "The number of records returned for this query", - "example": 12 + "description": "The duration (in seconds) over which the rewards are distributed", + "example": 6048000 + }, + "strategies": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategy": { + "type": "string", + "description": "The contract address of the restaking strategy", + "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" + }, + "multiplier": { + "type": "string", + "description": "The multiplier associated with this strategy", + "example": "1068966896363604679" + }, + "amount": { + "type": "string", + "description": "The amount of rewards allocated to this strategy from the total rewards in this submissionn", + "example": "3.7932452554246293e+21" + }, + "amountEthValue": { + "type": "number", + "description": "The value of the rewards amount allocated to this strategy in ETH", + "example": 0.0638779707245759 + } + }, + "required": ["strategy", "multiplier"] + }, + "description": "List of strategies involved in the rewards submission" } }, - "required": ["total", "skip", "take"] + "required": [ + "avs", + "submissionNonce", + "rewardsSubmissionHash", + "rewardsSubmissionToken", + "rewardsSubmissionAmount", + "rewardsSubmissionStartTimeStamp", + "rewardsSubmissionDuration", + "strategies" + ] + }, + "ethValue": { + "type": "number", + "description": "The value of the shares in ETH", + "example": 1 } }, - "required": ["data", "meta"] + "required": ["tx", "blockNumber", "blockTime", "type", "args"] } } } @@ -7797,24 +10150,84 @@ } } }, - "/stakers/{address}/deposits": { + "/events/deposit": { "get": { - "operationId": "getStakerDeposits", - "summary": "Retrieve all deposits by staker address", - "description": "Returns all deposit data of the requested staker, including the transaction hash, token address, strategy address, shares and other relevant information.", - "tags": ["Stakers"], + "operationId": "getDepositEvents", + "summary": "Retrieve all deposit events", + "description": "Returns a list of all deposit events.", + "tags": ["Events"], "parameters": [ { - "in": "path", - "name": "address", - "description": "The address of the staker", + "in": "query", + "name": "txHash", + "description": "The transaction hash associated with the event", + "schema": { + "type": "string", + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The transaction hash associated with the event" + } + }, + { + "in": "query", + "name": "startAt", + "description": "Start date in ISO string format", + "schema": { + "type": "string", + "description": "Start date in ISO string format" + } + }, + { + "in": "query", + "name": "endAt", + "description": "End date in ISO string format", + "schema": { + "type": "string", + "description": "End date in ISO string format" + } + }, + { + "in": "query", + "name": "tokenAddress", + "description": "The contract address of the token", "schema": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The address of the staker", - "example": "0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34" - }, - "required": true + "description": "The contract address of the token" + } + }, + { + "in": "query", + "name": "strategyAddress", + "description": "The contract address of the restaking strategy", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The contract address of the restaking strategy" + } + }, + { + "in": "query", + "name": "withTokenData", + "description": "Toggle whether the route should return underlying token address and underlying value", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return underlying token address and underlying value", + "example": "false" + } + }, + { + "in": "query", + "name": "withEthValue", + "description": "Toggle whether the route should return value denominated in ETH", + "schema": { + "type": "string", + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return value denominated in ETH", + "example": "false" + } }, { "in": "query", @@ -7841,87 +10254,76 @@ ], "responses": { "200": { - "description": "The list of deposits.", + "description": "The deposit events found.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "transactionHash": { - "type": "string", - "description": "The hash of the transaction", - "example": "0x9d0a355df5a937516dfaed6721b0b461a16b8fad005f66d7dbf56b8a39136297" - }, - "stakerAddress": { - "type": "string", - "description": "The address of the staker", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" - }, - "tokenAddress": { - "type": "string", - "description": "The address of the token", - "example": "0xe95a203b1a91a908f9b9ce46459d101078c2c3cb" - }, - "strategyAddress": { - "type": "string", - "description": "The contract address of the restaking strategy", - "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" - }, - "shares": { - "type": "string", - "description": "The amount of shares held in the strategy", - "example": "40000000000000000" - }, - "createdAtBlock": { - "type": "number", - "description": "The block number when the withdrawal was recorded by EigenExplorer", - "example": 19912470 - }, - "createdAt": { - "type": "string", - "description": "The time stamp when the withdrawal was recorded by EigenExplorer", - "example": "2024-07-07T23:53:35.000Z" - } - }, - "required": [ - "transactionHash", - "stakerAddress", - "tokenAddress", - "strategyAddress", - "shares", - "createdAtBlock", - "createdAt" - ] - } + "tx": { + "type": "string", + "description": "The transaction hash", + "example": "0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0" }, - "meta": { + "blockNumber": { + "type": "number", + "description": "The block number of the transaction", + "example": 21045085 + }, + "blockTime": { + "type": "string", + "description": "The block time of the transaction as an ISO 8601 string", + "example": "2024-10-25T20:41:11.000Z" + }, + "type": { + "type": "string", + "enum": ["DEPOSIT"], + "description": "The type of the event", + "example": "DEPOSIT" + }, + "args": { "type": "object", "properties": { - "total": { - "type": "number", - "description": "Total number of records in the database", - "example": 30 + "staker": { + "type": "string", + "description": "The contract address of the staker", + "example": "0xa0e32344405b2097e738718dc27d2c2daf73e706" }, - "skip": { - "type": "number", - "description": "The number of skiped records for this query", - "example": 0 + "token": { + "type": "string", + "description": "The contract address of the token deposited", + "example": "0xec53bf9167f50cdeb3ae105f56099aaab9061f83" }, - "take": { + "strategy": { + "type": "string", + "description": "The contract address of the restaking strategy", + "example": "0xacb55c530acdb2849e6d4f36992cd8c9d50ed8f7" + }, + "shares": { "type": "number", - "description": "The number of records returned for this query", - "example": 12 + "description": "The amount of new shares given to the staker in this strategy", + "example": 10190000000000000000 } }, - "required": ["total", "skip", "take"] + "required": ["staker", "token", "strategy", "shares"] + }, + "underlyingToken": { + "type": "string", + "description": "The contract address of the token associated with this strategy", + "example": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84" + }, + "underlyingValue": { + "type": "number", + "description": "The value of the shares in terms of the underlying token", + "example": 5 + }, + "ethValue": { + "type": "number", + "description": "The value of the shares in ETH", + "example": 1 } }, - "required": ["data", "meta"] + "required": ["tx", "blockNumber", "blockTime", "type", "args"] } } } @@ -7950,152 +10352,229 @@ } } }, - "/deposits": { + "/events/withdrawal": { "get": { - "operationId": "getAllDeposits", - "summary": "Retrieve all deposits", - "description": "Returns all deposit data, including the transaction hash, token address, and other relevant information.", - "tags": ["Deposits"], + "operationId": "getWithdrawalEvents", + "summary": "Retrieve all withdrawal events", + "description": "Returns a list of all withdrawal events.", + "tags": ["Events"], "parameters": [ { "in": "query", - "name": "skip", - "description": "The number of records to skip for pagination", + "name": "txHash", + "description": "The transaction hash associated with the event", + "schema": { + "type": "string", + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The transaction hash associated with the event" + } + }, + { + "in": "query", + "name": "startAt", + "description": "Start date in ISO string format", + "schema": { + "type": "string", + "description": "Start date in ISO string format" + } + }, + { + "in": "query", + "name": "endAt", + "description": "End date in ISO string format", + "schema": { + "type": "string", + "description": "End date in ISO string format" + } + }, + { + "in": "query", + "name": "type", + "description": "The type of the withdrawal event", + "schema": { + "type": "string", + "enum": ["WITHDRAWAL_QUEUED", "WITHDRAWAL_COMPLETED"], + "description": "The type of the withdrawal event" + } + }, + { + "in": "query", + "name": "withdrawalRoot", + "description": "The withdrawal root associated with the event", "schema": { "type": "string", - "default": "0", - "description": "The number of records to skip for pagination", - "example": 0 + "pattern": "^0x[a-fA-F0-9]{64}$", + "description": "The withdrawal root associated with the event" } }, { "in": "query", - "name": "take", - "description": "The number of records to return for pagination", + "name": "delegatedTo", + "description": "The address to which funds were delegated", "schema": { "type": "string", - "default": "12", - "description": "The number of records to return for pagination", - "example": 12 + "pattern": "^0x[a-fA-F0-9]{40}$", + "description": "The address to which funds were delegated" } }, { "in": "query", - "name": "stakerAddress", - "description": "The address of the staker", + "name": "withdrawer", + "description": "The address of the withdrawer", "schema": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The address of the staker", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" + "description": "The address of the withdrawer" } }, { "in": "query", - "name": "tokenAddress", - "description": "The address of the token deposited", + "name": "withTokenData", + "description": "Toggle whether the route should return underlying token address and underlying value", "schema": { "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The address of the token deposited", - "example": "0xe95a203b1a91a908f9b9ce46459d101078c2c3cb" + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return underlying token address and underlying value", + "example": "false" } }, { "in": "query", - "name": "strategyAddress", - "description": "The contract address of the restaking strategy", + "name": "withEthValue", + "description": "Toggle whether the route should return value denominated in ETH", "schema": { "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "description": "The contract address of the restaking strategy", - "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" + "enum": ["true", "false"], + "default": "false", + "description": "Toggle whether the route should return value denominated in ETH", + "example": "false" + } + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 } } ], "responses": { "200": { - "description": "The list of deposits.", + "description": "The withdrawal events found.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "transactionHash": { - "type": "string", - "description": "The hash of the transaction", - "example": "0x9d0a355df5a937516dfaed6721b0b461a16b8fad005f66d7dbf56b8a39136297" - }, - "stakerAddress": { - "type": "string", - "description": "The address of the staker", - "example": "0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd" - }, - "tokenAddress": { - "type": "string", - "description": "The address of the token", - "example": "0xe95a203b1a91a908f9b9ce46459d101078c2c3cb" - }, - "strategyAddress": { - "type": "string", - "description": "The contract address of the restaking strategy", - "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" - }, - "shares": { - "type": "string", - "description": "The amount of shares held in the strategy", - "example": "40000000000000000" - }, - "createdAtBlock": { - "type": "number", - "description": "The block number when the withdrawal was recorded by EigenExplorer", - "example": 19912470 - }, - "createdAt": { - "type": "string", - "description": "The time stamp when the withdrawal was recorded by EigenExplorer", - "example": "2024-07-07T23:53:35.000Z" - } - }, - "required": [ - "transactionHash", - "stakerAddress", - "tokenAddress", - "strategyAddress", - "shares", - "createdAtBlock", - "createdAt" - ] - } + "tx": { + "type": "string", + "description": "The transaction hash", + "example": "0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0" }, - "meta": { + "blockNumber": { + "type": "number", + "description": "The block number of the transaction", + "example": 21045085 + }, + "blockTime": { + "type": "string", + "description": "The block time of the transaction as an ISO 8601 string", + "example": "2024-10-25T20:41:11.000Z" + }, + "type": { + "type": "string", + "enum": ["WITHDRAWAL_QUEUED", "WITHDRAWAL_COMPLETED"], + "description": "The type of the event", + "example": "WITHDRAWAL_QUEUED" + }, + "args": { "type": "object", "properties": { - "total": { - "type": "number", - "description": "Total number of records in the database", - "example": 30 + "staker": { + "type": "string", + "description": "The contract address of the staker who initiated the withdrawal", + "example": "0x513ea5a99988252f3b2cd8382ac077d7fd26ef48" }, - "skip": { + "withdrawalRoot": { + "type": "string", + "description": "The root hash of the withdrawal", + "example": "0xe6cdf9110330e1648039cb98e680aeb9d1c63e022764186f1131eb9432605421" + }, + "delegatedTo": { + "type": "string", + "description": "The address to which the staker was delegated when the withdrawal was initiated", + "example": "0x4cd2086e1d708e65db5d4f5712a9ca46ed4bbd0a" + }, + "withdrawer": { + "type": "string", + "description": "The address of the withdrawer, authorized to complete the withdrawal and receive the funds", + "example": "0x513ea5a99988252f3b2cd8382ac077d7fd26ef48" + }, + "nonce": { "type": "number", - "description": "The number of skiped records for this query", + "description": "The nonce of the withdrawal, ensuring unique hashes for otherwise identical withdrawals", "example": 0 }, - "take": { + "startBlock": { "type": "number", - "description": "The number of records returned for this query", - "example": 12 + "description": "The block number when the withdrawal was created", + "example": 21054925 + }, + "strategies": { + "type": "array", + "items": { + "type": "object", + "properties": { + "strategy": { + "type": "string", + "description": "The contract address of the restaking strategy", + "example": "0xacb55c530acdb2849e6d4f36992cd8c9d50ed8f7" + }, + "shares": { + "type": "string", + "description": "The amount of shares withdrawn for each strategy", + "example": "1000000000000000000" + }, + "underlyingToken": { + "type": "string", + "description": "The contract address of the token associated with this strategy", + "example": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84" + }, + "underlyingValue": { + "type": "number", + "description": "The value of the shares in terms of the underlying token", + "example": 5 + }, + "ethValue": { + "type": "number", + "description": "The value of the shares in ETH", + "example": 1 + } + }, + "required": ["strategy", "shares"] + } } }, - "required": ["total", "skip", "take"] + "required": ["withdrawalRoot"] } }, - "required": ["data", "meta"] + "required": ["tx", "blockNumber", "blockTime", "type", "args"] } } } @@ -8124,52 +10603,127 @@ } } }, - "/rewards/strategies": { + "/events/registration-status": { "get": { - "operationId": "getStrategies", - "summary": "Retrieve all strategies with their reward tokens", - "description": "Returns a list of strategies with their corresponding reward tokens, including strategy addresses and associated token addresses.", - "tags": ["Rewards"], + "operationId": "getRegistrationEvents", + "summary": "Retrieve all registration events", + "description": "Returns a list of all registration events.", + "tags": ["Events"], + "parameters": [ + { + "in": "query", + "name": "txHash", + "description": "The transaction hash associated with the event", + "schema": { + "type": "string", + "pattern": "^0x([A-Fa-f0-9]{64})$", + "description": "The transaction hash associated with the event" + } + }, + { + "in": "query", + "name": "startAt", + "description": "Start date in ISO string format", + "schema": { + "type": "string", + "description": "Start date in ISO string format" + } + }, + { + "in": "query", + "name": "endAt", + "description": "End date in ISO string format", + "schema": { + "type": "string", + "description": "End date in ISO string format" + } + }, + { + "in": "query", + "name": "status", + "description": "The status of Registration", + "schema": { + "type": "string", + "enum": ["REGISTERED", "DEREGISTERED"], + "description": "The status of Registration" + } + }, + { + "in": "query", + "name": "skip", + "description": "The number of records to skip for pagination", + "schema": { + "type": "string", + "default": "0", + "description": "The number of records to skip for pagination", + "example": 0 + } + }, + { + "in": "query", + "name": "take", + "description": "The number of records to return for pagination", + "schema": { + "type": "string", + "default": "12", + "description": "The number of records to return for pagination", + "example": 12 + } + } + ], "responses": { "200": { - "description": "List of strategies along with associated reward tokens.", + "description": "The registration events found.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "strategies": { - "type": "array", - "items": { - "type": "object", - "properties": { - "strategyAddress": { - "type": "string", - "description": "The contract address of the restaking strategy", - "example": "0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6" - }, - "tokens": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of reward token addresses associated with the strategy", - "example": [ - "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", - "0xba50933c268f567bdc86e1ac131be072c6b0b71a" - ] - } - }, - "required": ["strategyAddress", "tokens"] - } + "tx": { + "type": "string", + "description": "The transaction hash", + "example": "0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0" }, - "total": { + "blockNumber": { "type": "number", - "description": "The total number of strategies", - "example": 15 + "description": "The block number of the transaction", + "example": 21045085 + }, + "blockTime": { + "type": "string", + "description": "The block time of the transaction as an ISO 8601 string", + "example": "2024-10-25T20:41:11.000Z" + }, + "type": { + "type": "string", + "enum": ["REGISTRATION_STATUS"], + "description": "The type of the event", + "example": "REGISTRATION_STATUS" + }, + "args": { + "type": "object", + "properties": { + "operator": { + "type": "string", + "description": "The contract address of the AVS operator", + "example": "0x9abce41e1486210ad83deb831afcdd214af5b49d" + }, + "avs": { + "type": "string", + "description": "AVS service manager contract address", + "example": "0xb73a87e8f7f9129816d40940ca19dfa396944c71" + }, + "status": { + "type": "string", + "enum": ["REGISTERED", "DEREGISTERED"], + "description": "The status of the registration", + "example": "REGISTERED" + } + }, + "required": ["operator", "avs", "status"] } }, - "required": ["strategies", "total"] + "required": ["tx", "blockNumber", "blockTime", "type", "args"] } } } diff --git a/packages/openapi/src/apiResponseSchema/events/eventsRespone.ts b/packages/openapi/src/apiResponseSchema/events/eventsRespone.ts new file mode 100644 index 00000000..12b35e0c --- /dev/null +++ b/packages/openapi/src/apiResponseSchema/events/eventsRespone.ts @@ -0,0 +1,267 @@ +import z from '../../../../api/src/schema/zod' + +export const EventDetailsSchema = z.object({ + tx: z.string().describe('The transaction hash').openapi({ + example: '0xae41958d0342a4485536f701c72723625131680f182eb21f95abdac6d74d0ff0' + }), + blockNumber: z + .number() + .describe('The block number of the transaction') + .openapi({ example: 21045085 }), + blockTime: z + .string() + .describe('The block time of the transaction as an ISO 8601 string') + .openapi({ + example: '2024-10-25T20:41:11.000Z' + }) +}) + +const StrategySchema = z.object({ + strategy: z.string().describe('The contract address of the restaking strategy').openapi({ + example: '0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6' + }), + multiplier: z + .string() + .describe('The multiplier associated with this strategy') + .openapi({ example: '1068966896363604679' }), + amount: z + .string() + .optional() + .describe( + 'The amount of rewards allocated to this strategy from the total rewards in this submissionn' + ) + .openapi({ example: '3.7932452554246293e+21' }), + amountEthValue: z + .number() + .optional() + .describe('The value of the rewards amount allocated to this strategy in ETH') + .openapi({ example: 0.0638779707245759 }) +}) + +const UnderlyingSchema = z.object({ + underlyingToken: z + .string() + .optional() + .describe('The contract address of the token associated with this strategy') + .openapi({ + example: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84' + }), + underlyingValue: z + .number() + .optional() + .describe('The value of the shares in terms of the underlying token') + .openapi({ example: 5.0 }) +}) + +const EthValueSchema = z.object({ + ethValue: z + .number() + .optional() + .describe('The value of the shares in ETH') + .openapi({ example: 1.0 }) +}) + +export const GlobalDelegationEventSchema = EventDetailsSchema.extend({ + type: z + .enum(['DELEGATION', 'UNDELEGATION', 'SHARES_INCREASED', 'SHARES_DECREASED']) + .describe('The type of the event') + .openapi({ example: 'DELEGATION' }), + args: z.object({ + operator: z.string().describe('The contract address of the AVS operator').openapi({ + example: '0x71c6f7ed8c2d4925d0baf16f6a85bb1736d412eb' + }), + staker: z.string().describe('The contract address of the staker').openapi({ + example: '0x42318adf0773b8af4aa8ed1670ea0af7761d07c7' + }), + strategy: z + .string() + .optional() + .describe('The contract address of the restaking strategy') + .openapi({ + example: '0x93c4b944d05dfe6df7645a86cd2206016c51564d' + }), + shares: z + .number() + .optional() + .describe( + "The change in the operator's delegated shares, added or subtracted from the total." + ) + .openapi({ example: 62816824424188010 }) + }), + ...UnderlyingSchema.shape, + ...EthValueSchema.shape +}) + +export const GlobalRewardsEventSchema = EventDetailsSchema.extend({ + type: z.enum(['REWARDS']).describe('The type of the event').openapi({ example: 'REWARDS' }), + args: z.object({ + avs: z.string().describe('AVS service manager contract address').openapi({ + example: '0x1de75eaab2df55d467494a172652579e6fa4540e' + }), + submissionNonce: z + .number() + .describe('The nonce of the rewards submission') + .openapi({ example: 2 }), + rewardsSubmissionHash: z.string().describe('The hash of the rewards submission').openapi({ + example: '0x1e391c015c923972811a27e1c6c3a874511e47033f1022021f29967a60ab2c87' + }), + rewardsSubmissionToken: z + .string() + .describe('The contract address of the token used for rewards distribution') + .openapi({ + example: '0xba50933c268f567bdc86e1ac131be072c6b0b71a' + }), + rewardsSubmissionAmount: z + .string() + .describe('The total amount of rewards allocated in this submission') + .openapi({ + example: '49000000000000000000000' + }), + rewardsSubmissionStartTimeStamp: z + .number() + .describe('The timestamp marking the start of this rewards distribution period') + .openapi({ + example: 1728518400 + }), + rewardsSubmissionDuration: z + .number() + .describe('The duration (in seconds) over which the rewards are distributed') + .openapi({ example: 6048000 }), + strategies: z + .array(StrategySchema) + .describe('List of strategies involved in the rewards submission') + }), + ...EthValueSchema.shape +}) + +export const GlobalDepositEventSchema = EventDetailsSchema.extend({ + type: z.enum(['DEPOSIT']).describe('The type of the event').openapi({ example: 'DEPOSIT' }), + args: z.object({ + staker: z.string().describe('The contract address of the staker').openapi({ + example: '0xa0e32344405b2097e738718dc27d2c2daf73e706' + }), + token: z.string().describe('The contract address of the token deposited').openapi({ + example: '0xec53bf9167f50cdeb3ae105f56099aaab9061f83' + }), + strategy: z.string().describe('The contract address of the restaking strategy').openapi({ + example: '0xacb55c530acdb2849e6d4f36992cd8c9d50ed8f7' + }), + shares: z + .number() + .describe('The amount of new shares given to the staker in this strategy') + .openapi({ example: 10190000000000000000 }) + }), + ...UnderlyingSchema.shape, + ...EthValueSchema.shape +}) + +export const GlobalWithdrawalEventSchema = EventDetailsSchema.extend({ + type: z + .enum(['WITHDRAWAL_QUEUED', 'WITHDRAWAL_COMPLETED']) + .describe('The type of the event') + .openapi({ example: 'WITHDRAWAL_QUEUED' }), + args: z.object({ + staker: z + .string() + .optional() + .describe('The contract address of the staker who initiated the withdrawal') + .openapi({ + example: '0x513ea5a99988252f3b2cd8382ac077d7fd26ef48' + }), + withdrawalRoot: z.string().describe('The root hash of the withdrawal').openapi({ + example: '0xe6cdf9110330e1648039cb98e680aeb9d1c63e022764186f1131eb9432605421' + }), + delegatedTo: z + .string() + .optional() + .describe('The address to which the staker was delegated when the withdrawal was initiated') + .openapi({ + example: '0x4cd2086e1d708e65db5d4f5712a9ca46ed4bbd0a' + }), + withdrawer: z + .string() + .optional() + .describe( + 'The address of the withdrawer, authorized to complete the withdrawal and receive the funds' + ) + .openapi({ + example: '0x513ea5a99988252f3b2cd8382ac077d7fd26ef48' + }), + nonce: z + .number() + .optional() + .describe( + 'The nonce of the withdrawal, ensuring unique hashes for otherwise identical withdrawals' + ) + .openapi({ example: 0 }), + startBlock: z + .number() + .optional() + .describe('The block number when the withdrawal was created') + .openapi({ example: 21054925 }), + strategies: z + .array( + z.object({ + strategy: z.string().describe('The contract address of the restaking strategy').openapi({ + example: '0xacb55c530acdb2849e6d4f36992cd8c9d50ed8f7' + }), + shares: z + .string() + .describe('The amount of shares withdrawn for each strategy') + .openapi({ example: '1000000000000000000' }), + ...UnderlyingSchema.shape, + ...EthValueSchema.shape + }) + ) + .optional() + }) +}) + +export const GlobalRegistrationEventSchema = EventDetailsSchema.extend({ + type: z + .enum(['REGISTRATION_STATUS']) + .describe('The type of the event') + .openapi({ example: 'REGISTRATION_STATUS' }), + args: z.object({ + operator: z.string().describe('The contract address of the AVS operator').openapi({ + example: '0x9abce41e1486210ad83deb831afcdd214af5b49d' + }), + avs: z.string().describe('AVS service manager contract address').openapi({ + example: '0xb73a87e8f7f9129816d40940ca19dfa396944c71' + }), + status: z + .enum(['REGISTERED', 'DEREGISTERED']) + .describe('The status of the registration') + .openapi({ + example: 'REGISTERED' + }) + }) +}) + +export const OperatorDelegationEventSchema = GlobalDelegationEventSchema.extend({ + args: GlobalDelegationEventSchema.shape.args.omit({ operator: true }) +}) + +export const AvsRewardsEventSchema = GlobalRewardsEventSchema.extend({ + args: GlobalRewardsEventSchema.shape.args.omit({ avs: true }) +}) + +export const StakerDelegationEventSchema = GlobalDelegationEventSchema.extend({ + args: GlobalDelegationEventSchema.shape.args.omit({ staker: true }) +}) + +export const StakerDepositEventSchema = GlobalDepositEventSchema.extend({ + args: GlobalDepositEventSchema.shape.args.omit({ staker: true }) +}) + +export const StakerWithdrawalEventSchema = GlobalWithdrawalEventSchema.extend({ + args: GlobalWithdrawalEventSchema.shape.args.omit({ staker: true }) +}) + +export const OperatorRegistrationEventSchema = GlobalRegistrationEventSchema.extend({ + args: GlobalRegistrationEventSchema.shape.args.omit({ operator: true }) +}) + +export const AvsRegistrationEventSchema = GlobalRegistrationEventSchema.extend({ + args: GlobalRegistrationEventSchema.shape.args.omit({ avs: true }) +}) diff --git a/packages/openapi/src/apiResponseSchema/events/util.ts b/packages/openapi/src/apiResponseSchema/events/util.ts new file mode 100644 index 00000000..3c892902 --- /dev/null +++ b/packages/openapi/src/apiResponseSchema/events/util.ts @@ -0,0 +1,9 @@ +import z from '../../../../api/src/schema/zod' + +// Refinement Utility Function +export const applyAllRefinements = ( + schema: z.ZodTypeAny, + refinements: Array<(schema: z.ZodTypeAny) => z.ZodTypeAny> +) => { + return refinements.reduce((refinedSchema, refineFn) => refineFn(refinedSchema), schema) +} diff --git a/packages/openapi/src/apiResponseSchema/withdrawals/withdrawalsResponseSchema.ts b/packages/openapi/src/apiResponseSchema/withdrawals/withdrawalsResponseSchema.ts index 2cee065f..79851593 100644 --- a/packages/openapi/src/apiResponseSchema/withdrawals/withdrawalsResponseSchema.ts +++ b/packages/openapi/src/apiResponseSchema/withdrawals/withdrawalsResponseSchema.ts @@ -5,18 +5,25 @@ export const WithdrawalsResponseSchema = z.object({ withdrawalRoot: z.string().describe('The root hash of the withdrawal').openapi({ example: '0x9e6728ef0a8ad6009107a886047aae35bc5ed7deaa68580b0d1f8f67e3e5ed31' }), - nonce: z.number().describe('The nonce of the withdrawal').openapi({ example: 0 }), + nonce: z + .number() + .describe( + 'The nonce of the withdrawal, ensuring unique hashes for otherwise identical withdrawals' + ) + .openapi({ example: 0 }), stakerAddress: z .string() - .describe('The address of the staker') + .describe('The contract address of the staker who initiated the withdrawal') .openapi({ example: '0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd' }), delegatedTo: z .string() - .describe('The operator address to which staking is delegated') + .describe('The address to which the staker was delegated when the withdrawal was initiated') .openapi({ example: '0x0000000000000000000000000000000000000000' }), withdrawerAddress: z .string() - .describe('The address of the withdrawer') + .describe( + 'The address of the withdrawer, authorized to complete the withdrawal and receive the funds' + ) .openapi({ example: '0x74ede5f75247fbdb9266d2b3a7be63b3db7611dd' }), shares: z .array(StrategySharesSchema) diff --git a/packages/openapi/src/documentBase.ts b/packages/openapi/src/documentBase.ts index ceb3c136..bd7fc2e9 100644 --- a/packages/openapi/src/documentBase.ts +++ b/packages/openapi/src/documentBase.ts @@ -9,6 +9,7 @@ import { stakersRoutes } from './routes/stakers' import { depositsRoutes } from './routes/deposits' import { historicalRoutes } from './routes/historical' import { rewardsRoutes } from './routes/rewards' +import { eventRoutes } from './routes/events' export const document = createDocument({ openapi: '3.0.3', @@ -36,7 +37,8 @@ export const document = createDocument({ ...withdrawalsRoutes, ...stakersRoutes, ...depositsRoutes, - ...rewardsRoutes + ...rewardsRoutes, + ...eventRoutes }, components: { schemas: {}, diff --git a/packages/openapi/src/routes/avs/getAvsRegistrationEvents.ts b/packages/openapi/src/routes/avs/getAvsRegistrationEvents.ts new file mode 100644 index 00000000..d0dd25b9 --- /dev/null +++ b/packages/openapi/src/routes/avs/getAvsRegistrationEvents.ts @@ -0,0 +1,45 @@ +import z from '../../../../api/src/schema/zod' +import { openApiErrorResponses } from '../../apiResponseSchema/base/errorResponses' +import { EthereumAddressSchema } from '../../../../api/src/schema/zod/schemas/base/ethereumAddress' +import { ZodOpenApiOperationObject } from 'zod-openapi' +import { AvsRegistrationEventSchema } from '../../apiResponseSchema/events/eventsRespone' +import { + refineStartEndDates, + AvsRegistrationEventQuerySchemaBase +} from '../../../../api/src/schema/zod/schemas/eventSchemas' +import { PaginationQuerySchema } from '../../../../api/src/schema/zod/schemas/paginationQuery' +import { applyAllRefinements } from '../../apiResponseSchema/events/util' + +const AvsAddressParam = z.object({ + address: EthereumAddressSchema.describe('AVS service manager contract address').openapi({ + example: '0x870679e138bcdf293b7ff14dd44b70fc97e12fc0' + }) +}) + +const CombinedQuerySchemaBase = z + .object({}) + .merge(AvsRegistrationEventQuerySchemaBase) + .merge(PaginationQuerySchema) +const CombinedQuerySchema = applyAllRefinements(CombinedQuerySchemaBase, [refineStartEndDates]) + +export const getAvsRegistrationEvents: ZodOpenApiOperationObject = { + operationId: 'getAvsRegistrationEvents', + summary: 'Retrieve all registration events for a given AVS address', + description: 'Returns a list of all registration events for a given AVS address.', + tags: ['AVS'], + requestParams: { + path: AvsAddressParam, + query: CombinedQuerySchema + }, + responses: { + '200': { + description: 'The registration events found for the AVS.', + content: { + 'application/json': { + schema: AvsRegistrationEventSchema + } + } + }, + ...openApiErrorResponses + } +} diff --git a/packages/openapi/src/routes/avs/getAvsRewardsEvents.ts b/packages/openapi/src/routes/avs/getAvsRewardsEvents.ts new file mode 100644 index 00000000..65ff9433 --- /dev/null +++ b/packages/openapi/src/routes/avs/getAvsRewardsEvents.ts @@ -0,0 +1,45 @@ +import z from '../../../../api/src/schema/zod' +import { openApiErrorResponses } from '../../apiResponseSchema/base/errorResponses' +import { EthereumAddressSchema } from '../../../../api/src/schema/zod/schemas/base/ethereumAddress' +import { ZodOpenApiOperationObject } from 'zod-openapi' +import { AvsRewardsEventSchema } from '../../apiResponseSchema/events/eventsRespone' +import { + refineStartEndDates, + RewardsEventQuerySchemaBase +} from '../../../../api/src/schema/zod/schemas/eventSchemas' +import { PaginationQuerySchema } from '../../../../api/src/schema/zod/schemas/paginationQuery' +import { applyAllRefinements } from '../../apiResponseSchema/events/util' + +const AvsAddressParam = z.object({ + address: EthereumAddressSchema.describe('AVS service manager contract address').openapi({ + example: '0x870679e138bcdf293b7ff14dd44b70fc97e12fc0' + }) +}) + +const CombinedQuerySchemaBase = z + .object({}) + .merge(RewardsEventQuerySchemaBase) + .merge(PaginationQuerySchema) +const CombinedQuerySchema = applyAllRefinements(CombinedQuerySchemaBase, [refineStartEndDates]) + +export const getAvsRewardsEvents: ZodOpenApiOperationObject = { + operationId: 'getAvsRewardsEvents', + summary: 'Retrieve all reward events for a given AVS address', + description: 'Returns a list of all reward events for a given AVS address.', + tags: ['AVS'], + requestParams: { + path: AvsAddressParam, + query: CombinedQuerySchema + }, + responses: { + '200': { + description: 'The reward events found for the AVS.', + content: { + 'application/json': { + schema: AvsRewardsEventSchema + } + } + }, + ...openApiErrorResponses + } +} diff --git a/packages/openapi/src/routes/avs/index.ts b/packages/openapi/src/routes/avs/index.ts index a54942d1..d2598629 100644 --- a/packages/openapi/src/routes/avs/index.ts +++ b/packages/openapi/src/routes/avs/index.ts @@ -4,7 +4,9 @@ import { getAllAvs } from './getAllAvs' import { getAvsByAddress } from './getAvsByAddress' import { getAvsStakersByAddress } from './getAvsStakersByAddress' import { getAvsOperatorsByAddress } from './getAvsOperatorsByAddress' -import { getAvsRewards } from './getAVSRewards' +import { getAvsRewards } from './getAvsRewards' +import { getAvsRewardsEvents } from './getAvsRewardsEvents' +import { getAvsRegistrationEvents } from './getAvsRegistrationEvents' export const avsRoutes: ZodOpenApiPathsObject = { '/avs': { get: getAllAvs }, @@ -14,5 +16,7 @@ export const avsRoutes: ZodOpenApiPathsObject = { '/avs/{address}': { get: getAvsByAddress }, '/avs/{address}/stakers': { get: getAvsStakersByAddress }, '/avs/{address}/operators': { get: getAvsOperatorsByAddress }, - '/avs/{address}/rewards': { get: getAvsRewards } + '/avs/{address}/rewards': { get: getAvsRewards }, + '/avs/{address}/events/rewards': { get: getAvsRewardsEvents }, + '/avs/{address}/events/registration-status': { get: getAvsRegistrationEvents } } diff --git a/packages/openapi/src/routes/events/getDelegationEvents.ts b/packages/openapi/src/routes/events/getDelegationEvents.ts new file mode 100644 index 00000000..8e7766f6 --- /dev/null +++ b/packages/openapi/src/routes/events/getDelegationEvents.ts @@ -0,0 +1,49 @@ +import z from '../../../../api/src/schema/zod' +import { openApiErrorResponses } from '../../apiResponseSchema/base/errorResponses' +import { ZodOpenApiOperationObject } from 'zod-openapi' +import { GlobalDelegationEventSchema } from '../../apiResponseSchema/events/eventsRespone' +import { + DelegationEventQuerySchemaBase, + refineDelegationTypeRestrictions, + refineStartEndDates, + refineWithEthValueRequiresTokenData +} from '../../../../api/src/schema/zod/schemas/eventSchemas' +import { PaginationQuerySchema } from '../../../../api/src/schema/zod/schemas/paginationQuery' +import { applyAllRefinements } from '../../apiResponseSchema/events/util' +import { + WithTokenDataQuerySchema, + WithEthValueQuerySchema +} from '../../../../api/src/schema/zod/schemas/withTokenDataQuery' + +const CombinedQuerySchemaBase = z + .object({}) + .merge(DelegationEventQuerySchemaBase) + .merge(WithTokenDataQuerySchema) + .merge(WithEthValueQuerySchema) + .merge(PaginationQuerySchema) +const CombinedQuerySchema = applyAllRefinements(CombinedQuerySchemaBase, [ + refineStartEndDates, + refineWithEthValueRequiresTokenData, + refineDelegationTypeRestrictions +]) + +export const getDelegationEvents: ZodOpenApiOperationObject = { + operationId: 'getDelegationEvents', + summary: 'Retrieve all delegation events', + description: 'Returns a list of all delegation events.', + tags: ['Events'], + requestParams: { + query: CombinedQuerySchema + }, + responses: { + '200': { + description: 'The delegation events found.', + content: { + 'application/json': { + schema: GlobalDelegationEventSchema + } + } + }, + ...openApiErrorResponses + } +} diff --git a/packages/openapi/src/routes/events/getDepositEvents.ts b/packages/openapi/src/routes/events/getDepositEvents.ts new file mode 100644 index 00000000..3f658c37 --- /dev/null +++ b/packages/openapi/src/routes/events/getDepositEvents.ts @@ -0,0 +1,41 @@ +import z from '../../../../api/src/schema/zod' +import { openApiErrorResponses } from '../../apiResponseSchema/base/errorResponses' +import { ZodOpenApiOperationObject } from 'zod-openapi' +import { GlobalDepositEventSchema } from '../../apiResponseSchema/events/eventsRespone' +import { + DepositEventQuerySchemaBase, + refineStartEndDates, + refineWithEthValueRequiresTokenData +} from '../../../../api/src/schema/zod/schemas/eventSchemas' +import { PaginationQuerySchema } from '../../../../api/src/schema/zod/schemas/paginationQuery' +import { applyAllRefinements } from '../../apiResponseSchema/events/util' + +const CombinedQuerySchemaBase = z + .object({}) + .merge(DepositEventQuerySchemaBase) + .merge(PaginationQuerySchema) +const CombinedQuerySchema = applyAllRefinements(CombinedQuerySchemaBase, [ + refineStartEndDates, + refineWithEthValueRequiresTokenData +]) + +export const getDepositEvents: ZodOpenApiOperationObject = { + operationId: 'getDepositEvents', + summary: 'Retrieve all deposit events', + description: 'Returns a list of all deposit events.', + tags: ['Events'], + requestParams: { + query: CombinedQuerySchema + }, + responses: { + '200': { + description: 'The deposit events found.', + content: { + 'application/json': { + schema: GlobalDepositEventSchema + } + } + }, + ...openApiErrorResponses + } +} diff --git a/packages/openapi/src/routes/events/getRegistrationEvents.ts b/packages/openapi/src/routes/events/getRegistrationEvents.ts new file mode 100644 index 00000000..9e98cb3d --- /dev/null +++ b/packages/openapi/src/routes/events/getRegistrationEvents.ts @@ -0,0 +1,37 @@ +import z from '../../../../api/src/schema/zod' +import { openApiErrorResponses } from '../../apiResponseSchema/base/errorResponses' +import { ZodOpenApiOperationObject } from 'zod-openapi' +import { GlobalRegistrationEventSchema } from '../../apiResponseSchema/events/eventsRespone' +import { + refineStartEndDates, + RegistrationEventQuerySchemaBase +} from '../../../../api/src/schema/zod/schemas/eventSchemas' +import { PaginationQuerySchema } from '../../../../api/src/schema/zod/schemas/paginationQuery' +import { applyAllRefinements } from '../../apiResponseSchema/events/util' + +const CombinedQuerySchemaBase = z + .object({}) + .merge(RegistrationEventQuerySchemaBase) + .merge(PaginationQuerySchema) +const CombinedQuerySchema = applyAllRefinements(CombinedQuerySchemaBase, [refineStartEndDates]) + +export const getRegistrationsEvents: ZodOpenApiOperationObject = { + operationId: 'getRegistrationEvents', + summary: 'Retrieve all registration events', + description: 'Returns a list of all registration events.', + tags: ['Events'], + requestParams: { + query: CombinedQuerySchema + }, + responses: { + '200': { + description: 'The registration events found.', + content: { + 'application/json': { + schema: GlobalRegistrationEventSchema + } + } + }, + ...openApiErrorResponses + } +} diff --git a/packages/openapi/src/routes/events/getRewardsEvents.ts b/packages/openapi/src/routes/events/getRewardsEvents.ts new file mode 100644 index 00000000..4d7858a6 --- /dev/null +++ b/packages/openapi/src/routes/events/getRewardsEvents.ts @@ -0,0 +1,37 @@ +import z from '../../../../api/src/schema/zod' +import { openApiErrorResponses } from '../../apiResponseSchema/base/errorResponses' +import { ZodOpenApiOperationObject } from 'zod-openapi' +import { GlobalRewardsEventSchema } from '../../apiResponseSchema/events/eventsRespone' +import { + refineStartEndDates, + RewardsEventQuerySchemaBase +} from '../../../../api/src/schema/zod/schemas/eventSchemas' +import { PaginationQuerySchema } from '../../../../api/src/schema/zod/schemas/paginationQuery' +import { applyAllRefinements } from '../../apiResponseSchema/events/util' + +const CombinedQuerySchemaBase = z + .object({}) + .merge(RewardsEventQuerySchemaBase) + .merge(PaginationQuerySchema) +const CombinedQuerySchema = applyAllRefinements(CombinedQuerySchemaBase, [refineStartEndDates]) + +export const getRewardsEvents: ZodOpenApiOperationObject = { + operationId: 'getRewardsEvents', + summary: 'Retrieve all reward events', + description: 'Returns a list of all reward events.', + tags: ['Events'], + requestParams: { + query: CombinedQuerySchema + }, + responses: { + '200': { + description: 'The reward events found.', + content: { + 'application/json': { + schema: GlobalRewardsEventSchema + } + } + }, + ...openApiErrorResponses + } +} diff --git a/packages/openapi/src/routes/events/getWithdrawalEvents.ts b/packages/openapi/src/routes/events/getWithdrawalEvents.ts new file mode 100644 index 00000000..5e818c32 --- /dev/null +++ b/packages/openapi/src/routes/events/getWithdrawalEvents.ts @@ -0,0 +1,43 @@ +import z from '../../../../api/src/schema/zod' +import { openApiErrorResponses } from '../../apiResponseSchema/base/errorResponses' +import { ZodOpenApiOperationObject } from 'zod-openapi' +import { GlobalWithdrawalEventSchema } from '../../apiResponseSchema/events/eventsRespone' +import { + refineStartEndDates, + refineWithdrawalTypeRestrictions, + refineWithEthValueRequiresTokenData, + WithdrawalEventQuerySchemaBase +} from '../../../../api/src/schema/zod/schemas/eventSchemas' +import { PaginationQuerySchema } from '../../../../api/src/schema/zod/schemas/paginationQuery' +import { applyAllRefinements } from '../../apiResponseSchema/events/util' + +const CombinedQuerySchemaBase = z + .object({}) + .merge(WithdrawalEventQuerySchemaBase) + .merge(PaginationQuerySchema) +const CombinedQuerySchema = applyAllRefinements(CombinedQuerySchemaBase, [ + refineStartEndDates, + refineWithEthValueRequiresTokenData, + refineWithdrawalTypeRestrictions +]) + +export const getWithdrawalEvents: ZodOpenApiOperationObject = { + operationId: 'getWithdrawalEvents', + summary: 'Retrieve all withdrawal events', + description: 'Returns a list of all withdrawal events.', + tags: ['Events'], + requestParams: { + query: CombinedQuerySchema + }, + responses: { + '200': { + description: 'The withdrawal events found.', + content: { + 'application/json': { + schema: GlobalWithdrawalEventSchema + } + } + }, + ...openApiErrorResponses + } +} diff --git a/packages/openapi/src/routes/events/index.ts b/packages/openapi/src/routes/events/index.ts new file mode 100644 index 00000000..5de225fc --- /dev/null +++ b/packages/openapi/src/routes/events/index.ts @@ -0,0 +1,14 @@ +import { ZodOpenApiPathsObject } from 'zod-openapi' +import { getDelegationEvents } from './getDelegationEvents' +import { getDepositEvents } from './getDepositEvents' +import { getRewardsEvents } from './getRewardsEvents' +import { getWithdrawalEvents } from './getWithdrawalEvents' +import { getRegistrationsEvents } from './getRegistrationEvents' + +export const eventRoutes: ZodOpenApiPathsObject = { + '/events/delegation': { get: getDelegationEvents }, + '/events/rewards': { get: getRewardsEvents }, + '/events/deposit': { get: getDepositEvents }, + '/events/withdrawal': { get: getWithdrawalEvents }, + '/events/registration-status': { get: getRegistrationsEvents } +} diff --git a/packages/openapi/src/routes/operators/getOperatorDelegationEvents.ts b/packages/openapi/src/routes/operators/getOperatorDelegationEvents.ts new file mode 100644 index 00000000..9223f302 --- /dev/null +++ b/packages/openapi/src/routes/operators/getOperatorDelegationEvents.ts @@ -0,0 +1,51 @@ +import { openApiErrorResponses } from '../../apiResponseSchema/base/errorResponses' +import z from '../../../../api/src/schema/zod' +import { EthereumAddressSchema } from '../../../../api/src/schema/zod/schemas/base/ethereumAddress' +import { ZodOpenApiOperationObject } from 'zod-openapi' +import { OperatorDelegationEventSchema } from '../../apiResponseSchema/events/eventsRespone' +import { + OperatorDelegationEventQuerySchemaBase, + refineDelegationTypeRestrictions, + refineStartEndDates, + refineWithEthValueRequiresTokenData +} from '../../../../api/src/schema/zod/schemas/eventSchemas' +import { PaginationQuerySchema } from '../../../../api/src/schema/zod/schemas/paginationQuery' +import { applyAllRefinements } from '../../apiResponseSchema/events/util' + +const OperatorAddressParam = z.object({ + address: EthereumAddressSchema.describe('The address of the operator').openapi({ + example: '0x00107cfdeaddc0a3160ed2f6fedd627f313e7b1a' + }) +}) + +const CombinedQuerySchemaBase = z + .object({}) + .merge(OperatorDelegationEventQuerySchemaBase) + .merge(PaginationQuerySchema) +const CombinedQuerySchema = applyAllRefinements(CombinedQuerySchemaBase, [ + refineStartEndDates, + refineWithEthValueRequiresTokenData, + refineDelegationTypeRestrictions +]) + +export const getOperatorDelegationEvents: ZodOpenApiOperationObject = { + operationId: 'getOperatorDelegationEvents', + summary: 'Retrieve all delegation events for a given operator address', + description: 'Returns a list of all delegation events for a given operator address.', + tags: ['Operators'], + requestParams: { + path: OperatorAddressParam, + query: CombinedQuerySchema + }, + responses: { + '200': { + description: 'The delegation events found for the operator.', + content: { + 'application/json': { + schema: OperatorDelegationEventSchema + } + } + }, + ...openApiErrorResponses + } +} diff --git a/packages/openapi/src/routes/operators/getOperatorRegistrationEvents.ts b/packages/openapi/src/routes/operators/getOperatorRegistrationEvents.ts new file mode 100644 index 00000000..7c89cdf3 --- /dev/null +++ b/packages/openapi/src/routes/operators/getOperatorRegistrationEvents.ts @@ -0,0 +1,46 @@ +import { openApiErrorResponses } from '../../apiResponseSchema/base/errorResponses' +import z from '../../../../api/src/schema/zod' +import { EthereumAddressSchema } from '../../../../api/src/schema/zod/schemas/base/ethereumAddress' +import { ZodOpenApiOperationObject } from 'zod-openapi' +import { OperatorRegistrationEventSchema } from '../../apiResponseSchema/events/eventsRespone' +import { + OperatorRegistrationEventQuerySchemaBase, + refineStartEndDates +} from '../../../../api/src/schema/zod/schemas/eventSchemas' +import { PaginationQuerySchema } from '../../../../api/src/schema/zod/schemas/paginationQuery' +import { applyAllRefinements } from '../../apiResponseSchema/events/util' + +const OperatorAddressParam = z.object({ + address: EthereumAddressSchema.describe('The address of the operator').openapi({ + example: '0x00107cfdeaddc0a3160ed2f6fedd627f313e7b1a' + }) +}) + +const CombinedQuerySchemaBase = z + .object({}) + .merge(OperatorRegistrationEventQuerySchemaBase) + .merge(PaginationQuerySchema) + +const CombinedQuerySchema = applyAllRefinements(CombinedQuerySchemaBase, [refineStartEndDates]) + +export const getOperatorRegistrationEvents: ZodOpenApiOperationObject = { + operationId: 'getOperatorRegistrationEvents', + summary: 'Retrieve all registration events for a given operator address', + description: 'Returns a list of all registration events for a given operator address.', + tags: ['Operators'], + requestParams: { + path: OperatorAddressParam, + query: CombinedQuerySchema + }, + responses: { + '200': { + description: 'The registration events found for the operator.', + content: { + 'application/json': { + schema: OperatorRegistrationEventSchema + } + } + }, + ...openApiErrorResponses + } +} diff --git a/packages/openapi/src/routes/operators/index.ts b/packages/openapi/src/routes/operators/index.ts index 0b5fa5e0..fb50f65e 100644 --- a/packages/openapi/src/routes/operators/index.ts +++ b/packages/openapi/src/routes/operators/index.ts @@ -3,10 +3,14 @@ import { getAllOperators } from './getAllOperators' import { getOperatorByAddress } from './getOperatorByAddress' import { getAllOperatorAddresses } from './getAllOperatorAddresses' import { getOperatorRewards } from './getOperatorRewards' +import { getOperatorDelegationEvents } from './getOperatorDelegationEvents' +import { getOperatorRegistrationEvents } from './getOperatorRegistrationEvents' export const operatorsRoutes: ZodOpenApiPathsObject = { '/operators': { get: getAllOperators }, '/operators/addresses': { get: getAllOperatorAddresses }, '/operators/{address}': { get: getOperatorByAddress }, - '/operators/{address}/rewards': { get: getOperatorRewards } + '/operators/{address}/rewards': { get: getOperatorRewards }, + '/operators/{address}/events/delegation': { get: getOperatorDelegationEvents }, + '/operators/{address}/events/registration-status': { get: getOperatorRegistrationEvents } } diff --git a/packages/openapi/src/routes/stakers/getStakerDelegationEvents.ts b/packages/openapi/src/routes/stakers/getStakerDelegationEvents.ts new file mode 100644 index 00000000..553e930e --- /dev/null +++ b/packages/openapi/src/routes/stakers/getStakerDelegationEvents.ts @@ -0,0 +1,51 @@ +import z from '../../../../api/src/schema/zod' +import { ZodOpenApiOperationObject } from 'zod-openapi' +import { openApiErrorResponses } from '../../apiResponseSchema/base/errorResponses' +import { PaginationQuerySchema } from '../../../../api/src/schema/zod/schemas/paginationQuery' +import { EthereumAddressSchema } from '../../../../api/src/schema/zod/schemas/base/ethereumAddress' +import { StakerDelegationEventSchema } from '../../apiResponseSchema/events/eventsRespone' +import { + refineDelegationTypeRestrictions, + refineStartEndDates, + refineWithEthValueRequiresTokenData, + StakerDelegationEventQuerySchemaBase +} from '../../../../api/src/schema/zod/schemas/eventSchemas' +import { applyAllRefinements } from '../../apiResponseSchema/events/util' + +const StakerAddressParam = z.object({ + address: EthereumAddressSchema.describe('The address of the staker').openapi({ + example: '0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34' + }) +}) + +const CombinedQuerySchemaBase = z + .object({}) + .merge(StakerDelegationEventQuerySchemaBase) + .merge(PaginationQuerySchema) +const CombinedQuerySchema = applyAllRefinements(CombinedQuerySchemaBase, [ + refineStartEndDates, + refineWithEthValueRequiresTokenData, + refineDelegationTypeRestrictions +]) + +export const getStakerDelegationEvents: ZodOpenApiOperationObject = { + operationId: 'getStakerDelegationEvents', + summary: 'Retrieve all delegation events for a given staker address', + description: 'Returns a list of all delegation events for a given staker address.', + tags: ['Stakers'], + requestParams: { + path: StakerAddressParam, + query: CombinedQuerySchema + }, + responses: { + '200': { + description: 'The delegation events found for the staker.', + content: { + 'application/json': { + schema: StakerDelegationEventSchema + } + } + }, + ...openApiErrorResponses + } +} diff --git a/packages/openapi/src/routes/stakers/getStakerDepositEvents.ts b/packages/openapi/src/routes/stakers/getStakerDepositEvents.ts new file mode 100644 index 00000000..8e272747 --- /dev/null +++ b/packages/openapi/src/routes/stakers/getStakerDepositEvents.ts @@ -0,0 +1,49 @@ +import z from '../../../../api/src/schema/zod' +import { ZodOpenApiOperationObject } from 'zod-openapi' +import { openApiErrorResponses } from '../../apiResponseSchema/base/errorResponses' +import { PaginationQuerySchema } from '../../../../api/src/schema/zod/schemas/paginationQuery' +import { EthereumAddressSchema } from '../../../../api/src/schema/zod/schemas/base/ethereumAddress' +import { StakerDepositEventSchema } from '../../apiResponseSchema/events/eventsRespone' +import { + DepositEventQuerySchemaBase, + refineStartEndDates, + refineWithEthValueRequiresTokenData +} from '../../../../api/src/schema/zod/schemas/eventSchemas' +import { applyAllRefinements } from '../../apiResponseSchema/events/util' + +const StakerAddressParam = z.object({ + address: EthereumAddressSchema.describe('The address of the staker').openapi({ + example: '0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34' + }) +}) + +const CombinedQuerySchemaBase = z + .object({}) + .merge(DepositEventQuerySchemaBase) + .merge(PaginationQuerySchema) +const CombinedQuerySchema = applyAllRefinements(CombinedQuerySchemaBase, [ + refineStartEndDates, + refineWithEthValueRequiresTokenData +]) + +export const getStakerDepositEvents: ZodOpenApiOperationObject = { + operationId: 'getStakerDepositEvents', + summary: 'Retrieve all deposit events for a given staker address', + description: 'Returns a list of all deposit events for a given staker address.', + tags: ['Stakers'], + requestParams: { + path: StakerAddressParam, + query: CombinedQuerySchema + }, + responses: { + '200': { + description: 'The deposit events found for the staker.', + content: { + 'application/json': { + schema: StakerDepositEventSchema + } + } + }, + ...openApiErrorResponses + } +} diff --git a/packages/openapi/src/routes/stakers/getStakerWithdrawalEvents.ts b/packages/openapi/src/routes/stakers/getStakerWithdrawalEvents.ts new file mode 100644 index 00000000..c9c0211b --- /dev/null +++ b/packages/openapi/src/routes/stakers/getStakerWithdrawalEvents.ts @@ -0,0 +1,51 @@ +import z from '../../../../api/src/schema/zod' +import { ZodOpenApiOperationObject } from 'zod-openapi' +import { openApiErrorResponses } from '../../apiResponseSchema/base/errorResponses' +import { PaginationQuerySchema } from '../../../../api/src/schema/zod/schemas/paginationQuery' +import { EthereumAddressSchema } from '../../../../api/src/schema/zod/schemas/base/ethereumAddress' +import { StakerWithdrawalEventSchema } from '../../apiResponseSchema/events/eventsRespone' +import { + refineStartEndDates, + refineWithdrawalTypeRestrictions, + refineWithEthValueRequiresTokenData, + WithdrawalEventQuerySchemaBase +} from '../../../../api/src/schema/zod/schemas/eventSchemas' +import { applyAllRefinements } from '../../apiResponseSchema/events/util' + +const StakerAddressParam = z.object({ + address: EthereumAddressSchema.describe('The address of the staker').openapi({ + example: '0x9791fdb4e9c0495efc5a1f3f9271ef226251eb34' + }) +}) + +const CombinedQuerySchemaBase = z + .object({}) + .merge(WithdrawalEventQuerySchemaBase) + .merge(PaginationQuerySchema) +const CombinedQuerySchema = applyAllRefinements(CombinedQuerySchemaBase, [ + refineStartEndDates, + refineWithEthValueRequiresTokenData, + refineWithdrawalTypeRestrictions +]) + +export const getStakerWithdrawalEvents: ZodOpenApiOperationObject = { + operationId: 'getStakerWithdrawalEvents', + summary: 'Retrieve all withdrawal events for a given staker address', + description: 'Returns a list of all withdrawal events for a given staker address.', + tags: ['Stakers'], + requestParams: { + path: StakerAddressParam, + query: CombinedQuerySchema + }, + responses: { + '200': { + description: 'The withdrawal events found for the staker.', + content: { + 'application/json': { + schema: StakerWithdrawalEventSchema + } + } + }, + ...openApiErrorResponses + } +} diff --git a/packages/openapi/src/routes/stakers/index.ts b/packages/openapi/src/routes/stakers/index.ts index fbf95bde..270beb37 100644 --- a/packages/openapi/src/routes/stakers/index.ts +++ b/packages/openapi/src/routes/stakers/index.ts @@ -6,6 +6,9 @@ import { getQueuedStakerWithdrawals } from './getQueuedStakerWithdrawals' import { getQueuedWithdrawableStakerWithdrawals } from './getQueuedWithdrawableStakerWithdrawals' import { getCompletedStakerWithdrawals } from './getCompletedStakerWithdrawals' import { getStakerDeposits } from './getStakerDeposits' +import { getStakerDelegationEvents } from './getStakerDelegationEvents' +import { getStakerDepositEvents } from './getStakerDepositEvents' +import { getStakerWithdrawalEvents } from './getStakerWithdrawalEvents' export const stakersRoutes: ZodOpenApiPathsObject = { '/stakers': { get: getAllStakers }, @@ -24,5 +27,14 @@ export const stakersRoutes: ZodOpenApiPathsObject = { }, '/stakers/{address}/deposits': { get: getStakerDeposits + }, + '/stakers/{address}/events/delegation': { + get: getStakerDelegationEvents + }, + '/stakers/{address}/events/deposit': { + get: getStakerDepositEvents + }, + '/stakers/{address}/events/withdrawal': { + get: getStakerWithdrawalEvents } }