Skip to content

Commit 0506508

Browse files
authored
Merge pull request #136 from bgd-labs/feat/add-agents-hub
feat: add agent hub permissions
2 parents 1768ee7 + 51a2f46 commit 0506508

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+9864
-1521
lines changed

abis/agent.ts

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
export const AGENT_ABI = [
2+
{
3+
"type": "function",
4+
"name": "AGENT_HUB",
5+
"inputs": [],
6+
"outputs": [
7+
{
8+
"name": "",
9+
"type": "address",
10+
"internalType": "address"
11+
}
12+
],
13+
"stateMutability": "view"
14+
},
15+
{
16+
"type": "function",
17+
"name": "POOL",
18+
"inputs": [],
19+
"outputs": [
20+
{
21+
"name": "",
22+
"type": "address",
23+
"internalType": "contract IPool"
24+
}
25+
],
26+
"stateMutability": "view"
27+
},
28+
{
29+
"type": "function",
30+
"name": "RANGE_VALIDATION_MODULE",
31+
"inputs": [],
32+
"outputs": [
33+
{
34+
"name": "",
35+
"type": "address",
36+
"internalType": "contract IRangeValidationModule"
37+
}
38+
],
39+
"stateMutability": "view"
40+
},
41+
{
42+
"type": "function",
43+
"name": "getMarkets",
44+
"inputs": [
45+
{
46+
"name": "",
47+
"type": "uint256",
48+
"internalType": "uint256"
49+
}
50+
],
51+
"outputs": [
52+
{
53+
"name": "",
54+
"type": "address[]",
55+
"internalType": "address[]"
56+
}
57+
],
58+
"stateMutability": "view"
59+
},
60+
{
61+
"type": "function",
62+
"name": "inject",
63+
"inputs": [
64+
{
65+
"name": "agentId",
66+
"type": "uint256",
67+
"internalType": "uint256"
68+
},
69+
{
70+
"name": "agentContext",
71+
"type": "bytes",
72+
"internalType": "bytes"
73+
},
74+
{
75+
"name": "update",
76+
"type": "tuple",
77+
"internalType": "struct IRiskOracle.RiskParameterUpdate",
78+
"components": [
79+
{
80+
"name": "timestamp",
81+
"type": "uint256",
82+
"internalType": "uint256"
83+
},
84+
{
85+
"name": "newValue",
86+
"type": "bytes",
87+
"internalType": "bytes"
88+
},
89+
{
90+
"name": "referenceId",
91+
"type": "string",
92+
"internalType": "string"
93+
},
94+
{
95+
"name": "previousValue",
96+
"type": "bytes",
97+
"internalType": "bytes"
98+
},
99+
{
100+
"name": "updateType",
101+
"type": "string",
102+
"internalType": "string"
103+
},
104+
{
105+
"name": "updateId",
106+
"type": "uint256",
107+
"internalType": "uint256"
108+
},
109+
{
110+
"name": "market",
111+
"type": "address",
112+
"internalType": "address"
113+
},
114+
{
115+
"name": "additionalData",
116+
"type": "bytes",
117+
"internalType": "bytes"
118+
}
119+
]
120+
}
121+
],
122+
"outputs": [],
123+
"stateMutability": "nonpayable"
124+
},
125+
{
126+
"type": "function",
127+
"name": "validate",
128+
"inputs": [
129+
{
130+
"name": "agentId",
131+
"type": "uint256",
132+
"internalType": "uint256"
133+
},
134+
{
135+
"name": "agentContext",
136+
"type": "bytes",
137+
"internalType": "bytes"
138+
},
139+
{
140+
"name": "update",
141+
"type": "tuple",
142+
"internalType": "struct IRiskOracle.RiskParameterUpdate",
143+
"components": [
144+
{
145+
"name": "timestamp",
146+
"type": "uint256",
147+
"internalType": "uint256"
148+
},
149+
{
150+
"name": "newValue",
151+
"type": "bytes",
152+
"internalType": "bytes"
153+
},
154+
{
155+
"name": "referenceId",
156+
"type": "string",
157+
"internalType": "string"
158+
},
159+
{
160+
"name": "previousValue",
161+
"type": "bytes",
162+
"internalType": "bytes"
163+
},
164+
{
165+
"name": "updateType",
166+
"type": "string",
167+
"internalType": "string"
168+
},
169+
{
170+
"name": "updateId",
171+
"type": "uint256",
172+
"internalType": "uint256"
173+
},
174+
{
175+
"name": "market",
176+
"type": "address",
177+
"internalType": "address"
178+
},
179+
{
180+
"name": "additionalData",
181+
"type": "bytes",
182+
"internalType": "bytes"
183+
}
184+
]
185+
}
186+
],
187+
"outputs": [
188+
{
189+
"name": "",
190+
"type": "bool",
191+
"internalType": "bool"
192+
}
193+
],
194+
"stateMutability": "view"
195+
},
196+
{
197+
"type": "error",
198+
"name": "InvalidBytesValue",
199+
"inputs": []
200+
},
201+
{
202+
"type": "error",
203+
"name": "OnlyAgentHub",
204+
"inputs": [
205+
{
206+
"name": "account",
207+
"type": "address",
208+
"internalType": "address"
209+
}
210+
]
211+
}
212+
];

abis/agentHub.ts

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)