UNPKG

@didtools/pkh-ethereum

Version:

Implements support to authenticate, authorize and verify with Ethereum accounts as a did:pkh with SIWE(X) and CACAO. Primarly used with `did-session` and `@didtools/cacao`.

27 lines (26 loc) 947 B
import { AuthMethod } from '@didtools/cacao'; import { AccountId } from 'caip'; /** * SIWX Version */ export declare const VERSION = "1"; /** * CAIP2 for ethereum, used in CAIP10 (acountId) */ export declare const CHAIN_NAMESPACE = "eip155"; export declare namespace EthereumWebAuth { /** * Get a configured authMethod for an Ethereum account in a web based environment */ function getAuthMethod(ethProvider: any, account: AccountId): Promise<AuthMethod>; } export declare namespace EthereumNodeAuth { /** * Get a configured authMethod for an Ethereum account in a Node based environment */ function getAuthMethod(ethProvider: any, account: AccountId, appName: string): Promise<AuthMethod>; } /** * Helper function to get an accountId (CAIP10) for an Ethereum account, uses ethProvider to get chainId/network */ export declare function getAccountId(ethProvider: any, address: string): Promise<AccountId>;