npm.io
11.0.1 • Published 10 months ago

@ucanto/interface

Licence
(Apache-2.0 AND MIT)
Version
11.0.1
Deps
2
Size
143 kB
Vulns
0
Weekly
0
Stars
62

@ucanto/interface

@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 ucanto modules.
  • Type Safety: Enhances reliability through TypeScript-based type checking.

How It Fits with Other Modules

For an overview and detailed usage information, refer to the main ucanto README.

Installation

npm install @ucanto/interface

Example Usage

import { Capability, Invocation } from '@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.

Keywords