@le-space/ucanto-interface
v11.1.1
Published
interface definitions for ucanto
Readme
@le-space/ucanto-interface
@le-space/ucanto-interface provides shared type definitions and contracts used across the ucanto ecosystem. It ensures consistent and type-safe interactions between different modules, facilitating seamless integration.
What It Provides
- Shared Type Definitions: Standardized types for capabilities, invocations, and responses.
- Interface Contracts: Defines clear API contracts for
ucantomodules. - Type Safety: Enhances reliability through TypeScript-based type checking.
How It Fits with Other Modules
@le-space/ucanto-core: Uses the interfaces to define and execute capabilities.@le-space/ucanto-server: Implements service logic based on interface definitions.@le-space/ucanto-transport: Adopts standardized encoding and transport interfaces.@le-space/ucanto-principal: Uses identity-related interfaces for cryptographic operations.@le-space/ucanto-client: Ensures consistent request and response structures.
For an overview and detailed usage information, refer to the main ucanto README.
Installation
npm install @le-space/ucanto-interfaceExample Usage
import { Capability, Invocation } from '@le-space/ucanto-interface';
const exampleCapability: Capability = {
can: 'file/read',
with: 'file://example.txt'
};
const exampleInvocation: Invocation = {
capability: exampleCapability,
issuer: 'did:key:xyz',
audience: 'did:key:abc'
};For more details, see the ucanto documentation.
