Socket
Socket
Sign inDemoInstall

@did-connect/types

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@did-connect/types

Type definition and validator for did-connect protocol


Version published
Weekly downloads
1.1K
decreased by-13.29%
Maintainers
1
Weekly downloads
 
Created
Source

styled with prettier docs Gitter

Overview

This package exist for 2 purposes:

  • Define core data structures and validators for DID Connect Protocol
  • Provide a set of utilities that are widely used in ArcBlock implementation of DID Connect Protocol

Core data structures includes:

  • DID Connect Request: a request to be fulfilled by DID Wallet
    • AgreementRequest
    • AssetRequest
    • AuthPrincipalRequest
    • PrepareTxRequest
    • ProfileRequest
    • SignatureRequest
    • VerifiableCredentialRequest;
  • DID Connect Response: a response sent from DID Wallet to fulfill a request
    • TAgreementResponse
    • TAssetResponse
    • TAuthPrincipalResponse
    • TPrepareTxResponse
    • TProfileResponse
    • TSignatureResponse
    • TVerifiableCredentialResponse;
  • DID Connect Session: the object that holds a running DID Connect session
  • DID Connect Context: the object that holds the context of a running DID Connect session

Other utilities includes:

  • AppInfo
  • ChainInfo
  • WalletInfo

Install

npm install @did-connect/types
// or
yarn add @did-connect/types

Usage

Using types:

import type { TProfileRequest } from '@did-connect/types';
const profile: TProfileRequest = {
  type: 'profile',
  description: 'Request user profile',
  items: ['fullName'],
};

Using validators:

import type { TProfileRequest } from '@did-connect/types';
import { ProfileRequest } from '@did-connect/types';

const { error, value } = ProfileRequest.validate({
  type: 'profile',
  description: 'Request user profile',
  items: ['fullName'],
});

Keywords

FAQs

Package last updated on 12 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc