-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathsolana_demo.ainl
More file actions
23 lines (22 loc) · 1.38 KB
/
solana_demo.ainl
File metadata and controls
23 lines (22 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# examples/solana_demo.ainl
# Solana example — demonstrates R solana.VERB pattern. General blockchain adapters will use similar structure via blockchain_base.py.
# Strict demo: read-only Solana RPC + simulation (install solana+solders for live calls).
#
# Env (typical):
# export AINL_SOLANA_RPC_URL=https://api.devnet.solana.com # default if unset
# export AINL_DRY_RUN=1 # safe: no real txs from mutating steps
# Optional caps: AINL_SOLANA_TOKEN_ACCOUNTS_LIMIT, AINL_SOLANA_GET_PROGRAM_ACCOUNTS_LIMIT
# GET_LATEST_BLOCKHASH below: read-only; with AINL_DRY_RUN=1 returns mock blockhash (no RPC).
#
# ainl-validate examples/solana_demo.ainl --strict
# ainl-validate examples/solana_demo.ainl --strict --emit solana-client -o solana_client.py
# cd /path/to/AI_Native_Lang && AINL_DRY_RUN=1 python3 solana_client.py
# AINL_SOLANA_DEMO_PREVIEW=1 AINL_DRY_RUN=1 python3 solana_client.py
L1:
R solana.GET_ACCOUNT "11111111111111111111111111111111" ->sysprog
R solana.GET_BALANCE "11111111111111111111111111111111" ->sysbal
R solana.GET_LATEST_BLOCKHASH _ ->bh # _ = strict-parse placeholder (no primary arg); use bh + dry-run txs to rehearse flows
R solana.GET_SIGNATURES_FOR_ADDRESS "Vote111111111111111111111111111111111111111" 3 ->sigs
R solana.SIMULATE_EVENTS "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" ->evts
R core.STRINGIFY sysbal ->sbal
J sbal