Skip to content

Commit

Permalink
Merge pull request #424 from LIT-Protocol/fix/prefix-0x-to-pkp-pubkey
Browse files Browse the repository at this point in the history
feat(lit-node-client-nodejs): prefix 0x to pkp pubkey if not present
  • Loading branch information
Ansonhkg authored Apr 15, 2024
2 parents 597f00d + 95ab5d5 commit f6018a9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2474,7 +2474,12 @@ export class LitNodeClientNodeJs

// Compute the address from the public key if it's provided. Otherwise, the node will compute it.
const pkpEthAddress = (function () {
if (params.pkpPublicKey) return computeAddress(params.pkpPublicKey);
if (params.pkpPublicKey) {
// prefix '0x' if it's not already prefixed
const hexedPkpPublicKey = hexPrefixed(params.pkpPublicKey);

if (hexedPkpPublicKey) return computeAddress(hexedPkpPublicKey);
}

// This will be populated by the node, using dummy value for now.
return '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2';
Expand Down

0 comments on commit f6018a9

Please sign in to comment.