platon-cli

Use Foundry `cast` to query PlatON on-chain data from mainnet or devnet over RPC. Use when a user asks to inspect blocks, transactions, receipts, balances, code, storage, logs, contract calls, gas price, nonce, or other direct chain data from PlatON. Accept network aliases `mainnet` and `main`, plus `dev`, `testnet`, and `devnet`.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "platon-cli" with this command: npx skills add platonnetwork/platon-dev-skills/platonnetwork-platon-dev-skills-platon-cli

PlatON CLI

Overview

Use Foundry cast to query PlatON chain data from mainnet or devnet. Prefer explicit --rpc-url usage so every command is reproducible and does not depend on ambient shell state.

Setup

Install Foundry (includes cast):

curl -L https://foundry.paradigm.xyz | bash foundryup --install  v1.6.0-rc1

Set RPC (optional):

export ETH_RPC_URL="https://openapi2.platon.network/rpc"

When the user needs the latest validated PlatON endpoints, first use $platon-chainlist.

Check Balance

cast balance <ADDRESS> --rpc-url https://openapi2.platon.network/rpc

In LAT (human readable):

cast balance <ADDRESS> --ether --rpc-url https://openapi2.platon.network/rpc

Transaction Info

cast tx <TX_HASH> --rpc-url https://openapi2.platon.network/rpc

Transaction receipt:

cast receipt <TX_HASH> --rpc-url https://openapi2.platon.network/rpc

Gas Price

cast gas-price --rpc-url https://openapi2.platon.network/rpc

In gwei:

cast --to-unit $(cast gas-price --rpc-url https://openapi2.platon.network/rpc) gwei

Block Info

Latest block:

cast block latest --rpc-url https://openapi2.platon.network/rpc

Specific block:

cast block <BLOCK_NUMBER> --rpc-url https://openapi2.platon.network/rpc

Contract Call

cast call <CONTRACT> "balanceOf(address)(uint256)" <ADDRESS> --rpc-url https://openapi2.platon.network/rpc

Read another view function:

cast call <CONTRACT> "<FUNCTION_SIGNATURE>" <ARGS...> --rpc-url https://openapi2.platon.network/rpc

Publish Transaction

Broadcast a raw signed transaction:

cast publish <SIGNED_TX_HEX> --rpc-url https://openapi2.platon.network/rpc

Send Transaction

Send a state-changing transaction with a private key:

cast send <CONTRACT> "transfer(address,uint256)" <TO> <AMOUNT> \
  --private-key <PRIVATE_KEY> \
  --rpc-url https://openapi2.platon.network/rpc

Send native LAT:

cast send <TO> --value 1ether \
  --private-key <PRIVATE_KEY> \
  --rpc-url https://openapi2.platon.network/rpc

Estimate Gas

Estimate gas for a contract write:

cast estimate <CONTRACT> "transfer(address,uint256)" <TO> <AMOUNT> --rpc-url https://openapi2.platon.network/rpc

Estimate gas for native transfer:

cast estimate <TO> --value 1ether --rpc-url https://openapi2.platon.network/rpc

Contract Code

cast code <ADDRESS> --rpc-url https://openapi2.platon.network/rpc

Storage

cast storage <ADDRESS> <SLOT> --rpc-url https://openapi2.platon.network/rpc

Logs

cast logs --rpc-url https://openapi2.platon.network/rpc --address <ADDRESS> --from-block <START> --to-block <END>

Account Nonce

cast nonce <ADDRESS> --rpc-url https://openapi2.platon.network/rpc

Chain Info

cast chain-id --rpc-url https://openapi2.platon.network/rpc

Address Conversion

Convert between PlatON lat bech32 addresses and 0x hex addresses:

node platon-cli/scripts/address_convert.ts lat1jt5xgxdca0hvs9ffhsk0a70zykwd8vjfc5aefl

Convert 0x to lat:

node platon-cli/scripts/address_convert.ts 0x92e86419B8EbeEC81529bC2CfEf9E2259CD3B249

The script auto-detects the input format and prints the converted address.

Public RPC Endpoints

NetworkProtocolURL
MainnetHTTPhttps://openapi2.platon.network/rpc
MainnetWSwss://openapi2.platon.network/ws
DevnetHTTPhttps://devnet3openapi.platon.network/rpc
DevnetWSwss://devnet3openapi.platon.network/ws

Network aliases:

  • mainnet, main
  • dev, testnet, devnet

Notes

  • Addresses are 0x-prefixed hex (42 characters)
  • Gas prices fluctuate; check before transactions
  • Rate limits apply on public RPCs
  • Use --rpc-url or set ETH_RPC_URL environment variable

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

precog

Trade on prediction markets. Create a local wallet, list markets, check prices, buy and sell outcome shares. Coming soon: create and fund markets directly from this skill.

Archived SourceRecently Updated
Web3

china-sportswear-outdoor-sourcing

Comprehensive sportswear and outdoor equipment sourcing guide for international buyers – provides detailed information about China's athletic apparel, footwear, outdoor gear, and accessories manufacturing clusters, supply chain structure, regional specializations, and industry trends (2026 updated).

Archived SourceRecently Updated
Web3

china-lighting-sourcing

Comprehensive lighting industry sourcing guide for international buyers – provides detailed information about China's LED, smart, outdoor, automotive, and specialty lighting manufacturing clusters, supply chain structure, regional specializations, and industry trends (2026 updated).

Archived SourceRecently Updated
Web3

china-furniture-sourcing

Comprehensive furniture industry sourcing guide for international buyers – provides detailed information about China's residential, office, hotel, outdoor, and custom furniture manufacturing clusters, supply chain structure, regional specializations, and industry trends (2026 updated).

Archived SourceRecently Updated