mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-24 17:53:20 +00:00
19 lines
696 B
TypeScript
19 lines
696 B
TypeScript
import { type RoboidentitiesClient } from '../type';
|
|
import { generate_roboname } from 'robo-identities-wasm';
|
|
import { robohash } from './RobohashGenerator';
|
|
|
|
class RoboidentitiesClientWebClient implements RoboidentitiesClient {
|
|
public generateRoboname: (initialString: string) => Promise<string> = async (initialString) => {
|
|
return new Promise<string>(async (resolve, _reject) => {
|
|
resolve(generate_roboname(initialString));
|
|
});
|
|
};
|
|
|
|
public generateRobohash: (initialString: string, size: 'small' | 'large') => Promise<string> =
|
|
async (initialString, size) => {
|
|
return robohash.generate(initialString, size);
|
|
};
|
|
}
|
|
|
|
export default RoboidentitiesClientWebClient;
|