agent0-sdk 1.0.1__py3-none-any.whl → 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agent0_sdk/__init__.py +1 -1
- agent0_sdk/core/agent.py +10 -9
- agent0_sdk/core/contracts.py +23 -8
- agent0_sdk/core/feedback_manager.py +181 -124
- agent0_sdk/core/indexer.py +16 -15
- agent0_sdk/core/ipfs_client.py +8 -6
- agent0_sdk/core/models.py +5 -3
- agent0_sdk/core/sdk.py +64 -147
- agent0_sdk/core/subgraph_client.py +22 -27
- agent0_sdk/core/value_encoding.py +91 -0
- {agent0_sdk-1.0.1.dist-info → agent0_sdk-1.2.0.dist-info}/METADATA +29 -17
- agent0_sdk-1.2.0.dist-info/RECORD +20 -0
- agent0_sdk-1.0.1.dist-info/RECORD +0 -19
- {agent0_sdk-1.0.1.dist-info → agent0_sdk-1.2.0.dist-info}/WHEEL +0 -0
- {agent0_sdk-1.0.1.dist-info → agent0_sdk-1.2.0.dist-info}/licenses/LICENSE +0 -0
- {agent0_sdk-1.0.1.dist-info → agent0_sdk-1.2.0.dist-info}/top_level.txt +0 -0
agent0_sdk/__init__.py
CHANGED
agent0_sdk/core/agent.py
CHANGED
|
@@ -327,7 +327,8 @@ class Agent:
|
|
|
327
327
|
oasf_endpoint = Endpoint(
|
|
328
328
|
type=EndpointType.OASF,
|
|
329
329
|
value="https://github.com/agntcy/oasf/",
|
|
330
|
-
|
|
330
|
+
# Version string follows ERC-8004 spec example ("0.8")
|
|
331
|
+
meta={"version": "0.8", "skills": [], "domains": []}
|
|
331
332
|
)
|
|
332
333
|
self.registration_file.endpoints.append(oasf_endpoint)
|
|
333
334
|
return oasf_endpoint
|
|
@@ -529,14 +530,14 @@ class Agent:
|
|
|
529
530
|
raise ValueError("Wallet address cannot be empty. Use a non-zero address.")
|
|
530
531
|
|
|
531
532
|
# Validate address format
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
533
|
+
if not addr.startswith("0x") or len(addr) != 42:
|
|
534
|
+
raise ValueError(f"Invalid Ethereum address format: {addr}. Must be 42 characters starting with '0x'")
|
|
535
|
+
|
|
536
|
+
# Validate hexadecimal characters
|
|
537
|
+
try:
|
|
538
|
+
int(addr[2:], 16)
|
|
539
|
+
except ValueError:
|
|
540
|
+
raise ValueError(f"Invalid hexadecimal characters in address: {addr}")
|
|
540
541
|
|
|
541
542
|
# Determine chain ID to use (local bookkeeping)
|
|
542
543
|
if chainId is None:
|
agent0_sdk/core/contracts.py
CHANGED
|
@@ -159,7 +159,7 @@ IDENTITY_REGISTRY_ABI = [
|
|
|
159
159
|
{"internalType": "uint256", "name": "agentId", "type": "uint256"}
|
|
160
160
|
],
|
|
161
161
|
"name": "getAgentWallet",
|
|
162
|
-
"outputs": [{"internalType": "
|
|
162
|
+
"outputs": [{"internalType": "bytes", "name": "", "type": "bytes"}],
|
|
163
163
|
"stateMutability": "view",
|
|
164
164
|
"type": "function"
|
|
165
165
|
},
|
|
@@ -175,6 +175,15 @@ IDENTITY_REGISTRY_ABI = [
|
|
|
175
175
|
"stateMutability": "nonpayable",
|
|
176
176
|
"type": "function"
|
|
177
177
|
},
|
|
178
|
+
{
|
|
179
|
+
"inputs": [
|
|
180
|
+
{"internalType": "uint256", "name": "agentId", "type": "uint256"}
|
|
181
|
+
],
|
|
182
|
+
"name": "unsetAgentWallet",
|
|
183
|
+
"outputs": [],
|
|
184
|
+
"stateMutability": "nonpayable",
|
|
185
|
+
"type": "function"
|
|
186
|
+
},
|
|
178
187
|
|
|
179
188
|
# Events
|
|
180
189
|
{
|
|
@@ -222,7 +231,8 @@ REPUTATION_REGISTRY_ABI = [
|
|
|
222
231
|
{
|
|
223
232
|
"inputs": [
|
|
224
233
|
{"internalType": "uint256", "name": "agentId", "type": "uint256"},
|
|
225
|
-
{"internalType": "
|
|
234
|
+
{"internalType": "int256", "name": "value", "type": "int256"},
|
|
235
|
+
{"internalType": "uint8", "name": "valueDecimals", "type": "uint8"},
|
|
226
236
|
{"internalType": "string", "name": "tag1", "type": "string"},
|
|
227
237
|
{"internalType": "string", "name": "tag2", "type": "string"},
|
|
228
238
|
{"internalType": "string", "name": "endpoint", "type": "string"},
|
|
@@ -275,7 +285,8 @@ REPUTATION_REGISTRY_ABI = [
|
|
|
275
285
|
],
|
|
276
286
|
"name": "readFeedback",
|
|
277
287
|
"outputs": [
|
|
278
|
-
{"internalType": "
|
|
288
|
+
{"internalType": "int256", "name": "value", "type": "int256"},
|
|
289
|
+
{"internalType": "uint8", "name": "valueDecimals", "type": "uint8"},
|
|
279
290
|
{"internalType": "string", "name": "tag1", "type": "string"},
|
|
280
291
|
{"internalType": "string", "name": "tag2", "type": "string"},
|
|
281
292
|
{"internalType": "bool", "name": "isRevoked", "type": "bool"}
|
|
@@ -293,7 +304,8 @@ REPUTATION_REGISTRY_ABI = [
|
|
|
293
304
|
"name": "getSummary",
|
|
294
305
|
"outputs": [
|
|
295
306
|
{"internalType": "uint64", "name": "count", "type": "uint64"},
|
|
296
|
-
{"internalType": "
|
|
307
|
+
{"internalType": "int256", "name": "summaryValue", "type": "int256"},
|
|
308
|
+
{"internalType": "uint8", "name": "summaryValueDecimals", "type": "uint8"}
|
|
297
309
|
],
|
|
298
310
|
"stateMutability": "view",
|
|
299
311
|
"type": "function"
|
|
@@ -308,9 +320,10 @@ REPUTATION_REGISTRY_ABI = [
|
|
|
308
320
|
],
|
|
309
321
|
"name": "readAllFeedback",
|
|
310
322
|
"outputs": [
|
|
311
|
-
{"internalType": "address[]", "name": "
|
|
323
|
+
{"internalType": "address[]", "name": "clients", "type": "address[]"},
|
|
312
324
|
{"internalType": "uint64[]", "name": "feedbackIndexes", "type": "uint64[]"},
|
|
313
|
-
{"internalType": "
|
|
325
|
+
{"internalType": "int256[]", "name": "values", "type": "int256[]"},
|
|
326
|
+
{"internalType": "uint8[]", "name": "valueDecimals", "type": "uint8[]"},
|
|
314
327
|
{"internalType": "string[]", "name": "tag1s", "type": "string[]"},
|
|
315
328
|
{"internalType": "string[]", "name": "tag2s", "type": "string[]"},
|
|
316
329
|
{"internalType": "bool[]", "name": "revokedStatuses", "type": "bool[]"}
|
|
@@ -345,8 +358,10 @@ REPUTATION_REGISTRY_ABI = [
|
|
|
345
358
|
{"indexed": True, "internalType": "uint256", "name": "agentId", "type": "uint256"},
|
|
346
359
|
{"indexed": True, "internalType": "address", "name": "clientAddress", "type": "address"},
|
|
347
360
|
{"indexed": False, "internalType": "uint64", "name": "feedbackIndex", "type": "uint64"},
|
|
348
|
-
{"indexed": False, "internalType": "
|
|
349
|
-
{"indexed":
|
|
361
|
+
{"indexed": False, "internalType": "int256", "name": "value", "type": "int256"},
|
|
362
|
+
{"indexed": False, "internalType": "uint8", "name": "valueDecimals", "type": "uint8"},
|
|
363
|
+
{"indexed": True, "internalType": "string", "name": "indexedTag1", "type": "string"},
|
|
364
|
+
{"indexed": False, "internalType": "string", "name": "tag1", "type": "string"},
|
|
350
365
|
{"indexed": False, "internalType": "string", "name": "tag2", "type": "string"},
|
|
351
366
|
{"indexed": False, "internalType": "string", "name": "endpoint", "type": "string"},
|
|
352
367
|
{"indexed": False, "internalType": "string", "name": "feedbackURI", "type": "string"},
|