Skip to content

createKeyPairFromPrivateKeyString in KeyPair return type Any #2

@cfcodefans

Description

@cfcodefans

function createKeyPairFromPrivateKeyString(privateKeyString) {
var privateKey = _convert2.default.hexToUint8(privateKeyString);
if (Key_Size !== privateKey.length) throw Error('private key has unexpected size: ' + privateKey.length);

var publicKey = catapult.crypto.extractPublicKey(privateKey, catapult.hash.func);
return { privateKey: privateKey, publicKey: publicKey };

}

I tried but failed to find a type definition for KeyPair as { privateKey: privateKey, publicKey: publicKey }
This is confusing, since java api does have
org.nem.core.crypto.KeyPair

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions