@compass-labs/api-sdk 0.0.20 → 0.0.21
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 +2 -2
- package/README.md +9 -7
- package/bin/mcp-server.js +637 -380
- package/bin/mcp-server.js.map +16 -12
- package/dist/commonjs/funcs/aaveV3Rate.d.ts +31 -0
- package/dist/commonjs/funcs/aaveV3Rate.d.ts.map +1 -0
- package/dist/commonjs/funcs/aaveV3Rate.js +134 -0
- package/dist/commonjs/funcs/aaveV3Rate.js.map +1 -0
- package/dist/commonjs/funcs/skyBuy.d.ts +6 -2
- package/dist/commonjs/funcs/skyBuy.d.ts.map +1 -1
- package/dist/commonjs/funcs/skyBuy.js +6 -2
- package/dist/commonjs/funcs/skyBuy.js.map +1 -1
- package/dist/commonjs/funcs/skySell.d.ts +6 -2
- package/dist/commonjs/funcs/skySell.d.ts.map +1 -1
- package/dist/commonjs/funcs/skySell.js +6 -2
- package/dist/commonjs/funcs/skySell.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/aaveV3Rate.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/aaveV3Rate.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/aaveV3Rate.js +77 -0
- package/dist/commonjs/mcp-server/tools/aaveV3Rate.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/skyBuy.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools/skyBuy.js +6 -2
- package/dist/commonjs/mcp-server/tools/skyBuy.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/skySell.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools/skySell.js +6 -2
- package/dist/commonjs/mcp-server/tools/skySell.js.map +1 -1
- package/dist/commonjs/models/components/aaverateresponse.d.ts +57 -0
- package/dist/commonjs/models/components/aaverateresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/aaverateresponse.js +98 -0
- package/dist/commonjs/models/components/aaverateresponse.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +1 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/operations/aaverate.d.ts +244 -0
- package/dist/commonjs/models/operations/aaverate.d.ts.map +1 -0
- package/dist/commonjs/models/operations/aaverate.js +163 -0
- package/dist/commonjs/models/operations/aaverate.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/sdk/aavev3.d.ts +20 -0
- package/dist/commonjs/sdk/aavev3.d.ts.map +1 -1
- package/dist/commonjs/sdk/aavev3.js +23 -0
- package/dist/commonjs/sdk/aavev3.js.map +1 -1
- package/dist/commonjs/sdk/sky.d.ts +12 -4
- package/dist/commonjs/sdk/sky.d.ts.map +1 -1
- package/dist/commonjs/sdk/sky.js +12 -4
- package/dist/commonjs/sdk/sky.js.map +1 -1
- package/dist/esm/funcs/aaveV3Rate.d.ts +31 -0
- package/dist/esm/funcs/aaveV3Rate.d.ts.map +1 -0
- package/dist/esm/funcs/aaveV3Rate.js +98 -0
- package/dist/esm/funcs/aaveV3Rate.js.map +1 -0
- package/dist/esm/funcs/skyBuy.d.ts +6 -2
- package/dist/esm/funcs/skyBuy.d.ts.map +1 -1
- package/dist/esm/funcs/skyBuy.js +6 -2
- package/dist/esm/funcs/skyBuy.js.map +1 -1
- package/dist/esm/funcs/skySell.d.ts +6 -2
- package/dist/esm/funcs/skySell.d.ts.map +1 -1
- package/dist/esm/funcs/skySell.js +6 -2
- package/dist/esm/funcs/skySell.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/aaveV3Rate.d.ts +8 -0
- package/dist/esm/mcp-server/tools/aaveV3Rate.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/aaveV3Rate.js +41 -0
- package/dist/esm/mcp-server/tools/aaveV3Rate.js.map +1 -0
- package/dist/esm/mcp-server/tools/skyBuy.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools/skyBuy.js +6 -2
- package/dist/esm/mcp-server/tools/skyBuy.js.map +1 -1
- package/dist/esm/mcp-server/tools/skySell.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools/skySell.js +6 -2
- package/dist/esm/mcp-server/tools/skySell.js.map +1 -1
- package/dist/esm/models/components/aaverateresponse.d.ts +57 -0
- package/dist/esm/models/components/aaverateresponse.d.ts.map +1 -0
- package/dist/esm/models/components/aaverateresponse.js +60 -0
- package/dist/esm/models/components/aaverateresponse.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +1 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/operations/aaverate.d.ts +244 -0
- package/dist/esm/models/operations/aaverate.d.ts.map +1 -0
- package/dist/esm/models/operations/aaverate.js +125 -0
- package/dist/esm/models/operations/aaverate.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/sdk/aavev3.d.ts +20 -0
- package/dist/esm/sdk/aavev3.d.ts.map +1 -1
- package/dist/esm/sdk/aavev3.js +23 -0
- package/dist/esm/sdk/aavev3.js.map +1 -1
- package/dist/esm/sdk/sky.d.ts +12 -4
- package/dist/esm/sdk/sky.d.ts.map +1 -1
- package/dist/esm/sdk/sky.js +12 -4
- package/dist/esm/sdk/sky.js.map +1 -1
- package/docs/sdks/aavev3/README.md +93 -0
- package/docs/sdks/sky/README.md +12 -4
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/aaveV3Rate.ts +182 -0
- package/src/funcs/skyBuy.ts +6 -2
- package/src/funcs/skySell.ts +6 -2
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/aaveV3Rate.ts +50 -0
- package/src/mcp-server/tools/skyBuy.ts +6 -2
- package/src/mcp-server/tools/skySell.ts +6 -2
- package/src/models/components/aaverateresponse.ts +123 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/operations/aaverate.ts +199 -0
- package/src/models/operations/index.ts +1 -0
- package/src/sdk/aavev3.ts +31 -0
- package/src/sdk/sky.ts +12 -4
package/dist/esm/sdk/aavev3.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { aaveV3Borrow } from "../funcs/aaveV3Borrow.js";
|
|
5
5
|
import { aaveV3HistoricalTransactions } from "../funcs/aaveV3HistoricalTransactions.js";
|
|
6
6
|
import { aaveV3LiquidityChange } from "../funcs/aaveV3LiquidityChange.js";
|
|
7
|
+
import { aaveV3Rate } from "../funcs/aaveV3Rate.js";
|
|
7
8
|
import { aaveV3Repay } from "../funcs/aaveV3Repay.js";
|
|
8
9
|
import { aaveV3Supply } from "../funcs/aaveV3Supply.js";
|
|
9
10
|
import { aaveV3TokenPrice } from "../funcs/aaveV3TokenPrice.js";
|
|
@@ -13,6 +14,28 @@ import { aaveV3Withdraw } from "../funcs/aaveV3Withdraw.js";
|
|
|
13
14
|
import { ClientSDK } from "../lib/sdks.js";
|
|
14
15
|
import { unwrapAsync } from "../types/fp.js";
|
|
15
16
|
export class AaveV3 extends ClientSDK {
|
|
17
|
+
/**
|
|
18
|
+
* Interest rates
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Returns the latest APY and APR rates for a specified token on Aave, for both
|
|
22
|
+
* deposits and loans.
|
|
23
|
+
*
|
|
24
|
+
* **Annual percentage yield (APY)** is the yearly return/cost after continuous
|
|
25
|
+
* compounding of the per-second rate stored on-chain. This value is the same value as
|
|
26
|
+
* seen the on [app.aave.com](
|
|
27
|
+
* https://app.aave.com/)
|
|
28
|
+
* but more up-to-date as it is taken directly from the
|
|
29
|
+
* blockchain every time this endpoint is called.
|
|
30
|
+
*
|
|
31
|
+
* **Annual percentage rate (APR)** is the yearly simple interest rate (no
|
|
32
|
+
* compounding).
|
|
33
|
+
*
|
|
34
|
+
* For APY/APR on loans Aave offers both stable and fixed rates on certain tokens.
|
|
35
|
+
*/
|
|
36
|
+
async rate(request, options) {
|
|
37
|
+
return unwrapAsync(aaveV3Rate(this, request, options));
|
|
38
|
+
}
|
|
16
39
|
/**
|
|
17
40
|
* Token prices
|
|
18
41
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aavev3.js","sourceRoot":"","sources":["../../../src/sdk/aavev3.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAA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AAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,MAAM,CACV,OAAqC,EACrC,OAAwB;QAExB,OAAO,WAAW,CAAC,YAAY,CAC7B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,KAAK,CACT,OAAoC,EACpC,OAAwB;QAExB,OAAO,WAAW,CAAC,WAAW,CAC5B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,QAAQ,CACZ,OAAuC,EACvC,OAAwB;QAExB,OAAO,WAAW,CAAC,cAAc,CAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/esm/sdk/sky.d.ts
CHANGED
|
@@ -13,18 +13,26 @@ export declare class Sky extends ClientSDK {
|
|
|
13
13
|
* Buy USDS
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Buy USDS with DAI or USDC on a 1:1 basis.
|
|
16
|
+
* Buy USDS with DAI or USDC on a 1:1 basis. There are no fees.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* If buying with DAI, user will need to set an allowance on the DAI contract for the
|
|
19
|
+
* 'SkyDaiUsdsConverter' contract beforehand.
|
|
20
|
+
*
|
|
21
|
+
* If buying with USDC, user will need to set an allowance on the USDC contract for the
|
|
22
|
+
* 'SkyDaiUsdsConverter' contract beforehand.
|
|
19
23
|
*/
|
|
20
24
|
buy(request: components.SkyBuyRequest, options?: RequestOptions): Promise<components.UnsignedTransaction>;
|
|
21
25
|
/**
|
|
22
26
|
* Sell USDS
|
|
23
27
|
*
|
|
24
28
|
* @remarks
|
|
25
|
-
* Sell USDS for DAI or USDC on a 1:1 basis.
|
|
29
|
+
* Sell USDS for DAI or USDC on a 1:1 basis. There are no fees.
|
|
26
30
|
*
|
|
27
|
-
*
|
|
31
|
+
* If swapping to DAI, user will need to set an allowance on the USDS contract for the
|
|
32
|
+
* 'SkyDaiUsdsConverter' contract beforehand.
|
|
33
|
+
*
|
|
34
|
+
* If swapping to USDC, user will need to set an allowance on the USDS contract for the
|
|
35
|
+
* 'SkyUsdcUsdsConverter' contract beforehand.
|
|
28
36
|
*/
|
|
29
37
|
sell(request: components.SkySellRequest, options?: RequestOptions): Promise<components.UnsignedTransaction>;
|
|
30
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sky.d.ts","sourceRoot":"","sources":["../../../src/sdk/sky.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,GAAI,SAAQ,SAAS;IAChC;;;;;OAKG;IACG,QAAQ,CACZ,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,wBAAwB,CAAC;IAQ/C
|
|
1
|
+
{"version":3,"file":"sky.d.ts","sourceRoot":"","sources":["../../../src/sdk/sky.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,GAAI,SAAQ,SAAS;IAChC;;;;;OAKG;IACG,QAAQ,CACZ,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,wBAAwB,CAAC;IAQ/C;;;;;;;;;;;OAWG;IACG,GAAG,CACP,OAAO,EAAE,UAAU,CAAC,aAAa,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC;IAQ1C;;;;;;;;;;;OAWG;IACG,IAAI,CACR,OAAO,EAAE,UAAU,CAAC,cAAc,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC;IAQ1C;;;;;;;OAOG;IACG,OAAO,CACX,OAAO,EAAE,UAAU,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC;IAQ1C;;;;;;;OAOG;IACG,QAAQ,CACZ,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC;CAO3C"}
|
package/dist/esm/sdk/sky.js
CHANGED
|
@@ -22,9 +22,13 @@ export class Sky extends ClientSDK {
|
|
|
22
22
|
* Buy USDS
|
|
23
23
|
*
|
|
24
24
|
* @remarks
|
|
25
|
-
* Buy USDS with DAI or USDC on a 1:1 basis.
|
|
25
|
+
* Buy USDS with DAI or USDC on a 1:1 basis. There are no fees.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
27
|
+
* If buying with DAI, user will need to set an allowance on the DAI contract for the
|
|
28
|
+
* 'SkyDaiUsdsConverter' contract beforehand.
|
|
29
|
+
*
|
|
30
|
+
* If buying with USDC, user will need to set an allowance on the USDC contract for the
|
|
31
|
+
* 'SkyDaiUsdsConverter' contract beforehand.
|
|
28
32
|
*/
|
|
29
33
|
async buy(request, options) {
|
|
30
34
|
return unwrapAsync(skyBuy(this, request, options));
|
|
@@ -33,9 +37,13 @@ export class Sky extends ClientSDK {
|
|
|
33
37
|
* Sell USDS
|
|
34
38
|
*
|
|
35
39
|
* @remarks
|
|
36
|
-
* Sell USDS for DAI or USDC on a 1:1 basis.
|
|
40
|
+
* Sell USDS for DAI or USDC on a 1:1 basis. There are no fees.
|
|
37
41
|
*
|
|
38
|
-
*
|
|
42
|
+
* If swapping to DAI, user will need to set an allowance on the USDS contract for the
|
|
43
|
+
* 'SkyDaiUsdsConverter' contract beforehand.
|
|
44
|
+
*
|
|
45
|
+
* If swapping to USDC, user will need to set an allowance on the USDS contract for the
|
|
46
|
+
* 'SkyUsdcUsdsConverter' contract beforehand.
|
|
39
47
|
*/
|
|
40
48
|
async sell(request, options) {
|
|
41
49
|
return unwrapAsync(skySell(this, request, options));
|
package/dist/esm/sdk/sky.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sky.js","sourceRoot":"","sources":["../../../src/sdk/sky.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,GAAI,SAAQ,SAAS;IAChC;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CACZ,OAAsC,EACtC,OAAwB;QAExB,OAAO,WAAW,CAAC,WAAW,CAC5B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"sky.js","sourceRoot":"","sources":["../../../src/sdk/sky.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,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liquidityChange](#liquiditychange) - Liquidity index
|
|
10
11
|
* [userPositionSummary](#userpositionsummary) - Positions - total
|
|
@@ -15,6 +16,98 @@
|
|
|
15
16
|
* [repay](#repay) - Repay loans
|
|
16
17
|
* [withdraw](#withdraw) - Unstake
|
|
17
18
|
|
|
19
|
+
## rate
|
|
20
|
+
|
|
21
|
+
Returns the latest APY and APR rates for a specified token on Aave, for both
|
|
22
|
+
deposits and loans.
|
|
23
|
+
|
|
24
|
+
**Annual percentage yield (APY)** is the yearly return/cost after continuous
|
|
25
|
+
compounding of the per-second rate stored on-chain. This value is the same value as
|
|
26
|
+
seen the on [app.aave.com](
|
|
27
|
+
https://app.aave.com/)
|
|
28
|
+
but more up-to-date as it is taken directly from the
|
|
29
|
+
blockchain every time this endpoint is called.
|
|
30
|
+
|
|
31
|
+
**Annual percentage rate (APR)** is the yearly simple interest rate (no
|
|
32
|
+
compounding).
|
|
33
|
+
|
|
34
|
+
For APY/APR on loans Aave offers both stable and fixed rates on certain tokens.
|
|
35
|
+
|
|
36
|
+
### Example Usage
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
40
|
+
|
|
41
|
+
const compassApiSDK = new CompassApiSDK({
|
|
42
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
async function run() {
|
|
46
|
+
const result = await compassApiSDK.aaveV3.rate({
|
|
47
|
+
chain: "arbitrum:mainnet",
|
|
48
|
+
token: "USDC",
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Handle the result
|
|
52
|
+
console.log(result);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
run();
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Standalone function
|
|
59
|
+
|
|
60
|
+
The standalone function version of this method:
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
64
|
+
import { aaveV3Rate } from "@compass-labs/api-sdk/funcs/aaveV3Rate.js";
|
|
65
|
+
|
|
66
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
67
|
+
// You can create one instance of it to use across an application.
|
|
68
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
69
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
async function run() {
|
|
73
|
+
const res = await aaveV3Rate(compassApiSDK, {
|
|
74
|
+
chain: "arbitrum:mainnet",
|
|
75
|
+
token: "USDC",
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
if (!res.ok) {
|
|
79
|
+
throw res.error;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const { value: result } = res;
|
|
83
|
+
|
|
84
|
+
// Handle the result
|
|
85
|
+
console.log(result);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
run();
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Parameters
|
|
92
|
+
|
|
93
|
+
| Parameter | Type | Required | Description |
|
|
94
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
95
|
+
| `request` | [operations.AaveRateRequest](../../models/operations/aaveraterequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
96
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
97
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
98
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
99
|
+
|
|
100
|
+
### Response
|
|
101
|
+
|
|
102
|
+
**Promise\<[components.AaveRateResponse](../../models/components/aaverateresponse.md)\>**
|
|
103
|
+
|
|
104
|
+
### Errors
|
|
105
|
+
|
|
106
|
+
| Error Type | Status Code | Content Type |
|
|
107
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
108
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
109
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
110
|
+
|
|
18
111
|
## tokenPrice
|
|
19
112
|
|
|
20
113
|
This endpoint retrieves the current price of a specified token in USD as
|
package/docs/sdks/sky/README.md
CHANGED
|
@@ -90,9 +90,13 @@ run();
|
|
|
90
90
|
|
|
91
91
|
## buy
|
|
92
92
|
|
|
93
|
-
Buy USDS with DAI or USDC on a 1:1 basis.
|
|
93
|
+
Buy USDS with DAI or USDC on a 1:1 basis. There are no fees.
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
If buying with DAI, user will need to set an allowance on the DAI contract for the
|
|
96
|
+
'SkyDaiUsdsConverter' contract beforehand.
|
|
97
|
+
|
|
98
|
+
If buying with USDC, user will need to set an allowance on the USDC contract for the
|
|
99
|
+
'SkyDaiUsdsConverter' contract beforehand.
|
|
96
100
|
|
|
97
101
|
### Example Usage
|
|
98
102
|
|
|
@@ -173,9 +177,13 @@ run();
|
|
|
173
177
|
|
|
174
178
|
## sell
|
|
175
179
|
|
|
176
|
-
Sell USDS for DAI or USDC on a 1:1 basis.
|
|
180
|
+
Sell USDS for DAI or USDC on a 1:1 basis. There are no fees.
|
|
177
181
|
|
|
178
|
-
|
|
182
|
+
If swapping to DAI, user will need to set an allowance on the USDS contract for the
|
|
183
|
+
'SkyDaiUsdsConverter' contract beforehand.
|
|
184
|
+
|
|
185
|
+
If swapping to USDC, user will need to set an allowance on the USDS contract for the
|
|
186
|
+
'SkyUsdcUsdsConverter' contract beforehand.
|
|
179
187
|
|
|
180
188
|
### Example Usage
|
|
181
189
|
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CompassApiSDKCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Interest rates
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Returns the latest APY and APR rates for a specified token on Aave, for both
|
|
33
|
+
* deposits and loans.
|
|
34
|
+
*
|
|
35
|
+
* **Annual percentage yield (APY)** is the yearly return/cost after continuous
|
|
36
|
+
* compounding of the per-second rate stored on-chain. This value is the same value as
|
|
37
|
+
* seen the on [app.aave.com](
|
|
38
|
+
* https://app.aave.com/)
|
|
39
|
+
* but more up-to-date as it is taken directly from the
|
|
40
|
+
* blockchain every time this endpoint is called.
|
|
41
|
+
*
|
|
42
|
+
* **Annual percentage rate (APR)** is the yearly simple interest rate (no
|
|
43
|
+
* compounding).
|
|
44
|
+
*
|
|
45
|
+
* For APY/APR on loans Aave offers both stable and fixed rates on certain tokens.
|
|
46
|
+
*/
|
|
47
|
+
export function aaveV3Rate(
|
|
48
|
+
client: CompassApiSDKCore,
|
|
49
|
+
request: operations.AaveRateRequest,
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): APIPromise<
|
|
52
|
+
Result<
|
|
53
|
+
components.AaveRateResponse,
|
|
54
|
+
| errors.HTTPValidationError
|
|
55
|
+
| APIError
|
|
56
|
+
| SDKValidationError
|
|
57
|
+
| UnexpectedClientError
|
|
58
|
+
| InvalidRequestError
|
|
59
|
+
| RequestAbortedError
|
|
60
|
+
| RequestTimeoutError
|
|
61
|
+
| ConnectionError
|
|
62
|
+
>
|
|
63
|
+
> {
|
|
64
|
+
return new APIPromise($do(
|
|
65
|
+
client,
|
|
66
|
+
request,
|
|
67
|
+
options,
|
|
68
|
+
));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function $do(
|
|
72
|
+
client: CompassApiSDKCore,
|
|
73
|
+
request: operations.AaveRateRequest,
|
|
74
|
+
options?: RequestOptions,
|
|
75
|
+
): Promise<
|
|
76
|
+
[
|
|
77
|
+
Result<
|
|
78
|
+
components.AaveRateResponse,
|
|
79
|
+
| errors.HTTPValidationError
|
|
80
|
+
| APIError
|
|
81
|
+
| SDKValidationError
|
|
82
|
+
| UnexpectedClientError
|
|
83
|
+
| InvalidRequestError
|
|
84
|
+
| RequestAbortedError
|
|
85
|
+
| RequestTimeoutError
|
|
86
|
+
| ConnectionError
|
|
87
|
+
>,
|
|
88
|
+
APICall,
|
|
89
|
+
]
|
|
90
|
+
> {
|
|
91
|
+
const parsed = safeParse(
|
|
92
|
+
request,
|
|
93
|
+
(value) => operations.AaveRateRequest$outboundSchema.parse(value),
|
|
94
|
+
"Input validation failed",
|
|
95
|
+
);
|
|
96
|
+
if (!parsed.ok) {
|
|
97
|
+
return [parsed, { status: "invalid" }];
|
|
98
|
+
}
|
|
99
|
+
const payload = parsed.value;
|
|
100
|
+
const body = null;
|
|
101
|
+
|
|
102
|
+
const path = pathToFunc("/v0/aave/rate/get")();
|
|
103
|
+
|
|
104
|
+
const query = encodeFormQuery({
|
|
105
|
+
"chain": payload.chain,
|
|
106
|
+
"token": payload.token,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const headers = new Headers(compactMap({
|
|
110
|
+
Accept: "application/json",
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
114
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
115
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
116
|
+
|
|
117
|
+
const context = {
|
|
118
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
119
|
+
operationID: "aave_rate",
|
|
120
|
+
oAuth2Scopes: [],
|
|
121
|
+
|
|
122
|
+
resolvedSecurity: requestSecurity,
|
|
123
|
+
|
|
124
|
+
securitySource: client._options.apiKeyAuth,
|
|
125
|
+
retryConfig: options?.retries
|
|
126
|
+
|| client._options.retryConfig
|
|
127
|
+
|| { strategy: "none" },
|
|
128
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const requestRes = client._createRequest(context, {
|
|
132
|
+
security: requestSecurity,
|
|
133
|
+
method: "GET",
|
|
134
|
+
baseURL: options?.serverURL,
|
|
135
|
+
path: path,
|
|
136
|
+
headers: headers,
|
|
137
|
+
query: query,
|
|
138
|
+
body: body,
|
|
139
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
140
|
+
}, options);
|
|
141
|
+
if (!requestRes.ok) {
|
|
142
|
+
return [requestRes, { status: "invalid" }];
|
|
143
|
+
}
|
|
144
|
+
const req = requestRes.value;
|
|
145
|
+
|
|
146
|
+
const doResult = await client._do(req, {
|
|
147
|
+
context,
|
|
148
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
149
|
+
retryConfig: context.retryConfig,
|
|
150
|
+
retryCodes: context.retryCodes,
|
|
151
|
+
});
|
|
152
|
+
if (!doResult.ok) {
|
|
153
|
+
return [doResult, { status: "request-error", request: req }];
|
|
154
|
+
}
|
|
155
|
+
const response = doResult.value;
|
|
156
|
+
|
|
157
|
+
const responseFields = {
|
|
158
|
+
HttpMeta: { Response: response, Request: req },
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const [result] = await M.match<
|
|
162
|
+
components.AaveRateResponse,
|
|
163
|
+
| errors.HTTPValidationError
|
|
164
|
+
| APIError
|
|
165
|
+
| SDKValidationError
|
|
166
|
+
| UnexpectedClientError
|
|
167
|
+
| InvalidRequestError
|
|
168
|
+
| RequestAbortedError
|
|
169
|
+
| RequestTimeoutError
|
|
170
|
+
| ConnectionError
|
|
171
|
+
>(
|
|
172
|
+
M.json(200, components.AaveRateResponse$inboundSchema),
|
|
173
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
174
|
+
M.fail("4XX"),
|
|
175
|
+
M.fail("5XX"),
|
|
176
|
+
)(response, { extraFields: responseFields });
|
|
177
|
+
if (!result.ok) {
|
|
178
|
+
return [result, { status: "complete", request: req, response }];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return [result, { status: "complete", request: req, response }];
|
|
182
|
+
}
|
package/src/funcs/skyBuy.ts
CHANGED
|
@@ -28,9 +28,13 @@ import { Result } from "../types/fp.js";
|
|
|
28
28
|
* Buy USDS
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
|
-
* Buy USDS with DAI or USDC on a 1:1 basis.
|
|
31
|
+
* Buy USDS with DAI or USDC on a 1:1 basis. There are no fees.
|
|
32
32
|
*
|
|
33
|
-
*
|
|
33
|
+
* If buying with DAI, user will need to set an allowance on the DAI contract for the
|
|
34
|
+
* 'SkyDaiUsdsConverter' contract beforehand.
|
|
35
|
+
*
|
|
36
|
+
* If buying with USDC, user will need to set an allowance on the USDC contract for the
|
|
37
|
+
* 'SkyDaiUsdsConverter' contract beforehand.
|
|
34
38
|
*/
|
|
35
39
|
export function skyBuy(
|
|
36
40
|
client: CompassApiSDKCore,
|
package/src/funcs/skySell.ts
CHANGED
|
@@ -28,9 +28,13 @@ import { Result } from "../types/fp.js";
|
|
|
28
28
|
* Sell USDS
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
|
-
* Sell USDS for DAI or USDC on a 1:1 basis.
|
|
31
|
+
* Sell USDS for DAI or USDC on a 1:1 basis. There are no fees.
|
|
32
32
|
*
|
|
33
|
-
*
|
|
33
|
+
* If swapping to DAI, user will need to set an allowance on the USDS contract for the
|
|
34
|
+
* 'SkyDaiUsdsConverter' contract beforehand.
|
|
35
|
+
*
|
|
36
|
+
* If swapping to USDC, user will need to set an allowance on the USDS contract for the
|
|
37
|
+
* 'SkyUsdcUsdsConverter' contract beforehand.
|
|
34
38
|
*/
|
|
35
39
|
export function skySell(
|
|
36
40
|
client: CompassApiSDKCore,
|
package/src/lib/config.ts
CHANGED
|
@@ -57,8 +57,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
57
57
|
export const SDK_METADATA = {
|
|
58
58
|
language: "typescript",
|
|
59
59
|
openapiDocVersion: "0.0.1",
|
|
60
|
-
sdkVersion: "0.0.
|
|
60
|
+
sdkVersion: "0.0.21",
|
|
61
61
|
genVersion: "2.598.22",
|
|
62
62
|
userAgent:
|
|
63
|
-
"speakeasy-sdk/typescript 0.0.
|
|
63
|
+
"speakeasy-sdk/typescript 0.0.21 2.598.22 0.0.1 @compass-labs/api-sdk",
|
|
64
64
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { createRegisterTool } from "./tools.js";
|
|
|
16
16
|
import { tool$aaveV3Borrow } from "./tools/aaveV3Borrow.js";
|
|
17
17
|
import { tool$aaveV3HistoricalTransactions } from "./tools/aaveV3HistoricalTransactions.js";
|
|
18
18
|
import { tool$aaveV3LiquidityChange } from "./tools/aaveV3LiquidityChange.js";
|
|
19
|
+
import { tool$aaveV3Rate } from "./tools/aaveV3Rate.js";
|
|
19
20
|
import { tool$aaveV3Repay } from "./tools/aaveV3Repay.js";
|
|
20
21
|
import { tool$aaveV3Supply } from "./tools/aaveV3Supply.js";
|
|
21
22
|
import { tool$aaveV3TokenPrice } from "./tools/aaveV3TokenPrice.js";
|
|
@@ -80,7 +81,7 @@ export function createMCPServer(deps: {
|
|
|
80
81
|
}) {
|
|
81
82
|
const server = new McpServer({
|
|
82
83
|
name: "CompassApiSDK",
|
|
83
|
-
version: "0.0.
|
|
84
|
+
version: "0.0.21",
|
|
84
85
|
});
|
|
85
86
|
|
|
86
87
|
const client = new CompassApiSDKCore({
|
|
@@ -110,6 +111,7 @@ export function createMCPServer(deps: {
|
|
|
110
111
|
const register = { tool, resource, resourceTemplate, prompt };
|
|
111
112
|
void register; // suppress unused warnings
|
|
112
113
|
|
|
114
|
+
tool(tool$aaveV3Rate);
|
|
113
115
|
tool(tool$aaveV3TokenPrice);
|
|
114
116
|
tool(tool$aaveV3LiquidityChange);
|
|
115
117
|
tool(tool$aaveV3UserPositionSummary);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { aaveV3Rate } from "../../funcs/aaveV3Rate.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.AaveRateRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$aaveV3Rate: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "aave-v3-rate",
|
|
15
|
+
description: `Interest rates
|
|
16
|
+
|
|
17
|
+
Returns the latest APY and APR rates for a specified token on Aave, for both
|
|
18
|
+
deposits and loans.
|
|
19
|
+
|
|
20
|
+
**Annual percentage yield (APY)** is the yearly return/cost after continuous
|
|
21
|
+
compounding of the per-second rate stored on-chain. This value is the same value as
|
|
22
|
+
seen the on [app.aave.com](
|
|
23
|
+
https://app.aave.com/)
|
|
24
|
+
but more up-to-date as it is taken directly from the
|
|
25
|
+
blockchain every time this endpoint is called.
|
|
26
|
+
|
|
27
|
+
**Annual percentage rate (APR)** is the yearly simple interest rate (no
|
|
28
|
+
compounding).
|
|
29
|
+
|
|
30
|
+
For APY/APR on loans Aave offers both stable and fixed rates on certain tokens.`,
|
|
31
|
+
args,
|
|
32
|
+
tool: async (client, args, ctx) => {
|
|
33
|
+
const [result, apiCall] = await aaveV3Rate(
|
|
34
|
+
client,
|
|
35
|
+
args.request,
|
|
36
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
37
|
+
).$inspect();
|
|
38
|
+
|
|
39
|
+
if (!result.ok) {
|
|
40
|
+
return {
|
|
41
|
+
content: [{ type: "text", text: result.error.message }],
|
|
42
|
+
isError: true,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const value = result.value;
|
|
47
|
+
|
|
48
|
+
return formatResult(value, apiCall);
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -14,9 +14,13 @@ export const tool$skyBuy: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "sky-buy",
|
|
15
15
|
description: `Buy USDS
|
|
16
16
|
|
|
17
|
-
Buy USDS with DAI or USDC on a 1:1 basis.
|
|
17
|
+
Buy USDS with DAI or USDC on a 1:1 basis. There are no fees.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
If buying with DAI, user will need to set an allowance on the DAI contract for the
|
|
20
|
+
'SkyDaiUsdsConverter' contract beforehand.
|
|
21
|
+
|
|
22
|
+
If buying with USDC, user will need to set an allowance on the USDC contract for the
|
|
23
|
+
'SkyDaiUsdsConverter' contract beforehand.`,
|
|
20
24
|
args,
|
|
21
25
|
tool: async (client, args, ctx) => {
|
|
22
26
|
const [result, apiCall] = await skyBuy(
|
|
@@ -14,9 +14,13 @@ export const tool$skySell: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "sky-sell",
|
|
15
15
|
description: `Sell USDS
|
|
16
16
|
|
|
17
|
-
Sell USDS for DAI or USDC on a 1:1 basis.
|
|
17
|
+
Sell USDS for DAI or USDC on a 1:1 basis. There are no fees.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
If swapping to DAI, user will need to set an allowance on the USDS contract for the
|
|
20
|
+
'SkyDaiUsdsConverter' contract beforehand.
|
|
21
|
+
|
|
22
|
+
If swapping to USDC, user will need to set an allowance on the USDS contract for the
|
|
23
|
+
'SkyUsdcUsdsConverter' contract beforehand.`,
|
|
20
24
|
args,
|
|
21
25
|
tool: async (client, args, ctx) => {
|
|
22
26
|
const [result, apiCall] = await skySell(
|