Skip to content

Commit 14b0bba

Browse files
Merge pull request #154 from Virtual-Protocol/sdk-upgrade-auth-priv-memo
Private Deliverable Memo Content
2 parents c5d00e4 + 3a98b72 commit 14b0bba

20 files changed

Lines changed: 552 additions & 216 deletions

File tree

examples/acp_base/cross_chain_transfer_service/buyer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def on_new_task(job: ACPJob, memo_to_sign: Optional[ACPMemo] = None):
6969
logger.info(f"Job {job.id} rejection memo signed")
7070

7171
elif job.phase == ACPJobPhase.COMPLETED:
72-
logger.info(f"Job {job.id} completed, received deliverable: {job.deliverable}")
72+
logger.info(f"Job {job.id} completed, received deliverable: {job.get_deliverable()}")
7373

7474
elif job.phase == ACPJobPhase.REJECTED:
7575
logger.info(f"Job {job.id} rejected by seller")

examples/acp_base/funds_transfer/prediction_market/buyer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def on_new_task(job: ACPJob, memo_to_sign: Optional[ACPMemo] = None):
5959
msg = (
6060
f"[on_new_task] Job {job_id} {job_phase}. "
6161
+ (
62-
f"Deliverable received: {job.deliverable}"
62+
f"Deliverable received: {job.get_deliverable()}"
6363
if job_phase == ACPJobPhase.COMPLETED
6464
else f"Rejection reason: {job.rejection_reason}"
6565
)

examples/acp_base/funds_transfer/trading/buyer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def on_new_task(job: ACPJob, memo_to_sign: Optional[ACPMemo] = None):
5959
msg = (
6060
f"[on_new_task] Job {job_id} {job.phase}. "
6161
+ (
62-
f"Deliverable received: {job.deliverable}"
62+
f"Deliverable received: {job.get_deliverable()}"
6363
if job.phase == ACPJobPhase.COMPLETED
6464
else f"Rejection reason: {job.rejection_reason}"
6565
)

examples/acp_base/funds_transfer/trading/seller.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ def handle_task_transaction(job: ACPJob):
231231
),
232232
Fare.from_contract_address(
233233
to_contract,
234-
config
234+
config,
235+
config.chain_id
235236
)
236237
)
237238
logger.info(f"Returning swapped token: {swapped_amount}")

examples/acp_base/polling_mode/buyer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def buyer():
3434
config=BASE_MAINNET_ACP_X402_CONFIG_V2, # route to x402 for payment, undefined defaulted back to direct transfer
3535
),
3636
)
37-
logger.info(f"Buyer ACP Initialized. Agent: {acp_client.agent_address}")
37+
logger.info(f"Buyer ACP Initialized. Agent: {acp_client.wallet_address}")
3838

3939
# Browse available agents based on a keyword and cluster name
4040
relevant_agents = acp_client.browse_agents(

examples/acp_base/polling_mode/evaluator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ def evaluator():
3636
entity_id=env.EVALUATOR_ENTITY_ID,
3737
),
3838
)
39-
logger.info(f"Evaluator ACP Initialized. Agent: {acp_client.agent_address}")
39+
logger.info(f"Evaluator ACP Initialized. Agent: {acp_client.wallet_address}")
4040

4141
while True:
4242
logger.info(
43-
f"\nPolling for jobs assigned to {acp_client.agent_address} requiring evaluation."
43+
f"\nPolling for jobs assigned to {acp_client.wallet_address} requiring evaluation."
4444
)
4545
active_jobs_list: List[ACPJob] = acp_client.get_active_jobs()
4646

@@ -54,13 +54,13 @@ def evaluator():
5454
try:
5555

5656
# Ensure this job is for the current evaluator
57-
if job.evaluator_address != acp_client.agent_address:
57+
if job.evaluator_address != acp_client.wallet_address:
5858
continue
5959

6060
if job.phase == ACPJobPhase.EVALUATION:
6161
logger.info(f"Found Job {job.id} in EVALUATION phase.")
6262
logger.info(
63-
f"Job {job.id}: Evaluating deliverable: {job.deliverable} with requirement: {job.requirement}"
63+
f"Job {job.id}: Evaluating deliverable: {job.get_deliverable()} with requirement: {job.requirement}"
6464
)
6565
job.evaluate(
6666
accept=ACCEPT_EVALUATION,

examples/acp_base/polling_mode/seller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def seller():
4040

4141
while True:
4242
logger.info(
43-
f"\nPolling for active jobs for {acp_client.agent_address}."
43+
f"\nPolling for active jobs for {acp_client.wallet_address}."
4444
)
4545
active_jobs_list: List[ACPJob] = acp_client.get_active_jobs()
4646

@@ -51,7 +51,7 @@ def seller():
5151

5252
for job in active_jobs_list:
5353
# Ensure this job is for the current seller
54-
if job.provider_address != acp_client.agent_address:
54+
if job.provider_address != acp_client.wallet_address:
5555
continue
5656

5757
try:

examples/acp_base/skip_evaluation/buyer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def on_new_task(job: ACPJob, memo_to_sign: Optional[ACPMemo] = None):
5050
logger.info(f"Job {job.id} rejection memo signed")
5151

5252
elif job.phase == ACPJobPhase.COMPLETED:
53-
logger.info(f"Job {job.id} completed, received deliverable: {job.deliverable}")
53+
logger.info(f"Job {job.id} completed, received deliverable: {job.get_deliverable()}")
5454

5555
elif job.phase == ACPJobPhase.REJECTED:
5656
logger.info(f"Job {job.id} rejected by seller")

poetry.lock

Lines changed: 20 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "virtuals-acp"
3-
version = "0.3.20"
3+
version = "0.3.21"
44
description = "Agent Commerce Protocol Python SDK by Virtuals"
55
authors = ["Steven Lee Soon Fatt <steven@virtuals.io>"]
66
readme = "README.md"
@@ -18,6 +18,7 @@ python-socketio = "^5.11.1"
1818
websocket-client = "^1.7.0"
1919
jsonschema = "^4.22.0"
2020
pydantic-settings = "^2.0"
21+
PyJWT = "^2.0.0"
2122

2223
[tool.poetry.group.dev.dependencies]
2324
pytest = "^8.3.4"

0 commit comments

Comments
 (0)