@compass-labs/api-sdk 2.2.25-rc.0 → 2.2.26-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/dist/commonjs/models/components/earntransferrequest.d.ts +5 -0
- package/dist/commonjs/models/components/earntransferrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/earntransferrequest.js +1 -0
- package/dist/commonjs/models/components/earntransferrequest.js.map +1 -1
- package/dist/commonjs/models/components/earntransfertoaddressparams.d.ts +50 -0
- package/dist/commonjs/models/components/earntransfertoaddressparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/earntransfertoaddressparams.js +63 -0
- package/dist/commonjs/models/components/earntransfertoaddressparams.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +1 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/v2bundlerequest.d.ts +10 -8
- 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 +5 -4
- package/dist/commonjs/models/components/v2useroperation.d.ts.map +1 -1
- package/dist/commonjs/models/components/v2useroperation.js +3 -0
- package/dist/commonjs/models/components/v2useroperation.js.map +1 -1
- package/dist/esm/models/components/earntransferrequest.d.ts +5 -0
- package/dist/esm/models/components/earntransferrequest.d.ts.map +1 -1
- package/dist/esm/models/components/earntransferrequest.js +1 -0
- package/dist/esm/models/components/earntransferrequest.js.map +1 -1
- package/dist/esm/models/components/earntransfertoaddressparams.d.ts +50 -0
- package/dist/esm/models/components/earntransfertoaddressparams.d.ts.map +1 -0
- package/dist/esm/models/components/earntransfertoaddressparams.js +25 -0
- package/dist/esm/models/components/earntransfertoaddressparams.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +1 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/v2bundlerequest.d.ts +10 -8
- 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 +5 -4
- package/dist/esm/models/components/v2useroperation.d.ts.map +1 -1
- package/dist/esm/models/components/v2useroperation.js +3 -0
- package/dist/esm/models/components/v2useroperation.js.map +1 -1
- package/docs/models/components/earntransferrequest.md +2 -1
- package/docs/models/components/earntransfertoaddressparams.md +31 -0
- package/docs/models/components/earntransfertoaddressparamsamount.md +19 -0
- package/docs/models/components/v2bundlerequest.md +10 -8
- package/docs/models/components/v2useroperation.md +4 -7
- package/docs/models/components/v2useroperationbody.md +11 -0
- package/examples/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/examples/node_modules/@esbuild/linux-x64/package.json +1 -1
- package/examples/node_modules/esbuild/bin/esbuild +1 -1
- package/examples/node_modules/esbuild/lib/main.js +300 -10
- package/examples/node_modules/esbuild/package.json +27 -27
- package/examples/package-lock.json +107 -107
- package/package.json +1 -1
- package/src/models/components/earntransferrequest.ts +6 -0
- package/src/models/components/earntransfertoaddressparams.ts +95 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/v2bundlerequest.ts +10 -8
- package/src/models/components/v2useroperation.ts +11 -0
|
@@ -8,14 +8,16 @@ import { V2UserOperation, V2UserOperation$Outbound } from "./v2useroperation.js"
|
|
|
8
8
|
*
|
|
9
9
|
* ## Supported Action Types
|
|
10
10
|
*
|
|
11
|
-
* - **V2_TRANSFER_FROM_EOA**: Transfer tokens from the owner's EOA to the
|
|
11
|
+
* - **V2_TRANSFER_FROM_EOA**: Transfer tokens from the owner's EOA to the product account
|
|
12
12
|
* using Permit2. Requires a signed Permit2 message.
|
|
13
|
-
* - **V2_TRANSFER_TO_EOA**: Transfer tokens from the
|
|
14
|
-
* No signature required (
|
|
15
|
-
* - **
|
|
13
|
+
* - **V2_TRANSFER_TO_EOA**: Transfer tokens from the product account back to the owner's EOA.
|
|
14
|
+
* No signature required (product account owns the tokens).
|
|
15
|
+
* - **V2_TRANSFER_TO_ADDRESS**: Transfer ERC20 tokens from the product account to any
|
|
16
|
+
* specified recipient address. No signature required (product account owns the tokens).
|
|
17
|
+
* - **V2_SWAP**: Swap tokens within the product account using 1inch aggregator.
|
|
16
18
|
* - **V2_MANAGE**: Deposit or withdraw from DeFi venues (Aave, Morpho, Vaults, etc.)
|
|
17
19
|
*
|
|
18
|
-
* ## Using V2_TRANSFER_FROM_EOA (Deposit to
|
|
20
|
+
* ## Using V2_TRANSFER_FROM_EOA (Deposit to Product Account)
|
|
19
21
|
*
|
|
20
22
|
* To include a transfer from EOA in your bundle, follow these steps:
|
|
21
23
|
*
|
|
@@ -25,7 +27,7 @@ import { V2UserOperation, V2UserOperation$Outbound } from "./v2useroperation.js"
|
|
|
25
27
|
* 2. **Get Permit2 signature**: Call `POST /v2/earn/transfer` with:
|
|
26
28
|
* - `action`: "DEPOSIT"
|
|
27
29
|
* - `gas_sponsorship`: true
|
|
28
|
-
* - `spender`: omit this field (defaults to
|
|
30
|
+
* - `spender`: omit this field (defaults to product account address for bundle use)
|
|
29
31
|
*
|
|
30
32
|
* This returns EIP-712 typed data. Sign it with the owner's wallet.
|
|
31
33
|
*
|
|
@@ -36,9 +38,9 @@ import { V2UserOperation, V2UserOperation$Outbound } from "./v2useroperation.js"
|
|
|
36
38
|
*
|
|
37
39
|
* ## Using V2_TRANSFER_TO_EOA (Withdraw to EOA)
|
|
38
40
|
*
|
|
39
|
-
* To transfer tokens from the
|
|
41
|
+
* To transfer tokens from the product account back to the owner's EOA, simply add
|
|
40
42
|
* a V2_TRANSFER_TO_EOA action to your bundle. No signature is required since
|
|
41
|
-
* the
|
|
43
|
+
* the product account already owns the tokens.
|
|
42
44
|
*
|
|
43
45
|
* Specify the exact token amount to transfer.
|
|
44
46
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2bundlerequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/v2bundlerequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAwB,MAAM,YAAY,CAAC;AACzD,OAAO,EACL,eAAe,EACf,wBAAwB,EAEzB,MAAM,sBAAsB,CAAC;AAE9B
|
|
1
|
+
{"version":3,"file":"v2bundlerequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/v2bundlerequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAwB,MAAM,YAAY,CAAC;AACzD,OAAO,EACL,eAAe,EACf,wBAAwB,EAEzB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IACb;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IAChC;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACzC,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAAO,CACpD,wBAAwB,EACxB,CAAC,CAAC,UAAU,EACZ,eAAe,CAUf,CAAC;AAEH,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAER"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2bundlerequest.js","sourceRoot":"","sources":["../../../../src/models/components/v2bundlerequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAS,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAGL,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"v2bundlerequest.js","sourceRoot":"","sources":["../../../../src/models/components/v2bundlerequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAS,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAGL,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAwE9B,gBAAgB;AAChB,MAAM,CAAC,MAAM,8BAA8B,GAIvC,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,oBAAoB;IAC3B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC;IAChD,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACvC,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,qBAAqB,CACnC,eAAgC;IAEhC,OAAO,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -2,22 +2,23 @@ import * as z from "zod/v3";
|
|
|
2
2
|
import { EarnManageParams, EarnManageParams$Outbound } from "./earnmanageparams.js";
|
|
3
3
|
import { EarnSwapParams, EarnSwapParams$Outbound } from "./earnswapparams.js";
|
|
4
4
|
import { EarnTransferFromEOAParams, EarnTransferFromEOAParams$Outbound } from "./earntransferfromeoaparams.js";
|
|
5
|
+
import { EarnTransferToAddressParams, EarnTransferToAddressParams$Outbound } from "./earntransfertoaddressparams.js";
|
|
5
6
|
import { EarnTransferToEOAParams, EarnTransferToEOAParams$Outbound } from "./earntransfertoeoaparams.js";
|
|
6
|
-
export type V2UserOperationBody = EarnManageParams | EarnSwapParams | EarnTransferFromEOAParams | EarnTransferToEOAParams;
|
|
7
|
+
export type V2UserOperationBody = EarnManageParams | EarnSwapParams | EarnTransferFromEOAParams | EarnTransferToAddressParams | EarnTransferToEOAParams;
|
|
7
8
|
/**
|
|
8
9
|
* A single operation in a V2 bundle.
|
|
9
10
|
*/
|
|
10
11
|
export type V2UserOperation = {
|
|
11
|
-
body: EarnManageParams | EarnSwapParams | EarnTransferFromEOAParams | EarnTransferToEOAParams;
|
|
12
|
+
body: EarnManageParams | EarnSwapParams | EarnTransferFromEOAParams | EarnTransferToAddressParams | EarnTransferToEOAParams;
|
|
12
13
|
};
|
|
13
14
|
/** @internal */
|
|
14
|
-
export type V2UserOperationBody$Outbound = EarnManageParams$Outbound | EarnSwapParams$Outbound | EarnTransferFromEOAParams$Outbound | EarnTransferToEOAParams$Outbound;
|
|
15
|
+
export type V2UserOperationBody$Outbound = EarnManageParams$Outbound | EarnSwapParams$Outbound | EarnTransferFromEOAParams$Outbound | EarnTransferToAddressParams$Outbound | EarnTransferToEOAParams$Outbound;
|
|
15
16
|
/** @internal */
|
|
16
17
|
export declare const V2UserOperationBody$outboundSchema: z.ZodType<V2UserOperationBody$Outbound, z.ZodTypeDef, V2UserOperationBody>;
|
|
17
18
|
export declare function v2UserOperationBodyToJSON(v2UserOperationBody: V2UserOperationBody): string;
|
|
18
19
|
/** @internal */
|
|
19
20
|
export type V2UserOperation$Outbound = {
|
|
20
|
-
body: EarnManageParams$Outbound | EarnSwapParams$Outbound | EarnTransferFromEOAParams$Outbound | EarnTransferToEOAParams$Outbound;
|
|
21
|
+
body: EarnManageParams$Outbound | EarnSwapParams$Outbound | EarnTransferFromEOAParams$Outbound | EarnTransferToAddressParams$Outbound | EarnTransferToEOAParams$Outbound;
|
|
21
22
|
};
|
|
22
23
|
/** @internal */
|
|
23
24
|
export declare const V2UserOperation$outboundSchema: z.ZodType<V2UserOperation$Outbound, z.ZodTypeDef, V2UserOperation>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2useroperation.d.ts","sourceRoot":"","sources":["../../../../src/models/components/v2useroperation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EAE1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EACd,uBAAuB,EAExB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAEnC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,uBAAuB,EACvB,gCAAgC,EAEjC,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAC3B,gBAAgB,GAChB,cAAc,GACd,yBAAyB,GACzB,uBAAuB,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EACA,gBAAgB,GAChB,cAAc,GACd,yBAAyB,GACzB,uBAAuB,CAAC;CAC7B,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,4BAA4B,GACpC,yBAAyB,GACzB,uBAAuB,GACvB,kCAAkC,GAClC,gCAAgC,CAAC;AAErC,gBAAgB;AAChB,eAAO,MAAM,kCAAkC,EAAE,CAAC,CAAC,OAAO,CACxD,4BAA4B,EAC5B,CAAC,CAAC,UAAU,EACZ,mBAAmB,
|
|
1
|
+
{"version":3,"file":"v2useroperation.d.ts","sourceRoot":"","sources":["../../../../src/models/components/v2useroperation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EAE1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EACd,uBAAuB,EAExB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAEnC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EAErC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,uBAAuB,EACvB,gCAAgC,EAEjC,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAC3B,gBAAgB,GAChB,cAAc,GACd,yBAAyB,GACzB,2BAA2B,GAC3B,uBAAuB,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EACA,gBAAgB,GAChB,cAAc,GACd,yBAAyB,GACzB,2BAA2B,GAC3B,uBAAuB,CAAC;CAC7B,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,4BAA4B,GACpC,yBAAyB,GACzB,uBAAuB,GACvB,kCAAkC,GAClC,oCAAoC,GACpC,gCAAgC,CAAC;AAErC,gBAAgB;AAChB,eAAO,MAAM,kCAAkC,EAAE,CAAC,CAAC,OAAO,CACxD,4BAA4B,EAC5B,CAAC,CAAC,UAAU,EACZ,mBAAmB,CAOnB,CAAC;AAEH,wBAAgB,yBAAyB,CACvC,mBAAmB,EAAE,mBAAmB,GACvC,MAAM,CAIR;AAED,gBAAgB;AAChB,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EACA,yBAAyB,GACzB,uBAAuB,GACvB,kCAAkC,GAClC,oCAAoC,GACpC,gCAAgC,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAAO,CACpD,wBAAwB,EACxB,CAAC,CAAC,UAAU,EACZ,eAAe,CASf,CAAC;AAEH,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAER"}
|
|
@@ -5,12 +5,14 @@ import * as z from "zod/v3";
|
|
|
5
5
|
import { EarnManageParams$outboundSchema, } from "./earnmanageparams.js";
|
|
6
6
|
import { EarnSwapParams$outboundSchema, } from "./earnswapparams.js";
|
|
7
7
|
import { EarnTransferFromEOAParams$outboundSchema, } from "./earntransferfromeoaparams.js";
|
|
8
|
+
import { EarnTransferToAddressParams$outboundSchema, } from "./earntransfertoaddressparams.js";
|
|
8
9
|
import { EarnTransferToEOAParams$outboundSchema, } from "./earntransfertoeoaparams.js";
|
|
9
10
|
/** @internal */
|
|
10
11
|
export const V2UserOperationBody$outboundSchema = z.union([
|
|
11
12
|
EarnManageParams$outboundSchema,
|
|
12
13
|
EarnSwapParams$outboundSchema,
|
|
13
14
|
EarnTransferFromEOAParams$outboundSchema,
|
|
15
|
+
EarnTransferToAddressParams$outboundSchema,
|
|
14
16
|
EarnTransferToEOAParams$outboundSchema,
|
|
15
17
|
]);
|
|
16
18
|
export function v2UserOperationBodyToJSON(v2UserOperationBody) {
|
|
@@ -22,6 +24,7 @@ export const V2UserOperation$outboundSchema = z.object({
|
|
|
22
24
|
EarnManageParams$outboundSchema,
|
|
23
25
|
EarnSwapParams$outboundSchema,
|
|
24
26
|
EarnTransferFromEOAParams$outboundSchema,
|
|
27
|
+
EarnTransferToAddressParams$outboundSchema,
|
|
25
28
|
EarnTransferToEOAParams$outboundSchema,
|
|
26
29
|
]),
|
|
27
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2useroperation.js","sourceRoot":"","sources":["../../../../src/models/components/v2useroperation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAGL,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,6BAA6B,GAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,wCAAwC,GACzC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAGL,sCAAsC,GACvC,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"v2useroperation.js","sourceRoot":"","sources":["../../../../src/models/components/v2useroperation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAGL,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,6BAA6B,GAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,wCAAwC,GACzC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAGL,0CAA0C,GAC3C,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAGL,sCAAsC,GACvC,MAAM,8BAA8B,CAAC;AA6BtC,gBAAgB;AAChB,MAAM,CAAC,MAAM,kCAAkC,GAI3C,CAAC,CAAC,KAAK,CAAC;IACV,+BAA+B;IAC/B,6BAA6B;IAC7B,wCAAwC;IACxC,0CAA0C;IAC1C,sCAAsC;CACvC,CAAC,CAAC;AAEH,MAAM,UAAU,yBAAyB,CACvC,mBAAwC;IAExC,OAAO,IAAI,CAAC,SAAS,CACnB,kCAAkC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAC9D,CAAC;AACJ,CAAC;AAYD,gBAAgB;AAChB,MAAM,CAAC,MAAM,8BAA8B,GAIvC,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;QACZ,+BAA+B;QAC/B,6BAA6B;QAC7B,wCAAwC;QACxC,0CAA0C;QAC1C,sCAAsC;KACvC,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,UAAU,qBAAqB,CACnC,eAAgC;IAEhC,OAAO,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -24,4 +24,5 @@ let value: EarnTransferRequest = {
|
|
|
24
24
|
| `amount` | *components.EarnTransferRequestAmount* | :heavy_check_mark: | The amount of 'token' to transfer. | 0.01 |
|
|
25
25
|
| `action` | [components.EarnTransferRequestAction](../../models/components/earntransferrequestaction.md) | :heavy_check_mark: | Whether you are depositing to or withdrawing from your earn account. | DEPOSIT |
|
|
26
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 Earn Account (Safe) address, allowing the transfer to be included in a bundle transaction where the Safe pulls the tokens itself. | |
|
|
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 Earn Account (Safe) address, allowing the transfer to be included in a bundle transaction where the Safe pulls the tokens itself. | |
|
|
28
|
+
| `recipient` | *string* | :heavy_minus_sign: | Optional recipient address for withdrawals. When `action` is 'WITHDRAW': - If provided, tokens will be sent to this address instead of the owner. - If not provided, defaults to the owner's address. | |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# EarnTransferToAddressParams
|
|
2
|
+
|
|
3
|
+
Parameters for transferring tokens from product account to an arbitrary address.
|
|
4
|
+
|
|
5
|
+
Used by multicall/bundle endpoint to send ERC20 tokens from the product account
|
|
6
|
+
to any specified recipient address as part of an atomic bundle transaction.
|
|
7
|
+
|
|
8
|
+
No signature is required for this action since the product account already owns
|
|
9
|
+
the tokens and is executing the transfer as part of its own transaction.
|
|
10
|
+
|
|
11
|
+
## Example Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { EarnTransferToAddressParams } from "@compass-labs/api-sdk/models/components";
|
|
15
|
+
|
|
16
|
+
let value: EarnTransferToAddressParams = {
|
|
17
|
+
actionType: "V2_TRANSFER_TO_ADDRESS",
|
|
18
|
+
token: "<value>",
|
|
19
|
+
amount: 1644.08,
|
|
20
|
+
recipient: "<value>",
|
|
21
|
+
};
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Fields
|
|
25
|
+
|
|
26
|
+
| Field | Type | Required | Description | Example |
|
|
27
|
+
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
|
28
|
+
| `actionType` | *"V2_TRANSFER_TO_ADDRESS"* | :heavy_check_mark: | Action type identifier for product-account-to-arbitrary-address transfer operations. | V2_TRANSFER_TO_ADDRESS |
|
|
29
|
+
| `token` | *string* | :heavy_check_mark: | The ERC20 token to transfer from the product account. | |
|
|
30
|
+
| `amount` | *components.EarnTransferToAddressParamsAmount* | :heavy_check_mark: | The amount of tokens to transfer (in token units, not wei). | |
|
|
31
|
+
| `recipient` | *string* | :heavy_check_mark: | The destination address to receive the tokens. | |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# EarnTransferToAddressParamsAmount
|
|
2
|
+
|
|
3
|
+
The amount of tokens to transfer (in token units, not wei).
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Supported Types
|
|
7
|
+
|
|
8
|
+
### `number`
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
const value: number = 1284.03;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### `string`
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
const value: string = "<value>";
|
|
18
|
+
```
|
|
19
|
+
|
|
@@ -4,14 +4,16 @@ Request to execute multiple earn actions in a single atomic transaction.
|
|
|
4
4
|
|
|
5
5
|
## Supported Action Types
|
|
6
6
|
|
|
7
|
-
- **V2_TRANSFER_FROM_EOA**: Transfer tokens from the owner's EOA to the
|
|
7
|
+
- **V2_TRANSFER_FROM_EOA**: Transfer tokens from the owner's EOA to the product account
|
|
8
8
|
using Permit2. Requires a signed Permit2 message.
|
|
9
|
-
- **V2_TRANSFER_TO_EOA**: Transfer tokens from the
|
|
10
|
-
No signature required (
|
|
11
|
-
- **
|
|
9
|
+
- **V2_TRANSFER_TO_EOA**: Transfer tokens from the product account back to the owner's EOA.
|
|
10
|
+
No signature required (product account owns the tokens).
|
|
11
|
+
- **V2_TRANSFER_TO_ADDRESS**: Transfer ERC20 tokens from the product account to any
|
|
12
|
+
specified recipient address. No signature required (product account owns the tokens).
|
|
13
|
+
- **V2_SWAP**: Swap tokens within the product account using 1inch aggregator.
|
|
12
14
|
- **V2_MANAGE**: Deposit or withdraw from DeFi venues (Aave, Morpho, Vaults, etc.)
|
|
13
15
|
|
|
14
|
-
## Using V2_TRANSFER_FROM_EOA (Deposit to
|
|
16
|
+
## Using V2_TRANSFER_FROM_EOA (Deposit to Product Account)
|
|
15
17
|
|
|
16
18
|
To include a transfer from EOA in your bundle, follow these steps:
|
|
17
19
|
|
|
@@ -21,7 +23,7 @@ To include a transfer from EOA in your bundle, follow these steps:
|
|
|
21
23
|
2. **Get Permit2 signature**: Call `POST /v2/earn/transfer` with:
|
|
22
24
|
- `action`: "DEPOSIT"
|
|
23
25
|
- `gas_sponsorship`: true
|
|
24
|
-
- `spender`: omit this field (defaults to
|
|
26
|
+
- `spender`: omit this field (defaults to product account address for bundle use)
|
|
25
27
|
|
|
26
28
|
This returns EIP-712 typed data. Sign it with the owner's wallet.
|
|
27
29
|
|
|
@@ -32,9 +34,9 @@ The bundle will atomically: pull tokens from EOA → execute subsequent actions.
|
|
|
32
34
|
|
|
33
35
|
## Using V2_TRANSFER_TO_EOA (Withdraw to EOA)
|
|
34
36
|
|
|
35
|
-
To transfer tokens from the
|
|
37
|
+
To transfer tokens from the product account back to the owner's EOA, simply add
|
|
36
38
|
a V2_TRANSFER_TO_EOA action to your bundle. No signature is required since
|
|
37
|
-
the
|
|
39
|
+
the product account already owns the tokens.
|
|
38
40
|
|
|
39
41
|
Specify the exact token amount to transfer.
|
|
40
42
|
|
|
@@ -9,13 +9,10 @@ import { V2UserOperation } from "@compass-labs/api-sdk/models/components";
|
|
|
9
9
|
|
|
10
10
|
let value: V2UserOperation = {
|
|
11
11
|
body: {
|
|
12
|
-
actionType: "
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
action: "WITHDRAW",
|
|
18
|
-
amount: "314.39",
|
|
12
|
+
actionType: "V2_SWAP",
|
|
13
|
+
tokenIn: "<value>",
|
|
14
|
+
tokenOut: "<value>",
|
|
15
|
+
amountIn: "<value>",
|
|
19
16
|
},
|
|
20
17
|
};
|
|
21
18
|
```
|
|
@@ -47,6 +47,17 @@ const value: components.EarnTransferFromEOAParams = {
|
|
|
47
47
|
};
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
### `components.EarnTransferToAddressParams`
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
const value: components.EarnTransferToAddressParams = {
|
|
54
|
+
actionType: "V2_TRANSFER_TO_ADDRESS",
|
|
55
|
+
token: "<value>",
|
|
56
|
+
amount: 1644.08,
|
|
57
|
+
recipient: "<value>",
|
|
58
|
+
};
|
|
59
|
+
```
|
|
60
|
+
|
|
50
61
|
### `components.EarnTransferToEOAParams`
|
|
51
62
|
|
|
52
63
|
```typescript
|
|
Binary file
|
|
@@ -201,7 +201,7 @@ for your current platform.`);
|
|
|
201
201
|
"node_modules",
|
|
202
202
|
".cache",
|
|
203
203
|
"esbuild",
|
|
204
|
-
`pnpapi-${pkg.replace("/", "-")}-${"0.27.
|
|
204
|
+
`pnpapi-${pkg.replace("/", "-")}-${"0.27.4"}-${path.basename(subpath)}`
|
|
205
205
|
);
|
|
206
206
|
if (!fs.existsSync(binTargetPath)) {
|
|
207
207
|
fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
|