UNPKG

@dfinity/oisy-wallet-signer

Version:

A library designed to facilitate communication between a dApp and the OISY Wallet on the Internet Computer.

53 lines (52 loc) 2.32 kB
import { type Identity } from '@dfinity/agent'; import * as z from 'zod'; declare const IdentityNotAnonymousSchema: z.ZodEffects<z.ZodType<Identity, z.ZodTypeDef, Identity>, Identity, Identity>; export type IdentityNotAnonymous = z.infer<typeof IdentityNotAnonymousSchema>; export declare const SignerHostSchema: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>; export type SignerHost = z.infer<typeof SignerHostSchema>; export declare const SignerOptionsSchema: z.ZodObject<{ /** * The owner who interacts with the signer. * * When the signer is initialized, the owner should be signed in to the consumer dApp. * Upon signing out, it is up to the consumer to disconnect the signer. */ owner: z.ZodEffects<z.ZodType<Identity, z.ZodTypeDef, Identity>, Identity, Identity>; /** * The replica's host to which the signer should connect to. * If localhost or 127.0.0.1 are provided, the signer will automatically connect to a local replica and fetch the root key for the agent. */ host: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>; /** * Options for managing session behavior, including session expiration times. */ sessionOptions: z.ZodOptional<z.ZodObject<{ /** * Specifies the duration in milliseconds for which the session permissions are valid. * After this period, the user is requested to approve or deny permissions again. * Must be a positive number. * * @default 7 days (7 * 24 * 60 * 60 * 1000 = 604800000 milliseconds) * */ sessionPermissionExpirationInMilliseconds: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { sessionPermissionExpirationInMilliseconds?: number | undefined; }, { sessionPermissionExpirationInMilliseconds?: number | undefined; }>>; }, "strip", z.ZodTypeAny, { owner: Identity; host?: string | undefined; sessionOptions?: { sessionPermissionExpirationInMilliseconds?: number | undefined; } | undefined; }, { owner: Identity; host?: string | undefined; sessionOptions?: { sessionPermissionExpirationInMilliseconds?: number | undefined; } | undefined; }>; export type SignerOptions = z.infer<typeof SignerOptionsSchema>; export {};