Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)7.0k · #13610

alkahest-developer

Skill này làm gì

Skill này dành cho lập trình viên xây phần mềm dùng Alkahest, một giao thức escrow giữ tài sản cho đến khi các điều kiện đã thỏa thuận được đáp ứng. Nó trình bày các lựa chọn SDK và mẫu thiết lập cho từng ngôn ngữ.

Khi nào nên dùng

  • ✓Khi bạn đang thêm escrow Alkahest vào một ứng dụng web hoặc backend.
  • ✓Khi bạn viết một bot tạo escrow hoặc hoàn tất điều kiện của chúng.
  • ✓Khi bạn cần xây dựng arbiter hoặc contract nghĩa vụ tùy chỉnh cho Alkahest.

Liên kết skill

https://github.com/internet-court/internet-court-skill/blob/main/vendored/arkhai/alkahest-developer/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/internet-court/internet-court-skill/blob/main/vendored/arkhai/alkahest-developer/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn thêm escrow vào ứng dụng của mình, nên cần mã TypeScript tạo một escrow cho một công việc freelance.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent dùng các mẫu mã và bước thiết lập từ skill, chọn SDK phù hợp với ngôn ngữ của bạn. Nó kết nối một wallet client, rồi dùng các hàm SDK để tạo hoặc hoàn tất escrow.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

Câu hỏi thường gặp

Skill này hỗ trợ những ngôn ngữ nào?

TypeScript hoặc JavaScript, Rust và Python. Mỗi ngôn ngữ có một gói SDK riêng.

Mã có cần ví không?

Có. Phần thiết lập kết nối một wallet client để ký các giao dịch.

Arbiter là gì?

Arbiter là quy tắc quyết định xem các điều kiện của escrow đã được đáp ứng hay chưa.

Chi tiết

Mô tả gốc của tác giả

Help developers write code that interacts with Alkahest escrow contracts using the TypeScript, Rust, or Python SDK

repo: internet-court/internet-court-skill

Độ phổ biến

Sao GitHub
7.0k
Vị trí xếp hạng
#13610
Giấy phép
—
Cập nhật
26/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự