Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: add LoadContract gRPC endpoint #37

Merged
merged 7 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gen/api-ts/eigenlayer/sidecar/v1/sidecar/rpc.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ export class Rpc {
static About(req: EigenlayerSidecarV1SidecarSidecar.AboutRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1SidecarSidecar.AboutResponse> {
return fm.fetchReq<EigenlayerSidecarV1SidecarSidecar.AboutRequest, EigenlayerSidecarV1SidecarSidecar.AboutResponse>(`/rpc/v1/about?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
}
static LoadContract(req: EigenlayerSidecarV1SidecarSidecar.LoadContractRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1SidecarSidecar.LoadContractResponse> {
return fm.fetchReq<EigenlayerSidecarV1SidecarSidecar.LoadContractRequest, EigenlayerSidecarV1SidecarSidecar.LoadContractResponse>(`/rpc/v1/load-contract`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
}
static LoadContracts(req: EigenlayerSidecarV1SidecarSidecar.LoadContractsRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1SidecarSidecar.LoadContractsResponse> {
return fm.fetchReq<EigenlayerSidecarV1SidecarSidecar.LoadContractsRequest, EigenlayerSidecarV1SidecarSidecar.LoadContractsResponse>(`/rpc/v1/load-contracts`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
}
}
35 changes: 35 additions & 0 deletions gen/api-ts/eigenlayer/sidecar/v1/sidecar/sidecar.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,39 @@ export type AboutResponse = {
version?: string
commit?: string
chain?: string
}

export type LoadContractRequest = {
address?: string
abi?: string
bytecodeHash?: string
blockNumber?: string
associateToProxy?: string
}

export type LoadContractResponse = {
blockHeight?: string
address?: string
}

export type CoreContract = {
contractAddress?: string
contractAbi?: string
bytecodeHash?: string
}

export type ProxyContract = {
contractAddress?: string
proxyContractAddress?: string
blockNumber?: string
}

export type LoadContractsRequest = {
coreContracts?: CoreContract[]
proxyContracts?: ProxyContract[]
}

export type LoadContractsResponse = {
blockHeight?: string
addresses?: string[]
}
85 changes: 85 additions & 0 deletions gen/openapi/api.public.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,20 @@
}
}
},
"CoreContract": {
"type": "object",
"properties": {
"bytecodeHash": {
"type": "string"
},
"contractAbi": {
"type": "string"
},
"contractAddress": {
"type": "string"
}
}
},
"DisabledDistributionRoot": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1395,6 +1409,62 @@
}
}
},
"LoadContractRequest": {
"type": "object",
"properties": {
"abi": {
"type": "string"
},
"address": {
"type": "string"
},
"associateToProxy": {
"type": "string"
},
"blockNumber": {
"type": "integer",
"format": "uint64"
},
"bytecodeHash": {
"type": "string"
}
}
},
"LoadContractResponse": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"blockHeight": {
"type": "integer",
"format": "uint64"
}
}
},
"LoadContractsRequest": {
"type": "object",
"properties": {
"coreContracts": {
"$ref": "#/components/schemas/CoreContract"
},
"proxyContracts": {
"$ref": "#/components/schemas/ProxyContract"
}
}
},
"LoadContractsResponse": {
"type": "object",
"properties": {
"addresses": {
"type": "string"
},
"blockHeight": {
"type": "integer",
"format": "uint64"
}
}
},
"Operator": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1520,6 +1590,21 @@
"earner_leaf"
]
},
"ProxyContract": {
"type": "object",
"properties": {
"blockNumber": {
"type": "integer",
"format": "uint64"
},
"contractAddress": {
"type": "string"
},
"proxyContractAddress": {
"type": "string"
}
}
},
"QueueStakerStrategyWithdrawal": {
"type": "object",
"properties": {
Expand Down
191 changes: 191 additions & 0 deletions gen/openapi/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,112 @@
]
}
},
"/rpc/v1/load-contract": {
"post": {
"summary": "LoadContract",
"operationId": "Rpc_LoadContract",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"abi": {
"type": "string"
},
"address": {
"type": "string"
},
"associateToProxy": {
"type": "string"
},
"blockNumber": {
"type": "integer",
"format": "uint64"
},
"bytecodeHash": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"blockHeight": {
"type": "integer",
"format": "uint64"
}
}
}
}
}
}
},
"tags": [
"sidecar"
]
}
},
"/rpc/v1/load-contracts": {
"post": {
"summary": "LoadContracts",
"operationId": "Rpc_LoadContracts",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"coreContracts": {
"$ref": "#/components/schemas/CoreContract"
},
"proxyContracts": {
"$ref": "#/components/schemas/ProxyContract"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"addresses": {
"type": "string"
},
"blockHeight": {
"type": "integer",
"format": "uint64"
}
}
}
}
}
}
},
"tags": [
"sidecar"
]
}
},
"/rpc/v1/state-roots/{blockNumber}": {
"get": {
"summary": "GetStateRoot",
Expand Down Expand Up @@ -2101,6 +2207,20 @@
}
}
},
"CoreContract": {
"type": "object",
"properties": {
"bytecodeHash": {
"type": "string"
},
"contractAbi": {
"type": "string"
},
"contractAddress": {
"type": "string"
}
}
},
"DisabledDistributionRoot": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -3166,6 +3286,62 @@
}
}
},
"LoadContractRequest": {
"type": "object",
"properties": {
"abi": {
"type": "string"
},
"address": {
"type": "string"
},
"associateToProxy": {
"type": "string"
},
"blockNumber": {
"type": "integer",
"format": "uint64"
},
"bytecodeHash": {
"type": "string"
}
}
},
"LoadContractResponse": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"blockHeight": {
"type": "integer",
"format": "uint64"
}
}
},
"LoadContractsRequest": {
"type": "object",
"properties": {
"coreContracts": {
"$ref": "#/components/schemas/CoreContract"
},
"proxyContracts": {
"$ref": "#/components/schemas/ProxyContract"
}
}
},
"LoadContractsResponse": {
"type": "object",
"properties": {
"addresses": {
"type": "string"
},
"blockHeight": {
"type": "integer",
"format": "uint64"
}
}
},
"Operator": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -3291,6 +3467,21 @@
"earner_leaf"
]
},
"ProxyContract": {
"type": "object",
"properties": {
"blockNumber": {
"type": "integer",
"format": "uint64"
},
"contractAddress": {
"type": "string"
},
"proxyContractAddress": {
"type": "string"
}
}
},
"QueueStakerStrategyWithdrawal": {
"type": "object",
"properties": {
Expand Down
Loading