@coinbase/agentkit 0.0.0-nightly-20250717210412 → 0.0.0-nightly-20250725210423

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 (62) hide show
  1. package/README.md +31 -1
  2. package/dist/action-providers/cdp/index.d.ts +0 -3
  3. package/dist/action-providers/cdp/index.js +0 -3
  4. package/dist/action-providers/farcaster/farcasterActionProvider.js +2 -0
  5. package/dist/action-providers/farcaster/farcasterActionProvider.test.js +55 -0
  6. package/dist/action-providers/farcaster/schemas.d.ts +13 -0
  7. package/dist/action-providers/farcaster/schemas.js +6 -0
  8. package/dist/action-providers/index.d.ts +2 -0
  9. package/dist/action-providers/index.js +2 -0
  10. package/dist/action-providers/truemarkets/constants.d.ts +179 -0
  11. package/dist/action-providers/truemarkets/constants.js +46 -0
  12. package/dist/action-providers/truemarkets/index.d.ts +1 -0
  13. package/dist/action-providers/truemarkets/index.js +17 -0
  14. package/dist/action-providers/truemarkets/schemas.d.ts +21 -0
  15. package/dist/action-providers/truemarkets/schemas.js +29 -0
  16. package/dist/action-providers/truemarkets/truemarketsActionProvider.d.ts +51 -0
  17. package/dist/action-providers/truemarkets/truemarketsActionProvider.js +469 -0
  18. package/dist/action-providers/truemarkets/truemarketsActionProvider.test.d.ts +1 -0
  19. package/dist/action-providers/truemarkets/truemarketsActionProvider.test.js +217 -0
  20. package/dist/action-providers/truemarkets/utils.d.ts +10 -0
  21. package/dist/action-providers/truemarkets/utils.js +9 -0
  22. package/dist/action-providers/twitter/schemas.d.ts +16 -0
  23. package/dist/action-providers/twitter/schemas.js +23 -1
  24. package/dist/action-providers/twitter/twitterActionProvider.d.ts +8 -1
  25. package/dist/action-providers/twitter/twitterActionProvider.js +56 -5
  26. package/dist/action-providers/twitter/twitterActionProvider.test.js +52 -2
  27. package/dist/action-providers/weth/constants.d.ts +9 -0
  28. package/dist/action-providers/weth/constants.js +12 -0
  29. package/dist/action-providers/weth/schemas.d.ts +7 -0
  30. package/dist/action-providers/weth/schemas.js +7 -1
  31. package/dist/action-providers/weth/wethActionProvider.d.ts +9 -1
  32. package/dist/action-providers/weth/wethActionProvider.js +50 -1
  33. package/dist/action-providers/weth/wethActionProvider.test.js +60 -0
  34. package/dist/action-providers/x402/schemas.d.ts +9 -45
  35. package/dist/action-providers/x402/schemas.js +53 -17
  36. package/dist/action-providers/x402/x402ActionProvider.js +24 -19
  37. package/dist/action-providers/x402/x402ActionProvider.test.js +4 -35
  38. package/dist/action-providers/zora/index.d.ts +3 -0
  39. package/dist/action-providers/zora/index.js +19 -0
  40. package/dist/action-providers/zora/schemas.d.ts +29 -0
  41. package/dist/action-providers/zora/schemas.js +31 -0
  42. package/dist/action-providers/zora/utils.d.ts +28 -0
  43. package/dist/action-providers/zora/utils.js +200 -0
  44. package/dist/action-providers/zora/zoraActionProvider.d.ts +36 -0
  45. package/dist/action-providers/zora/zoraActionProvider.js +151 -0
  46. package/dist/action-providers/zora/zoraActionProvider.test.d.ts +1 -0
  47. package/dist/action-providers/zora/zoraActionProvider.test.js +205 -0
  48. package/dist/wallet-providers/cdpEvmWalletProvider.d.ts +4 -4
  49. package/dist/wallet-providers/cdpEvmWalletProvider.js +4 -4
  50. package/dist/wallet-providers/cdpShared.d.ts +2 -2
  51. package/dist/wallet-providers/cdpSmartWalletProvider.d.ts +2 -2
  52. package/dist/wallet-providers/cdpSmartWalletProvider.js +11 -4
  53. package/dist/wallet-providers/cdpSmartWalletProvider.test.js +31 -11
  54. package/dist/wallet-providers/legacyCdpWalletProvider.d.ts +1 -1
  55. package/dist/wallet-providers/legacyCdpWalletProvider.js +1 -1
  56. package/package.json +3 -2
  57. package/dist/action-providers/cdp/cdpEvmWalletActionProvider.d.ts +0 -17
  58. package/dist/action-providers/cdp/cdpEvmWalletActionProvider.js +0 -20
  59. package/dist/action-providers/cdp/cdpSmartWalletActionProvider.d.ts +0 -17
  60. package/dist/action-providers/cdp/cdpSmartWalletActionProvider.js +0 -20
  61. package/dist/action-providers/cdp/cdpSolanaWalletActionProvider.d.ts +0 -17
  62. package/dist/action-providers/cdp/cdpSolanaWalletActionProvider.js +0 -20
@@ -117,11 +117,11 @@ class CdpSmartWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
117
117
  /**
118
118
  * Signs a message using the owner account.
119
119
  *
120
- * @param message - The message to sign.
120
+ * @param _message - The message to sign.
121
121
  * @returns The signed message.
122
122
  */
123
- async signMessage(message) {
124
- return __classPrivateFieldGet(this, _CdpSmartWalletProvider_ownerAccount, "f").signMessage({ message });
123
+ async signMessage(_message) {
124
+ throw new Error("Direct message signing not supported for smart wallets. Use sendTransaction instead.");
125
125
  }
126
126
  /**
127
127
  * Signs a typed data object using the owner account.
@@ -131,7 +131,14 @@ class CdpSmartWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
131
131
  */
132
132
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
133
133
  async signTypedData(typedData) {
134
- return __classPrivateFieldGet(this, _CdpSmartWalletProvider_ownerAccount, "f").signTypedData(typedData);
134
+ const { domain, types, primaryType, message } = typedData;
135
+ return await __classPrivateFieldGet(this, _CdpSmartWalletProvider_smartAccount, "f").signTypedData({
136
+ domain,
137
+ types,
138
+ primaryType,
139
+ message,
140
+ network: __classPrivateFieldGet(this, _CdpSmartWalletProvider_instances, "m", _CdpSmartWalletProvider_getCdpSdkNetwork).call(this),
141
+ });
135
142
  }
136
143
  /**
137
144
  * Signs a transaction using the owner account.
@@ -188,20 +188,40 @@ describe("CdpSmartWalletProvider", () => {
188
188
  // signing operation tests
189
189
  // =========================================================
190
190
  describe("signing operations", () => {
191
- it("should sign messages using owner account", async () => {
192
- const signature = await provider.signMessage("Hello, world!");
193
- expect(mockOwnerAccount.signMessage).toHaveBeenCalledWith({ message: "Hello, world!" });
194
- expect(signature).toBe(MOCK_SIGNATURE);
191
+ it("should throw error for direct message signing", async () => {
192
+ await expect(provider.signMessage("Hello, world!")).rejects.toThrow("Direct message signing not supported for smart wallets. Use sendTransaction instead.");
195
193
  });
196
- it("should sign typed data using owner account", async () => {
194
+ it("should sign typed data using smart account", async () => {
197
195
  const typedData = {
198
- domain: { name: "Example" },
199
- types: { Test: [{ name: "test", type: "string" }] },
200
- message: { test: "example" },
201
- primaryType: "Test",
196
+ domain: {
197
+ name: "Example",
198
+ version: "1",
199
+ chainId: 1,
200
+ verifyingContract: "0x1234567890123456789012345678901234567890",
201
+ },
202
+ types: {
203
+ Person: [
204
+ { name: "name", type: "string" },
205
+ { name: "wallet", type: "address" },
206
+ ],
207
+ },
208
+ primaryType: "Person",
209
+ message: {
210
+ name: "Bob",
211
+ wallet: "0x1234567890123456789012345678901234567890",
212
+ },
202
213
  };
214
+ // Mock the smart account's signTypedData method
215
+ mockSmartAccount.signTypedData = jest.fn().mockResolvedValue(MOCK_SIGNATURE);
203
216
  const signature = await provider.signTypedData(typedData);
204
- expect(mockOwnerAccount.signTypedData).toHaveBeenCalledWith(typedData);
217
+ // Verify the smart account was called with the correct parameters
218
+ expect(mockSmartAccount.signTypedData).toHaveBeenCalledWith({
219
+ domain: typedData.domain,
220
+ types: typedData.types,
221
+ primaryType: typedData.primaryType,
222
+ message: typedData.message,
223
+ network: MOCK_NETWORK.networkId,
224
+ });
205
225
  expect(signature).toBe(MOCK_SIGNATURE);
206
226
  });
207
227
  it("should throw error for direct transaction signing", async () => {
@@ -209,7 +229,7 @@ describe("CdpSmartWalletProvider", () => {
209
229
  to: "0x1234567890123456789012345678901234567890",
210
230
  value: BigInt(1000000000000000000),
211
231
  };
212
- await expect(provider.signTransaction(tx)).rejects.toThrow("Direct transaction signing not supported for smart wallets");
232
+ await expect(provider.signTransaction(tx)).rejects.toThrow("Direct transaction signing not supported for smart wallets. Use sendTransaction instead.");
213
233
  });
214
234
  });
215
235
  // =========================================================
@@ -67,7 +67,7 @@ interface ConfigureLegacyCdpAgentkitWithWalletOptions extends LegacyCdpWalletPro
67
67
  /**
68
68
  * A legacy wallet provider that uses the old Coinbase SDK.
69
69
  *
70
- * @deprecated Use CdpServerWalletProvider or CdpSmartWalletProvider instead
70
+ * @deprecated Use CdpEvmWalletProvider or CdpSmartWalletProvider instead
71
71
  */
72
72
  export declare class LegacyCdpWalletProvider extends EvmWalletProvider {
73
73
  #private;
@@ -23,7 +23,7 @@ const utils_1 = require("../utils");
23
23
  /**
24
24
  * A legacy wallet provider that uses the old Coinbase SDK.
25
25
  *
26
- * @deprecated Use CdpServerWalletProvider or CdpSmartWalletProvider instead
26
+ * @deprecated Use CdpEvmWalletProvider or CdpSmartWalletProvider instead
27
27
  */
28
28
  class LegacyCdpWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
29
29
  /**
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@coinbase/agentkit",
3
3
  "description": "Coinbase AgentKit core primitives",
4
4
  "repository": "https://github.com/coinbase/agentkit",
5
- "version": "0.0.0-nightly-20250717210412",
5
+ "version": "0.0.0-nightly-20250725210423",
6
6
  "author": "Coinbase Inc.",
7
7
  "license": "Apache-2.0",
8
8
  "main": "dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "@across-protocol/app-sdk": "^0.2.0",
26
26
  "@alloralabs/allora-sdk": "^0.1.0",
27
- "@coinbase/cdp-sdk": "^1.25.0",
27
+ "@coinbase/cdp-sdk": "^1.26.0",
28
28
  "@coinbase/coinbase-sdk": "^0.20.0",
29
29
  "@jup-ag/api": "^6.0.39",
30
30
  "@privy-io/public-api": "2.18.5",
@@ -34,6 +34,7 @@
34
34
  "@zerodev/ecdsa-validator": "^5.4.5",
35
35
  "@zerodev/intent": "^0.0.24",
36
36
  "@zerodev/sdk": "^5.4.28",
37
+ "@zoralabs/coins-sdk": "^0.2.8",
37
38
  "axios": "^1.9.0",
38
39
  "bs58": "^4.0.1",
39
40
  "canonicalize": "^2.1.0",
@@ -1,17 +0,0 @@
1
- import { ActionProvider } from "../actionProvider";
2
- import { CdpEvmWalletProvider } from "../../wallet-providers";
3
- import { Network } from "../../network";
4
- /**
5
- * CdpEvmWalletActionProvider is an action provider for Cdp.
6
- *
7
- * This provider is used for any action that requires a CDP Wallet.
8
- */
9
- declare class CdpEvmWalletActionProvider extends ActionProvider<CdpEvmWalletProvider> {
10
- /**
11
- * Constructor for the CdpEvmWalletActionProvider class.
12
- */
13
- constructor();
14
- supportsNetwork: (network: Network) => boolean;
15
- }
16
- export declare const cdpEvmWalletActionProvider: () => CdpEvmWalletActionProvider;
17
- export {};
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cdpEvmWalletActionProvider = void 0;
4
- const actionProvider_1 = require("../actionProvider");
5
- /**
6
- * CdpEvmWalletActionProvider is an action provider for Cdp.
7
- *
8
- * This provider is used for any action that requires a CDP Wallet.
9
- */
10
- class CdpEvmWalletActionProvider extends actionProvider_1.ActionProvider {
11
- /**
12
- * Constructor for the CdpEvmWalletActionProvider class.
13
- */
14
- constructor() {
15
- super("cdp_evm", []);
16
- this.supportsNetwork = (network) => network.protocolFamily === "evm";
17
- }
18
- }
19
- const cdpEvmWalletActionProvider = () => new CdpEvmWalletActionProvider();
20
- exports.cdpEvmWalletActionProvider = cdpEvmWalletActionProvider;
@@ -1,17 +0,0 @@
1
- import { ActionProvider } from "../actionProvider";
2
- import { CdpSmartWalletProvider } from "../../wallet-providers";
3
- import { Network } from "../../network";
4
- /**
5
- * CdpSmartWalletActionProvider is an action provider for Cdp.
6
- *
7
- * This provider is used for any action that requires a CDP Wallet.
8
- */
9
- declare class CdpSmartWalletActionProvider extends ActionProvider<CdpSmartWalletProvider> {
10
- /**
11
- * Constructor for the CdpSmartWalletActionProvider class.
12
- */
13
- constructor();
14
- supportsNetwork: (network: Network) => boolean;
15
- }
16
- export declare const cdpSmartWalletActionProvider: () => CdpSmartWalletActionProvider;
17
- export {};
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cdpSmartWalletActionProvider = void 0;
4
- const actionProvider_1 = require("../actionProvider");
5
- /**
6
- * CdpSmartWalletActionProvider is an action provider for Cdp.
7
- *
8
- * This provider is used for any action that requires a CDP Wallet.
9
- */
10
- class CdpSmartWalletActionProvider extends actionProvider_1.ActionProvider {
11
- /**
12
- * Constructor for the CdpSmartWalletActionProvider class.
13
- */
14
- constructor() {
15
- super("cdp_smart_wallet", []);
16
- this.supportsNetwork = (network) => network.protocolFamily === "evm";
17
- }
18
- }
19
- const cdpSmartWalletActionProvider = () => new CdpSmartWalletActionProvider();
20
- exports.cdpSmartWalletActionProvider = cdpSmartWalletActionProvider;
@@ -1,17 +0,0 @@
1
- import { ActionProvider } from "../actionProvider";
2
- import { CdpSolanaWalletProvider } from "../../wallet-providers";
3
- import { Network } from "../../network";
4
- /**
5
- * CdpSolanaWalletActionProvider is an action provider for Cdp.
6
- *
7
- * This provider is used for any action that requires a CDP Wallet.
8
- */
9
- declare class CdpSolanaWalletActionProvider extends ActionProvider<CdpSolanaWalletProvider> {
10
- /**
11
- * Constructor for the CdpSolanaWalletActionProvider class.
12
- */
13
- constructor();
14
- supportsNetwork: (network: Network) => boolean;
15
- }
16
- export declare const cdpSolanaWalletActionProvider: () => CdpSolanaWalletActionProvider;
17
- export {};
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cdpSolanaWalletActionProvider = void 0;
4
- const actionProvider_1 = require("../actionProvider");
5
- /**
6
- * CdpSolanaWalletActionProvider is an action provider for Cdp.
7
- *
8
- * This provider is used for any action that requires a CDP Wallet.
9
- */
10
- class CdpSolanaWalletActionProvider extends actionProvider_1.ActionProvider {
11
- /**
12
- * Constructor for the CdpSolanaWalletActionProvider class.
13
- */
14
- constructor() {
15
- super("cdp_solana", []);
16
- this.supportsNetwork = (network) => network.protocolFamily === "solana";
17
- }
18
- }
19
- const cdpSolanaWalletActionProvider = () => new CdpSolanaWalletActionProvider();
20
- exports.cdpSolanaWalletActionProvider = cdpSolanaWalletActionProvider;