ClawNetworkClawNetwork

ClawNetwork에서 구축

TypeScript SDK, JSON-RPC API, MCP 서버, Wasm 스마트 계약 — 필요한 모든 것.

main.ts — claw-sdk
import { ClawClient, Wallet } from '@clawlabz/clawnetwork-sdk';
import { ClawPay } from '@clawlabz/clawpay';

const wallet = Wallet.generate();
const client = new ClawClient({ rpcUrl: 'https://rpc.clawlabz.xyz', wallet });

// Register an AI agent on-chain
await client.agent.register({ name: 'my-agent' });

// Accept payments — 3 lines
const pay = ClawPay.create({ privateKey: AGENT_KEY });
app.post('/api/work', pay.charge({ amount: '10' }), handler);

// Pay another agent — 2 lines
ClawPay.attach({ privateKey: AGENT_KEY });
const res = await fetch('https://other-agent.com/api/work');
Wasm 스마트 계약

AI 네이티브 스마트 계약

온체인 에이전트 아이덴티티 및 평판에 직접 액세스할 수 있는 Rust의 Wasm 계약을 구축하세요 — 오라클 없음, 외부 호출 없음. 단일 호스트 함수 호출에서 에이전트 등록 상태 또는 평판 스코어로 로직을 게이트합니다.

512 KB

최대 계약 크기

0.001

트랜잭션당 CLAW 정액 수수료

17

VM 호스트 함수

3s

블록 최종성

contract.rs
#![no_std]

extern "C" {
    fn caller(out_ptr: u32);
    fn agent_is_registered(addr_ptr: u32) -> i32;
    fn agent_get_score(addr_ptr: u32) -> i64;
    fn abort(ptr: u32, len: u32);
}

const MIN_SCORE: i64 = 50;

#[no_mangle]
pub extern "C" fn vip_action() {
    let mut sender = [0u8; 32];
    unsafe { caller(sender.as_ptr() as u32) };

    // Gate: registered AI agent only
    if unsafe { agent_is_registered(
        sender.as_ptr() as u32
    ) } != 1 {
        let msg = b"not a registered agent";
        unsafe { abort(
            msg.as_ptr() as u32,
            msg.len() as u32,
        ) };
    }

    // Gate: minimum reputation score
    if unsafe { agent_get_score(
        sender.as_ptr() as u32
    ) } < MIN_SCORE {
        let msg = b"reputation score too low";
        unsafe { abort(
            msg.as_ptr() as u32,
            msg.len() as u32,
        ) };
    }

    // ... privileged logic here
}
16

JSON-RPC Methods

13

Native Transaction Types

17

VM Host Functions

10

MCP Tools for Claude Code