@compass-labs/api-sdk 2.2.28 → 2.2.29-rc.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.
Files changed (61) hide show
  1. package/dist/commonjs/funcs/earnEarnVaults.js +1 -0
  2. package/dist/commonjs/funcs/earnEarnVaults.js.map +1 -1
  3. package/dist/commonjs/lib/config.d.ts +2 -2
  4. package/dist/commonjs/lib/config.js +2 -2
  5. package/dist/commonjs/lib/config.js.map +1 -1
  6. package/dist/commonjs/lib/files.d.ts +13 -0
  7. package/dist/commonjs/lib/files.d.ts.map +1 -1
  8. package/dist/commonjs/lib/files.js +19 -0
  9. package/dist/commonjs/lib/files.js.map +1 -1
  10. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  11. package/dist/commonjs/lib/sdks.js +8 -4
  12. package/dist/commonjs/lib/sdks.js.map +1 -1
  13. package/dist/commonjs/lib/url.d.ts.map +1 -1
  14. package/dist/commonjs/lib/url.js +4 -2
  15. package/dist/commonjs/lib/url.js.map +1 -1
  16. package/dist/commonjs/models/components/vaultinfo.d.ts +4 -0
  17. package/dist/commonjs/models/components/vaultinfo.d.ts.map +1 -1
  18. package/dist/commonjs/models/components/vaultinfo.js +2 -0
  19. package/dist/commonjs/models/components/vaultinfo.js.map +1 -1
  20. package/dist/commonjs/models/operations/v2earnvaults.d.ts +14 -0
  21. package/dist/commonjs/models/operations/v2earnvaults.d.ts.map +1 -1
  22. package/dist/commonjs/models/operations/v2earnvaults.js +9 -1
  23. package/dist/commonjs/models/operations/v2earnvaults.js.map +1 -1
  24. package/dist/esm/funcs/earnEarnVaults.js +1 -0
  25. package/dist/esm/funcs/earnEarnVaults.js.map +1 -1
  26. package/dist/esm/lib/config.d.ts +2 -2
  27. package/dist/esm/lib/config.js +2 -2
  28. package/dist/esm/lib/config.js.map +1 -1
  29. package/dist/esm/lib/files.d.ts +13 -0
  30. package/dist/esm/lib/files.d.ts.map +1 -1
  31. package/dist/esm/lib/files.js +18 -0
  32. package/dist/esm/lib/files.js.map +1 -1
  33. package/dist/esm/lib/sdks.d.ts.map +1 -1
  34. package/dist/esm/lib/sdks.js +8 -4
  35. package/dist/esm/lib/sdks.js.map +1 -1
  36. package/dist/esm/lib/url.d.ts.map +1 -1
  37. package/dist/esm/lib/url.js +4 -2
  38. package/dist/esm/lib/url.js.map +1 -1
  39. package/dist/esm/models/components/vaultinfo.d.ts +4 -0
  40. package/dist/esm/models/components/vaultinfo.d.ts.map +1 -1
  41. package/dist/esm/models/components/vaultinfo.js +2 -0
  42. package/dist/esm/models/components/vaultinfo.js.map +1 -1
  43. package/dist/esm/models/operations/v2earnvaults.d.ts +14 -0
  44. package/dist/esm/models/operations/v2earnvaults.d.ts.map +1 -1
  45. package/dist/esm/models/operations/v2earnvaults.js +7 -0
  46. package/dist/esm/models/operations/v2earnvaults.js.map +1 -1
  47. package/docs/models/components/vaultinfo.md +1 -0
  48. package/docs/models/operations/minliquidityusd.md +19 -0
  49. package/docs/models/operations/v2earnvaultsrequest.md +2 -1
  50. package/examples/node_modules/get-tsconfig/dist/index.cjs +1 -1
  51. package/examples/node_modules/get-tsconfig/dist/index.mjs +1 -1
  52. package/examples/node_modules/get-tsconfig/package.json +1 -1
  53. package/examples/package-lock.json +3 -3
  54. package/package.json +1 -1
  55. package/src/funcs/earnEarnVaults.ts +1 -0
  56. package/src/lib/config.ts +2 -2
  57. package/src/lib/files.ts +22 -0
  58. package/src/lib/sdks.ts +7 -5
  59. package/src/lib/url.ts +16 -14
  60. package/src/models/components/vaultinfo.ts +6 -0
  61. package/src/models/operations/v2earnvaults.ts +28 -0
package/src/lib/url.ts CHANGED
@@ -13,21 +13,23 @@ export function pathToFunc(
13
13
  const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;
14
14
 
15
15
  return function buildURLPath(params: Record<string, unknown> = {}): string {
16
- return pathPattern.replace(paramRE, function (_, placeholder) {
17
- if (!hasOwn.call(params, placeholder)) {
18
- throw new Error(`Parameter '${placeholder}' is required`);
19
- }
16
+ return pathPattern
17
+ .replace(paramRE, function (_, placeholder) {
18
+ if (!hasOwn.call(params, placeholder)) {
19
+ throw new Error(`Parameter '${placeholder}' is required`);
20
+ }
20
21
 
21
- const value = params[placeholder];
22
- if (typeof value !== "string" && typeof value !== "number") {
23
- throw new Error(
24
- `Parameter '${placeholder}' must be a string or number`,
25
- );
26
- }
22
+ const value = params[placeholder];
23
+ if (typeof value !== "string" && typeof value !== "number") {
24
+ throw new Error(
25
+ `Parameter '${placeholder}' must be a string or number`,
26
+ );
27
+ }
27
28
 
28
- return options?.charEncoding === "percent"
29
- ? encodeURIComponent(`${value}`)
30
- : `${value}`;
31
- });
29
+ return options?.charEncoding === "percent"
30
+ ? encodeURIComponent(`${value}`)
31
+ : `${value}`;
32
+ })
33
+ .replace(/^\/+/, "");
32
34
  };
33
35
  }
@@ -52,6 +52,10 @@ export type VaultInfo = {
52
52
  * Total Value Locked in USD.
53
53
  */
54
54
  tvlUsd?: string | null | undefined;
55
+ /**
56
+ * Available liquidity in USD (withdrawable amount).
57
+ */
58
+ liquidityUsd?: string | null | undefined;
55
59
  /**
56
60
  * 7-day APY as a percentage (e.g., 5.25 = 5.25%).
57
61
  */
@@ -85,6 +89,7 @@ export const VaultInfo$inboundSchema: z.ZodType<
85
89
  asset_name: z.nullable(z.string()).optional(),
86
90
  asset_symbol: z.nullable(z.string()).optional(),
87
91
  tvl_usd: z.nullable(z.string()).optional(),
92
+ liquidity_usd: z.nullable(z.string()).optional(),
88
93
  apy_7d: z.nullable(z.string()).optional(),
89
94
  apy_30d: z.nullable(z.string()).optional(),
90
95
  apy_90d: z.nullable(z.string()).optional(),
@@ -95,6 +100,7 @@ export const VaultInfo$inboundSchema: z.ZodType<
95
100
  "asset_name": "assetName",
96
101
  "asset_symbol": "assetSymbol",
97
102
  "tvl_usd": "tvlUsd",
103
+ "liquidity_usd": "liquidityUsd",
98
104
  "apy_7d": "apy7d",
99
105
  "apy_30d": "apy30d",
100
106
  "apy_90d": "apy90d",
@@ -24,6 +24,11 @@ export type V2EarnVaultsDirection = ClosedEnum<typeof V2EarnVaultsDirection>;
24
24
  */
25
25
  export type V2EarnVaultsMinTvlUsd = number | string;
26
26
 
27
+ /**
28
+ * Minimum available liquidity in USD. Vaults below this are excluded.
29
+ */
30
+ export type MinLiquidityUsd = number | string;
31
+
27
32
  export type V2EarnVaultsRequest = {
28
33
  /**
29
34
  * The field to order the results by.
@@ -53,6 +58,10 @@ export type V2EarnVaultsRequest = {
53
58
  * Minimum TVL in USD. Vaults with TVL below this value will be excluded.
54
59
  */
55
60
  minTvlUsd?: number | string | null | undefined;
61
+ /**
62
+ * Minimum available liquidity in USD. Vaults below this are excluded.
63
+ */
64
+ minLiquidityUsd?: number | string | null | undefined;
56
65
  };
57
66
 
58
67
  /** @internal */
@@ -78,6 +87,22 @@ export function v2EarnVaultsMinTvlUsdToJSON(
78
87
  );
79
88
  }
80
89
 
90
+ /** @internal */
91
+ export type MinLiquidityUsd$Outbound = number | string;
92
+
93
+ /** @internal */
94
+ export const MinLiquidityUsd$outboundSchema: z.ZodType<
95
+ MinLiquidityUsd$Outbound,
96
+ z.ZodTypeDef,
97
+ MinLiquidityUsd
98
+ > = z.union([z.number(), z.string()]);
99
+
100
+ export function minLiquidityUsdToJSON(
101
+ minLiquidityUsd: MinLiquidityUsd,
102
+ ): string {
103
+ return JSON.stringify(MinLiquidityUsd$outboundSchema.parse(minLiquidityUsd));
104
+ }
105
+
81
106
  /** @internal */
82
107
  export type V2EarnVaultsRequest$Outbound = {
83
108
  order_by: string;
@@ -87,6 +112,7 @@ export type V2EarnVaultsRequest$Outbound = {
87
112
  chain?: string | null | undefined;
88
113
  asset_symbol?: string | null | undefined;
89
114
  min_tvl_usd?: number | string | null | undefined;
115
+ min_liquidity_usd?: number | string | null | undefined;
90
116
  };
91
117
 
92
118
  /** @internal */
@@ -102,11 +128,13 @@ export const V2EarnVaultsRequest$outboundSchema: z.ZodType<
102
128
  chain: z.nullable(components.Chain$outboundSchema).optional(),
103
129
  assetSymbol: z.nullable(z.string()).optional(),
104
130
  minTvlUsd: z.nullable(z.union([z.number(), z.string()])).optional(),
131
+ minLiquidityUsd: z.nullable(z.union([z.number(), z.string()])).optional(),
105
132
  }).transform((v) => {
106
133
  return remap$(v, {
107
134
  orderBy: "order_by",
108
135
  assetSymbol: "asset_symbol",
109
136
  minTvlUsd: "min_tvl_usd",
137
+ minLiquidityUsd: "min_liquidity_usd",
110
138
  });
111
139
  });
112
140