import { Network, AccountAddress, Signature, InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from '@endlesslab/endless-ts-sdk'; export type ColorMode = 'light' | 'dark'; export type EndlessWalletOptions = { colorMode?: ColorMode; network: Network; fullnode?: string; indexer?: string; walletUrl?: string; prover?: string; windowWidth?: number; }; export enum UserResponseStatus { APPROVED = 'Approved', REJECTED = 'Rejected' } export interface UserApproval { status: UserResponseStatus.APPROVED; args: TResponseArgs; } export interface UserRejection { status: UserResponseStatus.REJECTED; message?: string; } export type UserResponse = UserApproval | UserRejection; export interface AccountInfo { account: string; address: string; authKey: string; ansName?: string; } export interface NetworkInfo { name: Network; chainId: number; url?: string; } export type EndlessSignMessageInput = { // Should we include the address of the account in the message address?: boolean; // Should we include the domain of the dapp application?: boolean; // Should we include the current chain id the wallet is connected to chainId?: boolean; // The message to be signed and displayed to the user message: string; // A nonce the dapp should generate nonce: string; }; export type EndlessSignMessageOutput = { address?: string; application?: string; chainId?: number; fullMessage: string; publicKey: string; message: string; nonce: string; prefix: 'Endless::Message'; signature: Signature; }; export interface EndlessSignAndSubmitTransactionInput { payload: InputGenerateTransactionPayloadData; // the transaction payload options?: InputGenerateTransactionOptions; } export enum EndlessSendTransactionType { SIGNATURE_ONLY = 'signatureOnly', SIGN_AND_SUBMIT = 'signAndSubmit' } export enum EndlessWalletTransactionType { SIMPLE = 'simple', MULTI_AGENT = 'multiAgent' } declare global { interface Window { WeixinJSBridge: { invoke(api: string, data: any, callback: (res: any) => void): void; on(api: string, callback: (res: any) => void): void; } } }