WalletManagement
The WalletManagement is a tool that helps you handle Ethereum wallets. With it, you can make a new wallet, bring in a wallet you already have, get back a wallet if you lost it, or delete your wallet.
How To Use
Import the Wallet Service:
import Wallet from '@sdk/src/services/Wallet';
import { IStorage } from '@sdk/src/services/interfaces/IStorage';Initialize the wallet and custom storage:
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);
}
}
const storage = new SecureStorage();
const wallet = Wallet.create('YOUR_AUTH_SERVER_BASE_URL', storage);
const walletManagement = wallet.walletManagement;Examples:
Wallet Creation
Wallet Import
Wallet Recovery
Wallet Deletion
Create Biometric Token
Associated Interface
IWalletManagementLast updated