@coinbase/agentkit 0.1.1 → 0.1.2

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 (33) hide show
  1. package/README.md +19 -0
  2. package/dist/action-providers/alchemy/alchemyTokenPricesActionProvider.d.ts +55 -0
  3. package/dist/action-providers/alchemy/alchemyTokenPricesActionProvider.js +173 -0
  4. package/dist/action-providers/alchemy/alchemyTokenPricesActionProvider.test.d.ts +1 -0
  5. package/dist/action-providers/alchemy/alchemyTokenPricesActionProvider.test.js +131 -0
  6. package/dist/action-providers/alchemy/index.d.ts +2 -0
  7. package/dist/action-providers/alchemy/index.js +18 -0
  8. package/dist/action-providers/alchemy/schemas.d.ts +41 -0
  9. package/dist/action-providers/alchemy/schemas.js +34 -0
  10. package/dist/action-providers/basename/basenameActionProvider.d.ts +1 -1
  11. package/dist/action-providers/cdp/cdpApiActionProvider.js +7 -1
  12. package/dist/action-providers/erc20/erc20ActionProvider.d.ts +1 -1
  13. package/dist/action-providers/erc721/erc721ActionProvider.d.ts +1 -1
  14. package/dist/action-providers/index.d.ts +2 -0
  15. package/dist/action-providers/index.js +2 -0
  16. package/dist/action-providers/moonwell/constants.d.ts +78 -0
  17. package/dist/action-providers/moonwell/constants.js +111 -0
  18. package/dist/action-providers/moonwell/index.d.ts +1 -0
  19. package/dist/action-providers/moonwell/index.js +5 -0
  20. package/dist/action-providers/moonwell/moonwellActionProvider.d.ts +39 -0
  21. package/dist/action-providers/moonwell/moonwellActionProvider.js +249 -0
  22. package/dist/action-providers/moonwell/moonwellActionProvider.test.d.ts +1 -0
  23. package/dist/action-providers/moonwell/moonwellActionProvider.test.js +455 -0
  24. package/dist/action-providers/moonwell/schemas.d.ts +30 -0
  25. package/dist/action-providers/moonwell/schemas.js +39 -0
  26. package/dist/action-providers/morpho/morphoActionProvider.d.ts +1 -1
  27. package/dist/action-providers/pyth/pythActionProvider.test.d.ts +1 -0
  28. package/dist/action-providers/pyth/pythActionProvider.test.js +113 -0
  29. package/dist/action-providers/weth/wethActionProvider.d.ts +1 -1
  30. package/dist/action-providers/wow/wowActionProvider.d.ts +1 -1
  31. package/dist/wallet-providers/cdpWalletProvider.js +17 -1
  32. package/dist/wallet-providers/viemWalletProvider.js +1 -1
  33. package/package.json +1 -1
package/README.md CHANGED
@@ -12,6 +12,10 @@ AgentKit is a framework for easily enabling AI agents to take actions onchain. I
12
12
  - [Create an AgentKit instance with a specified wallet provider](#create-an-agentkit-instance-with-a-specified-wallet-provider)
13
13
  - [Create an AgentKit instance with a specified action providers](#create-an-agentkit-instance-with-a-specified-action-providers)
14
14
  - [Use the agent's actions with a framework extension. For example, using LangChain + OpenAI](#use-the-agents-actions-with-a-framework-extension-for-example-using-langchain--openai)
15
+ - [Creating an Action Provider](#creating-an-action-provider)
16
+ - [Adding Actions to your Action Provider](#adding-actions-to-your-action-provider)
17
+ - [Adding Actions to your Action Provider that use a Wallet Provider](#adding-actions-to-your-action-provider-that-use-a-wallet-provider)
18
+ - [Adding an Action Provider to your AgentKit instance](#adding-an-action-provider-to-your-agentkit-instance)
15
19
  - [Wallet Providers](#wallet-providers)
16
20
  - [CdpWalletProvider](#cdpwalletprovider)
17
21
  - [Network Configuration](#network-configuration)
@@ -127,6 +131,21 @@ class MyActionProvider extends ActionProvider<WalletProvider> {
127
131
 
128
132
  Actions are defined as instance methods on the action provider class with the `@CreateAction` decorator. Actions can use a wallet provider or not and always return a Promise that resolves to a string.
129
133
 
134
+ #### Required Typescript Compiler Options
135
+
136
+ Creating actions with the `@CreateAction` decorator requires the following compilerOptions to be included in your project's `tsconfig.json`.
137
+
138
+ ```json
139
+ {
140
+ "compilerOptions": {
141
+ "experimentalDecorators": true,
142
+ "emitDecoratorMetadata": true
143
+ }
144
+ }
145
+ ```
146
+
147
+ #### Steps to create an action
148
+
130
149
  1. Define the action schema. Action schemas are defined using the `zod` library.
131
150
 
132
151
  ```typescript
@@ -0,0 +1,55 @@
1
+ import { z } from "zod";
2
+ import { ActionProvider } from "../actionProvider";
3
+ import { AlchemyTokenPricesBySymbolSchema, AlchemyTokenPricesByAddressSchema } from "./schemas";
4
+ /**
5
+ * Configuration options for the AlchemyTokenPricesActionProvider.
6
+ */
7
+ export interface AlchemyTokenPricesActionProviderConfig {
8
+ /**
9
+ * Alchemy API Key
10
+ */
11
+ apiKey?: string;
12
+ }
13
+ /**
14
+ * AlchemyTokenPricesActionProvider is an action provider for fetching token prices via the Alchemy Prices API.
15
+ * This provider enables querying current and historical token prices using symbols or addresses.
16
+ *
17
+ */
18
+ export declare class AlchemyTokenPricesActionProvider extends ActionProvider {
19
+ private readonly apiKey;
20
+ private readonly baseUrl;
21
+ /**
22
+ * Creates a new instance of AlchemyTokenPricesActionProvider
23
+ *
24
+ * @param config - Configuration options including the API key
25
+ */
26
+ constructor(config?: AlchemyTokenPricesActionProviderConfig);
27
+ /**
28
+ * Fetch current token prices for one or more token symbols.
29
+ *
30
+ * @param args - The arguments containing an array of token symbols.
31
+ * @returns A JSON string with the token prices or an error message.
32
+ */
33
+ tokenPricesBySymbol(args: z.infer<typeof AlchemyTokenPricesBySymbolSchema>): Promise<string>;
34
+ /**
35
+ * Fetch current token prices for one or more tokens identified by network and address pairs.
36
+ *
37
+ * @param args - The arguments containing an array of token network/address pairs.
38
+ * @returns A JSON string with the token prices or an error message.
39
+ */
40
+ tokenPricesByAddress(args: z.infer<typeof AlchemyTokenPricesByAddressSchema>): Promise<string>;
41
+ /**
42
+ * Checks if the Alchemy Prices action provider supports the given network.
43
+ * Since the API works with multiple networks, this always returns true.
44
+ *
45
+ * @returns Always returns true.
46
+ */
47
+ supportsNetwork(): boolean;
48
+ }
49
+ /**
50
+ * Factory function to create a new AlchemyTokenPricesActionProvider instance.
51
+ *
52
+ * @param config - The configuration options for the provider.
53
+ * @returns A new instance of AlchemyTokenPricesActionProvider.
54
+ */
55
+ export declare const alchemyTokenPricesActionProvider: (config?: AlchemyTokenPricesActionProviderConfig) => AlchemyTokenPricesActionProvider;
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.alchemyTokenPricesActionProvider = exports.AlchemyTokenPricesActionProvider = void 0;
13
+ const zod_1 = require("zod");
14
+ const actionProvider_1 = require("../actionProvider");
15
+ const actionDecorator_1 = require("../actionDecorator");
16
+ const schemas_1 = require("./schemas");
17
+ /**
18
+ * AlchemyTokenPricesActionProvider is an action provider for fetching token prices via the Alchemy Prices API.
19
+ * This provider enables querying current and historical token prices using symbols or addresses.
20
+ *
21
+ */
22
+ class AlchemyTokenPricesActionProvider extends actionProvider_1.ActionProvider {
23
+ /**
24
+ * Creates a new instance of AlchemyTokenPricesActionProvider
25
+ *
26
+ * @param config - Configuration options including the API key
27
+ */
28
+ constructor(config = {}) {
29
+ super("alchemyTokenPrices", []);
30
+ config.apiKey || (config.apiKey = process.env.ALCHEMY_API_KEY);
31
+ if (!config.apiKey) {
32
+ throw new Error("ALCHEMY_API_KEY is not configured.");
33
+ }
34
+ this.apiKey = config.apiKey;
35
+ this.baseUrl = "https://api.g.alchemy.com/prices/v1";
36
+ }
37
+ /**
38
+ * Fetch current token prices for one or more token symbols.
39
+ *
40
+ * @param args - The arguments containing an array of token symbols.
41
+ * @returns A JSON string with the token prices or an error message.
42
+ */
43
+ async tokenPricesBySymbol(args) {
44
+ try {
45
+ // Build query parameters: for each symbol add a separate query parameter
46
+ const params = new URLSearchParams();
47
+ for (const symbol of args.symbols) {
48
+ params.append("symbols", symbol);
49
+ }
50
+ const url = `${this.baseUrl}/${this.apiKey}/tokens/by-symbol?${params.toString()}`;
51
+ const response = await fetch(url, {
52
+ method: "GET",
53
+ headers: {
54
+ Accept: "application/json",
55
+ },
56
+ });
57
+ if (!response.ok) {
58
+ throw new Error(`HTTP error! status: ${response.status}`);
59
+ }
60
+ const data = await response.json();
61
+ return `Successfully fetched token prices by symbol:\n${JSON.stringify(data, null, 2)}`;
62
+ }
63
+ catch (error) {
64
+ return `Error fetching token prices by symbol: ${error}`;
65
+ }
66
+ }
67
+ /**
68
+ * Fetch current token prices for one or more tokens identified by network and address pairs.
69
+ *
70
+ * @param args - The arguments containing an array of token network/address pairs.
71
+ * @returns A JSON string with the token prices or an error message.
72
+ */
73
+ async tokenPricesByAddress(args) {
74
+ try {
75
+ const url = `${this.baseUrl}/${this.apiKey}/tokens/by-address`;
76
+ const response = await fetch(url, {
77
+ method: "POST",
78
+ headers: {
79
+ Accept: "application/json",
80
+ "Content-Type": "application/json",
81
+ },
82
+ body: JSON.stringify(args),
83
+ });
84
+ if (!response.ok) {
85
+ throw new Error(`HTTP error! status: ${response.status}`);
86
+ }
87
+ const data = await response.json();
88
+ return `Successfully fetched token prices by address:\n${JSON.stringify(data, null, 2)}`;
89
+ }
90
+ catch (error) {
91
+ return `Error fetching token prices by address: ${error}`;
92
+ }
93
+ }
94
+ /**
95
+ * Checks if the Alchemy Prices action provider supports the given network.
96
+ * Since the API works with multiple networks, this always returns true.
97
+ *
98
+ * @returns Always returns true.
99
+ */
100
+ supportsNetwork() {
101
+ return true;
102
+ }
103
+ }
104
+ exports.AlchemyTokenPricesActionProvider = AlchemyTokenPricesActionProvider;
105
+ __decorate([
106
+ (0, actionDecorator_1.CreateAction)({
107
+ name: "token_prices_by_symbol",
108
+ description: `
109
+ This tool will fetch current prices for one or more tokens using their symbols via the Alchemy Prices API.
110
+
111
+ A successful response will return a JSON payload similar to:
112
+ {
113
+ "data": [
114
+ {
115
+ "symbol": "ETH",
116
+ "prices": [
117
+ {
118
+ "currency": "usd",
119
+ "value": "2873.490923459",
120
+ "lastUpdatedAt": "2025-02-03T23:46:40Z"
121
+ }
122
+ ]
123
+ }
124
+ ]
125
+ }
126
+
127
+ A failure response will return an error message with details.
128
+ `,
129
+ schema: schemas_1.AlchemyTokenPricesBySymbolSchema,
130
+ }),
131
+ __metadata("design:type", Function),
132
+ __metadata("design:paramtypes", [void 0]),
133
+ __metadata("design:returntype", Promise)
134
+ ], AlchemyTokenPricesActionProvider.prototype, "tokenPricesBySymbol", null);
135
+ __decorate([
136
+ (0, actionDecorator_1.CreateAction)({
137
+ name: "token_prices_by_address",
138
+ description: `
139
+ This tool will fetch current prices for tokens using network and address pairs via the Alchemy Prices API.
140
+
141
+ A successful response will return a JSON payload similar to:
142
+ {
143
+ "data": [
144
+ {
145
+ "network": "eth-mainnet",
146
+ "address": "0xYourTokenAddress",
147
+ "prices": [
148
+ {
149
+ "currency": "usd",
150
+ "value": "1234.56",
151
+ "lastUpdatedAt": "2025-02-03T23:46:40Z"
152
+ }
153
+ ]
154
+ }
155
+ ]
156
+ }
157
+
158
+ A failure response will return an error message with details.
159
+ `,
160
+ schema: schemas_1.AlchemyTokenPricesByAddressSchema,
161
+ }),
162
+ __metadata("design:type", Function),
163
+ __metadata("design:paramtypes", [void 0]),
164
+ __metadata("design:returntype", Promise)
165
+ ], AlchemyTokenPricesActionProvider.prototype, "tokenPricesByAddress", null);
166
+ /**
167
+ * Factory function to create a new AlchemyTokenPricesActionProvider instance.
168
+ *
169
+ * @param config - The configuration options for the provider.
170
+ * @returns A new instance of AlchemyTokenPricesActionProvider.
171
+ */
172
+ const alchemyTokenPricesActionProvider = (config) => new AlchemyTokenPricesActionProvider(config);
173
+ exports.alchemyTokenPricesActionProvider = alchemyTokenPricesActionProvider;
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const alchemyTokenPricesActionProvider_1 = require("./alchemyTokenPricesActionProvider");
4
+ const MOCK_API_KEY = "alch-demo";
5
+ // Sample responses for each action
6
+ const MOCK_TOKEN_PRICES_BY_SYMBOL_RESPONSE = {
7
+ data: [
8
+ {
9
+ symbol: "ETH",
10
+ prices: [
11
+ {
12
+ currency: "usd",
13
+ value: "2873.490923459",
14
+ lastUpdatedAt: "2025-02-03T23:46:40Z",
15
+ },
16
+ ],
17
+ },
18
+ ],
19
+ };
20
+ const MOCK_TOKEN_PRICES_BY_ADDRESS_RESPONSE = {
21
+ data: [
22
+ {
23
+ network: "eth-mainnet",
24
+ address: "0x1234567890abcdef",
25
+ prices: [
26
+ {
27
+ currency: "usd",
28
+ value: "1234.56",
29
+ lastUpdatedAt: "2025-02-03T23:46:40Z",
30
+ },
31
+ ],
32
+ },
33
+ ],
34
+ };
35
+ describe("AlchemyTokenPricesActionProvider", () => {
36
+ let provider;
37
+ beforeEach(() => {
38
+ process.env.ALCHEMY_API_KEY = MOCK_API_KEY;
39
+ provider = (0, alchemyTokenPricesActionProvider_1.alchemyTokenPricesActionProvider)({ apiKey: MOCK_API_KEY });
40
+ jest.restoreAllMocks();
41
+ });
42
+ afterEach(() => {
43
+ jest.clearAllMocks();
44
+ });
45
+ describe("tokenPricesBySymbol", () => {
46
+ it("should successfully fetch token prices by symbol", async () => {
47
+ const fetchMock = jest.spyOn(global, "fetch").mockResolvedValue({
48
+ ok: true,
49
+ json: async () => MOCK_TOKEN_PRICES_BY_SYMBOL_RESPONSE,
50
+ });
51
+ const response = await provider.tokenPricesBySymbol({ symbols: ["ETH", "BTC"] });
52
+ // Verify the URL has the correct API key and query parameters.
53
+ const expectedUrlPart = `${provider["baseUrl"]}/${MOCK_API_KEY}/tokens/by-symbol`;
54
+ expect(fetchMock).toHaveBeenCalled();
55
+ const calledUrl = fetchMock.mock.calls[0][0];
56
+ expect(calledUrl).toContain(expectedUrlPart);
57
+ expect(calledUrl).toContain("symbols=ETH");
58
+ expect(calledUrl).toContain("symbols=BTC");
59
+ expect(response).toContain("Successfully fetched token prices by symbol");
60
+ expect(response).toContain(JSON.stringify(MOCK_TOKEN_PRICES_BY_SYMBOL_RESPONSE, null, 2));
61
+ });
62
+ it("should handle non-ok response for token prices by symbol", async () => {
63
+ jest.spyOn(global, "fetch").mockResolvedValue({
64
+ ok: false,
65
+ status: 400,
66
+ });
67
+ const response = await provider.tokenPricesBySymbol({ symbols: ["ETH"] });
68
+ expect(response).toContain("Error fetching token prices by symbol");
69
+ expect(response).toContain("400");
70
+ });
71
+ it("should handle fetch error for token prices by symbol", async () => {
72
+ const error = new Error("Fetch error");
73
+ jest.spyOn(global, "fetch").mockRejectedValue(error);
74
+ const response = await provider.tokenPricesBySymbol({ symbols: ["ETH"] });
75
+ expect(response).toContain("Error fetching token prices by symbol");
76
+ expect(response).toContain(error.message);
77
+ });
78
+ });
79
+ describe("tokenPricesByAddress", () => {
80
+ it("should successfully fetch token prices by address", async () => {
81
+ const fetchMock = jest.spyOn(global, "fetch").mockResolvedValue({
82
+ ok: true,
83
+ json: async () => MOCK_TOKEN_PRICES_BY_ADDRESS_RESPONSE,
84
+ });
85
+ const payload = {
86
+ addresses: [{ network: "eth-mainnet", address: "0x1234567890abcdef" }],
87
+ };
88
+ const response = await provider.tokenPricesByAddress(payload);
89
+ expect(fetchMock).toHaveBeenCalled();
90
+ // Verify that fetch was called with the correct POST URL and options.
91
+ const expectedUrl = `${provider["baseUrl"]}/${MOCK_API_KEY}/tokens/by-address`;
92
+ expect(fetchMock).toHaveBeenCalledWith(expectedUrl, expect.objectContaining({
93
+ method: "POST",
94
+ headers: expect.objectContaining({
95
+ Accept: "application/json",
96
+ "Content-Type": "application/json",
97
+ }),
98
+ body: JSON.stringify(payload),
99
+ }));
100
+ expect(response).toContain("Successfully fetched token prices by address");
101
+ expect(response).toContain(JSON.stringify(MOCK_TOKEN_PRICES_BY_ADDRESS_RESPONSE, null, 2));
102
+ });
103
+ it("should handle non-ok response for token prices by address", async () => {
104
+ jest.spyOn(global, "fetch").mockResolvedValue({
105
+ ok: false,
106
+ status: 429,
107
+ });
108
+ const payload = {
109
+ addresses: [{ network: "eth-mainnet", address: "0x1234567890abcdef" }],
110
+ };
111
+ const response = await provider.tokenPricesByAddress(payload);
112
+ expect(response).toContain("Error fetching token prices by address");
113
+ expect(response).toContain("429");
114
+ });
115
+ it("should handle fetch error for token prices by address", async () => {
116
+ const error = new Error("Fetch error");
117
+ jest.spyOn(global, "fetch").mockRejectedValue(error);
118
+ const payload = {
119
+ addresses: [{ network: "eth-mainnet", address: "0x1234567890abcdef" }],
120
+ };
121
+ const response = await provider.tokenPricesByAddress(payload);
122
+ expect(response).toContain("Error fetching token prices by address");
123
+ expect(response).toContain(error.message);
124
+ });
125
+ });
126
+ describe("supportsNetwork", () => {
127
+ it("should always return true", () => {
128
+ expect(provider.supportsNetwork()).toBe(true);
129
+ });
130
+ });
131
+ });
@@ -0,0 +1,2 @@
1
+ export * from "./alchemyTokenPricesActionProvider";
2
+ export * from "./schemas";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./alchemyTokenPricesActionProvider"), exports);
18
+ __exportStar(require("./schemas"), exports);
@@ -0,0 +1,41 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Input schema for fetching token prices by symbol.
4
+ *
5
+ * The API expects a list of token symbols.
6
+ */
7
+ export declare const AlchemyTokenPricesBySymbolSchema: z.ZodObject<{
8
+ symbols: z.ZodArray<z.ZodString, "many">;
9
+ }, "strip", z.ZodTypeAny, {
10
+ symbols: string[];
11
+ }, {
12
+ symbols: string[];
13
+ }>;
14
+ /**
15
+ * Input schema for fetching token prices by address.
16
+ *
17
+ * The API expects an object with an array of addresses, where each address contains
18
+ * a network identifier and a token contract address.
19
+ */
20
+ export declare const AlchemyTokenPricesByAddressSchema: z.ZodObject<{
21
+ addresses: z.ZodArray<z.ZodObject<{
22
+ network: z.ZodString;
23
+ address: z.ZodString;
24
+ }, "strip", z.ZodTypeAny, {
25
+ address: string;
26
+ network: string;
27
+ }, {
28
+ address: string;
29
+ network: string;
30
+ }>, "many">;
31
+ }, "strip", z.ZodTypeAny, {
32
+ addresses: {
33
+ address: string;
34
+ network: string;
35
+ }[];
36
+ }, {
37
+ addresses: {
38
+ address: string;
39
+ network: string;
40
+ }[];
41
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlchemyTokenPricesByAddressSchema = exports.AlchemyTokenPricesBySymbolSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Input schema for fetching token prices by symbol.
7
+ *
8
+ * The API expects a list of token symbols.
9
+ */
10
+ exports.AlchemyTokenPricesBySymbolSchema = zod_1.z
11
+ .object({
12
+ symbols: zod_1.z
13
+ .array(zod_1.z.string())
14
+ .min(1, "At least one token symbol is required. Example: ETH, BTC, SOL, etc.")
15
+ .max(25, "A maximum of 25 token symbols can be provided."),
16
+ })
17
+ .describe("Input schema for fetching token prices by symbol from Alchemy");
18
+ /**
19
+ * Input schema for fetching token prices by address.
20
+ *
21
+ * The API expects an object with an array of addresses, where each address contains
22
+ * a network identifier and a token contract address.
23
+ */
24
+ exports.AlchemyTokenPricesByAddressSchema = zod_1.z
25
+ .object({
26
+ addresses: zod_1.z
27
+ .array(zod_1.z.object({
28
+ network: zod_1.z.string().describe("Network identifier (e.g., eth-mainnet, base-mainnet etc.)"),
29
+ address: zod_1.z.string().describe("Token contract address"),
30
+ }))
31
+ .min(1, "At least one address is required.")
32
+ .max(25, "A maximum of 25 addresses can be provided."),
33
+ })
34
+ .describe("Input schema for fetching token prices by address from Alchemy");
@@ -6,7 +6,7 @@ import { EvmWalletProvider } from "../../wallet-providers";
6
6
  /**
7
7
  * Action provider for registering Basenames.
8
8
  */
9
- export declare class BasenameActionProvider extends ActionProvider {
9
+ export declare class BasenameActionProvider extends ActionProvider<EvmWalletProvider> {
10
10
  /**
11
11
  * Constructs a new BasenameActionProvider.
12
12
  */
@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.cdpApiActionProvider = exports.CdpApiActionProvider = void 0;
13
+ const package_json_1 = require("../../../package.json");
13
14
  const coinbase_sdk_1 = require("@coinbase/coinbase-sdk");
14
15
  const zod_1 = require("zod");
15
16
  const actionDecorator_1 = require("../actionDecorator");
@@ -37,7 +38,12 @@ class CdpApiActionProvider extends actionProvider_1.ActionProvider {
37
38
  */
38
39
  this.supportsNetwork = (_) => true;
39
40
  if (config.apiKeyName && config.apiKeyPrivateKey) {
40
- coinbase_sdk_1.Coinbase.configure({ apiKeyName: config.apiKeyName, privateKey: config.apiKeyPrivateKey });
41
+ coinbase_sdk_1.Coinbase.configure({
42
+ apiKeyName: config.apiKeyName,
43
+ privateKey: config.apiKeyPrivateKey,
44
+ source: "agentkit",
45
+ sourceVersion: package_json_1.version,
46
+ });
41
47
  }
42
48
  else {
43
49
  coinbase_sdk_1.Coinbase.configureFromJson();
@@ -6,7 +6,7 @@ import { EvmWalletProvider } from "../../wallet-providers";
6
6
  /**
7
7
  * ERC20ActionProvider is an action provider for ERC20 tokens.
8
8
  */
9
- export declare class ERC20ActionProvider extends ActionProvider {
9
+ export declare class ERC20ActionProvider extends ActionProvider<EvmWalletProvider> {
10
10
  /**
11
11
  * Constructor for the ERC20ActionProvider.
12
12
  */
@@ -6,7 +6,7 @@ import { Network } from "../../network";
6
6
  /**
7
7
  * Erc721ActionProvider is an action provider for Erc721 contract interactions.
8
8
  */
9
- export declare class Erc721ActionProvider extends ActionProvider {
9
+ export declare class Erc721ActionProvider extends ActionProvider<EvmWalletProvider> {
10
10
  /**
11
11
  * Constructor for the Erc721ActionProvider class.
12
12
  */
@@ -11,3 +11,5 @@ export * from "./farcaster";
11
11
  export * from "./twitter";
12
12
  export * from "./wallet";
13
13
  export * from "./customActionProvider";
14
+ export * from "./alchemy";
15
+ export * from "./moonwell";
@@ -27,3 +27,5 @@ __exportStar(require("./farcaster"), exports);
27
27
  __exportStar(require("./twitter"), exports);
28
28
  __exportStar(require("./wallet"), exports);
29
29
  __exportStar(require("./customActionProvider"), exports);
30
+ __exportStar(require("./alchemy"), exports);
31
+ __exportStar(require("./moonwell"), exports);
@@ -0,0 +1,78 @@
1
+ export declare const MOONWELL_BASE_ADDRESSES: {
2
+ "0xEdc817A28E8B93B03976FBd4a3dDBc9f7D176c22": string;
3
+ "0x73b06D8d18De422E269645eaCe15400DE7462417": string;
4
+ "0x628ff693426583D9a7FB391E54366292F509D457": string;
5
+ "0x3bf93770f2d4a794c3d9EBEfBAeBAE2a8f09A5E5": string;
6
+ "0x627Fe393Bc6EdDA28e99AE648fD6fF362514304b": string;
7
+ "0x73902f619CEB9B31FD8EFecf435CbDf89E369Ba6": string;
8
+ "0xb8051464C8c92209C92F3a4CD9C73746C4c3CFb3": string;
9
+ "0xF877ACaFA28c19b96727966690b2f44d35aD5976": string;
10
+ "0xb682c840B5F4FC58B20769E691A6fa1305A501a2": string;
11
+ "0xfC41B49d064Ac646015b459C522820DB9472F4B5": string;
12
+ "0xdC7810B47eAAb250De623F0eE07764afa5F71ED1": string;
13
+ "0xb6419c6C2e60c4025D6D06eE4F913ce89425a357": string;
14
+ "0x9A858ebfF1bEb0D3495BB0e2897c1528eD84A218": string;
15
+ "0x70778cfcFC475c7eA0f24cC625Baf6EaE475D0c9": string;
16
+ };
17
+ export declare const MOONWELL_BASE_SEPOLIA_ADDRESSES: {
18
+ "0x876852425331a113d8E432eFFB3aC5BEf38f033a": string;
19
+ "0x5302EbD8BC32435C823c2e22B04Cd6c45f593e89": string;
20
+ "0x2F39a349A79492a70E152760ce7123A1933eCf28": string;
21
+ };
22
+ export declare const WETH_ROUTER_ADDRESS = "0x70778cfcFC475c7eA0f24cC625Baf6EaE475D0c9";
23
+ export declare const TOKEN_DECIMALS: {
24
+ "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913": number;
25
+ "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42": number;
26
+ "0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A": number;
27
+ "0xEDfa23602D0EC14714057867A78d01e94176BEA0": number;
28
+ "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b": number;
29
+ "0xA88594D404727625A9437C3f886C7643872296AE": number;
30
+ "0x820C137fa70C8691f0e44Dc420a5e53c168921Dc": number;
31
+ "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb": number;
32
+ "0x4200000000000000000000000000000000000006": number;
33
+ "0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22": number;
34
+ "0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452": number;
35
+ "0x940181a94a35a4569e4529a3cdfb74e38fd98631": number;
36
+ "0x0000000000000000000000000000000000000000": number;
37
+ };
38
+ export declare const MTOKENS_UNDERLYING_DECIMALS: {
39
+ MOONWELL_USDC: number;
40
+ MOONWELL_DAI: number;
41
+ MOONWELL_WETH: number;
42
+ MOONWELL_cbETH: number;
43
+ MOONWELL_wstETH: number;
44
+ MOONWELL_AERO: number;
45
+ MOONWELL_weETH: number;
46
+ MOONWELL_cbBTC: number;
47
+ MOONWELL_EURC: number;
48
+ MOONWELL_wrsETH: number;
49
+ MOONWELL_WELL: number;
50
+ MOONWELL_USDS: number;
51
+ MOONWELL_TBTC: number;
52
+ };
53
+ export declare const ETH_ROUTER_ABI: {
54
+ name: string;
55
+ inputs: {
56
+ internalType: string;
57
+ name: string;
58
+ type: string;
59
+ }[];
60
+ outputs: never[];
61
+ stateMutability: string;
62
+ type: string;
63
+ }[];
64
+ export declare const MTOKEN_ABI: {
65
+ type: string;
66
+ name: string;
67
+ inputs: {
68
+ name: string;
69
+ type: string;
70
+ internalType: string;
71
+ }[];
72
+ outputs: {
73
+ name: string;
74
+ type: string;
75
+ internalType: string;
76
+ }[];
77
+ stateMutability: string;
78
+ }[];