Skip to content

[POC] Add Tweet Functionality to ACP Plugin #7

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions examples/acp_base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Before running the examples, you need to set up your environment variables. Crea
# Required for all examples
WHITELISTED_WALLET_PRIVATE_KEY=0x... # Your whitelisted wallet private key
WHITELISTED_WALLET_ENTITY_ID=... # Your session entity key ID
BUYER_WALLET_ADDRESS=0x... # Buyer's wallet address
SELLER_WALLET_ADDRESS=0x... # Seller's wallet address
BUYER_AGENT_WALLET_ADDRESS=0x... # Buyer's wallet address
SELLER_AGENT_WALLET_ADDRESS=0x... # Seller's wallet address

# Required for external evaluation examples
EVALUATOR_WALLET_ADDRESS=0x... # Evaluator's wallet address
EVALUATOR_AGENT_WALLET_ADDRESS=0x... # Evaluator's wallet address
```

### Getting the Required Values
Expand All @@ -37,9 +37,9 @@ EVALUATOR_WALLET_ADDRESS=0x... # Evaluator's wallet address
![Session Entity ID](docs/imgs/session-entity-id-location.png)

3. **Wallet Addresses**
- `BUYER_WALLET_ADDRESS`: The wallet address of the agent initiating the job
- `SELLER_WALLET_ADDRESS`: The wallet address of the agent providing the service
- `EVALUATOR_WALLET_ADDRESS`: (For external evaluation) The wallet address of the third-party evaluator
- `BUYER_AGENT_WALLET_ADDRESS`: The wallet address of the agent initiating the job
- `SELLER_AGENT_WALLET_ADDRESS`: The wallet address of the agent providing the service
- `EVALUATOR_AGENT_WALLET_ADDRESS`: (For external evaluation) The wallet address of the third-party evaluator

> **Note:** Make sure your wallet has sufficient $BMW tokens for testing on Base Sepolia. If you need tokens, please reach out to Virtuals' DevRel team.

Expand Down
6 changes: 3 additions & 3 deletions examples/acp_base/external_evaluation/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
WHITELISTED_WALLET_PRIVATE_KEY=0x-<whitelisted-wallet-private-key>
WHITELISTED_WALLET_ENTITY_ID=<whitelisted-wallet-entity-id>
BUYER_WALLET_ADDRESS=<buyer-agent-wallet-address>
SELLER_WALLET_ADDRESS=<seller-agent-wallet-address>
EVALUATOR_WALLET_ADDRESS=<evaluator-agent-wallet-address>
BUYER_AGENT_WALLET_ADDRESS=<buyer-agent-wallet-address>
SELLER_AGENT_WALLET_ADDRESS=<seller-agent-wallet-address>
EVALUATOR_AGENT_WALLET_ADDRESS=<evaluator-agent-wallet-address>
8 changes: 4 additions & 4 deletions examples/acp_base/external_evaluation/buyer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import AcpContractClient, { AcpJobPhases } from "../../../src/acpContractClient"
import AcpJob from "../../../src/acpJob";
import { baseSepoliaAcpConfig } from "../../../src";
import {
BUYER_WALLET_ADDRESS,
EVALUATOR_WALLET_ADDRESS,
BUYER_AGENT_WALLET_ADDRESS,
EVALUATOR_AGENT_WALLET_ADDRESS,
WHITELISTED_WALLET_ENTITY_ID,
WHITELISTED_WALLET_PRIVATE_KEY
} from "./env";
Expand All @@ -16,7 +16,7 @@ async function buyer() {
acpContractClient: await AcpContractClient.build(
WHITELISTED_WALLET_PRIVATE_KEY,
WHITELISTED_WALLET_ENTITY_ID,
BUYER_WALLET_ADDRESS,
BUYER_AGENT_WALLET_ADDRESS,
baseSepoliaAcpConfig
),
onNewTask: async (job: AcpJob) => {
Expand All @@ -43,7 +43,7 @@ async function buyer() {
const jobId = await chosenJobOffering.initiateJob(
chosenJobOffering.requirementSchema || {},
new Date(Date.now() + 1000 * 60 * 60 * 24),
EVALUATOR_WALLET_ADDRESS,
EVALUATOR_AGENT_WALLET_ADDRESS,
);

console.log(`Job ${jobId} initiated`);
Expand Down
6 changes: 3 additions & 3 deletions examples/acp_base/external_evaluation/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ function getEnvVar<T extends string = string>(key: string, required = true): T {

export const WHITELISTED_WALLET_PRIVATE_KEY = getEnvVar<Address>('WHITELISTED_WALLET_PRIVATE_KEY');
export const WHITELISTED_WALLET_ENTITY_ID = parseInt(getEnvVar('WHITELISTED_WALLET_ENTITY_ID'), 10);
export const BUYER_WALLET_ADDRESS = getEnvVar<Address>('BUYER_WALLET_ADDRESS');
export const SELLER_WALLET_ADDRESS = getEnvVar<Address>('SELLER_WALLET_ADDRESS');
export const EVALUATOR_WALLET_ADDRESS = getEnvVar<Address>('EVALUATOR_WALLET_ADDRESS');
export const BUYER_AGENT_WALLET_ADDRESS = getEnvVar<Address>('BUYER_AGENT_WALLET_ADDRESS');
export const SELLER_AGENT_WALLET_ADDRESS = getEnvVar<Address>('SELLER_AGENT_WALLET_ADDRESS');
export const EVALUATOR_AGENT_WALLET_ADDRESS = getEnvVar<Address>('EVALUATOR_AGENT_WALLET_ADDRESS');

if (isNaN(WHITELISTED_WALLET_ENTITY_ID)) {
throw new Error('WHITELISTED_WALLET_ENTITY_ID must be a valid number in the .env file');
Expand Down
4 changes: 2 additions & 2 deletions examples/acp_base/external_evaluation/evaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AcpContractClient from "../../../src/acpContractClient";
import AcpJob from "../../../src/acpJob";
import { baseSepoliaAcpConfig } from "../../../src";
import {
EVALUATOR_WALLET_ADDRESS,
EVALUATOR_AGENT_WALLET_ADDRESS,
WHITELISTED_WALLET_ENTITY_ID,
WHITELISTED_WALLET_PRIVATE_KEY
} from "./env";
Expand All @@ -15,7 +15,7 @@ async function evaluator() {
acpContractClient: await AcpContractClient.build(
WHITELISTED_WALLET_PRIVATE_KEY,
WHITELISTED_WALLET_ENTITY_ID,
EVALUATOR_WALLET_ADDRESS,
EVALUATOR_AGENT_WALLET_ADDRESS,
baseSepoliaAcpConfig
),
onEvaluate: async (job: AcpJob) => {
Expand Down
4 changes: 2 additions & 2 deletions examples/acp_base/external_evaluation/seller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AcpContractClient, { AcpJobPhases } from "../../../src/acpContractClient"
import AcpJob from "../../../src/acpJob";
import { baseSepoliaAcpConfig } from "../../../src";
import {
SELLER_WALLET_ADDRESS,
SELLER_AGENT_WALLET_ADDRESS,
WHITELISTED_WALLET_ENTITY_ID,
WHITELISTED_WALLET_PRIVATE_KEY
} from "./env";
Expand All @@ -15,7 +15,7 @@ async function seller() {
acpContractClient: await AcpContractClient.build(
WHITELISTED_WALLET_PRIVATE_KEY,
WHITELISTED_WALLET_ENTITY_ID,
SELLER_WALLET_ADDRESS,
SELLER_AGENT_WALLET_ADDRESS,
baseSepoliaAcpConfig
),
onNewTask: async (job: AcpJob) => {
Expand Down
4 changes: 2 additions & 2 deletions examples/acp_base/self_evaluation/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WHITELISTED_WALLET_PRIVATE_KEY=0x-<whitelisted-wallet-private-key>
WHITELISTED_WALLET_ENTITY_ID=<whitelisted-wallet-entity-id>
BUYER_WALLET_ADDRESS=<buyer-agent-wallet-address>
SELLER_WALLET_ADDRESS=<seller-agent-wallet-address>
BUYER_AGENT_WALLET_ADDRESS=<buyer-agent-wallet-address>
SELLER_AGENT_WALLET_ADDRESS=<seller-agent-wallet-address>
4 changes: 2 additions & 2 deletions examples/acp_base/self_evaluation/buyer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AcpContractClient, { AcpJobPhases } from "../../../src/acpContractClient"
import AcpJob from "../../../src/acpJob";
import { baseSepoliaAcpConfig } from "../../../src";
import {
BUYER_WALLET_ADDRESS,
BUYER_AGENT_WALLET_ADDRESS,
WHITELISTED_WALLET_ENTITY_ID,
WHITELISTED_WALLET_PRIVATE_KEY
} from "./env";
Expand All @@ -15,7 +15,7 @@ async function buyer() {
acpContractClient: await AcpContractClient.build(
WHITELISTED_WALLET_PRIVATE_KEY,
WHITELISTED_WALLET_ENTITY_ID,
BUYER_WALLET_ADDRESS,
BUYER_AGENT_WALLET_ADDRESS,
baseSepoliaAcpConfig
),
onNewTask: async (job: AcpJob) => {
Expand Down
4 changes: 2 additions & 2 deletions examples/acp_base/self_evaluation/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function getEnvVar<T extends string = string>(key: string, required = true): T {

export const WHITELISTED_WALLET_PRIVATE_KEY = getEnvVar<Address>('WHITELISTED_WALLET_PRIVATE_KEY');
export const WHITELISTED_WALLET_ENTITY_ID = parseInt(getEnvVar('WHITELISTED_WALLET_ENTITY_ID'), 10);
export const BUYER_WALLET_ADDRESS = getEnvVar<Address>('BUYER_WALLET_ADDRESS');
export const SELLER_WALLET_ADDRESS = getEnvVar<Address>('SELLER_WALLET_ADDRESS');
export const BUYER_AGENT_WALLET_ADDRESS = getEnvVar<Address>('BUYER_AGENT_WALLET_ADDRESS');
export const SELLER_AGENT_WALLET_ADDRESS = getEnvVar<Address>('SELLER_AGENT_WALLET_ADDRESS');

if (isNaN(WHITELISTED_WALLET_ENTITY_ID)) {
throw new Error('WHITELISTED_WALLET_ENTITY_ID must be a valid number in the .env file');
Expand Down
4 changes: 2 additions & 2 deletions examples/acp_base/self_evaluation/seller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AcpContractClient, { AcpJobPhases } from "../../../src/acpContractClient"
import AcpJob from "../../../src/acpJob";
import { baseSepoliaAcpConfig } from "../../../src";
import {
SELLER_WALLET_ADDRESS,
SELLER_AGENT_WALLET_ADDRESS,
WHITELISTED_WALLET_ENTITY_ID,
WHITELISTED_WALLET_PRIVATE_KEY
} from "./env";
Expand All @@ -15,7 +15,7 @@ async function seller() {
acpContractClient: await AcpContractClient.build(
WHITELISTED_WALLET_PRIVATE_KEY,
WHITELISTED_WALLET_ENTITY_ID,
SELLER_WALLET_ADDRESS,
SELLER_AGENT_WALLET_ADDRESS,
baseSepoliaAcpConfig
),
onNewTask: async (job: AcpJob) => {
Expand Down
7 changes: 7 additions & 0 deletions examples/game_sdk/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
WHITELISTED_WALLET_PRIVATE_KEY=0x-<whitelisted-wallet-private-key>
WHITELISTED_WALLET_ENTITY_ID=<whitelisted-wallet-entity-id>
BUYER_AGENT_WALLET_ADDRESS=<buyer-agent-wallet-address>
SELLER_AGENT_WALLET_ADDRESS=<seller-agent-wallet-address>
BUYER_GAME_TWITTER_ACCESS_TOKEN=apx-<buyer-game-twitter-access-token>
SELLER_GAME_TWITTER_ACCESS_TOKEN=apx-<seller-game-twitter-access-token>
GAME_API_KEY=apt-<game-api-key>
Loading