UNPKG

@make-software/csprclick-core-types

Version:

Typescript definitions for CSPR.click core packages

126 lines (125 loc) 3.28 kB
import { JsonTypes } from 'typedjson'; import { AccountType } from './account'; export type MESSAGES = string; export declare const MESSAGES: { CORE_LOADED: string; REQUEST_CONNECTION: string; CONNECTED_ACCOUNT: string; DISCONNECTED_SITE: string; KNOWN_ACCOUNTS: string; FORGET_ACCOUNT: string; WEB_TOKEN_ISSUED: string; PROXY_UI_EVENT: string; TKEY_NEW_ACCOUNT_WITH_JWT: string; TKEY_NEW_SESSION_WITH_JWT: string; TKEY_RESTORE_SESSION: string; TKEY_SIGN_NETWORK_TRANSACTION: string; TKEY_SIGN_MESSAGE: string; TKEY_CANCEL_SIGN_REQUEST: string; TKEY_UNLOCK_ACCOUNT: string; TKEY_SAVE_UNLOCK_PIN: string; TKEY_IS_UNLOCKED: string; TKEY_DOWNLOAD_PEM_FILE: string; TKEY_NEW_RECOVERY_PHRASE: string; TKEY_UNLOCK_WITH_RECOVERY_PHRASE: string; TKEY_DISCONNECT: string; TKEY_PASSWORD_REQUIRED: string; SL_GET_TOKEN: string; }; export type ClickMessage = { origin: string; action: MESSAGES; }; export type CoreLoadedMessage = { version: string; appOrigin: string; } & ClickMessage; export type RequestConnectionMessage = { provider: string; providerAction: JsonTypes; } & ClickMessage; export type ConnectedAccountMessage = { provider: string; account: AccountType; } & ClickMessage; export type DisconnectedSiteMessage = { provider: string; } & ClickMessage; export type KnownAccountsMessage = { accounts: AccountType[]; } & ClickMessage; export type ForgetAccountMessage = { account: AccountType; } & ClickMessage; export type WebTokenIssuedMessage = { account: AccountType; token: string; } & ClickMessage; export type ProxyUIEventMessage = { provider: string | undefined; event: string; data: any; } & ClickMessage; export type TKeyCreateAccountMessage = { verifierDetails: string; token: string; unlockPin?: string; createDeviceShare?: boolean; connected?: boolean; publicKey?: string; }; export type TKeyConnectMessage = { verifierDetails: string; token: string; connected?: boolean; sessionExpired?: boolean; }; export type TKeySignTransactionMessage = { deploy: object | null; transaction: object | null; signatureHex?: string; signingKey: string; cancelled?: boolean; timeout?: boolean; }; export type TKeyCancelSignatureRequestMessage = { deployHash: string; }; export type TKeySignMessageMessage = { message: string; signatureHex?: string; signingKey: string; cancelled?: boolean; timeout?: boolean; }; export type TKeyUnlockAccountMessage = { unlockPin?: string; trustDevice?: boolean; }; export type TKeySaveUnlockPinMessage = { unlockPin?: string; }; export type TKeyIsUnlockedMessage = { publicKey: string; unlocked?: boolean; }; export type TKeyDownloadPemFileMessage = { unlockPin?: string; publicKey: string; }; export type TKeyNewRecoveryPhraseMessage = { unlockPin?: string; publicKey: string; newRecoveryPhrase?: string; }; export type TKeyUnlockWithRecoveryPhraseMessage = { recoveryPhrase: string; publicKey: string; }; export type TKeyDisconnectMessage = { publicKey: string; }; export type SLGetTokenMessage = { openidProvider: string; publicKey?: string; };