/******************************************************************************
*
* (C) 2022 AhnLab Blockchain Company, Inc. All rights reserved.
* Any part of this source code can not be copied with any method without
* prior written permission from the author or authorized person.
*
******************************************************************************/
///
import EventEmitter from 'events';
import { AbcAuth, GetNewSessionJwtRes, RegisterUserResult, RestAddAccountDto, SaveKeyGenResultDto, UserModel, VerifySelfSign } from '../../../main/accounts/interface';
import { GetChallengeMessageDto, TwofaGenVerifyDto, TwofaResetDto, TwofaVerifyMpcDto, UnlockDto } from '../../../schema/account';
import { AbcLoginResult } from '../../../main/abc/interface';
export declare class AccountRestApi extends EventEmitter {
getNewSessionJwt: (accessToken: string) => Promise;
registerUser: () => Promise;
saveKeyGenResult: (dto: SaveKeyGenResultDto, abcAuth: AbcAuth) => Promise<{
user: UserModel;
wallet: any;
accessToken: any;
expiresIn: any;
}>;
addAccount: (dto: RestAddAccountDto) => Promise;
generateTwoFactor: (dto: {
reset: boolean;
}) => Promise<{
qrcode?: string;
secret?: string;
}>;
getTwofaResetcode: () => Promise<{
twofaResetcode?: string;
}>;
verifyTwofactorGen: (dto: TwofaGenVerifyDto) => Promise<{
twofaResetCode?: string;
user?: {
uid?: string;
wid?: number;
email?: string;
abcUid?: string;
accounts?: {
id?: number;
sid?: string;
ethAddress?: string;
pubkey?: string;
icon?: string;
name?: string;
signer?: string;
}[];
favorites?: {
id?: string;
chainId?: number;
address?: string;
nickname?: string;
created?: string;
}[];
autoconfirms?: {
contractAddress?: string;
chainId?: number;
funcHash?: string;
funcName?: string;
domainName?: string;
created?: string;
}[];
twoFactorEnabled?: boolean;
twoFactorFreezeEndTime?: number;
twoFactorResetRetryCount?: number;
twoFactorRetryFreezeEndTime?: number;
tempTwoFactorSecret?: string;
twoFactorSecret?: string;
twoFAResetCode?: string;
};
}>;
verifyTwoFactorResetGenVerify: (dto: any) => Promise;
verifyTwofactor: (token: string) => Promise<{
verified: boolean;
}>;
verifyTwofactorForMpcSign: (dto: TwofaVerifyMpcDto) => Promise<{
mpcToken?: string;
}>;
resetTwofactor: (dto: TwofaResetDto) => Promise;
disableTwoFactor: () => Promise;
unlock: (dto: UnlockDto) => Promise<{
accessToken?: string;
expiresIn?: string;
}>;
verifySelfSign: (dto: VerifySelfSign) => Promise<{
accessToken: string;
expiresIn: string;
}>;
getChallengeMessage: (dto: GetChallengeMessageDto) => Promise;
getUser: () => Promise<{
user: UserModel;
}>;
getUIdAndWIdWithSId: (dto: any) => Promise<{
uid: string;
wid: string;
}>;
fetchUserAndAccessTokenWithSid: (dto: any) => Promise<{
accessToken: string;
user: UserModel;
expiresIn: string;
}>;
updateAccountName: (dto: any) => Promise<{
user: UserModel;
}>;
getWalletsAndUserByAbcUid: (abcAuth: AbcLoginResult) => Promise<{
user: any;
wallets: any;
}>;
recover: (dto: any) => Promise;
coingeckoSimplePrice: ({ ids, vsCurrencies, }: {
ids: string;
vsCurrencies: string;
}) => Promise;
}
export interface CoingeckoSimplePriceResponse {
[key: string]: {
usd: number;
krw: number;
jpy: number;
};
}