Skip to content

OpenClawChain/claw-strk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

claw-strk

A pragmatic Starknet (Sepolia-first) CLI for:

  • Swaps via AVNU
  • Demo lending pool flows
  • x402 paywalled HTTP requests (client-side)
  • Deploy/test demo ERC20 + ERC721 (NFT) contracts
  • A simple .claw name registry (StarknetID-like MVP for Sepolia)

This is prototype tooling for Starknet Sepolia.

Resources


Installation

Install globally from npm:

npm install -g @openclawchain/claw-strk
# or
pnpm add -g @openclawchain/claw-strk

Then run:

claw-strk --help

Configuration

The CLI loads env in this order:

  1. --env <path>
  2. ./.env
  3. ~/.claw-strk/.env

Minimum required:

STARKNET_ACCOUNT_ADDRESS=0x...
STARKNET_PRIVATE_KEY=0x...
STARKNET_RPC_URL=https://starknet-sepolia.g.alchemy.com/v2/<key>

Optional:

# x402 Server (defaults to OpenClawChain hosted server)
X402_SERVER_URL=https://stark-facilitator.openclawchain.org

Create a template:

claw-strk init

CLI Usage

A) Swap (AVNU)

Quote:

claw-strk quote --sell STRK --buy USDC --amount 1

Swap:

claw-strk swap --sell STRK --buy USDC --amount 1 --slippage 5

B) Lending

List demo pools:

claw-strk lend pools

Run the demo (deposit/borrow/repay/withdraw):

claw-strk lend demo

USDC borrow example (STRK collateral → borrow USDC):

# show pool + price
claw-strk lend pool --pool-id strk-usdc

# deposit 1 STRK as collateral
claw-strk lend deposit --pool-id strk-usdc --amount 1

# borrow a tiny amount of USDC (6 decimals)
claw-strk lend borrow --pool-id strk-usdc --amount 0.005

# repay
claw-strk lend repay --pool-id strk-usdc --amount 0.005

# withdraw collateral
claw-strk lend withdraw --pool-id strk-usdc --amount 1

C) x402 payment (paywalled HTTP)

Discover requirements (no payment):

claw-strk x402 discover \
  --url https://stark-facilitator.openclawchain.org/api/protected/chainstatus

Paywall endpoint example (discover → pay → retry):

claw-strk x402 request \
  --url https://stark-facilitator.openclawchain.org/api/protected/chainstatus \
  --network sepolia \
  --auto-approve

Notes:

  • x402 request first calls the URL normally; if the server replies 402, it reads the required payment details (accepts[0]) and retries with X-PAYMENT.
  • --auto-approve will approve exactly maxAmountRequired to the spender (one-time per amount).
  • Override spender/facilitator if needed:
claw-strk x402 request \
  --url <resource-url> \
  --facilitator <facilitator-base-url> \
  --spender <spender-address> \
  --auto-approve

D) .claw domain

Register:

claw-strk claw register --name bobio.claw --metadata '{"owner":"bobio"}' --network sepolia

Resolve:

claw-strk claw resolve --name bobio.claw --network sepolia

Get full record:

claw-strk claw get --name bobio.claw --network sepolia

E) ERC20 demo token

Create:

claw-strk token create --kind mintable --name "Mint Token" --symbol MNT --decimals 6 --initial 0

Mint (owner-only):

claw-strk token mint --token <address> --to <address> --amount 100 --decimals 6

F) NFT (ERC721)

Create collection:

claw-strk nft create --name "OpenClawMinion" --symbol "CLAW" --network sepolia

Mint:

claw-strk nft mint --contract <address> --id 1 --network sepolia

Check ownership (ERC721 balance_of):

claw-strk nft balance --contract <address>

References

Supported tokens (swap)

Starknet Sepolia bridged token addresses:

  • STRK: 0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d
  • ETH: 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7
  • USDC: 0x053b40a647cedfca6ca84f542a0fe36736031905a9639a7f19a3c1e66bfd5080
  • USDT: 0x02ab8758891e84b968ff11361789070c6b1af2df618d6d2f4a78b0757573c6eb
  • WBTC: 0x00452bd5c0512a61df7c7be8cfea5e4f893cb40e126bdc40aee6054db955129e
  • wstETH: 0x030de54c07e57818ae4a1210f2a3018a0b9521b8f8ae5206605684741650ac25
  • EKUBO: 0x01fad7c03b2ea7fbef306764e20977f8d4eae6191b3a54e4514cc5fc9d19e569

x402 default server (Sepolia)

  • Facilitator base: https://stark-facilitator.openclawchain.org/api/facilitator
  • Paywalled base: https://stark-facilitator.openclawchain.org/api/protected
  • Example resource: GET /chainstatus
  • Default spender (facilitator account):
    • 0x04dA15eb06D6D01C4907eb4876Cc29BdeF21A84bD71fB34d0369c83b8744D104

Lending demo pool (Sepolia)

Pool id: strk-usdc

  • Registry: 0x183ca728ea9432536ce728416dcb3126373f18a2e5cd46327a90dc2f1f93e15
  • Pool: 0x04bdad5b68e73eaa8784a488f02b6ead417a4e5c0472566027908149f115979b

Deployed contracts (Sepolia)

Feature Contract Address
NFT collection (OpenClawMinion / CLAWSTRK) MintableERC721 0x49782e9d0ce5eb2b1122fdb6de8498a6717389a8ce73768d69c3995c72d1ecd
.claw registry ClawIdRegistry 0x18fe5d665fe78d1e9032d85c5e3fd6f99492a608d197f4cb048a2246f7d68eb

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors