@compass-labs/api-sdk 2.1.26-rc.1 → 2.1.26-rc.10

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 (89) hide show
  1. package/codeSamples_typescript.yaml +1 -1
  2. package/dist/commonjs/funcs/earnEarnManage.d.ts +4 -1
  3. package/dist/commonjs/funcs/earnEarnManage.d.ts.map +1 -1
  4. package/dist/commonjs/funcs/earnEarnManage.js +4 -1
  5. package/dist/commonjs/funcs/earnEarnManage.js.map +1 -1
  6. package/dist/commonjs/funcs/earnEarnPositions.js +0 -1
  7. package/dist/commonjs/funcs/earnEarnPositions.js.map +1 -1
  8. package/dist/commonjs/models/components/aaveposition.d.ts +0 -4
  9. package/dist/commonjs/models/components/aaveposition.d.ts.map +1 -1
  10. package/dist/commonjs/models/components/aaveposition.js +0 -1
  11. package/dist/commonjs/models/components/aaveposition.js.map +1 -1
  12. package/dist/commonjs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.d.ts +0 -4
  13. package/dist/commonjs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.d.ts.map +1 -1
  14. package/dist/commonjs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.js +0 -1
  15. package/dist/commonjs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.js.map +1 -1
  16. package/dist/commonjs/models/components/depositevent.d.ts +0 -4
  17. package/dist/commonjs/models/components/depositevent.d.ts.map +1 -1
  18. package/dist/commonjs/models/components/depositevent.js +0 -2
  19. package/dist/commonjs/models/components/depositevent.js.map +1 -1
  20. package/dist/commonjs/models/components/fee.d.ts +6 -5
  21. package/dist/commonjs/models/components/fee.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/fee.js +2 -1
  23. package/dist/commonjs/models/components/fee.js.map +1 -1
  24. package/dist/commonjs/models/components/withdrawalevent.d.ts +0 -4
  25. package/dist/commonjs/models/components/withdrawalevent.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/withdrawalevent.js +0 -2
  27. package/dist/commonjs/models/components/withdrawalevent.js.map +1 -1
  28. package/dist/commonjs/models/operations/v2earnpositions.d.ts +0 -5
  29. package/dist/commonjs/models/operations/v2earnpositions.d.ts.map +1 -1
  30. package/dist/commonjs/models/operations/v2earnpositions.js +0 -1
  31. package/dist/commonjs/models/operations/v2earnpositions.js.map +1 -1
  32. package/dist/commonjs/sdk/earn.d.ts +4 -1
  33. package/dist/commonjs/sdk/earn.d.ts.map +1 -1
  34. package/dist/commonjs/sdk/earn.js +4 -1
  35. package/dist/commonjs/sdk/earn.js.map +1 -1
  36. package/dist/esm/funcs/earnEarnManage.d.ts +4 -1
  37. package/dist/esm/funcs/earnEarnManage.d.ts.map +1 -1
  38. package/dist/esm/funcs/earnEarnManage.js +4 -1
  39. package/dist/esm/funcs/earnEarnManage.js.map +1 -1
  40. package/dist/esm/funcs/earnEarnPositions.js +0 -1
  41. package/dist/esm/funcs/earnEarnPositions.js.map +1 -1
  42. package/dist/esm/models/components/aaveposition.d.ts +0 -4
  43. package/dist/esm/models/components/aaveposition.d.ts.map +1 -1
  44. package/dist/esm/models/components/aaveposition.js +0 -1
  45. package/dist/esm/models/components/aaveposition.js.map +1 -1
  46. package/dist/esm/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.d.ts +0 -4
  47. package/dist/esm/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.d.ts.map +1 -1
  48. package/dist/esm/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.js +0 -1
  49. package/dist/esm/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.js.map +1 -1
  50. package/dist/esm/models/components/depositevent.d.ts +0 -4
  51. package/dist/esm/models/components/depositevent.d.ts.map +1 -1
  52. package/dist/esm/models/components/depositevent.js +0 -2
  53. package/dist/esm/models/components/depositevent.js.map +1 -1
  54. package/dist/esm/models/components/fee.d.ts +6 -5
  55. package/dist/esm/models/components/fee.d.ts.map +1 -1
  56. package/dist/esm/models/components/fee.js +2 -1
  57. package/dist/esm/models/components/fee.js.map +1 -1
  58. package/dist/esm/models/components/withdrawalevent.d.ts +0 -4
  59. package/dist/esm/models/components/withdrawalevent.d.ts.map +1 -1
  60. package/dist/esm/models/components/withdrawalevent.js +0 -2
  61. package/dist/esm/models/components/withdrawalevent.js.map +1 -1
  62. package/dist/esm/models/operations/v2earnpositions.d.ts +0 -5
  63. package/dist/esm/models/operations/v2earnpositions.d.ts.map +1 -1
  64. package/dist/esm/models/operations/v2earnpositions.js +0 -1
  65. package/dist/esm/models/operations/v2earnpositions.js.map +1 -1
  66. package/dist/esm/sdk/earn.d.ts +4 -1
  67. package/dist/esm/sdk/earn.d.ts.map +1 -1
  68. package/dist/esm/sdk/earn.js +4 -1
  69. package/dist/esm/sdk/earn.js.map +1 -1
  70. package/docs/models/components/aaveposition.md +0 -2
  71. package/docs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.md +0 -2
  72. package/docs/models/components/denomination.md +2 -2
  73. package/docs/models/components/depositevent.md +7 -9
  74. package/docs/models/components/fee.md +5 -5
  75. package/docs/models/components/feeamount.md +1 -1
  76. package/docs/models/components/userposition.md +0 -2
  77. package/docs/models/components/withdrawalevent.md +9 -11
  78. package/docs/models/operations/v2earnpositionsrequest.md +1 -3
  79. package/docs/sdks/earn/README.md +4 -3
  80. package/package.json +1 -1
  81. package/src/funcs/earnEarnManage.ts +4 -1
  82. package/src/funcs/earnEarnPositions.ts +0 -1
  83. package/src/models/components/aaveposition.ts +0 -5
  84. package/src/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.ts +0 -5
  85. package/src/models/components/depositevent.ts +0 -8
  86. package/src/models/components/fee.ts +6 -5
  87. package/src/models/components/withdrawalevent.ts +0 -8
  88. package/src/models/operations/v2earnpositions.ts +0 -6
  89. package/src/sdk/earn.ts +4 -1
@@ -16,10 +16,6 @@ export type DepositEvent = {
16
16
  * Block number when deposit occurred
17
17
  */
18
18
  blockNumber: number;
19
- /**
20
- * Timestamp of the deposit
21
- */
22
- blockTimestamp: Date;
23
19
  /**
24
20
  * Transaction hash of the deposit
25
21
  */
@@ -45,9 +41,6 @@ export const DepositEvent$inboundSchema: z.ZodType<
45
41
  unknown
46
42
  > = z.object({
47
43
  block_number: z.number().int(),
48
- block_timestamp: z.string().datetime({ offset: true }).transform(v =>
49
- new Date(v)
50
- ),
51
44
  transaction_hash: z.string(),
52
45
  assets_deposited: z.string(),
53
46
  units_received: z.string(),
@@ -55,7 +48,6 @@ export const DepositEvent$inboundSchema: z.ZodType<
55
48
  }).transform((v) => {
56
49
  return remap$(v, {
57
50
  "block_number": "blockNumber",
58
- "block_timestamp": "blockTimestamp",
59
51
  "transaction_hash": "transactionHash",
60
52
  "assets_deposited": "assetsDeposited",
61
53
  "units_received": "unitsReceived",
@@ -6,19 +6,20 @@ import * as z from "zod/v3";
6
6
  import { ClosedEnum } from "../../types/enums.js";
7
7
 
8
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).
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
10
  */
11
11
  export type FeeAmount = number | string;
12
12
 
13
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 transaction amount) or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
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
16
  export const Denomination = {
17
17
  Percentage: "PERCENTAGE",
18
18
  Fixed: "FIXED",
19
+ Performance: "PERFORMANCE",
19
20
  } as const;
20
21
  /**
21
- * 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) or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
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).
22
23
  */
23
24
  export type Denomination = ClosedEnum<typeof Denomination>;
24
25
 
@@ -28,11 +29,11 @@ export type Fee = {
28
29
  */
29
30
  recipient: string;
30
31
  /**
31
- * 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).
32
+ * 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).
32
33
  */
33
34
  amount: number | string;
34
35
  /**
35
- * 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) or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
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).
36
37
  */
37
38
  denomination?: Denomination | undefined;
38
39
  };
@@ -16,10 +16,6 @@ export type WithdrawalEvent = {
16
16
  * Block number when withdrawal occurred
17
17
  */
18
18
  blockNumber: number;
19
- /**
20
- * Timestamp of the withdrawal
21
- */
22
- blockTimestamp: Date;
23
19
  /**
24
20
  * Transaction hash of the withdrawal
25
21
  */
@@ -53,9 +49,6 @@ export const WithdrawalEvent$inboundSchema: z.ZodType<
53
49
  unknown
54
50
  > = z.object({
55
51
  block_number: z.number().int(),
56
- block_timestamp: z.string().datetime({ offset: true }).transform(v =>
57
- new Date(v)
58
- ),
59
52
  transaction_hash: z.string(),
60
53
  assets_received: z.string(),
61
54
  units_withdrawn: z.string(),
@@ -65,7 +58,6 @@ export const WithdrawalEvent$inboundSchema: z.ZodType<
65
58
  }).transform((v) => {
66
59
  return remap$(v, {
67
60
  "block_number": "blockNumber",
68
- "block_timestamp": "blockTimestamp",
69
61
  "transaction_hash": "transactionHash",
70
62
  "assets_received": "assetsReceived",
71
63
  "units_withdrawn": "unitsWithdrawn",
@@ -27,10 +27,6 @@ export type V2EarnPositionsRequest = {
27
27
  * The address of the user to get vault positions for.
28
28
  */
29
29
  userAddress: string;
30
- /**
31
- * How many days back from the current time to include in the blockchain scan.
32
- */
33
- days?: number | undefined;
34
30
  };
35
31
 
36
32
  /** @internal */
@@ -44,7 +40,6 @@ export type V2EarnPositionsRequest$Outbound = {
44
40
  limit?: number | undefined;
45
41
  chain: string;
46
42
  user_address: string;
47
- days?: number | undefined;
48
43
  };
49
44
 
50
45
  /** @internal */
@@ -57,7 +52,6 @@ export const V2EarnPositionsRequest$outboundSchema: z.ZodType<
57
52
  limit: z.number().int().optional(),
58
53
  chain: V2EarnPositionsChain$outboundSchema,
59
54
  userAddress: z.string(),
60
- days: z.number().int().optional(),
61
55
  }).transform((v) => {
62
56
  return remap$(v, {
63
57
  userAddress: "user_address",
package/src/sdk/earn.ts CHANGED
@@ -145,7 +145,10 @@ export class Earn extends ClientSDK {
145
145
  *
146
146
  * If `WITHDRAW` is selected for `action`, tokens will be withdrawn from the selected venue address back into the Earn Account associated with the `owner` wallet.
147
147
  *
148
- * A fee can be configured. This fee is deducted from the total `amount`. It can be expressed as a `FIXED` amount or a `PERCENTAGE` of `amount`.
148
+ * A fee can be configured. This fee is deducted from the total `amount`. It can be expressed as:
149
+ * - `FIXED`: a fixed token amount (e.g., 0.1 means 0.1 tokens)
150
+ * - `PERCENTAGE`: a percentage of the transaction amount (e.g., 1.5 means 1.5%)
151
+ * - `PERFORMANCE`: a percentage of realized profit using FIFO cost basis (e.g., 10 means 10% of profit). Only applicable for withdrawals.
149
152
  *
150
153
  * The transaction can be gas-sponsored by an arbitrary wallet address which will sign, submit and pay the required gas for the transaction. If `gas_sponsorship` is set to `true`, EIP-712 typed data will be returned that must be signed by the `owner` and submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`) where the `sender` of the transaction can be set.
151
154
  */