MyShell
  • About MyShell
    • What is MyShell
    • MyShell in a Nutshell
    • Quickstart
  • Explore AI Agents
    • Image Generation
    • Video Generation
    • Meme Generation
    • Role-Playing Game
    • Character
    • Utility
  • Create AI Agents
    • Classic Mode
      • Enhanced Prompt
      • Knowledge Base
      • Telegram Integration
    • Pro Config Mode
      • Core Concepts
      • Tutorial
        • Tutorial Structure
        • Hello World with Pro Config
        • Building Workflow
        • Transitions
        • Expressions and Variables
        • Integration with Any Widget
        • An Advanced Example
      • Basic
        • Common
        • Atomic State
        • Transition
        • Automata
        • Modules
      • Advanced
        • Cron Pusher
        • Neutral Language To SD Prompt
        • Advanced Input Validation
        • Advanced Memory Manager in Prompt Widget
      • Tools
        • AutoConfig Agent
        • Cache Mode
        • Knowledge Base Agent
        • Crawler Widget
      • Example
        • Homeless With You
        • Random Routing
        • Function Calling
      • API Reference
        • Atomic State
        • Transition
        • Automata
        • Context
        • Module
          • AnyWidget Module
            • Prompt Widget
            • LLM Widget
            • TTS Widget
            • Code Runner Widget
            • Melo TTS
            • Age Transformation
            • ChatImg
            • GIF Generation
            • Music Generation
          • LLM Module
          • LLM Function Module
          • TTS Module
          • Google Search Module
        • Widgets
          • Bark TTS
          • Champ
          • CoinGecko
          • ControlNet with Civitai
          • Crawler
          • Crypto News
          • Data Visualizer
          • Email Sender
          • Google Flight Search
          • Google Hotel Search
          • Google Image Search
          • Google Map Search
          • Google News Search
          • Google Scholar Search
          • Google Search
          • GroundedSAM
          • Image Text Fuser
          • Information Extractor - OpenAI Schema Generator
          • Information Extractor
          • Instagram Search
          • JSON to Table
          • LinkedIn
          • MS Word to Markdown
          • Markdown to MS Word
          • Markdown to PDF
          • Mindmap Generator
          • Notion Database
          • OCR
          • Pdf to Markdown
          • RMBG
          • Stabel-Video-Diffusion
          • Stable Diffusion Inpaint
          • Stable Diffusion Recommend
          • Stable Diffusion Transform
          • Stable Diffusion Upscale
          • Stable Diffusion with 6 fixed category
          • Stable Diffusion with Civitai
          • Storydiffusion
          • Suno Lyrics Generator
          • Suno Music Generator
          • Table to Markdown
          • TripAdvisor
          • Twitter Search
          • UDOP: Document Question Answering
          • Weather forecasting
          • Whisper large-v3
          • Wikipedia
          • Wolfram Alpha Search
          • Yelp Search
          • YouTube Downloader
          • YouTube Transcriber
          • Youtube Search
      • FAQs
      • Changelog
    • ShellAgent Mode
      • Download and Installation
      • App Builder
      • Workflow
      • Build Custom Widget
      • Publish to MyShell
      • Customized Pricing For Your Agent
      • Example
        • Child Book X Agent w/ DeepSeek
        • Kids Book NFT AI Agent w/ BNB Chain
        • DeFAI Agent w/ BNB Chain
  • Shell Launchpad
    • How to Launch a Token
    • Trade Agent Tokens
  • Tokenomics
    • $SHELL Basics
    • $SHELL Token Utility
    • How to Obtain $SHELL
    • Roadmap
  • Open-source AI Framework/SDK
    • ShellAgent
    • OpenVoice
    • MeloTTS
    • JetMoE
    • AIlice
  • Links
Powered by GitBook
On this page
  • Introduction
  • How to Import a Template?
  • ShellAgent Local Upload
  • ShellAgent Cloud Selection
  • Setting up the Greeting Message
  • Transfer Function
  • Swap Token
  • Approve Token
  • Swap
  • Deploy Token on BSC
  • Deploy Form
  • Deploy BEP20
  • How to test your Agent?
  • Final Thoughts
  1. Create AI Agents
  2. ShellAgent Mode
  3. Example

DeFAI Agent w/ BNB Chain

Unlocking ShellAgent’s DeFAI Features in Crypto

PreviousKids Book NFT AI Agent w/ BNB ChainNextShell Launchpad

Last updated 3 months ago

Introduction

ShellAgent already provides a robust suite of multi-modal development tools, making AI agent creation more powerful and accessible than ever. But for many creators, the missing piece has been DeFAI integration, from token transfers and swaps to seamless token deployments.

If you’ve been waiting for this, good news! MyShell has now introduced blockchain functionality to ShellAgent, unlocking a new realm of possibilities for AI agents.

This document will walk you through the process, ensuring you can seamlessly build and launch on-chain AI agents. Let’s get started!

How to Import a Template?

You can choose either ShellAgent local upload or ShellAgent cloud selection.

ShellAgent Local Upload

Go to https://app.myshell.ai/robot-workshop/create and select ShellAgent Mode

If you’ve already created an agent in ShellAgent Cloud, click “Cloud” and select your agent.

If you haven’t created any agents in Cloud yet, you can import a JSON file in Local Mode instead.

Right-click on the above .json link and select "Save link as..." to download the .json file.

ShellAgent Cloud Selection

1

Create an agent from templates

2

Choose the template

Choose the template of DeFAI Agent.

3

Save your configuration

Click the Save button on the top right corner of the interface

Setting up the Greeting Message

Create a greeting message here to define your agent’s personality and clearly communicate its purpose to users.

👋 Hello there! I'm your BSC agent. 💼

I'm here to help you navigate the blockchain safely and efficiently! 

🛡️ Without my help, you may accidentally authorize phishing contracts, so I'm here to assist with secure transactions. 🎣

Ready to get started? Here are your options:
🔄 To transfer assets, tap "Transfer Token"
💱 To swap assets, hit "Swap Tokens"
🚀 To deploy tokens in one click, select "Deploy Token"

⚠️ Swap Tokens Protection: we offer only a select group of popular tokens to minimize slippage issues in illiquid pairs. If you observe significant price drops during swapping, please cancel the transaction immediately!

⚠️ Swap Tokens Protection: Only WBNB pools are supported. Make sure either the base token or the quote token is WBNB.

Transfer Function

The Transfer workflow is structured into three key states, managing your agent’s transfer functionality. The default settings are optimized to work seamlessly without the need for modifications.

Transfer Form

When users initiate the “Transfer Token” workflow, they can define the token type, transfer amount, and recipient address. These details are then passed to the next state for processing.

Token Info

Once the Transfer Form input is received, the system queries the Wallet Asset Explorer widget and utilizes LLM to generate the transfer details.

Transfer BNB / Transfer ERC-20

Once the information is displayed, the process advances to its final state.

The transition is smooth and intuitive, allowing users to review the recipient address and details before proceeding.

When users click the “Transfer” button, a wallet popup will appear, prompting them to sign the transaction.

Swap Token

The Swap token workflow has three states designed to guide users through the token swapping process.

Swap form:

⚠️ Swap Tokens Protection: To minimize slippage in illiquid pairs, only a curated selection of popular tokens is available.

⚠️ Only WBNB pools are supported. Make sure either the base token or the quote token is WBNB.

The Swap function is a predefined feature, not a widget. Do not modify the token options in the list or the token variables in the output, as this will cause errors.

Once the “Swap Token” workflow is triggered, users can enter the swap amount (how much base token to pay) and select the From/To tokens using the dropdown menu.

Approve Token

Before placing a swap order, users must grant approval for the PancakeSwap v3 contract to access their tokens.

Clicking the "Approve" button in this state triggers an authorization popup.

Clicking "Skip" automatically advances to the next state.

Swap

In this state, users can review and confirm their trading pair. Clicking “Swap” will trigger the wallet plugin to process the transaction.

Deploy Token on BSC

The process consists of two main states, making it simple and easy to follow.

Deploy Form

When users start the “Deploy Token” workflow, they only need to enter their desired token name and symbol to get started.

Deploy BEP20

The deployment process is powered by the “Contract Call Encoder” widget.

Once users confirm the format and options, clicking “Deploy” will trigger a wallet popup to finalize the process.

How to test your Agent?

Once you’ve made your modifications, simply hit “Run” in the top-left corner to see your agent in action!

Final Thoughts

For years, crypto and DeFi applications have struggled with complex user experiences, limiting accessibility for many users. But with the rise of AI agents, those barriers are starting to break down. Now, with more crypto features on ShellAgent, AI x DeFi isn’t just a concept—it’s something you can build today.

Whether you’re creating a DeFi-powered AI assistant, an automated trading bot, or an on-chain agent, ShellAgent equips you with the tools to make it happen.

While MyShell has already seen innovative AI agents in image & video generation and companion AI, the real breakthroughs are just beginning. With more powerful, versatile, and intelligent AI agents, the next wave of AI innovation is here.

Start building, experiment with crypto integrations, and take your AI agent to the next level with MyShell!

67KB
DeFAI Agent.json