@beclab/olaresid
v0.2.1
Published
DID Contract SDK with CLI tool
Downloads
516
Maintainers
Readme
OlaresID SDK & CLI
Introduction
olaresid is an SDK library and CLI tool focused on Olares ID domain metadata and tags. It helps you read core metadata (such as domain, DID, owner, and subdomain settings), and manage typed tag data on-chain for structured profile, auth, and application-specific information.
Quick Start
As a CLI Tool
npm install -g @beclab/olaresid
# Query Olares ID information on mainnet (default)
did-cli fetch olares.com
# Query Olares ID information on sepolia testnet
did-cli fetch olares.com --network sepolia
# Support Olares ID Format
did-cli fetch [email protected]- Scenario-based usage guide: CLI.md
- Full command reference: CLI-TREE.md
As an SDK
npm install @beclab/olaresidIn your TypeScript or JavaScript code, import the package:
import OlaresID from '@beclab/olaresid';- Full SDK API reference: SDK-TREE.md
- Usage examples: examples directory
Tag System
Tag-related usage is documented separately:
- SDK and concepts: TAG.md
- CLI command usage: TAG.md#cli-usage
Frontend Usage (Browser Environment)
When using @beclab/olaresid in frontend applications (React, Vue, etc.), you need to configure polyfills and bundler settings due to:
- WASM Support: The package includes Trust Wallet Core WASM module
- Node.js Polyfills: Browser environments need
bufferpolyfill - CommonJS Format: The package is in CommonJS format
Webpack has better support for CommonJS packages and WASM modules. We strongly recommend using Webpack for bundling.
Contribution Guide
Contributions are welcome! Before submitting a PR, you can test your changes locally in the following ways:
Environment Setup
# Clone the repository and install dependencies
git clone https://github.com/beclab/did-system.git
cd did-system/packages/olaresid
npm installTesting Method 1: Debug via CLI
After modifying the code, you can test your changes through the CLI tool:
# Compile the code
npm run build
# Link the local version globally
npm link
# Test CLI functionality
did-cli info tw7613781.olares.com
did-cli info pengpeng8.olares.com --network sepoliaTesting Method 2: Debug via Example Code
You can also test by running example code in the examples directory:
# Compile the code
npm run build
# Run examples
npx ts-node ./examples/index.ts
# Or run domain fetching examples
npx ts-node ./examples/fetch-domain-demo.ts
npx ts-node ./examples/fetch-all-flat-demo.tsAfter testing, feel free to submit a Pull Request!
Network Configuration
Mainnet (Default)
- RPC: https://optimism-rpc.publicnode.com
- DID Contract: 0x5DA4Fa8E567d86e52Ef8Da860de1be8f54cae97D
- Root Resolver: 0x9bA3D0D3d2046aeD57e9897F7F79C58DfAa5325A
- Root Resolver2: 0x7e7961aB771cA942CE4DB6e79579e016a33Dc95B
- ABI Type: 0x9ae3F16bD99294Af1784beB1a0A5C84bf2636365
- Query Contract: 0x8305411EEa5C3F99f9426845Cf2977E77D5a1711
- Support Service: https://api.olares.com/did/support
Sepolia Testnet
- RPC: https://sepolia.optimism.io
- DID Contract: 0xe2D7c3a9013960E04d4E9F5F9B63fff37eEd97A8
- Root Resolver: 0xbEE79099eD3eD33c8ce57df9fb79370aAc79f261
- Root Resolver2: 0xcbC02aa08c77a374eC0D5A0403E108b7573d96e8
- ABI Type: 0x7386fCBae6Ad4CCE1499d9153D99bc950B589718
- Query Contract: 0xAf0430AB9f2450c52E7401846C7CA702D53eCFC2
- Support Service: https://api-test.olares.com/did/support
