UNPKG

@polkadot/keyring

Version:
9 lines (8 loc) 306 B
import { objectSpread } from '@polkadot/util'; import { jsonEncryptFormat } from '@polkadot/util-crypto'; export function pairToJson(type, { address, meta }, encoded, isEncrypted) { return objectSpread(jsonEncryptFormat(encoded, ['pkcs8', type], isEncrypted), { address, meta }); }