@dapplets/dapplet-extension
Version:
The Bridge to the Augmented Web.
42 lines (41 loc) • 2 kB
TypeScript
import { NearNetworks, TConnectedAccountsVerificationRequestInfo } from '../../common/types';
interface IRequestVerificationProps {
firstAccountId: string;
firstOriginId: string;
firstAccountImage: string;
secondAccountId: string;
secondOriginId: string;
secondAccountImage: string;
isUnlink: boolean;
firstProofUrl?: string;
secondProofUrl?: string;
}
type AccountStatus = {
isMain: boolean;
};
type Account = {
id: string;
status: AccountStatus;
};
declare class ConnectedAccounts {
getConnectedAccounts(accountId: string, originId: string, closeness?: number, network?: NearNetworks): Promise<Account[][] | null>;
getMinStakeAmount(network?: NearNetworks): Promise<number>;
getPendingRequests(network?: NearNetworks): Promise<number[]>;
getVerificationRequest(id: number, network?: NearNetworks): Promise<TConnectedAccountsVerificationRequestInfo | null>;
getStatus(accountId: string, originId: string, network?: NearNetworks): Promise<boolean>;
getMainAccount(accountId: string, originId: string, network?: NearNetworks): Promise<string | null>;
getRequestStatus(id: number, network?: NearNetworks): Promise<'not found' | 'pending' | 'approved' | 'rejected'>;
areConnected(accountGId1: string, accountGId2: string, network?: NearNetworks): Promise<boolean>;
getNet(accountGId: string, network?: NearNetworks): Promise<string[] | null>;
requestVerification({ firstAccountId, firstOriginId, firstAccountImage, secondAccountId, secondOriginId, secondAccountImage, firstProofUrl, secondProofUrl, isUnlink, }: IRequestVerificationProps, condition: {
type: string;
[name: string]: string;
}, network?: NearNetworks): Promise<number>;
changeStatus({ accountId, originId, accountImage, isMain, }: {
accountId: string;
originId: string;
accountImage: string;
isMain: boolean;
}, network?: NearNetworks): Promise<void>;
}
export default ConnectedAccounts;