
Okx Onchain Gateway
Bootstrap and refresh the OKX onchainos CLI with version checks so other OnchainOS agent skills can call onchain APIs reliably.
Overview
OKX Onchain Gateway is an agent skill for the Build phase that runs shared onchainos CLI pre-flight checks—release resolution, install, and update—before other OnchainOS commands.
Install
npx skills add https://github.com/okx/onchainos-skills --skill okx-onchain-gatewayWhat is this skill?
- Resolves latest stable tag from GitHub releases API before any onchainos command
- Installs or updates onchainos when missing or when ~/.onchainos/last_check is older than 12 hours
- Downloads install.sh and checksums from okx/onchainos-skills release assets on macOS/Linux
- Fails closed when binary is missing and network install is unavailable
- Shared across all onchainos skills—run once per session before first command
- 12-hour cache at ~/.onchainos/last_check before re-checking install/update
Adoption & trust: 7k installs on skills.sh; 284 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent tries onchain commands with a missing or outdated onchainos binary and every downstream Web3 skill fails unpredictably.
Who is it for?
Builders using OKX OnchainOS skills who want one consistent install gate per agent session on macOS, Linux, or Windows paths.
Skip if: Projects with no onchain footprint, teams forbidden from curl-based installers, or workflows that must use only pinned offline binaries with no GitHub calls.
When should I use this skill?
Every session before the first onchainos command across all onchainos skills—resolve LATEST_TAG, install or update if needed, then proceed without echoing routine output.
What do I get? / Deliverables
onchainos is installed or refreshed against the latest stable release (or you get a clear stop when offline without a binary), so subsequent OnchainOS skills can run in the same session.
- Verified or updated onchainos CLI ready for downstream commands
- Brief user-facing status only on install, update, or failure
Recommended Skills
Journey fit
Build integrations is the shelf for wiring external onchain gateways and CLIs into your agent workflow before you ship or operate at scale. Integrations matches shared pre-flight install, GitHub release resolution, and first-command session hygiene for the onchainos binary.
How it compares
Use as onboarding glue for the OnchainOS skill family—not a swap or wallet skill on its own.
Common Questions / FAQ
Who is okx-onchain-gateway for?
Solo builders and agent authors invoking OKX onchainos-skills who need the CLI present and up to date before swap, wallet, or chain automation steps.
When should I use okx-onchain-gateway?
At the start of each agent session immediately before the first onchainos command, and whenever install/update checks have not run within the last twelve hours.
Is okx-onchain-gateway safe to install?
It runs shell installers and network calls to GitHub; review the Security Audits panel on this Prism page, verify release checksums, and only install from the official okx/onchainos-skills repository.
SKILL.md
READMESKILL.md - Okx Onchain Gateway
# Shared Pre-flight Checks > This file is shared across all onchainos skills. Follow these steps before the first `onchainos` command each session. Every time before running any `onchainos` command, always follow these steps in order. Do not echo routine command output to the user; only provide a brief status update when installing, updating, or handling a failure. 1. **Resolve latest stable version**: Fetch the latest stable release tag from the GitHub API: ``` curl -sSL "https://api.github.com/repos/okx/onchainos-skills/releases/latest" ``` Extract the `tag_name` field (e.g., `v1.0.5`) into `LATEST_TAG`. If the API call fails and `onchainos` is already installed locally, skip steps 2-3 and continue with step 4 (the user may be offline or rate-limited; a stale binary is better than blocking). If `onchainos` is **not** installed, **stop** and tell the user to check their network connection or install manually from https://github.com/okx/onchainos-skills. 2. **Install or update**: If `onchainos` is not found, or if the cache at `~/.onchainos/last_check` (`$env:USERPROFILE\.onchainos\last_check` on Windows) is older than 12 hours: - Download the installer and its checksum file from the latest release tag: - **macOS/Linux**: `curl -sSL "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.sh" -o /tmp/onchainos-install.sh` `curl -sSL "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -o /tmp/installer-checksums.txt` - **Windows**: `Invoke-WebRequest -Uri "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.ps1" -OutFile "$env:TEMP\onchainos-install.ps1"` `Invoke-WebRequest -Uri "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -OutFile "$env:TEMP\installer-checksums.txt"` - Verify the installer's SHA256 against `installer-checksums.txt`. On mismatch, **stop** and warn — the installer may have been tampered with. - Execute: `sh /tmp/onchainos-install.sh` (or `& "$env:TEMP\onchainos-install.ps1"` on Windows). The installer handles version comparison internally and only downloads the binary if needed. - On other failures, point to https://github.com/okx/onchainos-skills. 3. **Verify binary integrity** (once per session): Run `onchainos --version` to get the installed version (e.g., `1.0.5` or `2.0.0-beta.0`). Construct the installed tag as `v<version>`. Download `checksums.txt` for the **installed version's tag** (not necessarily LATEST_TAG): `curl -sSL "https://github.com/okx/onchainos-skills/releases/download/v<version>/checksums.txt" -o /tmp/onchainos-checksums.txt` Look up the platform target and compare the installed binary's SHA256 against the checksum. On mismatch, reinstall (step 2) and re-verify. If still mismatched, **stop** and warn. - Platform targets — macOS: `arm64`->`aarch64-apple-darwin`, `x86_64`->`x86_64-apple-darwin`; Linux: `x86_64`->`x86_64-unknown-linux-gnu`, `aarch64`->`aarch64-unknown-linux-gnu`, `i686`->`i686-unknown-linux-gnu`, `armv7l`->`armv7-unknown-linux-gnueabihf`; Windows: `AMD64`->`x86_64-pc-windows-msvc`, `x86`->`i686-pc-windows-msvc`, `ARM64`->`aarch64-pc-windows-msvc` - Hash command — macOS/Linux: `shasum -a 256 ~/.local/bin/onchainos`; Windows: `(Get-FileHash "$env:USERPROFILE\.local\bin\onchainos.exe" -Algorithm SHA256).Hash.ToLower()` 4. **Version drift check** — REQUIRED, run even if steps 1-3 were skipped. - Run `onchainos --version` → CLI version (e.g., `2.2.9`) - Read `version` field from the active skill's YAML frontmatter (e.g., `version: "2.0.0"` at the top of SKILL.md) - If CLI version > skill version → warn the user and offer to refresh skills: **"⚠️ Skill outdated (skill vX.Y.Z < CLI vA.B.C). Run `onchainos upgrade` to refresh both the CLI and any locally cloned skill checkouts (`~/.codex/onchainos-skills`, `~/.openclaw/onc