@virtuals-protocol/acp-node-v2 0.0.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 +453 -0
- package/dist/acpAgent.d.ts +103 -0
- package/dist/acpAgent.d.ts.map +1 -0
- package/dist/acpAgent.js +423 -0
- package/dist/acpAgent.js.map +1 -0
- package/dist/acpJob.d.ts +35 -0
- package/dist/acpJob.d.ts.map +1 -0
- package/dist/acpJob.js +62 -0
- package/dist/acpJob.js.map +1 -0
- package/dist/clientFactory.d.ts +10 -0
- package/dist/clientFactory.d.ts.map +1 -0
- package/dist/clientFactory.js +28 -0
- package/dist/clientFactory.js.map +1 -0
- package/dist/clients/baseAcpClient.d.ts +43 -0
- package/dist/clients/baseAcpClient.d.ts.map +1 -0
- package/dist/clients/baseAcpClient.js +40 -0
- package/dist/clients/baseAcpClient.js.map +1 -0
- package/dist/clients/evmAcpClient.d.ts +33 -0
- package/dist/clients/evmAcpClient.d.ts.map +1 -0
- package/dist/clients/evmAcpClient.js +164 -0
- package/dist/clients/evmAcpClient.js.map +1 -0
- package/dist/clients/solanaAcpClient.d.ts +29 -0
- package/dist/clients/solanaAcpClient.d.ts.map +1 -0
- package/dist/clients/solanaAcpClient.js +102 -0
- package/dist/clients/solanaAcpClient.js.map +1 -0
- package/dist/core/acpAbi.d.ts +944 -0
- package/dist/core/acpAbi.d.ts.map +1 -0
- package/dist/core/acpAbi.js +750 -0
- package/dist/core/acpAbi.js.map +1 -0
- package/dist/core/assetToken.d.ts +16 -0
- package/dist/core/assetToken.d.ts.map +1 -0
- package/dist/core/assetToken.js +50 -0
- package/dist/core/assetToken.js.map +1 -0
- package/dist/core/chains.d.ts +36 -0
- package/dist/core/chains.d.ts.map +1 -0
- package/dist/core/chains.js +49 -0
- package/dist/core/chains.js.map +1 -0
- package/dist/core/constants.d.ts +25 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +56 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/fundTransferHookAbi.d.ts +464 -0
- package/dist/core/fundTransferHookAbi.d.ts.map +1 -0
- package/dist/core/fundTransferHookAbi.js +347 -0
- package/dist/core/fundTransferHookAbi.js.map +1 -0
- package/dist/core/operations.d.ts +72 -0
- package/dist/core/operations.d.ts.map +1 -0
- package/dist/core/operations.js +2 -0
- package/dist/core/operations.js.map +1 -0
- package/dist/events/acpApiClient.d.ts +11 -0
- package/dist/events/acpApiClient.d.ts.map +1 -0
- package/dist/events/acpApiClient.js +57 -0
- package/dist/events/acpApiClient.js.map +1 -0
- package/dist/events/acpHttpClient.d.ts +18 -0
- package/dist/events/acpHttpClient.d.ts.map +1 -0
- package/dist/events/acpHttpClient.js +78 -0
- package/dist/events/acpHttpClient.js.map +1 -0
- package/dist/events/socketTransport.d.ts +18 -0
- package/dist/events/socketTransport.d.ts.map +1 -0
- package/dist/events/socketTransport.js +117 -0
- package/dist/events/socketTransport.js.map +1 -0
- package/dist/events/sseTransport.d.ts +17 -0
- package/dist/events/sseTransport.d.ts.map +1 -0
- package/dist/events/sseTransport.js +101 -0
- package/dist/events/sseTransport.js.map +1 -0
- package/dist/events/types.d.ts +197 -0
- package/dist/events/types.d.ts.map +1 -0
- package/dist/events/types.js +13 -0
- package/dist/events/types.js.map +1 -0
- package/dist/examples/buyer-fund.d.ts +2 -0
- package/dist/examples/buyer-fund.d.ts.map +1 -0
- package/dist/examples/buyer-fund.js +51 -0
- package/dist/examples/buyer-fund.js.map +1 -0
- package/dist/examples/buyer-llm.d.ts +2 -0
- package/dist/examples/buyer-llm.d.ts.map +1 -0
- package/dist/examples/buyer-llm.js +92 -0
- package/dist/examples/buyer-llm.js.map +1 -0
- package/dist/examples/buyer.d.ts +2 -0
- package/dist/examples/buyer.d.ts.map +1 -0
- package/dist/examples/buyer.js +66 -0
- package/dist/examples/buyer.js.map +1 -0
- package/dist/examples/seller-fund.d.ts +2 -0
- package/dist/examples/seller-fund.d.ts.map +1 -0
- package/dist/examples/seller-fund.js +48 -0
- package/dist/examples/seller-fund.js.map +1 -0
- package/dist/examples/seller-llm.d.ts +2 -0
- package/dist/examples/seller-llm.d.ts.map +1 -0
- package/dist/examples/seller-llm.js +85 -0
- package/dist/examples/seller-llm.js.map +1 -0
- package/dist/examples/seller.d.ts +2 -0
- package/dist/examples/seller.d.ts.map +1 -0
- package/dist/examples/seller.js +50 -0
- package/dist/examples/seller.js.map +1 -0
- package/dist/examples-local/buyer-fund.d.ts +2 -0
- package/dist/examples-local/buyer-fund.d.ts.map +1 -0
- package/dist/examples-local/buyer-fund.js +69 -0
- package/dist/examples-local/buyer-fund.js.map +1 -0
- package/dist/examples-local/buyer-llm.d.ts +2 -0
- package/dist/examples-local/buyer-llm.d.ts.map +1 -0
- package/dist/examples-local/buyer-llm.js +112 -0
- package/dist/examples-local/buyer-llm.js.map +1 -0
- package/dist/examples-local/buyer-search.d.ts +2 -0
- package/dist/examples-local/buyer-search.d.ts.map +1 -0
- package/dist/examples-local/buyer-search.js +72 -0
- package/dist/examples-local/buyer-search.js.map +1 -0
- package/dist/examples-local/buyer.d.ts +2 -0
- package/dist/examples-local/buyer.d.ts.map +1 -0
- package/dist/examples-local/buyer.js +65 -0
- package/dist/examples-local/buyer.js.map +1 -0
- package/dist/examples-local/seller-dumb.d.ts +2 -0
- package/dist/examples-local/seller-dumb.d.ts.map +1 -0
- package/dist/examples-local/seller-dumb.js +42 -0
- package/dist/examples-local/seller-dumb.js.map +1 -0
- package/dist/examples-local/seller-fund.d.ts +2 -0
- package/dist/examples-local/seller-fund.d.ts.map +1 -0
- package/dist/examples-local/seller-fund.js +46 -0
- package/dist/examples-local/seller-fund.js.map +1 -0
- package/dist/examples-local/seller-llm.d.ts +2 -0
- package/dist/examples-local/seller-llm.d.ts.map +1 -0
- package/dist/examples-local/seller-llm.js +84 -0
- package/dist/examples-local/seller-llm.js.map +1 -0
- package/dist/examples-local/seller.d.ts +2 -0
- package/dist/examples-local/seller.d.ts.map +1 -0
- package/dist/examples-local/seller.js +50 -0
- package/dist/examples-local/seller.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/jobSession.d.ts +37 -0
- package/dist/jobSession.d.ts.map +1 -0
- package/dist/jobSession.js +370 -0
- package/dist/jobSession.js.map +1 -0
- package/dist/providers/evm/alchemyEvmProviderAdapter.d.ts +28 -0
- package/dist/providers/evm/alchemyEvmProviderAdapter.d.ts.map +1 -0
- package/dist/providers/evm/alchemyEvmProviderAdapter.js +110 -0
- package/dist/providers/evm/alchemyEvmProviderAdapter.js.map +1 -0
- package/dist/providers/evm/privyAlchemyEvmProviderAdapter.d.ts +32 -0
- package/dist/providers/evm/privyAlchemyEvmProviderAdapter.d.ts.map +1 -0
- package/dist/providers/evm/privyAlchemyEvmProviderAdapter.js +252 -0
- package/dist/providers/evm/privyAlchemyEvmProviderAdapter.js.map +1 -0
- package/dist/providers/evm/viemProviderAdapter.d.ts +17 -0
- package/dist/providers/evm/viemProviderAdapter.d.ts.map +1 -0
- package/dist/providers/evm/viemProviderAdapter.js +37 -0
- package/dist/providers/evm/viemProviderAdapter.js.map +1 -0
- package/dist/providers/providerAuthClient.d.ts +18 -0
- package/dist/providers/providerAuthClient.d.ts.map +1 -0
- package/dist/providers/providerAuthClient.js +48 -0
- package/dist/providers/providerAuthClient.js.map +1 -0
- package/dist/providers/solana/solanaProviderAdapter.d.ts +12 -0
- package/dist/providers/solana/solanaProviderAdapter.d.ts.map +1 -0
- package/dist/providers/solana/solanaProviderAdapter.js +23 -0
- package/dist/providers/solana/solanaProviderAdapter.js.map +1 -0
- package/dist/providers/types.d.ts +45 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +2 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/utils/events.d.ts +17 -0
- package/dist/utils/events.d.ts.map +1 -0
- package/dist/utils/events.js +48 -0
- package/dist/utils/events.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
export const FUND_TRANSFER_HOOK_ABI = [
|
|
2
|
+
{
|
|
3
|
+
inputs: [{ internalType: "address", name: "coreAddress", type: "address" }],
|
|
4
|
+
stateMutability: "nonpayable",
|
|
5
|
+
type: "constructor",
|
|
6
|
+
},
|
|
7
|
+
{ inputs: [], name: "AlreadySigned", type: "error" },
|
|
8
|
+
{ inputs: [], name: "EscrowAlreadyExists", type: "error" },
|
|
9
|
+
{ inputs: [], name: "InvalidJob", type: "error" },
|
|
10
|
+
{ inputs: [], name: "NotLatestIntent", type: "error" },
|
|
11
|
+
{ inputs: [], name: "OnlyACPContract", type: "error" },
|
|
12
|
+
{ inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
|
|
13
|
+
{
|
|
14
|
+
inputs: [{ internalType: "address", name: "token", type: "address" }],
|
|
15
|
+
name: "SafeERC20FailedOperation",
|
|
16
|
+
type: "error",
|
|
17
|
+
},
|
|
18
|
+
{ inputs: [], name: "SubscriptionNotExtended", type: "error" },
|
|
19
|
+
{ inputs: [], name: "WrongStatus", type: "error" },
|
|
20
|
+
{
|
|
21
|
+
anonymous: false,
|
|
22
|
+
inputs: [
|
|
23
|
+
{
|
|
24
|
+
indexed: true,
|
|
25
|
+
internalType: "uint256",
|
|
26
|
+
name: "intentId",
|
|
27
|
+
type: "uint256",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
indexed: true,
|
|
31
|
+
internalType: "address",
|
|
32
|
+
name: "signer",
|
|
33
|
+
type: "address",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
indexed: false,
|
|
37
|
+
internalType: "bool",
|
|
38
|
+
name: "isApproved",
|
|
39
|
+
type: "bool",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
name: "IntentSigned",
|
|
43
|
+
type: "event",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
anonymous: false,
|
|
47
|
+
inputs: [
|
|
48
|
+
{
|
|
49
|
+
indexed: true,
|
|
50
|
+
internalType: "uint256",
|
|
51
|
+
name: "jobId",
|
|
52
|
+
type: "uint256",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
indexed: true,
|
|
56
|
+
internalType: "address",
|
|
57
|
+
name: "actor",
|
|
58
|
+
type: "address",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
indexed: false,
|
|
62
|
+
internalType: "uint256",
|
|
63
|
+
name: "intentId",
|
|
64
|
+
type: "uint256",
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
name: "NewIntent",
|
|
68
|
+
type: "event",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
anonymous: false,
|
|
72
|
+
inputs: [
|
|
73
|
+
{
|
|
74
|
+
indexed: true,
|
|
75
|
+
internalType: "uint256",
|
|
76
|
+
name: "jobId",
|
|
77
|
+
type: "uint256",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
indexed: true,
|
|
81
|
+
internalType: "uint256",
|
|
82
|
+
name: "intentId",
|
|
83
|
+
type: "uint256",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
indexed: false,
|
|
87
|
+
internalType: "address",
|
|
88
|
+
name: "sender",
|
|
89
|
+
type: "address",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
indexed: false,
|
|
93
|
+
internalType: "address",
|
|
94
|
+
name: "token",
|
|
95
|
+
type: "address",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
indexed: false,
|
|
99
|
+
internalType: "uint256",
|
|
100
|
+
name: "amount",
|
|
101
|
+
type: "uint256",
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
name: "PayableFundsEscrowed",
|
|
105
|
+
type: "event",
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
anonymous: false,
|
|
109
|
+
inputs: [
|
|
110
|
+
{
|
|
111
|
+
indexed: true,
|
|
112
|
+
internalType: "uint256",
|
|
113
|
+
name: "jobId",
|
|
114
|
+
type: "uint256",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
indexed: true,
|
|
118
|
+
internalType: "uint256",
|
|
119
|
+
name: "intentId",
|
|
120
|
+
type: "uint256",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
indexed: false,
|
|
124
|
+
internalType: "address",
|
|
125
|
+
name: "sender",
|
|
126
|
+
type: "address",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
indexed: false,
|
|
130
|
+
internalType: "address",
|
|
131
|
+
name: "token",
|
|
132
|
+
type: "address",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
indexed: false,
|
|
136
|
+
internalType: "uint256",
|
|
137
|
+
name: "amount",
|
|
138
|
+
type: "uint256",
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
name: "PayableFundsRefunded",
|
|
142
|
+
type: "event",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
anonymous: false,
|
|
146
|
+
inputs: [
|
|
147
|
+
{
|
|
148
|
+
indexed: true,
|
|
149
|
+
internalType: "uint256",
|
|
150
|
+
name: "jobId",
|
|
151
|
+
type: "uint256",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
indexed: true,
|
|
155
|
+
internalType: "uint256",
|
|
156
|
+
name: "intentId",
|
|
157
|
+
type: "uint256",
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
indexed: false,
|
|
161
|
+
internalType: "address",
|
|
162
|
+
name: "from",
|
|
163
|
+
type: "address",
|
|
164
|
+
},
|
|
165
|
+
{ indexed: false, internalType: "address", name: "to", type: "address" },
|
|
166
|
+
{
|
|
167
|
+
indexed: false,
|
|
168
|
+
internalType: "address",
|
|
169
|
+
name: "token",
|
|
170
|
+
type: "address",
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
indexed: false,
|
|
174
|
+
internalType: "uint256",
|
|
175
|
+
name: "amount",
|
|
176
|
+
type: "uint256",
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
name: "PayableTransferExecuted",
|
|
180
|
+
type: "event",
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
anonymous: false,
|
|
184
|
+
inputs: [
|
|
185
|
+
{
|
|
186
|
+
indexed: true,
|
|
187
|
+
internalType: "uint256",
|
|
188
|
+
name: "jobId",
|
|
189
|
+
type: "uint256",
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
indexed: true,
|
|
193
|
+
internalType: "address",
|
|
194
|
+
name: "client",
|
|
195
|
+
type: "address",
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
indexed: true,
|
|
199
|
+
internalType: "address",
|
|
200
|
+
name: "provider",
|
|
201
|
+
type: "address",
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
indexed: false,
|
|
205
|
+
internalType: "uint256",
|
|
206
|
+
name: "packageId",
|
|
207
|
+
type: "uint256",
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
indexed: false,
|
|
211
|
+
internalType: "uint256",
|
|
212
|
+
name: "expiry",
|
|
213
|
+
type: "uint256",
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
name: "SubscriptionSet",
|
|
217
|
+
type: "event",
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
inputs: [],
|
|
221
|
+
name: "acpContract",
|
|
222
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
223
|
+
stateMutability: "view",
|
|
224
|
+
type: "function",
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
inputs: [
|
|
228
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
229
|
+
{ internalType: "bytes4", name: "selector", type: "bytes4" },
|
|
230
|
+
{ internalType: "bytes", name: "data", type: "bytes" },
|
|
231
|
+
],
|
|
232
|
+
name: "afterAction",
|
|
233
|
+
outputs: [],
|
|
234
|
+
stateMutability: "nonpayable",
|
|
235
|
+
type: "function",
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
inputs: [
|
|
239
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
240
|
+
{ internalType: "bytes4", name: "selector", type: "bytes4" },
|
|
241
|
+
{ internalType: "bytes", name: "data", type: "bytes" },
|
|
242
|
+
],
|
|
243
|
+
name: "beforeAction",
|
|
244
|
+
outputs: [],
|
|
245
|
+
stateMutability: "nonpayable",
|
|
246
|
+
type: "function",
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
|
|
250
|
+
name: "claimEscrowRefund",
|
|
251
|
+
outputs: [],
|
|
252
|
+
stateMutability: "nonpayable",
|
|
253
|
+
type: "function",
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
|
|
257
|
+
name: "fundRequestIntentId",
|
|
258
|
+
outputs: [{ internalType: "uint256", name: "intentId", type: "uint256" }],
|
|
259
|
+
stateMutability: "view",
|
|
260
|
+
type: "function",
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
inputs: [{ internalType: "uint256", name: "intentId", type: "uint256" }],
|
|
264
|
+
name: "getIntent",
|
|
265
|
+
outputs: [
|
|
266
|
+
{
|
|
267
|
+
components: [
|
|
268
|
+
{ internalType: "uint256", name: "id", type: "uint256" },
|
|
269
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
270
|
+
{ internalType: "address", name: "actor", type: "address" },
|
|
271
|
+
{ internalType: "bool", name: "isEscrow", type: "bool" },
|
|
272
|
+
{ internalType: "bool", name: "isSigned", type: "bool" },
|
|
273
|
+
{ internalType: "address", name: "from", type: "address" },
|
|
274
|
+
{ internalType: "address", name: "token", type: "address" },
|
|
275
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
276
|
+
{ internalType: "address", name: "recipient", type: "address" },
|
|
277
|
+
],
|
|
278
|
+
internalType: "struct FundTransferHook.Intent",
|
|
279
|
+
name: "",
|
|
280
|
+
type: "tuple",
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
stateMutability: "view",
|
|
284
|
+
type: "function",
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
inputs: [
|
|
288
|
+
{ internalType: "address", name: "client", type: "address" },
|
|
289
|
+
{ internalType: "address", name: "provider", type: "address" },
|
|
290
|
+
{ internalType: "uint256", name: "packageId", type: "uint256" },
|
|
291
|
+
],
|
|
292
|
+
name: "getSubscriptionExpiry",
|
|
293
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
294
|
+
stateMutability: "view",
|
|
295
|
+
type: "function",
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
inputs: [],
|
|
299
|
+
name: "intentCounter",
|
|
300
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
301
|
+
stateMutability: "view",
|
|
302
|
+
type: "function",
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
306
|
+
name: "intents",
|
|
307
|
+
outputs: [
|
|
308
|
+
{ internalType: "uint256", name: "id", type: "uint256" },
|
|
309
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
310
|
+
{ internalType: "address", name: "actor", type: "address" },
|
|
311
|
+
{ internalType: "bool", name: "isEscrow", type: "bool" },
|
|
312
|
+
{ internalType: "bool", name: "isSigned", type: "bool" },
|
|
313
|
+
{ internalType: "address", name: "from", type: "address" },
|
|
314
|
+
{ internalType: "address", name: "token", type: "address" },
|
|
315
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
316
|
+
{ internalType: "address", name: "recipient", type: "address" },
|
|
317
|
+
],
|
|
318
|
+
stateMutability: "view",
|
|
319
|
+
type: "function",
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
|
|
323
|
+
name: "providerEscrowIntentId",
|
|
324
|
+
outputs: [{ internalType: "uint256", name: "intentId", type: "uint256" }],
|
|
325
|
+
stateMutability: "view",
|
|
326
|
+
type: "function",
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
inputs: [
|
|
330
|
+
{ internalType: "address", name: "client", type: "address" },
|
|
331
|
+
{ internalType: "address", name: "provider", type: "address" },
|
|
332
|
+
{ internalType: "uint256", name: "packageId", type: "uint256" },
|
|
333
|
+
],
|
|
334
|
+
name: "subscriptionExpiry",
|
|
335
|
+
outputs: [{ internalType: "uint256", name: "expiry", type: "uint256" }],
|
|
336
|
+
stateMutability: "view",
|
|
337
|
+
type: "function",
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
|
|
341
|
+
name: "supportsInterface",
|
|
342
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
343
|
+
stateMutability: "view",
|
|
344
|
+
type: "function",
|
|
345
|
+
},
|
|
346
|
+
];
|
|
347
|
+
//# sourceMappingURL=fundTransferHookAbi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fundTransferHookAbi.js","sourceRoot":"","sources":["../../src/core/fundTransferHookAbi.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC;QACE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC3E,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,aAAa;KACpB;IACD,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE;IACpD,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,OAAO,EAAE;IAC1D,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,YAA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C,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACzE,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YAC5D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;YAC9D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE;SAChE;QACD,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACvE,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QACzE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC3D,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;CACO,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { NetworkContext } from "./chains";
|
|
2
|
+
import type { Call, Hex } from "viem";
|
|
3
|
+
import type { SolanaInstructionLike } from "../providers/types";
|
|
4
|
+
export type CapabilityFlags = {
|
|
5
|
+
supportsBatch: boolean;
|
|
6
|
+
supportsAllowance: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type OperationResult<TTx, TRaw = unknown> = {
|
|
9
|
+
tx: TTx;
|
|
10
|
+
chain: NetworkContext["family"];
|
|
11
|
+
network: NetworkContext["network"];
|
|
12
|
+
raw?: TRaw;
|
|
13
|
+
};
|
|
14
|
+
export type PreparedEvmTx = OperationResult<Call[]> & {
|
|
15
|
+
chain: "evm";
|
|
16
|
+
};
|
|
17
|
+
export type PreparedSolanaTx = OperationResult<SolanaInstructionLike[]> & {
|
|
18
|
+
chain: "solana";
|
|
19
|
+
};
|
|
20
|
+
export type PreparedTx = PreparedEvmTx | PreparedSolanaTx;
|
|
21
|
+
export type PreparedTxInput = PreparedTx[];
|
|
22
|
+
export type CreateJobParams = {
|
|
23
|
+
providerAddress: string;
|
|
24
|
+
evaluatorAddress: string;
|
|
25
|
+
expiredAt: number;
|
|
26
|
+
description: string;
|
|
27
|
+
hookAddress?: string;
|
|
28
|
+
optParams?: Hex;
|
|
29
|
+
};
|
|
30
|
+
export type SetBudgetParams = {
|
|
31
|
+
jobId: bigint;
|
|
32
|
+
amount: bigint;
|
|
33
|
+
optParams?: Hex;
|
|
34
|
+
};
|
|
35
|
+
export type ApproveAllowanceParams = {
|
|
36
|
+
tokenAddress: string;
|
|
37
|
+
spenderAddress: string;
|
|
38
|
+
amount: bigint;
|
|
39
|
+
optParams?: Hex;
|
|
40
|
+
};
|
|
41
|
+
export type FundParams = {
|
|
42
|
+
jobId: bigint;
|
|
43
|
+
expectedBudget: bigint;
|
|
44
|
+
optParams?: Hex;
|
|
45
|
+
};
|
|
46
|
+
export type SubmitParams = {
|
|
47
|
+
jobId: bigint;
|
|
48
|
+
deliverable: string;
|
|
49
|
+
optParams?: Hex;
|
|
50
|
+
};
|
|
51
|
+
export type CompleteParams = {
|
|
52
|
+
jobId: bigint;
|
|
53
|
+
reason: string;
|
|
54
|
+
optParams?: Hex;
|
|
55
|
+
};
|
|
56
|
+
export type RejectParams = {
|
|
57
|
+
jobId: bigint;
|
|
58
|
+
reason: string;
|
|
59
|
+
optParams?: Hex;
|
|
60
|
+
};
|
|
61
|
+
export type OnChainJob = {
|
|
62
|
+
id: bigint;
|
|
63
|
+
client: string;
|
|
64
|
+
provider: string;
|
|
65
|
+
evaluator: string;
|
|
66
|
+
description: string;
|
|
67
|
+
budget: bigint;
|
|
68
|
+
expiredAt: bigint;
|
|
69
|
+
status: number;
|
|
70
|
+
hook: string;
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/core/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,IAAI;IACjD,EAAE,EAAE,GAAG,CAAC;IACR,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAChC,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACnC,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC,IAAI,EAAE,CAAC,GAAG;IACpD,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,qBAAqB,EAAE,CAAC,GAAG;IACxE,KAAK,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAC1D,MAAM,MAAM,eAAe,GAAG,UAAU,EAAE,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,EAAE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AM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/core/operations.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AcpAgentDetail, AcpJobApi, BrowseAgentParams, OffChainJob } from "./types";
|
|
2
|
+
import { AcpHttpClient, type AcpHttpClientOptions } from "./acpHttpClient";
|
|
3
|
+
export declare class AcpApiClient extends AcpHttpClient implements AcpJobApi {
|
|
4
|
+
constructor(opts?: AcpHttpClientOptions);
|
|
5
|
+
getActiveJobs(): Promise<OffChainJob[]>;
|
|
6
|
+
getJob(chainId: number, jobId: string): Promise<OffChainJob | null>;
|
|
7
|
+
postDeliverable(chainId: number, jobId: string, deliverable: string): Promise<void>;
|
|
8
|
+
browseAgents(keyword: string, chainIds: number[], params?: BrowseAgentParams): Promise<Array<AcpAgentDetail>>;
|
|
9
|
+
getAgentByWalletAddress(walletAddress: string): Promise<AcpAgentDetail | null>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=acpApiClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acpApiClient.d.ts","sourceRoot":"","sources":["../../src/events/acpApiClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,WAAW,EACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,qBAAa,YAAa,SAAQ,aAAc,YAAW,SAAS;gBACtD,IAAI,GAAE,oBAAyB;IAIrC,aAAa,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IASvC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAUnE,eAAe,CACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAkBV,YAAY,CAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAAE,EAClB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAgB3B,uBAAuB,CAC3B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;CAalC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AcpHttpClient } from "./acpHttpClient";
|
|
2
|
+
export class AcpApiClient extends AcpHttpClient {
|
|
3
|
+
constructor(opts = {}) {
|
|
4
|
+
super(opts);
|
|
5
|
+
}
|
|
6
|
+
async getActiveJobs() {
|
|
7
|
+
await this.ensureAuthenticated();
|
|
8
|
+
const res = await this.authedFetch(`${this.serverUrl}/jobs`);
|
|
9
|
+
const data = (await res.json());
|
|
10
|
+
return data.jobs || [];
|
|
11
|
+
}
|
|
12
|
+
async getJob(chainId, jobId) {
|
|
13
|
+
await this.ensureAuthenticated();
|
|
14
|
+
const res = await this.authedFetch(`${this.serverUrl}/jobs/${chainId}/${jobId}`);
|
|
15
|
+
if (!res.ok)
|
|
16
|
+
return null;
|
|
17
|
+
const body = (await res.json());
|
|
18
|
+
return body.data ?? null;
|
|
19
|
+
}
|
|
20
|
+
async postDeliverable(chainId, jobId, deliverable) {
|
|
21
|
+
await this.ensureAuthenticated();
|
|
22
|
+
const res = await this.authedFetch(`${this.serverUrl}/jobs/${chainId}/${jobId}/deliverable`, {
|
|
23
|
+
method: "POST",
|
|
24
|
+
headers: { "Content-Type": "application/json" },
|
|
25
|
+
body: JSON.stringify({ deliverable }),
|
|
26
|
+
});
|
|
27
|
+
if (!res.ok) {
|
|
28
|
+
throw new Error(`postDeliverable failed: ${res.status} ${res.statusText}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async browseAgents(keyword, chainIds, params) {
|
|
32
|
+
await this.ensureAuthenticated();
|
|
33
|
+
const query = new URLSearchParams({ query: keyword });
|
|
34
|
+
if (chainIds.length > 0)
|
|
35
|
+
query.set("chainIds", chainIds.join(","));
|
|
36
|
+
for (const [key, value] of Object.entries(params ?? {})) {
|
|
37
|
+
if (value !== undefined)
|
|
38
|
+
query.set(key, String(value));
|
|
39
|
+
}
|
|
40
|
+
const res = await this.authedFetch(`${this.serverUrl}/agents/search?${query.toString()}`);
|
|
41
|
+
if (!res.ok) {
|
|
42
|
+
throw new Error(`browseAgents failed: ${res.status} ${res.statusText}`);
|
|
43
|
+
}
|
|
44
|
+
return (await res.json()).data;
|
|
45
|
+
}
|
|
46
|
+
async getAgentByWalletAddress(walletAddress) {
|
|
47
|
+
await this.ensureAuthenticated();
|
|
48
|
+
const res = await this.authedFetch(`${this.serverUrl}/agents/wallet/${walletAddress}`);
|
|
49
|
+
if (res.status === 404)
|
|
50
|
+
return null;
|
|
51
|
+
if (!res.ok) {
|
|
52
|
+
throw new Error(`getAgentByWalletAddress failed: ${res.status} ${res.statusText}`);
|
|
53
|
+
}
|
|
54
|
+
return (await res.json()).data;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=acpApiClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acpApiClient.js","sourceRoot":"","sources":["../../src/events/acpApiClient.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAA6B,MAAM,iBAAiB,CAAC;AAE3E,MAAM,OAAO,YAAa,SAAQ,aAAa;IAC7C,YAAY,OAA6B,EAAE;QACzC,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACjC,MAA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,IAAI,GAAG,CAAC,UAAU,EAAE,CAClE,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TransportContext } from "./types";
|
|
2
|
+
export type AcpHttpClientOptions = {
|
|
3
|
+
serverUrl?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare class AcpHttpClient {
|
|
6
|
+
protected ctx: TransportContext | null;
|
|
7
|
+
protected token: string;
|
|
8
|
+
protected readonly serverUrl: string;
|
|
9
|
+
constructor(opts?: AcpHttpClientOptions);
|
|
10
|
+
setContext(ctx: TransportContext): void;
|
|
11
|
+
ensureAuthenticated(): Promise<void>;
|
|
12
|
+
protected authenticate(): Promise<string>;
|
|
13
|
+
/** Returns true if the token expiry is within 60 s (or unparseable). */
|
|
14
|
+
protected isTokenExpiring(): boolean;
|
|
15
|
+
protected refreshTokenIfNeeded(): Promise<void>;
|
|
16
|
+
protected authedFetch(url: string, init?: RequestInit): Promise<Response>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=acpHttpClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acpHttpClient.d.ts","sourceRoot":"","sources":["../../src/events/acpHttpClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,aAAa;IACxB,SAAS,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAC9C,SAAS,CAAC,KAAK,SAAM;IACrB,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEzB,IAAI,GAAE,oBAAyB;IAI3C,UAAU,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI;IAIjC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;cAU1B,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IA2B/C,wEAAwE;IACxE,SAAS,CAAC,eAAe,IAAI,OAAO;cAWpB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;cAUrC,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,QAAQ,CAAC;CAkBrB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ACP_SERVER_URL } from "../core/constants";
|
|
2
|
+
export class AcpHttpClient {
|
|
3
|
+
constructor(opts = {}) {
|
|
4
|
+
this.ctx = null;
|
|
5
|
+
this.token = "";
|
|
6
|
+
this.serverUrl = opts.serverUrl ?? ACP_SERVER_URL;
|
|
7
|
+
}
|
|
8
|
+
setContext(ctx) {
|
|
9
|
+
this.ctx = ctx;
|
|
10
|
+
}
|
|
11
|
+
async ensureAuthenticated() {
|
|
12
|
+
if (!this.token || this.isTokenExpiring()) {
|
|
13
|
+
this.token = await this.authenticate();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Authentication
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
async authenticate() {
|
|
20
|
+
if (!this.ctx)
|
|
21
|
+
throw new Error("Transport context not set");
|
|
22
|
+
const chainId = this.ctx.providerSupportedChainIds[0];
|
|
23
|
+
const message = `acp-auth:${Date.now()}`;
|
|
24
|
+
const signature = await this.ctx.signMessage(chainId, message);
|
|
25
|
+
const res = await fetch(`${this.serverUrl}/auth/agent`, {
|
|
26
|
+
method: "POST",
|
|
27
|
+
headers: { "Content-Type": "application/json" },
|
|
28
|
+
body: JSON.stringify({
|
|
29
|
+
walletAddress: this.ctx.agentAddress,
|
|
30
|
+
signature,
|
|
31
|
+
message,
|
|
32
|
+
chainId,
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
if (!res.ok) {
|
|
36
|
+
throw new Error(`Agent auth failed: ${res.status} ${res.statusText}`);
|
|
37
|
+
}
|
|
38
|
+
const body = (await res.json());
|
|
39
|
+
return body.data.token;
|
|
40
|
+
}
|
|
41
|
+
/** Returns true if the token expiry is within 60 s (or unparseable). */
|
|
42
|
+
isTokenExpiring() {
|
|
43
|
+
try {
|
|
44
|
+
const parts = this.token.split(".");
|
|
45
|
+
if (!parts[1])
|
|
46
|
+
return true;
|
|
47
|
+
const payload = JSON.parse(Buffer.from(parts[1], "base64url").toString());
|
|
48
|
+
return (payload.exp ?? 0) * 1000 - Date.now() < 60000;
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async refreshTokenIfNeeded() {
|
|
55
|
+
if (this.isTokenExpiring()) {
|
|
56
|
+
this.token = await this.authenticate();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
// REST helpers
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
async authedFetch(url, init) {
|
|
63
|
+
const doFetch = () => fetch(url, {
|
|
64
|
+
...init,
|
|
65
|
+
headers: {
|
|
66
|
+
...init?.headers,
|
|
67
|
+
Authorization: `Bearer ${this.token}`,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
let res = await doFetch();
|
|
71
|
+
if (res.status === 401) {
|
|
72
|
+
this.token = await this.authenticate();
|
|
73
|
+
res = await doFetch();
|
|
74
|
+
}
|
|
75
|
+
return res;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=acpHttpClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acpHttpClient.js","sourceRoot":"","sources":["../../src/events/acpHttpClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMnD,MAAM,OAA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,OAAO,EAAE,CAAC;QAC1B,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACvB,IAAI,CAAC,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;YACvC,GAAG,GAAG,MAAM,OAAO,EAAE,CAAC;QACxB,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AcpChatTransport, JobRoomEntry } from "./types";
|
|
2
|
+
import { AcpHttpClient, type AcpHttpClientOptions } from "./acpHttpClient";
|
|
3
|
+
export type SocketTransportOptions = AcpHttpClientOptions;
|
|
4
|
+
export declare class SocketTransport extends AcpHttpClient implements AcpChatTransport {
|
|
5
|
+
private socket;
|
|
6
|
+
private heartbeatInterval;
|
|
7
|
+
private entryHandler;
|
|
8
|
+
private lastEventTimestamp;
|
|
9
|
+
private seenEntries;
|
|
10
|
+
constructor(opts?: SocketTransportOptions);
|
|
11
|
+
connect(onConnected?: () => void): Promise<void>;
|
|
12
|
+
disconnect(): Promise<void>;
|
|
13
|
+
onEntry(handler: (entry: JobRoomEntry) => void): void;
|
|
14
|
+
sendMessage(chainId: number, jobId: string, content: string, contentType?: string): void;
|
|
15
|
+
postMessage(chainId: number, jobId: string, content: string, contentType?: string): Promise<void>;
|
|
16
|
+
getHistory(chainId: number, jobId: string): Promise<JobRoomEntry[]>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=socketTransport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socketTransport.d.ts","sourceRoot":"","sources":["../../src/events/socketTransport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAoB,MAAM,SAAS,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAE1D,qBAAa,eAAgB,SAAQ,aAAc,YAAW,gBAAgB;IAC5E,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,iBAAiB,CAA+C;IACxE,OAAO,CAAC,YAAY,CAAgD;IACpE,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,WAAW,CAAqB;gBAE5B,IAAI,GAAE,sBAA2B;IAQvC,OAAO,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAyDhD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBjC,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI;IAQrD,WAAW,CACT,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,WAAW,GAAE,MAAe,GAC3B,IAAI;IAcD,WAAW,CACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,WAAW,GAAE,MAAe,GAC3B,OAAO,CAAC,IAAI,CAAC;IAoBV,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAQ1E"}
|