@gear-js/api
Version:
A JavaScript library that provides functionality to connect GEAR Component APIs.
12 lines (9 loc) • 321 B
JavaScript
import { Keyring } from '@polkadot/api';
import { u8aToHex } from '@polkadot/util';
function decodeAddress(publicKey) {
return u8aToHex(new Keyring().decodeAddress(publicKey));
}
function encodeAddress(publicKeyRaw) {
return new Keyring().encodeAddress(publicKeyRaw);
}
export { decodeAddress, encodeAddress };