@compass-labs/api-sdk 2.2.40-rc.0 → 2.2.40

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 (54) hide show
  1. package/dist/commonjs/models/components/creditborrowparams.d.ts +4 -4
  2. package/dist/commonjs/models/components/creditborrowparams.d.ts.map +1 -1
  3. package/dist/commonjs/models/components/creditborrowparams.js +2 -2
  4. package/dist/commonjs/models/components/creditborrowparams.js.map +1 -1
  5. package/dist/commonjs/models/components/creditborrowrequest.d.ts +4 -4
  6. package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -1
  7. package/dist/commonjs/models/components/creditborrowrequest.js +2 -2
  8. package/dist/commonjs/models/components/creditborrowrequest.js.map +1 -1
  9. package/dist/commonjs/models/components/creditfee.d.ts +57 -0
  10. package/dist/commonjs/models/components/creditfee.d.ts.map +1 -0
  11. package/dist/commonjs/models/components/creditfee.js +66 -0
  12. package/dist/commonjs/models/components/creditfee.js.map +1 -0
  13. package/dist/commonjs/models/components/fee.d.ts +4 -4
  14. package/dist/commonjs/models/components/fee.d.ts.map +1 -1
  15. package/dist/commonjs/models/components/fee.js +4 -4
  16. package/dist/commonjs/models/components/fee.js.map +1 -1
  17. package/dist/commonjs/models/components/index.d.ts +1 -0
  18. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  19. package/dist/commonjs/models/components/index.js +1 -0
  20. package/dist/commonjs/models/components/index.js.map +1 -1
  21. package/dist/esm/models/components/creditborrowparams.d.ts +4 -4
  22. package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -1
  23. package/dist/esm/models/components/creditborrowparams.js +2 -2
  24. package/dist/esm/models/components/creditborrowparams.js.map +1 -1
  25. package/dist/esm/models/components/creditborrowrequest.d.ts +4 -4
  26. package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
  27. package/dist/esm/models/components/creditborrowrequest.js +2 -2
  28. package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
  29. package/dist/esm/models/components/creditfee.d.ts +57 -0
  30. package/dist/esm/models/components/creditfee.d.ts.map +1 -0
  31. package/dist/esm/models/components/creditfee.js +28 -0
  32. package/dist/esm/models/components/creditfee.js.map +1 -0
  33. package/dist/esm/models/components/fee.d.ts +4 -4
  34. package/dist/esm/models/components/fee.d.ts.map +1 -1
  35. package/dist/esm/models/components/fee.js +3 -3
  36. package/dist/esm/models/components/fee.js.map +1 -1
  37. package/dist/esm/models/components/index.d.ts +1 -0
  38. package/dist/esm/models/components/index.d.ts.map +1 -1
  39. package/dist/esm/models/components/index.js +1 -0
  40. package/dist/esm/models/components/index.js.map +1 -1
  41. package/docs/models/components/creditborrowparams.md +2 -2
  42. package/docs/models/components/creditborrowrequest.md +1 -1
  43. package/docs/models/components/creditfee.md +27 -0
  44. package/docs/models/components/creditfeeamount.md +19 -0
  45. package/docs/models/components/creditfeedenomination.md +17 -0
  46. package/docs/models/components/credituseroperationbody.md +1 -1
  47. package/docs/models/components/fee.md +1 -1
  48. package/docs/models/components/{denomination.md → feedenomination.md} +3 -3
  49. package/package.json +1 -1
  50. package/src/models/components/creditborrowparams.ts +9 -5
  51. package/src/models/components/creditborrowrequest.ts +9 -5
  52. package/src/models/components/creditfee.ts +90 -0
  53. package/src/models/components/fee.ts +7 -6
  54. package/src/models/components/index.ts +1 -0
@@ -0,0 +1,90 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ /**
9
+ * The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
10
+ */
11
+ export type CreditFeeAmount = number | string;
12
+
13
+ /**
14
+ * The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the borrow amount), or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
15
+ */
16
+ export const CreditFeeDenomination = {
17
+ Percentage: "PERCENTAGE",
18
+ Fixed: "FIXED",
19
+ } as const;
20
+ /**
21
+ * The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the borrow amount), or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
22
+ */
23
+ export type CreditFeeDenomination = ClosedEnum<typeof CreditFeeDenomination>;
24
+
25
+ /**
26
+ * Fee configuration for credit-product actions.
27
+ *
28
+ * @remarks
29
+ *
30
+ * Same shape as `Fee`, but narrows `denomination` to the values supported by
31
+ * credit borrows. PERFORMANCE is not supported because realized-profit fees
32
+ * are not meaningful for debt positions.
33
+ */
34
+ export type CreditFee = {
35
+ /**
36
+ * The wallet address that will receive the fee.
37
+ */
38
+ recipient: string;
39
+ /**
40
+ * The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
41
+ */
42
+ amount: number | string;
43
+ /**
44
+ * The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the borrow amount), or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
45
+ */
46
+ denomination?: CreditFeeDenomination | undefined;
47
+ };
48
+
49
+ /** @internal */
50
+ export type CreditFeeAmount$Outbound = number | string;
51
+
52
+ /** @internal */
53
+ export const CreditFeeAmount$outboundSchema: z.ZodType<
54
+ CreditFeeAmount$Outbound,
55
+ z.ZodTypeDef,
56
+ CreditFeeAmount
57
+ > = z.union([z.number(), z.string()]);
58
+
59
+ export function creditFeeAmountToJSON(
60
+ creditFeeAmount: CreditFeeAmount,
61
+ ): string {
62
+ return JSON.stringify(CreditFeeAmount$outboundSchema.parse(creditFeeAmount));
63
+ }
64
+
65
+ /** @internal */
66
+ export const CreditFeeDenomination$outboundSchema: z.ZodNativeEnum<
67
+ typeof CreditFeeDenomination
68
+ > = z.nativeEnum(CreditFeeDenomination);
69
+
70
+ /** @internal */
71
+ export type CreditFee$Outbound = {
72
+ recipient: string;
73
+ amount: number | string;
74
+ denomination?: string | undefined;
75
+ };
76
+
77
+ /** @internal */
78
+ export const CreditFee$outboundSchema: z.ZodType<
79
+ CreditFee$Outbound,
80
+ z.ZodTypeDef,
81
+ CreditFee
82
+ > = z.object({
83
+ recipient: z.string(),
84
+ amount: z.union([z.number(), z.string()]),
85
+ denomination: CreditFeeDenomination$outboundSchema.optional(),
86
+ });
87
+
88
+ export function creditFeeToJSON(creditFee: CreditFee): string {
89
+ return JSON.stringify(CreditFee$outboundSchema.parse(creditFee));
90
+ }
@@ -13,7 +13,7 @@ export type FeeAmount = number | string;
13
13
  /**
14
14
  * The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit).
15
15
  */
16
- export const Denomination = {
16
+ export const FeeDenomination = {
17
17
  Percentage: "PERCENTAGE",
18
18
  Fixed: "FIXED",
19
19
  Performance: "PERFORMANCE",
@@ -21,7 +21,7 @@ export const Denomination = {
21
21
  /**
22
22
  * The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit).
23
23
  */
24
- export type Denomination = ClosedEnum<typeof Denomination>;
24
+ export type FeeDenomination = ClosedEnum<typeof FeeDenomination>;
25
25
 
26
26
  export type Fee = {
27
27
  /**
@@ -35,7 +35,7 @@ export type Fee = {
35
35
  /**
36
36
  * The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit).
37
37
  */
38
- denomination?: Denomination | undefined;
38
+ denomination?: FeeDenomination | undefined;
39
39
  };
40
40
 
41
41
  /** @internal */
@@ -53,8 +53,9 @@ export function feeAmountToJSON(feeAmount: FeeAmount): string {
53
53
  }
54
54
 
55
55
  /** @internal */
56
- export const Denomination$outboundSchema: z.ZodNativeEnum<typeof Denomination> =
57
- z.nativeEnum(Denomination);
56
+ export const FeeDenomination$outboundSchema: z.ZodNativeEnum<
57
+ typeof FeeDenomination
58
+ > = z.nativeEnum(FeeDenomination);
58
59
 
59
60
  /** @internal */
60
61
  export type Fee$Outbound = {
@@ -68,7 +69,7 @@ export const Fee$outboundSchema: z.ZodType<Fee$Outbound, z.ZodTypeDef, Fee> = z
68
69
  .object({
69
70
  recipient: z.string(),
70
71
  amount: z.union([z.number(), z.string()]),
71
- denomination: Denomination$outboundSchema.optional(),
72
+ denomination: FeeDenomination$outboundSchema.optional(),
72
73
  });
73
74
 
74
75
  export function feeToJSON(fee: Fee): string {
@@ -93,6 +93,7 @@ export * from "./creditbundlerequest.js";
93
93
  export * from "./creditbundleresponse.js";
94
94
  export * from "./creditenablecollateralparams.js";
95
95
  export * from "./creditevent.js";
96
+ export * from "./creditfee.js";
96
97
  export * from "./creditpositionsresponse.js";
97
98
  export * from "./creditrepayparams.js";
98
99
  export * from "./creditrepayrequest.js";