π₯οΈSample Code
Demo Application
Importing Classes
import Wallet from 'didpass-wallet-sdk';Creating a Wallet Instance
const authServerBaseUrl: string = "YOUR_AUTH_SERVER_BASE_URL";
const storage: IStorage = // Your implementation of the IStorage interface
const wallet: Wallet = Wallet.create(authServerBaseUrl, storage);import { IStorage } from 'didpass-wallet-sdk';
class SecureStorage implements IStorage {
async get<T>(key: string): Promise<T | null> {
const result = await SecureStore.getItemAsync(key);
if (result) {
return JSON.parse(result) as T;
} else {
return null;
}
}
async set<T>(key: string, value: T): Promise<void> {
await SecureStore.setItemAsync(key, JSON.stringify(value));
}
async remove(key: string): Promise<void> {
await SecureStore.deleteItemAsync(key);
}
}Wallet Creation
Wallet Import
Wallet Recovery
Wallet Deletion
Last updated