@compass-labs/api-sdk 2.1.34 → 2.1.35-rc.0

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 (131) hide show
  1. package/dist/commonjs/funcs/earnEarnAaveMarkets.d.ts +4 -7
  2. package/dist/commonjs/funcs/earnEarnAaveMarkets.d.ts.map +1 -1
  3. package/dist/commonjs/funcs/earnEarnAaveMarkets.js +4 -7
  4. package/dist/commonjs/funcs/earnEarnAaveMarkets.js.map +1 -1
  5. package/dist/commonjs/funcs/earnEarnBundle.d.ts +9 -10
  6. package/dist/commonjs/funcs/earnEarnBundle.d.ts.map +1 -1
  7. package/dist/commonjs/funcs/earnEarnBundle.js +9 -10
  8. package/dist/commonjs/funcs/earnEarnBundle.js.map +1 -1
  9. package/dist/commonjs/funcs/earnEarnCreateAccount.d.ts +5 -7
  10. package/dist/commonjs/funcs/earnEarnCreateAccount.d.ts.map +1 -1
  11. package/dist/commonjs/funcs/earnEarnCreateAccount.js +5 -7
  12. package/dist/commonjs/funcs/earnEarnCreateAccount.js.map +1 -1
  13. package/dist/commonjs/funcs/earnEarnManage.d.ts +10 -14
  14. package/dist/commonjs/funcs/earnEarnManage.d.ts.map +1 -1
  15. package/dist/commonjs/funcs/earnEarnManage.js +10 -14
  16. package/dist/commonjs/funcs/earnEarnManage.js.map +1 -1
  17. package/dist/commonjs/funcs/earnEarnPositions.d.ts +8 -1
  18. package/dist/commonjs/funcs/earnEarnPositions.d.ts.map +1 -1
  19. package/dist/commonjs/funcs/earnEarnPositions.js +8 -1
  20. package/dist/commonjs/funcs/earnEarnPositions.js.map +1 -1
  21. package/dist/commonjs/funcs/earnEarnSwap.d.ts +6 -0
  22. package/dist/commonjs/funcs/earnEarnSwap.d.ts.map +1 -1
  23. package/dist/commonjs/funcs/earnEarnSwap.js +6 -0
  24. package/dist/commonjs/funcs/earnEarnSwap.js.map +1 -1
  25. package/dist/commonjs/funcs/earnEarnTransfer.d.ts +14 -5
  26. package/dist/commonjs/funcs/earnEarnTransfer.d.ts.map +1 -1
  27. package/dist/commonjs/funcs/earnEarnTransfer.js +14 -5
  28. package/dist/commonjs/funcs/earnEarnTransfer.js.map +1 -1
  29. package/dist/commonjs/funcs/earnEarnVaults.d.ts +6 -2
  30. package/dist/commonjs/funcs/earnEarnVaults.d.ts.map +1 -1
  31. package/dist/commonjs/funcs/earnEarnVaults.js +6 -2
  32. package/dist/commonjs/funcs/earnEarnVaults.js.map +1 -1
  33. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipApproveTransfer.d.ts +8 -8
  34. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipApproveTransfer.js +8 -8
  35. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipPrepare.d.ts +9 -3
  36. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipPrepare.d.ts.map +1 -1
  37. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipPrepare.js +9 -3
  38. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipPrepare.js.map +1 -1
  39. package/dist/commonjs/models/components/approvetransferrequest.d.ts +1 -1
  40. package/dist/commonjs/models/components/batchedsafeoperationsresponseinput.d.ts +2 -2
  41. package/dist/commonjs/models/components/batchedsafeoperationsresponseoutput.d.ts +2 -2
  42. package/dist/commonjs/models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.d.ts +3 -3
  43. package/dist/commonjs/models/components/safetxmessage.d.ts +3 -3
  44. package/dist/commonjs/models/components/sponsorgasrequest.d.ts +1 -1
  45. package/dist/commonjs/sdk/earn.d.ts +62 -46
  46. package/dist/commonjs/sdk/earn.d.ts.map +1 -1
  47. package/dist/commonjs/sdk/earn.js +62 -46
  48. package/dist/commonjs/sdk/earn.js.map +1 -1
  49. package/dist/commonjs/sdk/gassponsorship.d.ts +17 -11
  50. package/dist/commonjs/sdk/gassponsorship.d.ts.map +1 -1
  51. package/dist/commonjs/sdk/gassponsorship.js +17 -11
  52. package/dist/commonjs/sdk/gassponsorship.js.map +1 -1
  53. package/dist/esm/funcs/earnEarnAaveMarkets.d.ts +4 -7
  54. package/dist/esm/funcs/earnEarnAaveMarkets.d.ts.map +1 -1
  55. package/dist/esm/funcs/earnEarnAaveMarkets.js +4 -7
  56. package/dist/esm/funcs/earnEarnAaveMarkets.js.map +1 -1
  57. package/dist/esm/funcs/earnEarnBundle.d.ts +9 -10
  58. package/dist/esm/funcs/earnEarnBundle.d.ts.map +1 -1
  59. package/dist/esm/funcs/earnEarnBundle.js +9 -10
  60. package/dist/esm/funcs/earnEarnBundle.js.map +1 -1
  61. package/dist/esm/funcs/earnEarnCreateAccount.d.ts +5 -7
  62. package/dist/esm/funcs/earnEarnCreateAccount.d.ts.map +1 -1
  63. package/dist/esm/funcs/earnEarnCreateAccount.js +5 -7
  64. package/dist/esm/funcs/earnEarnCreateAccount.js.map +1 -1
  65. package/dist/esm/funcs/earnEarnManage.d.ts +10 -14
  66. package/dist/esm/funcs/earnEarnManage.d.ts.map +1 -1
  67. package/dist/esm/funcs/earnEarnManage.js +10 -14
  68. package/dist/esm/funcs/earnEarnManage.js.map +1 -1
  69. package/dist/esm/funcs/earnEarnPositions.d.ts +8 -1
  70. package/dist/esm/funcs/earnEarnPositions.d.ts.map +1 -1
  71. package/dist/esm/funcs/earnEarnPositions.js +8 -1
  72. package/dist/esm/funcs/earnEarnPositions.js.map +1 -1
  73. package/dist/esm/funcs/earnEarnSwap.d.ts +6 -0
  74. package/dist/esm/funcs/earnEarnSwap.d.ts.map +1 -1
  75. package/dist/esm/funcs/earnEarnSwap.js +6 -0
  76. package/dist/esm/funcs/earnEarnSwap.js.map +1 -1
  77. package/dist/esm/funcs/earnEarnTransfer.d.ts +14 -5
  78. package/dist/esm/funcs/earnEarnTransfer.d.ts.map +1 -1
  79. package/dist/esm/funcs/earnEarnTransfer.js +14 -5
  80. package/dist/esm/funcs/earnEarnTransfer.js.map +1 -1
  81. package/dist/esm/funcs/earnEarnVaults.d.ts +6 -2
  82. package/dist/esm/funcs/earnEarnVaults.d.ts.map +1 -1
  83. package/dist/esm/funcs/earnEarnVaults.js +6 -2
  84. package/dist/esm/funcs/earnEarnVaults.js.map +1 -1
  85. package/dist/esm/funcs/gasSponsorshipGasSponsorshipApproveTransfer.d.ts +8 -8
  86. package/dist/esm/funcs/gasSponsorshipGasSponsorshipApproveTransfer.js +8 -8
  87. package/dist/esm/funcs/gasSponsorshipGasSponsorshipPrepare.d.ts +9 -3
  88. package/dist/esm/funcs/gasSponsorshipGasSponsorshipPrepare.d.ts.map +1 -1
  89. package/dist/esm/funcs/gasSponsorshipGasSponsorshipPrepare.js +9 -3
  90. package/dist/esm/funcs/gasSponsorshipGasSponsorshipPrepare.js.map +1 -1
  91. package/dist/esm/models/components/approvetransferrequest.d.ts +1 -1
  92. package/dist/esm/models/components/batchedsafeoperationsresponseinput.d.ts +2 -2
  93. package/dist/esm/models/components/batchedsafeoperationsresponseoutput.d.ts +2 -2
  94. package/dist/esm/models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.d.ts +3 -3
  95. package/dist/esm/models/components/safetxmessage.d.ts +3 -3
  96. package/dist/esm/models/components/sponsorgasrequest.d.ts +1 -1
  97. package/dist/esm/sdk/earn.d.ts +62 -46
  98. package/dist/esm/sdk/earn.d.ts.map +1 -1
  99. package/dist/esm/sdk/earn.js +62 -46
  100. package/dist/esm/sdk/earn.js.map +1 -1
  101. package/dist/esm/sdk/gassponsorship.d.ts +17 -11
  102. package/dist/esm/sdk/gassponsorship.d.ts.map +1 -1
  103. package/dist/esm/sdk/gassponsorship.js +17 -11
  104. package/dist/esm/sdk/gassponsorship.js.map +1 -1
  105. package/docs/models/components/approvetransferrequest.md +1 -1
  106. package/docs/models/components/batchedsafeoperationsresponseinput.md +2 -2
  107. package/docs/models/components/batchedsafeoperationsresponseoutput.md +2 -2
  108. package/docs/models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.md +5 -5
  109. package/docs/models/components/safetxmessage.md +3 -3
  110. package/docs/models/components/sponsorgasrequest.md +1 -1
  111. package/docs/sdks/earn/README.md +62 -46
  112. package/docs/sdks/gassponsorship/README.md +17 -11
  113. package/package.json +1 -1
  114. package/src/funcs/earnEarnAaveMarkets.ts +4 -7
  115. package/src/funcs/earnEarnBundle.ts +9 -10
  116. package/src/funcs/earnEarnCreateAccount.ts +5 -7
  117. package/src/funcs/earnEarnManage.ts +10 -14
  118. package/src/funcs/earnEarnPositions.ts +8 -1
  119. package/src/funcs/earnEarnSwap.ts +6 -0
  120. package/src/funcs/earnEarnTransfer.ts +14 -5
  121. package/src/funcs/earnEarnVaults.ts +6 -2
  122. package/src/funcs/gasSponsorshipGasSponsorshipApproveTransfer.ts +8 -8
  123. package/src/funcs/gasSponsorshipGasSponsorshipPrepare.ts +9 -3
  124. package/src/models/components/approvetransferrequest.ts +1 -1
  125. package/src/models/components/batchedsafeoperationsresponseinput.ts +2 -2
  126. package/src/models/components/batchedsafeoperationsresponseoutput.ts +2 -2
  127. package/src/models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.ts +3 -3
  128. package/src/models/components/safetxmessage.ts +3 -3
  129. package/src/models/components/sponsorgasrequest.ts +1 -1
  130. package/src/sdk/earn.ts +62 -46
  131. package/src/sdk/gassponsorship.ts +17 -11
@@ -6,87 +6,98 @@ export declare class Earn extends ClientSDK {
6
6
  * List earn positions
7
7
  *
8
8
  * @remarks
9
- * This endpoint fetches all Compass Earn positions with PnL information.
9
+ * List all Earn positions for a given owner with PnL tracking.
10
+ *
11
+ * Returns position data including current balance, cost basis, and profit and loss.
12
+ * Use this endpoint to display portfolio performance, track yields over time, or build
13
+ * position management interfaces.
14
+ *
15
+ * Positions are tracked across all venue types (vaults and Aave markets). Each
16
+ * position includes the venue address, deposited amount, and performance metrics.
10
17
  */
11
18
  earnPositions(request: operations.V2EarnPositionsRequest, options?: RequestOptions): Promise<components.EarnPositionsResponse>;
12
19
  /**
13
20
  * List vaults
14
21
  *
15
22
  * @remarks
16
- * List information about 4626 vaults.
23
+ * List ERC-4626 yield vaults across DeFi venues.
24
+ *
25
+ * Returns vault data including APY, TVL, and underlying asset information. Use this endpoint to discover yield opportunities, compare rates across venues, or build vault selection interfaces.
26
+ *
27
+ * Supports dozens of vaults and markets like Morpho and other ERC-4626 compatible yield venues.
17
28
  *
18
- * These are earn opportunities for protocols like morpho.
29
+ * To deposit into a vault, use the [manage endpoint](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position) with `venue_type=VAULTS`.
19
30
  */
20
31
  earnVaults(request: operations.V2EarnVaultsRequest, options?: RequestOptions): Promise<components.VaultsResponse>;
21
32
  /**
22
33
  * List aave markets
23
34
  *
24
35
  * @remarks
25
- * List all aave markets with their supply and borrow rates.
36
+ * List Aave lending markets with supply and borrow rates.
26
37
  *
27
- * Returns rates organized by token symbol, with chain-specific data for each token.
28
- * Each token includes rates for all chains where it's available, plus information
29
- * about which chain offers the highest supply APY.
38
+ * Returns rates organized by token symbol, with chain-specific data for each token. Each token includes rates for all chains where it's available, plus information about which chain offers the highest supply APY.
30
39
  *
31
- * APY values are returned in percentage format (e.g., 4.5 means 4.5%). Tokens with
32
- * zero APY on both supply and borrow are excluded.
40
+ * APY values are returned in percentage format (e.g., 4.5 means 4.5%). Tokens with zero APY on both supply and borrow are excluded.
33
41
  *
34
- * Optionally filter by chain.
42
+ * To deposit into an Aave market, use the [manage endpoint](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position) with `venue_type=AAVE`.
35
43
  */
36
44
  earnAaveMarkets(request: operations.V2EarnAaveMarketsRequest, options?: RequestOptions): Promise<components.ListAaveMarketsResponse>;
37
45
  /**
38
46
  * Create earn account
39
47
  *
40
48
  * @remarks
41
- * Create an Earn Account.
49
+ * Create an Earn Account for a wallet address.
42
50
  *
43
- * Before creating Earn positions, the `owner` must create an Earn Account associated with their wallet address.
51
+ * Before depositing into venues or managing positions, the owner must create an Earn Account. Each wallet address has one Earn Account per chain.
44
52
  *
45
- * Only the `owner` has the authority to sign transactions for this account. This can be done in one of two ways:
53
+ * Returns an unsigned transaction to create the account. The `sender` signs and broadcasts this transaction.
46
54
  *
47
- * 1) **No gas-sponsorship:** The `owner` signs a transaction and submits it to the network for execution. The `owner` covers the cost of gas in this case.
55
+ * **If owner pays gas:** Set `sender` to the owner's address.
48
56
  *
49
- * 2) **Gas-sponsorship:** The `owner` does an off-chain EIP-712 signature and submits this signature to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`). Here, another wallet address is set as `sender`. This wallet will sign, submit and cover the gas fees of the transaction.
50
- *
51
- * The creation of an Earn Account itself can be a gas-sponsored transaction by setting the `sender` to the wallet which will sign and send the transaction.
57
+ * **If someone else pays gas:** Set `sender` to the wallet that will sign and broadcast the transaction on behalf of the owner.
52
58
  */
53
59
  earnCreateAccount(request: components.CreateAccountRequest, options?: RequestOptions): Promise<components.CreateAccountResponse>;
54
60
  /**
55
61
  * Transfer tokens to/from account
56
62
  *
57
63
  * @remarks
58
- * Transfer tokens to and from an Earn Account.
64
+ * Transfer tokens between an owner's wallet and their Earn Account.
65
+ *
66
+ * Use `DEPOSIT` to move tokens from the owner's wallet into their Earn Account. Use `WITHDRAW` to move tokens from the Earn Account back to the owner's wallet.
67
+ *
68
+ * **Gas-sponsored deposits** require two steps:
59
69
  *
60
- * If `DEPOSIT`'` is selected, tokens will be transferred from the `owner`'s wallet into their Earn Account.
70
+ * **Step 1 (once per token):** Set up Permit2 allowance
71
+ * 1. Call [/gas_sponsorship/approve_transfer](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/approve-token-transfer) to get EIP-712 typed data
72
+ * 2. Owner signs the typed data
73
+ * 3. Submit signature + typed data to [/gas_sponsorship/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction)
61
74
  *
62
- * If `WITHDRAW` is selected, tokens will be transferred from the `owner`'s Earn Account into their wallet.
75
+ * **Step 2 (each transfer):** Execute the gas-sponsored transfer
76
+ * 1. Call this endpoint with `gas_sponsorship=true` to get EIP-712 typed data
77
+ * 2. Owner signs the typed data
78
+ * 3. Submit signature + typed data to [/gas_sponsorship/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction)
63
79
  *
64
- * If a gas-sponsored `DEPOSIT` transfer is desired for a given token, a one-time Permit2 allowance must be set before proceeding. This is common practice for many other applications and, for many `owner`s, this one-time allowance will already have been set for the token they would like to transfer.
65
- * Once the one-time allowance is set for a given token and `gas_sponsorship` is set to 'true', EIP-712 typed data will be returned and can be signed off-chain by the user. This signature can then be submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`) where a `sender` can be set for the transaction.
80
+ * **Note:** This endpoint moves tokens to/from the Earn Account itself—not into yield venues. To deposit into a vault or Aave market, use the [manage endpoint](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position).
66
81
  */
67
82
  earnTransfer(request: components.EarnTransferRequest, options?: RequestOptions): Promise<components.EarnTransferResponse>;
68
83
  /**
69
84
  * Manage earn position
70
85
  *
71
86
  * @remarks
72
- * Manage an Earn position for a given `owner`'s Earn Account.
87
+ * Deposit into or withdraw from a yield venue.
73
88
  *
74
- * The `owner` is the main wallet address that owns and controls the Earn Account. It is not the Earn Account address itself.
89
+ * Use `DEPOSIT` to move tokens from the Earn Account into a vault or Aave market. Use `WITHDRAW` to move tokens back from a venue into the Earn Account.
75
90
  *
76
- * Venue Types:
77
- * - VAULTS
78
- * - AAVE
91
+ * **Venue types:**
92
+ * - `VAULTS`: ERC-4626 vaults (see [/vaults](https://docs.compasslabs.ai/v2/api-reference/earn/list-vaults) for available options)
93
+ * - `AAVE`: Aave lending pools (see [/aave_markets](https://docs.compasslabs.ai/v2/api-reference/earn/list-aave-markets) for available options)
79
94
  *
80
- * If `DEPOSIT` is selected for `action`, tokens will be deposited into the selected venue address from the Earn Account associated with the `owner` wallet.
95
+ * **Fees:** A fee can be configured and deducted from the transaction amount:
96
+ * - `FIXED`: A fixed token amount (e.g., 0.1 means 0.1 tokens)
97
+ * - `PERCENTAGE`: A percentage of the amount (e.g., 1.5 means 1.5%)
98
+ * - `PERFORMANCE`: A percentage of realized profit (withdrawals only)
81
99
  *
82
- * 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.
83
- *
84
- * A fee can be configured. This fee is deducted from the total `amount`. It can be expressed as:
85
- * - `FIXED`: a fixed token amount (e.g., 0.1 means 0.1 tokens)
86
- * - `PERCENTAGE`: a percentage of the transaction amount (e.g., 1.5 means 1.5%)
87
- * - `PERFORMANCE`: a percentage of realized profit using FIFO cost basis (e.g., 10 means 10% of profit). Only applicable for withdrawals.
88
- *
89
- * 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.
100
+ * **Gas sponsorship:** Set `gas_sponsorship=true` to receive EIP-712 typed data. Owner signs the typed data, then submit to [/gas_sponsorship/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction).
90
101
  */
91
102
  earnManage(request: components.EarnManageRequest, options?: RequestOptions): Promise<components.EarnManageResponse>;
92
103
  /**
@@ -94,26 +105,31 @@ export declare class Earn extends ClientSDK {
94
105
  *
95
106
  * @remarks
96
107
  * Swap tokens within an Earn Account.
108
+ *
109
+ * Use this endpoint to exchange one token for another without transferring funds out of the Earn Account.
110
+ *
111
+ * The swap executes atomically within the Earn Account and can be combined with other actions using the [bundle endpoint](https://docs.compasslabs.ai/v2/api-reference/earn/execute-multiple-earn-actions). For example, swap ETH to USDC, then deposit USDC into a vault—all in one transaction.
112
+ *
113
+ * Returns either an unsigned transaction (when `gas_sponsorship=false`) or EIP-712 typed data for off-chain signing (when `gas_sponsorship=true`). For gas-sponsored swaps, submit the signed typed data to `/gas_sponsorship/prepare`.
97
114
  */
98
115
  earnSwap(request: components.EarnSwapRequest, options?: RequestOptions): Promise<components.EarnSwapResponse>;
99
116
  /**
100
117
  * Execute multiple earn actions
101
118
  *
102
119
  * @remarks
103
- * This endpoint allows combining multiple actions (swaps, vault
104
- * deposits/withdrawals, Aave deposits/withdrawals) into a single atomic transaction
105
- * executed via the Earn account).
120
+ * Combine multiple actions into a single atomic transaction.
121
+ *
122
+ * Bundle swaps and venue deposits/withdrawals into one transaction executed through the Earn Account. This saves gas compared to executing actions separately and ensures all actions succeed or fail together.
106
123
  *
107
- * **Example Use Case:** Swap USDC to AUSD, then deposit AUSD into a vault - all in one transaction.
124
+ * **Example:** Swap AUSD to USDC, then deposit USDC into a vault - all in one transaction.
108
125
  *
109
- * Actions are executed in the order they are provided. Each action type has its own parameters:
126
+ * **Action types:**
127
+ * - `V2_SWAP`: Swap tokens within the Earn Account
128
+ * - `V2_MANAGE`: Deposit/withdraw to ERC-4626 vaults or Aave markets
110
129
  *
111
- * - **V2_SWAP**: Swapping tokens within the Earn Account
112
- * - **V2_MANAGE**: Manage positions - deposit/withdraw to ERC-4626 vaults or Aave lending pool
130
+ * Actions execute in the order provided.
113
131
  *
114
- * The bundled transaction can be gas-sponsored by setting `gas_sponsorship=true`.
115
- * This returns EIP-712 typed data that the owner must sign and submit to
116
- * `/gas_sponsorship/prepare` for execution by a gas sponsor.
132
+ * **Gas sponsorship:** Set `gas_sponsorship=true` to receive EIP-712 typed data. Owner signs the typed data, then submit to [/gas_sponsorship/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction).
117
133
  */
118
134
  earnBundle(request: components.V2BundleRequest, options?: RequestOptions): Promise<components.V2BundleResponse>;
119
135
  }
@@ -1 +1 @@
1
- {"version":3,"file":"earn.d.ts","sourceRoot":"","sources":["../../../src/sdk/earn.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAE,cAAc,E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,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAQzC;;;;;;;;;;;OAWG;IACG,QAAQ,CACZ,OAAO,EAAE,UAAU,CAAC,eAAe,EACnC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC;IAQvC;;;;;;;;;;;;;;;;;OAiBG;IACG,UAAU,CACd,OAAO,EAAE,UAAU,CAAC,eAAe,EACnC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC;CAOxC"}
@@ -16,7 +16,14 @@ export class Earn extends ClientSDK {
16
16
  * List earn positions
17
17
  *
18
18
  * @remarks
19
- * This endpoint fetches all Compass Earn positions with PnL information.
19
+ * List all Earn positions for a given owner with PnL tracking.
20
+ *
21
+ * Returns position data including current balance, cost basis, and profit and loss.
22
+ * Use this endpoint to display portfolio performance, track yields over time, or build
23
+ * position management interfaces.
24
+ *
25
+ * Positions are tracked across all venue types (vaults and Aave markets). Each
26
+ * position includes the venue address, deposited amount, and performance metrics.
20
27
  */
21
28
  async earnPositions(request, options) {
22
29
  return unwrapAsync(earnEarnPositions(this, request, options));
@@ -25,9 +32,13 @@ export class Earn extends ClientSDK {
25
32
  * List vaults
26
33
  *
27
34
  * @remarks
28
- * List information about 4626 vaults.
35
+ * List ERC-4626 yield vaults across DeFi venues.
36
+ *
37
+ * Returns vault data including APY, TVL, and underlying asset information. Use this endpoint to discover yield opportunities, compare rates across venues, or build vault selection interfaces.
38
+ *
39
+ * Supports dozens of vaults and markets like Morpho and other ERC-4626 compatible yield venues.
29
40
  *
30
- * These are earn opportunities for protocols like morpho.
41
+ * To deposit into a vault, use the [manage endpoint](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position) with `venue_type=VAULTS`.
31
42
  */
32
43
  async earnVaults(request, options) {
33
44
  return unwrapAsync(earnEarnVaults(this, request, options));
@@ -36,16 +47,13 @@ export class Earn extends ClientSDK {
36
47
  * List aave markets
37
48
  *
38
49
  * @remarks
39
- * List all aave markets with their supply and borrow rates.
50
+ * List Aave lending markets with supply and borrow rates.
40
51
  *
41
- * Returns rates organized by token symbol, with chain-specific data for each token.
42
- * Each token includes rates for all chains where it's available, plus information
43
- * about which chain offers the highest supply APY.
52
+ * Returns rates organized by token symbol, with chain-specific data for each token. Each token includes rates for all chains where it's available, plus information about which chain offers the highest supply APY.
44
53
  *
45
- * APY values are returned in percentage format (e.g., 4.5 means 4.5%). Tokens with
46
- * zero APY on both supply and borrow are excluded.
54
+ * APY values are returned in percentage format (e.g., 4.5 means 4.5%). Tokens with zero APY on both supply and borrow are excluded.
47
55
  *
48
- * Optionally filter by chain.
56
+ * To deposit into an Aave market, use the [manage endpoint](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position) with `venue_type=AAVE`.
49
57
  */
50
58
  async earnAaveMarkets(request, options) {
51
59
  return unwrapAsync(earnEarnAaveMarkets(this, request, options));
@@ -54,17 +62,15 @@ export class Earn extends ClientSDK {
54
62
  * Create earn account
55
63
  *
56
64
  * @remarks
57
- * Create an Earn Account.
65
+ * Create an Earn Account for a wallet address.
58
66
  *
59
- * Before creating Earn positions, the `owner` must create an Earn Account associated with their wallet address.
67
+ * Before depositing into venues or managing positions, the owner must create an Earn Account. Each wallet address has one Earn Account per chain.
60
68
  *
61
- * Only the `owner` has the authority to sign transactions for this account. This can be done in one of two ways:
69
+ * Returns an unsigned transaction to create the account. The `sender` signs and broadcasts this transaction.
62
70
  *
63
- * 1) **No gas-sponsorship:** The `owner` signs a transaction and submits it to the network for execution. The `owner` covers the cost of gas in this case.
71
+ * **If owner pays gas:** Set `sender` to the owner's address.
64
72
  *
65
- * 2) **Gas-sponsorship:** The `owner` does an off-chain EIP-712 signature and submits this signature to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`). Here, another wallet address is set as `sender`. This wallet will sign, submit and cover the gas fees of the transaction.
66
- *
67
- * The creation of an Earn Account itself can be a gas-sponsored transaction by setting the `sender` to the wallet which will sign and send the transaction.
73
+ * **If someone else pays gas:** Set `sender` to the wallet that will sign and broadcast the transaction on behalf of the owner.
68
74
  */
69
75
  async earnCreateAccount(request, options) {
70
76
  return unwrapAsync(earnEarnCreateAccount(this, request, options));
@@ -73,14 +79,23 @@ export class Earn extends ClientSDK {
73
79
  * Transfer tokens to/from account
74
80
  *
75
81
  * @remarks
76
- * Transfer tokens to and from an Earn Account.
82
+ * Transfer tokens between an owner's wallet and their Earn Account.
83
+ *
84
+ * Use `DEPOSIT` to move tokens from the owner's wallet into their Earn Account. Use `WITHDRAW` to move tokens from the Earn Account back to the owner's wallet.
85
+ *
86
+ * **Gas-sponsored deposits** require two steps:
77
87
  *
78
- * If `DEPOSIT`'` is selected, tokens will be transferred from the `owner`'s wallet into their Earn Account.
88
+ * **Step 1 (once per token):** Set up Permit2 allowance
89
+ * 1. Call [/gas_sponsorship/approve_transfer](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/approve-token-transfer) to get EIP-712 typed data
90
+ * 2. Owner signs the typed data
91
+ * 3. Submit signature + typed data to [/gas_sponsorship/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction)
79
92
  *
80
- * If `WITHDRAW` is selected, tokens will be transferred from the `owner`'s Earn Account into their wallet.
93
+ * **Step 2 (each transfer):** Execute the gas-sponsored transfer
94
+ * 1. Call this endpoint with `gas_sponsorship=true` to get EIP-712 typed data
95
+ * 2. Owner signs the typed data
96
+ * 3. Submit signature + typed data to [/gas_sponsorship/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction)
81
97
  *
82
- * If a gas-sponsored `DEPOSIT` transfer is desired for a given token, a one-time Permit2 allowance must be set before proceeding. This is common practice for many other applications and, for many `owner`s, this one-time allowance will already have been set for the token they would like to transfer.
83
- * Once the one-time allowance is set for a given token and `gas_sponsorship` is set to 'true', EIP-712 typed data will be returned and can be signed off-chain by the user. This signature can then be submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`) where a `sender` can be set for the transaction.
98
+ * **Note:** This endpoint moves tokens to/from the Earn Account itself—not into yield venues. To deposit into a vault or Aave market, use the [manage endpoint](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position).
84
99
  */
85
100
  async earnTransfer(request, options) {
86
101
  return unwrapAsync(earnEarnTransfer(this, request, options));
@@ -89,24 +104,20 @@ export class Earn extends ClientSDK {
89
104
  * Manage earn position
90
105
  *
91
106
  * @remarks
92
- * Manage an Earn position for a given `owner`'s Earn Account.
107
+ * Deposit into or withdraw from a yield venue.
93
108
  *
94
- * The `owner` is the main wallet address that owns and controls the Earn Account. It is not the Earn Account address itself.
109
+ * Use `DEPOSIT` to move tokens from the Earn Account into a vault or Aave market. Use `WITHDRAW` to move tokens back from a venue into the Earn Account.
95
110
  *
96
- * Venue Types:
97
- * - VAULTS
98
- * - AAVE
111
+ * **Venue types:**
112
+ * - `VAULTS`: ERC-4626 vaults (see [/vaults](https://docs.compasslabs.ai/v2/api-reference/earn/list-vaults) for available options)
113
+ * - `AAVE`: Aave lending pools (see [/aave_markets](https://docs.compasslabs.ai/v2/api-reference/earn/list-aave-markets) for available options)
99
114
  *
100
- * If `DEPOSIT` is selected for `action`, tokens will be deposited into the selected venue address from the Earn Account associated with the `owner` wallet.
115
+ * **Fees:** A fee can be configured and deducted from the transaction amount:
116
+ * - `FIXED`: A fixed token amount (e.g., 0.1 means 0.1 tokens)
117
+ * - `PERCENTAGE`: A percentage of the amount (e.g., 1.5 means 1.5%)
118
+ * - `PERFORMANCE`: A percentage of realized profit (withdrawals only)
101
119
  *
102
- * 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.
103
- *
104
- * A fee can be configured. This fee is deducted from the total `amount`. It can be expressed as:
105
- * - `FIXED`: a fixed token amount (e.g., 0.1 means 0.1 tokens)
106
- * - `PERCENTAGE`: a percentage of the transaction amount (e.g., 1.5 means 1.5%)
107
- * - `PERFORMANCE`: a percentage of realized profit using FIFO cost basis (e.g., 10 means 10% of profit). Only applicable for withdrawals.
108
- *
109
- * 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.
120
+ * **Gas sponsorship:** Set `gas_sponsorship=true` to receive EIP-712 typed data. Owner signs the typed data, then submit to [/gas_sponsorship/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction).
110
121
  */
111
122
  async earnManage(request, options) {
112
123
  return unwrapAsync(earnEarnManage(this, request, options));
@@ -116,6 +127,12 @@ export class Earn extends ClientSDK {
116
127
  *
117
128
  * @remarks
118
129
  * Swap tokens within an Earn Account.
130
+ *
131
+ * Use this endpoint to exchange one token for another without transferring funds out of the Earn Account.
132
+ *
133
+ * The swap executes atomically within the Earn Account and can be combined with other actions using the [bundle endpoint](https://docs.compasslabs.ai/v2/api-reference/earn/execute-multiple-earn-actions). For example, swap ETH to USDC, then deposit USDC into a vault—all in one transaction.
134
+ *
135
+ * Returns either an unsigned transaction (when `gas_sponsorship=false`) or EIP-712 typed data for off-chain signing (when `gas_sponsorship=true`). For gas-sponsored swaps, submit the signed typed data to `/gas_sponsorship/prepare`.
119
136
  */
120
137
  async earnSwap(request, options) {
121
138
  return unwrapAsync(earnEarnSwap(this, request, options));
@@ -124,20 +141,19 @@ export class Earn extends ClientSDK {
124
141
  * Execute multiple earn actions
125
142
  *
126
143
  * @remarks
127
- * This endpoint allows combining multiple actions (swaps, vault
128
- * deposits/withdrawals, Aave deposits/withdrawals) into a single atomic transaction
129
- * executed via the Earn account).
144
+ * Combine multiple actions into a single atomic transaction.
145
+ *
146
+ * Bundle swaps and venue deposits/withdrawals into one transaction executed through the Earn Account. This saves gas compared to executing actions separately and ensures all actions succeed or fail together.
130
147
  *
131
- * **Example Use Case:** Swap USDC to AUSD, then deposit AUSD into a vault - all in one transaction.
148
+ * **Example:** Swap AUSD to USDC, then deposit USDC into a vault - all in one transaction.
132
149
  *
133
- * Actions are executed in the order they are provided. Each action type has its own parameters:
150
+ * **Action types:**
151
+ * - `V2_SWAP`: Swap tokens within the Earn Account
152
+ * - `V2_MANAGE`: Deposit/withdraw to ERC-4626 vaults or Aave markets
134
153
  *
135
- * - **V2_SWAP**: Swapping tokens within the Earn Account
136
- * - **V2_MANAGE**: Manage positions - deposit/withdraw to ERC-4626 vaults or Aave lending pool
154
+ * Actions execute in the order provided.
137
155
  *
138
- * The bundled transaction can be gas-sponsored by setting `gas_sponsorship=true`.
139
- * This returns EIP-712 typed data that the owner must sign and submit to
140
- * `/gas_sponsorship/prepare` for execution by a gas sponsor.
156
+ * **Gas sponsorship:** Set `gas_sponsorship=true` to receive EIP-712 typed data. Owner signs the typed data, then submit to [/gas_sponsorship/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction).
141
157
  */
142
158
  async earnBundle(request, options) {
143
159
  return unwrapAsync(earnEarnBundle(this, request, options));
@@ -1 +1 @@
1
- {"version":3,"file":"earn.js","sourceRoot":"","sources":["../../../src/sdk/earn.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MA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AAO,WAAW,CAAC,cAAc,CAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,eAAe,CACnB,OAA4C,EAC5C,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,iBAAiB,CACrB,OAAwC,EACxC,OAAwB;QAExB,OAAO,WAAW,CAAC,qBAAqB,CACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAK,CAAC,YAAY,CAChB,OAAuC,EACvC,OAAwB;QAExB,OAAO,WAAW,CAAC,gBAAgB,CACjC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,UAAU,CACd,OAAqC,EACrC,OAAwB;QAExB,OAAO,WAAW,CAAC,cAAc,CAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,QAAQ,CACZ,OAAmC,EACnC,OAAwB;QAExB,OAAO,WAAW,CAAC,YAAY,CAC7B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,UAAU,CACd,OAAmC,EACnC,OAAwB;QAExB,OAAO,WAAW,CAAC,cAAc,CAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -5,27 +5,33 @@ export declare class GasSponsorship extends ClientSDK {
5
5
  * Prepare gas-sponsored transaction
6
6
  *
7
7
  * @remarks
8
- * Prepare a gas-sponsored transaction to be signed and submitted by `sender`.
8
+ * Prepare a gas-sponsored transaction from signed EIP-712 typed data.
9
9
  *
10
- * The `owner` submits their off-chain signature of EIP-712 typed data along with the data itself.
10
+ * Submit the `owner`'s off-chain signature along with the EIP-712 typed data that was signed. Returns an unsigned transaction for the `sender` to sign and broadcast.
11
11
  *
12
- * The `sender` will sign and submit the transaction returned from this endpoint, effectively sponsoring the gas for the transaction on behalf of the `owner`.
12
+ * **How gas sponsorship works:**
13
+ * 1. Call an endpoint with `gas_sponsorship=true` (e.g., [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account), [/earn/manage](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position)) to get EIP-712 typed data
14
+ * 2. Owner signs the typed data off-chain
15
+ * 3. Submit signature + typed data to this endpoint
16
+ * 4. Sender signs and broadcasts the returned transaction, paying gas on behalf of the owner
17
+ *
18
+ * **Note:** For gas-sponsored deposits via [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account), the owner must first set up a Permit2 allowance using [/approve_transfer](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/approve-token-transfer) (once per token).
13
19
  */
14
20
  gasSponsorshipPrepare(request: components.SponsorGasRequest, options?: RequestOptions): Promise<components.SponsorGasResponse>;
15
21
  /**
16
22
  * Approve token transfer
17
23
  *
18
24
  * @remarks
19
- * Prepare a one-time permit2 approval transaction for a given token.
25
+ * Set up a one-time Permit2 allowance for gas-sponsored token transfers.
26
+ *
27
+ * Only required when using [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) with `gas_sponsorship=true`. This allowance only needs to be set up once per token.
20
28
  *
21
- * This is only required if the `owner` would like to transfer tokens from their wallet to their Earn Account with gas-sponsorship.
29
+ * **With gas sponsorship (`gas_sponsorship=true`):**
30
+ * - Returns EIP-712 typed data for the owner to sign off-chain
31
+ * - Submit signature + typed data to [/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction)
32
+ * - Only works for tokens that support EIP-2612 permit (e.g., USDC)
22
33
  *
23
- * This approval transaction itself can be submitted with gas-sponsorship.
24
- * In this case, EIP-712 typed data will be returned and should be signed by the `owner` off-chain.
25
- * This signature can then be submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`).
26
- * Gas-sponsored approvals can only be achieved by ERC-20 tokens that support permit (EIP-2612).
27
- * Some tokens, like USDT and WETH, do not allow for this behavior.
28
- * In the case of non-permit tokens, the one-time approval transaction can be submitted in the conventional manner where the `owner` must sign, submit and pay gas for the transaction.
34
+ * Some tokens, like USDT and WETH, do not support EIP-2612 permit. For these tokens, set `gas_sponsorship=false` to receive an unsigned transaction that the owner must sign, submit, and pay gas for.
29
35
  */
30
36
  gasSponsorshipApproveTransfer(request: components.ApproveTransferRequest, options?: RequestOptions): Promise<components.ApproveTransferResponse>;
31
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gassponsorship.d.ts","sourceRoot":"","sources":["../../../src/sdk/gassponsorship.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,cAAe,SAAQ,SAAS;IAC3C;;;;;;;;;OASG;IACG,qBAAqB,CACzB,OAAO,EAAE,UAAU,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAQzC;;;;;;;;;;;;;;OAcG;IACG,6BAA6B,CACjC,OAAO,EAAE,UAAU,CAAC,sBAAsB,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC;CAO/C"}
1
+ {"version":3,"file":"gassponsorship.d.ts","sourceRoot":"","sources":["../../../src/sdk/gassponsorship.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,cAAe,SAAQ,SAAS;IAC3C;;;;;;;;;;;;;;;OAeG;IACG,qBAAqB,CACzB,OAAO,EAAE,UAAU,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAQzC;;;;;;;;;;;;;;OAcG;IACG,6BAA6B,CACjC,OAAO,EAAE,UAAU,CAAC,sBAAsB,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC;CAO/C"}
@@ -10,11 +10,17 @@ export class GasSponsorship extends ClientSDK {
10
10
  * Prepare gas-sponsored transaction
11
11
  *
12
12
  * @remarks
13
- * Prepare a gas-sponsored transaction to be signed and submitted by `sender`.
13
+ * Prepare a gas-sponsored transaction from signed EIP-712 typed data.
14
14
  *
15
- * The `owner` submits their off-chain signature of EIP-712 typed data along with the data itself.
15
+ * Submit the `owner`'s off-chain signature along with the EIP-712 typed data that was signed. Returns an unsigned transaction for the `sender` to sign and broadcast.
16
16
  *
17
- * The `sender` will sign and submit the transaction returned from this endpoint, effectively sponsoring the gas for the transaction on behalf of the `owner`.
17
+ * **How gas sponsorship works:**
18
+ * 1. Call an endpoint with `gas_sponsorship=true` (e.g., [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account), [/earn/manage](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position)) to get EIP-712 typed data
19
+ * 2. Owner signs the typed data off-chain
20
+ * 3. Submit signature + typed data to this endpoint
21
+ * 4. Sender signs and broadcasts the returned transaction, paying gas on behalf of the owner
22
+ *
23
+ * **Note:** For gas-sponsored deposits via [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account), the owner must first set up a Permit2 allowance using [/approve_transfer](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/approve-token-transfer) (once per token).
18
24
  */
19
25
  async gasSponsorshipPrepare(request, options) {
20
26
  return unwrapAsync(gasSponsorshipGasSponsorshipPrepare(this, request, options));
@@ -23,16 +29,16 @@ export class GasSponsorship extends ClientSDK {
23
29
  * Approve token transfer
24
30
  *
25
31
  * @remarks
26
- * Prepare a one-time permit2 approval transaction for a given token.
32
+ * Set up a one-time Permit2 allowance for gas-sponsored token transfers.
33
+ *
34
+ * Only required when using [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) with `gas_sponsorship=true`. This allowance only needs to be set up once per token.
27
35
  *
28
- * This is only required if the `owner` would like to transfer tokens from their wallet to their Earn Account with gas-sponsorship.
36
+ * **With gas sponsorship (`gas_sponsorship=true`):**
37
+ * - Returns EIP-712 typed data for the owner to sign off-chain
38
+ * - Submit signature + typed data to [/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction)
39
+ * - Only works for tokens that support EIP-2612 permit (e.g., USDC)
29
40
  *
30
- * This approval transaction itself can be submitted with gas-sponsorship.
31
- * In this case, EIP-712 typed data will be returned and should be signed by the `owner` off-chain.
32
- * This signature can then be submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`).
33
- * Gas-sponsored approvals can only be achieved by ERC-20 tokens that support permit (EIP-2612).
34
- * Some tokens, like USDT and WETH, do not allow for this behavior.
35
- * In the case of non-permit tokens, the one-time approval transaction can be submitted in the conventional manner where the `owner` must sign, submit and pay gas for the transaction.
41
+ * Some tokens, like USDT and WETH, do not support EIP-2612 permit. For these tokens, set `gas_sponsorship=false` to receive an unsigned transaction that the owner must sign, submit, and pay gas for.
36
42
  */
37
43
  async gasSponsorshipApproveTransfer(request, options) {
38
44
  return unwrapAsync(gasSponsorshipGasSponsorshipApproveTransfer(this, request, options));
@@ -1 +1 @@
1
- {"version":3,"file":"gassponsorship.js","sourceRoot":"","sources":["../../../src/sdk/gassponsorship.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,2CAA2C,EAAE,MAAM,yDAAyD,CAAC;AACtH,OAAO,EAAE,mCAAmC,EAAE,MAAM,iDAAiD,CAAC;AACtG,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,cAAe,SAAQ,SAAS;IAC3C;;;;;;;;;OASG;IACH,KAAK,CAAC,qBAAqB,CACzB,OAAqC,EACrC,OAAwB;QAExB,OAAO,WAAW,CAAC,mCAAmC,CACpD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,6BAA6B,CACjC,OAA0C,EAC1C,OAAwB;QAExB,OAAO,WAAW,CAAC,2CAA2C,CAC5D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"gassponsorship.js","sourceRoot":"","sources":["../../../src/sdk/gassponsorship.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,2CAA2C,EAAE,MAAM,yDAAyD,CAAC;AACtH,OAAO,EAAE,mCAAmC,EAAE,MAAM,iDAAiD,CAAC;AACtG,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,cAAe,SAAQ,SAAS;IAC3C;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,qBAAqB,CACzB,OAAqC,EACrC,OAAwB;QAExB,OAAO,WAAW,CAAC,mCAAmC,CACpD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,6BAA6B,CACjC,OAA0C,EAC1C,OAAwB;QAExB,OAAO,WAAW,CAAC,2CAA2C,CAC5D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -16,7 +16,7 @@ let value: ApproveTransferRequest = {
16
16
 
17
17
  | Field | Type | Required | Description | Example |
18
18
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
19
- | `owner` | *string* | :heavy_check_mark: | The owner of the smart account's address. | 0x01E62835dd7F52173546A325294762143eE4a882 |
19
+ | `owner` | *string* | :heavy_check_mark: | The wallet address that owns the Earn Account. | 0x01E62835dd7F52173546A325294762143eE4a882 |
20
20
  | `chain` | [components.Chain](../../models/components/chain.md) | :heavy_check_mark: | The chain to use. | |
21
21
  | `token` | *string* | :heavy_check_mark: | The token you would like to transfer with gas sponsorship. | USDT |
22
22
  | `gasSponsorship` | *boolean* | :heavy_minus_sign: | Optionally request gas sponsorship. If set to `true`, EIP-712 signature data will be returned that must be signed by the `owner` and submitted to the `/gas_sponsorship/prepare` endpoint. | false |
@@ -54,7 +54,7 @@ let value: BatchedSafeOperationsResponseInput = {
54
54
 
55
55
  | Field | Type | Required | Description |
56
56
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
57
- | `domain` | [components.CompassApiBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain](../../models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.md) | :heavy_check_mark: | The EIP-712 domain separator for Safe transactions. |
57
+ | `domain` | [components.CompassApiBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain](../../models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.md) | :heavy_check_mark: | The EIP-712 domain separator. |
58
58
  | `types` | [components.CompassApiBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types](../../models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712types.md) | :heavy_check_mark: | The type definitions for EIP-712 structured data. |
59
59
  | `primaryType` | *"SafeTx"* | :heavy_check_mark: | Primary type for the structured data |
60
- | `message` | [components.SafeTxMessage](../../models/components/safetxmessage.md) | :heavy_check_mark: | The message data for a Safe transaction. |
60
+ | `message` | [components.SafeTxMessage](../../models/components/safetxmessage.md) | :heavy_check_mark: | The message data for the transaction. |
@@ -36,7 +36,7 @@ let value: BatchedSafeOperationsResponseOutput = {
36
36
 
37
37
  | Field | Type | Required | Description |
38
38
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
39
- | `domain` | [components.CompassApiBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain](../../models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.md) | :heavy_check_mark: | The EIP-712 domain separator for Safe transactions. |
39
+ | `domain` | [components.CompassApiBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain](../../models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.md) | :heavy_check_mark: | The EIP-712 domain separator. |
40
40
  | `types` | [components.CompassApiBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types](../../models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712types.md) | :heavy_check_mark: | The type definitions for EIP-712 structured data. |
41
41
  | `primaryType` | *"SafeTx"* | :heavy_check_mark: | Primary type for the structured data |
42
- | `message` | [components.SafeTxMessage](../../models/components/safetxmessage.md) | :heavy_check_mark: | The message data for a Safe transaction. |
42
+ | `message` | [components.SafeTxMessage](../../models/components/safetxmessage.md) | :heavy_check_mark: | The message data for the transaction. |
@@ -1,6 +1,6 @@
1
1
  # CompassApiBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain
2
2
 
3
- The EIP-712 domain separator for Safe transactions.
3
+ The EIP-712 domain separator.
4
4
 
5
5
  ## Example Usage
6
6
 
@@ -17,7 +17,7 @@ let value:
17
17
 
18
18
  ## Fields
19
19
 
20
- | Field | Type | Required | Description |
21
- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- |
22
- | `chainId` | *number* | :heavy_check_mark: | Chain ID for the Safe transaction |
23
- | `verifyingContract` | *string* | :heavy_check_mark: | Address of the Safe contract |
20
+ | Field | Type | Required | Description |
21
+ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
22
+ | `chainId` | *number* | :heavy_check_mark: | Chain ID |
23
+ | `verifyingContract` | *string* | :heavy_check_mark: | Address of the Product Account |