organic-protocol
v0.1.1
Published
The shared protocol of the Organic Economy: wire formats, QR codes and API contracts, verified by the TypeScript compiler. Companion of organic-money.
Maintainers
Readme
organic-protocol
The shared protocol of the Organic Economy — wire formats, QR codes and REST contracts, verified by the TypeScript compiler.
This package carries the shapes that travel between Organic Economy instances: transaction and block wire formats, the versioned QR standard (OM1:CT/TX/BR/PP) with its encode/decode functions, and the DTOs of the /api/v1 REST contract. It contains no cryptography — that lives in organic-money.
The organic-webapp client and the organic-webserver server both import this package, so any drift between what one sends and the other expects becomes a compile error instead of a silent bug. Third-party implementations should either import it or implement PROTOCOL.md, which is the same standard in prose.
npm install organic-protocolimport { decodeQr, encodeContactQr, UnsupportedQrVersionError } from 'organic-protocol'
const qr = encodeContactQr({ pk: '02ab…', url: 'https://trifouillis.fr', n: 'Alice' })
const decoded = decodeQr(qr) // { type: 'CT', payload: { pk, url, n } }Development
npm install
npm run build # tsc → dist/
npm test # mocha + chai (via tsx)License
MIT — © suipotryot
