Skip to content

fix helper fn example #36

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

Merged
merged 2 commits into from
Jul 4, 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
7 changes: 6 additions & 1 deletion examples/acp_base/helpers/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
WHITELISTED_WALLET_PRIVATE_KEY=<whitelisted-wallet-private-key>
BUYER_AGENT_WALLET_ADDRESS=<buyer-agent-wallet-address>
BUYER_ENTITY_ID=<buyer-entity-id>

SELLER_AGENT_WALLET_ADDRESS=<seller-agent-wallet-address>
EVALUATOR_AGENT_WALLET_ADDRESS=<evaluator-agent-wallet-address>
SELLER_ENTITY_ID=<seller-entity-id>

EVALUATOR_AGENT_WALLET_ADDRESS=<evaluator-agent-wallet-address>
EVALUATOR_ENTITY_ID=<evaluator-entity-id>
15 changes: 8 additions & 7 deletions examples/acp_base/helpers/acp_helper_functions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from acp_sdk.client import VirtualsACP
from acp_sdk.configs import BASE_SEPOLIA_CONFIG
from acp_sdk.env import EnvSettings
from virtuals_acp.client import VirtualsACP
from virtuals_acp.configs import BASE_SEPOLIA_CONFIG
from virtuals_acp.env import EnvSettings

from dotenv import load_dotenv

load_dotenv(override=True)

def test_helper_functions():
Expand All @@ -11,7 +12,7 @@ def test_helper_functions():
acp = VirtualsACP(
wallet_private_key=env.WHITELISTED_WALLET_PRIVATE_KEY,
agent_wallet_address=env.BUYER_AGENT_WALLET_ADDRESS,
config=BASE_SEPOLIA_CONFIG
entity_id=env.BUYER_ENTITY_ID
)

# Get active jobs
Expand All @@ -30,15 +31,15 @@ def test_helper_functions():
print(cancelled_jobs or "No cancelled jobs found.")

if completed_jobs:
onchain_job_id = completed_jobs[0].get("id")
onchain_job_id = completed_jobs[0].id
if onchain_job_id:
job = acp.get_job_by_onchain_id(onchain_job_id=onchain_job_id)
print(f"\n📄 Job Details (Job ID: {onchain_job_id}):")
print(job)

memos = completed_jobs[0].get("memos", [])
memos = completed_jobs[0].memos
if memos:
memo_id = memos[0].get("id")
memo_id = memos[0].id
memo = acp.get_memo_by_id(onchain_job_id=onchain_job_id, memo_id=memo_id)
print(f"\n📝 Memo Details (Job ID: {onchain_job_id}, Memo ID: {memo_id}):")
print(memo)
Expand Down