server

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseURL = "https://li.quest"
)
View Source
const ERC20ABI = `` /* 1101-byte string literal not displayed */

ERC20 ABI for token interactions

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	ID             int          `json:"id"`
	Key            string       `json:"key"`
	Name           string       `json:"name"`
	NativeToken    Token        `json:"nativeToken"`
	NativeCurrency Token        `json:"nativeCurrency"`
	Metamask       MetamaskInfo `json:"metamask"`
}

type ChainData

type ChainData struct {
	Chains []Chain `json:"chains"`
}

Chain data structures

type MetamaskInfo

type MetamaskInfo struct {
	ChainId           string   `json:"chainId"`
	BlockExplorerUrls []string `json:"blockExplorerUrls"`
	ChainName         string   `json:"chainName"`
	RpcUrls           []string `json:"rpcUrls"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents the LiFi MCP server

func NewServer

func NewServer(version string) *Server

NewServer creates a new LiFi MCP server instance

func (*Server) GetMCPServer

func (s *Server) GetMCPServer() *mcpserver.MCPServer

GetMCPServer returns the underlying MCP server for in-process transport

func (*Server) GetWalletAddress

func (s *Server) GetWalletAddress() (string, error)

GetWalletAddress returns the Ethereum address corresponding to the loaded private key

func (*Server) LoadKeystore

func (s *Server) LoadKeystore(keystoreName, password string) error

LoadKeystore loads a keystore file for transaction signing

func (*Server) RegisterWalletTools

func (s *Server) RegisterWalletTools()

RegisterWalletTools registers wallet-related tools that require a keystore

func (*Server) ServeStdio

func (s *Server) ServeStdio() error

ServeStdio starts the server in stdio mode

type Token

type Token struct {
	Address  string `json:"address"`
	Symbol   string `json:"symbol"`
	Decimals int    `json:"decimals"`
	Name     string `json:"name"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL