[![logo][]](https://xyo.network)

# @xyo-network/sdk

[![npm][npm-badge]][npm-link]
[![license][license-badge]][license-link]

> Self-contained all-in-one SDK for XYO Protocol 2.0 — foundation + modules runtime. The legacy `@xyo-network/sdk-js` package re-exports this package for backward compatibility.

## Self-contained build

Unlike a traditional barrel that declares every child package as a runtime dependency,
`@xyo-network/sdk` is **self-contained**: its published `dist/` vendors the compiled output
of each `@xyo-network/*` package in the closure (under `dist/_pkg/`), with cross-package
imports rewritten to relative paths. At runtime it depends only on real externals (`ethers`,
`@xylabs/sdk`, `zod`, etc.), declared as `peerDependencies`.

Import the whole SDK:

```ts
import { MemoryArchivist } from '@xyo-network/sdk'
```

…or a group via subpath export:

```ts
import { Archivist } from '@xyo-network/sdk/archivist'
import { ObjectHasher } from '@xyo-network/sdk/protocol'
```

The vendoring is performed by [`scripts/populate-dist.mjs`](scripts/populate-dist.mjs),
wired into the toolchain via a local **`package-compile`** script in `package.json`.

```sh
pnpm xy build                           # compiles all packages, then vendors the barrel
pnpm xy build @xyo-network/sdk          # vendors using already-compiled child dist
```

## Install

```sh
npm install @xyo-network/sdk
```

## License

See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).

## Credits

[Made with 🔥 and ❄️ by XYO Foundation](https://xyo.network)

[npm-badge]: https://img.shields.io/npm/v/@xyo-network/sdk.svg
[npm-link]: https://www.npmjs.com/package/@xyo-network/sdk
[license-badge]: https://img.shields.io/npm/l/@xyo-network/sdk.svg
[license-link]: https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/main/LICENSE
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png