@solidus-network/types
Shared TypeScript type definitions used across all Solidus SDK packages. This package contains no runtime code — only type exports.
npm install @solidus-network/typesimport type {
DID,
DIDDocument,
VerifiableCredential,
Challenge,
VerificationSession,
} from '@solidus-network/types'DID Types
Types for Decentralized Identifiers, defined in did.ts.
DID
Core DID record stored on-chain.
interface DID {
id: string // e.g. "did:solidus:testnet:7Kf9xB2..."
controller: string // DID of the controller (usually same as id)
created: string // ISO 8601 creation timestamp
updated: string // ISO 8601 last-update timestamp
network: string // "testnet" or "mainnet"
}VerificationMethod
A public key associated with a DID, used for authentication and signing.
interface VerificationMethod {
id: string // e.g. "did:solidus:testnet:7Kf9...#key-1"
type: 'Ed25519VerificationKey2020'
controller: string // The DID that controls this key
publicKeyMultibase: string // Multibase-encoded Ed25519 public key
}DIDDocument
The full W3C-compliant DID document.
interface DIDDocument {
'@context': string | string[]
id: string // The DID
verificationMethod: VerificationMethod[] // Public keys
authentication: string[] // Key refs for authentication
assertionMethod: string[] // Key refs for signing credentials
}Credential Types
Types for Verifiable Credentials, defined in vc.ts.
KYCLevel
Numeric level representing the depth of KYC verification completed.
type KYCLevel = 0 | 1 | 2 | 3| Level | Meaning |
|---|---|
| 0 | No verification |
| 1 | Basic — email and phone verified |
| 2 | Standard — government ID verified |
| 3 | Enhanced — ID + face match + address verified |
VerificationStatus
Status of a verification process.
type VerificationStatus =
| 'pending'
| 'processing'
| 'completed'
| 'failed'
| 'expired'CredentialProof
Cryptographic proof attached to a verifiable credential.
interface CredentialProof {
type: 'Ed25519Signature2020'
created: string // ISO 8601 timestamp
verificationMethod: string // DID key reference (e.g. "did:solidus:...#key-1")
proofPurpose: string // "assertionMethod" for credentials
proofValue: string // Base58-encoded Ed25519 signature
}VerifiableCredential
A W3C Verifiable Credential with a cryptographic proof.
interface VerifiableCredential {
'@context': string | string[]
id: string // URN UUID (e.g. "urn:uuid:a1b2c3d4-...")
type: string[] // e.g. ["VerifiableCredential", "KYCCredential"]
issuer: string // Issuer DID
issuanceDate: string // ISO 8601 timestamp
expirationDate?: string // ISO 8601 timestamp (optional)
credentialSubject: Record<string, unknown> // The claims
proof: CredentialProof // Cryptographic proof
}IssueCredentialParams
Parameters for issuing a new credential via sdk.credentials.issue().
interface IssueCredentialParams {
subjectDid: string // DID of the credential subject
issuerDid: string // DID of the issuer
issuerPrivateKey: string // Hex-encoded Ed25519 private key
type: string[] // Credential types
claims: Record<string, unknown> // Claims to include
expiresInDays?: number // Days until expiration
network?: string // Network override
}VerificationResult
Result of verifying a credential via sdk.credentials.verify().
interface VerificationResult {
valid: boolean // Overall validity
credentialId?: string // The credential ID if resolved
error?: string // Error message if invalid
checks: {
signature: boolean // Ed25519 signature is valid
expiry: boolean // Credential has not expired
revocation: boolean // Credential has not been revoked
}
}Auth Types
Types for DID-based authentication, defined in auth.ts.
AuthResult
Result of an authentication attempt.
interface AuthResult {
valid: boolean
did?: string // The authenticated DID
claims?: Record<string, unknown> // Claims from the presentation
error?: string // Error message if invalid
}Challenge
A time-limited authentication challenge.
interface Challenge {
challenge: string // The nonce value
domain: string // The domain that issued the challenge
expiresAt: string // ISO 8601 expiration timestamp
}Verify Types
Types for the Verify (KYC) service, defined in verify.ts.
SandboxOutcome
Predefined outcome for sandbox/testing mode.
type SandboxOutcome =
| 'pass'
| 'fail'
| 'timeout'
| 'document_rejected'VerificationSession
A KYC verification session.
interface VerificationSession {
id: string // Session UUID
organizationId: string // Organization that created the session
subjectDid?: string // DID of the person being verified (set after linking)
level: KYCLevel // Required verification level
status: VerificationStatus // Current status
credentialId?: string // Credential ID (set after successful verification)
sandbox: boolean // Whether this is a sandbox session
sandboxOutcome?: SandboxOutcome // Forced outcome for sandbox sessions
createdAt: string // ISO 8601 creation timestamp
updatedAt: string // ISO 8601 last-update timestamp
}Usage with SDK Methods
These types are used throughout the SDK. Here is how they connect:
import { createSdk } from '@solidus-network/sdk'
import type {
DIDDocument,
VerifiableCredential,
VerificationResult,
} from '@solidus-network/types'
const sdk = createSdk({ mode: 'testnet', chain: { /* ... */ } })
// did.create returns DIDDocument
const doc: DIDDocument = await sdk.did.create({
publicKey: new Uint8Array(32),
})
// credentials.issue returns VerifiableCredential
const cred: VerifiableCredential = await sdk.credentials.issue({
subjectDid: doc.id,
issuerDid: 'did:solidus:testnet:issuer',
issuerPrivateKey: '0x...',
type: ['VerifiableCredential'],
claims: { verified: true },
})
// credentials.verify returns VerificationResult
const result: VerificationResult = await sdk.credentials.verify(cred)