{"skill":{"slug":"bobine-contract-caller","displayName":"Bobine Contract Caller","summary":"Use when you need to call deployed Bobine modules with typed params or perform a signed Ed25519 call through an auth module.","description":"---\nname: bobine-contract-caller\nlicense: MIT\ndescription: >\n  Use when you need to call deployed Bobine modules with typed params or\n  perform a signed Ed25519 call through an auth module.\nmetadata:\n  version: 0.1.0\n  openclaw:\n    requires:\n      bins:\n        - node\n    emoji: \"🧵\"\n    homepage: https://github.com/hazae41/bobine\n    os:\n      - linux\n      - darwin\n      - win32\n---\n\n# Bobine Contract Caller\n\nDefault entrypoint: `scripts/call_bobine.mjs`.\n\n## Upstream references\n\n- Concept overview: <https://www.bobine.tech/>\n- Bobine project: <https://github.com/hazae41/bobine>\n- Standard libraries for Bobine WebAssembly VM: <https://github.com/hazae41/stdbob>\n\n## Scope\n\n- Calling a Bobine module through `/api/execute`\n- Preparing typed Bobine params for contract methods\n- Generating Ed25519 keys for Bobine auth sessions\n- Performing an authenticated `ed25519` call with nonce handling and signature\n\n## Runtime requirements\n\n- Node.js 20+\n- Network access to a Bobine server\n\n## Load on demand\n\n- Read `references/params.md` only when params use packed arrays or quoted `text:` payloads\n- Read `references/runtime.md` only when spark handling, outputs, or failure modes are unclear\n- Use `scripts/keygen.mjs` only when the call needs `ed25519` auth\n- Use `scripts/call_bobine.mjs` for all unsigned and signed calls\n\n## Quick workflow\n\n1. Use `scripts/call_bobine.mjs` as the default entrypoint for Bobine interactions.\n2. Read `references/params.md` only if params are nested, packed, or need quoted `text:`.\n3. Generate keys if the call needs `ed25519` auth:\n\n   ```bash\n   node ./scripts/keygen.mjs\n   ```\n\n4. Call the target contract with explicit arguments:\n\n   ```bash\n   node ./scripts/call_bobine.mjs \\\n     --server http://localhost:8080 \\\n     --module <target-module> \\\n     --method <target-method> \\\n     --param text:Alice\n   ```\n\n## Inputs\n\n- `call_bobine.mjs`\n  - `--server`: Bobine server base URL\n  - `--module`: target module address\n  - `--method`: target method name\n  - `--param`: repeat once per typed param\n  - `--auth-module`: optional deployed `ed25519` auth module address\n  - `--sigkey`: required when `--auth-module` is provided\n  - `--pubkey`: required when `--auth-module` is provided\n  - `--spark-hex`: optional one-off spark value for this exact call\n  - `--spark-effort`: optional inline spark generation target\n\n## Param rules\n\n- Scalars:\n  - `null`\n  - `blob:<hex>`\n  - `bigint:<value>`\n  - `number:<value>`\n  - `text:<value>`\n- Arrays:\n  - `pack:[...]`\n  - `array:[...]`\n- Nesting is allowed\n- Quote the whole shell argument when it contains brackets, commas, or spaces\n- Quote the `text:` payload itself when it contains `,` or `]`, for example `text:\"a,b]\"`\n\n## Gotchas\n\n- `--param` is one top-level Bobine param per flag; nested arrays stay inside a single typed param string\n- `text:` values containing `,` or `]` must quote the payload itself, for example `text:\"a,b]\"`\n- Signed calls require all of `--auth-module`, `--sigkey`, and `--pubkey`\n- `--spark-hex` is a one-off override for a specific call; prefer `--spark-effort` when you want a fresh spark\n- `keygen.mjs` prints secret material, so do not paste its output back to the user unless they explicitly ask for it\n\n## Signed call behavior\n\n1. Read `--server`, target module, target method, and typed params\n2. Build the Bobine session payload `[auth_module, pubkey]`\n3. Derive the session address from `sha256(pack(session))`\n4. Query `<auth_module>.get_nonce(session_address)`\n5. Sign `[domain, module, method, params, nonce]`\n6. Call `<auth_module>.call(module, method, params, pubkey, signature)`\n7. Print a JSON object with logs, returned value, spark hex, and reported sparks\n\n## Output contract\n\n- Scripts print a single JSON object on stdout on success\n- Usage and failure diagnostics go to stderr\n- Returned Bobine values are normalized into tagged JSON:\n  - `{ \"type\": \"text\", \"value\": \"hello\" }`\n  - `{ \"type\": \"bigint\", \"value\": \"42\" }`\n  - `{ \"type\": \"array\", \"value\": [...] }`\n- `keygen.mjs` prints `{ \"sigkey\": \"...\", \"pubkey\": \"...\" }`\n\n## Safety\n\n- Do not echo private keys back to the user unless they explicitly ask for them\n- Treat `sigkey` as sensitive\n- Prefer a fresh inline spark by default; use `--spark-hex` only when you deliberately want to supply a one-off spark\n- Surface server errors and decoded logs instead of retrying blindly\n\n## Troubleshooting\n\n- `Missing required call arguments`: re-run with `--server`, `--module`, `--method`, and any required auth flags\n- `Unknown value type`: read `references/params.md`\n- `Failed Bobine execute request`: report the HTTP status and response body\n- `Invalid session` or `Unauthorized`: the auth module, nonce, keys, or target contract assumptions are wrong\n","tags":{"latest":"0.1.0"},"stats":{"comments":0,"downloads":312,"installsAllTime":12,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1778346379964,"updatedAt":1778492888959},"latestVersion":{"version":"0.1.0","createdAt":1778346379964,"changelog":"Initial release of bobine-contract-caller.\n\n- Enables typed Bobine contract calls via `/api/execute`\n- Supports unsigned and authenticated Ed25519-signed calls to Bobine modules\n- Provides scripts for contract interaction (`call_bobine.mjs`) and Ed25519 key generation (`keygen.mjs`)\n- Handles complex param structures and signed call nonce/signature flow\n- Outputs results as normalized tagged JSON; logs diagnostics to stderr\n- Includes robust safety practices for handling sensitive key material","license":"MIT-0"},"metadata":{"setup":[],"os":["linux","darwin","win32"],"systems":null},"owner":{"handle":"ccamel","userId":"s177wz3n9wkq2nnskf8f6erqvx84q9cw","displayName":"Chris","image":"https://avatars.githubusercontent.com/u/9574336?v=4"},"moderation":null}