coinoperated
Skill1 starsChanged 7 days agoMITView on GitHub
High-level coordinator for CoinOperated (coinoperated.finance) agent setup: create a local agent EOA via agent-wallet, emit a user deeplink to register an additional signer and spending delegation, wait for the user, SIWE for a Bearer JWT and call the REST API using OpenAPI, then spend via public-relayer (agent-wallet redelegate + relayer_estimate/send7710Transaction, including batched executions and multichain). Use when linking an agent wallet to CoinOperated, CoinOperated agent onboarding, SIWE verify/token for additional signers, GET /api/agent/delegations, generating coinoperated.finance/agent/link URLs, or redeeming a CoinOperated agent grant through the 1Shot relayer. Pair with agent-wallet for keys and public-relayer for JSON-RPC; do not use for Host RPC wallet embeds (1shot-wallet).
- Installs packages
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 1shot-apiSkill
- 1shot-walletSkill
- agent-walletSkill
- ows-branding-layerSkill
- public-relayerSkill
- unit-testsSkill
- webauthn-prf-walletSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 74
Follow skill agent-wallet: doctor, then create (or address if a wallet already exists).
- Distinctive: line 88
Ask the user to open the link while signed into CoinOperated, confirm adding the address as an additional signer, and approve a spending …
- Distinctive: line 94
Use idle time for read-only setup — do not estimate/send or move USDC until the user asks to spend:
- Very specific: line 96
Ensure agent-wallet/scripts has npm install (doctor → depsOk).
- Very specific: line 98
After they confirm the link: SIWE (Phase 3), then GET /api/agent/delegations → write parent.json.
- Distinctive: line 100
Never redeem “just because setup finished.”
- Distinctive: line 104
After the user confirms they finished the link flow:
- Very specific: line 112
Call authenticated routes with Authorization: Bearer <accessToken>.
- Very specific: line 127
If you JSON.stringify(row.delegation) when it is already a string, aw redelegate rejects the double-encoded parent.
- Distinctive: line 132
Follow skill public-relayer Path D2, Example 0d, and references/spend-paths.md.
- Very specific: line 146
cwd: run node scripts/aw.mjs … from the agent-wallet skill root (folder that contains scripts/), not from inside scripts/.
- Very specific: line 184
Do not use aw send for the grant redeem — that broadcasts a raw EOA tx and is not the CoinOperated funding flow.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CoinOperated (agent coordinator)
Orchestrate linking a coding-agent wallet to CoinOperated, authenticating to the REST API, and spending under the owner grant via the 1Shot public relayer (direct pay or pull-to-agent). CoinOperated never holds agent private keys. The human owner confirms the agent address and signs a limited Arc USDC spending permission in the browser.
Humans usually paste a prompt that points here:
Follow https://raw.githubusercontent.com/1Shot-API/skills/main/coinoperated/SKILL.md to set up a CoinOperated agent wallet and link it to my account.Install companion skills
Claude Code / Cursor (user-level, ~/.claude/skills is read by both):
npx skills add 1Shot-API/skills/coinoperated -g -a claude-code -y
npx skills add 1Shot-API/skills/agent-wallet -g -a claude-code -y
npx skills add 1Shot-API/skills/public-relayer -g -a claude-code -yAny agent / cloud sandbox (no skills CLI):
git clone --depth 1 https://github.com/1Shot-API/skills.git
cd skills/agent-wallet/scripts && npm install
# Foundry cast is OPTIONAL for the CoinOperated path (create / SIWE sign / auth7702 / redelegate).
# Only send/mktx/sign-typed still need cast: https://getfoundry.shSkill roots after clone: skills/coinoperated, skills/agent-wallet, skills/public-relayer. Human overview: https://coinoperated.finance/guides/agents.
Spend paths (pick by user intent)
Full detail: references/spend-paths.md. Runnable example: scripts/arc-usdc-transfer.mjs.
| User intent | Path | executions work leg |
“Send / pay / transfer $X to 0x…” | A — Direct (one redeem) | ERC-20 transfer(recipient, amount) |
| Hold funds / LiFi / multi-hop / trading | B — Pull then trade | ERC-20 transfer(agent, amount); trade later from agent |
Both paths: fee leg → feeCollector, redelegate to relayer targetAddress, permissionContext = [child, parent], auth7702 on first use.
For complex work, do not encode LiFi under the owner grant — Path B only. For a simple payment the user named a recipient for, use Path A (do not invent an extra pull hop).
# From coinoperated/scripts (sibling agent-wallet installed + npm install)
node arc-usdc-transfer.mjs --parent ./parent.json --to 0xRecipient --amount 1 --max-fee 0.05
node arc-usdc-transfer.mjs --parent ./parent.json --amount 5 # pull to agentPhase 1 — Local wallet (agent-wallet)
- Follow skill agent-wallet:
doctor, thencreate(oraddressif a wallet already exists). Afternpm installunderscripts/, create/sign work without Foundry. - Show the user the address only from JSON stdout. Never open keystore or password files.
- Pick a short display
namefor the deeplink (agent or product name, max 64 chars). Omit if none.
Phase 2 — User grant via deeplink
Build the URL (URL-encode
namewhen present):https://coinoperated.finance/agent/link?accountAddress={address}&name={name}Omit
&name=…when there is no label. Full contract: references/deeplinks.md.- Ask the user to open the link while signed into CoinOperated, confirm adding the address as an additional signer, and approve a spending delegation in their wallet UI.
- Stop and wait until the user says they are ready. Do not poll CoinOperated for completion in this skill version.
Prepare while waiting (no funds moved)
Use idle time for read-only setup — do not estimate/send or move USDC until the user asks to spend:
- Ensure
agent-wallet/scriptshasnpm install(doctor→depsOk). - Cache
relayer_getCapabilities(["5042"])→targetAddress,feeCollector, USDC. - After they confirm the link: SIWE (Phase 3), then
GET /api/agent/delegations→ writeparent.json. - Optionally check agent code on Arc; plan
authorizationListif not yet upgraded. - Never redeem “just because setup finished.”
Phase 3 — SIWE → Bearer → API
After the user confirms they finished the link flow:
GET https://coinoperated.finance/api/auth/siwe/nonce→{ nonce, chainId, domain }.- Build a SIWE message for the agent address — use the exact EIP-4361 template in references/siwe-agent.md (includes Issued At). Prefer that template over guessing
siwepackage fields (siweis not a dependency of agent-wallet). - Sign with agent-wallet
sign-personal --message …(the full prepared string). Never dump private keys. POST https://coinoperated.finance/api/auth/siwe/verify/tokenwith{ "message", "signature" }→{ accessToken, tokenType, expiresIn, user, signerNonce }.- Fails if the address is not yet a primary or registered additional signer.
signerNonce: hex correlation nonce for Agent Activity webhooks (see Phase 4). Persist it with the token.
- Call authenticated routes with
Authorization: Bearer <accessToken>.
Source of truth for paths and schemas: https://coinoperated.finance/openapi.yaml (human UI: /docs/api). Prefer OpenAPI over inventing endpoints.
First useful check after linking: GET /api/agent/delegations (Bearer-only; lists stored grants for the JWT signer).
Persisting parent.json (avoid double-encoding)
Each row’s delegation field is already a JSON string (serialized MetaMask Delegation), not a nested object.
# Correct — write the string body once
node -e "const r=JSON.parse(require('fs').readFileSync(0,'utf8')); const d=r.result?.[0]??r[0]; const raw=typeof d.delegation==='string'?d.delegation:JSON.stringify(d.delegation); require('fs').writeFileSync('parent.json', raw);"- If you
JSON.stringify(row.delegation)when it is already a string,aw redelegaterejects the double-encoded parent. permissionContext(when present) is typically hex / encoded chain data — prefer thedelegationstring forparent.json.
Phase 4 — Spend via public-relayer (Path D2)
Follow skill public-relayer Path D2, Example 0d, and references/spend-paths.md. Prefer the runnable script when the ask is a simple Arc USDC transfer.
Chain / RPC constants (Arc mainnet)
| Item | Value |
| Chain id (decimal) | 5042 |
| Chain id (hex) | 0x13b2 |
| Public RPC | https://rpc.mainnet.arc.io |
| Relayer JSON-RPC | https://relayer.1shotapi.com/relayers |
| Agent Activity webhook | https://coinoperated.finance/api/webhooks/relayer |
GET /api/chains may not list the RPC URL — use the table above for Arc.
cwd: run node scripts/aw.mjs … from the agent-wallet skill root (folder that contains scripts/), not from inside scripts/.
First redeem on a chain: EIP-7702 upgrade (required)
# from agent-wallet skill root
node scripts/aw.mjs auth7702 --rpc https://rpc.mainnet.arc.io --chain-id 5042Pass authorizationList: [authorization] on estimate and send. Stateless7702 impl (all CREATE2 chains): 0x63c0c19a282a1B52b07dD5a65b58948A07DAE32B. Do not use viem executor: "self".
Shared redeem steps
- Capabilities →
targetAddress,feeCollector, USDC. parent.jsonfrom API (raw string).- First use:
auth7702→ keepauthorization. aw redelegatewith childto: targetAddress,maxAmount≥ fee + work (decimal atom strings OK —awcoerces tobigint).permissionContext = [child, parent](leaf first).executions[]: fee →feeCollector; work → recipient (Path A) or agent (Path B).- Estimate (retry on
ECONNRESET/ fetch failures) → if fee changed, re-sign child → send withcontextwithin ~30s. If user set a fee cap, re-quote after expiry and send only if still ≤ cap. If send may have landed, pollrelayer_getStatus— do not double-submit. - Units:
estimate.requiredPaymentAmount= atoms (BigIntOK).getFeeData.minFee= human decimal ("0.01") — useparseUnits, neverBigInt(minFee).
Agent Activity: destinationUrl + memo JSON
So spends appear under the owner’s Agent Activity tab, every relayer_send7710Transaction* must include:
destinationUrl: "https://coinoperated.finance/api/webhooks/relayer",
memo: JSON.stringify({
source: "coinoperated", // required literal
signerAddress: agentAddress, // 0x… agent EOA (additional signer)
nonce: signerNonce, // from SIWE verify/token (0x + 32 hex)
justification: "Pull 5 USDC for LiFi route", // optional; shown in UI
}),Constraints: memo ≤ 256 characters total; omit keys and the row will not ingest (GET /api/user/agent-activity stays empty). signerNonce is not the SIWE login nonce — it is the dedicated field on the token response.
Do not use aw send for the grant redeem — that broadcasts a raw EOA tx and is not the CoinOperated funding flow.
Non-goals
- Full DCA / triggered-plan tutorials — use OpenAPI after auth; on-chain work still goes through public-relayer when required.
- Embedding
wallet.1shotapi.comHost RPC — skill 1shot-wallet (owner UI, not the agent EOA).
See also
- references/deeplinks.md
- references/siwe-agent.md
- references/spend-paths.md — direct pay vs pull-then-trade
- scripts/arc-usdc-transfer.mjs — tested Path D2 example CLI
- Skill agent-wallet — local EOA create /
sign-personal/auth7702/redelegate - Skill public-relayer —
relayer_*estimate/send, Path D, fee units, retries - Skill 1shot-wallet — embedded wallet Host Layer (owner UI, not agent EOA)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

