接口契约 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.
连接 CONNECTION
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
6 模块 6 MODULES
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
交易类型参考 TRANSACTION TYPES
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 | ||
| SelfRegister | PoW 注册 + 空投PoW register + airdrop | |
| RepayDebt | 偿还空投债务Repay airdrop debt | |
错误层级 ERROR HIERARCHY
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
关键常量 KEY CONSTANTS
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
集成模式 INTEGRATION PATTERN
端到端:注册能力 → 接受调用 → 执行 → 交付 → 收款。六步完成一次经济交易。 End to end: register capability → accept invocation → execute → deliver → collect payment. Six steps for one economic transaction.
# 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
查询探索器 QUERY EXPLORER
选择模块查看所有可用端点。 Select a module to see all available endpoints.
33 查询端点 QUERY ENDPOINTS
32 交易类型 TX TYPES
6 模块 MODULES
1 依赖 DEPENDENCY