Some checks failed
morphit-release / Build + publish release tarball (push) Has been cancelled
154 lines
8.3 KiB
Markdown
154 lines
8.3 KiB
Markdown
# @beblurt/dblurt
|
|
|
|
[](https://www.npmjs.com/package/@beblurt/dblurt)
|
|
[](https://dblurt.beblurt.com/)
|
|
[](https://dblurt.beblurt.com/guides/typescript.html)
|
|
[](https://dblurt.beblurt.com/reference/compatibility.html)
|
|
|
|
**Build modern dApps** on the **Blurt blockchain** with a single JavaScript and **TypeScript SDK**.
|
|
|
|
`@beblurt/dblurt` is a JavaScript and TypeScript SDK for building applications on the **Blurt Social Blockchain**.
|
|
|
|
Whether you're building a **web3 dApp**, a social application, a dashboard, an automation tool, a wallet workflow or an AI integration, `@beblurt/dblurt` provides a modern, typed and practical foundation for interacting with the Blurt ecosystem.
|
|
|
|
New to Blurt? Discover the **Blurt Social Blockchain** at **https://blurt.blog/**.
|
|
|
|
Want to see `@beblurt/dblurt` in production? **BeBlurt** (**https://beblurt.com/**) is a complete social application built with the SDK and demonstrates how it can power a real-world Blurt experience.
|
|
|
|
> [!TIP]
|
|
> **Start here:** New to `@beblurt/dblurt`? Begin with the **[Getting started](https://dblurt.beblurt.com/start/getting-started.html)** guide. **In just a few minutes you'll make your first call to the Blurt blockchain!**
|
|
|
|
## 🤖 AI-friendly developer experience
|
|
|
|
`@beblurt/dblurt` is designed to work naturally with modern AI coding assistants.
|
|
|
|
The repository includes curated AI context, executable examples, validated documentation and a complete API reference to help assistants generate more accurate code, explanations and integrations.
|
|
|
|
Whether you use **Claude Code**, **Hermes**, **Codex**, **ChatGPT** or another coding assistant, the SDK is structured to make AI-assisted development more reliable.
|
|
|
|
## At a glance
|
|
|
|
| If you want to… | `dblurt` helps you… | Continue with… |
|
|
| --- | --- | --- |
|
|
| Build a Blurt dApp | connect application code to Blurt blockchain data and actions | [Getting started](https://dblurt.beblurt.com/start/getting-started.html) |
|
|
| Create social or community features | load posts, profiles, communities, notifications and referrals | [Use social data](https://dblurt.beblurt.com/guides/use-nexus-social-data.html) |
|
|
| Build dashboards, bots or indexers | read accounts, blocks, operations, witnesses and chain properties | [Read chain data](https://dblurt.beblurt.com/guides/read-chain-data.html) |
|
|
| Make apps resilient | configure multiple endpoints and fail over when one node is unavailable | [RPC endpoints and failover](https://dblurt.beblurt.com/guides/rpc-endpoints-and-failover.html) |
|
|
| Add transactions safely | prepare, sign and broadcast when your app is ready for side effects | [Broadcast safely](https://dblurt.beblurt.com/guides/broadcast-safely.html) |
|
|
| Work in modern app stacks | use TypeScript-friendly helpers in Node.js and browser integrations | [Runtime and browser](https://dblurt.beblurt.com/guides/runtime-and-browser.html) |
|
|
|
|
## Install
|
|
|
|
```bash
|
|
npm install @beblurt/dblurt
|
|
```
|
|
|
|
Runtime support is defined by package metadata and validated in CI. See [Compatibility](https://dblurt.beblurt.com/reference/compatibility.html) for the current support model.
|
|
|
|
## Try it safely
|
|
|
|
The fastest useful test is a blockchain query. It confirms your app can reach Blurt, use endpoint failover and read current chain state without a private key.
|
|
|
|
```ts
|
|
import { Client } from '@beblurt/dblurt';
|
|
|
|
const client = new Client([
|
|
'https://rpc.blurt.blog',
|
|
'https://rpc.beblurt.com',
|
|
'https://blurt-rpc.saboin.com'
|
|
], {
|
|
timeout: 15_000,
|
|
failoverThreshold: 3
|
|
});
|
|
|
|
const props = await client.condenser.getDynamicGlobalProperties();
|
|
|
|
console.log({
|
|
head: props.head_block_number,
|
|
irreversible: props.last_irreversible_block_num,
|
|
time: props.time
|
|
});
|
|
```
|
|
|
|
> [!IMPORTANT]
|
|
> This example is intentionally blockchain query. It does not use a private key and does not broadcast a transaction. Read [Broadcast safely](https://dblurt.beblurt.com/guides/broadcast-safely.html) before adding side effects.
|
|
|
|
## Main SDK surfaces
|
|
|
|
| Surface | Use it for | Continue with… |
|
|
| --- | --- | --- |
|
|
| `client.condenser` | common Blurt chain reads: accounts, content, witnesses and chain properties | [Read chain data](https://dblurt.beblurt.com/guides/read-chain-data.html) |
|
|
| `client.database` | appbase database API calls | [API reference](https://dblurt.beblurt.com/reference/api.html) |
|
|
| `client.accountHistory` | account operations and virtual operation history | [API reference](https://dblurt.beblurt.com/reference/api.html) |
|
|
| `client.blockchain` | block ranges, streams and operation iteration | [Recipes](https://dblurt.beblurt.com/recipes/) |
|
|
| `client.nexus` | posts, communities, profiles, notifications and referrals | [Use social data](https://dblurt.beblurt.com/guides/use-nexus-social-data.html) |
|
|
| `client.read` | higher-level account, witness, vote and social summaries | [Read account summary](https://dblurt.beblurt.com/recipes/read-account-summary.html) |
|
|
| `client.broadcast` | preparing, signing and broadcasting transactions | [Broadcast safely](https://dblurt.beblurt.com/guides/broadcast-safely.html) |
|
|
| operation builders | constructing posts, replies, follows, reblogs, community actions and custom JSON | [Build post operation](https://dblurt.beblurt.com/recipes/build-post-operation.html) |
|
|
| crypto and utilities | keys, signatures, assets, vote calculations, VESTS conversion and memo helpers | [API reference](https://dblurt.beblurt.com/reference/api.html) |
|
|
|
|
## Ready to go further?
|
|
|
|
The README is only the starting point.
|
|
|
|
Whether you want to understand the Blurt blockchain, build your first dApp, explore recipes, browse the API or learn safe transaction workflows, you'll find the complete developer documentation at:
|
|
|
|
➡️ **https://dblurt.beblurt.com/**
|
|
|
|
Start with the **Getting started** guide, then follow the learning path that matches what you want to build.
|
|
|
|
## Examples
|
|
|
|
The repository includes executable examples with metadata and validation status.
|
|
|
|
- [Recipes](https://dblurt.beblurt.com/recipes/) for task-oriented walkthroughs
|
|
- [Examples catalog](https://gitlab.com/beblurt/dblurt/-/blob/main/examples/README.md)
|
|
- [Node.js examples](https://gitlab.com/beblurt/dblurt/-/tree/main/examples/node)
|
|
- [TypeScript example](https://gitlab.com/beblurt/dblurt/-/blob/main/examples/typescript/read-account.ts)
|
|
- [Browser example](https://gitlab.com/beblurt/dblurt/-/tree/main/examples/browser)
|
|
|
|
For browser integrations, use [Runtime and browser](https://dblurt.beblurt.com/guides/runtime-and-browser.html). For quick CDN experiments only, `https://unpkg.com/@beblurt/dblurt@latest/dist/dblurt.js` is available; pin a package version for production CDN use.
|
|
|
|
## Community and support
|
|
|
|
Need help or want to discuss an integration?
|
|
|
|
- Join the **Blurt Discord**: https://discord.blurt.blog/
|
|
|
|
Want to follow the project and the Blurt developer ecosystem?
|
|
|
|
- Visit the **Dev on Blurt** community: https://beblurt.com/community/blurt-101010
|
|
|
|
Found a bug or have a feature request?
|
|
|
|
- Open an issue on **GitLab** using the provided templates.
|
|
|
|
Looking for the complete documentation?
|
|
|
|
- Visit **https://dblurt.beblurt.com/**
|
|
|
|
## Contributing
|
|
|
|
Contributions are welcome: bug fixes, examples, documentation improvements, tests and carefully scoped SDK changes all help the project.
|
|
|
|
Please read [CONTRIBUTING.md](https://gitlab.com/beblurt/dblurt/-/blob/main/CONTRIBUTING.md) before opening a merge request. It explains the contribution workflow, validation commands, documentation expectations and how to write useful issues.
|
|
|
|
## Security
|
|
|
|
Security matters for every blockchain application.
|
|
|
|
Please read [SECURITY.md](SECURITY.md) for our security policy, responsible disclosure process and maintainer expectations before reporting security-related issues.
|
|
|
|
## Changelog
|
|
|
|
Looking for recent changes or upgrading from an earlier version?
|
|
|
|
See [CHANGELOG.md](CHANGELOG.md) for release history and migration notes.
|
|
|
|
## Maintainer
|
|
|
|
Maintained by [@nalexadre](https://beblurt.com/@nalexadre), Blurt blockchain Top 20 Witness.
|
|
|
|
## License
|
|
|
|
This package currently declares `BSD-3-Clause-No-Military-License` in `package.json`. See [LICENSE](LICENSE) for the full license text.
|