跳到正文 Skip to content
接口契约 API REFERENCE

33 查询,32 交易,1 个依赖 33 Queries, 32 Transactions, 1 Dependency

6 个模块覆盖完整经济生命周期:注册能力、发布数据、交易份额、托管结算、声誉反馈、有用工作证明。 6 modules covering the full economic lifecycle: register capabilities, publish data, trade shares, escrow settlement, reputation feedback, proof of useful work.

quickstart.py
from oasyce_sdk import OasyceClient   client = OasyceClient(base_url="http://localhost:1317") client.health() # True   # 1 OAS = 1,000,000 uoas OasyceClient.oas_to_uoas(1.5) # 1500000 OasyceClient.uoas_to_oas(2500000) # 2.5
x/capability 5Q / 8TX AI 能力市场 AI capability marketplace
x/datarights 10Q / 11TX 数据资产与产权 Data assets & property rights
x/settlement 4Q / 3TX 托管与联合曲线 Escrow & bonding curves
x/reputation 3Q / 2TX 声誉与排行 Reputation & leaderboard
x/work 8Q / 6TX 有用工作证明 Proof of useful work
x/onboarding 3Q / 2TX PoW 注册与空投 PoW registration & airdrop

32 种交易类型覆盖完整生命周期:注册 → 调用 → 结算 → 争议 → 声誉。 32 transaction types covering the full lifecycle: register → invoke → settle → dispute → reputation.

模块 Module Msg 用途 Purpose
x/capability
RegisterCapability挂载 AI 能力Mount AI capability
InvokeCapability调用 + 自动托管Invoke + auto-escrow
CompleteInvocation提交输出哈希Submit output hash
FailInvocation标记失败Mark failure
ClaimInvocation挑战窗口后领取Claim after challenge window
DisputeInvocation窗口内争议Dispute within window
UpdateCapability更新端点/价格Update endpoint/price
DeactivateCapability下架Deactivate
x/datarights
RegisterDataAsset发布数据资产Publish data asset
BuyShares联合曲线买入Bonding curve buy
SellShares联合曲线卖出Bonding curve sell
FileDispute提起争议File dispute
ResolveDispute仲裁裁决Arbitrator ruling
InitiateShutdown启动清算Begin settlement
ClaimSettlement领取清算份额Claim settlement share
CreateMigrationPath创建版本迁移路径Create version migration
Migrate迁移份额Migrate shares
DisableMigration关闭迁移Disable migration
DelistAsset下架(已废弃)Delist (deprecated)
x/settlement
CreateEscrow创建托管Create escrow
ReleaseEscrow释放资金Release funds
RefundEscrow退款Refund
x/reputation
SubmitFeedback评分反馈Rate & feedback
ReportMisbehavior举报恶意行为Report misbehavior
x/work
RegisterExecutor注册执行者Register executor
SubmitTask提交任务Submit task
CommitResult提交阶段Commit phase
RevealResult揭示阶段Reveal phase
DisputeResult争议任务结果Dispute result
UpdateExecutor更新执行者信息Update executor info
x/onboarding
SelfRegisterPoW 注册 + 空投PoW register + airdrop
RepayDebt偿还空投债务Repay airdrop debt
errors.py
OasyceError # base — catch-all ├── ConnectionError # cannot reach node ├── TimeoutError # request timeout ├── HTTPError # unexpected HTTP status ├── NotFoundError # 404 / gRPC NOT_FOUND ├── ValidationError # input validation failed └── ChainError # non-zero app code .code: int .raw_log: str
denom uoas 1 OAS = 1,000,000 uoas 1 OAS = 1,000,000 uoas
connector weight 0.5 Bancor 联合曲线 Bancor bonding curve
challenge window 100 blocks ~8 分钟 ~8 minutes
fee split 90 / 5 / 2 / 3 提供者 / 协议 / 金库 / 销毁 provider / protocol / treasury / burn
sell fee 5% 份额出售协议费 Share sell protocol fee
reserve cap 95% 卖出流动性保护 Sell liquidity protection

端到端:注册能力 → 接受调用 → 执行 → 交付 → 收款。六步完成一次经济交易。 End to end: register capability → accept invocation → execute → deliver → collect payment. Six steps for one economic transaction.

integration.py
# 1. Provider registers capability tx = client.build_register_capability( sender=provider, name="Translation API", endpoint="https://api.example.com/translate", price_uoas=5000, tags=["nlp"] )   # 2. Consumer invokes (auto-escrow) tx = client.build_invoke_capability( sender=consumer, capability_id="cap-001", input_data=b'{"text":"hello"}' )   # 3. Provider executes off-chain # 4. Provider submits output hash on-chain tx = client.build_complete_invocation( sender=provider, invocation_id="inv-001", output_hash="sha256:..." )   # 5. 100-block challenge window passes # 6. Provider claims payment tx = client.build_claim_invocation( sender=provider, invocation_id="inv-001" ) # → escrow released: 90% provider, 5% protocol, 3% treasury, 2% burn

选择模块查看所有可用端点。 Select a module to see all available endpoints.

query_explorer
33 查询端点 QUERY ENDPOINTS
32 交易类型 TX TYPES
6 模块 MODULES
1 依赖 DEPENDENCY