This guide explains how this repo submits Chia offers to a Splash server, including local (localhost) and local network (LAN) setups.
As of: 2026-02-19
Note (2026-03-19): The historical
old/directory (includingold/common.py) was removed from this repository. Splash-related behavior now lives in the main package (e.g. adapters and manager/daemon flows). Usegit log -- old/if you need the previous script text.
Offer submission was historically centralized in old/common.py (removed); the patterns below described that layout:
- Function:
post_offer_to_splash(offer_text: str) - Transport: HTTP
POST - URL source:
SPLASH_API_URL(env var with fallback default) - Body: JSON with a single
offerfield
Current default in code (when env var is not set):
SPLASH_API_URL = "http://john-deere.hoffmang.com:4000"
- Method:
POST - URL: value of
SPLASH_API_URL(base URL on port4000) - Header:
Content-Type: application/json - Body:
{
"offer": "<serialized_chia_offer_string>"
}Preferred: set SPLASH_API_URL as an environment variable.
- Local machine:
export SPLASH_API_URL="http://localhost:4000"
- LAN host:
export SPLASH_API_URL="http://192.168.1.50:4000"(replace with your Splash host IP)
Alternative: edit old/common.py fallback default.
If both are present, env var wins.
Legacy/manual edit examples:
- Local machine:
http://localhost:4000
- LAN host:
http://192.168.1.50:4000(replace with your Splash host IP)
Example export:
export SPLASH_API_URL="http://localhost:4000"
python old/make_offer.py --offer-wallet <CAT_ASSET_ID> --pair xch --count 1Example code fallback edit:
SPLASH_API_URL = "http://localhost:4000"The scripts create an offer via Chia wallet RPC, then submit it to Splash:
- Build/create offer using:
chia rpc wallet create_offer_for_ids
- Extract:
offer(serialized offer string)trade_id
- Submit
offerto Splash withpost_offer_to_splash(...)
Primary scripts that do this:
old/make_offer.py(recommended unified script)old/make_offer_for_xch.py(legacy)old/make_offer_for_b_usdc.py(legacy)
From the old/ directory:
python make_offer.py --offer-wallet <CAT_ASSET_ID> --pair xch --count 1or:
python make_offer.py --offer-wallet <CAT_ASSET_ID> --pair usdc --count 1If the command succeeds, output includes:
- created offer string
- trade ID
- Splash API response
Use this when you already have an offer string:
curl -X POST "http://localhost:4000" \
-H "Content-Type: application/json" \
-d '{"offer":"offer1..."}'Failed to post offer to Splash:- check host/IP and port (
4000) - verify Splash server is running and reachable
- check local firewall / router rules
- check host/IP and port (
- Connection works locally but not from another machine:
- bind Splash to a LAN-reachable interface, not loopback-only
- use LAN IP, not
localhost, from remote clients
- Offer creation fails before posting:
- ensure Chia wallet RPC is running
- verify
CHIA_BIN_PATHinold/common.py
- Slow response/timeouts:
- repo timeout is
REQUEST_TIMEOUT = 30seconds inold/common.py
- repo timeout is
SPLASH_API_URLnow supports env override; if unset, code falls back to the default URL inold/common.py.- No auth headers/tokens are used in the existing submission implementation.
make_offer.pycan use--cancel-after-create; cancellation happens after creation and around the same flow as posting, so behavior depends on timing and server-side handling.
old/common.pyold/make_offer.pyold/make_offer_for_xch.pyold/make_offer_for_b_usdc.pyold/README.md