@varun-ai07/covenant-mcp 2.0.2 → 2.0.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/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +55 -55
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/sdk/chunk-3R2WXEXL.mjs +828 -0
- package/dist/sdk/chunk-6ORMNSPN.mjs +842 -0
- package/dist/sdk/chunk-FH2MCRWQ.mjs +8732 -0
- package/dist/sdk/chunk-Y3YIH5K3.mjs +816 -0
- package/dist/sdk/config.d.ts +121 -0
- package/dist/sdk/config.d.ts.map +1 -0
- package/dist/sdk/config.js +196 -0
- package/dist/sdk/config.js.map +1 -0
- package/dist/sdk/contracts/AgentCollective.json +467 -0
- package/dist/sdk/contracts/AgentRegistry.d.ts +144 -0
- package/dist/sdk/contracts/AgentRegistry.d.ts.map +1 -0
- package/dist/sdk/contracts/AgentRegistry.js +92 -0
- package/dist/sdk/contracts/AgentRegistry.js.map +1 -0
- package/dist/sdk/contracts/COVENANTRouter.json +206 -0
- package/dist/sdk/contracts/CovenantArbitration.json +546 -0
- package/dist/sdk/contracts/CovenantAttestation.json +476 -0
- package/dist/sdk/contracts/CovenantEscrow.d.ts +70 -0
- package/dist/sdk/contracts/CovenantEscrow.d.ts.map +1 -0
- package/dist/sdk/contracts/CovenantEscrow.js +3 -0
- package/dist/sdk/contracts/CovenantEscrow.js.map +1 -0
- package/dist/sdk/contracts/CovenantEscrow.json +783 -0
- package/dist/sdk/contracts/CovenantGovernance.json +729 -0
- package/dist/sdk/contracts/CovenantIdentity.d.ts +70 -0
- package/dist/sdk/contracts/CovenantIdentity.d.ts.map +1 -0
- package/dist/sdk/contracts/CovenantIdentity.js +3 -0
- package/dist/sdk/contracts/CovenantIdentity.js.map +1 -0
- package/dist/sdk/contracts/CovenantIdentity.json +800 -0
- package/dist/sdk/contracts/CovenantSettlement.json +609 -0
- package/dist/sdk/contracts/DisputeResolution.d.ts +122 -0
- package/dist/sdk/contracts/DisputeResolution.d.ts.map +1 -0
- package/dist/sdk/contracts/DisputeResolution.js +86 -0
- package/dist/sdk/contracts/DisputeResolution.js.map +1 -0
- package/dist/sdk/contracts/GrantProgram.json +373 -0
- package/dist/sdk/contracts/InsurancePool.d.ts +209 -0
- package/dist/sdk/contracts/InsurancePool.d.ts.map +1 -0
- package/dist/sdk/contracts/InsurancePool.js +153 -0
- package/dist/sdk/contracts/InsurancePool.js.map +1 -0
- package/dist/sdk/contracts/InsurancePool.json +456 -0
- package/dist/sdk/contracts/MultiTokenEscrow.json +435 -0
- package/dist/sdk/contracts/OpenTaskMarket.d.ts +190 -0
- package/dist/sdk/contracts/OpenTaskMarket.d.ts.map +1 -0
- package/dist/sdk/contracts/OpenTaskMarket.js +117 -0
- package/dist/sdk/contracts/OpenTaskMarket.js.map +1 -0
- package/dist/sdk/contracts/ParallelTaskBatch.json +511 -0
- package/dist/sdk/contracts/ReceiptVerifierV2.d.ts +168 -0
- package/dist/sdk/contracts/ReceiptVerifierV2.d.ts.map +1 -0
- package/dist/sdk/contracts/ReceiptVerifierV2.js +109 -0
- package/dist/sdk/contracts/ReceiptVerifierV2.js.map +1 -0
- package/dist/sdk/contracts/RevisionManager.json +489 -0
- package/dist/sdk/contracts/TaskEscrow.d.ts +222 -0
- package/dist/sdk/contracts/TaskEscrow.d.ts.map +1 -0
- package/dist/sdk/contracts/TaskEscrow.js +144 -0
- package/dist/sdk/contracts/TaskEscrow.js.map +1 -0
- package/dist/sdk/contracts/TrainingMarketplace.json +357 -0
- package/dist/sdk/index.d.mts +385 -0
- package/dist/sdk/index.d.ts +35 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +284 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/index.mjs +32 -0
- package/dist/sdk/types.d.ts +110 -0
- package/dist/sdk/types.d.ts.map +1 -0
- package/dist/sdk/types.js +17 -0
- package/dist/sdk/types.js.map +1 -0
- package/dist/sdk/v2.d.mts +100 -0
- package/dist/sdk/v2.d.ts +100 -0
- package/dist/sdk/v2.d.ts.map +1 -0
- package/dist/sdk/v2.js +2615 -0
- package/dist/sdk/v2.js.map +1 -0
- package/dist/sdk/v2.mjs +571 -0
- package/dist/sdk/v5-extensions.d.ts +133 -0
- package/dist/sdk/v5-extensions.d.ts.map +1 -0
- package/dist/sdk/v5-extensions.js +993 -0
- package/dist/sdk/v5-extensions.js.map +1 -0
- package/dist/sdk.d.ts +30 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/sdk.js +180 -0
- package/dist/sdk.js.map +1 -0
- package/dist/server.js +1 -1
- package/dist/shared-types.d.ts +101 -1
- package/dist/shared-types.d.ts.map +1 -1
- package/package.json +3 -4
|
@@ -0,0 +1,842 @@
|
|
|
1
|
+
// src/config.ts
|
|
2
|
+
import { BASE_SEPOLIA_ADDRESSES } from "@covenant/shared-types";
|
|
3
|
+
var DEFAULT_ADDRESSES = {
|
|
4
|
+
// Base Sepolia Testnet
|
|
5
|
+
84532: BASE_SEPOLIA_ADDRESSES,
|
|
6
|
+
// Hardhat Local (placeholder addresses)
|
|
7
|
+
31337: {
|
|
8
|
+
AgentRegistry: "0x0000000000000000000000000000000000000000",
|
|
9
|
+
TaskEscrow: "0x0000000000000000000000000000000000000000",
|
|
10
|
+
ReceiptVerifier: "0x0000000000000000000000000000000000000000",
|
|
11
|
+
OpenTaskMarket: "0x0000000000000000000000000000000000000000",
|
|
12
|
+
ParallelTaskBatch: "0x0000000000000000000000000000000000000000",
|
|
13
|
+
AgentCollective: "0x0000000000000000000000000000000000000000",
|
|
14
|
+
AgentInsurance: "0x0000000000000000000000000000000000000000",
|
|
15
|
+
DisputeArbitration: "0x0000000000000000000000000000000000000000",
|
|
16
|
+
Groth16VerifierCapability: "0x0000000000000000000000000000000000000000",
|
|
17
|
+
CapabilityVerifier: "0x0000000000000000000000000000000000000000",
|
|
18
|
+
Groth16VerifierReputation: "0x0000000000000000000000000000000000000000",
|
|
19
|
+
ReputationVerifier: "0x0000000000000000000000000000000000000000",
|
|
20
|
+
COVENANTRouter: "0x0000000000000000000000000000000000000000",
|
|
21
|
+
LitProtocolIntegration: "0x0000000000000000000000000000000000000000",
|
|
22
|
+
MultiTokenEscrow: "0x0000000000000000000000000000000000000000",
|
|
23
|
+
AgentSmartWallet: "0x0000000000000000000000000000000000000000",
|
|
24
|
+
CovenantPaymaster: "0x0000000000000000000000000000000000000000",
|
|
25
|
+
TrainingMarketplace: "0x0000000000000000000000000000000000000000",
|
|
26
|
+
GrantProgram: "0x0000000000000000000000000000000000000000",
|
|
27
|
+
AutoVerifier: "0x0000000000000000000000000000000000000000",
|
|
28
|
+
MultiPartyReview: "0x0000000000000000000000000000000000000000",
|
|
29
|
+
ClientReputation: "0x0000000000000000000000000000000000000000",
|
|
30
|
+
StakeSlashing: "0x0000000000000000000000000000000000000000",
|
|
31
|
+
MilestoneVerification: "0x0000000000000000000000000000000000000000",
|
|
32
|
+
RevisionManager: "0x0000000000000000000000000000000000000000",
|
|
33
|
+
AgentWallet: "0x0000000000000000000000000000000000000000"
|
|
34
|
+
},
|
|
35
|
+
// Base Mainnet (placeholder - not deployed yet)
|
|
36
|
+
8453: {
|
|
37
|
+
AgentRegistry: "0x0000000000000000000000000000000000000000",
|
|
38
|
+
TaskEscrow: "0x0000000000000000000000000000000000000000",
|
|
39
|
+
ReceiptVerifier: "0x0000000000000000000000000000000000000000",
|
|
40
|
+
OpenTaskMarket: "0x0000000000000000000000000000000000000000",
|
|
41
|
+
ParallelTaskBatch: "0x0000000000000000000000000000000000000000",
|
|
42
|
+
AgentCollective: "0x0000000000000000000000000000000000000000",
|
|
43
|
+
AgentInsurance: "0x0000000000000000000000000000000000000000",
|
|
44
|
+
DisputeArbitration: "0x0000000000000000000000000000000000000000",
|
|
45
|
+
Groth16VerifierCapability: "0x0000000000000000000000000000000000000000",
|
|
46
|
+
CapabilityVerifier: "0x0000000000000000000000000000000000000000",
|
|
47
|
+
Groth16VerifierReputation: "0x0000000000000000000000000000000000000000",
|
|
48
|
+
ReputationVerifier: "0x0000000000000000000000000000000000000000",
|
|
49
|
+
COVENANTRouter: "0x0000000000000000000000000000000000000000",
|
|
50
|
+
LitProtocolIntegration: "0x0000000000000000000000000000000000000000",
|
|
51
|
+
MultiTokenEscrow: "0x0000000000000000000000000000000000000000",
|
|
52
|
+
AgentSmartWallet: "0x0000000000000000000000000000000000000000",
|
|
53
|
+
CovenantPaymaster: "0x0000000000000000000000000000000000000000",
|
|
54
|
+
TrainingMarketplace: "0x0000000000000000000000000000000000000000",
|
|
55
|
+
GrantProgram: "0x0000000000000000000000000000000000000000",
|
|
56
|
+
AutoVerifier: "0x0000000000000000000000000000000000000000",
|
|
57
|
+
MultiPartyReview: "0x0000000000000000000000000000000000000000",
|
|
58
|
+
ClientReputation: "0x0000000000000000000000000000000000000000",
|
|
59
|
+
StakeSlashing: "0x0000000000000000000000000000000000000000",
|
|
60
|
+
MilestoneVerification: "0x0000000000000000000000000000000000000000",
|
|
61
|
+
RevisionManager: "0x0000000000000000000000000000000000000000",
|
|
62
|
+
AgentWallet: "0x0000000000000000000000000000000000000000"
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var V2_ADDRESSES = {
|
|
66
|
+
// Base Sepolia Testnet
|
|
67
|
+
84532: {
|
|
68
|
+
AgentRegistry: "0x773d1954997b6A91e917e0c2326ABCcAf36e21E1",
|
|
69
|
+
TaskEscrow: "0xf4d0765A935E36F888d899D9A7C9156CeCdEa6F5",
|
|
70
|
+
ReceiptVerifier: "0x05cC13692755015FCb11e95d609187b214197edF",
|
|
71
|
+
InsurancePool: "0x920f3925122B3Ce9380A220AA748e67bD787BE1d",
|
|
72
|
+
DisputeResolution: "0xFA6dd0929a4ACCCC2E083DaDaD89226dd71Ef28F"
|
|
73
|
+
},
|
|
74
|
+
// Hardhat Local (placeholder addresses)
|
|
75
|
+
31337: {
|
|
76
|
+
AgentRegistry: "0x0000000000000000000000000000000000000000",
|
|
77
|
+
TaskEscrow: "0x0000000000000000000000000000000000000000",
|
|
78
|
+
ReceiptVerifier: "0x0000000000000000000000000000000000000000",
|
|
79
|
+
InsurancePool: "0x0000000000000000000000000000000000000000",
|
|
80
|
+
DisputeResolution: "0x0000000000000000000000000000000000000000"
|
|
81
|
+
},
|
|
82
|
+
// Base Mainnet (placeholder - not deployed yet)
|
|
83
|
+
8453: {
|
|
84
|
+
AgentRegistry: "0x0000000000000000000000000000000000000000",
|
|
85
|
+
TaskEscrow: "0x0000000000000000000000000000000000000000",
|
|
86
|
+
ReceiptVerifier: "0x0000000000000000000000000000000000000000",
|
|
87
|
+
InsurancePool: "0x0000000000000000000000000000000000000000",
|
|
88
|
+
DisputeResolution: "0x0000000000000000000000000000000000000000"
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
var CHAIN_CONFIGS = {
|
|
92
|
+
84532: {
|
|
93
|
+
chain: {
|
|
94
|
+
id: 84532,
|
|
95
|
+
name: "Base Sepolia",
|
|
96
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
97
|
+
rpcUrls: { default: { http: ["https://sepolia.base.org"] } }
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
8453: {
|
|
101
|
+
chain: {
|
|
102
|
+
id: 8453,
|
|
103
|
+
name: "Base",
|
|
104
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
105
|
+
rpcUrls: { default: { http: ["https://mainnet.base.org"] } }
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
31337: {
|
|
109
|
+
chain: {
|
|
110
|
+
id: 31337,
|
|
111
|
+
name: "Hardhat Local",
|
|
112
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
113
|
+
rpcUrls: { default: { http: ["http://localhost:8545"] } }
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
var CHAINS = {
|
|
118
|
+
baseSepolia: {
|
|
119
|
+
id: 84532,
|
|
120
|
+
name: "Base Sepolia",
|
|
121
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
122
|
+
rpcUrls: {
|
|
123
|
+
default: { http: ["https://sepolia.base.org"] }
|
|
124
|
+
},
|
|
125
|
+
blockExplorers: {
|
|
126
|
+
default: { name: "Basescan", url: "https://sepolia.basescan.org" }
|
|
127
|
+
},
|
|
128
|
+
testnet: true
|
|
129
|
+
},
|
|
130
|
+
base: {
|
|
131
|
+
id: 8453,
|
|
132
|
+
name: "Base",
|
|
133
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
134
|
+
rpcUrls: {
|
|
135
|
+
default: { http: ["https://mainnet.base.org"] }
|
|
136
|
+
},
|
|
137
|
+
blockExplorers: {
|
|
138
|
+
default: { name: "Basescan", url: "https://basescan.org" }
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
function getContractAddresses(chainId, overrides) {
|
|
143
|
+
const defaults = DEFAULT_ADDRESSES[chainId];
|
|
144
|
+
if (!defaults) {
|
|
145
|
+
throw new Error(`Unsupported chain ID: ${chainId}. Supported: ${Object.keys(DEFAULT_ADDRESSES).join(", ")}`);
|
|
146
|
+
}
|
|
147
|
+
return { ...defaults, ...overrides };
|
|
148
|
+
}
|
|
149
|
+
function isDeployed(chainId) {
|
|
150
|
+
const addresses = DEFAULT_ADDRESSES[chainId];
|
|
151
|
+
if (!addresses) return false;
|
|
152
|
+
return addresses.AgentRegistry !== "0x0000000000000000000000000000000000000000";
|
|
153
|
+
}
|
|
154
|
+
function getV2ContractAddresses(chainId, overrides) {
|
|
155
|
+
const defaults = V2_ADDRESSES[chainId];
|
|
156
|
+
if (!defaults) {
|
|
157
|
+
throw new Error(`Unsupported chain ID for V2: ${chainId}. Supported: ${Object.keys(V2_ADDRESSES).join(", ")}`);
|
|
158
|
+
}
|
|
159
|
+
return { ...defaults, ...overrides };
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// src/contracts/AgentRegistry.ts
|
|
163
|
+
var AgentRegistryABI = [
|
|
164
|
+
// Read functions
|
|
165
|
+
{
|
|
166
|
+
name: "getAgent",
|
|
167
|
+
type: "function",
|
|
168
|
+
stateMutability: "view",
|
|
169
|
+
inputs: [{ name: "agent", type: "address" }],
|
|
170
|
+
outputs: [
|
|
171
|
+
{ name: "did", type: "bytes32" },
|
|
172
|
+
{ name: "name", type: "string" },
|
|
173
|
+
{ name: "capabilities", type: "string[]" },
|
|
174
|
+
{ name: "reputation", type: "uint256" },
|
|
175
|
+
{ name: "stakedAmount", type: "uint256" },
|
|
176
|
+
{ name: "tasksCompleted", type: "uint256" },
|
|
177
|
+
{ name: "tasksFailed", type: "uint256" },
|
|
178
|
+
{ name: "totalValueTransferred", type: "uint256" },
|
|
179
|
+
{ name: "isActive", type: "bool" },
|
|
180
|
+
{ name: "registeredAt", type: "uint256" },
|
|
181
|
+
{ name: "walletAddress", type: "address" }
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: "getAgentCount",
|
|
186
|
+
type: "function",
|
|
187
|
+
stateMutability: "view",
|
|
188
|
+
inputs: [],
|
|
189
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: "getAgentsByCapability",
|
|
193
|
+
type: "function",
|
|
194
|
+
stateMutability: "view",
|
|
195
|
+
inputs: [
|
|
196
|
+
{ name: "capability", type: "string" },
|
|
197
|
+
{ name: "offset", type: "uint256" },
|
|
198
|
+
{ name: "limit", type: "uint256" }
|
|
199
|
+
],
|
|
200
|
+
outputs: [{ name: "", type: "address[]" }]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "getAllAgents",
|
|
204
|
+
type: "function",
|
|
205
|
+
stateMutability: "view",
|
|
206
|
+
inputs: [
|
|
207
|
+
{ name: "offset", type: "uint256" },
|
|
208
|
+
{ name: "limit", type: "uint256" }
|
|
209
|
+
],
|
|
210
|
+
outputs: [{ name: "", type: "address[]" }]
|
|
211
|
+
},
|
|
212
|
+
// Write functions
|
|
213
|
+
{
|
|
214
|
+
name: "register",
|
|
215
|
+
type: "function",
|
|
216
|
+
stateMutability: "payable",
|
|
217
|
+
inputs: [
|
|
218
|
+
{ name: "name", type: "string" },
|
|
219
|
+
{ name: "capabilities", type: "string[]" }
|
|
220
|
+
],
|
|
221
|
+
outputs: []
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: "deactivate",
|
|
225
|
+
type: "function",
|
|
226
|
+
stateMutability: "nonpayable",
|
|
227
|
+
inputs: [],
|
|
228
|
+
outputs: []
|
|
229
|
+
},
|
|
230
|
+
// Events
|
|
231
|
+
{
|
|
232
|
+
name: "AgentRegistered",
|
|
233
|
+
type: "event",
|
|
234
|
+
inputs: [
|
|
235
|
+
{ name: "agent", type: "address", indexed: true },
|
|
236
|
+
{ name: "did", type: "bytes32", indexed: true },
|
|
237
|
+
{ name: "name", type: "string", indexed: false },
|
|
238
|
+
{ name: "stake", type: "uint256", indexed: false }
|
|
239
|
+
]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "ReputationUpdated",
|
|
243
|
+
type: "event",
|
|
244
|
+
inputs: [
|
|
245
|
+
{ name: "agent", type: "address", indexed: true },
|
|
246
|
+
{ name: "delta", type: "int256", indexed: false },
|
|
247
|
+
{ name: "newReputation", type: "uint256", indexed: false }
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
];
|
|
251
|
+
|
|
252
|
+
// src/contracts/TaskEscrow.ts
|
|
253
|
+
var TaskEscrowABI = [
|
|
254
|
+
// Read functions
|
|
255
|
+
{
|
|
256
|
+
name: "getTask",
|
|
257
|
+
type: "function",
|
|
258
|
+
stateMutability: "view",
|
|
259
|
+
inputs: [{ name: "taskId", type: "uint256" }],
|
|
260
|
+
outputs: [
|
|
261
|
+
{ name: "taskId", type: "uint256" },
|
|
262
|
+
{ name: "client", type: "address" },
|
|
263
|
+
{ name: "worker", type: "address" },
|
|
264
|
+
{ name: "payment", type: "uint256" },
|
|
265
|
+
{ name: "deadline", type: "uint256" },
|
|
266
|
+
{ name: "descriptionHash", type: "string" },
|
|
267
|
+
{ name: "deliverableHash", type: "string" },
|
|
268
|
+
{ name: "status", type: "uint8" },
|
|
269
|
+
{ name: "createdAt", type: "uint256" },
|
|
270
|
+
{ name: "completedAt", type: "uint256" },
|
|
271
|
+
{ name: "protocolFee", type: "uint256" },
|
|
272
|
+
{ name: "totalValue", type: "uint256" }
|
|
273
|
+
]
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
name: "getTaskCount",
|
|
277
|
+
type: "function",
|
|
278
|
+
stateMutability: "view",
|
|
279
|
+
inputs: [],
|
|
280
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
name: "getClientTasks",
|
|
284
|
+
type: "function",
|
|
285
|
+
stateMutability: "view",
|
|
286
|
+
inputs: [{ name: "client", type: "address" }],
|
|
287
|
+
outputs: [{ name: "", type: "uint256[]" }]
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: "getWorkerTasks",
|
|
291
|
+
type: "function",
|
|
292
|
+
stateMutability: "view",
|
|
293
|
+
inputs: [{ name: "worker", type: "address" }],
|
|
294
|
+
outputs: [{ name: "", type: "uint256[]" }]
|
|
295
|
+
},
|
|
296
|
+
// Write functions
|
|
297
|
+
{
|
|
298
|
+
name: "createTask",
|
|
299
|
+
type: "function",
|
|
300
|
+
stateMutability: "payable",
|
|
301
|
+
inputs: [
|
|
302
|
+
{ name: "worker", type: "address" },
|
|
303
|
+
{ name: "deadline", type: "uint256" },
|
|
304
|
+
{ name: "descriptionHash", type: "string" }
|
|
305
|
+
],
|
|
306
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: "fundTask",
|
|
310
|
+
type: "function",
|
|
311
|
+
stateMutability: "payable",
|
|
312
|
+
inputs: [{ name: "taskId", type: "uint256" }],
|
|
313
|
+
outputs: []
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
name: "startTask",
|
|
317
|
+
type: "function",
|
|
318
|
+
stateMutability: "nonpayable",
|
|
319
|
+
inputs: [{ name: "taskId", type: "uint256" }],
|
|
320
|
+
outputs: []
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
name: "submitWork",
|
|
324
|
+
type: "function",
|
|
325
|
+
stateMutability: "nonpayable",
|
|
326
|
+
inputs: [
|
|
327
|
+
{ name: "taskId", type: "uint256" },
|
|
328
|
+
{ name: "deliverableHash", type: "string" }
|
|
329
|
+
],
|
|
330
|
+
outputs: []
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: "verifyTask",
|
|
334
|
+
type: "function",
|
|
335
|
+
stateMutability: "nonpayable",
|
|
336
|
+
inputs: [
|
|
337
|
+
{ name: "taskId", type: "uint256" },
|
|
338
|
+
{ name: "success", type: "bool" }
|
|
339
|
+
],
|
|
340
|
+
outputs: []
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: "disputeTask",
|
|
344
|
+
type: "function",
|
|
345
|
+
stateMutability: "payable",
|
|
346
|
+
inputs: [{ name: "taskId", type: "uint256" }],
|
|
347
|
+
outputs: []
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
name: "cancelTask",
|
|
351
|
+
type: "function",
|
|
352
|
+
stateMutability: "nonpayable",
|
|
353
|
+
inputs: [{ name: "taskId", type: "uint256" }],
|
|
354
|
+
outputs: []
|
|
355
|
+
},
|
|
356
|
+
// Events
|
|
357
|
+
{
|
|
358
|
+
name: "TaskCreated",
|
|
359
|
+
type: "event",
|
|
360
|
+
inputs: [
|
|
361
|
+
{ name: "taskId", type: "uint256", indexed: true },
|
|
362
|
+
{ name: "client", type: "address", indexed: true },
|
|
363
|
+
{ name: "worker", type: "address", indexed: true },
|
|
364
|
+
{ name: "payment", type: "uint256", indexed: false },
|
|
365
|
+
{ name: "deadline", type: "uint256", indexed: false }
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
name: "WorkSubmitted",
|
|
370
|
+
type: "event",
|
|
371
|
+
inputs: [
|
|
372
|
+
{ name: "taskId", type: "uint256", indexed: true },
|
|
373
|
+
{ name: "deliverableHash", type: "string", indexed: false }
|
|
374
|
+
]
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
name: "TaskCompleted",
|
|
378
|
+
type: "event",
|
|
379
|
+
inputs: [
|
|
380
|
+
{ name: "taskId", type: "uint256", indexed: true },
|
|
381
|
+
{ name: "workerPayment", type: "uint256", indexed: false }
|
|
382
|
+
]
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
name: "TaskDisputed",
|
|
386
|
+
type: "event",
|
|
387
|
+
inputs: [
|
|
388
|
+
{ name: "taskId", type: "uint256", indexed: true },
|
|
389
|
+
{ name: "disputedBy", type: "address", indexed: false }
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
];
|
|
393
|
+
|
|
394
|
+
// src/contracts/OpenTaskMarket.ts
|
|
395
|
+
var OpenTaskMarketABI = [
|
|
396
|
+
// Read functions
|
|
397
|
+
{
|
|
398
|
+
name: "getOpenTask",
|
|
399
|
+
type: "function",
|
|
400
|
+
stateMutability: "view",
|
|
401
|
+
inputs: [{ name: "taskId", type: "uint256" }],
|
|
402
|
+
outputs: [
|
|
403
|
+
{ name: "client", type: "address" },
|
|
404
|
+
{ name: "maxPayment", type: "uint256" },
|
|
405
|
+
{ name: "deadline", type: "uint256" },
|
|
406
|
+
{ name: "descriptionHash", type: "string" },
|
|
407
|
+
{ name: "bidders", type: "address[]" },
|
|
408
|
+
{ name: "selectedWorker", type: "address" },
|
|
409
|
+
{ name: "status", type: "uint8" }
|
|
410
|
+
]
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
name: "getBid",
|
|
414
|
+
type: "function",
|
|
415
|
+
stateMutability: "view",
|
|
416
|
+
inputs: [
|
|
417
|
+
{ name: "taskId", type: "uint256" },
|
|
418
|
+
{ name: "bidder", type: "address" }
|
|
419
|
+
],
|
|
420
|
+
outputs: [
|
|
421
|
+
{ name: "price", type: "uint256" },
|
|
422
|
+
{ name: "timeEstimate", type: "uint256" },
|
|
423
|
+
{ name: "proposalHash", type: "string" },
|
|
424
|
+
{ name: "bidAt", type: "uint256" }
|
|
425
|
+
]
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
name: "getOpenTaskCount",
|
|
429
|
+
type: "function",
|
|
430
|
+
stateMutability: "view",
|
|
431
|
+
inputs: [],
|
|
432
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
433
|
+
},
|
|
434
|
+
// Write functions
|
|
435
|
+
{
|
|
436
|
+
name: "postOpenTask",
|
|
437
|
+
type: "function",
|
|
438
|
+
stateMutability: "payable",
|
|
439
|
+
inputs: [
|
|
440
|
+
{ name: "maxPayment", type: "uint256" },
|
|
441
|
+
{ name: "deadline", type: "uint256" },
|
|
442
|
+
{ name: "descriptionHash", type: "string" }
|
|
443
|
+
],
|
|
444
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
name: "submitBid",
|
|
448
|
+
type: "function",
|
|
449
|
+
stateMutability: "nonpayable",
|
|
450
|
+
inputs: [
|
|
451
|
+
{ name: "taskId", type: "uint256" },
|
|
452
|
+
{ name: "price", type: "uint256" },
|
|
453
|
+
{ name: "timeEstimate", type: "uint256" },
|
|
454
|
+
{ name: "proposalHash", type: "string" }
|
|
455
|
+
],
|
|
456
|
+
outputs: []
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: "selectWorker",
|
|
460
|
+
type: "function",
|
|
461
|
+
stateMutability: "nonpayable",
|
|
462
|
+
inputs: [
|
|
463
|
+
{ name: "taskId", type: "uint256" },
|
|
464
|
+
{ name: "worker", type: "address" }
|
|
465
|
+
],
|
|
466
|
+
outputs: []
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
name: "withdrawBid",
|
|
470
|
+
type: "function",
|
|
471
|
+
stateMutability: "nonpayable",
|
|
472
|
+
inputs: [{ name: "taskId", type: "uint256" }],
|
|
473
|
+
outputs: []
|
|
474
|
+
},
|
|
475
|
+
// Events
|
|
476
|
+
{
|
|
477
|
+
name: "TaskPosted",
|
|
478
|
+
type: "event",
|
|
479
|
+
inputs: [
|
|
480
|
+
{ name: "taskId", type: "uint256", indexed: true },
|
|
481
|
+
{ name: "client", type: "address", indexed: true },
|
|
482
|
+
{ name: "maxPayment", type: "uint256", indexed: false },
|
|
483
|
+
{ name: "deadline", type: "uint256", indexed: false },
|
|
484
|
+
{ name: "descriptionHash", type: "string", indexed: false }
|
|
485
|
+
]
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
name: "BidSubmitted",
|
|
489
|
+
type: "event",
|
|
490
|
+
inputs: [
|
|
491
|
+
{ name: "taskId", type: "uint256", indexed: true },
|
|
492
|
+
{ name: "bidder", type: "address", indexed: true },
|
|
493
|
+
{ name: "price", type: "uint256", indexed: false },
|
|
494
|
+
{ name: "timeEstimate", type: "uint256", indexed: false },
|
|
495
|
+
{ name: "proposalHash", type: "string", indexed: false }
|
|
496
|
+
]
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
name: "WorkerSelected",
|
|
500
|
+
type: "event",
|
|
501
|
+
inputs: [
|
|
502
|
+
{ name: "taskId", type: "uint256", indexed: true },
|
|
503
|
+
{ name: "worker", type: "address", indexed: true },
|
|
504
|
+
{ name: "selectedPrice", type: "uint256", indexed: false }
|
|
505
|
+
]
|
|
506
|
+
}
|
|
507
|
+
];
|
|
508
|
+
|
|
509
|
+
// src/types.ts
|
|
510
|
+
import {
|
|
511
|
+
TASK_STATUS,
|
|
512
|
+
PRIORITY_LEVEL,
|
|
513
|
+
RECEIPT_TYPE,
|
|
514
|
+
BASE_SEPOLIA_ADDRESSES as BASE_SEPOLIA_ADDRESSES2
|
|
515
|
+
} from "@covenant/shared-types";
|
|
516
|
+
var ReceiptType = /* @__PURE__ */ ((ReceiptType2) => {
|
|
517
|
+
ReceiptType2[ReceiptType2["TaskCompleted"] = 0] = "TaskCompleted";
|
|
518
|
+
ReceiptType2[ReceiptType2["AgentVerified"] = 1] = "AgentVerified";
|
|
519
|
+
ReceiptType2[ReceiptType2["DisputeResolved"] = 2] = "DisputeResolved";
|
|
520
|
+
ReceiptType2[ReceiptType2["InsuranceClaimed"] = 3] = "InsuranceClaimed";
|
|
521
|
+
ReceiptType2[ReceiptType2["MilestoneReached"] = 4] = "MilestoneReached";
|
|
522
|
+
ReceiptType2[ReceiptType2["ReputationUpdated"] = 5] = "ReputationUpdated";
|
|
523
|
+
return ReceiptType2;
|
|
524
|
+
})(ReceiptType || {});
|
|
525
|
+
|
|
526
|
+
// src/index.ts
|
|
527
|
+
var CovenantSDK = class {
|
|
528
|
+
publicClient;
|
|
529
|
+
walletClient;
|
|
530
|
+
addresses;
|
|
531
|
+
chain;
|
|
532
|
+
account;
|
|
533
|
+
constructor(config) {
|
|
534
|
+
this.publicClient = config.publicClient;
|
|
535
|
+
this.walletClient = config.walletClient;
|
|
536
|
+
this.account = config.walletClient?.account;
|
|
537
|
+
this.addresses = getContractAddresses(config.chainId, config.contractAddresses);
|
|
538
|
+
this.chain = CHAIN_CONFIGS[config.chainId]?.chain ?? {
|
|
539
|
+
id: config.chainId,
|
|
540
|
+
name: `Chain ${config.chainId}`,
|
|
541
|
+
nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
|
|
542
|
+
rpcUrls: { default: { http: [] } }
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
// =========================================================================
|
|
546
|
+
// Agent Methods
|
|
547
|
+
// =========================================================================
|
|
548
|
+
/**
|
|
549
|
+
* Get agent data by address
|
|
550
|
+
*/
|
|
551
|
+
async getAgent(address) {
|
|
552
|
+
const result = await this.publicClient.readContract({
|
|
553
|
+
address: this.addresses.AgentRegistry,
|
|
554
|
+
abi: AgentRegistryABI,
|
|
555
|
+
functionName: "getAgent",
|
|
556
|
+
args: [address]
|
|
557
|
+
});
|
|
558
|
+
return this.parseAgentData(result);
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Get total number of registered agents
|
|
562
|
+
*/
|
|
563
|
+
async getAgentCount() {
|
|
564
|
+
return await this.publicClient.readContract({
|
|
565
|
+
address: this.addresses.AgentRegistry,
|
|
566
|
+
abi: AgentRegistryABI,
|
|
567
|
+
functionName: "getAgentCount",
|
|
568
|
+
args: []
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Find agents by capability
|
|
573
|
+
*/
|
|
574
|
+
async findAgents(capability, minReputation, limit = 20) {
|
|
575
|
+
const addresses = await this.publicClient.readContract({
|
|
576
|
+
address: this.addresses.AgentRegistry,
|
|
577
|
+
abi: AgentRegistryABI,
|
|
578
|
+
functionName: "getAgentsByCapability",
|
|
579
|
+
args: [capability, BigInt(0), BigInt(limit)]
|
|
580
|
+
});
|
|
581
|
+
if (minReputation !== void 0) {
|
|
582
|
+
const filtered = [];
|
|
583
|
+
for (const addr of addresses) {
|
|
584
|
+
const agent = await this.getAgent(addr);
|
|
585
|
+
if (agent.reputation >= BigInt(minReputation)) {
|
|
586
|
+
filtered.push(addr);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
return filtered;
|
|
590
|
+
}
|
|
591
|
+
return addresses;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Get all agents with pagination
|
|
595
|
+
*/
|
|
596
|
+
async getAllAgents(offset = 0, limit = 50) {
|
|
597
|
+
return await this.publicClient.readContract({
|
|
598
|
+
address: this.addresses.AgentRegistry,
|
|
599
|
+
abi: AgentRegistryABI,
|
|
600
|
+
functionName: "getAllAgents",
|
|
601
|
+
args: [BigInt(offset), BigInt(limit)]
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Register a new agent (requires wallet)
|
|
606
|
+
*/
|
|
607
|
+
async registerAgent(name, capabilities, stake) {
|
|
608
|
+
this.requireWallet();
|
|
609
|
+
return await this.walletClient.writeContract({
|
|
610
|
+
address: this.addresses.AgentRegistry,
|
|
611
|
+
abi: AgentRegistryABI,
|
|
612
|
+
functionName: "register",
|
|
613
|
+
args: [name, capabilities],
|
|
614
|
+
value: stake,
|
|
615
|
+
chain: this.chain,
|
|
616
|
+
account: this.account
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
// =========================================================================
|
|
620
|
+
// Task Methods
|
|
621
|
+
// =========================================================================
|
|
622
|
+
/**
|
|
623
|
+
* Get task data by ID
|
|
624
|
+
*/
|
|
625
|
+
async getTask(taskId) {
|
|
626
|
+
const result = await this.publicClient.readContract({
|
|
627
|
+
address: this.addresses.TaskEscrow,
|
|
628
|
+
abi: TaskEscrowABI,
|
|
629
|
+
functionName: "getTask",
|
|
630
|
+
args: [taskId]
|
|
631
|
+
});
|
|
632
|
+
return this.parseTaskData(result);
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Get total number of tasks
|
|
636
|
+
*/
|
|
637
|
+
async getTaskCount() {
|
|
638
|
+
return await this.publicClient.readContract({
|
|
639
|
+
address: this.addresses.TaskEscrow,
|
|
640
|
+
abi: TaskEscrowABI,
|
|
641
|
+
functionName: "getTaskCount",
|
|
642
|
+
args: []
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Get all task IDs for a client
|
|
647
|
+
*/
|
|
648
|
+
async getClientTasks(client) {
|
|
649
|
+
return await this.publicClient.readContract({
|
|
650
|
+
address: this.addresses.TaskEscrow,
|
|
651
|
+
abi: TaskEscrowABI,
|
|
652
|
+
functionName: "getClientTasks",
|
|
653
|
+
args: [client]
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Get all task IDs for a worker
|
|
658
|
+
*/
|
|
659
|
+
async getWorkerTasks(worker) {
|
|
660
|
+
return await this.publicClient.readContract({
|
|
661
|
+
address: this.addresses.TaskEscrow,
|
|
662
|
+
abi: TaskEscrowABI,
|
|
663
|
+
functionName: "getWorkerTasks",
|
|
664
|
+
args: [worker]
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Create a new task (requires wallet)
|
|
669
|
+
*/
|
|
670
|
+
async createTask(worker, payment, deadline, descriptionHash) {
|
|
671
|
+
this.requireWallet();
|
|
672
|
+
return await this.walletClient.writeContract({
|
|
673
|
+
address: this.addresses.TaskEscrow,
|
|
674
|
+
abi: TaskEscrowABI,
|
|
675
|
+
functionName: "createTask",
|
|
676
|
+
args: [worker, deadline, descriptionHash],
|
|
677
|
+
value: payment,
|
|
678
|
+
chain: this.chain,
|
|
679
|
+
account: this.account
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Submit work for a task (requires wallet)
|
|
684
|
+
*/
|
|
685
|
+
async submitWork(taskId, deliverableHash) {
|
|
686
|
+
this.requireWallet();
|
|
687
|
+
return await this.walletClient.writeContract({
|
|
688
|
+
address: this.addresses.TaskEscrow,
|
|
689
|
+
abi: TaskEscrowABI,
|
|
690
|
+
functionName: "submitWork",
|
|
691
|
+
args: [taskId, deliverableHash],
|
|
692
|
+
chain: this.chain,
|
|
693
|
+
account: this.account
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Verify task completion (requires wallet)
|
|
698
|
+
*/
|
|
699
|
+
async verifyTask(taskId, success) {
|
|
700
|
+
this.requireWallet();
|
|
701
|
+
return await this.walletClient.writeContract({
|
|
702
|
+
address: this.addresses.TaskEscrow,
|
|
703
|
+
abi: TaskEscrowABI,
|
|
704
|
+
functionName: "verifyTask",
|
|
705
|
+
args: [taskId, success],
|
|
706
|
+
chain: this.chain,
|
|
707
|
+
account: this.account
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* Dispute a task (requires wallet)
|
|
712
|
+
*/
|
|
713
|
+
async disputeTask(taskId, disputeBond) {
|
|
714
|
+
this.requireWallet();
|
|
715
|
+
return await this.walletClient.writeContract({
|
|
716
|
+
address: this.addresses.TaskEscrow,
|
|
717
|
+
abi: TaskEscrowABI,
|
|
718
|
+
functionName: "disputeTask",
|
|
719
|
+
args: [taskId],
|
|
720
|
+
value: disputeBond,
|
|
721
|
+
chain: this.chain,
|
|
722
|
+
account: this.account
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
// =========================================================================
|
|
726
|
+
// Open Task Market Methods
|
|
727
|
+
// =========================================================================
|
|
728
|
+
/**
|
|
729
|
+
* Post an open task for bidding
|
|
730
|
+
*/
|
|
731
|
+
async postOpenTask(maxPayment, deadline, descriptionHash) {
|
|
732
|
+
this.requireWallet();
|
|
733
|
+
return await this.walletClient.writeContract({
|
|
734
|
+
address: this.addresses.OpenTaskMarket,
|
|
735
|
+
abi: OpenTaskMarketABI,
|
|
736
|
+
functionName: "postOpenTask",
|
|
737
|
+
args: [maxPayment, deadline, descriptionHash],
|
|
738
|
+
value: maxPayment,
|
|
739
|
+
chain: this.chain,
|
|
740
|
+
account: this.account
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Submit a bid on an open task
|
|
745
|
+
*/
|
|
746
|
+
async submitBid(taskId, price, timeEstimate, proposalHash) {
|
|
747
|
+
this.requireWallet();
|
|
748
|
+
return await this.walletClient.writeContract({
|
|
749
|
+
address: this.addresses.OpenTaskMarket,
|
|
750
|
+
abi: OpenTaskMarketABI,
|
|
751
|
+
functionName: "submitBid",
|
|
752
|
+
args: [taskId, price, timeEstimate, proposalHash],
|
|
753
|
+
chain: this.chain,
|
|
754
|
+
account: this.account
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Select a worker for an open task
|
|
759
|
+
*/
|
|
760
|
+
async selectWorker(taskId, worker) {
|
|
761
|
+
this.requireWallet();
|
|
762
|
+
return await this.walletClient.writeContract({
|
|
763
|
+
address: this.addresses.OpenTaskMarket,
|
|
764
|
+
abi: OpenTaskMarketABI,
|
|
765
|
+
functionName: "selectWorker",
|
|
766
|
+
args: [taskId, worker],
|
|
767
|
+
chain: this.chain,
|
|
768
|
+
account: this.account
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
// =========================================================================
|
|
772
|
+
// Utility Methods
|
|
773
|
+
// =========================================================================
|
|
774
|
+
/**
|
|
775
|
+
* Wait for a transaction to be confirmed
|
|
776
|
+
*/
|
|
777
|
+
async waitForTransaction(hash) {
|
|
778
|
+
return await this.publicClient.waitForTransactionReceipt({ hash });
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Get contract addresses being used
|
|
782
|
+
*/
|
|
783
|
+
getAddresses() {
|
|
784
|
+
return { ...this.addresses };
|
|
785
|
+
}
|
|
786
|
+
// =========================================================================
|
|
787
|
+
// Private Helpers
|
|
788
|
+
// =========================================================================
|
|
789
|
+
requireWallet() {
|
|
790
|
+
if (!this.walletClient) {
|
|
791
|
+
throw new Error("Wallet client required for write operations. Pass walletClient in config.");
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
parseAgentData(result) {
|
|
795
|
+
return {
|
|
796
|
+
did: result[0],
|
|
797
|
+
name: result[1],
|
|
798
|
+
capabilities: result[2],
|
|
799
|
+
reputation: result[3],
|
|
800
|
+
stakedAmount: result[4],
|
|
801
|
+
tasksCompleted: result[5],
|
|
802
|
+
tasksFailed: result[6],
|
|
803
|
+
totalValueTransferred: result[7],
|
|
804
|
+
isActive: result[8],
|
|
805
|
+
registeredAt: result[9],
|
|
806
|
+
walletAddress: result[10]
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
parseTaskData(result) {
|
|
810
|
+
const statusMap = ["Open", "Funded", "InProgress", "Submitted", "Completed", "Disputed", "Failed", "Cancelled"];
|
|
811
|
+
return {
|
|
812
|
+
taskId: result[0],
|
|
813
|
+
client: result[1],
|
|
814
|
+
worker: result[2],
|
|
815
|
+
payment: result[3],
|
|
816
|
+
deadline: result[4],
|
|
817
|
+
descriptionHash: result[5],
|
|
818
|
+
deliverableHash: result[6],
|
|
819
|
+
status: statusMap[result[7]] || "Open",
|
|
820
|
+
createdAt: result[8],
|
|
821
|
+
completedAt: result[9],
|
|
822
|
+
protocolFee: result[10],
|
|
823
|
+
totalValue: result[11]
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
};
|
|
827
|
+
|
|
828
|
+
export {
|
|
829
|
+
DEFAULT_ADDRESSES,
|
|
830
|
+
V2_ADDRESSES,
|
|
831
|
+
CHAIN_CONFIGS,
|
|
832
|
+
CHAINS,
|
|
833
|
+
getContractAddresses,
|
|
834
|
+
isDeployed,
|
|
835
|
+
getV2ContractAddresses,
|
|
836
|
+
ReceiptType,
|
|
837
|
+
TASK_STATUS,
|
|
838
|
+
PRIORITY_LEVEL,
|
|
839
|
+
RECEIPT_TYPE,
|
|
840
|
+
BASE_SEPOLIA_ADDRESSES2 as BASE_SEPOLIA_ADDRESSES,
|
|
841
|
+
CovenantSDK
|
|
842
|
+
};
|