@virtuals-protocol/acp-node 0.1.0-beta.2 → 0.1.0-beta.3
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 +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ For testing on Base Sepolia:
|
|
|
58
58
|
## Installation
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
npm install acp-node
|
|
61
|
+
npm install @virtuals-protocol/acp-node
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## Usage
|
|
@@ -66,7 +66,7 @@ npm install acp-node
|
|
|
66
66
|
1. Import the ACP Client:
|
|
67
67
|
|
|
68
68
|
```typescript
|
|
69
|
-
import AcpClient from 'acp-node';
|
|
69
|
+
import AcpClient from '@virtuals-protocol/acp-node';
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
2. Create and initialize an ACP instance:
|
package/dist/index.d.mts
CHANGED
|
@@ -8410,7 +8410,7 @@ declare class AcpJobOffering {
|
|
|
8410
8410
|
requirementSchema?: Object | undefined;
|
|
8411
8411
|
private ajv;
|
|
8412
8412
|
constructor(acpClient: AcpClient, providerAddress: Address$1, type: string, price: number, requirementSchema?: Object | undefined);
|
|
8413
|
-
initiateJob(serviceRequirement: Object | string,
|
|
8413
|
+
initiateJob(serviceRequirement: Object | string, evaluatorAddress?: Address$1, expiredAt?: Date): Promise<number>;
|
|
8414
8414
|
}
|
|
8415
8415
|
|
|
8416
8416
|
interface IAcpClientOptions {
|
package/dist/index.d.ts
CHANGED
|
@@ -8410,7 +8410,7 @@ declare class AcpJobOffering {
|
|
|
8410
8410
|
requirementSchema?: Object | undefined;
|
|
8411
8411
|
private ajv;
|
|
8412
8412
|
constructor(acpClient: AcpClient, providerAddress: Address$1, type: string, price: number, requirementSchema?: Object | undefined);
|
|
8413
|
-
initiateJob(serviceRequirement: Object | string,
|
|
8413
|
+
initiateJob(serviceRequirement: Object | string, evaluatorAddress?: Address$1, expiredAt?: Date): Promise<number>;
|
|
8414
8414
|
}
|
|
8415
8415
|
|
|
8416
8416
|
interface IAcpClientOptions {
|
package/dist/index.js
CHANGED
|
@@ -1101,8 +1101,8 @@ var AcpJobOffering = class {
|
|
|
1101
1101
|
this.requirementSchema = requirementSchema;
|
|
1102
1102
|
this.ajv = new import_ajv.default({ allErrors: true });
|
|
1103
1103
|
}
|
|
1104
|
-
initiateJob(_0, _1
|
|
1105
|
-
return __async(this, arguments, function* (serviceRequirement,
|
|
1104
|
+
initiateJob(_0, _1) {
|
|
1105
|
+
return __async(this, arguments, function* (serviceRequirement, evaluatorAddress, expiredAt = new Date(Date.now() + 1e3 * 60 * 60 * 24)) {
|
|
1106
1106
|
if (this.requirementSchema) {
|
|
1107
1107
|
const validator = this.ajv.compile(this.requirementSchema);
|
|
1108
1108
|
const valid = validator(serviceRequirement);
|
|
@@ -1113,7 +1113,7 @@ var AcpJobOffering = class {
|
|
|
1113
1113
|
return yield this.acpClient.initiateJob(
|
|
1114
1114
|
this.providerAddress,
|
|
1115
1115
|
serviceRequirement,
|
|
1116
|
-
|
|
1116
|
+
this.price,
|
|
1117
1117
|
evaluatorAddress,
|
|
1118
1118
|
expiredAt
|
|
1119
1119
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -1063,8 +1063,8 @@ var AcpJobOffering = class {
|
|
|
1063
1063
|
this.requirementSchema = requirementSchema;
|
|
1064
1064
|
this.ajv = new Ajv({ allErrors: true });
|
|
1065
1065
|
}
|
|
1066
|
-
initiateJob(_0, _1
|
|
1067
|
-
return __async(this, arguments, function* (serviceRequirement,
|
|
1066
|
+
initiateJob(_0, _1) {
|
|
1067
|
+
return __async(this, arguments, function* (serviceRequirement, evaluatorAddress, expiredAt = new Date(Date.now() + 1e3 * 60 * 60 * 24)) {
|
|
1068
1068
|
if (this.requirementSchema) {
|
|
1069
1069
|
const validator = this.ajv.compile(this.requirementSchema);
|
|
1070
1070
|
const valid = validator(serviceRequirement);
|
|
@@ -1075,7 +1075,7 @@ var AcpJobOffering = class {
|
|
|
1075
1075
|
return yield this.acpClient.initiateJob(
|
|
1076
1076
|
this.providerAddress,
|
|
1077
1077
|
serviceRequirement,
|
|
1078
|
-
|
|
1078
|
+
this.price,
|
|
1079
1079
|
evaluatorAddress,
|
|
1080
1080
|
expiredAt
|
|
1081
1081
|
);
|