@ceramicnetwork/blockchain-utils-linking
Version:
Blockchain utils for linking blockchain accounts to DID
28 lines • 1.39 kB
TypeScript
import { AuthProvider } from './auth-provider.js';
import { AccountId } from 'caip';
import { CapabilityOpts, LinkProof } from './util.js';
import { StreamID } from '@ceramicnetwork/streamid';
import { Cacao } from '@didtools/cacao';
declare type EthProviderOpts = {
eoaSignAccount?: string;
};
export declare class EthereumAuthProvider implements AuthProvider {
private readonly provider;
private readonly address;
private readonly opts;
readonly isAuthProvider = true;
private _accountId;
constructor(provider: any, address: string, opts?: EthProviderOpts);
accountId(): Promise<AccountId>;
authenticate(message: string): Promise<string>;
createLink(did: string): Promise<LinkProof>;
requestCapability(sessionDID: string, streams: Array<StreamID | string>, opts?: CapabilityOpts): Promise<Cacao>;
withAddress(address: string): AuthProvider;
}
export declare function isEthAddress(address: string): boolean;
export declare function isERC1271(account: AccountId, provider: any): Promise<boolean>;
export declare function normalizeAccountId(input: AccountId): AccountId;
export declare function createLink(did: string, account: AccountId, provider: any, opts: any): Promise<LinkProof>;
export declare function authenticate(message: string, account: AccountId, provider: any): Promise<string>;
export {};
//# sourceMappingURL=ethereum.d.ts.map