Commit 689b46ce authored by Will Cory's avatar Will Cory

fix(atst): return correct type for encodeRawKey

parent 43b47c22
import { ethers } from 'ethers' import { ethers } from 'ethers'
export const encodeRawKey = (rawKey: string) => { import { WagmiBytes } from '../types/WagmiBytes'
export const encodeRawKey = (rawKey: string): WagmiBytes => {
if (rawKey.length < 32) { if (rawKey.length < 32) {
return ethers.utils.formatBytes32String(rawKey) return ethers.utils.formatBytes32String(rawKey) as WagmiBytes
} }
const hash = ethers.utils.keccak256(ethers.utils.toUtf8Bytes(rawKey)) const hash = ethers.utils.keccak256(ethers.utils.toUtf8Bytes(rawKey))
return hash.slice(0, 64) + 'ff' return (hash.slice(0, 64) + 'ff') as WagmiBytes
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment