@compass-labs/api-sdk 2.1.14 → 2.1.15-rc.1

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 (140) hide show
  1. package/README.md +20 -18
  2. package/codeSamples_typescript.yaml +8 -2
  3. package/dist/commonjs/funcs/earnEarnBundle.d.ts +31 -0
  4. package/dist/commonjs/funcs/earnEarnBundle.d.ts.map +1 -0
  5. package/dist/commonjs/funcs/earnEarnBundle.js +131 -0
  6. package/dist/commonjs/funcs/earnEarnBundle.js.map +1 -0
  7. package/dist/commonjs/lib/config.d.ts +2 -2
  8. package/dist/commonjs/lib/config.js +2 -2
  9. package/dist/commonjs/models/components/earnmanageparams.d.ts +63 -0
  10. package/dist/commonjs/models/components/earnmanageparams.d.ts.map +1 -0
  11. package/dist/commonjs/models/components/earnmanageparams.js +74 -0
  12. package/dist/commonjs/models/components/earnmanageparams.js.map +1 -0
  13. package/dist/commonjs/models/components/earnmanagerequest.d.ts +25 -13
  14. package/dist/commonjs/models/components/earnmanagerequest.d.ts.map +1 -1
  15. package/dist/commonjs/models/components/earnmanagerequest.js +9 -7
  16. package/dist/commonjs/models/components/earnmanagerequest.js.map +1 -1
  17. package/dist/commonjs/models/components/earnswapparams.d.ts +60 -0
  18. package/dist/commonjs/models/components/earnswapparams.d.ts.map +1 -0
  19. package/dist/commonjs/models/components/earnswapparams.js +73 -0
  20. package/dist/commonjs/models/components/earnswapparams.js.map +1 -0
  21. package/dist/commonjs/models/components/earnswaprequest.d.ts +26 -14
  22. package/dist/commonjs/models/components/earnswaprequest.d.ts.map +1 -1
  23. package/dist/commonjs/models/components/earnswaprequest.js +10 -8
  24. package/dist/commonjs/models/components/earnswaprequest.js.map +1 -1
  25. package/dist/commonjs/models/components/index.d.ts +5 -0
  26. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  27. package/dist/commonjs/models/components/index.js +5 -0
  28. package/dist/commonjs/models/components/index.js.map +1 -1
  29. package/dist/commonjs/models/components/useroperation.d.ts +4 -4
  30. package/dist/commonjs/models/components/useroperation.d.ts.map +1 -1
  31. package/dist/commonjs/models/components/useroperation.js +5 -5
  32. package/dist/commonjs/models/components/useroperation.js.map +1 -1
  33. package/dist/commonjs/models/components/v2bundlerequest.d.ts +43 -0
  34. package/dist/commonjs/models/components/v2bundlerequest.d.ts.map +1 -0
  35. package/dist/commonjs/models/components/v2bundlerequest.js +59 -0
  36. package/dist/commonjs/models/components/v2bundlerequest.js.map +1 -0
  37. package/dist/commonjs/models/components/v2bundleresponse.d.ts +31 -0
  38. package/dist/commonjs/models/components/v2bundleresponse.d.ts.map +1 -0
  39. package/dist/commonjs/models/components/v2bundleresponse.js +61 -0
  40. package/dist/commonjs/models/components/v2bundleresponse.js.map +1 -0
  41. package/dist/commonjs/models/components/v2useroperation.d.ts +23 -0
  42. package/dist/commonjs/models/components/v2useroperation.d.ts.map +1 -0
  43. package/dist/commonjs/models/components/v2useroperation.js +60 -0
  44. package/dist/commonjs/models/components/v2useroperation.js.map +1 -0
  45. package/dist/commonjs/sdk/earn.d.ts +20 -0
  46. package/dist/commonjs/sdk/earn.d.ts.map +1 -1
  47. package/dist/commonjs/sdk/earn.js +23 -0
  48. package/dist/commonjs/sdk/earn.js.map +1 -1
  49. package/dist/esm/funcs/earnEarnBundle.d.ts +31 -0
  50. package/dist/esm/funcs/earnEarnBundle.d.ts.map +1 -0
  51. package/dist/esm/funcs/earnEarnBundle.js +95 -0
  52. package/dist/esm/funcs/earnEarnBundle.js.map +1 -0
  53. package/dist/esm/lib/config.d.ts +2 -2
  54. package/dist/esm/lib/config.js +2 -2
  55. package/dist/esm/models/components/earnmanageparams.d.ts +63 -0
  56. package/dist/esm/models/components/earnmanageparams.d.ts.map +1 -0
  57. package/dist/esm/models/components/earnmanageparams.js +36 -0
  58. package/dist/esm/models/components/earnmanageparams.js.map +1 -0
  59. package/dist/esm/models/components/earnmanagerequest.d.ts +25 -13
  60. package/dist/esm/models/components/earnmanagerequest.d.ts.map +1 -1
  61. package/dist/esm/models/components/earnmanagerequest.js +7 -5
  62. package/dist/esm/models/components/earnmanagerequest.js.map +1 -1
  63. package/dist/esm/models/components/earnswapparams.d.ts +60 -0
  64. package/dist/esm/models/components/earnswapparams.d.ts.map +1 -0
  65. package/dist/esm/models/components/earnswapparams.js +34 -0
  66. package/dist/esm/models/components/earnswapparams.js.map +1 -0
  67. package/dist/esm/models/components/earnswaprequest.d.ts +26 -14
  68. package/dist/esm/models/components/earnswaprequest.d.ts.map +1 -1
  69. package/dist/esm/models/components/earnswaprequest.js +8 -6
  70. package/dist/esm/models/components/earnswaprequest.js.map +1 -1
  71. package/dist/esm/models/components/index.d.ts +5 -0
  72. package/dist/esm/models/components/index.d.ts.map +1 -1
  73. package/dist/esm/models/components/index.js +5 -0
  74. package/dist/esm/models/components/index.js.map +1 -1
  75. package/dist/esm/models/components/useroperation.d.ts +4 -4
  76. package/dist/esm/models/components/useroperation.d.ts.map +1 -1
  77. package/dist/esm/models/components/useroperation.js +3 -3
  78. package/dist/esm/models/components/useroperation.js.map +1 -1
  79. package/dist/esm/models/components/v2bundlerequest.d.ts +43 -0
  80. package/dist/esm/models/components/v2bundlerequest.d.ts.map +1 -0
  81. package/dist/esm/models/components/v2bundlerequest.js +22 -0
  82. package/dist/esm/models/components/v2bundlerequest.js.map +1 -0
  83. package/dist/esm/models/components/v2bundleresponse.d.ts +31 -0
  84. package/dist/esm/models/components/v2bundleresponse.d.ts.map +1 -0
  85. package/dist/esm/models/components/v2bundleresponse.js +24 -0
  86. package/dist/esm/models/components/v2bundleresponse.js.map +1 -0
  87. package/dist/esm/models/components/v2useroperation.d.ts +23 -0
  88. package/dist/esm/models/components/v2useroperation.d.ts.map +1 -0
  89. package/dist/esm/models/components/v2useroperation.js +22 -0
  90. package/dist/esm/models/components/v2useroperation.js.map +1 -0
  91. package/dist/esm/sdk/earn.d.ts +20 -0
  92. package/dist/esm/sdk/earn.d.ts.map +1 -1
  93. package/dist/esm/sdk/earn.js +23 -0
  94. package/dist/esm/sdk/earn.js.map +1 -1
  95. package/docs/models/components/earnmanageparams.md +31 -0
  96. package/docs/models/components/earnmanageparamsaction.md +17 -0
  97. package/docs/models/components/{venue.md → earnmanageparamsvenue.md} +1 -1
  98. package/docs/models/components/earnmanagerequest.md +12 -6
  99. package/docs/models/components/earnmanagerequestvenue.md +25 -0
  100. package/docs/models/components/earnswapparams.md +29 -0
  101. package/docs/models/components/earnswapparamsamountin.md +19 -0
  102. package/docs/models/components/{slippage.md → earnswapparamsslippage.md} +3 -3
  103. package/docs/models/components/earnswaprequest.md +10 -5
  104. package/docs/models/components/earnswaprequestslippage.md +19 -0
  105. package/docs/models/components/useroperation.md +3 -3
  106. package/docs/models/components/{body.md → useroperationbody.md} +1 -1
  107. package/docs/models/components/v2bundlerequest.md +52 -0
  108. package/docs/models/components/v2bundleresponse.md +24 -0
  109. package/docs/models/components/v2useroperation.md +27 -0
  110. package/docs/models/components/v2useroperationbody.md +31 -0
  111. package/docs/sdks/aavev3/README.md +0 -1
  112. package/docs/sdks/aerodromeslipstream/README.md +0 -1
  113. package/docs/sdks/bridge/README.md +0 -1
  114. package/docs/sdks/earn/README.md +148 -11
  115. package/docs/sdks/erc4626vaults/README.md +1 -2
  116. package/docs/sdks/ethena/README.md +0 -1
  117. package/docs/sdks/gassponsorship/README.md +0 -1
  118. package/docs/sdks/morpho/README.md +0 -1
  119. package/docs/sdks/pendle/README.md +0 -1
  120. package/docs/sdks/sky/README.md +0 -1
  121. package/docs/sdks/smartaccount/README.md +0 -1
  122. package/docs/sdks/swap/README.md +0 -1
  123. package/docs/sdks/token/README.md +0 -1
  124. package/docs/sdks/transactionbundler/README.md +0 -1
  125. package/docs/sdks/uniswapv3/README.md +0 -1
  126. package/docs/sdks/universal/README.md +0 -1
  127. package/docs/sdks/wildcat/README.md +0 -1
  128. package/package.json +1 -1
  129. package/src/funcs/earnEarnBundle.ts +182 -0
  130. package/src/lib/config.ts +2 -2
  131. package/src/models/components/earnmanageparams.ts +118 -0
  132. package/src/models/components/earnmanagerequest.ts +38 -18
  133. package/src/models/components/earnswapparams.ts +115 -0
  134. package/src/models/components/earnswaprequest.ts +38 -20
  135. package/src/models/components/index.ts +5 -0
  136. package/src/models/components/useroperation.ts +52 -45
  137. package/src/models/components/v2bundlerequest.ts +72 -0
  138. package/src/models/components/v2bundleresponse.ts +67 -0
  139. package/src/models/components/v2useroperation.ts +67 -0
  140. package/src/sdk/earn.ts +31 -0
package/src/lib/config.ts CHANGED
@@ -62,7 +62,7 @@ export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "0.0.1",
64
64
  sdkVersion: "2.0.0",
65
- genVersion: "2.770.0",
65
+ genVersion: "2.772.0",
66
66
  userAgent:
67
- "speakeasy-sdk/typescript 2.0.0 2.770.0 0.0.1 @compass-labs/api-sdk",
67
+ "speakeasy-sdk/typescript 2.0.0 2.772.0 0.0.1 @compass-labs/api-sdk",
68
68
  } as const;
@@ -0,0 +1,118 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+ import {
9
+ AaveVenue,
10
+ AaveVenue$Outbound,
11
+ AaveVenue$outboundSchema,
12
+ } from "./aavevenue.js";
13
+ import {
14
+ VaultVenue,
15
+ VaultVenue$Outbound,
16
+ VaultVenue$outboundSchema,
17
+ } from "./vaultvenue.js";
18
+
19
+ /**
20
+ * The earn venue.
21
+ */
22
+ export type EarnManageParamsVenue = AaveVenue | VaultVenue;
23
+
24
+ /**
25
+ * Whether you are depositing into or withdrawing from the given Earn `venue`.
26
+ */
27
+ export const EarnManageParamsAction = {
28
+ Deposit: "DEPOSIT",
29
+ Withdraw: "WITHDRAW",
30
+ } as const;
31
+ /**
32
+ * Whether you are depositing into or withdrawing from the given Earn `venue`.
33
+ */
34
+ export type EarnManageParamsAction = ClosedEnum<typeof EarnManageParamsAction>;
35
+
36
+ /**
37
+ * Parameters for earn manage operations (deposit/withdraw to vault/Aave).
38
+ *
39
+ * @remarks
40
+ *
41
+ * Used by multicall/bundle endpoint to specify manage actions. EarnManageRequest
42
+ * inherits from this class.
43
+ */
44
+ export type EarnManageParams = {
45
+ /**
46
+ * Action type identifier for manage operations.
47
+ */
48
+ actionType: "V2_MANAGE";
49
+ /**
50
+ * The earn venue.
51
+ */
52
+ venue: AaveVenue | VaultVenue;
53
+ /**
54
+ * Whether you are depositing into or withdrawing from the given Earn `venue`.
55
+ */
56
+ action: EarnManageParamsAction;
57
+ /**
58
+ * Amount of the underlying asset to act on (deposit or withdraw). For VAULT, this is the vault's underlying token; for AAVE, this is the Aave reserve asset. Provide as a decimal in token units (not wei); must be > 0.
59
+ */
60
+ amount?: any | undefined;
61
+ };
62
+
63
+ /** @internal */
64
+ export type EarnManageParamsVenue$Outbound =
65
+ | AaveVenue$Outbound
66
+ | VaultVenue$Outbound;
67
+
68
+ /** @internal */
69
+ export const EarnManageParamsVenue$outboundSchema: z.ZodType<
70
+ EarnManageParamsVenue$Outbound,
71
+ z.ZodTypeDef,
72
+ EarnManageParamsVenue
73
+ > = z.union([AaveVenue$outboundSchema, VaultVenue$outboundSchema]);
74
+
75
+ export function earnManageParamsVenueToJSON(
76
+ earnManageParamsVenue: EarnManageParamsVenue,
77
+ ): string {
78
+ return JSON.stringify(
79
+ EarnManageParamsVenue$outboundSchema.parse(earnManageParamsVenue),
80
+ );
81
+ }
82
+
83
+ /** @internal */
84
+ export const EarnManageParamsAction$outboundSchema: z.ZodNativeEnum<
85
+ typeof EarnManageParamsAction
86
+ > = z.nativeEnum(EarnManageParamsAction);
87
+
88
+ /** @internal */
89
+ export type EarnManageParams$Outbound = {
90
+ action_type: "V2_MANAGE";
91
+ venue: AaveVenue$Outbound | VaultVenue$Outbound;
92
+ action: string;
93
+ amount?: any | undefined;
94
+ };
95
+
96
+ /** @internal */
97
+ export const EarnManageParams$outboundSchema: z.ZodType<
98
+ EarnManageParams$Outbound,
99
+ z.ZodTypeDef,
100
+ EarnManageParams
101
+ > = z.object({
102
+ actionType: z.literal("V2_MANAGE"),
103
+ venue: z.union([AaveVenue$outboundSchema, VaultVenue$outboundSchema]),
104
+ action: EarnManageParamsAction$outboundSchema,
105
+ amount: z.any().optional(),
106
+ }).transform((v) => {
107
+ return remap$(v, {
108
+ actionType: "action_type",
109
+ });
110
+ });
111
+
112
+ export function earnManageParamsToJSON(
113
+ earnManageParams: EarnManageParams,
114
+ ): string {
115
+ return JSON.stringify(
116
+ EarnManageParams$outboundSchema.parse(earnManageParams),
117
+ );
118
+ }
@@ -21,7 +21,7 @@ import {
21
21
  /**
22
22
  * The earn venue.
23
23
  */
24
- export type Venue = AaveVenue | VaultVenue;
24
+ export type EarnManageRequestVenue = AaveVenue | VaultVenue;
25
25
 
26
26
  /**
27
27
  * Whether you are depositing into or withdrawing from the given Earn `venue`.
@@ -37,15 +37,18 @@ export type EarnManageRequestAction = ClosedEnum<
37
37
  typeof EarnManageRequestAction
38
38
  >;
39
39
 
40
+ /**
41
+ * Request model for the unified manage endpoint.
42
+ *
43
+ * @remarks
44
+ *
45
+ * Inherits from EarnManageParams and adds context fields (owner, chain, etc).
46
+ */
40
47
  export type EarnManageRequest = {
41
48
  /**
42
- * The primary wallet address that owns and controls the Earn Account.
43
- */
44
- owner: string;
45
- /**
46
- * The chain to use.
49
+ * Action type identifier for manage operations.
47
50
  */
48
- chain: Chain;
51
+ actionType?: "V2_MANAGE" | undefined;
49
52
  /**
50
53
  * The earn venue.
51
54
  */
@@ -55,9 +58,17 @@ export type EarnManageRequest = {
55
58
  */
56
59
  action: EarnManageRequestAction;
57
60
  /**
58
- * Amount of the underlying asset to act on (deposit or withdraw). For VAULT, this is the vaults underlying token; for AAVE, this is the Aave reserve asset. Provide as a decimal in token units (not wei); must be > 0.
61
+ * Amount of the underlying asset to act on (deposit or withdraw). For VAULT, this is the vault's underlying token; for AAVE, this is the Aave reserve asset. Provide as a decimal in token units (not wei); must be > 0.
59
62
  */
60
63
  amount?: any | undefined;
64
+ /**
65
+ * The primary wallet address that owns and controls the Earn Account.
66
+ */
67
+ owner: string;
68
+ /**
69
+ * The chain to use.
70
+ */
71
+ chain: Chain;
61
72
  /**
62
73
  * Optionally request gas sponsorship. If 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`).
63
74
  */
@@ -69,17 +80,23 @@ export type EarnManageRequest = {
69
80
  };
70
81
 
71
82
  /** @internal */
72
- export type Venue$Outbound = AaveVenue$Outbound | VaultVenue$Outbound;
83
+ export type EarnManageRequestVenue$Outbound =
84
+ | AaveVenue$Outbound
85
+ | VaultVenue$Outbound;
73
86
 
74
87
  /** @internal */
75
- export const Venue$outboundSchema: z.ZodType<
76
- Venue$Outbound,
88
+ export const EarnManageRequestVenue$outboundSchema: z.ZodType<
89
+ EarnManageRequestVenue$Outbound,
77
90
  z.ZodTypeDef,
78
- Venue
91
+ EarnManageRequestVenue
79
92
  > = z.union([AaveVenue$outboundSchema, VaultVenue$outboundSchema]);
80
93
 
81
- export function venueToJSON(venue: Venue): string {
82
- return JSON.stringify(Venue$outboundSchema.parse(venue));
94
+ export function earnManageRequestVenueToJSON(
95
+ earnManageRequestVenue: EarnManageRequestVenue,
96
+ ): string {
97
+ return JSON.stringify(
98
+ EarnManageRequestVenue$outboundSchema.parse(earnManageRequestVenue),
99
+ );
83
100
  }
84
101
 
85
102
  /** @internal */
@@ -89,11 +106,12 @@ export const EarnManageRequestAction$outboundSchema: z.ZodNativeEnum<
89
106
 
90
107
  /** @internal */
91
108
  export type EarnManageRequest$Outbound = {
92
- owner: string;
93
- chain: string;
109
+ action_type?: "V2_MANAGE" | undefined;
94
110
  venue: AaveVenue$Outbound | VaultVenue$Outbound;
95
111
  action: string;
96
112
  amount?: any | undefined;
113
+ owner: string;
114
+ chain: string;
97
115
  gas_sponsorship?: boolean | undefined;
98
116
  fee?: Fee$Outbound | null | undefined;
99
117
  };
@@ -104,15 +122,17 @@ export const EarnManageRequest$outboundSchema: z.ZodType<
104
122
  z.ZodTypeDef,
105
123
  EarnManageRequest
106
124
  > = z.object({
107
- owner: z.string(),
108
- chain: Chain$outboundSchema,
125
+ actionType: z.literal("V2_MANAGE").optional(),
109
126
  venue: z.union([AaveVenue$outboundSchema, VaultVenue$outboundSchema]),
110
127
  action: EarnManageRequestAction$outboundSchema,
111
128
  amount: z.any().optional(),
129
+ owner: z.string(),
130
+ chain: Chain$outboundSchema,
112
131
  gasSponsorship: z.boolean().optional(),
113
132
  fee: z.nullable(Fee$outboundSchema).optional(),
114
133
  }).transform((v) => {
115
134
  return remap$(v, {
135
+ actionType: "action_type",
116
136
  gasSponsorship: "gas_sponsorship",
117
137
  });
118
138
  });
@@ -0,0 +1,115 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+
8
+ /**
9
+ * Human-readable amount of `token_in` to swap (token units, not wei).
10
+ */
11
+ export type EarnSwapParamsAmountIn = number | string;
12
+
13
+ /**
14
+ * Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%).
15
+ */
16
+ export type EarnSwapParamsSlippage = number | string;
17
+
18
+ /**
19
+ * Parameters for swap operations (without context like owner/chain).
20
+ *
21
+ * @remarks
22
+ *
23
+ * Used by multicall/bundle endpoint to specify swap actions.
24
+ */
25
+ export type EarnSwapParams = {
26
+ /**
27
+ * Action type identifier for swap operations.
28
+ */
29
+ actionType: "V2_SWAP";
30
+ /**
31
+ * Token to sell (input). Provide a token symbol from a limited set (e.g., 'USDC') or any token address.
32
+ */
33
+ tokenIn: string;
34
+ /**
35
+ * Token to buy (output). Provide a token symbol from a limited set (e.g., 'USDT') or any token address.
36
+ */
37
+ tokenOut: string;
38
+ /**
39
+ * Human-readable amount of `token_in` to swap (token units, not wei).
40
+ */
41
+ amountIn: number | string;
42
+ /**
43
+ * Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%).
44
+ */
45
+ slippage?: number | string | undefined;
46
+ };
47
+
48
+ /** @internal */
49
+ export type EarnSwapParamsAmountIn$Outbound = number | string;
50
+
51
+ /** @internal */
52
+ export const EarnSwapParamsAmountIn$outboundSchema: z.ZodType<
53
+ EarnSwapParamsAmountIn$Outbound,
54
+ z.ZodTypeDef,
55
+ EarnSwapParamsAmountIn
56
+ > = z.union([z.number(), z.string()]);
57
+
58
+ export function earnSwapParamsAmountInToJSON(
59
+ earnSwapParamsAmountIn: EarnSwapParamsAmountIn,
60
+ ): string {
61
+ return JSON.stringify(
62
+ EarnSwapParamsAmountIn$outboundSchema.parse(earnSwapParamsAmountIn),
63
+ );
64
+ }
65
+
66
+ /** @internal */
67
+ export type EarnSwapParamsSlippage$Outbound = number | string;
68
+
69
+ /** @internal */
70
+ export const EarnSwapParamsSlippage$outboundSchema: z.ZodType<
71
+ EarnSwapParamsSlippage$Outbound,
72
+ z.ZodTypeDef,
73
+ EarnSwapParamsSlippage
74
+ > = z.union([z.number(), z.string()]);
75
+
76
+ export function earnSwapParamsSlippageToJSON(
77
+ earnSwapParamsSlippage: EarnSwapParamsSlippage,
78
+ ): string {
79
+ return JSON.stringify(
80
+ EarnSwapParamsSlippage$outboundSchema.parse(earnSwapParamsSlippage),
81
+ );
82
+ }
83
+
84
+ /** @internal */
85
+ export type EarnSwapParams$Outbound = {
86
+ action_type: "V2_SWAP";
87
+ token_in: string;
88
+ token_out: string;
89
+ amount_in: number | string;
90
+ slippage?: number | string | undefined;
91
+ };
92
+
93
+ /** @internal */
94
+ export const EarnSwapParams$outboundSchema: z.ZodType<
95
+ EarnSwapParams$Outbound,
96
+ z.ZodTypeDef,
97
+ EarnSwapParams
98
+ > = z.object({
99
+ actionType: z.literal("V2_SWAP"),
100
+ tokenIn: z.string(),
101
+ tokenOut: z.string(),
102
+ amountIn: z.union([z.number(), z.string()]),
103
+ slippage: z.union([z.number(), z.string()]).optional(),
104
+ }).transform((v) => {
105
+ return remap$(v, {
106
+ actionType: "action_type",
107
+ tokenIn: "token_in",
108
+ tokenOut: "token_out",
109
+ amountIn: "amount_in",
110
+ });
111
+ });
112
+
113
+ export function earnSwapParamsToJSON(earnSwapParams: EarnSwapParams): string {
114
+ return JSON.stringify(EarnSwapParams$outboundSchema.parse(earnSwapParams));
115
+ }
@@ -14,17 +14,20 @@ export type EarnSwapRequestAmountIn = number | string;
14
14
  /**
15
15
  * Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%).
16
16
  */
17
- export type Slippage = number | string;
17
+ export type EarnSwapRequestSlippage = number | string;
18
18
 
19
+ /**
20
+ * Request model for swap endpoint.
21
+ *
22
+ * @remarks
23
+ *
24
+ * Inherits swap params and adds context fields (owner, chain, gas_sponsorship).
25
+ */
19
26
  export type EarnSwapRequest = {
20
27
  /**
21
- * The owner's wallet address.
22
- */
23
- owner: string;
24
- /**
25
- * The chain to use.
28
+ * Action type identifier for swap operations.
26
29
  */
27
- chain: Chain;
30
+ actionType?: "V2_SWAP" | undefined;
28
31
  /**
29
32
  * Token to sell (input). Provide a token symbol from a limited set (e.g., 'USDC') or any token address.
30
33
  */
@@ -40,7 +43,15 @@ export type EarnSwapRequest = {
40
43
  /**
41
44
  * Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%).
42
45
  */
43
- slippage: number | string;
46
+ slippage?: number | string | undefined;
47
+ /**
48
+ * The owner's wallet address.
49
+ */
50
+ owner: string;
51
+ /**
52
+ * The chain to use.
53
+ */
54
+ chain: Chain;
44
55
  /**
45
56
  * Optionally request gas sponsorship. If `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`).
46
57
  */
@@ -66,27 +77,32 @@ export function earnSwapRequestAmountInToJSON(
66
77
  }
67
78
 
68
79
  /** @internal */
69
- export type Slippage$Outbound = number | string;
80
+ export type EarnSwapRequestSlippage$Outbound = number | string;
70
81
 
71
82
  /** @internal */
72
- export const Slippage$outboundSchema: z.ZodType<
73
- Slippage$Outbound,
83
+ export const EarnSwapRequestSlippage$outboundSchema: z.ZodType<
84
+ EarnSwapRequestSlippage$Outbound,
74
85
  z.ZodTypeDef,
75
- Slippage
86
+ EarnSwapRequestSlippage
76
87
  > = z.union([z.number(), z.string()]);
77
88
 
78
- export function slippageToJSON(slippage: Slippage): string {
79
- return JSON.stringify(Slippage$outboundSchema.parse(slippage));
89
+ export function earnSwapRequestSlippageToJSON(
90
+ earnSwapRequestSlippage: EarnSwapRequestSlippage,
91
+ ): string {
92
+ return JSON.stringify(
93
+ EarnSwapRequestSlippage$outboundSchema.parse(earnSwapRequestSlippage),
94
+ );
80
95
  }
81
96
 
82
97
  /** @internal */
83
98
  export type EarnSwapRequest$Outbound = {
84
- owner: string;
85
- chain: string;
99
+ action_type?: "V2_SWAP" | undefined;
86
100
  token_in: string;
87
101
  token_out: string;
88
102
  amount_in: number | string;
89
- slippage: number | string;
103
+ slippage?: number | string | undefined;
104
+ owner: string;
105
+ chain: string;
90
106
  gas_sponsorship?: boolean | undefined;
91
107
  };
92
108
 
@@ -96,15 +112,17 @@ export const EarnSwapRequest$outboundSchema: z.ZodType<
96
112
  z.ZodTypeDef,
97
113
  EarnSwapRequest
98
114
  > = z.object({
99
- owner: z.string(),
100
- chain: Chain$outboundSchema,
115
+ actionType: z.literal("V2_SWAP").optional(),
101
116
  tokenIn: z.string(),
102
117
  tokenOut: z.string(),
103
118
  amountIn: z.union([z.number(), z.string()]),
104
- slippage: z.union([z.number(), z.string()]),
119
+ slippage: z.union([z.number(), z.string()]).optional(),
120
+ owner: z.string(),
121
+ chain: Chain$outboundSchema,
105
122
  gasSponsorship: z.boolean().optional(),
106
123
  }).transform((v) => {
107
124
  return remap$(v, {
125
+ actionType: "action_type",
108
126
  tokenIn: "token_in",
109
127
  tokenOut: "token_out",
110
128
  amountIn: "amount_in",
@@ -81,10 +81,12 @@ export * from "./createaccountresponse.js";
81
81
  export * from "./depositforburnrequest.js";
82
82
  export * from "./depositforburnresponse.js";
83
83
  export * from "./details.js";
84
+ export * from "./earnmanageparams.js";
84
85
  export * from "./earnmanagerequest.js";
85
86
  export * from "./earnmanageresponse.js";
86
87
  export * from "./earnpositionresponse.js";
87
88
  export * from "./earnpositionsresponse.js";
89
+ export * from "./earnswapparams.js";
88
90
  export * from "./earnswaprequest.js";
89
91
  export * from "./earnswapresponse.js";
90
92
  export * from "./earntransferrequest.js";
@@ -223,6 +225,9 @@ export * from "./usageascollateral.js";
223
225
  export * from "./useroperation.js";
224
226
  export * from "./useroperationresponse.js";
225
227
  export * from "./userstate.js";
228
+ export * from "./v2bundlerequest.js";
229
+ export * from "./v2bundleresponse.js";
230
+ export * from "./v2useroperation.js";
226
231
  export * from "./validationerror.js";
227
232
  export * from "./vault.js";
228
233
  export * from "./vaultdepositparams.js";
@@ -194,7 +194,7 @@ import {
194
194
  WrapEthParams$outboundSchema,
195
195
  } from "./wrapethparams.js";
196
196
 
197
- export type Body =
197
+ export type UserOperationBody =
198
198
  | AaveBorrowParams
199
199
  | AaveRepayParams
200
200
  | AaveSupplyParams
@@ -277,7 +277,7 @@ export type UserOperation = {
277
277
  };
278
278
 
279
279
  /** @internal */
280
- export type Body$Outbound =
280
+ export type UserOperationBody$Outbound =
281
281
  | AaveBorrowParams$Outbound
282
282
  | AaveRepayParams$Outbound
283
283
  | AaveSupplyParams$Outbound
@@ -318,50 +318,57 @@ export type Body$Outbound =
318
318
  | WrapEthParams$Outbound;
319
319
 
320
320
  /** @internal */
321
- export const Body$outboundSchema: z.ZodType<Body$Outbound, z.ZodTypeDef, Body> =
322
- z.union([
323
- AaveBorrowParams$outboundSchema,
324
- AaveRepayParams$outboundSchema,
325
- AaveSupplyParams$outboundSchema,
326
- AaveWithdrawParams$outboundSchema,
327
- AerodromeSlipstreamBuyExactlyParams$outboundSchema,
328
- AerodromeSlipstreamIncreaseLiquidityProvisionParams$outboundSchema,
329
- AerodromeSlipstreamMintLiquidityProvisionParams$outboundSchema,
330
- AerodromeSlipstreamSellExactlyParams$outboundSchema,
331
- AerodromeSlipstreamWithdrawLiquidityProvisionParams$outboundSchema,
332
- EthenaDepositParams$outboundSchema,
333
- EthenaRequestToWithdrawParams$outboundSchema,
334
- EthenaUnstakeParams$outboundSchema,
335
- MorphoBorrowParams$outboundSchema,
336
- MorphoDepositParams$outboundSchema,
337
- MorphoRepayParams$outboundSchema,
338
- MorphoSupplyCollateralParams$outboundSchema,
339
- MorphoWithdrawParams$outboundSchema,
340
- MorphoWithdrawCollateralParams$outboundSchema,
341
- OdosSwapParams$outboundSchema,
342
- PendleManageLiquidityParams$outboundSchema,
343
- PendleRedeemYieldParams$outboundSchema,
344
- PendleTradePtParams$outboundSchema,
345
- PendleTradeYtParams$outboundSchema,
346
- SetAllowanceParams$outboundSchema,
347
- SkyBuyParams$outboundSchema,
348
- SkyDepositParams$outboundSchema,
349
- SkySellParams$outboundSchema,
350
- SkyWithdrawParams$outboundSchema,
351
- TokenTransferParams$outboundSchema,
352
- UniswapIncreaseLiquidityProvisionParams$outboundSchema,
353
- UniswapBuyExactlyParams$outboundSchema,
354
- UniswapMintLiquidityProvisionParams$outboundSchema,
355
- UniswapSellExactlyParams$outboundSchema,
356
- UniswapWithdrawLiquidityProvisionParams$outboundSchema,
357
- UnwrapWethParams$outboundSchema,
358
- VaultDepositParams$outboundSchema,
359
- VaultWithdrawParams$outboundSchema,
360
- WrapEthParams$outboundSchema,
361
- ]);
321
+ export const UserOperationBody$outboundSchema: z.ZodType<
322
+ UserOperationBody$Outbound,
323
+ z.ZodTypeDef,
324
+ UserOperationBody
325
+ > = z.union([
326
+ AaveBorrowParams$outboundSchema,
327
+ AaveRepayParams$outboundSchema,
328
+ AaveSupplyParams$outboundSchema,
329
+ AaveWithdrawParams$outboundSchema,
330
+ AerodromeSlipstreamBuyExactlyParams$outboundSchema,
331
+ AerodromeSlipstreamIncreaseLiquidityProvisionParams$outboundSchema,
332
+ AerodromeSlipstreamMintLiquidityProvisionParams$outboundSchema,
333
+ AerodromeSlipstreamSellExactlyParams$outboundSchema,
334
+ AerodromeSlipstreamWithdrawLiquidityProvisionParams$outboundSchema,
335
+ EthenaDepositParams$outboundSchema,
336
+ EthenaRequestToWithdrawParams$outboundSchema,
337
+ EthenaUnstakeParams$outboundSchema,
338
+ MorphoBorrowParams$outboundSchema,
339
+ MorphoDepositParams$outboundSchema,
340
+ MorphoRepayParams$outboundSchema,
341
+ MorphoSupplyCollateralParams$outboundSchema,
342
+ MorphoWithdrawParams$outboundSchema,
343
+ MorphoWithdrawCollateralParams$outboundSchema,
344
+ OdosSwapParams$outboundSchema,
345
+ PendleManageLiquidityParams$outboundSchema,
346
+ PendleRedeemYieldParams$outboundSchema,
347
+ PendleTradePtParams$outboundSchema,
348
+ PendleTradeYtParams$outboundSchema,
349
+ SetAllowanceParams$outboundSchema,
350
+ SkyBuyParams$outboundSchema,
351
+ SkyDepositParams$outboundSchema,
352
+ SkySellParams$outboundSchema,
353
+ SkyWithdrawParams$outboundSchema,
354
+ TokenTransferParams$outboundSchema,
355
+ UniswapIncreaseLiquidityProvisionParams$outboundSchema,
356
+ UniswapBuyExactlyParams$outboundSchema,
357
+ UniswapMintLiquidityProvisionParams$outboundSchema,
358
+ UniswapSellExactlyParams$outboundSchema,
359
+ UniswapWithdrawLiquidityProvisionParams$outboundSchema,
360
+ UnwrapWethParams$outboundSchema,
361
+ VaultDepositParams$outboundSchema,
362
+ VaultWithdrawParams$outboundSchema,
363
+ WrapEthParams$outboundSchema,
364
+ ]);
362
365
 
363
- export function bodyToJSON(body: Body): string {
364
- return JSON.stringify(Body$outboundSchema.parse(body));
366
+ export function userOperationBodyToJSON(
367
+ userOperationBody: UserOperationBody,
368
+ ): string {
369
+ return JSON.stringify(
370
+ UserOperationBody$outboundSchema.parse(userOperationBody),
371
+ );
365
372
  }
366
373
 
367
374
  /** @internal */
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { Chain, Chain$outboundSchema } from "./chain.js";
8
+ import {
9
+ V2UserOperation,
10
+ V2UserOperation$Outbound,
11
+ V2UserOperation$outboundSchema,
12
+ } from "./v2useroperation.js";
13
+
14
+ /**
15
+ * Request model for bundling multiple V2 earn actions into a single Safe
16
+ *
17
+ * @remarks
18
+ * transaction.
19
+ *
20
+ * This endpoint allows combining multiple actions (swaps, vault deposits/withdrawals,
21
+ * Aave deposits/withdrawals) into a single atomic transaction executed Compass Account.
22
+ *
23
+ * Example use case: Swap USDC to AUSD, then deposit AUSD into a vault - all in one tx.
24
+ */
25
+ export type V2BundleRequest = {
26
+ /**
27
+ * The owner's wallet address that controls the Earn Account (Safe).
28
+ */
29
+ owner: string;
30
+ /**
31
+ * The chain to use.
32
+ */
33
+ chain: Chain;
34
+ /**
35
+ * List of actions to bundle. Actions are executed in order.
36
+ */
37
+ actions: Array<V2UserOperation>;
38
+ /**
39
+ * If true, returns EIP-712 typed data for gas sponsorship. The owner must sign this data and submit to /gas_sponsorship/prepare.
40
+ */
41
+ gasSponsorship?: boolean | undefined;
42
+ };
43
+
44
+ /** @internal */
45
+ export type V2BundleRequest$Outbound = {
46
+ owner: string;
47
+ chain: string;
48
+ actions: Array<V2UserOperation$Outbound>;
49
+ gas_sponsorship?: boolean | undefined;
50
+ };
51
+
52
+ /** @internal */
53
+ export const V2BundleRequest$outboundSchema: z.ZodType<
54
+ V2BundleRequest$Outbound,
55
+ z.ZodTypeDef,
56
+ V2BundleRequest
57
+ > = z.object({
58
+ owner: z.string(),
59
+ chain: Chain$outboundSchema,
60
+ actions: z.array(V2UserOperation$outboundSchema),
61
+ gasSponsorship: z.boolean().optional(),
62
+ }).transform((v) => {
63
+ return remap$(v, {
64
+ gasSponsorship: "gas_sponsorship",
65
+ });
66
+ });
67
+
68
+ export function v2BundleRequestToJSON(
69
+ v2BundleRequest: V2BundleRequest,
70
+ ): string {
71
+ return JSON.stringify(V2BundleRequest$outboundSchema.parse(v2BundleRequest));
72
+ }