UNPKG

@luffalab/luffa-evm-sdk

Version:

luffa evm ts sdk

71 lines (61 loc) 1.41 kB
export enum Network { MAINNET = "mainnet", TESTNET = "testnet", ETH = 'eth', BSC = 'bsc', } export type IInitData = { colorMode?: 'light' | 'dark'; network: Network | string; fullnode?: string; indexer?: string; walletUrl?: string; prover?: string; callbackWalletName?: string; miniprogram?: Boolean; windowWidth?: number; }; export type ChainData = { targetNet: 'endless' | 'eds' | 'eth' | 'bsc' } export enum UserResponseStatus { APPROVED = 'Approved', REJECTED = 'Rejected' } export interface UserApproval<TResponseArgs> { status: UserResponseStatus.APPROVED; args: TResponseArgs; } export interface UserRejection { status: UserResponseStatus.REJECTED; message?: string; } export type UserResponse<TResponseArgs> = UserApproval<TResponseArgs> | UserRejection; export interface AccountInfo { account: string; address: string; authKey: string; ansName?: string; } export interface NetworkInfo { name: Network | string; chainId: number; url?: string; } declare global { var wx: any interface Window { wx: any, webkit: any WeixinJSBridge: { invoke(api: string, data: any, callback: (res: any) => void): void; on(api: string, callback: (res: any) => void): void; }, evmWallet?: { sendResponse: (response: any) => void; }, _evmWallet?: { sendMessage: (data: any) => void; } } }