laconic-wallet/types.ts
shreerang6921 63faa74e2c
Remove any type (#57)
* Remove any type for requestEvent parameter

* Handle review changes
2024-03-15 13:50:57 +05:30

120 lines
2.7 KiB
TypeScript

import { SignClientTypes, SessionTypes } from '@walletconnect/types';
import { Web3WalletTypes } from '@walletconnect/web3wallet';
export type StackParamsList = {
Laconic: undefined;
SignMessage: { selectedNetwork: string; accountInfo: Account } | undefined;
SignRequest:
| {
network: string;
address: string;
message: string;
requestEvent?: Web3WalletTypes.SessionRequest;
requestSession?: any;
}
| undefined;
InvalidPath: undefined;
WalletConnect: undefined;
AddSession: undefined;
};
export type Account = {
counterId: number;
pubKey: string;
address: string;
hdPath: string;
};
export type WalletDetails = {
mnemonic: string;
ethAccounts: Account | undefined;
cosmosAccounts: Account | undefined;
};
export type AccountsProps = {
network: string;
currentIndex: number;
updateIndex: (index: number) => void;
};
export type NetworkDropdownProps = {
selectedNetwork: string;
updateNetwork: (network: string) => void;
};
export type AccountsState = {
ethAccounts: Account[];
cosmosAccounts: Account[];
};
export type SignMessageParams = {
message: string;
network: string;
accountId: number;
};
export type CreateWalletProps = {
isWalletCreating: boolean;
createWalletHandler: () => Promise<void>;
};
export type ResetDialogProps = {
visible: boolean;
hideDialog: () => void;
onConfirm: () => void;
};
export type HDPathDialogProps = {
pathCode: string;
visible: boolean;
hideDialog: () => void;
updateIndex: (index: number) => void;
updateAccounts: (account: Account) => void;
};
export type CustomDialogProps = {
visible: boolean;
hideDialog: () => void;
contentText: string;
titleText?: string;
};
export type GridViewProps = {
words: string[];
};
export type PathState = {
firstNumber: string;
secondNumber: string;
thirdNumber: string;
};
export interface PairingModalProps {
visible: boolean;
setModalVisible: (arg1: boolean) => void;
currentProposal:
| SignClientTypes.EventArguments['session_proposal']
| undefined;
setCurrentProposal: (
arg1: SignClientTypes.EventArguments['session_proposal'] | undefined,
) => void;
setToastVisible: (arg1: boolean) => void;
}
export interface SignModalProps {
visible: boolean;
setModalVisible: (arg1: boolean) => void;
requestSession: any;
requestEvent: SignClientTypes.EventArguments['session_request'] | undefined;
currentEthAddresses: string[];
}
export interface WalletConnectContextProps {
requestSession: any;
setRequestSession: (requestSession: any) => void;
activeSessions: Record<string, SessionTypes.Struct>;
setActiveSessions: (
activeSessions: Record<string, SessionTypes.Struct>,
) => void;
}