@compass-labs/api-sdk 2.2.21 → 2.2.22

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 (65) hide show
  1. package/README.md +2 -2
  2. package/codeSamples_typescript.yaml +1 -1
  3. package/dist/commonjs/funcs/creditCreditTransfer.d.ts +10 -9
  4. package/dist/commonjs/funcs/creditCreditTransfer.d.ts.map +1 -1
  5. package/dist/commonjs/funcs/creditCreditTransfer.js +10 -9
  6. package/dist/commonjs/funcs/creditCreditTransfer.js.map +1 -1
  7. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipApproveTransfer.d.ts +1 -1
  8. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipApproveTransfer.js +1 -1
  9. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipPrepare.d.ts +2 -2
  10. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipPrepare.js +2 -2
  11. package/dist/commonjs/lib/config.d.ts +2 -2
  12. package/dist/commonjs/lib/config.js +2 -2
  13. package/dist/commonjs/models/components/credittransferrequest.d.ts +30 -1
  14. package/dist/commonjs/models/components/credittransferrequest.d.ts.map +1 -1
  15. package/dist/commonjs/models/components/credittransferrequest.js +18 -1
  16. package/dist/commonjs/models/components/credittransferrequest.js.map +1 -1
  17. package/dist/commonjs/models/components/credittransferresponse.d.ts +8 -1
  18. package/dist/commonjs/models/components/credittransferresponse.d.ts.map +1 -1
  19. package/dist/commonjs/models/components/credittransferresponse.js +17 -2
  20. package/dist/commonjs/models/components/credittransferresponse.js.map +1 -1
  21. package/dist/commonjs/sdk/credit.d.ts +10 -9
  22. package/dist/commonjs/sdk/credit.d.ts.map +1 -1
  23. package/dist/commonjs/sdk/credit.js +10 -9
  24. package/dist/commonjs/sdk/credit.js.map +1 -1
  25. package/dist/commonjs/sdk/gassponsorship.d.ts +3 -3
  26. package/dist/commonjs/sdk/gassponsorship.js +3 -3
  27. package/dist/esm/funcs/creditCreditTransfer.d.ts +10 -9
  28. package/dist/esm/funcs/creditCreditTransfer.d.ts.map +1 -1
  29. package/dist/esm/funcs/creditCreditTransfer.js +10 -9
  30. package/dist/esm/funcs/creditCreditTransfer.js.map +1 -1
  31. package/dist/esm/funcs/gasSponsorshipGasSponsorshipApproveTransfer.d.ts +1 -1
  32. package/dist/esm/funcs/gasSponsorshipGasSponsorshipApproveTransfer.js +1 -1
  33. package/dist/esm/funcs/gasSponsorshipGasSponsorshipPrepare.d.ts +2 -2
  34. package/dist/esm/funcs/gasSponsorshipGasSponsorshipPrepare.js +2 -2
  35. package/dist/esm/lib/config.d.ts +2 -2
  36. package/dist/esm/lib/config.js +2 -2
  37. package/dist/esm/models/components/credittransferrequest.d.ts +30 -1
  38. package/dist/esm/models/components/credittransferrequest.d.ts.map +1 -1
  39. package/dist/esm/models/components/credittransferrequest.js +17 -0
  40. package/dist/esm/models/components/credittransferrequest.js.map +1 -1
  41. package/dist/esm/models/components/credittransferresponse.d.ts +8 -1
  42. package/dist/esm/models/components/credittransferresponse.d.ts.map +1 -1
  43. package/dist/esm/models/components/credittransferresponse.js +15 -1
  44. package/dist/esm/models/components/credittransferresponse.js.map +1 -1
  45. package/dist/esm/sdk/credit.d.ts +10 -9
  46. package/dist/esm/sdk/credit.d.ts.map +1 -1
  47. package/dist/esm/sdk/credit.js +10 -9
  48. package/dist/esm/sdk/credit.js.map +1 -1
  49. package/dist/esm/sdk/gassponsorship.d.ts +3 -3
  50. package/dist/esm/sdk/gassponsorship.js +3 -3
  51. package/docs/models/components/credittransferrequest.md +10 -6
  52. package/docs/models/components/credittransferrequestaction.md +17 -0
  53. package/docs/models/components/credittransferresponse.md +4 -3
  54. package/docs/models/components/credittransferresponseeip712.md +97 -0
  55. package/docs/sdks/credit/README.md +12 -9
  56. package/docs/sdks/gassponsorship/README.md +3 -3
  57. package/package.json +1 -1
  58. package/src/funcs/creditCreditTransfer.ts +10 -9
  59. package/src/funcs/gasSponsorshipGasSponsorshipApproveTransfer.ts +1 -1
  60. package/src/funcs/gasSponsorshipGasSponsorshipPrepare.ts +2 -2
  61. package/src/lib/config.ts +2 -2
  62. package/src/models/components/credittransferrequest.ts +44 -1
  63. package/src/models/components/credittransferresponse.ts +45 -2
  64. package/src/sdk/credit.ts +10 -9
  65. package/src/sdk/gassponsorship.ts +3 -3
package/README.md CHANGED
@@ -171,7 +171,7 @@ run();
171
171
  * [creditPositions](docs/sdks/credit/README.md#creditpositions) - List credit positions
172
172
  * [creditCreateAccount](docs/sdks/credit/README.md#creditcreateaccount) - Create credit account
173
173
  * [creditBorrow](docs/sdks/credit/README.md#creditborrow) - Borrow against collateral
174
- * [creditTransfer](docs/sdks/credit/README.md#credittransfer) - Get Permit2 signature data for Credit Account transfer
174
+ * [creditTransfer](docs/sdks/credit/README.md#credittransfer) - Transfer tokens to/from Credit Account
175
175
  * [creditRepay](docs/sdks/credit/README.md#creditrepay) - Repay debt and withdraw collateral
176
176
  * [creditBundle](docs/sdks/credit/README.md#creditbundle) - Execute multiple credit actions atomically
177
177
 
@@ -334,7 +334,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
334
334
  - [`creditCreditCreateAccount`](docs/sdks/credit/README.md#creditcreateaccount) - Create credit account
335
335
  - [`creditCreditPositions`](docs/sdks/credit/README.md#creditpositions) - List credit positions
336
336
  - [`creditCreditRepay`](docs/sdks/credit/README.md#creditrepay) - Repay debt and withdraw collateral
337
- - [`creditCreditTransfer`](docs/sdks/credit/README.md#credittransfer) - Get Permit2 signature data for Credit Account transfer
337
+ - [`creditCreditTransfer`](docs/sdks/credit/README.md#credittransfer) - Transfer tokens to/from Credit Account
338
338
  - [`earnEarnAaveMarkets`](docs/sdks/earn/README.md#earnaavemarkets) - List aave markets
339
339
  - [`earnEarnBalances`](docs/sdks/earn/README.md#earnbalances) - Get token balances
340
340
  - [`earnEarnBundle`](docs/sdks/earn/README.md#earnbundle) - Execute multiple earn actions
@@ -530,7 +530,7 @@ actions:
530
530
  "x-codeSamples":
531
531
  - "lang": "typescript"
532
532
  "label": "Typescript (SDK)"
533
- "source": "import { CompassApiSDK } from \"@compass-labs/api-sdk\";\n\nconst compassApiSDK = new CompassApiSDK({\n apiKeyAuth: \"<YOUR_API_KEY_HERE>\",\n});\n\nasync function run() {\n const result = await compassApiSDK.credit.creditTransfer({\n owner: \"0x4A83fec8c6A9A25Be28f3242a16dBaD0ab00f3a6\",\n chain: \"base\",\n token: \"USDC\",\n amount: 100,\n });\n\n console.log(result);\n}\n\nrun();"
533
+ "source": "import { CompassApiSDK } from \"@compass-labs/api-sdk\";\n\nconst compassApiSDK = new CompassApiSDK({\n apiKeyAuth: \"<YOUR_API_KEY_HERE>\",\n});\n\nasync function run() {\n const result = await compassApiSDK.credit.creditTransfer({\n owner: \"0x4A83fec8c6A9A25Be28f3242a16dBaD0ab00f3a6\",\n chain: \"base\",\n token: \"USDC\",\n amount: 100,\n action: \"DEPOSIT\",\n });\n\n console.log(result);\n}\n\nrun();"
534
534
  - target: $["paths"]["/v2/earn/aave_markets"]["get"]
535
535
  update:
536
536
  "x-codeSamples":
@@ -9,19 +9,20 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
9
9
  import { APIPromise } from "../types/async.js";
10
10
  import { Result } from "../types/fp.js";
11
11
  /**
12
- * Get Permit2 signature data for Credit Account transfer
12
+ * Transfer tokens to/from Credit Account
13
13
  *
14
14
  * @remarks
15
- * Generate Permit2 EIP-712 typed data for transferring tokens from the owner's EOA
16
- * to a Credit Account.
15
+ * Transfer tokens between the owner's EOA and their Credit Account.
17
16
  *
18
- * The owner signs the returned EIP-712 data, then includes the signature in a `/v2/credit/borrow`
19
- * or `/v2/credit/repay` request to atomically pull tokens from their EOA as part of the bundle.
17
+ * **DEPOSIT** (EOA Credit Account):
18
+ * - With `gas_sponsorship=true`: returns Permit2 EIP-712 typed data to sign. The gas sponsor
19
+ * calls `permitTransferFrom` to pull tokens (1 signature).
20
+ * - With `gas_sponsorship=false`: returns an unsigned ERC-20 transfer transaction.
20
21
  *
21
- * **Flow:**
22
- * 1. Call this endpoint to get the Permit2 typed data
23
- * 2. Sign the typed data with the owner's wallet
24
- * 3. Call `/v2/credit/borrow` or `/v2/credit/repay` with the `permit2_signature`, `permit2_nonce`, and `permit2_deadline` fields
22
+ * **WITHDRAW** (Credit Account → EOA):
23
+ * - With `gas_sponsorship=true`: returns SafeTx EIP-712 typed data to sign. The gas sponsor
24
+ * broadcasts the `execTransaction` (1 signature).
25
+ * - With `gas_sponsorship=false`: returns an unsigned `execTransaction`.
25
26
  */
26
27
  export declare function creditCreditTransfer(client: CompassApiSDKCore, request: components.CreditTransferRequest, options?: RequestOptions): APIPromise<Result<components.CreditTransferResponse, errors.HTTPValidationError | CompassAPISDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
27
28
  //# sourceMappingURL=creditCreditTransfer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"creditCreditTransfer.d.ts","sourceRoot":"","sources":["../../../src/funcs/creditCreditTransfer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAK/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,sBAAsB,EAC/B,MAAM,CAAC,mBAAmB,GAC1B,kBAAkB,GAClB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
1
+ {"version":3,"file":"creditCreditTransfer.d.ts","sourceRoot":"","sources":["../../../src/funcs/creditCreditTransfer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAK/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,sBAAsB,EAC/B,MAAM,CAAC,mBAAmB,GAC1B,kBAAkB,GAClB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
@@ -47,19 +47,20 @@ const components = __importStar(require("../models/components/index.js"));
47
47
  const errors = __importStar(require("../models/errors/index.js"));
48
48
  const async_js_1 = require("../types/async.js");
49
49
  /**
50
- * Get Permit2 signature data for Credit Account transfer
50
+ * Transfer tokens to/from Credit Account
51
51
  *
52
52
  * @remarks
53
- * Generate Permit2 EIP-712 typed data for transferring tokens from the owner's EOA
54
- * to a Credit Account.
53
+ * Transfer tokens between the owner's EOA and their Credit Account.
55
54
  *
56
- * The owner signs the returned EIP-712 data, then includes the signature in a `/v2/credit/borrow`
57
- * or `/v2/credit/repay` request to atomically pull tokens from their EOA as part of the bundle.
55
+ * **DEPOSIT** (EOA Credit Account):
56
+ * - With `gas_sponsorship=true`: returns Permit2 EIP-712 typed data to sign. The gas sponsor
57
+ * calls `permitTransferFrom` to pull tokens (1 signature).
58
+ * - With `gas_sponsorship=false`: returns an unsigned ERC-20 transfer transaction.
58
59
  *
59
- * **Flow:**
60
- * 1. Call this endpoint to get the Permit2 typed data
61
- * 2. Sign the typed data with the owner's wallet
62
- * 3. Call `/v2/credit/borrow` or `/v2/credit/repay` with the `permit2_signature`, `permit2_nonce`, and `permit2_deadline` fields
60
+ * **WITHDRAW** (Credit Account → EOA):
61
+ * - With `gas_sponsorship=true`: returns SafeTx EIP-712 typed data to sign. The gas sponsor
62
+ * broadcasts the `execTransaction` (1 signature).
63
+ * - With `gas_sponsorship=false`: returns an unsigned `execTransaction`.
63
64
  */
64
65
  function creditCreditTransfer(client, request, options) {
65
66
  return new async_js_1.APIPromise($do(client, request, options));
@@ -1 +1 @@
1
- {"version":3,"file":"creditCreditTransfer.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditTransfer.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;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@@ -14,7 +14,7 @@ import { Result } from "../types/fp.js";
14
14
  * @remarks
15
15
  * Set up a one-time Permit2 allowance for gas-sponsored token transfers.
16
16
  *
17
- * 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.
17
+ * Required when using [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) or [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/transfer-tokens-tofrom-account) with `gas_sponsorship=true`. This allowance only needs to be set up once per token.
18
18
  *
19
19
  * **With gas sponsorship (`gas_sponsorship=true`):**
20
20
  * - Returns EIP-712 typed data for the owner to sign off-chain
@@ -52,7 +52,7 @@ const async_js_1 = require("../types/async.js");
52
52
  * @remarks
53
53
  * Set up a one-time Permit2 allowance for gas-sponsored token transfers.
54
54
  *
55
- * 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.
55
+ * Required when using [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) or [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/transfer-tokens-tofrom-account) with `gas_sponsorship=true`. This allowance only needs to be set up once per token.
56
56
  *
57
57
  * **With gas sponsorship (`gas_sponsorship=true`):**
58
58
  * - Returns EIP-712 typed data for the owner to sign off-chain
@@ -17,12 +17,12 @@ import { Result } from "../types/fp.js";
17
17
  * 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.
18
18
  *
19
19
  * **How gas sponsorship works:**
20
- * 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
20
+ * 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), [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/transfer-tokens-tofrom-account)) to get EIP-712 typed data
21
21
  * 2. Owner signs the typed data off-chain
22
22
  * 3. Submit signature + typed data to this endpoint
23
23
  * 4. Sender signs and broadcasts the returned transaction, paying gas on behalf of the owner
24
24
  *
25
- * **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).
25
+ * **Note:** For gas-sponsored deposits via [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) or [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/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).
26
26
  */
27
27
  export declare function gasSponsorshipGasSponsorshipPrepare(client: CompassApiSDKCore, request: components.SponsorGasRequest, options?: RequestOptions): APIPromise<Result<components.SponsorGasResponse, errors.HTTPValidationError | CompassAPISDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
28
28
  //# sourceMappingURL=gasSponsorshipGasSponsorshipPrepare.d.ts.map
@@ -55,12 +55,12 @@ const async_js_1 = require("../types/async.js");
55
55
  * 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.
56
56
  *
57
57
  * **How gas sponsorship works:**
58
- * 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
58
+ * 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), [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/transfer-tokens-tofrom-account)) to get EIP-712 typed data
59
59
  * 2. Owner signs the typed data off-chain
60
60
  * 3. Submit signature + typed data to this endpoint
61
61
  * 4. Sender signs and broadcasts the returned transaction, paying gas on behalf of the owner
62
62
  *
63
- * **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).
63
+ * **Note:** For gas-sponsored deposits via [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) or [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/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).
64
64
  */
65
65
  function gasSponsorshipGasSponsorshipPrepare(client, request, options) {
66
66
  return new async_js_1.APIPromise($do(client, request, options));
@@ -32,7 +32,7 @@ export declare const SDK_METADATA: {
32
32
  readonly language: "typescript";
33
33
  readonly openapiDocVersion: "0.0.1";
34
34
  readonly sdkVersion: "2.0.0";
35
- readonly genVersion: "2.839.0";
36
- readonly userAgent: "speakeasy-sdk/typescript 2.0.0 2.839.0 0.0.1 @compass-labs/api-sdk";
35
+ readonly genVersion: "2.841.0";
36
+ readonly userAgent: "speakeasy-sdk/typescript 2.0.0 2.841.0 0.0.1 @compass-labs/api-sdk";
37
37
  };
38
38
  //# sourceMappingURL=config.d.ts.map
@@ -32,7 +32,7 @@ exports.SDK_METADATA = {
32
32
  language: "typescript",
33
33
  openapiDocVersion: "0.0.1",
34
34
  sdkVersion: "2.0.0",
35
- genVersion: "2.839.0",
36
- userAgent: "speakeasy-sdk/typescript 2.0.0 2.839.0 0.0.1 @compass-labs/api-sdk",
35
+ genVersion: "2.841.0",
36
+ userAgent: "speakeasy-sdk/typescript 2.0.0 2.841.0 0.0.1 @compass-labs/api-sdk",
37
37
  };
38
38
  //# sourceMappingURL=config.js.map
@@ -1,9 +1,21 @@
1
1
  import * as z from "zod/v3";
2
+ import { ClosedEnum } from "../../types/enums.js";
2
3
  import { Chain } from "./chain.js";
3
4
  /**
4
5
  * The amount of tokens to transfer (in token units, not wei).
5
6
  */
6
7
  export type CreditTransferRequestAmount = number | string;
8
+ /**
9
+ * Whether you are depositing to or withdrawing from your credit account.
10
+ */
11
+ export declare const CreditTransferRequestAction: {
12
+ readonly Deposit: "DEPOSIT";
13
+ readonly Withdraw: "WITHDRAW";
14
+ };
15
+ /**
16
+ * Whether you are depositing to or withdrawing from your credit account.
17
+ */
18
+ export type CreditTransferRequestAction = ClosedEnum<typeof CreditTransferRequestAction>;
7
19
  export type CreditTransferRequest = {
8
20
  /**
9
21
  * The owner's wallet address (EOA).
@@ -14,13 +26,25 @@ export type CreditTransferRequest = {
14
26
  */
15
27
  chain: Chain;
16
28
  /**
17
- * The token to transfer from the EOA to the Credit Account.
29
+ * The token to transfer.
18
30
  */
19
31
  token: string;
20
32
  /**
21
33
  * The amount of tokens to transfer (in token units, not wei).
22
34
  */
23
35
  amount: number | string;
36
+ /**
37
+ * Whether you are depositing to or withdrawing from your credit account.
38
+ */
39
+ action: CreditTransferRequestAction;
40
+ /**
41
+ * 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.
42
+ */
43
+ gasSponsorship?: boolean | undefined;
44
+ /**
45
+ * The address that will call Permit2's permitTransferFrom to execute the transfer. When `action` is 'DEPOSIT' and `gas_sponsorship` is `true`: - If provided, the signature will authorize this address (typically a gas sponsor) to pull tokens. - If not provided, defaults to the Credit Account (Safe) address, allowing the transfer to be included in a bundle transaction where the Safe pulls the tokens itself.
46
+ */
47
+ spender?: string | null | undefined;
24
48
  };
25
49
  /** @internal */
26
50
  export type CreditTransferRequestAmount$Outbound = number | string;
@@ -28,11 +52,16 @@ export type CreditTransferRequestAmount$Outbound = number | string;
28
52
  export declare const CreditTransferRequestAmount$outboundSchema: z.ZodType<CreditTransferRequestAmount$Outbound, z.ZodTypeDef, CreditTransferRequestAmount>;
29
53
  export declare function creditTransferRequestAmountToJSON(creditTransferRequestAmount: CreditTransferRequestAmount): string;
30
54
  /** @internal */
55
+ export declare const CreditTransferRequestAction$outboundSchema: z.ZodNativeEnum<typeof CreditTransferRequestAction>;
56
+ /** @internal */
31
57
  export type CreditTransferRequest$Outbound = {
32
58
  owner: string;
33
59
  chain: string;
34
60
  token: string;
35
61
  amount: number | string;
62
+ action: string;
63
+ gas_sponsorship?: boolean | undefined;
64
+ spender?: string | null | undefined;
36
65
  };
37
66
  /** @internal */
38
67
  export declare const CreditTransferRequest$outboundSchema: z.ZodType<CreditTransferRequest$Outbound, z.ZodTypeDef, CreditTransferRequest>;
@@ -1 +1 @@
1
- {"version":3,"file":"credittransferrequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/credittransferrequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAwB,MAAM,YAAY,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,oCAAoC,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnE,gBAAgB;AAChB,eAAO,MAAM,0CAA0C,EAAE,CAAC,CAAC,OAAO,CAChE,oCAAoC,EACpC,CAAC,CAAC,UAAU,EACZ,2BAA2B,CACQ,CAAC;AAEtC,wBAAgB,iCAAiC,CAC/C,2BAA2B,EAAE,2BAA2B,GACvD,MAAM,CAMR;AAED,gBAAgB;AAChB,MAAM,MAAM,8BAA8B,GAAG;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAC1D,8BAA8B,EAC9B,CAAC,CAAC,UAAU,EACZ,qBAAqB,CAMrB,CAAC;AAEH,wBAAgB,2BAA2B,CACzC,qBAAqB,EAAE,qBAAqB,GAC3C,MAAM,CAIR"}
1
+ {"version":3,"file":"credittransferrequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/credittransferrequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAwB,MAAM,YAAY,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;CAG9B,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,UAAU,CAClD,OAAO,2BAA2B,CACnC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,KAAK,EAAE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AIR"}
@@ -36,22 +36,39 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.CreditTransferRequest$outboundSchema = exports.CreditTransferRequestAmount$outboundSchema = void 0;
39
+ exports.CreditTransferRequest$outboundSchema = exports.CreditTransferRequestAction$outboundSchema = exports.CreditTransferRequestAmount$outboundSchema = exports.CreditTransferRequestAction = void 0;
40
40
  exports.creditTransferRequestAmountToJSON = creditTransferRequestAmountToJSON;
41
41
  exports.creditTransferRequestToJSON = creditTransferRequestToJSON;
42
42
  const z = __importStar(require("zod/v3"));
43
+ const primitives_js_1 = require("../../lib/primitives.js");
43
44
  const chain_js_1 = require("./chain.js");
45
+ /**
46
+ * Whether you are depositing to or withdrawing from your credit account.
47
+ */
48
+ exports.CreditTransferRequestAction = {
49
+ Deposit: "DEPOSIT",
50
+ Withdraw: "WITHDRAW",
51
+ };
44
52
  /** @internal */
45
53
  exports.CreditTransferRequestAmount$outboundSchema = z.union([z.number(), z.string()]);
46
54
  function creditTransferRequestAmountToJSON(creditTransferRequestAmount) {
47
55
  return JSON.stringify(exports.CreditTransferRequestAmount$outboundSchema.parse(creditTransferRequestAmount));
48
56
  }
49
57
  /** @internal */
58
+ exports.CreditTransferRequestAction$outboundSchema = z.nativeEnum(exports.CreditTransferRequestAction);
59
+ /** @internal */
50
60
  exports.CreditTransferRequest$outboundSchema = z.object({
51
61
  owner: z.string(),
52
62
  chain: chain_js_1.Chain$outboundSchema,
53
63
  token: z.string(),
54
64
  amount: z.union([z.number(), z.string()]),
65
+ action: exports.CreditTransferRequestAction$outboundSchema,
66
+ gasSponsorship: z.boolean().optional(),
67
+ spender: z.nullable(z.string()).optional(),
68
+ }).transform((v) => {
69
+ return (0, primitives_js_1.remap)(v, {
70
+ gasSponsorship: "gas_sponsorship",
71
+ });
55
72
  });
56
73
  function creditTransferRequestToJSON(creditTransferRequest) {
57
74
  return JSON.stringify(exports.CreditTransferRequest$outboundSchema.parse(creditTransferRequest));
@@ -1 +1 @@
1
- {"version":3,"file":"credittransferrequest.js","sourceRoot":"","sources":["../../../../src/models/components/credittransferrequest.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCH,8EAQC;AAsBD,kEAMC;AAzED,0CAA4B;AAC5B,yCAAyD;AA6BzD,gBAAgB;AACH,QAAA,0CAA0C,GAInD,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAEtC,SAAgB,iCAAiC,CAC/C,2BAAwD;IAExD,OAAO,IAAI,CAAC,SAAS,CACnB,kDAA0C,CAAC,KAAK,CAC9C,2BAA2B,CAC5B,CACF,CAAC;AACJ,CAAC;AAUD,gBAAgB;AACH,QAAA,oCAAoC,GAI7C,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,+BAAoB;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;CAC1C,CAAC,CAAC;AAEH,SAAgB,2BAA2B,CACzC,qBAA4C;IAE5C,OAAO,IAAI,CAAC,SAAS,CACnB,4CAAoC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAClE,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"credittransferrequest.js","sourceRoot":"","sources":["../../../../src/models/components/credittransferrequest.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEH,8EAQC;AAqCD,kEAMC;AApHD,0CAA4B;AAC5B,2DAA0D;AAE1D,yCAAyD;AAOzD;;GAEG;AACU,QAAA,2BAA2B,GAAG;IACzC,O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zod/v3";
2
2
  import { Result as SafeParseResult } from "../../types/fp.js";
3
3
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
4
+ import { BatchedSafeOperationsResponseOutput } from "./batchedsafeoperationsresponseoutput.js";
4
5
  import { Permit2TypedDataOutput } from "./permit2typeddataoutput.js";
6
+ import { UnsignedTransaction } from "./unsignedtransaction.js";
7
+ export type CreditTransferResponseEip712 = BatchedSafeOperationsResponseOutput | Permit2TypedDataOutput;
5
8
  export type CreditTransferResponse = {
6
- eip712: Permit2TypedDataOutput;
9
+ transaction?: UnsignedTransaction | null | undefined;
10
+ eip712?: BatchedSafeOperationsResponseOutput | Permit2TypedDataOutput | null | undefined;
7
11
  };
8
12
  /** @internal */
13
+ export declare const CreditTransferResponseEip712$inboundSchema: z.ZodType<CreditTransferResponseEip712, z.ZodTypeDef, unknown>;
14
+ export declare function creditTransferResponseEip712FromJSON(jsonString: string): SafeParseResult<CreditTransferResponseEip712, SDKValidationError>;
15
+ /** @internal */
9
16
  export declare const CreditTransferResponse$inboundSchema: z.ZodType<CreditTransferResponse, z.ZodTypeDef, unknown>;
10
17
  export declare function creditTransferResponseFromJSON(jsonString: string): SafeParseResult<CreditTransferResponse, SDKValidationError>;
11
18
  //# sourceMappingURL=credittransferresponse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"credittransferresponse.d.ts","sourceRoot":"","sources":["../../../../src/models/components/credittransferresponse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,sBAAsB,EAEvB,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,sBAAsB,CAAC;CAChC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAC1D,sBAAsB,EACtB,CAAC,CAAC,UAAU,EACZ,OAAO,CAOP,CAAC;AAEH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAM7D"}
1
+ {"version":3,"file":"credittransferresponse.d.ts","sourceRoot":"","sources":["../../../../src/models/components/credittransferresponse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,mCAAmC,EAEpC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,sBAAsB,EAEvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,mBAAmB,EAEpB,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,4BAA4B,GACpC,mCAAmC,GACnC,sBAAsB,CAAC;AAE3B,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,CAAC;IACrD,MAAM,CAAC,EACH,mCAAmC,GACnC,sBAAsB,GACtB,IAAI,GACJ,SAAS,CAAC;CACf,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,0CAA0C,EAAE,CAAC,CAAC,OAAO,CAChE,4BAA4B,EAC5B,CAAC,CAAC,UAAU,EACZ,OAAO,CAIP,CAAC;AAEH,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAMnE;AAED,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAC1D,sBAAsB,EACtB,CAAC,CAAC,UAAU,EACZ,OAAO,CAaP,CAAC;AAEH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAM7D"}
@@ -36,15 +36,30 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.CreditTransferResponse$inboundSchema = void 0;
39
+ exports.CreditTransferResponse$inboundSchema = exports.CreditTransferResponseEip712$inboundSchema = void 0;
40
+ exports.creditTransferResponseEip712FromJSON = creditTransferResponseEip712FromJSON;
40
41
  exports.creditTransferResponseFromJSON = creditTransferResponseFromJSON;
41
42
  const z = __importStar(require("zod/v3"));
42
43
  const primitives_js_1 = require("../../lib/primitives.js");
43
44
  const schemas_js_1 = require("../../lib/schemas.js");
45
+ const batchedsafeoperationsresponseoutput_js_1 = require("./batchedsafeoperationsresponseoutput.js");
44
46
  const permit2typeddataoutput_js_1 = require("./permit2typeddataoutput.js");
47
+ const unsignedtransaction_js_1 = require("./unsignedtransaction.js");
48
+ /** @internal */
49
+ exports.CreditTransferResponseEip712$inboundSchema = z.union([
50
+ batchedsafeoperationsresponseoutput_js_1.BatchedSafeOperationsResponseOutput$inboundSchema,
51
+ permit2typeddataoutput_js_1.Permit2TypedDataOutput$inboundSchema,
52
+ ]);
53
+ function creditTransferResponseEip712FromJSON(jsonString) {
54
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreditTransferResponseEip712$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreditTransferResponseEip712' from JSON`);
55
+ }
45
56
  /** @internal */
46
57
  exports.CreditTransferResponse$inboundSchema = z.object({
47
- eip_712: permit2typeddataoutput_js_1.Permit2TypedDataOutput$inboundSchema,
58
+ transaction: z.nullable(unsignedtransaction_js_1.UnsignedTransaction$inboundSchema).optional(),
59
+ eip_712: z.nullable(z.union([
60
+ batchedsafeoperationsresponseoutput_js_1.BatchedSafeOperationsResponseOutput$inboundSchema,
61
+ permit2typeddataoutput_js_1.Permit2TypedDataOutput$inboundSchema,
62
+ ])).optional(),
48
63
  }).transform((v) => {
49
64
  return (0, primitives_js_1.remap)(v, {
50
65
  "eip_712": "eip712",
@@ -1 +1 @@
1
- {"version":3,"file":"credittransferresponse.js","sourceRoot":"","sources":["../../../../src/models/components/credittransferresponse.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BH,wEAQC;AAnCD,0CAA4B;AAC5B,2DAA0D;AAC1D,qDAAiD;AAGjD,2EAGqC;AAMrC,gBAAgB;AACH,QAAA,oCAAoC,GAI7C,CAAC,CAAC,MAAM,CAAC;IACX,OAAO,EAAE,gEAAoC;CAC9C,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,SAAS,EAAE,QAAQ;KACpB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAgB,8BAA8B,CAC5C,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,4CAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAChE,oDAAoD,CACrD,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"credittransferresponse.js","sourceRoot":"","sources":["../../../../src/models/components/credittransferresponse.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CH,oFAQC;AAqBD,wEAQC;AA9ED,0CAA4B;AAC5B,2DAA0D;AAC1D,qDAAiD;AAGjD,qGAGkD;AAClD,2EAGqC;AACrC,qEAGkC;AAelC,gBAAgB;AACH,QAAA,0CAA0C,GAInD,CAAC,CAAC,KAAK,CAAC;IACV,0FAAiD;IACjD,gEAAoC;CACrC,CAAC,CAAC;AAEH,SAAgB,oCAAoC,CAClD,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,kDAA0C,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACtE,0DAA0D,CAC3D,CAAC;AACJ,CAAC;AAED,gBAAgB;AACH,QAAA,oCAAoC,GAI7C,CAAC,CAAC,MAAM,CAAC;IACX,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,0DAAiC,CAAC,CAAC,QAAQ,EAAE;IACrE,OAAO,EAAE,CAAC,CAAC,QAAQ,CACjB,CAAC,CAAC,KAAK,CAAC;QACN,0FAAiD;QACjD,gEAAoC;KACrC,CAAC,CACH,CAAC,QAAQ,EAAE;CACb,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,SAAS,EAAE,QAAQ;KACpB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAgB,8BAA8B,CAC5C,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,4CAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAChE,oDAAoD,CACrD,CAAC;AACJ,CAAC"}
@@ -42,19 +42,20 @@ export declare class Credit extends ClientSDK {
42
42
  */
43
43
  creditBorrow(request: components.CreditBorrowRequest, options?: RequestOptions): Promise<components.CreditBorrowResponse>;
44
44
  /**
45
- * Get Permit2 signature data for Credit Account transfer
45
+ * Transfer tokens to/from Credit Account
46
46
  *
47
47
  * @remarks
48
- * Generate Permit2 EIP-712 typed data for transferring tokens from the owner's EOA
49
- * to a Credit Account.
48
+ * Transfer tokens between the owner's EOA and their Credit Account.
50
49
  *
51
- * The owner signs the returned EIP-712 data, then includes the signature in a `/v2/credit/borrow`
52
- * or `/v2/credit/repay` request to atomically pull tokens from their EOA as part of the bundle.
50
+ * **DEPOSIT** (EOA Credit Account):
51
+ * - With `gas_sponsorship=true`: returns Permit2 EIP-712 typed data to sign. The gas sponsor
52
+ * calls `permitTransferFrom` to pull tokens (1 signature).
53
+ * - With `gas_sponsorship=false`: returns an unsigned ERC-20 transfer transaction.
53
54
  *
54
- * **Flow:**
55
- * 1. Call this endpoint to get the Permit2 typed data
56
- * 2. Sign the typed data with the owner's wallet
57
- * 3. Call `/v2/credit/borrow` or `/v2/credit/repay` with the `permit2_signature`, `permit2_nonce`, and `permit2_deadline` fields
55
+ * **WITHDRAW** (Credit Account → EOA):
56
+ * - With `gas_sponsorship=true`: returns SafeTx EIP-712 typed data to sign. The gas sponsor
57
+ * broadcasts the `execTransaction` (1 signature).
58
+ * - With `gas_sponsorship=false`: returns an unsigned `execTransaction`.
58
59
  */
59
60
  creditTransfer(request: components.CreditTransferRequest, options?: RequestOptions): Promise<components.CreditTransferResponse>;
60
61
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"credit.d.ts","sourceRoot":"","sources":["../../../src/sdk/credit.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,MAAO,SAAQ,SAAS;IACnC;;;;;;;;OAQG;IACG,eAAe,CACnB,OAAO,EAAE,UAAU,CAAC,wBAAwB,EAC5C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC;IAQ9C;;;;;;;;;;;;;OAaG;IACG,mBAAmB,CACvB,OAAO,EAAE,UAAU,CAAC,0BAA0B,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,2BAA2B,CAAC;IAQlD;;;;;;;;;;;;OAYG;IACG,YAAY,CAChB,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,U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;IACG,cAAc,CAClB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAQ7C;;;;;;;;;;;;;OAaG;IACG,WAAW,CACf,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC;IAQ1C;;;;;;;;OAQG;IACG,YAAY,CAChB,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC;CAO5C"}
@@ -59,19 +59,20 @@ class Credit extends sdks_js_1.ClientSDK {
59
59
  return (0, fp_js_1.unwrapAsync)((0, creditCreditBorrow_js_1.creditCreditBorrow)(this, request, options));
60
60
  }
61
61
  /**
62
- * Get Permit2 signature data for Credit Account transfer
62
+ * Transfer tokens to/from Credit Account
63
63
  *
64
64
  * @remarks
65
- * Generate Permit2 EIP-712 typed data for transferring tokens from the owner's EOA
66
- * to a Credit Account.
65
+ * Transfer tokens between the owner's EOA and their Credit Account.
67
66
  *
68
- * The owner signs the returned EIP-712 data, then includes the signature in a `/v2/credit/borrow`
69
- * or `/v2/credit/repay` request to atomically pull tokens from their EOA as part of the bundle.
67
+ * **DEPOSIT** (EOA Credit Account):
68
+ * - With `gas_sponsorship=true`: returns Permit2 EIP-712 typed data to sign. The gas sponsor
69
+ * calls `permitTransferFrom` to pull tokens (1 signature).
70
+ * - With `gas_sponsorship=false`: returns an unsigned ERC-20 transfer transaction.
70
71
  *
71
- * **Flow:**
72
- * 1. Call this endpoint to get the Permit2 typed data
73
- * 2. Sign the typed data with the owner's wallet
74
- * 3. Call `/v2/credit/borrow` or `/v2/credit/repay` with the `permit2_signature`, `permit2_nonce`, and `permit2_deadline` fields
72
+ * **WITHDRAW** (Credit Account → EOA):
73
+ * - With `gas_sponsorship=true`: returns SafeTx EIP-712 typed data to sign. The gas sponsor
74
+ * broadcasts the `execTransaction` (1 signature).
75
+ * - With `gas_sponsorship=false`: returns an unsigned `execTransaction`.
75
76
  */
76
77
  async creditTransfer(request, options) {
77
78
  return (0, fp_js_1.unwrapAsync)((0, creditCreditTransfer_js_1.creditCreditTransfer)(this, request, options));
@@ -1 +1 @@
1
- {"version":3,"file":"credit.js","sourceRoot":"","sources":["../../../src/sdk/credit.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,0EAAoE;AACpE,0EAAoE;AACpE,wFAAkF;AAClF,gFAA0E;AAC1E,wEAAkE;AAClE,8EAAwE;AACxE,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,MAAO,SAAQ,mBAAS;IACnC;;;;;;;;OAQG;IACH,KAAK,CAAC,eAAe,CACnB,OAA4C,EAC5C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,gDAAqB,EACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,mBAAmB,CACvB,OAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wDAAyB,EAC1C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,YAAY,CAChB,OAAuC,EACvC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,0CAAkB,EACnC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,cAAc,CAClB,OAAyC,EACzC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8CAAoB,EACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,WAAW,CACf,OAAsC,EACtC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wCAAiB,EAClC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,YAAY,CAChB,OAAuC,EACvC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,0CAAkB,EACnC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AA5ID,wBA4IC"}
1
+ {"version":3,"file":"credit.js","sourceRoot":"","sources":["../../../src/sdk/credit.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,0EAAoE;AACpE,0EAAoE;AACpE,wFAAkF;AAClF,gFAA0E;AAC1E,wEAAkE;AAClE,8EAAwE;AACxE,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,MAAO,SAAQ,mBAAS;IACnC;;;;;;;;OAQG;IACH,KAAK,CAAC,eAAe,CACnB,OAA4C,EAC5C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,gDAAqB,EACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,mBAAmB,CACvB,OAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wDAAyB,EAC1C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,YAAY,CAChB,OAAuC,EACvC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,0CAAkB,EACnC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,cAAc,CAClB,OAAyC,EACzC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8CAAoB,EACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,WAAW,CACf,OAAsC,EACtC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wCAAiB,EAClC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,YAAY,CAChB,OAAuC,EACvC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,0CAAkB,EACnC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AA7ID,wBA6IC"}
@@ -10,12 +10,12 @@ export declare class GasSponsorship extends ClientSDK {
10
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
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
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), [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/transfer-tokens-tofrom-account)) to get EIP-712 typed data
14
14
  * 2. Owner signs the typed data off-chain
15
15
  * 3. Submit signature + typed data to this endpoint
16
16
  * 4. Sender signs and broadcasts the returned transaction, paying gas on behalf of the owner
17
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).
18
+ * **Note:** For gas-sponsored deposits via [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) or [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/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).
19
19
  */
20
20
  gasSponsorshipPrepare(request: components.SponsorGasRequest, options?: RequestOptions): Promise<components.SponsorGasResponse>;
21
21
  /**
@@ -24,7 +24,7 @@ export declare class GasSponsorship extends ClientSDK {
24
24
  * @remarks
25
25
  * Set up a one-time Permit2 allowance for gas-sponsored token transfers.
26
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.
27
+ * Required when using [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) or [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/transfer-tokens-tofrom-account) with `gas_sponsorship=true`. This allowance only needs to be set up once per token.
28
28
  *
29
29
  * **With gas sponsorship (`gas_sponsorship=true`):**
30
30
  * - Returns EIP-712 typed data for the owner to sign off-chain
@@ -18,12 +18,12 @@ class GasSponsorship extends sdks_js_1.ClientSDK {
18
18
  * 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.
19
19
  *
20
20
  * **How gas sponsorship works:**
21
- * 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
21
+ * 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), [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/transfer-tokens-tofrom-account)) to get EIP-712 typed data
22
22
  * 2. Owner signs the typed data off-chain
23
23
  * 3. Submit signature + typed data to this endpoint
24
24
  * 4. Sender signs and broadcasts the returned transaction, paying gas on behalf of the owner
25
25
  *
26
- * **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).
26
+ * **Note:** For gas-sponsored deposits via [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) or [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/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).
27
27
  */
28
28
  async gasSponsorshipPrepare(request, options) {
29
29
  return (0, fp_js_1.unwrapAsync)((0, gasSponsorshipGasSponsorshipPrepare_js_1.gasSponsorshipGasSponsorshipPrepare)(this, request, options));
@@ -34,7 +34,7 @@ class GasSponsorship extends sdks_js_1.ClientSDK {
34
34
  * @remarks
35
35
  * Set up a one-time Permit2 allowance for gas-sponsored token transfers.
36
36
  *
37
- * 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.
37
+ * Required when using [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) or [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/transfer-tokens-tofrom-account) with `gas_sponsorship=true`. This allowance only needs to be set up once per token.
38
38
  *
39
39
  * **With gas sponsorship (`gas_sponsorship=true`):**
40
40
  * - Returns EIP-712 typed data for the owner to sign off-chain
@@ -9,19 +9,20 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
9
9
  import { APIPromise } from "../types/async.js";
10
10
  import { Result } from "../types/fp.js";
11
11
  /**
12
- * Get Permit2 signature data for Credit Account transfer
12
+ * Transfer tokens to/from Credit Account
13
13
  *
14
14
  * @remarks
15
- * Generate Permit2 EIP-712 typed data for transferring tokens from the owner's EOA
16
- * to a Credit Account.
15
+ * Transfer tokens between the owner's EOA and their Credit Account.
17
16
  *
18
- * The owner signs the returned EIP-712 data, then includes the signature in a `/v2/credit/borrow`
19
- * or `/v2/credit/repay` request to atomically pull tokens from their EOA as part of the bundle.
17
+ * **DEPOSIT** (EOA Credit Account):
18
+ * - With `gas_sponsorship=true`: returns Permit2 EIP-712 typed data to sign. The gas sponsor
19
+ * calls `permitTransferFrom` to pull tokens (1 signature).
20
+ * - With `gas_sponsorship=false`: returns an unsigned ERC-20 transfer transaction.
20
21
  *
21
- * **Flow:**
22
- * 1. Call this endpoint to get the Permit2 typed data
23
- * 2. Sign the typed data with the owner's wallet
24
- * 3. Call `/v2/credit/borrow` or `/v2/credit/repay` with the `permit2_signature`, `permit2_nonce`, and `permit2_deadline` fields
22
+ * **WITHDRAW** (Credit Account → EOA):
23
+ * - With `gas_sponsorship=true`: returns SafeTx EIP-712 typed data to sign. The gas sponsor
24
+ * broadcasts the `execTransaction` (1 signature).
25
+ * - With `gas_sponsorship=false`: returns an unsigned `execTransaction`.
25
26
  */
26
27
  export declare function creditCreditTransfer(client: CompassApiSDKCore, request: components.CreditTransferRequest, options?: RequestOptions): APIPromise<Result<components.CreditTransferResponse, errors.HTTPValidationError | CompassAPISDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
27
28
  //# sourceMappingURL=creditCreditTransfer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"creditCreditTransfer.d.ts","sourceRoot":"","sources":["../../../src/funcs/creditCreditTransfer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAK/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,sBAAsB,EAC/B,MAAM,CAAC,mBAAmB,GAC1B,kBAAkB,GAClB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
1
+ {"version":3,"file":"creditCreditTransfer.d.ts","sourceRoot":"","sources":["../../../src/funcs/creditCreditTransfer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAK/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,sBAAsB,EAC/B,MAAM,CAAC,mBAAmB,GAC1B,kBAAkB,GAClB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}