This is a minimal proof-of-concept integration of the Splitter ADO into your existing app for demo purposes.
✅ Function to instantiate a Splitter contract on Andromeda mainnet with 2 recipients (80/20 split)
✅ Function to send ANDR tokens to the Splitter contract address to trigger distribution
✅ Function to query the Splitter config and recipients' balances for demo proof
✅ Web interface for easy testing
✅ API endpoints for programmatic access
splitter_ado.py- Core Splitter ADO integration functionstemplates/splitter_demo.html- Web interface for testingtest_splitter.py- Test script with examplesSPLITTER_DEMO.md- This guide
app.py- Added Splitter demo endpointsrequirements.txt- Addedaiohttp==3.8.5
pip install -r requirements.txtpython app.pyVisit: http://localhost:5000/splitter-demo
Enter your actual Keplr wallet addresses:
- Creator Address (80%): Your main wallet
- Treasury Address (20%): Your second wallet
- Enter your two wallet addresses in the web interface
- Click "Generate Instantiate TX"
- Copy the transaction body
- Sign and broadcast with Keplr or CosmJS
- Save the contract address from the transaction result
- Enter the contract address from Step 1
- Set amount (default: 1 ANDR)
- Click "Generate Send TX"
- Sign and broadcast the transaction
- Click "Query Results"
- Check that:
- Creator received ~0.8 ANDR (80%)
- Treasury received ~0.2 ANDR (20%)
- Contract config shows correct recipients
POST /api/splitter/instantiate
Content-Type: application/json
{
"creator_address": "andr1...",
"treasury_address": "andr1..."
}POST /api/splitter/send
Content-Type: application/json
{
"sender_address": "andr1...",
"splitter_address": "andr1...",
"amount": "1000000"
}POST /api/splitter/query
Content-Type: application/json
{
"splitter_address": "andr1...",
"creator_address": "andr1...",
"treasury_address": "andr1..."
}{
"recipients": [
{"recipient": {"address": "andr1creator..."}, "percent": "0.8"},
{"recipient": {"address": "andr1treasury..."}, "percent": "0.2"}
],
"lock_time": null,
"default_recipient": null,
"kernel_address": "andr14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4anegh",
"owner": "andr1creator..."
}{
"send": {}
}{
"get_splitter_config": {}
}- RPC:
https://rpc.andromeda-1.andromeda.io - REST:
https://rest.andromeda-1.andromeda.io - Chain ID:
andromeda-1 - Kernel:
andr14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4anegh
- Recipient 1: 80% (Creator/Main wallet)
- Recipient 2: 20% (Treasury/Second wallet)
- No lock time (can update recipients)
- No default recipient (MVP configuration)
Run the test script to see example outputs:
python test_splitter.pyThis will show you:
- Instantiate configuration
- Transaction bodies for signing
- API endpoint documentation
- Step-by-step checklist
// Example for frontend integration
const instantiateTx = {
"typeUrl": "/cosmwasm.wasm.v1.MsgInstantiateContract",
"value": {
"sender": "andr1creator...",
"admin": "andr1creator...",
"codeId": "1",
"label": "Splitter-andr1cre",
"msg": /* base64 encoded instantiate message */,
"funds": []
}
};
// Sign with Keplr
const result = await window.keplr.signAndBroadcast(
"andromeda-1",
"andr1creator...",
[instantiateTx],
"auto"
);-
"Module not found" error
- Run:
pip install -r requirements.txt
- Run:
-
"Template not found" error
- Ensure
templates/directory exists - Check that
splitter_demo.htmlis in the templates folder
- Ensure
-
Query failures
- Verify contract address is correct
- Check network connectivity
- Ensure contract is deployed on Andromeda mainnet
-
Transaction signing
- Use Keplr browser extension or CosmJS
- Ensure you have ANDR tokens for gas fees
- Verify wallet is connected to Andromeda mainnet
- Check the console logs in your browser developer tools
- Run
python test_splitter.pyto verify configuration - Ensure your wallet addresses start with
andr1
This is an MVP integration. For production use, consider adding:
- Error handling and retry logic
- Transaction status monitoring
- Gas estimation
- Multi-signature support
- Lock time configuration
- Default recipient settings
- Integration with existing user management
Ready to test! 🚀
Start the Flask app and visit /splitter-demo to begin your Andromeda Splitter ADO integration demo.