
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@agentcommercekit/did
Advanced tools
DID (Decentralized Identifier) and DID document utilities with support for multiple DID methods.
DID (Decentralized Identifier) and DID document utilities with support for multiple DID methods.
This package is part of the Agent Commerce Kit.
npm i @agentcommercekit/did
# or
pnpm add @agentcommercekit/did
import { getDidResolver, resolveDid } from "@agentcommercekit/did"
import type { DidUri } from "@agentcommercekit/did"
// Create a resolver with support for did:web, did:key, and did:pkh methods
const resolver = getDidResolver()
// Resolve a DID
const { did, didDocument } = await resolveDid("did:web:example.com", resolver)
import { getDidResolver, resolveDidWithController } from "@agentcommercekit/did"
const resolver = getDidResolver()
// Resolve a DID and its controller
const { did, didDocument, controller } = await resolveDidWithController(
"did:web:example.com",
resolver
)
import {
createDidWebUri,
createDidKeyUri,
createDidPkhUri
} from "@agentcommercekit/did"
import { generateKeypair } from "@agentcommercekit/keys"
// Create a did:web URI from a domain or URL
const webDid = createDidWebUri("https://www.example.com")
// did:web:example.com
// Create a did:key URI from a keypair
const keypair = await generateKeypair("secp256k1")
const keyDid = createDidKeyUri(keypair)
// did:key:zQ3...
// Create a did:pkh URI from an address and chain ID
const pkhDid = createDidPkhUri(
"eip155:1",
"0x1234567890123456789012345678901234567890"
)
// did:pkh:eip155:1:0x1234567890123456789012345678901234567890
import { generateKeypair } from "@agentcommercekit/keys"
import {
createDidDocumentFromKeypair,
createDidWebDocumentFromKeypair
} from "@agentcommercekit/did"
const keypair = await generateKeypair("secp256k1")
// Create a DID document from a keypair
const did = createDidKeyUri(keypair)
const didDocument = createDidDocumentFromKeypair({
did,
keypair,
encoding: "jwk", // Optional, defaults to "jwk"
controller: "did:web:controller.example.com" // Optional
})
// Create a did:web and document with URI and document
const { did, didDocument } = createDidWebDocumentFromKeypair({
keypair,
baseUrl: "https://www.example.com",
controller: ownerDid
})
createDidWebUri(input: string | URL): DidWebUri
- Create a did:web URI from a domain or URLcreateDidKeyUri(keypair: Keypair): DidKeyUri
- Create a did:key URI from a keypaircreateDidPkhUri(chainId: DidPkhChainId, address: string): DidPkhUri
- Create a did:pkh URI from an address and chain IDgetDidResolver(options?: GetDidResolverOptions): DidResolver
- Create a resolver supporting multiple DID methodsresolveDid(didUri: string, resolver: Resolvable): Promise<DidUriWithDocument>
- Resolve a DID to its documentresolveDidWithController(didUri: string, resolver: Resolvable): Promise<DidUriWithControlledDidDocument>
- Resolve a DID and its controllercreateDidDocument(options: CreateDidDocumentOptions): DidDocument
- Create a generic DID documentcreateDidDocumentFromKeypair(options: CreateDidDocumentFromKeypairOptions): DidDocument
- Create a DID document from a keypaircreateDidWebDocument(options: CreateDidWebDocumentOptions): DidUriWithDocument
- Create a DidWebUri and associated document documentcreateDidPkhDocument(options: CreateDidPkhDocumentOptions): DidUriWithDocument
- Create a DidPkhUri and associated documentisDidUri(value: unknown): value is DidUri
- Check if a value is a valid DID URIisDidDocument(value: unknown): value is DidDocument
- Check if a value is a valid DID documentisDidDocumentForDid(didDocument: DidDocument, did: string): boolean
- Check if a document belongs to a DID// Zod v4 schemas
import { didUriSchema } from "@agentcommercekit/did/schemas/zod/v4"
// Zod v3 schemas
import { didUriSchema } from "@agentcommercekit/did/schemas/zod/v3"
// Valibot schemas
import { didUriSchema } from "@agentcommercekit/did/schemas/valibot"
Copyright (c) 2025 Catena Labs, Inc.
FAQs
DID (Decentralized Identifier) and DID document utilities with support for multiple DID methods.
The npm package @agentcommercekit/did receives a total of 558 weekly downloads. As such, @agentcommercekit/did popularity was classified as not popular.
We found that @agentcommercekit/did demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.