@compass-labs/api-sdk 1.0.0 → 1.0.2

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.
Files changed (94) hide show
  1. package/README.md +0 -14
  2. package/bin/mcp-server.js +23 -22
  3. package/bin/mcp-server.js.map +13 -13
  4. package/dist/commonjs/hooks/hooks.d.ts +2 -3
  5. package/dist/commonjs/hooks/hooks.d.ts.map +1 -1
  6. package/dist/commonjs/hooks/hooks.js.map +1 -1
  7. package/dist/commonjs/hooks/types.d.ts +6 -2
  8. package/dist/commonjs/hooks/types.d.ts.map +1 -1
  9. package/dist/commonjs/lib/config.d.ts +2 -2
  10. package/dist/commonjs/lib/config.js +2 -2
  11. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  12. package/dist/commonjs/lib/sdks.js +6 -5
  13. package/dist/commonjs/lib/sdks.js.map +1 -1
  14. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  15. package/dist/commonjs/mcp-server/server.js +1 -1
  16. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.d.ts +1 -1
  17. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.d.ts.map +1 -1
  18. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.js +2 -2
  19. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.js.map +1 -1
  20. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.d.ts +1 -1
  21. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.js +2 -2
  23. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.js.map +1 -1
  24. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.d.ts +1 -1
  25. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.js +2 -2
  27. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.js.map +1 -1
  28. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.d.ts +1 -1
  29. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.js +2 -2
  31. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.js.map +1 -1
  32. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.d.ts +1 -1
  33. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.js +2 -2
  35. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.js.map +1 -1
  36. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.d.ts +1 -1
  37. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.js +3 -2
  39. package/dist/commonjs/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.js.map +1 -1
  40. package/dist/esm/hooks/hooks.d.ts +2 -3
  41. package/dist/esm/hooks/hooks.d.ts.map +1 -1
  42. package/dist/esm/hooks/hooks.js.map +1 -1
  43. package/dist/esm/hooks/types.d.ts +6 -2
  44. package/dist/esm/hooks/types.d.ts.map +1 -1
  45. package/dist/esm/lib/config.d.ts +2 -2
  46. package/dist/esm/lib/config.js +2 -2
  47. package/dist/esm/lib/sdks.d.ts.map +1 -1
  48. package/dist/esm/lib/sdks.js +6 -5
  49. package/dist/esm/lib/sdks.js.map +1 -1
  50. package/dist/esm/mcp-server/mcp-server.js +1 -1
  51. package/dist/esm/mcp-server/server.js +1 -1
  52. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.d.ts +1 -1
  53. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.d.ts.map +1 -1
  54. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.js +2 -2
  55. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.js.map +1 -1
  56. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.d.ts +1 -1
  57. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.d.ts.map +1 -1
  58. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.js +2 -2
  59. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.js.map +1 -1
  60. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.d.ts +1 -1
  61. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.d.ts.map +1 -1
  62. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.js +2 -2
  63. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.js.map +1 -1
  64. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.d.ts +1 -1
  65. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.d.ts.map +1 -1
  66. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.js +2 -2
  67. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.js.map +1 -1
  68. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.d.ts +1 -1
  69. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.d.ts.map +1 -1
  70. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.js +2 -2
  71. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.js.map +1 -1
  72. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.d.ts +1 -1
  73. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.d.ts.map +1 -1
  74. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.js +3 -2
  75. package/dist/esm/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.js.map +1 -1
  76. package/docs/sdks/aavev3/README.md +6 -6
  77. package/docs/sdks/erc4626vaults/README.md +2 -2
  78. package/docs/sdks/morpho/README.md +4 -4
  79. package/docs/sdks/transactionbundler/README.md +4 -4
  80. package/docs/sdks/uniswapv3/README.md +10 -10
  81. package/jsr.json +1 -1
  82. package/package.json +1 -1
  83. package/src/hooks/hooks.ts +2 -2
  84. package/src/hooks/types.ts +7 -2
  85. package/src/lib/config.ts +2 -2
  86. package/src/lib/sdks.ts +7 -6
  87. package/src/mcp-server/mcp-server.ts +1 -1
  88. package/src/mcp-server/server.ts +1 -1
  89. package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsborrow.ts +3 -3
  90. package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsliquidationcall.ts +3 -3
  91. package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsrepay.ts +3 -3
  92. package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionssupply.ts +3 -3
  93. package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsswapborrowrate.ts +3 -3
  94. package/src/models/components/compassapibackendmodelsaavereadresponsehistoricaltransactionsusageascollateral.ts +6 -3
@@ -244,8 +244,8 @@ async function run() {
244
244
  s: "0x78f7982ede9dabc53d7153974c5692fda8a21fc73bdafc42aaf135505e22817c",
245
245
  yParity: 0,
246
246
  },
247
- collateralToken: "SNX",
248
- borrowToken: "cbETH",
247
+ collateralToken: "eUSDe",
248
+ borrowToken: "SNX",
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: "SNX",
289
- borrowToken: "cbETH",
288
+ collateralToken: "eUSDe",
289
+ borrowToken: "SNX",
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: "arbitrum",
435
+ chain: "ethereum",
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: "arbitrum",
466
+ chain: "ethereum",
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: "base",
535
+ chain: "ethereum",
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: "base",
566
+ chain: "ethereum",
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: "ethereum",
642
+ chain: "arbitrum",
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: "ethereum",
678
+ chain: "arbitrum",
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: "base",
749
+ chain: "ethereum",
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: "base",
780
+ chain: "ethereum",
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: "base",
849
+ chain: "ethereum",
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: "base",
877
+ chain: "ethereum",
878
878
  sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
879
879
  });
880
880
  if (res.ok) {
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@compass-labs/api-sdk",
5
- "version": "1.0.0",
5
+ "version": "1.0.2",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-labs/api-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "author": "royalnine",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,7 +2,6 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import { SDKOptions } from "../lib/config.js";
6
5
  import { RequestInput } from "../lib/http.js";
7
6
  import {
8
7
  AfterErrorContext,
@@ -16,6 +15,7 @@ import {
16
15
  Hook,
17
16
  Hooks,
18
17
  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: SDKOptions): SDKOptions {
70
+ sdkInit(opts: SDKInitOptions): SDKInitOptions {
71
71
  return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts);
72
72
  }
73
73
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { SDKOptions } from "../lib/config.js";
6
- import { RequestInput } from "../lib/http.js";
6
+ import { HTTPClient, RequestInput } from "../lib/http.js";
7
7
  import { RetryConfig } from "../lib/retries.js";
8
8
  import { SecurityState } from "../lib/security.js";
9
9
 
@@ -19,6 +19,11 @@ 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
+
22
27
  export type BeforeCreateRequestContext = HookContext & {};
23
28
  export type BeforeRequestContext = HookContext & {};
24
29
  export type AfterSuccessContext = HookContext & {};
@@ -29,7 +34,7 @@ export type AfterErrorContext = HookContext & {};
29
34
  * hook can return a new baseURL and HTTP client to be used by the SDK.
30
35
  */
31
36
  export interface SDKInitHook {
32
- sdkInit: (opts: SDKOptions) => SDKOptions;
37
+ sdkInit: (opts: SDKInitOptions) => SDKInitOptions;
33
38
  }
34
39
 
35
40
  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: "1.0.0",
64
+ sdkVersion: "1.0.2",
65
65
  genVersion: "2.672.0",
66
66
  userAgent:
67
- "speakeasy-sdk/typescript 1.0.0 2.672.0 0.0.1 @compass-labs/api-sdk",
67
+ "speakeasy-sdk/typescript 1.0.2 2.672.0 0.0.1 @compass-labs/api-sdk",
68
68
  } as const;
package/src/lib/sdks.ts CHANGED
@@ -96,16 +96,17 @@ 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
-
103
99
  const url = serverURLFromOptions(options);
104
100
  if (url) {
105
101
  url.pathname = url.pathname.replace(/\/+$/, "") + "/";
106
102
  }
107
- this._baseURL = url;
108
- this.#httpClient = options.httpClient || defaultHttpClient;
103
+
104
+ const { baseURL, client } = this.#hooks.sdkInit({
105
+ baseURL: url,
106
+ client: options.httpClient || new HTTPClient(),
107
+ });
108
+ this._baseURL = baseURL;
109
+ this.#httpClient = client;
109
110
 
110
111
  this._options = { ...options, hooks: this.#hooks };
111
112
 
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "1.0.0",
22
+ currentVersion: "1.0.2",
23
23
  },
24
24
  });
25
25
 
@@ -99,7 +99,7 @@ export function createMCPServer(deps: {
99
99
  }) {
100
100
  const server = new McpServer({
101
101
  name: "CompassApiSDK",
102
- version: "1.0.0",
102
+ version: "1.0.2",
103
103
  });
104
104
 
105
105
  const client = new CompassApiSDKCore({
@@ -56,7 +56,7 @@ export type CompassApiBackendModelsAaveReadResponseHistoricalTransactionsBorrow
56
56
  /**
57
57
  * The type of transaction
58
58
  */
59
- action: "Borrow";
59
+ action?: "Borrow" | undefined;
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").default("Borrow").optional(),
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").default("Borrow" as const),
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: "LiquidationCall";
36
+ action?: "LiquidationCall" | undefined;
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").default("LiquidationCall").optional(),
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").default("LiquidationCall" as const),
93
93
  block: z.number().int(),
94
94
  });
95
95
 
@@ -36,7 +36,7 @@ export type CompassApiBackendModelsAaveReadResponseHistoricalTransactionsRepay =
36
36
  /**
37
37
  * The type of transaction
38
38
  */
39
- action: "Repay";
39
+ action?: "Repay" | undefined;
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").default("Repay").optional(),
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").default("Repay" as const),
87
87
  block: z.number().int(),
88
88
  });
89
89
 
@@ -39,7 +39,7 @@ export type CompassApiBackendModelsAaveReadResponseHistoricalTransactionsSupply
39
39
  /**
40
40
  * The type of transaction
41
41
  */
42
- action: "Supply";
42
+ action?: "Supply" | undefined;
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").default("Supply").optional(),
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").default("Supply" as const),
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: "SwapBorrowRate";
35
+ action?: "SwapBorrowRate" | undefined;
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").default("SwapBorrowRate").optional(),
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").default("SwapBorrowRate" as const),
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: "UsageAsCollateral";
36
+ action?: "UsageAsCollateral" | undefined;
37
37
  block: number;
38
38
  };
39
39
 
@@ -50,7 +50,8 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsUsageA
50
50
  fromState: z.boolean(),
51
51
  toState: z.boolean(),
52
52
  reserve: Reserve$inboundSchema,
53
- action: z.literal("UsageAsCollateral"),
53
+ action: z.literal("UsageAsCollateral").default("UsageAsCollateral")
54
+ .optional(),
54
55
  block: z.number().int(),
55
56
  });
56
57
 
@@ -80,7 +81,9 @@ export const CompassApiBackendModelsAaveReadResponseHistoricalTransactionsUsageA
80
81
  fromState: z.boolean(),
81
82
  toState: z.boolean(),
82
83
  reserve: Reserve$outboundSchema,
83
- action: z.literal("UsageAsCollateral"),
84
+ action: z.literal("UsageAsCollateral").default(
85
+ "UsageAsCollateral" as const,
86
+ ),
84
87
  block: z.number().int(),
85
88
  });
86
89