> For the complete documentation index, see [llms.txt](https://suiverify.gitbook.io/suiverify/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://suiverify.gitbook.io/suiverify/suiverify-sdk/api-reference.md).

# API reference

https\://www\.npmjs.com/package/suiverify-sdk

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://suiverify.gitbook.io/suiverify/suiverify-sdk/api-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
