Skip to content

API Reference ​

XO is split into a set of @xo-cash packages. Most applications only need @xo-cash/engine, which builds on the others.

Packages ​

@xo-cash/engine ​

The main entry point for building on XO. It manages an account's templates, invitations and transactions, compiles and resolves template actions, and talks to the network through Electrum servers.

@xo-cash/state ​

Stores and retrieves engine state, such as templates, invitations, locking bytecodes, unspent outputs and events. It gives IndexedDB and SQLite storage the same API.

@xo-cash/sync-client ​

A minimal client for the XO Sync Server. It reads, writes and watches for updates over Server-Sent Events or WebSockets, with end-to-end encryption coming soon.

@xo-cash/crypto ​

Handles key material for XO. It derives private and public keys from a seed, signs invitation commits with Schnorr signatures, and generates bytecode.

@xo-cash/templates ​

A collection of ready-to-use XO templates, such as P2PKH and Wrapped Cash, that can be imported straight into the engine.

@xo-cash/primitives ​

Validated value types such as keys, satoshi amounts, token categories, identifiers and signatures. Each primitive checks its input when it is created, so an instance is always valid.

@xo-cash/types ​

Shared TypeScript type definitions and interfaces, such as XOTemplate and XOInvitation, used by all of the XO packages.

@xo-cash/utils ​

Shared helpers for parsing, serializing and validating templates, generating template and script identifiers, and Extended JSON encoding.