alkahest-developer
できること
このスキルは、エスクロー(条件が満たされるまで資産を預かる仕組み)のプロトコルであるAlkahestを使うソフトウェアを作る開発者向けです。SDKの選択肢と、各言語のセットアップの方法を示します。
使う場面
- ✓Webアプリやバックエンドに、Alkahestのエスクローを追加しているとき。
- ✓エスクローを作ったり、その条件を満たしたりするボットを書いているとき。
- ✓Alkahestのためにカスタムのアービターや義務のコントラクトを作る必要があるとき。
スキルのリンク
https://github.com/internet-court/internet-court-skill/blob/main/vendored/arkhai/alkahest-developer/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のアプリにエスクローを追加したいので、フリーランスの仕事のためのエスクローを作るTypeScriptのコードがほしいです。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、スキルのコードのパターンとセットアップの手順を使い、あなたの言語に合ったSDKを選びます。ウォレットのクライアントを接続し、SDKの関数を使ってエスクローを作成したり完了させたりします。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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::<Erc20Module>(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.default.doObligation(
client.erc20.escrow.default.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().default().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.default.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.default.collectObligation(
escrowUid,
fulfillmentUid,
);
Rust:
let receipt = client.erc20().escrow().default().collect_payment(
escrow_uid, fulfillment_uid,
).await?;
Python:
tx_hash = await client.erc20.escrow.default.collect(escrow_uid, fulfillment_uid)
Waiting for Fulfil
よくある質問
どの言語に対応していますか?
TypeScriptまたはJavaScript、Rust、Pythonです。それぞれに専用のSDKパッケージがあります。
コードにはウォレットが必要ですか?
はい。セットアップではウォレットのクライアントを接続し、それがトランザクションに署名します。
アービターとは何ですか?
エスクローの条件が満たされたかどうかを判定するルールです。
詳細
作者による元の説明
Help developers write code that interacts with Alkahest escrow contracts using the TypeScript, Rust, or Python SDK
人気
- GitHubのスター
- 7.0k
- ランキング
- #13610
- ライセンス
- —
- 更新日
- 2026/10/26
コメント
- …
このリポジトリの他のスキル
internet-court
7.0kエージェントが、他のAIエージェントや有料サービスと安全に支払い、雇用、取引できるよう支援し、適切な専門ガイドを案内します。
genlayer-erc7710-connector
7.0kエージェントが、AIによるレビューの結果を権限の仕組みにつなぎ、悪いレビューがエージェントの権限を制限または取り消せるよう支援します。
genlayer-intelligent-contracts
7.0kエージェントが、別のエージェントが委任された範囲を守ったかを判定するAIの審査役について、ルール、証拠、出力を定義できるよう支援します。
x402-erc7710
7.0kエージェントが、リクエストごとにウェブサービスの支払いを行い、許可された予算の範囲内で継続的な支出を設定できるよう支援します。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。