@compass-labs/api-sdk 2.1.26-rc.1 → 2.1.26-rc.11
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/funcs/earnEarnManage.d.ts +4 -1
- package/dist/commonjs/funcs/earnEarnManage.d.ts.map +1 -1
- package/dist/commonjs/funcs/earnEarnManage.js +4 -1
- package/dist/commonjs/funcs/earnEarnManage.js.map +1 -1
- package/dist/commonjs/funcs/earnEarnPositions.js +1 -2
- package/dist/commonjs/funcs/earnEarnPositions.js.map +1 -1
- package/dist/commonjs/models/components/aaveposition.d.ts +0 -4
- package/dist/commonjs/models/components/aaveposition.d.ts.map +1 -1
- package/dist/commonjs/models/components/aaveposition.js +0 -1
- package/dist/commonjs/models/components/aaveposition.js.map +1 -1
- package/dist/commonjs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.d.ts +0 -4
- package/dist/commonjs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.d.ts.map +1 -1
- package/dist/commonjs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.js +0 -1
- package/dist/commonjs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.js.map +1 -1
- package/dist/commonjs/models/components/depositevent.d.ts +0 -4
- package/dist/commonjs/models/components/depositevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/depositevent.js +0 -2
- package/dist/commonjs/models/components/depositevent.js.map +1 -1
- package/dist/commonjs/models/components/fee.d.ts +6 -5
- package/dist/commonjs/models/components/fee.d.ts.map +1 -1
- package/dist/commonjs/models/components/fee.js +2 -1
- package/dist/commonjs/models/components/fee.js.map +1 -1
- package/dist/commonjs/models/components/withdrawalevent.d.ts +0 -4
- package/dist/commonjs/models/components/withdrawalevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/withdrawalevent.js +0 -2
- package/dist/commonjs/models/components/withdrawalevent.js.map +1 -1
- package/dist/commonjs/models/operations/v2earnpositions.d.ts +3 -8
- package/dist/commonjs/models/operations/v2earnpositions.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2earnpositions.js +1 -7
- package/dist/commonjs/models/operations/v2earnpositions.js.map +1 -1
- package/dist/commonjs/sdk/earn.d.ts +4 -1
- package/dist/commonjs/sdk/earn.d.ts.map +1 -1
- package/dist/commonjs/sdk/earn.js +4 -1
- package/dist/commonjs/sdk/earn.js.map +1 -1
- package/dist/esm/funcs/earnEarnManage.d.ts +4 -1
- package/dist/esm/funcs/earnEarnManage.d.ts.map +1 -1
- package/dist/esm/funcs/earnEarnManage.js +4 -1
- package/dist/esm/funcs/earnEarnManage.js.map +1 -1
- package/dist/esm/funcs/earnEarnPositions.js +1 -2
- package/dist/esm/funcs/earnEarnPositions.js.map +1 -1
- package/dist/esm/models/components/aaveposition.d.ts +0 -4
- package/dist/esm/models/components/aaveposition.d.ts.map +1 -1
- package/dist/esm/models/components/aaveposition.js +0 -1
- package/dist/esm/models/components/aaveposition.js.map +1 -1
- package/dist/esm/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.d.ts +0 -4
- package/dist/esm/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.d.ts.map +1 -1
- package/dist/esm/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.js +0 -1
- package/dist/esm/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.js.map +1 -1
- package/dist/esm/models/components/depositevent.d.ts +0 -4
- package/dist/esm/models/components/depositevent.d.ts.map +1 -1
- package/dist/esm/models/components/depositevent.js +0 -2
- package/dist/esm/models/components/depositevent.js.map +1 -1
- package/dist/esm/models/components/fee.d.ts +6 -5
- package/dist/esm/models/components/fee.d.ts.map +1 -1
- package/dist/esm/models/components/fee.js +2 -1
- package/dist/esm/models/components/fee.js.map +1 -1
- package/dist/esm/models/components/withdrawalevent.d.ts +0 -4
- package/dist/esm/models/components/withdrawalevent.d.ts.map +1 -1
- package/dist/esm/models/components/withdrawalevent.js +0 -2
- package/dist/esm/models/components/withdrawalevent.js.map +1 -1
- package/dist/esm/models/operations/v2earnpositions.d.ts +3 -8
- package/dist/esm/models/operations/v2earnpositions.d.ts.map +1 -1
- package/dist/esm/models/operations/v2earnpositions.js +1 -7
- package/dist/esm/models/operations/v2earnpositions.js.map +1 -1
- package/dist/esm/sdk/earn.d.ts +4 -1
- package/dist/esm/sdk/earn.d.ts.map +1 -1
- package/dist/esm/sdk/earn.js +4 -1
- package/dist/esm/sdk/earn.js.map +1 -1
- package/docs/models/components/aaveposition.md +0 -2
- package/docs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.md +0 -2
- package/docs/models/components/denomination.md +2 -2
- package/docs/models/components/depositevent.md +7 -9
- package/docs/models/components/fee.md +5 -5
- package/docs/models/components/feeamount.md +1 -1
- package/docs/models/components/userposition.md +0 -2
- package/docs/models/components/withdrawalevent.md +9 -11
- package/docs/models/operations/v2earnpositionsrequest.md +2 -4
- package/docs/sdks/earn/README.md +6 -5
- package/package.json +1 -1
- package/src/funcs/earnEarnManage.ts +4 -1
- package/src/funcs/earnEarnPositions.ts +1 -2
- package/src/models/components/aaveposition.ts +0 -5
- package/src/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.ts +0 -5
- package/src/models/components/depositevent.ts +0 -8
- package/src/models/components/fee.ts +6 -5
- package/src/models/components/withdrawalevent.ts +0 -8
- package/src/models/operations/v2earnpositions.ts +4 -15
- package/src/sdk/earn.ts +4 -1
|
@@ -14,10 +14,6 @@ export type AavePosition = {
|
|
|
14
14
|
* The market type discriminator.
|
|
15
15
|
*/
|
|
16
16
|
type: "AAVE";
|
|
17
|
-
/**
|
|
18
|
-
* Base64-encoded position identifier.
|
|
19
|
-
*/
|
|
20
|
-
id: string;
|
|
21
17
|
vaultAddress?: "None" | undefined;
|
|
22
18
|
/**
|
|
23
19
|
* The user's position value denominated in the supplied asset.
|
|
@@ -41,7 +37,6 @@ export const AavePosition$inboundSchema: z.ZodType<
|
|
|
41
37
|
unknown
|
|
42
38
|
> = z.object({
|
|
43
39
|
type: z.literal("AAVE"),
|
|
44
|
-
id: z.string(),
|
|
45
40
|
vault_address: z.literal("None").optional(),
|
|
46
41
|
amount_in_underlying_token: z.string(),
|
|
47
42
|
token_name: z.string(),
|
package/src/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.ts
CHANGED
|
@@ -14,10 +14,6 @@ export type CompassApiBackendV2ModelsEarnReadResponsePositionsVaultPosition = {
|
|
|
14
14
|
* The market type discriminator.
|
|
15
15
|
*/
|
|
16
16
|
type: "VAULT";
|
|
17
|
-
/**
|
|
18
|
-
* Base64-encoded position identifier.
|
|
19
|
-
*/
|
|
20
|
-
id: string;
|
|
21
17
|
/**
|
|
22
18
|
* The vault address you are depositing to.
|
|
23
19
|
*/
|
|
@@ -48,7 +44,6 @@ export const CompassApiBackendV2ModelsEarnReadResponsePositionsVaultPosition$inb
|
|
|
48
44
|
unknown
|
|
49
45
|
> = z.object({
|
|
50
46
|
type: z.literal("VAULT"),
|
|
51
|
-
id: z.string(),
|
|
52
47
|
vault_address: z.string(),
|
|
53
48
|
amount_in_underlying_token: z.string(),
|
|
54
49
|
token_name: z.string(),
|
|
@@ -16,10 +16,6 @@ export type DepositEvent = {
|
|
|
16
16
|
* Block number when deposit occurred
|
|
17
17
|
*/
|
|
18
18
|
blockNumber: number;
|
|
19
|
-
/**
|
|
20
|
-
* Timestamp of the deposit
|
|
21
|
-
*/
|
|
22
|
-
blockTimestamp: Date;
|
|
23
19
|
/**
|
|
24
20
|
* Transaction hash of the deposit
|
|
25
21
|
*/
|
|
@@ -45,9 +41,6 @@ export const DepositEvent$inboundSchema: z.ZodType<
|
|
|
45
41
|
unknown
|
|
46
42
|
> = z.object({
|
|
47
43
|
block_number: z.number().int(),
|
|
48
|
-
block_timestamp: z.string().datetime({ offset: true }).transform(v =>
|
|
49
|
-
new Date(v)
|
|
50
|
-
),
|
|
51
44
|
transaction_hash: z.string(),
|
|
52
45
|
assets_deposited: z.string(),
|
|
53
46
|
units_received: z.string(),
|
|
@@ -55,7 +48,6 @@ export const DepositEvent$inboundSchema: z.ZodType<
|
|
|
55
48
|
}).transform((v) => {
|
|
56
49
|
return remap$(v, {
|
|
57
50
|
"block_number": "blockNumber",
|
|
58
|
-
"block_timestamp": "blockTimestamp",
|
|
59
51
|
"transaction_hash": "transactionHash",
|
|
60
52
|
"assets_deposited": "assetsDeposited",
|
|
61
53
|
"units_received": "unitsReceived",
|
|
@@ -6,19 +6,20 @@ import * as z from "zod/v3";
|
|
|
6
6
|
import { ClosedEnum } from "../../types/enums.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens).
|
|
9
|
+
* The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
|
|
10
10
|
*/
|
|
11
11
|
export type FeeAmount = number | string;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount)
|
|
14
|
+
* The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit).
|
|
15
15
|
*/
|
|
16
16
|
export const Denomination = {
|
|
17
17
|
Percentage: "PERCENTAGE",
|
|
18
18
|
Fixed: "FIXED",
|
|
19
|
+
Performance: "PERFORMANCE",
|
|
19
20
|
} as const;
|
|
20
21
|
/**
|
|
21
|
-
* The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount)
|
|
22
|
+
* The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit).
|
|
22
23
|
*/
|
|
23
24
|
export type Denomination = ClosedEnum<typeof Denomination>;
|
|
24
25
|
|
|
@@ -28,11 +29,11 @@ export type Fee = {
|
|
|
28
29
|
*/
|
|
29
30
|
recipient: string;
|
|
30
31
|
/**
|
|
31
|
-
* The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens).
|
|
32
|
+
* The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
|
|
32
33
|
*/
|
|
33
34
|
amount: number | string;
|
|
34
35
|
/**
|
|
35
|
-
* The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount)
|
|
36
|
+
* The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit).
|
|
36
37
|
*/
|
|
37
38
|
denomination?: Denomination | undefined;
|
|
38
39
|
};
|
|
@@ -16,10 +16,6 @@ export type WithdrawalEvent = {
|
|
|
16
16
|
* Block number when withdrawal occurred
|
|
17
17
|
*/
|
|
18
18
|
blockNumber: number;
|
|
19
|
-
/**
|
|
20
|
-
* Timestamp of the withdrawal
|
|
21
|
-
*/
|
|
22
|
-
blockTimestamp: Date;
|
|
23
19
|
/**
|
|
24
20
|
* Transaction hash of the withdrawal
|
|
25
21
|
*/
|
|
@@ -53,9 +49,6 @@ export const WithdrawalEvent$inboundSchema: z.ZodType<
|
|
|
53
49
|
unknown
|
|
54
50
|
> = z.object({
|
|
55
51
|
block_number: z.number().int(),
|
|
56
|
-
block_timestamp: z.string().datetime({ offset: true }).transform(v =>
|
|
57
|
-
new Date(v)
|
|
58
|
-
),
|
|
59
52
|
transaction_hash: z.string(),
|
|
60
53
|
assets_received: z.string(),
|
|
61
54
|
units_withdrawn: z.string(),
|
|
@@ -65,7 +58,6 @@ export const WithdrawalEvent$inboundSchema: z.ZodType<
|
|
|
65
58
|
}).transform((v) => {
|
|
66
59
|
return remap$(v, {
|
|
67
60
|
"block_number": "blockNumber",
|
|
68
|
-
"block_timestamp": "blockTimestamp",
|
|
69
61
|
"transaction_hash": "transactionHash",
|
|
70
62
|
"assets_received": "assetsReceived",
|
|
71
63
|
"units_withdrawn": "unitsWithdrawn",
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
6
|
import { ClosedEnum } from "../../types/enums.js";
|
|
8
7
|
|
|
9
8
|
export const V2EarnPositionsChain = {
|
|
@@ -24,13 +23,9 @@ export type V2EarnPositionsRequest = {
|
|
|
24
23
|
limit?: number | undefined;
|
|
25
24
|
chain: V2EarnPositionsChain;
|
|
26
25
|
/**
|
|
27
|
-
* The address of the
|
|
26
|
+
* The address of the owner of the earn account to get positions for.
|
|
28
27
|
*/
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* How many days back from the current time to include in the blockchain scan.
|
|
32
|
-
*/
|
|
33
|
-
days?: number | undefined;
|
|
28
|
+
owner: string;
|
|
34
29
|
};
|
|
35
30
|
|
|
36
31
|
/** @internal */
|
|
@@ -43,8 +38,7 @@ export type V2EarnPositionsRequest$Outbound = {
|
|
|
43
38
|
offset?: number | undefined;
|
|
44
39
|
limit?: number | undefined;
|
|
45
40
|
chain: string;
|
|
46
|
-
|
|
47
|
-
days?: number | undefined;
|
|
41
|
+
owner: string;
|
|
48
42
|
};
|
|
49
43
|
|
|
50
44
|
/** @internal */
|
|
@@ -56,12 +50,7 @@ export const V2EarnPositionsRequest$outboundSchema: z.ZodType<
|
|
|
56
50
|
offset: z.number().int().optional(),
|
|
57
51
|
limit: z.number().int().optional(),
|
|
58
52
|
chain: V2EarnPositionsChain$outboundSchema,
|
|
59
|
-
|
|
60
|
-
days: z.number().int().optional(),
|
|
61
|
-
}).transform((v) => {
|
|
62
|
-
return remap$(v, {
|
|
63
|
-
userAddress: "user_address",
|
|
64
|
-
});
|
|
53
|
+
owner: z.string(),
|
|
65
54
|
});
|
|
66
55
|
|
|
67
56
|
export function v2EarnPositionsRequestToJSON(
|
package/src/sdk/earn.ts
CHANGED
|
@@ -145,7 +145,10 @@ export class Earn extends ClientSDK {
|
|
|
145
145
|
*
|
|
146
146
|
* If `WITHDRAW` is selected for `action`, tokens will be withdrawn from the selected venue address back into the Earn Account associated with the `owner` wallet.
|
|
147
147
|
*
|
|
148
|
-
* A fee can be configured. This fee is deducted from the total `amount`. It can be expressed as
|
|
148
|
+
* A fee can be configured. This fee is deducted from the total `amount`. It can be expressed as:
|
|
149
|
+
* - `FIXED`: a fixed token amount (e.g., 0.1 means 0.1 tokens)
|
|
150
|
+
* - `PERCENTAGE`: a percentage of the transaction amount (e.g., 1.5 means 1.5%)
|
|
151
|
+
* - `PERFORMANCE`: a percentage of realized profit using FIFO cost basis (e.g., 10 means 10% of profit). Only applicable for withdrawals.
|
|
149
152
|
*
|
|
150
153
|
* The transaction can be gas-sponsored by an arbitrary wallet address which will sign, submit and pay the required gas for the transaction. If `gas_sponsorship` is set to `true`, EIP-712 typed data will be returned that must be signed by the `owner` and submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`) where the `sender` of the transaction can be set.
|
|
151
154
|
*/
|