@unique-nft/api
Version:
Definitely typed JS API for the Unique Network blockchain
13 lines (11 loc) • 491 B
text/typescript
import {KeypairType, KeyringOptions, Prefix} from "../types";
import {getPolkadotKeyring} from "../libs";
export const keyringFromSeed = (seed: string, keypairType: KeypairType = 'sr25519', ss58Format: Prefix = 42) => {
const keyring = createKeyring({type: keypairType, ss58Format})
return keyring.addFromUri(seed);
}
export const createKeyring = (options?: KeyringOptions) => {
const {Keyring} = getPolkadotKeyring()
return new Keyring(options);
}
export {KeypairType}