Skip to content

Commit 1c6fc1b

Browse files
authored
feat: add LoadContract gRPC endpoint (#37)
2 parents c5c98c1 + a479d03 commit 1c6fc1b

39 files changed

+3385
-5497
lines changed

gen/api-ts/eigenlayer/sidecar/v1/sidecar/rpc.pb.ts

+6
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ export class Rpc {
1616
static About(req: EigenlayerSidecarV1SidecarSidecar.AboutRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1SidecarSidecar.AboutResponse> {
1717
return fm.fetchReq<EigenlayerSidecarV1SidecarSidecar.AboutRequest, EigenlayerSidecarV1SidecarSidecar.AboutResponse>(`/rpc/v1/about?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
1818
}
19+
static LoadContract(req: EigenlayerSidecarV1SidecarSidecar.LoadContractRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1SidecarSidecar.LoadContractResponse> {
20+
return fm.fetchReq<EigenlayerSidecarV1SidecarSidecar.LoadContractRequest, EigenlayerSidecarV1SidecarSidecar.LoadContractResponse>(`/rpc/v1/load-contract`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
21+
}
22+
static LoadContracts(req: EigenlayerSidecarV1SidecarSidecar.LoadContractsRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1SidecarSidecar.LoadContractsResponse> {
23+
return fm.fetchReq<EigenlayerSidecarV1SidecarSidecar.LoadContractsRequest, EigenlayerSidecarV1SidecarSidecar.LoadContractsResponse>(`/rpc/v1/load-contracts`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
24+
}
1925
}

gen/api-ts/eigenlayer/sidecar/v1/sidecar/sidecar.pb.ts

+35
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,39 @@ export type AboutResponse = {
2929
version?: string
3030
commit?: string
3131
chain?: string
32+
}
33+
34+
export type LoadContractRequest = {
35+
address?: string
36+
abi?: string
37+
bytecodeHash?: string
38+
blockNumber?: string
39+
associateToProxy?: string
40+
}
41+
42+
export type LoadContractResponse = {
43+
blockHeight?: string
44+
address?: string
45+
}
46+
47+
export type CoreContract = {
48+
contractAddress?: string
49+
contractAbi?: string
50+
bytecodeHash?: string
51+
}
52+
53+
export type ProxyContract = {
54+
contractAddress?: string
55+
proxyContractAddress?: string
56+
blockNumber?: string
57+
}
58+
59+
export type LoadContractsRequest = {
60+
coreContracts?: CoreContract[]
61+
proxyContracts?: ProxyContract[]
62+
}
63+
64+
export type LoadContractsResponse = {
65+
blockHeight?: string
66+
addresses?: string[]
3267
}

gen/openapi/api.public.swagger.json

+85
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,20 @@
330330
}
331331
}
332332
},
333+
"CoreContract": {
334+
"type": "object",
335+
"properties": {
336+
"bytecodeHash": {
337+
"type": "string"
338+
},
339+
"contractAbi": {
340+
"type": "string"
341+
},
342+
"contractAddress": {
343+
"type": "string"
344+
}
345+
}
346+
},
333347
"DisabledDistributionRoot": {
334348
"type": "object",
335349
"properties": {
@@ -1395,6 +1409,62 @@
13951409
}
13961410
}
13971411
},
1412+
"LoadContractRequest": {
1413+
"type": "object",
1414+
"properties": {
1415+
"abi": {
1416+
"type": "string"
1417+
},
1418+
"address": {
1419+
"type": "string"
1420+
},
1421+
"associateToProxy": {
1422+
"type": "string"
1423+
},
1424+
"blockNumber": {
1425+
"type": "integer",
1426+
"format": "uint64"
1427+
},
1428+
"bytecodeHash": {
1429+
"type": "string"
1430+
}
1431+
}
1432+
},
1433+
"LoadContractResponse": {
1434+
"type": "object",
1435+
"properties": {
1436+
"address": {
1437+
"type": "string"
1438+
},
1439+
"blockHeight": {
1440+
"type": "integer",
1441+
"format": "uint64"
1442+
}
1443+
}
1444+
},
1445+
"LoadContractsRequest": {
1446+
"type": "object",
1447+
"properties": {
1448+
"coreContracts": {
1449+
"$ref": "#/components/schemas/CoreContract"
1450+
},
1451+
"proxyContracts": {
1452+
"$ref": "#/components/schemas/ProxyContract"
1453+
}
1454+
}
1455+
},
1456+
"LoadContractsResponse": {
1457+
"type": "object",
1458+
"properties": {
1459+
"addresses": {
1460+
"type": "string"
1461+
},
1462+
"blockHeight": {
1463+
"type": "integer",
1464+
"format": "uint64"
1465+
}
1466+
}
1467+
},
13981468
"Operator": {
13991469
"type": "object",
14001470
"properties": {
@@ -1520,6 +1590,21 @@
15201590
"earner_leaf"
15211591
]
15221592
},
1593+
"ProxyContract": {
1594+
"type": "object",
1595+
"properties": {
1596+
"blockNumber": {
1597+
"type": "integer",
1598+
"format": "uint64"
1599+
},
1600+
"contractAddress": {
1601+
"type": "string"
1602+
},
1603+
"proxyContractAddress": {
1604+
"type": "string"
1605+
}
1606+
}
1607+
},
15231608
"QueueStakerStrategyWithdrawal": {
15241609
"type": "object",
15251610
"properties": {

gen/openapi/api.swagger.json

+191
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,112 @@
15741574
]
15751575
}
15761576
},
1577+
"/rpc/v1/load-contract": {
1578+
"post": {
1579+
"summary": "LoadContract",
1580+
"operationId": "Rpc_LoadContract",
1581+
"requestBody": {
1582+
"required": true,
1583+
"content": {
1584+
"application/json": {
1585+
"schema": {
1586+
"type": "object",
1587+
"properties": {
1588+
"abi": {
1589+
"type": "string"
1590+
},
1591+
"address": {
1592+
"type": "string"
1593+
},
1594+
"associateToProxy": {
1595+
"type": "string"
1596+
},
1597+
"blockNumber": {
1598+
"type": "integer",
1599+
"format": "uint64"
1600+
},
1601+
"bytecodeHash": {
1602+
"type": "string"
1603+
}
1604+
}
1605+
}
1606+
}
1607+
}
1608+
},
1609+
"responses": {
1610+
"200": {
1611+
"description": "Successful response",
1612+
"content": {
1613+
"application/json": {
1614+
"schema": {
1615+
"type": "object",
1616+
"properties": {
1617+
"address": {
1618+
"type": "string"
1619+
},
1620+
"blockHeight": {
1621+
"type": "integer",
1622+
"format": "uint64"
1623+
}
1624+
}
1625+
}
1626+
}
1627+
}
1628+
}
1629+
},
1630+
"tags": [
1631+
"sidecar"
1632+
]
1633+
}
1634+
},
1635+
"/rpc/v1/load-contracts": {
1636+
"post": {
1637+
"summary": "LoadContracts",
1638+
"operationId": "Rpc_LoadContracts",
1639+
"requestBody": {
1640+
"required": true,
1641+
"content": {
1642+
"application/json": {
1643+
"schema": {
1644+
"type": "object",
1645+
"properties": {
1646+
"coreContracts": {
1647+
"$ref": "#/components/schemas/CoreContract"
1648+
},
1649+
"proxyContracts": {
1650+
"$ref": "#/components/schemas/ProxyContract"
1651+
}
1652+
}
1653+
}
1654+
}
1655+
}
1656+
},
1657+
"responses": {
1658+
"200": {
1659+
"description": "Successful response",
1660+
"content": {
1661+
"application/json": {
1662+
"schema": {
1663+
"type": "object",
1664+
"properties": {
1665+
"addresses": {
1666+
"type": "string"
1667+
},
1668+
"blockHeight": {
1669+
"type": "integer",
1670+
"format": "uint64"
1671+
}
1672+
}
1673+
}
1674+
}
1675+
}
1676+
}
1677+
},
1678+
"tags": [
1679+
"sidecar"
1680+
]
1681+
}
1682+
},
15771683
"/rpc/v1/state-roots/{blockNumber}": {
15781684
"get": {
15791685
"summary": "GetStateRoot",
@@ -2101,6 +2207,20 @@
21012207
}
21022208
}
21032209
},
2210+
"CoreContract": {
2211+
"type": "object",
2212+
"properties": {
2213+
"bytecodeHash": {
2214+
"type": "string"
2215+
},
2216+
"contractAbi": {
2217+
"type": "string"
2218+
},
2219+
"contractAddress": {
2220+
"type": "string"
2221+
}
2222+
}
2223+
},
21042224
"DisabledDistributionRoot": {
21052225
"type": "object",
21062226
"properties": {
@@ -3166,6 +3286,62 @@
31663286
}
31673287
}
31683288
},
3289+
"LoadContractRequest": {
3290+
"type": "object",
3291+
"properties": {
3292+
"abi": {
3293+
"type": "string"
3294+
},
3295+
"address": {
3296+
"type": "string"
3297+
},
3298+
"associateToProxy": {
3299+
"type": "string"
3300+
},
3301+
"blockNumber": {
3302+
"type": "integer",
3303+
"format": "uint64"
3304+
},
3305+
"bytecodeHash": {
3306+
"type": "string"
3307+
}
3308+
}
3309+
},
3310+
"LoadContractResponse": {
3311+
"type": "object",
3312+
"properties": {
3313+
"address": {
3314+
"type": "string"
3315+
},
3316+
"blockHeight": {
3317+
"type": "integer",
3318+
"format": "uint64"
3319+
}
3320+
}
3321+
},
3322+
"LoadContractsRequest": {
3323+
"type": "object",
3324+
"properties": {
3325+
"coreContracts": {
3326+
"$ref": "#/components/schemas/CoreContract"
3327+
},
3328+
"proxyContracts": {
3329+
"$ref": "#/components/schemas/ProxyContract"
3330+
}
3331+
}
3332+
},
3333+
"LoadContractsResponse": {
3334+
"type": "object",
3335+
"properties": {
3336+
"addresses": {
3337+
"type": "string"
3338+
},
3339+
"blockHeight": {
3340+
"type": "integer",
3341+
"format": "uint64"
3342+
}
3343+
}
3344+
},
31693345
"Operator": {
31703346
"type": "object",
31713347
"properties": {
@@ -3291,6 +3467,21 @@
32913467
"earner_leaf"
32923468
]
32933469
},
3470+
"ProxyContract": {
3471+
"type": "object",
3472+
"properties": {
3473+
"blockNumber": {
3474+
"type": "integer",
3475+
"format": "uint64"
3476+
},
3477+
"contractAddress": {
3478+
"type": "string"
3479+
},
3480+
"proxyContractAddress": {
3481+
"type": "string"
3482+
}
3483+
}
3484+
},
32943485
"QueueStakerStrategyWithdrawal": {
32953486
"type": "object",
32963487
"properties": {

0 commit comments

Comments
 (0)