pkp-either-signer
v5.7.16
Published
PKP Signer for ethers.
Downloads
39
Maintainers
Readme
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);