Skip to Content
SDK@solidus-network/types

@solidus-network/types

Tüm Solidus SDK paketlerinde kullanılan paylaşılan TypeScript tip tanımları. Bu paket hiçbir çalışma zamanı kodu içermez — yalnızca tip dışa aktarımları.

npm install @solidus-network/types
import type { DID, DIDDocument, VerifiableCredential, Challenge, VerificationSession, } from '@solidus-network/types'

DID Tipleri

did.ts içinde tanımlanan, Merkeziyetsiz Tanımlayıcılar (DID) için tipler.

DID

Zincir üzerinde saklanan temel DID kaydı.

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

Kimlik doğrulama ve imzalama için kullanılan, bir DID ile ilişkilendirilmiş açık anahtar.

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

W3C uyumlu tam DID belgesi.

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 }

Kimlik Bilgisi Tipleri

vc.ts içinde tanımlanan, Doğrulanabilir Kimlik Bilgileri için tipler.

KYCLevel

Tamamlanan KYC doğrulamasının derinliğini temsil eden sayısal seviye.

type KYCLevel = 0 | 1 | 2 | 3
SeviyeAnlamı
0Doğrulama yok
1Temel — e-posta ve telefon doğrulandı
2Standart — resmi kimlik doğrulandı
3Gelişmiş — kimlik + yüz eşleştirme + adres doğrulandı

VerificationStatus

Bir doğrulama sürecinin durumu.

type VerificationStatus = | 'pending' | 'processing' | 'completed' | 'failed' | 'expired'

CredentialProof

Doğrulanabilir bir kimlik bilgisine eklenen kriptografik kanıt.

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

Kriptografik kanıtlı bir W3C Doğrulanabilir Kimlik Bilgisi.

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

sdk.credentials.issue() aracılığıyla yeni bir kimlik bilgisi düzenlemek için parametreler.

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

sdk.credentials.verify() aracılığıyla bir kimlik bilgisini doğrulamanın sonucu.

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 } }

Kimlik Doğrulama Tipleri

auth.ts içinde tanımlanan, DID tabanlı kimlik doğrulama için tipler.

AuthResult

Bir kimlik doğrulama girişiminin sonucu.

interface AuthResult { valid: boolean did?: string // The authenticated DID claims?: Record<string, unknown> // Claims from the presentation error?: string // Error message if invalid }

Challenge

Süreli bir kimlik doğrulama meydan okuması.

interface Challenge { challenge: string // The nonce value domain: string // The domain that issued the challenge expiresAt: string // ISO 8601 expiration timestamp }

Verify Tipleri

verify.ts içinde tanımlanan, Verify (KYC) hizmeti için tipler.

SandboxOutcome

Sandbox/test modu için önceden tanımlanmış sonuç.

type SandboxOutcome = | 'pass' | 'fail' | 'timeout' | 'document_rejected'

VerificationSession

Bir KYC doğrulama oturumu.

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 }

SDK Metotlarıyla Kullanım

Bu tipler SDK boyunca kullanılır. Nasıl bağlandıkları aşağıdadır:

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(publicKeyHex) // 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)
Last updated on