PHP WebShell
Текущая директория: /usr/lib/node_modules/bitgo/node_modules/viem/utils/signature
Просмотр файла: recoverAddress.ts
import type { Address } from 'abitype'
import { publicKeyToAddress } from '../../accounts/utils/publicKeyToAddress.js'
import type { ErrorType } from '../../errors/utils.js'
import type { ByteArray, Hex, Signature } from '../../types/misc.js'
import { recoverPublicKey } from './recoverPublicKey.js'
export type RecoverAddressParameters = {
hash: Hex | ByteArray
signature: Hex | ByteArray | Signature
}
export type RecoverAddressReturnType = Address
export type RecoverAddressErrorType = ErrorType
export async function recoverAddress({
hash,
signature,
}: RecoverAddressParameters): Promise<RecoverAddressReturnType> {
return publicKeyToAddress(await recoverPublicKey({ hash, signature }))
}
Выполнить команду
Для локальной разработки. Не используйте в интернете!