@compass-labs/api-sdk 2.2.3 → 2.2.4
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/codeSamples_typescript.yaml +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/earntransferfromeoaparams.d.ts +64 -0
- package/dist/commonjs/models/components/earntransferfromeoaparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/earntransferfromeoaparams.js +68 -0
- package/dist/commonjs/models/components/earntransferfromeoaparams.js.map +1 -0
- package/dist/commonjs/models/components/earntransferrequest.d.ts +1 -1
- package/dist/commonjs/models/components/earntransfertoeoaparams.d.ts +36 -0
- package/dist/commonjs/models/components/earntransfertoeoaparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/earntransfertoeoaparams.js +56 -0
- package/dist/commonjs/models/components/earntransfertoeoaparams.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/v2bundlerequest.d.ts +41 -0
- package/dist/commonjs/models/components/v2bundlerequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/v2bundlerequest.js.map +1 -1
- package/dist/commonjs/models/components/v2useroperation.d.ts +6 -4
- package/dist/commonjs/models/components/v2useroperation.d.ts.map +1 -1
- package/dist/commonjs/models/components/v2useroperation.js +10 -1
- package/dist/commonjs/models/components/v2useroperation.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/earntransferfromeoaparams.d.ts +64 -0
- package/dist/esm/models/components/earntransferfromeoaparams.d.ts.map +1 -0
- package/dist/esm/models/components/earntransferfromeoaparams.js +30 -0
- package/dist/esm/models/components/earntransferfromeoaparams.js.map +1 -0
- package/dist/esm/models/components/earntransferrequest.d.ts +1 -1
- package/dist/esm/models/components/earntransfertoeoaparams.d.ts +36 -0
- package/dist/esm/models/components/earntransfertoeoaparams.d.ts.map +1 -0
- package/dist/esm/models/components/earntransfertoeoaparams.js +19 -0
- package/dist/esm/models/components/earntransfertoeoaparams.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/v2bundlerequest.d.ts +41 -0
- package/dist/esm/models/components/v2bundlerequest.d.ts.map +1 -1
- package/dist/esm/models/components/v2bundlerequest.js.map +1 -1
- package/dist/esm/models/components/v2useroperation.d.ts +6 -4
- package/dist/esm/models/components/v2useroperation.d.ts.map +1 -1
- package/dist/esm/models/components/v2useroperation.js +10 -1
- package/dist/esm/models/components/v2useroperation.js.map +1 -1
- package/docs/models/components/aaveborrowrequestamount.md +1 -1
- package/docs/models/components/aaverepayrequestamount.md +1 -1
- package/docs/models/components/aavesupplyrequestamount.md +1 -1
- package/docs/models/components/aavewithdrawrequestamount.md +1 -1
- package/docs/models/components/aerodromeslipstreambuyexactlyrequestamountinmaximum.md +1 -1
- package/docs/models/components/aerodromeslipstreambuyexactlyrequestamountout.md +1 -1
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestamount0desired.md +1 -1
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestamount0min.md +1 -1
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestamount1desired.md +1 -1
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestamount1min.md +1 -1
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestamount0desired.md +1 -1
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestamount0min.md +1 -1
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestamount1desired.md +1 -1
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestamount1min.md +1 -1
- package/docs/models/components/aerodromeslipstreamsellexactlyparamsamountoutminimum.md +1 -1
- package/docs/models/components/aerodromeslipstreamsellexactlyrequestamountin.md +1 -1
- package/docs/models/components/aerodromeslipstreamsellexactlyrequestamountoutminimum.md +1 -1
- package/docs/models/components/aerodromeslipstreamwithdrawliquidityprovisionrequestpercentageforwithdrawal.md +1 -1
- package/docs/models/components/depositforburnrequestamount.md +1 -1
- package/docs/models/components/earnswapparamsslippage.md +1 -1
- package/docs/models/components/earnswaprequestamountin.md +1 -1
- package/docs/models/components/earnswaprequestslippage.md +1 -1
- package/docs/models/components/earntransferfromeoaparams.md +39 -0
- package/docs/models/components/earntransferfromeoaparamsamount.md +19 -0
- package/docs/models/components/earntransferrequest.md +9 -9
- package/docs/models/components/earntransferrequestamount.md +1 -1
- package/docs/models/components/earntransfertoeoaparams.md +29 -0
- package/docs/models/components/ethenadepositrequestamount.md +1 -1
- package/docs/models/components/initialcollateralamount.md +1 -1
- package/docs/models/components/loantovalue.md +1 -1
- package/docs/models/components/maxslippagepercent.md +1 -1
- package/docs/models/components/morphoborrowrequestamount.md +1 -1
- package/docs/models/components/morphodepositrequestamount.md +1 -1
- package/docs/models/components/morphosupplycollateralrequestamount.md +1 -1
- package/docs/models/components/morphowithdrawcollateralrequestamount.md +1 -1
- package/docs/models/components/multiplier.md +1 -1
- package/docs/models/components/odosswaprequestamountin.md +1 -1
- package/docs/models/components/pendlemanageliquidityrequestamountin.md +1 -1
- package/docs/models/components/pendletradeptrequestamountin.md +1 -1
- package/docs/models/components/pendletradeytrequestamountin.md +1 -1
- package/docs/models/components/setallowancerequestamount.md +1 -1
- package/docs/models/components/skybuyrequestamount.md +1 -1
- package/docs/models/components/skydepositrequestamount.md +1 -1
- package/docs/models/components/skysellrequestamount.md +1 -1
- package/docs/models/components/tokentransferrequestamount.md +1 -1
- package/docs/models/components/uniswapbuyexactlyrequestamountout.md +1 -1
- package/docs/models/components/uniswapincreaseliquidityprovisionrequestamount0desired.md +1 -1
- package/docs/models/components/uniswapincreaseliquidityprovisionrequestamount0min.md +1 -1
- package/docs/models/components/uniswapincreaseliquidityprovisionrequestamount1desired.md +1 -1
- package/docs/models/components/uniswapincreaseliquidityprovisionrequestamount1min.md +1 -1
- package/docs/models/components/uniswapmintliquidityprovisionrequestamount0desired.md +1 -1
- package/docs/models/components/uniswapmintliquidityprovisionrequestamount0min.md +1 -1
- package/docs/models/components/uniswapmintliquidityprovisionrequestamount1desired.md +1 -1
- package/docs/models/components/uniswapmintliquidityprovisionrequestamount1min.md +1 -1
- package/docs/models/components/uniswapsellexactlyrequestamountin.md +1 -1
- package/docs/models/components/uniswapwithdrawliquidityprovisionrequestpercentageforwithdrawal.md +1 -1
- package/docs/models/components/unwrapwethrequestamount.md +1 -1
- package/docs/models/components/v2bundlerequest.md +54 -6
- package/docs/models/components/v2useroperationbody.md +23 -0
- package/docs/models/components/vaultdepositrequestamount.md +1 -1
- package/docs/models/components/wrapethrequestamount.md +1 -1
- package/docs/models/operations/amountin.md +1 -1
- package/docs/models/operations/amountout.md +1 -1
- package/docs/sdks/earn/README.md +20 -0
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/earntransferfromeoaparams.ts +112 -0
- package/src/models/components/earntransferrequest.ts +1 -1
- package/src/models/components/earntransfertoeoaparams.ts +62 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/v2bundlerequest.ts +41 -0
- package/src/models/components/v2useroperation.ts +36 -5
package/docs/sdks/earn/README.md
CHANGED
|
@@ -759,6 +759,16 @@ async function run() {
|
|
|
759
759
|
owner: "0x01E62835dd7F52173546A325294762143eE4a882",
|
|
760
760
|
chain: "ethereum",
|
|
761
761
|
actions: [
|
|
762
|
+
{
|
|
763
|
+
body: {
|
|
764
|
+
actionType: "V2_TRANSFER_FROM_EOA",
|
|
765
|
+
token: "USDC",
|
|
766
|
+
amount: "100",
|
|
767
|
+
permit2Signature: "0x...",
|
|
768
|
+
permit2Nonce: 1706000000,
|
|
769
|
+
permit2Deadline: 1706001800,
|
|
770
|
+
},
|
|
771
|
+
},
|
|
762
772
|
{
|
|
763
773
|
body: {
|
|
764
774
|
actionType: "V2_SWAP",
|
|
@@ -808,6 +818,16 @@ async function run() {
|
|
|
808
818
|
owner: "0x01E62835dd7F52173546A325294762143eE4a882",
|
|
809
819
|
chain: "ethereum",
|
|
810
820
|
actions: [
|
|
821
|
+
{
|
|
822
|
+
body: {
|
|
823
|
+
actionType: "V2_TRANSFER_FROM_EOA",
|
|
824
|
+
token: "USDC",
|
|
825
|
+
amount: "100",
|
|
826
|
+
permit2Signature: "0x...",
|
|
827
|
+
permit2Nonce: 1706000000,
|
|
828
|
+
permit2Deadline: 1706001800,
|
|
829
|
+
},
|
|
830
|
+
},
|
|
811
831
|
{
|
|
812
832
|
body: {
|
|
813
833
|
actionType: "V2_SWAP",
|
package/package.json
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -62,7 +62,7 @@ export const SDK_METADATA = {
|
|
|
62
62
|
language: "typescript",
|
|
63
63
|
openapiDocVersion: "0.0.1",
|
|
64
64
|
sdkVersion: "2.0.0",
|
|
65
|
-
genVersion: "2.
|
|
65
|
+
genVersion: "2.799.0",
|
|
66
66
|
userAgent:
|
|
67
|
-
"speakeasy-sdk/typescript 2.0.0 2.
|
|
67
|
+
"speakeasy-sdk/typescript 2.0.0 2.799.0 0.0.1 @compass-labs/api-sdk",
|
|
68
68
|
} as const;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The amount of tokens to transfer (in token units, not wei).
|
|
10
|
+
*/
|
|
11
|
+
export type EarnTransferFromEOAParamsAmount = number | string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Parameters for transferring tokens from EOA to Earn Account via Permit2.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
*
|
|
18
|
+
* Used by multicall/bundle endpoint to pull tokens from the owner's EOA
|
|
19
|
+
* into their Earn Account (Safe) as part of an atomic bundle transaction.
|
|
20
|
+
*
|
|
21
|
+
* The owner must have:
|
|
22
|
+
* 1. Previously approved Permit2 for the token (one-time setup via /gas_sponsorship/approve_transfer)
|
|
23
|
+
* 2. Signed a Permit2 message with spender = Earn Account address
|
|
24
|
+
*
|
|
25
|
+
* The signature is obtained by first calling /v2/earn/transfer with action=DEPOSIT
|
|
26
|
+
* and gas_sponsorship=True, then signing the returned EIP-712 typed data.
|
|
27
|
+
*/
|
|
28
|
+
export type EarnTransferFromEOAParams = {
|
|
29
|
+
/**
|
|
30
|
+
* Action type identifier for EOA-to-Earn-Account transfer operations.
|
|
31
|
+
*/
|
|
32
|
+
actionType: "V2_TRANSFER_FROM_EOA";
|
|
33
|
+
/**
|
|
34
|
+
* The token to transfer from EOA to Earn Account.
|
|
35
|
+
*/
|
|
36
|
+
token: string;
|
|
37
|
+
/**
|
|
38
|
+
* The amount of tokens to transfer (in token units, not wei).
|
|
39
|
+
*/
|
|
40
|
+
amount: number | string;
|
|
41
|
+
/**
|
|
42
|
+
* The EOA owner's signature of the Permit2 PermitTransferFrom typed data. Obtain this by calling /v2/earn/transfer with action=DEPOSIT and gas_sponsorship=True, then signing the returned EIP-712 data with the owner's wallet.
|
|
43
|
+
*/
|
|
44
|
+
permit2Signature: string;
|
|
45
|
+
/**
|
|
46
|
+
* The nonce used in the Permit2 signature (from the signed typed data).
|
|
47
|
+
*/
|
|
48
|
+
permit2Nonce: number;
|
|
49
|
+
/**
|
|
50
|
+
* The deadline timestamp used in the Permit2 signature (from the signed typed data).
|
|
51
|
+
*/
|
|
52
|
+
permit2Deadline: number;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** @internal */
|
|
56
|
+
export type EarnTransferFromEOAParamsAmount$Outbound = number | string;
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const EarnTransferFromEOAParamsAmount$outboundSchema: z.ZodType<
|
|
60
|
+
EarnTransferFromEOAParamsAmount$Outbound,
|
|
61
|
+
z.ZodTypeDef,
|
|
62
|
+
EarnTransferFromEOAParamsAmount
|
|
63
|
+
> = z.union([z.number(), z.string()]);
|
|
64
|
+
|
|
65
|
+
export function earnTransferFromEOAParamsAmountToJSON(
|
|
66
|
+
earnTransferFromEOAParamsAmount: EarnTransferFromEOAParamsAmount,
|
|
67
|
+
): string {
|
|
68
|
+
return JSON.stringify(
|
|
69
|
+
EarnTransferFromEOAParamsAmount$outboundSchema.parse(
|
|
70
|
+
earnTransferFromEOAParamsAmount,
|
|
71
|
+
),
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** @internal */
|
|
76
|
+
export type EarnTransferFromEOAParams$Outbound = {
|
|
77
|
+
action_type: "V2_TRANSFER_FROM_EOA";
|
|
78
|
+
token: string;
|
|
79
|
+
amount: number | string;
|
|
80
|
+
permit2_signature: string;
|
|
81
|
+
permit2_nonce: number;
|
|
82
|
+
permit2_deadline: number;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** @internal */
|
|
86
|
+
export const EarnTransferFromEOAParams$outboundSchema: z.ZodType<
|
|
87
|
+
EarnTransferFromEOAParams$Outbound,
|
|
88
|
+
z.ZodTypeDef,
|
|
89
|
+
EarnTransferFromEOAParams
|
|
90
|
+
> = z.object({
|
|
91
|
+
actionType: z.literal("V2_TRANSFER_FROM_EOA"),
|
|
92
|
+
token: z.string(),
|
|
93
|
+
amount: z.union([z.number(), z.string()]),
|
|
94
|
+
permit2Signature: z.string(),
|
|
95
|
+
permit2Nonce: z.number().int(),
|
|
96
|
+
permit2Deadline: z.number().int(),
|
|
97
|
+
}).transform((v) => {
|
|
98
|
+
return remap$(v, {
|
|
99
|
+
actionType: "action_type",
|
|
100
|
+
permit2Signature: "permit2_signature",
|
|
101
|
+
permit2Nonce: "permit2_nonce",
|
|
102
|
+
permit2Deadline: "permit2_deadline",
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export function earnTransferFromEOAParamsToJSON(
|
|
107
|
+
earnTransferFromEOAParams: EarnTransferFromEOAParams,
|
|
108
|
+
): string {
|
|
109
|
+
return JSON.stringify(
|
|
110
|
+
EarnTransferFromEOAParams$outboundSchema.parse(earnTransferFromEOAParams),
|
|
111
|
+
);
|
|
112
|
+
}
|
|
@@ -52,7 +52,7 @@ export type EarnTransferRequest = {
|
|
|
52
52
|
*/
|
|
53
53
|
gasSponsorship?: boolean | undefined;
|
|
54
54
|
/**
|
|
55
|
-
* The address
|
|
55
|
+
* 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 Earn Account (Safe) address, allowing the transfer to be included in a bundle transaction where the Safe pulls the tokens itself.
|
|
56
56
|
*/
|
|
57
57
|
spender?: string | null | undefined;
|
|
58
58
|
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Parameters for transferring tokens from Earn Account to EOA (withdrawal).
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
*
|
|
13
|
+
* Used by multicall/bundle endpoint to send tokens from the Earn Account (Safe) back
|
|
14
|
+
* to the owner's EOA as part of an atomic bundle transaction.
|
|
15
|
+
*
|
|
16
|
+
* No signature is required for this action since the Safe already owns the tokens and
|
|
17
|
+
* is executing the transfer as part of its own transaction.
|
|
18
|
+
*/
|
|
19
|
+
export type EarnTransferToEOAParams = {
|
|
20
|
+
/**
|
|
21
|
+
* Action type identifier for Earn-Account-to-EOA transfer operations.
|
|
22
|
+
*/
|
|
23
|
+
actionType: "V2_TRANSFER_TO_EOA";
|
|
24
|
+
/**
|
|
25
|
+
* The token to transfer from Earn Account to EOA.
|
|
26
|
+
*/
|
|
27
|
+
token: string;
|
|
28
|
+
/**
|
|
29
|
+
* The amount of tokens to transfer (in token units, not wei), or 'ALL' to transfer the entire balance.
|
|
30
|
+
*/
|
|
31
|
+
amount?: any | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export type EarnTransferToEOAParams$Outbound = {
|
|
36
|
+
action_type: "V2_TRANSFER_TO_EOA";
|
|
37
|
+
token: string;
|
|
38
|
+
amount?: any | undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** @internal */
|
|
42
|
+
export const EarnTransferToEOAParams$outboundSchema: z.ZodType<
|
|
43
|
+
EarnTransferToEOAParams$Outbound,
|
|
44
|
+
z.ZodTypeDef,
|
|
45
|
+
EarnTransferToEOAParams
|
|
46
|
+
> = z.object({
|
|
47
|
+
actionType: z.literal("V2_TRANSFER_TO_EOA"),
|
|
48
|
+
token: z.string(),
|
|
49
|
+
amount: z.any().optional(),
|
|
50
|
+
}).transform((v) => {
|
|
51
|
+
return remap$(v, {
|
|
52
|
+
actionType: "action_type",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export function earnTransferToEOAParamsToJSON(
|
|
57
|
+
earnTransferToEOAParams: EarnTransferToEOAParams,
|
|
58
|
+
): string {
|
|
59
|
+
return JSON.stringify(
|
|
60
|
+
EarnTransferToEOAParams$outboundSchema.parse(earnTransferToEOAParams),
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -90,8 +90,10 @@ export * from "./earnpositionsresponse.js";
|
|
|
90
90
|
export * from "./earnswapparams.js";
|
|
91
91
|
export * from "./earnswaprequest.js";
|
|
92
92
|
export * from "./earnswapresponse.js";
|
|
93
|
+
export * from "./earntransferfromeoaparams.js";
|
|
93
94
|
export * from "./earntransferrequest.js";
|
|
94
95
|
export * from "./earntransferresponse.js";
|
|
96
|
+
export * from "./earntransfertoeoaparams.js";
|
|
95
97
|
export * from "./eip712domainfield.js";
|
|
96
98
|
export * from "./eip712field.js";
|
|
97
99
|
export * from "./ensnameinforesponse.js";
|
|
@@ -11,6 +11,47 @@ import {
|
|
|
11
11
|
V2UserOperation$outboundSchema,
|
|
12
12
|
} from "./v2useroperation.js";
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Request to execute multiple earn actions in a single atomic transaction.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
*
|
|
19
|
+
* ## Supported Action Types
|
|
20
|
+
*
|
|
21
|
+
* - **V2_TRANSFER_FROM_EOA**: Transfer tokens from the owner's EOA to the Earn Account
|
|
22
|
+
* using Permit2. Requires a signed Permit2 message.
|
|
23
|
+
* - **V2_TRANSFER_TO_EOA**: Transfer tokens from the Earn Account back to the owner's EOA.
|
|
24
|
+
* No signature required (Safe owns the tokens).
|
|
25
|
+
* - **V2_SWAP**: Swap tokens within the Earn Account using 1inch aggregator.
|
|
26
|
+
* - **V2_MANAGE**: Deposit or withdraw from DeFi venues (Aave, Morpho, Vaults, etc.)
|
|
27
|
+
*
|
|
28
|
+
* ## Using V2_TRANSFER_FROM_EOA (Deposit to Earn Account)
|
|
29
|
+
*
|
|
30
|
+
* To include a transfer from EOA in your bundle, follow these steps:
|
|
31
|
+
*
|
|
32
|
+
* 1. **One-time setup**: Approve Permit2 to spend the token by calling
|
|
33
|
+
* `POST /v2/gas_sponsorship/approve_transfer` and executing the returned transaction.
|
|
34
|
+
*
|
|
35
|
+
* 2. **Get Permit2 signature**: Call `POST /v2/earn/transfer` with:
|
|
36
|
+
* - `action`: "DEPOSIT"
|
|
37
|
+
* - `gas_sponsorship`: true
|
|
38
|
+
* - `spender`: omit this field (defaults to Safe address for bundle use)
|
|
39
|
+
*
|
|
40
|
+
* This returns EIP-712 typed data. Sign it with the owner's wallet.
|
|
41
|
+
*
|
|
42
|
+
* 3. **Include in bundle**: Add a V2_TRANSFER_FROM_EOA action with the signature
|
|
43
|
+
* and nonce/deadline from the typed data.
|
|
44
|
+
*
|
|
45
|
+
* The bundle will atomically: pull tokens from EOA → execute subsequent actions.
|
|
46
|
+
*
|
|
47
|
+
* ## Using V2_TRANSFER_TO_EOA (Withdraw to EOA)
|
|
48
|
+
*
|
|
49
|
+
* To transfer tokens from the Earn Account back to the owner's EOA, simply add
|
|
50
|
+
* a V2_TRANSFER_TO_EOA action to your bundle. No signature is required since
|
|
51
|
+
* the Safe already owns the tokens.
|
|
52
|
+
*
|
|
53
|
+
* Use `amount: "ALL"` to transfer the entire token balance.
|
|
54
|
+
*/
|
|
14
55
|
export type V2BundleRequest = {
|
|
15
56
|
/**
|
|
16
57
|
* The owner's wallet address that controls the Earn Account.
|
|
@@ -13,27 +13,52 @@ import {
|
|
|
13
13
|
EarnSwapParams$Outbound,
|
|
14
14
|
EarnSwapParams$outboundSchema,
|
|
15
15
|
} from "./earnswapparams.js";
|
|
16
|
+
import {
|
|
17
|
+
EarnTransferFromEOAParams,
|
|
18
|
+
EarnTransferFromEOAParams$Outbound,
|
|
19
|
+
EarnTransferFromEOAParams$outboundSchema,
|
|
20
|
+
} from "./earntransferfromeoaparams.js";
|
|
21
|
+
import {
|
|
22
|
+
EarnTransferToEOAParams,
|
|
23
|
+
EarnTransferToEOAParams$Outbound,
|
|
24
|
+
EarnTransferToEOAParams$outboundSchema,
|
|
25
|
+
} from "./earntransfertoeoaparams.js";
|
|
16
26
|
|
|
17
|
-
export type V2UserOperationBody =
|
|
27
|
+
export type V2UserOperationBody =
|
|
28
|
+
| EarnManageParams
|
|
29
|
+
| EarnSwapParams
|
|
30
|
+
| EarnTransferFromEOAParams
|
|
31
|
+
| EarnTransferToEOAParams;
|
|
18
32
|
|
|
19
33
|
/**
|
|
20
34
|
* A single operation in a V2 bundle.
|
|
21
35
|
*/
|
|
22
36
|
export type V2UserOperation = {
|
|
23
|
-
body:
|
|
37
|
+
body:
|
|
38
|
+
| EarnManageParams
|
|
39
|
+
| EarnSwapParams
|
|
40
|
+
| EarnTransferFromEOAParams
|
|
41
|
+
| EarnTransferToEOAParams;
|
|
24
42
|
};
|
|
25
43
|
|
|
26
44
|
/** @internal */
|
|
27
45
|
export type V2UserOperationBody$Outbound =
|
|
28
46
|
| EarnManageParams$Outbound
|
|
29
|
-
| EarnSwapParams$Outbound
|
|
47
|
+
| EarnSwapParams$Outbound
|
|
48
|
+
| EarnTransferFromEOAParams$Outbound
|
|
49
|
+
| EarnTransferToEOAParams$Outbound;
|
|
30
50
|
|
|
31
51
|
/** @internal */
|
|
32
52
|
export const V2UserOperationBody$outboundSchema: z.ZodType<
|
|
33
53
|
V2UserOperationBody$Outbound,
|
|
34
54
|
z.ZodTypeDef,
|
|
35
55
|
V2UserOperationBody
|
|
36
|
-
> = z.union([
|
|
56
|
+
> = z.union([
|
|
57
|
+
EarnManageParams$outboundSchema,
|
|
58
|
+
EarnSwapParams$outboundSchema,
|
|
59
|
+
EarnTransferFromEOAParams$outboundSchema,
|
|
60
|
+
EarnTransferToEOAParams$outboundSchema,
|
|
61
|
+
]);
|
|
37
62
|
|
|
38
63
|
export function v2UserOperationBodyToJSON(
|
|
39
64
|
v2UserOperationBody: V2UserOperationBody,
|
|
@@ -45,7 +70,11 @@ export function v2UserOperationBodyToJSON(
|
|
|
45
70
|
|
|
46
71
|
/** @internal */
|
|
47
72
|
export type V2UserOperation$Outbound = {
|
|
48
|
-
body:
|
|
73
|
+
body:
|
|
74
|
+
| EarnManageParams$Outbound
|
|
75
|
+
| EarnSwapParams$Outbound
|
|
76
|
+
| EarnTransferFromEOAParams$Outbound
|
|
77
|
+
| EarnTransferToEOAParams$Outbound;
|
|
49
78
|
};
|
|
50
79
|
|
|
51
80
|
/** @internal */
|
|
@@ -57,6 +86,8 @@ export const V2UserOperation$outboundSchema: z.ZodType<
|
|
|
57
86
|
body: z.union([
|
|
58
87
|
EarnManageParams$outboundSchema,
|
|
59
88
|
EarnSwapParams$outboundSchema,
|
|
89
|
+
EarnTransferFromEOAParams$outboundSchema,
|
|
90
|
+
EarnTransferToEOAParams$outboundSchema,
|
|
60
91
|
]),
|
|
61
92
|
});
|
|
62
93
|
|