Skip to content

Packages

Terminal window
npm install @libid/contracts viem

These docs describe version 0.21.0, which matches libID-contracts v0.21.0. The package works with viem. It has:

  • ABIs: identityRegistryAbi, handleEscrowAbi, and the other contracts. bindErrorsAbi has every error a bind can revert with.
  • Reading helpers: resolveHandle, resolveId, resolveHandleAndId, primaryHandleOf, identityCount, identitiesOf.
  • Keys: platformId, handleNode, idNode, foldedHandleNode.
  • Handle and id rules: normalize, checkId, RULES_GITHUB, RULES_X, RULES_GOOGLE.
  • Call builders: calls, one per state-changing function.
  • Bind payloads: encodeTlsNotaryProof, encodeGoogleProof.

handleNode, idNode, foldedHandleNode and the rules are also in @libid/contracts/platforms, which loads without viem.

The reading helpers take a reader, { client, address }, where client is a viem public client and address is IdentityRegistry. They return null where the contract returns a zero address or an empty string.

Source and README: ts/packages/contracts.

Terminal window
cargo add libid-contracts

Bindings for the contracts, built on alloy 2. See docs.rs/libid-contracts.

For your tests, the testing feature adds StubPlatformVerifier, a platform verifier that accepts any binding without a proof. Enable it in [dev-dependencies] only.

Terminal window
cargo add libid-identity --features node

Handle and id rules, and with the node feature the nodes a binding is stored under. See docs.rs/libid-identity.