@compass-labs/api-sdk 2.2.21 → 2.2.22-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.
- package/README.md +2 -2
- package/codeSamples_typescript.yaml +1 -1
- package/dist/commonjs/funcs/creditCreditTransfer.d.ts +10 -9
- package/dist/commonjs/funcs/creditCreditTransfer.d.ts.map +1 -1
- package/dist/commonjs/funcs/creditCreditTransfer.js +10 -9
- package/dist/commonjs/funcs/creditCreditTransfer.js.map +1 -1
- package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipApproveTransfer.d.ts +1 -1
- package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipApproveTransfer.js +1 -1
- package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipPrepare.d.ts +2 -2
- package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipPrepare.js +2 -2
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/credittransferrequest.d.ts +30 -1
- package/dist/commonjs/models/components/credittransferrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/credittransferrequest.js +18 -1
- package/dist/commonjs/models/components/credittransferrequest.js.map +1 -1
- package/dist/commonjs/models/components/credittransferresponse.d.ts +8 -1
- package/dist/commonjs/models/components/credittransferresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/credittransferresponse.js +17 -2
- package/dist/commonjs/models/components/credittransferresponse.js.map +1 -1
- package/dist/commonjs/sdk/credit.d.ts +10 -9
- package/dist/commonjs/sdk/credit.d.ts.map +1 -1
- package/dist/commonjs/sdk/credit.js +10 -9
- package/dist/commonjs/sdk/credit.js.map +1 -1
- package/dist/commonjs/sdk/gassponsorship.d.ts +3 -3
- package/dist/commonjs/sdk/gassponsorship.js +3 -3
- package/dist/esm/funcs/creditCreditTransfer.d.ts +10 -9
- package/dist/esm/funcs/creditCreditTransfer.d.ts.map +1 -1
- package/dist/esm/funcs/creditCreditTransfer.js +10 -9
- package/dist/esm/funcs/creditCreditTransfer.js.map +1 -1
- package/dist/esm/funcs/gasSponsorshipGasSponsorshipApproveTransfer.d.ts +1 -1
- package/dist/esm/funcs/gasSponsorshipGasSponsorshipApproveTransfer.js +1 -1
- package/dist/esm/funcs/gasSponsorshipGasSponsorshipPrepare.d.ts +2 -2
- package/dist/esm/funcs/gasSponsorshipGasSponsorshipPrepare.js +2 -2
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/credittransferrequest.d.ts +30 -1
- package/dist/esm/models/components/credittransferrequest.d.ts.map +1 -1
- package/dist/esm/models/components/credittransferrequest.js +17 -0
- package/dist/esm/models/components/credittransferrequest.js.map +1 -1
- package/dist/esm/models/components/credittransferresponse.d.ts +8 -1
- package/dist/esm/models/components/credittransferresponse.d.ts.map +1 -1
- package/dist/esm/models/components/credittransferresponse.js +15 -1
- package/dist/esm/models/components/credittransferresponse.js.map +1 -1
- package/dist/esm/sdk/credit.d.ts +10 -9
- package/dist/esm/sdk/credit.d.ts.map +1 -1
- package/dist/esm/sdk/credit.js +10 -9
- package/dist/esm/sdk/credit.js.map +1 -1
- package/dist/esm/sdk/gassponsorship.d.ts +3 -3
- package/dist/esm/sdk/gassponsorship.js +3 -3
- package/docs/models/components/credittransferrequest.md +10 -6
- package/docs/models/components/credittransferrequestaction.md +17 -0
- package/docs/models/components/credittransferresponse.md +4 -3
- package/docs/models/components/credittransferresponseeip712.md +97 -0
- package/docs/sdks/credit/README.md +12 -9
- package/docs/sdks/gassponsorship/README.md +3 -3
- package/package.json +1 -1
- package/src/funcs/creditCreditTransfer.ts +10 -9
- package/src/funcs/gasSponsorshipGasSponsorshipApproveTransfer.ts +1 -1
- package/src/funcs/gasSponsorshipGasSponsorshipPrepare.ts +2 -2
- package/src/lib/config.ts +2 -2
- package/src/models/components/credittransferrequest.ts +44 -1
- package/src/models/components/credittransferresponse.ts +45 -2
- package/src/sdk/credit.ts +10 -9
- package/src/sdk/gassponsorship.ts +3 -3
|
@@ -11,19 +11,20 @@ import * as components from "../models/components/index.js";
|
|
|
11
11
|
import * as errors from "../models/errors/index.js";
|
|
12
12
|
import { APIPromise } from "../types/async.js";
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Transfer tokens to/from Credit Account
|
|
15
15
|
*
|
|
16
16
|
* @remarks
|
|
17
|
-
*
|
|
18
|
-
* to a Credit Account.
|
|
17
|
+
* Transfer tokens between the owner's EOA and their Credit Account.
|
|
19
18
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* **DEPOSIT** (EOA → Credit Account):
|
|
20
|
+
* - With `gas_sponsorship=true`: returns Permit2 EIP-712 typed data to sign. The gas sponsor
|
|
21
|
+
* calls `permitTransferFrom` to pull tokens (1 signature).
|
|
22
|
+
* - With `gas_sponsorship=false`: returns an unsigned ERC-20 transfer transaction.
|
|
22
23
|
*
|
|
23
|
-
* **
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* **WITHDRAW** (Credit Account → EOA):
|
|
25
|
+
* - With `gas_sponsorship=true`: returns SafeTx EIP-712 typed data to sign. The gas sponsor
|
|
26
|
+
* broadcasts the `execTransaction` (1 signature).
|
|
27
|
+
* - With `gas_sponsorship=false`: returns an unsigned `execTransaction`.
|
|
27
28
|
*/
|
|
28
29
|
export function creditCreditTransfer(client, request, options) {
|
|
29
30
|
return new APIPromise($do(client, request, options));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditTransfer.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditTransfer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAm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C,GAAG,EAAE,UAAU,CAAC,oCAAoC,CAAC,EAC5D,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,iCAAiC,CAAC,EACxD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EACb,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -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
|
-
*
|
|
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
|
|
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
16
16
|
* @remarks
|
|
17
17
|
* Set up a one-time Permit2 allowance for gas-sponsored token transfers.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
19
|
+
* 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.
|
|
20
20
|
*
|
|
21
21
|
* **With gas sponsorship (`gas_sponsorship=true`):**
|
|
22
22
|
* - 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
|
|
@@ -19,12 +19,12 @@ import { APIPromise } from "../types/async.js";
|
|
|
19
19
|
* 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.
|
|
20
20
|
*
|
|
21
21
|
* **How gas sponsorship works:**
|
|
22
|
-
* 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
|
|
22
|
+
* 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
|
|
23
23
|
* 2. Owner signs the typed data off-chain
|
|
24
24
|
* 3. Submit signature + typed data to this endpoint
|
|
25
25
|
* 4. Sender signs and broadcasts the returned transaction, paying gas on behalf of the owner
|
|
26
26
|
*
|
|
27
|
-
* **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).
|
|
27
|
+
* **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).
|
|
28
28
|
*/
|
|
29
29
|
export function gasSponsorshipGasSponsorshipPrepare(client, request, options) {
|
|
30
30
|
return new APIPromise($do(client, request, options));
|
package/dist/esm/lib/config.d.ts
CHANGED
|
@@ -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.
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 2.0.0 2.
|
|
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
|
package/dist/esm/lib/config.js
CHANGED
|
@@ -28,7 +28,7 @@ export const SDK_METADATA = {
|
|
|
28
28
|
language: "typescript",
|
|
29
29
|
openapiDocVersion: "0.0.1",
|
|
30
30
|
sdkVersion: "2.0.0",
|
|
31
|
-
genVersion: "2.
|
|
32
|
-
userAgent: "speakeasy-sdk/typescript 2.0.0 2.
|
|
31
|
+
genVersion: "2.841.0",
|
|
32
|
+
userAgent: "speakeasy-sdk/typescript 2.0.0 2.841.0 0.0.1 @compass-labs/api-sdk",
|
|
33
33
|
};
|
|
34
34
|
//# 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
|
|
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;
|
|
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,MA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MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACrC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAC1D,8BAA8B,EAC9B,CAAC,CAAC,UAAU,EACZ,qBAAqB,CAarB,CAAC;AAEH,wBAAgB,2BAA2B,CACzC,qBAAqB,EAAE,qBAAqB,GAC3C,MAAM,CAIR"}
|
|
@@ -2,18 +2,35 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v3";
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
5
6
|
import { Chain$outboundSchema } from "./chain.js";
|
|
7
|
+
/**
|
|
8
|
+
* Whether you are depositing to or withdrawing from your credit account.
|
|
9
|
+
*/
|
|
10
|
+
export const CreditTransferRequestAction = {
|
|
11
|
+
Deposit: "DEPOSIT",
|
|
12
|
+
Withdraw: "WITHDRAW",
|
|
13
|
+
};
|
|
6
14
|
/** @internal */
|
|
7
15
|
export const CreditTransferRequestAmount$outboundSchema = z.union([z.number(), z.string()]);
|
|
8
16
|
export function creditTransferRequestAmountToJSON(creditTransferRequestAmount) {
|
|
9
17
|
return JSON.stringify(CreditTransferRequestAmount$outboundSchema.parse(creditTransferRequestAmount));
|
|
10
18
|
}
|
|
11
19
|
/** @internal */
|
|
20
|
+
export const CreditTransferRequestAction$outboundSchema = z.nativeEnum(CreditTransferRequestAction);
|
|
21
|
+
/** @internal */
|
|
12
22
|
export const CreditTransferRequest$outboundSchema = z.object({
|
|
13
23
|
owner: z.string(),
|
|
14
24
|
chain: Chain$outboundSchema,
|
|
15
25
|
token: z.string(),
|
|
16
26
|
amount: z.union([z.number(), z.string()]),
|
|
27
|
+
action: CreditTransferRequestAction$outboundSchema,
|
|
28
|
+
gasSponsorship: z.boolean().optional(),
|
|
29
|
+
spender: z.nullable(z.string()).optional(),
|
|
30
|
+
}).transform((v) => {
|
|
31
|
+
return remap$(v, {
|
|
32
|
+
gasSponsorship: "gas_sponsorship",
|
|
33
|
+
});
|
|
17
34
|
});
|
|
18
35
|
export function creditTransferRequestToJSON(creditTransferRequest) {
|
|
19
36
|
return JSON.stringify(CreditTransferRequest$outboundSchema.parse(creditTransferRequest));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credittransferrequest.js","sourceRoot":"","sources":["../../../../src/models/components/credittransferrequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAS,oBAAoB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"credittransferrequest.js","sourceRoot":"","sources":["../../../../src/models/components/credittransferrequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAS,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAOzD;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACZ,CAAC;AA0CX,gBAAgB;AAChB,MAAM,CAAC,MAAM,0CAA0C,GAInD,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAEtC,MAAM,UAAU,iCAAiC,CAC/C,2BAAwD;IAExD,OAAO,IAAI,CAAC,SAAS,CACnB,0CAA0C,CAAC,KAAK,CAC9C,2BAA2B,CAC5B,CACF,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,0CAA0C,GAEnD,CAAC,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;AAa9C,gBAAgB;AAChB,MAAM,CAAC,MAAM,oCAAoC,GAI7C,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,oBAAoB;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;IACzC,MAAM,EAAE,0CAA0C;IAClD,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACtC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,cAAc,EAAE,iBAAiB;KAClC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,2BAA2B,CACzC,qBAA4C;IAE5C,OAAO,IAAI,CAAC,SAAS,CACnB,oCAAoC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAClE,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import * as z from "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
|
-
|
|
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;
|
|
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"}
|
|
@@ -4,10 +4,24 @@
|
|
|
4
4
|
import * as z from "zod/v3";
|
|
5
5
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { BatchedSafeOperationsResponseOutput$inboundSchema, } from "./batchedsafeoperationsresponseoutput.js";
|
|
7
8
|
import { Permit2TypedDataOutput$inboundSchema, } from "./permit2typeddataoutput.js";
|
|
9
|
+
import { UnsignedTransaction$inboundSchema, } from "./unsignedtransaction.js";
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const CreditTransferResponseEip712$inboundSchema = z.union([
|
|
12
|
+
BatchedSafeOperationsResponseOutput$inboundSchema,
|
|
13
|
+
Permit2TypedDataOutput$inboundSchema,
|
|
14
|
+
]);
|
|
15
|
+
export function creditTransferResponseEip712FromJSON(jsonString) {
|
|
16
|
+
return safeParse(jsonString, (x) => CreditTransferResponseEip712$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreditTransferResponseEip712' from JSON`);
|
|
17
|
+
}
|
|
8
18
|
/** @internal */
|
|
9
19
|
export const CreditTransferResponse$inboundSchema = z.object({
|
|
10
|
-
|
|
20
|
+
transaction: z.nullable(UnsignedTransaction$inboundSchema).optional(),
|
|
21
|
+
eip_712: z.nullable(z.union([
|
|
22
|
+
BatchedSafeOperationsResponseOutput$inboundSchema,
|
|
23
|
+
Permit2TypedDataOutput$inboundSchema,
|
|
24
|
+
])).optional(),
|
|
11
25
|
}).transform((v) => {
|
|
12
26
|
return remap$(v, {
|
|
13
27
|
"eip_712": "eip712",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credittransferresponse.js","sourceRoot":"","sources":["../../../../src/models/components/credittransferresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAEL,oCAAoC,GACrC,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"credittransferresponse.js","sourceRoot":"","sources":["../../../../src/models/components/credittransferresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAEL,iDAAiD,GAClD,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAEL,oCAAoC,GACrC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,iCAAiC,GAClC,MAAM,0BAA0B,CAAC;AAelC,gBAAgB;AAChB,MAAM,CAAC,MAAM,0CAA0C,GAInD,CAAC,CAAC,KAAK,CAAC;IACV,iDAAiD;IACjD,oCAAoC;CACrC,CAAC,CAAC;AAEH,MAAM,UAAU,oCAAoC,CAClD,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,0CAA0C,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACtE,0DAA0D,CAC3D,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,oCAAoC,GAI7C,CAAC,CAAC,MAAM,CAAC;IACX,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,QAAQ,EAAE;IACrE,OAAO,EAAE,CAAC,CAAC,QAAQ,CACjB,CAAC,CAAC,KAAK,CAAC;QACN,iDAAiD;QACjD,oCAAoC;KACrC,CAAC,CACH,CAAC,QAAQ,EAAE;CACb,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,SAAS,EAAE,QAAQ;KACpB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,8BAA8B,CAC5C,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,oCAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAChE,oDAAoD,CACrD,CAAC;AACJ,CAAC"}
|
package/dist/esm/sdk/credit.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
45
|
+
* Transfer tokens to/from Credit Account
|
|
46
46
|
*
|
|
47
47
|
* @remarks
|
|
48
|
-
*
|
|
49
|
-
* to a Credit Account.
|
|
48
|
+
* Transfer tokens between the owner's EOA and their Credit Account.
|
|
50
49
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
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
|
-
* **
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
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,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AY,CAChB,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC;CAO5C"}
|
package/dist/esm/sdk/credit.js
CHANGED
|
@@ -56,19 +56,20 @@ export class Credit extends ClientSDK {
|
|
|
56
56
|
return unwrapAsync(creditCreditBorrow(this, request, options));
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* Transfer tokens to/from Credit Account
|
|
60
60
|
*
|
|
61
61
|
* @remarks
|
|
62
|
-
*
|
|
63
|
-
* to a Credit Account.
|
|
62
|
+
* Transfer tokens between the owner's EOA and their Credit Account.
|
|
64
63
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
* **DEPOSIT** (EOA → Credit Account):
|
|
65
|
+
* - With `gas_sponsorship=true`: returns Permit2 EIP-712 typed data to sign. The gas sponsor
|
|
66
|
+
* calls `permitTransferFrom` to pull tokens (1 signature).
|
|
67
|
+
* - With `gas_sponsorship=false`: returns an unsigned ERC-20 transfer transaction.
|
|
67
68
|
*
|
|
68
|
-
* **
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
69
|
+
* **WITHDRAW** (Credit Account → EOA):
|
|
70
|
+
* - With `gas_sponsorship=true`: returns SafeTx EIP-712 typed data to sign. The gas sponsor
|
|
71
|
+
* broadcasts the `execTransaction` (1 signature).
|
|
72
|
+
* - With `gas_sponsorship=false`: returns an unsigned `execTransaction`.
|
|
72
73
|
*/
|
|
73
74
|
async creditTransfer(request, options) {
|
|
74
75
|
return unwrapAsync(creditCreditTransfer(this, request, options));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit.js","sourceRoot":"","sources":["../../../src/sdk/credit.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,M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
@@ -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
|
-
*
|
|
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
|
|
@@ -15,12 +15,12 @@ export class GasSponsorship extends ClientSDK {
|
|
|
15
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
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
|
|
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), [/credit/transfer](https://docs.compasslabs.ai/v2/api-reference/credit/transfer-tokens-tofrom-account)) to get EIP-712 typed data
|
|
19
19
|
* 2. Owner signs the typed data off-chain
|
|
20
20
|
* 3. Submit signature + typed data to this endpoint
|
|
21
21
|
* 4. Sender signs and broadcasts the returned transaction, paying gas on behalf of the owner
|
|
22
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).
|
|
23
|
+
* **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).
|
|
24
24
|
*/
|
|
25
25
|
async gasSponsorshipPrepare(request, options) {
|
|
26
26
|
return unwrapAsync(gasSponsorshipGasSponsorshipPrepare(this, request, options));
|
|
@@ -31,7 +31,7 @@ export class GasSponsorship extends ClientSDK {
|
|
|
31
31
|
* @remarks
|
|
32
32
|
* Set up a one-time Permit2 allowance for gas-sponsored token transfers.
|
|
33
33
|
*
|
|
34
|
-
*
|
|
34
|
+
* 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.
|
|
35
35
|
*
|
|
36
36
|
* **With gas sponsorship (`gas_sponsorship=true`):**
|
|
37
37
|
* - Returns EIP-712 typed data for the owner to sign off-chain
|
|
@@ -10,14 +10,18 @@ let value: CreditTransferRequest = {
|
|
|
10
10
|
chain: "base",
|
|
11
11
|
token: "USDC",
|
|
12
12
|
amount: 100,
|
|
13
|
+
action: "DEPOSIT",
|
|
13
14
|
};
|
|
14
15
|
```
|
|
15
16
|
|
|
16
17
|
## Fields
|
|
17
18
|
|
|
18
|
-
| Field
|
|
19
|
-
|
|
|
20
|
-
| `owner`
|
|
21
|
-
| `chain`
|
|
22
|
-
| `token`
|
|
23
|
-
| `amount`
|
|
19
|
+
| Field | Type | Required | Description | Example |
|
|
20
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| `owner` | *string* | :heavy_check_mark: | The owner's wallet address (EOA). | 0x4A83fec8c6A9A25Be28f3242a16dBaD0ab00f3a6 |
|
|
22
|
+
| `chain` | [components.Chain](../../models/components/chain.md) | :heavy_check_mark: | The chain to use. | |
|
|
23
|
+
| `token` | *string* | :heavy_check_mark: | The token to transfer. | USDC |
|
|
24
|
+
| `amount` | *components.CreditTransferRequestAmount* | :heavy_check_mark: | The amount of tokens to transfer (in token units, not wei). | 100 |
|
|
25
|
+
| `action` | [components.CreditTransferRequestAction](../../models/components/credittransferrequestaction.md) | :heavy_check_mark: | Whether you are depositing to or withdrawing from your credit account. | DEPOSIT |
|
|
26
|
+
| `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 |
|
|
27
|
+
| `spender` | *string* | :heavy_minus_sign: | 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. | |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# CreditTransferRequestAction
|
|
2
|
+
|
|
3
|
+
Whether you are depositing to or withdrawing from your credit account.
|
|
4
|
+
|
|
5
|
+
## Example Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { CreditTransferRequestAction } from "@compass-labs/api-sdk/models/components";
|
|
9
|
+
|
|
10
|
+
let value: CreditTransferRequestAction = "DEPOSIT";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Values
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
"DEPOSIT" | "WITHDRAW"
|
|
17
|
+
```
|
|
@@ -70,6 +70,7 @@ let value: CreditTransferResponse = {
|
|
|
70
70
|
|
|
71
71
|
## Fields
|
|
72
72
|
|
|
73
|
-
| Field
|
|
74
|
-
|
|
|
75
|
-
| `
|
|
73
|
+
| Field | Type | Required | Description |
|
|
74
|
+
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
75
|
+
| `transaction` | [components.UnsignedTransaction](../../models/components/unsignedtransaction.md) | :heavy_minus_sign: | N/A |
|
|
76
|
+
| `eip712` | *components.CreditTransferResponseEip712* | :heavy_minus_sign: | N/A |
|