@compass-labs/api-sdk 0.5.6 → 0.5.8
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/FUNCTIONS.md +6 -26
- package/README.md +47 -78
- package/bin/mcp-server.js +19 -18
- package/bin/mcp-server.js.map +12 -12
- package/dist/commonjs/funcs/transactionBatchingAaveLoop.d.ts +1 -1
- package/dist/commonjs/funcs/transactionBatchingAaveLoop.js +1 -1
- package/dist/commonjs/funcs/transactionBatchingAuthorization.d.ts +6 -6
- package/dist/commonjs/funcs/transactionBatchingAuthorization.js +6 -6
- package/dist/commonjs/funcs/transactionBatchingExecute.d.ts +3 -2
- package/dist/commonjs/funcs/transactionBatchingExecute.d.ts.map +1 -1
- package/dist/commonjs/funcs/transactionBatchingExecute.js +3 -2
- package/dist/commonjs/funcs/transactionBatchingExecute.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/mcp-server/tools/transactionBatchingAaveLoop.js +1 -1
- package/dist/commonjs/mcp-server/tools/transactionBatchingAuthorization.js +6 -6
- package/dist/commonjs/mcp-server/tools/transactionBatchingAuthorization.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/transactionBatchingExecute.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools/transactionBatchingExecute.js +3 -2
- package/dist/commonjs/mcp-server/tools/transactionBatchingExecute.js.map +1 -1
- package/dist/commonjs/models/errors/apierror.d.ts +14 -2
- package/dist/commonjs/models/errors/apierror.d.ts.map +1 -1
- package/dist/commonjs/models/errors/apierror.js +1 -1
- package/dist/commonjs/models/errors/apierror.js.map +1 -1
- package/dist/commonjs/sdk/transactionbatching.d.ts +10 -9
- package/dist/commonjs/sdk/transactionbatching.d.ts.map +1 -1
- package/dist/commonjs/sdk/transactionbatching.js +10 -9
- package/dist/commonjs/sdk/transactionbatching.js.map +1 -1
- package/dist/esm/funcs/transactionBatchingAaveLoop.d.ts +1 -1
- package/dist/esm/funcs/transactionBatchingAaveLoop.js +1 -1
- package/dist/esm/funcs/transactionBatchingAuthorization.d.ts +6 -6
- package/dist/esm/funcs/transactionBatchingAuthorization.js +6 -6
- package/dist/esm/funcs/transactionBatchingExecute.d.ts +3 -2
- package/dist/esm/funcs/transactionBatchingExecute.d.ts.map +1 -1
- package/dist/esm/funcs/transactionBatchingExecute.js +3 -2
- package/dist/esm/funcs/transactionBatchingExecute.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/mcp-server/tools/transactionBatchingAaveLoop.js +1 -1
- package/dist/esm/mcp-server/tools/transactionBatchingAuthorization.js +6 -6
- package/dist/esm/mcp-server/tools/transactionBatchingAuthorization.js.map +1 -1
- package/dist/esm/mcp-server/tools/transactionBatchingExecute.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools/transactionBatchingExecute.js +3 -2
- package/dist/esm/mcp-server/tools/transactionBatchingExecute.js.map +1 -1
- package/dist/esm/models/errors/apierror.d.ts +14 -2
- package/dist/esm/models/errors/apierror.d.ts.map +1 -1
- package/dist/esm/models/errors/apierror.js +1 -1
- package/dist/esm/models/errors/apierror.js.map +1 -1
- package/dist/esm/sdk/transactionbatching.d.ts +10 -9
- package/dist/esm/sdk/transactionbatching.d.ts.map +1 -1
- package/dist/esm/sdk/transactionbatching.js +10 -9
- package/dist/esm/sdk/transactionbatching.js.map +1 -1
- package/docs/sdks/aavev3/README.md +83 -199
- package/docs/sdks/aerodromeslipstream/README.md +39 -79
- package/docs/sdks/morpho/README.md +84 -182
- package/docs/sdks/pendle/README.md +53 -113
- package/docs/sdks/sky/README.md +27 -51
- package/docs/sdks/smartaccount/README.md +5 -9
- package/docs/sdks/token/README.md +24 -56
- package/docs/sdks/transactionbatching/README.md +25 -36
- package/docs/sdks/uniswapv3/README.md +60 -132
- package/docs/sdks/universal/README.md +50 -106
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/transactionBatchingAaveLoop.ts +1 -1
- package/src/funcs/transactionBatchingAuthorization.ts +6 -6
- package/src/funcs/transactionBatchingExecute.ts +3 -2
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/transactionBatchingAaveLoop.ts +1 -1
- package/src/mcp-server/tools/transactionBatchingAuthorization.ts +6 -6
- package/src/mcp-server/tools/transactionBatchingExecute.ts +3 -2
- package/src/models/errors/apierror.ts +18 -3
- package/src/sdk/transactionbatching.ts +10 -9
|
@@ -31,11 +31,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
async function run() {
|
|
34
|
-
const result = await compassApiSDK.universal.portfolio({
|
|
35
|
-
chain: "arbitrum:mainnet",
|
|
36
|
-
});
|
|
34
|
+
const result = await compassApiSDK.universal.portfolio({});
|
|
37
35
|
|
|
38
|
-
// Handle the result
|
|
39
36
|
console.log(result);
|
|
40
37
|
}
|
|
41
38
|
|
|
@@ -57,18 +54,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
57
54
|
});
|
|
58
55
|
|
|
59
56
|
async function run() {
|
|
60
|
-
const res = await universalPortfolio(compassApiSDK, {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
const res = await universalPortfolio(compassApiSDK, {});
|
|
58
|
+
if (res.ok) {
|
|
59
|
+
const { value: result } = res;
|
|
60
|
+
console.log(result);
|
|
61
|
+
} else {
|
|
62
|
+
console.log("universalPortfolio failed:", res.error);
|
|
66
63
|
}
|
|
67
|
-
|
|
68
|
-
const { value: result } = res;
|
|
69
|
-
|
|
70
|
-
// Handle the result
|
|
71
|
-
console.log(result);
|
|
72
64
|
}
|
|
73
65
|
|
|
74
66
|
run();
|
|
@@ -112,11 +104,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
112
104
|
});
|
|
113
105
|
|
|
114
106
|
async function run() {
|
|
115
|
-
const result = await compassApiSDK.universal.visualizePortfolio({
|
|
116
|
-
chain: "arbitrum:mainnet",
|
|
117
|
-
});
|
|
107
|
+
const result = await compassApiSDK.universal.visualizePortfolio({});
|
|
118
108
|
|
|
119
|
-
// Handle the result
|
|
120
109
|
console.log(result);
|
|
121
110
|
}
|
|
122
111
|
|
|
@@ -138,18 +127,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
138
127
|
});
|
|
139
128
|
|
|
140
129
|
async function run() {
|
|
141
|
-
const res = await universalVisualizePortfolio(compassApiSDK, {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
130
|
+
const res = await universalVisualizePortfolio(compassApiSDK, {});
|
|
131
|
+
if (res.ok) {
|
|
132
|
+
const { value: result } = res;
|
|
133
|
+
console.log(result);
|
|
134
|
+
} else {
|
|
135
|
+
console.log("universalVisualizePortfolio failed:", res.error);
|
|
147
136
|
}
|
|
148
|
-
|
|
149
|
-
const { value: result } = res;
|
|
150
|
-
|
|
151
|
-
// Handle the result
|
|
152
|
-
console.log(result);
|
|
153
137
|
}
|
|
154
138
|
|
|
155
139
|
run();
|
|
@@ -189,11 +173,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
189
173
|
});
|
|
190
174
|
|
|
191
175
|
async function run() {
|
|
192
|
-
const result = await compassApiSDK.universal.supportedTokens({
|
|
193
|
-
chain: "arbitrum:mainnet",
|
|
194
|
-
});
|
|
176
|
+
const result = await compassApiSDK.universal.supportedTokens({});
|
|
195
177
|
|
|
196
|
-
// Handle the result
|
|
197
178
|
console.log(result);
|
|
198
179
|
}
|
|
199
180
|
|
|
@@ -215,18 +196,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
215
196
|
});
|
|
216
197
|
|
|
217
198
|
async function run() {
|
|
218
|
-
const res = await universalSupportedTokens(compassApiSDK, {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
199
|
+
const res = await universalSupportedTokens(compassApiSDK, {});
|
|
200
|
+
if (res.ok) {
|
|
201
|
+
const { value: result } = res;
|
|
202
|
+
console.log(result);
|
|
203
|
+
} else {
|
|
204
|
+
console.log("universalSupportedTokens failed:", res.error);
|
|
224
205
|
}
|
|
225
|
-
|
|
226
|
-
const { value: result } = res;
|
|
227
|
-
|
|
228
|
-
// Handle the result
|
|
229
|
-
console.log(result);
|
|
230
206
|
}
|
|
231
207
|
|
|
232
208
|
run();
|
|
@@ -272,13 +248,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
272
248
|
});
|
|
273
249
|
|
|
274
250
|
async function run() {
|
|
275
|
-
const result = await compassApiSDK.universal.allowance({
|
|
276
|
-
chain: "arbitrum:mainnet",
|
|
277
|
-
token: "USDC",
|
|
278
|
-
contractName: "AaveV3Pool",
|
|
279
|
-
});
|
|
251
|
+
const result = await compassApiSDK.universal.allowance({});
|
|
280
252
|
|
|
281
|
-
// Handle the result
|
|
282
253
|
console.log(result);
|
|
283
254
|
}
|
|
284
255
|
|
|
@@ -300,20 +271,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
300
271
|
});
|
|
301
272
|
|
|
302
273
|
async function run() {
|
|
303
|
-
const res = await universalAllowance(compassApiSDK, {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
if (!res.ok) {
|
|
310
|
-
throw res.error;
|
|
274
|
+
const res = await universalAllowance(compassApiSDK, {});
|
|
275
|
+
if (res.ok) {
|
|
276
|
+
const { value: result } = res;
|
|
277
|
+
console.log(result);
|
|
278
|
+
} else {
|
|
279
|
+
console.log("universalAllowance failed:", res.error);
|
|
311
280
|
}
|
|
312
|
-
|
|
313
|
-
const { value: result } = res;
|
|
314
|
-
|
|
315
|
-
// Handle the result
|
|
316
|
-
console.log(result);
|
|
317
281
|
}
|
|
318
282
|
|
|
319
283
|
run();
|
|
@@ -356,11 +320,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
356
320
|
});
|
|
357
321
|
|
|
358
322
|
async function run() {
|
|
359
|
-
const result = await compassApiSDK.universal.ens({
|
|
360
|
-
chain: "ethereum:mainnet",
|
|
361
|
-
});
|
|
323
|
+
const result = await compassApiSDK.universal.ens({});
|
|
362
324
|
|
|
363
|
-
// Handle the result
|
|
364
325
|
console.log(result);
|
|
365
326
|
}
|
|
366
327
|
|
|
@@ -382,18 +343,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
382
343
|
});
|
|
383
344
|
|
|
384
345
|
async function run() {
|
|
385
|
-
const res = await universalEns(compassApiSDK, {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
346
|
+
const res = await universalEns(compassApiSDK, {});
|
|
347
|
+
if (res.ok) {
|
|
348
|
+
const { value: result } = res;
|
|
349
|
+
console.log(result);
|
|
350
|
+
} else {
|
|
351
|
+
console.log("universalEns failed:", res.error);
|
|
391
352
|
}
|
|
392
|
-
|
|
393
|
-
const { value: result } = res;
|
|
394
|
-
|
|
395
|
-
// Handle the result
|
|
396
|
-
console.log(result);
|
|
397
353
|
}
|
|
398
354
|
|
|
399
355
|
run();
|
|
@@ -440,7 +396,6 @@ async function run() {
|
|
|
440
396
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
441
397
|
});
|
|
442
398
|
|
|
443
|
-
// Handle the result
|
|
444
399
|
console.log(result);
|
|
445
400
|
}
|
|
446
401
|
|
|
@@ -467,15 +422,12 @@ async function run() {
|
|
|
467
422
|
chain: "arbitrum:mainnet",
|
|
468
423
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
469
424
|
});
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
425
|
+
if (res.ok) {
|
|
426
|
+
const { value: result } = res;
|
|
427
|
+
console.log(result);
|
|
428
|
+
} else {
|
|
429
|
+
console.log("universalWrapEth failed:", res.error);
|
|
473
430
|
}
|
|
474
|
-
|
|
475
|
-
const { value: result } = res;
|
|
476
|
-
|
|
477
|
-
// Handle the result
|
|
478
|
-
console.log(result);
|
|
479
431
|
}
|
|
480
432
|
|
|
481
433
|
run();
|
|
@@ -522,7 +474,6 @@ async function run() {
|
|
|
522
474
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
523
475
|
});
|
|
524
476
|
|
|
525
|
-
// Handle the result
|
|
526
477
|
console.log(result);
|
|
527
478
|
}
|
|
528
479
|
|
|
@@ -549,15 +500,12 @@ async function run() {
|
|
|
549
500
|
chain: "arbitrum:mainnet",
|
|
550
501
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
551
502
|
});
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
503
|
+
if (res.ok) {
|
|
504
|
+
const { value: result } = res;
|
|
505
|
+
console.log(result);
|
|
506
|
+
} else {
|
|
507
|
+
console.log("universalUnwrapWeth failed:", res.error);
|
|
555
508
|
}
|
|
556
|
-
|
|
557
|
-
const { value: result } = res;
|
|
558
|
-
|
|
559
|
-
// Handle the result
|
|
560
|
-
console.log(result);
|
|
561
509
|
}
|
|
562
510
|
|
|
563
511
|
run();
|
|
@@ -611,7 +559,6 @@ async function run() {
|
|
|
611
559
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
612
560
|
});
|
|
613
561
|
|
|
614
|
-
// Handle the result
|
|
615
562
|
console.log(result);
|
|
616
563
|
}
|
|
617
564
|
|
|
@@ -640,15 +587,12 @@ async function run() {
|
|
|
640
587
|
chain: "base:mainnet",
|
|
641
588
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
642
589
|
});
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
590
|
+
if (res.ok) {
|
|
591
|
+
const { value: result } = res;
|
|
592
|
+
console.log(result);
|
|
593
|
+
} else {
|
|
594
|
+
console.log("universalAllowanceSet failed:", res.error);
|
|
646
595
|
}
|
|
647
|
-
|
|
648
|
-
const { value: result } = res;
|
|
649
|
-
|
|
650
|
-
// Handle the result
|
|
651
|
-
console.log(result);
|
|
652
596
|
}
|
|
653
597
|
|
|
654
598
|
run();
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
25
25
|
import { Result } from "../types/fp.js";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* AAVE leverage long/short
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
31
|
* Execute an Aave looping strategy that involves repeated supply and borrow
|
|
@@ -25,15 +25,15 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
25
25
|
import { Result } from "../types/fp.js";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Enable transaction bundling.
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
|
-
* Get authorization
|
|
31
|
+
* Get authorization for bundling transactions.
|
|
32
32
|
*
|
|
33
|
-
*
|
|
34
|
-
* ordering when batching multiple actions into a single
|
|
35
|
-
* includes a nonce and chain ID to guarantee
|
|
36
|
-
* targeting.
|
|
33
|
+
* Currently this is required for every transaction bundle to prevent replay attacks
|
|
34
|
+
* and ensure transaction ordering when batching multiple actions into a single
|
|
35
|
+
* transaction. The authorization includes a nonce and chain ID to guarantee
|
|
36
|
+
* transaction uniqueness and proper network targeting.
|
|
37
37
|
*/
|
|
38
38
|
export function transactionBatchingAuthorization(
|
|
39
39
|
client: CompassApiSDKCore,
|
|
@@ -25,10 +25,11 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
25
25
|
import { Result } from "../types/fp.js";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Construct Bundled Transaction
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
|
-
*
|
|
31
|
+
* Bundle arbitrary transactions together into a single multicall transaction using
|
|
32
|
+
* EIP-7702.
|
|
32
33
|
*
|
|
33
34
|
* This endpoint allows bundling multiple contract calls into a single atomic
|
|
34
35
|
* transaction, reducing gas costs and ensuring all operations succeed or fail
|
package/src/lib/config.ts
CHANGED
|
@@ -61,8 +61,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
61
61
|
export const SDK_METADATA = {
|
|
62
62
|
language: "typescript",
|
|
63
63
|
openapiDocVersion: "0.0.1",
|
|
64
|
-
sdkVersion: "0.5.
|
|
65
|
-
genVersion: "2.
|
|
64
|
+
sdkVersion: "0.5.8",
|
|
65
|
+
genVersion: "2.620.2",
|
|
66
66
|
userAgent:
|
|
67
|
-
"speakeasy-sdk/typescript 0.5.
|
|
67
|
+
"speakeasy-sdk/typescript 0.5.8 2.620.2 0.0.1 @compass-labs/api-sdk",
|
|
68
68
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -12,7 +12,7 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$transactionBatchingAaveLoop: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "transaction-batching-aave-loop",
|
|
15
|
-
description: `
|
|
15
|
+
description: `AAVE leverage long/short
|
|
16
16
|
|
|
17
17
|
Execute an Aave looping strategy that involves repeated supply and borrow
|
|
18
18
|
operations.
|
|
@@ -14,14 +14,14 @@ export const tool$transactionBatchingAuthorization: ToolDefinition<
|
|
|
14
14
|
typeof args
|
|
15
15
|
> = {
|
|
16
16
|
name: "transaction-batching-authorization",
|
|
17
|
-
description: `
|
|
17
|
+
description: `Enable transaction bundling.
|
|
18
18
|
|
|
19
|
-
Get authorization
|
|
19
|
+
Get authorization for bundling transactions.
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
ordering when batching multiple actions into a single
|
|
23
|
-
includes a nonce and chain ID to guarantee
|
|
24
|
-
targeting.`,
|
|
21
|
+
Currently this is required for every transaction bundle to prevent replay attacks
|
|
22
|
+
and ensure transaction ordering when batching multiple actions into a single
|
|
23
|
+
transaction. The authorization includes a nonce and chain ID to guarantee
|
|
24
|
+
transaction uniqueness and proper network targeting.`,
|
|
25
25
|
args,
|
|
26
26
|
tool: async (client, args, ctx) => {
|
|
27
27
|
const [result, apiCall] = await transactionBatchingAuthorization(
|
|
@@ -12,9 +12,10 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$transactionBatchingExecute: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "transaction-batching-execute",
|
|
15
|
-
description: `
|
|
15
|
+
description: `Construct Bundled Transaction
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Bundle arbitrary transactions together into a single multicall transaction using
|
|
18
|
+
EIP-7702.
|
|
18
19
|
|
|
19
20
|
This endpoint allows bundling multiple contract calls into a single atomic
|
|
20
21
|
transaction, reducing gas costs and ensuring all operations succeed or fail
|
|
@@ -3,22 +3,37 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export class APIError extends Error {
|
|
6
|
+
/**
|
|
7
|
+
* HTTP status code
|
|
8
|
+
*/
|
|
6
9
|
public readonly statusCode: number;
|
|
10
|
+
/**
|
|
11
|
+
* HTTP content type
|
|
12
|
+
*/
|
|
7
13
|
public readonly contentType: string;
|
|
14
|
+
/**
|
|
15
|
+
* HTTP body
|
|
16
|
+
*/
|
|
17
|
+
public readonly body: string;
|
|
18
|
+
/**
|
|
19
|
+
* Raw response
|
|
20
|
+
*/
|
|
21
|
+
public readonly rawResponse: Response;
|
|
8
22
|
|
|
9
23
|
constructor(
|
|
10
24
|
message: string,
|
|
11
|
-
|
|
12
|
-
|
|
25
|
+
rawResponse: Response,
|
|
26
|
+
body: string = "",
|
|
13
27
|
) {
|
|
14
28
|
const statusCode = rawResponse.status;
|
|
15
29
|
const contentType = rawResponse.headers.get("content-type") || "";
|
|
16
30
|
const bodyString = body.length > 0 ? `\n${body}` : "";
|
|
17
|
-
|
|
18
31
|
super(
|
|
19
32
|
`${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`,
|
|
20
33
|
);
|
|
21
34
|
|
|
35
|
+
this.body = body;
|
|
36
|
+
this.rawResponse = rawResponse;
|
|
22
37
|
this.statusCode = statusCode;
|
|
23
38
|
this.contentType = contentType;
|
|
24
39
|
|
|
@@ -11,15 +11,15 @@ import { unwrapAsync } from "../types/fp.js";
|
|
|
11
11
|
|
|
12
12
|
export class TransactionBatching extends ClientSDK {
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Enable transaction bundling.
|
|
15
15
|
*
|
|
16
16
|
* @remarks
|
|
17
|
-
* Get authorization
|
|
17
|
+
* Get authorization for bundling transactions.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
* ordering when batching multiple actions into a single
|
|
21
|
-
* includes a nonce and chain ID to guarantee
|
|
22
|
-
* targeting.
|
|
19
|
+
* Currently this is required for every transaction bundle to prevent replay attacks
|
|
20
|
+
* and ensure transaction ordering when batching multiple actions into a single
|
|
21
|
+
* transaction. The authorization includes a nonce and chain ID to guarantee
|
|
22
|
+
* transaction uniqueness and proper network targeting.
|
|
23
23
|
*/
|
|
24
24
|
async authorization(
|
|
25
25
|
request: components.MulticallAuthorizationRequest,
|
|
@@ -33,10 +33,11 @@ export class TransactionBatching extends ClientSDK {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Construct Bundled Transaction
|
|
37
37
|
*
|
|
38
38
|
* @remarks
|
|
39
|
-
*
|
|
39
|
+
* Bundle arbitrary transactions together into a single multicall transaction using
|
|
40
|
+
* EIP-7702.
|
|
40
41
|
*
|
|
41
42
|
* This endpoint allows bundling multiple contract calls into a single atomic
|
|
42
43
|
* transaction, reducing gas costs and ensuring all operations succeed or fail
|
|
@@ -55,7 +56,7 @@ export class TransactionBatching extends ClientSDK {
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
|
-
*
|
|
59
|
+
* AAVE leverage long/short
|
|
59
60
|
*
|
|
60
61
|
* @remarks
|
|
61
62
|
* Execute an Aave looping strategy that involves repeated supply and borrow
|