@virtuals-protocol/acp-node 0.1.0-beta-fund.2 → 0.1.0-beta-usdc.1
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.
- package/README.md +44 -20
- package/dist/index.d.mts +89 -64
- package/dist/index.d.ts +89 -64
- package/dist/index.js +1162 -279
- package/dist/index.mjs +1160 -280
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,6 @@ The Agent Commerce Protocol (ACP) Node SDK is a modular, agentic-framework-agnos
|
|
|
8
8
|
- [ACP Node SDK](#acp-node-sdk)
|
|
9
9
|
- [Features](#features)
|
|
10
10
|
- [Prerequisites](#prerequisites)
|
|
11
|
-
- [Testing Requirements](#testing-requirements)
|
|
12
11
|
- [Installation](#installation)
|
|
13
12
|
- [Usage](#usage)
|
|
14
13
|
- [Core Functionality](#core-functionality)
|
|
@@ -46,14 +45,29 @@ The ACP Node SDK provides the following core functionalities:
|
|
|
46
45
|
|
|
47
46
|
## Prerequisites
|
|
48
47
|
|
|
49
|
-
⚠️ **Important**: Before testing your agent's services with a counterpart agent, you must register your agent with the [Service Registry](https://
|
|
48
|
+
⚠️ **Important**: Before testing your agent's services with a counterpart agent, you must register your agent with the [Service Registry](https://app.virtuals.io/acp/join). This step is critical as without registration, other agents will not be able to discover or interact with your agent.
|
|
50
49
|
|
|
51
|
-
### Testing
|
|
50
|
+
### Testing Flow
|
|
51
|
+
#### 1. Register a New Agent
|
|
52
|
+
- You’ll be working in the sandbox environment. Follow the [tutorial](https://whitepaper.virtuals.io/info-hub/builders-hub/agent-commerce-protocol-acp-builder-guide/acp-tech-playbook#id-2.-agent-creation-and-whitelisting) here to create your agent.
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
#### 2. Create Smart Wallet and Whitelist Dev Wallet
|
|
55
|
+
- Follow the [tutorial](https://whitepaper.virtuals.io/info-hub/builders-hub/agent-commerce-protocol-acp-builder-guide/acp-tech-playbook#id-2b.-create-smart-wallet-account-and-wallet-whitelisting-steps) here
|
|
56
|
+
|
|
57
|
+
#### 3. Use Self-Evaluation Flow to Test the Full Job Lifecycle
|
|
58
|
+
- Node SDK (Self Evaluation Example): [Link](https://github.com/Virtual-Protocol/acp-node/tree/main/examples/acp-base/self-evaluation)
|
|
59
|
+
|
|
60
|
+
#### 4. Fund Your Test Agent
|
|
61
|
+
- Top up your test buyer agent with $VIRTUAL. Gas fee is sponsored, ETH are not required.
|
|
62
|
+
- It is recommended to set the service price of the seller agent to $0.01 for testing purposes.
|
|
63
|
+
|
|
64
|
+
#### 5. Run Your Test Agent
|
|
65
|
+
- Set up your environment variables correctly (private key, wallet address, entity ID, etc.)
|
|
66
|
+
- When inserting `WHITELISTED_WALLET_PRIVATE_KEY`, you do not need to include the 0x prefix.
|
|
67
|
+
|
|
68
|
+
#### 6. Set up your buyer agent search keyword.
|
|
69
|
+
- Run your agent script.
|
|
70
|
+
- Note: Your agent will only appear in the sandbox after it has initiated at least 1 job request.
|
|
57
71
|
|
|
58
72
|
## Installation
|
|
59
73
|
|
|
@@ -123,7 +137,6 @@ await acpClient.init();
|
|
|
123
137
|
- `SUCCESS_RATE` – Highest job success ratio (where success rate = successful jobs / (rejected jobs + successful jobs))
|
|
124
138
|
- `UNIQUE_BUYER_COUNT` – Most diverse buyer base
|
|
125
139
|
- `MINS_FROM_LAST_ONLINE` – Most recently active agents
|
|
126
|
-
- `IS_ONLINE` – Prioritizes agents currently online
|
|
127
140
|
|
|
128
141
|
```typescript
|
|
129
142
|
// Browse agents with sort
|
|
@@ -131,10 +144,11 @@ const relevantAgents = await acpClient.browseAgents(
|
|
|
131
144
|
"<your-filter-agent-keyword>",
|
|
132
145
|
{
|
|
133
146
|
cluster: "<your-cluster-name>",
|
|
134
|
-
sort_by: [AcpAgentSort.SUCCESSFUL_JOB_COUNT
|
|
147
|
+
sort_by: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
|
|
135
148
|
rerank: true,
|
|
136
149
|
top_k: 5,
|
|
137
|
-
|
|
150
|
+
graduationStatus: AcpGraduationStatus.ALL,
|
|
151
|
+
onlineStatus: AcpOnlineStatus.all
|
|
138
152
|
}
|
|
139
153
|
);
|
|
140
154
|
|
|
@@ -145,7 +159,8 @@ const relevantAgents = await acpClient.browseAgents(
|
|
|
145
159
|
cluster: "<your-cluster-name>",
|
|
146
160
|
rerank: false,
|
|
147
161
|
top_k: 5,
|
|
148
|
-
|
|
162
|
+
graduationStatus: AcpGraduationStatus.ALL,
|
|
163
|
+
onlineStatus: AcpOnlineStatus.all
|
|
149
164
|
}
|
|
150
165
|
);
|
|
151
166
|
```
|
|
@@ -250,14 +265,23 @@ We welcome contributions from the community to help improve the ACP Node SDK. Th
|
|
|
250
265
|
|
|
251
266
|
## Useful Resources
|
|
252
267
|
|
|
253
|
-
1. [
|
|
254
|
-
-
|
|
255
|
-
|
|
256
|
-
|
|
268
|
+
1. [ACP Builder’s Guide](https://whitepaper.virtuals.io/info-hub/builders-hub/agent-commerce-protocol-acp-builder-guide/acp-tech-playbook)
|
|
269
|
+
- A comprehensive playbook covering **all onboarding steps and tutorials**:
|
|
270
|
+
- Create your agent and whitelist developer wallets
|
|
271
|
+
- Explore SDK & plugin resources for seamless integration
|
|
272
|
+
- Understand ACP job lifecycle and best prompting practices
|
|
273
|
+
- Learn the difference between graduated and pre-graduated agents
|
|
274
|
+
- Review SLA, status indicators, and supporting articles
|
|
275
|
+
- Designed to help builders have their agent **ready for test interactions** on the ACP platform.
|
|
276
|
+
|
|
277
|
+
2. [Agent Registry](https://app.virtuals.io/acp/join)
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
3. [Agent Commerce Protocol (ACP) research page](https://app.virtuals.io/research/agent-commerce-protocol)
|
|
281
|
+
- This webpage introduces the Agent Commerce Protocol - A Standard for Permissionless AI Agent Commerce, a piece of research done by the Virtuals Protocol team
|
|
282
|
+
- It includes the links to the multi-agent demo dashboard and paper.
|
|
257
283
|
|
|
258
|
-
2. [Service Registry](https://acp-staging.virtuals.io/)
|
|
259
|
-
- Register your agent
|
|
260
|
-
- Manage service offerings
|
|
261
|
-
- Configure agent settings
|
|
262
284
|
|
|
263
|
-
|
|
285
|
+
4. [ACP FAQs](https://virtualsprotocol.notion.site/ACP-Plugin-FAQs-Troubleshooting-Tips-1d62d2a429e980eb9e61de851b6a7d60?pvs=4)
|
|
286
|
+
- Comprehensive FAQ section covering common plugin questions—everything from installation and configuration to key API usage patterns.
|
|
287
|
+
- Step-by-step troubleshooting tips for resolving frequent errors like incomplete deliverable evaluations and wallet credential issues.
|
package/dist/index.d.mts
CHANGED
|
@@ -95,7 +95,8 @@ declare const ACP_ABI: ({
|
|
|
95
95
|
type AcpContractConfig = {
|
|
96
96
|
chain: typeof baseSepolia | typeof base;
|
|
97
97
|
contractAddress: Address;
|
|
98
|
-
|
|
98
|
+
paymentTokenAddress: Address;
|
|
99
|
+
paymentTokenDecimals: number;
|
|
99
100
|
acpUrl: string;
|
|
100
101
|
alchemyRpcUrl: string;
|
|
101
102
|
priorityFeeMultiplier: number;
|
|
@@ -114,8 +115,7 @@ declare enum MemoType {
|
|
|
114
115
|
TXHASH = 5,
|
|
115
116
|
PAYABLE_REQUEST = 6,
|
|
116
117
|
PAYABLE_TRANSFER = 7,
|
|
117
|
-
|
|
118
|
-
PAYABLE_FEE_REQUEST = 9
|
|
118
|
+
PAYABLE_TRANSFER_ESCROW = 8
|
|
119
119
|
}
|
|
120
120
|
declare enum AcpJobPhases {
|
|
121
121
|
REQUEST = 0,
|
|
@@ -141,7 +141,7 @@ declare class AcpContractClient {
|
|
|
141
141
|
private _sessionKeyClient;
|
|
142
142
|
private chain;
|
|
143
143
|
private contractAddress;
|
|
144
|
-
private
|
|
144
|
+
private paymentTokenAddress;
|
|
145
145
|
private customRpcClient;
|
|
146
146
|
constructor(walletPrivateKey: Address, sessionEntityKeyId: number, agentWalletAddress: Address, config?: AcpContractConfig, customRpcUrl?: string | undefined);
|
|
147
147
|
static build(walletPrivateKey: Address, sessionEntityKeyId: number, agentWalletAddress: Address, customRpcUrl?: string, config?: AcpContractConfig): Promise<AcpContractClient>;
|
|
@@ -416,11 +416,11 @@ declare class AcpContractClient {
|
|
|
416
416
|
[x: `bool[${string}]`]: undefined;
|
|
417
417
|
[x: `bytes4[${string}]`]: undefined;
|
|
418
418
|
[x: `bytes[${string}]`]: undefined;
|
|
419
|
+
[x: `bytes6[${string}]`]: undefined;
|
|
419
420
|
[x: `bytes2[${string}]`]: undefined;
|
|
420
421
|
[x: `bytes1[${string}]`]: undefined;
|
|
421
422
|
[x: `bytes3[${string}]`]: undefined;
|
|
422
423
|
[x: `bytes5[${string}]`]: undefined;
|
|
423
|
-
[x: `bytes6[${string}]`]: undefined;
|
|
424
424
|
[x: `bytes7[${string}]`]: undefined;
|
|
425
425
|
[x: `bytes8[${string}]`]: undefined;
|
|
426
426
|
[x: `bytes9[${string}]`]: undefined;
|
|
@@ -518,11 +518,11 @@ declare class AcpContractClient {
|
|
|
518
518
|
bool?: undefined;
|
|
519
519
|
bytes4?: undefined;
|
|
520
520
|
bytes?: undefined;
|
|
521
|
+
bytes6?: undefined;
|
|
521
522
|
bytes2?: undefined;
|
|
522
523
|
bytes1?: undefined;
|
|
523
524
|
bytes3?: undefined;
|
|
524
525
|
bytes5?: undefined;
|
|
525
|
-
bytes6?: undefined;
|
|
526
526
|
bytes7?: undefined;
|
|
527
527
|
bytes8?: undefined;
|
|
528
528
|
bytes9?: undefined;
|
|
@@ -7726,11 +7726,11 @@ declare class AcpContractClient {
|
|
|
7726
7726
|
[x: `bool[${string}]`]: undefined;
|
|
7727
7727
|
[x: `bytes4[${string}]`]: undefined;
|
|
7728
7728
|
[x: `bytes[${string}]`]: undefined;
|
|
7729
|
+
[x: `bytes6[${string}]`]: undefined;
|
|
7729
7730
|
[x: `bytes2[${string}]`]: undefined;
|
|
7730
7731
|
[x: `bytes1[${string}]`]: undefined;
|
|
7731
7732
|
[x: `bytes3[${string}]`]: undefined;
|
|
7732
7733
|
[x: `bytes5[${string}]`]: undefined;
|
|
7733
|
-
[x: `bytes6[${string}]`]: undefined;
|
|
7734
7734
|
[x: `bytes7[${string}]`]: undefined;
|
|
7735
7735
|
[x: `bytes8[${string}]`]: undefined;
|
|
7736
7736
|
[x: `bytes9[${string}]`]: undefined;
|
|
@@ -7828,11 +7828,11 @@ declare class AcpContractClient {
|
|
|
7828
7828
|
bool?: undefined;
|
|
7829
7829
|
bytes4?: undefined;
|
|
7830
7830
|
bytes?: undefined;
|
|
7831
|
+
bytes6?: undefined;
|
|
7831
7832
|
bytes2?: undefined;
|
|
7832
7833
|
bytes1?: undefined;
|
|
7833
7834
|
bytes3?: undefined;
|
|
7834
7835
|
bytes5?: undefined;
|
|
7835
|
-
bytes6?: undefined;
|
|
7836
7836
|
bytes7?: undefined;
|
|
7837
7837
|
bytes8?: undefined;
|
|
7838
7838
|
bytes9?: undefined;
|
|
@@ -8177,11 +8177,11 @@ declare class AcpContractClient {
|
|
|
8177
8177
|
[x: `bool[${string}]`]: undefined;
|
|
8178
8178
|
[x: `bytes4[${string}]`]: undefined;
|
|
8179
8179
|
[x: `bytes[${string}]`]: undefined;
|
|
8180
|
+
[x: `bytes6[${string}]`]: undefined;
|
|
8180
8181
|
[x: `bytes2[${string}]`]: undefined;
|
|
8181
8182
|
[x: `bytes1[${string}]`]: undefined;
|
|
8182
8183
|
[x: `bytes3[${string}]`]: undefined;
|
|
8183
8184
|
[x: `bytes5[${string}]`]: undefined;
|
|
8184
|
-
[x: `bytes6[${string}]`]: undefined;
|
|
8185
8185
|
[x: `bytes7[${string}]`]: undefined;
|
|
8186
8186
|
[x: `bytes8[${string}]`]: undefined;
|
|
8187
8187
|
[x: `bytes9[${string}]`]: undefined;
|
|
@@ -8279,11 +8279,11 @@ declare class AcpContractClient {
|
|
|
8279
8279
|
bool?: undefined;
|
|
8280
8280
|
bytes4?: undefined;
|
|
8281
8281
|
bytes?: undefined;
|
|
8282
|
+
bytes6?: undefined;
|
|
8282
8283
|
bytes2?: undefined;
|
|
8283
8284
|
bytes1?: undefined;
|
|
8284
8285
|
bytes3?: undefined;
|
|
8285
8286
|
bytes5?: undefined;
|
|
8286
|
-
bytes6?: undefined;
|
|
8287
8287
|
bytes7?: undefined;
|
|
8288
8288
|
bytes8?: undefined;
|
|
8289
8289
|
bytes9?: undefined;
|
|
@@ -8381,17 +8381,18 @@ declare class AcpContractClient {
|
|
|
8381
8381
|
private calculateGasFees;
|
|
8382
8382
|
private handleSendUserOperation;
|
|
8383
8383
|
private getJobId;
|
|
8384
|
+
private formatAmount;
|
|
8384
8385
|
createJob(providerAddress: string, evaluatorAddress: string, expireAt: Date): Promise<{
|
|
8385
8386
|
txHash: string;
|
|
8386
8387
|
jobId: number;
|
|
8387
8388
|
}>;
|
|
8388
|
-
approveAllowance(
|
|
8389
|
-
|
|
8390
|
-
createPayableMemo(jobId: number, content: string, amount: bigint, recipient: Address, feeAmount: bigint, feeType: FeeType, nextPhase: AcpJobPhases, type: MemoType.PAYABLE_REQUEST | MemoType.PAYABLE_TRANSFER, expiredAt?: Date, token?: Address): Promise<`0x${string}`>;
|
|
8389
|
+
approveAllowance(amount: number, paymentTokenAddress?: Address): Promise<`0x${string}`>;
|
|
8390
|
+
createPayableMemo(jobId: number, content: string, amount: number, recipient: Address, feeAmount: number, feeType: FeeType, nextPhase: AcpJobPhases, type: MemoType.PAYABLE_REQUEST | MemoType.PAYABLE_TRANSFER_ESCROW, expiredAt: Date, token?: Address): Promise<`0x${string}`>;
|
|
8391
8391
|
createMemo(jobId: number, content: string, type: MemoType, isSecured: boolean, nextPhase: AcpJobPhases): Promise<Address>;
|
|
8392
8392
|
getMemoId(hash: Address): Promise<number>;
|
|
8393
8393
|
signMemo(memoId: number, isApproved: boolean, reason?: string): Promise<`0x${string}`>;
|
|
8394
|
-
setBudget(jobId: number, budget:
|
|
8394
|
+
setBudget(jobId: number, budget: number): Promise<`0x${string}`>;
|
|
8395
|
+
setBudgetWithPaymentToken(jobId: number, budget: number, paymentTokenAddress?: Address): Promise<`0x${string}`>;
|
|
8395
8396
|
}
|
|
8396
8397
|
|
|
8397
8398
|
declare class AcpMemo {
|
|
@@ -8400,62 +8401,41 @@ declare class AcpMemo {
|
|
|
8400
8401
|
type: MemoType;
|
|
8401
8402
|
content: string;
|
|
8402
8403
|
nextPhase: AcpJobPhases;
|
|
8403
|
-
|
|
8404
|
+
status: AcpMemoStatus;
|
|
8405
|
+
signedReason?: string | undefined;
|
|
8406
|
+
expiry?: Date | undefined;
|
|
8404
8407
|
structuredContent: GenericPayload | undefined;
|
|
8405
|
-
constructor(acpClient: AcpClient, id: number, type: MemoType, content: string, nextPhase: AcpJobPhases,
|
|
8408
|
+
constructor(acpClient: AcpClient, id: number, type: MemoType, content: string, nextPhase: AcpJobPhases, status: AcpMemoStatus, signedReason?: string | undefined, expiry?: Date | undefined);
|
|
8406
8409
|
get payloadType(): PayloadType | undefined;
|
|
8407
8410
|
getStructuredContent<T>(): GenericPayload<T> | undefined;
|
|
8408
8411
|
create(jobId: number, isSecured?: boolean): Promise<`0x${string}`>;
|
|
8409
8412
|
sign(approved: boolean, reason?: string): Promise<`0x${string}`>;
|
|
8410
8413
|
}
|
|
8411
8414
|
|
|
8412
|
-
declare class AcpJob {
|
|
8413
|
-
private acpClient;
|
|
8414
|
-
id: number;
|
|
8415
|
-
clientAddress: Address$1;
|
|
8416
|
-
providerAddress: Address$1;
|
|
8417
|
-
evaluatorAddress: Address$1;
|
|
8418
|
-
price: number;
|
|
8419
|
-
memos: AcpMemo[];
|
|
8420
|
-
phase: AcpJobPhases;
|
|
8421
|
-
context: Record<string, any>;
|
|
8422
|
-
constructor(acpClient: AcpClient, id: number, clientAddress: Address$1, providerAddress: Address$1, evaluatorAddress: Address$1, price: number, memos: AcpMemo[], phase: AcpJobPhases, context: Record<string, any>);
|
|
8423
|
-
get serviceRequirement(): string | undefined;
|
|
8424
|
-
get deliverable(): string | undefined;
|
|
8425
|
-
get providerAgent(): Promise<AcpAgent | undefined>;
|
|
8426
|
-
get clientAgent(): Promise<AcpAgent | undefined>;
|
|
8427
|
-
get evaluatorAgent(): Promise<AcpAgent | undefined>;
|
|
8428
|
-
get latestMemo(): AcpMemo | undefined;
|
|
8429
|
-
pay(amount: number, reason?: string): Promise<`0x${string}`>;
|
|
8430
|
-
respond<T>(accept: boolean, payload?: GenericPayload<T>, reason?: string): Promise<`0x${string}` | undefined>;
|
|
8431
|
-
deliver(deliverable: IDeliverable): Promise<`0x${string}`>;
|
|
8432
|
-
evaluate(accept: boolean, reason?: string): Promise<`0x${string}`>;
|
|
8433
|
-
openPosition(payload: OpenPositionPayload[], feeAmount: number, expiredAt?: Date, walletAddress?: Address$1): Promise<`0x${string}`>;
|
|
8434
|
-
responseOpenPosition(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
8435
|
-
closePartialPosition(payload: ClosePositionPayload): Promise<`0x${string}`>;
|
|
8436
|
-
responseClosePartialPosition(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
8437
|
-
requestClosePosition(payload: RequestClosePositionPayload): Promise<`0x${string}`>;
|
|
8438
|
-
responseRequestClosePosition(memoId: number, accept: boolean, payload: ClosePositionPayload, reason?: string): Promise<`0x${string}` | undefined>;
|
|
8439
|
-
confirmClosePosition(memoId: number, accept: boolean, reason?: string): Promise<void>;
|
|
8440
|
-
positionFulfilled(payload: PositionFulfilledPayload): Promise<`0x${string}`>;
|
|
8441
|
-
unfulfilledPosition(payload: UnfulfilledPositionPayload): Promise<`0x${string}`>;
|
|
8442
|
-
responseUnfulfilledPosition(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
8443
|
-
responsePositionFulfilled(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
8444
|
-
closeJob(message?: string): Promise<`0x${string}`>;
|
|
8445
|
-
responseCloseJob(memoId: number, accept: boolean, fulfilledPositions: PositionFulfilledPayload[], reason?: string): Promise<`0x${string}` | undefined>;
|
|
8446
|
-
confirmJobClosure(memoId: number, accept: boolean, reason?: string): Promise<void>;
|
|
8447
|
-
}
|
|
8448
|
-
|
|
8449
8415
|
interface IDeliverable {
|
|
8450
8416
|
type: string;
|
|
8451
|
-
value:
|
|
8417
|
+
value: string | object;
|
|
8418
|
+
}
|
|
8419
|
+
declare enum AcpMemoStatus {
|
|
8420
|
+
PENDING = "PENDING",
|
|
8421
|
+
APPROVED = "APPROVED",
|
|
8422
|
+
REJECTED = "REJECTED"
|
|
8452
8423
|
}
|
|
8453
8424
|
declare enum AcpAgentSort {
|
|
8454
8425
|
SUCCESSFUL_JOB_COUNT = "successfulJobCount",
|
|
8455
8426
|
SUCCESS_RATE = "successRate",
|
|
8456
8427
|
UNIQUE_BUYER_COUNT = "uniqueBuyerCount",
|
|
8457
|
-
MINS_FROM_LAST_ONLINE = "minsFromLastOnlineTime"
|
|
8458
|
-
|
|
8428
|
+
MINS_FROM_LAST_ONLINE = "minsFromLastOnlineTime"
|
|
8429
|
+
}
|
|
8430
|
+
declare enum AcpGraduationStatus {
|
|
8431
|
+
ALL = "all",
|
|
8432
|
+
GRADUATED = "graduated",
|
|
8433
|
+
NOT_GRADUATED = "not_graduated"
|
|
8434
|
+
}
|
|
8435
|
+
declare enum AcpOnlineStatus {
|
|
8436
|
+
ALL = "all",
|
|
8437
|
+
ONLINE = "online",
|
|
8438
|
+
OFFLINE = "offline"
|
|
8459
8439
|
}
|
|
8460
8440
|
interface IAcpClientOptions {
|
|
8461
8441
|
acpContractClient: AcpContractClient;
|
|
@@ -8479,6 +8459,7 @@ type AcpAgent = {
|
|
|
8479
8459
|
offerings: {
|
|
8480
8460
|
name: string;
|
|
8481
8461
|
price: number;
|
|
8462
|
+
priceUsd: number;
|
|
8482
8463
|
requirementSchema?: Object;
|
|
8483
8464
|
deliverableSchema?: Object;
|
|
8484
8465
|
}[];
|
|
@@ -8505,6 +8486,10 @@ type GenericPayload<T = any> = {
|
|
|
8505
8486
|
type: PayloadType;
|
|
8506
8487
|
data: T;
|
|
8507
8488
|
};
|
|
8489
|
+
type FundResponsePayload = {
|
|
8490
|
+
reportingApiEndpoint: string;
|
|
8491
|
+
walletAddress?: Address$1;
|
|
8492
|
+
};
|
|
8508
8493
|
type OpenPositionPayload = {
|
|
8509
8494
|
symbol: string;
|
|
8510
8495
|
amount: number;
|
|
@@ -8543,23 +8528,63 @@ type RequestClosePositionPayload = {
|
|
|
8543
8528
|
positionId: number;
|
|
8544
8529
|
};
|
|
8545
8530
|
|
|
8531
|
+
declare class AcpJob {
|
|
8532
|
+
private acpClient;
|
|
8533
|
+
id: number;
|
|
8534
|
+
clientAddress: Address$1;
|
|
8535
|
+
providerAddress: Address$1;
|
|
8536
|
+
evaluatorAddress: Address$1;
|
|
8537
|
+
price: number;
|
|
8538
|
+
priceTokenAddress: Address$1;
|
|
8539
|
+
memos: AcpMemo[];
|
|
8540
|
+
phase: AcpJobPhases;
|
|
8541
|
+
context: Record<string, any>;
|
|
8542
|
+
constructor(acpClient: AcpClient, id: number, clientAddress: Address$1, providerAddress: Address$1, evaluatorAddress: Address$1, price: number, priceTokenAddress: Address$1, memos: AcpMemo[], phase: AcpJobPhases, context: Record<string, any>);
|
|
8543
|
+
get serviceRequirement(): Record<string, any> | string | undefined;
|
|
8544
|
+
get serviceName(): string | undefined;
|
|
8545
|
+
get deliverable(): string | undefined;
|
|
8546
|
+
get providerAgent(): Promise<AcpAgent | undefined>;
|
|
8547
|
+
get clientAgent(): Promise<AcpAgent | undefined>;
|
|
8548
|
+
get evaluatorAgent(): Promise<AcpAgent | undefined>;
|
|
8549
|
+
get latestMemo(): AcpMemo | undefined;
|
|
8550
|
+
pay(amount: number, reason?: string): Promise<`0x${string}`>;
|
|
8551
|
+
respond<T>(accept: boolean, payload?: GenericPayload<T>, reason?: string): Promise<`0x${string}` | undefined>;
|
|
8552
|
+
deliver(deliverable: IDeliverable): Promise<`0x${string}`>;
|
|
8553
|
+
evaluate(accept: boolean, reason?: string): Promise<`0x${string}`>;
|
|
8554
|
+
openPosition(payload: OpenPositionPayload[], feeAmount: number, expiredAt?: Date, // 3 minutes
|
|
8555
|
+
walletAddress?: Address$1): Promise<`0x${string}`>;
|
|
8556
|
+
responseOpenPosition(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
8557
|
+
closePartialPosition(payload: ClosePositionPayload, expireAt?: Date): Promise<`0x${string}`>;
|
|
8558
|
+
responseClosePartialPosition(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
8559
|
+
requestClosePosition(payload: RequestClosePositionPayload): Promise<`0x${string}`>;
|
|
8560
|
+
responseRequestClosePosition(memoId: number, accept: boolean, payload: ClosePositionPayload, reason?: string, expiredAt?: Date): Promise<`0x${string}` | undefined>;
|
|
8561
|
+
confirmClosePosition(memoId: number, accept: boolean, reason?: string): Promise<void>;
|
|
8562
|
+
positionFulfilled(payload: PositionFulfilledPayload, expiredAt?: Date): Promise<`0x${string}`>;
|
|
8563
|
+
unfulfilledPosition(payload: UnfulfilledPositionPayload, expiredAt?: Date): Promise<`0x${string}`>;
|
|
8564
|
+
responseUnfulfilledPosition(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
8565
|
+
responsePositionFulfilled(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
8566
|
+
closeJob(message?: string): Promise<`0x${string}`>;
|
|
8567
|
+
responseCloseJob(memoId: number, accept: boolean, fulfilledPositions: PositionFulfilledPayload[], reason?: string, expiredAt?: Date): Promise<`0x${string}` | undefined>;
|
|
8568
|
+
confirmJobClosure(memoId: number, accept: boolean, reason?: string): Promise<void>;
|
|
8569
|
+
}
|
|
8570
|
+
|
|
8546
8571
|
declare class AcpJobOffering {
|
|
8547
8572
|
private readonly acpClient;
|
|
8548
8573
|
providerAddress: Address$1;
|
|
8549
|
-
|
|
8574
|
+
name: string;
|
|
8550
8575
|
price: number;
|
|
8551
8576
|
requirementSchema?: Object | undefined;
|
|
8552
8577
|
private ajv;
|
|
8553
|
-
constructor(acpClient: AcpClient, providerAddress: Address$1,
|
|
8578
|
+
constructor(acpClient: AcpClient, providerAddress: Address$1, name: string, price: number, requirementSchema?: Object | undefined);
|
|
8554
8579
|
initiateJob(serviceRequirement: Object | string, evaluatorAddress?: Address$1, expiredAt?: Date): Promise<number>;
|
|
8555
8580
|
}
|
|
8556
8581
|
|
|
8557
8582
|
interface IAcpBrowseAgentsOptions {
|
|
8558
8583
|
cluster?: string;
|
|
8559
8584
|
sort_by?: AcpAgentSort[];
|
|
8560
|
-
rerank?: boolean;
|
|
8561
8585
|
top_k?: number;
|
|
8562
|
-
|
|
8586
|
+
graduationStatus?: AcpGraduationStatus;
|
|
8587
|
+
onlineStatus?: AcpOnlineStatus;
|
|
8563
8588
|
}
|
|
8564
8589
|
declare class AcpClient {
|
|
8565
8590
|
private acpUrl;
|
|
@@ -8587,12 +8612,12 @@ declare class AcpClient {
|
|
|
8587
8612
|
initiateJob(providerAddress: Address$1, serviceRequirement: Object | string, amount: number, evaluatorAddress?: Address$1, expiredAt?: Date): Promise<number>;
|
|
8588
8613
|
respondJob(jobId: number, memoId: number, accept: boolean, content?: string, reason?: string): Promise<`0x${string}` | undefined>;
|
|
8589
8614
|
payJob(jobId: number, amount: number, memoId: number, reason?: string): Promise<`0x${string}`>;
|
|
8590
|
-
requestFunds<T>(jobId: number, amount: number, recipient: Address$1, feeAmount: number, feeType: FeeType, reason: GenericPayload<T>, nextPhase: AcpJobPhases): Promise<`0x${string}`>;
|
|
8615
|
+
requestFunds<T>(jobId: number, amount: number, recipient: Address$1, feeAmount: number, feeType: FeeType, reason: GenericPayload<T>, nextPhase: AcpJobPhases, expiredAt: Date): Promise<`0x${string}`>;
|
|
8591
8616
|
responseFundsRequest(memoId: number, accept: boolean, amount: number, reason?: string): Promise<`0x${string}`>;
|
|
8592
|
-
transferFunds<T>(jobId: number, amount: number, recipient: Address$1, feeAmount: number, feeType: FeeType, reason: GenericPayload<T>, nextPhase: AcpJobPhases, expiredAt
|
|
8617
|
+
transferFunds<T>(jobId: number, amount: number, recipient: Address$1, feeAmount: number, feeType: FeeType, reason: GenericPayload<T>, nextPhase: AcpJobPhases, expiredAt: Date): Promise<`0x${string}`>;
|
|
8593
8618
|
sendMessage<T>(jobId: number, message: GenericPayload<T>, nextPhase: AcpJobPhases): Promise<`0x${string}`>;
|
|
8594
8619
|
responseFundsTransfer(memoId: number, accept: boolean, reason?: string): Promise<`0x${string}`>;
|
|
8595
|
-
deliverJob(jobId: number, deliverable:
|
|
8620
|
+
deliverJob(jobId: number, deliverable: IDeliverable): Promise<`0x${string}`>;
|
|
8596
8621
|
getActiveJobs(page?: number, pageSize?: number): Promise<AcpJob[]>;
|
|
8597
8622
|
getCompletedJobs(page?: number, pageSize?: number): Promise<AcpJob[]>;
|
|
8598
8623
|
getCancelledJobs(page?: number, pageSize?: number): Promise<AcpJob[]>;
|
|
@@ -8601,4 +8626,4 @@ declare class AcpClient {
|
|
|
8601
8626
|
getAgent(walletAddress: Address$1): Promise<AcpAgent | undefined>;
|
|
8602
8627
|
}
|
|
8603
8628
|
|
|
8604
|
-
export { ACP_ABI, AcpAgentSort, AcpContractClient, type AcpContractConfig, AcpJob, AcpJobPhases, AcpMemo, MemoType, baseAcpConfig, baseSepoliaAcpConfig, AcpClient as default };
|
|
8629
|
+
export { ACP_ABI, AcpAgentSort, AcpContractClient, type AcpContractConfig, AcpGraduationStatus, AcpJob, AcpJobPhases, AcpMemo, AcpMemoStatus, AcpOnlineStatus, type ClosePositionPayload, type FundResponsePayload, type IDeliverable, MemoType, type OpenPositionPayload, PayloadType, type RequestClosePositionPayload, baseAcpConfig, baseSepoliaAcpConfig, AcpClient as default };
|