Skip to main content

Cài đặt

Yêu cầu: Python 3.9+

Khởi tạo Client

SDK Python hoàn toàn async. Tất cả phương thức trả về coroutine và cần được await.

Tác nhân

aw.agents.create()

Tạo tác nhân mới với ví MPC được bảo mật.

aw.agents.get(agent_id)

aw.agents.list()

aw.agents.freeze(agent_id) / aw.agents.unfreeze(agent_id)

Thanh toán

aw.payments.send()

Gửi thanh toán on-chain trực tiếp.

aw.payments.get(transaction_id)

aw.payments.list()

Thanh toán nhỏ x402

aw.x402.create_session()

aw.x402.check()

aw.x402.pay()

aw.x402.session_pay(session_id, target_url)

aw.x402.http_interceptor()

Tạo bộ chặn tự động xử lý thách thức x402 v2:

Chính sách

aw.policies.update()

aw.policies.get(agent_id)

aw.policies.apply_template()

Webhook

aw.webhooks.create()

Xử lý Lỗi

Type Hints

SDK Python bao gồm type hints đầy đủ cho hỗ trợ IDE và phân tích tĩnh:

Sử dụng với asyncio

SDK là async-first. Sử dụng trong ngữ cảnh async: