Open
Conversation
Ang-dot
approved these changes
Mar 2, 2026
312b79b to
e897a4e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds wallet-based authentication for the ACP API and Socket.IO, makes deliverable content private (fetched via API when needed), and updates chain configs and contract client APIs. 19 files changed (~500 additions, ~206 deletions).
1. Authentication (API + Socket)
ACPApiClientinvirtuals_acp/client.py:require_auth.BearerAuthuses a callable to get access tokens and attaches them to requests.get_auth_challenge()→ sign with contract client →verify_auth_challenge()→ receiveaccessToken.auth:walletAddress+accessTokenfromget_access_token().x-sdk-version,x-sdk-language,x-contract-address.init(); optionalskip_socket_connectionto avoid connecting (e.g. for polling-only usage).^2.0.0) added inpyproject.toml.2. Contract clients & signing
base_contract_client.py):get_asset_manager_address()(abstract),sign_typed_data(typed_data: dict)(abstract).get_job_idsignature: argument renamed fromreceipttoresponse.contract_client.py,contract_client_v2.py):sign_typed_dataimplemented: EIP-712 style — hash challenge, wrap in replay-safe typed data (domain usesSINGLE_SIGNER_VALIDATION_MODULE_ADDRESS, salt from agent wallet), sign, then_pack_1271_eoa_signature(prefix + entity_id + separator + EOA type + signature bytes).get_asset_manager_address: V1 raises “Not Supported”; V2 returns memo manager’sassetManager().3. VirtualsACP client API and init
contract_client→acp_contract_client(property).agent_wallet_address→wallet_address(checksummed).custom_rpc_url(optional).skip_socket_connection: ifTrue, no Socket.IO connection; caller can useinit()later.ACPApiClientwith auth for API calls andno_auth_acp_clientwhere auth isn’t required;acp_urlandwallet_addresscome from the first contract client.4. Job model & deliverable (private memo content)
ACPJob(virtuals_acp/job.py):deliverable: Now an optional field (e.g.DeliverablePayloador reference); no longer derived from memos. Completed memo content is no longer exposed directly; fetching is done via API when needed.get_deliverable()added: returnsdeliverable; if it’s a string matchingapi/memo-contents/([0-9]+)$, fetches content viaacp_client.get_memo_content(deliverable)and parses JSON or returns raw string.deliver()anddeliver_payable(): Phase check — both raiseACPError("Job is not in transaction phase")whenjob.phase != ACPJobPhase.TRANSACTION.acp_client.contract_client→acp_client.acp_contract_client, and_base_farefromacp_contract_client.config.base_fare._get_memo_by_id: Argument type annotated asmemo_id: int.5. Chain configs
virtuals_acp/configs/configs.py:TESTNET_CHAINS: Base Sepolia (chain_id 84532) and optional commented chains (Sepolia, Polygon Amoy, etc.).MAINNET_CHAINS: Base mainnet (8453) and optional commented chains.chainsargument set to eitherTESTNET_CHAINSorMAINNET_CHAINS.6. Examples
job.get_deliverable()instead ofjob.deliverable(cross_chain_transfer_service, prediction_market, trading, polling_mode, skip_evaluation).acp_client.agent_addresschanged toacp_client.wallet_address(polling_mode buyer, evaluator, seller).7. Tests
test_client.py,test_job.py):contract_client→acp_contract_client,agent_wallet_address→wallet_address."state": 1where applicable.Fareand config mocks getchain_id=8453; client mock usesacp_contract_clientandcontract_client_by_address.return_valuefor config.ACPError("Job is not in transaction phase")when not inTRANSACTION; previous “No transaction memo found” /ValueErrortests removed or replaced.job.deliverableare commented out with a TODO to align withget_deliverable().ACPJobPhase.TRANSACTIONwhere needed; memo mocks gettype = MemoType.MESSAGE.test_client_integration.py):agent_address→wallet_addressin assertions andget_agentcalls.8. Other
virtuals_acp/web3.py: Comment added: “TODO: implement wrapper methods in base_contract_client”.Breaking changes (for callers)
acp_client.contract_clientacp_client.acp_contract_clientacp_client.agent_wallet_address/agent_addressacp_client.wallet_addressjob.deliverable(property from memo)job.get_deliverable()(may call API for memo content)deliver()/deliver_payable()only checked memo phaseACPJobPhase.TRANSACTIONor raiseACPError