diff --git a/typescript/.changeset/green-planes-decide.md b/typescript/.changeset/green-planes-decide.md new file mode 100644 index 000000000..2068effc0 --- /dev/null +++ b/typescript/.changeset/green-planes-decide.md @@ -0,0 +1,5 @@ +--- +"create-onchain-agent": patch +--- + +Fixed bugs in next template configs diff --git a/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/evm/cdp/prepare-agentkit.ts b/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/evm/cdp/prepare-agentkit.ts index f42af9ddf..f6f58278a 100644 --- a/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/evm/cdp/prepare-agentkit.ts +++ b/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/evm/cdp/prepare-agentkit.ts @@ -1,7 +1,6 @@ import { AgentKit, cdpApiActionProvider, - cdpEvmWalletActionProvider, CdpEvmWalletProvider, erc20ActionProvider, pythActionProvider, @@ -94,7 +93,6 @@ export async function prepareAgentkitAndWalletProvider(): Promise<{ walletActionProvider(), erc20ActionProvider(), cdpApiActionProvider(), - cdpEvmWalletActionProvider(), ], }); diff --git a/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/evm/privy/prepare-agentkit.ts b/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/evm/privy/prepare-agentkit.ts index 1295d0550..7bb1c28f2 100644 --- a/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/evm/privy/prepare-agentkit.ts +++ b/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/evm/privy/prepare-agentkit.ts @@ -1,9 +1,9 @@ import { ActionProvider, AgentKit, - cdpApiActionProvider, + legacyCdpApiActionProvider, erc20ActionProvider, - PrivyWalletConfig, + PrivyEvmWalletConfig, PrivyWalletProvider, pythActionProvider, walletActionProvider, @@ -66,7 +66,7 @@ export async function prepareAgentkitAndWalletProvider(): Promise<{ try { // Initialize WalletProvider: https://docs.cdp.coinbase.com/agentkit/docs/wallet-management - const config: PrivyWalletConfig = { + const config: PrivyEvmWalletConfig = { appId: process.env.PRIVY_APP_ID as string, appSecret: process.env.PRIVY_APP_SECRET as string, walletId: process.env.PRIVY_WALLET_ID as string, @@ -101,7 +101,7 @@ export async function prepareAgentkitAndWalletProvider(): Promise<{ const canUseCdpApi = process.env.CDP_API_KEY_ID && process.env.CDP_API_KEY_SECRET; if (canUseCdpApi) { actionProviders.push( - cdpApiActionProvider({ + legacyCdpApiActionProvider({ apiKeyId: process.env.CDP_API_KEY_ID, apiKeySecret: process.env.CDP_API_KEY_SECRET, }), diff --git a/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/evm/viem/prepare-agentkit.ts b/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/evm/viem/prepare-agentkit.ts index e29d7f267..2312147de 100644 --- a/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/evm/viem/prepare-agentkit.ts +++ b/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/evm/viem/prepare-agentkit.ts @@ -1,7 +1,7 @@ import { ActionProvider, AgentKit, - cdpApiActionProvider, + legacyCdpApiActionProvider, erc20ActionProvider, NETWORK_ID_TO_VIEM_CHAIN, pythActionProvider, @@ -97,7 +97,7 @@ export async function prepareAgentkitAndWalletProvider(): Promise<{ const canUseCdpApi = process.env.CDP_API_KEY_ID && process.env.CDP_API_KEY_SECRET; if (canUseCdpApi) { actionProviders.push( - cdpApiActionProvider({ + legacyCdpApiActionProvider({ apiKeyId: process.env.CDP_API_KEY_ID, apiKeySecret: process.env.CDP_API_KEY_SECRET, }), diff --git a/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/svm/privy/prepare-agentkit.ts b/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/svm/privy/prepare-agentkit.ts index c18205968..8c7245af5 100644 --- a/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/svm/privy/prepare-agentkit.ts +++ b/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/svm/privy/prepare-agentkit.ts @@ -1,9 +1,9 @@ import { ActionProvider, AgentKit, - cdpApiActionProvider, + legacyCdpApiActionProvider, jupiterActionProvider, - PrivyWalletConfig, + PrivySvmWalletConfig, PrivyWalletProvider, splActionProvider, walletActionProvider, @@ -65,14 +65,14 @@ export async function prepareAgentkitAndWalletProvider(): Promise<{ try { // Initialize WalletProvider: https://docs.cdp.coinbase.com/agentkit/docs/wallet-management - const config: PrivyWalletConfig = { + const config: PrivySvmWalletConfig = { appId: process.env.PRIVY_APP_ID as string, appSecret: process.env.PRIVY_APP_SECRET as string, walletId: process.env.PRIVY_WALLET_ID as string, authorizationPrivateKey: process.env.PRIVY_WALLET_AUTHORIZATION_PRIVATE_KEY, authorizationKeyId: process.env.PRIVY_WALLET_AUTHORIZATION_KEY_ID, - chainType: "solana", networkId: process.env.NETWORK_ID, + walletType: "server", }; // Try to load saved wallet data if (fs.existsSync(WALLET_DATA_FILE)) { @@ -92,7 +92,7 @@ export async function prepareAgentkitAndWalletProvider(): Promise<{ const canUseCdpApi = process.env.CDP_API_KEY_ID && process.env.CDP_API_KEY_SECRET; if (canUseCdpApi) { actionProviders.push( - cdpApiActionProvider({ + legacyCdpApiActionProvider({ apiKeyId: process.env.CDP_API_KEY_ID, apiKeySecret: process.env.CDP_API_KEY_SECRET, }), diff --git a/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/svm/solanaKeypair/prepare-agentkit.ts b/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/svm/solanaKeypair/prepare-agentkit.ts index ea8a6e9b3..6c5c16dd6 100644 --- a/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/svm/solanaKeypair/prepare-agentkit.ts +++ b/typescript/create-onchain-agent/templates/next/app/api/agent/agentkit/svm/solanaKeypair/prepare-agentkit.ts @@ -1,7 +1,7 @@ import { ActionProvider, AgentKit, - cdpApiActionProvider, + legacyCdpApiActionProvider, jupiterActionProvider, SOLANA_NETWORK_ID, SolanaKeypairWalletProvider, @@ -97,7 +97,7 @@ export async function prepareAgentkitAndWalletProvider(): Promise<{ const canUseCdpApi = process.env.CDP_API_KEY_ID && process.env.CDP_API_KEY_SECRET; if (canUseCdpApi) { actionProviders.push( - cdpApiActionProvider({ + legacyCdpApiActionProvider({ apiKeyId: process.env.CDP_API_KEY_ID, apiKeySecret: process.env.CDP_API_KEY_SECRET, }),