Skip to content
Open
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ SOLANA_PRIVATE_KEY=
DISCORD_TOKEN=
XAI_API_KEY=
TOGETHER_API_KEY=
MONAD_PRIVATE_KEY=
DEBRIDGE_ACCESS_KEY=

MONAD_PRIVATE_KEY=
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,50 @@ Each plugin has its own configuration options that can be specified in the agent

### GOAT

### Blockchain Networks
- Solana
- SOL/SPL transfers and swaps via Jupiter
- Staking and balance management
- Network monitoring and token queries

- EVM Networks
- Ethereum/Base/Polygon
- ETH/ERC-20 transfers and swaps
- Kyberswap integration
- Balance and token queries
- Sonic
- Fast EVM transactions
- Custom slippage settings
- Token swaps via Sonic DEX
- Network switching (mainnet/testnet)
- DeBridge - Bridge tokens across multiple chains
- EternalAI
- Transform agents to smart contracts
- Deploy on 10+ blockchains
- Onchain system prompts
- Decentralized inference

### Social Platforms
- Twitter/X
- Post and reply to tweets
- Timeline management
- Engagement features

- Farcaster
- Cast creation and interactions
- Timeline and reply management
- Like/requote functionality

- Discord
- Channel management
- Message operations
- Reaction handling

- Echochambers
- Room messaging and context
- History tracking
- Topic management
=======
- Interact with EVM chains through a unified interface
- Manage ERC20 tokens:
- Check token balances
Expand Down
4 changes: 3 additions & 1 deletion agents/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
"name": "evm",
"network": "ethereum"
},

{
"name": "debridge"
},
{
"name": "discord",
"message_read_count": 10,
Expand Down
139 changes: 139 additions & 0 deletions src/actions/debridge_actions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import logging
from src.action_handler import register_action

logger = logging.getLogger("actions.debridge_actions")

@register_action("create-bridge-tx")
def create_bridge_tx(agent, **kwargs):
"""Create Bridge TX using Debridge"""
try:
required_args = ['connection', 'srcChainId', 'srcChainTokenIn', 'srcChainTokenInAmount', 'dstChainId', 'dstChainTokenOut', 'dstChainTokenOutRecipient']
for arg in required_args:
if arg not in kwargs:
logger.error(f"Missing required argument: {arg}")
return None

response = agent.connection_manager.connections["debridge"].create_bridge_tx(
connection=kwargs['connection'],
srcChainId=kwargs['srcChainId'],
srcChainTokenIn=kwargs['srcChainTokenIn'],
srcChainTokenInAmount=kwargs['srcChainTokenInAmount'],
dstChainId=kwargs['dstChainId'],
dstChainTokenOut=kwargs['dstChainTokenOut'],
dstChainTokenOutRecipient=kwargs['dstChainTokenOutRecipient'],
dstChainTokenOutAmount=kwargs.get('dstChainTokenOutAmount', "auto"),
dstChainOrderAuthorityAddress=kwargs.get('dstChainOrderAuthorityAddress'),
affiliateFeeRecipient=kwargs.get('affiliateFeeRecipient'),
prependOperatingExpense=kwargs.get('prependOperatingExpense', True),
affiliateFeePercent=kwargs.get('affiliateFeePercent', 0),
dlnHook=kwargs.get('dlnHook')
)
return response
except Exception as e:
logger.error(f"Failed to create bridge transaction: {str(e)}")
return None

@register_action("get-order-status")
def get_order_status(agent, **kwargs):
"""Get order status using Debridge"""
try:
response = agent.connection_manager.connections["debridge"].get_order_status(
id=kwargs.get('id'),
hash=kwargs.get('hash')
)
return response
except Exception as e:
logger.error(f"Failed to get order status: {str(e)}")
return None

@register_action("get-order-details")
def get_order_details(agent, **kwargs):
"""Get order details using Debridge"""
try:
if 'id' not in kwargs:
logger.error("Missing required argument: id")
return None

response = agent.connection_manager.connections["debridge"].get_order_details(
id=kwargs['id']
)
return response
except Exception as e:
logger.error(f"Failed to get order details: {str(e)}")
return None

@register_action("cancel-tx")
def cancel_tx(agent, **kwargs):
"""Cancel transaction using Debridge"""
try:
if 'id' not in kwargs:
logger.error("Missing required argument: id")
return None

response = agent.connection_manager.connections["debridge"].cancel_tx(
id=kwargs['id']
)
return response
except Exception as e:
logger.error(f"Failed to cancel transaction: {str(e)}")
return None

@register_action("extcall-cancel-tx")
def extcall_cancel_tx(agent, **kwargs):
"""External call to cancel transaction using Debridge"""
try:
if 'id' not in kwargs:
logger.error("Missing required argument: id")
return None

response = agent.connection_manager.connections["debridge"].extcall_cancel_tx(
id=kwargs['id']
)
return response
except Exception as e:
logger.error(f"Failed to perform external call to cancel transaction: {str(e)}")
return None

@register_action("get-supported-chains")
def get_supported_chains(agent, **kwargs):
"""Get supported chains using Debridge"""
try:
response = agent.connection_manager.connections["debridge"].get_supported_chains()
return response
except Exception as e:
logger.error(f"Failed to get supported chains: {str(e)}")
return None

@register_action("get-token-list")
def get_token_list(agent, **kwargs):
"""Get token list using Debridge"""
try:
if 'chainId' not in kwargs:
logger.error("Missing required argument: chainId")
return None

response = agent.connection_manager.connections["debridge"].get_token_list(
chainId=kwargs['chainId']
)
return response
except Exception as e:
logger.error(f"Failed to get token list: {str(e)}")
return None

@register_action("execute-bridge-tx")
def execute_bridge_tx(agent, **kwargs):
"""Execute bridge transaction using Debridge"""
try:
if 'connection' not in kwargs:
logger.error("Missing required argument: connection")
return None

response = agent.connection_manager.connections["debridge"].execute_bridge_tx(
connection=kwargs['connection'],
compute_unit_price=kwargs.get('compute_unit_price', 200_000),
compute_unit_limit=kwargs.get('compute_unit_limit')
)
return response
except Exception as e:
logger.error(f"Failed to execute bridge transaction: {str(e)}")
return None
8 changes: 7 additions & 1 deletion src/connection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from src.connections.together_connection import TogetherAIConnection
from src.connections.evm_connection import EVMConnection
from src.connections.perplexity_connection import PerplexityConnection
from src.connections.debridge_connection import DebridgeConnection
from src.connections.monad_connection import MonadConnection

logger = logging.getLogger("connection_manager")
Expand Down Expand Up @@ -74,6 +75,8 @@ def _class_name_to_type(class_name: str) -> Type[BaseConnection]:
return EVMConnection
elif class_name == "perplexity":
return PerplexityConnection
elif class_name == "debridge":
return DebridgeConnection
elif class_name == "monad":
return MonadConnection
return None
Expand All @@ -90,7 +93,10 @@ def _register_connection(self, config_dic: Dict[str, Any]) -> None:
try:
name = config_dic["name"]
connection_class = self._class_name_to_type(name)
connection = connection_class(config_dic)
if name == "debridge":
connection = DebridgeConnection(config_dic, self.connections)
else:
connection = connection_class(config_dic)
self.connections[name] = connection
except Exception as e:
logging.error(f"Failed to initialize connection {name}: {e}")
Expand Down
Loading