From fdda1f081ada147c15d27ee5ad5d32a8716ef7df Mon Sep 17 00:00:00 2001 From: mmjee Date: Fri, 28 Apr 2023 16:51:56 +0530 Subject: [PATCH] WIP --- src/index.ts | 24 ++++++++++++++---------- src/typings.ts | 6 ++++++ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/index.ts b/src/index.ts index a79ac51..ac7a3d0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,35 +1,36 @@ import { ArcanaProvider } from './provider' import IframeWrapper from './iframeWrapper' import { - getErrorReporter, constructLoginUrl, - getCurrentUrl, getConstructorParams, - removeHexPrefix, + getCurrentUrl, + getErrorReporter, + getParamsFromClientId, + isClientId, preLoadIframe, + removeHexPrefix, validateAppAddress, - isClientId, - getParamsFromClientId, } from './utils' import { getNetworkConfig, getRpcConfig } from './config' import { AppConfig, AppMode, - ConstructorParams, ChainConfigInput, + ChainType, + ConstructorParams, + EthereumProvider, + InitStatus, + Logins, NetworkConfig, Position, RpcConfig, Theme, ThemeConfig, UserInfo, - InitStatus, - Logins, - EthereumProvider, WalletType, } from './typings' import { getAppInfo, getImageUrls } from './appInfo' -import { ErrorNotInitialized, ArcanaAuthError } from './errors' +import { ArcanaAuthError, ErrorNotInitialized } from './errors' import { LOG_LEVEL, setExceptionReporter, setLogLevel } from './logger' import { Chain } from './chainList' import Popup from './popup' @@ -319,6 +320,7 @@ class AuthProvider { ) this.appConfig = { name: appInfo.name, + chainType: ChainType.solana_cv25519, themeConfig: { assets: { logo: { @@ -395,8 +397,10 @@ export { Chain as CHAIN, EthereumProvider, AppConfig, + AppMode, Theme, Position, + ChainType, RpcConfig, Logins, UserInfo, diff --git a/src/typings.ts b/src/typings.ts index e6a0ec8..02371a9 100644 --- a/src/typings.ts +++ b/src/typings.ts @@ -75,6 +75,7 @@ export interface AppInfo { export interface AppConfig { name: string themeConfig: ThemeConfig + chainType: ChainType } export interface UserInfo { @@ -168,6 +169,11 @@ export enum AppMode { Full = 2, } +export enum ChainType { + evm_secp256k1, + solana_cv25519, +} + export const ModeWalletTypeRelation = { [WalletType.UI]: [AppMode.Widget, AppMode.Full], [WalletType.NoUI]: [AppMode.NoUI],