Skip to content

Latest commit

ย 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DevLens Stellar ๐Ÿ”

A developer intelligence layer for Stellar โ€” simulate before you submit, debug when things fail, verify before you trust.

License: MIT Node.js Stellar PRs Welcome

DevLens Stellar fills a critical gap in the Stellar developer ecosystem: there is no single tool that helps developers confidently build on Stellar by predicting outcomes before submission, explaining failures in plain English, and verifying the trustworthiness of accounts and assets.


๐Ÿ” The Problem

Every Stellar developer hits these walls:

  • "Why did my transaction fail?" โ€” Horizon returns cryptic XDR error codes with no explanation
  • "Will this transaction succeed?" โ€” No way to know without actually submitting it
  • "Can I trust this account or asset?" โ€” No quick verification tool exists

DevLens Stellar solves all three.


โœจ Three Modules

๐Ÿ”ฎ Simulate

Predict what will happen before you spend a fee submitting to the network.

  • Simulate full transaction XDRs
  • Simulate simple payment outcomes
  • Get smart fee recommendations based on live network conditions

๐Ÿ› Debug

When something goes wrong, understand exactly why โ€” in plain English.

  • Debug failed transactions by hash
  • Decode raw result XDRs
  • Look up any Stellar error code instantly
  • Decode transaction envelope XDRs into readable JSON

โœ… Verify

Before you interact with an unknown account or asset, know if you can trust it.

  • Account trust score (home domain, stellar.toml, age, flags)
  • Asset verification (issuer identity, toml listing, authorization flags)
  • Transaction pre-flight checks before submission

๐Ÿš€ Getting Started

Prerequisites

  • Node.js >= 18
  • npm >= 9

Installation

git clone https://github.com/stellarkit-lab-devtools/devlens-stellar.git
cd devlens-stellar
npm install
cp .env.example .env
npm run dev

๐Ÿ“ก API Endpoints

Simulate

Method Endpoint Description
POST /simulate/transaction Simulate a full transaction XDR
POST /simulate/payment Simulate a simple payment
GET /simulate/fee-estimate Get recommended fee tiers

Debug

Method Endpoint Description
POST /debug/transaction Debug a failed transaction by hash
POST /debug/xdr Decode a result XDR
POST /debug/error-code Look up a single error code
GET /debug/error-codes List all known error codes
POST /debug/decode-envelope Decode a transaction envelope XDR

Verify

Method Endpoint Description
GET /verify/account/:id Verify account trust score
GET /verify/asset/:code/:issuer Verify asset legitimacy
POST /verify/transaction Pre-flight check a transaction

๐Ÿ“ Usage Examples

Debug a Failed Transaction

curl -X POST http://localhost:3000/debug/transaction \
  -H "Content-Type: application/json" \
  -d '{ "hash": "abc123...64chars" }'

Response:

{
  "success": true,
  "data": {
    "status": "failed",
    "diagnosis": {
      "transaction": {
        "code": "tx_bad_seq",
        "message": "The transaction sequence number is incorrect.",
        "fix": "Fetch the account current sequence number and use it + 1."
      }
    }
  }
}

Verify an Account

curl http://localhost:3000/verify/account/GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN

Response:

{
  "success": true,
  "data": {
    "trustScore": "high",
    "summary": "This account has a high trust score based on 5/5 checks passed.",
    "checks": [...]
  }
}

Simulate a Payment

curl -X POST http://localhost:3000/simulate/payment \
  -H "Content-Type: application/json" \
  -d '{
    "senderAccount": "GAAZI4...",
    "destinationAccount": "GBVFTZ...",
    "amount": "100",
    "assetCode": "XLM"
  }'

๐Ÿงช Running Tests

npm test

๐Ÿค Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a PR.


๐Ÿ“ Project Structure

devlens-stellar/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ””โ”€โ”€ stellar.js          # Stellar SDK + Horizon setup
โ”‚   โ”œโ”€โ”€ middleware/
โ”‚   โ”‚   โ””โ”€โ”€ errorHandler.js     # Centralised error handling
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ simulate.js         # Simulate module endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ debug.js            # Debug module endpoints
โ”‚   โ”‚   โ””โ”€โ”€ verify.js           # Verify module endpoints
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ”œโ”€โ”€ errorDecoder.js     # Stellar error code translator
โ”‚   โ”‚   โ””โ”€โ”€ validators.js       # Input validation helpers
โ”‚   โ””โ”€โ”€ index.js                # App entry point
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ api.test.js
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

๐ŸŒ Stellar Resources


๐Ÿ“„ License

MIT

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages