xrpl-dev

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

XRPL Development Skill

XRPL开发技能

What this Skill is for

本技能适用场景

Use this Skill when the user asks for:
  • XRPL dApp development (any language/framework)
  • Scaffolding a new XRPL project
  • Frontend wallet connection (Crossmark, Xaman, GemWallet)
  • Account creation, funding, and management
  • Transaction building, signing, and submission
  • Token operations (TrustLines, issued currencies, MPTs)
  • NFT operations (XLS-20 NFTokens)
  • DEX interactions (offers, order books, path finding)
  • AMM (Automated Market Maker) operations
  • Cross-chain interoperability (Axelar bridge, XRPL EVM sidechain)
  • Payment channels, escrows, and checks
  • Security review of XRPL transactions and integrations
当用户询问以下内容时使用本技能:
  • XRPL dApp开发(任意语言/框架)
  • 搭建新的XRPL项目
  • 前端钱包连接(Crossmark、Xaman、GemWallet)
  • 账户创建、充值与管理
  • 交易构建、签名与提交
  • 代币操作(TrustLines、发行货币、MPTs)
  • NFT操作(XLS-20 NFTokens)
  • DEX交互(挂单、订单簿、路径查找)
  • AMM(自动化做市商)操作
  • 跨链互操作性(Axelar桥、XRPL EVM侧链)
  • 支付通道、托管与支票
  • XRPL交易与集成的安全审查

Default stack decisions (opinionated)

默认技术栈选择(主观建议)

  1. Scaffolding: create-xrp
    • For new projects, start with
      npx create-xrp my-app
      .
    • Scaffolds a Turborepo monorepo with Next.js (React) or Nuxt (Vue).
    • Pre-configured:
      xrpl-connect
      wallet connection, network switching, Tailwind CSS, transaction UI.
    • Smart contract support is experimental — skip it by default.
  2. Client SDK: xrpl.js first (JavaScript/TypeScript)
    • Use
      xrpl
      for all new JS/TS client code.
    • For Python projects, use
      xrpl-py
      .
    • For Java/Kotlin, use
      xrpl4j
      .
  3. Frontend: xrpl-connect first
    • Use
      xrpl-connect
      for all wallet connection and signing UX.
    • Framework-agnostic web component (
      <xrpl-wallet-connector>
      ), works with React, Vue, Next.js, Nuxt, vanilla JS.
    • Built-in adapters for Xaman, Crossmark, GemWallet, WalletConnect, and Ledger.
    • Event-driven
      WalletManager
      handles connection state, session persistence, and auto-reconnect.
  4. Network: testnet for development
    • Always default to testnet (
      wss://s.altnet.rippletest.net:51233
      ).
    • Use devnet for experimental/amendment features.
    • Never hardcode mainnet endpoints in development code.
  5. Transaction signing: local or wallet-delegated
    • For backend/scripts: sign locally, never send secrets over the network.
    • For frontend: delegate signing to the connected wallet.
    • For production backends: prefer custodial signing services or hardware wallets.
  6. Account management: reserves-aware
    • Always check and communicate reserve requirements before operations.
    • Base reserve (currently 10 XRP) + owner reserve (2 XRP per owned object).
    • Warn users when operations will lock up reserves.
  7. Error handling: explicit
    • Always check
      validated
      status, not just submission
      tesSUCCESS
      .
    • Handle
      tec*
      codes (claimed-but-failed) differently from
      tef*
      /
      tem*
      codes.
    • Implement retry logic for
      terQUEUED
      and
      tefPAST_SEQ
      .
  1. 脚手架:create-xrp
    • 新项目请从
      npx create-xrp my-app
      开始。
    • 搭建包含Next.js(React)或Nuxt(Vue)的Turborepo monorepo项目。
    • 预配置:
      xrpl-connect
      钱包连接、网络切换、Tailwind CSS、交易UI。
    • 智能合约支持目前为实验性功能——默认跳过。
  2. 客户端SDK:优先使用xrpl.js(JavaScript/TypeScript)
    • 所有新的JS/TS客户端代码均使用
      xrpl
    • Python项目使用
      xrpl-py
    • Java/Kotlin项目使用
      xrpl4j
  3. 前端:优先使用xrpl-connect
    • 所有钱包连接与签名用户体验均使用
      xrpl-connect
    • 与框架无关的Web组件
      <xrpl-wallet-connector>
      ,兼容React、Vue、Next.js、Nuxt、原生JS。
    • 内置Xaman、Crossmark、GemWallet、WalletConnect、Ledger的适配器。
    • 事件驱动的
      WalletManager
      处理连接状态、会话持久化与自动重连。
  4. 网络:开发环境使用测试网
    • 始终默认使用测试网(
      wss://s.altnet.rippletest.net:51233
      )。
    • 实验性/修正案功能使用开发网。
    • 开发代码中切勿硬编码主网端点。
  5. 交易签名:本地签名或钱包委托签名
    • 后端/脚本场景:本地签名,切勿通过网络传输密钥。
    • 前端场景:委托已连接的钱包进行签名。
    • 生产后端场景:优先使用托管签名服务或硬件钱包。
  6. 账户管理:关注储备金要求
    • 操作前始终检查并告知用户储备金要求。
    • 基础储备金(当前为10 XRP)+ 所有者储备金(每个拥有对象2 XRP)。
    • 当操作会锁定储备金时,向用户发出警告。
  7. 错误处理:明确区分
    • 始终检查
      validated
      状态,而非仅检查提交结果
      tesSUCCESS
    • 区别处理
      tec*
      代码(已提交但失败)与
      tef*
      /
      tem*
      代码。
    • terQUEUED
      tefPAST_SEQ
      实现重试逻辑。

Operating procedure (how to execute tasks)

操作流程(任务执行方式)

1. Classify the task layer

1. 任务分层分类

  • Scaffolding — new project setup
  • Frontend/wallet layer — wallet connection, signing UX, displaying state
  • Client/scripts layer — building or sending transactions, querying ledger state
  • Token/asset layer — TrustLines, issued currencies, NFTs, MPTs
  • DEX/AMM layer — offers, order books, AMM pools, path finding
  • Interoperability layer — Axelar bridge, EVM sidechain
  • Security review — cross-cutting concern
  • 脚手架层 — 新项目搭建
  • 前端/钱包层 — 钱包连接、签名用户体验、状态展示
  • 客户端/脚本层 — 交易构建或发送、账本状态查询
  • 代币/资产层 — TrustLines、发行货币、NFT、MPTs
  • DEX/AMM层 — 挂单、订单簿、AMM池、路径查找
  • 互操作性层 — Axelar桥、EVM侧链
  • 安全审查层 — 跨领域关注点

2. Pick the right building blocks

2. 选择合适的构建模块

  • New projects:
    npx create-xrp
    to scaffold (Next.js or Nuxt)
  • Frontend:
    xrpl-connect
    (WalletManager + web component) +
    xrpl
    for state queries
  • JS/TS backend/scripts:
    xrpl
    package
  • Python projects:
    xrpl-py
  • Cross-chain: Axelar GMP via XRPL Payment memos
  • 新项目:使用
    npx create-xrp
    搭建(Next.js或Nuxt)
  • 前端:
    xrpl-connect
    (WalletManager + Web组件)+
    xrpl
    用于状态查询
  • JS/TS后端/脚本:
    xrpl
  • Python项目:
    xrpl-py
  • 跨链场景:通过XRPL支付备注使用Axelar GMP

3. Implement with XRPL-specific correctness

3. 遵循XRPL特定规范实现

Always be explicit about:
  • network (mainnet / testnet / devnet) + WebSocket endpoint
  • account reserves (base + owner reserves) and their implications
  • transaction fees (auto-filled vs explicit, fee escalation)
  • sequence numbers (auto-filled vs explicit, for multi-tx workflows)
  • LastLedgerSequence
    (always set for reliable submission)
  • flags and field requirements per transaction type
  • trust line limits and issuer relationships
  • NFT transfer fees and broker mechanics
始终明确以下内容:
  • 网络(主网/测试网/开发网)+ WebSocket端点
  • 账户储备金(基础+所有者)及其影响
  • 交易手续费(自动填充vs手动设置、手续费升级)
  • 序列号(自动填充vs手动设置,适用于多交易流程)
  • LastLedgerSequence
    (为确保可靠提交,始终设置该字段)
  • 各交易类型的标志与字段要求
  • 信任线限额与发行方关系
  • NFT转账手续费与经纪人机制

4. Add tests

4. 添加测试

  • Unit test transaction building and serialization.
  • Integration test against testnet (use faucet for funding).
  • Frontend: test wallet connection and signing flows with mocked providers.
  • 单元测试交易构建与序列化。
  • 针对测试网进行集成测试(使用水龙头获取测试资金)。
  • 前端:使用模拟提供商测试钱包连接与签名流程。

5. Deliverables expectations

5. 交付物要求

When you implement changes, provide:
  • exact files changed + diffs
  • commands to install/build/test
  • a short "risk notes" section for anything touching signing, fees, reserves, or asset transfers
实现变更时,请提供:
  • 具体修改的文件 + 差异内容
  • 安装/构建/测试命令
  • 针对涉及签名、手续费、储备金或资产转移的内容,添加简短的“风险说明”部分

Content Sources

内容来源

This skill incorporates best practices from:
本技能整合了以下来源的最佳实践:

Progressive disclosure (read when needed)

进阶内容(按需查阅)

  • Client SDK patterns (xrpl.js): client-sdk.md
  • Frontend & wallet integration: frontend.md
  • Tokens & TrustLines: tokens.md
  • NFTs (XLS-20): nfts.md
  • DEX & AMM: dex-amm.md
  • Payments, escrows & channels: payments.md
  • Cross-chain interoperability: interoperability.md
  • Security checklist: security.md
  • Resources & references: resources.md
  • A framework-agnostic wallet connection toolkit for the XRP Ledger xrpl-connect
  • 客户端SDK模式(xrpl.js):client-sdk.md
  • 前端与钱包集成:frontend.md
  • 代币与TrustLines:tokens.md
  • NFT(XLS-20):nfts.md
  • DEX与AMM:dex-amm.md
  • 支付、托管与通道:payments.md
  • 跨链互操作性:interoperability.md
  • 安全 checklist:security.md
  • 资源与参考:resources.md
  • 适用于XRPL账本的框架无关钱包连接工具包 xrpl-connect