Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 1.42 KB

File metadata and controls

60 lines (44 loc) · 1.42 KB

Coinbase-Langchain

A DeFi agent built using Langchain and powered by CDP SDK, operating over the XMTP messaging protocol.

Prerequisites

Environment variables

To run your XMTP agent, you must create a .env file with the following variables:

WALLET_KEY= # the private key for the wallet
ENCRYPTION_KEY= # the encryption key for the wallet
# public key is

NETWORK_ID=base-sepolia # base-mainnet or others
OPENAI_API_KEY= # the OpenAI API key
CDP_API_KEY_NAME= # the name of the CDP API key
CDP_API_KEY_PRIVATE_KEY= # the private key for the CDP API key
XMTP_ENV=local # local, dev, production

You can generate random xmtp keys with the following command:

yarn gen:keys <name>

Warning

Running the gen:keys or gen:keys <name> command will append keys to your existing .env file.

Usage

Example prompts:

  • "Send 0.01 USDC to 0x1234..."
  • "Check my wallet balance"

Run the agent

# git clone repo
git clone https://github.com/ephemeraHQ/xmtp-agent-examples.git
# go to the folder
cd xmtp-agent-examples
cd examples/coinbase-langchain
# install packages
yarn
# generate random xmtp keys (optional)
yarn gen:keys
# run the example
yarn dev