{"_id":"@aurracloud/agentkit","_rev":"2-1ebf8e66b4a2251b8b1d914e43eab43a","name":"@aurracloud/agentkit","dist-tags":{"latest":"0.10.0"},"versions":{"0.9.0":{"name":"@aurracloud/agentkit","version":"0.9.0","keywords":["coinbase","sdk","crypto","cdp","agentkit","ai","agent","nodejs","typescript"],"author":{"name":"Coinbase Inc."},"license":"Apache-2.0","_id":"@aurracloud/agentkit@0.9.0","maintainers":[{"name":"yahya_aurracloud","email":"yahya@aurracloud.com"}],"homepage":"https://github.com/Aurracloud/agentkit#readme","bugs":{"url":"https://github.com/Aurracloud/agentkit/issues"},"dist":{"shasum":"fe0d7c79a0af669c5e87a057f824b22e8cb8cf63","tarball":"https://registry.npmjs.org/@aurracloud/agentkit/-/agentkit-0.9.0.tgz","fileCount":386,"integrity":"sha512-NsUKzQs3StlRkl1WkJtHkSd9CnhMuUHHhhLTGx13xIncBAde00RfqWUQmKYFUhwDMAxraXIGnF0hkidlxsACwA==","signatures":[{"sig":"MEYCIQD2etjM3Y8qkNo2+JP1ApUAtDge80zWZTyvmho5sZie3AIhANxRXHC5S9AL/U7y6bzvkPdLYx4RzzsHG9MMuwB01bcp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1427023},"main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"f43753b09e9ea8cbf88fa19325f1756bedd9978a","scripts":{"dev":"tsc --watch","docs":"typedoc --entryPoints ./src --entryPointStrategy expand --exclude ./src/tests/**/*.ts","lint":"eslint -c .eslintrc.json \"src/**/*.ts\"","test":"jest --no-cache --testMatch='**/*.test.ts'","build":"tsc","check":"tsc --noEmit","clean":"rm -rf dist/*","format":"prettier -c .prettierrc --write \"**/*.{ts,js,cjs,json,md}\"","prepack":"tsc","lint:fix":"eslint -c .eslintrc.json \"src/**/*.ts\" --fix","test:e2e":"jest --no-cache --testMatch=**/e2e.ts --coverageThreshold '{}'","docs:serve":"http-server ./docs","test:types":"tsd --files src/tests/types.test-d.ts","format:check":"prettier -c .prettierrc --check \"**/*.{ts,js,cjs,json,md}\"","generate:action-provider":"tsx ./scripts/generate-action-provider/main.ts"},"_npmUser":{"name":"yahya_aurracloud","email":"yahya@aurracloud.com"},"repository":{"url":"git+https://github.com/Aurracloud/agentkit.git","type":"git"},"_npmVersion":"10.9.0","description":"Aurracloud AgentKit core primitives, forked from Coinbase","directories":{},"_nodeVersion":"23.3.0","dependencies":{"md5":"^2.3.0","zod":"^3.23.8","bs58":"^4.0.1","viem":"^2.22.16","x402":"^0.4.1","axios":"^1.9.0","ethers":"^6.13.5","decimal.js":"^10.5.0","opensea-js":"^7.1.18","x402-axios":"^0.3.3","@jup-ag/api":"^6.0.39","@zerodev/sdk":"^5.4.28","canonicalize":"^2.1.0","twitter-api-v2":"^1.18.2","@solana/web3.js":"^1.98.1","@zerodev/intent":"^0.0.24","reflect-metadata":"^0.2.2","@coinbase/cdp-sdk":"^1.26.0","@solana/spl-token":"^0.4.12","@privy-io/public-api":"2.18.5","@privy-io/server-auth":"1.18.4","@alloralabs/allora-sdk":"^0.1.0","@coinbase/coinbase-sdk":"^0.20.0","@across-protocol/app-sdk":"^0.2.0","@zerodev/ecdsa-validator":"^5.4.5"},"_hasShrinkwrap":false,"devDependencies":{"ora":"^7.0.1","tsd":"^0.31.2","tsx":"^4.7.1","jest":"^29.7.0","yargs":"^17.7.2","abitype":"^1.0.8","mock-fs":"^5.2.0","prompts":"^2.4.2","ts-jest":"^29.2.5","nunjucks":"^3.2.4","@types/ora":"^3.2.0","picocolors":"^1.0.0","typescript":"^5.7.2","@types/jest":"^29.5.14","http-server":"^14.1.1","@types/prompts":"^2.4.9","@types/nunjucks":"^3.2.6","@types/secp256k1":"^4.0.6"},"_npmOperationalInternal":{"tmp":"tmp/agentkit_0.9.0_1753264640314_0.5247149271520168","host":"s3://npm-registry-packages-npm-production"}},"0.10.0":{"name":"@aurracloud/agentkit","description":"Aurracloud AgentKit core primitives, forked from Coinbase","repository":{"type":"git","url":"git+https://github.com/Aurracloud/agentkit.git"},"version":"0.10.0","author":{"name":"Coinbase Inc."},"license":"Apache-2.0","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","lint":"eslint -c .eslintrc.json \"src/**/*.ts\"","lint:fix":"eslint -c .eslintrc.json \"src/**/*.ts\" --fix","format":"prettier -c .prettierrc --write \"**/*.{ts,js,cjs,json,md}\"","format:check":"prettier -c .prettierrc --check \"**/*.{ts,js,cjs,json,md}\"","check":"tsc --noEmit","test":"jest --no-cache --testMatch='**/*.test.ts'","test:e2e":"jest --no-cache --testMatch=**/e2e.ts --coverageThreshold '{}'","test:types":"tsd --files src/tests/types.test-d.ts","clean":"rm -rf dist/*","prepack":"tsc","docs":"typedoc --entryPoints ./src --entryPointStrategy expand --exclude ./src/tests/**/*.ts","docs:serve":"http-server ./docs","dev":"tsc --watch","generate:action-provider":"tsx ./scripts/generate-action-provider/main.ts"},"keywords":["coinbase","sdk","crypto","cdp","agentkit","ai","agent","nodejs","typescript"],"dependencies":{"@across-protocol/app-sdk":"^0.2.0","@alloralabs/allora-sdk":"^0.1.0","@coinbase/cdp-sdk":"^1.34.0","@coinbase/coinbase-sdk":"^0.20.0","@jup-ag/api":"^6.0.39","@privy-io/public-api":"2.18.5","@privy-io/server-auth":"1.18.4","@solana/spl-token":"^0.4.12","@solana/web3.js":"^1.98.1","@zerodev/ecdsa-validator":"^5.4.5","@zerodev/intent":"^0.0.24","@zerodev/sdk":"^5.4.28","@zoralabs/coins-sdk":"^0.2.8","axios":"^1.9.0","bs58":"^4.0.1","canonicalize":"^2.1.0","decimal.js":"^10.5.0","ethers":"^6.13.5","md5":"^2.3.0","opensea-js":"^7.1.18","reflect-metadata":"^0.2.2","twitter-api-v2":"^1.18.2","viem":"^2.22.16","x402":"^0.4.1","x402-axios":"^0.3.3","zod":"^3.23.8"},"devDependencies":{"@types/jest":"^29.5.14","@types/nunjucks":"^3.2.6","@types/ora":"^3.2.0","@types/prompts":"^2.4.9","@types/secp256k1":"^4.0.6","abitype":"^1.0.8","http-server":"^14.1.1","jest":"^29.7.0","mock-fs":"^5.2.0","nunjucks":"^3.2.4","ora":"^7.0.1","picocolors":"^1.0.0","prompts":"^2.4.2","ts-jest":"^29.2.5","tsd":"^0.31.2","tsx":"^4.7.1","typescript":"^5.7.2","yargs":"^17.7.2"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"_id":"@aurracloud/agentkit@0.10.0","gitHead":"cbcd87085b35cc09ca4a0b80699ecb64ef781141","bugs":{"url":"https://github.com/Aurracloud/agentkit/issues"},"homepage":"https://github.com/Aurracloud/agentkit#readme","_nodeVersion":"23.3.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-DGoFob5awgN+7bWtRislJWDNziRaeai6impdYckkHOCpStyRz3/IzAJ+Pc1GCoEgzk2Xf5/qPI2ct7aLZLv4cQ==","shasum":"577c85b58973550c4fffd61fbe8ca35198eed0fd","tarball":"https://registry.npmjs.org/@aurracloud/agentkit/-/agentkit-0.10.0.tgz","fileCount":432,"unpackedSize":1592617,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCSXRUraSs+29IGwWy7Zy5Ujo6MYfxDD9wFMm7TN1bHggIhAOIW7L4CsN7AD6Ti7JXV9/YRCzDvD5XZrIUSaFQQi5Ol"}]},"_npmUser":{"name":"yahya_aurracloud","email":"yahya@aurracloud.com"},"directories":{},"maintainers":[{"name":"yahya_aurracloud","email":"yahya@aurracloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agentkit_0.10.0_1754815465121_0.44323137990197004"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-23T09:57:20.191Z","modified":"2025-08-10T08:44:25.562Z","0.9.0":"2025-07-23T09:57:20.521Z","0.10.0":"2025-08-10T08:44:25.386Z"},"bugs":{"url":"https://github.com/Aurracloud/agentkit/issues"},"author":{"name":"Coinbase Inc."},"license":"Apache-2.0","homepage":"https://github.com/Aurracloud/agentkit#readme","keywords":["coinbase","sdk","crypto","cdp","agentkit","ai","agent","nodejs","typescript"],"repository":{"type":"git","url":"git+https://github.com/Aurracloud/agentkit.git"},"description":"Aurracloud AgentKit core primitives, forked from Coinbase","maintainers":[{"name":"yahya_aurracloud","email":"yahya@aurracloud.com"}],"readme":"# Agentkit\n\nAgentKit is a framework for easily enabling AI agents to take actions onchain. It is designed to be framework-agnostic, so you can use it with any AI framework, and wallet-agnostic, so you can use it with any wallet.\n\n## Table of Contents\n\n- [Agentkit](#agentkit)\n  - [Table of Contents](#table-of-contents)\n  - [Getting Started](#getting-started)\n  - [Installation](#installation)\n  - [Usage](#usage)\n    - [Create an AgentKit instance. If no wallet or action providers are specified, the agent will use the `CdpWalletProvider` and `WalletProvider` action provider.](#create-an-agentkit-instance-if-no-wallet-or-action-providers-are-specified-the-agent-will-use-the-cdpwalletprovider-and-walletprovider-action-provider)\n    - [Create an AgentKit instance](#create-an-agentkit-instance)\n    - [Create an AgentKit instance with a specified wallet provider.](#create-an-agentkit-instance-with-a-specified-wallet-provider)\n    - [Create an AgentKit instance with a specified action providers.](#create-an-agentkit-instance-with-a-specified-action-providers)\n    - [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)\n  - [Action Providers](#action-providers)\n  - [Creating an Action Provider](#creating-an-action-provider)\n    - [Adding Actions to your Action Provider](#adding-actions-to-your-action-provider)\n      - [Required Typescript Compiler Options](#required-typescript-compiler-options)\n      - [Steps to create an action](#steps-to-create-an-action)\n      - [Adding Actions to your Action Provider that use a Wallet Provider](#adding-actions-to-your-action-provider-that-use-a-wallet-provider)\n    - [Adding an Action Provider to your AgentKit instance.](#adding-an-action-provider-to-your-agentkit-instance)\n  - [EVM Wallet Providers](#evm-wallet-providers)\n    - [CdpEvmWalletProvider](#cdpevmwalletprovider)\n      - [Basic Configuration](#basic-configuration)\n      - [Using an Existing Wallet](#using-an-existing-wallet)\n      - [Creating a New Wallet](#creating-a-new-wallet)\n      - [Environment Variables](#environment-variables)\n      - [Exporting a wallet](#exporting-a-wallet)\n    - [CdpSmartWalletProvider](#cdpsmartwalletprovider)\n      - [Basic Configuration](#basic-configuration-1)\n      - [Using an Existing Smart Wallet](#using-an-existing-smart-wallet)\n      - [Specifying an Owner Account](#specifying-an-owner-account)\n      - [Creating a New Smart Wallet](#creating-a-new-smart-wallet)\n      - [Environment Variables](#environment-variables-1)\n      - [Exporting Smart Wallet Information](#exporting-smart-wallet-information)\n      - [Key Differences from Regular Wallets](#key-differences-from-regular-wallets)\n    - [LegacyCdpWalletProvider](#legacycdpwalletprovider)\n      - [Network Configuration](#network-configuration)\n      - [Configuring from an existing CDP API Wallet](#configuring-from-an-existing-cdp-api-wallet)\n      - [Configuring from a mnemonic phrase](#configuring-from-a-mnemonic-phrase)\n      - [Exporting a wallet](#exporting-a-wallet-1)\n      - [Importing a wallet from `WalletData` JSON string](#importing-a-wallet-from-walletdata-json-string)\n      - [Configuring LegacyCdpWalletProvider gas parameters](#configuring-legacycdpwalletprovider-gas-parameters)\n    - [ViemWalletProvider](#viemwalletprovider)\n      - [Configuring ViemWalletProvider gas parameters](#configuring-viemwalletprovider-gas-parameters)\n    - [PrivyWalletProvider](#privywalletprovider)\n      - [Server Wallet Configuration](#server-wallet-configuration)\n      - [Delegated Embedded Wallet Configuration](#delegated-embedded-wallet-configuration)\n    - [Prerequisites](#prerequisites)\n    - [Supported Operations](#supported-operations)\n      - [Authorization Keys](#authorization-keys)\n      - [Exporting Privy Wallet information](#exporting-privy-wallet-information)\n    - [SmartWalletProvider](#smartwalletprovider)\n    - [ZeroDevWalletProvider](#zerodevwalletprovider)\n      - [Configuring from CdpWalletProvider](#configuring-from-cdpwalletprovider)\n      - [Configuring from PrivyWalletProvider](#configuring-from-privywalletprovider)\n      - [Configuring from ViemWalletProvider](#configuring-from-viemwalletprovider)\n  - [SVM Wallet Providers](#svm-wallet-providers)\n    - [CdpV2SolanaWalletProvider](#cdpv2solanawalletprovider)\n      - [Basic Configuration](#basic-configuration-2)\n      - [Using an Existing Wallet](#using-an-existing-wallet-1)\n      - [Creating a New Wallet](#creating-a-new-wallet-1)\n      - [Environment Variables](#environment-variables-2)\n      - [Supported Networks](#supported-networks)\n    - [SolanaKeypairWalletProvider](#solanakeypairwalletprovider)\n      - [Solana Network Configuration](#solana-network-configuration)\n      - [RPC URL Configuration](#rpc-url-configuration)\n    - [PrivyWalletProvider (Solana)](#privywalletprovider-solana)\n      - [Connection Configuration](#connection-configuration)\n      - [Authorization Keys](#authorization-keys-1)\n      - [Exporting Privy Wallet information](#exporting-privy-wallet-information-1)\n  - [Contributing](#contributing)\n\n## Getting Started\n\n_Prerequisites_:\n\n- [Node.js 18+](https://nodejs.org/en/download/)\n- [CDP Secret API Key](https://docs.cdp.coinbase.com/get-started/docs/cdp-api-keys#creating-secret-api-keys)\n\n## Installation\n\n```bash\nnpm install @coinbase/agentkit\n```\n\n## Usage\n\n### Create an AgentKit instance. If no wallet or action providers are specified, the agent will use the `CdpWalletProvider` and `WalletProvider` action provider.\n\n```typescript\nconst agentKit = await AgentKit.from({\n  cdpApiKeyId: \"CDP API KEY NAME\",\n  cdpApiKeySecret: \"CDP API KEY SECRET\",\n});\n```\n\n### Create an AgentKit instance\n\nIf no wallet or action provider are specified, the agent will use the `CdpWalletProvider` and `WalletActionProvider` action provider by default.\n\n```typescript\nconst agentKit = await AgentKit.from({\n  cdpApiKeyId: \"CDP API KEY NAME\",\n  cdpApiKeySecret: \"CDP API KEY SECRET\",\n});\n```\n\n### Create an AgentKit instance with a specified wallet provider.\n\n```typescript\nimport { CdpWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await CdpWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP API KEY NAME\",\n  apiKeyPrivate: \"CDP API KEY SECRET\",\n  networkId: \"base-mainnet\",\n});\n\nconst agentKit = await AgentKit.from({\n  walletProvider,\n});\n```\n\n### Create an AgentKit instance with a specified action providers.\n\n```typescript\nimport { cdpApiActionProvider, pythActionProvider } from \"@coinbase/agentkit\";\n\nconst agentKit = await AgentKit.from({\n  walletProvider,\n  actionProviders: [\n    cdpApiActionProvider({\n      apiKeyId: \"CDP API KEY NAME\",\n      apiKeyPrivate: \"CDP API KEY SECRET\",\n    }),\n    pythActionProvider(),\n  ],\n});\n```\n\n### Use the agent's actions with a framework extension. For example, using LangChain + OpenAI.\n\n_Prerequisites_:\n\n- [OpenAI API Key](https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key)\n- Set `OPENAI_API_KEY` environment variable.\n\n```bash\nnpm install @langchain @langchain/langgraph @langchain/openai\n```\n\n```typescript\nimport { getLangChainTools } from \"@coinbase/agentkit-langchain\";\nimport { createReactAgent } from \"@langchain/langgraph/prebuilt\";\nimport { ChatOpenAI } from \"@langchain/openai\";\n\nconst tools = await getLangChainTools(agentKit);\n\nconst llm = new ChatOpenAI({\n  model: \"gpt-4o-mini\",\n});\n\nconst agent = createReactAgent({\n  llm,\n  tools,\n});\n```\n\n## Action Providers\n\n<details>\n<summary><strong>CDP EVM Wallet</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>list_spend_permissions</code></td>\n    <td width=\"768\">Lists spend permissions that have been granted to the current EVM wallet by a smart account.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>use_spend_permission</code></td>\n    <td width=\"768\">Uses a spend permission to spend tokens on behalf of a smart account that the current EVM wallet has permission to spend.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>CDP Smart Wallet</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>list_spend_permissions</code></td>\n    <td width=\"768\">Lists spend permissions that have been granted to the current smart wallet by a smart account.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>use_spend_permission</code></td>\n    <td width=\"768\">Uses a spend permission to spend tokens on behalf of a smart account that the current smart wallet has permission to spend.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Across</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>bridge_token</code></td>\n    <td width=\"768\">Bridges tokens between supported chains using Across Protocol.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>check_deposit_status</code></td>\n    <td width=\"768\">Checks the status of a cross-chain bridge deposit on the Across Protocol (mainnet networks only).</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Basename</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>register_basename</code></td>\n    <td width=\"768\">Registers a custom .base.eth or .basetest.eth domain name for the wallet address.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Compound</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>supply</code></td>\n    <td width=\"768\">Supplies collateral assets (WETH, CBETH, CBBTC, WSTETH, or USDC) to Compound.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>withdraw</code></td>\n    <td width=\"768\">Withdraws previously supplied collateral assets from Compound.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>borrow</code></td>\n    <td width=\"768\">Borrows base assets (WETH or USDC) from Compound using supplied collateral.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>repay</code></td>\n    <td width=\"768\">Repays borrowed assets back to Compound.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>get_portfolio</code></td>\n    <td width=\"768\">Retrieves portfolio details including collateral balances and borrowed amounts.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>DefiLlama</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>find_protocol</code></td>\n    <td width=\"768\">Searches for DeFi protocols on DefiLlama by name, returning protocol metadata including TVL, chain, and category.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>get_protocol</code></td>\n    <td width=\"768\">Fetches detailed information about a specific protocol from DefiLlama, including TVL, description, and historical data.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>get_token_prices</code></td>\n    <td width=\"768\">Fetches current token prices from DefiLlama for specified token addresses with chain prefixes.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>ERC20</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>get_balance</code></td>\n    <td width=\"768\">Retrieves the token balance for a specified address and ERC-20 contract.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>transfer</code></td>\n    <td width=\"768\">Transfers a specified amount of ERC-20 tokens to a destination address.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>ERC721</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>get_balance</code></td>\n    <td width=\"768\">Retrieves the NFT balance for a specified address and ERC-721 contract.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>mint</code></td>\n    <td width=\"768\">Creates a new NFT token and assigns it to a specified destination address.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>transfer</code></td>\n    <td width=\"768\">Transfers ownership of a specific NFT token to a destination address.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Farcaster</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>account_details</code></td>\n    <td width=\"768\">Fetches profile information and metadata for the authenticated Farcaster account.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>post_cast</code></td>\n    <td width=\"768\">Creates a new cast (message) on Farcaster with up to 280 characters and support for up to 2 embedded URLs.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Flaunch</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>flaunch</code></td>\n    <td width=\"768\">Launches a new memecoin token with customizable name, symbol, image, and metadata.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>buyCoinWithETHInput</code></td>\n    <td width=\"768\">Purchases Flaunch memecoin tokens by specifying ETH input amount with configurable slippage.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>buyCoinWithCoinInput</code></td>\n    <td width=\"768\">Purchases Flaunch memecoin tokens by specifying desired token output amount with configurable slippage.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>sellCoin</code></td>\n    <td width=\"768\">Sells Flaunch memecoin tokens back to ETH with configurable slippage.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Messari</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>research_question</code></td>\n    <td width=\"768\">Queries Messari AI for comprehensive crypto research across news, market data, protocol information, and more.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Morpho</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>deposit</code></td>\n    <td width=\"768\">Deposits a specified amount of assets into a designated Morpho Vault.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>withdraw</code></td>\n    <td width=\"768\">Withdraws a specified amount of assets from a designated Morpho Vault.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Onramp</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>get_onramp_buy_url</code></td>\n    <td width=\"768\">Gets a URL to purchase cryptocurrency from Coinbase via Debit card or other payment methods.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Opensea</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>list_nft</code></td>\n    <td width=\"768\">Lists an NFT for sale on OpenSea.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>get_nfts_by_account</code></td>\n    <td width=\"768\">Fetches NFTs owned by a specific wallet address on OpenSea.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Pyth</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>fetch_price</code></td>\n    <td width=\"768\">Retrieves current price data from a specified Pyth price feed.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>fetch_price_feed_id</code></td>\n    <td width=\"768\">Retrieves the unique price feed identifier for a given token symbol.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Twitter</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>account_details</code></td>\n    <td width=\"768\">Fetches profile information and metadata for the authenticated Twitter account.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>account_mentions</code></td>\n    <td width=\"768\">Retrieves recent mentions and interactions for the authenticated account.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>post_tweet</code></td>\n    <td width=\"768\">Creates a new tweet on the authenticated Twitter account.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>post_tweet_reply</code></td>\n    <td width=\"768\">Creates a reply to an existing tweet using the tweet's unique identifier.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>upload_media</code></td>\n    <td width=\"768\">Uploads media (images, videos) to Twitter that can be attached to tweets.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>TrueMarkets</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>get_active_markets</code></td>\n    <td width=\"768\">Retrieves active prediction markets from Truemarkets with pagination and sorting options.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>get_market_details</code></td>\n    <td width=\"768\">Fetches comprehensive details for a specific Truemarkets prediction market including question, status, prices, and liquidity.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Wallet</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>get_wallet_details</code></td>\n    <td width=\"768\">Retrieves wallet address, network info, balances, and provider details.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>native_transfer</code></td>\n    <td width=\"768\">Transfers native blockchain tokens (e.g., ETH) to a destination address.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>WETH</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>wrap_eth</code></td>\n    <td width=\"768\">Converts native ETH to Wrapped ETH (WETH) on Base Sepolia or Base Mainnet.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>unwrap_eth</code></td>\n    <td width=\"768\">Converts Wrapped ETH (WETH) to Native ETH on Base Sepolia or Base Mainnet.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>WOW</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>buy_token</code></td>\n    <td width=\"768\">Purchases WOW tokens from a contract using ETH based on bonding curve pricing.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>create_token</code></td>\n    <td width=\"768\">Creates a new WOW memecoin with bonding curve functionality via Zora factory.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>sell_token</code></td>\n    <td width=\"768\">Sells WOW tokens back to the contract for ETH based on bonding curve pricing.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Jupiter</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>swap</code></td>\n    <td width=\"768\">Swap tokens on Solana using the Jupiter DEX aggregator.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>x402</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>make_http_request</code></td>\n    <td width=\"768\">Makes a basic HTTP request to an API endpoint. If the endpoint requires payment (returns 402),\nit will return payment details that can be used on retry.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>retry_http_request_with_x402</code></td>\n    <td width=\"768\">Retries an HTTP request with x402 payment after receiving a 402 Payment Required response.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>make_http_request_with_x402</code></td>\n    <td width=\"768\">Combines make_http_request and retry_http_request_with_x402 into a single step.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Zerion</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>getPortfolioOverview</code></td>\n    <td width=\"768\">Fetches and summarizes a crypto wallet's portfolio in USD.</td>\n</tr>\n<tr>\n    <td width=\"200\"><code>getFungiblePositions</code></td>\n    <td width=\"768\">Retrieves and summarizes a wallet's fungible token holdings (including DeFi positions)</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>ZeroDev Wallet</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>getCAB</code></td>\n    <td width=\"768\">Retrieves chain abstracted balances (CAB) for specified tokens across multiple networks.</td>\n</tr>\n</table>\n</details>\n<details>\n<summary><strong>Zora</strong></summary>\n<table width=\"100%\">\n<tr>\n    <td width=\"200\"><code>coinIt</code></td>\n    <td width=\"768\">Creates a new Zora coin with customizable name, symbol, description, and image.</td>\n</tr>\n</table>\n</details>\n\n## Creating an Action Provider\n\nAction providers are used to define the actions that an agent can take. They are defined as a class that extends the `ActionProvider` abstract class.\n\n```typescript\nimport { ActionProvider, WalletProvider, Network } from \"@coinbase/agentkit\";\n\n// Define an action provider that uses a wallet provider.\nclass MyActionProvider extends ActionProvider<WalletProvider> {\n  constructor() {\n    super(\"my-action-provider\", []);\n  }\n\n  // Define if the action provider supports the given network\n  supportsNetwork = (network: Network) => true;\n}\n```\n\n### Adding Actions to your Action Provider\n\nActions 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.\n\n#### Required Typescript Compiler Options\n\nCreating actions with the `@CreateAction` decorator requires the following compilerOptions to be included in your project's `tsconfig.json`.\n\n```json\n{\n  \"compilerOptions\": {\n    \"experimentalDecorators\": true,\n    \"emitDecoratorMetadata\": true\n  }\n}\n```\n\n#### Steps to create an action\n\n1. Define the action schema. Action schemas are defined using the `zod` library.\n\n```typescript\nimport { z } from \"zod\";\n\nexport const MyActionSchema = z.object({\n  myField: z.string(),\n});\n```\n\n2. Define the action.\n\n```typescript\nimport { ActionProvider, WalletProvider, Network, CreateAction } from \"@coinbase/agentkit\";\n\nclass MyActionProvider extends ActionProvider<WalletProvider> {\n  constructor() {\n    super(\"my-action-provider\", []);\n  }\n\n  @CreateAction({\n    name: \"my-action\",\n    description: \"My action description\",\n    schema: MyActionSchema,\n  })\n  async myAction(args: z.infer<typeof MyActionSchema>): Promise<string> {\n    return args.myField;\n  }\n\n  supportsNetwork = (network: Network) => true;\n}\n\nexport const myActionProvider = () => new MyActionProvider();\n```\n\n#### Adding Actions to your Action Provider that use a Wallet Provider\n\nActions that use a wallet provider can be defined as instance methods on the action provider class with the `@CreateAction` decorator that have a `WalletProvider` as the first parameter.\n\n```typescript\nclass MyActionProvider extends ActionProvider<WalletProvider> {\n  constructor() {\n    super(\"my-action-provider\", []);\n  }\n\n  @CreateAction({\n    name: \"my-action\",\n    description: \"My action description\",\n    schema: MyActionSchema,\n  })\n  async myAction(\n    walletProvider: WalletProvider,\n    args: z.infer<typeof MyActionSchema>,\n  ): Promise<string> {\n    return walletProvider.signMessage(args.myField);\n  }\n\n  supportsNetwork = (network: Network) => true;\n}\n```\n\n### Adding an Action Provider to your AgentKit instance.\n\nThis gives your agent access to the actions defined in the action provider.\n\n```typescript\nconst agentKit = new AgentKit({\n  cdpApiKeyId: \"CDP API KEY NAME\",\n  cdpApiKeySecret: \"CDP API KEY SECRET\",\n  actionProviders: [myActionProvider()],\n});\n```\n\n## EVM Wallet Providers\n\nWallet providers give an agent access to a wallet. AgentKit currently supports the following wallet providers:\n\nEVM:\n\n- [CdpEvmWalletProvider](https://github.com/coinbase/agentkit/blob/main/typescript/agentkit/src/wallet-providers/cdpEvmWalletProvider.ts)\n- [CdpSmartWalletProvider](https://github.com/coinbase/agentkit/blob/main/typescript/agentkit/src/wallet-providers/cdpSmartWalletProvider.ts)\n- [ViemWalletProvider](https://github.com/coinbase/agentkit/blob/main/typescript/agentkit/src/wallet-providers/viemWalletProvider.ts)\n- [PrivyWalletProvider](https://github.com/coinbase/agentkit/blob/main/typescript/agentkit/src/wallet-providers/privyWalletProvider.ts)\n- [ZeroDevWalletProvider](https://github.com/coinbase/agentkit/blob/main/typescript/agentkit/src/wallet-providers/zeroDevWalletProvider.ts)\n\n### CdpEvmWalletProvider\n\nThe `CdpEvmWalletProvider` is a wallet provider that uses the Coinbase Developer Platform (CDP) [v2 Wallet API](https://docs.cdp.coinbase.com/wallet-api/v2/introduction/welcome). It provides a more modern and streamlined interface for interacting with CDP wallets.\n\n#### Basic Configuration\n\n```typescript\nimport { CdpEvmWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await CdpEvmWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP_API_KEY_ID\",\n  apiKeySecret: \"CDP_API_KEY_SECRET\",\n  walletSecret: \"CDP_WALLET_SECRET\",\n  networkId: \"base-sepolia\", // Optional, defaults to \"base-sepolia\"\n});\n```\n\n#### Using an Existing Wallet\n\nYou can configure the provider with an existing wallet by providing the wallet's address:\n\n```typescript\nimport { CdpEvmWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await CdpEvmWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP_API_KEY_ID\",\n  apiKeySecret: \"CDP_API_KEY_SECRET\",\n  walletSecret: \"CDP_WALLET_SECRET\",\n  address: \"0x...\", // The address of an existing wallet\n  networkId: \"base-sepolia\",\n});\n```\n\n#### Creating a New Wallet\n\nTo create a new wallet, you can provide an idempotency key. The same idempotency key will always generate the same wallet address, and these keys are valid for 24 hours:\n\n```typescript\nimport { CdpEvmWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await CdpEvmWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP_API_KEY_ID\",\n  apiKeySecret: \"CDP_API_KEY_SECRET\",\n  walletSecret: \"CDP_WALLET_SECRET\",\n  idempotencyKey: \"unique-key-123\", // Optional, if not provided a new wallet will be created\n  networkId: \"base-sepolia\",\n});\n```\n\n#### Environment Variables\n\nThe provider can also be configured using environment variables:\n\n```typescript\n// Environment variables:\n// CDP_API_KEY_ID=your_api_key_id\n// CDP_API_KEY_SECRET=your_api_key_secret\n// CDP_WALLET_SECRET=your_wallet_secret\n// NETWORK_ID=base-sepolia (optional)\n// IDEMPOTENCY_KEY=unique-key-123 (optional)\n\nconst walletProvider = await CdpEvmWalletProvider.configureWithWallet();\n```\n\n#### Exporting a wallet\n\nThe `CdpEvmWalletProvider` can export a wallet by calling the `exportWallet` method:\n\n```typescript\nconst walletData = await walletProvider.exportWallet();\n```\n\n### CdpSmartWalletProvider\n\nThe `CdpSmartWalletProvider` is a wallet provider that uses the Coinbase Developer Platform (CDP) [Smart Wallets](https://docs.cdp.coinbase.com/wallet-api/docs/smart-wallets). Smart wallets are ERC-4337 compliant smart contract wallets that provide enhanced features like gasless transactions, batch operations, and account recovery.\n\n**Note:** Smart wallets are currently only supported on Base networks (base-sepolia and base-mainnet).\n\n#### Basic Configuration\n\n```typescript\nimport { CdpSmartWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await CdpSmartWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP_API_KEY_ID\",\n  apiKeySecret: \"CDP_API_KEY_SECRET\",\n  walletSecret: \"CDP_WALLET_SECRET\",\n  networkId: \"base-sepolia\", // Optional, defaults to \"base-sepolia\"\n});\n```\n\n#### Using an Existing Smart Wallet\n\nYou can configure the provider with an existing smart wallet by providing either the wallet's address or name:\n\n```typescript\nimport { CdpSmartWalletProvider } from \"@coinbase/agentkit\";\n\n// Using smart wallet address\nconst walletProvider = await CdpSmartWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP_API_KEY_ID\",\n  apiKeySecret: \"CDP_API_KEY_SECRET\",\n  walletSecret: \"CDP_WALLET_SECRET\",\n  address: \"0x...\", // The address of an existing smart wallet\n  networkId: \"base-sepolia\",\n});\n\n// Or using smart wallet name\nconst walletProvider = await CdpSmartWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP_API_KEY_ID\",\n  apiKeySecret: \"CDP_API_KEY_SECRET\",\n  walletSecret: \"CDP_WALLET_SECRET\",\n  smartAccountName: \"my-smart-wallet\", // The name of an existing smart wallet\n  networkId: \"base-sepolia\",\n});\n```\n\n#### Specifying an Owner Account\n\nSmart wallets require an owner account. You can specify an existing owner account by providing its address or the account object itself:\n\n```typescript\nimport { CdpSmartWalletProvider } from \"@coinbase/agentkit\";\n\n// Using owner address\nconst walletProvider = await CdpSmartWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP_API_KEY_ID\",\n  apiKeySecret: \"CDP_API_KEY_SECRET\",\n  walletSecret: \"CDP_WALLET_SECRET\",\n  owner: \"0x...\", // The address of the owner account\n  networkId: \"base-sepolia\",\n});\n\n// Using owner account object\nconst walletProvider = await CdpSmartWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP_API_KEY_ID\",\n  apiKeySecret: \"CDP_API_KEY_SECRET\",\n  walletSecret: \"CDP_WALLET_SECRET\",\n  owner: ownerAccount, // An EvmServerAccount or PrivateKeyAccount object\n  networkId: \"base-sepolia\",\n});\n```\n\n#### Creating a New Smart Wallet\n\nTo create a new smart wallet, provide an idempotency key. The same idempotency key will always generate the same owner account address, and these keys are valid for 24 hours:\n\n```typescript\nimport { CdpSmartWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await CdpSmartWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP_API_KEY_ID\",\n  apiKeySecret: \"CDP_API_KEY_SECRET\",\n  walletSecret: \"CDP_WALLET_SECRET\",\n  idempotencyKey: \"unique-key-123\", // Optional, if not provided a new owner account will be created\n  networkId: \"base-sepolia\",\n});\n```\n\n#### Environment Variables\n\nThe provider can also be configured using environment variables:\n\n```typescript\n// Environment variables:\n// CDP_API_KEY_ID=your_api_key_id\n// CDP_API_KEY_SECRET=your_api_key_secret\n// CDP_WALLET_SECRET=your_wallet_secret\n// NETWORK_ID=base-sepolia (optional)\n// IDEMPOTENCY_KEY=unique-key-123 (optional)\n\nconst walletProvider = await CdpSmartWalletProvider.configureWithWallet();\n```\n\n#### Exporting Smart Wallet Information\n\nThe `CdpSmartWalletProvider` can export wallet information by calling the `exportWallet` method:\n\n```typescript\nconst walletData = await walletProvider.exportWallet();\n\n// walletData will be in the following format:\n{\n  name: string | undefined; // The smart wallet name (if set)\n  address: string; // The smart wallet address\n  ownerAddress: string; // The owner account address\n}\n```\n\n#### Key Differences from Regular Wallets\n\n1. **User Operations**: Smart wallets use ERC-4337 user operations instead of regular transactions\n2. **No Direct Transaction Signing**: Smart wallets cannot sign transactions directly; all operations go through the user operation flow\n3. **Gasless Transactions**: Smart wallets can be configured to use paymasters for sponsored transactions\n4. **Batch Operations**: Multiple operations can be bundled into a single user operation\n5. **Base Networks Only**: Currently limited to base-sepolia and base-mainnet\n\n### LegacyCdpWalletProvider\n\nThe `LegacyCdpWalletProvider` is a wallet provider that uses the Coinbase Developer Platform (CDP) [v1 Wallet API](https://docs.cdp.coinbase.com/wallet-api/v1/introduction/welcome).\n\n#### Network Configuration\n\nThe `LegacyCdpWalletProvider` can be configured to use a specific network by passing the `networkId` parameter to the `configureWithWallet` method. The `networkId` is the ID of the network you want to use. You can find a list of [supported networks on the CDP API docs](https://docs.cdp.coinbase.com/cdp-apis/docs/networks).\n\n```typescript\nimport { LegacyCdpWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await CdpWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP API KEY NAME\",\n  apiKeyPrivate: \"CDP API KEY SECRET\",\n  networkId: \"base-mainnet\",\n});\n```\n\n#### Configuring from an existing CDP API Wallet\n\nIf you already have a CDP API Wallet, you can configure the `LegacyCdpWalletProvider` by passing the `wallet` parameter to the `configureWithWallet` method.\n\n```typescript\nimport { LegacyCdpWalletProvider } from \"@coinbase/agentkit\";\nimport { Wallet } from \"@coinbase/coinbase-sdk\";\nconst walletProvider = await LegacyCdpWalletProvider.configureWithWallet({\n  wallet,\n  apiKeyId: \"CDP API KEY NAME\",\n  apiKeyPrivate: \"CDP API KEY SECRET\",\n});\n```\n\n#### Configuring from a mnemonic phrase\n\nThe `LegacyCdpWalletProvider` can be configured from a mnemonic phrase by passing the `mnemonicPhrase` and `networkId` parameters to the `configureWithWallet` method. If `networkId` is not defined, the `LegacyCdpWalletProvider` will fall back to the env var `NETWORK_ID`, and if that is not defined, it will default to `base-sepolia`.\n\n```typescript\nimport { LegacyCdpWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await LegacyCdpWalletProvider.configureWithWallet({\n  mnemonicPhrase: \"MNEMONIC PHRASE\",\n  networkId: \"base-sepolia\",\n});\n```\n\n#### Exporting a wallet\n\nThe `LegacyCdpWalletProvider` can export a wallet by calling the `exportWallet` method.\n\n```typescript\nimport { LegacyCdpWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await LegacyCdpWalletProvider.configureWithWallet({\n  mnemonicPhrase: \"MNEMONIC PHRASE\",\n  networkId: \"base-sepolia\",\n});\n\nconst walletData = await walletProvider.exportWallet();\n```\n\n#### Importing a wallet from `WalletData` JSON string\n\nThe `LegacyCdpWalletProvider` can import a wallet from a `WalletData` JSON string by passing the `cdpWalletData` parameter to the `configureWithWallet` method.\n\n```typescript\nimport { LegacyCdpWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await LegacyCdpWalletProvider.configureWithWallet({\n  cdpWalletData: \"WALLET DATA JSON STRING\",\n  apiKeyId: \"CDP API KEY NAME\",\n  apiKeyPrivate: \"CDP API KEY SECRET\",\n});\n```\n\n#### Configuring LegacyCdpWalletProvider gas parameters\n\nThe `LegacyCdpWalletProvider` also exposes parameters for effecting the gas calculations.\n\n```typescript\nimport { LegacyCdpWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await LegacyCdpWalletProvider.configureWithWallet({\n  cdpWalletData: \"WALLET DATA JSON STRING\",\n  apiKeyId: \"CDP API KEY NAME\",\n  apiKeyPrivate: \"CDP API KEY SECRET\",\n  gas: {\n    gasLimitMultiplier: 2.0, // Adjusts gas limit estimation\n    feePerGasMultiplier: 2.0, // Adjusts max fee per gas\n  },\n});\n```\n\n**Note**: Gas parameters only impact the `walletProvider.sendTransaction` behavior. Actions that do not rely on direct transaction calls, such as `deploy_token`, `deploy_contract`, and `native_transfer`, remain unaffected.\n\n### ViemWalletProvider\n\nThe `ViemWalletProvider` is a wallet provider that uses the [Viem library](https://viem.sh/docs/getting-started). It is useful for interacting with any EVM-compatible chain.\n\n```typescript\nimport { ViemWalletProvider } from \"@coinbase/agentkit\";\nimport { privateKeyToAccount } from \"viem/accounts\";\nimport { baseSepolia } from \"viem/chains\";\nimport { http } from \"viem/transports\";\nimport { createWalletClient } from \"viem\";\n\nconst account = privateKeyToAccount(\n  \"0x4c0883a69102937d6231471b5dbb6208ffd70c02a813d7f2da1c54f2e3be9f38\",\n);\n\nconst client = createWalletClient({\n  account,\n  chain: baseSepolia,\n  transport: http(),\n});\n\nconst walletProvider = new ViemWalletProvider(client);\n```\n\n#### Configuring ViemWalletProvider gas parameters\n\nThe `ViemWalletProvider` also exposes parameters for effecting the gas calculations.\n\n```typescript\nimport { ViemWalletProvider } from \"@coinbase/agentkit\";\nimport { privateKeyToAccount } from \"viem/accounts\";\nimport { baseSepolia } from \"viem/chains\";\nimport { http } from \"viem/transports\";\nimport { createWalletClient } from \"viem\";\n\nconst account = privateKeyToAccount(\n  \"0x4c0883a69102937d6231471b5dbb6208ffd70c02a813d7f2da1c54f2e3be9f38\",\n);\n\nconst client = createWalletClient({\n  account,\n  chain: baseSepolia,\n  transport: http(),\n});\n\nconst walletProvider = new ViemWalletProvider(client, {\n  gasLimitMultiplier: 2.0, // Adjusts gas limit estimation\n  feePerGasMultiplier: 2.0, // Adjusts max fee per gas\n});\n```\n\n### PrivyWalletProvider\n\nThe `PrivyWalletProvider` is a wallet provider that uses [Privy Server Wallets](https://docs.privy.io/guide/server-wallets/) or [Privy Embedded Wallets](https://docs.privy.io/guide/embedded-wallets/). This implementation extends the `EvmWalletProvider`.\n\n#### Server Wallet Configuration\n\n```typescript\nimport { PrivyWalletProvider } from \"@coinbase/agentkit\";\n\n// Configure Server Wallet Provider\nconst config = {\n  appId: \"PRIVY_APP_ID\",\n  appSecret: \"PRIVY_APP_SECRET\",\n  chainId: \"84532\", // base-sepolia\n  walletId: \"PRIVY_WALLET_ID\", // optional, otherwise a new wallet will be created\n  authorizationPrivateKey: \"PRIVY_WALLET_AUTHORIZATION_PRIVATE_KEY\", // optional, required if your account is using authorization keys\n  authorizationKeyId: \"PRIVY_WALLET_AUTHORIZATION_KEY_ID\", // optional, only required to create a new wallet if walletId is not provided\n};\n\nconst walletProvider = await PrivyWalletProvider.configureWithWallet(config);\n```\n\n#### Delegated Embedded Wallet Configuration\n\nYou can also use Privy's embedded wallets with delegation for agent actions. This allows your agent to use wallets that have been delegated transaction signing authority by users.\n\n```typescript\nimport { PrivyWalletProvider } from \"@coinbase/agentkit\";\n\n// Configure Embedded Wallet Provider\nconst config = {\n  appId: \"PRIVY_APP_ID\",\n  appSecret: \"PRIVY_APP_SECRET\",\n  authorizationPrivateKey: \"PRIVY_WALLET_AUTHORIZATION_PRIVATE_KEY\",\n  walletId: \"PRIVY_DELEGATED_WALLET_ID\", // The ID of the wallet that was delegated to your server\n  networkId: \"base-mainnet\", // or any supported network\n  walletType: \"embedded\", // Specify \"embedded\" to use the embedded wallet provider\n};\n\nconst walletProvider = await PrivyWalletProvider.configureWithWallet(config);\n```\n\n### Prerequisites\n\nBefore using this wallet provider, you need to:\n\n1. Set up Privy in your application\n2. Enable server delegated actions\n3. Have users delegate permissions to your server\n4. Obtain the delegated wallet ID\n\nFor more information on setting up Privy and enabling delegated actions, see [Privy's documentation](https://docs.privy.io/guide/embedded/server-delegated-actions).\n\n### Supported Operations\n\nThe `PrivyEvmDelegatedEmbeddedWalletProvider` supports all standard wallet operations including transaction signing, message signing, and native transfers, using the wallet that was delegated to your server.\n\n#### Authorization Keys\n\nPrivy offers the option to use authorization keys to secure your server wallets.\n\nYou can manage authorization keys from your [Privy dashboard](https://dashboard.privy.io/account).\n\nWhen using authorization keys, you must provide the `authorizationPrivateKey` and `authorizationKeyId` parameters to the `configureWithWallet` method if you are creating a new wallet. Please note that when creating a key, if you enable \"Create and modify wallets\", you will be required to use that key when creating new wallets via the PrivyWalletProvider.\n\n#### Exporting Privy Wallet information\n\nThe `PrivyWalletProvider` can export wallet information by calling the `exportWallet` method.\n\n```typescript\nconst walletData = await walletProvider.exportWallet();\n\n// For server wallets, walletData will be in the following format:\n{\n  walletId: string;\n  authorizationKey: string | undefined;\n  chainId: string | undefined;\n}\n\n// For embedded wallets, walletData will be in the following format:\n{\n  walletId: string;\n  networkId: string;\n  chainId: string | undefined;\n}\n```\n\n### SmartWalletProvider\n\nThe `SmartWalletProvider` is a wallet provider that uses [CDP Smart Wallets](https://docs.cdp.coinbase.com/wallet-api/docs/smart-wallets).\n\n```typescript\nimport { SmartWalletProvider, SmartWalletConfig } from \"@coinbase/agentkit\";\nimport { generatePrivateKey, privateKeyToAccount } from \"viem/accounts\";\n\nconst networkId = process.env.NETWORK_ID || \"base-sepolia\";\n\nconst privateKey = process.env.PRIVATE_KEY || generatePrivateKey();\nconst signer = privateKeyToAccount(privateKey);\n\n// Configure Wallet Provider\nconst walletProvider = await SmartWalletProvider.configureWithWallet({\n  networkId,\n  signer,\n  smartWalletAddress: undefined, // If not provided a new smart wallet will be created\n  paymasterUrl: undefined, // Sponsor transactions: https://docs.cdp.coinbase.com/paymaster/docs/welcome\n});\n```\n\n### ZeroDevWalletProvider\n\nThe `ZeroDevWalletProvider` is a wallet provider that uses [ZeroDev](https://docs.zerodev.app/) smart accounts. It supports features like chain abstraction, gasless transactions, batched transactions, and more.\n\nIn the context of Agent Kit, \"chain abstraction\" means that the agent can spend funds across chains without explicitly bridging. For example, if you send funds to the agent's address on Base, the agent will be able to spend the funds on any supported EVM chains such as Arbitrum and Optimism.\n\nThe ZeroDev wallet provider does not itself manage keys. Rather, it can be used with any EVM wallet provider (e.g. CDP/Privy/Viem) which serves as the \"signer\" for the ZeroDev smart account.\n\n#### Configuring from CdpWalletProvider\n\n```typescript\nimport { ZeroDevWalletProvider, CdpWalletProvider } from \"@coinbase/agentkit\";\n\n// First create a CDP wallet provider as the signer\nconst cdpWalletProvider = await CdpWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP API KEY NAME\",\n  apiKeyPrivate: \"CDP API KEY SECRET\",\n  networkId: \"base-mainnet\",\n});\n\n// Configure ZeroDev Wallet Provider with CDP signer\nconst walletProvider = await ZeroDevWalletProvider.configureWithWallet({\n  signer: cdpWalletProvider.toSigner(),\n  projectId: \"ZERODEV_PROJECT_ID\",\n  entryPointVersion: \"0.7\" as const,\n  networkId: \"base-mainnet\",\n});\n```\n\n#### Configuring from PrivyWalletProvider\n\n```typescript\nimport { ZeroDevWalletProvider, PrivyWalletProvider } from \"@coinbase/agentkit\";\n\n// First create a Privy wallet provider as the signer\nconst privyWalletProvider = await PrivyWalletProvider.configureWithWallet({\n  appId: \"PRIVY_APP_ID\",\n  appSecret: \"PRIVY_APP_SECRET\",\n  chainId: \"8453\", // base-mainnet\n});\n\n// Configure ZeroDev Wallet Provider with Privy signer\nconst walletProvider = await ZeroDevWalletProvider.configureWithWallet({\n  signer: privyWalletProvider.toSigner(),\n  projectId: \"ZERODEV_PROJECT_ID\",\n  entryPointVersion: \"0.7\" as const,\n  networkId: \"base-mainnet\",\n});\n```\n\n#### Configuring from ViemWalletProvider\n\n```typescript\nimport { ZeroDevWalletProvider, ViemWalletProvider } from \"@coinbase/agentkit\";\nimport { privateKeyToAccount } from \"viem/accounts\";\nimport { base } from \"viem/chains\";\nimport { createWalletClient, http } from \"viem\";\n\n// First create a Viem wallet provider as the signer\nconst account = privateKeyToAccount(\"PRIVATE_KEY\");\n\nconst viemWalletProvider = new ViemWalletProvider(\n  createWalletClient({\n    account,\n    chain: base,\n    transport: http(),\n  }),\n);\n\n// Configure ZeroDev Wallet Provider with Viem signer\nconst walletProvider = await ZeroDevWalletProvider.configureWithWallet({\n  signer: viemWalletProvider.toSigner(),\n  projectId: \"ZERODEV_PROJECT_ID\",\n  entryPointVersion: \"0.7\" as const,\n  networkId: \"base-mainnet\",\n});\n```\n\n## SVM Wallet Providers\n\nWallet providers give an agent access to a wallet. AgentKit currently supports the following wallet providers:\n\nSVM:\n\n- [CdpV2SolanaWalletProvider](https://github.com/coinbase/agentkit/blob/main/typescript/agentkit/src/wallet-providers/cdpV2SolanaWalletProvider.ts)\n- [SolanaKeypairWalletProvider](https://github.com/coinbase/agentkit/blob/main/typescript/agentkit/src/wallet-providers/solanaKeypairWalletProvider.ts)\n- [PrivyWalletProvider](https://github.com/coinbase/agentkit/blob/main/typescript/agentkit/src/wallet-providers/privySvmWalletProvider.ts)\n\n### CdpV2SolanaWalletProvider\n\nThe `CdpV2SolanaWalletProvider` is a wallet provider that uses the Coinbase Developer Platform (CDP) V2 API for Solana. It provides a more modern and streamlined interface for interacting with CDP wallets on the Solana network.\n\n#### Basic Configuration\n\n```typescript\nimport { CdpV2SolanaWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await CdpV2SolanaWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP_API_KEY_ID\",\n  apiKeySecret: \"CDP_API_KEY_SECRET\",\n  walletSecret: \"CDP_WALLET_SECRET\",\n  networkId: \"solana-devnet\", // Optional, defaults to \"solana-devnet\"\n});\n```\n\n#### Using an Existing Wallet\n\nYou can configure the provider with an existing wallet by providing the wallet's address:\n\n```typescript\nimport { CdpV2SolanaWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await CdpV2SolanaWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP_API_KEY_ID\",\n  apiKeySecret: \"CDP_API_KEY_SECRET\",\n  walletSecret: \"CDP_WALLET_SECRET\",\n  address: \"your-solana-address\", // The address of an existing wallet\n  networkId: \"solana-devnet\",\n});\n```\n\n#### Creating a New Wallet\n\nTo create a new wallet, you can provide an idempotency key. The same idempotency key will always generate the same wallet address, and these keys are valid for 24 hours:\n\n```typescript\nimport { CdpV2SolanaWalletProvider } from \"@coinbase/agentkit\";\n\nconst walletProvider = await CdpV2SolanaWalletProvider.configureWithWallet({\n  apiKeyId: \"CDP_API_KEY_ID\",\n  apiKeySecret: \"CDP_API_KEY_SECRET\",\n  walletSecret: \"CDP_WALLET_SECRET\",\n  idempotencyKey: \"unique-key-123\", // Optional, if not provided a new wallet will be created\n  networkId: \"solana-devnet\",\n});\n```\n\n#### Environment Variables\n\nThe provider can also be configured using environment variables:\n\n```typescript\n// Environment variables:\n// CDP_API_KEY_ID=your_api_key_id\n// CDP_API_KEY_SECRET=your_api_key_secret\n// CDP_WALLET_SECRET=your_wallet_secret\n// NETWORK_ID=solana-devnet (optional)\n// IDEMPOTENCY_KEY=unique-key-123 (optional)\n\nconst walletProvider = await CdpV2SolanaWalletProvider.configureWithWallet();\n```\n\n#### Supported Networks\n\nThe `CdpV2SolanaWalletProvider` supports the following Solana networks:\n\n- `solana-mainnet`\n- `solana-devnet`\n- `solana-testnet`\n\n### SolanaKeypairWalletProvider\n\nThe `SolanaKeypairWalletProvider` is a wallet provider that uses the API [Solana web3.js](https://solana.com/docs/clients/javascript).\n\nNOTE: It is highly recommended to use a dedicated RPC provider. See [here](https://solana.com/rpc) for more info on Solana RPC infrastructure, and see [here](#rpc-url-configuration) for instructions on configuring `SolanaKeypairWalletProvider` with a custom RPC URL.\n\n#### Solana Network Configuration\n\nThe `SolanaKeypairWalletProvider` can be configured to use a specific network by passing the `networkId` parameter to the `fromNetwork` method. The `networkId` is the ID of the Solana network you want to use. Valid values are `solana-mainnet`, `solana-devnet` and `solana-testnet`.\n\nThe default RPC endpoints for each network are as follows:\n\n- `solana-mainnet`: `https://api.mainnet-beta.solana.com`\n- `solana-devnet`: `https://api.devnet.solana.com`\n- `solana-testnet`: `https://api.testnet.solana.com`\n\n```typescript\nimport { SOLANA_NETWORK_ID, SolanaKeypairWalletProvider } from \"@coinbase/agentkit\";\n\n// Configure Solana Keypair Wallet Provider\nconst privateKey = process.env.SOLANA_PRIVATE_KEY;\nconst network = process.env.NETWORK_ID as SOLANA_NETWORK_ID;\nconst walletProvider = await SolanaKeypairWalletProvider.fromNetwork(network, privateKey);\n```\n\n#### RPC URL Configuration\n\nThe `SolanaKeypairWalletProvider` can be configured to use a specific RPC url by passing the `rpcUrl` parameter to the `fromRpcUrl` method. The `rpcUrl` will determine the network you are using.\n\n```typescript\nimport { SOLANA_NETWORK_ID, SolanaKeypairWalletProvider } from \"@coinbase/agentkit\";\n\n// Configure Solana Keypair Wallet Provider\nconst privateKey = process.env.SOLANA_PRIVATE_KEY;\nconst rpcUrl = process.env.SOLANA_RPC_URL;\nconst walletProvider = await SolanaKeypairWalletProvider.fromRpcUrl(network, privateKey);\n```\n\n### PrivyWalletProvider (Solana)\n\nThe `PrivyWalletProvider` is a wallet provider that uses [Privy Server Wallets](https://docs.privy.io/guide/server-wallets/).\n\nNOTE: It is highly recommended to use a dedicated RPC provider. See [here](https://solana.com/rpc) for more info on Solana RPC infrastructure, and see [here](#connection-configuration) for instructions on configuring `PrivyWalletProvider` with a custom RPC URL.\n\n```typescript\nimport { PrivyWalletProvider, PrivyWalletConfig } from \"@coinbase/agentkit\";\n\n// Configure Wallet Provider\nconst config: PrivyWalletConfig = {\n  appId: \"PRIVY_APP_ID\",\n  appSecret: \"PRIVY_APP_SECRET\",\n  connection,\n  chainType: \"solana\", // optional, defaults to \"evm\". Make sure to set this to \"solana\" if you want to use Solana!\n  networkId: \"solana-devnet\", // optional, defaults to \"solana-devnet\"\n  walletId: \"PRIVY_WALLET_ID\", // optional, otherwise a new wallet will be created\n  authorizationPrivateKey: PRIVY_WALLET_AUTHORIZATION_PRIVATE_KEY, // optional, required if your account is using authorization keys\n  authorizationKeyId: PRIVY_WALLET_AUTHORIZATION_KEY_ID, // optional, only required to create a new wallet if walletId is not provided\n};\n\nconst walletProvider = await PrivyWalletProvider.configureWithWallet(config);\n```\n\n#### Connection Configuration\n\nOptionally, you can configure your own `@solana/web3.js` connection by passing the `connection` parameter to the `configureWithWallet` method.\n\n```typescript\nimport { PrivyWalletProvider, PrivyWalletConfig } from \"@coinbase/agentkit\";\n\nconst connection = new Connection(\"YOUR_RPC_URL\");\n\n// Configure Wallet Provider\nconst config: PrivyWalletConfig = {\n  appId: \"PRIVY_APP_ID\",\n  appSecret: \"PRIVY_APP_SECRET\",\n  connection,\n  chainType: \"solana\", // optional, defaults to \"evm\". Make sure to set this to \"solana\" if you want to use Solana!\n  networkId: \"solana-devnet\", // optional, defaults to \"solana-devnet\"\n  walletId: \"PRIVY_WALLET_ID\", // optional, otherwise a new wallet will be created\n  authorizationPrivateKey: PRIVY_WALLET_AUTHORIZATION_PRIVATE_KEY, // optional, required if your account is using authorization keys\n  authorizationKeyId: PRIVY_WALLET_AUTHORIZATION_KEY_ID, // optional, only required to create a new wallet if walletId is not provided\n};\n\nconst walletProvider = await PrivyWalletProvider.configureWithWallet(config);\n```\n\n#### Authorization Keys\n\nPrivy offers the option to use authorization keys to secure your server wallets.\n\nYou can manage authorization keys from your [Privy dashboard](https://dashboard.privy.io/account).\n\nWhen using authorization keys, you must provide the `authorizationPrivateKey` and `authorizationKeyId` parameters to the `configureWithWallet` method if you are creating a new wallet. Please note that when creating a key, if you enable \"Create and modify wallets\", you will be required to use that key when creating new wallets via the PrivyWalletProvider.\n\n#### Exporting Privy Wallet information\n\nThe `PrivyWalletProvider` can export wallet information by calling the `exportWallet` method.\n\n```typescript\nconst walletData = await walletProvider.exportWallet();\n\n// walletData will be in the following format:\n{\n  walletId: string;\n  authorizationKey: string | undefined;\n  networkId: string | undefined;\n}\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](../../CONTRIBUTING.md) for more information.\n","readmeFilename":"README.md"}