Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example(ts): mnemonic phrase wallet import #99 #119

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cdp-langchain/examples/wallet-typescript/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"parser": "@typescript-eslint/parser",
"extends": ["../../../.eslintrc.base.json"]
}
7 changes: 7 additions & 0 deletions cdp-langchain/examples/wallet-typescript/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
docs/
dist/
coverage/
.github/
src/client
**/**/*.json
*.md
11 changes: 11 additions & 0 deletions cdp-langchain/examples/wallet-typescript/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "avoid",
"printWidth": 100,
"proseWrap": "never"
}
47 changes: 47 additions & 0 deletions cdp-langchain/examples/wallet-typescript/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# CDP AgentKit Langchain Extension Examples - Mnemomic Phrase Wallet Import

This example demonstrates agentkit setup with an imported wallet from a mnemomic phrase through the ENV. An example of a mnemomic phrase could be:
```bash
eternal phone creek robot disorder climb thought eternal noodle flat cage bubble liquid sting can
```

## Requirements

- Node.js 18+
- [CDP API Key](https://portal.cdp.coinbase.com/access/api)

### Checking Node Version

Before using the example, ensure that you have the correct version of Node.js installed. The example requires Node.js 18 or higher. You can check your Node version by running:

```bash
node --version
npm --version
```

## Installation

```bash
npm install
```

## Run the Chatbot

### Set ENV Vars

Ensure the following ENV Vars are set in .env
- "CDP_API_KEY_NAME"
- "CDP_API_KEY_PRIVATE_KEY"
- "MNEMONIC_PHRASE"
- "OPENAI_API_KEY"
- "NETWORK_ID" (Defaults to `base-sepolia`)

The mnemomic phrase example above can be used to validate wallet import functionality.

```bash
npm start
```

## License

Apache-2.0
Loading
Loading