← 返回 Skills 市场
217
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install alkahest-developer
功能描述
Help developers write code that interacts with Alkahest escrow contracts using the TypeScript, Rust, or Python SDK
使用说明 (SKILL.md)
Alkahest Developer Skill
When to Use
Use this skill when a developer wants to write code that interacts with Alkahest escrow contracts. This covers:
- Integrating Alkahest into an application
- Writing bots/agents that create escrows, fulfill obligations, or arbitrate
- Building custom arbiters or obligation contracts
- Understanding SDK patterns and APIs
SDK Overview
| SDK | Language | Package | Foundation |
|---|---|---|---|
| TypeScript | TypeScript/JavaScript | @alkahest/ts-sdk |
viem |
| Rust | Rust | alkahest-rs |
alloy |
| Python | Python | alkahest-py |
PyO3 wrapper around Rust SDK |
Client Setup
TypeScript
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { baseSepolia } from "viem/chains";
import { makeClient } from "@alkahest/ts-sdk";
const walletClient = createWalletClient({
account: privateKeyToAccount("0xPRIVATE_KEY"),
chain: baseSepolia,
transport: http("https://rpc-url"),
});
// Full client with all extensions
const client = makeClient(walletClient);
// Custom addresses (optional)
const client = makeClient(walletClient, customAddresses);
// Minimal client for custom extension patterns
const minimal = makeMinimalClient(walletClient);
const extended = minimal.extend((base) => ({
custom: makeErc20Client(base.viemClient, pickErc20Addresses(base.contractAddresses)),
}));
Rust
use alkahest_rs::AlkahestClient;
// Full client with all extensions (Base Sepolia default)
let client = AlkahestClient::with_base_extensions(
"0xPRIVATE_KEY",
"https://rpc-url",
None, // uses Base Sepolia addresses
).await?;
// Custom addresses
use alkahest_rs::{DefaultExtensionConfig, ETHEREUM_SEPOLIA_ADDRESSES};
let client = AlkahestClient::with_base_extensions(
"0xPRIVATE_KEY",
"https://rpc-url",
Some(ETHEREUM_SEPOLIA_ADDRESSES),
).await?;
// Bare client + custom extensions
let bare = AlkahestClient::new("0xPRIVATE_KEY", "https://rpc-url").await?;
let extended = bare.extend::\x3CErc20Module>(Some(erc20_config)).await?;
Python
from alkahest_py import PyAlkahestClient
# Full client with all extensions (Base Sepolia default)
client = PyAlkahestClient("0xPRIVATE_KEY", "https://rpc-url")
# Custom addresses
from alkahest_py import DefaultExtensionConfig, PyErc20Addresses, ...
config = DefaultExtensionConfig(erc20_addresses=..., ...)
client = PyAlkahestClient("0xPRIVATE_KEY", "https://rpc-url", config)
Core Patterns
Creating an Escrow
TypeScript:
// 1. Approve token
await client.erc20.util.approve({ address: TOKEN, value: amount }, "escrow");
// 2. Create escrow
const { hash, attested } = await client.erc20.escrow.nonTierable.doObligation(
client.erc20.escrow.nonTierable.encodeObligationRaw({
token: TOKEN, amount, arbiter: ARBITER, demand: DEMAND_BYTES,
}),
);
const escrowUid = attested.uid;
Rust:
// 1. Approve
client.erc20().approve(&Erc20Data { address: token, value: amount }, ApprovalPurpose::Escrow).await?;
// 2. Create escrow
let receipt = client.erc20().escrow().non_tierable().make_statement(
token, amount, arbiter, demand_bytes, expiration,
).await?;
let attested = client.get_attested_event(receipt)?;
Python:
# 1. Approve
await client.erc20.util.approve(token_address, amount, "escrow")
# 2. Create escrow
uid = await client.erc20.escrow.non_tierable.create(
token=token_address, amount=amount,
arbiter=arbiter_address, demand=demand_bytes,
expiration=expiration,
)
Fulfilling with StringObligation
TypeScript:
const { attested } = await client.stringObligation.doObligation(
"fulfillment content",
undefined, // schema
escrowUid, // refUID
);
Rust:
let receipt = client.string_obligation().do_obligation(
"fulfillment content", None, Some(escrow_uid),
).await?;
Python:
uid = await client.string_obligation.do_obligation(
"fulfillment content",
ref_uid=escrow_uid,
)
Collecting Escrow
TypeScript:
const { hash } = await client.erc20.escrow.nonTierable.collectObligation(
escrowUid,
fulfillmentUid,
);
Rust:
let receipt = client.erc20().escrow().non_tierable().collect_payment(
escrow_uid, fulfillment_uid,
).await?;
Python:
tx_hash = await client.erc20.escrow.non_tierable.collect(escrow_uid, fulfillment_uid)
Waiting for Fulfillment
TypeScript:
const result = await client.waitForFulfillment(
client.contractAddresses.erc20EscrowObligation,
escrowUid,
);
Rust:
let log = client.wait_for_fulfillment(
client.erc20_address(Erc20Contract::EscrowObligation),
escrow_uid,
None, // from_block
).await?;
Python:
result = await client.wait_for_fulfillment(
escrow_contract_address,
escrow_uid,
)
Encoding Demands
TypeScript:
// Trusted oracle
const demand = client.arbiters.general.trustedOracle.encodeDemand({
oracle: ORACLE, data: "0x",
});
// Logical composition
const demand = client.arbiters.logical.all.encodeDemand({
arbiters: [ARBITER_A, ARBITER_B],
demands: [DEMAND_A, DEMAND_B],
});
// Attestation properties
const demand = client.arbiters.attestationProperties.attester.encodeDemand({
attester: REQUIRED_ATTESTER,
});
Rust:
// Trusted oracle (ABI encoding)
use alloy::sol_types::SolValue;
let demand = TrustedOracleArbiter::DemandData { oracle, data: Bytes::new() }.abi_encode();
// Decode arbiter demand (auto-detects)
let decoded = client.arbiters().decode_arbiter_demand(arbiter_addr, &demand_bytes)?;
Python:
# Trusted oracle
demand = client.arbiters.trusted_oracle.encode_demand(oracle=ORACLE, data=b"")
# Logical composition
demand = client.arbiters.logical.all.encode(
arbiters=[ARBITER_A, ARBITER_B],
demands=[DEMAND_A, DEMAND_B],
)
Commit-Reveal Pattern
TypeScript:
// 1. Compute commitment
const commitment = await client.commitReveal.computeCommitment(
escrowUid, claimerAddress, { payload, salt, schema },
);
// 2. Commit (sends bond as ETH)
await client.commitReveal.commit(commitment);
// 3. Wait 1+ blocks, then reveal
const { attested } = await client.commitReveal.doObligation(
{ payload, salt, schema }, escrowUid,
);
// 4. Reclaim bond
await client.commitReveal.reclaimBond(attested.uid);
Rust:
let commitment = client.commit_reveal().compute_commitment(
escrow_uid, claimer, &obligation_data,
).await?;
client.commit_reveal().commit(commitment).await?;
// wait 1+ blocks
let receipt = client.commit_reveal().do_obligation(&obligation_data, Some(escrow_uid)).await?;
client.commit_reveal().reclaim_bond(obligation_uid).await?;
Python:
commitment = await client.commit_reveal.compute_commitment(
escrow_uid, claimer, payload, salt, schema,
)
await client.commit_reveal.commit(commitment)
# wait 1+ blocks
uid = await client.commit_reveal.do_obligation(payload, salt, schema, ref_uid=escrow_uid)
await client.commit_reveal.reclaim_bond(uid)
Barter Utilities
Barter utils provide atomic single-transaction token swaps:
TypeScript:
await client.erc20.barter.buyErc20ForErc20(
{ address: BID_TOKEN, value: bidAmount },
{ address: ASK_TOKEN, value: askAmount },
BigInt(Math.floor(Date.now() / 1000) + 3600),
);
Rust:
client.erc20().barter().buy_erc20_for_erc20(
&bid_token, &ask_token, expiration,
).await?;
Key Type Differences
| Concept | TypeScript | Rust | Python |
|---|---|---|---|
| Addresses | `0x${string}` |
Address |
str (hex) |
| Big integers | bigint |
U256 |
str (decimal) |
| Bytes | `0x${string}` |
Bytes / FixedBytes\x3C32> |
bytes / str (hex) |
| Receipts | { hash, attested } |
TransactionReceipt |
str (tx hash or uid) |
| Attestations | Attestation object |
IEAS::Attestation |
PyAttestation |
Reference Documentation
references/typescript-api.md— full TS SDK API treereferences/rust-api.md— full Rust SDK API treereferences/python-api.md— full Python SDK API treereferences/contracts.md— contract addresses and data schemasdocs/Escrow Flow (pt 1).md— token trading walkthroughdocs/Escrow Flow (pt 2).md— oracle arbitration walkthroughdocs/Escrow Flow (pt 2b).md— commit-reveal frontrunning protectiondocs/Escrow Flow (pt 3).md— composing demands with logical arbitersdocs/Writing Arbiters/— custom arbiter developmentdocs/Writing Contracts/— custom escrow/obligation developmentdocs/mcp-server/— MCP server for looking up contract details
安全使用建议
This skill is documentation for using the Alkahest SDKs and appears internally consistent. Before using it: (1) do not paste real private keys into example code — use environment variables or a secure key store; (2) verify the SDK package names and their sources (e.g., @alkahest/ts-sdk, alkahest-rs, alkahest-py) on the official package registries or project repo before installing; (3) validate any RPC endpoint you supply and avoid unknown or untrusted RPC providers; (4) double-check the contract addresses and chain you intend to use (testnet vs mainnet) to avoid sending real assets by mistake. If you want the skill to perform real operations, request additional metadata (origin/homepage, repository) to verify the publisher.
功能分析
Type: OpenClaw Skill
Name: alkahest-developer
Version: 1.0.0
The skill bundle is a comprehensive documentation and reference set for the Alkahest escrow protocol SDKs (TypeScript, Rust, and Python). It contains legitimate API references, contract addresses for multiple blockchain networks (Base, Ethereum, Filecoin), and standard code snippets for web3 development. No evidence of malicious intent, data exfiltration, or prompt injection was found across the SKILL.md or reference files.
能力评估
Purpose & Capability
Name/description (help devs write code for Alkahest escrow contracts) matches the content: language-specific examples and API references for TypeScript, Rust, and Python. There are no unrelated environment variables, binaries, or installs requested.
Instruction Scope
SKILL.md is documentation and example code only. Examples show creating clients, making transactions, and using RPC URLs and private keys (placeholders like "0xPRIVATE_KEY"). The skill does not instruct the agent to read local files, exfiltrate data, or contact unknown endpoints, but the examples encourage embedding private keys directly in code which is unsafe practice for users.
Install Mechanism
No install spec and no code files to execute — lowest-risk instruction-only skill. Nothing will be downloaded or written to disk by an installer.
Credentials
The skill declares no required env vars or secrets (proportional). However examples use inline private-key placeholders and arbitrary RPC URLs; users should not paste real private keys in source and should use appropriate secret management when following these examples.
Persistence & Privilege
Skill is not always-enabled and uses default invocation policies. It does not request persistent system privileges or modify other skills or system configs.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install alkahest-developer - 安装完成后,直接呼叫该 Skill 的名称或使用
/alkahest-developer触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Alkahest Developer Skill 1.0.0 – Initial Release
- Introduces documentation and patterns for integrating with Alkahest escrow smart contracts using TypeScript, Rust, and Python SDKs.
- Provides client setup guides for each supported language, with code samples for full, custom, and minimal clients.
- Demonstrates core escrow workflows: approving tokens, creating escrows, fulfilling obligations, collecting payments, and waiting for fulfillment.
- Details advanced patterns including encoding arbiter demands, commit-reveal flows, and barter utilities for atomic token swaps.
- Includes a summary of key type differences between SDKs for addresses and big integers.
元数据
常见问题
Alkahest Developer 是什么?
Help developers write code that interacts with Alkahest escrow contracts using the TypeScript, Rust, or Python SDK. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 217 次。
如何安装 Alkahest Developer?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install alkahest-developer」即可一键安装,无需额外配置。
Alkahest Developer 是免费的吗?
是的,Alkahest Developer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Alkahest Developer 支持哪些平台?
Alkahest Developer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Alkahest Developer?
由 疒奀(@mlegls)开发并维护,当前版本 v1.0.0。
推荐 Skills