@coinbase/agentkit 0.10.3 → 0.10.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.
Files changed (55) hide show
  1. package/README.md +47 -10
  2. package/dist/action-providers/across/acrossActionProvider.js +2 -4
  3. package/dist/action-providers/across/acrossActionProvider.test.js +10 -5
  4. package/dist/action-providers/baseAccount/baseAccountActionProvider.js +5 -7
  5. package/dist/action-providers/clanker/utils.d.ts +2 -1
  6. package/dist/action-providers/clanker/utils.js +2 -2
  7. package/dist/action-providers/index.d.ts +1 -0
  8. package/dist/action-providers/index.js +1 -0
  9. package/dist/action-providers/jupiter/jupiterActionProvider.js +2 -2
  10. package/dist/action-providers/spl/splActionProvider.js +12 -13
  11. package/dist/action-providers/superfluid/graphQueries/superfluidGraphQueries.js +2 -2
  12. package/dist/action-providers/sushi/constants.d.ts +35 -0
  13. package/dist/action-providers/sushi/constants.js +7 -0
  14. package/dist/action-providers/sushi/index.d.ts +4 -0
  15. package/dist/action-providers/sushi/index.js +20 -0
  16. package/dist/action-providers/sushi/sushiDataActionProvider.d.ts +32 -0
  17. package/dist/action-providers/sushi/sushiDataActionProvider.js +113 -0
  18. package/dist/action-providers/sushi/sushiDataSchemas.d.ts +11 -0
  19. package/dist/action-providers/sushi/sushiDataSchemas.js +16 -0
  20. package/dist/action-providers/sushi/sushiRouterActionProvider.d.ts +40 -0
  21. package/dist/action-providers/sushi/sushiRouterActionProvider.js +386 -0
  22. package/dist/action-providers/sushi/sushiRouterActionProvider.test.d.ts +1 -0
  23. package/dist/action-providers/sushi/sushiRouterActionProvider.test.js +392 -0
  24. package/dist/action-providers/sushi/sushiRouterSchemas.d.ts +36 -0
  25. package/dist/action-providers/sushi/sushiRouterSchemas.js +55 -0
  26. package/dist/action-providers/vaultsfyi/constants.d.ts +8 -12
  27. package/dist/action-providers/vaultsfyi/constants.js +47 -13
  28. package/dist/action-providers/vaultsfyi/schemas.d.ts +120 -65
  29. package/dist/action-providers/vaultsfyi/schemas.js +72 -38
  30. package/dist/action-providers/vaultsfyi/sdk.d.ts +8 -0
  31. package/dist/action-providers/vaultsfyi/sdk.js +15 -0
  32. package/dist/action-providers/vaultsfyi/utils.d.ts +151 -55
  33. package/dist/action-providers/vaultsfyi/utils.js +29 -75
  34. package/dist/action-providers/vaultsfyi/vaultsfyiActionProvider.d.ts +55 -16
  35. package/dist/action-providers/vaultsfyi/vaultsfyiActionProvider.js +413 -217
  36. package/dist/action-providers/vaultsfyi/vaultsfyiActionProvider.test.js +509 -316
  37. package/dist/action-providers/x402/constants.d.ts +67 -0
  38. package/dist/action-providers/x402/constants.js +37 -0
  39. package/dist/action-providers/x402/schemas.d.ts +45 -5
  40. package/dist/action-providers/x402/schemas.js +81 -11
  41. package/dist/action-providers/x402/utils.d.ts +85 -10
  42. package/dist/action-providers/x402/utils.js +302 -35
  43. package/dist/action-providers/x402/x402ActionProvider.d.ts +15 -1
  44. package/dist/action-providers/x402/x402ActionProvider.js +230 -179
  45. package/dist/action-providers/x402/x402ActionProvider.test.js +222 -262
  46. package/dist/action-providers/zora/zoraActionProvider.js +4 -5
  47. package/package.json +10 -7
  48. package/dist/action-providers/vaultsfyi/api/actions.d.ts +0 -41
  49. package/dist/action-providers/vaultsfyi/api/actions.js +0 -28
  50. package/dist/action-providers/vaultsfyi/api/historicalData.d.ts +0 -31
  51. package/dist/action-providers/vaultsfyi/api/historicalData.js +0 -44
  52. package/dist/action-providers/vaultsfyi/api/types.d.ts +0 -34
  53. package/dist/action-providers/vaultsfyi/api/types.js +0 -2
  54. package/dist/action-providers/vaultsfyi/api/vaults.d.ts +0 -66
  55. package/dist/action-providers/vaultsfyi/api/vaults.js +0 -57
@@ -3,46 +3,43 @@ import { z } from "zod";
3
3
  * Vaults list action schema.
4
4
  */
5
5
  export declare const VaultsActionSchema: z.ZodObject<{
6
- token: z.ZodOptional<z.ZodEffects<z.ZodString, string | undefined, string>>;
7
- protocol: z.ZodOptional<z.ZodEffects<z.ZodString, string | undefined, string>>;
8
- network: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodEnum<[string, ...string[]]>, z.ZodEnum<["", "all"]>]>>, string | undefined, string | undefined>;
6
+ allowedAssets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7
+ allowedProtocols: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
+ allowedNetworks: z.ZodOptional<z.ZodArray<z.ZodEnum<["mainnet", "optimism", "arbitrum", "polygon", "gnosis", "base", "unichain", "swellchain", "celo", "worldchain", "berachain", "ink", "bsc", "hyperliquid", "plasma", "avalanche"]>, "many">>;
9
9
  minTvl: z.ZodOptional<z.ZodNumber>;
10
10
  sort: z.ZodOptional<z.ZodObject<{
11
- field: z.ZodOptional<z.ZodEnum<["tvl", "apy", "name"]>>;
11
+ field: z.ZodOptional<z.ZodEnum<["tvl", "apy1day", "apy7day", "apy30day"]>>;
12
12
  direction: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
13
13
  }, "strip", z.ZodTypeAny, {
14
- field?: "name" | "tvl" | "apy" | undefined;
14
+ field?: "tvl" | "apy1day" | "apy7day" | "apy30day" | undefined;
15
15
  direction?: "asc" | "desc" | undefined;
16
16
  }, {
17
- field?: "name" | "tvl" | "apy" | undefined;
17
+ field?: "tvl" | "apy1day" | "apy7day" | "apy30day" | undefined;
18
18
  direction?: "asc" | "desc" | undefined;
19
19
  }>>;
20
- apyRange: z.ZodOptional<z.ZodEnum<["1day", "7day", "30day"]>>;
21
- take: z.ZodOptional<z.ZodNumber>;
20
+ perPage: z.ZodOptional<z.ZodNumber>;
22
21
  page: z.ZodOptional<z.ZodNumber>;
23
22
  }, "strip", z.ZodTypeAny, {
24
23
  sort?: {
25
- field?: "name" | "tvl" | "apy" | undefined;
24
+ field?: "tvl" | "apy1day" | "apy7day" | "apy30day" | undefined;
26
25
  direction?: "asc" | "desc" | undefined;
27
26
  } | undefined;
28
- network?: string | undefined;
29
- token?: string | undefined;
30
- protocol?: string | undefined;
27
+ allowedAssets?: string[] | undefined;
28
+ allowedProtocols?: string[] | undefined;
29
+ allowedNetworks?: ("arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid")[] | undefined;
31
30
  minTvl?: number | undefined;
32
- apyRange?: "1day" | "7day" | "30day" | undefined;
33
- take?: number | undefined;
31
+ perPage?: number | undefined;
34
32
  page?: number | undefined;
35
33
  }, {
36
34
  sort?: {
37
- field?: "name" | "tvl" | "apy" | undefined;
35
+ field?: "tvl" | "apy1day" | "apy7day" | "apy30day" | undefined;
38
36
  direction?: "asc" | "desc" | undefined;
39
37
  } | undefined;
40
- network?: string | undefined;
41
- token?: string | undefined;
42
- protocol?: string | undefined;
38
+ allowedAssets?: string[] | undefined;
39
+ allowedProtocols?: string[] | undefined;
40
+ allowedNetworks?: ("arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid")[] | undefined;
43
41
  minTvl?: number | undefined;
44
- apyRange?: "1day" | "7day" | "30day" | undefined;
45
- take?: number | undefined;
42
+ perPage?: number | undefined;
46
43
  page?: number | undefined;
47
44
  }>;
48
45
  /**
@@ -50,80 +47,138 @@ export declare const VaultsActionSchema: z.ZodObject<{
50
47
  */
51
48
  export declare const VaultDetailsActionSchema: z.ZodObject<{
52
49
  vaultAddress: z.ZodString;
53
- network: z.ZodEnum<[string, ...string[]]>;
54
- apyRange: z.ZodOptional<z.ZodEnum<["1day", "7day", "30day"]>>;
50
+ network: z.ZodEnum<["mainnet", "optimism", "arbitrum", "polygon", "gnosis", "base", "unichain", "swellchain", "celo", "worldchain", "berachain", "ink", "bsc", "hyperliquid", "plasma", "avalanche"]>;
55
51
  }, "strip", z.ZodTypeAny, {
56
- network: string;
52
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
57
53
  vaultAddress: string;
58
- apyRange?: "1day" | "7day" | "30day" | undefined;
59
54
  }, {
60
- network: string;
55
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
61
56
  vaultAddress: string;
62
- apyRange?: "1day" | "7day" | "30day" | undefined;
63
57
  }>;
64
58
  export declare const VaultHistoricalDataActionSchema: z.ZodObject<{
65
59
  vaultAddress: z.ZodString;
66
- network: z.ZodEnum<[string, ...string[]]>;
67
- date: z.ZodString;
68
- apyRange: z.ZodOptional<z.ZodEnum<["1day", "7day", "30day"]>>;
60
+ network: z.ZodEnum<["mainnet", "optimism", "arbitrum", "polygon", "gnosis", "base", "unichain", "swellchain", "celo", "worldchain", "berachain", "ink", "bsc", "hyperliquid", "plasma", "avalanche"]>;
61
+ fromDate: z.ZodString;
62
+ toDate: z.ZodString;
63
+ granularity: z.ZodEnum<["1hour", "1day", "1week"]>;
64
+ apyInterval: z.ZodEnum<["1day", "7day", "30day"]>;
65
+ page: z.ZodOptional<z.ZodNumber>;
66
+ perPage: z.ZodOptional<z.ZodNumber>;
69
67
  }, "strip", z.ZodTypeAny, {
70
- network: string;
71
- date: string;
68
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
72
69
  vaultAddress: string;
73
- apyRange?: "1day" | "7day" | "30day" | undefined;
70
+ granularity: "1hour" | "1day" | "1week";
71
+ fromDate: string;
72
+ toDate: string;
73
+ apyInterval: "1day" | "7day" | "30day";
74
+ perPage?: number | undefined;
75
+ page?: number | undefined;
74
76
  }, {
75
- network: string;
76
- date: string;
77
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
77
78
  vaultAddress: string;
78
- apyRange?: "1day" | "7day" | "30day" | undefined;
79
+ granularity: "1hour" | "1day" | "1week";
80
+ fromDate: string;
81
+ toDate: string;
82
+ apyInterval: "1day" | "7day" | "30day";
83
+ perPage?: number | undefined;
84
+ page?: number | undefined;
79
85
  }>;
80
- export declare const depositActionSchema: z.ZodObject<{
86
+ /**
87
+ * Base transaction params schema.
88
+ */
89
+ export declare const transactionContextActionSchema: z.ZodObject<{
81
90
  vaultAddress: z.ZodString;
82
- assetAddress: z.ZodString;
83
- network: z.ZodEnum<[string, ...string[]]>;
84
- amount: z.ZodNumber;
91
+ network: z.ZodEnum<["mainnet", "optimism", "arbitrum", "polygon", "gnosis", "base", "unichain", "swellchain", "celo", "worldchain", "berachain", "ink", "bsc", "hyperliquid", "plasma", "avalanche"]>;
85
92
  }, "strip", z.ZodTypeAny, {
86
- amount: number;
87
- network: string;
93
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
88
94
  vaultAddress: string;
89
- assetAddress: string;
90
95
  }, {
91
- amount: number;
92
- network: string;
96
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
93
97
  vaultAddress: string;
94
- assetAddress: string;
95
98
  }>;
96
- export declare const redeemActionSchema: z.ZodObject<z.objectUtil.extendShape<{
99
+ export declare const executeStepActionSchema: z.ZodObject<z.objectUtil.extendShape<{
97
100
  vaultAddress: z.ZodString;
98
- assetAddress: z.ZodString;
99
- network: z.ZodEnum<[string, ...string[]]>;
100
- amount: z.ZodNumber;
101
+ network: z.ZodEnum<["mainnet", "optimism", "arbitrum", "polygon", "gnosis", "base", "unichain", "swellchain", "celo", "worldchain", "berachain", "ink", "bsc", "hyperliquid", "plasma", "avalanche"]>;
101
102
  }, {
102
- all: z.ZodOptional<z.ZodBoolean>;
103
+ action: z.ZodEnum<["deposit", "redeem", "request-redeem", "request-deposit", "claim-redeem", "claim-deposit", "claim-rewards", "start-redeem-cooldown"]>;
104
+ assetAddress: z.ZodString;
105
+ amount: z.ZodOptional<z.ZodUnion<[z.ZodBigInt, z.ZodLiteral<"all">]>>;
103
106
  }>, "strip", z.ZodTypeAny, {
104
- amount: number;
105
- network: string;
107
+ action: "deposit" | "redeem" | "request-redeem" | "request-deposit" | "claim-redeem" | "claim-deposit" | "claim-rewards" | "start-redeem-cooldown";
108
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
106
109
  vaultAddress: string;
107
110
  assetAddress: string;
108
- all?: boolean | undefined;
111
+ amount?: bigint | "all" | undefined;
109
112
  }, {
110
- amount: number;
111
- network: string;
113
+ action: "deposit" | "redeem" | "request-redeem" | "request-deposit" | "claim-redeem" | "claim-deposit" | "claim-rewards" | "start-redeem-cooldown";
114
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
112
115
  vaultAddress: string;
113
116
  assetAddress: string;
114
- all?: boolean | undefined;
117
+ amount?: bigint | "all" | undefined;
118
+ }>;
119
+ export declare const claimRewardsActionSchema: z.ZodObject<{
120
+ claimIds: z.ZodArray<z.ZodString, "many">;
121
+ }, "strip", z.ZodTypeAny, {
122
+ claimIds: string[];
123
+ }, {
124
+ claimIds: string[];
115
125
  }>;
116
- export declare const claimActionSchema: z.ZodObject<Omit<{
126
+ export declare const benchmarkActionSchema: z.ZodObject<{
127
+ network: z.ZodEnum<["mainnet", "optimism", "arbitrum", "polygon", "gnosis", "base", "unichain", "swellchain", "celo", "worldchain", "berachain", "ink", "bsc", "hyperliquid", "plasma", "avalanche"]>;
128
+ benchmarkCode: z.ZodEnum<["eth", "usd"]>;
129
+ }, "strip", z.ZodTypeAny, {
130
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
131
+ benchmarkCode: "eth" | "usd";
132
+ }, {
133
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
134
+ benchmarkCode: "eth" | "usd";
135
+ }>;
136
+ export declare const historicalBenchmarkActionSchema: z.ZodObject<z.objectUtil.extendShape<{
137
+ network: z.ZodEnum<["mainnet", "optimism", "arbitrum", "polygon", "gnosis", "base", "unichain", "swellchain", "celo", "worldchain", "berachain", "ink", "bsc", "hyperliquid", "plasma", "avalanche"]>;
138
+ benchmarkCode: z.ZodEnum<["eth", "usd"]>;
139
+ }, {
140
+ fromDate: z.ZodString;
141
+ toDate: z.ZodString;
142
+ page: z.ZodOptional<z.ZodNumber>;
143
+ perPage: z.ZodOptional<z.ZodNumber>;
144
+ }>, "strip", z.ZodTypeAny, {
145
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
146
+ fromDate: string;
147
+ toDate: string;
148
+ benchmarkCode: "eth" | "usd";
149
+ perPage?: number | undefined;
150
+ page?: number | undefined;
151
+ }, {
152
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
153
+ fromDate: string;
154
+ toDate: string;
155
+ benchmarkCode: "eth" | "usd";
156
+ perPage?: number | undefined;
157
+ page?: number | undefined;
158
+ }>;
159
+ export declare const totalVaultReturnsActionSchema: z.ZodObject<{
117
160
  vaultAddress: z.ZodString;
118
- assetAddress: z.ZodString;
119
- network: z.ZodEnum<[string, ...string[]]>;
120
- amount: z.ZodNumber;
121
- }, "amount">, "strip", z.ZodTypeAny, {
122
- network: string;
161
+ userAddress: z.ZodOptional<z.ZodString>;
162
+ network: z.ZodEnum<["mainnet", "optimism", "arbitrum", "polygon", "gnosis", "base", "unichain", "swellchain", "celo", "worldchain", "berachain", "ink", "bsc", "hyperliquid", "plasma", "avalanche"]>;
163
+ }, "strip", z.ZodTypeAny, {
164
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
123
165
  vaultAddress: string;
124
- assetAddress: string;
166
+ userAddress?: string | undefined;
125
167
  }, {
126
- network: string;
168
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
127
169
  vaultAddress: string;
128
- assetAddress: string;
170
+ userAddress?: string | undefined;
171
+ }>;
172
+ export declare const userEventsActionSchema: z.ZodObject<{
173
+ vaultAddress: z.ZodString;
174
+ userAddress: z.ZodOptional<z.ZodString>;
175
+ network: z.ZodEnum<["mainnet", "optimism", "arbitrum", "polygon", "gnosis", "base", "unichain", "swellchain", "celo", "worldchain", "berachain", "ink", "bsc", "hyperliquid", "plasma", "avalanche"]>;
176
+ }, "strip", z.ZodTypeAny, {
177
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
178
+ vaultAddress: string;
179
+ userAddress?: string | undefined;
180
+ }, {
181
+ network: "arbitrum" | "avalanche" | "base" | "berachain" | "bsc" | "celo" | "gnosis" | "ink" | "mainnet" | "optimism" | "plasma" | "polygon" | "swellchain" | "unichain" | "worldchain" | "hyperliquid";
182
+ vaultAddress: string;
183
+ userAddress?: string | undefined;
129
184
  }>;
@@ -1,47 +1,44 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.claimActionSchema = exports.redeemActionSchema = exports.depositActionSchema = exports.VaultHistoricalDataActionSchema = exports.VaultDetailsActionSchema = exports.VaultsActionSchema = void 0;
3
+ exports.userEventsActionSchema = exports.totalVaultReturnsActionSchema = exports.historicalBenchmarkActionSchema = exports.benchmarkActionSchema = exports.claimRewardsActionSchema = exports.executeStepActionSchema = exports.transactionContextActionSchema = exports.VaultHistoricalDataActionSchema = exports.VaultDetailsActionSchema = exports.VaultsActionSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const constants_1 = require("./constants");
5
+ const sdk_1 = require("@vaultsfyi/sdk");
6
6
  /**
7
7
  * Action schemas for the vaultsfyi action provider.
8
8
  *
9
9
  * This file contains the Zod schemas that define the shape and validation
10
10
  * rules for action parameters in the vaultsfyi action provider.
11
11
  */
12
- const NetworkSchema = zod_1.z.enum(Object.values(constants_1.VAULTSFYI_SUPPORTED_CHAINS));
12
+ const NetworkSchema = zod_1.z.enum(sdk_1.SUPPORTED_NETWORKS);
13
13
  /**
14
14
  * Vaults list action schema.
15
15
  */
16
16
  exports.VaultsActionSchema = zod_1.z.object({
17
- token: zod_1.z
18
- .string()
19
- .transform(val => (val === "" ? undefined : val))
17
+ allowedAssets: zod_1.z
18
+ .array(zod_1.z.string())
20
19
  .optional()
21
- .describe("Optional: Name or symbol of the token to filter vaults by"),
22
- protocol: zod_1.z
23
- .string()
24
- .transform(val => (val === "" ? undefined : val))
20
+ .describe("Optional: Symbols of the assets to filter vaults by"),
21
+ allowedProtocols: zod_1.z
22
+ .array(zod_1.z.string())
25
23
  .optional()
26
- .describe("Optional: Protocol to filter vaults by"),
27
- network: NetworkSchema.or(zod_1.z.enum(["", "all"]))
24
+ .describe("Optional: Protocols to filter vaults by. Leave undefined to include all protocols."),
25
+ allowedNetworks: zod_1.z
26
+ .array(NetworkSchema)
28
27
  .optional()
29
- .transform(val => (val === "" || val === "all" ? undefined : val))
30
- .describe("Optional: Network name to filter vaults by. Supported networks: mainnet, arbitrum, optimism, polygon, base, gnosis, unichain"),
31
- minTvl: zod_1.z.number().optional().describe("Optional: Minimum TVL to filter vaults by"),
28
+ .describe("Optional: Networks to filter vaults by. Leave undefined to include all networks."),
29
+ minTvl: zod_1.z.coerce.number().optional().describe("Optional: Minimum TVL to filter vaults by"),
32
30
  sort: zod_1.z
33
31
  .object({
34
- field: zod_1.z.enum(["tvl", "apy", "name"]).optional().describe("Sort field"),
32
+ field: zod_1.z.enum(["tvl", "apy1day", "apy7day", "apy30day"]).optional().describe("Sort field"),
35
33
  direction: zod_1.z.enum(["asc", "desc"]).optional().describe("Sort direction"),
36
34
  })
37
35
  .optional()
38
36
  .describe("Sort options"),
39
- apyRange: zod_1.z
40
- .enum(["1day", "7day", "30day"])
37
+ perPage: zod_1.z.coerce
38
+ .number()
41
39
  .optional()
42
- .describe("Optional: APY moving average range (default: 7day)"),
43
- take: zod_1.z.number().optional().describe("Optional: Limit the number of results"),
44
- page: zod_1.z.number().optional().describe("Optional: Page number"),
40
+ .describe("Optional: Number of results per page (default: 5)"),
41
+ page: zod_1.z.coerce.number().optional().describe("Optional: Page number starting from 0 (default: 0)"),
45
42
  });
46
43
  /**
47
44
  * Vault details action schema.
@@ -49,33 +46,70 @@ exports.VaultsActionSchema = zod_1.z.object({
49
46
  exports.VaultDetailsActionSchema = zod_1.z.object({
50
47
  vaultAddress: zod_1.z.string().describe("The address of the vault to fetch details for"),
51
48
  network: NetworkSchema.describe("The network of the vault"),
52
- apyRange: zod_1.z
53
- .enum(["1day", "7day", "30day"])
54
- .optional()
55
- .describe("Optional: APY moving average range (default: 7day)"),
56
49
  });
57
50
  exports.VaultHistoricalDataActionSchema = zod_1.z.object({
58
51
  vaultAddress: zod_1.z.string().describe("The address of the vault to fetch historical data for"),
59
52
  network: NetworkSchema.describe("The network of the vault"),
60
- date: zod_1.z.string().datetime().describe("The date to fetch historical data for"),
61
- apyRange: zod_1.z
62
- .enum(["1day", "7day", "30day"])
63
- .optional()
64
- .describe("Optional: APY moving average range (default: 7day)"),
53
+ fromDate: zod_1.z.string().datetime().describe("The date to fetch historical data from"),
54
+ toDate: zod_1.z.string().datetime().describe("The date to fetch historical data to"),
55
+ granularity: zod_1.z.enum(["1hour", "1day", "1week"]).describe("The granularity of the data"),
56
+ apyInterval: zod_1.z.enum(["1day", "7day", "30day"]).describe("The interval of the apy data"),
57
+ page: zod_1.z.coerce.number().optional().describe("The page number to fetch"),
58
+ perPage: zod_1.z.coerce.number().optional().describe("The number of results per page"),
65
59
  });
66
60
  /**
67
61
  * Base transaction params schema.
68
62
  */
69
- const TransactionActionSchema = zod_1.z.object({
63
+ exports.transactionContextActionSchema = zod_1.z.object({
70
64
  vaultAddress: zod_1.z.string().describe("The address of the vault to interact with"),
71
- assetAddress: zod_1.z.string().describe("The address of the vault's underlying token"),
72
65
  network: NetworkSchema.describe("The network of the vault"),
73
- amount: zod_1.z.number().describe("The amount of assets to use"),
74
66
  });
75
- exports.depositActionSchema = TransactionActionSchema;
76
- exports.redeemActionSchema = TransactionActionSchema.extend({
77
- all: zod_1.z.boolean().optional().describe("Should redeem all assets"),
67
+ exports.executeStepActionSchema = exports.transactionContextActionSchema.extend({
68
+ action: zod_1.z
69
+ .enum([
70
+ "deposit",
71
+ "redeem",
72
+ "request-redeem",
73
+ "request-deposit",
74
+ "claim-redeem",
75
+ "claim-deposit",
76
+ "claim-rewards",
77
+ "start-redeem-cooldown",
78
+ ])
79
+ .describe("The action to execute"),
80
+ assetAddress: zod_1.z.string().describe("The address of the vault's underlying token"),
81
+ amount: zod_1.z.coerce
82
+ .bigint()
83
+ .or(zod_1.z.literal("all"))
84
+ .optional()
85
+ .describe("The amount of assets to use as a number with decimals"),
86
+ });
87
+ exports.claimRewardsActionSchema = zod_1.z.object({
88
+ claimIds: zod_1.z.array(zod_1.z.string()).describe("The ids of the rewards to claim"),
89
+ });
90
+ exports.benchmarkActionSchema = zod_1.z.object({
91
+ network: NetworkSchema.describe("The network to retrieve benchmark data for"),
92
+ benchmarkCode: zod_1.z.enum(["eth", "usd"]).describe("The benchmark code to retrieve data for"),
78
93
  });
79
- exports.claimActionSchema = TransactionActionSchema.omit({
80
- amount: true,
94
+ exports.historicalBenchmarkActionSchema = exports.benchmarkActionSchema.extend({
95
+ fromDate: zod_1.z.string().datetime().describe("The date to fetch historical data from"),
96
+ toDate: zod_1.z.string().datetime().describe("The date to fetch historical data to"),
97
+ page: zod_1.z.coerce.number().optional().describe("The page number to fetch"),
98
+ perPage: zod_1.z.coerce.number().optional().describe("The number of results per page"),
99
+ });
100
+ exports.totalVaultReturnsActionSchema = zod_1.z.object({
101
+ vaultAddress: zod_1.z.string().describe("The address of the vault to fetch total returns for"),
102
+ userAddress: zod_1.z
103
+ .string()
104
+ .optional()
105
+ .describe("The address of the user to fetch total returns for. (default: user's address)"),
106
+ network: NetworkSchema.describe("The network of the vault"),
107
+ });
108
+ exports.userEventsActionSchema = zod_1.z.object({
109
+ vaultAddress: zod_1.z.string().describe("The address of the vault to fetch user events for"),
110
+ userAddress: zod_1.z
111
+ .string()
112
+ .optional()
113
+ .describe("The address of the user to fetch user events for. (default: user's address)"),
114
+ network: NetworkSchema.describe("The network of the vault"),
81
115
  });
@@ -0,0 +1,8 @@
1
+ import { VaultsSdk } from "@vaultsfyi/sdk";
2
+ /**
3
+ * Get the vaults.fyi SDK
4
+ *
5
+ * @param apiKey - The API key for the vaults.fyi API
6
+ * @returns The vaults.fyi SDK client
7
+ */
8
+ export declare function getVaultsSdk(apiKey: string): VaultsSdk;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getVaultsSdk = getVaultsSdk;
4
+ const sdk_1 = require("@vaultsfyi/sdk");
5
+ /**
6
+ * Get the vaults.fyi SDK
7
+ *
8
+ * @param apiKey - The API key for the vaults.fyi API
9
+ * @returns The vaults.fyi SDK client
10
+ */
11
+ function getVaultsSdk(apiKey) {
12
+ return new sdk_1.VaultsSdk({
13
+ apiKey,
14
+ });
15
+ }