UNPKG

@didtools/pkh-tezos

Version:

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

36 lines (35 loc) 1.42 kB
import { AccountId } from 'caip'; import { AuthMethod } from '@didtools/cacao'; export declare const TEZOS_MAINNET_CHAIN_REF = "NetXdQprcVkpaWU"; export declare const TEZOS_DEVNET_CHAIN_REF = "NetXm8tYqnMWky1"; export declare const VERSION = "1"; export declare const CHAIN_NAMESPACE = "tezos"; export declare const chainIdMap: { mainnet: string; devnet: string; }; type TezosNetwork = 'mainnet' | 'devnet'; export declare namespace TezosWebAuth { function getAuthMethod(tzProvider: any, account: AccountId): Promise<AuthMethod>; } export type SupportedProvider = { requestSignPayload: (opts: { signingType: string; payload: string; }) => Promise<{ signature: string; }>; getActiveAccount: () => Promise<{ network: { type: TezosNetwork; }; publicKey: string; }>; }; export declare function assertSupportedProvider(tzProvider: any): asserts tzProvider is SupportedProvider; export declare function assertSupportedConnection(tzProvider: any): asserts tzProvider is SupportedProvider; export declare function requestChainId(tzProvider: any): Promise<string>; export declare function getAccountId(tzProvider: any, address: string): Promise<AccountId>; export declare function getAccountIdByNetwork(network: TezosNetwork, address: string): AccountId; export declare function getPublicKey(tzProvider: any): Promise<string>; export {};