@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
|
@@ -35,11 +35,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
async function run() {
|
|
38
|
-
const result = await compassApiSDK.aerodromeSlipstream.slipstreamLiquidityProvisionPositions({
|
|
39
|
-
chain: "base:mainnet",
|
|
40
|
-
});
|
|
38
|
+
const result = await compassApiSDK.aerodromeSlipstream.slipstreamLiquidityProvisionPositions({});
|
|
41
39
|
|
|
42
|
-
// Handle the result
|
|
43
40
|
console.log(result);
|
|
44
41
|
}
|
|
45
42
|
|
|
@@ -61,18 +58,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
61
58
|
});
|
|
62
59
|
|
|
63
60
|
async function run() {
|
|
64
|
-
const res = await aerodromeSlipstreamSlipstreamLiquidityProvisionPositions(compassApiSDK, {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
const res = await aerodromeSlipstreamSlipstreamLiquidityProvisionPositions(compassApiSDK, {});
|
|
62
|
+
if (res.ok) {
|
|
63
|
+
const { value: result } = res;
|
|
64
|
+
console.log(result);
|
|
65
|
+
} else {
|
|
66
|
+
console.log("aerodromeSlipstreamSlipstreamLiquidityProvisionPositions failed:", res.error);
|
|
70
67
|
}
|
|
71
|
-
|
|
72
|
-
const { value: result } = res;
|
|
73
|
-
|
|
74
|
-
// Handle the result
|
|
75
|
-
console.log(result);
|
|
76
68
|
}
|
|
77
69
|
|
|
78
70
|
run();
|
|
@@ -117,13 +109,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
117
109
|
});
|
|
118
110
|
|
|
119
111
|
async function run() {
|
|
120
|
-
const result = await compassApiSDK.aerodromeSlipstream.slipstreamPoolPrice({
|
|
121
|
-
chain: "base:mainnet",
|
|
122
|
-
tokenIn: "USDC",
|
|
123
|
-
tokenOut: "WETH",
|
|
124
|
-
});
|
|
112
|
+
const result = await compassApiSDK.aerodromeSlipstream.slipstreamPoolPrice({});
|
|
125
113
|
|
|
126
|
-
// Handle the result
|
|
127
114
|
console.log(result);
|
|
128
115
|
}
|
|
129
116
|
|
|
@@ -145,20 +132,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
145
132
|
});
|
|
146
133
|
|
|
147
134
|
async function run() {
|
|
148
|
-
const res = await aerodromeSlipstreamSlipstreamPoolPrice(compassApiSDK, {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (!res.ok) {
|
|
155
|
-
throw res.error;
|
|
135
|
+
const res = await aerodromeSlipstreamSlipstreamPoolPrice(compassApiSDK, {});
|
|
136
|
+
if (res.ok) {
|
|
137
|
+
const { value: result } = res;
|
|
138
|
+
console.log(result);
|
|
139
|
+
} else {
|
|
140
|
+
console.log("aerodromeSlipstreamSlipstreamPoolPrice failed:", res.error);
|
|
156
141
|
}
|
|
157
|
-
|
|
158
|
-
const { value: result } = res;
|
|
159
|
-
|
|
160
|
-
// Handle the result
|
|
161
|
-
console.log(result);
|
|
162
142
|
}
|
|
163
143
|
|
|
164
144
|
run();
|
|
@@ -216,7 +196,6 @@ async function run() {
|
|
|
216
196
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
217
197
|
});
|
|
218
198
|
|
|
219
|
-
// Handle the result
|
|
220
199
|
console.log(result);
|
|
221
200
|
}
|
|
222
201
|
|
|
@@ -247,15 +226,12 @@ async function run() {
|
|
|
247
226
|
chain: "arbitrum:mainnet",
|
|
248
227
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
249
228
|
});
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
229
|
+
if (res.ok) {
|
|
230
|
+
const { value: result } = res;
|
|
231
|
+
console.log(result);
|
|
232
|
+
} else {
|
|
233
|
+
console.log("aerodromeSlipstreamSlipstreamSwapSellExactly failed:", res.error);
|
|
253
234
|
}
|
|
254
|
-
|
|
255
|
-
const { value: result } = res;
|
|
256
|
-
|
|
257
|
-
// Handle the result
|
|
258
|
-
console.log(result);
|
|
259
235
|
}
|
|
260
236
|
|
|
261
237
|
run();
|
|
@@ -314,7 +290,6 @@ async function run() {
|
|
|
314
290
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
315
291
|
});
|
|
316
292
|
|
|
317
|
-
// Handle the result
|
|
318
293
|
console.log(result);
|
|
319
294
|
}
|
|
320
295
|
|
|
@@ -345,15 +320,12 @@ async function run() {
|
|
|
345
320
|
chain: "arbitrum:mainnet",
|
|
346
321
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
347
322
|
});
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
323
|
+
if (res.ok) {
|
|
324
|
+
const { value: result } = res;
|
|
325
|
+
console.log(result);
|
|
326
|
+
} else {
|
|
327
|
+
console.log("aerodromeSlipstreamSlipstreamSwapBuyExactly failed:", res.error);
|
|
351
328
|
}
|
|
352
|
-
|
|
353
|
-
const { value: result } = res;
|
|
354
|
-
|
|
355
|
-
// Handle the result
|
|
356
|
-
console.log(result);
|
|
357
329
|
}
|
|
358
330
|
|
|
359
331
|
run();
|
|
@@ -416,7 +388,6 @@ async function run() {
|
|
|
416
388
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
417
389
|
});
|
|
418
390
|
|
|
419
|
-
// Handle the result
|
|
420
391
|
console.log(result);
|
|
421
392
|
}
|
|
422
393
|
|
|
@@ -452,15 +423,12 @@ async function run() {
|
|
|
452
423
|
chain: "arbitrum:mainnet",
|
|
453
424
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
454
425
|
});
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
426
|
+
if (res.ok) {
|
|
427
|
+
const { value: result } = res;
|
|
428
|
+
console.log(result);
|
|
429
|
+
} else {
|
|
430
|
+
console.log("aerodromeSlipstreamSlipstreamLiquidityProvisionMint failed:", res.error);
|
|
458
431
|
}
|
|
459
|
-
|
|
460
|
-
const { value: result } = res;
|
|
461
|
-
|
|
462
|
-
// Handle the result
|
|
463
|
-
console.log(result);
|
|
464
432
|
}
|
|
465
433
|
|
|
466
434
|
run();
|
|
@@ -520,7 +488,6 @@ async function run() {
|
|
|
520
488
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
521
489
|
});
|
|
522
490
|
|
|
523
|
-
// Handle the result
|
|
524
491
|
console.log(result);
|
|
525
492
|
}
|
|
526
493
|
|
|
@@ -551,15 +518,12 @@ async function run() {
|
|
|
551
518
|
chain: "base:mainnet",
|
|
552
519
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
553
520
|
});
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
521
|
+
if (res.ok) {
|
|
522
|
+
const { value: result } = res;
|
|
523
|
+
console.log(result);
|
|
524
|
+
} else {
|
|
525
|
+
console.log("aerodromeSlipstreamSlipstreamLiquidityProvisionIncrease failed:", res.error);
|
|
557
526
|
}
|
|
558
|
-
|
|
559
|
-
const { value: result } = res;
|
|
560
|
-
|
|
561
|
-
// Handle the result
|
|
562
|
-
console.log(result);
|
|
563
527
|
}
|
|
564
528
|
|
|
565
529
|
run();
|
|
@@ -616,7 +580,6 @@ async function run() {
|
|
|
616
580
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
617
581
|
});
|
|
618
582
|
|
|
619
|
-
// Handle the result
|
|
620
583
|
console.log(result);
|
|
621
584
|
}
|
|
622
585
|
|
|
@@ -644,15 +607,12 @@ async function run() {
|
|
|
644
607
|
chain: "ethereum:mainnet",
|
|
645
608
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
646
609
|
});
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
610
|
+
if (res.ok) {
|
|
611
|
+
const { value: result } = res;
|
|
612
|
+
console.log(result);
|
|
613
|
+
} else {
|
|
614
|
+
console.log("aerodromeSlipstreamSlipstreamLiquidityProvisionWithdraw failed:", res.error);
|
|
650
615
|
}
|
|
651
|
-
|
|
652
|
-
const { value: result } = res;
|
|
653
|
-
|
|
654
|
-
// Handle the result
|
|
655
|
-
console.log(result);
|
|
656
616
|
}
|
|
657
617
|
|
|
658
618
|
run();
|
|
@@ -38,11 +38,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
async function run() {
|
|
41
|
-
const result = await compassApiSDK.morpho.vaults({
|
|
42
|
-
chain: "ethereum:mainnet",
|
|
43
|
-
});
|
|
41
|
+
const result = await compassApiSDK.morpho.vaults({});
|
|
44
42
|
|
|
45
|
-
// Handle the result
|
|
46
43
|
console.log(result);
|
|
47
44
|
}
|
|
48
45
|
|
|
@@ -64,18 +61,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
64
61
|
});
|
|
65
62
|
|
|
66
63
|
async function run() {
|
|
67
|
-
const res = await morphoVaults(compassApiSDK, {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
const res = await morphoVaults(compassApiSDK, {});
|
|
65
|
+
if (res.ok) {
|
|
66
|
+
const { value: result } = res;
|
|
67
|
+
console.log(result);
|
|
68
|
+
} else {
|
|
69
|
+
console.log("morphoVaults failed:", res.error);
|
|
73
70
|
}
|
|
74
|
-
|
|
75
|
-
const { value: result } = res;
|
|
76
|
-
|
|
77
|
-
// Handle the result
|
|
78
|
-
console.log(result);
|
|
79
71
|
}
|
|
80
72
|
|
|
81
73
|
run();
|
|
@@ -122,12 +114,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
122
114
|
});
|
|
123
115
|
|
|
124
116
|
async function run() {
|
|
125
|
-
const result = await compassApiSDK.morpho.vault({
|
|
126
|
-
chain: "ethereum:mainnet",
|
|
127
|
-
vaultAddress: "0xbEef047a543E45807105E51A8BBEFCc5950fcfBa",
|
|
128
|
-
});
|
|
117
|
+
const result = await compassApiSDK.morpho.vault({});
|
|
129
118
|
|
|
130
|
-
// Handle the result
|
|
131
119
|
console.log(result);
|
|
132
120
|
}
|
|
133
121
|
|
|
@@ -149,19 +137,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
149
137
|
});
|
|
150
138
|
|
|
151
139
|
async function run() {
|
|
152
|
-
const res = await morphoVault(compassApiSDK, {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
throw res.error;
|
|
140
|
+
const res = await morphoVault(compassApiSDK, {});
|
|
141
|
+
if (res.ok) {
|
|
142
|
+
const { value: result } = res;
|
|
143
|
+
console.log(result);
|
|
144
|
+
} else {
|
|
145
|
+
console.log("morphoVault failed:", res.error);
|
|
159
146
|
}
|
|
160
|
-
|
|
161
|
-
const { value: result } = res;
|
|
162
|
-
|
|
163
|
-
// Handle the result
|
|
164
|
-
console.log(result);
|
|
165
147
|
}
|
|
166
148
|
|
|
167
149
|
run();
|
|
@@ -202,13 +184,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
202
184
|
});
|
|
203
185
|
|
|
204
186
|
async function run() {
|
|
205
|
-
const result = await compassApiSDK.morpho.vaultPosition({
|
|
206
|
-
chain: "ethereum:mainnet",
|
|
207
|
-
userAddress: "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
208
|
-
vaultAddress: "0xbEef047a543E45807105E51A8BBEFCc5950fcfBa",
|
|
209
|
-
});
|
|
187
|
+
const result = await compassApiSDK.morpho.vaultPosition({});
|
|
210
188
|
|
|
211
|
-
// Handle the result
|
|
212
189
|
console.log(result);
|
|
213
190
|
}
|
|
214
191
|
|
|
@@ -230,20 +207,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
230
207
|
});
|
|
231
208
|
|
|
232
209
|
async function run() {
|
|
233
|
-
const res = await morphoVaultPosition(compassApiSDK, {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
if (!res.ok) {
|
|
240
|
-
throw res.error;
|
|
210
|
+
const res = await morphoVaultPosition(compassApiSDK, {});
|
|
211
|
+
if (res.ok) {
|
|
212
|
+
const { value: result } = res;
|
|
213
|
+
console.log(result);
|
|
214
|
+
} else {
|
|
215
|
+
console.log("morphoVaultPosition failed:", res.error);
|
|
241
216
|
}
|
|
242
|
-
|
|
243
|
-
const { value: result } = res;
|
|
244
|
-
|
|
245
|
-
// Handle the result
|
|
246
|
-
console.log(result);
|
|
247
217
|
}
|
|
248
218
|
|
|
249
219
|
run();
|
|
@@ -286,11 +256,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
286
256
|
});
|
|
287
257
|
|
|
288
258
|
async function run() {
|
|
289
|
-
const result = await compassApiSDK.morpho.markets({
|
|
290
|
-
chain: "ethereum:mainnet",
|
|
291
|
-
});
|
|
259
|
+
const result = await compassApiSDK.morpho.markets({});
|
|
292
260
|
|
|
293
|
-
// Handle the result
|
|
294
261
|
console.log(result);
|
|
295
262
|
}
|
|
296
263
|
|
|
@@ -312,18 +279,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
312
279
|
});
|
|
313
280
|
|
|
314
281
|
async function run() {
|
|
315
|
-
const res = await morphoMarkets(compassApiSDK, {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
282
|
+
const res = await morphoMarkets(compassApiSDK, {});
|
|
283
|
+
if (res.ok) {
|
|
284
|
+
const { value: result } = res;
|
|
285
|
+
console.log(result);
|
|
286
|
+
} else {
|
|
287
|
+
console.log("morphoMarkets failed:", res.error);
|
|
321
288
|
}
|
|
322
|
-
|
|
323
|
-
const { value: result } = res;
|
|
324
|
-
|
|
325
|
-
// Handle the result
|
|
326
|
-
console.log(result);
|
|
327
289
|
}
|
|
328
290
|
|
|
329
291
|
run();
|
|
@@ -372,12 +334,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
372
334
|
});
|
|
373
335
|
|
|
374
336
|
async function run() {
|
|
375
|
-
const result = await compassApiSDK.morpho.market({
|
|
376
|
-
chain: "ethereum:mainnet",
|
|
377
|
-
uniqueMarketKey: "0x83b7ad16905809ea36482f4fbf6cfee9c9f316d128de9a5da1952607d5e4df5e",
|
|
378
|
-
});
|
|
337
|
+
const result = await compassApiSDK.morpho.market({});
|
|
379
338
|
|
|
380
|
-
// Handle the result
|
|
381
339
|
console.log(result);
|
|
382
340
|
}
|
|
383
341
|
|
|
@@ -399,19 +357,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
399
357
|
});
|
|
400
358
|
|
|
401
359
|
async function run() {
|
|
402
|
-
const res = await morphoMarket(compassApiSDK, {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
throw res.error;
|
|
360
|
+
const res = await morphoMarket(compassApiSDK, {});
|
|
361
|
+
if (res.ok) {
|
|
362
|
+
const { value: result } = res;
|
|
363
|
+
console.log(result);
|
|
364
|
+
} else {
|
|
365
|
+
console.log("morphoMarket failed:", res.error);
|
|
409
366
|
}
|
|
410
|
-
|
|
411
|
-
const { value: result } = res;
|
|
412
|
-
|
|
413
|
-
// Handle the result
|
|
414
|
-
console.log(result);
|
|
415
367
|
}
|
|
416
368
|
|
|
417
369
|
run();
|
|
@@ -452,13 +404,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
452
404
|
});
|
|
453
405
|
|
|
454
406
|
async function run() {
|
|
455
|
-
const result = await compassApiSDK.morpho.marketPosition({
|
|
456
|
-
chain: "ethereum:mainnet",
|
|
457
|
-
userAddress: "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
458
|
-
uniqueMarketKey: "0xe7399fdebc318d76dfec7356caafcf8cd4b91287e139a3ec423f09aeeb656fc4",
|
|
459
|
-
});
|
|
407
|
+
const result = await compassApiSDK.morpho.marketPosition({});
|
|
460
408
|
|
|
461
|
-
// Handle the result
|
|
462
409
|
console.log(result);
|
|
463
410
|
}
|
|
464
411
|
|
|
@@ -480,20 +427,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
480
427
|
});
|
|
481
428
|
|
|
482
429
|
async function run() {
|
|
483
|
-
const res = await morphoMarketPosition(compassApiSDK, {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
if (!res.ok) {
|
|
490
|
-
throw res.error;
|
|
430
|
+
const res = await morphoMarketPosition(compassApiSDK, {});
|
|
431
|
+
if (res.ok) {
|
|
432
|
+
const { value: result } = res;
|
|
433
|
+
console.log(result);
|
|
434
|
+
} else {
|
|
435
|
+
console.log("morphoMarketPosition failed:", res.error);
|
|
491
436
|
}
|
|
492
|
-
|
|
493
|
-
const { value: result } = res;
|
|
494
|
-
|
|
495
|
-
// Handle the result
|
|
496
|
-
console.log(result);
|
|
497
437
|
}
|
|
498
438
|
|
|
499
439
|
run();
|
|
@@ -536,12 +476,8 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
536
476
|
});
|
|
537
477
|
|
|
538
478
|
async function run() {
|
|
539
|
-
const result = await compassApiSDK.morpho.userPosition({
|
|
540
|
-
chain: "ethereum:mainnet",
|
|
541
|
-
userAddress: "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
542
|
-
});
|
|
479
|
+
const result = await compassApiSDK.morpho.userPosition({});
|
|
543
480
|
|
|
544
|
-
// Handle the result
|
|
545
481
|
console.log(result);
|
|
546
482
|
}
|
|
547
483
|
|
|
@@ -563,19 +499,13 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
563
499
|
});
|
|
564
500
|
|
|
565
501
|
async function run() {
|
|
566
|
-
const res = await morphoUserPosition(compassApiSDK, {
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
throw res.error;
|
|
502
|
+
const res = await morphoUserPosition(compassApiSDK, {});
|
|
503
|
+
if (res.ok) {
|
|
504
|
+
const { value: result } = res;
|
|
505
|
+
console.log(result);
|
|
506
|
+
} else {
|
|
507
|
+
console.log("morphoUserPosition failed:", res.error);
|
|
573
508
|
}
|
|
574
|
-
|
|
575
|
-
const { value: result } = res;
|
|
576
|
-
|
|
577
|
-
// Handle the result
|
|
578
|
-
console.log(result);
|
|
579
509
|
}
|
|
580
510
|
|
|
581
511
|
run();
|
|
@@ -626,7 +556,6 @@ async function run() {
|
|
|
626
556
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
627
557
|
});
|
|
628
558
|
|
|
629
|
-
// Handle the result
|
|
630
559
|
console.log(result);
|
|
631
560
|
}
|
|
632
561
|
|
|
@@ -654,15 +583,12 @@ async function run() {
|
|
|
654
583
|
chain: "ethereum:mainnet",
|
|
655
584
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
656
585
|
});
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
586
|
+
if (res.ok) {
|
|
587
|
+
const { value: result } = res;
|
|
588
|
+
console.log(result);
|
|
589
|
+
} else {
|
|
590
|
+
console.log("morphoAllowance failed:", res.error);
|
|
660
591
|
}
|
|
661
|
-
|
|
662
|
-
const { value: result } = res;
|
|
663
|
-
|
|
664
|
-
// Handle the result
|
|
665
|
-
console.log(result);
|
|
666
592
|
}
|
|
667
593
|
|
|
668
594
|
run();
|
|
@@ -719,7 +645,6 @@ async function run() {
|
|
|
719
645
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
720
646
|
});
|
|
721
647
|
|
|
722
|
-
// Handle the result
|
|
723
648
|
console.log(result);
|
|
724
649
|
}
|
|
725
650
|
|
|
@@ -747,15 +672,12 @@ async function run() {
|
|
|
747
672
|
chain: "base:mainnet",
|
|
748
673
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
749
674
|
});
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
675
|
+
if (res.ok) {
|
|
676
|
+
const { value: result } = res;
|
|
677
|
+
console.log(result);
|
|
678
|
+
} else {
|
|
679
|
+
console.log("morphoDeposit failed:", res.error);
|
|
753
680
|
}
|
|
754
|
-
|
|
755
|
-
const { value: result } = res;
|
|
756
|
-
|
|
757
|
-
// Handle the result
|
|
758
|
-
console.log(result);
|
|
759
681
|
}
|
|
760
682
|
|
|
761
683
|
run();
|
|
@@ -812,7 +734,6 @@ async function run() {
|
|
|
812
734
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
813
735
|
});
|
|
814
736
|
|
|
815
|
-
// Handle the result
|
|
816
737
|
console.log(result);
|
|
817
738
|
}
|
|
818
739
|
|
|
@@ -840,15 +761,12 @@ async function run() {
|
|
|
840
761
|
chain: "ethereum:mainnet",
|
|
841
762
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
842
763
|
});
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
764
|
+
if (res.ok) {
|
|
765
|
+
const { value: result } = res;
|
|
766
|
+
console.log(result);
|
|
767
|
+
} else {
|
|
768
|
+
console.log("morphoWithdraw failed:", res.error);
|
|
846
769
|
}
|
|
847
|
-
|
|
848
|
-
const { value: result } = res;
|
|
849
|
-
|
|
850
|
-
// Handle the result
|
|
851
|
-
console.log(result);
|
|
852
770
|
}
|
|
853
771
|
|
|
854
772
|
run();
|
|
@@ -900,7 +818,6 @@ async function run() {
|
|
|
900
818
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
901
819
|
});
|
|
902
820
|
|
|
903
|
-
// Handle the result
|
|
904
821
|
console.log(result);
|
|
905
822
|
}
|
|
906
823
|
|
|
@@ -928,15 +845,12 @@ async function run() {
|
|
|
928
845
|
chain: "ethereum:mainnet",
|
|
929
846
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
930
847
|
});
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
848
|
+
if (res.ok) {
|
|
849
|
+
const { value: result } = res;
|
|
850
|
+
console.log(result);
|
|
851
|
+
} else {
|
|
852
|
+
console.log("morphoSupplyCollateral failed:", res.error);
|
|
934
853
|
}
|
|
935
|
-
|
|
936
|
-
const { value: result } = res;
|
|
937
|
-
|
|
938
|
-
// Handle the result
|
|
939
|
-
console.log(result);
|
|
940
854
|
}
|
|
941
855
|
|
|
942
856
|
run();
|
|
@@ -988,7 +902,6 @@ async function run() {
|
|
|
988
902
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
989
903
|
});
|
|
990
904
|
|
|
991
|
-
// Handle the result
|
|
992
905
|
console.log(result);
|
|
993
906
|
}
|
|
994
907
|
|
|
@@ -1016,15 +929,12 @@ async function run() {
|
|
|
1016
929
|
chain: "base:mainnet",
|
|
1017
930
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
1018
931
|
});
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
932
|
+
if (res.ok) {
|
|
933
|
+
const { value: result } = res;
|
|
934
|
+
console.log(result);
|
|
935
|
+
} else {
|
|
936
|
+
console.log("morphoWithdrawCollateral failed:", res.error);
|
|
1022
937
|
}
|
|
1023
|
-
|
|
1024
|
-
const { value: result } = res;
|
|
1025
|
-
|
|
1026
|
-
// Handle the result
|
|
1027
|
-
console.log(result);
|
|
1028
938
|
}
|
|
1029
939
|
|
|
1030
940
|
run();
|
|
@@ -1079,7 +989,6 @@ async function run() {
|
|
|
1079
989
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
1080
990
|
});
|
|
1081
991
|
|
|
1082
|
-
// Handle the result
|
|
1083
992
|
console.log(result);
|
|
1084
993
|
}
|
|
1085
994
|
|
|
@@ -1107,15 +1016,12 @@ async function run() {
|
|
|
1107
1016
|
chain: "base:mainnet",
|
|
1108
1017
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
1109
1018
|
});
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1019
|
+
if (res.ok) {
|
|
1020
|
+
const { value: result } = res;
|
|
1021
|
+
console.log(result);
|
|
1022
|
+
} else {
|
|
1023
|
+
console.log("morphoBorrow failed:", res.error);
|
|
1113
1024
|
}
|
|
1114
|
-
|
|
1115
|
-
const { value: result } = res;
|
|
1116
|
-
|
|
1117
|
-
// Handle the result
|
|
1118
|
-
console.log(result);
|
|
1119
1025
|
}
|
|
1120
1026
|
|
|
1121
1027
|
run();
|
|
@@ -1167,7 +1073,6 @@ async function run() {
|
|
|
1167
1073
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
1168
1074
|
});
|
|
1169
1075
|
|
|
1170
|
-
// Handle the result
|
|
1171
1076
|
console.log(result);
|
|
1172
1077
|
}
|
|
1173
1078
|
|
|
@@ -1195,15 +1100,12 @@ async function run() {
|
|
|
1195
1100
|
chain: "ethereum:mainnet",
|
|
1196
1101
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
1197
1102
|
});
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1103
|
+
if (res.ok) {
|
|
1104
|
+
const { value: result } = res;
|
|
1105
|
+
console.log(result);
|
|
1106
|
+
} else {
|
|
1107
|
+
console.log("morphoRepay failed:", res.error);
|
|
1201
1108
|
}
|
|
1202
|
-
|
|
1203
|
-
const { value: result } = res;
|
|
1204
|
-
|
|
1205
|
-
// Handle the result
|
|
1206
|
-
console.log(result);
|
|
1207
1109
|
}
|
|
1208
1110
|
|
|
1209
1111
|
run();
|