@compass-labs/api-sdk 0.5.76 → 1.0.0
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 +14 -0
- package/bin/mcp-server.js +22 -23
- package/bin/mcp-server.js.map +13 -13
- package/dist/commonjs/hooks/hooks.d.ts +3 -2
- package/dist/commonjs/hooks/hooks.d.ts.map +1 -1
- package/dist/commonjs/hooks/hooks.js.map +1 -1
- package/dist/commonjs/hooks/types.d.ts +2 -6
- package/dist/commonjs/hooks/types.d.ts.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/sdks.d.ts.map +1 -1
- package/dist/commonjs/lib/sdks.js +5 -6
- package/dist/commonjs/lib/sdks.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js.map +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.d.ts +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.d.ts.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.js +2 -2
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.js.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.d.ts +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.d.ts.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.js +2 -2
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.js.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.d.ts +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.d.ts.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.js +2 -2
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.js.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.d.ts +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.d.ts.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.js +2 -2
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.js.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.d.ts +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.d.ts.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.js +2 -2
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.js.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.d.ts +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.d.ts.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.js +2 -3
- package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.js.map +1 -1
- package/dist/esm/hooks/hooks.d.ts +3 -2
- package/dist/esm/hooks/hooks.d.ts.map +1 -1
- package/dist/esm/hooks/hooks.js.map +1 -1
- package/dist/esm/hooks/types.d.ts +2 -6
- package/dist/esm/hooks/types.d.ts.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/sdks.d.ts.map +1 -1
- package/dist/esm/lib/sdks.js +5 -6
- package/dist/esm/lib/sdks.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/mcp-server.js.map +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.d.ts +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.d.ts.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.js +2 -2
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.js.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.d.ts +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.d.ts.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.js +2 -2
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.js.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.d.ts +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.d.ts.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.js +2 -2
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.js.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.d.ts +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.d.ts.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.js +2 -2
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.js.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.d.ts +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.d.ts.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.js +2 -2
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.js.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.d.ts +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.d.ts.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.js +2 -3
- package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.js.map +1 -1
- package/docs/sdks/aavev3/README.md +6 -6
- package/docs/sdks/erc4626vaults/README.md +2 -2
- package/docs/sdks/morpho/README.md +4 -4
- package/docs/sdks/transactionbundler/README.md +4 -4
- package/docs/sdks/uniswapv3/README.md +10 -10
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/hooks/hooks.ts +2 -2
- package/src/hooks/types.ts +2 -7
- package/src/lib/config.ts +2 -2
- package/src/lib/sdks.ts +6 -7
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.ts +3 -3
- package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.ts +3 -3
- package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.ts +3 -3
- package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.ts +3 -3
- package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.ts +3 -3
- package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.ts +3 -6
|
@@ -908,7 +908,7 @@ async function run() {
|
|
|
908
908
|
token: "PT-eUSDE-29MAY2025",
|
|
909
909
|
amount: 150.5,
|
|
910
910
|
interestRateMode: "stable",
|
|
911
|
-
chain: "
|
|
911
|
+
chain: "base",
|
|
912
912
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
913
913
|
});
|
|
914
914
|
|
|
@@ -937,7 +937,7 @@ async function run() {
|
|
|
937
937
|
token: "PT-eUSDE-29MAY2025",
|
|
938
938
|
amount: 150.5,
|
|
939
939
|
interestRateMode: "stable",
|
|
940
|
-
chain: "
|
|
940
|
+
chain: "base",
|
|
941
941
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
942
942
|
});
|
|
943
943
|
if (res.ok) {
|
|
@@ -1005,7 +1005,7 @@ async function run() {
|
|
|
1005
1005
|
token: "DAI",
|
|
1006
1006
|
amount: 150.5,
|
|
1007
1007
|
interestRateMode: "stable",
|
|
1008
|
-
chain: "
|
|
1008
|
+
chain: "base",
|
|
1009
1009
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
1010
1010
|
});
|
|
1011
1011
|
|
|
@@ -1034,7 +1034,7 @@ async function run() {
|
|
|
1034
1034
|
token: "DAI",
|
|
1035
1035
|
amount: 150.5,
|
|
1036
1036
|
interestRateMode: "stable",
|
|
1037
|
-
chain: "
|
|
1037
|
+
chain: "base",
|
|
1038
1038
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
1039
1039
|
});
|
|
1040
1040
|
if (res.ok) {
|
|
@@ -1103,7 +1103,7 @@ async function run() {
|
|
|
1103
1103
|
token: "PT-USDe-31JUL2025",
|
|
1104
1104
|
amount: 1.5,
|
|
1105
1105
|
recipient: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
1106
|
-
chain: "
|
|
1106
|
+
chain: "arbitrum",
|
|
1107
1107
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
1108
1108
|
});
|
|
1109
1109
|
|
|
@@ -1132,7 +1132,7 @@ async function run() {
|
|
|
1132
1132
|
token: "PT-USDe-31JUL2025",
|
|
1133
1133
|
amount: 1.5,
|
|
1134
1134
|
recipient: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
1135
|
-
chain: "
|
|
1135
|
+
chain: "arbitrum",
|
|
1136
1136
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
1137
1137
|
});
|
|
1138
1138
|
if (res.ok) {
|
|
@@ -201,7 +201,7 @@ async function run() {
|
|
|
201
201
|
const result = await compassApiSDK.erc4626Vaults.vaultsWithdraw({
|
|
202
202
|
vaultAddress: "0xbEef047a543E45807105E51A8BBEFCc5950fcfBa",
|
|
203
203
|
amount: 1.5,
|
|
204
|
-
chain: "
|
|
204
|
+
chain: "ethereum",
|
|
205
205
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
206
206
|
});
|
|
207
207
|
|
|
@@ -229,7 +229,7 @@ async function run() {
|
|
|
229
229
|
const res = await erc4626VaultsVaultsWithdraw(compassApiSDK, {
|
|
230
230
|
vaultAddress: "0xbEef047a543E45807105E51A8BBEFCc5950fcfBa",
|
|
231
231
|
amount: 1.5,
|
|
232
|
-
chain: "
|
|
232
|
+
chain: "ethereum",
|
|
233
233
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
234
234
|
});
|
|
235
235
|
if (res.ok) {
|
|
@@ -594,7 +594,7 @@ async function run() {
|
|
|
594
594
|
const result = await compassApiSDK.morpho.morphoWithdraw({
|
|
595
595
|
vaultAddress: "0xbEef047a543E45807105E51A8BBEFCc5950fcfBa",
|
|
596
596
|
amount: "1.5",
|
|
597
|
-
chain: "
|
|
597
|
+
chain: "arbitrum",
|
|
598
598
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
599
599
|
});
|
|
600
600
|
|
|
@@ -622,7 +622,7 @@ async function run() {
|
|
|
622
622
|
const res = await morphoMorphoWithdraw(compassApiSDK, {
|
|
623
623
|
vaultAddress: "0xbEef047a543E45807105E51A8BBEFCc5950fcfBa",
|
|
624
624
|
amount: "1.5",
|
|
625
|
-
chain: "
|
|
625
|
+
chain: "arbitrum",
|
|
626
626
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
627
627
|
});
|
|
628
628
|
if (res.ok) {
|
|
@@ -969,7 +969,7 @@ async function run() {
|
|
|
969
969
|
const result = await compassApiSDK.morpho.morphoRepay({
|
|
970
970
|
amount: 1.5,
|
|
971
971
|
uniqueMarketKey: "0xe7399fdebc318d76dfec7356caafcf8cd4b91287e139a3ec423f09aeeb656fc4",
|
|
972
|
-
chain: "
|
|
972
|
+
chain: "base",
|
|
973
973
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
974
974
|
});
|
|
975
975
|
|
|
@@ -997,7 +997,7 @@ async function run() {
|
|
|
997
997
|
const res = await morphoMorphoRepay(compassApiSDK, {
|
|
998
998
|
amount: 1.5,
|
|
999
999
|
uniqueMarketKey: "0xe7399fdebc318d76dfec7356caafcf8cd4b91287e139a3ec423f09aeeb656fc4",
|
|
1000
|
-
chain: "
|
|
1000
|
+
chain: "base",
|
|
1001
1001
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
1002
1002
|
});
|
|
1003
1003
|
if (res.ok) {
|
|
@@ -244,8 +244,8 @@ async function run() {
|
|
|
244
244
|
s: "0x78f7982ede9dabc53d7153974c5692fda8a21fc73bdafc42aaf135505e22817c",
|
|
245
245
|
yParity: 0,
|
|
246
246
|
},
|
|
247
|
-
collateralToken: "
|
|
248
|
-
borrowToken: "
|
|
247
|
+
collateralToken: "SNX",
|
|
248
|
+
borrowToken: "cbETH",
|
|
249
249
|
initialCollateralAmount: "1000",
|
|
250
250
|
multiplier: "2.5",
|
|
251
251
|
maxSlippagePercent: 2.5,
|
|
@@ -285,8 +285,8 @@ async function run() {
|
|
|
285
285
|
s: "0x78f7982ede9dabc53d7153974c5692fda8a21fc73bdafc42aaf135505e22817c",
|
|
286
286
|
yParity: 0,
|
|
287
287
|
},
|
|
288
|
-
collateralToken: "
|
|
289
|
-
borrowToken: "
|
|
288
|
+
collateralToken: "SNX",
|
|
289
|
+
borrowToken: "cbETH",
|
|
290
290
|
initialCollateralAmount: "1000",
|
|
291
291
|
multiplier: "2.5",
|
|
292
292
|
maxSlippagePercent: 2.5,
|
|
@@ -432,7 +432,7 @@ async function run() {
|
|
|
432
432
|
fee: "1.0",
|
|
433
433
|
amountOut: 1.5,
|
|
434
434
|
maxSlippagePercent: 0.5,
|
|
435
|
-
chain: "
|
|
435
|
+
chain: "arbitrum",
|
|
436
436
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
437
437
|
});
|
|
438
438
|
|
|
@@ -463,7 +463,7 @@ async function run() {
|
|
|
463
463
|
fee: "1.0",
|
|
464
464
|
amountOut: 1.5,
|
|
465
465
|
maxSlippagePercent: 0.5,
|
|
466
|
-
chain: "
|
|
466
|
+
chain: "arbitrum",
|
|
467
467
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
468
468
|
});
|
|
469
469
|
if (res.ok) {
|
|
@@ -532,7 +532,7 @@ async function run() {
|
|
|
532
532
|
fee: "1.0",
|
|
533
533
|
amountIn: 1.5,
|
|
534
534
|
maxSlippagePercent: 0.5,
|
|
535
|
-
chain: "
|
|
535
|
+
chain: "base",
|
|
536
536
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
537
537
|
});
|
|
538
538
|
|
|
@@ -563,7 +563,7 @@ async function run() {
|
|
|
563
563
|
fee: "1.0",
|
|
564
564
|
amountIn: 1.5,
|
|
565
565
|
maxSlippagePercent: 0.5,
|
|
566
|
-
chain: "
|
|
566
|
+
chain: "base",
|
|
567
567
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
568
568
|
});
|
|
569
569
|
if (res.ok) {
|
|
@@ -639,7 +639,7 @@ async function run() {
|
|
|
639
639
|
amount0Min: "1.4",
|
|
640
640
|
amount1Min: "1.6",
|
|
641
641
|
recipient: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
642
|
-
chain: "
|
|
642
|
+
chain: "ethereum",
|
|
643
643
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
644
644
|
});
|
|
645
645
|
|
|
@@ -675,7 +675,7 @@ async function run() {
|
|
|
675
675
|
amount0Min: "1.4",
|
|
676
676
|
amount1Min: "1.6",
|
|
677
677
|
recipient: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
678
|
-
chain: "
|
|
678
|
+
chain: "ethereum",
|
|
679
679
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
680
680
|
});
|
|
681
681
|
if (res.ok) {
|
|
@@ -746,7 +746,7 @@ async function run() {
|
|
|
746
746
|
amount1Desired: "1.7",
|
|
747
747
|
amount0Min: "1.4",
|
|
748
748
|
amount1Min: "1.6",
|
|
749
|
-
chain: "
|
|
749
|
+
chain: "base",
|
|
750
750
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
751
751
|
});
|
|
752
752
|
|
|
@@ -777,7 +777,7 @@ async function run() {
|
|
|
777
777
|
amount1Desired: "1.7",
|
|
778
778
|
amount0Min: "1.4",
|
|
779
779
|
amount1Min: "1.6",
|
|
780
|
-
chain: "
|
|
780
|
+
chain: "base",
|
|
781
781
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
782
782
|
});
|
|
783
783
|
if (res.ok) {
|
|
@@ -846,7 +846,7 @@ async function run() {
|
|
|
846
846
|
const result = await compassApiSDK.uniswapV3.uniswapLiquidityProvisionWithdraw({
|
|
847
847
|
tokenId: 821299,
|
|
848
848
|
percentageForWithdrawal: "25",
|
|
849
|
-
chain: "
|
|
849
|
+
chain: "base",
|
|
850
850
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
851
851
|
});
|
|
852
852
|
|
|
@@ -874,7 +874,7 @@ async function run() {
|
|
|
874
874
|
const res = await uniswapV3UniswapLiquidityProvisionWithdraw(compassApiSDK, {
|
|
875
875
|
tokenId: 821299,
|
|
876
876
|
percentageForWithdrawal: "25",
|
|
877
|
-
chain: "
|
|
877
|
+
chain: "base",
|
|
878
878
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
879
879
|
});
|
|
880
880
|
if (res.ok) {
|
package/jsr.json
CHANGED
package/package.json
CHANGED
package/src/hooks/hooks.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { SDKOptions } from "../lib/config.js";
|
|
5
6
|
import { RequestInput } from "../lib/http.js";
|
|
6
7
|
import {
|
|
7
8
|
AfterErrorContext,
|
|
@@ -15,7 +16,6 @@ import {
|
|
|
15
16
|
Hook,
|
|
16
17
|
Hooks,
|
|
17
18
|
SDKInitHook,
|
|
18
|
-
SDKInitOptions,
|
|
19
19
|
} from "./types.js";
|
|
20
20
|
|
|
21
21
|
export class SDKHooks implements Hooks {
|
|
@@ -67,7 +67,7 @@ export class SDKHooks implements Hooks {
|
|
|
67
67
|
this.afterErrorHooks.push(hook);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
sdkInit(opts:
|
|
70
|
+
sdkInit(opts: SDKOptions): SDKOptions {
|
|
71
71
|
return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts);
|
|
72
72
|
}
|
|
73
73
|
|
package/src/hooks/types.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { SDKOptions } from "../lib/config.js";
|
|
6
|
-
import {
|
|
6
|
+
import { RequestInput } from "../lib/http.js";
|
|
7
7
|
import { RetryConfig } from "../lib/retries.js";
|
|
8
8
|
import { SecurityState } from "../lib/security.js";
|
|
9
9
|
|
|
@@ -19,11 +19,6 @@ export type HookContext = {
|
|
|
19
19
|
|
|
20
20
|
export type Awaitable<T> = T | Promise<T>;
|
|
21
21
|
|
|
22
|
-
export type SDKInitOptions = {
|
|
23
|
-
baseURL: URL | null;
|
|
24
|
-
client: HTTPClient;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
22
|
export type BeforeCreateRequestContext = HookContext & {};
|
|
28
23
|
export type BeforeRequestContext = HookContext & {};
|
|
29
24
|
export type AfterSuccessContext = HookContext & {};
|
|
@@ -34,7 +29,7 @@ export type AfterErrorContext = HookContext & {};
|
|
|
34
29
|
* hook can return a new baseURL and HTTP client to be used by the SDK.
|
|
35
30
|
*/
|
|
36
31
|
export interface SDKInitHook {
|
|
37
|
-
sdkInit: (opts:
|
|
32
|
+
sdkInit: (opts: SDKOptions) => SDKOptions;
|
|
38
33
|
}
|
|
39
34
|
|
|
40
35
|
export interface BeforeCreateRequestHook {
|
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.
|
|
64
|
+
sdkVersion: "1.0.0",
|
|
65
65
|
genVersion: "2.672.0",
|
|
66
66
|
userAgent:
|
|
67
|
-
"speakeasy-sdk/typescript 0.
|
|
67
|
+
"speakeasy-sdk/typescript 1.0.0 2.672.0 0.0.1 @compass-labs/api-sdk",
|
|
68
68
|
} as const;
|
package/src/lib/sdks.ts
CHANGED
|
@@ -96,17 +96,16 @@ export class ClientSDK {
|
|
|
96
96
|
} else {
|
|
97
97
|
this.#hooks = new SDKHooks();
|
|
98
98
|
}
|
|
99
|
+
const defaultHttpClient = new HTTPClient();
|
|
100
|
+
options.httpClient = options.httpClient || defaultHttpClient;
|
|
101
|
+
options = this.#hooks.sdkInit(options);
|
|
102
|
+
|
|
99
103
|
const url = serverURLFromOptions(options);
|
|
100
104
|
if (url) {
|
|
101
105
|
url.pathname = url.pathname.replace(/\/+$/, "") + "/";
|
|
102
106
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
baseURL: url,
|
|
106
|
-
client: options.httpClient || new HTTPClient(),
|
|
107
|
-
});
|
|
108
|
-
this._baseURL = baseURL;
|
|
109
|
-
this.#httpClient = client;
|
|
107
|
+
this._baseURL = url;
|
|
108
|
+
this.#httpClient = options.httpClient || defaultHttpClient;
|
|
110
109
|
|
|
111
110
|
this._options = { ...options, hooks: this.#hooks };
|
|
112
111
|
|
package/src/mcp-server/server.ts
CHANGED
package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.ts
CHANGED
|
@@ -56,7 +56,7 @@ export type CompassApiBackendModelsAaveReadResponseHistoricalTransactionsBorrow
|
|
|
56
56
|
/**
|
|
57
57
|
* The type of transaction
|
|
58
58
|
*/
|
|
59
|
-
action
|
|
59
|
+
action: "Borrow";
|
|
60
60
|
block: number;
|
|
61
61
|
};
|
|
62
62
|
|
|
@@ -95,7 +95,7 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsBorrow
|
|
|
95
95
|
borrowRateMode: Borrowratemode$inboundSchema,
|
|
96
96
|
reserve: Reserve$inboundSchema,
|
|
97
97
|
assetPriceUSD: z.number(),
|
|
98
|
-
action: z.literal("Borrow")
|
|
98
|
+
action: z.literal("Borrow"),
|
|
99
99
|
block: z.number().int(),
|
|
100
100
|
});
|
|
101
101
|
|
|
@@ -127,7 +127,7 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsBorrow
|
|
|
127
127
|
borrowRateMode: Borrowratemode$outboundSchema,
|
|
128
128
|
reserve: Reserve$outboundSchema,
|
|
129
129
|
assetPriceUSD: z.number(),
|
|
130
|
-
action: z.literal("Borrow")
|
|
130
|
+
action: z.literal("Borrow"),
|
|
131
131
|
block: z.number().int(),
|
|
132
132
|
});
|
|
133
133
|
|
|
@@ -33,7 +33,7 @@ export type CompassApiBackendModelsAaveReadResponseHistoricalTransactionsLiquida
|
|
|
33
33
|
principalReserve: Reserve;
|
|
34
34
|
collateralAssetPriceUSD: number;
|
|
35
35
|
borrowAssetPriceUSD: number;
|
|
36
|
-
action
|
|
36
|
+
action: "LiquidationCall";
|
|
37
37
|
block: number;
|
|
38
38
|
};
|
|
39
39
|
|
|
@@ -53,7 +53,7 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsLiquid
|
|
|
53
53
|
principalReserve: Reserve$inboundSchema,
|
|
54
54
|
collateralAssetPriceUSD: z.number(),
|
|
55
55
|
borrowAssetPriceUSD: z.number(),
|
|
56
|
-
action: z.literal("LiquidationCall")
|
|
56
|
+
action: z.literal("LiquidationCall"),
|
|
57
57
|
block: z.number().int(),
|
|
58
58
|
});
|
|
59
59
|
|
|
@@ -89,7 +89,7 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsLiquid
|
|
|
89
89
|
principalReserve: Reserve$outboundSchema,
|
|
90
90
|
collateralAssetPriceUSD: z.number(),
|
|
91
91
|
borrowAssetPriceUSD: z.number(),
|
|
92
|
-
action: z.literal("LiquidationCall")
|
|
92
|
+
action: z.literal("LiquidationCall"),
|
|
93
93
|
block: z.number().int(),
|
|
94
94
|
});
|
|
95
95
|
|
package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type CompassApiBackendModelsAaveReadResponseHistoricalTransactionsRepay =
|
|
|
36
36
|
/**
|
|
37
37
|
* The type of transaction
|
|
38
38
|
*/
|
|
39
|
-
action
|
|
39
|
+
action: "Repay";
|
|
40
40
|
block: number;
|
|
41
41
|
};
|
|
42
42
|
|
|
@@ -53,7 +53,7 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsRepay$
|
|
|
53
53
|
amount: z.number(),
|
|
54
54
|
reserve: Reserve$inboundSchema,
|
|
55
55
|
assetPriceUSD: z.number(),
|
|
56
|
-
action: z.literal("Repay")
|
|
56
|
+
action: z.literal("Repay"),
|
|
57
57
|
block: z.number().int(),
|
|
58
58
|
});
|
|
59
59
|
|
|
@@ -83,7 +83,7 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsRepay$
|
|
|
83
83
|
amount: z.number(),
|
|
84
84
|
reserve: Reserve$outboundSchema,
|
|
85
85
|
assetPriceUSD: z.number(),
|
|
86
|
-
action: z.literal("Repay")
|
|
86
|
+
action: z.literal("Repay"),
|
|
87
87
|
block: z.number().int(),
|
|
88
88
|
});
|
|
89
89
|
|
package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type CompassApiBackendModelsAaveReadResponseHistoricalTransactionsSupply
|
|
|
39
39
|
/**
|
|
40
40
|
* The type of transaction
|
|
41
41
|
*/
|
|
42
|
-
action
|
|
42
|
+
action: "Supply";
|
|
43
43
|
block: number;
|
|
44
44
|
};
|
|
45
45
|
|
|
@@ -56,7 +56,7 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsSupply
|
|
|
56
56
|
amount: z.number(),
|
|
57
57
|
reserve: Reserve$inboundSchema,
|
|
58
58
|
assetPriceUSD: z.number(),
|
|
59
|
-
action: z.literal("Supply")
|
|
59
|
+
action: z.literal("Supply"),
|
|
60
60
|
block: z.number().int(),
|
|
61
61
|
});
|
|
62
62
|
|
|
@@ -86,7 +86,7 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsSupply
|
|
|
86
86
|
amount: z.number(),
|
|
87
87
|
reserve: Reserve$outboundSchema,
|
|
88
88
|
assetPriceUSD: z.number(),
|
|
89
|
-
action: z.literal("Supply")
|
|
89
|
+
action: z.literal("Supply"),
|
|
90
90
|
block: z.number().int(),
|
|
91
91
|
});
|
|
92
92
|
|
|
@@ -32,7 +32,7 @@ export type CompassApiBackendModelsAaveReadResponseHistoricalTransactionsSwapBor
|
|
|
32
32
|
variableBorrowRate: number;
|
|
33
33
|
stableBorrowRate: number;
|
|
34
34
|
reserve: Reserve;
|
|
35
|
-
action
|
|
35
|
+
action: "SwapBorrowRate";
|
|
36
36
|
block: number;
|
|
37
37
|
};
|
|
38
38
|
|
|
@@ -51,7 +51,7 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsSwapBo
|
|
|
51
51
|
variableBorrowRate: z.number().int(),
|
|
52
52
|
stableBorrowRate: z.number().int(),
|
|
53
53
|
reserve: Reserve$inboundSchema,
|
|
54
|
-
action: z.literal("SwapBorrowRate")
|
|
54
|
+
action: z.literal("SwapBorrowRate"),
|
|
55
55
|
block: z.number().int(),
|
|
56
56
|
});
|
|
57
57
|
|
|
@@ -85,7 +85,7 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsSwapBo
|
|
|
85
85
|
variableBorrowRate: z.number().int(),
|
|
86
86
|
stableBorrowRate: z.number().int(),
|
|
87
87
|
reserve: Reserve$outboundSchema,
|
|
88
|
-
action: z.literal("SwapBorrowRate")
|
|
88
|
+
action: z.literal("SwapBorrowRate"),
|
|
89
89
|
block: z.number().int(),
|
|
90
90
|
});
|
|
91
91
|
|
|
@@ -33,7 +33,7 @@ export type CompassApiBackendModelsAaveReadResponseHistoricalTransactionsUsageAs
|
|
|
33
33
|
/**
|
|
34
34
|
* The type of transaction
|
|
35
35
|
*/
|
|
36
|
-
action
|
|
36
|
+
action: "UsageAsCollateral";
|
|
37
37
|
block: number;
|
|
38
38
|
};
|
|
39
39
|
|
|
@@ -50,8 +50,7 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsUsageA
|
|
|
50
50
|
fromState: z.boolean(),
|
|
51
51
|
toState: z.boolean(),
|
|
52
52
|
reserve: Reserve$inboundSchema,
|
|
53
|
-
action: z.literal("UsageAsCollateral")
|
|
54
|
-
.optional(),
|
|
53
|
+
action: z.literal("UsageAsCollateral"),
|
|
55
54
|
block: z.number().int(),
|
|
56
55
|
});
|
|
57
56
|
|
|
@@ -81,9 +80,7 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsUsageA
|
|
|
81
80
|
fromState: z.boolean(),
|
|
82
81
|
toState: z.boolean(),
|
|
83
82
|
reserve: Reserve$outboundSchema,
|
|
84
|
-
action: z.literal("UsageAsCollateral")
|
|
85
|
-
"UsageAsCollateral" as const,
|
|
86
|
-
),
|
|
83
|
+
action: z.literal("UsageAsCollateral"),
|
|
87
84
|
block: z.number().int(),
|
|
88
85
|
});
|
|
89
86
|
|