← 返回
未分类 中文

XPR Network Dev

Comprehensive knowledge for XPR Network blockchain development - smart contracts, CLI, web SDK, DeFi, NFTs, and infrastructure
全面掌握 XPR Network 区块链开发技术:智能合约、CLI、Web SDK、DeFi、NFT 与基础设施
paulgnz paulgnz 来源
未分类 clawhub v2.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 258
下载
💾 0
安装
1
版本
#latest

概述

XPR Network Developer Skill

This skill provides comprehensive knowledge for developing on XPR Network, a fast, gas-free blockchain with WebAuthn wallet support.

> IMPORTANT DISCLAIMER: AI-Generated Smart Contract Code

>

> Smart contracts handle real assets and are immutable once deployed. AI-generated code, including code produced with this skill, should always be reviewed by an experienced developer before deployment to mainnet.

>

> - Test thoroughly on testnet before any mainnet deployment

> - Have code reviewed by someone familiar with XPR Network/EOSIO smart contracts

> - Audit critical contracts - consider professional security audits for contracts handling significant value

> - Understand the code - don't deploy code you don't fully understand

>

> Claude can accelerate development and help with patterns, but it does not replace proper code review, testing, and auditing practices.

XPR Network Overview

XPR Network is an EOS-based blockchain optimized for payments and identity:

FeatureDescription
----------------------
Speed0.5 second block times, 4000+ TPS
FeesZero gas fees for end users
AccountsHuman-readable names (1-12 chars, a-z, 1-5)
WalletsWebAuthn support (Face ID, fingerprint, security keys)
ContractsAssemblyScript/TypeScript with @proton/ts-contracts
StorageOn-chain tables with RAM-based pricing

Name Change: Proton → XPR Network

The blockchain was rebranded from Proton to XPR Network in 2024. You may see legacy references to "Proton" in:

  • Package names (@proton/cli, @proton/web-sdk, proton-tsc)
  • GitHub organization (XPRNetwork, formerly ProtonProtocol)
  • Documentation and code comments
  • Explorer (now explorer.xprnetwork.org, formerly protonscan.io and proton.bloks.io)

The token symbol remains XPR and all functionality is unchanged.

Chain IDs

NetworkChain ID
-------------------
Mainnet384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0
Testnet71ee83bcf52142d61019d95f9cc5427ba6a0d7ff8accd9e2088ae2abeaf3d3dd

Progressive Disclosure

Load specialized modules based on your task:

Core Development

ModuleRead WhenKey Topics
-------------------------------
smart-contracts.mdBuilding contractsTables, actions, auth, build/deploy
cli-reference.mdUsing CLI toolsNetwork, keys, deploy, queries, transfers
web-sdk.mdBuilding dAppsWallet connect, transactions, sessions, transfers
backend-patterns.mdServer-side devproton CLI keychain signing (v0.3.0+), bots, key isolation
rpc-queries.mdReading chain dataRPC, Hyperion API, Light API, pagination, token balances
testing-debugging.mdTesting contractsUnit tests, testnet, debugging, logs
accounts-permissions.mdAccount managementCreate accounts, permissions, multisig
staking-governance.mdStaking & votingXPR staking, BPs, DPoS, resource model

Token & Identity

ModuleRead WhenKey Topics
-------------------------------
token-creation.mdCreating tokensFungible tokens, issuance, vesting
webauth-identity.mdUser identityWebAuth wallets, KYC, profiles, trust
nfts-atomicassets.mdNFT developmentCollections, schemas, minting, marketplace

DeFi & Trading

ModuleRead WhenKey Topics
-------------------------------
metalx-dex.mdDEX integrationMetalX DEX API reference, order format, error codes
defi-trading.mdTrading bots/DeFiTrading bot patterns, swap pools, DeFi strategies
simpledex.mdToken launch & AMMSimpleDEX swaps, bonding curves, token creation, graduation
loan-protocol.mdLending protocolLOAN protocol, supply, borrow, liquidations
oracles-randomness.mdPrice feeds & RNGOracle prices, verifiable random numbers

Integration Patterns

ModuleRead WhenKey Topics
-------------------------------
real-time-events.mdLive updatesHyperion streaming, WebSockets, notifications
payment-patterns.mdCommerce/paymentsPayment links, invoicing, POS, subscriptions

Infrastructure

ModuleRead WhenKey Topics
-------------------------------
node-operation.mdRunning nodesAPI nodes, Block Producers, validators

Safety & Reference

ModuleRead WhenKey Topics
-------------------------------
safety-guidelines.mdBEFORE modifying contractsTable rules, deployment safety, recovery
troubleshooting.mdDebugging errorsCommon errors, solutions, diagnostics
examples.mdLearning patternsPriceBattle, ProtonWall, ProtonRating
resources.mdFinding endpointsRPC URLs, docs, explorers, community

CRITICAL: Before Modifying Contracts

Read: safety-guidelines.md

  • NEVER modify existing table structures with data
  • Pre-deployment checklist
  • Recovery procedures

Quick Reference

Common CLI Commands

# Install CLI
npm i -g @proton/cli

# Set network
proton chain:set proton          # Mainnet
proton chain:set proton-test     # Testnet

# Account info
proton account myaccount -t      # With token balances

# Query table
proton table CONTRACT TABLE

# Execute action
proton action CONTRACT ACTION 'JSON_DATA' AUTHORIZATION

# Deploy contract
proton contract:set ACCOUNT ./assembly/target

Common RPC Query

import { JsonRpc } from '@proton/js';
const rpc = new JsonRpc('https://proton.eosusa.io');

const { rows } = await rpc.get_table_rows({
  code: 'CONTRACT',
  scope: 'CONTRACT',
  table: 'TABLE',
  limit: 100
});

Basic Contract Structure

import { Contract, Table, TableStore, Name, requireAuth } from 'proton-tsc';

@table("mydata")
class MyData extends Table {
  constructor(
    public id: u64 = 0,
    public owner: Name = new Name(),
    public value: string = ""
  ) { super(); }

  @primary
  get primary(): u64 { return this.id; }
}

@contract
class MyContract extends Contract {
  dataTable: TableStore<MyData> = new TableStore<MyData>(this.receiver);

  @action("store")
  store(owner: Name, value: string): void {
    requireAuth(owner);
    const row = new MyData(this.dataTable.availablePrimaryKey, owner, value);
    this.dataTable.store(row, this.receiver);
  }
}

Basic Frontend Login

import '@proton/link';  // Required for mobile wallet support
import ProtonWebSDK from '@proton/web-sdk';

const { link, session } = await ProtonWebSDK({
  linkOptions: {
    chainId: '384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0',
    endpoints: ['https://proton.eosusa.io']
  },
  selectorOptions: { appName: 'My App' }
});

// session.auth contains { actor, permission }
// Use session.transact() for transactions

Key Packages

PackagePurposeInstall
---------------------------
@proton/cliCommand-line toolsnpm i -g @proton/cli
proton-tscContract developmentnpm i proton-tsc
@proton/web-sdkFrontend wallet integrationnpm i @proton/web-sdk
@proton/linkMobile wallet transport (required with web-sdk)npm i @proton/link
@proton/jsRPC queriesnpm i @proton/js

Official Resources

  • Documentation: https://docs.xprnetwork.org
  • GitHub: https://github.com/XPRNetwork
  • Block Explorer: https://explorer.xprnetwork.org
  • Resources Portal: https://resources.xprnetwork.org (buy RAM, etc.)

Safety Reminders

  1. NEVER modify existing table structures once deployed with data - this breaks deserialization
  2. Always test on testnet before mainnet deployment
  3. Verify the target account before deploying - wrong account = overwrite existing contract
  4. Back up ABIs before deploying changes
  5. Use new tables for new features instead of modifying existing ones
  6. DEX deposits MUST use empty memo ("") — any other memo (e.g. "deposit") causes permanent, irrecoverable fund loss. See metalx-dex.md.
  7. All-numeric account names (e.g. 333555) cause silent data loss in get_table_rows — see rpc-queries.md for workarounds.

版本历史

共 1 个版本

  • v2.0.0 当前
    2026-05-20 05:48 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 197 📥 68,141
data-analysis

XPR Web Scraping

paulgnz
用于从单个或多个网页获取并提取清洗文本、元数据和链接的工具,支持格式选项与链接过滤。
★ 0 📥 2,631
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 683 📥 330,619