@humangate/sdk
v0.1.2
Published
TypeScript SDK for HumanGate — provider-agnostic human verification on Starknet
Maintainers
Readme
@humangate/sdk
TypeScript SDK for HumanGate — provider-agnostic human verification on Starknet.
Install
npm install @humangate/sdkOn-chain reads (no gas, no backend)
import { HumanGateChainReader } from '@humangate/sdk';
const reader = new HumanGateChainReader({
rpcUrl: 'https://rpc.starknet.lava.build',
registryAddress: '0x07f66804a1556e31993afb4eddfb2c90b78f67785c92a5860a076edc38b17d26',
});
// Check if address is a verified human
const isHuman = await reader.isHuman(userAddress);
// Get full attestation details
const attestation = await reader.getAttestation(userAddress, 'worldcoin');
// Check eligibility for a scoped action (airdrop, vote, etc.)
const eligible = await reader.isEligible(userAddress, scopeHash, 'worldcoin');
// Check if action already consumed
const consumed = await reader.hasConsumed(userAddress, scopeHash);Cairo integration (for smart contracts)
No SDK needed. Call the registry directly from your Cairo contract:
use starknet::ContractAddress;
#[starknet::interface]
trait IHumanGateRegistry<TContractState> {
fn is_human(self: @TContractState, address: ContractAddress, min_level: u8) -> bool;
}
// In your contract:
let registry = IHumanGateRegistry { contract_address: registry_addr };
let is_real = registry.is_human(caller, 1);Contract
Starknet Mainnet: 0x07f66804a1556e31993afb4eddfb2c90b78f67785c92a5860a076edc38b17d26
API
HumanGateChainReader
| Method | Returns | Description |
|--------|---------|-------------|
| isHuman(address, minLevel?) | boolean | Is this address a verified human? |
| getAttestation(address, providerId) | AttestationView | Full attestation details |
| isEligible(address, scopeHash, providerId) | boolean | Can this human perform scoped action? |
| hasConsumed(address, scopeHash) | boolean | Has the action already been consumed? |
HumanGate (internal — for HumanGate Portal backend only)
Low-level API client used internally by the HumanGate Portal to submit World ID proofs. dApp developers should use HumanGateChainReader above — all verification data is on-chain.
License
MIT
