@compass-labs/api-sdk 2.1.10-rc.6 → 2.1.10-rc.8

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/README.md +2 -2
  2. package/dist/commonjs/funcs/bridgeCctpBurn.d.ts +2 -4
  3. package/dist/commonjs/funcs/bridgeCctpBurn.d.ts.map +1 -1
  4. package/dist/commonjs/funcs/bridgeCctpBurn.js +2 -4
  5. package/dist/commonjs/funcs/bridgeCctpBurn.js.map +1 -1
  6. package/dist/commonjs/funcs/bridgeCctpMint.d.ts +9 -10
  7. package/dist/commonjs/funcs/bridgeCctpMint.d.ts.map +1 -1
  8. package/dist/commonjs/funcs/bridgeCctpMint.js +9 -10
  9. package/dist/commonjs/funcs/bridgeCctpMint.js.map +1 -1
  10. package/dist/commonjs/models/components/depositforburnrequest.d.ts +3 -13
  11. package/dist/commonjs/models/components/depositforburnrequest.d.ts.map +1 -1
  12. package/dist/commonjs/models/components/depositforburnrequest.js.map +1 -1
  13. package/dist/commonjs/models/components/mintpreparereadyresponse.d.ts +3 -17
  14. package/dist/commonjs/models/components/mintpreparereadyresponse.d.ts.map +1 -1
  15. package/dist/commonjs/models/components/mintpreparereadyresponse.js +1 -7
  16. package/dist/commonjs/models/components/mintpreparereadyresponse.js.map +1 -1
  17. package/dist/commonjs/models/components/mintpreparerequest.d.ts +4 -18
  18. package/dist/commonjs/models/components/mintpreparerequest.d.ts.map +1 -1
  19. package/dist/commonjs/models/components/mintpreparerequest.js +1 -3
  20. package/dist/commonjs/models/components/mintpreparerequest.js.map +1 -1
  21. package/dist/commonjs/sdk/bridge.d.ts +11 -14
  22. package/dist/commonjs/sdk/bridge.d.ts.map +1 -1
  23. package/dist/commonjs/sdk/bridge.js +11 -14
  24. package/dist/commonjs/sdk/bridge.js.map +1 -1
  25. package/dist/esm/funcs/bridgeCctpBurn.d.ts +2 -4
  26. package/dist/esm/funcs/bridgeCctpBurn.d.ts.map +1 -1
  27. package/dist/esm/funcs/bridgeCctpBurn.js +2 -4
  28. package/dist/esm/funcs/bridgeCctpBurn.js.map +1 -1
  29. package/dist/esm/funcs/bridgeCctpMint.d.ts +9 -10
  30. package/dist/esm/funcs/bridgeCctpMint.d.ts.map +1 -1
  31. package/dist/esm/funcs/bridgeCctpMint.js +9 -10
  32. package/dist/esm/funcs/bridgeCctpMint.js.map +1 -1
  33. package/dist/esm/models/components/depositforburnrequest.d.ts +3 -13
  34. package/dist/esm/models/components/depositforburnrequest.d.ts.map +1 -1
  35. package/dist/esm/models/components/depositforburnrequest.js.map +1 -1
  36. package/dist/esm/models/components/mintpreparereadyresponse.d.ts +3 -17
  37. package/dist/esm/models/components/mintpreparereadyresponse.d.ts.map +1 -1
  38. package/dist/esm/models/components/mintpreparereadyresponse.js +1 -7
  39. package/dist/esm/models/components/mintpreparereadyresponse.js.map +1 -1
  40. package/dist/esm/models/components/mintpreparerequest.d.ts +4 -18
  41. package/dist/esm/models/components/mintpreparerequest.d.ts.map +1 -1
  42. package/dist/esm/models/components/mintpreparerequest.js +1 -3
  43. package/dist/esm/models/components/mintpreparerequest.js.map +1 -1
  44. package/dist/esm/sdk/bridge.d.ts +11 -14
  45. package/dist/esm/sdk/bridge.d.ts.map +1 -1
  46. package/dist/esm/sdk/bridge.js +11 -14
  47. package/dist/esm/sdk/bridge.js.map +1 -1
  48. package/package.json +1 -1
  49. package/src/funcs/bridgeCctpBurn.ts +2 -4
  50. package/src/funcs/bridgeCctpMint.ts +9 -10
  51. package/src/models/components/depositforburnrequest.ts +3 -13
  52. package/src/models/components/mintpreparereadyresponse.ts +4 -26
  53. package/src/models/components/mintpreparerequest.ts +5 -21
  54. package/src/sdk/bridge.ts +11 -14
@@ -58,22 +58,12 @@ export type DepositForBurnRequestTransferMode = ClosedEnum<
58
58
  *
59
59
  * @remarks
60
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
61
+ * Burns USDC from a Product Account to initiate a cross-chain transfer via Circle's
62
+ * CCTP.
73
63
  */
74
64
  export type DepositForBurnRequest = {
75
65
  /**
76
- * The primary wallet address that owns and controls the Earn Account (Safe).
66
+ * The primary wallet address that owns and controls the Product Account.
77
67
  */
78
68
  owner: string;
79
69
  /**
@@ -7,10 +7,6 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
- import {
11
- BatchedSafeOperationsResponseOutput,
12
- BatchedSafeOperationsResponseOutput$inboundSchema,
13
- } from "./batchedsafeoperationsresponseoutput.js";
14
10
  import {
15
11
  UnsignedTransaction,
16
12
  UnsignedTransaction$inboundSchema,
@@ -21,10 +17,8 @@ import {
21
17
  *
22
18
  * @remarks
23
19
  *
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).
20
+ * Returned with 200 OK status code. Contains an unsigned transaction that calls
21
+ * receiveMessage on the MessageTransmitter contract.
28
22
  */
29
23
  export type MintPrepareReadyResponse = {
30
24
  /**
@@ -35,18 +29,7 @@ export type MintPrepareReadyResponse = {
35
29
  * The bridge identifier.
36
30
  */
37
31
  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;
32
+ transaction: UnsignedTransaction;
50
33
  };
51
34
 
52
35
  /** @internal */
@@ -57,15 +40,10 @@ export const MintPrepareReadyResponse$inboundSchema: z.ZodType<
57
40
  > = z.object({
58
41
  status: z.literal("ready").default("ready").optional(),
59
42
  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(),
43
+ transaction: UnsignedTransaction$inboundSchema,
64
44
  }).transform((v) => {
65
45
  return remap$(v, {
66
46
  "bridge_id": "bridgeId",
67
- "eip_712": "eip712",
68
- "message_hash": "messageHash",
69
47
  });
70
48
  });
71
49
 
@@ -6,16 +6,7 @@ import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
 
8
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 and burn_tx_hash to:
14
- * 1. Look up the bridge session created during burn/prepare
15
- * 2. Find the DepositForBurn event using the burn transaction hash
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
9
+ * Request model for preparing a CCTP mint transaction.
19
10
  */
20
11
  export type MintPrepareRequest = {
21
12
  /**
@@ -27,21 +18,16 @@ export type MintPrepareRequest = {
27
18
  */
28
19
  burnTxHash: string;
29
20
  /**
30
- * 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.
21
+ * The wallet address that will sign and send the mint transaction.
31
22
  */
32
- owner: string;
33
- /**
34
- * 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`).
35
- */
36
- gasSponsorship?: boolean | undefined;
23
+ sender: string;
37
24
  };
38
25
 
39
26
  /** @internal */
40
27
  export type MintPrepareRequest$Outbound = {
41
28
  bridge_id: string;
42
29
  burn_tx_hash: string;
43
- owner: string;
44
- gas_sponsorship?: boolean | undefined;
30
+ sender: string;
45
31
  };
46
32
 
47
33
  /** @internal */
@@ -52,13 +38,11 @@ export const MintPrepareRequest$outboundSchema: z.ZodType<
52
38
  > = z.object({
53
39
  bridgeId: z.string(),
54
40
  burnTxHash: z.string(),
55
- owner: z.string(),
56
- gasSponsorship: z.boolean().optional(),
41
+ sender: z.string(),
57
42
  }).transform((v) => {
58
43
  return remap$(v, {
59
44
  bridgeId: "bridge_id",
60
45
  burnTxHash: "burn_tx_hash",
61
- gasSponsorship: "gas_sponsorship",
62
46
  });
63
47
  });
64
48
 
package/src/sdk/bridge.ts CHANGED
@@ -14,7 +14,7 @@ export class Bridge extends ClientSDK {
14
14
  * Initiate USDC bridging
15
15
  *
16
16
  * @remarks
17
- * Build a transaction to burn USDC from an Earn Account (Safe) on the source chain
17
+ * Build a transaction to burn USDC from any Product Account on the source chain
18
18
  * and initiate a cross-chain transfer via Circle's CCTP V2 (Cross-Chain Transfer Protocol).
19
19
  *
20
20
  * **Transfer modes:**
@@ -38,10 +38,8 @@ export class Bridge extends ClientSDK {
38
38
  * - Arbitrum (domain 3)
39
39
  * - Base (domain 6)
40
40
  *
41
- * **Note:** The USDC must already be deposited in the Earn Account. If approval is needed
41
+ * **Note:** The USDC must already be deposited in the Product Account. If approval is needed
42
42
  * for the TokenMessengerV2 contract, it will be included in the transaction automatically.
43
- *
44
- * **Gas estimate:** ~200,000 gas units (includes Safe execTransaction overhead)
45
43
  */
46
44
  async cctpBurn(
47
45
  request: components.DepositForBurnRequest,
@@ -55,28 +53,25 @@ export class Bridge extends ClientSDK {
55
53
  }
56
54
 
57
55
  /**
58
- * Confirm bridging
56
+ * Confirm USDC bridging
59
57
  *
60
58
  * @remarks
61
59
  * ***This endpoint is only needed to be called in rare cases when bridging was not confirmed automatically***
62
60
  *
63
- * Prepare a receiveMessage transaction to mint USDC to an Earn Account (Safe) on the
61
+ * Prepare a receiveMessage transaction to mint USDC to any Product Account on the
64
62
  * destination chain.
65
63
  *
66
64
  * **How it works:**
67
65
  *
68
66
  * This endpoint uses the `bridge_id` from `/burn` to:
69
- * 1. Look up the bridge session (no burn tx hash needed!)
70
- * 2. Find the DepositForBurn event on the source chain using stored nonce
71
- * 3. Extract the CCTP message and compute its hash
72
- * 4. Check if Circle's attestation is ready
73
- * 5. Return the mint transaction wrapped in Safe execTransaction
67
+ * 1. Look up the bridge session
68
+ * 2. Check if Circle's attestation is ready
69
+ * 3. Return the mint transaction
74
70
  *
75
71
  * **Request parameters:**
76
72
  *
77
73
  * - `bridge_id`: The bridge ID returned from `/burn`
78
- * - `owner`: The wallet address that owns the Earn Account (Safe) on the destination chain
79
- * - `gas_sponsorship`: If true, returns EIP-712 typed data for gas-sponsored execution
74
+ * - `burn_tx_hash`: The transaction hash of the burn transaction on the source chain
80
75
  *
81
76
  * **Response codes:**
82
77
  *
@@ -86,6 +81,8 @@ export class Bridge extends ClientSDK {
86
81
  *
87
82
  * **After receiving 202:**
88
83
  *
84
+ * The SSE stream and status endpoint are in progress. Keep an eye on the updates from our team.
85
+ *
89
86
  * Either:
90
87
  * - Connect to the SSE stream at `sse_url` and wait for `attestation_ready` event
91
88
  * - Poll this endpoint periodically until you get 200
@@ -93,7 +90,7 @@ export class Bridge extends ClientSDK {
93
90
  * **After receiving 200:**
94
91
  *
95
92
  * Sign and broadcast the returned transaction on the destination chain to mint USDC
96
- * to your Earn Account.
93
+ * to your Product Account.
97
94
  */
98
95
  async cctpMint(
99
96
  request: components.MintPrepareRequest,