pohi-sdk
v0.1.0
Published
SDK for interacting with PoHI Registry on World Chain
Downloads
132
Maintainers
Readme
pohi-sdk
SDK for interacting with the PoHI Registry on World Chain.
Installation
npm install pohi-sdkFeatures
- Full client for World Chain interaction
- Record and verify attestations on-chain
- Query attestation status
- Built on viem
Usage
import { PoHIClient } from 'pohi-sdk';
// Create client (read-only)
const client = new PoHIClient({
network: 'mainnet', // or 'sepolia'
});
// Check if commit has valid attestation
const hasAttestation = await client.hasValidAttestation(
'owner/repo',
'abc123...'
);
// With write access
const writeClient = new PoHIClient({
network: 'sepolia',
privateKey: '0x...',
});
// Record attestation on-chain
const txHash = await writeClient.recordAttestation(attestation);API
PoHIClient
Main client class for interacting with the PoHI Registry.
Read Operations
getAttestation(hash)- Get attestation by hashisValidAttestation(hash)- Check if attestation is validhasValidAttestation(repo, commit)- Check if commit has valid attestationgetAttestationsForCommit(repo, commit)- Get all attestations for commit
Write Operations
recordAttestation(attestation)- Record attestation on-chainrevokeAttestation(hash, reason)- Revoke an attestation
License
Apache-2.0
