pkp-either-signer
TypeScript icon, indicating that this package has built-in type declarations

5.7.16 • Public • Published

PKP Wallet Signer

Install

yarn add pkp-either-signer ethers

Then

import { PKPWallet } from 'pkp-either-signer';

const PKP_PUBKEY = '{YOUR PKP UNCOMPRESSED PUBLIC KEY}';

const CONTROLLER_AUTHSIG = await LitJsSdk.checkAndSignAuthMessage({ chain: 'mumbai' });

const pkpWallet = new PKPWallet({
    pkpPubKey: PKP_PUBKEY,
    controllerAuthSig: CONTROLLER_AUTHSIG,
    provider: "https://matic-mumbai.chainstacklabs.com",
});

await pkpWallet.init();

const tx = {
    to: "0x1cD4147AF045AdCADe6eAC4883b9310FD286d95a",
    value: 0,
};

// -- Sign Transaction
const signedTx = await pkpWallet.signTransaction(tx);
console.log('signedTx:', signedTx);

// -- Send Transaction
// const sentTx = await pkpWallet.sendTransaction(signedTx);
// console.log("sentTx:", sentTx);

// -- Sign Message
const signedMsg = await pkpWallet.signMessage("Secret Message.. shh!");
console.log('signedMsg:', signedMsg);

Dependents (0)

Package Sidebar

Install

npm i pkp-either-signer

Weekly Downloads

4

Version

5.7.16

License

MIT

Unpacked Size

110 kB

Total Files

28

Last publish

Collaborators

  • websaam