Module kaspa_wasm::keypair

source ·
Expand description

keypair module encapsulates Keypair and PrivateKey. The Keypair provides access to the secret and public keys.


let keypair = Keypair.random();
let privateKey = keypair.privateKey;
let publicKey = keypair.publicKey;

// to obtain an address from a keypair
let address = keypair.toAddress(NetworkType.Mainnnet);

// to obtain a keypair from a private key
let keypair = privateKey.toKeypair();

Structs§