coinio
gno.land/p/g1qp5pt8cdq2f6kfdamn3yuxwg6quqnfpyewzz39/coinio on gno.land mainnetgno.land/p/g1ut6uspuh73e02yauxpmyt8g3wwddaq8utagvm3/coinio on onyx-1 testnet
pure packageprimitivevalue-handlinglive on mainnetlive on onyx-1
Receive, pay out and sweep coins without rewriting the checks each time.
Every realm that holds funds needs the same payment guards, so they are written once here and audited once.
In detail curated
Native-coin I/O for realms: the Receive receipt-guard trio (caller shape, envelope, denomination), Payout via RealmSend, reserve-protected Sweep, and HeldAt.
Use it
A pure package has no state and no transactions: you use it by importing it.
Import it
on gno.land mainnet
import "gno.land/p/g1qp5pt8cdq2f6kfdamn3yuxwg6quqnfpyewzz39/coinio"on onyx-1 testnet
import "gno.land/p/g1ut6uspuh73e02yauxpmyt8g3wwddaq8utagvm3/coinio"The path is the address: there is no package manager, nothing to add to a manifest and no version to pin, so the package you compile against is the one the chain runs. It differs per chain because the namespace in it is the deploying account's.
Called from real code
Not an example written for this page. These lines are quoted from auction, a deployed package in this portfolio that imports this one as coinio, out of the committed file whose sha256 onyx-1 testnet attested. They compile because they are compiled.
bidder, amount := coinio.Receive(0, cur, Denom)coinio.Payout(0, cur, caller, Denom, amount)coinio.Payout(0, cur, feeRecipient, Denom, amount)Deployments
Deployed on 2 chains from the same source. The bytes are identical — one digest, ea9d467d380ff297…, on both — so the API below is the API on either. Everything that is not the bytes differs per chain and is stated per chain: the import path, the namespace, the transaction, the height, the cost, and which files the chain holds.
gno.land mainnet gnoland-1
chain-attested| Import path | gno.land/p/g1qp5pt8cdq2f6kfdamn3yuxwg6quqnfpyewzz39/coinio |
|---|---|
| Namespace | g1qp5pt8cdq2f6kfdamn3yuxwg6quqnfpyewzz39 |
| Deployed at height | 323,266 |
| Deploy transaction | 7c1b494f65b77e9acc9a3f049c150bd112bd4d1825e88503e16a9bd1ca3605f0 look it up on the RPC |
| Deployer | g1qp5pt8cdq2f6kfdamn3yuxwg6quqnfpyewzz39 |
| Gas used | 9,793,648 |
| Storage | not attested per package on this chain — see the limitations below |
| Files on chain | coinio.gno gnomod.toml |
| Deployed bytes | coinio.gno — 5,685 bytes |
| sha256 | ea9d467d380ff2971695d452f96fe64ea46d847d094023f755edf5f79995b09d |
| Realm address | none — A /p/ package is not a realm: it holds no state, custodies no coins and is never a transaction sender. The pkgPath derivation would still produce a value; recording one would name nothing. |
| Used by | r/budgets, r/crowdfund, r/revshare, r/service_market, r/subscriptions, r/upkeep, r/vesting |
|---|
Do not take the hash above on trust. $download returns the bytes gnoland-1 is actually running; this command fetches them and prints their digest, which should equal the one in the table:
curl -sS 'https://gno.land/p/g1qp5pt8cdq2f6kfdamn3yuxwg6quqnfpyewzz39/coinio$download&file=coinio.gno' | shasum -a 256Expected: ea9d467d380ff2971695d452f96fe64ea46d847d094023f755edf5f79995b09d — 5,685 bytes. Use curl: the gno.land edges answer Python's default user-agent with HTTP 403.
onyx-1 testnet onyx-1
chain-attested| Import path | gno.land/p/g1ut6uspuh73e02yauxpmyt8g3wwddaq8utagvm3/coinio |
|---|---|
| Namespace | g1ut6uspuh73e02yauxpmyt8g3wwddaq8utagvm3 |
| Deployed at height | 96,543 |
| Deploy transaction | 6ad482fed77da2f6ab5ac882fdf17248e2af29e29c865bd3ddc1a7702e786c53 look it up on the RPC |
| Deployer | g1ut6uspuh73e02yauxpmyt8g3wwddaq8utagvm3 |
| Gas used | 9,792,027 |
| Storage | not attested per package on this chain — see the limitations below |
| Files on chain | coinio.gno gnomod.toml |
| Deployed bytes | coinio.gno — 5,685 bytes |
| sha256 | ea9d467d380ff2971695d452f96fe64ea46d847d094023f755edf5f79995b09d |
| Realm address | none — A /p/ package is not a realm: it holds no state, custodies no coins and is never a transaction sender. The pkgPath derivation would still produce a value; recording one would name nothing. |
| Used by | r/auction, r/budgets, r/crowdfund, r/deposits, r/invoices, r/loans, r/meters, r/netting, r/payroll, r/reimbursements, r/sealedbid, r/subscriptions |
|---|
Do not take the hash above on trust. $download returns the bytes onyx-1 is actually running; this command fetches them and prints their digest, which should equal the one in the table:
curl -sS 'https://onyx.testnets.gno.land/p/g1ut6uspuh73e02yauxpmyt8g3wwddaq8utagvm3/coinio$download&file=coinio.gno' | shasum -a 256Expected: ea9d467d380ff2971695d452f96fe64ea46d847d094023f755edf5f79995b09d — 5,685 bytes. Use curl: the gno.land edges answer Python's default user-agent with HTTP 403.
API
chain-derived 3 exported functions.
Read from vm/qdoc on gnoland-1. It describes the onyx-1 testnet deployment as well: the deployed bytes are identical on every chain here — one digest, ea9d467d380ff297… — and this site refuses to build a shared page for a package whose bytes differ across chains, so the same API is the API on each. The API is the only thing that carries across; every provenance fact above is per-chain.
This is a /p/ package: you import it, you do not call it in a transaction. gnoweb's $help shows only exported top-level functions, so the types and methods below do not appear there at all — which is why this reference exists.
Overview
Package coinio is the chain-facing coin plumbing that every value-holding realm on gno.land repeats: verified payment receipt, disciplined payout, and reserve-protected surplus sweeping. It was extracted from two audited, pearl-1-validated realms (vault and bounties) whose implementations of these mechanics were line-identical.
The package is PURE and STATELESS: it holds no balances, no roles, and no configuration; all state stays in the consuming realm (and its accounting package, e.g. feeledger). It emits no events — consumers emit their own. Every function either succeeds or panics, aborting the transaction: these are payment guards, and no failure here has a meaningful recovery path.
CAPABILITY CONTRACT: pure packages cannot declare crossing functions (a first `realm` parameter), so every coin-moving function here uses the canonical secondary-parameter shape `(_ int, rlm realm, ...)` — the same pattern as chain treasury packages. Pass 0 and your crossing entrypoint's own live `cur` (forwarded through non-crossing calls keeps it current). Each function asserts rlm.IsCurrent() before acting, so a stale, stored, or Previous() realm value fails closed (the designation-forgery guard secondary realm parameters require). Coins can only move FROM rlm.Address() — the calling realm itself — so no consumer can spend another realm's funds through this package.
AUTHORIZATION is the consumer's responsibility: coinio decides HOW coins move, never WHO may move them. Gate your entrypoints before calling in.
ORDERING CONTRACT (the one invariant coinio cannot enforce): debit your own accounting BEFORE calling Payout or Sweep (checks-effects-interactions). A panic inside coinio aborts the whole transaction, reverting your debit with it — that is what makes the debit-first order safe.
Imports
chainchain/bankerchain/runtime/unsafe
Functions
HeldAt
func HeldAt(addr address, denom string) int64
HeldAt returns the amount of denom held at addr. Read-only; usable from views and Render without a realm capability.
Payout
func Payout(_ int, rlm realm, to address, denom string, amount int64)
Payout sends amount of denom from the calling realm's own address to `to`. DEBIT YOUR ACCOUNTING FIRST — a panic here (or anywhere later in the transaction) reverts the debit together with the send.
Sweep
func Sweep(_ int, rlm realm, to address, denom string, reserve int64) int64
Sweep sends the surplus of a single denomination — everything the calling realm holds above `reserve` — to `to`, and returns the swept amount. Pass your total liabilities as the reserve for the denom your accounting tracks, and 0 for foreign denominations. Panics if there is no positive surplus, so reserved funds are untouchable by construction. One denomination per call keeps the operation gas- bounded regardless of how many junk denoms third parties force-send.
Doc text is reproduced as vm/qdoc returns it. The node markdown-escapes doc comments, so a bracket or angle bracket may carry a backslash the committed source does not have. The source itself is at source and in this repository.
Dependencies
A first-party dependency is imported from the SAME chain's namespace, so each deployment above depends on that chain's copy — the paths differ even where the code does not.
chain-attested| Imports | chain, chain/banker, chain/runtime/unsafe |
|---|---|
| First-party dependencies | none |
Known limitations
Recorded by the people who built and deployed it. This list is deliberately not empty where honesty costs something.
curatedgno.land mainnet
- Consumed on this chain by revshare, service_market, subscriptions as of 2026-09-25 (Group 1). Before that this entry read "no consumer on this chain"; the claim was true when written and the reusability argument it qualified was carried over from pearl-1.
- storage_bytes and storage_deposit are null because gnoland-1 emits no /tm.StorageDepositEvent ON ADDPKG -- a scope that is load-bearing, because it DOES emit one on MsgCall (measured 2026-10-17, AL62); see the chain's storage_deposit_events field. The deposits actually charged were measured from the signer's balance and are recorded in [an unpublished record], Cost; they are not chain-attested per package by this manifest.
onyx-1 testnet
The manifest records no limitation for this package on onyx-1. That is an absence of a recorded caveat, not a proof that none exists — the deployment record for that chain carries its own "what was NOT verified live" section.
Source
| Source file (gnoland-1) | mainnet/p/coinio/coinio.gno at commit c2e10d17ffbf in the project repository (not public — the digest command above is the check that needs no repository) |
|---|---|
| Matches the deployed bytes (gnoland-1) | yes — byte-identical |
| Source file (onyx-1) | onyx/p/coinio/coinio.gno at commit c2e10d17ffbf in the project repository (not public — the digest command above is the check that needs no repository) |
| Matches the deployed bytes (onyx-1) | yes — byte-identical |