diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6cdf0f6dd..41fc0a893 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -37,7 +37,7 @@ Prompt: For example: ``` -Chatbot: typescript/examples/langchain-cdp-chatbot/chatbot.ts +Chatbot: typescript/examples/langchain-smart-wallet-chatbot/chatbot.ts Network: Base Sepolia Setup: Fauceted with 1 USDC diff --git a/.gitignore b/.gitignore index 247a9f8ea..3aac66927 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ **/__pycache__/ # Wallet data -**/wallet_data.txt +**/wallet_data* # Tools **/.pytest_cache diff --git a/CONTRIBUTING-PYTHON.md b/CONTRIBUTING-PYTHON.md index 32a3b2445..1bae999bb 100644 --- a/CONTRIBUTING-PYTHON.md +++ b/CONTRIBUTING-PYTHON.md @@ -193,7 +193,7 @@ Integrations into AI Agent frameworks are specific to the framework itself, so w ### Local Testing -A good way to test new actions locally is by using the chatbot example in `python/examples/langchain-cdp-chatbot`. See the [chatbot README](./python/examples/langchain-cdp-chatbot/README.md) for instructions on setting up and running the chatbot. +A good way to test new actions locally is by using the chatbot example in `python/examples/langchain-smart-wallet-chatbot`. See the [chatbot README](./python/examples/langchain-smart-wallet-chatbot/README.md) for instructions on setting up and running the chatbot. The flow is: diff --git a/CONTRIBUTING-TYPESCRIPT.md b/CONTRIBUTING-TYPESCRIPT.md index 6d9bd9b01..002e51f39 100644 --- a/CONTRIBUTING-TYPESCRIPT.md +++ b/CONTRIBUTING-TYPESCRIPT.md @@ -224,13 +224,13 @@ Integrations into AI Agent frameworks are specific to the framework itself, so w ### Local Testing -A good way to test new actions locally is by using the chatbot example in `typescript/examples/langchain-cdp-chatbot`. See the [chatbot README](https://github.com/coinbase/agentkit/blob/master/typescript/examples/langchain-cdp-chatbot/README.md) for instructions on setting up and running the chatbot. +A good way to test new actions locally is by using the chatbot example in `typescript/examples/langchain-smart-wallet-chatbot`. See the [chatbot README](https://github.com/coinbase/agentkit/blob/master/typescript/examples/langchain-smart-wallet-chatbot/README.md) for instructions on setting up and running the chatbot. The flow is: 1. Make your change as described in the [Adding an Agentic Action](#adding-an-agentic-action) section -2. From `typescript/`, run `pnpm run build && pnpm i` -3. In `typescript/examples/langchain-cdp-chatbot`, run `pnpm run start` +2. From `typescript/`, run `pnpm i && pnpm build` +3. In `typescript/examples/langchain-smart-wallet-chatbot`, run `pnpm run start` 4. You can now interact with your new action via the chatbot! ### Running Tests diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f4a488eae..ae5b14d5b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,8 +36,8 @@ agentkit/ │ ├── langchain-privy-chatbot/ │ ├── langchain-solana-chatbot/ │ ├── langchain-twitter-chatbot/ -│ ├── model-context-protocol-cdp-server/ -│ └── vercel-ai-sdk-cdp-chatbot/ +│ ├── model-context-protocol-smart-wallet-server/ +│ └── vercel-ai-sdk-smart-wallet-chatbot/ ├── python/ │ ├── coinbase-agentkit/ │ ├── create-onchain-agent/ @@ -47,7 +47,7 @@ agentkit/ │ └── examples/ │ ├── langchain-cdp-chatbot/ │ ├── langchain-twitter-chatbot/ -│ └── openai-agents-sdk-cdp-chatbot/ +│ └── openai-agents-sdk-smart-wallet-chatbot/ ``` ## Language-Specific Guides diff --git a/README.md b/README.md index 6bbb3c2cd..abe258cd2 100644 --- a/README.md +++ b/README.md @@ -150,8 +150,8 @@ agentkit/ │ ├── langchain-privy-chatbot/ │ ├── langchain-solana-chatbot/ │ ├── langchain-twitter-chatbot/ -│ ├── model-context-protocol-cdp-server/ -│ └── vercel-ai-sdk-cdp-chatbot/ +│ ├── model-context-protocol-smart-wallet-server/ +│ └── vercel-ai-sdk-smart-wallet-chatbot/ ├── python/ │ ├── coinbase-agentkit/ │ ├── create-onchain-agent/ @@ -161,7 +161,7 @@ agentkit/ │ └── examples/ │ ├── langchain-cdp-chatbot/ │ ├── langchain-twitter-chatbot/ -│ └── openai-agents-sdk-cdp-chatbot/ +│ └── openai-agents-sdk-smart-wallet-chatbot/ ``` ## 🤝 Contributing diff --git a/python/create-onchain-agent/changelog.d/622.feature.md b/python/create-onchain-agent/changelog.d/622.feature.md new file mode 100644 index 000000000..02c0eef36 --- /dev/null +++ b/python/create-onchain-agent/changelog.d/622.feature.md @@ -0,0 +1 @@ +Updated default wallet provider to SmartWalletProvider diff --git a/python/create-onchain-agent/create_onchain_agent/cli.py b/python/create-onchain-agent/create_onchain_agent/cli.py index e3fb4e2e4..272d0d75b 100755 --- a/python/create-onchain-agent/create_onchain_agent/cli.py +++ b/python/create-onchain-agent/create_onchain_agent/cli.py @@ -238,14 +238,14 @@ def create_advanced_project(templates_path: str | None = None): if network: if network in CDP_SUPPORTED_NETWORKS: wallet_choices = [ - "CDP Wallet Provider", "Smart Wallet Provider", + "CDP Wallet Provider", "Ethereum Account Wallet Provider", ] wallet_selection = questionary.select( "Select a wallet provider:", choices=wallet_choices, - default="CDP Wallet Provider", + default="Smart Wallet Provider", style=custom_style, ).ask() diff --git a/python/examples/langchain-smart-wallet-chatbot/chatbot.py b/python/examples/langchain-smart-wallet-chatbot/chatbot.py index 182ede16f..38c67e55e 100644 --- a/python/examples/langchain-smart-wallet-chatbot/chatbot.py +++ b/python/examples/langchain-smart-wallet-chatbot/chatbot.py @@ -22,15 +22,15 @@ from langgraph.checkpoint.memory import MemorySaver from langgraph.prebuilt import create_react_agent -wallet_data_file = "wallet_data.txt" - load_dotenv() - def initialize_agent(): """Initialize the agent with SmartWalletProvider.""" llm = ChatOpenAI(model="gpt-4o-mini") + network_id = os.getenv("NETWORK_ID", "base-sepolia") + wallet_data_file = f"wallet_data_{network_id.replace('-', '_')}.txt" + # Load wallet data from JSON file wallet_data = {"private_key": None, "smart_wallet_address": None} if os.path.exists(wallet_data_file): @@ -38,18 +38,16 @@ def initialize_agent(): with open(wallet_data_file) as f: wallet_data = json.load(f) except json.JSONDecodeError: - print("Warning: Invalid wallet data file format. Creating new wallet.") + print(f"Warning: Invalid wallet data file format for {network_id}. Creating new wallet.") # Use private key from env if not in wallet data private_key = wallet_data.get("private_key") or os.getenv("PRIVATE_KEY") - if not private_key: - raise ValueError("PRIVATE_KEY environment variable is required") + acct = Account.create() + private_key = acct.key.hex() signer = Account.from_key(private_key) - network_id = os.getenv("NETWORK_ID", "base-sepolia") - # Initialize CDP Wallet Provider wallet_provider = SmartWalletProvider( SmartWalletProviderConfig( diff --git a/python/examples/langchain-twitter-chatbot/chatbot.py b/python/examples/langchain-twitter-chatbot/chatbot.py index a92af90e6..17329ce92 100644 --- a/python/examples/langchain-twitter-chatbot/chatbot.py +++ b/python/examples/langchain-twitter-chatbot/chatbot.py @@ -6,13 +6,14 @@ from coinbase_agentkit import ( AgentKit, AgentKitConfig, - CdpWalletProvider, - CdpWalletProviderConfig, + SmartWalletProvider, + SmartWalletProviderConfig, twitter_action_provider, wallet_action_provider, ) from coinbase_agentkit_langchain import get_langchain_tools from dotenv import load_dotenv +from eth_account.account import Account from langchain_core.messages import HumanMessage from langchain_openai import ChatOpenAI from langgraph.checkpoint.memory import MemorySaver @@ -29,17 +30,42 @@ def initialize_agent(): # Initialize LLM llm = ChatOpenAI(model="gpt-4o-mini") - # Initialize CDP Wallet Provider - wallet_data = None + # Load wallet data from JSON file + network_id = os.getenv("NETWORK_ID", "base-sepolia") + wallet_data_file = f"wallet_data_{network_id.replace('-', '_')}.txt" + wallet_data = {"private_key": None, "smart_wallet_address": None} if os.path.exists(wallet_data_file): - with open(wallet_data_file) as f: - wallet_data = f.read() - - cdp_config = None - if wallet_data is not None: - cdp_config = CdpWalletProviderConfig(wallet_data=wallet_data) + try: + with open(wallet_data_file) as f: + wallet_data = json.load(f) + except json.JSONDecodeError: + print(f"Warning: Invalid wallet data file format for {network_id}. Creating new wallet.") + + # Use private key from env if not in wallet data + private_key = wallet_data.get("private_key") or os.getenv("PRIVATE_KEY") + if not private_key: + acct = Account.create() + private_key = acct.key.hex() + + signer = Account.from_key(private_key) + + # Initialize Smart Wallet Provider + wallet_provider = SmartWalletProvider( + SmartWalletProviderConfig( + network_id=network_id, + signer=signer, + smart_wallet_address=wallet_data.get("smart_wallet_address"), + paymaster_url=None, # Sponsor transactions: https://docs.cdp.coinbase.com/paymaster/docs/welcome + ) + ) - wallet_provider = CdpWalletProvider(cdp_config) + # Save both private key and smart wallet address + wallet_data = { + "private_key": private_key, + "smart_wallet_address": wallet_provider.get_address(), + } + with open(wallet_data_file, "w") as f: + json.dump(wallet_data, f, indent=2) agentkit = AgentKit( AgentKitConfig( @@ -51,11 +77,6 @@ def initialize_agent(): ) ) - wallet_data_json = json.dumps(wallet_provider.export_wallet().to_dict()) - - with open(wallet_data_file, "w") as f: - f.write(wallet_data_json) - # use get_langchain_tools tools = get_langchain_tools(agentkit) diff --git a/python/examples/openai-agents-sdk-cdp-chatbot/.env.local b/python/examples/openai-agents-sdk-smart-wallet-chatbot/.env.local similarity index 80% rename from python/examples/openai-agents-sdk-cdp-chatbot/.env.local rename to python/examples/openai-agents-sdk-smart-wallet-chatbot/.env.local index 8cde60f43..cd7824307 100644 --- a/python/examples/openai-agents-sdk-cdp-chatbot/.env.local +++ b/python/examples/openai-agents-sdk-smart-wallet-chatbot/.env.local @@ -1,3 +1,4 @@ CDP_API_KEY_NAME= # Place your CDP API key name here CDP_API_KEY_PRIVATE_KEY= # Place your CDP API key private key here OPENAI_API_KEY= # Place your OpenAI API key here +PRIVATE_KEY= # Place your private key here \ No newline at end of file diff --git a/python/examples/openai-agents-sdk-cdp-chatbot/Makefile b/python/examples/openai-agents-sdk-smart-wallet-chatbot/Makefile similarity index 100% rename from python/examples/openai-agents-sdk-cdp-chatbot/Makefile rename to python/examples/openai-agents-sdk-smart-wallet-chatbot/Makefile diff --git a/python/examples/openai-agents-sdk-cdp-chatbot/README.md b/python/examples/openai-agents-sdk-smart-wallet-chatbot/README.md similarity index 95% rename from python/examples/openai-agents-sdk-cdp-chatbot/README.md rename to python/examples/openai-agents-sdk-smart-wallet-chatbot/README.md index fb2cac466..436205ea0 100644 --- a/python/examples/openai-agents-sdk-cdp-chatbot/README.md +++ b/python/examples/openai-agents-sdk-smart-wallet-chatbot/README.md @@ -35,6 +35,7 @@ poetry install - "CDP_API_KEY_NAME" - "CDP_API_KEY_PRIVATE_KEY" - "OPENAI_API_KEY" + - "PRIVATE_KEY" (optional, will generate a new private key if not provided) - "NETWORK_ID" (Defaults to `base-sepolia`) ```bash diff --git a/python/examples/openai-agents-sdk-cdp-chatbot/chatbot.py b/python/examples/openai-agents-sdk-smart-wallet-chatbot/chatbot.py similarity index 75% rename from python/examples/openai-agents-sdk-cdp-chatbot/chatbot.py rename to python/examples/openai-agents-sdk-smart-wallet-chatbot/chatbot.py index 375e84644..d04e675ef 100644 --- a/python/examples/openai-agents-sdk-cdp-chatbot/chatbot.py +++ b/python/examples/openai-agents-sdk-smart-wallet-chatbot/chatbot.py @@ -7,10 +7,9 @@ from coinbase_agentkit import ( AgentKit, AgentKitConfig, - CdpWalletProvider, - CdpWalletProviderConfig, + SmartWalletProvider, + SmartWalletProviderConfig, cdp_api_action_provider, - cdp_wallet_action_provider, erc20_action_provider, pyth_action_provider, wallet_action_provider, @@ -18,6 +17,7 @@ ) from coinbase_agentkit_openai_agents_sdk import get_openai_agents_sdk_tools from dotenv import load_dotenv +from eth_account.account import Account from agents.agent import Agent from agents.run import Runner @@ -28,25 +28,50 @@ def initialize_agent(): - """Initialize the agent with CDP Agentkit.""" - # Initialize CDP Wallet Provider - wallet_data = None - if os.path.exists(wallet_data_file): - with open(wallet_data_file) as f: - wallet_data = f.read() + """Initialize the agent with SmartWalletProvider.""" + network_id = os.getenv("NETWORK_ID", "base-sepolia") + wallet_data_file = f"wallet_data_{network_id.replace('-', '_')}.txt" - cdp_config = None - if wallet_data is not None: - cdp_config = CdpWalletProviderConfig(wallet_data=wallet_data) + # Load wallet data from JSON file + wallet_data = {"private_key": None, "smart_wallet_address": None} + if os.path.exists(wallet_data_file): + try: + with open(wallet_data_file) as f: + wallet_data = json.load(f) + except json.JSONDecodeError: + print(f"Warning: Invalid wallet data file format for {network_id}. Creating new wallet.") + + # Use private key from env if not in wallet data + private_key = wallet_data.get("private_key") or os.getenv("PRIVATE_KEY") + if not private_key: + acct = Account.create() + private_key = acct.key.hex() + + signer = Account.from_key(private_key) + + # Initialize Smart Wallet Provider + wallet_provider = SmartWalletProvider( + SmartWalletProviderConfig( + network_id=network_id, + signer=signer, + smart_wallet_address=wallet_data.get("smart_wallet_address"), + paymaster_url=None, # Sponsor transactions: https://docs.cdp.coinbase.com/paymaster/docs/welcome + ) + ) - wallet_provider = CdpWalletProvider(cdp_config) + # Save both private key and smart wallet address + wallet_data = { + "private_key": private_key, + "smart_wallet_address": wallet_provider.get_address(), + } + with open(wallet_data_file, "w") as f: + json.dump(wallet_data, f, indent=2) agentkit = AgentKit( AgentKitConfig( wallet_provider=wallet_provider, action_providers=[ cdp_api_action_provider(), - cdp_wallet_action_provider(), erc20_action_provider(), pyth_action_provider(), wallet_action_provider(), @@ -55,11 +80,6 @@ def initialize_agent(): ) ) - wallet_data_json = json.dumps(wallet_provider.export_wallet().to_dict()) - - with open(wallet_data_file, "w") as f: - f.write(wallet_data_json) - # use get_openai_agents_sdk_tools tools = get_openai_agents_sdk_tools(agentkit) diff --git a/python/examples/openai-agents-sdk-cdp-chatbot/poetry.lock b/python/examples/openai-agents-sdk-smart-wallet-chatbot/poetry.lock similarity index 100% rename from python/examples/openai-agents-sdk-cdp-chatbot/poetry.lock rename to python/examples/openai-agents-sdk-smart-wallet-chatbot/poetry.lock diff --git a/python/examples/openai-agents-sdk-cdp-chatbot/pyproject.toml b/python/examples/openai-agents-sdk-smart-wallet-chatbot/pyproject.toml similarity index 100% rename from python/examples/openai-agents-sdk-cdp-chatbot/pyproject.toml rename to python/examples/openai-agents-sdk-smart-wallet-chatbot/pyproject.toml diff --git a/python/framework-extensions/langchain/README.md b/python/framework-extensions/langchain/README.md index 86ee2d36a..2b9c54149 100644 --- a/python/framework-extensions/langchain/README.md +++ b/python/framework-extensions/langchain/README.md @@ -47,7 +47,7 @@ agent = create_react_agent( For AgentKit configuration options, see the [Coinbase Agentkit README](https://github.com/coinbase/agentkit/blob/master/python/coinbase-agentkit/README.md). -For a full example, see the [chatbot example](https://github.com/coinbase/agentkit/blob/master/python/examples/langchain-cdp-chatbot/chatbot.py). +For a full example, see the [chatbot example](https://github.com/coinbase/agentkit/blob/master/python/examples/langchain-smart-wallet-chatbot/chatbot.py). ## Contributing diff --git a/python/framework-extensions/openai-agents-sdk/README.md b/python/framework-extensions/openai-agents-sdk/README.md index 8b1e45316..f297dc676 100644 --- a/python/framework-extensions/openai-agents-sdk/README.md +++ b/python/framework-extensions/openai-agents-sdk/README.md @@ -47,7 +47,7 @@ agent = Agent( For AgentKit configuration options, see the [Coinbase Agentkit README](https://github.com/coinbase/agentkit/blob/master/python/coinbase-agentkit/README.md). -For a full example, see the [chatbot example](https://github.com/coinbase/agentkit/blob/master/python/examples/openai-agents-sdk-cdp-chatbot/chatbot.py). +For a full example, see the [chatbot example](https://github.com/coinbase/agentkit/blob/master/python/examples/openai-agents-sdk-smart-wallet-chatbot/chatbot.py). ## Contributing diff --git a/typescript/.changeset/kind-terms-spend.md b/typescript/.changeset/kind-terms-spend.md new file mode 100644 index 000000000..71a370521 --- /dev/null +++ b/typescript/.changeset/kind-terms-spend.md @@ -0,0 +1,5 @@ +--- +"create-onchain-agent": minor +--- + +Updated default wallet provider to SmartWalletProvider diff --git a/typescript/create-onchain-agent/src/actions/initProject.ts b/typescript/create-onchain-agent/src/actions/initProject.ts index e3e4730fa..9fd19b36e 100644 --- a/typescript/create-onchain-agent/src/actions/initProject.ts +++ b/typescript/create-onchain-agent/src/actions/initProject.ts @@ -198,8 +198,8 @@ export async function initProject() { }, message: (prev, { network }) => { const walletDescriptions: Record = { - CDP: "Uses Coinbase Developer Platform (CDP)'s managed wallet.", SmartWallet: "Uses Coinbase Developer Platform (CDP)'s Smart Wallet.", + CDP: "Uses Coinbase Developer Platform (CDP)'s managed wallet.", Viem: "Client-side Ethereum wallet.", Privy: "Authentication and wallet infrastructure.", SolanaKeypair: "Client-side Solana wallet.", diff --git a/typescript/create-onchain-agent/src/actions/prepareAgentkit.ts b/typescript/create-onchain-agent/src/actions/prepareAgentkit.ts index ae6ee514a..a17f94c7b 100644 --- a/typescript/create-onchain-agent/src/actions/prepareAgentkit.ts +++ b/typescript/create-onchain-agent/src/actions/prepareAgentkit.ts @@ -103,8 +103,8 @@ export async function prepareAgentKit() { name: "walletProvider", message: (prev, { network }) => { const walletDescriptions: Record = { - CDP: "Uses Coinbase Developer Platform (CDP)'s managed wallet.", SmartWallet: "Uses Coinbase Developer Platform (CDP)'s Smart Wallet.", + CDP: "Uses Coinbase Developer Platform (CDP)'s managed wallet.", Viem: "Client-side Ethereum wallet.", Privy: "Authentication and wallet infrastructure.", SolanaKeypair: "Client-side Solana wallet.", diff --git a/typescript/create-onchain-agent/src/common/constants.ts b/typescript/create-onchain-agent/src/common/constants.ts index e6bd44936..679b91d7c 100644 --- a/typescript/create-onchain-agent/src/common/constants.ts +++ b/typescript/create-onchain-agent/src/common/constants.ts @@ -25,7 +25,7 @@ export type SVMNetwork = (typeof SVM_NETWORKS)[number]; export type Network = EVMNetwork | SVMNetwork; -const CDP_SUPPORTED_EVM_WALLET_PROVIDERS = ["CDP", "SmartWallet", "Viem", "Privy"] as const; +const CDP_SUPPORTED_EVM_WALLET_PROVIDERS = ["SmartWallet", "CDP", "Viem", "Privy"] as const; const SVM_WALLET_PROVIDERS = ["SolanaKeypair", "Privy"] as const; export const NON_CDP_SUPPORTED_EVM_WALLET_PROVIDERS = ["Viem", "Privy"] as const; diff --git a/typescript/create-onchain-agent/templates/mcp/package.json b/typescript/create-onchain-agent/templates/mcp/package.json index 4c86354e7..5b84bc941 100644 --- a/typescript/create-onchain-agent/templates/mcp/package.json +++ b/typescript/create-onchain-agent/templates/mcp/package.json @@ -16,7 +16,7 @@ "@modelcontextprotocol/sdk": "^1.6.1", "@solana/web3.js": "^1.98.0", "bs58": "^6.0.0", - "viem": "^2.23.7" + "viem": "^2.24.1" }, "devDependencies": { "@types/node": "^22.13.9", diff --git a/typescript/create-onchain-agent/templates/next/package.json b/typescript/create-onchain-agent/templates/next/package.json index 0ea09156d..4e652e4e4 100644 --- a/typescript/create-onchain-agent/templates/next/package.json +++ b/typescript/create-onchain-agent/templates/next/package.json @@ -24,7 +24,7 @@ "react": "^18", "react-dom": "^18", "react-markdown": "^10.0.0", - "viem": "^2.17.4", + "viem": "^2.24.1", "wagmi": "^2.11.0" }, "devDependencies": { diff --git a/typescript/examples/langchain-smart-wallet-chatbot/chatbot.ts b/typescript/examples/langchain-smart-wallet-chatbot/chatbot.ts index 33143faba..16719c450 100644 --- a/typescript/examples/langchain-smart-wallet-chatbot/chatbot.ts +++ b/typescript/examples/langchain-smart-wallet-chatbot/chatbot.ts @@ -53,8 +53,6 @@ function validateEnvironment(): void { // Add this right after imports and before any other code validateEnvironment(); -// Configure a file to persist the agent's CDP Smart Wallet + Private Key data -const WALLET_DATA_FILE = "wallet_data.txt"; type WalletData = { privateKey: Hex; smartWalletAddress: Address; @@ -72,23 +70,26 @@ async function initializeAgent() { model: "gpt-4o-mini", }); + const networkId = process.env.NETWORK_ID || "base-sepolia"; + const walletDataFile = `wallet_data_${networkId.replace(/-/g, "_")}.txt`; + let walletData: WalletData | null = null; let privateKey: Hex | null = null; // Read existing wallet data if available - if (fs.existsSync(WALLET_DATA_FILE)) { + if (fs.existsSync(walletDataFile)) { try { - walletData = JSON.parse(fs.readFileSync(WALLET_DATA_FILE, "utf8")) as WalletData; + walletData = JSON.parse(fs.readFileSync(walletDataFile, "utf8")) as WalletData; privateKey = walletData.privateKey; } catch (error) { - console.error("Error reading wallet data:", error); + console.error(`Error reading wallet data for ${networkId}:`, error); // Continue without wallet data } } if (!privateKey) { if (walletData?.smartWalletAddress) { throw new Error( - `Smart wallet found but no private key provided. Either provide the private key, or delete ${WALLET_DATA_FILE} and try again.`, + `Smart wallet found but no private key provided. Either provide the private key, or delete ${walletDataFile} and try again.`, ); } privateKey = (process.env.PRIVATE_KEY || generatePrivateKey()) as Hex; @@ -98,7 +99,7 @@ async function initializeAgent() { // Configure Smart Wallet Provider const walletProvider = await SmartWalletProvider.configureWithWallet({ - networkId: process.env.NETWORK_ID, + networkId, signer, smartWalletAddress: walletData?.smartWalletAddress, paymasterUrl: undefined, // Sponsor transactions: https://docs.cdp.coinbase.com/paymaster/docs/welcome @@ -150,7 +151,7 @@ async function initializeAgent() { // Save wallet data const smartWalletAddress = await walletProvider.getAddress(); fs.writeFileSync( - WALLET_DATA_FILE, + walletDataFile, JSON.stringify({ privateKey, smartWalletAddress, diff --git a/typescript/examples/model-context-protocol-cdp-server/.eslintrc.json b/typescript/examples/model-context-protocol-smart-wallet-server/.eslintrc.json similarity index 100% rename from typescript/examples/model-context-protocol-cdp-server/.eslintrc.json rename to typescript/examples/model-context-protocol-smart-wallet-server/.eslintrc.json diff --git a/typescript/examples/model-context-protocol-cdp-server/.prettierignore b/typescript/examples/model-context-protocol-smart-wallet-server/.prettierignore similarity index 100% rename from typescript/examples/model-context-protocol-cdp-server/.prettierignore rename to typescript/examples/model-context-protocol-smart-wallet-server/.prettierignore diff --git a/typescript/examples/model-context-protocol-cdp-server/.prettierrc b/typescript/examples/model-context-protocol-smart-wallet-server/.prettierrc similarity index 100% rename from typescript/examples/model-context-protocol-cdp-server/.prettierrc rename to typescript/examples/model-context-protocol-smart-wallet-server/.prettierrc diff --git a/typescript/examples/model-context-protocol-cdp-server/README.md b/typescript/examples/model-context-protocol-smart-wallet-server/README.md similarity index 92% rename from typescript/examples/model-context-protocol-cdp-server/README.md rename to typescript/examples/model-context-protocol-smart-wallet-server/README.md index 7fe7cb5cb..73299e194 100644 --- a/typescript/examples/model-context-protocol-cdp-server/README.md +++ b/typescript/examples/model-context-protocol-smart-wallet-server/README.md @@ -38,6 +38,8 @@ You'll need to configure the Claude desktop config file with your CDP API keys. 2. Set your CDP API keys in the `env` section: - "CDP_API_KEY_NAME" - "CDP_API_KEY_PRIVATE_KEY" + - "PRIVATE_KEY" (optional, will generate a new private key if not provided) + - "SMART_WALLET_ADDRESS" (optional, will generate a new smart wallet address if not provided) Then, navigate to the `claude_desktop_config.json` file found in your Claude Desktop apps' settings and update it's contents to the contents of our `claude_desktop_config.json` file. diff --git a/typescript/examples/model-context-protocol-cdp-server/claude_desktop_config.json b/typescript/examples/model-context-protocol-smart-wallet-server/claude_desktop_config.json similarity index 64% rename from typescript/examples/model-context-protocol-cdp-server/claude_desktop_config.json rename to typescript/examples/model-context-protocol-smart-wallet-server/claude_desktop_config.json index 366b1bfae..07494d5b7 100644 --- a/typescript/examples/model-context-protocol-cdp-server/claude_desktop_config.json +++ b/typescript/examples/model-context-protocol-smart-wallet-server/claude_desktop_config.json @@ -3,11 +3,13 @@ "agentkit": { "command": "node", "args": [ - "/Users/YOUR_USER/YOUR_DIRECTORIES/agentkit/typescript/examples/model-context-protocol-cdp-server/dist/index.js" + "/Users/YOUR_USER/YOUR_DIRECTORIES/agentkit/typescript/examples/model-context-protocol-smart-wallet-server/dist/index.js" ], "env": { "CDP_API_KEY_NAME": "YOUR_CDP_API_KEY_NAME", - "CDP_API_KEY_PRIVATE_KEY": "YOUR_CDP_API_KEY_PRIVATE_KEY" + "CDP_API_KEY_PRIVATE_KEY": "YOUR_CDP_API_KEY_PRIVATE_KEY", + "PRIVATE_KEY": "YOUR_PRIVATE_KEY", + "SMART_WALLET_ADDRESS": "YOUR_SMART_WALLET_ADDRESS" } } } diff --git a/typescript/examples/model-context-protocol-cdp-server/index.ts b/typescript/examples/model-context-protocol-smart-wallet-server/index.ts similarity index 83% rename from typescript/examples/model-context-protocol-cdp-server/index.ts rename to typescript/examples/model-context-protocol-smart-wallet-server/index.ts index 236393bf7..df7c3ecad 100644 --- a/typescript/examples/model-context-protocol-cdp-server/index.ts +++ b/typescript/examples/model-context-protocol-smart-wallet-server/index.ts @@ -1,19 +1,19 @@ -import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; -import { getMcpTools } from "@coinbase/agentkit-model-context-protocol"; import { AgentKit, - CdpWalletProvider, - wethActionProvider, - walletActionProvider, + cdpApiActionProvider, erc20ActionProvider, erc721ActionProvider, - cdpApiActionProvider, - cdpWalletActionProvider, pythActionProvider, + SmartWalletProvider, + walletActionProvider, + wethActionProvider, } from "@coinbase/agentkit"; +import { getMcpTools } from "@coinbase/agentkit-model-context-protocol"; import { Server } from "@modelcontextprotocol/sdk/server/index.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js"; - +import { Address, Hex } from "viem"; +import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; /** * Validates that required environment variables are set */ @@ -57,13 +57,24 @@ async function initializeServer() { ); // Configure CDP Wallet Provider + const privateKey = (process.env.PRIVATE_KEY || generatePrivateKey()) as Hex; + const signer = privateKeyToAccount(privateKey); + const config = { apiKeyName: process.env.CDP_API_KEY_NAME!, apiKeyPrivateKey: process.env.CDP_API_KEY_PRIVATE_KEY!, networkId: process.env.NETWORK_ID || "base-sepolia", + smartWalletAddress: process.env.SMART_WALLET_ADDRESS as Address, + signer, }; - const walletProvider = await CdpWalletProvider.configureWithWallet(config); + const walletProvider = await SmartWalletProvider.configureWithWallet(config); + + if (!process.env.PRIVATE_KEY || !process.env.SMART_WALLET_ADDRESS) { + console.log("Save your private key and smart wallet address to the environment variables"); + console.log("PRIVATE_KEY=" + privateKey); + console.log("SMART_WALLET_ADDRESS=" + walletProvider.getAddress()); + } // Initialize AgentKit const agentkit = await AgentKit.from({ @@ -78,10 +89,6 @@ async function initializeServer() { apiKeyName: config.apiKeyName, apiKeyPrivateKey: config.apiKeyPrivateKey, }), - cdpWalletActionProvider({ - apiKeyName: config.apiKeyName, - apiKeyPrivateKey: config.apiKeyPrivateKey, - }), ], }); diff --git a/typescript/examples/model-context-protocol-cdp-server/package.json b/typescript/examples/model-context-protocol-smart-wallet-server/package.json similarity index 97% rename from typescript/examples/model-context-protocol-cdp-server/package.json rename to typescript/examples/model-context-protocol-smart-wallet-server/package.json index 6a84ecced..673bf9dc5 100644 --- a/typescript/examples/model-context-protocol-cdp-server/package.json +++ b/typescript/examples/model-context-protocol-smart-wallet-server/package.json @@ -19,6 +19,7 @@ "@coinbase/agentkit": "workspace:*", "@coinbase/agentkit-model-context-protocol": "workspace:*", "@modelcontextprotocol/sdk": "^1.6.1", + "viem": "^2.24.1", "zod": "^3.22.4" }, "devDependencies": { diff --git a/typescript/examples/model-context-protocol-cdp-server/tsconfig.json b/typescript/examples/model-context-protocol-smart-wallet-server/tsconfig.json similarity index 100% rename from typescript/examples/model-context-protocol-cdp-server/tsconfig.json rename to typescript/examples/model-context-protocol-smart-wallet-server/tsconfig.json diff --git a/typescript/examples/vercel-ai-sdk-cdp-chatbot/.env-local b/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/.env-local similarity index 77% rename from typescript/examples/vercel-ai-sdk-cdp-chatbot/.env-local rename to typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/.env-local index c837255d6..64def7b46 100644 --- a/typescript/examples/vercel-ai-sdk-cdp-chatbot/.env-local +++ b/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/.env-local @@ -1,3 +1,4 @@ CDP_API_KEY_NAME="" # Place your CDP API key name in between the quotes CDP_API_KEY_PRIVATE_KEY="" # Place your CDP API key private key in between the quotes -OPENAI_API_KEY="" # Place your OpenAI API key in between the quotes \ No newline at end of file +OPENAI_API_KEY="" # Place your OpenAI API key in between the quotes +PRIVATE_KEY="" # Place your private key in between the quotes \ No newline at end of file diff --git a/typescript/examples/vercel-ai-sdk-cdp-chatbot/.eslintrc.json b/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/.eslintrc.json similarity index 100% rename from typescript/examples/vercel-ai-sdk-cdp-chatbot/.eslintrc.json rename to typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/.eslintrc.json diff --git a/typescript/examples/vercel-ai-sdk-cdp-chatbot/.prettierignore b/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/.prettierignore similarity index 100% rename from typescript/examples/vercel-ai-sdk-cdp-chatbot/.prettierignore rename to typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/.prettierignore diff --git a/typescript/examples/vercel-ai-sdk-cdp-chatbot/.prettierrc b/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/.prettierrc similarity index 100% rename from typescript/examples/vercel-ai-sdk-cdp-chatbot/.prettierrc rename to typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/.prettierrc diff --git a/typescript/examples/vercel-ai-sdk-cdp-chatbot/README.md b/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/README.md similarity index 91% rename from typescript/examples/vercel-ai-sdk-cdp-chatbot/README.md rename to typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/README.md index 8e5ed7f95..31c4a794d 100644 --- a/typescript/examples/vercel-ai-sdk-cdp-chatbot/README.md +++ b/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/README.md @@ -39,6 +39,7 @@ Once you have them, rename the `.env-local` file to `.env` and make sure you set - "CDP_API_KEY_NAME" - "CDP_API_KEY_PRIVATE_KEY" - "OPENAI_API_KEY" +- "PRIVATE_KEY" (optional, will generate a new private key if not provided) ## Running the example @@ -51,7 +52,7 @@ npm run build This will install the dependencies and build the packages locally. The chatbot example uses the local `@coinbase/agentkit-vercel-ai-sdk` and `@coinbase/agentkit` packages. If you make changes to the packages, you can run `npm run build` from root again to rebuild the packages, and your changes will be reflected in the chatbot example. -Now from the `typescript/examples/vercel-ai-sdk-cdp-chatbot` directory, run: +Now from the `typescript/examples/vercel-ai-sdk-smart-wallet-chatbot` directory, run: ```bash npm start diff --git a/typescript/examples/vercel-ai-sdk-cdp-chatbot/chatbot.ts b/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/chatbot.ts similarity index 82% rename from typescript/examples/vercel-ai-sdk-cdp-chatbot/chatbot.ts rename to typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/chatbot.ts index 7c6c7c224..87dcb554b 100644 --- a/typescript/examples/vercel-ai-sdk-cdp-chatbot/chatbot.ts +++ b/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/chatbot.ts @@ -4,7 +4,7 @@ import { erc721ActionProvider, pythActionProvider, walletActionProvider, - CdpWalletProvider, + SmartWalletProvider, } from "@coinbase/agentkit"; import { getVercelAITools } from "@coinbase/agentkit-vercel-ai-sdk"; import { openai } from "@ai-sdk/openai"; @@ -12,9 +12,16 @@ import { generateId, Message, streamText, ToolSet } from "ai"; import * as dotenv from "dotenv"; import * as readline from "readline"; import * as fs from "fs"; +import { Address, Hex } from "viem"; +import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; dotenv.config(); +type WalletData = { + privateKey: Hex; + smartWalletAddress: Address; +}; + /** * Validates that required environment variables are set * @@ -50,9 +57,6 @@ function validateEnvironment(): void { // Add this right after imports and before any other code validateEnvironment(); -// Configure a file to persist the agent's CDP MPC Wallet Data -const WALLET_DATA_FILE = "wallet_data.txt"; - const system = `You are a helpful agent that can interact onchain using the Coinbase Developer Platform AgentKit. You are empowered to interact onchain using your tools. If you ever need funds, you can request them from the faucet if you are on network ID 'base-sepolia'. If not, you can provide your wallet details and request @@ -71,23 +75,40 @@ restating your tools' descriptions unless it is explicitly requested.`; */ async function initializeAgent() { try { - let walletDataStr: string | null = null; + const networkId = process.env.NETWORK_ID || "base-sepolia"; + const walletDataFile = `wallet_data_${networkId.replace(/-/g, "_")}.txt`; + + let walletData: WalletData | null = null; + let privateKey: Hex | null = null; // Read existing wallet data if available - if (fs.existsSync(WALLET_DATA_FILE)) { + if (fs.existsSync(walletDataFile)) { try { - walletDataStr = fs.readFileSync(WALLET_DATA_FILE, "utf8"); + walletData = JSON.parse(fs.readFileSync(walletDataFile, "utf8")) as WalletData; + privateKey = walletData.privateKey; } catch (error) { - console.error("Error reading wallet data:", error); + console.error(`Error reading wallet data for ${networkId}:`, error); // Continue without wallet data } } - const walletProvider = await CdpWalletProvider.configureWithWallet({ - apiKeyName: process.env.CDP_API_KEY_NAME, - apiKeyPrivateKey: process.env.CDP_API_KEY_PRIVATE_KEY?.replace(/\\n/g, "\n"), - cdpWalletData: walletDataStr || undefined, - networkId: process.env.NETWORK_ID || "base-sepolia", + if (!privateKey) { + if (walletData?.smartWalletAddress) { + throw new Error( + `Smart wallet found but no private key provided. Either provide the private key, or delete ${walletDataFile} and try again.`, + ); + } + privateKey = (process.env.PRIVATE_KEY || generatePrivateKey()) as Hex; + } + + const signer = privateKeyToAccount(privateKey); + + // Configure Smart Wallet Provider + const walletProvider = await SmartWalletProvider.configureWithWallet({ + networkId, + signer, + smartWalletAddress: walletData?.smartWalletAddress, + paymasterUrl: undefined, // Sponsor transactions: https://docs.cdp.coinbase.com/paymaster/docs/welcome }); const agentKit = await AgentKit.from({ @@ -103,6 +124,16 @@ async function initializeAgent() { ], }); + // Save wallet data + const smartWalletAddress = await walletProvider.getAddress(); + fs.writeFileSync( + walletDataFile, + JSON.stringify({ + privateKey, + smartWalletAddress, + } as WalletData), + ); + const tools = getVercelAITools(agentKit); return { tools }; } catch (error) { diff --git a/typescript/examples/vercel-ai-sdk-cdp-chatbot/package.json b/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/package.json similarity index 97% rename from typescript/examples/vercel-ai-sdk-cdp-chatbot/package.json rename to typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/package.json index fb12b61c6..3d0de77b3 100644 --- a/typescript/examples/vercel-ai-sdk-cdp-chatbot/package.json +++ b/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/package.json @@ -20,6 +20,7 @@ "ai": "^4.1.16", "dotenv": "^16.4.5", "tsx": "^4.7.1", + "viem": "^2.24.1", "zod": "^3.22.4" }, "devDependencies": { diff --git a/typescript/examples/vercel-ai-sdk-cdp-chatbot/tsconfig.json b/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/tsconfig.json similarity index 100% rename from typescript/examples/vercel-ai-sdk-cdp-chatbot/tsconfig.json rename to typescript/examples/vercel-ai-sdk-smart-wallet-chatbot/tsconfig.json diff --git a/typescript/framework-extensions/vercel-ai-sdk/README.md b/typescript/framework-extensions/vercel-ai-sdk/README.md index 57e97c128..3aa14845e 100644 --- a/typescript/framework-extensions/vercel-ai-sdk/README.md +++ b/typescript/framework-extensions/vercel-ai-sdk/README.md @@ -66,7 +66,7 @@ const { text } = await generateText({ console.log(text); ``` -For a full example, see the [AgentKit AI SDK Chatbot Example](https://github.com/coinbase/agentkit/tree/main/typescript/examples/vercel-ai-sdk-cdp-chatbot). +For a full example, see the [AgentKit AI SDK Chatbot Example](https://github.com/coinbase/agentkit/tree/main/typescript/examples/vercel-ai-sdk-smart-wallet-chatbot). ## Contributing diff --git a/typescript/pnpm-lock.yaml b/typescript/pnpm-lock.yaml index 27acf5428..177f43cf1 100644 --- a/typescript/pnpm-lock.yaml +++ b/typescript/pnpm-lock.yaml @@ -215,8 +215,8 @@ importers: specifier: ^6.0.0 version: 6.0.0 viem: - specifier: ^2.23.7 - version: 2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) + specifier: ^2.24.1 + version: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) devDependencies: '@types/node': specifier: ^22.13.9 @@ -276,11 +276,11 @@ importers: specifier: ^10.0.0 version: 10.1.0(@types/react@18.3.20)(react@18.3.1) viem: - specifier: ^2.17.4 - version: 2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) + specifier: ^2.24.1 + version: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) wagmi: specifier: ^2.11.0 - version: 2.14.15(@tanstack/query-core@5.69.0)(@tanstack/react-query@5.69.0(react@18.3.1))(@types/react@18.3.20)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2))(zod@3.24.2) + version: 2.14.15(@tanstack/query-core@5.69.0)(@tanstack/react-query@5.69.0(react@18.3.1))(@types/react@18.3.20)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2))(zod@3.24.2) devDependencies: '@types/node': specifier: ^20 @@ -502,7 +502,7 @@ importers: specifier: ^10.9.2 version: 10.9.2(@types/node@22.13.13)(typescript@5.8.2) - examples/model-context-protocol-cdp-server: + examples/model-context-protocol-smart-wallet-server: dependencies: '@coinbase/agentkit': specifier: workspace:* @@ -513,6 +513,9 @@ importers: '@modelcontextprotocol/sdk': specifier: ^1.6.1 version: 1.8.0 + viem: + specifier: ^2.24.1 + version: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) zod: specifier: ^3.22.4 version: 3.24.2 @@ -524,7 +527,7 @@ importers: specifier: ^10.9.2 version: 10.9.2(@types/node@22.13.13)(typescript@5.8.2) - examples/vercel-ai-sdk-cdp-chatbot: + examples/vercel-ai-sdk-smart-wallet-chatbot: dependencies: '@ai-sdk/openai': specifier: ^1.1.9 @@ -544,6 +547,9 @@ importers: tsx: specifier: ^4.7.1 version: 4.19.3 + viem: + specifier: ^2.24.1 + version: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) zod: specifier: ^3.22.4 version: 3.24.2 @@ -6619,14 +6625,14 @@ snapshots: '@alloralabs/allora-sdk': 0.1.0 '@coinbase/coinbase-sdk': 0.20.0(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) '@jup-ag/api': 6.0.40 - '@privy-io/server-auth': 1.19.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)(viem@2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2)) + '@privy-io/server-auth': 1.19.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2)) '@solana/spl-token': 0.4.13(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.2)(utf-8-validate@5.0.10) '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) md5: 2.3.0 opensea-js: 7.1.18(bufferutil@4.0.9)(utf-8-validate@5.0.10) reflect-metadata: 0.2.2 twitter-api-v2: 1.22.0 - viem: 2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) + viem: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) zod: 3.24.2 transitivePeerDependencies: - bufferutil @@ -6651,7 +6657,7 @@ snapshots: ethers: 6.13.5(bufferutil@4.0.9)(utf-8-validate@5.0.10) jose: 5.10.0 secp256k1: 5.0.1 - viem: 2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) + viem: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) transitivePeerDependencies: - bufferutil - debug @@ -7553,6 +7559,26 @@ snapshots: - encoding - utf-8-validate + '@privy-io/server-auth@1.19.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2))': + dependencies: + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 + '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + canonicalize: 2.1.0 + dotenv: 16.4.7 + jose: 4.15.9 + node-fetch-native: 1.6.6 + redaxios: 0.5.1 + svix: 1.62.0 + ts-case-convert: 2.1.0 + type-fest: 3.13.1 + optionalDependencies: + viem: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) + transitivePeerDependencies: + - bufferutil + - encoding + - utf-8-validate + '@rtsao/scc@1.1.0': {} '@rushstack/eslint-patch@1.11.0': {} @@ -7570,7 +7596,7 @@ snapshots: '@safe-global/safe-apps-sdk@9.1.0(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2)': dependencies: '@safe-global/safe-gateway-typescript-sdk': 3.22.9 - viem: 2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) + viem: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) transitivePeerDependencies: - bufferutil - typescript @@ -8072,16 +8098,16 @@ snapshots: '@unrs/rspack-resolver-binding-win32-x64-msvc@1.3.0': optional: true - '@wagmi/connectors@5.7.11(@types/react@18.3.20)(@wagmi/core@2.16.7(@tanstack/query-core@5.69.0)(@types/react@18.3.20)(react@18.3.1)(typescript@5.8.2)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2)))(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2))(zod@3.24.2)': + '@wagmi/connectors@5.7.11(@types/react@18.3.20)(@wagmi/core@2.16.7(@tanstack/query-core@5.69.0)(@types/react@18.3.20)(react@18.3.1)(typescript@5.8.2)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2)))(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2))(zod@3.24.2)': dependencies: '@coinbase/wallet-sdk': 4.3.0 '@metamask/sdk': 0.32.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@safe-global/safe-apps-provider': 0.18.5(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) '@safe-global/safe-apps-sdk': 9.1.0(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) - '@wagmi/core': 2.16.7(@tanstack/query-core@5.69.0)(@types/react@18.3.20)(react@18.3.1)(typescript@5.8.2)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2)) + '@wagmi/core': 2.16.7(@tanstack/query-core@5.69.0)(@types/react@18.3.20)(react@18.3.1)(typescript@5.8.2)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2)) '@walletconnect/ethereum-provider': 2.19.1(@types/react@18.3.20)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) cbw-sdk: '@coinbase/wallet-sdk@3.9.3' - viem: 2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) + viem: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) optionalDependencies: typescript: 5.8.2 transitivePeerDependencies: @@ -8111,11 +8137,11 @@ snapshots: - utf-8-validate - zod - '@wagmi/core@2.16.7(@tanstack/query-core@5.69.0)(@types/react@18.3.20)(react@18.3.1)(typescript@5.8.2)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2))': + '@wagmi/core@2.16.7(@tanstack/query-core@5.69.0)(@types/react@18.3.20)(react@18.3.1)(typescript@5.8.2)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2))': dependencies: eventemitter3: 5.0.1 mipd: 0.0.7(typescript@5.8.2) - viem: 2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) + viem: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) zustand: 5.0.0(@types/react@18.3.20)(react@18.3.1)(use-sync-external-store@1.4.0(react@18.3.1)) optionalDependencies: '@tanstack/query-core': 5.69.0 @@ -13291,14 +13317,14 @@ snapshots: - utf-8-validate - zod - wagmi@2.14.15(@tanstack/query-core@5.69.0)(@tanstack/react-query@5.69.0(react@18.3.1))(@types/react@18.3.20)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2))(zod@3.24.2): + wagmi@2.14.15(@tanstack/query-core@5.69.0)(@tanstack/react-query@5.69.0(react@18.3.1))(@types/react@18.3.20)(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2))(zod@3.24.2): dependencies: '@tanstack/react-query': 5.69.0(react@18.3.1) - '@wagmi/connectors': 5.7.11(@types/react@18.3.20)(@wagmi/core@2.16.7(@tanstack/query-core@5.69.0)(@types/react@18.3.20)(react@18.3.1)(typescript@5.8.2)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2)))(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2))(zod@3.24.2) - '@wagmi/core': 2.16.7(@tanstack/query-core@5.69.0)(@types/react@18.3.20)(react@18.3.1)(typescript@5.8.2)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2)) + '@wagmi/connectors': 5.7.11(@types/react@18.3.20)(@wagmi/core@2.16.7(@tanstack/query-core@5.69.0)(@types/react@18.3.20)(react@18.3.1)(typescript@5.8.2)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2)))(bufferutil@4.0.9)(react@18.3.1)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2))(zod@3.24.2) + '@wagmi/core': 2.16.7(@tanstack/query-core@5.69.0)(@types/react@18.3.20)(react@18.3.1)(typescript@5.8.2)(use-sync-external-store@1.4.0(react@18.3.1))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2)) react: 18.3.1 use-sync-external-store: 1.4.0(react@18.3.1) - viem: 2.23.15(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) + viem: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.24.2) optionalDependencies: typescript: 5.8.2 transitivePeerDependencies: