@compass-labs/api-sdk 2.1.9 → 2.1.10-rc.3

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 (134) hide show
  1. package/README.md +7 -0
  2. package/dist/commonjs/funcs/cctpCCTPBurn.d.ts +43 -0
  3. package/dist/commonjs/funcs/cctpCCTPBurn.d.ts.map +1 -0
  4. package/dist/commonjs/funcs/cctpCCTPBurn.js +143 -0
  5. package/dist/commonjs/funcs/cctpCCTPBurn.js.map +1 -0
  6. package/dist/commonjs/funcs/cctpCCTPMint.d.ts +52 -0
  7. package/dist/commonjs/funcs/cctpCCTPMint.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/cctpCCTPMint.js +152 -0
  9. package/dist/commonjs/funcs/cctpCCTPMint.js.map +1 -0
  10. package/dist/commonjs/lib/config.d.ts +2 -2
  11. package/dist/commonjs/lib/config.js +2 -2
  12. package/dist/commonjs/lib/encodings.d.ts +1 -0
  13. package/dist/commonjs/lib/encodings.d.ts.map +1 -1
  14. package/dist/commonjs/lib/encodings.js +9 -0
  15. package/dist/commonjs/lib/encodings.js.map +1 -1
  16. package/dist/commonjs/models/components/depositforburnrequest.d.ts +109 -0
  17. package/dist/commonjs/models/components/depositforburnrequest.d.ts.map +1 -0
  18. package/dist/commonjs/models/components/depositforburnrequest.js +96 -0
  19. package/dist/commonjs/models/components/depositforburnrequest.js.map +1 -0
  20. package/dist/commonjs/models/components/depositforburnresponse.d.ts +66 -0
  21. package/dist/commonjs/models/components/depositforburnresponse.d.ts.map +1 -0
  22. package/dist/commonjs/models/components/depositforburnresponse.js +74 -0
  23. package/dist/commonjs/models/components/depositforburnresponse.js.map +1 -0
  24. package/dist/commonjs/models/components/index.d.ts +5 -0
  25. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/index.js +5 -0
  27. package/dist/commonjs/models/components/index.js.map +1 -1
  28. package/dist/commonjs/models/components/mintpreparependingresponse.d.ts +43 -0
  29. package/dist/commonjs/models/components/mintpreparependingresponse.d.ts.map +1 -0
  30. package/dist/commonjs/models/components/mintpreparependingresponse.js +64 -0
  31. package/dist/commonjs/models/components/mintpreparependingresponse.js.map +1 -0
  32. package/dist/commonjs/models/components/mintpreparereadyresponse.d.ts +41 -0
  33. package/dist/commonjs/models/components/mintpreparereadyresponse.d.ts.map +1 -0
  34. package/dist/commonjs/models/components/mintpreparereadyresponse.js +64 -0
  35. package/dist/commonjs/models/components/mintpreparereadyresponse.js.map +1 -0
  36. package/dist/commonjs/models/components/mintpreparerequest.d.ts +39 -0
  37. package/dist/commonjs/models/components/mintpreparerequest.d.ts.map +1 -0
  38. package/dist/commonjs/models/components/mintpreparerequest.js +57 -0
  39. package/dist/commonjs/models/components/mintpreparerequest.js.map +1 -0
  40. package/dist/commonjs/models/operations/index.d.ts +1 -0
  41. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  42. package/dist/commonjs/models/operations/index.js +1 -0
  43. package/dist/commonjs/models/operations/index.js.map +1 -1
  44. package/dist/commonjs/models/operations/v2cctpmint.d.ts +9 -0
  45. package/dist/commonjs/models/operations/v2cctpmint.d.ts.map +1 -0
  46. package/dist/commonjs/models/operations/v2cctpmint.js +52 -0
  47. package/dist/commonjs/models/operations/v2cctpmint.js.map +1 -0
  48. package/dist/commonjs/sdk/cctp.d.ts +78 -0
  49. package/dist/commonjs/sdk/cctp.d.ts.map +1 -0
  50. package/dist/commonjs/sdk/cctp.js +90 -0
  51. package/dist/commonjs/sdk/cctp.js.map +1 -0
  52. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  53. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  54. package/dist/commonjs/sdk/sdk.js +4 -0
  55. package/dist/commonjs/sdk/sdk.js.map +1 -1
  56. package/dist/commonjs/types/unrecognized.d.ts +7 -1
  57. package/dist/commonjs/types/unrecognized.d.ts.map +1 -1
  58. package/dist/commonjs/types/unrecognized.js +9 -1
  59. package/dist/commonjs/types/unrecognized.js.map +1 -1
  60. package/dist/esm/funcs/cctpCCTPBurn.d.ts +43 -0
  61. package/dist/esm/funcs/cctpCCTPBurn.d.ts.map +1 -0
  62. package/dist/esm/funcs/cctpCCTPBurn.js +107 -0
  63. package/dist/esm/funcs/cctpCCTPBurn.js.map +1 -0
  64. package/dist/esm/funcs/cctpCCTPMint.d.ts +52 -0
  65. package/dist/esm/funcs/cctpCCTPMint.d.ts.map +1 -0
  66. package/dist/esm/funcs/cctpCCTPMint.js +116 -0
  67. package/dist/esm/funcs/cctpCCTPMint.js.map +1 -0
  68. package/dist/esm/lib/config.d.ts +2 -2
  69. package/dist/esm/lib/config.js +2 -2
  70. package/dist/esm/lib/encodings.d.ts +1 -0
  71. package/dist/esm/lib/encodings.d.ts.map +1 -1
  72. package/dist/esm/lib/encodings.js +9 -0
  73. package/dist/esm/lib/encodings.js.map +1 -1
  74. package/dist/esm/models/components/depositforburnrequest.d.ts +109 -0
  75. package/dist/esm/models/components/depositforburnrequest.d.ts.map +1 -0
  76. package/dist/esm/models/components/depositforburnrequest.js +58 -0
  77. package/dist/esm/models/components/depositforburnrequest.js.map +1 -0
  78. package/dist/esm/models/components/depositforburnresponse.d.ts +66 -0
  79. package/dist/esm/models/components/depositforburnresponse.d.ts.map +1 -0
  80. package/dist/esm/models/components/depositforburnresponse.js +37 -0
  81. package/dist/esm/models/components/depositforburnresponse.js.map +1 -0
  82. package/dist/esm/models/components/index.d.ts +5 -0
  83. package/dist/esm/models/components/index.d.ts.map +1 -1
  84. package/dist/esm/models/components/index.js +5 -0
  85. package/dist/esm/models/components/index.js.map +1 -1
  86. package/dist/esm/models/components/mintpreparependingresponse.d.ts +43 -0
  87. package/dist/esm/models/components/mintpreparependingresponse.d.ts.map +1 -0
  88. package/dist/esm/models/components/mintpreparependingresponse.js +27 -0
  89. package/dist/esm/models/components/mintpreparependingresponse.js.map +1 -0
  90. package/dist/esm/models/components/mintpreparereadyresponse.d.ts +41 -0
  91. package/dist/esm/models/components/mintpreparereadyresponse.d.ts.map +1 -0
  92. package/dist/esm/models/components/mintpreparereadyresponse.js +27 -0
  93. package/dist/esm/models/components/mintpreparereadyresponse.js.map +1 -0
  94. package/dist/esm/models/components/mintpreparerequest.d.ts +39 -0
  95. package/dist/esm/models/components/mintpreparerequest.d.ts.map +1 -0
  96. package/dist/esm/models/components/mintpreparerequest.js +20 -0
  97. package/dist/esm/models/components/mintpreparerequest.js.map +1 -0
  98. package/dist/esm/models/operations/index.d.ts +1 -0
  99. package/dist/esm/models/operations/index.d.ts.map +1 -1
  100. package/dist/esm/models/operations/index.js +1 -0
  101. package/dist/esm/models/operations/index.js.map +1 -1
  102. package/dist/esm/models/operations/v2cctpmint.d.ts +9 -0
  103. package/dist/esm/models/operations/v2cctpmint.d.ts.map +1 -0
  104. package/dist/esm/models/operations/v2cctpmint.js +15 -0
  105. package/dist/esm/models/operations/v2cctpmint.js.map +1 -0
  106. package/dist/esm/sdk/cctp.d.ts +78 -0
  107. package/dist/esm/sdk/cctp.d.ts.map +1 -0
  108. package/dist/esm/sdk/cctp.js +86 -0
  109. package/dist/esm/sdk/cctp.js.map +1 -0
  110. package/dist/esm/sdk/sdk.d.ts +3 -0
  111. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  112. package/dist/esm/sdk/sdk.js +4 -0
  113. package/dist/esm/sdk/sdk.js.map +1 -1
  114. package/dist/esm/types/unrecognized.d.ts +7 -1
  115. package/dist/esm/types/unrecognized.d.ts.map +1 -1
  116. package/dist/esm/types/unrecognized.js +9 -1
  117. package/dist/esm/types/unrecognized.js.map +1 -1
  118. package/package.json +1 -1
  119. package/src/funcs/cctpCCTPBurn.ts +194 -0
  120. package/src/funcs/cctpCCTPMint.ts +204 -0
  121. package/src/lib/config.ts +2 -2
  122. package/src/lib/encodings.ts +13 -0
  123. package/src/models/components/depositforburnrequest.ts +172 -0
  124. package/src/models/components/depositforburnresponse.ts +112 -0
  125. package/src/models/components/index.ts +5 -0
  126. package/src/models/components/mintpreparependingresponse.ts +78 -0
  127. package/src/models/components/mintpreparereadyresponse.ts +80 -0
  128. package/src/models/components/mintpreparerequest.ts +66 -0
  129. package/src/models/operations/index.ts +1 -0
  130. package/src/models/operations/v2cctpmint.ts +33 -0
  131. package/src/sdk/cctp.ts +104 -0
  132. package/src/sdk/sdk.ts +6 -0
  133. package/src/types/unrecognized.ts +9 -1
  134. package/tsconfig.json +0 -1
@@ -0,0 +1,172 @@
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
+
9
+ /**
10
+ * The source chain where USDC will be burned.
11
+ */
12
+ export const DepositForBurnRequestChain = {
13
+ Ethereum: "ethereum",
14
+ Arbitrum: "arbitrum",
15
+ Base: "base",
16
+ } as const;
17
+ /**
18
+ * The source chain where USDC will be burned.
19
+ */
20
+ export type DepositForBurnRequestChain = ClosedEnum<
21
+ typeof DepositForBurnRequestChain
22
+ >;
23
+
24
+ /**
25
+ * The amount of USDC to bridge (in token units, e.g., 100.5 for 100.5 USDC).
26
+ */
27
+ export type DepositForBurnRequestAmount = number | string;
28
+
29
+ /**
30
+ * The destination chain where USDC will be minted.
31
+ */
32
+ export const DestinationChain = {
33
+ Ethereum: "ethereum",
34
+ Arbitrum: "arbitrum",
35
+ Base: "base",
36
+ } as const;
37
+ /**
38
+ * The destination chain where USDC will be minted.
39
+ */
40
+ export type DestinationChain = ClosedEnum<typeof DestinationChain>;
41
+
42
+ /**
43
+ * Transfer speed mode. 'fast': ~30 second transfers using confirmed finality (requires a small fee taken from transfer amount). 'standard': ~15-19 minute transfers using full finality (free, no fee). Default is 'standard'.
44
+ */
45
+ export const DepositForBurnRequestTransferMode = {
46
+ Fast: "fast",
47
+ Standard: "standard",
48
+ } as const;
49
+ /**
50
+ * Transfer speed mode. 'fast': ~30 second transfers using confirmed finality (requires a small fee taken from transfer amount). 'standard': ~15-19 minute transfers using full finality (free, no fee). Default is 'standard'.
51
+ */
52
+ export type DepositForBurnRequestTransferMode = ClosedEnum<
53
+ typeof DepositForBurnRequestTransferMode
54
+ >;
55
+
56
+ /**
57
+ * Request model for CCTP depositForBurn transaction from a smart account.
58
+ *
59
+ * @remarks
60
+ *
61
+ * Burns USDC from an Earn Account (Safe) to initiate a cross-chain transfer
62
+ * via Circle's CCTP. The transaction is executed through the Safe contract,
63
+ * supporting both direct owner execution and gas-sponsored transactions.
64
+ *
65
+ * Flow:
66
+ * 1. Owner calls this endpoint to get either:
67
+ * - An unsigned transaction (gas_sponsorship=False)
68
+ * - EIP-712 typed data for signing (gas_sponsorship=True)
69
+ * 2. Owner signs the transaction/typed data
70
+ * 3. Transaction is broadcast on source chain
71
+ * 4. Wait for Circle's attestation service
72
+ * 5. Call receiveMessage on destination chain to mint USDC
73
+ */
74
+ export type DepositForBurnRequest = {
75
+ /**
76
+ * The primary wallet address that owns and controls the Earn Account (Safe).
77
+ */
78
+ owner: string;
79
+ /**
80
+ * The source chain where USDC will be burned.
81
+ */
82
+ chain: DepositForBurnRequestChain;
83
+ /**
84
+ * The amount of USDC to bridge (in token units, e.g., 100.5 for 100.5 USDC).
85
+ */
86
+ amount: number | string;
87
+ /**
88
+ * The destination chain where USDC will be minted.
89
+ */
90
+ destinationChain: DestinationChain;
91
+ /**
92
+ * 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`).
93
+ */
94
+ gasSponsorship?: boolean | undefined;
95
+ /**
96
+ * Transfer speed mode. 'fast': ~30 second transfers using confirmed finality (requires a small fee taken from transfer amount). 'standard': ~15-19 minute transfers using full finality (free, no fee). Default is 'standard'.
97
+ */
98
+ transferMode?: DepositForBurnRequestTransferMode | undefined;
99
+ };
100
+
101
+ /** @internal */
102
+ export const DepositForBurnRequestChain$outboundSchema: z.ZodNativeEnum<
103
+ typeof DepositForBurnRequestChain
104
+ > = z.nativeEnum(DepositForBurnRequestChain);
105
+
106
+ /** @internal */
107
+ export type DepositForBurnRequestAmount$Outbound = number | string;
108
+
109
+ /** @internal */
110
+ export const DepositForBurnRequestAmount$outboundSchema: z.ZodType<
111
+ DepositForBurnRequestAmount$Outbound,
112
+ z.ZodTypeDef,
113
+ DepositForBurnRequestAmount
114
+ > = z.union([z.number(), z.string()]);
115
+
116
+ export function depositForBurnRequestAmountToJSON(
117
+ depositForBurnRequestAmount: DepositForBurnRequestAmount,
118
+ ): string {
119
+ return JSON.stringify(
120
+ DepositForBurnRequestAmount$outboundSchema.parse(
121
+ depositForBurnRequestAmount,
122
+ ),
123
+ );
124
+ }
125
+
126
+ /** @internal */
127
+ export const DestinationChain$outboundSchema: z.ZodNativeEnum<
128
+ typeof DestinationChain
129
+ > = z.nativeEnum(DestinationChain);
130
+
131
+ /** @internal */
132
+ export const DepositForBurnRequestTransferMode$outboundSchema: z.ZodNativeEnum<
133
+ typeof DepositForBurnRequestTransferMode
134
+ > = z.nativeEnum(DepositForBurnRequestTransferMode);
135
+
136
+ /** @internal */
137
+ export type DepositForBurnRequest$Outbound = {
138
+ owner: string;
139
+ chain: string;
140
+ amount: number | string;
141
+ destination_chain: string;
142
+ gas_sponsorship?: boolean | undefined;
143
+ transfer_mode?: string | undefined;
144
+ };
145
+
146
+ /** @internal */
147
+ export const DepositForBurnRequest$outboundSchema: z.ZodType<
148
+ DepositForBurnRequest$Outbound,
149
+ z.ZodTypeDef,
150
+ DepositForBurnRequest
151
+ > = z.object({
152
+ owner: z.string(),
153
+ chain: DepositForBurnRequestChain$outboundSchema,
154
+ amount: z.union([z.number(), z.string()]),
155
+ destinationChain: DestinationChain$outboundSchema,
156
+ gasSponsorship: z.boolean().optional(),
157
+ transferMode: DepositForBurnRequestTransferMode$outboundSchema.optional(),
158
+ }).transform((v) => {
159
+ return remap$(v, {
160
+ destinationChain: "destination_chain",
161
+ gasSponsorship: "gas_sponsorship",
162
+ transferMode: "transfer_mode",
163
+ });
164
+ });
165
+
166
+ export function depositForBurnRequestToJSON(
167
+ depositForBurnRequest: DepositForBurnRequest,
168
+ ): string {
169
+ return JSON.stringify(
170
+ DepositForBurnRequest$outboundSchema.parse(depositForBurnRequest),
171
+ );
172
+ }
@@ -0,0 +1,112 @@
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 { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import {
12
+ BatchedSafeOperationsResponseOutput,
13
+ BatchedSafeOperationsResponseOutput$inboundSchema,
14
+ } from "./batchedsafeoperationsresponseoutput.js";
15
+ import {
16
+ UnsignedTransaction,
17
+ UnsignedTransaction$inboundSchema,
18
+ } from "./unsignedtransaction.js";
19
+
20
+ /**
21
+ * The transfer speed mode used. 'fast' uses confirmed finality (~30s), 'standard' uses full finality (~15-19 min).
22
+ */
23
+ export const DepositForBurnResponseTransferMode = {
24
+ Fast: "fast",
25
+ Standard: "standard",
26
+ } as const;
27
+ /**
28
+ * The transfer speed mode used. 'fast' uses confirmed finality (~30s), 'standard' uses full finality (~15-19 min).
29
+ */
30
+ export type DepositForBurnResponseTransferMode = ClosedEnum<
31
+ typeof DepositForBurnResponseTransferMode
32
+ >;
33
+
34
+ /**
35
+ * Response model for CCTP depositForBurn transaction from a smart account.
36
+ *
37
+ * @remarks
38
+ *
39
+ * Contains either an unsigned transaction for direct submission or EIP-712 typed
40
+ * data for gas-sponsored transactions. Also includes a bridge_id for tracking
41
+ * the cross-chain transfer.
42
+ *
43
+ * Attributes:
44
+ * bridge_id: Unique identifier for this bridge operation. Use this ID when
45
+ * calling /mint/prepare to complete the cross-chain transfer. The API
46
+ * tracks the bridge state and will automatically poll for Circle's
47
+ * attestation.
48
+ * transaction: Unsigned transaction for the owner to sign and submit directly.
49
+ * Present when gas_sponsorship=False.
50
+ * eip_712: EIP-712 typed data for off-chain signing. The owner signs this
51
+ * data and submits it to /gas_sponsorship/prepare for a relayer to execute.
52
+ * Present when gas_sponsorship=True.
53
+ * transfer_mode: The transfer speed mode used for this bridge operation.
54
+ * fee: Fee amount in USDC (only charged for fast mode, None for standard).
55
+ * estimated_time_seconds: Estimated time to complete the bridge in seconds.
56
+ */
57
+ export type DepositForBurnResponse = {
58
+ /**
59
+ * Unique bridge identifier for tracking this cross-chain transfer. Use this ID when calling /mint/prepare to complete the transfer. Only present when Redis is configured on the server.
60
+ */
61
+ bridgeId?: string | null | undefined;
62
+ transaction: UnsignedTransaction | null;
63
+ eip712: BatchedSafeOperationsResponseOutput | null;
64
+ /**
65
+ * The transfer speed mode used. 'fast' uses confirmed finality (~30s), 'standard' uses full finality (~15-19 min).
66
+ */
67
+ transferMode: DepositForBurnResponseTransferMode;
68
+ /**
69
+ * Fee amount in USDC charged for this transfer. Only present for fast mode. Standard mode transfers are free (fee is None or 0).
70
+ */
71
+ fee?: string | null | undefined;
72
+ /**
73
+ * Estimated time to complete the bridge in seconds.
74
+ */
75
+ estimatedTimeSeconds: number;
76
+ };
77
+
78
+ /** @internal */
79
+ export const DepositForBurnResponseTransferMode$inboundSchema: z.ZodNativeEnum<
80
+ typeof DepositForBurnResponseTransferMode
81
+ > = z.nativeEnum(DepositForBurnResponseTransferMode);
82
+
83
+ /** @internal */
84
+ export const DepositForBurnResponse$inboundSchema: z.ZodType<
85
+ DepositForBurnResponse,
86
+ z.ZodTypeDef,
87
+ unknown
88
+ > = z.object({
89
+ bridge_id: z.nullable(z.string()).optional(),
90
+ transaction: z.nullable(UnsignedTransaction$inboundSchema),
91
+ eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema),
92
+ transfer_mode: DepositForBurnResponseTransferMode$inboundSchema,
93
+ fee: z.nullable(z.string()).optional(),
94
+ estimated_time_seconds: z.number().int(),
95
+ }).transform((v) => {
96
+ return remap$(v, {
97
+ "bridge_id": "bridgeId",
98
+ "eip_712": "eip712",
99
+ "transfer_mode": "transferMode",
100
+ "estimated_time_seconds": "estimatedTimeSeconds",
101
+ });
102
+ });
103
+
104
+ export function depositForBurnResponseFromJSON(
105
+ jsonString: string,
106
+ ): SafeParseResult<DepositForBurnResponse, SDKValidationError> {
107
+ return safeParse(
108
+ jsonString,
109
+ (x) => DepositForBurnResponse$inboundSchema.parse(JSON.parse(x)),
110
+ `Failed to parse 'DepositForBurnResponse' from JSON`,
111
+ );
112
+ }
@@ -78,6 +78,8 @@ export * from "./compassapibackendv2modelssafetransactresponsebatchedsafeoperati
78
78
  export * from "./cooldownposition.js";
79
79
  export * from "./createaccountrequest.js";
80
80
  export * from "./createaccountresponse.js";
81
+ export * from "./depositforburnrequest.js";
82
+ export * from "./depositforburnresponse.js";
81
83
  export * from "./details.js";
82
84
  export * from "./earnmanagerequest.js";
83
85
  export * from "./earnmanageresponse.js";
@@ -108,6 +110,9 @@ export * from "./market.js";
108
110
  export * from "./marketposition.js";
109
111
  export * from "./markettokens.js";
110
112
  export * from "./maxsupplyapydata.js";
113
+ export * from "./mintpreparependingresponse.js";
114
+ export * from "./mintpreparereadyresponse.js";
115
+ export * from "./mintpreparerequest.js";
111
116
  export * from "./morphoborrowparams.js";
112
117
  export * from "./morphoborrowrequest.js";
113
118
  export * from "./morphocheckmarketpositionresponse.js";
@@ -0,0 +1,78 @@
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 { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Response when attestation is not yet ready.
13
+ *
14
+ * @remarks
15
+ *
16
+ * Returned with 202 Accepted status code. The client should either:
17
+ * - Connect to the SSE stream for real-time updates
18
+ * - Poll the status endpoint periodically
19
+ * - Call /mint/prepare again after some time
20
+ */
21
+ export type MintPreparePendingResponse = {
22
+ /**
23
+ * Indicates the attestation is still being awaited.
24
+ */
25
+ status?: "pending" | undefined;
26
+ /**
27
+ * The bridge identifier.
28
+ */
29
+ bridgeId: string;
30
+ /**
31
+ * The CCTP message hash being polled for attestation.
32
+ */
33
+ messageHash: string;
34
+ /**
35
+ * SSE endpoint URL for real-time attestation updates.
36
+ */
37
+ sseUrl: string;
38
+ /**
39
+ * HTTP endpoint URL for polling bridge status.
40
+ */
41
+ statusUrl: string;
42
+ /**
43
+ * Estimated wait time in seconds. Fast mode is typically ~30 seconds, standard mode is 15-19 minutes.
44
+ */
45
+ estimatedWaitSeconds: number;
46
+ };
47
+
48
+ /** @internal */
49
+ export const MintPreparePendingResponse$inboundSchema: z.ZodType<
50
+ MintPreparePendingResponse,
51
+ z.ZodTypeDef,
52
+ unknown
53
+ > = z.object({
54
+ status: z.literal("pending").default("pending").optional(),
55
+ bridge_id: z.string(),
56
+ message_hash: z.string(),
57
+ sse_url: z.string(),
58
+ status_url: z.string(),
59
+ estimated_wait_seconds: z.number().int(),
60
+ }).transform((v) => {
61
+ return remap$(v, {
62
+ "bridge_id": "bridgeId",
63
+ "message_hash": "messageHash",
64
+ "sse_url": "sseUrl",
65
+ "status_url": "statusUrl",
66
+ "estimated_wait_seconds": "estimatedWaitSeconds",
67
+ });
68
+ });
69
+
70
+ export function mintPreparePendingResponseFromJSON(
71
+ jsonString: string,
72
+ ): SafeParseResult<MintPreparePendingResponse, SDKValidationError> {
73
+ return safeParse(
74
+ jsonString,
75
+ (x) => MintPreparePendingResponse$inboundSchema.parse(JSON.parse(x)),
76
+ `Failed to parse 'MintPreparePendingResponse' from JSON`,
77
+ );
78
+ }
@@ -0,0 +1,80 @@
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 { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ BatchedSafeOperationsResponseOutput,
12
+ BatchedSafeOperationsResponseOutput$inboundSchema,
13
+ } from "./batchedsafeoperationsresponseoutput.js";
14
+ import {
15
+ UnsignedTransaction,
16
+ UnsignedTransaction$inboundSchema,
17
+ } from "./unsignedtransaction.js";
18
+
19
+ /**
20
+ * Response when attestation is ready and mint transaction can be built.
21
+ *
22
+ * @remarks
23
+ *
24
+ * Returned with 200 OK status code. Contains either an unsigned transaction for direct
25
+ * submission or EIP-712 typed data for gas-sponsored transactions. The transaction
26
+ * calls receiveMessage on the MessageTransmitter contract through the Earn Account
27
+ * (Safe).
28
+ */
29
+ export type MintPrepareReadyResponse = {
30
+ /**
31
+ * Indicates the attestation is ready and mint transaction is available.
32
+ */
33
+ status?: "ready" | undefined;
34
+ /**
35
+ * The bridge identifier.
36
+ */
37
+ bridgeId: string;
38
+ /**
39
+ * Unsigned Safe execTransaction for the destination chain that calls receiveMessage on the MessageTransmitter contract. Sign and broadcast this to mint USDC to your Earn Account. Present when gas_sponsorship=False.
40
+ */
41
+ transaction?: UnsignedTransaction | null | undefined;
42
+ /**
43
+ * EIP-712 typed data for off-chain signing. The owner signs this data and submits it to /gas_sponsorship/prepare for a relayer to execute. Present when gas_sponsorship=True.
44
+ */
45
+ eip712?: BatchedSafeOperationsResponseOutput | null | undefined;
46
+ /**
47
+ * The CCTP message hash used to obtain the attestation.
48
+ */
49
+ messageHash: string;
50
+ };
51
+
52
+ /** @internal */
53
+ export const MintPrepareReadyResponse$inboundSchema: z.ZodType<
54
+ MintPrepareReadyResponse,
55
+ z.ZodTypeDef,
56
+ unknown
57
+ > = z.object({
58
+ status: z.literal("ready").default("ready").optional(),
59
+ bridge_id: z.string(),
60
+ transaction: z.nullable(UnsignedTransaction$inboundSchema).optional(),
61
+ eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema)
62
+ .optional(),
63
+ message_hash: z.string(),
64
+ }).transform((v) => {
65
+ return remap$(v, {
66
+ "bridge_id": "bridgeId",
67
+ "eip_712": "eip712",
68
+ "message_hash": "messageHash",
69
+ });
70
+ });
71
+
72
+ export function mintPrepareReadyResponseFromJSON(
73
+ jsonString: string,
74
+ ): SafeParseResult<MintPrepareReadyResponse, SDKValidationError> {
75
+ return safeParse(
76
+ jsonString,
77
+ (x) => MintPrepareReadyResponse$inboundSchema.parse(JSON.parse(x)),
78
+ `Failed to parse 'MintPrepareReadyResponse' from JSON`,
79
+ );
80
+ }
@@ -0,0 +1,66 @@
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
+ * Request model for preparing a CCTP mint transaction on an Earn Account.
10
+ *
11
+ * @remarks
12
+ *
13
+ * The mint/prepare endpoint uses the bridge_id to:
14
+ * 1. Look up the bridge session created during burn/prepare
15
+ * 2. Find the DepositForBurn event on the source chain
16
+ * 3. Extract the CCTP message and compute its hash
17
+ * 4. Check if Circle's attestation is ready
18
+ * 5. Return the mint transaction wrapped in Safe execTransaction
19
+ *
20
+ * This eliminates the need for users to provide the burn transaction hash.
21
+ */
22
+ export type MintPrepareRequest = {
23
+ /**
24
+ * The bridge identifier returned from /burn endpoint. This is used to look up the bridge session and find the burn event.
25
+ */
26
+ bridgeId: string;
27
+ /**
28
+ * The primary wallet address that owns and controls the Earn Account (Safe) on the destination chain. This is used to determine the Safe address that will receive and execute the receiveMessage transaction.
29
+ */
30
+ owner: string;
31
+ /**
32
+ * 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`).
33
+ */
34
+ gasSponsorship?: boolean | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export type MintPrepareRequest$Outbound = {
39
+ bridge_id: string;
40
+ owner: string;
41
+ gas_sponsorship?: boolean | undefined;
42
+ };
43
+
44
+ /** @internal */
45
+ export const MintPrepareRequest$outboundSchema: z.ZodType<
46
+ MintPrepareRequest$Outbound,
47
+ z.ZodTypeDef,
48
+ MintPrepareRequest
49
+ > = z.object({
50
+ bridgeId: z.string(),
51
+ owner: z.string(),
52
+ gasSponsorship: z.boolean().optional(),
53
+ }).transform((v) => {
54
+ return remap$(v, {
55
+ bridgeId: "bridge_id",
56
+ gasSponsorship: "gas_sponsorship",
57
+ });
58
+ });
59
+
60
+ export function mintPrepareRequestToJSON(
61
+ mintPrepareRequest: MintPrepareRequest,
62
+ ): string {
63
+ return JSON.stringify(
64
+ MintPrepareRequest$outboundSchema.parse(mintPrepareRequest),
65
+ );
66
+ }
@@ -40,6 +40,7 @@ export * from "./v1uniswapquotebuyexactly.js";
40
40
  export * from "./v1uniswapquotesellexactly.js";
41
41
  export * from "./v1vaultsvault.js";
42
42
  export * from "./v1wildcatmarket.js";
43
+ export * from "./v2cctpmint.js";
43
44
  export * from "./v2earnaavetokenrates.js";
44
45
  export * from "./v2earnpositions.js";
45
46
  export * from "./v2earnpositionspositionid.js";
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as components from "../components/index.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type V2CctpMintResponse =
12
+ | components.MintPreparePendingResponse
13
+ | components.MintPrepareReadyResponse;
14
+
15
+ /** @internal */
16
+ export const V2CctpMintResponse$inboundSchema: z.ZodType<
17
+ V2CctpMintResponse,
18
+ z.ZodTypeDef,
19
+ unknown
20
+ > = z.union([
21
+ components.MintPreparePendingResponse$inboundSchema,
22
+ components.MintPrepareReadyResponse$inboundSchema,
23
+ ]);
24
+
25
+ export function v2CctpMintResponseFromJSON(
26
+ jsonString: string,
27
+ ): SafeParseResult<V2CctpMintResponse, SDKValidationError> {
28
+ return safeParse(
29
+ jsonString,
30
+ (x) => V2CctpMintResponse$inboundSchema.parse(JSON.parse(x)),
31
+ `Failed to parse 'V2CctpMintResponse' from JSON`,
32
+ );
33
+ }
@@ -0,0 +1,104 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { cctpCCTPBurn } from "../funcs/cctpCCTPBurn.js";
6
+ import { cctpCCTPMint } from "../funcs/cctpCCTPMint.js";
7
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
8
+ import * as components from "../models/components/index.js";
9
+ import * as operations from "../models/operations/index.js";
10
+ import { unwrapAsync } from "../types/fp.js";
11
+
12
+ export class Cctp extends ClientSDK {
13
+ /**
14
+ * Build depositForBurn transaction for Earn Account (CCTP V2)
15
+ *
16
+ * @remarks
17
+ * Build a transaction to burn USDC from an Earn Account (Safe) on the source chain
18
+ * and initiate a cross-chain transfer via Circle's CCTP V2 (Cross-Chain Transfer Protocol).
19
+ *
20
+ * **Transfer modes:**
21
+ * - `standard` (default): ~15-19 minute transfers, **free** (no fee)
22
+ * - `fast`: ~30 second transfers, requires a small fee (typically ~0.01%)
23
+ *
24
+ * The fee for fast mode is automatically calculated based on Circle's current rates.
25
+ *
26
+ * **Flow:**
27
+ * 1. Call this endpoint with `gas_sponsorship=false` to get an unsigned transaction,
28
+ * or `gas_sponsorship=true` to get EIP-712 typed data for gas-sponsored execution
29
+ * 2. Owner signs the transaction or typed data
30
+ * 3. Broadcast the transaction on the source chain (or submit to `/gas_sponsorship/prepare`)
31
+ * 4. Wait for Circle's attestation service to attest the burn
32
+ * 5. Call the mint endpoint to receive USDC on the destination chain
33
+ *
34
+ * **Supported chains:**
35
+ * - Ethereum (domain 0)
36
+ * - Arbitrum (domain 3)
37
+ * - Base (domain 6)
38
+ *
39
+ * **Note:** The USDC must already be deposited in the Earn Account. If approval is needed
40
+ * for the TokenMessengerV2 contract, it will be included in the transaction automatically.
41
+ *
42
+ * **Gas estimate:** ~200,000 gas units (includes Safe execTransaction overhead)
43
+ */
44
+ async cctpBurn(
45
+ request: components.DepositForBurnRequest,
46
+ options?: RequestOptions,
47
+ ): Promise<components.DepositForBurnResponse> {
48
+ return unwrapAsync(cctpCCTPBurn(
49
+ this,
50
+ request,
51
+ options,
52
+ ));
53
+ }
54
+
55
+ /**
56
+ * Prepare mint transaction for Earn Account on destination chain
57
+ *
58
+ * @remarks
59
+ * Prepare a receiveMessage transaction to mint USDC to an Earn Account (Safe) on the
60
+ * destination chain.
61
+ *
62
+ * **How it works:**
63
+ *
64
+ * This endpoint uses the `bridge_id` from `/burn` to:
65
+ * 1. Look up the bridge session (no burn tx hash needed!)
66
+ * 2. Find the DepositForBurn event on the source chain using stored nonce
67
+ * 3. Extract the CCTP message and compute its hash
68
+ * 4. Check if Circle's attestation is ready
69
+ * 5. Return the mint transaction wrapped in Safe execTransaction
70
+ *
71
+ * **Request parameters:**
72
+ *
73
+ * - `bridge_id`: The bridge ID returned from `/burn`
74
+ * - `owner`: The wallet address that owns the Earn Account (Safe) on the destination chain
75
+ * - `gas_sponsorship`: If true, returns EIP-712 typed data for gas-sponsored execution
76
+ *
77
+ * **Response codes:**
78
+ *
79
+ * - **200 OK**: Attestation is ready, mint transaction is included
80
+ * - **202 Accepted**: Attestation is pending, SSE URL for real-time updates is included
81
+ * - **400 Bad Request**: Bridge not found, or burn event not found yet
82
+ *
83
+ * **After receiving 202:**
84
+ *
85
+ * Either:
86
+ * - Connect to the SSE stream at `sse_url` and wait for `attestation_ready` event
87
+ * - Poll this endpoint periodically until you get 200
88
+ *
89
+ * **After receiving 200:**
90
+ *
91
+ * Sign and broadcast the returned transaction on the destination chain to mint USDC
92
+ * to your Earn Account.
93
+ */
94
+ async cctpMint(
95
+ request: components.MintPrepareRequest,
96
+ options?: RequestOptions,
97
+ ): Promise<operations.V2CctpMintResponse> {
98
+ return unwrapAsync(cctpCCTPMint(
99
+ this,
100
+ request,
101
+ options,
102
+ ));
103
+ }
104
+ }
package/src/sdk/sdk.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  import { ClientSDK } from "../lib/sdks.js";
6
6
  import { AaveV3 } from "./aavev3.js";
7
7
  import { AerodromeSlipstream } from "./aerodromeslipstream.js";
8
+ import { Cctp } from "./cctp.js";
8
9
  import { Earn } from "./earn.js";
9
10
  import { Erc4626Vaults } from "./erc4626vaults.js";
10
11
  import { Ethena } from "./ethena.js";
@@ -102,4 +103,9 @@ export class CompassApiSDK extends ClientSDK {
102
103
  get earn(): Earn {
103
104
  return (this._earn ??= new Earn(this._options));
104
105
  }
106
+
107
+ private _cctp?: Cctp;
108
+ get cctp(): Cctp {
109
+ return (this._cctp ??= new Cctp(this._options));
110
+ }
105
111
  }