# API reference

Constructor Options

```typescript
typescriptinterface SDKConfig {
suiClient: SuiClient; // Sui blockchain client
network: 'testnet' | 'mainnet'; // Network to use
enclaveId?: string; // Optional: specific enclave
cacheResults?: boolean; // Enable result caching
cacheTTL?: number; // Cache time-to-live in seconds
}
Core Methods
typescriptclass SuiVerifySDK {
// Basic verification
async verifyDIDNFT(nftId: string): Promise<boolean>

// Detailed verification with metadata
async verifyDIDNFTWithDetails(nftId: string): Promise<VerificationResult>

// Batch verification
async verifyBatch(nftIds: string[]): Promise<VerificationResult[]>

// Get NFT metadata without verification
async getNFTMetadata(nftId: string): Promise<NFTMetadata>

// Verify raw signature (advanced)
async verifySignature(
signature: Uint8Array,
message: Uint8Array,
publicKey: Uint8Array
): Promise<boolean>
}
Response Types
typescriptinterface VerificationResult {
isValid: boolean;
metadata?: {
owner: string;
didType: string;
verifiedAt: Date;
evidenceHash: string;
nautilusSignature: string;
};
error?: string;
}

interface NFTMetadata {
id: string;
owner: string;
didType: number;
verificationStatus: string;
createdAt: Date;
evidenceHash: string;
}
```

\
**Integration Examples**

```typescript
async function checkUserVerification(userAddress: string) {
const nfts = await sdk.getUserDIDNFTs(userAddress);

for (const nft of nfts) {
const result = await sdk.verifyDIDNFTWithDetails(
nft.id
);

if (result.isValid && result.metadata.didType === 'aadhaar') {
return {
verified: true,
level: 'government_id',
verifiedAt: result.metadata.verifiedAt
};
}
}

return { verified: false };
}
Gaming Protocol Integration
typescript// Verify player identity for tournament entry
async function verifyPlayerForTournament(playerId: string, nftId: string) {
const verification = await sdk.verifyDIDNFTWithDetails(nftId);

if (!verification.isValid) {
throw new Error('Invalid identity verification');
}

if (verification.metadata.owner !== playerId) {
throw new Error('NFT does not belong to player');
}

// Player is verified and owns the NFT
return {
eligible: true,
verificationLevel: verification.metadata.didType
};
}
```

\
\
How It Works Under the Hood\
\
The Verification Process

1. Fetch NFT Data: SDK retrieves the DID NFT from Sui blockchain
2. Extract Metadata: Pulls out signature, timestamp, evidence hash, and owner
3. Reconstruct Message: Recreates the exact message structure Nautilus signed
4. Serialize: Uses BCS serialization (same as Nautilus)
5. Get Public Key: Fetches enclave's public key from blockchain
6. Verify: Uses Ed25519 to verify signature matches message + public key

Security Guarantees\
1\. Cryptographic Proof: Ed25519 signatures are cryptographically secure\
2\. Tamper-Proof: Any modification to NFT data breaks signature verification\
3\. On-Chain Verification: Public keys stored on-chain, verifiable by anyone\
4\. Deterministic: Same inputs always produce same verification result
