@didtools/pkh-ethereum
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -5,2 +5,3 @@ import { Cacao, SiweMessage } from '@didtools/cacao'; | ||
import { safeSend, normalizeAccountId } from './utils.js'; | ||
import * as u8a from 'uint8arrays'; | ||
/** | ||
@@ -12,2 +13,5 @@ * SIWX Version | ||
*/ export const CHAIN_NAMESPACE = 'eip155'; | ||
function encodeHexStr(str) { | ||
return `0x${u8a.toString(u8a.fromString(str, 'utf8'), 'base16')}`; | ||
} | ||
export var EthereumWebAuth; | ||
@@ -53,3 +57,3 @@ (function(EthereumWebAuth) { | ||
const signature = await safeSend(ethProvider, 'personal_sign', [ | ||
siweMessage.signMessage(), | ||
encodeHexStr(siweMessage.signMessage()), | ||
normAccount.address | ||
@@ -56,0 +60,0 @@ ]); |
{ | ||
"name": "@didtools/pkh-ethereum", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"author": "3Box Labs", | ||
@@ -40,3 +40,4 @@ "license": "(Apache-2.0 OR MIT)", | ||
"@stablelib/random": "^1.0.2", | ||
"caip": "^1.1.0" | ||
"caip": "^1.1.0", | ||
"uint8arrays": "^4.0.3" | ||
}, | ||
@@ -43,0 +44,0 @@ "scripts": { |
19315
405
5
+ Addeduint8arrays@^4.0.3