mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-10-20 18:56:18 +00:00
e1f3074c39b2103779dcd2ca52d6efaa3b35217d
The registry gave the mainnet relay prefix 0, PZW and 10 decimals and Zagros prefix 2 and ZGS, with genesis hashes from chains since relaunched; the nodes report ss58Format 42, HEZ and 12 decimals. Today a lookup by genesis fails and apps fall back to 42, so addresses come out right by accident; with a current genesis they would have been formatted with prefix 0. - pezkuwi and zagros: prefix 42, HEZ, 12 decimals (decided 2026-10-07; the relaunched mainnet keeps them) - Zagros genesis is the live one; the mainnet has none until its relaunch, since a stale hash identifies a chain that no longer exists - the PezkuwiChain entry (prefix 1453, PZC) and the dicle genesis describe no chain and are removed The spec now holds the real data: the Pezkuwi networks report 42/HEZ/12, a prefix is shared only at 42 (upstream's one-network-per-prefix rule cannot hold when the chains share the generic format), no two networks claim one genesis. Red with the mainnet back at prefix 0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@pezkuwi/common
Common utilities, cryptographic functions, and keyring management for PezkuwiChain applications.
Developed by Dijital Kurdistan Tech Institute
Overview
This repository provides utility functions with additional safety checks, allowing for consistent coding and reducing boilerplate across all @pezkuwi packages.
Packages
| Package | Description |
|---|---|
| @pezkuwi/keyring | Keyring management for accounts |
| @pezkuwi/util | General utility functions |
| @pezkuwi/util-crypto | Cryptographic and hashing utilities |
| @pezkuwi/networks | Network definitions |
| @pezkuwi/x-bigint | BigInt polyfills |
| @pezkuwi/x-fetch | Fetch polyfills |
| @pezkuwi/x-global | Global object utilities |
| @pezkuwi/x-randomvalues | Random values polyfills |
| @pezkuwi/x-textdecoder | TextDecoder polyfills |
| @pezkuwi/x-textencoder | TextEncoder polyfills |
| @pezkuwi/x-ws | WebSocket polyfills |
Installation
# Keyring
npm install @pezkuwi/keyring
# Utilities
npm install @pezkuwi/util
# Crypto utilities
npm install @pezkuwi/util-crypto
Quick Start
import { Keyring } from '@pezkuwi/keyring';
import { hexToU8a, u8aToHex } from '@pezkuwi/util';
import { mnemonicGenerate, blake2AsHex } from '@pezkuwi/util-crypto';
// Generate a mnemonic
const mnemonic = mnemonicGenerate();
// Create a keyring and add account
const keyring = new Keyring({ type: 'sr25519' });
const pair = keyring.addFromMnemonic(mnemonic);
console.log(`Address: ${pair.address}`);
Development
Prerequisites
- Node.js >= 18.14
- Yarn 4.x (via corepack)
Building
git clone https://github.com/pezkuwichain/pezkuwi-common
cd pezkuwi-common
corepack enable
yarn install
yarn build
Tutorials
Looking for tutorials? Check out examples for guides on how to use these utilities.
Links
- Website: https://pezkuwichain.io
- Documentation: https://docs.pezkuwichain.io
- API Docs: https://js.pezkuwichain.app
- GitHub: https://github.com/pezkuwichain
License
Apache-2.0
Author
Dijital Kurdistan Tech Institute
Languages
TypeScript
99.4%
Python
0.2%
Shell
0.2%
JavaScript
0.1%
HTML
0.1%